@openscout/scout 0.2.94 → 0.2.96

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 (362) hide show
  1. package/NOTICE +14 -0
  2. package/README.md +164 -342
  3. package/bin/scout +26 -10
  4. package/bin/scoutd +0 -0
  5. package/dist/build-manifest.json +3 -3
  6. package/dist/client/assets/{ActivityScreen--eANwuxa.js → ActivityScreen-BnoaUkVZ.js} +1 -1
  7. package/dist/client/assets/{AddProjectForm-CcD6qvV8.js → AddProjectForm-IqOtJfRs.js} +1 -1
  8. package/dist/client/assets/{AgentAvatar-CYhf6twS.js → AgentAvatar-6-KBVKUu.js} +1 -1
  9. package/dist/client/assets/{AgentConfigurationScreen-BTI24HQX.js → AgentConfigurationScreen-CuZJy07q.js} +1 -1
  10. package/dist/client/assets/{AgentDefinitionsWorkspace-srmN6-vj.js → AgentDefinitionsWorkspace-Iyl4BesU.js} +1 -1
  11. package/dist/client/assets/{AgentDetailCard-UqPNpcvB.js → AgentDetailCard-C9rn3Fj5.js} +1 -1
  12. package/dist/client/assets/{AgentFloorView-XXNgI5Cj.js → AgentFloorView-YT-Jjccf.js} +1 -1
  13. package/dist/client/assets/{AgentInfoScreen-CimdOnZ9.js → AgentInfoScreen-Dr99gQEZ.js} +1 -1
  14. package/dist/client/assets/{AgentLaneCard-Z-aOBR3W.js → AgentLaneCard-DI2iW9zO.js} +1 -1
  15. package/dist/client/assets/{AgentLaneChrome-CyhA1reW.js → AgentLaneChrome-D8bARHMx.js} +1 -1
  16. package/dist/client/assets/{AgentLaneDetailSheet-BNzjMjIH.js → AgentLaneDetailSheet-52un7dKC.js} +1 -1
  17. package/dist/client/assets/{AgentLaneSummaryResize-Box8-_rS.js → AgentLaneSummaryResize-CEBjmPTa.js} +1 -1
  18. package/dist/client/assets/AgentLanesEmbedScreen-Dgcm7zd_.js +1 -0
  19. package/dist/client/assets/AgentLanesPreflight-q20mTjms.js +1 -0
  20. package/dist/client/assets/AgentLanesView-CetZZDyF.js +2 -0
  21. package/dist/client/assets/{AgentLiveActions-BwuzOE8h.js → AgentLiveActions-DrEJDJef.js} +1 -1
  22. package/dist/client/assets/AgentMasterScreen-DJPnstoD.js +1 -0
  23. package/dist/client/assets/{AgentSessions-CsZwoukw.js → AgentSessions-DCPCG4xb.js} +1 -1
  24. package/dist/client/assets/{AgentsConsole-KCao4XmX.js → AgentsConsole-CsYOoFJi.js} +1 -1
  25. package/dist/client/assets/{AgentsScreen-CtPAmwRX.js → AgentsScreen-k8LvBuU_.js} +1 -1
  26. package/dist/client/assets/AgentsSubnav-C4xpQhsv.js +1 -0
  27. package/dist/client/assets/{AstronautSuit-Ckx7lu7G.js → AstronautSuit-DbjQtfD_.js} +1 -1
  28. package/dist/client/assets/{AtopView-DYlpgEHf.js → AtopView-Daq_ob3z.js} +1 -1
  29. package/dist/client/assets/{BackToPicker-4JaeRvDm.js → BackToPicker-CXZjBRAe.js} +1 -1
  30. package/dist/client/assets/{BriefingDetailScreen-D6-xqrpo.js → BriefingDetailScreen-CUCXO-KH.js} +1 -1
  31. package/dist/client/assets/{BriefingsScreen-DKxSDEmk.js → BriefingsScreen-B5oMTGKv.js} +1 -1
  32. package/dist/client/assets/{BrokerMetadataPanel-BbREmsbK.js → BrokerMetadataPanel-BsiU8lTD.js} +1 -1
  33. package/dist/client/assets/{BrokerScreen-fbPIouMw.js → BrokerScreen-BPbOHhCS.js} +1 -1
  34. package/dist/client/assets/{CastPicker-BcA2vDDV.js → CastPicker-_5E5hNUe.js} +1 -1
  35. package/dist/client/assets/ChatCollapsedStrip-D-eXhzPf.js +1 -0
  36. package/dist/client/assets/{CodeDiffPane-Cn8Y9hAt.js → CodeDiffPane-n7W4iGUG.js} +1 -1
  37. package/dist/client/assets/{CodeProjectPicker-nPFktrco.js → CodeProjectPicker-CMsbSTDq.js} +1 -1
  38. package/dist/client/assets/{CodeScreen-BlAxtxE5.js → CodeScreen-CeuO3EhR.js} +1 -1
  39. package/dist/client/assets/{ConversationComposer-2HjbGPL9.js → ConversationComposer-CXPKx86g.js} +1 -1
  40. package/dist/client/assets/{ConversationFeedRows-C6wUqJrx.js → ConversationFeedRows-WrH-YI3L.js} +1 -1
  41. package/dist/client/assets/{ConversationHeader-C8vfXaTF.js → ConversationHeader-BQWzGzLK.js} +1 -1
  42. package/dist/client/assets/{ConversationPanels-CNCIbpqU.js → ConversationPanels-Dujvnmup.js} +2 -2
  43. package/dist/client/assets/ConversationScreen-CR9pWB65.js +2 -0
  44. package/dist/client/assets/{ConversationStatus-DZuyKsWN.js → ConversationStatus-DVzSb2Hv.js} +1 -1
  45. package/dist/client/assets/{CrewAvatar-CTIuxp4G.js → CrewAvatar-BwXjyg8N.js} +1 -1
  46. package/dist/client/assets/CrewWorkspaces-CkQDhyie.css +1 -0
  47. package/dist/client/assets/CrewWorkspaces-NKujRzwh.js +1 -0
  48. package/dist/client/assets/{DataTable-6IDhanr5.js → DataTable-Bp8tU9AK.js} +1 -1
  49. package/dist/client/assets/{DispatchAftermath-DC1u9itO.js → DispatchAftermath-B-6rmXzL.js} +1 -1
  50. package/dist/client/assets/{DocumentFocusViewer-DZVhS7as.js → DocumentFocusViewer-Do3wQ_3Z.js} +1 -1
  51. package/dist/client/assets/{EmbeddableSurfacesLab-BKUFJMCV.js → EmbeddableSurfacesLab-C1orRyP9.js} +1 -1
  52. package/dist/client/assets/{EmptyState-CeBl0iGd.js → EmptyState-CJzXj1l5.js} +1 -1
  53. package/dist/client/assets/{FileViewerPane-DQlpNt2S.js → FileViewerPane-Df6VzXjA.js} +1 -1
  54. package/dist/client/assets/FlightObserveScreen-6mGnmWQA.js +1 -0
  55. package/dist/client/assets/{FollowScreen-BXHOp3gb.js → FollowScreen-DvnxYLVh.js} +1 -1
  56. package/dist/client/assets/{HarnessMark-D5CA5uSp.js → HarnessMark-B979GCSB.js} +1 -1
  57. package/dist/client/assets/{HarnessesScreen-DhFXq1qz.js → HarnessesScreen-CHTuv8p6.js} +1 -1
  58. package/dist/client/assets/{HerdrSession-BRhs5LIR.js → HerdrSession-B3McuYgi.js} +1 -1
  59. package/dist/client/assets/{HomeHero-DMABJuze.js → HomeHero-CdUVPjkG.js} +1 -1
  60. package/dist/client/assets/{HostAdvisorView-RAociATV.js → HostAdvisorView-Bok5Sk5c.js} +1 -1
  61. package/dist/client/assets/{KnowledgeSearchInspector-CZPyVNSw.js → KnowledgeSearchInspector-B7XSoJsu.js} +1 -1
  62. package/dist/client/assets/{KnowledgeSearchScreen-mGTKIg00.js → KnowledgeSearchScreen-D3o3IODW.js} +1 -1
  63. package/dist/client/assets/{LaneToolHoverCard-D_DMlBeT.js → LaneToolHoverCard-HByf2ndx.js} +1 -1
  64. package/dist/client/assets/{LaneTraceDetailSheet-BEHg3LmH.js → LaneTraceDetailSheet-BUgHz-sd.js} +1 -1
  65. package/dist/client/assets/{LaneTraceEventFocus-DVimcizS.js → LaneTraceEventFocus-DM-hoPxG.js} +1 -1
  66. package/dist/client/assets/{MeshCanvas-BOuZx4AM.js → MeshCanvas-DCLJRsBy.js} +1 -1
  67. package/dist/client/assets/{MeshCanvasMinimap-wL-1N94e.js → MeshCanvasMinimap-cEFS9eW7.js} +1 -1
  68. package/dist/client/assets/{MeshScreen-DMY9Bmh5.js → MeshScreen-BcxPkhm6.js} +1 -1
  69. package/dist/client/assets/{MeshTopologyView-DiDcX5f4.js → MeshTopologyView-CCRPd8PU.js} +2 -2
  70. package/dist/client/assets/MessagesScreen-Bb5l13MO.js +1 -0
  71. package/dist/client/assets/{MissionContextRail-DrNKXG5u.js → MissionContextRail-DF0_kiU7.js} +1 -1
  72. package/dist/client/assets/{MissionControlView-ByBlHVN8.js → MissionControlView-E3V7bENU.js} +1 -1
  73. package/dist/client/assets/{MissionFocusOverlay-D1i6R6Zt.js → MissionFocusOverlay-h15sQFvP.js} +1 -1
  74. package/dist/client/assets/{MissionLeftAgentRow-DN9NcCML.js → MissionLeftAgentRow-KPdk9rSa.js} +1 -1
  75. package/dist/client/assets/{MissionLogPane-DSeIv3Xo.js → MissionLogPane-BbdDKjUl.js} +1 -1
  76. package/dist/client/assets/{NewAgentModal-V7yK6J6j.js → NewAgentModal-DfHxad34.js} +1 -1
  77. package/dist/client/assets/NewChatComposer-_Stj0fZy.js +19 -0
  78. package/dist/client/assets/{NewChatOrigin-DdpzE4kz.js → NewChatOrigin-B1u7ki70.js} +1 -1
  79. package/dist/client/assets/{ObserveEmbedScreen-l_Q3ts2q.js → ObserveEmbedScreen-Co0xTii6.js} +1 -1
  80. package/dist/client/assets/{ObserveTextFlow-BSEtYTxU.js → ObserveTextFlow-ZQWwrK3i.js} +2 -2
  81. package/dist/client/assets/{ObservedTopologyPanel-CdGUXxGR.js → ObservedTopologyPanel-BJUhDSuQ.js} +1 -1
  82. package/dist/client/assets/{OpenScoutAppShell-DN8dOSK4.js → OpenScoutAppShell-CUd2yOLu.js} +25 -25
  83. package/dist/client/assets/{OpsAgentsView-ntGr4pz4.js → OpsAgentsView-DI5wu1si.js} +1 -1
  84. package/dist/client/assets/OpsScreen-D8fQafCl.js +1 -0
  85. package/dist/client/assets/OpsSubnav-1K4Jaf__.js +1 -0
  86. package/dist/client/assets/ProjectAgentProfile-Bdjd_dAx.js +1 -0
  87. package/dist/client/assets/{ProjectAgentProfileBar-BQET-qrY.js → ProjectAgentProfileBar-k2QHHHsQ.js} +1 -1
  88. package/dist/client/assets/{ProjectAgentProfileHero-Ck8mThtx.js → ProjectAgentProfileHero-Bpxk1ui2.js} +1 -1
  89. package/dist/client/assets/ProjectsInbox-C_bMHLCc.js +2 -0
  90. package/dist/client/assets/ProjectsRail-J-aH_pxT.js +1 -0
  91. package/dist/client/assets/ProjectsScreen-cVUkGbPz.js +1 -0
  92. package/dist/client/assets/ProjectsThreadAside-_ourdM-Q.js +1 -0
  93. package/dist/client/assets/{Provider-B2xuo3rf.js → Provider-CtXJeLrP.js} +1 -1
  94. package/dist/client/assets/{RailRow-B-GycCBx.js → RailRow-CEH2MFBw.js} +1 -1
  95. package/dist/client/assets/{RawSessionsTable-AQThi6sm.js → RawSessionsTable-CDyrom-F.js} +1 -1
  96. package/dist/client/assets/RealtimeVoiceScreen-DBl3DN1H.js +1 -0
  97. package/dist/client/assets/{RepoDiffEmbedScreen-DXWoRF_c.js → RepoDiffEmbedScreen-kY2pHjIs.js} +1 -1
  98. package/dist/client/assets/{RepoDiffPageScreen-D_274ExO.js → RepoDiffPageScreen-C6LhoKrn.js} +1 -1
  99. package/dist/client/assets/{RepoDiffViewer-DbedmHDX.js → RepoDiffViewer-BhcIIQQg.js} +1 -1
  100. package/dist/client/assets/{RepoDiffViewerLazy-C0--fPtk.js → RepoDiffViewerLazy-Csy_j9LD.js} +2 -2
  101. package/dist/client/assets/{ReposScreen-D39_YG4H.js → ReposScreen-B_cB0zu7.js} +1 -1
  102. package/dist/client/assets/ScoutDeckSurface-CSy_fjcG.js +1 -0
  103. package/dist/client/assets/{ScoutSurface-UsRy0t-I.js → ScoutSurface-CQVcSrin.js} +1 -1
  104. package/dist/client/assets/{ScoutbotFxLab-Fmdfboxs.js → ScoutbotFxLab-DqGiLYNy.js} +1 -1
  105. package/dist/client/assets/{SecondaryNav-o2RL9H8H.js → SecondaryNav-BR4VRdgh.js} +1 -1
  106. package/dist/client/assets/SessionEmbedScreen-BTlZ9gAg.js +1 -0
  107. package/dist/client/assets/{SessionObserve-Dsd0j05N.js → SessionObserve-dQDN23pP.js} +1 -1
  108. package/dist/client/assets/{SessionObserveEvidence-DopQYDkD.js → SessionObserveEvidence-BRBGKAgd.js} +1 -1
  109. package/dist/client/assets/SessionRefScreen-COVQMbtE.js +1 -0
  110. package/dist/client/assets/SessionsScreen--5OJ3p3v.js +1 -0
  111. package/dist/client/assets/{SettingsDrawer-_AwuopMS.js → SettingsDrawer-RGVK_bmE.js} +1 -1
  112. package/dist/client/assets/{SettingsScreen-Cw4DDfJP.js → SettingsScreen-CCxzy5IU.js} +1 -1
  113. package/dist/client/assets/{ShikiPane-BfHc_3pM.js → ShikiPane-DYI9Hkge.js} +1 -1
  114. package/dist/client/assets/{SlidePanel-C-q7XwTa.js → SlidePanel-B9ugxWgA.js} +1 -1
  115. package/dist/client/assets/{SpriteAvatar-Bs68ZENy.js → SpriteAvatar-z5hHesx9.js} +1 -1
  116. package/dist/client/assets/{StatusPill-ZZQwxB1a.js → StatusPill-BFvMjmZV.js} +1 -1
  117. package/dist/client/assets/{TailView-Q4FVMsUH.js → TailView-0uEIj2JH.js} +1 -1
  118. package/dist/client/assets/{Terminal-D7zqHwHV.js → Terminal-DouZeNxc.js} +1 -1
  119. package/dist/client/assets/{TerminalEmbedScreen-CXIJ7qv6.js → TerminalEmbedScreen-dMNUbzXr.js} +1 -1
  120. package/dist/client/assets/{TerminalHeaderMount-BnBLOPbb.js → TerminalHeaderMount-BL07cd0q.js} +1 -1
  121. package/dist/client/assets/{TextDocumentSurface-CKQP-cBT.js → TextDocumentSurface-BflAwXeZ.js} +1 -1
  122. package/dist/client/assets/{TmuxPeek-V9dGESfO.js → TmuxPeek-BTnjOQi0.js} +1 -1
  123. package/dist/client/assets/{VoicePermissionsPanel-k7sbLXx2.js → VoicePermissionsPanel-CgQ6GGS-.js} +1 -1
  124. package/dist/client/assets/{WorkDetailScreen-60p9litn.js → WorkDetailScreen-CaLG-zDs.js} +1 -1
  125. package/dist/client/assets/{WorkFilesViewer-BjJS7GyM.js → WorkFilesViewer-B9Sil_No.js} +1 -1
  126. package/dist/client/assets/{activity-Bj3Hnbj3.js → activity-DcrMApUY.js} +1 -1
  127. package/dist/client/assets/{addon-fit-BL-NTWRU.js → addon-fit-DMVrz5Sv.js} +1 -1
  128. package/dist/client/assets/{addon-webgl-CIMgmNjg.js → addon-webgl-BYvpZUyu.js} +1 -1
  129. package/dist/client/assets/{agent-autocomplete-DXlvdc4b.js → agent-autocomplete-B-5QTeas.js} +1 -1
  130. package/dist/client/assets/{agent-essentials-BOMHR0_U.js → agent-essentials-D7KRGYvF.js} +1 -1
  131. package/dist/client/assets/{agent-lane-card-model-CTLxf3R4.js → agent-lane-card-model-CNZMPkhc.js} +1 -1
  132. package/dist/client/assets/{agent-lanes-model-AfrjRNK5.js → agent-lanes-model-DXqjs0OK.js} +2 -2
  133. package/dist/client/assets/agent-master-I1W-5d-x.css +1 -0
  134. package/dist/client/assets/agent-master-model-DqjrVI2h.js +1 -0
  135. package/dist/client/assets/{agent-specialization-BIPIBW8u.js → agent-specialization-BujJVUTD.js} +1 -1
  136. package/dist/client/assets/{arc.es-IR5r6sj_.js → arc.es-NHqHWohb.js} +1 -1
  137. package/dist/client/assets/{arrow-down-BydciYFZ.js → arrow-down-CKtSUjmW.js} +1 -1
  138. package/dist/client/assets/{arrow-left-CghA0kTw.js → arrow-left-Czpf-AE4.js} +1 -1
  139. package/dist/client/assets/{arrow-right-iJFv3jNh.js → arrow-right-BuzMnLYP.js} +1 -1
  140. package/dist/client/assets/{arrow-up-right-CCfZXPqD.js → arrow-up-right-C6Wl-1uw.js} +1 -1
  141. package/dist/client/assets/{bot-B5sub1-i.js → bot-rd0awxD3.js} +1 -1
  142. package/dist/client/assets/{check-C18YQC90.js → check-ofKUE8yH.js} +1 -1
  143. package/dist/client/assets/{chevron-down-Mp9mu_yd.js → chevron-down-wciXnOQz.js} +1 -1
  144. package/dist/client/assets/{chevron-right-CzH-TaSF.js → chevron-right-D-HdlPg8.js} +1 -1
  145. package/dist/client/assets/{chunk-HRAB3GC3-swV8PA2k.js → chunk-HRAB3GC3-Tyv9rzx7.js} +1 -1
  146. package/dist/client/assets/{chunk-JTPDIGGW-BKXqcLKw.js → chunk-JTPDIGGW-BC2Mandc.js} +3 -3
  147. package/dist/client/assets/{chunk-T65CQEWV-vYbNJ8E6.js → chunk-T65CQEWV-C1AWTYZZ.js} +1 -1
  148. package/dist/client/assets/{chunk-YOZR3KYS-U65yUmqt.js → chunk-YOZR3KYS-DwHPHa6f.js} +1 -1
  149. package/dist/client/assets/{clock-B4PTFi5m.js → clock-B88r8OrZ.js} +1 -1
  150. package/dist/client/assets/{code-xml-Jtxsp5d1.js → code-xml-D7pOQM9l.js} +1 -1
  151. package/dist/client/assets/{compass-0_54-vz3.js → compass-Dt1AMXz2.js} +1 -1
  152. package/dist/client/assets/content-9K38QchR.js +1 -0
  153. package/dist/client/assets/content-BRgnyXWh.js +1 -0
  154. package/dist/client/assets/{content-CHghn-rT.js → content-BWPNyXJ0.js} +1 -1
  155. package/dist/client/assets/content-BdkI07v3.js +1 -0
  156. package/dist/client/assets/content-C4oWa8SB.js +1 -0
  157. package/dist/client/assets/content-C9ijJxyl.js +1 -0
  158. package/dist/client/assets/content-CFZ4rghn.js +1 -0
  159. package/dist/client/assets/content-CIqu_Ci_.js +1 -0
  160. package/dist/client/assets/content-CnJF9DGO.js +1 -0
  161. package/dist/client/assets/content-CriW8Y8u.js +1 -0
  162. package/dist/client/assets/content-DDCyPPk_.js +1 -0
  163. package/dist/client/assets/content-DtcZeh5m.js +1 -0
  164. package/dist/client/assets/content-U9tsdtle.js +1 -0
  165. package/dist/client/assets/content-hFLK3CON.js +1 -0
  166. package/dist/client/assets/{content-DMbawvqU.js → content-nkx0swDe.js} +1 -1
  167. package/dist/client/assets/content-p00KQrtD.js +1 -0
  168. package/dist/client/assets/{conversation-icons-BV10B2Me.js → conversation-icons-tp9BX6X2.js} +1 -1
  169. package/dist/client/assets/{conversation-model-CwF6Y9gx.js → conversation-model-Dc02NsGp.js} +1 -1
  170. package/dist/client/assets/conversation-motion-features-D9-RmBSq.js +1 -0
  171. package/dist/client/assets/{copy-Dtpx4FOE.js → copy-CWWAJ75H.js} +1 -1
  172. package/dist/client/assets/{cpu-BjVis9mc.js → cpu-DrqejfkB.js} +1 -1
  173. package/dist/client/assets/{createLucideIcon-DXpqZP7I.js → createLucideIcon-DezKXSG2.js} +1 -1
  174. package/dist/client/assets/{ctx-panel-D_HJ3nhb.css → ctx-panel-F05jXK4Q.css} +1 -1
  175. package/dist/client/assets/discover-C2CZO4Tk.js +2 -0
  176. package/dist/client/assets/embed-entry-BSMUykuG.js +2 -0
  177. package/dist/client/assets/{external-link-Ckiyzjwo.js → external-link-Dp_a2vRZ.js} +1 -1
  178. package/dist/client/assets/{eye-CpfyvdLq.js → eye-BRyD0jno.js} +1 -1
  179. package/dist/client/assets/{file-code-corner-7mo7EviR.js → file-code-corner-muIVH_xO.js} +1 -1
  180. package/dist/client/assets/{file-text-KijGBnME.js → file-text-CqJgwxmv.js} +1 -1
  181. package/dist/client/assets/{gauge-y-Xg8Mrv.js → gauge-hU--hKVP.js} +1 -1
  182. package/dist/client/assets/{gestures-Bq9XnSqY.js → gestures-DN4hEeqv.js} +1 -1
  183. package/dist/client/assets/{git-branch-BQ_x8KZL.js → git-branch-CK5v8F2v.js} +1 -1
  184. package/dist/client/assets/{home-moving-signal-DtRpiNa0.js → home-moving-signal-BjDtEJUP.js} +1 -1
  185. package/dist/client/assets/{home-now-card-DFb4GOgM.js → home-now-card-nF8OotI-.js} +1 -1
  186. package/dist/client/assets/{home-now-card-nano-D--m9jpq.js → home-now-card-nano-C-r_bBg5.js} +1 -1
  187. package/dist/client/assets/{hooks-9d1SoaQA.js → hooks-D46bABUP.js} +1 -1
  188. package/dist/client/assets/index-CPrU5q04.js +1 -0
  189. package/dist/client/assets/{index-CZ-05hKz.js → index-DvLtl7rV.js} +5 -5
  190. package/dist/client/assets/index-kL1WLbeS.js +1 -0
  191. package/dist/client/assets/index-zvhpRHao.js +1 -0
  192. package/dist/client/assets/{inspector-panel-C-EhEDYy.js → inspector-panel-Dkc7rLvY.js} +1 -1
  193. package/dist/client/assets/{keyboard-nav-DFhAJkW3.js → keyboard-nav-BLYDhL3Z.js} +1 -1
  194. package/dist/client/assets/{lane-roster-store-gUBsydNf.js → lane-roster-store-DOdI1O13.js} +1 -1
  195. package/dist/client/assets/{layers-CGou-LwV.js → layers-CSsg3JVP.js} +1 -1
  196. package/dist/client/assets/{layout-grid-BrZt31QH.js → layout-grid-DOChPJdZ.js} +1 -1
  197. package/dist/client/assets/left-B-SdEJSJ.js +1 -0
  198. package/dist/client/assets/{left-B_o51JV6.js → left-B3wSE6ql.js} +1 -1
  199. package/dist/client/assets/{left-CwHZCGO3.js → left-BNRFiRsb.js} +1 -1
  200. package/dist/client/assets/{left-DA0amyfu.js → left-BggzhgXN.js} +1 -1
  201. package/dist/client/assets/left-CARCvvxS.js +2 -0
  202. package/dist/client/assets/left-CpokZYHt.js +1 -0
  203. package/dist/client/assets/{left-CwLs0okF.js → left-YT7mIGuH.js} +1 -1
  204. package/dist/client/assets/{left-advisor-DU3s01gk.js → left-advisor-CCY0vkcO.js} +1 -1
  205. package/dist/client/assets/left-agents-trhO5sL8.js +1 -0
  206. package/dist/client/assets/{left-default-uvuvDmt0.js → left-default-CG33elBs.js} +1 -1
  207. package/dist/client/assets/{left-lanes-DnNLgec8.js → left-lanes-CitMgeTp.js} +1 -1
  208. package/dist/client/assets/{left-mission-DN3-NLPC.js → left-mission-Zl2m_5eU.js} +1 -1
  209. package/dist/client/assets/{library-DIo5NiGP.js → library-DkALuCh5.js} +1 -1
  210. package/dist/client/assets/{loader-circle-BiohlpM3.js → loader-circle-pM56HNhR.js} +1 -1
  211. package/dist/client/assets/{local-agents-wUIaBcEr.js → local-agents-C8xAhbO5.js} +1 -1
  212. package/dist/client/assets/{mentions-CcPFMbmZ.js → mentions-DG6OQrsc.js} +1 -1
  213. package/dist/client/assets/{mesh-buckets-ByyFXdKT.js → mesh-buckets-6y3ZIibI.js} +1 -1
  214. package/dist/client/assets/{mesh-ops-CvGyjK84.js → mesh-ops-BZ1h5RQs.js} +1 -1
  215. package/dist/client/assets/{mesh-roster-n2nDpEmA.js → mesh-roster-Bc7T4b7z.js} +1 -1
  216. package/dist/client/assets/{mesh-view-store-BpxGm71b.js → mesh-view-store-ChUOASK8.js} +1 -1
  217. package/dist/client/assets/{message-circle-B2ddzBrX.js → message-circle-mZCv8tvB.js} +1 -1
  218. package/dist/client/assets/{message-markup-RkfmDfME.js → message-markup-C2LQDm_k.js} +1 -1
  219. package/dist/client/assets/{message-square-D9YYWE0x.js → message-square-C7t_qtuj.js} +1 -1
  220. package/dist/client/assets/{message-visibility-DwxgcgYK.js → message-visibility-CGOmSSKs.js} +1 -1
  221. package/dist/client/assets/{mission-control-store-Bf4b54MV.js → mission-control-store-nDLdUZPA.js} +1 -1
  222. package/dist/client/assets/{observe-CJRIvOCn.js → observe-BpEm1INu.js} +1 -1
  223. package/dist/client/assets/{page-status-BptpTdQ-.js → page-status-E5jnk48p.js} +1 -1
  224. package/dist/client/assets/{paperclip-B1UNGl5d.js → paperclip-C64lkcbM.js} +1 -1
  225. package/dist/client/assets/{persistent-state-YI-WHSCF.js → persistent-state-EHXw8WNy.js} +1 -1
  226. package/dist/client/assets/{plus-CuU_X0-8.js → plus-Co-dqKul.js} +1 -1
  227. package/dist/client/assets/{profile-rY8jO38P.js → profile-APxDsN2P.js} +1 -1
  228. package/dist/client/assets/projects-inbox-Cg4X2lUQ.js +1 -0
  229. package/dist/client/assets/projects-inbox-DRBl2N85.css +1 -0
  230. package/dist/client/assets/{proxy-DnLpZIi9.js → proxy-BiW5suC7.js} +1 -1
  231. package/dist/client/assets/{radio-Dm1ItnA4.js → radio-BOxBQX-T.js} +1 -1
  232. package/dist/client/assets/{refresh-cw-BRn9Oxxl.js → refresh-cw-DMxGzDwn.js} +1 -1
  233. package/dist/client/assets/resolve-panes-DeVJbS9c.js +1 -0
  234. package/dist/client/assets/resolve-sidebar-context-BQe5J6xF.js +1 -0
  235. package/dist/client/assets/{right-BJltPRnd.js → right-Bmfd3pjP.js} +1 -1
  236. package/dist/client/assets/{right-Beh3nCUB.js → right-BqI-nr9G.js} +1 -1
  237. package/dist/client/assets/{right-D3aTKf1F.js → right-BuCgE0fZ.js} +1 -1
  238. package/dist/client/assets/{right-Shpw_xDy.js → right-BwlW6E57.js} +1 -1
  239. package/dist/client/assets/{right-CPP7GyOm.js → right-C0ybUw0j.js} +1 -1
  240. package/dist/client/assets/{right-BbyYdzHn.js → right-CdkcrmeD.js} +1 -1
  241. package/dist/client/assets/{right-CJnB_Bg7.js → right-CimaAvQN.js} +1 -1
  242. package/dist/client/assets/{right-C1yumXNx.js → right-CkCCPbCX.js} +1 -1
  243. package/dist/client/assets/{right-DI1B79nR.js → right-D3eSiy41.js} +1 -1
  244. package/dist/client/assets/{right-DtsRNX5b.js → right-Dz_xD0Vj.js} +1 -1
  245. package/dist/client/assets/{rocket-DOwXHKWA.js → rocket-BQm5_CvR.js} +1 -1
  246. package/dist/client/assets/router-B9vQkNJL.js +1 -0
  247. package/dist/client/assets/{scope-views-A4_vP97W.js → scope-views-1IYJdl41.js} +1 -1
  248. package/dist/client/assets/{scout-voice-BhPzrc6P.js → scout-voice-BVUqGhth.js} +1 -1
  249. package/dist/client/assets/{scoutbot-markdown-jh7tzFB1.js → scoutbot-markdown-BQ_Ee2Ic.js} +1 -1
  250. package/dist/client/assets/{scroll-text-DO0GQzvN.js → scroll-text-Dze_dXtQ.js} +1 -1
  251. package/dist/client/assets/{search-D1tJSAWe.js → search-CDko0PKE.js} +1 -1
  252. package/dist/client/assets/{secondaryNavConfig-B9IF8wXl.js → secondaryNavConfig-BoQ_zYR9.js} +1 -1
  253. package/dist/client/assets/{selection-bridge-i2S9zpf8.js → selection-bridge-Din6yV3h.js} +1 -1
  254. package/dist/client/assets/{send-horizontal-CgLppsIC.js → send-horizontal-CSjIm6xg.js} +1 -1
  255. package/dist/client/assets/{server-Dymv5Emh.js → server-Bzj7lPIx.js} +1 -1
  256. package/dist/client/assets/{session-catalog-DNaOEzoQ.js → session-catalog-DsaZJXZt.js} +1 -1
  257. package/dist/client/assets/session-ref-lookup-state-SATH_jAP.js +1 -0
  258. package/dist/client/assets/{session-table-PTQVoTyc.js → session-table-BQfR7u6r.js} +1 -1
  259. package/dist/client/assets/{settings-2fC_G9nX.js → settings-Dyvpkb1D.js} +1 -1
  260. package/dist/client/assets/{sliders-horizontal-BPSMHhbm.js → sliders-horizontal-C8njVwfg.js} +1 -1
  261. package/dist/client/assets/{sparkles-Dy8p5xN8.js → sparkles-CETYrxGA.js} +1 -1
  262. package/dist/client/assets/{sse-CiOSzE5n.js → sse-CD9MMUxl.js} +1 -1
  263. package/dist/client/assets/{tail-events-BMQmSx1n.js → tail-events-Ps8KpKah.js} +1 -1
  264. package/dist/client/assets/{terminal-yN9xN-h9.js → terminal-9GRS_Qdc.js} +1 -1
  265. package/dist/client/assets/{terminal-relay-9lhzEp2V.js → terminal-relay-GYMIvKs1.js} +1 -1
  266. package/dist/client/assets/{terminal-takeover-DANQfTcy.js → terminal-takeover-_Jyys4me.js} +1 -1
  267. package/dist/client/assets/{text-CnZ0e1-V.js → text-BP3oyl8-.js} +1 -1
  268. package/dist/client/assets/{text-rLpBg4_z.css → text-BYAFNLNq.css} +1 -1
  269. package/dist/client/assets/{use-conversation-list-D9BNLfnW.js → use-conversation-list-C9ABzjXI.js} +1 -1
  270. package/dist/client/assets/use-fleet-active-asks-DAspZQjE.js +1 -0
  271. package/dist/client/assets/{use-mesh-ops-items-BIvIHlqe.js → use-mesh-ops-items-Dh54ymEp.js} +1 -1
  272. package/dist/client/assets/{use-reduced-motion-CKkhq9c5.js → use-reduced-motion-x8pJMVrG.js} +1 -1
  273. package/dist/client/assets/{use-scout-dev-flags-B2KCzPxn.js → use-scout-dev-flags-DhCbiDK3.js} +1 -1
  274. package/dist/client/assets/{useAgentHoverCard-CHBsxcbp.js → useAgentHoverCard-DoBwV0LX.js} +1 -1
  275. package/dist/client/assets/useContentSecondaryNav-pZe2Zfk1.js +1 -0
  276. package/dist/client/assets/{usePierreRuntime-DUuXH5yp.js → usePierreRuntime-ejq9dCWV.js} +1 -1
  277. package/dist/client/assets/{wrench-YcXMlsh2.js → wrench-DjkoAOQt.js} +1 -1
  278. package/dist/client/assets/{x-e3h2hDsp.js → x-CAbNespN.js} +1 -1
  279. package/dist/client/assets/{xterm-Byp1Hep_.js → xterm-Cf-ngcGP.js} +1 -1
  280. package/dist/client/assets/{zap-nMcjPoWB.js → zap-Cq8eWkcF.js} +1 -1
  281. package/dist/client/index.html +1 -1
  282. package/dist/drizzle/0009_old_korg.sql +72 -0
  283. package/dist/drizzle/0010_sparkling_colonel_america.sql +2 -0
  284. package/dist/drizzle/0011_funny_onslaught.sql +4 -0
  285. package/dist/drizzle/0012_high_blazing_skull.sql +16 -0
  286. package/dist/drizzle/0013_perfect_juggernaut.sql +1 -0
  287. package/dist/drizzle/0014_legal_meggan.sql +6 -0
  288. package/dist/drizzle/0015_lame_marvel_boy.sql +12 -0
  289. package/dist/drizzle/0016_early_goliath.sql +6 -0
  290. package/dist/drizzle/meta/0009_snapshot.json +6262 -0
  291. package/dist/drizzle/meta/0010_snapshot.json +6286 -0
  292. package/dist/drizzle/meta/0011_snapshot.json +6337 -0
  293. package/dist/drizzle/meta/0012_snapshot.json +6458 -0
  294. package/dist/drizzle/meta/0013_snapshot.json +6465 -0
  295. package/dist/drizzle/meta/0014_snapshot.json +6503 -0
  296. package/dist/drizzle/meta/0015_snapshot.json +6596 -0
  297. package/dist/drizzle/meta/0016_snapshot.json +6611 -0
  298. package/dist/drizzle/meta/_journal.json +56 -0
  299. package/dist/main.mjs +1311 -363
  300. package/dist/node/main.mjs +314 -12
  301. package/dist/pairing-runtime-controller.mjs +608 -108
  302. package/dist/runtime/base-daemon.mjs +30 -3
  303. package/dist/runtime/broker-daemon.mjs +4771 -529
  304. package/dist/runtime/broker-process-manager.mjs +23 -2
  305. package/dist/runtime/mesh-discover.mjs +23 -2
  306. package/dist/scout-control-plane-web.mjs +1914 -478
  307. package/package.json +25 -6
  308. package/dist/client/assets/AgentLanesEmbedScreen-BmLnN4on.js +0 -1
  309. package/dist/client/assets/AgentLanesPreflight-5B6sXvRB.js +0 -1
  310. package/dist/client/assets/AgentLanesView-DHyzVBk6.js +0 -2
  311. package/dist/client/assets/AgentsSubnav-CDMjKeYC.js +0 -1
  312. package/dist/client/assets/ChatCollapsedStrip-Ycm0ecaX.js +0 -1
  313. package/dist/client/assets/ConversationScreen-BNULZAp2.js +0 -2
  314. package/dist/client/assets/CrewWorkspaces-CJhBKVoZ.css +0 -1
  315. package/dist/client/assets/CrewWorkspaces-CkPYIA46.js +0 -1
  316. package/dist/client/assets/FlightObserveScreen-CDWGSKZg.js +0 -1
  317. package/dist/client/assets/MessagesScreen-Eulveud3.js +0 -1
  318. package/dist/client/assets/NewChatComposer-hlWT-nbR.js +0 -19
  319. package/dist/client/assets/OpsScreen-Ppen_Lmj.js +0 -1
  320. package/dist/client/assets/OpsSubnav-GAKsoSor.js +0 -1
  321. package/dist/client/assets/ProjectAgentProfile-BLlp2e6t.js +0 -1
  322. package/dist/client/assets/ProjectsInbox-Dlt8OQ8O.js +0 -2
  323. package/dist/client/assets/ProjectsRail-DCfNMmnW.js +0 -1
  324. package/dist/client/assets/ProjectsScreen-BP-hmI1m.js +0 -1
  325. package/dist/client/assets/ProjectsThreadAside-CWpMjGIH.js +0 -1
  326. package/dist/client/assets/RealtimeVoiceScreen-D7zZHK_t.js +0 -1
  327. package/dist/client/assets/ScoutDeckSurface-CKT3qdqY.js +0 -1
  328. package/dist/client/assets/SessionEmbedScreen-RD5XOx7R.js +0 -1
  329. package/dist/client/assets/SessionRefScreen-B_cTv47v.js +0 -1
  330. package/dist/client/assets/SessionsScreen-Bq0Z77On.js +0 -1
  331. package/dist/client/assets/archive-BjcGiAy8.js +0 -1
  332. package/dist/client/assets/content-6RvWTrtk.js +0 -1
  333. package/dist/client/assets/content-BCgwMUqz.js +0 -1
  334. package/dist/client/assets/content-Bf2VLhx0.js +0 -1
  335. package/dist/client/assets/content-BrU_38-m.js +0 -1
  336. package/dist/client/assets/content-BvvJN8rN.js +0 -1
  337. package/dist/client/assets/content-CAeEqYPw.js +0 -1
  338. package/dist/client/assets/content-CI_Z9DXk.js +0 -1
  339. package/dist/client/assets/content-CbyKONhW.js +0 -1
  340. package/dist/client/assets/content-Czogvp43.js +0 -1
  341. package/dist/client/assets/content-DFk0zNzX.js +0 -1
  342. package/dist/client/assets/content-DHe4DgkA.js +0 -1
  343. package/dist/client/assets/content-DTz7cKjo.js +0 -1
  344. package/dist/client/assets/content-E3kudY-W.js +0 -1
  345. package/dist/client/assets/content-LpO0aO_U.js +0 -1
  346. package/dist/client/assets/conversation-motion-features-BKkCRaWR.js +0 -1
  347. package/dist/client/assets/discover-CHbrEItO.js +0 -2
  348. package/dist/client/assets/embed-entry-vil28MyU.js +0 -2
  349. package/dist/client/assets/index-BVlMw8x_.js +0 -1
  350. package/dist/client/assets/index-Cn0GR-q1.js +0 -1
  351. package/dist/client/assets/index-DosI4AG9.js +0 -1
  352. package/dist/client/assets/left-BpgWnaah.js +0 -1
  353. package/dist/client/assets/left-Cx0kv6pe.js +0 -1
  354. package/dist/client/assets/left-agents-qL5PpUY-.js +0 -1
  355. package/dist/client/assets/left-z-6CkuBe.js +0 -2
  356. package/dist/client/assets/projects-inbox-BBs1hG13.css +0 -1
  357. package/dist/client/assets/projects-inbox-D-zAb9Gp.js +0 -1
  358. package/dist/client/assets/resolve-panes-DO6LkwhQ.js +0 -1
  359. package/dist/client/assets/resolve-sidebar-context-CIF288wY.js +0 -1
  360. package/dist/client/assets/router-DJj2WbDg.js +0 -1
  361. package/dist/client/assets/use-fleet-active-asks-BeAdcl09.js +0 -1
  362. package/dist/client/assets/useContentSecondaryNav-D0mUhxTF.js +0 -1
@@ -1,19 +0,0 @@
1
- import{j as i,r as l}from"./index-CZ-05hKz.js";import{f as Ot,M as zn}from"./text-CnZ0e1-V.js";import{C as Gn,c as Wn,S as vs,G as qn,H as Kn}from"./conversation-model-CwF6Y9gx.js";import{a as W}from"./api-Co9aQ2Jw.js";import{r as Jn}from"./index-BVlMw8x_.js";import{H as ys}from"./HarnessMark-D5CA5uSp.js";import{n as Vn,c as Xn,d as Yn}from"./colors-BtO5_zlx.js";import{NewChatOrigin as Qn}from"./NewChatOrigin-DdpzE4kz.js";import{u as Zn}from"./keyboard-nav-DFhAJkW3.js";import{X as er}from"./x-e3h2hDsp.js";import{C as tr}from"./chevron-down-Mp9mu_yd.js";import{S as sr}from"./search-D1tJSAWe.js";import{L as Tt}from"./loader-circle-BiohlpM3.js";import{F as nr}from"./file-text-KijGBnME.js";const rr={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:[]}]},qt=["none","minimal","low","medium","high","xhigh","max","ultra"],Gs={none:"None",minimal:"Minimal",low:"Light",medium:"Medium",high:"High",xhigh:"Extra High",max:"Max",ultra:"Ultra"},V=rr;function Kt(e,t=V){return t.harnesses.find(s=>s.id===e)}function or(e=V){return e.harnesses.find(t=>t.enabled&&t.default)?.id??e.harnesses.find(t=>t.enabled)?.id??null}function Ws(e,t=V){const s=Kt(e,t);return s?.models.find(n=>n.enabled&&n.default)?.id??s?.models.find(n=>n.enabled)?.id??null}function ar(e,t,s=V){const n=Kt(e,s);if(!n||!n.enabled)return null;const r=t?n.models.find(a=>a.enabled&&a.id===t):void 0;return r?.reasoningEfforts===null?null:r?.reasoningEfforts??n.reasoningEfforts}function qs(e,t,s=V){const n=Kt(e,s),r=t?n?.models.find(f=>f.enabled&&f.id===t):void 0,a=ar(e,t,s),u=r?.defaultReasoningEffort??n?.defaultReasoningEffort??null;return u&&a?.includes(u)?u:a?.[0]??null}function ir(e=V){return Object.fromEntries(e.harnesses.filter(t=>t.enabled).map(t=>{const s=Ws(t.id,e);return[t.id,{model:s,reasoningEffort:qs(t.id,s,e)}]}))}const cr=ir();Object.fromEntries(V.harnesses.filter(e=>e.enabled).map(e=>{const t=qt.filter(s=>e.reasoningEfforts?.includes(s)||e.models.some(n=>n.enabled&&n.reasoningEfforts?.includes(s)));return[e.id,t]}));function lr(e=V){const t=new Map;for(const s of e.harnesses)if(s.enabled)for(const n of s.models){if(!n.enabled)continue;const r=t.get(n.id);if(r){r.harnesses.includes(s.id)||r.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 ur=lr(),dr={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 fr(e=V){return qt.flatMap(t=>{const s=[],n=[];for(const r of e.harnesses){if(!r.enabled)continue;const a=r.models.filter(d=>d.enabled),u=a.filter(d=>(d.reasoningEfforts??r.reasoningEfforts)?.includes(t)),f=a.length===0&&r.reasoningEfforts?.includes(t);u.length===0&&!f||(s.push(r.id),a.length>0&&u.length<a.length&&n.push(...u.map(d=>d.id)))}return s.length===0?[]:[{id:t,label:Gs[t],description:dr[t],harnesses:s,...n.length>0?{models:n}:{}}]})}const mr=fr(),Ks=new Set(["md","markdown","mdx","mdown","mkd"]),hr=new Set(["c","cc","cpp","cxx","h","hh","hpp","hxx","cjs","mjs","js","jsx","ts","tsx","py","pyw","pyi","rs","go","java","kt","kts","swift","cs","rb","php","lua","r","sh","bash","zsh","fish","ps1","bat","cmd","sql","prisma","json","jsonc","json5","yaml","yml","toml","xml","html","htm","xhtml","css","scss","sass","less","vue","svelte","astro","graphql","gql","zig","ex","exs","erl","hrl","hs","clj","cljs","cljc","dart","tf","hcl","nix","env","ini","cfg","conf","properties","txt","log","cmake","gradle","groovy","patch","diff","proto","wat"]),pr=new Set(["dockerfile","containerfile","makefile","gemfile","rakefile","procfile","brewfile"]),gr=new Set(["text/markdown","text/x-markdown","text/plain","text/javascript","text/typescript","text/css","text/html","text/yaml","text/toml","text/x-shellscript","application/json","application/javascript"]);function Js(e){return e.trim().split(/[/\\]/).pop()?.toLowerCase()??""}function Jt(e){const t=Js(e),s=t.lastIndexOf(".");return s>=0?t.slice(s+1):""}function wr(e){return Ks.has(Jt(e))}function br(e){const t=Js(e);return pr.has(t)?!0:hr.has(Jt(e))}function Vs(e){return wr(e)||br(e)}function Xs(e,t){if(!Vs(t))return null;const s=Jt(t);if(Ks.has(s))return"text/markdown";switch(s){case"json":case"jsonc":case"json5":return"application/json";case"yaml":case"yml":return"text/yaml";case"toml":return"text/toml";case"html":case"htm":case"xhtml":return"text/html";case"css":case"scss":case"sass":case"less":return"text/css";case"js":case"jsx":case"mjs":case"cjs":return"text/javascript";case"ts":case"tsx":return"text/typescript";case"sh":case"bash":case"zsh":case"fish":return"text/x-shellscript"}const n=e.trim().toLowerCase();return gr.has(n)?n:"text/plain"}function vr(e,t){const s=e.trim().toLowerCase();return s.startsWith("image/")||s.startsWith("video/")||s==="text/markdown"||s==="text/x-markdown"?!0:t?Xs(s,t)?!0:!s||s==="application/octet-stream"?Vs(t):!1:!1}function yr(e){const t=e.type.trim().toLowerCase();return t.startsWith("image/")||t.startsWith("video/")?t:Xs(t,e.name)??t}function Xe(e){return vr(e.type,e.name)}function xr(e){return yr(e)}function dt(e){return e?e.files.length>0||[...e.types].some(t=>t.toLowerCase()==="files")?!0:[...e.items].some(t=>t.kind==="file"):!1}function Ys(e){if(!e)return[];const t=[...e.files];if(t.length>0)return t;const s=[];for(const n of e.items){if(n.kind!=="file")continue;const r=n.getAsFile();r&&s.push(r)}return s}function jr(e){return Ys(e).filter(Xe)}function Da(e){return jr(e)}function Sr(e){return new Promise((t,s)=>{const n=new FileReader;n.onload=()=>{const r=typeof n.result=="string"?n.result:"",a=r.indexOf(",");t(a>=0?r.slice(a+1):r)},n.onerror=()=>s(n.error??new Error("Could not read file.")),n.readAsDataURL(e)})}async function Cr(e){if(!Xe(e))throw new Error("Only markdown, code, image, and video files can be routed.");const t=await Sr(e);return W("/api/blobs",{method:"POST",body:JSON.stringify({data:t,mediaType:xr(e),fileName:e.name})})}async function kr(e){const t=e.filter(Xe);if(t.length===0)throw new Error("Drop markdown, code, an image, or a video clip to route.");return(await Promise.all(t.map(n=>Cr(n)))).map((n,r)=>({id:n.id,mediaType:n.mediaType,fileName:n.fileName??t[r]?.name,url:n.url}))}function Mr(e,t){const s=t?.trim();return s?e.find(n=>n.id===s)??null:null}function Ar(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=Mr(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}}function xs({label:e,items:t,activeIndex:s,placement:n="above",onPick:r,onActiveIndexChange:a}){return t.length===0?null:i.jsxs("div",{className:"s-msg-compose-suggest surface-card","data-placement":n,role:"listbox","aria-label":e,children:[i.jsxs("div",{className:"s-msg-compose-suggest-header",children:[i.jsx("span",{className:"s-msg-compose-suggest-label label-xs text-muted",children:e}),i.jsxs("span",{className:"label-xs text-dim s-msg-compose-suggest-count",children:[t.length," options"]})]}),i.jsx("div",{className:"s-msg-compose-suggest-list",children:t.map((u,f)=>{const d=f===s;return i.jsxs("button",{type:"button",role:"option","aria-selected":d,className:`s-msg-compose-suggest-item${d?" s-msg-compose-suggest-item--active":""}`,onMouseDown:b=>{b.preventDefault(),r(f)},onMouseEnter:()=>a(f),children:[d&&i.jsx("span",{className:"s-msg-compose-suggest-active-indicator","aria-hidden":"true"}),u.avatarNode?i.jsx("span",{className:"s-msg-compose-suggest-avatar-node","aria-hidden":"true",children:u.avatarNode}):u.avatar?i.jsx("span",{className:"s-ops-avatar s-msg-compose-suggest-avatar",style:{"--size":"20px",background:u.avatar.color},"aria-hidden":"true",children:u.avatar.label}):null,i.jsx("span",{className:"s-msg-compose-suggest-token",children:u.token}),i.jsx("span",{className:"s-msg-compose-suggest-desc",children:u.description}),d&&i.jsx("span",{className:"s-msg-compose-suggest-pick-hint label-xs text-dim",children:i.jsx(Gn,{size:10,"aria-hidden":"true"})})]},u.id)})}),i.jsx("div",{className:"s-msg-compose-suggest-footer",children:i.jsxs("span",{className:"label-xs text-dim",children:[i.jsx("kbd",{className:"s-kbd",children:"↑"})," ",i.jsx("kbd",{className:"s-kbd",children:"↓"})," navigate · ",i.jsx("kbd",{className:"s-kbd",children:"↵"})," select · ",i.jsx("kbd",{className:"s-kbd",children:"esc"})," close"]})})]})}const z="",Ir={none:"no reasoning",minimal:"lightest",low:"triage",medium:"default",high:"deep",xhigh:"exhaustive",max:"fullest",ultra:"beyond max"},Nr=qt.map(e=>({value:e,label:Gs[e],note:Ir[e]}));function _e(e,t){return e.harnesses.find(s=>s.value===t)}function Vt(e,t){return _e(e,t)?.models??[]}function Me(e,t,s){const n=_e(e,t),r=n?n.efforts===null?null:n.efforts??e.efforts:e.efforts;if(!r||!s)return r;const a=new Set((n?.models??[]).map(u=>u.value));return a.has(s)?r.filter(u=>{if(!u.models||u.models.length===0)return!0;const f=u.models.filter(d=>a.has(d));return f.length===0||f.includes(s)}):r}function Qs(e,t){const n=Vt(e,t.harness).find(r=>r.value===t.model);return n||(t.model.trim()?{value:t.model,label:t.model,note:"custom"}:{value:z,label:"Default",note:"harness picks"})}function Er(e,t){const s=_e(e,t.harness),n=s?.label??t.harness??"Default",r=Qs(e,t),a=Me(e,t.harness,t.model),u=a?.find(b=>b.value===t.effort),f=u?.label??t.effort,d=a?`Runtime: ${n}, model ${r.label}, effort ${f}`:`Runtime: ${n}, model ${r.label}`;return{harness:s,harnessLabel:n,model:r,modelLabel:r.label,effort:u,effortLabel:f,supportsEffort:a!==null,summary:d}}function Rr(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 p=Me(e,n.harness,n.model);if(!p||n.effort===z||p.some(Y=>Y.value===n.effort))return n;const F=(Me(e,t.harness,t.model)??e.efforts).findIndex(Y=>Y.value===t.effort),X=Math.min(Math.max(F,0),p.length-1);return n.effort=p[X]?.value??p[0]?.value??z,n}const a=_e(e,n.harness);n.model=s.model??a?.defaultModel??z,s.effort===void 0&&a?.defaultEffort&&(n.effort=a.defaultEffort);const u=Me(e,n.harness,n.model);if(!u)return n.effort=z,n;if(u.some(p=>p.value===n.effort))return n;const d=(Me(e,t.harness,t.model)??e.efforts).findIndex(p=>p.value===t.effort),b=Math.min(Math.max(d,0),u.length-1);return n.effort=u[b]?.value??u[0]?.value??z,n}function Tr(e,t){const s=t?.harness??e.harnesses.find(a=>!a.disabled)?.value??"",n=Me(e,s),r=n?.find(a=>a.note==="default")?.value??n?.[Math.floor((n.length-1)/2)]?.value??z;return{harness:s,model:t?.model??_e(e,s)?.defaultModel??Vt(e,s)[1]?.value??z,effort:n?t?.effort??_e(e,s)?.defaultEffort??r:z}}function Lr(e,t){const s=t.trim().toLowerCase();return s?e.filter(n=>`${n.label} ${n.value} ${n.note??""}`.toLowerCase().includes(s)):e}function Ke(...e){for(const t of e){const s=t?.trim();if(s)return s}}function Zs(e){const t=e.harnesses.map(n=>{const r=e.defaultsByHarness?.[n.id],a=n.ready!==!1,u=[{value:z,label:"Default",note:"harness picks"},...e.models.filter(d=>d.harnesses.includes(n.id)).map(d=>({value:d.id,label:d.label,note:Ke(d.description)}))],f=e.efforts.filter(d=>d.harnesses.includes(n.id));return{value:n.id,label:n.label,note:a?Ke(n.description):Ke(n.detail,n.state,"unavailable"),disabled:!a,defaultModel:r?.model??z,defaultEffort:r?.reasoningEffort??z,models:u,efforts:f.length===0?null:f.map(d=>({value:d.id,label:d.label,note:Ke(d.description),...d.models?.length?{models:[...d.models]}:{}}))}}),s=e.efforts.map(n=>({value:n.id,label:n.label,note:Ke(n.description)}));return{harnesses:t,efforts:s.length>0?s:Nr}}const Pr=6,Lt=34,Pt=460,$r=14,Dr=300,Je=8,$t=["harness","model","effort"],_r={harness:"vertical",model:"vertical",effort:"horizontal"};function Or(){return i.jsx("svg",{className:"s-rt-chip-chevron",width:"8",height:"5",viewBox:"0 0 8 5",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M1 1.2 4 4 7 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Fr({ctx:e}){const{efforts:t,value:s,set:n}=e;if(!t)return null;const r=Math.max(0,t.findIndex(a=>a.value===s.effort));return i.jsx("div",{className:"s-rt-ladder",role:"radiogroup","aria-label":"Reasoning effort",children:t.map((a,u)=>{const f=u===r;return i.jsxs("button",{type:"button",role:"radio","aria-checked":f,title:a.note,onClick:()=>n({effort:a.value}),...e.cell("effort",u),className:"s-rt-step",children:[i.jsx("span",{className:"s-rt-step-bar","data-state":f?"current":u<r?"filled":"empty"}),i.jsx("span",{className:"s-rt-step-label",children:a.label})]},a.value)})})}function Ur({harnessLabel:e}){return i.jsxs("p",{className:"s-rt-effort-absent",children:[e," has no effort control."]})}function Hr({option:e,selected:t,index:s,ctx:n}){const r=e.disabled??!1;return i.jsxs("button",{type:"button",role:"option","aria-selected":t,"aria-disabled":r||void 0,onClick:()=>{r||n.set({model:e.value})},"data-on":t||void 0,"data-disabled":r||void 0,...n.cell("model",s),style:{animationDelay:`${Math.min(s,6)*16}ms`},className:"s-rt-row s-rt-model-row",children:[i.jsx("span",{"aria-hidden":!0,className:"s-rt-dot"}),i.jsx("span",{className:"s-rt-row-label",children:e.label}),e.note?i.jsx("span",{className:"s-rt-note",children:e.note}):null]})}function Br({ctx:e}){return i.jsxs("div",{className:"s-rt-search",children:[i.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 12 12","aria-hidden":"true",className:"s-rt-search-icon",children:[i.jsx("circle",{cx:"5",cy:"5",r:"3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),i.jsx("path",{d:"M7.6 7.6 10.5 10.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),i.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?i.jsx("button",{type:"button",onClick:()=>{e.setQuery(""),e.searchRef.current?.focus()},"aria-label":"Clear filter",className:"s-rt-search-clear",children:"clear"}):null]})}function zr({ctx:e}){return e.status==="loading"?i.jsxs("div",{className:"s-rt-status","aria-busy":!0,role:"status",children:[i.jsx("span",{className:"s-rt-sr",children:"Loading models"}),[0,1,2].map(t=>i.jsx("span",{"aria-hidden":!0,className:"s-rt-skel",style:{animationDelay:`${t*90}ms`}},t))]}):e.status==="error"?i.jsxs("div",{role:"alert",className:"s-rt-status s-rt-status--error",children:[i.jsx("span",{className:"s-rt-status-message",children:e.statusMessage??"Model catalog unavailable."}),e.onRetry?i.jsx("button",{type:"button",onClick:e.onRetry,className:"s-rt-retry",children:"Retry"}):null]}):i.jsx("p",{className:"s-rt-empty",children:e.query.trim()?`No model matches “${e.query.trim()}”.`:"No models listed."})}function Gr({ctx:e}){return e.status!=="ready"||e.models.length===0?i.jsx(zr,{ctx:e}):i.jsx("div",{role:"listbox","aria-label":"Model",className:"s-rt-models",children:e.models.map((t,s)=>i.jsx(Hr,{option:t,index:s,selected:t.value===e.value.model,ctx:e},t.value||"default"))},e.value.harness)}function js({value:e,defaultValue:t,onChange:s,catalog:n,status:r="ready",statusMessage:a,onRetry:u,disabled:f=!1,showEffort:d,searchable:b="auto",className:p}){const[y,F]=l.useState(!1),[X,Y]=l.useState(""),[Ze,et]=l.useState(()=>Tr(n,t)),C=e??Ze,k=l.useRef(null),fe=l.useRef(null),me=l.useRef(null),he=l.useRef(null),A=l.useId(),Se=l.useCallback(m=>{const w=Rr(n,C,m);e===void 0&&et(w),s?.(w),m.harness!==void 0&&m.harness!==C.harness&&Y("")},[n,e,s,C]),P=n.harnesses,Fe=l.useMemo(()=>Vt(n,C.harness),[n,C.harness]),D=l.useMemo(()=>{const m=Qs(n,C);return m.note!=="custom"?Fe:[...Fe,m]},[Fe,n,C]),re=l.useMemo(()=>Lr(D,X),[D,X]),Ue=Me(n,C.harness,C.model),Q=d===!1?null:d===!0?Ue??n.efforts:Ue,$=b==="auto"?D.length>Pr:b,Z=Er(n,C),N=l.useRef(new Map),[pe,R]=l.useState({group:"model",index:0}),T=l.useMemo(()=>({harness:P.length,model:r==="ready"?re.length:0,effort:Q?.length??0}),[Q?.length,P.length,re.length,r]),oe=l.useCallback(m=>m==="harness"?Math.max(0,P.findIndex(w=>w.value===C.harness)):m==="model"?Math.max(0,re.findIndex(w=>w.value===C.model)):Math.max(0,Q?.findIndex(w=>w.value===C.effort)??0),[Q,P,re,C]),E=l.useCallback((m,w)=>{R({group:m,index:w}),N.current.get(`${m}:${w}`)?.focus()},[]),ge=l.useCallback((m,w)=>{const j=$t.indexOf(m);for(let x=j+w;x>=0&&x<$t.length;x+=w){const L=$t[x];if(T[L]>0)return E(L,Math.min(oe(L),T[L]-1)),!0}return!1},[T,E,oe]),tt=l.useCallback((m,w)=>({ref:j=>{const x=`${m}:${w}`;j?N.current.set(x,j):N.current.delete(x)},tabIndex:pe.group===m&&pe.index===w?0:-1,onFocus:()=>R({group:m,index:w}),onKeyDown:j=>{const x=_r[m]==="vertical",L=x?"ArrowDown":"ArrowRight",B=x?"ArrowUp":"ArrowLeft",Be=x?"ArrowRight":"ArrowDown",ae=x?"ArrowLeft":"ArrowUp",ve=T[m];if(ve!==0)if(j.key===L)j.preventDefault(),E(m,(w+1)%ve);else if(j.key===B){if(j.preventDefault(),m==="model"&&w===0&&$){R({group:m,index:0}),he.current?.focus();return}E(m,(w-1+ve)%ve)}else j.key===Be?(j.preventDefault(),ge(m,1)):j.key===ae?(j.preventDefault(),ge(m,-1)):j.key==="Home"?(j.preventDefault(),E(m,0)):j.key==="End"&&(j.preventDefault(),E(m,ve-1))}}),[T,pe,E,ge,$]),Ee=l.useCallback(m=>{if(m.key==="ArrowDown"&&T.model>0)m.preventDefault(),E("model",0);else if(m.key==="Enter"&&T.model===1){m.preventDefault();const w=re[0];w.disabled||Se({model:w.value})}else m.key==="Escape"&&X&&(m.preventDefault(),m.stopPropagation(),Y(""))},[T.model,E,re,X,Se]),[U,He]=l.useState(null),we=l.useCallback(()=>{const m=fe.current;if(!m)return;const w=m.getBoundingClientRect(),j=w.top,x=window.innerHeight-w.bottom,L=j>=Dr||j>=x?"up":"down",B=Math.min(Math.max(Je,w.right-Pt),Math.max(Je,window.innerWidth-Pt-Je));He({left:B,top:L==="up"?w.top-Je:w.bottom+Je,placement:L})},[]);l.useLayoutEffect(()=>{if(!y)return;we();const m=()=>we();return window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[y,we]);const I=l.useCallback(m=>{F(!1),m&&fe.current?.focus()},[]);l.useEffect(()=>{if(!y)return;const m=j=>{const x=j.target;k.current?.contains(x)||me.current?.contains(x)||F(!1)},w=j=>{j.key==="Escape"&&(j.stopPropagation(),I(!0))};return document.addEventListener("pointerdown",m),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",m),document.removeEventListener("keydown",w)}},[y,I]),l.useEffect(()=>{if(!y)return;const m=T.model>0?"model":"harness",w=Math.min(oe(m),Math.max(0,T[m]-1));R({group:m,index:w});const j=requestAnimationFrame(()=>{const x=N.current.get(`${m}:${w}`);x?x.focus():me.current?.focus()});return()=>cancelAnimationFrame(j)},[y]),l.useEffect(()=>{y||Y("")},[y]),l.useEffect(()=>{f&&F(!1)},[f]);const be=Math.max(0,P.findIndex(m=>m.value===C.harness)),H={value:C,set:Se,status:r,statusMessage:a,onRetry:u,harnesses:P,models:re,efforts:Q,harnessLabel:Z.harnessLabel,searchable:$,query:X,setQuery:Y,searchRef:he,cell:tt,onSearchKeyDown:Ee};return i.jsxs("div",{ref:k,className:p?`s-rt-root ${p}`:"s-rt-root",style:{position:"relative",display:"inline-flex"},children:[i.jsxs("button",{ref:fe,type:"button",className:`s-rt-chip${f?" s-rt-chip--disabled":""}`,"aria-haspopup":"dialog","aria-expanded":y,"aria-controls":y?A:void 0,"aria-label":Z.summary,disabled:f,onClick:()=>F(m=>!m),children:[i.jsx(ys,{harness:C.harness||"unknown",size:12,className:"s-rt-chip-mark",title:null}),i.jsxs("span",{className:"s-rt-chip-type",children:[i.jsx("span",{className:"s-rt-chip-model",style:{maxWidth:`${$r}ch`},children:i.jsx("span",{className:"s-rt-chip-model-text",children:Z.modelLabel},Z.modelLabel)}),Q&&Z.effortLabel?i.jsxs(i.Fragment,{children:[i.jsx("span",{"aria-hidden":!0,className:"s-rt-chip-divider"}),i.jsx("span",{className:"s-rt-chip-effort","data-effort":C.effort,children:Z.effortLabel})]}):null]}),i.jsx(Or,{})]}),y&&U?Jn.createPortal(i.jsx("div",{ref:me,id:A,role:"dialog","aria-label":"Runtime",tabIndex:-1,"data-placement":U.placement,className:"s-rt-panel",style:{left:U.left,width:Pt,...U.placement==="up"?{bottom:window.innerHeight-U.top}:{top:U.top}},children:i.jsxs("div",{className:"s-rt-rail",children:[i.jsxs("div",{className:"s-rt-rail-main",children:[i.jsxs("div",{className:"s-rt-harnesses",role:"radiogroup","aria-label":"Harness",children:[i.jsx("span",{"aria-hidden":!0,className:"s-rt-marker",style:{height:Lt-10,transform:`translateY(${be*Lt+5}px)`}}),P.map((m,w)=>{const j=m.value===C.harness,x=m.disabled??!1;return i.jsxs("button",{type:"button",role:"radio","aria-checked":j,"aria-disabled":x||void 0,onClick:()=>{x||H.set({harness:m.value})},style:{height:Lt},"data-on":j||void 0,"data-disabled":x||void 0,title:x?m.note:void 0,...H.cell("harness",w),className:"s-rt-harness",children:[i.jsx(ys,{harness:m.value||"unknown",size:14,className:"s-rt-opt-mark",title:null}),i.jsx("span",{className:"s-rt-harness-label",children:m.label})]},m.value||"default")})]}),i.jsxs("div",{className:"s-rt-models-col",children:[$?i.jsx(Br,{ctx:H}):null,i.jsx(Gr,{ctx:H})]})]}),i.jsx("div",{className:"s-rt-effort-foot",children:Q?i.jsx(Fr,{ctx:H}):i.jsx(Ur,{harnessLabel:Z.harnessLabel})})]})}),document.body):null]})}const Ft="scout:newchat:frame:v1",Wr=620,Ss=420,Cs=300,gt=12,qr=210,Kr=154;function en(e){return e>Wr}function ks(e,t,s){if(!en(s.width))return null;const n=e??t;return n?bt(n,s):null}function Jr(e){return e?Math.max(Kr,Math.round(e.height-qr)):null}function Ms(e,t,s){const n=s-t-gt;return Math.round(Math.max(gt,Math.min(e,n)))}function bt(e,t){const s=Math.round(Math.max(Ss,Math.min(e.width,Math.max(Ss,t.width-gt*2)))),n=Math.round(Math.max(Cs,Math.min(e.height,Math.max(Cs,t.height-gt*2))));return{x:Ms(e.x,s,t.width),y:Ms(e.y,n,t.height),width:s,height:n}}function Vr(e,t,s,n){return bt({...e,x:e.x+t,y:e.y+s},n)}function Xr(e,t,s,n,r){const a=n==="s"?e.width:e.width+t,u=n==="e"?e.height:e.height+s;return bt({...e,width:a,height:u},r)}function Yr(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 Qr(e){if(!e)return null;try{const t=JSON.parse(e);return Yr(t)?{x:t.x,y:t.y,width:t.width,height:t.height}:null}catch{return null}}function As(){try{return typeof localStorage>"u"?null:Qr(localStorage.getItem(Ft))}catch{return null}}function Is(e){try{if(typeof localStorage>"u")return;if(!e){localStorage.removeItem(Ft);return}localStorage.setItem(Ft,JSON.stringify(e))}catch{}}const Ut=or()??"",Ns=Ws(Ut),Ae={schemaVersion:"openscout.runtime-capabilities.v1",catalogVersion:V.schemaVersion,defaults:{harness:Ut,model:Ns,reasoningEffort:qs(Ut,Ns)},defaultsByHarness:cr,harnesses:V.harnesses.filter(e=>e.enabled&&e.listed!==!1).map(e=>({id:e.id,label:e.label})),models:ur.map(e=>({id:e.id,label:e.label,...e.description?{description:e.description}:{},harnesses:[...e.harnesses]})),efforts:mr.map(e=>({id:e.id,label:e.label,...e.description?{description:e.description}:{},harnesses:[...e.harnesses],...e.models?{models:[...e.models]}:{}}))};function _a(e){return Zs({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 Zr="|";function Es(e){return e<55296?e:e<57344?e+8192:e-2048}function eo(e,t){if(e===t)return 0;const s=Math.min(e.length,t.length);for(let n=0;n<s;n+=1){const r=e.charCodeAt(n),a=t.charCodeAt(n);if(r!==a)return Es(r)<Es(a)?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function Rs(e){return Number.isFinite(e)?e:0}function to(e,t){const s=Rs(e.createdAt),n=Rs(t.createdAt);return s!==n?s<n?-1:1:eo(e.id,t.id)}function so(e){return`${Number.isFinite(e.createdAt)?Math.max(0,Math.trunc(e.createdAt)):0}${Zr}${e.id}`}const no=10,ro=80,Ts=300,Ls=100,tn=2e3,oo=no,je=new Map,de=new Map;let sn=0;function Ne(e){return e.trim()}function ao(e){const t=new Map;for(const s of e)t.set(s.id,s);return[...t.values()].sort(to)}function io(){if(je.size<=oo)return;let e=null,t=Number.POSITIVE_INFINITY;for(const[s,n]of je)n.touchedAt<t&&(e=s,t=n.touchedAt);e&&je.delete(e)}function Ie(e){const t=Ne(e),s=je.get(t);return s?(s.touchedAt=++sn,s.messages):null}function Xt(e,t,s={}){const n=Ne(e);if(!n)return[];const r=je.get(n),a=ao(t).slice(-tn);return je.set(n,{messages:a,historyLoaded:s.historyLoaded??r?.historyLoaded??!1,historyExhausted:s.historyExhausted??r?.historyExhausted??!1,touchedAt:++sn}),io(),a}function nn(e,t){const s=Ie(e)??[];return Xt(e,[...s,...t])}function rn(e){return je.get(Ne(e))?.historyLoaded??!1}function co(e){const t=je.get(Ne(e));return!!(t&&t.historyLoaded&&!t.historyExhausted&&t.messages.length>0&&t.messages.length<tn)}async function Oa(e,t={}){const s=Ne(e);if(!s)return[];const n=Ie(s);if(n&&!t.refresh)return n;const r=de.get(s);if(r)return r;const a=W(`/api/messages?conversationId=${encodeURIComponent(s)}&limit=${ro}`).then(u=>nn(s,u));de.set(s,a);try{return await a}finally{de.delete(s)}}async function lo(e){const t=Ne(e);if(!t)return[];if(rn(t))return Ie(t)??[];const s=`${t}:history`,n=de.get(s);if(n)return n;const r=W(`/api/messages?conversationId=${encodeURIComponent(t)}&limit=${Ts}`).then(a=>Xt(t,[...Ie(t)??[],...a],{historyLoaded:!0,historyExhausted:a.length<Ts}));de.set(s,r);try{return await r}finally{de.delete(s)}}async function Fa(e){const t=Ne(e);if(!t)return[];if(!rn(t))return lo(t);if(!co(t))return Ie(t)??[];const s=Ie(t)??[],n=s[0];if(!n)return s;const r=so(n),a=`${t}:before:${r}`,u=de.get(a);if(u)return u;const f=W(`/api/messages?conversationId=${encodeURIComponent(t)}&limit=${Ls}&beforeMessageId=${encodeURIComponent(r)}`).then(d=>Xt(t,[...d,...Ie(t)??[]],{historyLoaded:!0,historyExhausted:d.length<Ls}));de.set(a,f);try{return await f}finally{de.delete(a)}}const uo=12e4,Ye=new Map;function fo(){const e=globalThis.crypto?.randomUUID?.();return e?`web-${e}`:`web-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function mo(e){const t=e.conversationId.trim(),s=e.messageId.trim();if(!t||!s)return;nn(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(),r=e.agentId?.trim();!n||!r||Ye.set(t,{flight:{id:n,invocationId:e.invocationId?.trim()||`pending:${n}`,agentId:r,agentName:null,conversationId:t,collaborationRecordId:null,state:"queued",summary:"Request accepted; waiting for worker activity.",startedAt:e.createdAt,completedAt:null,sessions:[]},expiresAt:Date.now()+uo})}function Ua(e,t=Date.now()){const s=e.trim(),n=Ye.get(s);return n?n.expiresAt<=t?(Ye.delete(s),null):n.flight:null}function Ha(e,t){const s=e.trim(),n=Ye.get(s);n&&(!t||n.flight.id===t)&&Ye.delete(s)}const ho=1200,po=new Set(["Page","URL"]);function on(e){return e.trim().slice(0,ho)}function go(e){const t=[{label:"Page",value:e.pageTitle??""},{label:"URL",value:e.pageUrl??""}];return e.selection?.trim()&&t.push({label:"Selection",value:on(e.selection)}),(e.notes??[]).forEach((s,n)=>{t.push({label:`Note ${n+1}`,value:s})}),t.filter(s=>s.value.trim())}function wo(e,t){const s=[];for(const r of t){const a=r.value.trim();a&&(po.has(r.label)?s.push(`${r.label}: ${a}`):s.push(`${r.label}:
2
- ${a.split(`
3
- `).map(u=>`> ${u}`).join(`
4
- `)}`))}const n=e.trim();return n&&s.push(n),s.join(`
5
-
6
- `)}const bo=6,Ps=1600;function vo(e){return e===0?"":e===1?"[1 attachment remains on the source Scout message; not copied]":`[${e} attachments remain on the source Scout message; not copied]`}function an(e){const t=e.body.trim(),s=vo(e.attachmentCount??0),n=[t,s].filter(Boolean).join(`
7
- `)||"(message has no text)";return n.length<=Ps?n:`${n.slice(0,Ps-1).trimEnd()}…`}function yo(e){const t=an(e).split(/\r?\n/gu).map(s=>`> ${s}`).join(`
8
- `);return`Forwarded from ${e.actorLabel} in Scout
9
-
10
- ${t}`}function Ba(e){const t=e.messages.findIndex(a=>a.id===e.selectedMessageId);if(t<0)throw new Error("The selected message is no longer available in this conversation.");const s=e.messages[t],n=e.messages.slice(Math.max(0,t-bo),t).filter(a=>a.body.trim()||(a.attachmentCount??0)>0),r=n.map(a=>`${a.actorLabel}:
11
- ${an(a)}`).join(`
12
-
13
- `).slice(-8e3).trim();return{selectedMessage:yo(s),selectedMessageId:s.id,sourceConversationId:e.conversationId,...r?{recentContext:r}:{},recentMessageCount:n.length}}function xo(e,t,s){const n=s.trim(),r=t==="instructions-only"?"":t==="recent-context"&&e.recentContext?[`Recent Scout conversation before the forwarded message (${e.recentMessageCount} ${e.recentMessageCount===1?"message":"messages"})`,e.recentContext,e.selectedMessage].join(`
14
-
15
- `):e.selectedMessage;return n?r?`${n}
16
-
17
- ---
18
-
19
- ${r}`:n:r}const cn="openscout.project-recency.v1",ln=12;function un(e){const t=e?.trim();return t?t.length>1?t.replace(/\/+$/u,""):t:null}function Ht(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(cn);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const s=[];for(const n of t){const r=typeof n=="string"?un(n):null;r&&!s.includes(r)&&s.push(r)}return s.slice(0,ln)}catch{return[]}}function $s(e){const t=un(e);if(!t)return Ht();const s=[t,...Ht().filter(n=>n!==t)].slice(0,ln);if(typeof window<"u")try{window.localStorage.setItem(cn,JSON.stringify(s))}catch{}return s}async function jo(e){const t=e.conversationId?.trim();if(t)return t;const s=e.projectRoot?.trim()||e.cwd?.trim(),n=await W("/api/conversations/direct",{method:"POST",body:JSON.stringify({agentId:e.id,targetLabel:e.selector??e.defaultSelector??e.name,...s?{projectPath:s}:{}})}),r=n.chatId?.trim()??n.conversationId?.trim()??n.cId?.trim()??n.id?.trim();if(!r)throw new Error("Chat was created, but no chat id was returned.");return r}function G(e){if(!e)return null;const t=e.replace(/\/+$/,""),s=t.lastIndexOf("/");return s>=0?t.slice(s+1):t}function Oe(e){const t=e?.trim();return t&&(t==="/private/tmp"||t.startsWith("/private/tmp/")?t.replace(/^\/private\/tmp/u,"/tmp"):t).replace(/\/+$/,"")||null}function dn(e){const t=e.replace(/\/+$/,""),s=t.lastIndexOf("/");return s>=0?t.slice(0,s)||"/":null}function Bt(e){return e.split(/[-_\s]+/).filter(Boolean).map(t=>t.slice(0,1).toUpperCase()+t.slice(1)).join(" ")}function fn(e){if(!e)return null;const t=So(e);if(t)return{title:Bt(G(t)??"Unscoped"),root:t};const s=G(e)?.trim().toLowerCase();if(!s||s==="~")return null;const r=s.match(/^(.+?)(?:-(?:parity|codex))?-c\d+$/)?.[1];if(!r)return null;const a=dn(e);return{title:Bt(r),root:a?`${a}/${r}`:r}}function So(e){const t=e.replace(/\/+$/,"");if(/^(?:~|\/Users\/[^/]+)\/\.codex\/worktrees\//u.test(t))return null;const s=t.match(/^(.*)\/([^/]+)-worktrees(?:\/[^/]+)+$/);return s?.[1]&&s[2]?`${s[1]}/${s[2]}`:t.match(/^(.*\/[^/]+)\/(?:\.worktrees|worktrees)(?:\/[^/]+)+$/)?.[1]??null}function Co(e){const s=G(e)?.match(/^(.+)-\d+$/u),n=dn(e);return s?.[1]&&n?`${n}/${s[1]}`:null}function ko(e){const t=e?.trim();if(!t)return null;const s=t.match(/^(\/Users\/[^/]+\/dev\/[^/]+)/);if(s?.[1])return s[1];const n=t.match(/^(~\/dev\/[^/]+)/);if(n?.[1])return n[1];const r=t.match(/\.claude\/projects\/-Users-([^-]+)-dev-([^/]+)/);if(r?.[1]&&r[2]){const a=r[2].split("-packages-")[0]??r[2];return`/Users/${r[1]}/dev/${a}`}return null}function Mo(e){const t=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);if(!t)return e;const s=t[1]??"";return s?`~${s}`:"~"}function Yt(e){const t=Oe(e);if(!t)return null;const n=fn(t)?.root??Co(t)??t,a=Mo(ko(n)??n);return a==="~"||/^\/(Users|home)\/[^/]+$/.test(a)||/^\/(Users|home)$/.test(a)?null:a}function zt(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim().replace(/\s+\d+$/,"").replace(/\s+/g,"")}function Ao(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-\d+$/,"")}function Io(e){let t=2166136261;for(let s=0;s<e.length;s++)t^=e.charCodeAt(s),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Ds(e){const t=e.root??"";return t?Gt(t)?3:t.startsWith("~/dev/")||/^\/Users\/[^/]+\/dev\//.test(t)?0:t.startsWith("~/")?1:2:4}function No(e,t){return Ds(e)-Ds(t)||e.key.localeCompare(t.key)}function Eo(e){const t=new Map;for(const s of e){const n=t.get(s.slug)??[];n.push(s),t.set(s.slug,n)}for(const s of t.values()){if(s.length<=1)continue;const n=[...s].sort(No)[0];for(const r of s)r!==n&&(r.slug=`${r.slug}-${Io(r.key)}`)}}function Ro(e,t){const s=Yt(e);return s?`root:${s}`:`project:${zt(t)||"unscoped"}`}function Gt(e){return!!(e?.startsWith("/tmp/")||e?.startsWith("/private/tmp/")||e?.startsWith("/var/tmp/")||e?.startsWith("/private/var/tmp/")||/^\/(?:private\/)?var\/folders\/[^/]+\/[^/]+\/T\//.test(e??""))}function _s(e,t){const s=Yt(t),n=s?Bt(G(s)??(e?.trim()||"Unscoped")):e?.trim()||"Unscoped";return{key:Ro(s,n),title:n,root:s,slug:Ao(G(s)??n)||"unscoped"}}const To=new Set(["empty","unknown","unscoped","untitled","general"]);function Lo(e,t){e.agents.push(...t.agents),e.scoutSessions.push(...t.scoutSessions),e.nativeSessions.push(...t.nativeSessions),e.workflows.push(...t.workflows)}function Po(e){const t=new Map;for(const s of e.values()){if(!s.root)continue;const n=zt(G(s.root)??s.title);n&&!t.has(n)&&t.set(n,s)}for(const[s,n]of[...e.entries()]){if(n.root)continue;const r=zt(n.title),a=r?t.get(r):void 0;a?(Lo(a,n),e.delete(s)):(!r||To.has(n.title.trim().toLowerCase())||n.agents.length===0&&n.scoutSessions.length===0)&&e.delete(s)}}function za(e,t){if(t.filter(r=>r.name===e.name).length<=1)return{name:e.name,qualifier:null};const n=e.project??e.branch??e.id.replace(/^.*\./,"");return{name:e.name,qualifier:n}}function Ga(e){const t=[...e].filter(r=>r.kind==="direct"&&!!r.agentId).sort((r,a)=>(a.lastMessageAt??0)-(r.lastMessageAt??0)),s=new Map,n=new Map;for(const r of t){const a=n.get(r.agentId);(!a||$o(r,a))&&(s.set(r.agentId,r.id),n.set(r.agentId,r))}return{conversationByAgentId:s,sessionByAgentId:n}}function $o(e,t){const s=e.lastMessageAt??0,n=t.lastMessageAt??0;return s!==n?s>n:e.id<t.id}const ft={needs_attention:0,in_turn:1,in_flight:2,callable:3,blocked:4},Do=6e4;function Qe(e,t){const s=Oe(t),n=fn(s);return n?_s(n.title,n.root):_s(e,s)}function _o(e){const t=Oe(e.agent.projectRoot??e.agent.cwd),s=e.agent.project??e.project;return Qe(s,t)}function Oo(e){return Qe(e.project,e.cwd)}function Fo(e){return Qe(e.agentName??e.title,e.workspaceRoot)}function Uo(e){return Qe(e.project.title,e.project.root)}function wt(e){const t=e?.trim();if(!t)return null;const s=G(t)??t;return s.endsWith(".jsonl")?s.slice(0,-6):s}function Pe(e,t){const s=t?.trim();s&&e.add(s.toLowerCase());const n=wt(s);n&&e.add(n.toLowerCase())}function mn(e){const t=new Set;return Pe(t,e.agent.conversationId),Pe(t,e.agent.harnessSessionId),Pe(t,e.agent.harnessLogPath),Pe(t,e.session?.id),Pe(t,e.session?.harnessSessionId),Pe(t,e.session?.harnessLogPath),t}function De(e,t){const s=t?.trim();if(s&&e.has(s.toLowerCase()))return!0;const n=wt(s);return!!(n&&e.has(n.toLowerCase()))}function Ho(e,t){if(e.agentId&&e.agentId===t.agent.id)return!0;const s=mn(t);return De(s,e.id)||De(s,e.harnessSessionId)||De(s,e.harnessLogPath)}function Bo(e,t){const s=e?.command?.toLowerCase();return s?[t.agent.id,t.agent.selector?.replace(/^@/,"").replace(/\.node:.+$/,""),t.agent.defaultSelector?.replace(/^@/,"").replace(/\.node:.+$/,""),t.agent.harnessSessionId].filter(r=>!!(r&&r.length>=8)).some(r=>s.includes(r.toLowerCase())):!1}function zo(e,t){const s=mn(t);return De(s,e.refId)||De(s,e.sessionId)||De(s,e.transcriptPath)||Bo(e.process,t)}function Wa(e,t){if(!e)return[];const s=[];for(const n of e.transcripts??[]){const r=n.source||"unknown",a=wt(n.sessionId)??wt(n.transcriptPath);if(!a)continue;const u=(n.lastEventAt??n.mtimeMs)||null;s.push({key:`transcript:${n.transcriptPath}`,refId:a,source:r,project:n.project?.trim()||G(n.cwd)||G(n.transcriptPath)||"unknown",cwd:Oe(n.cwd),transcriptPath:n.transcriptPath,sessionId:n.sessionId,mtimeMs:n.mtimeMs,size:n.size,status:u&&t-u<=Do?"active":"idle",process:null,lastActivityAt:u})}for(const n of e.processes??[]){const r=n.source||"unknown",a=Oe(n.cwd);s.push({key:`process:${r}:${n.pid}`,refId:`pid-${n.pid}`,source:r,project:G(a)??"unknown",cwd:a,transcriptPath:null,sessionId:null,mtimeMs:null,size:null,status:"active",process:n,lastActivityAt:null})}return s.sort((n,r)=>{const a=(n.status==="active"?0:1)-(r.status==="active"?0:1);return a!==0?a:(r.lastActivityAt??0)-(n.lastActivityAt??0)||n.project.localeCompare(r.project)})}function Go(e){if(!e)return"—";const t=e.replace(/^session[_:-]?/i,"");return t.length>10?t.slice(0,8):t}function $e(e){const t=e?.trim();return t||void 0}function Wo(e){const t=$e(e.projectRoot)??$e(e.cwd);return{target:{agentId:e.id,...t?{projectPath:t}:{}},execution:{session:"new",...$e(e.harness)?{harness:$e(e.harness)}:{},...$e(e.model)?{model:$e(e.model)}:{}}}}function qo(e){if(e.length===0)return null;const t={working:0,needs_attention:1,queued:2,failed:3,completed:4},s=[...e].sort((n,r)=>{const a=t[n.status]-t[r.status];return a!==0?a:(r.updatedAt??0)-(n.updatedAt??0)})[0];return(s.summary??s.task??s.statusLabel??"").trim()||null}function qa(e,t,s){const n=Vn(e.state,e),r=e.project??G(e.projectRoot)??"Unscoped",a=e.branch??"—",u=Ot(e.harness)??Ot(e.agentClass)??"agent";return{agent:e,status:n,stateLabel:Xn(e.state,e),project:r,branch:a,harness:u,session:t,activeTask:qo(s),activeAskCount:s.length,lastActivityAt:Math.max(0,t?.lastMessageAt??0,e.updatedAt??0)||null}}function Ko(e){return{...e,agents:[],scoutSessions:[],nativeSessions:[],workflows:[],status:"callable",lastActivityAt:null}}function mt(e,t){const s=e.get(t.key);if(s)return t.root&&(!s.root||Gt(s.root)&&!Gt(t.root))&&(s.root=t.root),s;const n=Ko(t);return e.set(t.key,n),n}function Jo(e){const t=e.agents.some(p=>p.status==="in_turn"||p.status==="in_flight"),s=e.nativeSessions.some(p=>p.status==="active"),n=e.workflows.some(p=>p.activeTaskCount>0||p.status==="running"),r=e.agents.some(p=>p.status==="callable");e.status=t||s||n?"in_turn":r?"callable":"blocked";const a=e.agents.map(p=>p.lastActivityAt??0),u=e.scoutSessions.map(p=>p.lastMessageAt??0),f=e.nativeSessions.map(p=>p.lastActivityAt??0),d=e.workflows.map(p=>p.lastActivityAt??0),b=Math.max(0,...a,...u,...f,...d);e.lastActivityAt=b||null}function Vo(e,t,s,n){const r=new Map,a=new Map;for(const d of e){const b=_o(d);mt(r,b).agents.push(d),a.set(d.agent.id,b.key)}for(const d of s)mt(r,Oo(d)).nativeSessions.push(d);for(const d of n)mt(r,Uo(d)).workflows.push(d);const u=new Map;for(const d of t){const b=d.agentId?a.get(d.agentId):void 0,p=b?r.get(b)??null:Yt(d.workspaceRoot)?mt(r,Fo(d)):null;if(!p)continue;const y=p,F=u.get(y.key)??new Set;F.has(d.id)||(F.add(d.id),u.set(y.key,F),y.scoutSessions.push(d))}Po(r);for(const d of r.values())d.agents.sort((b,p)=>{const y=ft[b.status]-ft[p.status];return y!==0?y:(p.lastActivityAt??0)-(b.lastActivityAt??0)||b.agent.name.localeCompare(p.agent.name)}),d.scoutSessions.sort((b,p)=>(p.lastMessageAt??0)-(b.lastMessageAt??0)),d.nativeSessions.sort((b,p)=>{const y=(b.status==="active"?0:1)-(p.status==="active"?0:1);return y!==0?y:(p.lastActivityAt??0)-(b.lastActivityAt??0)}),d.workflows.sort((b,p)=>{const y=(p.activeTaskCount>0?1:0)-(b.activeTaskCount>0?1:0);return y!==0?y:(p.lastActivityAt??0)-(b.lastActivityAt??0)||b.label.localeCompare(p.label)}),Jo(d);const f=[...r.values()];return Eo(f),f.sort((d,b)=>{const p=ft[d.status]-ft[b.status];return p!==0?p:(b.lastActivityAt??0)-(d.lastActivityAt??0)||d.title.localeCompare(b.title)})}function Os(e){const t=Ot(e.harness)??"scout";return{key:`scout:${e.id}`,kind:"scout",status:e.kind,harness:t,label:e.title||e.agentName||e.id,detail:e.preview??e.id,lastActivityAt:e.lastMessageAt,route:{view:"conversation",conversationId:e.id}}}function Fs(e){return{key:`native:${e.key}`,kind:"native",status:e.status,harness:e.source,label:Go(e.sessionId??e.refId),detail:e.transcriptPath??e.process?.command??e.cwd,lastActivityAt:e.lastActivityAt,route:e.sessionId||e.transcriptPath?{view:"sessions",sessionId:e.refId}:null}}function Xo(e,t){return e.agent.name.localeCompare(t.agent.name)||e.agent.id.localeCompare(t.agent.id)}function Us(e){const t={workflow:0,native:1,scout:2};return[...e].sort((s,n)=>{const r=t[s.kind]-t[n.kind];return r!==0?r:s.harness.localeCompare(n.harness)||s.key.localeCompare(n.key)})}function Yo(e){const t=new Set,s=new Set,n=[...e.agents].sort(Xo).map(a=>{const u=[];for(const f of e.scoutSessions)t.has(f.id)||Ho(f,a)&&(t.add(f.id),u.push(Os(f)));for(const f of e.nativeSessions)s.has(f.key)||zo(f,a)&&(s.add(f.key),u.push(Fs(f)));return{key:a.agent.id,row:a,sessions:Us(u)}}),r=Us([...e.nativeSessions.filter(a=>!s.has(a.key)).map(Fs),...e.scoutSessions.filter(a=>!t.has(a.id)).map(Os)]);return{agents:n,unassignedSessions:r}}const Qo=e=>e.status==="in_turn"||e.status==="in_flight";function Zo(e){let t=e.row.lastActivityAt??0;for(const s of e.sessions)t=Math.max(t,s.lastActivityAt??0);return t}function Hs(e){return e.agents.filter(t=>Qo(t.row)).length}function Bs(e){return e.agents.some(t=>t.row.activeAskCount>0)}function Ka(e,t,s){const r=Vo(e,t,s,[]).map(a=>{const u=Yo(a);let f=0;for(const d of u.agents)f=Math.max(f,Zo(d));for(const d of u.unassignedSessions)f=Math.max(f,d.lastActivityAt??0);return{slice:a,agents:u.agents,unassigned:u.unassignedSessions,lastActivityAt:f}});return r.sort((a,u)=>{const f=Bs(a)?1:0,d=Bs(u)?1:0;if(f!==d)return d-f;const b=Hs(a),p=Hs(u);return b!==p?p-b:u.lastActivityAt-a.lastActivityAt}),r}function Ja(e,t){if(!t)return null;const s=t.trim().replace(/^@+/,"");if(!s)return null;const n=e.find(f=>f.id===s);if(n)return n;if(s.split(".").filter(Boolean).length>=3)return null;const a=e.filter(f=>f.handle===s||f.selector===`@${s}`||f.defaultSelector===`@${s}`||f.id.startsWith(`${s}.`)),u=Array.from(new Map(a.map(f=>[f.id,f])).values());return u.length===1?u[0]:null}function Va(e){const s=e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean);return s[s.length-1]??e}function Xa(e){const t=Oe(e.projectRoot??e.cwd),s=e.project??G(t);return Qe(s,t)}function Ve(e){const t=e?.trim();return t?t.length>1?t.replace(/\/+$/u,""):t:null}function Wt(e){return e.split("/").filter(Boolean).at(-1)??e}function ea(e,t,s="claude"){const n=new Map;for(const r of e){const a=Ve(r.root);a&&n.set(a,{id:r.id||`project:${a}`,title:r.title?.trim()||Wt(a),root:a,defaultHarness:r.defaultHarness?.trim()||s,source:"inventory",registrationKind:r.registrationKind?.trim()||null})}for(const r of t){const a=Ve(r.projectRoot??r.cwd);!a||n.has(a)||n.set(a,{id:`agent-project:${a}`,title:r.project?.trim()||Wt(a),root:a,defaultHarness:r.harness?.trim()||s,source:"agent",registrationKind:null})}return[...n.values()].sort((r,a)=>r.title.localeCompare(a.title,void 0,{sensitivity:"base"})||r.root.localeCompare(a.root))}function ta(e,t){const s=e.title.toLocaleLowerCase(),n=e.root.toLocaleLowerCase(),r=Wt(e.root).toLocaleLowerCase();return s===t||r===t||n===t?0:s.startsWith(t)||r.startsWith(t)?1:n.startsWith(t)?2:t.split(/\s+/u).filter(Boolean).every(u=>s.includes(u)||n.includes(u))?3:null}function sa(e,t){if(t.length===0)return[...e];const s=new Map(e.map(a=>[a.root,a])),n=[],r=new Set;for(const a of t){const u=s.get(a);!u||r.has(a)||(r.add(a),n.push(u))}return[...n,...e.filter(a=>!r.has(a.root))]}function na(e,t){const s=t.trim().toLocaleLowerCase();return s?e.map(n=>({project:n,score:ta(n,s)})).filter(n=>n.score!==null).sort((n,r)=>n.score-r.score||n.project.title.localeCompare(r.project.title,void 0,{sensitivity:"base"})||n.project.root.localeCompare(r.project.root)).map(n=>n.project):[...e]}function ra(e,t){return e===t||e.startsWith(`${t}/`)}function oa(e,t){const s=Ve(t.preferredRoot);if(s){const r=e.find(a=>a.root===s);if(r)return r}for(const r of t.recentRoots??[]){const a=Ve(r);if(!a)continue;const u=e.find(f=>f.root===a);if(u)return u}const n=Ve(t.currentDirectory);if(n){const r=e.filter(a=>ra(n,a.root)).sort((a,u)=>u.root.length-a.root.length)[0];if(r)return r}return e[0]??null}async function aa(e){await W("/api/send",{method:"POST",body:JSON.stringify({conversationId:e.conversationId,body:e.body?.trim()??"",attachments:e.attachments})})}async function ia(e,t){const s=t?.attachments?.filter(Boolean)??[],n=t?.instructions?.trim(),r=Wo(e),a=n||s.length>0?{...r,seed:{...n?{instructions:n}:{},...s.length>0?{attachments:s}:{},...t?.clientMessageId?{clientMessageId:t.clientMessageId}:{}}}:r;return await W("/api/sessions",{method:"POST",body:JSON.stringify(a)})}async function ca(e){const t=e.projectPath.trim(),s=e.harness?.trim(),n=e.model?.trim(),r=e.reasoningEffort?.trim(),a=e.instructions?.trim(),u=e.fromMessageId?.trim(),f=e.fromConversationId?.trim(),d=e.attachments?.filter(Boolean)??[];return W("/api/sessions",{method:"POST",body:JSON.stringify({target:{projectPath:t},execution:{session:"new",...s?{harness:s}:{},...n?{model:n}:{},...r?{reasoningEffort:r}:{}},agent:{persistence:"one_time"},...a||d.length>0||u&&f?{seed:{...a?{instructions:a}:{},...d.length>0?{attachments:d}:{},...e.clientMessageId?{clientMessageId:e.clientMessageId}:{},...u&&f?{fromMessageId:u,fromConversationId:f}:{}}}:{}})})}async function Ya(e){return W("/api/sessions",{method:"POST",body:JSON.stringify({target:{agentId:e.agentId.trim()},execution:{session:"existing",targetSessionId:e.sessionId.trim()},seed:{instructions:e.instructions.trim()}})})}function la(e){const t=e?.trim().toLowerCase();if(t)switch(t){case"claude":case"claude-code":case"claude_code":case"claude_stream_json":return"claude";case"codex":case"codex_app_server":return"codex";case"pi":case"pi_rpc":return"pi";case"cursor":case"cursor_exec":return"cursor";case"grok":return"grok";case"grok-acp":case"grok_acp":return"grok-acp";case"kimi":return"kimi";case"opencode":case"opencode_acp":return"opencode";default:return}}function Qa(e){const t=la(e);return t&&["claude","codex","grok","opencode","pi"].includes(t)?t:void 0}async function Za(e){const t=e.projectPath.trim(),s=e.sessionId.trim(),n=e.instructions.trim(),r=e.harness?.trim()||void 0,a=e.model?.trim()||void 0,u=e.reasoningEffort?.trim()||void 0;return W("/api/sessions",{method:"POST",body:JSON.stringify({target:{projectPath:t},execution:{session:"existing",targetSessionId:s,...r?{harness:r}:{},...a?{model:a}:{},...u?{reasoningEffort:u}:{}},seed:{instructions:n}})})}async function ua(e,t){const s=t.message?.trim();if(t.mode==="existing-chat"){const a=await jo(e);return await aa({conversationId:a,body:s||"Shared capture",attachments:t.attachments}),{conversationId:a,agentId:e.id}}const n=await ia(e,{instructions:s||"Shared capture for context.",attachments:t.attachments}),r=n.conversationId?.trim();if(!r)throw new Error("Session started, but no conversation was returned.");return{conversationId:r,agentId:n.agentId?.trim()||e.id}}const hn=Ae.harnesses.map(e=>({id:e.id,label:e.label??e.id,description:null,state:null,ready:null,detail:null})),da=Ae.models.map(e=>({id:e.id,label:e.label??e.id,description:e.description??null,harnesses:[...e.harnesses],source:"catalog"})),fa=Ae.efforts.map(e=>({...e,harnesses:[...e.harnesses],...e.models?{models:[...e.models]}:{}})),ht={defaults:{harness:Ae.defaults?.harness??"claude",model:Ae.defaults?.model??null,reasoningEffort:Ae.defaults?.reasoningEffort??"medium"},defaultsByHarness:Ae.defaultsByHarness,harnesses:hn,models:da,efforts:fa};let Dt=null;const zs=5;function ma(e,t){const s=e.defaults.harness===t?e.defaults.model?.trim()??"":"";return s&&e.models.some(n=>n.id===s&&n.harnesses.includes(t))?s:e.models.find(n=>n.harnesses.includes(t))?.id??""}function ha(e,t){const s=e.efforts.filter(n=>n.harnesses.includes(t));return s.find(n=>n.id===e.defaults.reasoningEffort)?.id??s.find(n=>n.id==="medium")?.id??s[0]?.id??""}function pa(e){return URL.createObjectURL(e)}function _t(e){return e.replace(/^\/Users\/[^/]+/u,"~")}function ga(e){return e.split("/").filter(Boolean).at(-1)??e}function wa(e){const t=e.trim();return t.startsWith("/")||t.startsWith("~/")}function ba({file:e,onRemove:t}){const s=l.useMemo(()=>pa(e),[e]);l.useEffect(()=>()=>URL.revokeObjectURL(s),[s]);const n=e.type.startsWith("video/"),r=e.type.startsWith("image/");return i.jsxs("div",{className:"s-newchat-attachment",children:[n?i.jsx("video",{src:s,muted:!0,playsInline:!0}):r?i.jsx("img",{src:s,alt:e.name}):i.jsxs("div",{className:"s-newchat-attachment-file",title:e.name,children:[i.jsx(nr,{size:24,"aria-hidden":"true"}),i.jsx("span",{children:e.name})]}),i.jsx("span",{className:"s-newchat-attachment-badge",children:n?"video":r?"image":"file"}),i.jsx("button",{type:"button",className:"s-newchat-attachment-remove","aria-label":`Remove ${e.name}`,onClick:t,children:"×"})]})}function pt(){return{width:window.innerWidth,height:window.innerHeight}}function va({agents:e,route:t,navigate:s,onClose:n,initialAgentId:r,initialConversationId:a,initialMessage:u,initialFiles:f,initialAttachmentFeedback:d,initialIntent:b="new-task",initialProjectPath:p,initialForwardContext:y,initialForwardContextMode:F="selected-message",defaultMode:X,draftRestored:Y=!1,onDraftChange:Ze,onDraftConsumed:et}){const C=l.useMemo(()=>Ar(t,e),[t,e]),k=b==="forward-message"&&!!y,fe=l.useMemo(()=>[...e].sort((o,c)=>(c.updatedAt??0)-(o.updatedAt??0)),[e]),me=b==="route-capture"?r??C.agentId??null:null,he=b==="route-capture"?a??C.conversationId:null,A=fe.find(o=>o.id===me)??null,Se=A?.projectRoot??A?.cwd??null,[P,Fe]=l.useState(null),[D,re]=l.useState(Dt),[Ue,Q]=l.useState(null),[$,Z]=l.useState(null),[N,pe]=l.useState(()=>p||Se||""),[R,T]=l.useState(""),[oe,E]=l.useState(0),[ge,tt]=l.useState(()=>Ht()),[Ee,U]=l.useState(!1),[He,we]=l.useState(null),[I,be]=l.useState(()=>u??""),[H,m]=l.useState(F),[w,j]=l.useState({open:!1,query:"",triggerStart:-1,index:0}),[x,L]=l.useState({open:!1,query:"",triggerStart:-1,index:0}),[B,Be]=l.useState(()=>[...f??[]]),[ae,ve]=l.useState(()=>X||(he?"existing-chat":"new-session")),[pn,Qt]=l.useState("idle"),[gn,vt]=l.useState("idle"),[Zt,Ce]=l.useState(null),[st,es]=l.useState(()=>d??null),[ze]=l.useState(()=>{if(typeof window>"u")return{title:"",url:"",selection:""};const o=document.activeElement,c=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement;return{title:document.title,url:window.location.href,selection:c?"":on(window.getSelection()?.toString()??"")}}),[yt,wn]=l.useState(!1),[ie,ts]=l.useState(()=>A?.harness?.trim()||ht.defaults.harness),[nt,ss]=l.useState(()=>A?.model?.trim()||ht.defaults.model||""),[rt,ns]=l.useState(ht.defaults.reasoningEffort||""),[xt,rs]=l.useState(()=>Y?"Restored your unsent draft.":null),[bn,jt]=l.useState(0),{ref:St,onKeyDown:vn}=Zn(!0),_=l.useRef(null),Ct=l.useRef(null),ke=l.useRef(0),ot=l.useRef(!!p),os=l.useRef(!1),[ee,Re]=l.useState(null),[yn,kt]=l.useState(null),Ge=l.useRef(null);l.useEffect(()=>{typeof window>"u"||Re(ks(null,As(),pt()))},[]),l.useEffect(()=>{if(typeof window>"u")return;const o=()=>{Re(c=>{const g=pt();return ks(c,c?null:As(),g)})};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]);const xn=l.useCallback(()=>{if(ee)return ee;const o=St.current;if(!o)return null;const c=o.getBoundingClientRect();return{x:Math.round(c.left),y:Math.round(c.top),width:Math.round(c.width),height:Math.round(c.height)}},[ee,St]),jn=(o,c)=>{if(typeof window>"u"||o.button!==0||!en(window.innerWidth)||!c&&o.target?.closest("button"))return;const g=xn();g&&(o.preventDefault(),o.currentTarget.setPointerCapture(o.pointerId),Ge.current={base:g,x:o.clientX,y:o.clientY,edge:c},kt(c?"resize":"move"),Re(bt(g,pt())))},Sn=o=>{const c=Ge.current;if(!c)return;const g=o.clientX-c.x,h=o.clientY-c.y,v=pt();Re(c.edge?Xr(c.base,g,h,c.edge,v):Vr(c.base,g,h,v))},as=o=>{if(Ge.current){Ge.current=null,kt(null);try{o.currentTarget.releasePointerCapture(o.pointerId)}catch{}Re(c=>(c&&Is(c),c))}},Cn=()=>{Ge.current=null,kt(null),Re(null),Is(null)},at=o=>({onPointerDown:c=>jn(c,o),onPointerMove:Sn,onPointerUp:as,onPointerCancel:as}),is=Jr(ee),kn=ee?{position:"absolute",left:ee.x,top:ee.y,width:ee.width,height:ee.height,maxWidth:"none",maxHeight:"none",...is?{"--s-newchat-input-min":`${is}px`}:{}}:void 0,te=l.useMemo(()=>sa(ea(P?.projects??[],e,P?.context.defaultHarness??"claude"),ge),[e,P,ge]),M=te.find(o=>o.root===N)??null??(N?{id:`direct:${N}`,title:ga(N),root:N,defaultHarness:P?.context.defaultHarness??A?.harness??"claude",source:"agent",registrationKind:null}:null),Mt=l.useMemo(()=>{const o=new Set,c=M?fe.filter(h=>h.projectRoot?.trim()===M.root||h.cwd?.trim()===M.root):[];return(c.length>0?c:fe).flatMap(h=>{if(h.retiredFromFleet)return[];const v=h.handle?.trim().replace(/^@+/,"")||Wn(h.id)||"",K=v.toLowerCase();return!v||o.has(K)?[]:(o.add(K),[{id:h.id,label:v,name:h.name||v,handle:v}])})},[M,fe]),se=(D?.harnesses??hn).find(o=>o.id===ie)??null,Te=!D&&!$,cs=l.useMemo(()=>{const o=Zs(D??ht);return ie&&!o.harnesses.some(c=>c.value===ie)?{...o,harnesses:[...o.harnesses,{value:ie,label:ie,models:[{value:"",label:"Default",note:"harness picks"}]}]}:o},[D,ie]),We=l.useMemo(()=>na(te,R),[R,te]),ne=l.useMemo(()=>{const o=We.slice(0,zs);if(!N||o.some(g=>g.root===N))return o;const c=We.find(g=>g.root===N);return c?[c,...o.slice(0,zs-1)]:o},[We,N]),ye=wa(R)&&!te.some(o=>o.root===R.trim())?R.trim():null,it=ne.length+(ye?1:0),Mn=Math.max(0,(R.trim()?We.length:te.length)-ne.length),An=!!(A&&M&&[A.projectRoot,A.cwd].some(o=>o?.trim()===M.root)),q=B.length>0,S=pn==="starting",ls=bn>0,ct=An&&!!(A?.conversationId||he),xe=!q||!ct||ae==="new-session",us=xe&&(Te||se?.ready===!1),ds=k?"Forward to new task":q?"Route capture":"New task",fs=l.useMemo(()=>k?[]:go({pageTitle:ze.title,pageUrl:ze.url,selection:yt?ze.selection:void 0}),[yt,k,ze]),ce=k&&y?xo(y,H,I):wo(I,fs),In=gn==="uploading"?"Uploading capture":k?"Forwarding to new task":q?"Routing capture":"Sending message",Nn=q?`Submitted to ${M?.title??A?.name??"Scout"}. Opening the chat when the broker returns it.`:ce?`Routing your first message through /${M?.title??A?.name??"project"}.`:`Starting a project-routed chat in /${M?.title??A?.name??"project"}.`,ms=q&&ct,En=xe&&(Te||!!$||se?.ready===!1),Rn=ms||!k&&En,le=l.useMemo(()=>{if(!w.open)return[];const o=w.query.toLowerCase();return o?vs.filter(c=>c.command.toLowerCase().startsWith(`/${o}`)||c.command.toLowerCase().includes(o)):vs},[w.open,w.query]),ue=l.useMemo(()=>{if(!x.open)return[];const o=x.query.toLowerCase();return o?Mt.filter(c=>c.handle.toLowerCase().includes(o)||c.name.toLowerCase().includes(o)||c.label.toLowerCase().includes(o)).slice(0,8):Mt.slice(0,8)},[Mt,x.open,x.query]),At=l.useCallback(()=>{j(o=>o.open?{...o,open:!1}:o),L(o=>o.open?{...o,open:!1}:o)},[]),qe=l.useCallback((o,c)=>{const g=qn(o,c);j(v=>g?{open:!0,query:g.query,triggerStart:g.start,index:v.open&&v.triggerStart===g.start?v.index:0}:v.open?{...v,open:!1}:v);const h=Kn(o,c);L(v=>h?{open:!0,query:h.query,triggerStart:h.start,index:v.open&&v.triggerStart===h.start?v.index:0}:v.open?{...v,open:!1}:v)},[]),Tn=l.useCallback((o,c)=>{be(o),qe(o,c?.caret??o.length)},[qe]),It=l.useCallback(o=>{const c=w.triggerStart;if(c<0)return;const g=_.current?.selectionStart??I.length,h=I.slice(0,c),v=I.slice(g),K=`${h}${o.insert}${v}`;be(K),j(J=>({...J,open:!1})),requestAnimationFrame(()=>{const J=_.current;if(!J)return;const O=h.length+o.insert.length;J.focus(),J.setSelectionRange(O,O)})},[I,w.triggerStart]),Nt=l.useCallback(o=>{const c=x.triggerStart;if(c<0)return;const g=_.current?.selectionStart??I.length,h=I.slice(0,c),v=I.slice(g),K=`@${o.handle}${v.length===0||!v.startsWith(" ")?" ":""}`,J=`${h}${K}${v}`;be(J),L(O=>({...O,open:!1})),requestAnimationFrame(()=>{const O=_.current;if(!O)return;const Le=h.length+K.length;O.focus(),O.setSelectionRange(Le,Le)})},[x.triggerStart,I]),hs=l.useCallback(o=>{if(S)return;const g=_.current?.selectionStart??I.length,h=I.slice(0,g),v=I.slice(g),J=`${h&&!/\s$/.test(h)?" ":""}${o}`,O=`${h}${J}${v}`,Le=h.length+J.length;be(O),qe(O,Le),requestAnimationFrame(()=>{const Rt=_.current;Rt&&(Rt.focus(),Rt.setSelectionRange(Le,Le))})},[S,I,qe]),Ln=l.useCallback(o=>{const c=w.open&&le.length>0,g=x.open&&ue.length>0;if(!c&&!g)return!1;if(o.key==="ArrowDown")return c?j(h=>({...h,index:(h.index+1)%le.length})):L(h=>({...h,index:(h.index+1)%ue.length})),!0;if(o.key==="ArrowUp")return c?j(h=>({...h,index:(h.index-1+le.length)%le.length})):L(h=>({...h,index:(h.index-1+ue.length)%ue.length})),!0;if(o.key==="Escape")return At(),!0;if((o.key==="Enter"||o.key==="Tab")&&!o.shiftKey&&!o.metaKey&&!o.ctrlKey&&!o.altKey){if(c){const h=le[w.index]??le[0];h&&It(h)}else{const h=ue[x.index]??ue[0];h&&Nt(h)}return!0}return!1},[Nt,It,At,ue,le,x.index,x.open,w.index,w.open]),Et=l.useCallback(()=>{S||n()},[S,n]),Pn=l.useCallback(()=>{rs("Draft kept open. Use Esc or × when you are ready to close it."),requestAnimationFrame(()=>_.current?.focus())},[]);l.useEffect(()=>{const o=c=>{c.key==="Escape"&&(c.preventDefault(),Et())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[Et]),l.useEffect(()=>{if(!xt)return;const o=window.setTimeout(()=>rs(null),5e3);return()=>window.clearTimeout(o)},[xt]),l.useEffect(()=>{_.current?.focus()},[]),l.useEffect(()=>{let o=!1;return W("/api/agent-config/snapshot").then(c=>{o||(Fe(c),Q(null))}).catch(c=>{o||Q(c instanceof Error?c.message:"Could not load projects.")}),()=>{o=!0}},[]);const lt=l.useCallback(()=>{W("/api/runner/options").then(o=>{Dt=o,re(o),Z(null)}).catch(()=>{Dt||Z("Model catalog unavailable. Harness defaults are still available.")})},[]);l.useEffect(()=>{lt()},[lt]),l.useEffect(()=>{if(ot.current||te.length===0)return;const o=oa(te,{preferredRoot:Se,currentDirectory:P?.context.currentDirectory,recentRoots:ge});o&&pe(o.root)},[P?.context.currentDirectory,Se,te,ge]),l.useEffect(()=>{if(os.current)return;const o=M?.defaultHarness?.trim()||A?.harness?.trim()||D?.defaults.harness||"claude";if(ts(o),!D)return;const c=A?.model?.trim()??"",g=D.models.some(h=>h.id===c&&h.harnesses.includes(o));ss(g?c:ma(D,o)),ns(ha(D,o))},[A?.harness,A?.model,D,M?.defaultHarness,M?.root]),l.useLayoutEffect(()=>{Ze?.({intent:b,...me?{agentId:me}:{},...he?{conversationId:he}:{},message:I,files:B,attachmentFeedback:st,mode:ae,projectPath:N,projectQuery:R,...k&&y?{forwardContext:y}:{},forwardContextMode:H})},[st,B,H,y,b,k,I,ae,Ze,N,R,me,he,M?.title]);const ps=l.useCallback((o,c="Added")=>{if(S)return;const g=o.filter(Xe),h=o.filter(v=>!Xe(v));if(g.length>0&&(Be(v=>[...v,...g]),es(g.length===1?`${c} ${g[0]?.name??"1 attachment"}.`:`${c} ${g.length} attachments.`)),h.length>0){const v=h.length===1?h[0]?.name??"That file":`${h.length} files`;Ce(`${v} ${h.length===1?"is":"are"} not supported. Attach markdown, code, an image, or a video clip.`)}else g.length>0&&Ce(null)},[S]),ut=l.useCallback((o,c)=>{const g=Ys(o);if(g.length===0){Ce("Scout could not read that file. Try dropping or pasting it again.");return}ps(g,c)},[ps]),$n=l.useCallback(o=>{S||!dt(o.dataTransfer)||(o.preventDefault(),o.stopPropagation(),ke.current+=1,jt(ke.current))},[S]),Dn=l.useCallback(o=>{S||!dt(o.dataTransfer)||(o.preventDefault(),o.stopPropagation(),o.dataTransfer.dropEffect="copy")},[S]),_n=l.useCallback(o=>{ke.current!==0&&(o.preventDefault(),o.stopPropagation(),ke.current=Math.max(0,ke.current-1),jt(ke.current))},[]),On=l.useCallback(o=>{dt(o.dataTransfer)&&(o.preventDefault(),o.stopPropagation(),ke.current=0,jt(0),ut(o.dataTransfer,"Added"))},[ut]),Fn=l.useCallback(o=>{S||!dt(o.clipboardData)||(o.preventDefault(),o.stopPropagation(),ut(o.clipboardData,"Pasted"))},[ut,S]),gs=o=>{ot.current=!0,tt($s(o.root)),pe(o.root),T(""),E(0),U(!1),we(null),requestAnimationFrame(()=>_.current?.focus())},ws=o=>{const c=o.trim();c&&(ot.current=!0,tt($s(c)),pe(c),T(""),E(0),U(!1),we(null),requestAnimationFrame(()=>_.current?.focus()))},Un=()=>{ot.current=!0,pe(""),T(""),E(0),U(!1),we(null),requestAnimationFrame(()=>_.current?.focus())},Hn=o=>{if(o.key==="ArrowDown"||o.key==="ArrowUp"){o.preventDefault(),E(c=>{if(it===0)return 0;const g=o.key==="ArrowDown"?1:-1;return(c+g+it)%it});return}if(o.key==="Enter"){o.preventDefault();const c=ne[oe];c?gs(c):ye&&oe===ne.length&&ws(ye);return}o.key==="Escape"&&Ee&&R&&(o.preventDefault(),o.stopPropagation(),T(""),E(0))},bs=o=>{os.current=!0,ts(o.harness),ss(o.model),ns(o.effort)},Bn=async()=>{if(S)return;if(k&&!ce){Ce("Add instructions, or choose a context option that includes the source message."),requestAnimationFrame(()=>_.current?.focus());return}if(!M){Ce(null),we("Choose a project before starting this task."),U(!0),requestAnimationFrame(()=>Ct.current?.focus());return}if(us)return;Qt("starting"),vt(B.length>0?"uploading":"starting"),Ce(null);const o=fo(),c=Date.now();try{let g=[];if(B.length>0&&(g=await kr(B),vt("starting")),q&&A&&ct&&ae==="existing-chat"){const O=await ua(A,{mode:ae==="existing-chat"&&ct?"existing-chat":"new-session",message:ce,attachments:g});be(""),Be([]),es(null),s({view:"agents-v2",agentId:O.agentId,conversationId:O.conversationId,tab:"message"}),et?.(),n();return}const h=await ca({projectPath:M.root,harness:ie,...nt?{model:nt}:{},...rt?{reasoningEffort:rt}:{},...ce?{instructions:ce}:q?{instructions:"Shared capture for context."}:{},...g.length>0?{attachments:g}:{},...k&&y?{fromMessageId:y.selectedMessageId,fromConversationId:y.sourceConversationId}:{},clientMessageId:o}),v=h.conversationId?.trim();if(!v)throw new Error("Message sent, but no Chat was returned.");const K=h.messageId?.trim();K&&mo({conversationId:v,messageId:K,clientMessageId:o,body:ce||(g.length>0?"Shared capture for context.":"New session started."),attachments:g,agentId:h.agentId,flightId:h.flightId,invocationId:h.invocationId,createdAt:c}),be(""),s({view:"conversation",conversationId:v}),et?.(),n()}catch(g){Ce(g instanceof Error?g.message:q?"Could not route capture.":"Could not send message."),Qt("idle"),vt("idle")}};return i.jsx("div",{className:"s-newchat-backdrop",onClick:Pn,onDragEnter:$n,onDragOver:Dn,onDragLeave:_n,onDrop:On,onPaste:Fn,role:"presentation",children:i.jsxs("div",{ref:St,className:`s-newchat-panel${S?" s-newchat-panel--starting":""}${ls?" s-newchat-panel--dragging":""}`,style:kn,"data-framed":ee?"true":void 0,"data-gesture":yn??void 0,role:"dialog","aria-modal":"true","aria-label":ds,onClick:o=>o.stopPropagation(),onKeyDown:vn,tabIndex:-1,children:[i.jsxs("header",{className:"s-newchat-head",title:"Drag to move · double-click to recenter",onDoubleClick:Cn,...at(null),children:[i.jsx("span",{className:"s-newchat-title",children:ds}),i.jsx("div",{className:"s-newchat-head-status",children:i.jsx("span",{role:"status","aria-live":"polite",children:xt})}),i.jsx("button",{type:"button",className:"s-newchat-close",onClick:Et,disabled:S,"aria-label":"Close (Esc)",title:"Close (Esc)",children:i.jsx(er,{size:14,"aria-hidden":"true"})})]}),ls?i.jsx("div",{className:"s-newchat-drop-prompt",role:"status","aria-live":"polite",children:"Drop to attach markdown, code, images, or video"}):null,i.jsxs("div",{className:"s-newchat-body",children:[i.jsxs("div",{className:"s-newchat-lead",children:[k?i.jsx("p",{className:"s-newchat-forward-intro",children:"Choose the destination, runtime, and visible Scout context to carry into a fresh task."}):null,i.jsx(Qn,{context:fs,selection:ze.selection,attached:yt,onToggleSelection:()=>wn(o=>!o)}),i.jsxs("div",{className:"s-newchat-project-bar",children:[i.jsx("span",{className:"label-md s-newchat-project-label",children:"Project"}),i.jsxs("button",{type:"button",className:"s-newchat-project-summary","data-empty":M?void 0:"true","aria-expanded":Ee,"aria-controls":"s-newchat-project-panel","aria-describedby":He?"s-newchat-project-reminder":void 0,disabled:S,onClick:()=>{const o=!Ee;U(o),requestAnimationFrame(o?()=>Ct.current?.focus():()=>_.current?.focus())},children:[i.jsx("span",{className:"s-newchat-project-summary-title",children:M?`/${M.title}`:"Choose a project"}),M?i.jsx("span",{className:"s-newchat-project-summary-path",title:M.root,children:_t(M.root)}):i.jsx("span",{className:"s-newchat-project-summary-path",children:"Required when you send"}),i.jsx(tr,{size:13,"aria-hidden":"true"})]})]}),He?i.jsx("p",{id:"s-newchat-project-reminder",className:"s-newchat-project-reminder",role:"alert",children:He}):null,Ee?i.jsxs("div",{id:"s-newchat-project-panel",className:"s-newchat-project-panel",children:[i.jsxs("div",{className:"s-newchat-project-picker",children:[i.jsx(sr,{size:13,"aria-hidden":"true",className:"s-newchat-project-search-icon"}),i.jsx("input",{ref:Ct,id:"s-newchat-project-search",className:"s-newchat-project-search",type:"search",role:"combobox","aria-label":"Filter projects or enter a project path","aria-autocomplete":"list","aria-expanded":"true","aria-controls":"s-newchat-project-results","aria-activedescendant":it>0?`s-newchat-project-option-${oe}`:void 0,value:R,placeholder:P?"Filter projects, or type a path…":"Loading projects…",disabled:S,spellCheck:!1,autoComplete:"off",onChange:o=>{T(o.currentTarget.value),E(0)},onKeyDown:Hn})]}),i.jsxs("div",{id:"s-newchat-project-results",className:"s-newchat-project-results",role:"listbox","aria-label":"Projects",children:[ne.map((o,c)=>i.jsxs("div",{id:`s-newchat-project-option-${c}`,role:"option","aria-selected":o.root===N,"aria-disabled":S||void 0,className:"s-newchat-project-option","data-active":c===oe||void 0,onMouseDown:g=>g.preventDefault(),onMouseEnter:()=>E(c),onClick:()=>{S||gs(o)},children:[i.jsxs("span",{className:"s-newchat-project-option-title",children:["/",o.title]}),i.jsx("span",{className:"s-newchat-project-option-path",children:_t(o.root)})]},o.root)),ye?i.jsxs("div",{id:`s-newchat-project-option-${ne.length}`,role:"option","aria-selected":ye===N,"aria-disabled":S||void 0,className:"s-newchat-project-option s-newchat-project-option--path","data-active":oe===ne.length||void 0,onMouseDown:o=>o.preventDefault(),onMouseEnter:()=>E(ne.length),onClick:()=>{S||ws(ye)},children:[i.jsx("span",{className:"s-newchat-project-option-title",children:"Use this project path"}),i.jsx("span",{className:"s-newchat-project-option-path",children:_t(ye)})]}):null,ne.length===0&&!ye?i.jsx("p",{className:"s-newchat-project-empty",children:"No project matched. Type an absolute path such as ~/dev/my-project."}):null]}),i.jsxs("div",{className:"s-newchat-project-panel-foot",children:[Mn>0?i.jsxs("p",{className:"s-newchat-project-foot",children:[ne.length," of"," ",R.trim()?We.length:te.length,R.trim()?" matches":" projects"," · type to narrow"]}):i.jsx("span",{}),M?i.jsx("button",{type:"button",className:"s-newchat-project-clear",onClick:Un,children:"Clear project"}):null]}),Ue&&te.length===0?i.jsx("div",{className:"s-newchat-error",role:"alert",children:Ue}):null]}):null,k&&y?i.jsxs("div",{className:"s-newchat-forward-config",children:[i.jsxs("div",{className:"s-newchat-field",children:[i.jsx("span",{className:"label-md s-newchat-field-label",children:"Runtime"}),i.jsx("div",{className:"s-newchat-forward-runtime",children:i.jsx(js,{catalog:cs,value:{harness:ie,model:nt,effort:rt},onChange:bs,status:Te?"loading":$?"error":"ready",statusMessage:$??void 0,onRetry:lt,disabled:S||!xe})}),xe&&Te?i.jsxs("p",{className:"s-newchat-runtime-note","data-pending":"true",role:"status",children:[i.jsx(Tt,{size:11,className:"s-newchat-runtime-note-spinner","aria-hidden":"true"}),"Loading the model catalog…"]}):xe&&($||se?.ready===!1)?i.jsx("p",{className:"s-newchat-runtime-note",role:"alert",children:se?.ready===!1?se.detail||`${se.label} is unavailable.`:$}):null]}),i.jsxs("div",{className:"s-newchat-field",children:[i.jsx("span",{id:"s-newchat-forward-context-label",className:"label-md s-newchat-field-label",children:"Context"}),i.jsxs("div",{className:"s-newchat-context-options",role:"radiogroup","aria-labelledby":"s-newchat-forward-context-label",children:[i.jsxs("button",{type:"button",className:"s-newchat-context-option",role:"radio","aria-checked":H==="selected-message",disabled:S,onClick:()=>m("selected-message"),children:[i.jsx("span",{className:"s-newchat-context-option-title",children:"Selected message"}),i.jsx("span",{className:"s-newchat-context-option-copy",children:"Carry only the message you chose."})]}),i.jsxs("button",{type:"button",className:"s-newchat-context-option",role:"radio","aria-checked":H==="recent-context",disabled:S||y.recentMessageCount===0,onClick:()=>m("recent-context"),children:[i.jsx("span",{className:"s-newchat-context-option-title",children:"Recent context + message"}),i.jsx("span",{className:"s-newchat-context-option-copy",children:y.recentMessageCount>0?`Carry ${y.recentMessageCount} preceding visible ${y.recentMessageCount===1?"message":"messages"}, then this message.`:"No preceding visible messages are available."})]}),i.jsxs("button",{type:"button",className:"s-newchat-context-option",role:"radio","aria-checked":H==="instructions-only",disabled:S,onClick:()=>m("instructions-only"),children:[i.jsx("span",{className:"s-newchat-context-option-title",children:"Instructions only"}),i.jsx("span",{className:"s-newchat-context-option-copy",children:"Start clean without source conversation text."})]})]}),i.jsx("p",{className:"s-newchat-context-note",children:"Recent context is a bounded Scout excerpt, not a generated summary or full model context."})]})]}):null,k?i.jsx("span",{className:"label-md s-newchat-field-label",children:"Instructions"}):null,i.jsx(zn,{density:"panel",value:I,onChange:Tn,onSend:()=>{Bn()},sendOnEnter:!0,textareaRef:_,placeholder:k?"Add what the new task should do (optional)…":q?"What should the agent do with this?":"Describe the task, or leave blank…","aria-label":k?"Instructions for the new task":"Message",disabled:S,sending:S,canSend:!S&&!us&&(!k||!!ce),rows:7,maxHeightPx:280,sendTitle:k?"Forward to new task (Enter)":q?"Route (Enter)":"Start task (Enter)",sendAriaLabel:k?"Forward to new task":q?"Route capture":"Start task",overlay:i.jsxs(i.Fragment,{children:[w.open?i.jsx(xs,{label:"Slash commands",placement:"inside",items:le.map(o=>({id:o.command,token:o.label,description:o.description})),activeIndex:w.index,onPick:o=>{const c=le[o];c&&It(c)},onActiveIndexChange:o=>j(c=>({...c,index:o}))}):null,x.open?i.jsx(xs,{label:"Mention agent",placement:"inside",items:ue.map(o=>({id:o.id,token:`@${o.handle}`,description:o.name,avatar:{label:o.name[0]?.toUpperCase()??"?",color:Yn(o.name)}})),activeIndex:x.index,onPick:o=>{const c=ue[o];c&&Nt(c)},onActiveIndexChange:o=>L(c=>({...c,index:o}))}):null]}),onSelect:o=>{const c=o.currentTarget;qe(c.value,c.selectionStart)},onBlur:()=>window.setTimeout(At,120),onKeyDown:Ln,leadingTools:i.jsxs("div",{className:"s-newchat-compose-triggers","aria-label":"Message shortcuts",children:[i.jsx("button",{type:"button",className:"s-newchat-command-trigger",disabled:S,onClick:()=>hs("/"),children:"/Commands"}),i.jsx("span",{"aria-hidden":"true",children:"·"}),i.jsx("button",{type:"button",className:"s-newchat-command-trigger",disabled:S,onClick:()=>hs("@"),children:"@Agents"})]}),tools:k?void 0:i.jsx(js,{catalog:cs,value:{harness:ie,model:nt,effort:rt},onChange:bs,status:Te?"loading":$?"error":"ready",statusMessage:$??void 0,onRetry:lt,disabled:S||!xe})}),B.length>0?i.jsx("div",{className:"s-newchat-attachments","aria-label":"Attached captures",children:B.map((o,c)=>i.jsx(ba,{file:o,onRemove:()=>Be(g=>g.filter((h,v)=>v!==c))},`${o.name}:${o.size}:${c}`))}):null,st?i.jsx("div",{className:"s-newchat-attachment-feedback",role:"status","aria-live":"polite",children:st}):null,Zt&&i.jsx("div",{className:"s-newchat-error",role:"alert",children:Zt}),S&&i.jsxs("div",{className:"s-newchat-progress",role:"status","aria-live":"polite",children:[i.jsx(Tt,{size:14,className:"s-newchat-progress-spinner","aria-hidden":"true"}),i.jsxs("div",{className:"s-newchat-progress-copy",children:[i.jsx("span",{className:"label-md s-newchat-progress-title",children:In}),i.jsx("span",{className:"s-newchat-progress-detail",children:Nn}),ce&&i.jsx("span",{className:"s-newchat-progress-message",children:ce})]})]})]}),Rn?i.jsxs("div",{className:"s-newchat-config",children:[ms?i.jsxs("div",{className:"s-newchat-mode",role:"group","aria-label":"Delivery mode",children:[i.jsx("button",{type:"button",className:`s-newchat-mode-btn${ae==="existing-chat"?" s-newchat-mode-btn--on":""}`,disabled:S,onClick:()=>ve("existing-chat"),children:"Existing chat"}),i.jsx("button",{type:"button",className:`s-newchat-mode-btn${ae==="new-session"?" s-newchat-mode-btn--on":""}`,disabled:S,onClick:()=>ve("new-session"),children:"New chat"})]}):null,xe&&Te?i.jsxs("p",{className:"s-newchat-runtime-note","data-pending":"true",role:"status",children:[i.jsx(Tt,{size:11,className:"s-newchat-runtime-note-spinner","aria-hidden":"true"}),"Loading the model catalog…"]}):xe&&($||se?.ready===!1)?i.jsx("p",{className:"s-newchat-runtime-note",role:"alert",children:se?.ready===!1?se.detail||`${se.label} is unavailable.`:$}):null]}):null]}),i.jsx("div",{className:"s-newchat-resize s-newchat-resize--e","aria-hidden":"true",title:"Drag to resize",...at("e")}),i.jsx("div",{className:"s-newchat-resize s-newchat-resize--s","aria-hidden":"true",title:"Drag to resize",...at("s")}),i.jsx("div",{className:"s-newchat-resize s-newchat-resize--se","aria-hidden":"true",title:"Drag to resize",...at("se")})]})})}const ei=Object.freeze(Object.defineProperty({__proto__:null,NewChatComposer:va},Symbol.toStringTag,{value:"Module"}));export{fo as A,kr as B,Qa as C,Ya as D,Za as E,_a as F,Me as G,js as H,Qo as I,Ar as J,Ys as K,ei as L,xs as M,va as N,Ae as R,Xa as a,za as b,qa as c,Ga as d,Wa as e,Ka as f,Hs as g,jo as h,Bs as i,Xe as j,Da as k,dt as l,jr as m,Wo as n,Ie as o,Va as p,Ua as q,Ja as r,co as s,rn as t,lo as u,Oa as v,Xt as w,Ha as x,Fa as y,Ba as z};
@@ -1 +0,0 @@
1
- import{r as n,j as t}from"./index-CZ-05hKz.js";/* empty css */import{u as d}from"./Provider-B2xuo3rf.js";/* empty css */import{u as v}from"./page-status-BptpTdQ-.js";import{A as x}from"./AgentLanesView-DHyzVBk6.js";import{MissionControlView as j}from"./MissionControlView-ByBlHVN8.js";import{OpsAgentsView as f}from"./OpsAgentsView-ntGr4pz4.js";import{HostAdvisorView as w}from"./HostAdvisorView-RAociATV.js";import{AtopView as N}from"./AtopView-DYlpgEHf.js";import{TailView as c}from"./TailView-Q4FVMsUH.js";import{u as g}from"./useContentSecondaryNav-D0mUhxTF.js";import{OpsSubnav as S}from"./OpsSubnav-GAKsoSor.js";import"./router-DJj2WbDg.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./api-Co9aQ2Jw.js";import"./sse-CiOSzE5n.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DZVhS7as.js";import"./createLucideIcon-DXpqZP7I.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./file-text-KijGBnME.js";import"./x-e3h2hDsp.js";import"./chevron-right-CzH-TaSF.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./arrow-right-iJFv3jNh.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-DFhAJkW3.js";import"./NewChatComposer-hlWT-nbR.js";import"./text-CnZ0e1-V.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-BiohlpM3.js";import"./conversation-model-CwF6Y9gx.js";import"./time-Dhsh_2EG.js";import"./index-BVlMw8x_.js";import"./HarnessMark-D5CA5uSp.js";import"./NewChatOrigin-DdpzE4kz.js";import"./chevron-down-Mp9mu_yd.js";import"./search-D1tJSAWe.js";import"./chunk-HRAB3GC3-swV8PA2k.js";/* empty css */import"./tail-events-BMQmSx1n.js";import"./observe-CJRIvOCn.js";import"./types-B0PlfpKc.js";import"./AgentAvatar-CYhf6twS.js";import"./SpriteAvatar-Bs68ZENy.js";import"./CrewAvatar-CTIuxp4G.js";import"./SessionObserve-Dsd0j05N.js";import"./bash-format-BRV5C6Gv.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-D_DMlBeT.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-CcPFMbmZ.js";import"./AgentDetailCard-UqPNpcvB.js";import"./AgentLiveActions-BwuzOE8h.js";import"./terminal-takeover-DANQfTcy.js";import"./openContent-C6XO6kr5.js";import"./eye-CpfyvdLq.js";import"./terminal-yN9xN-h9.js";import"./message-markup-RkfmDfME.js";import"./ObservedTopologyPanel-CdGUXxGR.js";import"./ObserveTextFlow-BSEtYTxU.js";import"./use-reduced-motion-CKkhq9c5.js";import"./proxy-DnLpZIi9.js";import"./SessionObserveEvidence-DopQYDkD.js";import"./message-circle-B2ddzBrX.js";import"./wrench-YcXMlsh2.js";import"./external-link-Ckiyzjwo.js";import"./AgentFloorView-XXNgI5Cj.js";/* empty css */import"./agent-lanes-model-AfrjRNK5.js";import"./context-budget-DX_fwUs3.js";import"./lane-roster-store-gUBsydNf.js";import"./AgentLanesPreflight-5B6sXvRB.js";import"./AgentLaneChrome-CyhA1reW.js";import"./AgentLaneCard-Z-aOBR3W.js";/* empty css */import"./AgentLaneSummaryResize-Box8-_rS.js";import"./clipboard-e3fSpeo7.js";import"./agent-lane-card-model-CTLxf3R4.js";import"./agent-lane-preview-BhplDYGf.js";import"./agent-lane-detail-ppJId6Jc.js";import"./AgentLaneDetailSheet-BNzjMjIH.js";import"./SlidePanel-C-q7XwTa.js";import"./LaneTraceDetailSheet-BEHg3LmH.js";import"./LaneTraceEventFocus-DVimcizS.js";/* empty css */import"./mission-control-store-Bf4b54MV.js";import"./MissionContextRail-DrNKXG5u.js";import"./mission-wall-CocIM1cF.js";import"./mission-control-model-C0fByIjm.js";import"./MissionFocusOverlay-D1i6R6Zt.js";import"./MissionLogPane-DSeIv3Xo.js";/* empty css */import"./DataTable-6IDhanr5.js";/* empty css */import"./useAgentHoverCard-CHBsxcbp.js";import"./sliders-horizontal-BPSMHhbm.js";/* empty css */import"./compass-0_54-vz3.js";import"./layout-grid-BrZt31QH.js";import"./refresh-cw-BRn9Oxxl.js";import"./arrow-up-right-CCfZXPqD.js";import"./cpu-BjVis9mc.js";import"./gauge-y-Xg8Mrv.js";/* empty css */import"./SecondaryNav-o2RL9H8H.js";import"./secondaryNavConfig-B9IF8wXl.js";import"./message-square-D9YYWE0x.js";import"./settings-2fC_G9nX.js";import"./git-branch-BQ_x8KZL.js";import"./scroll-text-DO0GQzvN.js";const A=220;function F(){const r=v(),o=!!(r.hover||r.content),[i,p]=n.useState(o?{hover:r.hover,content:r.content}:null),[e,s]=n.useState(o?"enter":"hidden"),m=n.useRef(null);if(n.useEffect(()=>{if(o){m.current&&(clearTimeout(m.current),m.current=null),p({hover:r.hover,content:r.content}),s(h=>h==="show"?"show":"enter");const u=requestAnimationFrame(()=>s("show"));return()=>cancelAnimationFrame(u)}return s("leave"),m.current=setTimeout(()=>{s("hidden"),p(null),m.current=null},A),()=>{m.current&&(clearTimeout(m.current),m.current=null)}},[o,r.hover,r.content]),e==="hidden"||!i)return null;const a=i.hover?.label??i.hover?.route??null,l=i.hover?.label&&i.hover?.route?i.hover.route:null;return t.jsxs("div",{className:`s-page-status s-page-status--${e}`,role:"status","aria-live":"polite",children:[t.jsx("div",{className:"s-page-status-left",children:a&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"s-page-status-arrow","aria-hidden":!0,children:"→"}),t.jsx("span",{className:"s-page-status-target",children:a}),l&&t.jsx("span",{className:"s-page-status-route",children:l})]})}),t.jsx("div",{className:"s-page-status-right",children:i.content&&t.jsx("span",{className:"s-page-status-content",children:i.content})})]})}function qr({navigate:r,mode:o="mission",tailQuery:i}){const{agents:p,route:e}=d(),s=g();return t.jsxs("div",{className:"s-ops",children:[s?t.jsx("div",{className:"s-ops-header",children:t.jsx(S,{activeRoute:e,navigate:r})}):null,t.jsxs("div",{className:"s-ops-body",children:[o==="mission"&&t.jsx(j,{navigate:r,agents:p}),o==="agents"&&t.jsx(f,{navigate:r,agents:p}),o==="advisor"&&t.jsx(w,{navigate:r,agents:p}),o==="issues"&&t.jsx(c,{navigate:r,initialFilter:i,variant:"issues"}),o==="tail"&&t.jsx(c,{navigate:r,initialFilter:i,variant:"tail"}),o==="atop"&&t.jsx(N,{}),o==="lanes"&&t.jsx(x,{navigate:r,agents:p})]}),t.jsx(F,{})]})}export{qr as OpsScreen};
@@ -1 +0,0 @@
1
- import{j as t}from"./index-CZ-05hKz.js";import{S as p}from"./SecondaryNav-o2RL9H8H.js";import{O as i}from"./secondaryNavConfig-B9IF8wXl.js";/* empty css */import"./createLucideIcon-DXpqZP7I.js";import"./message-square-D9YYWE0x.js";import"./file-text-KijGBnME.js";import"./search-D1tJSAWe.js";import"./compass-0_54-vz3.js";import"./settings-2fC_G9nX.js";import"./terminal-yN9xN-h9.js";import"./git-branch-BQ_x8KZL.js";import"./code-xml-Jtxsp5d1.js";import"./scroll-text-DO0GQzvN.js";function v({activeRoute:r,navigate:o}){return t.jsx(p,{ariaLabel:"Ops sections",activeRoute:r,groups:i,navigate:o})}export{v as OpsSubnav};
@@ -1 +0,0 @@
1
- import{r as m,j as o}from"./index-CZ-05hKz.js";import{a as A}from"./api-Co9aQ2Jw.js";import{u as b,d as S}from"./Provider-B2xuo3rf.js";import{b as y}from"./router-DJj2WbDg.js";import{u as P}from"./sse-CiOSzE5n.js";import{AgentsSubnav as N}from"./AgentsSubnav-CDMjKeYC.js";import{AgentDetailWithRail as B,AgentProfileSessionsCenter as E}from"./profile-rY8jO38P.js";import{r as R,d as C,b as M}from"./NewChatComposer-hlWT-nbR.js";/* empty css *//* empty css *//* empty css */import{ProjectAgentProfileBar as w}from"./ProjectAgentProfileBar-BQET-qrY.js";/* empty css */import"./perf-PX8Rx0EP.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DZVhS7as.js";import"./createLucideIcon-DXpqZP7I.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./file-text-KijGBnME.js";import"./x-e3h2hDsp.js";import"./chevron-right-CzH-TaSF.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./arrow-right-iJFv3jNh.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-DFhAJkW3.js";import"./chunk-HRAB3GC3-swV8PA2k.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./index-BWHgHrtv.js";import"./SecondaryNav-o2RL9H8H.js";import"./secondaryNavConfig-B9IF8wXl.js";import"./message-square-D9YYWE0x.js";import"./search-D1tJSAWe.js";import"./compass-0_54-vz3.js";import"./settings-2fC_G9nX.js";import"./terminal-yN9xN-h9.js";import"./git-branch-BQ_x8KZL.js";import"./scroll-text-DO0GQzvN.js";import"./AgentAvatar-CYhf6twS.js";import"./SpriteAvatar-Bs68ZENy.js";import"./CrewAvatar-CTIuxp4G.js";import"./HarnessMark-D5CA5uSp.js";import"./context-budget-DX_fwUs3.js";import"./session-catalog-DNaOEzoQ.js";import"./terminal-relay-9lhzEp2V.js";import"./time-Dhsh_2EG.js";import"./BackToPicker-4JaeRvDm.js";import"./openContent-C6XO6kr5.js";import"./ConversationScreen-BNULZAp2.js";import"./text-CnZ0e1-V.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-BiohlpM3.js";import"./ConversationComposer-2HjbGPL9.js";import"./index-BVlMw8x_.js";import"./zap-nMcjPoWB.js";import"./conversation-model-CwF6Y9gx.js";import"./message-markup-RkfmDfME.js";import"./mentions-CcPFMbmZ.js";import"./AgentDetailCard-UqPNpcvB.js";import"./AgentLiveActions-BwuzOE8h.js";import"./terminal-takeover-DANQfTcy.js";import"./eye-CpfyvdLq.js";import"./message-visibility-DwxgcgYK.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";import"./ConversationHeader-C8vfXaTF.js";import"./AstronautSuit-Ckx7lu7G.js";import"./ConversationFeedRows-C6wUqJrx.js";import"./ConversationPanels-CNCIbpqU.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CKkhq9c5.js";import"./proxy-DnLpZIi9.js";import"./chevron-down-Mp9mu_yd.js";import"./activity-Bj3Hnbj3.js";import"./message-circle-B2ddzBrX.js";import"./tail-events-BMQmSx1n.js";import"./ConversationStatus-DZuyKsWN.js";import"./check-C18YQC90.js";import"./sparkles-Dy8p5xN8.js";import"./SessionObserve-Dsd0j05N.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-D_DMlBeT.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CdGUXxGR.js";import"./ObserveTextFlow-BSEtYTxU.js";import"./SessionObserveEvidence-DopQYDkD.js";import"./wrench-YcXMlsh2.js";import"./external-link-Ckiyzjwo.js";/* empty css */import"./AgentDefinitionsWorkspace-srmN6-vj.js";import"./agent-specialization-BIPIBW8u.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-DQlpNt2S.js";import"./agent-essentials-BOMHR0_U.js";import"./NewChatOrigin-DdpzE4kz.js";import"./model-IGCUEsMy.js";import"./agents-project-model-UYiamtrU.js";function wo({route:t,navigate:r}){const{agents:e}=b(),p=y(t),n=m.useMemo(()=>S(e,p),[e,p]),[f,g]=m.useState([]),a=m.useCallback(async()=>{const s=await A("/api/conversations").catch(()=>[]);g(s)},[]);m.useEffect(()=>{a()},[a]),P(()=>{a()});const i=R(n,t.agentId),c=!!(t.agentId&&i&&i.id!==t.agentId),{conversationByAgentId:j}=C(f);if(m.useEffect(()=>{!t.agentId||!i||!c||r({...t,view:"agents-v2",agentId:i.id})},[r,t,i,t.agentId,c]),!i)return o.jsx(v,{activeRoute:t,navigate:r,children:o.jsx("div",{className:"av2-empty",children:"Agent not found."})});const d=t.conversationId??j.get(i.id)??i.conversationId??null,l=t.tab??(t.conversationId?"message":"profile");return o.jsx("div",{className:"s-av2-profileShell",children:o.jsx(v,{activeRoute:t,navigate:r,bar:o.jsx(w,{agent:i,conversationId:d,activeTab:l,route:t,navigate:r}),children:o.jsx("div",{className:"av2-profileCanvas",children:o.jsx(B,{agent:i,allAgents:n,conversationId:d,navigate:r,activeTab:l,renderProfile:({agent:s,sessionCatalog:x,conversationId:h,navigate:I,route:u})=>o.jsx(E,{agent:s,name:M(s,n).name,sessionCatalog:x,conversationId:h,navigate:I,route:u,homeView:"agents-v2"})})})})})}function v({activeRoute:t,children:r,navigate:e,bar:p}){return o.jsxs("div",{className:"s-secondary-nav-shell",children:[o.jsx("div",{className:"s-secondary-nav-bar",children:p??o.jsx(N,{activeRoute:t,navigate:e})}),o.jsx("div",{className:"s-secondary-nav-body",children:r})]})}export{wo as ProjectAgentProfile};
@@ -1,2 +0,0 @@
1
- import{r as m,j as s}from"./index-CZ-05hKz.js";import{A as Me}from"./AgentAvatar-CYhf6twS.js";import{H as ge}from"./HarnessMark-D5CA5uSp.js";import{a as Ee}from"./api-Co9aQ2Jw.js";import{r as Ie,i as $e}from"./ui-LM8pS8qE.js";import{t as _,d as We,n as ee}from"./time-Dhsh_2EG.js";import{p as Fe,l as Be,s as De,f as Oe}from"./terminal-sessions-BQ6t92tJ.js";import{u as ze}from"./Provider-B2xuo3rf.js";import{o as He}from"./openContent-C6XO6kr5.js";import{p as Z}from"./NewChatComposer-hlWT-nbR.js";import{SessionRefScreen as qe}from"./SessionRefScreen-B_cTv47v.js";import{C as Ge}from"./CrewWorkspaces-CkPYIA46.js";import{r as X,s as V}from"./project-overview-helpers-BQTc_Ous.js";import{u as _e,g as Q,e as oe,h as Ve,s as re,a as le,j as Ke,k as be,c as Ue,l as Xe,f as Ye,r as Ze}from"./projects-inbox-D-zAb9Gp.js";import{g as Je,a as Qe,f as ce,b as es}from"./api-HFH8wFyb.js";import{f as ss}from"./cache-CeWH_KzJ.js";import{A as ue}from"./arrow-up-right-CCfZXPqD.js";import{C as ts}from"./chevron-right-CzH-TaSF.js";import{F as ns}from"./AddProjectForm-CcD6qvV8.js";import{S as is}from"./search-D1tJSAWe.js";import{A as as}from"./arrow-right-iJFv3jNh.js";import{E as os}from"./external-link-Ckiyzjwo.js";import{F as rs}from"./DocumentFocusViewer-DZVhS7as.js";import"./SpriteAvatar-Bs68ZENy.js";import"./colors-BtO5_zlx.js";import"./CrewAvatar-CTIuxp4G.js";import"./perf-PX8Rx0EP.js";import"./router-DJj2WbDg.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./sse-CiOSzE5n.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./file-text-KijGBnME.js";import"./createLucideIcon-DXpqZP7I.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-DFhAJkW3.js";import"./chunk-HRAB3GC3-swV8PA2k.js";import"./text-CnZ0e1-V.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-BiohlpM3.js";import"./conversation-model-CwF6Y9gx.js";import"./index-BVlMw8x_.js";import"./NewChatOrigin-DdpzE4kz.js";import"./x-e3h2hDsp.js";import"./chevron-down-Mp9mu_yd.js";import"./tail-events-BMQmSx1n.js";import"./BackToPicker-4JaeRvDm.js";import"./ConversationScreen-BNULZAp2.js";import"./ConversationComposer-2HjbGPL9.js";import"./zap-nMcjPoWB.js";import"./message-markup-RkfmDfME.js";import"./mentions-CcPFMbmZ.js";import"./AgentDetailCard-UqPNpcvB.js";import"./AgentLiveActions-BwuzOE8h.js";import"./terminal-takeover-DANQfTcy.js";import"./eye-CpfyvdLq.js";import"./terminal-yN9xN-h9.js";import"./message-visibility-DwxgcgYK.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-C8vfXaTF.js";import"./AstronautSuit-Ckx7lu7G.js";import"./ConversationFeedRows-C6wUqJrx.js";import"./ConversationPanels-CNCIbpqU.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CKkhq9c5.js";import"./proxy-DnLpZIi9.js";import"./activity-Bj3Hnbj3.js";import"./message-circle-B2ddzBrX.js";import"./ConversationStatus-DZuyKsWN.js";import"./check-C18YQC90.js";import"./sparkles-Dy8p5xN8.js";import"./SessionObserve-Dsd0j05N.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-D_DMlBeT.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CdGUXxGR.js";import"./ObserveTextFlow-BSEtYTxU.js";import"./SessionObserveEvidence-DopQYDkD.js";import"./wrench-YcXMlsh2.js";/* empty css */import"./model-IGCUEsMy.js";import"./agents-project-model-UYiamtrU.js";import"./agent-specialization-BIPIBW8u.js";import"./cpu-BjVis9mc.js";import"./sliders-horizontal-BPSMHhbm.js";import"./message-square-D9YYWE0x.js";function de(e){const t=e?.trim();if(!t)return null;const i=t.split(/[\\/]/u).filter(Boolean).at(-1)??t;return i.endsWith(".jsonl")?i.slice(0,-6):i}function ls(e){return e.surfaces.filter(t=>t.backend==="tmux")}function cs(e,t){return{terminalSessionId:e.id,terminalSurfaceKey:De(t),sessionName:t.sessionName}}function us(e,t){const i=de(t.agentId),n=new Set(t.sessionRefs.map(de).filter(r=>!!r)),o=i?.split(".",1)[0]??null;o?.startsWith("session-")&&n.add(o);for(const r of e){const a=ls(r).find(u=>n.has(u.sessionName));if(a)return cs(r,a)}return null}function ds(e,t){const i=Fe(e.terminalSurfaceKey);return i?`scout://terminal?${new URLSearchParams({session:e.terminalSessionId,surface:Be(i),mode:t}).toString()}`:null}const ps=1e4,ms=2e4,hs=6e4,fs=15e3,js=45e3,xs=["branch","unstaged","staged"];function te(e){const t=()=>{document.visibilityState==="visible"&&e()};return window.addEventListener("focus",t),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",t)}}function gs(e,t){const i=new Set;for(const n of[e,...t]){const o=n?.trim();o&&i.add(o.replace(/\/+$/u,""))}return[...i].slice(0,6)}function bs(e){return e.replace(/\/+$/u,"").split("/").pop()?.toLocaleLowerCase()??e.toLocaleLowerCase()}function vs(e,t,i){return e.path===t||i?.worktrees.some(o=>o.path===e.path)?!0:e.repo.split("/").pop()?.toLocaleLowerCase()===(i?.name.toLocaleLowerCase()??bs(t))}function J(e){return e&&typeof e=="object"&&"name"in e&&e.name==="AbortError"?"The repository scan timed out.":e instanceof Error?e.message:String(e)}function ws(e,t=[]){const i=gs(e,t).join("\0"),n=m.useMemo(()=>i?i.split("\0"):[],[i]),[o,r]=m.useState(()=>Je()),[a,u]=m.useState(()=>Qe()),[c,j]=m.useState(!!(e&&!X(o,e))),[v,g]=m.useState(!!e),[C,N]=m.useState(!!e),[L,R]=m.useState(null),[y,M]=m.useState(null),[F,I]=m.useState(()=>new Map),[D,k]=m.useState(()=>new Map),[S,B]=m.useState(0),f=m.useRef(null),x=m.useCallback(()=>{f.current=null,B(d=>d+1)},[]);m.useEffect(()=>{if(!e){j(!1),R(null);return}let d=!1,b=!1,T=!0;const W=async()=>{if(b)return;b=!0,d||(j(!0),R(null));let O=null;try{let E=null;const z=S>0&&T;T=!1;try{E=await ce("standard",z,fs)}catch(A){O=J(A)}if((!E||!X(E,e))&&f.current!==e){f.current=e;try{const A=await ce("expanded",z,js);X(A,e)&&(E=A)}catch(A){O=J(A)}}!d&&E&&r(A=>X(E,e)?E:A&&X(A,e)?A:E),!d&&!X(E,e)&&R(O??"Repo Watch did not include this project in its latest scan.")}finally{b=!1,d||j(!1)}};W();const p=window.setInterval(()=>{document.visibilityState==="visible"&&W()},ps),P=te(()=>{W()});return()=>{d=!0,window.clearInterval(p),P()}},[e,S]),m.useEffect(()=>{if(n.length===0){N(!1),k(new Map);return}let d=!1,b=!1,T=!0;const W=async()=>{if(b)return;b=!0,d||N(!0);const O=await Promise.allSettled(n.map(E=>ss(E,[...xs],{force:S>0&&T,tier:"summary"})));if(T=!1,!d){const E=new Map,z=new Map;O.forEach((A,K)=>{const q=n[K];A.status==="fulfilled"?E.set(q,A.value.snapshot):z.set(q,J(A.reason))}),I(A=>{const K=new Map(A);for(const q of n)K.delete(q);for(const[q,se]of E)K.set(q,se);return K}),k(z),N(!1)}b=!1};W();const p=window.setInterval(()=>{document.visibilityState==="visible"&&W()},ms),P=te(()=>{W()});return()=>{d=!0,window.clearInterval(p),P()}},[n,S]),m.useEffect(()=>{if(n.length===0){g(!1),M(null);return}let d=!1,b=!1;const T=async()=>{if(!b){b=!0;try{const P=await es(n);d||(u(P),M(null))}catch(P){d||M(J(P))}finally{b=!1,d||g(!1)}}};g(!0),M(null),T();const W=window.setInterval(()=>{document.visibilityState==="visible"&&T()},hs),p=te(()=>{T()});return()=>{d=!0,window.clearInterval(W),p()}},[n,S]);const l=m.useMemo(()=>X(o,e),[e,o]),h=m.useMemo(()=>e?(a?.pullRequests??[]).filter(d=>vs(d,e,l)):[],[l,e,a]),$=m.useMemo(()=>{const d=a?.paths.some(b=>n.includes(b))?a.warnings:[];return y?[y,...d]:d},[n,y,a]);return{project:l,pullRequests:h,pullRequestsLoading:v,pullRequestWarnings:$,repoLoading:c,repoError:L,diffSnapshots:F,diffErrors:D,diffLoading:C,refresh:x}}const Ns=[];function ks(e,t){return e.thread===t.thread&&e.crossProject===t.crossProject&&e.selected===t.selected&&e.cursor===t.cursor&&e.nowMs===t.nowMs&&e.workLabel===t.workLabel}const Ss=m.memo(function({thread:t,crossProject:i,selected:n,cursor:o,nowMs:r,onSelect:a,onOpen:u,rowRef:c,workLabel:j}){return s.jsxs("button",{ref:c,type:"button",className:"pi-row","data-state":t.group,"data-selected":n||void 0,"data-cursor":o||void 0,onClick:a,onDoubleClick:u,children:[s.jsx("span",{className:"pi-rowDot","aria-hidden":!0}),s.jsxs("span",{className:"pi-rowBody",children:[s.jsx("span",{className:"pi-rowWork",title:t.work,children:j??t.work}),s.jsxs("span",{className:"pi-rowAttr",children:[s.jsx("span",{className:"pi-rowAvatar",children:s.jsx(Me,{agent:{name:t.agentName,harness:t.harness,state:t.working?"in_turn":null},placement:"row",size:22})}),s.jsx("span",{className:"pi-rowAgent",title:t.agentName,children:t.agentName}),s.jsx("span",{className:"pi-rowHmark","aria-hidden":!0,children:s.jsx(ge,{harness:t.harness,size:11})}),i?s.jsxs("span",{className:"pi-rowChip",title:`/${t.projectTitle}`,children:["/",t.projectTitle]}):t.branch?s.jsx("span",{className:"pi-rowBranch",title:t.branch,children:t.branch}):null]})]}),s.jsxs("span",{className:"pi-rowVitals",children:[t.working?s.jsx("span",{className:"pi-rowLiveTag",children:"live"}):null,s.jsx("span",{className:"pi-rowAgo",children:t.lastActivityAt?_(t.lastActivityAt,r):"—"}),t.contextPct!=null?s.jsxs("span",{className:"pi-rowCtx",children:[t.contextPct,"%"]}):null]}),s.jsxs("span",{className:"pi-rowOpen","aria-hidden":!0,children:[s.jsx("span",{children:"Open"}),s.jsx(ts,{size:14,strokeWidth:1.8})]})]})},ks);function pe({title:e,detail:t,tone:i="muted"}){return s.jsxs("div",{className:"pi-stateBlock","data-tone":i,role:i==="loading"?"status":"note",children:[s.jsx("span",{className:"pi-statePulse","aria-hidden":!0}),s.jsx("span",{className:"pi-stateTitle",children:e}),t?s.jsx("span",{className:"pi-stateDetail",children:t}):null]})}function ys({rows:e=7}){return s.jsxs("div",{className:"pi-loadingRows","aria-hidden":"true",children:[s.jsxs("div",{className:"pi-sectionHead pi-sectionHead--loading",children:[s.jsx("span",{className:"pi-loadingLine pi-loadingLine--label"}),s.jsx("span",{className:"pi-loadingLine pi-loadingLine--count"})]}),Array.from({length:e},(t,i)=>s.jsxs("div",{className:"pi-row pi-row--loading",children:[s.jsx("span",{className:"pi-rowDot"}),s.jsxs("span",{className:"pi-rowBody",children:[s.jsx("span",{className:"pi-loadingLine pi-loadingLine--title"}),s.jsx("span",{className:"pi-loadingLine pi-loadingLine--meta"})]}),s.jsx("span",{className:"pi-rowVitals",children:s.jsx("span",{className:"pi-loadingLine pi-loadingLine--time"})})]},i))]})}function Cs({route:e,navigate:t,slug:i,model:n,mode:o,repoProject:r}){const a=n.projects.find(y=>y.slug===i)??null,u=Q(n.threads,i),c=u.filter(y=>y.kind==="agent"),j=a?.title??i,v=a?.root??null,g=(a?.agentCount??c.length)>1,C=e.machineId?{machineId:e.machineId}:{},N={view:"agents-v2",projectSlug:i,...C},L=As(a?.needs??0,a?.working??0,u.length),R=r?.worktrees.length??a?.worktreeCount??0;return s.jsxs("header",{className:"pi-projectHead",children:[s.jsx("div",{className:"pi-projectHeadTop",children:s.jsxs("div",{className:"pi-projectIdent",children:[s.jsx("h1",{className:"pi-projectTitle",children:j}),s.jsxs("div",{className:"pi-projectMeta",children:[v?s.jsx("span",{title:v,children:V(v)}):null,s.jsx("span",{className:"pi-projectDigest",children:L})]})]})}),s.jsxs("div",{className:"pi-projectFacets","aria-label":"Project sections",children:[s.jsx("button",{type:"button",className:"pi-projectFacet","data-selected":o==="overview"||void 0,onClick:()=>t(N),children:s.jsx("span",{children:"Overview"})}),s.jsxs("button",{type:"button",className:"pi-projectFacet","data-selected":o==="sessions"||void 0,onClick:()=>t({...N,indexView:"sessions"}),children:[s.jsx("span",{children:"Sessions"}),s.jsx("b",{children:a?.sessionCount??0})]}),g?s.jsxs("button",{type:"button",className:"pi-projectFacet","data-selected":o==="agents"||void 0,onClick:()=>t({...N,indexView:"agents"}),children:[s.jsx("span",{children:"Agents"}),s.jsx("b",{children:a?.agentCount??c.length})]}):null,s.jsxs("button",{type:"button",className:"pi-projectFacet",title:"Open worktrees in Repos",onClick:()=>t({view:"repos",...v?{root:v}:{},...C}),children:[s.jsx("span",{children:"Worktrees"}),s.jsx("b",{children:R}),s.jsx(ue,{className:"pi-projectFacetOut",size:11,strokeWidth:2,"aria-hidden":!0})]}),s.jsxs("button",{type:"button",className:"pi-projectFacet",disabled:!v,title:v?"Open this project's AGENTS.md":"No project root known",onClick:()=>t({view:"code",project:i,path:"AGENTS.md"}),children:[s.jsx("span",{children:"Rules"}),s.jsx("b",{children:v?"set":"—"}),s.jsx(ue,{className:"pi-projectFacetOut",size:11,strokeWidth:2,"aria-hidden":!0})]})]})]})}function As(e,t,i){if(i===0)return s.jsx("span",{children:"No conversations yet."});const n=[];return t>0&&n.push(s.jsxs("b",{children:[t," moving"]},"w")),e>0&&n.push(s.jsxs("b",{children:[e," needs you"]},"n")),n.push(s.jsxs("span",{children:[i," conversation",i===1?"":"s"]},"t")),n.reduce((o,r,a)=>(a>0&&o.push(s.jsx("span",{children:" · "},`sep${a}`)),o.push(r),o),[])}function ve(e){if(e.length<=18)return e;const t=e.match(/^([0-9a-f]{8})-[0-9a-f-]{27,}$/iu);return t?t[1]:`${e.slice(0,10)}…${e.slice(-5)}`}function Rs(e,t){return`${t?0:e.projects.length} tracked`}function Ts({route:e,navigate:t,projects:i}){const{onboarding:n,refreshOnboarding:o,reload:r}=ze(),a=Ls(n?.defaultHarness),[u,c]=m.useState(""),[j,v]=m.useState(""),[g,C]=m.useState(a),[N,L]=m.useState(!1),[R,y]=m.useState(null),[M,F]=m.useState(null),[I,D]=m.useState(null);m.useEffect(()=>{C(a)},[a]);const k=m.useMemo(()=>Ps(i),[i]),S=m.useMemo(()=>Ms(k,u),[u,k]),B=m.useMemo(()=>k.find(p=>p.slug===j)??he(k,u),[u,k,j]),f=u.trim(),x=Is(f)&&!he(k,f),l=B??(!x&&f?S[0]??null:null),h=l?"Open project":x?"Create project":"Find project",$=!!(l||x||f);m.useEffect(()=>{j&&(k.some(p=>p.slug===j)||v(""))},[k,j]),m.useEffect(()=>{if(!I)return;const p=k.find(P=>$s(P,I));p&&(D(null),t(me(e,p.slug)))},[I,t,k,e]);const d=p=>{v(p.slug),c(p.title),y(null),F(null)},b=p=>{t(me(e,p.slug))},T=async p=>{L(!0),y(null),F(null);try{await Ee("/api/onboarding/project",{method:"POST",body:JSON.stringify({contextRoot:p,sourceRoots:[p],defaultHarness:g})}),D(p),F("Project created. Refreshing inventory."),v(""),c(""),Ze(),await Promise.all([o(),r()])}catch(P){y(P instanceof Error?P.message:"Could not create project.")}finally{L(!1)}},W=p=>{if(p.preventDefault(),!N){if(l){b(l);return}if(x){T(f);return}if(f){y("No project matches that search. Paste a repo path to create one.");return}y("Choose a project or paste a repo path.")}};return s.jsxs("div",{className:"pi-zero",children:[s.jsxs("div",{className:"pi-zeroHead",children:[s.jsxs("span",{className:"pi-zeroKicker",children:[s.jsx(ns,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Projects"]}),s.jsx("h2",{children:"Pick a project to start."})]}),s.jsxs("form",{className:"pi-zeroComposer",onSubmit:W,children:[s.jsxs("div",{className:"pi-zeroBar",children:[s.jsxs("label",{className:"pi-zeroSelect",children:[s.jsx(is,{size:13,strokeWidth:1.8,"aria-hidden":!0}),s.jsxs("select",{value:j,"aria-label":"Choose project",onChange:p=>{const P=k.find(O=>O.slug===p.currentTarget.value);P?d(P):v("")},children:[s.jsx("option",{value:"",children:"Choose project"}),k.slice(0,80).map(p=>s.jsx("option",{value:p.slug,children:p.title},p.slug))]})]}),s.jsx("div",{className:"pi-zeroHarness",role:"group","aria-label":"Default harness",children:["claude","codex"].map(p=>s.jsx("button",{type:"button","data-on":g===p||void 0,onClick:()=>C(p),children:p==="claude"?"Claude":"Codex"},p))})]}),s.jsxs("div",{className:"pi-zeroInputRow",children:[s.jsx("textarea",{value:u,rows:2,placeholder:"Find project or paste /path/to/repo","aria-label":"Find or create project",onChange:p=>{c(p.currentTarget.value),v(""),y(null),F(null)},onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),p.currentTarget.form?.requestSubmit())}}),s.jsxs("button",{type:"submit",className:"pi-zeroSend",disabled:N||!$,title:h,children:[s.jsx(as,{size:15,strokeWidth:2,"aria-hidden":!0}),s.jsx("span",{children:N?"Working":h})]})]}),S.length>0?s.jsx("div",{className:"pi-zeroMatches","aria-label":"Matching projects",children:S.map(p=>s.jsxs("button",{type:"button",className:"pi-zeroMatch","data-selected":B?.slug===p.slug||void 0,onClick:()=>d(p),onDoubleClick:()=>b(p),children:[s.jsxs("span",{className:"pi-zeroMatchMain",children:[s.jsxs("span",{className:"pi-zeroMatchTitle",children:["/",p.title]}),s.jsx("span",{className:"pi-zeroMatchRoot",title:p.root??void 0,children:p.root?V(p.root):p.slug})]}),s.jsx("span",{className:"pi-zeroMatchMeta",children:Ws(p)})]},p.slug))}):f?s.jsx("div",{className:"pi-zeroEmpty",children:"No project matches."}):null,R?s.jsx("div",{className:"pi-zeroError",children:R}):null,M?s.jsx("div",{className:"pi-zeroStatus",children:M}):null]})]})}function Ls(e){return e==="codex"?"codex":"claude"}function me(e,t){return{view:"agents-v2",projectSlug:t,...e.showEphemeral?{showEphemeral:!0}:{},...e.machineId?{machineId:e.machineId}:{}}}function Ps(e){return e.map(t=>({slug:t.slug,title:t.title,root:t.root,agentCount:t.agentCount,sessionCount:t.sessionCount,lastActivityAt:t.lastActivityAt})).sort((t,i)=>i.lastActivityAt-t.lastActivityAt||i.agentCount-t.agentCount||i.sessionCount-t.sessionCount||t.title.localeCompare(i.title))}function Ms(e,t){const i=H(t);return i?e.map(n=>({option:n,score:Es(n,i)})).filter(n=>n.score!==null).sort((n,o)=>n.score-o.score||o.option.lastActivityAt-n.option.lastActivityAt||n.option.title.localeCompare(o.option.title)).slice(0,6).map(n=>n.option):e.slice(0,6)}function he(e,t){const i=H(t);return i?e.find(n=>{const o=H(n.root??""),r=H(n.root?Z(n.root):"");return H(n.title)===i||H(n.slug)===i||o===i||r===i||H(n.root?V(n.root):"")===i})??null:null}function Es(e,t){const i=H(e.title),n=H(e.slug),o=H(e.root??""),r=H(e.root?Z(e.root):"");return i===t||n===t||o===t||r===t?0:i.startsWith(t)||n.startsWith(t)||r.startsWith(t)?1:i.includes(t)||n.includes(t)||r.includes(t)?2:o.includes(t)?3:null}function H(e){return e.trim().toLowerCase().replace(/^~(?=\/)/u,"").replace(/\s+/g," ")}function Is(e){const t=e.trim();return/^(~\/|\/|\.{1,2}\/)/u.test(t)||t.includes("/")}function $s(e,t){const i=H(t);return i?[e.root??"",e.root?V(e.root):"",e.root?Z(e.root):"",e.slug,e.title].map(H).some(o=>o===i||o.endsWith(i)):!1}function Ws(e){return[fe(e.agentCount,"agent"),fe(e.sessionCount,"session"),e.lastActivityAt?_(e.lastActivityAt):null].filter(Boolean).join(" · ")}function fe(e,t){return`${e} ${t}${e===1?"":"s"}`}function Fs(e,t){return Ye(e,t)}function je(e){return/^native:process:/iu.test(e??"")}function Bs(e){return e.startsWith("/")||e.startsWith("~/")||e.includes("/")&&/\.(jsonl?|events)$/i.test(e)}function we(e,t,i){const n=e?.trim()??"";return!n||Bs(n)?t:n}function Ds({session:e,sessionRef:t,threads:i,lookup:n,route:o,navigate:r,nowMs:a}){const[u,c]=m.useState(null),j=e?.agentName??o.selectedAgentId??o.agentId??"Session",v=e?.harness??"session",g=n?.kind==="observe"?n.observe.data:null,C=g?.metadata?.session,N=e?.lastActivityAt??n?.session?.lastMessageAt??null,[L,R,y]=m.useMemo(()=>[ae(g),ke(g,N),Gs(g,N)],[g,N]),M=C?.gitBranch??n?.session?.currentBranch??e?.branch??null,F=C?.model??null,I=C?.turnCount??g?.metadata?.usage?.assistantMessages??(n?.kind==="conversation"?n.session.messageCount:null),D=R?_(R,a):e?.lastActivityAt?_(e.lastActivityAt,a):"—",k=e?.working?`live · last ${D}`:D!=="—"?`last ${D}`:"trace resolving",S=we(e?.work,j),B=ve(t),f=n?.session??null,x=n?.kind==="observe"?n.observe.agentId??f?.agentId??e?.agentId:f?.agentId??e?.agentId,l=n?.kind==="observe"?n.observe.sessionId:f?.harnessSessionId,h=[j,v,F,M,L?`started ${We(L)}`:null,y,I!=null?`turn ${w(I)}`:null,B].filter(b=>!!b&&b!=="—");m.useEffect(()=>{let b=!0;return c(null),!x&&!l&&!t?()=>{b=!1}:(Oe({includeDiscovered:!0}).then(T=>{b&&c(us(T,{agentId:x,sessionRefs:[t,l,e?.sessionId]}))}).catch(()=>{b&&c(null)}),()=>{b=!1})},[e?.sessionId,t,x,l]);const $=()=>{u&&He(r,{view:"terminal",terminalSessionId:u.terminalSessionId,terminalSurfaceKey:u.terminalSurfaceKey,mode:"takeover"},{returnTo:o})},d=u?ds(u,"takeover"):null;return s.jsxs("section",{className:"pi-sessionOverview","aria-label":"Session overview",children:[s.jsxs("section",{className:"pi-sessionMasthead","data-state":e?.working?"working":"recent",children:[s.jsxs("div",{className:"pi-sessionMastTop",children:[s.jsx("span",{className:"pi-sessionCrumb",children:"Sessions ▸"}),s.jsx("h2",{className:"pi-sessionHeadline",title:S,children:S}),s.jsxs("span",{className:"pi-sessionState",children:[e?.working?s.jsx("span",{className:"pi-sessionLiveDot","aria-hidden":!0}):null,k]})]}),s.jsx("div",{className:"pi-sessionMeta",children:h.map((b,T)=>s.jsxs("span",{title:T===h.length-1?t:b,children:[T===1?s.jsx(ge,{harness:v,size:11}):null,b]},`${b}:${T}`))}),u?s.jsxs("div",{className:"pi-sessionTerminalActions","aria-label":"tmux terminal actions",children:[s.jsxs("span",{className:"pi-sessionTerminalName",title:u.sessionName,children:["tmux · ",u.sessionName]}),s.jsx("button",{type:"button",onClick:$,children:"Open in web terminal"}),d?s.jsxs("a",{href:d,children:["Open in native terminal",s.jsx(os,{size:11,strokeWidth:1.8,"aria-hidden":!0})]}):null]}):null]}),s.jsx(Zs,{lookup:n,session:e,threads:i,nowMs:a,route:o,navigate:r})]})}function Os({session:e,sessionRef:t,threads:i,route:n,navigate:o,nowMs:r}){const[a,u]=m.useState(null);return m.useEffect(()=>{u(null)},[t]),s.jsx("main",{className:"pi-sessionDetail","aria-label":"Selected session",children:s.jsxs("div",{className:"pi-sessionContent",children:[s.jsx(Ds,{session:e,sessionRef:t,threads:i,lookup:a,route:n,navigate:o,nowMs:r}),s.jsx(qe,{sessionRef:t,navigate:o,showObserveRail:!1,onLookup:u})]})})}function w(e){return typeof e!="number"||!Number.isFinite(e)?"—":Math.abs(e)<1e3?e.toLocaleString("en-US"):Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(e).toLowerCase()}function Ne(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?"—":`${w(e)} tok`}function G(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}function zs(e){const t=G(e?.contextInputTokens),i=G(e?.contextWindowTokens);return t===null||i===null?null:Math.max(0,Math.min(1,t/i))}function Hs(e){const t=[{key:"input",label:"input",value:G(e?.inputTokens)??0},{key:"cache-read",label:"cache rd",value:G(e?.cacheReadInputTokens)??0},{key:"cache-write",label:"cache wr",value:G(e?.cacheCreationInputTokens)??0},{key:"output",label:"output",value:G(e?.outputTokens)??0},{key:"reasoning",label:"reasoning",value:G(e?.reasoningOutputTokens)??0}].filter(r=>r.value>0),i=t.reduce((r,a)=>r+a.value,0),n=t.filter(r=>r.key!=="reasoning"||i>0&&r.value/i>=.02);if(n.length>0)return n;const o=G(e?.totalTokens);return o!==null?[{key:"total",label:"total",value:o}]:[]}function qs({buckets:e}){const t=e.reduce((i,n)=>i+n.value,0);return e.length===0?null:s.jsxs("div",{className:"pi-sessionGlanceTokens","aria-label":"Token usage",children:[s.jsx("div",{className:"pi-sessionGlanceTokenBars",children:e.map(i=>s.jsx("span",{className:"pi-sessionGlanceTokenSeg","data-kind":i.key,style:{flexGrow:t>0?Math.max(.035,i.value/t):1,flexBasis:0},title:`${i.label}: ${Ne(i.value)}`},i.key))}),s.jsx("div",{className:"pi-sessionGlanceTokenLegend",children:e.map(i=>s.jsxs("span",{children:[s.jsx("i",{"data-kind":i.key,"aria-hidden":!0}),i.label," ",s.jsx("b",{children:w(i.value)})]},i.key))})]})}function ae(e){const t=ee(e?.metadata?.session?.sessionStart);if(t!==null)return t;for(const i of e?.events??[]){const n=ee(i.at);if(n!==null)return n}return null}function ke(e,t){for(let o=(e?.events.length??0)-1;o>=0;o-=1){const r=ee(e?.events[o]?.at);if(r!==null)return r}const i=ae(e),n=e?.events.at(-1)?.t;return i!==null&&typeof n=="number"&&Number.isFinite(n)?i+n*1e3:ee(t)}function Gs(e,t){const i=ae(e),n=ke(e,t);if(i!==null&&n!==null)return ie(Math.max(0,n-i))||"—";const o=e?.events.at(-1)?.t;return typeof o=="number"&&Number.isFinite(o)&&ie(o*1e3)||"—"}function ie(e){if(typeof e!="number"||!Number.isFinite(e)||e<0)return"";const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const i=Math.floor(t/60);if(i<60)return`${i}m`;const n=Math.floor(i/60),o=i%60;if(n<48)return o>0?`${n}h ${o}m`:`${n}h`;const r=Math.floor(n/24),a=n%24;return a>0?`${r}d ${a}h`:`${r}d`}function _s(e){const t=e?.metadata?.topology;if(!t)return null;const i=t.agents.length,n=t.agents.filter(u=>u.role!=="lead").length,o=t.groups.filter(u=>u.kind==="workflow").length,r=t.tasks.length,a=[];return n>0?a.push(`${n} worker${n===1?"":"s"}`):i>0&&a.push(`${i} agent${i===1?"":"s"}`),o>0&&a.push(`${o} workflow${o===1?"":"s"}`),r>0&&a.push(`${r} task${r===1?"":"s"}`),a.length?a.join(" · "):null}function Vs(e){return[...e].sort((t,i)=>xe(i.state)-xe(t.state)||i.touches-t.touches||i.lastT-t.lastT||t.path.localeCompare(i.path)).slice(0,5).map(t=>({path:t.path,kind:t.state,detail:[t.touches>1?`${w(t.touches)} touches`:"1 touch",t.lastT>0?`last ${ie(t.lastT*1e3)}`:null].filter(Boolean).join(" · ")}))}function xe(e){switch(e){case"created":return 3;case"modified":return 2;case"read":return 1}}function Ks(e){const t=new Map;for(const i of e){if(i.kind!=="tool")continue;const n=Us(i.tool||i.text),o=t.get(n)??{count:0,samples:[]};o.count+=1;const r=i.arg||i.detail||i.text;r&&o.samples.length<2&&o.samples.push(r),t.set(n,o)}return[...t.entries()].sort((i,n)=>n[1].count-i[1].count||i[0].localeCompare(n[0])).slice(0,5).map(([i,n])=>({name:i,count:n.count,detail:n.samples.join(" · ")||`${w(n.count)} uses`}))}function Us(e){return(e.trim().split(/\s+/u)[0]??"tool").replace(/[_-]+/gu," ").toLowerCase()}function Xs({usage:e,contextPct:t,topology:i,workspace:n,projectRoot:o,branch:r}){const a=[];return t!==null&&a.push({label:"Context",value:`${t}%`,detail:t>=80?"approaching limit":"within window",tone:t>=80?"warn":void 0}),(e?.serviceTier||e?.planType||e?.speed)&&a.push({label:"Budget",value:e.serviceTier??e.planType??e.speed??"usage",detail:[e.planType,e.speed].filter(Boolean).join(" · ")||"provider metadata"}),n&&o&&n!==o?a.push({label:"Worktree",value:V(n),detail:"session cwd differs from project root",tone:"warn"}):r&&a.push({label:"Repo",value:r,detail:"session branch"}),i&&a.push({label:"Topology",value:i,detail:"observed harness hierarchy"}),(e?.webSearchRequests||e?.webFetchRequests)&&a.push({label:"Network",value:`${w((e.webSearchRequests??0)+(e.webFetchRequests??0))} req`,detail:[e.webSearchRequests?`${w(e.webSearchRequests)} search`:null,e.webFetchRequests?`${w(e.webFetchRequests)} fetch`:null].filter(Boolean).join(" · ")}),a.slice(0,4)}function Ys({session:e,threads:t,nowMs:i}){return t.filter(n=>n.kind==="agent").filter(n=>n.agentId!==e?.agentId||n.work!==e?.work).sort((n,o)=>Number(o.working)-Number(n.working)||o.lastActivityAt-n.lastActivityAt).slice(0,4).map(n=>{const o=!!(e?.branch&&n.branch===e.branch),r=!!(e?.agentName&&n.agentName===e.agentName);return{thread:n,title:we(n.work,n.agentName,n.id),channel:n.conversationId?ve(n.conversationId):n.agentName,state:n.needs?"needs":n.working?"working":"recent",time:n.lastActivityAt?_(n.lastActivityAt,i):"—",participants:n.agentName,why:o?"same branch":r?"same agent":n.working?"active in project":"project thread"}})}function Y({label:e,value:t,title:i,detail:n}){return s.jsxs("span",{className:"pi-sessionGlanceField",title:i,children:[s.jsx("span",{children:e}),s.jsx("b",{children:t}),n?s.jsx("small",{children:n}):null]})}function Zs({lookup:e,session:t,threads:i,nowMs:n,route:o,navigate:r}){const[a,u]=m.useState(!1),c=m.useMemo(()=>{const x=e?.kind==="observe"?e.observe.data:null,l=x?.metadata?.session,h=x?.metadata?.usage,$=x?.events??[],d=x?.files??[],b=l?.turnCount??h?.assistantMessages??(e?.kind==="conversation"?e.session.messageCount:null),T=$.filter(U=>U.kind==="tool").length,W=d.filter(U=>U.state==="created").length,p=d.filter(U=>U.state==="modified").length,P=d.filter(U=>U.state==="read").length,O=W+p,E=zs(h),z=E!==null?Math.round(E*100):null,A=l?.cwd??e?.session?.workspaceRoot??t?.projectRoot??null,K=l?.gitBranch??e?.session?.currentBranch??t?.branch??null,q=_s(x),se=Ne(h?.totalTokens??(typeof h?.inputTokens=="number"||typeof h?.outputTokens=="number"?(h?.inputTokens??0)+(h?.outputTokens??0):null)),ye=Hs(h),Ce=O>0?[p>0?`${w(p)} mod`:null,W>0?`${w(W)} new`:null].filter(Boolean).join(" · "):P>0?"read-only":"no file trace",Ae=d.length>0?`${w(d.length)} touched`:"—",Re=Vs(d),Te=Ks($),Le=Xs({usage:h,contextPct:z,topology:q,workspace:A,projectRoot:t?.projectRoot,branch:K}),Pe=Ys({session:t,threads:i,nowMs:n});return{turnCount:b,toolCount:T,editCount:O,fileCountLabel:Ae,fileStateLabel:Ce,workspace:A,contextPct:z,showContext:z!==null,contextWarn:z!==null&&z>=80,tokenTotal:se,buckets:ye,fileSignals:Re,toolSignals:Te,contextSignals:Le,threadSignals:Pe,projectRoot:t?.projectRoot??null}},[e,t,i,n]),{turnCount:j,toolCount:v,editCount:g,fileCountLabel:C,fileStateLabel:N,workspace:L,contextPct:R,showContext:y,contextWarn:M,tokenTotal:F,buckets:I,fileSignals:D,toolSignals:k,contextSignals:S,threadSignals:B,projectRoot:f}=c;return s.jsxs("section",{className:"pi-sessionGlance","aria-label":"Session glance",children:[s.jsxs("div",{className:"pi-sessionVitals","aria-label":"Session vitals",children:[s.jsx(Y,{label:"Turns",value:w(j)}),s.jsx(Y,{label:"Tools",value:w(v)}),s.jsx(Y,{label:"Edits",value:w(g)}),s.jsx(Y,{label:"Files",value:C,detail:N!=="no file trace"?N:null}),L&&f&&L!==f?s.jsx(Y,{label:"Worktree",value:V(L),title:L}):null,y?s.jsxs("span",{className:"pi-sessionContextVital",title:"Context window usage",children:[s.jsx("span",{children:"Ctx"}),s.jsx("span",{className:"pi-sessionContextBar","aria-hidden":!0,children:s.jsx("span",{"data-warn":M||void 0,style:{width:`${R}%`}})}),s.jsxs("b",{"data-warn":M||void 0,children:[R,"%"]})]}):null,I.length>0?s.jsxs("button",{type:"button",className:"pi-sessionTokenToggle","aria-expanded":a,onClick:()=>u(x=>!x),children:[s.jsx("span",{children:"Tokens"}),s.jsx("b",{children:F}),s.jsx("i",{children:a?"▾":"▸"})]}):null]}),a&&I.length>0?s.jsx(qs,{buckets:I}):null,s.jsx(Js,{files:D,tools:k,context:S,threads:B,route:o,navigate:r})]})}function Js({files:e,tools:t,context:i,threads:n,route:o,navigate:r}){return s.jsxs("section",{className:"pi-sessionSignals","aria-label":"Session work signals",children:[s.jsxs("div",{className:"pi-sessionSignalCol",children:[s.jsxs("div",{className:"pi-sessionSignalHead",children:[s.jsx("span",{children:"Files"}),s.jsx("b",{children:w(e.length)})]}),e.length>0?s.jsx("div",{className:"pi-sessionFileList",children:e.map(a=>s.jsxs("div",{className:"pi-sessionFileRow",children:[s.jsx("span",{"data-kind":a.kind,children:a.kind}),s.jsx("code",{title:a.path,children:a.path}),s.jsx("small",{children:a.detail})]},`${a.kind}:${a.path}`))}):s.jsx("span",{className:"pi-sessionSignalEmpty",children:"No file trace yet."})]}),s.jsxs("div",{className:"pi-sessionSignalCol",children:[s.jsx("div",{className:"pi-sessionSignalHead",children:s.jsx("span",{children:"Tools · Context · Topology"})}),t.length>0?s.jsx("div",{className:"pi-sessionToolGrid",children:t.map(a=>s.jsxs("span",{className:"pi-sessionToolPill",title:a.detail,children:[s.jsx("b",{children:a.name}),s.jsx("em",{children:w(a.count)})]},a.name))}):null,i.length>0?s.jsx("div",{className:"pi-sessionContextList",children:i.map(a=>s.jsxs("div",{className:"pi-sessionContextRow",children:[s.jsx("span",{children:a.label}),s.jsx("b",{"data-tone":a.tone,children:a.value}),s.jsx("small",{children:a.detail})]},`${a.label}:${a.value}`))}):t.length===0?s.jsx("span",{className:"pi-sessionSignalEmpty",children:"Trace metadata is still resolving."}):null]}),s.jsxs("div",{className:"pi-sessionSignalCol",children:[s.jsxs("div",{className:"pi-sessionSignalHead",children:[s.jsx("span",{children:"Recent threads"}),s.jsx("b",{children:w(n.length)})]}),n.length>0?s.jsx("div",{className:"pi-sessionThreadList",children:n.map(a=>s.jsxs("button",{type:"button",className:"pi-sessionThreadRow",onClick:()=>r(be(a.thread,o)),children:[s.jsx("span",{className:"pi-sessionThreadTitle",title:a.title,children:a.title}),s.jsxs("span",{className:"pi-sessionThreadMeta",children:[s.jsx("b",{children:a.channel}),s.jsx("em",{children:a.state}),s.jsx("small",{children:a.time})]}),s.jsxs("span",{className:"pi-sessionThreadWhy",children:[a.participants," · ",a.why]})]},a.thread.id))}):s.jsx("span",{className:"pi-sessionSignalEmpty",children:"No recent agent threads."})]})]})}function ne(e){return!e||e==="—"||/^\d+\s+branches$/iu.test(e)?null:e}function Se(e,t,i,n){const o=new Map,r=(u,c)=>{const j=u??e,v=ne(c),g=j??"project",C=o.get(g);if(C)return!C.branch&&v&&(C.branch=v),C;const N={key:g,root:j,branch:v,sessions:0,work:0,moving:0,lastActivityAt:0,repoWatch:null};return o.set(g,N),N};for(const u of t){const c=r(u.root,u.branch);u.working&&(c.moving+=1),c.lastActivityAt=Math.max(c.lastActivityAt,u.lastActivityAt)}const a=(u,c)=>{const j=u??e,v=o.get(j??"project");return v||(t.length>0?o.get(e??"")??o.values().next().value:r(u,c))};for(const u of i){const c=a(u.workspaceRoot??u.projectRoot,u.branch);c.sessions+=1,u.working&&(c.moving+=1,c.branch=ne(u.branch)??c.branch),c.lastActivityAt=Math.max(c.lastActivityAt,u.lastActivityAt)}for(const u of n){const c=a(u.workspaceRoot??u.projectRoot,u.branch);c.work+=1,u.working&&(c.moving+=1,c.branch=ne(u.branch)??c.branch),c.lastActivityAt=Math.max(c.lastActivityAt,u.lastActivityAt)}return o.size===0&&r(e,null),[...o.values()].sort((u,c)=>c.moving-u.moving||c.lastActivityAt-u.lastActivityAt||(u.root??"").localeCompare(c.root??""))}function Qs(e){return e.worktrees.map(t=>({key:t.id,root:t.path,branch:t.branch.name,sessions:t.sessions.length,work:t.agents.length,moving:t.agents.some($e)?1:0,lastActivityAt:t.lastCommitAt??0,repoWatch:t}))}function et({pullRequests:e,loading:t,warnings:i,onRefresh:n,nowMs:o}){return s.jsxs("section",{className:"pi-projectPullRequests","aria-label":"Open pull requests",children:[s.jsxs("div",{className:"pi-projectPullRequestsHead",children:[s.jsx("span",{children:"Open PRs"}),s.jsx("b",{children:t&&e.length===0?"…":w(e.length)})]}),e.length>0?s.jsx("div",{className:"pi-projectPullRequestList",children:e.slice(0,6).map(r=>{const a=r.updatedAt?Date.parse(r.updatedAt):Number.NaN;return s.jsxs("a",{className:"pi-projectPullRequest",href:r.url,target:"_blank",rel:"noreferrer",children:[s.jsxs("span",{className:"pi-projectPullRequestNumber",children:["#",r.number]}),s.jsx("b",{title:r.title,children:r.title}),s.jsxs("span",{className:"pi-projectPullRequestBranch",title:`${r.headRefName} → ${r.baseRefName}`,children:[r.headRefName," → ",r.baseRefName]}),s.jsx("em",{children:r.isDraft?"draft":"open"}),s.jsx("time",{children:Number.isFinite(a)?_(a,o):"updated"})]},r.id)})}):s.jsxs("div",{className:"pi-projectPullRequestState","data-loading":t||void 0,children:[s.jsx("span",{children:t?"Checking GitHub for open pull requests…":i[0]??"No open pull requests for this repository."}),!t&&i.length>0?s.jsx("button",{type:"button",onClick:n,children:"Retry"}):null]})]})}function st(e){const t=new Set;let i=0,n=0;const o=[];for(const r of e.layers){r.files.length>0&&o.push(r.kind);for(const a of r.files)t.add(a.newPath??a.oldPath??"unknown"),i+=a.additions??0,n+=a.deletions??0}return{additions:i,deletions:n,files:[...t],layers:o}}function tt({additions:e,deletions:t}){return e+t===0?s.jsx("span",{className:"pi-projectWorktreeChurnBar","data-empty":!0}):s.jsxs("span",{className:"pi-projectWorktreeChurnBar","aria-label":`${e} additions and ${t} deletions`,children:[e>0?s.jsx("i",{"data-add":!0,style:{flexGrow:e}}):null,t>0?s.jsx("i",{"data-delete":!0,style:{flexGrow:t}}):null]})}function nt({project:e,repoProject:t,repoLoading:i,repoError:n,diffSnapshots:o,diffErrors:r,diffLoading:a,pullRequests:u,pullRequestsLoading:c,pullRequestWarnings:j,onRepositoryRefresh:v,threads:g,sessions:C,route:N,navigate:L,nowMs:R}){const y=e?.root??C[0]?.projectRoot??g[0]?.projectRoot??null,M=g.length,F=e?.sessionCount??C.length,I=e?.agentCount??0,D=Math.max(e?.lastActivityAt??0,C[0]?.lastActivityAt??0,g[0]?.lastActivityAt??0),k=e?.branches.length?e.branches:[...new Set([...C.map(l=>l.branch),...g.map(l=>l.branch)].filter(l=>!!l&&l!=="—"&&l!=="main"))],S=t?.worktrees.length?Qs(t):Se(y,e?.worktrees??[],C,g),B=S.find(l=>l.moving>0&&l.branch)?.branch??S.find(l=>l.branch)?.branch??k[0]??"main",f=y?Z(y):e?.title??N.projectSlug??"project",x=S.find(l=>l.moving>0)?.key??S.find(l=>l.branch===B)?.key??S[0]?.key;return s.jsxs("main",{className:"pi-projectOverview","aria-label":"Project overview",children:[s.jsxs("section",{className:"pi-projectSnapshot","aria-label":"Project snapshot",children:[s.jsxs("div",{className:"pi-projectRepository",children:[s.jsxs("div",{className:"pi-projectRepositoryHead",children:[s.jsx("span",{children:"Repository"}),s.jsx(rs,{size:13,strokeWidth:1.7,"aria-hidden":!0})]}),s.jsxs("div",{className:"pi-projectRepositoryIdentity",children:[s.jsx("b",{children:f}),s.jsx("span",{title:y??void 0,children:y?V(y):N.projectSlug??"project"})]}),s.jsxs("div",{className:"pi-projectRepositoryCurrent",children:[S.some(l=>l.moving>0)?s.jsx("span",{className:"pi-projectRepositoryPulse","aria-label":"Active now"}):null,s.jsxs("span",{children:[s.jsx("small",{children:"Current branch"}),s.jsx("b",{title:B,children:B})]}),s.jsx("time",{children:D?_(D,R):"no activity"})]}),F>0||I>0||M>0?s.jsxs("div",{className:"pi-projectRepositoryStats","aria-label":"Repository activity",children:[F>0?s.jsxs("span",{children:[s.jsx("b",{children:w(F)})," sessions"]}):null,I>0?s.jsxs("span",{children:[s.jsx("b",{children:w(I)})," agents"]}):null,M>0?s.jsxs("span",{children:[s.jsx("b",{children:w(M)})," threads"]}):null]}):null]}),s.jsxs("div",{className:"pi-projectWorktrees",children:[s.jsxs("div",{className:"pi-projectWorktreesHead",children:[s.jsx("span",{children:"Worktree preview"}),s.jsx("b",{children:w(S.length)})]}),s.jsx("div",{className:"pi-projectWorktreeList",children:S.slice(0,6).map(l=>{const h=l.repoWatch,$=l.root?o.get(l.root)??null:null,d=$?st($):null,b=h?Ie(h):null,T=d?.additions??b?.add??0,W=d?.deletions??b?.del??0,p=d?.files.length??(h?Math.max(h.status.changedFiles,b?.files??0):0),P=!!(p>0||h&&(!h.status.clean||h.branch.ahead>0||h.branch.behind>0)),O=u.filter(A=>A.headRefName===l.branch),E=!!(l.root&&a&&!$&&!r.has(l.root)),z=l.root?r.get(l.root)??null:"No worktree path is available.";return s.jsxs("article",{className:"pi-projectWorktree","data-active":l.key===x||void 0,"data-stranded":P||void 0,children:[s.jsx("span",{className:"pi-projectWorktreeTop",children:s.jsx("b",{title:l.branch??"main",children:l.branch??"main"})}),s.jsx("em",{title:l.root??void 0,children:l.root?V(l.root):"workspace"}),$||h?s.jsxs("div",{className:"pi-projectWorktreeDiff","data-clean":!P||void 0,children:[P?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"pi-projectWorktreeChurn",children:[s.jsxs("b",{className:"pi-projectWorktreeAdd",children:["+",w(T)]}),s.jsxs("b",{className:"pi-projectWorktreeDel",children:["−",w(W)]}),s.jsx(tt,{additions:T,deletions:W})]}),s.jsxs("small",{children:[w(p)," changed"]})]}):s.jsx("small",{children:"clean"}),l.root?s.jsx("button",{type:"button",className:"pi-projectWorktreeOpenDiff",onClick:()=>L({view:"repo-diff",path:l.root}),children:"View diff"}):null]}):s.jsxs("div",{className:"pi-projectWorktreeDiff","data-pending":!0,children:[s.jsx("small",{children:E||i?"Reading worktree diff…":z??n??"No diff data returned."}),!E&&!i?s.jsx("button",{type:"button",className:"pi-projectWorktreeOpenDiff",onClick:v,children:"Retry"}):null]}),d&&d.files.length>0?s.jsxs("span",{className:"pi-projectWorktreeFiles",title:d.files.join(`
2
- `),children:[d.files.slice(0,2).map(A=>Z(A)).join(" · "),d.files.length>2?` · +${d.files.length-2} more`:""]}):null,s.jsx("span",{className:"pi-projectWorktreeMeta",children:h?s.jsxs(s.Fragment,{children:[s.jsx("small",{children:h.branch.ahead>0||h.branch.behind>0?`${h.branch.ahead}↑ ${h.branch.behind}↓`:"synced"}),h.status.staged>0?s.jsxs("small",{children:[w(h.status.staged)," staged"]}):null,h.status.unstaged>0?s.jsxs("small",{children:[w(h.status.unstaged)," unstaged"]}):null,h.status.untracked>0?s.jsxs("small",{children:[w(h.status.untracked)," untracked"]}):null,h.status.conflicts>0?s.jsxs("small",{children:[w(h.status.conflicts)," conflicts"]}):null,d?.layers.map(A=>s.jsx("small",{children:A},A)),O.length>0?s.jsxs("small",{children:[O.length," PR",O.length===1?"":"s"]}):null]}):s.jsxs(s.Fragment,{children:[s.jsx("small",{children:l.lastActivityAt?_(l.lastActivityAt,R):"idle"}),s.jsxs("small",{children:[w(l.sessions)," sessions"]}),s.jsxs("small",{children:[w(l.work)," threads"]})]})})]},l.key)})}),S.length>6?s.jsxs("div",{className:"pi-projectWorktreeMore",children:["+",S.length-6," more worktrees"]}):null]})]}),s.jsx(et,{pullRequests:u,loading:c,warnings:j,onRefresh:v,nowMs:R})]})}function it({project:e,threads:t,sessions:i,route:n,navigate:o,nowMs:r}){const a=e?.root??i[0]?.projectRoot??t[0]?.projectRoot??null,u=m.useMemo(()=>Se(a,e?.worktrees??[],i,t).map(j=>j.root).filter(j=>!!j),[e?.worktrees,a,i,t]),c=ws(a,u);return s.jsx(nt,{project:e,repoProject:c.project,repoLoading:c.repoLoading,repoError:c.repoError,diffSnapshots:c.diffSnapshots,diffErrors:c.diffErrors,diffLoading:c.diffLoading,pullRequests:c.pullRequests,pullRequestsLoading:c.pullRequestsLoading,pullRequestWarnings:c.pullRequestWarnings,onRepositoryRefresh:c.refresh,threads:t,sessions:i,route:n,navigate:o,nowMs:r})}function Zn({route:e,navigate:t,zeroPreview:i=!1}){const{model:n,nowMs:o,loading:r,error:a,agents:u=Ns}=_e(e),c=!!e.projectSlug,j=c&&!je(e.sessionId)?e.sessionId??null:null,v=m.useMemo(()=>j?Fs(n.sessions,e):null,[n.sessions,e,j]),g=c?e.indexView==="agents"?"agents":e.indexView==="sessions"?"sessions":"overview":"overview",C=c?n.projects.find(f=>f.slug===e.projectSlug)??null:null,N=m.useMemo(()=>{if(i)return[];if(!c)return[];const f=e.projectSlug,x=Q(n.threads,f),l=oe(n.sessions,f);return g==="overview"?[]:g==="agents"?x.filter(h=>h.kind==="agent"):l.length>0?l:x},[n.sessions,n.threads,g,e.projectSlug,c,i]),L=m.useMemo(()=>Ve(N),[N]),R=m.useMemo(()=>L.flatMap(f=>f.items),[L]),y=n.projects.length>0||n.threads.length>0||n.sessions.length>0,M=r&&!y,F=r&&!i,I=!c&&!F&&(i||n.projects.length===0&&N.length===0),D=!c&&!I,[k,S]=m.useState(-1),B=m.useRef(new Map);return m.useEffect(()=>{!c||!e.sessionId||!je(e.sessionId)||t({...e,indexView:"sessions",sessionId:void 0,selectedAgentId:void 0})},[t,e,c]),m.useEffect(()=>{S(-1)},[e.projectSlug]),m.useEffect(()=>{function f(x){const l=document.activeElement;if(!!l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const $=R.length;if($){if(x.key==="ArrowDown"||x.key==="j")x.preventDefault(),S(d=>d<0?0:Math.min($-1,d+1));else if(x.key==="ArrowUp"||x.key==="k")x.preventDefault(),S(d=>d<0?0:Math.max(0,d-1));else if(x.key==="Enter"){const d=R[k<0?0:k];d&&(x.preventDefault(),t(d.kind==="session"?re(d,e):le(d,e)))}}}return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[k,R,t,e]),m.useEffect(()=>{if(k<0)return;const f=R[k];f&&B.current.get(f.id)?.scrollIntoView({block:"nearest"})},[k,R]),s.jsxs("div",{className:"s-pi s-pi-inbox","aria-busy":r||void 0,"data-loading":r||void 0,children:[c?s.jsx(Cs,{route:e,navigate:t,slug:e.projectSlug,model:n,mode:g,repoProject:null}):s.jsx("div",{className:"pi-inboxHead",children:s.jsxs("div",{className:"pi-inboxHeading",children:[s.jsx("h1",{className:"pi-inboxTitle",children:"Projects"}),s.jsx("span",{className:"pi-inboxDigest",children:Rs(n,i)})]})}),j?s.jsx(Os,{session:v,sessionRef:j,threads:Q(n.threads,e.projectSlug),route:e,navigate:t,nowMs:o}):c&&g==="overview"?s.jsx(it,{project:C,threads:Q(n.threads,e.projectSlug),sessions:oe(n.sessions,e.projectSlug),route:e,navigate:t,nowMs:o}):D?s.jsx(Ge,{model:n,agents:u,route:e,navigate:t,nowMs:o}):s.jsxs("div",{className:"pi-threads",children:[M?s.jsx(ys,{}):null,!M&&L.map(f=>{let x=0;for(const l of L){if(l.group===f.group)break;x+=l.items.length}return s.jsxs("div",{children:[s.jsxs("div",{className:"pi-sectionHead","data-tone":f.group,children:[s.jsx("span",{className:"pi-sectionLabel",children:f.label}),s.jsx("span",{className:"pi-sectionCount",children:f.items.length})]}),f.items.map((l,h)=>{const $=x+h;return s.jsx(Ss,{thread:l,crossProject:!c,selected:l.kind==="session"?Ue(l,e,n.sessions):Xe(l,e,n.threads),cursor:k===$,nowMs:o,onSelect:()=>{const d=l.kind==="session"?Ke(l,e):be(l,e);t(d)},onOpen:()=>t(l.kind==="session"?re(l,e):le(l,e)),rowRef:d=>{d?B.current.set(l.id,d):B.current.delete(l.id)}},l.id)})]},f.group)}),!M&&N.length===0?a&&!y?s.jsx(pe,{tone:"error",title:"Projects unavailable",detail:a}):I?s.jsx("div",{className:"pi-empty",children:s.jsx(Ts,{route:e,navigate:t,projects:n.projects})}):F?s.jsx("div",{className:"pi-empty",children:"Loading…"}):s.jsx(pe,{title:at(c,g)}):null]})]})}function at(e,t){return e&&t==="agents"?"No visible agents in this project.":e?"No sessions in this project yet.":"No projects yet."}export{Zn as ProjectsInbox,Ss as ThreadRow};
@@ -1 +0,0 @@
1
- import{r as d,j as t}from"./index-CZ-05hKz.js";import{t as W}from"./time-Dhsh_2EG.js";import{p as me}from"./NewChatComposer-hlWT-nbR.js";import{F as Se,A as fe}from"./AddProjectForm-CcD6qvV8.js";import{s as xe}from"./project-overview-helpers-BQTc_Ous.js";import{u as ge,i as X,s as we,c as F,d as _,e as ve}from"./projects-inbox-D-zAb9Gp.js";import{S as Z}from"./search-D1tJSAWe.js";import{X as ye}from"./x-e3h2hDsp.js";import{C as re}from"./chevron-down-Mp9mu_yd.js";import{C as ae}from"./chevron-right-CzH-TaSF.js";import{F as le}from"./DocumentFocusViewer-DZVhS7as.js";import{c as Ne}from"./createLucideIcon-DXpqZP7I.js";import{A as Ae}from"./archive-BjcGiAy8.js";const Ce=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],Pe=Ne("pin",Ce),ee=4,be=4,ce="openscout.projects.pinnedSessions",de="openscout.projects.archivedSessions";function ke(e){return e.needs>0?"needs":e.working>0||e.liveSessionCount>0?"working":"idle"}function Le({rows:e=6}){return t.jsx("div",{className:"pi-railLoading","aria-hidden":"true",children:Array.from({length:e},(i,s)=>t.jsxs("div",{className:"pi-projectGroup pi-projectGroup--loading",children:[t.jsx("div",{className:"pi-projectGroupHead",children:t.jsxs("span",{className:"pi-projectPath",children:[t.jsx(le,{size:13,strokeWidth:1.6,"aria-hidden":!0}),t.jsx("span",{className:"pi-loadingLine pi-loadingLine--railProject"})]})}),t.jsxs("div",{className:"pi-projectSessionList",children:[t.jsx("span",{className:"pi-loadingLine pi-loadingLine--railSession"}),t.jsx("span",{className:"pi-loadingLine pi-loadingLine--railSession"})]})]},s))})}function Re({route:e,navigate:i,zeroPreview:s=!1}){const{model:o,nowMs:a,loading:r,error:c}=ge(e),[p,y]=d.useState(""),[S,m]=d.useState("recent"),[f,N]=d.useState(!1),[L,u]=d.useState(()=>new Set),[b,A]=d.useState(()=>new Set),[x,R]=d.useState(()=>$e()),[g,he]=d.useState(()=>Fe()),[V,B]=d.useState(!1),w=e.machineId,P=e.showEphemeral,je=r&&o.projects.length===0&&o.sessions.length===0,j=d.useMemo(()=>s?[]:o.sessions.filter(n=>!g.has(C(n))),[o.sessions,g,s]),J=d.useMemo(()=>s?[]:Ie(o.projects,j),[o.projects,j,s]),E=d.useMemo(()=>pe(J,p,S),[J,p,S]),q=p.trim().length>0,K=q?E:E.filter(n=>!X(n.project,a)),T=q?[]:E.filter(n=>X(n.project,a)),U=d.useMemo(()=>s?[]:z(j.filter(n=>x.has(C(n))&&D(n,p))),[j,x,p,s]),Y=d.useMemo(()=>s?[]:ue(j,p),[j,p,s]),Q=d.useCallback(n=>{u(l=>ne(l,n)),i({view:"agents-v2",projectSlug:n,...w?{machineId:w}:{},...P?{showEphemeral:!0}:{}})},[w,i,P]),I=d.useCallback(n=>{u(l=>ne(l,n.projectSlug)),i(we(n,{projectSlug:n.projectSlug,...w?{machineId:w}:{},...P?{showEphemeral:!0}:{}}))},[w,i,P]),M=d.useCallback(n=>{const l=C(n);R(v=>{const h=new Set(v);return h.has(l)?h.delete(l):h.add(l),oe(h),h})},[]),O=d.useCallback(n=>{const l=C(n);he(v=>{if(v.has(l))return v;const h=new Set(v);return h.add(l),_e(h),h}),R(v=>{if(!v.has(l))return v;const h=new Set(v);return h.delete(l),oe(h),h}),F(n,e,j)&&i({view:"agents-v2",projectSlug:n.projectSlug,indexView:"sessions",...w?{machineId:w}:{},...P?{showEphemeral:!0}:{}})},[w,i,j,e,P]);return t.jsxs("nav",{className:"s-pi s-pi-rail","aria-label":"Projects","aria-busy":r||void 0,"data-loading":r||void 0,children:[t.jsxs("div",{className:"pi-railFind",role:"search",children:[t.jsx(Z,{size:13,strokeWidth:1.8,"aria-hidden":!0}),t.jsx("input",{className:"pi-railFindInput",type:"search",value:p,placeholder:"Find project or session","aria-label":"Find project or session",onChange:n=>y(n.currentTarget.value)}),p?t.jsx("button",{type:"button",className:"pi-railFindClear","aria-label":"Clear",onClick:()=>y(""),children:t.jsx(ye,{size:12,strokeWidth:2,"aria-hidden":!0})}):null]}),t.jsx("div",{className:"pi-railBody",children:t.jsxs("div",{className:"pi-railGroup pi-railGroup--projects",children:[t.jsxs("div",{className:"pi-railProjectTools",children:[t.jsx("div",{className:"pi-railLabel",children:"Projects"}),t.jsxs("label",{className:"pi-railSortWrap",title:"Sort projects",children:[t.jsx("span",{className:"pi-srOnly",children:"Sort projects"}),t.jsxs("select",{className:"pi-railSort",value:S,"aria-label":"Sort projects",onChange:n=>m(n.currentTarget.value),children:[t.jsx("option",{value:"recent",children:"Recent"}),t.jsx("option",{value:"name",children:"Name"}),t.jsx("option",{value:"sessions",children:"Sessions"})]}),t.jsx(re,{size:12,strokeWidth:2,"aria-hidden":!0})]}),t.jsx("button",{type:"button",className:"pi-railAddBtn","aria-expanded":V,"aria-label":"Add project",title:"Add a project by path",onClick:()=>B(n=>!n),children:t.jsx(Se,{size:13,strokeWidth:1.8,"aria-hidden":!0})})]}),V?t.jsx(fe,{onClose:()=>B(!1)}):null,je?t.jsx(Le,{}):c&&E.length===0?t.jsx("div",{className:"pi-railEmpty",children:"Projects unavailable."}):t.jsxs(t.Fragment,{children:[U.length>0?t.jsxs("div",{className:"pi-pinnedSessions",children:[t.jsx("div",{className:"pi-pinnedLabel",children:"Pinned"}),t.jsx("div",{className:"pi-projectSessionList",children:U.map(n=>t.jsx(G,{session:n,pinned:!0,selected:F(n,e,j),showProject:!0,nowMs:a,onOpenSession:I,onTogglePinnedSession:M,onArchiveSession:O},`pinned:${n.id}`))})]}):null,Y.length>0?t.jsxs("div",{className:"pi-recentReplies","aria-label":"Latest harness replies",children:[t.jsx("div",{className:"pi-pinnedLabel",children:"Latest replies"}),t.jsx("div",{className:"pi-projectSessionList",children:Y.map(n=>t.jsx(G,{session:n,pinned:x.has(C(n)),selected:F(n,e,j),showProject:!0,nowMs:a,onOpenSession:I,onTogglePinnedSession:M,onArchiveSession:O},`reply:${n.id}`))})]}):null,K.map(n=>t.jsx(te,{group:n,selected:e.projectSlug===n.project.slug,collapsed:L.has(n.project.slug),expanded:b.has(n.project.slug),pinnedSessions:x,allSessions:j,nowMs:a,route:e,onOpenProject:Q,onOpenSession:I,onToggleCollapsed:()=>u(l=>$(l,n.project.slug)),onToggleExpanded:()=>A(l=>$(l,n.project.slug)),onTogglePinnedSession:M,onArchiveSession:O},n.project.slug)),K.length===0&&T.length===0?t.jsx("div",{className:"pi-railEmpty",children:p?"No projects matched.":"No projects yet."}):null,T.length>0?t.jsxs(t.Fragment,{children:[t.jsxs("button",{type:"button",className:"pi-railDisclosure","data-open":f||void 0,onClick:()=>N(n=>!n),children:[t.jsx(ae,{className:"pi-railChev",size:12,strokeWidth:2,"aria-hidden":!0}),"All projects · ",T.length," quiet"]}),f?T.map(n=>t.jsx(te,{group:n,selected:e.projectSlug===n.project.slug,collapsed:L.has(n.project.slug),expanded:b.has(n.project.slug),pinnedSessions:x,allSessions:j,nowMs:a,route:e,onOpenProject:Q,onOpenSession:I,onToggleCollapsed:()=>u(l=>$(l,n.project.slug)),onToggleExpanded:()=>A(l=>$(l,n.project.slug)),onTogglePinnedSession:M,onArchiveSession:O},n.project.slug)):null]}):null]})]})}),t.jsx("div",{className:"pi-railFoot",children:t.jsxs("button",{type:"button",className:"pi-railFootBtn",onClick:()=>i({view:"search"}),children:[t.jsx(Z,{size:13,strokeWidth:1.8,"aria-hidden":!0}),"Search agents & sessions"]})})]})}function te({group:e,selected:i,collapsed:s,expanded:o,pinnedSessions:a,allSessions:r,nowMs:c,route:p,onOpenProject:y,onOpenSession:S,onToggleCollapsed:m,onToggleExpanded:f,onTogglePinnedSession:N,onArchiveSession:L}){const{project:u,sessions:b}=e,A=z(b.filter(g=>!a.has(C(g)))),x=s?[]:o?A:A.slice(0,ee),R=Math.max(0,A.length-x.length);return t.jsxs("div",{className:"pi-projectGroup","data-selected":i||void 0,"data-state":ke(u),"data-collapsed":s||void 0,children:[t.jsxs("div",{className:"pi-projectGroupHead",children:[t.jsxs("button",{type:"button",className:"pi-projectPath","aria-expanded":i?!s:void 0,title:Oe(u),"aria-current":i?"page":void 0,"aria-label":i?s?`Expand /${u.title}`:`Collapse /${u.title}`:`Open /${u.title}`,onClick:()=>{i?m():y(u.slug)},children:[t.jsx(le,{size:13,strokeWidth:1.6,"aria-hidden":!0}),t.jsxs("span",{className:"pi-projectPathText",children:["/",u.title]})]}),t.jsx("button",{type:"button",className:"pi-projectPathToggle","aria-expanded":!s,"aria-label":s?`Expand /${u.title}`:`Collapse /${u.title}`,onClick:m,children:s?t.jsx(ae,{size:12,strokeWidth:2}):t.jsx(re,{size:12,strokeWidth:2})})]}),!s&&x.length>0?t.jsx("div",{className:"pi-projectSessionList",children:x.map(g=>t.jsx(G,{session:g,pinned:a.has(C(g)),selected:F(g,p,r),showProject:!1,nowMs:c,onOpenSession:S,onTogglePinnedSession:N,onArchiveSession:L},g.id))}):!s&&b.length===0?t.jsx("div",{className:"pi-projectSessionEmpty",children:"No sessions yet"}):null,!s&&R>0?t.jsx("button",{type:"button",className:"pi-projectShowMore",onClick:f,children:"Show more"}):!s&&o&&A.length>ee?t.jsx("button",{type:"button",className:"pi-projectShowMore",onClick:f,children:"Show less"}):null]})}function Ee(e,i){return e.session===i.session&&e.pinned===i.pinned&&e.selected===i.selected&&e.showProject===i.showProject&&e.nowMs===i.nowMs&&e.onOpenSession===i.onOpenSession&&e.onTogglePinnedSession===i.onTogglePinnedSession&&e.onArchiveSession===i.onArchiveSession}function se(e){const i=e.getBoundingClientRect();return{left:Math.min(window.innerWidth-304-12,i.right+10),top:Math.max(12,Math.min(window.innerHeight-174-12,i.top-18))}}const G=d.memo(function({session:i,pinned:s,selected:o,showProject:a,nowMs:r,onOpenSession:c,onTogglePinnedSession:p,onArchiveSession:y}){const[S,m]=d.useState(null),f=k(i);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"pi-projectSession","data-active":i.working||void 0,"data-pinned":s||void 0,"data-selected":o||void 0,onMouseEnter:N=>m(se(N.currentTarget)),onMouseLeave:()=>m(null),onFocusCapture:N=>m(se(N.currentTarget)),onBlurCapture:()=>m(null),children:[t.jsxs("button",{type:"button",className:"pi-projectSessionMain","aria-label":a?`${f} /${i.projectTitle}`:f,onClick:()=>{m(null),c(i)},children:[t.jsx("span",{className:"pi-projectSessionTitle",children:f}),a?t.jsxs("span",{className:"pi-projectSessionProject",children:["/",i.projectTitle]}):null]}),t.jsx("button",{type:"button",className:"pi-sessionPin","data-pinned":s||void 0,"aria-pressed":s,"aria-label":s?"Unpin session":"Pin session",title:s?"Unpin session":"Pin session",onClick:()=>p(i),children:t.jsx(Pe,{size:11,strokeWidth:2,"aria-hidden":!0})}),t.jsx("button",{type:"button",className:"pi-sessionArchive","aria-label":"Archive session",title:"Archive session",onClick:()=>y(i),children:t.jsx(Ae,{size:11,strokeWidth:2,"aria-hidden":!0})}),t.jsx("span",{className:"pi-projectSessionWhen",children:i.latestReplyAt?W(i.latestReplyAt,r):i.lastActivityAt?W(i.lastActivityAt,r):"-"})]}),S?t.jsx(Te,{session:i,left:S.left,top:S.top,nowMs:r}):null]})},Ee);function Te({session:e,left:i,top:s,nowMs:o}){const a=e.agentName||null,r=e.projectRoot?xe(e.projectRoot):`/${e.projectTitle}`,c=_(e);return t.jsxs("div",{className:"pi-sessionHoverCard",role:"tooltip",style:{left:i,top:s},children:[t.jsxs("div",{className:"pi-sessionHoverKicker",children:[t.jsxs("span",{children:["/",e.projectTitle]}),t.jsx("span",{children:e.lastActivityAt?W(e.lastActivityAt,o):"-"})]}),t.jsx("div",{className:"pi-sessionHoverTitle",children:k(e)}),t.jsxs("div",{className:"pi-sessionHoverContext",children:[e.working?"Live now":"Last touched"," in ",r]}),t.jsxs("div",{className:"pi-sessionHoverFacts",children:[t.jsx("span",{children:e.harness}),t.jsx("span",{children:e.working?"active":"recent"}),e.branch?t.jsx("span",{children:e.branch}):null,a?t.jsx("span",{children:a}):null]}),t.jsx("div",{className:"pi-sessionHoverRef",children:c??"No session archive yet"})]})}function Ie(e,i){return e.map(s=>{const o=ve(i,s.slug);return{project:s,sessions:z(o),lastActivityAt:o[0]?.lastActivityAt??s.lastActivityAt}})}function pe(e,i,s){const o=i.trim().toLowerCase();return[...o?e.flatMap(r=>{const c=r.project.title.toLowerCase().includes(o)||r.project.slug.toLowerCase().includes(o),p=r.sessions.filter(y=>D(y,o));return!c&&p.length===0?[]:[{...r,sessions:c?r.sessions:p}]}):e].sort((r,c)=>{switch(s){case"name":return r.project.title.localeCompare(c.project.title);case"sessions":return c.project.sessionCount-r.project.sessionCount||c.lastActivityAt-r.lastActivityAt||r.project.title.localeCompare(c.project.title);default:return c.project.liveSessionCount-r.project.liveSessionCount||c.lastActivityAt-r.lastActivityAt||c.project.sessionCount-r.project.sessionCount||r.project.title.localeCompare(c.project.title)}})}function z(e){return[...e].sort((i,s)=>(s.latestReplyAt??s.lastActivityAt)-(i.latestReplyAt??i.lastActivityAt)||Number(s.working)-Number(i.working)||ie(s)-ie(i)||k(i).localeCompare(k(s)))}function ie(e){return _(e)?2:e.agentId?1:0}function D(e,i){const s=i.trim().toLowerCase();return s?e.projectTitle.toLowerCase().includes(s)||e.projectSlug.toLowerCase().includes(s)||k(e).toLowerCase().includes(s)||e.work.toLowerCase().includes(s)||e.id.toLowerCase().includes(s)||(e.sessionId?.toLowerCase().includes(s)??!1)||(_(e)?.toLowerCase().includes(s)??!1)||e.agentName.toLowerCase().includes(s)||e.harness.toLowerCase().includes(s)||(e.branch?.toLowerCase().includes(s)??!1):!0}function ue(e,i){return[...e].filter(s=>s.latestReplyAt!==null&&D(s,i)).sort((s,o)=>(o.latestReplyAt??0)-(s.latestReplyAt??0)).slice(0,be)}function C(e){return _(e)??e.id}function k(e){if(e.latestReplyPreview){const o=e.latestReplyPreview.replace(/\s+/gu," ").trim(),a=o.length>42?`${o.slice(0,39).trim()}...`:o;return`${H(e.harness)} replied · ${a}`}const i=e.work||e.sessionId||e.id,s=i.includes("/")?me(i):i;return Me(s,e.harness)}function Me(e,i){const s=e.replace(/\.jsonl$/iu,""),o=s.match(/^rollout-(\d{4})-(\d{2})-(\d{2})T(\d{2})-(\d{2})/u);if(o)return`${H(i)} rollout ${o[4]}:${o[5]}`;const a=s.match(/^([0-9a-f]{8})-[0-9a-f-]{27,}$/iu);return a?`${H(i)} session ${a[1]}`:s.length>42?`${s.slice(0,39).trim()}...`:s}function Oe(e){return`/${e.title}`}function H(e){const i=e.trim();return i?i.charAt(0).toUpperCase()+i.slice(1).toLowerCase():"Session"}function $(e,i){const s=new Set(e);return s.has(i)?s.delete(i):s.add(i),s}function ne(e,i){if(!e.has(i))return e;const s=new Set(e);return s.delete(i),s}function $e(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(ce),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(s=>typeof s=="string"):[])}catch{return new Set}}function oe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ce,JSON.stringify([...e]))}catch{}}function Fe(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(de),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(s=>typeof s=="string"):[])}catch{return new Set}}function _e(e){if(!(typeof window>"u"))try{window.localStorage.setItem(de,JSON.stringify([...e]))}catch{}}const Xe=Object.freeze(Object.defineProperty({__proto__:null,ProjectsRail:Re,filterAndSortProjectGroups:pe,recentReplySessionsForRail:ue},Symbol.toStringTag,{value:"Module"}));export{Re as P,Pe as a,Xe as b};
@@ -1 +0,0 @@
1
- import{j as i}from"./index-CZ-05hKz.js";import{u as e}from"./Provider-B2xuo3rf.js";import{d as s}from"./types-B0PlfpKc.js";import{ProjectsInbox as c}from"./ProjectsInbox-Dlt8OQ8O.js";import{P as a}from"./ProjectsRail-DCfNMmnW.js";import{ProjectAgentProfile as n}from"./ProjectAgentProfile-BLlp2e6t.js";import{i as l}from"./model-IGCUEsMy.js";/* empty css */import"./projects-inbox-D-zAb9Gp.js";import"./router-DJj2WbDg.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./api-Co9aQ2Jw.js";import"./sse-CiOSzE5n.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DZVhS7as.js";import"./createLucideIcon-DXpqZP7I.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./file-text-KijGBnME.js";import"./x-e3h2hDsp.js";import"./chevron-right-CzH-TaSF.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./arrow-right-iJFv3jNh.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-DFhAJkW3.js";import"./NewChatComposer-hlWT-nbR.js";import"./text-CnZ0e1-V.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-BiohlpM3.js";import"./conversation-model-CwF6Y9gx.js";import"./time-Dhsh_2EG.js";import"./index-BVlMw8x_.js";import"./HarnessMark-D5CA5uSp.js";import"./NewChatOrigin-DdpzE4kz.js";import"./chevron-down-Mp9mu_yd.js";import"./search-D1tJSAWe.js";import"./chunk-HRAB3GC3-swV8PA2k.js";import"./AgentAvatar-CYhf6twS.js";import"./SpriteAvatar-Bs68ZENy.js";import"./CrewAvatar-CTIuxp4G.js";import"./ui-LM8pS8qE.js";import"./openContent-C6XO6kr5.js";import"./SessionRefScreen-B_cTv47v.js";import"./tail-events-BMQmSx1n.js";import"./BackToPicker-4JaeRvDm.js";import"./ConversationScreen-BNULZAp2.js";import"./ConversationComposer-2HjbGPL9.js";import"./zap-nMcjPoWB.js";import"./message-markup-RkfmDfME.js";import"./mentions-CcPFMbmZ.js";import"./AgentDetailCard-UqPNpcvB.js";import"./AgentLiveActions-BwuzOE8h.js";import"./terminal-takeover-DANQfTcy.js";import"./eye-CpfyvdLq.js";import"./terminal-yN9xN-h9.js";import"./message-visibility-DwxgcgYK.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";/* empty css */import"./ConversationHeader-C8vfXaTF.js";import"./AstronautSuit-Ckx7lu7G.js";import"./ConversationFeedRows-C6wUqJrx.js";import"./ConversationPanels-CNCIbpqU.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CKkhq9c5.js";import"./proxy-DnLpZIi9.js";import"./activity-Bj3Hnbj3.js";import"./message-circle-B2ddzBrX.js";import"./ConversationStatus-DZuyKsWN.js";import"./check-C18YQC90.js";import"./sparkles-Dy8p5xN8.js";import"./SessionObserve-Dsd0j05N.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-D_DMlBeT.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CdGUXxGR.js";import"./ObserveTextFlow-BSEtYTxU.js";import"./SessionObserveEvidence-DopQYDkD.js";import"./wrench-YcXMlsh2.js";import"./external-link-Ckiyzjwo.js";/* empty css */import"./CrewWorkspaces-CkPYIA46.js";import"./project-overview-helpers-BQTc_Ous.js";import"./AddProjectForm-CcD6qvV8.js";import"./agent-specialization-BIPIBW8u.js";import"./cpu-BjVis9mc.js";import"./sliders-horizontal-BPSMHhbm.js";import"./message-square-D9YYWE0x.js";import"./api-HFH8wFyb.js";import"./cache-CeWH_KzJ.js";import"./arrow-up-right-CCfZXPqD.js";import"./archive-BjcGiAy8.js";import"./AgentsSubnav-CDMjKeYC.js";import"./SecondaryNav-o2RL9H8H.js";import"./secondaryNavConfig-B9IF8wXl.js";import"./compass-0_54-vz3.js";import"./settings-2fC_G9nX.js";import"./git-branch-BQ_x8KZL.js";import"./scroll-text-DO0GQzvN.js";import"./profile-rY8jO38P.js";import"./context-budget-DX_fwUs3.js";import"./session-catalog-DNaOEzoQ.js";import"./terminal-relay-9lhzEp2V.js";/* empty css */import"./AgentDefinitionsWorkspace-srmN6-vj.js";import"./FileViewerPane-DQlpNt2S.js";import"./agent-essentials-BOMHR0_U.js";/* empty css *//* empty css */import"./ProjectAgentProfileBar-BQET-qrY.js";import"./agents-project-model-UYiamtrU.js";function f({route:o,navigate:r}){const t=l(o),m=t?`profile:${o.agentId}`:"index",p=!t&&j();return i.jsx("div",{className:"s-av2","data-view":t?"profile":"index",children:i.jsx("div",{className:"av2-stagePane",children:t?i.jsx(n,{route:o,navigate:r}):i.jsx(c,{route:o,navigate:r,zeroPreview:p})},m)})}function Cr({navigate:o}){const{route:r}=e(),t=r.view==="agents-v2"?r:{view:"agents-v2"};return i.jsxs("div",{className:"pi-projectsEmbedShell",children:[i.jsx(a,{route:t,navigate:o}),i.jsx(f,{route:t,navigate:o})]})}const Ir=s({id:"projects",label:"Projects",route:{view:"agents-v2"},webPath:"/projects",screen:"ProjectsEmbedScreen",embed:{path:"/embed/projects",profile:"macos.projects",ownsInternalRoutes:!0,rootClassName:"s-projects-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0}}});function j(){if(typeof window>"u")return!1;const o=window.location.hostname.toLowerCase();if(o!=="localhost"&&o!=="127.0.0.1"&&o!=="::1")return!1;const r=new URLSearchParams(window.location.search).get("zero")?.trim().toLowerCase();return r==="projects"||r==="project"||r==="1"||r==="true"}export{Cr as ProjectsEmbedScreen,f as ProjectsScreen,Ir as scoutSurface};
@@ -1 +0,0 @@
1
- import{j as s}from"./index-CZ-05hKz.js";import{A as R}from"./AgentAvatar-CYhf6twS.js";import{H as y}from"./HarnessMark-D5CA5uSp.js";import{t as O}from"./time-Dhsh_2EG.js";import{s as P}from"./project-overview-helpers-BQTc_Ous.js";import{u as H,t as T,a as B,s as C,f as L,b as z}from"./projects-inbox-D-zAb9Gp.js";import{A as b}from"./arrow-up-right-CCfZXPqD.js";import"./Provider-B2xuo3rf.js";import"./router-DJj2WbDg.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./api-Co9aQ2Jw.js";import"./sse-CiOSzE5n.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DZVhS7as.js";import"./createLucideIcon-DXpqZP7I.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./file-text-KijGBnME.js";import"./x-e3h2hDsp.js";import"./chevron-right-CzH-TaSF.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./arrow-right-iJFv3jNh.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-DFhAJkW3.js";import"./NewChatComposer-hlWT-nbR.js";import"./text-CnZ0e1-V.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-BiohlpM3.js";import"./conversation-model-CwF6Y9gx.js";import"./index-BVlMw8x_.js";import"./NewChatOrigin-DdpzE4kz.js";import"./chevron-down-Mp9mu_yd.js";import"./search-D1tJSAWe.js";import"./chunk-HRAB3GC3-swV8PA2k.js";import"./SpriteAvatar-Bs68ZENy.js";import"./CrewAvatar-CTIuxp4G.js";import"./tail-events-BMQmSx1n.js";import"./agents-project-model-UYiamtrU.js";import"./model-IGCUEsMy.js";function V(i,o,t){if(t.sessionId){const r=L(o,t);if(r)return{kind:"session",session:r};const a=z(i,t);if(a)return{kind:"thread",thread:a}}if(t.selectedAgentId){const r=i.find(l=>l.agentId===t.selectedAgentId)??null;if(r)return{kind:"thread",thread:r};const a=o.find(l=>!l.sessionId&&l.agentId===t.selectedAgentId)??null;if(a)return{kind:"session",session:a}}return null}function p({label:i,value:o}){return s.jsxs("span",{className:"pi-stat",children:[s.jsx("span",{className:"pi-statLabel",children:i}),s.jsx("span",{className:"pi-statValue",children:o})]})}function Os({route:i,navigate:o}){const{model:t,nowMs:r,loading:a,error:l}=H(i);if(!i.sessionId&&!i.selectedAgentId)return null;const d=V(t.threads,t.sessions,i);if(!d)return s.jsxs("div",{className:"s-pi s-pi-aside",children:[s.jsx("header",{className:"pi-asideHead",children:s.jsxs("div",{className:"pi-asideIdent",children:[s.jsx("div",{className:"pi-asideTop",children:s.jsx("span",{className:"pi-asideName",children:a?"Resolving selection":l?"Project data unavailable":"Selection unavailable"})}),s.jsx("div",{className:"pi-asideSub",children:s.jsxs("span",{className:"pi-asideStatus","data-tone":a?"working":"recent",children:[a?s.jsx("span",{className:"pi-asidePulse","aria-hidden":!0}):null,a?"loading":"idle"]})})]})}),s.jsx("div",{className:"pi-asideBody",children:s.jsx("p",{className:"pi-asideMuted",children:l??"The selected item is not in the current project snapshot."})})]});const n=d.kind==="thread"?d.thread:null,e=d.kind==="session"?d.session:null,m=n?.agentName??e?.agentName??"Session",h=n?.harness??e?.harness??"session",g=n?.projectTitle??e?.projectTitle??i.projectSlug??"project",x=n?.branch??e?.branch??null,c=n?.working??e?.working??!1,f=n?.needs?"needs":c?"working":"recent",I=n?.needs?"your turn":c?"working":e?"selected":"idle",k=n?.work??e?.work??"No session detail available.",v=n?.lastActivityAt??e?.lastActivityAt??0,j=e?.sessionId??n?.sessionId??null,u=n?.projectRoot??e?.projectRoot??null,N=n?T(n,i):null,w=n?B(n,i):e?C(e,i):i,A=e?e.route?.view==="conversation"?"Open conversation":e.route?.view==="sessions"?"Open session":e.agentId?"Open agent":"Open project":n?.kind==="native"?"Open session":n?.conversationId?"Open conversation":"Open agent",S={view:"agents-v2",...i.projectSlug?{projectSlug:i.projectSlug}:{},...i.indexView?{indexView:i.indexView}:{},...i.machineId?{machineId:i.machineId}:{},...i.showEphemeral?{showEphemeral:!0}:{}};return s.jsxs("div",{className:"s-pi s-pi-aside",children:[s.jsxs("header",{className:"pi-asideHead",children:[s.jsx("span",{className:"pi-asideAvatar",children:s.jsx(R,{agent:{name:m,harness:h,state:c?"in_turn":null},placement:"row",size:38})}),s.jsxs("div",{className:"pi-asideIdent",children:[s.jsxs("div",{className:"pi-asideTop",children:[s.jsx("span",{className:"pi-asideName",title:m,children:m}),s.jsx("span",{className:"pi-asideHmark","aria-hidden":!0,children:s.jsx(y,{harness:h,size:13})}),s.jsxs("span",{className:"pi-asideProj",children:["/",g]})]}),s.jsxs("div",{className:"pi-asideSub",children:[x?s.jsx("span",{className:"pi-asideBranch",children:x}):null,s.jsxs("span",{className:"pi-asideStatus","data-tone":f,children:[c?s.jsx("span",{className:"pi-asidePulse","aria-hidden":!0}):null,I]})]})]})]}),s.jsxs("div",{className:"pi-asideBody",children:[s.jsx("h2",{className:"pi-asideHeadline",children:k}),s.jsxs("div",{className:"pi-asideReadouts",children:[s.jsx(p,{label:"Last active",value:v?O(v,r):"—"}),s.jsx(p,{label:e?"Session":"Conversations",value:e?"1":String(n?.sessionCount??0)}),s.jsx(p,{label:"Harness",value:h}),n?.contextPct!=null?s.jsx(p,{label:"Context",value:`${n.contextPct}%`}):null]}),e?s.jsxs("div",{className:"pi-asideSection",children:[s.jsx("div",{className:"pi-asideSectionHead",children:"Session context"}),s.jsxs("div",{className:"pi-asideLine",children:[j?s.jsxs("span",{title:j,children:["ref · ",j]}):s.jsx("span",{children:"No stable session reference yet."}),u?s.jsxs("span",{title:u,children:["root · ",P(u)]}):null,e.conversationId?s.jsxs("span",{title:e.conversationId,children:["conversation · ",e.conversationId]}):null]})]}):null,s.jsxs("div",{className:"pi-asideActions",children:[s.jsxs("button",{type:"button",className:"pi-asideBtn pi-asideBtnPrimary",onClick:()=>o(w),children:[A,s.jsx(b,{size:13,strokeWidth:2,"aria-hidden":!0})]}),N?s.jsxs("button",{type:"button",className:"pi-asideBtn",onClick:()=>o(N),children:["Observe",s.jsx(b,{size:13,strokeWidth:2,"aria-hidden":!0})]}):null,s.jsx("button",{type:"button",className:"pi-asideBtn",onClick:()=>o(S),children:"Clear"})]})]})]})}export{Os as ProjectsThreadAside};