@openscout/scout 0.2.91 → 0.2.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (508) hide show
  1. package/README.md +19 -17
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/apple-touch-icon.png +0 -0
  5. package/dist/client/assets/ActivityScreen--eANwuxa.js +1 -0
  6. package/dist/client/assets/{AddProjectForm-DtTfn4Zk.js → AddProjectForm-CcD6qvV8.js} +1 -1
  7. package/dist/client/assets/AgentAvatar-CYhf6twS.js +1 -0
  8. package/dist/client/assets/AgentConfigurationScreen-BTI24HQX.js +1 -0
  9. package/dist/client/assets/AgentDefinitionsWorkspace-srmN6-vj.js +1 -0
  10. package/dist/client/assets/{AgentDetailCard-Dtc02KUO.js → AgentDetailCard-UqPNpcvB.js} +1 -1
  11. package/dist/client/assets/AgentFloorView-XXNgI5Cj.js +1 -0
  12. package/dist/client/assets/AgentInfoScreen-CimdOnZ9.js +1 -0
  13. package/dist/client/assets/{AgentLaneCard-BRAkw8YJ.js → AgentLaneCard-Z-aOBR3W.js} +1 -1
  14. package/dist/client/assets/{AgentLaneChrome-T8QE5742.js → AgentLaneChrome-CyhA1reW.js} +1 -1
  15. package/dist/client/assets/AgentLaneDetailSheet-BNzjMjIH.js +4 -0
  16. package/dist/client/assets/{AgentLaneSummaryResize-FyYweLo_.js → AgentLaneSummaryResize-Box8-_rS.js} +1 -1
  17. package/dist/client/assets/AgentLanesEmbedScreen-BmLnN4on.js +1 -0
  18. package/dist/client/assets/{AgentLanesPreflight-Cil3dNwu.js → AgentLanesPreflight-5B6sXvRB.js} +1 -1
  19. package/dist/client/assets/AgentLanesView-DHyzVBk6.js +2 -0
  20. package/dist/client/assets/{AgentLiveActions-DwScaVRF.js → AgentLiveActions-BwuzOE8h.js} +1 -1
  21. package/dist/client/assets/AgentSessions-CsZwoukw.js +6 -0
  22. package/dist/client/assets/AgentsConsole-KCao4XmX.js +1 -0
  23. package/dist/client/assets/AgentsScreen-CtPAmwRX.js +1 -0
  24. package/dist/client/assets/AgentsSubnav-CDMjKeYC.js +1 -0
  25. package/dist/client/assets/AstronautSuit-Ckx7lu7G.js +1 -0
  26. package/dist/client/assets/AtopView-DYlpgEHf.js +1 -0
  27. package/dist/client/assets/{BackToPicker-D6WgIDb-.js → BackToPicker-4JaeRvDm.js} +1 -1
  28. package/dist/client/assets/BriefingDetailScreen-D6-xqrpo.js +1 -0
  29. package/dist/client/assets/BriefingsScreen-DKxSDEmk.js +1 -0
  30. package/dist/client/assets/{BrokerMetadataPanel-Cu93j-Ga.js → BrokerMetadataPanel-BbREmsbK.js} +1 -1
  31. package/dist/client/assets/BrokerScreen-fbPIouMw.js +5 -0
  32. package/dist/client/assets/CastPicker-BcA2vDDV.js +1 -0
  33. package/dist/client/assets/CastPicker-zXsnkTIy.css +1 -0
  34. package/dist/client/assets/ChatCollapsedStrip-Ycm0ecaX.js +1 -0
  35. package/dist/client/assets/{CodeDiffPane-BjCOBLze.js → CodeDiffPane-Cn8Y9hAt.js} +1 -1
  36. package/dist/client/assets/{CodeProjectPicker-NSGdCaK0.js → CodeProjectPicker-nPFktrco.js} +1 -1
  37. package/dist/client/assets/CodeScreen-BlAxtxE5.js +1 -0
  38. package/dist/client/assets/ConversationComposer-2HjbGPL9.js +1 -0
  39. package/dist/client/assets/ConversationFeedRows-C6wUqJrx.js +1 -0
  40. package/dist/client/assets/ConversationHeader-C8vfXaTF.js +1 -0
  41. package/dist/client/assets/ConversationPanels-CNCIbpqU.js +6 -0
  42. package/dist/client/assets/ConversationScreen-BNULZAp2.js +2 -0
  43. package/dist/client/assets/ConversationScreen-CkWnKXt6.css +1 -0
  44. package/dist/client/assets/ConversationStatus-DZuyKsWN.js +1 -0
  45. package/dist/client/assets/CrewAvatar-CTIuxp4G.js +1 -0
  46. package/dist/client/assets/CrewAvatar-D0c9z5Qr.css +1 -0
  47. package/dist/client/assets/CrewWorkspaces-CJhBKVoZ.css +1 -0
  48. package/dist/client/assets/CrewWorkspaces-CkPYIA46.js +1 -0
  49. package/dist/client/assets/{DataTable-Dzqiaha4.js → DataTable-6IDhanr5.js} +1 -1
  50. package/dist/client/assets/DispatchAftermath-DC1u9itO.js +1 -0
  51. package/dist/client/assets/DocumentFocusViewer-DZVhS7as.js +1 -0
  52. package/dist/client/assets/{EmbeddableSurfacesLab-C3a7hJWO.js → EmbeddableSurfacesLab-BKUFJMCV.js} +1 -1
  53. package/dist/client/assets/{EmptyState-CYNJZMrZ.js → EmptyState-CeBl0iGd.js} +1 -1
  54. package/dist/client/assets/{FileViewerPane-Fwt8_KmD.js → FileViewerPane-DQlpNt2S.js} +2 -2
  55. package/dist/client/assets/FlightObserveScreen-CDWGSKZg.js +1 -0
  56. package/dist/client/assets/FollowScreen-BXHOp3gb.js +1 -0
  57. package/dist/client/assets/{HarnessMark-DrE57dUq.js → HarnessMark-D5CA5uSp.js} +1 -1
  58. package/dist/client/assets/HarnessesScreen-DhFXq1qz.js +1 -0
  59. package/dist/client/assets/{HerdrSession-1eVu9Owj.js → HerdrSession-BRhs5LIR.js} +1 -1
  60. package/dist/client/assets/HomeHero-7JwycwFY.css +1 -0
  61. package/dist/client/assets/HomeHero-DMABJuze.js +1 -0
  62. package/dist/client/assets/HostAdvisorView-RAociATV.js +1 -0
  63. package/dist/client/assets/{KnowledgeSearchInspector-CbPVg3fr.js → KnowledgeSearchInspector-CZPyVNSw.js} +1 -1
  64. package/dist/client/assets/KnowledgeSearchScreen-mGTKIg00.js +1 -0
  65. package/dist/client/assets/{LaneToolHoverCard-BkBcDYm-.js → LaneToolHoverCard-D_DMlBeT.js} +1 -1
  66. package/dist/client/assets/LaneTraceDetailSheet-BEHg3LmH.js +1 -0
  67. package/dist/client/assets/{LaneTraceEventFocus-BmMmPTyJ.js → LaneTraceEventFocus-DVimcizS.js} +1 -1
  68. package/dist/client/assets/{MeshCanvas-DwkjsiJ5.js → MeshCanvas-BOuZx4AM.js} +2 -2
  69. package/dist/client/assets/{MeshCanvasMinimap-vmCpU1sD.js → MeshCanvasMinimap-wL-1N94e.js} +1 -1
  70. package/dist/client/assets/MeshScreen-DMY9Bmh5.js +1 -0
  71. package/dist/client/assets/{MeshTopologyView-BD2xLE2C.js → MeshTopologyView-DiDcX5f4.js} +2 -2
  72. package/dist/client/assets/MessagesScreen-Eulveud3.js +1 -0
  73. package/dist/client/assets/{MissionContextRail-D5MEP2f4.js → MissionContextRail-DrNKXG5u.js} +1 -1
  74. package/dist/client/assets/MissionControlView-ByBlHVN8.js +1 -0
  75. package/dist/client/assets/MissionFocusOverlay-D1i6R6Zt.js +1 -0
  76. package/dist/client/assets/MissionLeftAgentRow-DN9NcCML.js +1 -0
  77. package/dist/client/assets/MissionLogPane-DSeIv3Xo.js +1 -0
  78. package/dist/client/assets/NewAgentModal-V7yK6J6j.js +1 -0
  79. package/dist/client/assets/NewChatComposer-hlWT-nbR.js +19 -0
  80. package/dist/client/assets/{NewChatOrigin-DXPvX-hh.js → NewChatOrigin-DdpzE4kz.js} +1 -1
  81. package/dist/client/assets/ObserveEmbedScreen-l_Q3ts2q.js +2 -0
  82. package/dist/client/assets/ObserveTextFlow-BSEtYTxU.js +2 -0
  83. package/dist/client/assets/ObservedTopologyPanel-CdGUXxGR.js +2 -0
  84. package/dist/client/assets/OpenScoutAppShell-DN8dOSK4.js +79 -0
  85. package/dist/client/assets/OpsAgentsView-ntGr4pz4.js +1 -0
  86. package/dist/client/assets/OpsScreen-Ppen_Lmj.js +1 -0
  87. package/dist/client/assets/OpsSubnav-GAKsoSor.js +1 -0
  88. package/dist/client/assets/ProjectAgentProfile-BLlp2e6t.js +1 -0
  89. package/dist/client/assets/{ProjectAgentProfileBar-C5QWwZCn.js → ProjectAgentProfileBar-BQET-qrY.js} +1 -1
  90. package/dist/client/assets/ProjectAgentProfileHero-Ck8mThtx.js +1 -0
  91. package/dist/client/assets/ProjectsInbox-Dlt8OQ8O.js +2 -0
  92. package/dist/client/assets/ProjectsRail-DCfNMmnW.js +1 -0
  93. package/dist/client/assets/ProjectsScreen-BP-hmI1m.js +1 -0
  94. package/dist/client/assets/ProjectsThreadAside-CWpMjGIH.js +1 -0
  95. package/dist/client/assets/Provider-B2xuo3rf.js +1 -0
  96. package/dist/client/assets/RailRow-B-GycCBx.js +1 -0
  97. package/dist/client/assets/RailRow-B0sRaJc6.css +1 -0
  98. package/dist/client/assets/RawSessionsTable-AQThi6sm.js +1 -0
  99. package/dist/client/assets/RealtimeVoiceScreen-D7zZHK_t.js +1 -0
  100. package/dist/client/assets/{RepoDiffEmbedScreen-xjzjcJ_c.js → RepoDiffEmbedScreen-DXWoRF_c.js} +1 -1
  101. package/dist/client/assets/{RepoDiffPageScreen-DRzIY-dk.js → RepoDiffPageScreen-D_274ExO.js} +1 -1
  102. package/dist/client/assets/RepoDiffViewer-DbedmHDX.js +7 -0
  103. package/dist/client/assets/RepoDiffViewerLazy-C0--fPtk.js +2 -0
  104. package/dist/client/assets/ReposScreen-D39_YG4H.js +6 -0
  105. package/dist/client/assets/ScoutDeckSurface-CKT3qdqY.js +1 -0
  106. package/dist/client/assets/{ScoutSurface-BENBUt5-.js → ScoutSurface-UsRy0t-I.js} +1 -1
  107. package/dist/client/assets/{ScoutbotFxLab-Bk2ZsfPp.js → ScoutbotFxLab-Fmdfboxs.js} +1 -1
  108. package/dist/client/assets/{SecondaryNav-B4IsujYh.js → SecondaryNav-o2RL9H8H.js} +1 -1
  109. package/dist/client/assets/{SessionEmbedScreen-CPfH-jqN.js → SessionEmbedScreen-RD5XOx7R.js} +1 -1
  110. package/dist/client/assets/{SessionObserve-B-SkP3tu.js → SessionObserve-Dsd0j05N.js} +9 -9
  111. package/dist/client/assets/{SessionObserveEvidence-CF5jnH3-.js → SessionObserveEvidence-DopQYDkD.js} +1 -1
  112. package/dist/client/assets/SessionRefScreen-B_cTv47v.js +1 -0
  113. package/dist/client/assets/SessionsScreen-Bq0Z77On.js +1 -0
  114. package/dist/client/assets/SettingsDrawer-R8a0TlJD.css +1 -0
  115. package/dist/client/assets/SettingsDrawer-_AwuopMS.js +3 -0
  116. package/dist/client/assets/SettingsScreen-Cw4DDfJP.js +1 -0
  117. package/dist/client/assets/{ShikiPane-DH8yYDks.js → ShikiPane-BfHc_3pM.js} +1 -1
  118. package/dist/client/assets/{SlidePanel-RFXJpfUa.js → SlidePanel-C-q7XwTa.js} +1 -1
  119. package/dist/client/assets/SpriteAvatar-Bs68ZENy.js +1 -0
  120. package/dist/client/assets/{StatusPill-9uy70ttd.js → StatusPill-ZZQwxB1a.js} +1 -1
  121. package/dist/client/assets/{TailView-6bIrgdxN.js → TailView-Q4FVMsUH.js} +2 -2
  122. package/dist/client/assets/Terminal-D7zqHwHV.js +1 -0
  123. package/dist/client/assets/TerminalEmbedScreen-CXIJ7qv6.js +1 -0
  124. package/dist/client/assets/TerminalHeaderMount-BnBLOPbb.js +1 -0
  125. package/dist/client/assets/{TextDocumentSurface-BcP9vvji.js → TextDocumentSurface-CKQP-cBT.js} +1 -1
  126. package/dist/client/assets/{TmuxPeek-IaWqCgyJ.js → TmuxPeek-V9dGESfO.js} +1 -1
  127. package/dist/client/assets/{VoicePermissionsPanel-C80iZxgy.js → VoicePermissionsPanel-k7sbLXx2.js} +1 -1
  128. package/dist/client/assets/WorkDetailScreen-60p9litn.js +5 -0
  129. package/dist/client/assets/WorkFilesViewer-BjJS7GyM.js +1 -0
  130. package/dist/client/assets/{activity-DS0u0Itf.js → activity-Bj3Hnbj3.js} +1 -1
  131. package/dist/client/assets/{addon-fit-CN888B3D.js → addon-fit-BL-NTWRU.js} +1 -1
  132. package/dist/client/assets/{addon-webgl-CoAnanQS.js → addon-webgl-CIMgmNjg.js} +1 -1
  133. package/dist/client/assets/{ScoutbotBroadcastChip-CxtYZWPZ.css → agent-autocomplete-C7xwIcwd.css} +1 -1
  134. package/dist/client/assets/agent-autocomplete-DXlvdc4b.js +10 -0
  135. package/dist/client/assets/{agent-essentials-CuK4G_zS.js → agent-essentials-BOMHR0_U.js} +1 -1
  136. package/dist/client/assets/{agent-lane-card-model-q4cwzLX4.js → agent-lane-card-model-CTLxf3R4.js} +1 -1
  137. package/dist/client/assets/agent-lane-detail-ppJId6Jc.js +2 -0
  138. package/dist/client/assets/{agent-lane-preview-C33Dwpn7.js → agent-lane-preview-BhplDYGf.js} +1 -1
  139. package/dist/client/assets/{agent-lanes-BDNktFBZ.css → agent-lanes-DlqcEf0l.css} +1 -1
  140. package/dist/client/assets/{agent-lanes-model-VYQ5a68i.js → agent-lanes-model-AfrjRNK5.js} +2 -2
  141. package/dist/client/assets/agent-specialization-BIPIBW8u.js +1 -0
  142. package/dist/client/assets/api-Co9aQ2Jw.js +1 -0
  143. package/dist/client/assets/{api-BkjHJfgJ.js → api-HFH8wFyb.js} +1 -1
  144. package/dist/client/assets/{arc.es-BET9ev6q.js → arc.es-IR5r6sj_.js} +1 -1
  145. package/dist/client/assets/archive-BjcGiAy8.js +1 -0
  146. package/dist/client/assets/{arrow-down-DxxPnPwh.js → arrow-down-BydciYFZ.js} +1 -1
  147. package/dist/client/assets/{arrow-left-CXDkJuCg.js → arrow-left-CghA0kTw.js} +1 -1
  148. package/dist/client/assets/arrow-right-iJFv3jNh.js +1 -0
  149. package/dist/client/assets/{arrow-up-right-Bj8RjSqW.js → arrow-up-right-CCfZXPqD.js} +1 -1
  150. package/dist/client/assets/{bot-BSGSicKC.js → bot-B5sub1-i.js} +1 -1
  151. package/dist/client/assets/broker-display-Q75fupqG.js +2 -0
  152. package/dist/client/assets/{cache-Dr0why2k.js → cache-CeWH_KzJ.js} +1 -1
  153. package/dist/client/assets/{check-BfA0T8UD.js → check-C18YQC90.js} +1 -1
  154. package/dist/client/assets/{chevron-down-BVg09D6U.js → chevron-down-Mp9mu_yd.js} +1 -1
  155. package/dist/client/assets/{chevron-right-CaEwYkxE.js → chevron-right-CzH-TaSF.js} +1 -1
  156. package/dist/client/assets/{chunk-HRAB3GC3-HhKwnZCi.js → chunk-HRAB3GC3-swV8PA2k.js} +1 -1
  157. package/dist/client/assets/{chunk-JTPDIGGW-DX2eTIQ_.js → chunk-JTPDIGGW-BKXqcLKw.js} +3 -3
  158. package/dist/client/assets/{chunk-T65CQEWV-D-bOfuCH.js → chunk-T65CQEWV-vYbNJ8E6.js} +1 -1
  159. package/dist/client/assets/{chunk-YOZR3KYS-oS9dlQCI.js → chunk-YOZR3KYS-U65yUmqt.js} +1 -1
  160. package/dist/client/assets/{clock-C3TUL7D7.js → clock-B4PTFi5m.js} +1 -1
  161. package/dist/client/assets/{code-xml-Dbvjk9Kw.js → code-xml-Jtxsp5d1.js} +1 -1
  162. package/dist/client/assets/collapsed-strip-raJWthAH.css +1 -0
  163. package/dist/client/assets/compass-0_54-vz3.js +1 -0
  164. package/dist/client/assets/content-6RvWTrtk.js +1 -0
  165. package/dist/client/assets/content-BCgwMUqz.js +1 -0
  166. package/dist/client/assets/content-Bf2VLhx0.js +1 -0
  167. package/dist/client/assets/content-BrU_38-m.js +1 -0
  168. package/dist/client/assets/content-BvvJN8rN.js +1 -0
  169. package/dist/client/assets/content-CAeEqYPw.js +1 -0
  170. package/dist/client/assets/content-CHghn-rT.js +1 -0
  171. package/dist/client/assets/{content-Uqt8AG-s.css → content-CINHz-rZ.css} +1 -1
  172. package/dist/client/assets/content-CI_Z9DXk.js +1 -0
  173. package/dist/client/assets/content-CbyKONhW.js +1 -0
  174. package/dist/client/assets/content-Czogvp43.js +1 -0
  175. package/dist/client/assets/content-DFk0zNzX.js +1 -0
  176. package/dist/client/assets/content-DHe4DgkA.js +1 -0
  177. package/dist/client/assets/content-DMbawvqU.js +1 -0
  178. package/dist/client/assets/content-DTz7cKjo.js +1 -0
  179. package/dist/client/assets/content-E3kudY-W.js +1 -0
  180. package/dist/client/assets/content-LpO0aO_U.js +1 -0
  181. package/dist/client/assets/{conversation-icons-DmC_Ak3z.js → conversation-icons-BV10B2Me.js} +1 -1
  182. package/dist/client/assets/conversation-model-CwF6Y9gx.js +1 -0
  183. package/dist/client/assets/conversation-motion-features-BKkCRaWR.js +1 -0
  184. package/dist/client/assets/{copy-C79v_7D-.js → copy-Dtpx4FOE.js} +1 -1
  185. package/dist/client/assets/cpu-BjVis9mc.js +1 -0
  186. package/dist/client/assets/{createLucideIcon-DCq_3fQn.js → createLucideIcon-DXpqZP7I.js} +1 -1
  187. package/dist/client/assets/credentials-BTce3VP1.js +1 -0
  188. package/dist/client/assets/ctx-panel-D_HJ3nhb.css +1 -0
  189. package/dist/client/assets/discover-CHbrEItO.js +2 -0
  190. package/dist/client/assets/embed-entry-vil28MyU.js +2 -0
  191. package/dist/client/assets/{external-link-Dd8xaveL.js → external-link-Ckiyzjwo.js} +1 -1
  192. package/dist/client/assets/{eye-DkU59kfl.js → eye-CpfyvdLq.js} +1 -1
  193. package/dist/client/assets/file-code-corner-7mo7EviR.js +1 -0
  194. package/dist/client/assets/{file-text-BITQqGtF.js → file-text-KijGBnME.js} +1 -1
  195. package/dist/client/assets/gauge-y-Xg8Mrv.js +1 -0
  196. package/dist/client/assets/gestures-Bq9XnSqY.js +1 -0
  197. package/dist/client/assets/git-branch-BQ_x8KZL.js +1 -0
  198. package/dist/client/assets/harnesses-screen-2z36fJKE.css +1 -0
  199. package/dist/client/assets/home-moving-signal-DMguaRWR.css +1 -0
  200. package/dist/client/assets/home-moving-signal-DtRpiNa0.js +1 -0
  201. package/dist/client/assets/home-now-card-DFb4GOgM.js +1 -0
  202. package/dist/client/assets/{home-now-card-nano-C06GMiwD.js → home-now-card-nano-D--m9jpq.js} +1 -1
  203. package/dist/client/assets/hooks-9d1SoaQA.js +2 -0
  204. package/dist/client/assets/host-advisor-B2Fqs5Dd.css +1 -0
  205. package/dist/client/assets/index-BVlMw8x_.js +1 -0
  206. package/dist/client/assets/index-CZ-05hKz.js +10 -0
  207. package/dist/client/assets/index-Cn0GR-q1.js +1 -0
  208. package/dist/client/assets/index-DosI4AG9.js +1 -0
  209. package/dist/client/assets/index-i7TMxlwW.css +1 -0
  210. package/dist/client/assets/index-wLwc74Pu.css +1 -0
  211. package/dist/client/assets/inspector-panel-C-EhEDYy.js +2 -0
  212. package/dist/client/assets/{keyboard-nav-CHo_xmjw.js → keyboard-nav-DFhAJkW3.js} +1 -1
  213. package/dist/client/assets/{lane-observe-BA3g9aVd.js → lane-observe-vfyACHi0.js} +1 -1
  214. package/dist/client/assets/{lane-roster-store-B6ybJlHJ.js → lane-roster-store-gUBsydNf.js} +1 -1
  215. package/dist/client/assets/layers-CGou-LwV.js +1 -0
  216. package/dist/client/assets/layout-grid-BrZt31QH.js +1 -0
  217. package/dist/client/assets/left-B_o51JV6.js +1 -0
  218. package/dist/client/assets/left-BpgWnaah.js +1 -0
  219. package/dist/client/assets/left-CwHZCGO3.js +2 -0
  220. package/dist/client/assets/left-CwLs0okF.js +1 -0
  221. package/dist/client/assets/left-Cx0kv6pe.js +1 -0
  222. package/dist/client/assets/left-DA0amyfu.js +1 -0
  223. package/dist/client/assets/left-DH44V4I_.css +1 -0
  224. package/dist/client/assets/left-R2OOE7VG.css +1 -0
  225. package/dist/client/assets/left-advisor-DU3s01gk.js +1 -0
  226. package/dist/client/assets/left-agents-qL5PpUY-.js +1 -0
  227. package/dist/client/assets/left-default-uvuvDmt0.js +1 -0
  228. package/dist/client/assets/left-lanes-DnNLgec8.js +1 -0
  229. package/dist/client/assets/left-mission-DN3-NLPC.js +1 -0
  230. package/dist/client/assets/left-z-6CkuBe.js +2 -0
  231. package/dist/client/assets/library-DIo5NiGP.js +1 -0
  232. package/dist/client/assets/{loader-circle-B-l2Wj3-.js → loader-circle-BiohlpM3.js} +1 -1
  233. package/dist/client/assets/{local-agents-Wof5knTJ.js → local-agents-wUIaBcEr.js} +1 -1
  234. package/dist/client/assets/{mentions-BjXfeF7t.js → mentions-CcPFMbmZ.js} +1 -1
  235. package/dist/client/assets/mesh-buckets-ByyFXdKT.js +1 -0
  236. package/dist/client/assets/{mesh-ops-C1gq8zKf.js → mesh-ops-CvGyjK84.js} +1 -1
  237. package/dist/client/assets/mesh-roster-n2nDpEmA.js +1 -0
  238. package/dist/client/assets/{mesh-screen-BSDUjrnV.css → mesh-screen-D1Yvo8fU.css} +1 -1
  239. package/dist/client/assets/{mesh-view-store-B56D3f77.js → mesh-view-store-BpxGm71b.js} +1 -1
  240. package/dist/client/assets/{message-circle-BwVx5X0q.js → message-circle-B2ddzBrX.js} +1 -1
  241. package/dist/client/assets/{message-markup-DlVX-iuc.js → message-markup-RkfmDfME.js} +1 -1
  242. package/dist/client/assets/{message-square-BnkG6tae.js → message-square-D9YYWE0x.js} +1 -1
  243. package/dist/client/assets/message-visibility-DwxgcgYK.js +1 -0
  244. package/dist/client/assets/mission-control-CnU7dNt1.css +1 -0
  245. package/dist/client/assets/{mission-control-store-CMgIVjLJ.js → mission-control-store-Bf4b54MV.js} +1 -1
  246. package/dist/client/assets/{observe-DVHAcIrv.js → observe-CJRIvOCn.js} +1 -1
  247. package/dist/client/assets/{operator-attention-BwSPeheT.js → operator-attention-RqieiSY8.js} +1 -1
  248. package/dist/client/assets/{page-status-Bg2hd27j.js → page-status-BptpTdQ-.js} +1 -1
  249. package/dist/client/assets/{paperclip-DblaLD_N.js → paperclip-B1UNGl5d.js} +1 -1
  250. package/dist/client/assets/perf-PX8Rx0EP.js +1 -0
  251. package/dist/client/assets/persistent-state-YI-WHSCF.js +1 -0
  252. package/dist/client/assets/{plus-BAI0t5g9.js → plus-CuU_X0-8.js} +1 -1
  253. package/dist/client/assets/profile-rY8jO38P.js +1 -0
  254. package/dist/client/assets/projects-inbox-BBs1hG13.css +1 -0
  255. package/dist/client/assets/projects-inbox-D-zAb9Gp.js +1 -0
  256. package/dist/client/assets/proxy-DnLpZIi9.js +1 -0
  257. package/dist/client/assets/{radio-BGtkyCG9.js → radio-Dm1ItnA4.js} +1 -1
  258. package/dist/client/assets/{refresh-cw-DtF8xPqX.js → refresh-cw-BRn9Oxxl.js} +1 -1
  259. package/dist/client/assets/resolve-panes-DO6LkwhQ.js +1 -0
  260. package/dist/client/assets/resolve-sidebar-context-CIF288wY.js +1 -0
  261. package/dist/client/assets/right-BJltPRnd.js +1 -0
  262. package/dist/client/assets/right-BbyYdzHn.js +1 -0
  263. package/dist/client/assets/right-Beh3nCUB.js +1 -0
  264. package/dist/client/assets/right-C1yumXNx.js +1 -0
  265. package/dist/client/assets/{right-c4PAdFYZ.js → right-CJnB_Bg7.js} +2 -2
  266. package/dist/client/assets/right-CPP7GyOm.js +1 -0
  267. package/dist/client/assets/right-D3aTKf1F.js +1 -0
  268. package/dist/client/assets/right-DI1B79nR.js +1 -0
  269. package/dist/client/assets/right-DtsRNX5b.js +1 -0
  270. package/dist/client/assets/right-Shpw_xDy.js +1 -0
  271. package/dist/client/assets/{rocket-BWh18pt_.js → rocket-DOwXHKWA.js} +1 -1
  272. package/dist/client/assets/router-DJj2WbDg.js +1 -0
  273. package/dist/client/assets/{scope-views-Dm2_-NPi.js → scope-views-A4_vP97W.js} +1 -1
  274. package/dist/client/assets/scout-voice-BhPzrc6P.js +1 -0
  275. package/dist/client/assets/{scoutbot-BTIErYHo.js → scoutbot-BJIamJOH.js} +2 -2
  276. package/dist/client/assets/scoutbot-markdown-jh7tzFB1.js +6 -0
  277. package/dist/client/assets/{scroll-text-DZb3mmYo.js → scroll-text-DO0GQzvN.js} +1 -1
  278. package/dist/client/assets/{search-1QMVOxF3.js → search-D1tJSAWe.js} +1 -1
  279. package/dist/client/assets/secondaryNavConfig-B9IF8wXl.js +1 -0
  280. package/dist/client/assets/{selection-bridge-O9C4kGfF.js → selection-bridge-i2S9zpf8.js} +1 -1
  281. package/dist/client/assets/{send-horizontal-DbyEkGql.js → send-horizontal-CgLppsIC.js} +1 -1
  282. package/dist/client/assets/{server-Bncn9S7r.js → server-Dymv5Emh.js} +1 -1
  283. package/dist/client/assets/{session-catalog-DC6BlBBC.js → session-catalog-DNaOEzoQ.js} +1 -1
  284. package/dist/client/assets/{session-table-BUPq9Viy.js → session-table-PTQVoTyc.js} +1 -1
  285. package/dist/client/assets/settings-2fC_G9nX.js +1 -0
  286. package/dist/client/assets/{sliders-horizontal-CMe8Bay1.js → sliders-horizontal-BPSMHhbm.js} +1 -1
  287. package/dist/client/assets/{sparkles-_7cTZsIH.js → sparkles-Dy8p5xN8.js} +1 -1
  288. package/dist/client/assets/sse-CiOSzE5n.js +1 -0
  289. package/dist/client/assets/system-surfaces-redesign-QVXNeGYw.css +1 -0
  290. package/dist/client/assets/{tail-display-BRcJltQa.js → tail-display-DcliDVkW.js} +1 -1
  291. package/dist/client/assets/{tail-events-C12pfUax.js → tail-events-BMQmSx1n.js} +1 -1
  292. package/dist/client/assets/{terminal-relay-BgfVJXIL.js → terminal-relay-9lhzEp2V.js} +1 -1
  293. package/dist/client/assets/terminal-screen-BLk4PAYt.css +1 -0
  294. package/dist/client/assets/terminal-sessions-BQ6t92tJ.js +1 -0
  295. package/dist/client/assets/{terminal-takeover--05EYhJm.js → terminal-takeover-DANQfTcy.js} +1 -1
  296. package/dist/client/assets/{terminal-xGf_F3y7.js → terminal-yN9xN-h9.js} +1 -1
  297. package/dist/client/assets/{runtime-picker-BXKJbLot.js → text-CnZ0e1-V.js} +1 -1
  298. package/dist/client/assets/text-rLpBg4_z.css +1 -0
  299. package/dist/client/assets/use-conversation-list-D9BNLfnW.js +1 -0
  300. package/dist/client/assets/{use-fleet-active-asks-Cnwa4hTK.js → use-fleet-active-asks-BeAdcl09.js} +1 -1
  301. package/dist/client/assets/{use-mesh-ops-items-BRFm37oY.js → use-mesh-ops-items-BIvIHlqe.js} +1 -1
  302. package/dist/client/assets/use-reduced-motion-CKkhq9c5.js +1 -0
  303. package/dist/client/assets/{use-scout-dev-flags-FkMreOOb.js → use-scout-dev-flags-B2KCzPxn.js} +1 -1
  304. package/dist/client/assets/{useAgentHoverCard-DvPZSJK3.js → useAgentHoverCard-CHBsxcbp.js} +1 -1
  305. package/dist/client/assets/useContentSecondaryNav-D0mUhxTF.js +1 -0
  306. package/dist/client/assets/{usePierreRuntime-C8WJ0X3F.js → usePierreRuntime-DUuXH5yp.js} +1 -1
  307. package/dist/client/assets/{wrench-_tHBGTop.js → wrench-YcXMlsh2.js} +1 -1
  308. package/dist/client/assets/{x-CrGUKNRv.js → x-e3h2hDsp.js} +1 -1
  309. package/dist/client/assets/{xterm-Ks-VlLTq.js → xterm-Byp1Hep_.js} +1 -1
  310. package/dist/client/assets/zap-nMcjPoWB.js +1 -0
  311. package/dist/client/favicon-16.png +0 -0
  312. package/dist/client/favicon-32.png +0 -0
  313. package/dist/client/favicon.ico +0 -0
  314. package/dist/client/favicon.svg +20 -47
  315. package/dist/client/index.html +5 -5
  316. package/dist/client/openscout-icon.png +0 -0
  317. package/dist/client/site.webmanifest +2 -2
  318. package/dist/client/web-app-icon-192.png +0 -0
  319. package/dist/client/web-app-icon-512.png +0 -0
  320. package/dist/main.mjs +19862 -77878
  321. package/dist/node/main.mjs +322 -252
  322. package/dist/pairing-runtime-controller.mjs +1032 -804
  323. package/dist/runtime/base-daemon.mjs +49 -121
  324. package/dist/runtime/broker-daemon.mjs +1105 -281
  325. package/dist/runtime/broker-process-manager.mjs +6 -0
  326. package/dist/runtime/mesh-discover.mjs +6 -0
  327. package/dist/scout-control-plane-web.mjs +3326 -1912
  328. package/dist/scout-web-server.mjs +2 -96660
  329. package/package.json +6 -3
  330. package/dist/client/assets/ActivityScreen-BUeb4ERK.js +0 -1
  331. package/dist/client/assets/AgentAvatar-CneOa70z.js +0 -1
  332. package/dist/client/assets/AgentConfigurationScreen-CkZ7EjZh.js +0 -1
  333. package/dist/client/assets/AgentDefinitionsWorkspace-0Y3kqMtv.js +0 -1
  334. package/dist/client/assets/AgentFloorView-B5raPB_U.js +0 -1
  335. package/dist/client/assets/AgentInfoScreen-DFG4ElZD.js +0 -1
  336. package/dist/client/assets/AgentLaneDetailSheet-C8RYotnv.js +0 -4
  337. package/dist/client/assets/AgentLanesEmbedScreen-Br7cmZVO.js +0 -1
  338. package/dist/client/assets/AgentLanesView-DPfO8MOo.js +0 -2
  339. package/dist/client/assets/AgentSessions-DKoWA0Lm.js +0 -6
  340. package/dist/client/assets/AgentsConsole-DoBIWGoq.js +0 -1
  341. package/dist/client/assets/AgentsScreen-JuUiSuwY.js +0 -1
  342. package/dist/client/assets/AgentsSubnav-BV0WAgzf.js +0 -1
  343. package/dist/client/assets/AtopView-ycxMrRwp.js +0 -1
  344. package/dist/client/assets/BriefingDetailScreen-Zw-taW1s.js +0 -6
  345. package/dist/client/assets/BriefingsScreen-BerYOoWS.js +0 -1
  346. package/dist/client/assets/BrokerScreen-CeN90URH.js +0 -5
  347. package/dist/client/assets/ChatCollapsedStrip-DdKyMSEM.js +0 -1
  348. package/dist/client/assets/CodeScreen-CA9Sq6Dx.js +0 -1
  349. package/dist/client/assets/ContextMenu-DnFcmfMR.js +0 -1
  350. package/dist/client/assets/ConversationComposer-CjRXFkvY.js +0 -1
  351. package/dist/client/assets/ConversationFeedRows-CgRTIpAv.js +0 -1
  352. package/dist/client/assets/ConversationHeader-CRmdtuL7.js +0 -1
  353. package/dist/client/assets/ConversationPanels-DCkcLIHk.js +0 -2
  354. package/dist/client/assets/ConversationScreen-Br0QQ3xo.js +0 -1
  355. package/dist/client/assets/ConversationScreen-yIKEsm-8.css +0 -1
  356. package/dist/client/assets/ConversationStatus-BJ1CMbAv.js +0 -1
  357. package/dist/client/assets/DispatchAftermath-B0WMg_z3.js +0 -1
  358. package/dist/client/assets/DocumentFocusViewer-CZVVIAD5.js +0 -1
  359. package/dist/client/assets/FleetSearch-Dsi_l2KW.js +0 -1
  360. package/dist/client/assets/FleetSearch-EXOe8ulE.css +0 -1
  361. package/dist/client/assets/FlightObserveScreen-g_tiGmvz.js +0 -1
  362. package/dist/client/assets/FollowScreen-Bb_rcrzi.js +0 -1
  363. package/dist/client/assets/HarnessesScreen-CAsCJ_tG.js +0 -1
  364. package/dist/client/assets/HomeHero-DEl-WBsT.css +0 -1
  365. package/dist/client/assets/HomeHero-W445QrG1.js +0 -1
  366. package/dist/client/assets/KnowledgeSearchScreen-C1lN1xJk.js +0 -1
  367. package/dist/client/assets/LaneTraceDetailSheet-CzTd44rf.js +0 -1
  368. package/dist/client/assets/MeshScreen-CkMepUpT.js +0 -1
  369. package/dist/client/assets/MessageComposerSuggestions-qbalTne_.js +0 -1
  370. package/dist/client/assets/MessagesScreen-C8UynyLC.js +0 -1
  371. package/dist/client/assets/MissionControlView-K_I7eftL.js +0 -1
  372. package/dist/client/assets/MissionFocusOverlay-CWKLdUKG.js +0 -1
  373. package/dist/client/assets/MissionLeftAgentRow-ByGrNAcs.js +0 -1
  374. package/dist/client/assets/MissionLogPane-ZwHJ137T.js +0 -1
  375. package/dist/client/assets/NewAgentModal-Do9aVvan.js +0 -1
  376. package/dist/client/assets/NewChatComposer-DKlNX1UA.js +0 -19
  377. package/dist/client/assets/ObserveEmbedScreen-Dghsq2on.js +0 -2
  378. package/dist/client/assets/ObserveTextFlow-DWNlmTVm.js +0 -2
  379. package/dist/client/assets/ObservedTopologyPanel-BlmGoxCE.js +0 -2
  380. package/dist/client/assets/OpenScoutAppShell-DDqQi-oe.js +0 -87
  381. package/dist/client/assets/OpsAgentsView-Bn_fGBdo.js +0 -1
  382. package/dist/client/assets/OpsScreen-DHnT-Q9R.js +0 -1
  383. package/dist/client/assets/OpsSubnav-CJRD7MjM.js +0 -1
  384. package/dist/client/assets/PlanView-B6gKo543.js +0 -1
  385. package/dist/client/assets/ProjectAgentProfile-Be1VOkI4.js +0 -1
  386. package/dist/client/assets/ProjectAgentProfileHero-DC7Dd8VL.js +0 -1
  387. package/dist/client/assets/ProjectsInbox-DCLrDmj1.js +0 -2
  388. package/dist/client/assets/ProjectsRail-C4hiXYSb.js +0 -1
  389. package/dist/client/assets/ProjectsScreen-jruZRjgD.js +0 -1
  390. package/dist/client/assets/ProjectsThreadAside-DYmL2dCY.js +0 -1
  391. package/dist/client/assets/Provider-p-xuaAoE.js +0 -1
  392. package/dist/client/assets/RailRow-Cf9LOiEj.css +0 -1
  393. package/dist/client/assets/RailRow-bRkkXIpR.js +0 -1
  394. package/dist/client/assets/RawSessionsTable-B7WKmXrk.js +0 -1
  395. package/dist/client/assets/RealtimeVoiceScreen-BzP3BQq9.js +0 -1
  396. package/dist/client/assets/RepoDiffViewer-CNDp01KM.js +0 -7
  397. package/dist/client/assets/RepoDiffViewerLazy-b6vjYxez.js +0 -2
  398. package/dist/client/assets/ReposScreen-CpaLC_NU.js +0 -6
  399. package/dist/client/assets/ScoutDeckSurface-DkpZ-0DH.js +0 -1
  400. package/dist/client/assets/ScoutbotBroadcastChip-CGZyxS5H.js +0 -2
  401. package/dist/client/assets/ScoutbotRealtimeVoiceCall-n63LdBZs.js +0 -1
  402. package/dist/client/assets/SessionRefScreen-C-4jjmVG.js +0 -1
  403. package/dist/client/assets/SessionsScreen-HAjFvmIq.js +0 -1
  404. package/dist/client/assets/SettingsDrawer-DATxwZrn.js +0 -3
  405. package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +0 -1
  406. package/dist/client/assets/SettingsScreen-Bu53X7J_.js +0 -1
  407. package/dist/client/assets/SpriteAvatar-CEYdCzem.js +0 -1
  408. package/dist/client/assets/Terminal-BI6km7H4.js +0 -1
  409. package/dist/client/assets/TerminalEmbedScreen-D4JOWwtm.js +0 -1
  410. package/dist/client/assets/WorkDetailScreen-CweZ6fEd.js +0 -5
  411. package/dist/client/assets/WorkFilesViewer-Dy_-06iI.js +0 -1
  412. package/dist/client/assets/agent-identity-BxCsXnDp.js +0 -1
  413. package/dist/client/assets/agent-lane-detail-BNNm6FNu.js +0 -2
  414. package/dist/client/assets/api-h5zurxmi.js +0 -1
  415. package/dist/client/assets/broker-display-pp33bLsu.js +0 -2
  416. package/dist/client/assets/collapsed-strip-Dz-of2SM.css +0 -1
  417. package/dist/client/assets/content-BQuEedeL.js +0 -1
  418. package/dist/client/assets/content-BUae-L_N.js +0 -1
  419. package/dist/client/assets/content-BfG98J1k.js +0 -1
  420. package/dist/client/assets/content-BkVTfkAC.js +0 -1
  421. package/dist/client/assets/content-BsNMos_d.js +0 -1
  422. package/dist/client/assets/content-C2TZOKSE.js +0 -1
  423. package/dist/client/assets/content-CCn98eSk.js +0 -1
  424. package/dist/client/assets/content-CJuH5cDP.js +0 -1
  425. package/dist/client/assets/content-CYnPp9yo.js +0 -1
  426. package/dist/client/assets/content-CcrUhm4P.js +0 -1
  427. package/dist/client/assets/content-CiOMtgQc.js +0 -1
  428. package/dist/client/assets/content-CxuVONeQ.js +0 -1
  429. package/dist/client/assets/content-Dmq9n1_L.js +0 -1
  430. package/dist/client/assets/content-DskHP2NI.js +0 -1
  431. package/dist/client/assets/content-DvvzL2HK.js +0 -1
  432. package/dist/client/assets/content-snCAUbwv.js +0 -1
  433. package/dist/client/assets/conversation-model-CHwHZNw-.js +0 -1
  434. package/dist/client/assets/conversation-motion-features-DPiGTO21.js +0 -1
  435. package/dist/client/assets/ctx-panel-B4s49N9e.css +0 -1
  436. package/dist/client/assets/discover-IEnbrH8_.js +0 -2
  437. package/dist/client/assets/embed-entry-XUPb-AzL.js +0 -2
  438. package/dist/client/assets/gestures-B5rLNRpi.js +0 -1
  439. package/dist/client/assets/harnesses-screen-DBZoTZz8.css +0 -1
  440. package/dist/client/assets/home-moving-signal-Bs635mVw.js +0 -1
  441. package/dist/client/assets/home-moving-signal-CAa0V91u.css +0 -1
  442. package/dist/client/assets/home-now-card-VxlLjg1A.js +0 -1
  443. package/dist/client/assets/hooks-BWiLxTw1.js +0 -2
  444. package/dist/client/assets/index-9as_JTUs.css +0 -1
  445. package/dist/client/assets/index-BTj2MguM.js +0 -1
  446. package/dist/client/assets/index-BZovGpDk.js +0 -10
  447. package/dist/client/assets/index-CvF09yvf.css +0 -1
  448. package/dist/client/assets/index-DiiEQwdc.js +0 -1
  449. package/dist/client/assets/index-vbaJ8sin.js +0 -1
  450. package/dist/client/assets/inspector-panel-C96HcyK5.js +0 -2
  451. package/dist/client/assets/left-Bk3XnxPD.css +0 -1
  452. package/dist/client/assets/left-BuJ0wJW1.js +0 -2
  453. package/dist/client/assets/left-C6Zj3cR4.js +0 -1
  454. package/dist/client/assets/left-CCoobxPS.css +0 -1
  455. package/dist/client/assets/left-COMAiMfB.js +0 -2
  456. package/dist/client/assets/left-Ce4WKYPK.js +0 -1
  457. package/dist/client/assets/left-DMJkmJOF.js +0 -1
  458. package/dist/client/assets/left-DrCbY6ja.js +0 -1
  459. package/dist/client/assets/left-agents-BuSyVNGE.js +0 -1
  460. package/dist/client/assets/left-default-DRHywOKX.js +0 -1
  461. package/dist/client/assets/left-l92tw5Kc.js +0 -1
  462. package/dist/client/assets/left-lanes-4-aUyyrV.js +0 -1
  463. package/dist/client/assets/left-mission-e849d_Td.js +0 -1
  464. package/dist/client/assets/left-plan-MchYwAB_.js +0 -2
  465. package/dist/client/assets/library-DygjpA6u.js +0 -1
  466. package/dist/client/assets/mesh-buckets-CfAukILK.js +0 -1
  467. package/dist/client/assets/message-visibility-kJM8XcSG.js +0 -1
  468. package/dist/client/assets/mission-control-m3BTDQ9l.css +0 -1
  469. package/dist/client/assets/model-Co0zkMIc.js +0 -1
  470. package/dist/client/assets/plan-view-D56fneVF.css +0 -1
  471. package/dist/client/assets/profile-3Q4sUtvJ.js +0 -1
  472. package/dist/client/assets/projects-inbox-COZ23dLR.css +0 -1
  473. package/dist/client/assets/projects-inbox-Da2hYEn6.js +0 -1
  474. package/dist/client/assets/resolve-panes-D4tlKNCT.js +0 -1
  475. package/dist/client/assets/resolve-sidebar-context-B27lj3Ci.js +0 -1
  476. package/dist/client/assets/right-B8qg3JdB.js +0 -1
  477. package/dist/client/assets/right-BU_W1kSH.js +0 -1
  478. package/dist/client/assets/right-BlR7h0US.js +0 -1
  479. package/dist/client/assets/right-BwgwTGGd.js +0 -1
  480. package/dist/client/assets/right-ByptvkVX.js +0 -1
  481. package/dist/client/assets/right-CUP-NIDG.js +0 -1
  482. package/dist/client/assets/right-Ch_jrNe2.js +0 -1
  483. package/dist/client/assets/right-Dd2DscRz.js +0 -1
  484. package/dist/client/assets/right-DmVHd8Xj.js +0 -1
  485. package/dist/client/assets/router-63XV_E7f.js +0 -1
  486. package/dist/client/assets/runtime-picker-vhm0gtLs.css +0 -1
  487. package/dist/client/assets/scout-voice-D8Q5sZOL.js +0 -1
  488. package/dist/client/assets/secondaryNavConfig-c0cz3MkJ.js +0 -1
  489. package/dist/client/assets/sse-Bb0EOcU9.js +0 -1
  490. package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +0 -1
  491. package/dist/client/assets/terminal-screen-BqVnCwl0.css +0 -1
  492. package/dist/client/assets/terminal-sessions-AmSgHklm.js +0 -1
  493. package/dist/client/assets/text-DsBWV_4k.js +0 -1
  494. package/dist/client/assets/use-conversation-list-DWX02INv.js +0 -1
  495. package/dist/client/assets/use-reduced-motion-C8cWvIZ3.js +0 -1
  496. package/dist/client/assets/useContentSecondaryNav-CNlrhvvx.js +0 -1
  497. package/dist/highlights-eq9cgrbb.scm +0 -604
  498. package/dist/highlights-ghv9g403.scm +0 -205
  499. package/dist/highlights-hk7bwhj4.scm +0 -284
  500. package/dist/highlights-r812a2qc.scm +0 -150
  501. package/dist/highlights-x6tmsnaa.scm +0 -115
  502. package/dist/injections-73j83es3.scm +0 -27
  503. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  504. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  505. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  506. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  507. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  508. /package/dist/client/assets/{document-focus-viewer-BSC_JwVE.css → DocumentFocusViewer-BSC_JwVE.css} +0 -0
@@ -1 +0,0 @@
1
- import{j as e,r}from"./index-BZovGpDk.js";import{u as w}from"./router-63XV_E7f.js";import{a as p,b,c as g}from"./Provider-p-xuaAoE.js";import{S as j,a as E}from"./ScoutbotRealtimeVoiceCall-n63LdBZs.js";import{d as _}from"./types-B0PlfpKc.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./radio-BGtkyCG9.js";import"./plus-BAI0t5g9.js";function N({dictationActive:t=!1,autoStart:c=!1}){const a=w(p,!1),{enabled:l,state:i,leaseId:u,startCall:f,endCall:x}=b(),h=r.useRef(!1),n=r.useRef(null),[m,S]=r.useState(()=>window.innerWidth>=720&&window.innerHeight>=520?"page":"compact"),s=window.webkit?.messageHandlers?.scoutRealtimeVoice;return r.useEffect(()=>{const o=()=>{S(window.innerWidth>=720&&window.innerHeight>=520?"page":"compact")};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),r.useEffect(()=>{s?.postMessage({kind:"session-state",state:i,leaseId:u})},[u,s,i]),r.useEffect(()=>{const o=()=>{if(n.current)return n.current;const d=x().finally(()=>{n.current===d&&(n.current=null)});return n.current=d,d},v=()=>{o()};return window.__scoutRealtimeVoiceStop=o,window.addEventListener(g,v),window.__scoutRealtimeVoiceStopRequested&&o(),()=>{window.removeEventListener(g,v),window.__scoutRealtimeVoiceStop===o&&delete window.__scoutRealtimeVoiceStop}},[x]),r.useEffect(()=>{!c||t||!a||!l||h.current||i!=="idle"&&i!=="ended"&&i!=="error"||(h.current=!0,f())},[c,t,a,l,f,i]),a?l?e.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsx(j,{state:i,onMinimize:s?()=>s.postMessage("minimize"):void 0,onExpand:s?()=>s.postMessage(m==="page"?"restore":"expand"):void 0,layout:m}),e.jsx(E,{dictationActive:t,layout:m})]}):e.jsxs("div",{className:"flex h-full flex-col justify-center gap-2 p-4",children:[e.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Live voice is disabled"}),e.jsx("p",{className:"text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Enable realtime voice in Settings → Voice. The footer Voice control starts and manages calls."})]}):e.jsxs("div",{className:"flex h-full flex-col justify-center gap-2 p-4",children:[e.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Live voice is off"}),e.jsxs("p",{className:"text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:["Turn on the ",e.jsx("span",{className:"font-mono",children:p})," flag to hold live conversations with Scoutbot. Calls use the configured OpenAI API account."]})]})}function xe(){const t=w(p,!1),{enabled:c,state:a}=b();return!t||!c?e.jsx(N,{}):e.jsxs("main",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-[var(--scout-chrome-bg)]",children:[e.jsxs("div",{className:"border-b border-[var(--scout-chrome-border-soft)] px-6 py-5",children:[e.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.14em] text-[var(--scout-chrome-ink-faint)]",children:"Scoutbot"}),e.jsx("h1",{className:"mt-1 text-3xl font-medium text-[var(--scout-chrome-ink-strong)]",children:"Live voice"}),e.jsx("p",{className:"mt-1 max-w-2xl text-xs leading-relaxed text-[var(--scout-chrome-ink-faint)]",children:"Hold a live conversation, inspect navigation attempts, and audit what Scoutbot tried without leaving the call."})]}),e.jsx("div",{className:"min-h-0 flex-1 p-5",children:e.jsxs("section",{className:"mx-auto flex h-full min-h-[26rem] w-full max-w-5xl flex-col overflow-hidden rounded-xl border border-[color-mix(in_srgb,var(--hud-ink)_11%,transparent)] bg-[color-mix(in_srgb,var(--scout-chrome-bg)_96%,black)] shadow-[0_18px_48px_rgba(0,0,0,0.24)]",children:[e.jsx(j,{state:a,layout:"page"}),e.jsx(E,{dictationActive:!1,layout:"page"})]})})]})}const he=_({id:"voice",label:"Live voice",route:{view:"voice"},webPath:"/voice",screen:"RealtimeVoiceScreen",embed:{path:"/embed/voice",profile:"macos.voice",rootClassName:"s-voice-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:t=>({dictationActive:t.get("dictationActive")==="1",autoStart:t.get("autoStart")==="1"})}});export{xe as RealtimeVoicePage,N as RealtimeVoiceScreen,he as scoutSurface};
@@ -1,7 +0,0 @@
1
- import{r as l,j as n}from"./index-BZovGpDk.js";import{a as X,p as Z}from"./ui-LM8pS8qE.js";/* empty css */import{a as T,s as q,l as ee,L as te,f as K,S as ne,r as se,b as re,c as _,d as ie,u as ae,V as A,C as H,D as le,e as oe}from"./usePierreRuntime-C8WJ0X3F.js";import{C as ce}from"./chevron-down-BVg09D6U.js";import{C as de}from"./check-BfA0T8UD.js";import{L as ue}from"./loader-circle-B-l2Wj3-.js";import{S as fe}from"./send-horizontal-DbyEkGql.js";import{c as he}from"./createLucideIcon-DCq_3fQn.js";import{C as me}from"./code-xml-Dbvjk9Kw.js";import{X as pe}from"./x-CrGUKNRv.js";import{r as O,a as V,f as Y}from"./cache-Dr0why2k.js";import{M as xe}from"./message-square-BnkG6tae.js";import{R as ge}from"./refresh-cw-DtF8xPqX.js";import{P as be}from"./plus-BAI0t5g9.js";import{a as B}from"./api-h5zurxmi.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";const ye=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],je=he("file-code-corner",ye);function ke({snapshot:e,selectedFile:t,targets:r,targetId:s,onTargetId:i,draft:c,onDraft:f,contextItems:o,onRemoveContextItem:p,pending:a,status:d,error:g,textareaRef:$,onSubmit:S}){const[u,j]=l.useState(!1),b=l.useRef(null),w=r.find(h=>h.id===s)??null,m=w?.label??"Scout",k=r[0]?.id??null,N=t?T(t):null,I=(c.trim().length>0||o.length>0)&&!a,R=l.useMemo(()=>[...r.map(h=>({id:h.id,label:h.label,suffix:h.id===k?"best context":null})),{id:"scout",label:"Scout",suffix:null}],[k,r]);return l.useEffect(()=>{if(!u)return;const h=C=>{const D=b.current;D&&C.target instanceof Node&&D.contains(C.target)||j(!1)};return document.addEventListener("pointerdown",h),()=>document.removeEventListener("pointerdown",h)},[u]),n.jsxs("div",{className:"rd-comment",children:[o.length>0?n.jsx("div",{className:"rd-comment-context","aria-label":"Included diff context",children:o.map(h=>n.jsx(Ce,{item:h,disabled:a,onRemove:p},h.id))}):null,n.jsxs("div",{className:"rd-comment-main",children:[n.jsxs("div",{className:"rd-target-picker",ref:b,children:[n.jsxs("button",{type:"button",className:"rd-target-button",onClick:()=>j(h=>!h),onKeyDown:h=>{h.stopPropagation(),h.key==="Escape"&&j(!1)},disabled:a,"aria-label":"Diff comment target","aria-haspopup":"listbox","aria-expanded":u,title:"Diff comment target",children:[n.jsx("span",{children:m}),n.jsx(ce,{size:13,strokeWidth:2,"aria-hidden":!0})]}),u?n.jsx("div",{className:"rd-target-menu",role:"listbox","aria-label":"Diff comment target",children:R.map(h=>{const C=h.id===(w?.id??"scout");return n.jsxs("button",{type:"button",className:"rd-target-option",role:"option","aria-selected":C,onClick:()=>{i(h.id),j(!1)},children:[n.jsx("span",{className:"rd-target-option-label",children:h.label}),h.suffix?n.jsx("span",{className:"rd-target-option-suffix",children:h.suffix}):null,n.jsx("span",{className:"rd-target-option-check","aria-hidden":!0,children:C?n.jsx(de,{size:12,strokeWidth:2.2}):null})]},h.id)})}):null]}),n.jsx("textarea",{ref:$,value:c,onChange:h=>f(h.currentTarget.value),onKeyDown:h=>{h.stopPropagation(),(h.metaKey||h.ctrlKey)&&h.key==="Enter"&&(h.preventDefault(),S())},rows:1,disabled:a,placeholder:o.length>0?`Send to ${m} with included context`:"Leave a note on this diff…","aria-label":"Diff comment"}),n.jsxs("button",{type:"button",className:"rd-comment-send",disabled:!I,onClick:S,title:"Send diff comment","aria-label":"Send diff comment",children:[a?n.jsx(ue,{size:13,className:"rd-comment-spin","aria-hidden":!0}):n.jsx(fe,{size:13,"aria-hidden":!0}),n.jsx("span",{children:a?"Sending":"Send"})]})]}),n.jsx("div",{className:"rd-comment-meta",children:g?n.jsx("span",{className:"err",children:g}):d?n.jsx("span",{className:"ok",children:d}):n.jsxs("span",{children:[e.scope?.kind==="session"?"Session diff":"Worktree diff",N?` · ${N}`:""]})})]})}function Ce({item:e,disabled:t,onRemove:r}){const s=e.kind==="file"?je:me;return n.jsxs("div",{className:`rd-context-item ${e.kind}`,children:[n.jsxs("div",{className:"rd-context-head",children:[n.jsx("span",{className:"rd-context-icon","aria-hidden":!0,children:n.jsx(s,{size:12,strokeWidth:2})}),n.jsx("span",{className:"rd-context-label",title:e.label,children:e.label}),n.jsx("span",{className:"rd-context-detail",children:e.detail}),n.jsx("button",{type:"button",className:"rd-context-remove",onClick:()=>r(e.id),disabled:t,title:"Remove included context","aria-label":"Remove included context",children:n.jsx(pe,{size:11,strokeWidth:2.2,"aria-hidden":!0})})]}),e.preview?n.jsx("pre",{className:"rd-context-preview",children:e.preview}):null]})}function $e({heading:e,worktreePath:t,snapshot:r,freshness:s,activeLayer:i,onLayer:c,layout:f,onLayout:o,refreshing:p,onRefresh:a,onFocusComment:d,onClose:g,onOpenAsPage:$}){const{dir:S}=q(t);return n.jsxs("div",{className:"rd-header",children:[n.jsxs("div",{className:"rd-header-id",children:[n.jsxs("div",{className:"rd-header-title",children:[n.jsx("span",{className:"rd-header-name",title:t,children:e}),r.scope?n.jsx(Ne,{snapshot:r}):null,S?n.jsx("span",{className:"rd-header-dir",children:S}):null]}),n.jsx("div",{className:"rd-header-sub",children:n.jsx(ve,{layers:r.layers,activeLayer:i,onLayer:c})}),n.jsx(we,{freshness:s,generatedAt:r.generatedAt})]}),n.jsxs("div",{className:"rd-header-actions",children:[n.jsx("button",{type:"button",className:"rd-close","aria-label":"Comment on diff",title:"Comment on diff",onClick:d,children:n.jsx(xe,{size:14,strokeWidth:2,"aria-hidden":!0})}),n.jsxs("div",{className:"rd-segmented",role:"group","aria-label":"Diff layout",children:[n.jsx("button",{type:"button",className:f==="unified"?"on":"","aria-pressed":f==="unified",onClick:()=>o("unified"),children:"Unified"}),n.jsx("button",{type:"button",className:f==="split"?"on":"","aria-pressed":f==="split",onClick:()=>o("split"),children:"Split"})]}),n.jsx("button",{type:"button",className:`rd-close${p?" spinning":""}`,"aria-label":"Refresh diff",title:"Fetch fresh diff",onClick:a,disabled:p,children:n.jsx(ge,{size:14,strokeWidth:2,"aria-hidden":!0})}),$?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Open diff as page",title:"Open as full page",onClick:$,children:"↗"}):null,g?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Close",onClick:g,children:"✕"}):null]})]})}function Se({snapshot:e}){const t=[];e.coverage.truncatedLayers>0&&t.push({level:"warning",text:`${e.coverage.truncatedLayers} layer${e.coverage.truncatedLayers===1?"":"s"} truncated — the native diff hit a size budget; some files or hunks are omitted.`}),e.coverage.scanBudgetReached&&t.push({level:"warning",text:"Scan budget reached — this diff is partial."});for(const r of e.diagnostics)t.push({level:r.level,text:r.path?`${r.message} (${r.path})`:r.message});return t.length===0?null:n.jsx(n.Fragment,{children:t.map((r,s)=>n.jsxs("div",{className:`rd-banner ${r.level}`,children:[n.jsx("span",{className:"rd-banner-dot","aria-hidden":!0}),n.jsx("span",{children:r.text})]},s))})}function Ne({snapshot:e}){const t=e.scope;if(!t)return null;const r=t.kind==="session"?`Session · ${t.filteredPaths.length} files`:t.filteredPaths.length>0?`Filtered · ${t.filteredPaths.length} files`:"Worktree",s=t.kind==="session"?`${t.label}: path-filtered diff from ${t.changedFiles} changed / ${t.touchedFiles} touched session files`:t.label;return n.jsx("span",{className:`rd-scope-pill ${t.kind}`,title:s,children:r})}function we({freshness:e,generatedAt:t}){const r=e?.fetchedAt??t,s=Math.max(0,Date.now()-r),i=e?.cacheHit?`Prefetched ${O(s)}`:`Updated ${O(s)}`;return n.jsxs("div",{className:"rd-freshness",title:new Date(r).toLocaleString(),children:[n.jsx("span",{children:i}),e?.refreshing?n.jsx("span",{children:"Refreshing…"}):null,e?.refreshError?n.jsx("span",{children:"Refresh failed"}):null]})}function ve({layers:e,activeLayer:t,onLayer:r}){return n.jsx("div",{className:"rd-layers",role:"tablist","aria-label":"Diff layers",children:e.map(s=>{const i=ee(s);return n.jsxs("button",{type:"button",role:"tab","aria-selected":s.kind===t,className:"rd-layer-tab"+(s.kind===t?" on":""),onClick:()=>r(s.kind),title:s.shortstat??void 0,children:[n.jsx("span",{children:te[s.kind]??s.kind}),n.jsx("span",{className:"rd-layer-stat",children:s.files.length===0?"clean":n.jsxs(n.Fragment,{children:[s.files.length,"f"," ",n.jsxs("span",{style:{color:"var(--rd-add)"},children:["+",i.add]})," ",n.jsxs("span",{style:{color:"var(--rd-del)"},children:["−",i.del]}),s.truncated?" ⚠":""]})})]},s.kind)})})}const G="openscout.repo-diff.files-rail-width",U=268,Ie=196,De=520;function Re(e,t){if(e.length<=t)return e;const r=e.lastIndexOf(".");if(r<=0){const p=Math.max(1,Math.floor((t-1)/2)),a=t-p-1;return e.slice(0,p)+"…"+e.slice(-Math.max(1,a))}const s=e.slice(0,r),i=e.slice(r),c=t-i.length-1;if(c<2){const p=Math.max(1,t-i.length-1);return s.slice(0,p)+"…"+i}const f=Math.max(1,Math.floor(c/2)),o=Math.max(1,c-f);return s.slice(0,f)+"…"+s.slice(-o)+i}function Le(e,t){return Math.max(8,Math.floor((e-178-t*14)/6.7))}function W(e){return Math.max(Ie,Math.min(De,Math.round(e)))}function Pe(){if(typeof window>"u")return U;const e=Number(window.localStorage.getItem(G));return Number.isFinite(e)?W(e):U}function Me(e){const t={name:"",path:"",firstIndex:Number.MAX_SAFE_INTEGER,children:new Map,files:[]};for(const r of e){t.firstIndex=Math.min(t.firstIndex,r.index);const s=r.dir?r.dir.split("/").filter(Boolean):[];let i=t;for(const c of s){const f=i.path?`${i.path}/${c}`:c;let o=i.children.get(c);o||(o={name:c,path:f,firstIndex:r.index,children:new Map,files:[]},i.children.set(c,o)),o.firstIndex=Math.min(o.firstIndex,r.index),i=o}i.files.push(r)}return t}function J(e){let t=e.files.length;for(const r of e.children.values())t+=J(r);return t}function Ee({layer:e,selectedFileKey:t,onSelect:r,onIncludeFile:s}){const[i,c]=l.useState(Pe),[f,o]=l.useState(()=>new Set),p=l.useMemo(()=>(e?.files??[]).map((u,j)=>{const b=K(u,j),w=T(u),{name:m,dir:k}=q(w),N=(u.status==="renamed"||u.status==="copied")&&u.oldPath&&u.newPath&&u.oldPath!==u.newPath;return{file:u,index:j,key:b,display:w,name:m,dir:k,renamed:!!N}}),[e]),a=l.useMemo(()=>Me(p),[p]),d=l.useCallback(u=>{o(j=>{const b=new Set(j);return b.has(u)?b.delete(u):b.add(u),b})},[]),g=l.useCallback(u=>{u.preventDefault();const j=u.clientX,b=i,w=k=>{c(W(b+k.clientX-j))},m=()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",m),c(k=>{const N=W(k);return window.localStorage.setItem(G,String(N)),N})};window.addEventListener("pointermove",w),window.addEventListener("pointerup",m,{once:!0})},[i]),$=(u,j)=>n.jsx(Fe,{entry:u,depth:j,railWidth:i,selected:u.key===t,onSelect:r,onIncludeFile:s},u.key),S=(u,j)=>{const b=[],w=[...u.children.values()].sort((m,k)=>m.firstIndex!==k.firstIndex?m.firstIndex-k.firstIndex:m.name.localeCompare(k.name));for(const m of w){const k=f.has(m.path);b.push(n.jsxs("button",{type:"button",className:"rd-dir-row",style:{paddingLeft:12+j*14},onClick:()=>d(m.path),title:m.path,children:[n.jsx("span",{className:"rd-dir-caret",children:k?"›":"⌄"}),n.jsx("span",{className:"rd-dir-name",children:m.name}),n.jsx("span",{className:"rd-dir-count",children:J(m)})]},`dir:${m.path}`)),k||b.push(...S(m,j+1))}for(const m of u.files)b.push($(m,j));return b};return n.jsxs("div",{className:"rd-rail",style:{width:i},children:[n.jsx("div",{className:"rd-rail-head",children:e?`Changed files · ${e.files.length}`:"Changed files"}),n.jsx("div",{className:"rd-rail-list",children:S(a,0)}),n.jsx("div",{className:"rd-rail-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file navigation",onPointerDown:g})]})}function Fe({entry:e,depth:t,railWidth:r,selected:s,onSelect:i,onIncludeFile:c}){const{file:f,key:o,display:p,name:a,dir:d,renamed:g}=e,$=Le(r,t),S=Re(a,$);return n.jsxs("div",{className:"rd-file-row"+(s?" on":""),title:g?`${f.oldPath} → ${f.newPath}`:p,children:[n.jsxs("button",{type:"button",className:"rd-file-pick",style:{paddingLeft:18+t*14},onClick:()=>i(o),children:[n.jsx("span",{className:`rd-file-glyph ${f.status}`,children:ne[f.status]}),n.jsxs("span",{className:"rd-file-id",children:[n.jsx("span",{className:"rd-file-name",children:S}),n.jsx("span",{className:"rd-file-dir",children:g?`${f.oldPath} → ${d||a}`:d}),n.jsx(Te,{file:f})]})]}),n.jsx("span",{className:"rd-file-churn",children:f.binary?n.jsx("span",{className:"add",style:{color:"var(--muted)"},children:"bin"}):n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"add",children:["+",f.additions??0]}),n.jsxs("span",{className:"del",children:["−",f.deletions??0]})]})}),n.jsx("button",{type:"button",className:"rd-file-include",onClick:u=>{u.stopPropagation(),c(f,o)},"aria-label":`Include ${p} in comment`,title:"Include in comment",children:n.jsx(be,{size:12,strokeWidth:2,"aria-hidden":!0})})]})}function Te({file:e}){const t=[];return e.binary&&t.push("BINARY"),e.truncated&&t.push("TRUNCATED"),e.status==="conflict"&&t.push("CONFLICT"),t.length===0?null:n.jsx("span",{className:"rd-file-tags",children:t.map(r=>n.jsx("span",{className:"rd-file-tag",children:r},r))})}function Ae(e){switch(e?.trim().toLowerCase()){case"active":case"working":case"running":case"in_turn":return 80;case"queued":case"waiting":case"waking":case"in_flight":return 50;case"idle":case"available":return 25;case"offline":case"retired":case"stale":return-40;default:return 0}}function Ke(e){return e.newPath??e.oldPath??"(unknown)"}function Q(e){const t=e.scope?.kind==="session"?e.scope.agentId:null,r=new Map;for(const s of e.scout.hints)s.agentId&&r.set(s.agentId,(r.get(s.agentId)??0)+1);return e.scout.agents.map(s=>({id:s.id,label:X(s),score:Ae(s.state)+(s.id===t?1e3:0)+(r.get(s.id)??0)*10})).sort((s,i)=>{const c=i.score-s.score;return c!==0?c:s.label.localeCompare(i.label)})}function We(e){return Q(e)[0]??null}function ze(e){const t=e.files.reduce((r,s)=>({add:r.add+(s.additions??0),del:r.del+(s.deletions??0)}),{add:0,del:0});return`${e.kind}: ${e.files.length} file${e.files.length===1?"":"s"}, +${t.add} -${t.del}${e.truncated?", truncated":""}`}function z(e){const t=e.binary?"binary":`+${e.additions??0} -${e.deletions??0}`;return`${e.status}: ${Ke(e)} (${t}${e.truncated?", truncated":""})`}function _e(e){const t=e.scope;return t?t.kind==="session"?`session ${t.sessionId??t.refId??"(unknown)"} (${t.changedFiles} changed / ${t.touchedFiles} touched files, ${t.include})`:t.filteredPaths.length>0?`filtered worktree (${t.filteredPaths.length} paths)`:"worktree":"worktree"}function He(e){const{comment:t,includedContext:r=[],snapshot:s,activeLayer:i,selectedFile:c}=e,o=((i?s.layers.find(d=>d.kind===i)??null:null)?.files??s.layers.flatMap(d=>d.files)).slice(0,12).map(z),p=s.scout.agents.map(d=>X(d)).slice(0,8),a=["Operator comment on repo diff:",t,"","Repo Diff context:",`- Worktree: ${s.worktreePath}`,`- Scope: ${_e(s)}`,`- Active layer: ${i??"none"}`];return r.length>0&&a.splice(3,0,"Included diff context:",...r.map(d=>d.trim()).filter(Boolean),""),c&&a.push(`- Selected file: ${z(c)}`),a.push(`- Layers: ${s.layers.map(ze).join("; ")}`),p.length>0&&a.push(`- Attached agents: ${p.join(", ")}`),s.scout.sessions.length>0&&a.push(`- Sessions: ${s.scout.sessions.map(d=>d.id).slice(0,8).join(", ")}`),o.length>0&&a.push(`- Changed files: ${o.join(", ")}`),s.diagnostics.length>0&&a.push(`- Diagnostics: ${s.diagnostics.map(d=>d.message).join("; ")}`),a.join(`
2
- `)}function Oe(e){const{snapshot:t,activeLayer:r,file:s}=e,i=[r??"diff",z(s)];return t.scope?.kind==="session"&&i.push(`session ${t.scope.sessionId??t.scope.refId??"scope"}`),`[Diff context: ${i.join(" · ")}]`}function Be(e,t,r){return!e||!t?null:e.files.find((s,i)=>r(s,i)===t)??null}function Ue(e,t=120){const r=e.replace(/\s+/g," ").trim();return r.length>t?`${r.slice(0,t-3)}...`:r}function Xe(e,t=7){const r=e.trimEnd().split(`
3
- `),s=r.slice(0,t),i=r.length-s.length;return i>0?`${s.join(`
4
- `)}
5
- ... ${i} more line${i===1?"":"s"}`:s.join(`
6
- `)}function qe(e){return e.newLine!=null?`L${e.newLine}`:e.oldLine!=null?`old L${e.oldLine}`:"line"}function Ve(e){return e.side==="add"?"+":e.side==="del"?"-":" "}function Ye(e){const{snapshot:t,activeLayer:r,file:s}=e,i=T(s),c=s.binary?"binary":`+${s.additions??0} -${s.deletions??0}`;return{id:`file:${r??"diff"}:${i}`,kind:"file",label:i,detail:`${r??"diff"} · ${s.status} · ${c}`,preview:null,snippet:Oe({snapshot:t,activeLayer:r,file:s})}}function Ge(e){const{line:t}=e,r=Ve(t);return{id:`line:${t.layer}:${t.filePath}:${t.side}:${t.oldLine??""}:${t.newLine??""}`,kind:"line",label:`${t.filePath}:${qe(t)}`,detail:`${t.layer} · ${r}`,preview:`${r} ${Ue(t.text,180)}`,snippet:se({line:t})}}function Je(e){const{selection:t}=e,r=t.filePath??"diff selection",s=t.text.trim().split(`
7
- `).filter(Boolean).length;return{id:`selection:${t.layer??"diff"}:${r}:${t.text}`,kind:"selection",label:r,detail:`${t.layer??"diff"} · ${s} line${s===1?"":"s"}`,preview:Xe(t.text),snippet:re({selection:t})}}function Qe({snapshot:e,activeLayer:t,selectedFile:r,setSelectedFileKey:s,resetKey:i}){const[c,f]=l.useState(""),[o,p]=l.useState([]),[a,d]=l.useState("scout"),[g,$]=l.useState(!1),[S,u]=l.useState(!1),[j,b]=l.useState(null),[w,m]=l.useState(null),k=l.useRef(null),N=l.useMemo(()=>e?Q(e):[],[e]),I=l.useMemo(()=>e?We(e):null,[e]);l.useEffect(()=>{f(""),p([]),$(!1),b(null),m(null)},[i]),l.useEffect(()=>{d(y=>g&&y==="scout"||N.some(x=>x.id===y)?y:I?.id??"scout")},[g,N,I?.id]);const R=l.useCallback(y=>{f(y),b(null),m(null)},[]),h=l.useCallback(y=>{$(!0),d(y)},[]),C=l.useCallback(y=>{p(x=>x.some(P=>P.id===y.id)?x:[...x,y]),b(null),m(null),queueMicrotask(()=>k.current?.focus())},[]),D=l.useCallback(y=>{p(x=>x.filter(P=>P.id!==y)),b(null),m(null)},[]),M=l.useCallback(async()=>{const y=c.trim();if(!y&&o.length===0||S||!e)return;const x=N.find(F=>F.id===a)??null,P=He({comment:y||"Please review the included diff context.",includedContext:o.map(F=>F.snippet),snapshot:e,activeLayer:t,selectedFile:r});u(!0),b(null),m(null);try{x?(await B("/api/ask",{method:"POST",body:JSON.stringify({body:P,targetAgentId:x.id,targetLabel:x.label,metadata:{source:"repo-diff",originSurface:"repo-diff",handoffKind:"repo-diff-comment",targetAgentId:x.id,worktreePath:e.worktreePath,activeLayer:t,selectedFile:r?T(r):null,scopeKind:e.scope?.kind??"worktree"}})}),b(`Sent to ${x.label}`)):(await B("/api/send",{method:"POST",body:JSON.stringify({body:P})}),b("Sent to Scout")),f(""),p([])}catch(F){m(F instanceof Error?F.message:String(F))}finally{u(!1)}},[t,o,c,S,a,N,r,e]),v=l.useCallback((y,x)=>{e&&(s(x),C(Ye({snapshot:e,activeLayer:t,file:y})))},[t,C,s,e]),L=l.useCallback(y=>{e&&C(Ge({line:y}))},[C,e]),E=l.useCallback(y=>{e&&C(Je({selection:y}))},[C,e]);return{targets:N,targetId:a,setTargetId:h,draft:c,setDraft:R,contextItems:o,removeContextItem:D,pending:S,status:j,error:w,textareaRef:k,submit:M,includeFileInComment:v,includeLineInComment:L,includeSelectionInComment:E}}function Ze({path:e,activeLayer:t,selectedFile:r,snapshotKey:s}){const i=r?T(r):null,c=`${e}\0${t??""}\0${i??""}\0${s}`,[f,o]=l.useState({layer:null,phase:"idle",error:null}),p=l.useRef(c),a=l.useMemo(()=>!t||!i?null:V(e,[t],{files:[i],tier:"patch",cacheScope:s}),[t,i,e,s]);return l.useEffect(()=>{if(p.current=c,!t||!i){o({layer:null,phase:"idle",error:null});return}if(a?.fresh){o({layer:a.snapshot.layers[0]??null,phase:"ready",error:null});return}o({layer:null,phase:"loading",error:null}),Y(e,[t],{files:[i],tier:"patch",cacheScope:s}).then(d=>{p.current===c&&o({layer:d.snapshot.layers[0]??null,phase:"ready",error:null})},d=>{p.current===c&&o(g=>({layer:g.layer,phase:"error",error:d instanceof Error?d.message:String(d)}))})},[t,a,i,e,c]),f}function et(e){const[t,r]=l.useState(null),[s,i]=l.useState(null),[c,f]=l.useState("split");l.useEffect(()=>{e&&f(e.render.preferredLayout==="stacked"?"unified":"split")},[e]),l.useEffect(()=>{if(!e)return;const d=e.layers.filter(g=>g.files.length>0)[0]??e.layers[0]??null;r(g=>g&&e.layers.some($=>$.kind===g)?g:d?d.kind:null)},[e]);const o=l.useMemo(()=>!e||!t?null:e.layers.find(a=>a.kind===t)??null,[e,t]),p=l.useMemo(()=>Be(o,s,K),[o,s]);return l.useEffect(()=>{if(!o){i(null);return}i(a=>{const d=o.files.map((g,$)=>K(g,$));return a&&d.includes(a)?a:d[0]??null})},[o]),{activeLayer:t,setActiveLayer:r,layer:o,selectedFileKey:s,setSelectedFileKey:i,selectedFile:p,layout:c,setLayout:f}}function tt({path:e,layers:t,files:r,session:s,tier:i="summary",forceInitialLoad:c}){const f=t.join(","),o=l.useMemo(()=>f.split(","),[f]),p=(r??[]).join("\0"),a=s?`${s.sessionId??""}\0${s.agentId??""}\0${s.include??"changed"}`:"",d=l.useMemo(()=>({files:p?p.split("\0").filter(Boolean):void 0,tier:i,session:a?{sessionId:s?.sessionId??null,agentId:s?.agentId??null,include:s?.include??"changed"}:null}),[p,s?.agentId,s?.include,s?.sessionId,a,i]),[g,$]=l.useState(null),[S,u]=l.useState("loading"),[j,b]=l.useState(null),[w,m]=l.useState(null),k=l.useRef(null),N=l.useRef(!1);l.useEffect(()=>{k.current=g},[g]);const I=l.useCallback(async(h={})=>{const C=V(e,o,d),D=h.force===!0||c&&!N.current,M=h.preserveCurrent===!0&&k.current!=null;b(null),C&&!D?($(C.snapshot),m(_(C,!0)),u("ready")):M?(m(v=>({fetchedAt:v?.fetchedAt??Date.now(),cacheHit:v?.cacheHit??!1,refreshing:!0,refreshError:null})),u("ready")):(u("loading"),m(null));try{const v=await Y(e,o,{force:D||C!=null,...d});D&&(N.current=!0),$(v.snapshot),m(ie(v,!1)),u("ready")}catch(v){const L=v instanceof Error?v.message:String(v);C?(m(_(C,!1,L)),u("ready")):M?(m(E=>E&&{...E,refreshing:!1,refreshError:L}),u("ready")):(b(L),u("error"))}},[c,e,o,d]);l.useEffect(()=>{I()},[I]);const R=l.useCallback(()=>{I({force:!0,preserveCurrent:!0})},[I]);return{snapshot:g,fetchPhase:S,fetchError:j,freshness:w,filesKey:p,sessionKey:a,requestedLayers:o,loadSnapshot:I,refreshSnapshot:R}}function yt({path:e,layers:t=oe,files:r,session:s,forceInitialLoad:i=!1,onClose:c,onOpenAsPage:f,className:o,title:p}){const{snapshot:a,fetchPhase:d,fetchError:g,freshness:$,filesKey:S,sessionKey:u,loadSnapshot:j,refreshSnapshot:b}=tt({path:e,layers:t,files:r,session:s,tier:"summary",forceInitialLoad:i}),{pierre:w,pierrePhase:m,pierreError:k,pierreTheme:N,retryPierre:I}=ae(a),{activeLayer:R,setActiveLayer:h,layer:C,selectedFileKey:D,setSelectedFileKey:M,selectedFile:v,layout:L,setLayout:E}=et(a),y=Ze({path:e,activeLayer:R,selectedFile:v,snapshotKey:a?.render.renderKey??""}),x=Qe({snapshot:a,activeLayer:R,selectedFile:v,setSelectedFileKey:M,resetKey:`${e}\0${S}\0${u}`});if(d==="loading"&&!a)return n.jsx(A,{className:o,children:n.jsxs(H,{children:[n.jsx("div",{className:"rd-spinner","aria-hidden":!0}),n.jsxs("div",{className:"rd-center-title",children:["Reading ",s?"session":"worktree"," diff…"]}),n.jsx("div",{className:"rd-center-body",children:e})]})});if(d==="error"&&!a)return n.jsx(A,{className:o,children:n.jsxs(H,{children:[n.jsx("div",{className:"rd-center-title",children:"Couldn’t load the diff"}),n.jsx("div",{className:"rd-center-body",children:g??"The broker did not return a diff snapshot."}),n.jsx("div",{className:"rd-center-action",children:n.jsx("button",{type:"button",className:"rd-btn",onClick:()=>{j()},children:"Retry"})})]})});if(!a)return n.jsx(A,{className:o});const P=p??Z(a.worktreePath);return n.jsxs(A,{className:o,children:[n.jsx($e,{heading:P,worktreePath:a.worktreePath,snapshot:a,freshness:$,activeLayer:R,onLayer:h,layout:L,onLayout:E,refreshing:$?.refreshing===!0,onRefresh:b,onFocusComment:()=>{x.textareaRef.current?.scrollIntoView({block:"nearest"}),x.textareaRef.current?.focus()},onClose:c,onOpenAsPage:f}),n.jsx(Se,{snapshot:a}),n.jsxs("div",{className:"rd-body",children:[n.jsx(Ee,{layer:C,selectedFileKey:D,onSelect:M,onIncludeFile:x.includeFileInComment}),n.jsx(ke,{snapshot:a,selectedFile:v,targets:x.targets,targetId:x.targetId,onTargetId:x.setTargetId,draft:x.draft,onDraft:x.setDraft,contextItems:x.contextItems,onRemoveContextItem:x.removeContextItem,pending:x.pending,status:x.status,error:x.error,textareaRef:x.textareaRef,onSubmit:x.submit}),n.jsx(le,{layer:C,patchLayer:y.layer,patchPhase:y.phase,patchError:y.error,selectedFileKey:D,renderKey:a.render.renderKey,theme:N,layout:L,pierre:w,pierrePhase:m,pierreError:k,onRetryPierre:I,onIncludeLineContext:x.includeLineInComment,onIncludeSelectionContext:x.includeSelectionInComment})]})]})}export{yt as RepoDiffViewer,yt as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RepoDiffViewer-CNDp01KM.js","assets/index-BZovGpDk.js","assets/index-9as_JTUs.css","assets/ui-LM8pS8qE.js","assets/usePierreRuntime-C8WJ0X3F.js","assets/chunk-HRAB3GC3-HhKwnZCi.js","assets/chevron-down-BVg09D6U.js","assets/createLucideIcon-DCq_3fQn.js","assets/check-BfA0T8UD.js","assets/loader-circle-B-l2Wj3-.js","assets/send-horizontal-DbyEkGql.js","assets/code-xml-Dbvjk9Kw.js","assets/x-CrGUKNRv.js","assets/cache-Dr0why2k.js","assets/api-h5zurxmi.js","assets/message-square-BnkG6tae.js","assets/refresh-cw-DtF8xPqX.js","assets/plus-BAI0t5g9.js","assets/repo-diff-DyYmQMSA.css"])))=>i.map(i=>d[i]);
2
- import{j as e,r as i,_ as s}from"./index-BZovGpDk.js";/* empty css */const a=i.lazy(()=>s(()=>import("./RepoDiffViewer-CNDp01KM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])).then(r=>({default:r.RepoDiffViewer})));function t(){return e.jsx("div",{className:"rd-viewer","data-scout-theme":!0,children:e.jsx("div",{className:"rd-center",children:e.jsxs("div",{className:"rd-center-card",children:[e.jsx("div",{className:"rd-spinner","aria-hidden":!0}),e.jsx("div",{className:"rd-center-title",children:"Opening diff viewer…"})]})})})}function c(r){return e.jsx(i.Suspense,{fallback:e.jsx(t,{}),children:e.jsx(a,{...r})})}export{c as R};
@@ -1,6 +0,0 @@
1
- import{r as u,j as e}from"./index-BZovGpDk.js";import{E as se}from"./EmptyState-CYNJZMrZ.js";import{u as We}from"./ContextMenu-DnFcmfMR.js";import{f as he,b as qe}from"./api-BkjHJfgJ.js";import{a as _e}from"./api-h5zurxmi.js";import{c as te}from"./clipboard-e3fSpeo7.js";import{u as Be}from"./keyboard-nav-CHo_xmjw.js";/* empty css */import{f as w,c as He,b as Ce,r as Ee,u as Pe,i as ie,w as Ae,k as Ie,l as Ue,m as G,a as X,s as Ke,h as Ve}from"./ui-LM8pS8qE.js";import{B as Me,p as ze,c as Ge}from"./selection-bridge-O9C4kGfF.js";import{S as Xe}from"./SlidePanel-RFXJpfUa.js";import{R as Ye}from"./RepoDiffViewerLazy-b6vjYxez.js";import{p as Je}from"./cache-Dr0why2k.js";import{u as Qe}from"./Provider-p-xuaAoE.js";import{R as Ze}from"./refresh-cw-DtF8xPqX.js";import{S as es}from"./sliders-horizontal-CMe8Bay1.js";/* empty css */import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";const pe=[{value:"claude",label:"Claude"},{value:"codex",label:"Codex"},{value:"pi",label:"Grok"}],ss=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"XHigh"}],ts=[{value:"new",label:"New session",hint:"Start a fresh harness session for this agent"},{value:"existing",label:"Continue session",hint:"Resume this agent’s current harness session"}];function me(s){return`gh pr checkout ${s.number}`}function ns(s){return[`Please review pull request #${s.number}: ${s.title}`,"",`URL: ${s.url}`,`Repo: ${s.repo}`,`Branch: ${s.headRefName||"head"} → ${s.baseRefName||"base"}`,s.path?`Local path: ${s.path}`:null,s.author?`Author: @${s.author}`:null,s.isDraft?"Status: draft":"Status: open","","Read the diff, summarize the change, call out risks or test gaps, and recommend ship / revise / hold."].filter(n=>n!=null).join(`
2
- `)}function Q(s){return s.handle?.trim()||s.name?.trim()||s.id}function fe(s,n){const t=s?.trim(),r=n?.trim();return!t||!r?!1:t===r||t.startsWith(`${r}/`)||r.startsWith(`${t}/`)}function rs(s){switch(s?.trim().toLowerCase()){case"available":case"idle":case"callable":return 40;case"active":case"working":case"running":case"in_turn":case"in_flight":return 20;case"queued":case"waiting":case"waking":return 10;case"offline":case"retired":case"stale":case"blocked":return-50;default:return 0}}function as(s,n,t){const r=t?.trim()||s.path?.trim()||null,a=s.repo.split("/").pop()?.toLowerCase()??"",i=s.headRefName?.trim()??"";return n.filter(o=>!o.retiredFromFleet).map(o=>{let c=rs(o.state);return(fe(o.projectRoot,r)||fe(o.cwd,r))&&(c+=1e3),a&&o.project?.trim().toLowerCase()===a&&(c+=400),i&&o.branch?.trim()===i&&(c+=200),{agent:o,score:c}}).sort((o,c)=>c.score!==o.score?c.score-o.score:Q(o.agent).localeCompare(Q(c.agent))).map(o=>o.agent)}function ge(s,n){const t=new Map,r=s.path?.trim();if(r){const a=r.split("/").filter(Boolean).at(-1)??r;t.set(r,s.repo||a)}for(const a of n){const i=a.root?.trim();i&&(t.has(i)||t.set(i,a.name?.trim()||i.split("/").filter(Boolean).at(-1)||i))}return[...t.entries()].map(([a,i])=>({path:a,label:i}))}function ne(s,n){return s?.harness?.trim()||n?.trim()||"claude"}function is(s){return s?.model?.trim()||""}function ls(s,n){const t=new Set,r=n?.model?.trim();r&&t.add(r);for(const a of s){const i=a.model?.trim();i&&t.add(i)}return[...t]}function os(s){const n=s.harness?.trim()||void 0,t=s.model?.trim()||void 0,r=s.reasoningEffort?.trim()||void 0;return{...n?{harness:n}:{},...t?{model:t}:{},...r?{reasoningEffort:r}:{}}}async function cs(s,n){const t=ns(s),r=n.projectPath.trim();if(!r)throw new Error("Pick a project path for the review.");const a=os(n),i=n.agent??null,o=i&&n.sessionMode==="existing"?"existing":"new";if(i&&o==="existing"&&!i.harnessSessionId?.trim())throw new Error(`@${Q(i)} has no live harness session to continue. Pick “New session” instead.`);const c=await _e("/api/sessions",{method:"POST",body:JSON.stringify({target:i?{agentId:i.id,projectPath:r}:{projectPath:r},execution:{session:o,...o==="existing"&&i?.harnessSessionId?.trim()?{targetSessionId:i.harnessSessionId.trim()}:{},...a},agent:{persistence:i?"sticky":"one_time",...i?.handle?.trim()?{handle:i.handle.trim()}:{}},seed:{instructions:t}})}),h=c.flightId??c.flight?.id??null,p=c.targetAgentId??c.flight?.targetAgentId??c.agentId??i?.id??null,d=c.targetLabel?.trim()||(i?Q(i):null)||p||"one-time reviewer",m=i?o==="existing"?"continue":"new session":"one-time";return{message:[`Assigned #${s.number} for review → ${d.startsWith("@")?d:`@${d}`}`,`· ${m}`,a.harness?`· ${a.harness}`:null,a.model?`· ${a.model}`:null,a.reasoningEffort?`· ${a.reasoningEffort}`:null,h?`· ${h}`:null].filter(Boolean).join(" "),flightId:h,conversationId:c.conversationId??null,targetAgentId:p,targetLabel:d}}function ds(s){window.open(s.url,"_blank","noopener,noreferrer")}function us(s,n={}){const{matchingWorktree:t,onBeginAssign:r,onSelectWorktreeId:a,onOpenDiff:i,onStatus:o}=n,c=[];return r&&c.push({kind:"action",label:"Assign for review…",onSelect:()=>r(s)}),c.push({kind:"action",label:"Open on GitHub",onSelect:()=>ds(s)}),t&&a&&c.push({kind:"action",label:`Select worktree · ${t.branch}`,onSelect:()=>a(t.id)}),t&&i&&c.push({kind:"action",label:"Open local diff",onSelect:()=>i(t.path)}),c.push({kind:"separator"},{kind:"action",label:"Copy link",onSelect:()=>{te(s.url).then(h=>{o?.(h?`Copied link for #${s.number}`:`Could not copy link for #${s.number}`)})}},{kind:"action",label:"Copy checkout command",onSelect:()=>{te(me(s)).then(h=>{o?.(h?`Copied: ${me(s)}`:`Could not copy checkout command for #${s.number}`)})}},{kind:"action",label:"Copy title",onSelect:()=>{te(`#${s.number} ${s.title}`).then(h=>{o?.(h?`Copied title for #${s.number}`:`Could not copy title for #${s.number}`)})}}),c}function hs(s){return s.startsWith("/Users/")?`~/${s.split("/").slice(3).join("/")}`:s}function ps(s){const n=s.handle?.trim()||s.name?.trim()||s.id,t=[s.harness?.trim(),s.model?.trim(),s.state?.trim(),s.harnessSessionId?.trim()?"session":null].filter(Boolean);return t.length>0?`@${n} · ${t.join(" · ")}`:`@${n}`}function Y(s){const n=s?.trim();return n?n.length>18?`${n.slice(0,10)}…${n.slice(-4)}`:n:null}function ms({pr:s,agents:n,projects:t,pending:r,error:a,onClose:i,onPendingChange:o,onError:c,onAssigned:h}){const p=Be(),d=u.useMemo(()=>ge(s,t),[s,t]),[m,b]=u.useState(()=>d[0]?.path??s.path?.trim()??""),[S,A]=u.useState(""),P=u.useMemo(()=>as(s,n,m),[n,s,m]),f=P.find(l=>l.id===S)??null,x=!!f?.harnessSessionId?.trim(),[C,I]=u.useState(()=>ne(null)),[R,O]=u.useState(""),[j,y]=u.useState("medium"),[N,$]=u.useState("new");u.useEffect(()=>{const v=ge(s,t)[0]?.path??s.path?.trim()??"";b(v),A(""),I(ne(null)),O(""),y("medium"),$("new"),c(null)},[s.id]),u.useEffect(()=>{m&&d.some(l=>l.path===m)||b(d[0]?.path??s.path?.trim()??"")},[s.path,d,m]),u.useEffect(()=>{if(!f){$("new");return}I(ne(f)),O(is(f)),$(f.harnessSessionId?.trim()?"existing":"new")},[f?.id]),u.useEffect(()=>{S&&(P.some(l=>l.id===S)||A(""))},[S,P]),u.useEffect(()=>{N==="existing"&&f&&!x&&$("new")},[x,f,N]);const T=u.useMemo(()=>ls(P,f),[P,f]),D=!!m.trim()&&!r&&!(f&&N==="existing"&&!x),W=async()=>{if(D){o(!0),c(null);try{const l=await cs(s,{projectPath:m.trim(),harness:C,model:R,reasoningEffort:j,agent:f,sessionMode:f?N:"new"});h(l)}catch(l){c(l instanceof Error?l.message:String(l))}finally{o(!1)}}},F=r?"Assigning…":f?N==="existing"?"Continue session · review":"New session · review":"Start review",M=f?N==="existing"?`Continues @${f.handle?.trim()||f.name}'s current session${Y(f.harnessSessionId)?` (${Y(f.harnessSessionId)})`:""}.`:`Starts a fresh harness session for @${f.handle?.trim()||f.name}.`:"Starts a disposable one-time reviewer on the project with the runtime above.";return e.jsx("div",{className:"rw-pr-assign-backdrop",role:"presentation",onMouseDown:l=>{l.target===l.currentTarget&&!r&&i()},children:e.jsxs("div",{ref:p.ref,className:"rw-pr-assign-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"rw-pr-assign-title",tabIndex:-1,onKeyDown:l=>{p.onKeyDown(l),l.key==="Escape"&&!r&&(l.stopPropagation(),i())},children:[e.jsxs("div",{className:"rw-pr-assign-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"rw-pr-assign-eyebrow",children:"Assign for review"}),e.jsxs("h2",{id:"rw-pr-assign-title",className:"rw-pr-assign-title",children:["#",s.number," · launch review"]}),e.jsx("p",{className:"rw-pr-assign-copy",title:s.title,children:s.title}),e.jsxs("p",{className:"rw-pr-assign-meta",children:[s.repo," · ",s.headRefName||"head"," → ",s.baseRefName||"base"]})]}),e.jsx("button",{type:"button",className:"rw-pr-assign-close",onClick:i,disabled:r,children:"Cancel"})]}),e.jsxs("div",{className:"rw-pr-assign-body",children:[e.jsxs("div",{className:"rw-pr-assign-fields",children:[e.jsxs("label",{className:"rw-pr-assign-field",children:[e.jsx("span",{children:"Project"}),e.jsx("select",{value:m,disabled:r||d.length===0,onChange:l=>b(l.target.value),"aria-label":"Project path",children:d.length===0?e.jsx("option",{value:"",children:"No local project"}):d.map(l=>e.jsxs("option",{value:l.path,children:[l.label," · ",hs(l.path)]},l.path))})]}),e.jsxs("label",{className:"rw-pr-assign-field",children:[e.jsx("span",{children:"Harness"}),e.jsxs("select",{value:C,disabled:r,onChange:l=>I(l.target.value),"aria-label":"Harness",children:[pe.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value)),C&&!pe.some(l=>l.value===C)?e.jsx("option",{value:C,children:C}):null]})]}),e.jsxs("label",{className:"rw-pr-assign-field",children:[e.jsx("span",{children:"Model"}),e.jsx("input",{list:"rw-pr-assign-models",value:R,disabled:r,placeholder:"Default for harness",onChange:l=>O(l.target.value),"aria-label":"Model"}),e.jsx("datalist",{id:"rw-pr-assign-models",children:T.map(l=>e.jsx("option",{value:l},l))})]}),e.jsxs("label",{className:"rw-pr-assign-field",children:[e.jsx("span",{children:"Effort"}),e.jsx("select",{value:j,disabled:r,onChange:l=>y(l.target.value),"aria-label":"Reasoning effort",children:ss.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]}),e.jsxs("label",{className:"rw-pr-assign-field rw-pr-assign-field--wide",children:[e.jsxs("span",{children:["Agent ",e.jsx("em",{children:"(optional)"})]}),e.jsxs("select",{value:S,disabled:r,onChange:l=>A(l.target.value),"aria-label":"Existing agent (optional)",children:[e.jsx("option",{value:"",children:"New one-time reviewer on project"}),P.map(l=>e.jsx("option",{value:l.id,children:ps(l)},l.id))]})]}),f?e.jsxs("fieldset",{className:"rw-pr-assign-session",disabled:r,children:[e.jsx("legend",{children:"Session"}),e.jsx("div",{className:"rw-pr-assign-session-choices",role:"radiogroup","aria-label":"Session mode",children:ts.map(l=>{const v=l.value==="existing"&&!x,L=N===l.value;return e.jsxs("button",{type:"button",role:"radio","aria-checked":L,className:"rw-pr-assign-session-choice","data-active":L||void 0,disabled:v,title:v?"This agent has no live harness session to continue":l.hint,onClick:()=>$(l.value),children:[e.jsx("span",{className:"rw-pr-assign-session-title",children:l.label}),e.jsx("span",{className:"rw-pr-assign-session-sub",children:v?"No live session on this agent":l.value==="existing"&&Y(f.harnessSessionId)?Y(f.harnessSessionId):l.hint})]},l.value)})})]}):null]}),e.jsx("p",{className:"rw-pr-assign-hint",children:M}),a?e.jsx("div",{className:"rw-pr-assign-error",role:"alert",children:a}):null,e.jsx("div",{className:"rw-pr-assign-actions",children:e.jsx("button",{type:"button",className:"rw-pr-assign-submit",disabled:!D,onClick:()=>{W()},children:F})})]})]})})}const fs=/^Skipped missing repo-watch path:\s*(.+)$/i,gs=4;function js(s){const n=s.trim().replace(/\/+$/,"")||s.trim();if(!n)return"unknown paths";if(n==="~"||n.startsWith("~/"))return"~/*";if(!n.startsWith("/")){const[r]=n.split(/[\\/]/).filter(Boolean);return r?`${r}/*`:n}const t=n.split("/").filter(Boolean);return t[0]==="Users"&&t[1]?`/Users/${t[1]}/*`:t[0]==="Volumes"&&t[1]?`/Volumes/${t[1]}/*`:t.length>=2?`/${t[0]}/${t[1]}/*`:`/${t[0]??""}`}function xs(s,n){const t=[...new Set(s)];if(t.length===1)return{message:`Skipped missing repo-watch path: ${t[0]}`,examples:[],rawCount:1};const r=t.slice(0,gs),a=t.length-r.length;return a>0&&r.push(`+${a} more`),{message:`Skipped ${t.length} missing repo-watch paths under ${n}. These look like stale broker hints.`,examples:r,rawCount:t.length}}function je(s,n){if(s.length===0)return;const t=new Map;for(const r of s){const a=js(r),i=t.get(a);i?i.push(r):t.set(a,[r])}for(const[r,a]of t)n.push(xs(a,r));s.length=0}function bs(s){const n=[],t=[];for(const r of s){const a=fs.exec(r);if(a){t.push(a[1].trim());continue}je(t,n),n.push({message:r,examples:[],rawCount:1})}return je(t,n),n}const xe={attention:"desc",name:"asc",churn:"desc",files:"desc",drift:"desc",attached:"desc"},be="attention";function ws(s){return!s.status.clean||s.branch.ahead>0||s.branch.behind>0||s.agents.some(ie)||s.sessions.length>0||s.error!=null}function vs(s,n){const t=He(s),r=Ce(s),{add:a,del:i,total:o}=Ee(s),c=Pe(s);return{wt:s,project:n,state:Ae(s),add:a,del:i,churn:o,files:r.files+Math.max(t.files,s.status.changedFiles),live:c.filter(ie).length,agentsUnique:c}}function Te(s){return s.status.conflicts>0||s.error!=null}function Ns(s){const n=s.flatMap(i=>i.worktrees.filter(Te).map(o=>{const c=o.branch.name??o.name;return o.status.conflicts>0?`${i.name}/${c}: ${w(o.status.conflicts)} conflict${o.status.conflicts===1?"":"s"}`:`${i.name}/${c}: scan error`})),t="Worktrees blocked by conflicts or scan errors.";if(n.length===0)return t;const r=n.slice(0,8),a=n.length-r.length;return[t,...r,a>0?`+${a} more`:null].filter(i=>!!i).join(`
3
- `)}function Ss({snapshot:s,selectedId:n,onSelect:t,onViewDiff:r,scanDepth:a,scanMorePending:i,onScanMore:o,openPullRequestCount:c,openPullRequestTitle:h}){const[p,d]=u.useState(be),[m,b]=u.useState(xe[be]),[S,A]=u.useState(!1),{liveRows:P,cleanRows:f,stats:x,blockedTitle:C}=u.useMemo(()=>{const j=[],y=[];let N=0,$=0,T=0;for(const F of s.projects)for(const M of F.worktrees){const l=vs(M,F);T+=l.files,l.live>0&&N++,Te(M)&&$++,(ws(M)?j:y).push(l)}const D=s.totals,W={repos:D.projects,worktrees:D.worktrees,dirtyWorktrees:D.dirtyWorktrees,changedFiles:T,live:N,blocked:$};return{liveRows:j,cleanRows:y,stats:W,blockedTitle:Ns(s.projects)}},[s.projects,s.totals]),I=u.useMemo(()=>{const j=Ms(P,p,m),y=new Map;for(const N of j){const $=y.get(N.project.id);$?$.push(N):y.set(N.project.id,[N])}return[...y.values()]},[P,p,m]);function R(j){j===p?b(y=>y==="asc"?"desc":"asc"):(d(j),b(xe[j]))}const O=P.length===0&&f.length===0;return e.jsxs("section",{className:"rw-table",children:[e.jsxs("div",{className:"rw-head",children:[e.jsxs("div",{className:"rw-head-top",children:[e.jsx("span",{className:"rw-eyebrow",children:"STATE OF REPOS"}),f.length>0?e.jsxs("button",{type:"button",className:"rw-clean",style:{marginLeft:"auto"},onClick:()=>A(j=>!j),"aria-pressed":S,children:[S?"hide":"show"," clean & idle (",f.length,")"]}):null]}),e.jsxs("div",{className:"stats",children:[e.jsx(U,{v:x.repos,k:"REPOS"}),x.worktrees>x.repos?e.jsx(U,{v:x.worktrees,k:"WORKTREES",title:`${w(x.worktrees)} worktrees across ${w(x.repos)} repos.`}):null,e.jsx(U,{v:x.changedFiles,k:"CHANGED",title:`${w(x.changedFiles)} changed files across ${w(x.dirtyWorktrees)} dirty worktree${x.dirtyWorktrees===1?"":"s"}.`}),x.live>0?e.jsx(U,{v:x.live,k:"WORKING",tone:"mint"}):null,(c??0)>0?e.jsx(U,{v:c??0,k:"OPEN PRS",tone:"amber",title:h??void 0}):null,x.blocked>0?e.jsx(U,{v:x.blocked,k:"BLOCKED",tone:"coral",title:C}):null]})]}),e.jsxs("div",{className:"tbl-wrap",children:[e.jsxs("div",{className:"tbl-head",children:[e.jsx(V,{label:"REPO / BRANCH · WORKTREE",k:"name",sortKey:p,dir:m,onSort:R}),e.jsx(V,{label:"CHURN",k:"churn",sortKey:p,dir:m,onSort:R,align:"r"}),e.jsx(V,{label:"FILES",k:"files",sortKey:p,dir:m,onSort:R,align:"c"}),e.jsx(V,{label:"DRIFT",k:"drift",sortKey:p,dir:m,onSort:R,align:"c"}),e.jsx(V,{label:"ATTACHED",k:"attached",sortKey:p,dir:m,onSort:R})]}),O?e.jsx("div",{className:"rw-empty",children:"No repositories discovered yet."}):I.map(j=>j.length>1?e.jsx(Rs,{group:j,selectedId:n,onSelect:t,onViewDiff:r},j[0].project.id):e.jsx(ae,{row:j[0],top:!0,selected:n===j[0].wt.id,onSelect:()=>t(j[0].wt.id),onViewDiff:r},j[0].wt.id)),S&&f.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"tbl-head",style:{position:"static"},children:e.jsxs("span",{children:["CLEAN & IDLE · ",f.length]})}),f.map(j=>e.jsx(ae,{row:j,top:!0,clean:!0,selected:n===j.wt.id,onSelect:()=>t(j.wt.id),onViewDiff:r},j.wt.id))]}):null,e.jsx(ks,{snapshot:s,scanDepth:a,scanMorePending:i,onScanMore:o})]})]})}function ks({snapshot:s,scanDepth:n,scanMorePending:t,onScanMore:r}){const a=ys(s),i=bs(s.warnings),o=i.reduce((c,h)=>c+h.rawCount,0);return e.jsxs("div",{className:"scan-coverage",children:[e.jsxs("div",{className:"scan-coverage-row",children:[e.jsx("b",{children:"SCAN"}),e.jsx("span",{className:"scan-main",children:a.summary}),a.canScanMore&&n==="standard"?e.jsx("button",{type:"button",onClick:r,disabled:t,children:t?"Scanning":"Scan more"}):e.jsx("span",{className:"scan-chip",children:n==="expanded"?"expanded":"standard"})]}),i.length>0?e.jsxs("details",{className:"scan-details",children:[e.jsxs("summary",{children:[w(i.length)," diagnostic group",i.length===1?"":"s",o!==i.length?` (${w(o)} raw)`:""]}),e.jsx("ul",{children:i.map((c,h)=>e.jsxs("li",{children:[e.jsx("span",{children:c.message}),c.examples.length>0?e.jsx("span",{className:"scan-detail-examples",children:c.examples.join(" · ")}):null]},`${h}:${c.message}`))})]}):null]})}function ys(s){let n=null,t=0,r=0,a=0,i=0,o=0,c=0;for(const p of s.warnings){const d=/limited discovery to (\d+) repositories/i.exec(p);if(d){n=`discovery capped at ${d[1]}`;continue}if(/limited .* to \d+ worktrees/i.test(p)){t++;continue}if(/skipped unreadable worktree/i.test(p)){r++;continue}if(/skipped missing repo-watch path/i.test(p)){a++;continue}if(/scan budget|stopped discovery|stopped scanning/i.test(p)){i++;continue}if(/could not resolve git common directory/i.test(p)){o++;continue}c++}const h=[`${w(s.totals.projects)} repo${s.totals.projects===1?"":"s"}`,`${w(s.totals.worktrees)} worktree${s.totals.worktrees===1?"":"s"}`];return n&&h.push(n),t&&h.push(`${w(t)} repo${t===1?"":"s"} at worktree cap`),r&&h.push(`${w(r)} unreadable worktree${r===1?"":"s"} skipped`),a&&h.push(`${w(a)} missing path${a===1?"":"s"}`),o&&h.push(`${w(o)} unresolved git dir${o===1?"":"s"}`),i&&h.push("scan budget reached"),c&&h.push(`${w(c)} other diagnostic${c===1?"":"s"}`),{summary:h.join(" · "),canScanMore:n!==null||t>0||i>0}}function Rs({group:s,selectedId:n,onSelect:t,onViewDiff:r}){const a=s[0].project,i=s.some(p=>p.state==="error"),o=s.reduce((p,d)=>p+d.add,0),c=s.reduce((p,d)=>p+d.del,0),h=s.reduce((p,d)=>p+(d.live?1:0),0);return e.jsxs("div",{children:[e.jsxs("div",{className:"repo-grp"+(i?" attn":""),children:[e.jsxs("div",{className:"rg-name",children:[e.jsx("span",{className:"rg-tw","aria-hidden":!0,children:e.jsx("svg",{width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",style:{transform:"rotate(90deg)"},children:e.jsx("path",{d:"M3 2l4 3.5L3 9",stroke:"currentColor",strokeWidth:"1.3",fill:"none"})})}),e.jsx("span",{className:"dot "+Is(s)}),e.jsx("span",{className:"rg-nm",children:a.name}),e.jsx("span",{className:"rg-path",children:Ie(a.root,3)}),e.jsxs("span",{className:"rg-badge",children:[a.worktrees.length," worktrees"]})]}),e.jsx("div",{className:"rg-agg",children:o||c?e.jsxs("span",{children:[e.jsxs("span",{style:{color:"var(--mint-dim)"},children:["+",w(o)]})," ",e.jsxs("span",{style:{color:"var(--coral-dim)"},children:["−",w(c)]})]}):"—"}),e.jsx("div",{}),e.jsx("div",{}),e.jsx("div",{className:"rg-agg",style:{textAlign:"left"},children:h?`${h} working`:""})]}),s.map((p,d)=>e.jsx(ae,{row:p,guide:!0,last:d===s.length-1,selected:n===p.wt.id,onSelect:()=>t(p.wt.id),onViewDiff:r},p.wt.id))]})}function ae({row:s,top:n,guide:t,last:r,clean:a,selected:i,onSelect:o,onViewDiff:c}){const{wt:h,project:p}=s,d=h.branch,m=Ce(h),b=!!c&&(s.files>0||m.has||h.branch.ahead>0);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:["wt",i?"sel":"",s.state==="error"?"attn":""].join(" "),style:n&&!a?{borderTop:"1px solid var(--line)"}:void 0,onClick:o,role:"button",tabIndex:0,onKeyDown:o?S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),o())}:void 0,children:[e.jsxs("div",{className:"wt-name",children:[t?e.jsx("span",{className:"tw-guide"+(r?" last":"")}):null,e.jsxs("div",{className:"inner",children:[e.jsx("span",{className:"dot "+s.state}),e.jsxs("span",{className:"br",children:[n&&!t?e.jsxs("span",{className:"lead",children:[p.name,"  "]}):null,e.jsx(Me,{branch:h.branch,fallback:h.name})]}),e.jsx(As,{wt:h})]})]}),e.jsx($s,{add:s.add,del:s.del}),e.jsx("div",{className:"files",children:s.files>0?e.jsxs("span",{children:[s.files,h.status.conflicts>0?e.jsxs("span",{className:"conf",children:[" ⚠",h.status.conflicts]}):null]}):e.jsx("span",{className:"dash",children:"—"})}),e.jsx(Cs,{ahead:d.ahead,behind:d.behind}),e.jsxs("div",{className:"agents-cell",children:[e.jsx(Ps,{row:s}),b?e.jsx("button",{type:"button",className:"wt-diff",title:`View diff · ${s.files} changed file${s.files===1?"":"s"}`,"aria-label":"View diff",onClick:S=>{S.stopPropagation(),c?.(h.path)},children:"diff"}):null]})]})})}function U({v:s,k:n,tone:t,title:r}){return e.jsxs("div",{className:"stat",title:r,"aria-label":r?`${w(s)} ${n}. ${r}`:void 0,children:[e.jsx("span",{className:"v"+(t?" "+t:""),children:w(s)}),e.jsx("span",{className:"k",children:n})]})}function V({label:s,k:n,sortKey:t,dir:r,onSort:a,align:i}){const o=t===n;return e.jsx("div",{className:i==="r"?"r":i==="c"?"c":"",children:e.jsxs("button",{type:"button",className:o?"on":"",onClick:()=>a(n),children:[e.jsx("span",{children:s}),e.jsx("span",{className:"caret","aria-hidden":!0,children:r==="asc"?"▲":"▼"})]})})}function $s({add:s,del:n}){if(!s&&!n)return e.jsx("div",{className:"churn",children:e.jsx("span",{className:"dash",children:"—"})});const t=s+n||1;return e.jsxs("div",{className:"churn",children:[e.jsxs("span",{className:"nums",children:[e.jsxs("span",{className:"add",children:["+",w(s)]}),e.jsx("span",{className:"sl",children:"/"}),e.jsxs("span",{className:"del",children:["−",w(n)]})]}),e.jsxs("span",{className:"cbar",title:`+${w(s)} −${w(n)}`,children:[e.jsx("span",{className:"g",style:{width:s/t*100+"%"}}),e.jsx("span",{className:"r",style:{width:n/t*100+"%"}})]})]})}function Cs({ahead:s,behind:n}){return!s&&!n?e.jsx("div",{className:"drift",children:e.jsx("span",{className:"dash",children:"—"})}):e.jsxs("div",{className:"drift",children:[s?e.jsxs("span",{className:"dp ahead",children:["↑",s]}):null,n?e.jsxs("span",{className:"dp behind",children:["↓",n]}):null]})}const Es=2;function Ps({row:s}){const n=s.agentsUnique,t=s.wt.sessions,r=[...n.map(o=>`${X(o)} (${o.state??"—"})`),...t.map(o=>`session ${Ke(o)}`)].join(`
4
- `);if(n.length===0)return e.jsx("div",{className:"agents",title:r,children:t.length>0?e.jsxs("span",{className:"ahandle",children:[t.length," session",t.length===1?"":"s"]}):e.jsx("span",{className:"dash",children:"—"})});const a=n.slice(0,Es),i=n.length-a.length;return e.jsxs("div",{className:"agents",title:r,children:[s.live>0?e.jsxs("span",{className:"alive",children:[e.jsx("span",{className:"d"}),s.live]}):null,e.jsx("span",{className:"ahandle",children:a.map(o=>X(o)).join(" ")}),i>0?e.jsxs("span",{className:"amore",children:["+",i]}):null]})}function As({wt:s}){const n=[];return s.branch.detached?n.push({label:"DETACHED",cls:""}):s.branch.upstream||n.push({label:"LOCAL",cls:""}),s.error!=null&&n.push({label:"SCAN ERR",cls:"err"}),s.isBare&&n.push({label:"BARE",cls:""}),e.jsx(e.Fragment,{children:n.map(t=>e.jsx("span",{className:"tag "+t.cls,children:t.label},t.label))})}const we={error:3,live:2,dirty:1,clean:0};function Is(s){return s.reduce((n,t)=>we[t.state]>we[n]?t.state:n,"clean")}function Ms(s,n,t){const r=t==="asc"?1:-1,a=d=>{switch(n){case"attention":return-G(d.wt.attention);case"churn":return d.churn;case"files":return d.files;case"drift":return d.wt.branch.ahead+d.wt.branch.behind;case"attached":return d.live*1e6+d.agentsUnique.length*1e3+d.wt.sessions.length;default:return 0}},i=new Map;for(const d of s){const m=i.get(d.project.id);m?m.push(d):i.set(d.project.id,[d])}const o=(d,m)=>{if(n==="name")return Ue(d,m,r);const b=(a(d)-a(m))*r;if(b!==0)return b;const S=G(d.wt.attention)-G(m.wt.attention);return S!==0?S:d.wt.path.localeCompare(m.wt.path)},c=d=>d.reduce((m,b)=>Math.max(m,a(b)),-1/0),h=[...i.values()].sort((d,m)=>{if(n==="name")return d[0].project.name.localeCompare(m[0].project.name)*r;const b=(c(d)-c(m))*r;return b!==0?b:d[0].project.name.localeCompare(m[0].project.name)}),p=[];for(const d of h)p.push(...[...d].sort(o));return p}const J=8;function ve(s){if(s.error!=null)return 0;const{ahead:n,behind:t}=s.branch;return n>0&&t>0?1:t>0||n>0?2:3}function Ts(s){const n=(s.name??"").trim();if(n){const a=n.split(/[\s_\-/]+/).filter(Boolean);if(a.length>=2)return(a[0][0]+a[1][0]).toUpperCase();if(a.length===1)return a[0].slice(0,2).toUpperCase()}return(X(s).replace(/^@/,"").replace(/[^a-z0-9]/gi,"").slice(0,2)||"··").toUpperCase()}function Ds({snapshot:s,selectedId:n,onSelect:t}){return e.jsxs("section",{className:"bd",children:[e.jsx("div",{className:"bd-head",children:"BRANCH DRIFT — distance from each worktree's base · behind ← origin → ahead · flags call out what needs a rebase"}),e.jsxs("div",{className:"bd-axis",children:[e.jsx("div",{}),e.jsxs("div",{className:"bd-axis-track",children:[e.jsx("span",{className:"bd-axis-lbl",style:{left:"0%"},children:"−8"}),e.jsx("span",{className:"bd-axis-lbl",style:{left:"25%"},children:"−4"}),e.jsx("span",{className:"bd-axis-lbl bd-origin-lbl",style:{left:"50%"},children:"origin"}),e.jsx("span",{className:"bd-axis-lbl",style:{left:"75%"},children:"+4"}),e.jsx("span",{className:"bd-axis-lbl",style:{left:"100%"},children:"+8"}),e.jsx("span",{className:"bd-axis-cap",children:"COMMITS ←"})]}),e.jsx("div",{}),e.jsx("div",{}),e.jsx("div",{})]}),s.projects.map(r=>e.jsx(Ls,{project:r,selectedId:n,onSelect:t},r.id))]})}function Ls({project:s,selectedId:n,onSelect:t}){const r=[...s.worktrees].sort((a,i)=>ve(a)-ve(i));return e.jsxs("div",{className:"bd-grp",children:[e.jsxs("div",{className:"bd-grp-h",children:[e.jsx("span",{className:"bd-grp-nm",children:s.name}),e.jsx("span",{className:"bd-grp-path",children:Ie(s.root,3)})]}),r.map(a=>e.jsx(Os,{wt:a,selected:n===a.id,onSelect:()=>t(a.id)},a.id))]})}function Os({wt:s,selected:n,onSelect:t}){const r=Ae(s),{ahead:a,behind:i}=s.branch,o=s.error!=null,c=Pe(s);return e.jsxs("div",{className:["bd-row",n?"sel":""].join(" "),role:"button",tabIndex:0,onClick:t,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),t())},children:[e.jsxs("div",{className:"bd-id",children:[e.jsx("span",{className:"dot "+r}),e.jsx("span",{className:"bd-br",children:e.jsx(Me,{branch:s.branch,fallback:s.name})})]}),e.jsx(Fs,{ahead:a,behind:i,hasError:o}),e.jsx(Ws,{wt:s,hasError:o}),e.jsx(_s,{agents:c}),e.jsx(Bs,{ahead:a,behind:i,hasError:o})]})}function Fs({ahead:s,behind:n,hasError:t}){const r=s===0&&n===0;return e.jsxs("div",{className:"bd-track",children:[e.jsx("span",{className:"bd-tick",style:{left:"0%"}}),e.jsx("span",{className:"bd-tick",style:{left:"25%"}}),e.jsx("span",{className:"bd-tick bd-tick-origin",style:{left:"50%"}}),e.jsx("span",{className:"bd-tick",style:{left:"75%"}}),e.jsx("span",{className:"bd-tick",style:{left:"100%"}}),t||r?e.jsx("span",{className:"bd-origin-ring"}):e.jsxs(e.Fragment,{children:[n>0?e.jsxs("span",{className:"bd-bar bd-behind",style:{right:"50%",width:Math.min(n,J)/J*50+"%"},children:[e.jsx("span",{className:"bd-cap bd-cap-l"}),e.jsxs("span",{className:"bd-lbl bd-lbl-l",children:["↓",n]})]}):null,s>0?e.jsxs("span",{className:"bd-bar bd-ahead",style:{left:"50%",width:Math.min(s,J)/J*50+"%"},children:[e.jsx("span",{className:"bd-cap bd-cap-r"}),e.jsxs("span",{className:"bd-lbl bd-lbl-r",children:["↑",s]})]}):null]})]})}function Ws({wt:s,hasError:n}){const{add:t,del:r,has:a}=Ee(s);if(n||!a)return e.jsx("div",{className:"bd-churn",children:e.jsx("span",{className:"dash",children:"—"})});const i=t+r||1;return e.jsxs("div",{className:"bd-churn",children:[e.jsxs("span",{className:"bd-churn-nums",children:[e.jsxs("span",{className:"add",children:["+",w(t)]}),e.jsx("span",{className:"sl",children:"/"}),e.jsxs("span",{className:"del",children:["−",w(r)]})]}),e.jsxs("span",{className:"bd-cbar",title:`+${w(t)} −${w(r)}`,children:[e.jsx("span",{className:"g",style:{width:t/i*100+"%"}}),e.jsx("span",{className:"r",style:{width:r/i*100+"%"}})]})]})}const qs=2;function _s({agents:s}){if(s.length===0)return e.jsx("div",{className:"bd-agents",children:e.jsx("span",{className:"dash",children:"—"})});const n=s.slice(0,qs),t=s.length-n.length;return e.jsxs("div",{className:"bd-agents",title:s.map(r=>`${X(r)} (${r.state??"—"})`).join(`
5
- `),children:[n.map(r=>e.jsx("span",{className:"bd-av"+(ie(r)?" live":""),children:Ts(r)},X(r))),t>0?e.jsxs("span",{className:"bd-av-more",children:["+",t]}):null]})}function Bs({ahead:s,behind:n,hasError:t}){return t?e.jsx("div",{className:"bd-flag err",children:"SCAN ERR"}):s>0&&n>0?e.jsx("div",{className:"bd-flag rebase",children:"DIVERGED ▸"}):n>0?e.jsx("div",{className:"bd-flag rebase",children:"REBASE ▸"}):s>0?e.jsxs("div",{className:"bd-flag ahead",children:["AHEAD ",s]}):e.jsx("div",{className:"bd-flag sync",children:"IN SYNC"})}const Hs=1e4,Us=15e3,Ks=45e3,Vs=45e3,zs="openscout.repos.tone",Ne=["warm","cool","mono"],Gs="openscout.repos.view",Se=["table","drift"],Xs=12;function Ys(s){return s.warnings.some(n=>/scan budget|stopped discovery|stopped scanning/i.test(n))}function Js(s,n){return s.totals.worktrees<n.totals.worktrees||s.totals.projects<n.totals.projects}function Qs(s){return s&&typeof s=="object"&&"name"in s&&s.name==="AbortError"?"Repo Watch scan timed out; keeping the last available snapshot.":s instanceof Error?s.message:String(s)}function ke(s,n,t){const[r,a]=u.useState(()=>{if(typeof window>"u")return t;try{const o=window.localStorage.getItem(s);return o&&n.includes(o)?o:t}catch{return t}}),i=u.useCallback(o=>{a(o);try{window.localStorage.setItem(s,o)}catch{}},[s]);return[r,i]}function ye(s){let n=null,t=-1/0;for(const r of s)for(const a of r.worktrees){const i=a.agents.filter(c=>(c.state??"").toLowerCase()==="active").length,o=(4-G(a.attention))*1e6+i*1e4+a.status.changedFiles;o>t&&(t=o,n=a)}return n}function Zs(s,n){if(!s||!n)return{worktree:null,project:null};for(const t of s.projects)for(const r of t.worktrees)if(r.id===n)return{worktree:r,project:t};return{worktree:null,project:null}}function re(s){if(!s)return 0;const n=/(\d+)\s+files?\s+changed/.exec(s);return n?Number(n[1]):0}function et(s){const n=new Set,t=[];for(const r of s.projects){const a=r.worktrees[0]?.path??r.root;!a||n.has(a)||(n.add(a),t.push(a))}return t}function st(s,n){if(!s)return"updated";const t=Date.parse(s);return Number.isFinite(t)?Ve(t,n):"updated"}function tt(s){const n=s?.pullRequests??[];if(n.length===0)return null;const t=n.slice(0,8).map(a=>`${a.repo}#${a.number}: ${a.title}`),r=n.length-t.length;return["Open pull requests from gh.",...t,r>0?`+${r} more`:null].filter(a=>!!a).join(`
6
- `)}function Re(s,n){return n?s.path===n.root||n.worktrees.some(r=>r.path===s.path)?!0:s.repo.split("/").pop()?.toLowerCase()===n.name.toLowerCase():!1}function $e(s,n){const t=n?.branch.name?.trim();return!!(t&&s.headRefName===t)}function nt(s,n){if(!n)return null;const t=s.headRefName?.trim();if(!t)return null;const r=[];for(const a of n.projects)for(const i of a.worktrees)i.branch.name?.trim()===t&&r.push({id:i.id,path:i.path,branch:t});if(r.length===0)return null;if(s.path){const a=r.find(i=>i.path===s.path);if(a)return a}return r[0]??null}function rt(s,n){const t=[];for(const r of s.projects)for(const a of r.worktrees){const i=a.status.staged+a.status.unstaged+a.status.untracked+a.status.conflicts,o=a.agents.filter(m=>(m.state??"").toLowerCase()==="active").length,c=re(a.diff.branchShortstat),h=Math.max(a.status.changedFiles,re(a.diff.stagedShortstat)+re(a.diff.unstagedShortstat)),p=a.branch.ahead+a.branch.behind,d=o+a.sessions.length;i===0&&d===0&&c===0&&p===0||t.push({path:a.path,score:(a.id===n?1e7:0)+(4-G(a.attention))*1e5+o*1e4+a.sessions.length*5e3+p*1e3+c*250+i*100+h})}return t.sort((r,a)=>a.score-r.score).map(r=>r.path)}function z({children:s}){return e.jsx("div",{className:"s-ops",children:e.jsx("div",{className:"s-ops-body",style:{overflowY:"auto"},children:s})})}function at({error:s}){return e.jsxs("div",{className:"rw-empty-next",children:[e.jsx("p",{className:"rw-empty-copy",children:"Repos is waiting on the local Scout Services layer. Restart the broker from the menu bar app, then rescan."}),e.jsxs("ol",{className:"rw-empty-steps",children:[e.jsxs("li",{children:["Click ",e.jsx("span",{className:"rw-empty-action-name",children:"Restart broker"})," to hand off to the menu bar app."]}),e.jsx("li",{children:"Wait for Scout Services to report the broker online."}),e.jsxs("li",{children:["If nothing opens, run ",e.jsx("code",{children:"scout doctor"})," and follow the repair command it prints."]})]}),s?e.jsx("p",{className:"rw-empty-error",children:s}):null]})}function it({snapshot:s,loading:n,error:t,selectedProject:r,selectedWorktree:a,repoSnapshot:i,onSelectWorktree:o,onOpenDiff:c,navigate:h}){const{agents:p}=Qe(),d=We(),[m,b]=u.useState(null),[S,A]=u.useState(null),[P,f]=u.useState(!1),[x,C]=u.useState(null),I=u.useRef(null),R=u.useCallback(l=>{b(l),I.current!=null&&window.clearTimeout(I.current),l&&(I.current=window.setTimeout(()=>b(null),6e3))},[]);u.useEffect(()=>()=>{I.current!=null&&window.clearTimeout(I.current)},[]);const O=u.useCallback(()=>{P||(A(null),C(null))},[P]),j=u.useMemo(()=>(i?.projects??[]).map(l=>({root:l.root,name:l.name})),[i]),y=s?.pullRequests??[],N=a?.branch.name??null,$=y.filter(l=>Re(l,r)),T=$.filter(l=>$e(l,a)),D=$.filter(l=>!$e(l,a)),W=y.filter(l=>!Re(l,r)),F=[T.length>0?{key:"branch",label:N?`Selected branch · ${N}`:"Selected branch",items:T}:null,D.length>0?{key:"project",label:r?`${r.name} PRs`:"Selected project",items:D}:null,W.length>0?{key:"other",label:$.length>0?"Other open PRs":"Open PRs",items:W}:null].filter(l=>!!l);if(!n&&!t&&y.length===0)return null;const M=(l,v)=>{l.preventDefault(),d(l,us(v,{matchingWorktree:nt(v,i),onBeginAssign:L=>{C(null),A(L)},onSelectWorktreeId:o,onOpenDiff:c,onStatus:R}))};return e.jsxs("section",{className:"rw-open-prs","aria-label":"Open pull requests",children:[e.jsxs("div",{className:"rw-open-prs-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"rw-open-prs-eyebrow",children:"Open PRs"}),e.jsx("div",{className:"rw-open-prs-title",children:n&&y.length===0?"Checking GitHub":`${y.length} open`}),m?e.jsx("div",{className:"rw-open-prs-status",role:"status",children:m}):null]}),s?e.jsx("span",{className:"rw-open-prs-meta",children:"gh"}):null]}),y.length>0?e.jsx("div",{className:"rw-open-prs-list",children:F.map(l=>e.jsxs("div",{className:"rw-open-pr-group",children:[F.length>1?e.jsx("div",{className:"rw-open-pr-group-label",children:l.label}):null,l.items.map(v=>e.jsxs("button",{type:"button",className:"rw-open-pr",title:`${v.title} — click for actions`,onClick:L=>M(L,v),onContextMenu:L=>M(L,v),children:[e.jsxs("span",{className:"rw-open-pr-main",children:[e.jsxs("span",{className:"rw-open-pr-number",children:["#",v.number]}),e.jsx("span",{className:"rw-open-pr-title",title:v.title,children:v.title})]}),e.jsxs("span",{className:"rw-open-pr-detail",children:[e.jsx("span",{children:v.repo}),e.jsxs("span",{children:[v.headRefName||"head"," → ",v.baseRefName||"base"]}),v.isDraft?e.jsx("span",{children:"draft"}):e.jsx("span",{children:"open"}),v.author?e.jsxs("span",{children:["@",v.author]}):null,e.jsx("span",{children:st(v.updatedAt,s?.generatedAt??Date.now())})]})]},v.id))]},l.key))}):e.jsx("div",{className:"rw-open-prs-empty",children:t??"No open pull requests returned."}),S?e.jsx(ms,{pr:S,agents:p,projects:j,pending:P,error:x,onClose:O,onPendingChange:f,onError:C,onAssigned:l=>{A(null),C(null),R(l.message),(l.flightId||l.conversationId||l.targetAgentId)&&h({view:"follow",...l.flightId?{flightId:l.flightId}:{},...l.conversationId?{conversationId:l.conversationId}:{},...l.targetAgentId?{targetAgentId:l.targetAgentId}:{}})}}):null]})}function rn({navigate:s,focusRoot:n=null}){const[t,r]=u.useState(null),[a,i]=u.useState("loading"),[o,c]=u.useState(null),h=u.useRef(!1),p=u.useRef(0),d=u.useRef(null),m=u.useRef(!1),[b,S]=ke(zs,Ne,"warm"),[A,P]=ke(Gs,Se,"table"),[f,x]=u.useState(null),[C,I]=u.useState("standard"),[R,O]=u.useState(!1),[j,y]=u.useState(null),[N,$]=u.useState(!1),[T,D]=u.useState(!1),[W,F]=u.useState(null),[M,l]=u.useState(null),[v,L]=u.useState(!1),[De,Z]=u.useState(null),[B,K]=u.useState(null),q=u.useCallback(async(g={})=>{if(m.current&&!g.force)return;m.current=!0;const k=g.depth??C;g.scanMore&&$(!0),g.force&&!g.scanMore&&O(!0);try{let E=await he(k,g.force??!1,k==="expanded"?Ks:Us),_=k;if(!h.current&&k==="standard"&&!g.force&&E.projects.length===0)try{const ue=await he("expanded",!0,Vs);ue.projects.length>0&&(E=ue,_="expanded")}catch{}const de=d.current;if(de&&Ys(E)&&(E.projects.length===0||Js(E,de))){c("Scan budget was reached; keeping the last fuller Repo Watch snapshot."),i("ready");return}if(!g.force&&E.projects.length===0&&h.current&&p.current<3){p.current+=1,i("ready");return}p.current=0,h.current=!0,d.current=E,r(E),c(null),i("ready"),(g.scanMore||_!==k)&&I(_),g.force&&!g.scanMore&&y(`Fresh ${new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}`)}catch(E){const _=Qs(E);c(_),h.current||i("error")}finally{g.scanMore&&$(!1),g.force&&!g.scanMore&&O(!1),m.current=!1}},[C]);u.useEffect(()=>{d.current=t},[t]),u.useEffect(()=>{q();const g=setInterval(()=>{q()},Hs);return()=>clearInterval(g)},[q]);const le=u.useRef(null);u.useEffect(()=>{if(!t)return;if(n&&le.current!==n){const k=t.projects.find(E=>E.root===n||E.worktrees.some(_=>_.path===n));if(!k)return;if(le.current=n,!k.worktrees.some(E=>E.id===f)){x(ye([k])?.id??null);return}}t.projects.some(k=>k.worktrees.some(E=>E.id===f))||x(ye(t.projects)?.id??null)},[t,f,n]),u.useEffect(()=>{!t||t.projects.length===0||Je(rt(t,f),void 0,{limit:Xs})},[t,f]);const ee=u.useMemo(()=>t?et(t):[],[t]),Le=ee.join("\0");u.useEffect(()=>{if(ee.length===0){l(null),Z(null),L(!1);return}let g=!1;return L(!0),Z(null),qe(ee).then(k=>{g||l(k)}).catch(k=>{g||Z(k instanceof Error?k.message:String(k))}).finally(()=>{g||L(!1)}),()=>{g=!0}},[Le]);const H=u.useMemo(()=>Zs(t,f),[t,f]),Oe=u.useMemo(()=>tt(M),[M]);u.useEffect(()=>{ze({worktree:H.worktree,project:H.project,generatedAt:t?.generatedAt??0,tone:b})},[H.worktree,H.project,t?.generatedAt,b]),u.useEffect(()=>Ge,[]);const oe=u.useCallback(()=>{q({depth:"expanded",force:!0,scanMore:!0})},[q]),ce=u.useCallback(()=>{q({force:!0})},[q]),Fe=u.useCallback(async()=>{if(!T){D(!0),F(null);try{const g=await fetch("/api/scout-services/restart-link",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({target:"broker"})});if(!g.ok)throw new Error(`Scout Services link failed (${g.status})`);const k=await g.json();if(!k.url?.startsWith("scout://services/restart/"))throw new Error("Scout Services link was not returned.");window.location.assign(k.url)}catch(g){const k=g instanceof Error?g.message:String(g);F(`${k} Run scout doctor if the menu app did not open.`)}finally{D(!1)}}},[T]);return a==="loading"?e.jsx(z,{navigate:s,children:e.jsx("div",{className:"repo-watch-scope",style:{padding:"24px"},children:e.jsx(se,{title:"Scanning repositories…",body:"Reading worktree state from the broker."})})}):a==="error"&&!t?e.jsx(z,{navigate:s,children:e.jsx("div",{className:"repo-watch-scope",style:{padding:"24px"},children:e.jsx(se,{className:"sys-state-card-error",title:"Couldn’t load Repo Watch",body:o??"The broker did not return a snapshot.",action:e.jsx("button",{type:"button",className:"s-btn",onClick:()=>{i("loading"),q()},children:"Retry"})})})}):t&&t.projects.length===0?e.jsx(z,{navigate:s,children:e.jsx("div",{className:"repo-watch-scope",style:{padding:"24px"},children:e.jsx(se,{title:"Scout Services need attention",body:e.jsx(at,{error:W}),action:e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"s-btn s-btn-primary",onClick:()=>{Fe()},disabled:T,children:T?"Opening…":"Restart broker"}),e.jsx("button",{type:"button",className:"s-btn",onClick:ce,disabled:R||N,children:R?"Scanning…":"Scan again"}),e.jsx("button",{type:"button",className:"s-btn",onClick:oe,disabled:R||N,children:N?"Scanning…":"Scan more"})]})})})}):t?e.jsx(z,{navigate:s,children:e.jsxs("div",{className:"repo-watch-scope",children:[e.jsx("div",{className:"rw-scope tone-"+b,children:e.jsxs("div",{className:"rw-page-shell",children:[e.jsxs("div",{className:"rw-toolbar",children:[e.jsxs("button",{type:"button",className:"rw-refresh-main",onClick:ce,disabled:R||N,children:[e.jsx(Ze,{size:14,"aria-hidden":"true",className:R?"rw-refresh-spin":void 0}),e.jsx("span",{children:R?"Scanning":"Refresh"})]}),j?e.jsx("span",{className:"rw-refresh-receipt",children:j}):null,e.jsxs("details",{className:"rw-display-menu",children:[e.jsxs("summary",{"aria-label":"Display options",children:[e.jsx(es,{size:14,"aria-hidden":"true"}),e.jsx("span",{children:"Display"})]}),e.jsxs("div",{className:"rw-display-panel",children:[e.jsxs("div",{className:"rw-display-row",children:[e.jsx("span",{className:"rw-display-label",children:"View"}),e.jsx("div",{className:"rw-tone",role:"group","aria-label":"View",children:Se.map(g=>e.jsx("button",{type:"button",className:g===A?"on":"","aria-pressed":g===A,onClick:()=>P(g),children:g},g))})]}),e.jsxs("div",{className:"rw-display-row",children:[e.jsx("span",{className:"rw-display-label",children:"Tone"}),e.jsx("div",{className:"rw-tone",role:"group","aria-label":"Console tone",children:Ne.map(g=>e.jsx("button",{type:"button",className:g===b?"on":"","aria-pressed":g===b,onClick:()=>S(g),children:g},g))})]})]})]})]}),e.jsx("div",{className:"min-w-0",children:A==="drift"?e.jsx(Ds,{snapshot:t,selectedId:f,onSelect:x}):e.jsxs(e.Fragment,{children:[e.jsx(Ss,{snapshot:t,selectedId:f,onSelect:x,onViewDiff:K,scanDepth:C,scanMorePending:N,onScanMore:oe,openPullRequestCount:M?.pullRequests.length??null,openPullRequestTitle:Oe}),e.jsx(it,{snapshot:M,loading:v,error:De,selectedProject:H.project,selectedWorktree:H.worktree,repoSnapshot:t,onSelectWorktree:x,onOpenDiff:K,navigate:s})]})})]})}),e.jsx(Xe,{open:B!=null,onClose:()=>K(null),side:"right",owner:"openscout.repos-diff-viewer",resizable:!0,defaultSize:840,maxSize:1280,minSize:420,ariaLabel:"Worktree diff",children:B!=null?e.jsx(Ye,{path:B,onClose:()=>K(null),onOpenAsPage:()=>{B&&(s({view:"repo-diff",path:B}),K(null))}},B):null})]})}):e.jsx(z,{navigate:s})}export{rn as ReposScreen,rn as default};
@@ -1 +0,0 @@
1
- import{r as d,j as t}from"./index-BZovGpDk.js";import{a as Xt,f as fs,g as xs,b as gs,p as vs,c as ks,i as bs}from"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";const Ae=1,rt="scout:surface-push";class js{constructor(n,s,a=Ss()){this.surface=n,this.currentScope=s,this.handler=a}surface;currentScope;handler;bootstrap(){return this.request("bootstrap",{})}agents={list:n=>this.request("agents.list",{},n),observe:(n,s)=>this.request("agents.observe",{agentIds:s},n)};tail={recent:(n,s)=>this.request("tail.recent",{...s?{cursor:s}:{}},n),subscribe:(n,s)=>{const a=Qt("tail.delta",s);return this.request("tail.subscribe",{},n).catch(()=>a()),a}};codex={startSession:n=>this.request("codex.session.start",{route:n}),snapshot:n=>this.request("codex.thread.snapshot",{route:n}),connect:n=>this.request("codex.thread.connect",{route:n}),start:(n,s)=>this.request("codex.turn.start",{route:n,text:s}),steer:(n,s)=>this.request("codex.turn.steer",{route:n,text:s}),interrupt:n=>this.request("codex.turn.interrupt",{route:n})};dispatch={diagnostics:(n,s)=>this.request("dispatch.diagnostics",{...s?{cursor:s}:{}},n),ask:n=>this.request("dispatch.ask",n),review:n=>this.request("dispatch.review",n),subscribe:(n,s)=>{const a=Qt("dispatch.delta",s);return this.request("dispatch.subscribe",{},n).catch(()=>a()),a}};native={setLaneSelection:async n=>{await this.request("native.setLaneSelection",{selection:n})},openExternalURL:async n=>{await this.request("native.openExternalURL",{url:n})},getPreferences:n=>this.request("native.getPreferences",{keys:n}),setPreferences:async n=>{await this.request("native.setPreferences",n)},cancel:async n=>{await this.request("native.cancel",{requestId:n})},voice:{snapshot:()=>this.request("native.voice.snapshot",{}),toggleInput:()=>this.request("native.voice.toggleInput",{}),speak:n=>this.request("native.voice.speak",{text:n}),stopOutput:()=>this.request("native.voice.stopOutput",{})}};selectedScope(){return this.currentScope()}async request(n,s,a){const r=ys(),l={v:Ae,id:r,surface:this.surface,method:n,params:s,...a?{hostIds:a.hostIds}:{}},u=await this.handler.postMessage(l);if(u.v!==Ae||u.id!==r||u.method!==n)throw new Error("Scout native surface returned a mismatched reply");if("error"in u)throw new Error(`${u.error.code}: ${u.error.message}`);return u.result}}function Ss(){const e=window.webkit?.messageHandlers?.scoutSurface;if(!e)throw new Error("Scout native surface bridge is unavailable");return e}function ys(){return globalThis.crypto?.randomUUID?.()??`surface-${Date.now()}-${Math.random().toString(16).slice(2)}`}function Qt(e,n){const s=a=>{const r=a.detail;r?.stream!==e||!("payload"in r)||n({hostId:r.hostId,cursor:{epoch:r.epoch,sequence:r.sequence,connectionRevision:r.connectionRevision},...e==="tail.delta"?{events:r.payload.events}:{records:r.payload.records}})};return window.addEventListener(rt,s),()=>window.removeEventListener(rt,s)}function _s(){window.__scoutSurface={onPush(e){window.dispatchEvent(new CustomEvent(rt,{detail:e}))}}}const ms="/api/surfaces/deck",ln="scout.surface.preferences.v1";function ws(e,n){return window.webkit?.messageHandlers?.scoutSurface?new js(e,n):new Ns(e,n)}class Ns{constructor(n,s,a=ms){this.surface=n,this.currentScope=s,this.endpoint=a}surface;currentScope;endpoint;pending=new Map;voice=new Is;async bootstrap(){const n=await this.request("bootstrap",{});if(!this.voice.inputAvailable)return n;const s=new Set(n.capabilities);return s.add("native.voice.snapshot"),s.add("native.voice.toggleInput"),this.voice.outputAvailable&&(s.add("native.voice.speak"),s.add("native.voice.stopOutput")),{...n,capabilities:[...s],device:{platform:"web",formFactor:Cs()}}}agents={list:n=>this.request("agents.list",{},n),observe:(n,s)=>this.request("agents.observe",{agentIds:s},n)};tail={recent:(n,s)=>this.request("tail.recent",{...s?{cursor:s}:{}},n),subscribe:(n,s)=>{let a=new Set;const r=async()=>{try{const u=await this.tail.recent(n);for(const p of u.hosts){if(!p.ready)continue;const k=p.value.events.filter(y=>!a.has(y.id));a=new Set(p.value.events.map(y=>y.id)),k.length>0&&s({hostId:p.hostId,cursor:p.value.cursor,events:k})}}catch{}};r();const l=window.setInterval(()=>{r()},2e3);return()=>{window.clearInterval(l)}}};codex={startSession:n=>this.request("codex.session.start",{route:n}),snapshot:n=>this.request("codex.thread.snapshot",{route:n}),connect:n=>this.request("codex.thread.connect",{route:n}),start:(n,s)=>this.request("codex.turn.start",{route:n,text:s}),steer:(n,s)=>this.request("codex.turn.steer",{route:n,text:s}),interrupt:n=>this.request("codex.turn.interrupt",{route:n})};dispatch={diagnostics:()=>Promise.reject(new Error("Dispatch is unavailable on the Deck surface.")),ask:n=>Promise.reject(new Error("Dispatch is unavailable on the Deck surface.")),review:n=>Promise.reject(new Error("Dispatch is unavailable on the Deck surface.")),subscribe:(n,s)=>()=>{}};native={setLaneSelection:async n=>{await this.request("native.setLaneSelection",{selection:n})},openExternalURL:async n=>{const s=new URL(n);if(s.protocol!=="https:")throw new Error("Only https URLs can be opened from the Deck.");window.open(s,"_blank","noopener,noreferrer")},getPreferences:async n=>({entries:Zt().filter(a=>n.includes(a.key))}),setPreferences:async n=>{const s=new Map(Zt().map(a=>[a.key,a]));for(const a of n.entries)s.set(a.key,a);localStorage.setItem(ln,JSON.stringify([...s.values()]))},cancel:async n=>{this.pending.get(n)?.abort(),this.pending.delete(n)},voice:{snapshot:()=>Promise.resolve(this.voice.snapshot()),toggleInput:()=>this.voice.toggleInput(),speak:n=>this.voice.speak(n),stopOutput:()=>this.voice.stopOutput()}};selectedScope(){return this.currentScope()}async request(n,s,a){if(this.surface!=="deck")throw new Error("The web surface transport currently supports Scout Deck only.");const r=Ts(),l=new AbortController;this.pending.set(r,l);const u={v:Ae,id:r,surface:this.surface,method:n,params:s,...a?{hostIds:a.hostIds}:{}};try{const p=await fetch(this.endpoint,{method:"POST",credentials:"same-origin",cache:"no-store",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(u),signal:l.signal});if(!p.ok){const y=await p.json().catch(()=>null);throw new Error(y?.error||`Scout Deck web bridge returned HTTP ${p.status}.`)}const k=await p.json();if(k.v!==Ae||k.id!==r||k.method!==n)throw new Error("Scout Deck web bridge returned a mismatched reply.");if("error"in k)throw new Error(`${k.error.code}: ${k.error.message}`);return k.result}finally{this.pending.delete(r)}}}class Is{live=null;inputRun=0;state={input:{state:"idle",partialText:"",finalText:"",finalCount:0,engine:"parakeet",modelReady:!0,unavailableReason:null},output:{speaking:!1}};get inputAvailable(){return typeof fetch=="function"}get outputAvailable(){return"speechSynthesis"in window&&"SpeechSynthesisUtterance"in window}snapshot(){return{input:{...this.state.input},output:{...this.state.output}}}async toggleInput(){if(this.state.input.state==="listening"){const n=this.live;if(this.state={...this.state,input:{...this.state.input,state:"transcribing"}},n)try{await n.stop()}catch(s){this.failInput(s,this.inputRun)}return this.snapshot()}if(this.state.input.state==="preparing"||this.state.input.state==="transcribing"){const n=this.live;return this.inputRun+=1,this.live=null,await n?.cancel().catch(()=>{}),this.state={...this.state,input:{...this.state.input,state:"idle",partialText:"",unavailableReason:null}},this.snapshot()}return this.stopOutput(),this.startInput(),this.snapshot()}async speak(n){const s=n.trim();if(!s||!this.outputAvailable)return this.snapshot();window.speechSynthesis.cancel();const a=new SpeechSynthesisUtterance(s);return a.onstart=()=>{this.state={...this.state,output:{speaking:!0}}},a.onend=a.onerror=()=>{this.state={...this.state,output:{speaking:!1}}},window.speechSynthesis.speak(a),this.state={...this.state,output:{speaking:!0}},this.snapshot()}async stopOutput(){return this.outputAvailable&&window.speechSynthesis.cancel(),this.state={...this.state,output:{speaking:!1}},this.snapshot()}async startInput(){const n=++this.inputRun;this.state={...this.state,input:{...this.state.input,state:"preparing",partialText:"",unavailableReason:null}};try{let s=await Xt({surface:"scout-deck",requestPermissions:!0});if(n!==this.inputRun)return;if(!s.ready&&s.issue?.code==="microphone_not_requested"){if(await Es(1800),n!==this.inputRun)return;s=await Xt({surface:"scout-deck"})}if(!(s.ready||s.issue?.code==="microphone_not_requested")){this.state={...this.state,input:{...this.state.input,state:"unavailable",engine:s.settings.preference==="apple"?"apple":"parakeet",modelReady:!!s.settings.modelReady,unavailableReason:fs(s.issue)}};return}const r=xs();if(await r.probe({force:!0}).catch(()=>!1),n!==this.inputRun)return;const l=await r.startLive({onState:u=>this.applyInputState(u,n),onPartial:u=>{n===this.inputRun&&(this.state={...this.state,input:{...this.state.input,partialText:u}})}},{surface:"scout-deck"});if(n!==this.inputRun){await l.cancel().catch(()=>{});return}this.live=l,this.state={...this.state,input:{...this.state.input,state:"listening",engine:s.settings.preference==="apple"?"apple":"parakeet",modelReady:!!s.settings.modelReady,unavailableReason:null}},l.result.then(u=>this.finishInput(u.text,n)).catch(u=>this.failInput(u,n))}catch(s){this.failInput(s,n)}}applyInputState(n,s){if(s!==this.inputRun)return;const a=n==="recording"?"listening":n==="processing"||n==="done"?"transcribing":n==="cancelled"?"idle":n==="error"?"unavailable":"preparing";this.state={...this.state,input:{...this.state.input,state:a}}}finishInput(n,s){if(s!==this.inputRun)return;this.live=null;const a=n.trim();this.state={...this.state,input:{...this.state.input,state:a?"idle":"unavailable",partialText:"",finalText:a||this.state.input.finalText,finalCount:a?this.state.input.finalCount+1:this.state.input.finalCount,unavailableReason:a?null:"No speech was detected. Tap to try again."}}}failInput(n,s){if(s!==this.inputRun)return;this.live=null;const a=n instanceof Error?n.message:String(n),r=n instanceof Error&&n.name==="AbortError";this.state={...this.state,input:{...this.state.input,state:r?"idle":"unavailable",partialText:"",unavailableReason:r?null:a}}}}function Zt(){try{const e=JSON.parse(localStorage.getItem(ln)??"[]");return Array.isArray(e)?e:[]}catch{return[]}}function Cs(){const e=Math.min(window.screen.width,window.screen.height);return/iPad/i.test(navigator.userAgent)?"ipad":/Mobi|iPhone|Android/i.test(navigator.userAgent)&&e<700?"phone":e<1100?"tablet":"desktop"}function Es(e){return new Promise(n=>window.setTimeout(n,e))}function Ts(){return globalThis.crypto?.randomUUID?.()??`surface-${Date.now()}-${Math.random().toString(16).slice(2)}`}function st(e,n){const s=e.find(a=>a.key===n);return s?[s,...e.filter(a=>a.key!==n)]:[...e]}async function As(e,n){const s=e.filter(l=>l.transport==="codex_app_server"),r=(await Promise.allSettled(s.map(async l=>({lane:l,snapshot:await n({hostId:l.hostId,agentId:l.id})})))).flatMap(l=>l.status==="fulfilled"?[l.value]:[]);return r.find(({snapshot:l})=>l.state==="running")?.lane.key??r.find(({snapshot:l})=>l.state==="idle")?.lane.key??null}const dn=["ops","yoke","console","brief"],ct={ops:{label:"Ops",tagline:"Agent operations · routed control"},yoke:{label:"Yoke",tagline:"Two-grip cockpit · thumb-anchored"},console:{label:"Console",tagline:"Fleet board · one command bar"},brief:{label:"Brief",tagline:"Single column · command palette"}},Rs=9e3,en="scout.deck.hostScope",ce="scout.deck.lane.v1",un="scout.deck.treatment.v2",tn="scout.deck.autoSend",nn="scout.deck.voiceOut",at="scout.deck.voiceModel",Ee="scout.deck.voiceId",sn="scout.deck.voiceSpeed",ne="gpt-4o-mini-tts",ot="alloy",Os=1,an=44,Ls=160,Ds=[{id:"air",name:"MacBook Air",state:"connected"},{id:"studio",name:"Studio",state:"connected"}],se=Date.now(),Se=[Te("air","MacBook Air","01","OpenScout","codex","gpt-5.6","active","~/dev/openscout",[["tool","Verifying the native surface bundle","bun run build:native-surfaces"],["think","Mapping Deck to Scout's Codex session","Session state stays binary-native and host-scoped."],["message","Controller contract is live.","Start, steer, and interrupt map directly to the selected thread."]]),Te("studio","Studio","02","SpeakEasy","claude","opus-5","active","~/dev/SpeakEasy",[["message","Control deck reference review","Channel bank, focused stage, and restrained signal color."],["tool","Captured iPad landscape states","Connected, partial, and offline."],["think","Keep harness semantics explicit","A future Claude adapter can earn its own control vocabulary."]]),Te("air","MacBook Air","03","Hudson","claude","sonnet-5","waiting","~/dev/hudson",[["message","Waiting for operator review","One navigation decision needs attention."],["note","Candidate build is ready","No active tool call."]]),Te("studio","Studio","04","Release","codex","gpt-5.4","idle","~/dev/openscout",[["system","Last run completed","Checks passed 18 minutes ago."]])],ae={adapter:"codex_app_server",agentId:"01",threadId:"019fa45a-scout-deck",turnId:"turn_8d17",state:"running",capabilities:{connect:!0,start:!0,steer:!0,interrupt:!0,queue:!1,approvals:!1},capabilityNotes:{queue:"A Scout-managed Codex session runs one active turn at a time; Deck does not invent a client-side queue.",approvals:"Approval prompts remain runtime-owned and are not actionable from Deck yet."},snapshot:{session:{id:"019fa45a-scout-deck",name:"Rework the Deck turn flow",adapterType:"codex",status:"active",cwd:"/Users/example/dev/openscout",model:"gpt-5.6",providerMeta:{threadId:"019fa45a-scout-deck"}},currentTurnId:"turn_8d17",turns:[{id:"turn_8d11",status:"completed",startedAt:se-214e3,endedAt:se-176e3,isUserTurn:!0,blocks:[{status:"completed",block:{id:"input_8d11",turnId:"turn_8d11",type:"text",status:"completed",index:0,text:"Make Deck operate on the selected Scout-managed Codex session directly."}}]},{id:"turn_8d15",status:"completed",startedAt:se-164e3,endedAt:se-71e3,isUserTurn:!1,blocks:[{status:"completed",block:{id:"reason_8d15",turnId:"turn_8d15",type:"reasoning",status:"completed",index:0,text:"Tracing the trusted bridge to Scout's broker-managed Codex session."}},{status:"completed",block:{id:"tool_8d15",turnId:"turn_8d15",type:"action",status:"completed",index:1,action:{kind:"command",status:"completed",command:"bun run build:native-surfaces",output:"native surfaces validated"}}},{status:"completed",block:{id:"text_8d15",turnId:"turn_8d15",type:"text",status:"completed",index:2,text:"The control path is separated from Scout messaging and keeps Codex semantics visible."}}]},{id:"turn_8d17",status:"streaming",startedAt:se-43e3,isUserTurn:!1,blocks:[{status:"streaming",block:{id:"reason_8d17",turnId:"turn_8d17",type:"reasoning",status:"streaming",index:0,text:"Refining the controller hierarchy for iPad landscape."}},{status:"streaming",block:{id:"tool_8d17",turnId:"turn_8d17",type:"action",status:"streaming",index:1,action:{kind:"command",status:"running",command:"bun test scout-surface-contract",output:"running focused contract checks…"}}}]}]}},it={input:{state:"idle",partialText:"",finalText:"",finalCount:0,engine:"parakeet",modelReady:!0,unavailableReason:null},output:{speaking:!1}},Ms={defaultModelId:ne,defaultVoiceId:ot,source:"vox",models:[{id:ne,name:"GPT-4o mini TTS",provider:"openai",available:!0},{id:"eleven_multilingual_v2",name:"Eleven Multilingual v2",provider:"elevenlabs",available:!0}],voices:[{id:"alloy",name:"Alloy",provider:"openai",modelId:ne,available:!0,isDefault:!0},{id:"coral",name:"Coral",provider:"openai",modelId:ne,available:!0,isDefault:!1},{id:"fable",name:"Fable",provider:"openai",modelId:ne,available:!0,isDefault:!1},{id:"nova",name:"Nova",provider:"openai",modelId:ne,available:!0,isDefault:!1},{id:"9BWtsMINqrJLrRacOk9x",name:"Aria",provider:"elevenlabs",modelId:"eleven_multilingual_v2",available:!0,isDefault:!0}]};function $s(e){const n=e.get("treatment");if(rn(n))return n;const s=localStorage.getItem(un);return rn(s)?s:"ops"}function rn(e){return e!=null&&dn.includes(e)}function Ps(e){const n=Number(e.get("lane"));return Number.isInteger(n)?Math.min(Math.max(n-1,0),Se.length-1):0}function Vs(){const e=new URLSearchParams(window.location.search),n=e.get("preview")==="1",s=e.get("agent")?.trim()||null,a=n&&e.get("voice")==="listening"?{...it,input:{...it.input,state:"listening",partialText:"Make voice the fastest path into this active turn."}}:it,[r,l]=d.useState(()=>window.__scoutSurfaceBootstrap??null),[u,p]=d.useState(()=>$s(e)),[k,y]=d.useState(n?Se:[]),[m,U]=d.useState("all"),[E,f]=d.useState(n?Se[Ps(e)]?.key??Se[0]?.key??null:localStorage.getItem(ce)),[c,g]=d.useState(n?"ready":"waiting"),[J,Ue]=d.useState(null),[w,R]=d.useState(n?ae:null),[H,K]=d.useState(!1),[_t,T]=d.useState(null),[he,mn]=d.useState(null),[fe,xe]=d.useState(""),[wn,O]=d.useState(null),[X,V]=d.useState(null),[mt,He]=d.useState(()=>Date.now()),[Nn,Ke]=d.useState("thread"),[S,A]=d.useState(a),[wt,In]=d.useState(n),[_e,Cn]=d.useState(()=>localStorage.getItem(nn)!=="off"),[En,Nt]=d.useState(n?Ms:null),[Q,It]=d.useState(()=>localStorage.getItem(at)||ne),[me,Fe]=d.useState(()=>localStorage.getItem(Ee)||ot),[We,Tn]=d.useState(()=>{const i=Number(localStorage.getItem(sn));return Number.isFinite(i)&&i>=.5&&i<=2?i:Os}),[Ct,Z]=d.useState("idle"),[An,Rn]=d.useState(null),[Ge,On]=d.useState(()=>localStorage.getItem(tn)!=="off"),[Ln,M]=d.useState(null),[Dn,Et]=d.useState(n&&e.get("audio")==="open"),[Mn,Tt]=d.useState(()=>Array.from({length:an},()=>0)),_=d.useRef(null),At=d.useRef(s),F=d.useRef(E),Ye=d.useRef(!1),Rt=d.useRef(!1),we=d.useRef(n?0:null),ie=d.useRef(null),I=d.useRef(null),B=d.useRef(null),Ot=d.useRef(null),re=d.useRef(!1),ze=d.useRef(null),Lt=d.useRef(async()=>{}),Je=d.useRef(S);Je.current=S,F.current=E;const ge=i=>{Ot.current=i,mn(i)};d.useEffect(()=>{if(_s(),n)return;const i=ws("deck",()=>({hostIds:window.__scoutSurfaceBootstrap?.selectedHostIds??[]}));_.current=i;let o=!1,h=null,j=!1;return i.bootstrap().then(async x=>{if(o)return;window.__scoutSurfaceBootstrap=x,l(x);const b=x.selectedHostIds;if(b.length===0){g("offline"),y([]);return}const te=new Set(x.hosts.filter(P=>P.state==="connected").map(P=>P.id)),Ce=localStorage.getItem(en),us=Ce==="all"||Ce&&te.has(Ce)?Ce:x.focusedHostId&&te.has(x.focusedHostId)?x.focusedHostId:b[0]??"all";U(us);const Gt={hostIds:b},Yt=async()=>{if(!j){j=!0;try{const[P,zt]=await Promise.all([i.agents.list(Gt),i.tail.recent(Gt)]);if(o)return;const W=Bs(x.hosts,P,zt),nt=Ot.current,ke=nt?.receipt?W.find(D=>D.hostId===nt.receipt?.hostId&&D.id===nt.receipt?.agentId):null;if(ke){const D=st(W,ke.key);y(D),f(ke.key),F.current=ke.key,Ye.current=!0,localStorage.setItem(ce,ke.key),Ke("thread"),ge(null)}else{const D=At.current;At.current=null;const Jt=(D?W.find(q=>q.id===D):null)?.key??F.current??localStorage.getItem(ce),be=Jt?W.find(q=>q.key===Jt):null;if(be){const q=st(W,be.key);y(q),f(be.key),F.current=be.key,localStorage.setItem(ce,be.key)}else y(W),f(null),F.current=null,Rt.current||(Rt.current=!0,As(W,q=>i.codex.connect(q)).then(q=>{if(o||Ye.current)return;const je=q??W[0]?.key??null;je&&(y(hs=>st(hs,je)),f(je),F.current=je,localStorage.setItem(ce,je))}))}const ps=P.hosts.filter(D=>!D.ready).length+zt.hosts.filter(D=>!D.ready).length;Ue(null),g(ps>0?"partial":"ready")}catch(P){if(o)return;Ue(P instanceof Error?P.message:String(P)),g("partial")}finally{j=!1}}};await Yt(),o||(h=setInterval(()=>{Yt()},3e3))}).catch(x=>{o||(Ue(x instanceof Error?x.message:String(x)),g("error"))}),()=>{o=!0,h&&clearInterval(h),_.current=null}},[n]);const $n=n?Ds:r?.hosts??[],$=m==="all"?k:k.filter(i=>i.hostId===m),v=$.find(i=>i.key===E)??null,Xe=v?$.indexOf(v):-1,C=v?{hostId:v.hostId,agentId:v.id}:null,L=!!(v?.transport==="codex_app_server"&&(n||r?.capabilities?.includes("codex.thread.snapshot"))),ve=n||!!r?.capabilities?.includes("native.voice.snapshot"),ee=n||r?.device?.platform==="web",Pn=ee||!!r?.capabilities?.includes("native.voice.speak");d.useEffect(()=>{if(!ee||n)return;let i=!1;return gs(Q).then(o=>{if(i)return;if(Nt(o),!o.models.find(b=>b.id===Q)?.available){const b=o.models.find(te=>te.id===o.defaultModelId&&te.available)??o.models.find(te=>te.available);if(b&&b.id!==Q){It(b.id),localStorage.setItem(at,b.id);return}}if(o.voices.find(b=>b.id===me&&b.available))return;const x=o.voices.find(b=>b.isDefault&&b.available)??o.voices.find(b=>b.available);x&&(Fe(x.id),localStorage.setItem(Ee,x.id))}).catch(o=>{i||M(o instanceof Error?o.message:String(o))}),()=>{i=!0}},[ee,n,Q]),d.useEffect(()=>{if(!v){R(null);return}if(xe(""),T(null),O(null),V(null),re.current=!1,Ke(v.transport==="codex_app_server"?"thread":"signal"),ie.current=null,n){R(cn(v));return}const i=_.current;if(!i)return;R(null);let o=!1,h=null;return(async()=>{if(await i.native.setLaneSelection({hostId:v.hostId,agentId:v.id,...v.conversationId?{conversationId:v.conversationId}:{},...v.sessionId?{sessionId:v.sessionId}:{}}),o)return;if(!L){R(null);return}const j=async(x=!1)=>{try{let b=await i.codex.snapshot({hostId:v.hostId,agentId:v.id});if(x&&b.state==="disconnected"&&(V({kind:"connecting",at:Date.now()}),b=await i.codex.connect({hostId:v.hostId,agentId:v.id})),o)return;R(b),T(null)}catch(b){if(o)return;T(b instanceof Error?b.message:String(b))}};await j(!0),o||(h=setInterval(()=>{j()},2e3))})().catch(j=>{o||T(j instanceof Error?j.message:String(j))}),()=>{o=!0,h&&clearInterval(h)}},[v?.key,L,n]),d.useEffect(()=>{if(n||!ve)return;const i=_.current;if(!i)return;let o=!1;const h=async()=>{try{const x=await i.native.voice.snapshot();o||(A(x),In(!0),M(null))}catch(x){o||M(x instanceof Error?x.message:String(x))}};h();const j=setInterval(()=>{h()},320);return()=>{o=!0,clearInterval(j)}},[n,ve]),d.useEffect(()=>{if(!wt)return;const i=S.input.finalCount;if(we.current==null){we.current=i;return}if(i<=we.current)return;we.current=i;const o=S.input.finalText.trim(),h=re.current;if(re.current=!1,!o){h&&O("Nothing was transcribed — the turn was not sent.");return}const j=Js(fe,o);xe(j),h&&Lt.current(j)},[S.input.finalCount,S.input.finalText,wt,fe]),d.useEffect(()=>{const i=Xs(w);if(i){if(ie.current==null){ie.current=i.id;return}if(ie.current!==i.id){if(!_e){ie.current=i.id;return}if(!(S.input.state==="listening"||S.input.state==="transcribing")){if(ie.current=i.id,n){A(o=>({...o,output:{speaking:!0}})),I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{A(o=>({...o,output:{speaking:!1}}))},1600);return}if(ee){Ft(i.text);return}_.current?.native.voice.speak(i.text).then(A).catch(o=>M(o instanceof Error?o.message:String(o)))}}}},[w,S.input.state,_e,n,ee,Q,me,We]),d.useEffect(()=>()=>{I.current&&clearTimeout(I.current),B.current?.abort()},[]);const Vn=d.useMemo(()=>$.filter(i=>i.state==="waiting"||i.state==="blocked"||i.state==="error"),[$]),Bn=$.filter(i=>ft(i.state)).length,qn=ta(v?.events??[]),Dt=S.input.state==="listening"||S.input.state==="transcribing";d.useEffect(()=>{if(S.input.state!=="listening"){Tt(Array.from({length:an},()=>0));return}let i=Je.current.input.partialText.length,o=.45;const h=setInterval(()=>{let j;if(n)o=Math.min(1,Math.max(.08,o+(Math.random()-.48)*.42)),j=o;else{const x=Je.current.input.partialText.length;j=Math.min(1,Math.max(0,x-i)/5),i=x}Tt(x=>[...x.slice(1),j])},Ls);return()=>clearInterval(h)},[S.input.state,n]);const Mt=X&&mt-X.at<Rs?X:null,Ne=he?.sourceKey===v?.key?he:null,Qe=!!(Ne&&!Ne.error),Un=Ne?.error??null,$t=!!Ne?.receipt,N=Hs({adapterAvailable:L,startingSession:Qe,thread:w,threadError:_t,pending:Mt}),Hn=Ks(N),Kn=Gs(w),Fn=!!(ve&&!H&&(N==="ready"||N==="running")),Wn=!!(L&&w&&w.state!=="disconnected"&&!H),Gn=!!(L&&(N==="running"||N==="stopping")),Yn=!!(L&&(N==="cold"||N==="failed")),zn=!!(L&&!H),Pt=!!(he&&!he.error),Vt=L||!v?null:Qe?$t?"Codex started; Scout is locating its lane.":"Scout is starting Codex for this workspace.":Pt?`Scout is finishing the Codex launch for ${he?.sourceName??"another workspace"}.`:v.projectRoot?c!=="ready"&&c!=="partial"?"Reconnect the Scout host to start Codex.":!n&&!r?.capabilities?.includes("codex.session.start")?"This Scout host cannot start Codex from Deck.":null:"Scout does not know this lane's workspace.",Bt=!!(!L&&v&&!Vt);d.useEffect(()=>{if(!X)return;(X.kind==="sending"?w?.state==="running":X.kind==="stopping"?w?.state==="idle":w?.state==="idle"||w?.state==="running")&&V(null)},[X,w?.state]);const qt=N==="running"||N==="sending"||N==="stopping"||N==="linking"||N==="starting"||Dt;d.useEffect(()=>{if(!qt)return;const i=setInterval(()=>He(Date.now()),1e3);return He(Date.now()),()=>clearInterval(i)},[qt]);const Jn=i=>{p(i),Et(!1),localStorage.setItem(un,i)},Ze=i=>{Ye.current=!0,F.current=i.key,f(i.key),localStorage.setItem(ce,i.key)},Xn=i=>{if($.length===0)return;const h=((Xe<0?0:Xe)+i+$.length)%$.length,j=$[h];j&&Ze(j)},Qn=i=>{U(i),f(null),localStorage.setItem(en,i)},et=async()=>{n||!C||!_.current||R(await _.current.codex.snapshot(C))},Zn=async()=>{if(!(!C||H)){if(O(null),n){R(v?cn(v):null);return}K(!0);try{await et(),T(null)}catch(i){T(i instanceof Error?i.message:String(i))}finally{K(!1)}}},Ut=async()=>{if(!(!C||H)){K(!0),T(null),O(null),V({kind:"connecting",at:Date.now()});try{n?R({...ae,agentId:C.agentId,state:"idle",turnId:null}):_.current&&R(await _.current.codex.connect(C))}catch(i){V(null),T(i instanceof Error?i.message:String(i))}finally{K(!1)}}},Ht=async()=>{if(!C||!v||Pt||!Bt)return;const i={sourceKey:v.key,sourceName:v.name,receipt:null,error:null};ge(i),O(null);try{if(n){const x=Se.find(b=>b.transport==="codex_app_server");x&&Ze(x),ge(null);return}const o=_.current,h=r?.selectedHostIds;if(!o||!h?.length)throw new Error("No connected Scout host can start Codex.");const j=await o.codex.startSession(C);ge({...i,receipt:j})}catch(o){const h=o instanceof Error?o.message:String(o);ge({...i,error:h}),F.current===i.sourceKey&&O(h)}},Ie=async i=>{const o=i.trim();if(o){if(!C||!w){O("No Codex session is connected — the transcript is still in the composer.");return}if(H){O("A turn is already being sent — the transcript is still in the composer.");return}K(!0),T(null),O(null),V({kind:"sending",at:Date.now()});try{const h=w.state==="running"?"steer":"start";n?R(qs(w,o,h)):_.current&&(h==="steer"?await _.current.codex.steer(C,o):await _.current.codex.start(C,o),await new Promise(j=>setTimeout(j,180)),await et()),xe("")}catch(h){V(null),xe(o),T(h instanceof Error?h.message:String(h))}finally{K(!1)}}};Lt.current=Ie;const es=i=>{i?.preventDefault(),Ie(fe)},ts=async()=>{if(!(!C||!w||H)){K(!0),T(null),O(null),V({kind:"stopping",at:Date.now()});try{n?R(Us(w)):_.current&&(await _.current.codex.interrupt(C),await new Promise(i=>setTimeout(i,180)),await et())}catch(i){V(null),T(i instanceof Error?i.message:String(i))}finally{K(!1)}}},Kt=async()=>{if(ve){if(M(null),O(null),S.input.state!=="listening"&&S.input.state!=="transcribing"&&(B.current?.abort(),B.current=null,Z("idle")),S.input.state==="listening"?(re.current=Ge,ze.current=null):S.input.state==="transcribing"?re.current=!1:(re.current=!1,ze.current=Date.now(),He(Date.now())),n){if(I.current&&clearTimeout(I.current),S.input.state==="listening"){const i=S.input.partialText||"Make the voice loop feel immediate and obvious.";A(o=>({...o,input:{...o.input,state:"transcribing",partialText:""},output:{speaking:!1}})),I.current=setTimeout(()=>{A(o=>({...o,input:{...o.input,state:"idle",finalText:i,finalCount:o.input.finalCount+1}}))},520)}else S.input.state==="transcribing"?A(i=>({...i,input:{...i.input,state:"idle",partialText:""}})):A(i=>({...i,input:{...i.input,state:"listening",partialText:"Make the voice loop feel immediate and obvious.",unavailableReason:null},output:{speaking:!1}}));return}try{const i=await _.current?.native.voice.toggleInput();i&&A(i)}catch(i){M(i instanceof Error?i.message:String(i))}}};async function Ft(i){B.current?.abort();const o=new AbortController;B.current=o,Z("preparing"),M(null);try{const h=await vs(i,{modelId:Q,voiceId:me,speed:We,originAppId:"openscout-deck",utteranceId:`deck-${Date.now()}`,signal:o.signal});if(o.signal.aborted)return;Rn({modelId:h.modelId,voiceId:h.voiceId}),Z("speaking"),await ks(h,{signal:o.signal})}catch(h){bs(h)||M(h instanceof Error?h.message:String(h))}finally{B.current===o&&(B.current=null,Z("idle"))}}const Wt=async()=>{if(I.current&&clearTimeout(I.current),B.current?.abort(),B.current=null,Z("idle"),A(i=>({...i,output:{speaking:!1}})),!n)try{const i=await _.current?.native.voice.stopOutput();i&&A(i)}catch(i){M(i instanceof Error?i.message:String(i))}},ns=async()=>{const i=!_e;Cn(i),localStorage.setItem(nn,i?"on":"off"),i||await Wt()},ss=i=>{if(It(i),Nt(o=>n||o?.defaultModelId===i?o:null),n){const o=i==="eleven_multilingual_v2"?"9BWtsMINqrJLrRacOk9x":ot;Fe(o),localStorage.setItem(Ee,o)}localStorage.setItem(at,i)},as=i=>{Fe(i),localStorage.setItem(Ee,i)},is=i=>{const o=Math.min(2,Math.max(.5,i));Tn(o),localStorage.setItem(sn,String(o))},rs=()=>{if(n){Z("speaking"),I.current&&clearTimeout(I.current),I.current=setTimeout(()=>Z("idle"),1400);return}if(ee){Ft("Scout voice out is ready on this Deck.");return}_.current?.native.voice.speak("Scout voice out is ready on this Deck.").then(A).catch(i=>M(i instanceof Error?i.message:String(i)))},cs=()=>{const i=!Ge;On(i),localStorage.setItem(tn,i?"on":"off")},os=i=>{i.key==="Enter"&&(i.metaKey||i.ctrlKey)&&(i.preventDefault(),Ie(fe))},tt=L?N==="cold"||N==="failed"?"connect":"talk":"start_codex",ls=()=>{if(tt==="start_codex")return void Ht();if(tt==="connect")return void Ut();Kt()},ds=Ct==="idle"?S:{...S,output:{speaking:!0}};return{preview:n,treatment:u,setTreatment:Jn,hosts:$n,hostScope:m,selectHostScope:Qn,connection:c,error:J,lanes:k,scopedLanes:$,selected:v,selectedIndex:Xe,selectLane:Ze,stepLane:Xn,attention:Vn,activeCount:Bn,laneActivity:qn,thread:w,threadBusy:H,threadError:_t,sessionBusy:Qe,sessionError:Un,sessionLaunchAccepted:$t,sessionStartUnavailableReason:Vt,notice:wn,adapterAvailable:L,voiceAvailable:ve,phase:N,phaseTone:Hn,turnStartedAt:Kn,clock:mt,livePending:Mt,listeningSince:ze.current,canTalk:Fn,canCompose:Wn,canInterrupt:Gn,canRebind:Yn,canRefresh:zn,canStartCodexSession:Bt,primaryAction:tt,onPrimary:ls,command:fe,setCommand:xe,submitTurn:Ie,onComposerSubmit:es,onComposerKeyDown:os,connectThread:Ut,startCodexSession:Ht,refreshSnapshot:Zn,interruptThread:ts,voice:ds,voiceError:Ln,voiceOutEnabled:_e,voiceOutputAvailable:Pn,cloudSpeechAvailable:ee,speechCatalog:En,speechModelId:Q,speechVoiceId:me,speechSpeed:We,speechOutputPhase:Ct,speechRoute:An,selectSpeechModel:ss,selectSpeechVoice:as,selectSpeechSpeed:is,previewSpeechVoice:rs,toggleVoiceInput:Kt,toggleVoiceOutput:ns,stopSpeaking:Wt,autoSendOnStop:Ge,toggleAutoSend:cs,inputTrace:Mn,voiceInputActive:Dt,settingsOpen:Dn,setSettingsOpen:Et,view:Nn,setView:Ke}}function Bs(e,n,s){const a=new Map(e.map(l=>[l.id,l.name])),r=new Map;for(const l of s.hosts)if(l.ready)for(const u of l.value.events){if(!u.agentId)continue;const p=`${l.hostId}:${u.agentId}`;r.set(p,[...r.get(p)??[],u])}return n.hosts.flatMap(l=>l.ready?l.value.agents.map(u=>({...u,key:`${l.hostId}:${u.id}`,hostId:l.hostId,hostName:a.get(l.hostId)??l.hostId,events:(r.get(`${l.hostId}:${u.id}`)??[]).sort((p,k)=>k.at-p.at)})):[])}function Te(e,n,s,a,r,l,u,p,k){return{key:`${e}:${s}`,hostId:e,hostName:n,id:s,name:a,handle:a.toLowerCase(),harness:r,transport:r==="codex"?"codex_app_server":"claude_stream_json",model:l,state:u,projectRoot:p,conversationId:`conversation-${s}`,sessionId:`session-${s}`,updatedAt:se-Number(s)*43e3,events:k.map(([y,m,U],E)=>({id:`${s}-${E}`,at:se-E*68e3-Number(s)*12e3,agentId:s,sessionId:`session-${s}`,kind:y,text:m,detail:U}))}}function cn(e){return e.transport!=="codex_app_server"?null:e.id==="04"?{...ae,agentId:e.id,threadId:"019fa45a-release",turnId:null,state:"idle",snapshot:ae.snapshot?{...ae.snapshot,currentTurnId:null,turns:ae.snapshot.turns.slice(0,2)}:null}:ae}function qs(e,n,s){const a=s==="steer"?e.turnId??`turn_${Date.now()}`:`turn_${Date.now()}`,r=e.snapshot;if(!r)return e;const l={id:`${s}_${Date.now()}`,turnId:a,type:s==="steer"?"reasoning":"text",status:"streaming",index:99,text:s==="steer"?`Steer received: ${n}`:n},u=s==="steer"?r.turns.map(p=>p.id===a?{...p,blocks:[...p.blocks,{status:"streaming",block:l}]}:p):[...r.turns,{id:a,status:"streaming",blocks:[{status:"streaming",block:l}],startedAt:Date.now(),isUserTurn:!0}];return{...e,state:"running",turnId:a,snapshot:{...r,currentTurnId:a,turns:u}}}function Us(e){if(!e.snapshot||!e.turnId)return{...e,state:"idle",turnId:null};const n=e.snapshot.turns.map(s=>s.id===e.turnId?{...s,status:"interrupted",endedAt:Date.now(),blocks:s.blocks.map(a=>({...a,status:"completed",block:{...a.block,status:a.block.status==="streaming"?"completed":a.block.status}}))}:s);return{...e,state:"idle",turnId:null,snapshot:{...e.snapshot,currentTurnId:null,turns:n}}}function Hs({adapterAvailable:e,startingSession:n,thread:s,threadError:a,pending:r}){return!e&&n?"starting":e?a?"failed":r?.kind==="sending"?"sending":r?.kind==="stopping"?"stopping":r?.kind==="connecting"||!s?"linking":s.state==="disconnected"?"cold":s.state==="running"?"running":"ready":"unavailable"}function Ks(e){return e==="running"||e==="sending"||e==="starting"?"live":e==="ready"?"ready":e==="cold"||e==="failed"?"attention":"quiet"}function pt(e,n){return e==="unavailable"?Y(n):e==="starting"?"Starting Codex":e==="cold"?"Session offline":e==="linking"?"Linking":e==="failed"?"Connection failed":e==="sending"?"Sending":e==="stopping"?"Stopping":e==="running"?"Turn running":"Ready"}function Fs(e,n,s,a,r,l=null){if(a)return a;if(e==="unavailable")return l??"Scout sees this lane · Codex not started";if(e==="starting")return l??"Scout is starting a Codex session for this workspace…";if(e==="failed")return s??"The host did not answer.";if(e==="cold")return"Connect restores Scout's managed Codex session.";if(e==="linking")return"Connecting to Scout's managed Codex session…";if(e==="sending")return"Waiting for Codex to accept the turn…";if(e==="stopping")return"Interrupt sent; waiting for the turn to end…";if(e==="running")return Ws(n);const u=Ys(n);return u?`Idle · last turn ended ${de(u)} ago`:"Idle · no turns yet in this session"}function Ws(e){const n=pn(e);if(!n)return"Streaming…";for(let s=n.blocks.length-1;s>=0;s-=1){const a=n.blocks[s];if(!(!a||a.status!=="streaming")){if(a.block.type==="action"){const r=a.block.action?.command??a.block.action?.toolName??a.block.action?.path;return r?`Running ${r}`:"Running an action"}if(a.block.type==="reasoning")return"Thinking";if(a.block.type==="text")return"Writing a reply"}}return"Streaming…"}function pn(e){return(e?.snapshot?.turns??[]).find(s=>s.id===e?.turnId)??null}function Gs(e){return pn(e)?.startedAt??null}function Ys(e){const n=e?.snapshot?.turns??[];for(let s=n.length-1;s>=0;s-=1){const a=n[s]?.endedAt;if(a)return a}return null}function zs(e){const{phase:n,turnStartedAt:s,livePending:a,clock:r}=e;return n==="sending"&&a?lt(r-a.at):(n==="running"||n==="stopping")&&s?lt(r-s):""}function lt(e){const n=Math.max(0,Math.floor(e/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function Js(e,n){const s=n.trim();return s?e.trim()?`${e}${/\s$/.test(e)?"":" "}${s}`:s:e}function Xs(e){const n=e?.snapshot?.turns??[];for(let s=n.length-1;s>=0;s-=1){const a=n[s];if(!(!a||a.isUserTurn||a.status!=="completed"))for(let r=a.blocks.length-1;r>=0;r-=1){const l=a.blocks[r],u=l?.block.type==="text"?Oe(l.block):"";if(l?.status==="completed"&&u)return{id:l.block.id,text:u}}}return null}function hn(e,n=9){return(e.snapshot?.turns??[]).flatMap(s=>s.blocks.map(a=>({role:s.isUserTurn?"operator":"codex",at:s.startedAt,status:a.status,block:a.block}))).filter(s=>!!Oe(s.block)).slice(-n)}function Oe(e){return e.type==="action"?e.action?.command??e.action?.toolName??e.action?.path??e.action?.agentName??"Codex action":e.text?.trim()||e.message?.trim()||""}function dt(e){return e.type!=="action"?"":e.action?.output?.trim()||(e.action?.kind?`${e.action.kind.replaceAll("_"," ")} · ${e.action.status}`:"")}function Qs(e){return e==="ready"?"Host connected":e==="partial"?"Host degraded":e==="error"?"Host unavailable":e==="offline"?"Host disconnected":"Connecting to host"}function pe(e){return e?e==="codex_app_server"?"Scout app-server":e:"transport unreported"}function Zs(e){return e?e==="codex_app_server"?"App server":e:"unreported"}function ht(e){const n=e?.snapshot?.session?.name?.trim();return n||null}function ea(e){return e==="ready"?"online":e==="partial"?"degraded":e==="error"?"error":e==="offline"?"offline":"connecting"}function le(e){return e.state==="waiting"||e.state==="blocked"||e.state==="error"?"attention":ft(e.state)?"live":"quiet"}function Y(e){return ft(e)?"Agent active":e==="waiting"||e==="blocked"?"Needs attention":e==="error"?"Agent error":e==="idle"||e==="available"?"Idle":e?e.replaceAll("_"," "):"Standing by"}function ft(e){return e==="live"||e==="working"||e==="active"||e==="running"||e==="in_flight"}function de(e){if(!e)return"—";const n=Math.max(0,Math.floor((Date.now()-e)/1e3));if(n<60)return`${n}s`;const s=Math.floor(n/60);return s<60?`${s}m`:`${Math.floor(s/60)}h`}function z(e){return e.length<=12?e:`${e.slice(0,5)}…${e.slice(-5)}`}function ta(e,n=28,s=5*6e4){const a=Date.now(),r=a-s,l=Array.from({length:n},()=>0);for(const u of e){if(u.at<r||u.at>a)continue;const p=Math.min(n-1,Math.floor((u.at-r)/s*n));l[p]+=u.kind==="message"||u.kind==="ask"?2:1}return l.map(u=>Math.min(6,u))}function na(e,n,s){return e==="start_codex"?n==="starting"?"starting":"start codex":e==="connect"?n==="failed"?"retry":"connect":s==="listening"?"send":s==="transcribing"?"…":s==="preparing"?"warming":s==="unavailable"?"voice off":n==="linking"?"linking":n==="sending"?"sending":n==="stopping"?"stopping":n==="running"?"steer":"talk"}function fn(e,n,s,a=null){return e==="start_codex"?n==="starting"?a??"Scout is starting a Codex session for this workspace":a??"Start a Scout-managed Codex session for this workspace":e==="connect"?"Reconnect Scout's managed Codex session":s==="listening"?"Stop dictation and send the turn":s==="transcribing"?"Transcribing dictation":n==="running"?"Speak to steer the active turn":"Speak to start a turn"}function sa(e){const{voice:n,voiceAvailable:s,phase:a,listeningSince:r,clock:l,sessionError:u}=e;if(!s)return"Native voice becomes available inside the Scout iPad app.";if(n.input.state==="listening"){const p=r?` · ${lt(l-r)}`:"";return`${n.input.partialText||"Listening — speak naturally."}${p}`}return n.input.state==="transcribing"?"Transcribing on device, then sending…":n.input.state==="preparing"?"Warming Parakeet; Apple Speech remains available as fallback.":n.input.state==="unavailable"?n.input.unavailableReason||"Microphone access is unavailable.":u||(a==="starting"?e.sessionLaunchAccepted?"Codex started; waiting for its Scout lane.":"Scout is starting Codex.":a==="unavailable"?e.canStartCodexSession?"Voice becomes available with the Codex session.":e.sessionStartUnavailableReason??"Codex launch is unavailable for this lane.":a==="cold"||a==="failed"?"Reconnect the Codex session before talking to it.":a==="running"?"Tap to talk, tap again to steer the running turn.":"Tap to talk, tap again to send.")}function xt(e){return e==="listening"?"listening":e==="transcribing"?"processing":e==="preparing"?"warming":e==="unavailable"?"blocked":"ready"}function xn(e,n){return e==="starting"?"Composer unlocks when the Codex lane appears.":e==="unavailable"?"Composer unlocks with a Codex session.":e==="cold"||e==="failed"?"Reconnect the Codex session to enable typing.":n==="listening"?"Speaking… the transcript sends when you tap send.":n==="transcribing"?"Finishing your transcript…":e==="running"?"Or type a redirect for this active turn…":"Or type what this session should do next…"}function gn(){return t.jsxs("svg",{className:"deck-glyph deck-glyph--mic",viewBox:"0 0 32 32","aria-hidden":"true",children:[t.jsx("rect",{x:"11",y:"4",width:"10",height:"16",rx:"5"}),t.jsx("path",{d:"M7.5 15.5v.8a8.5 8.5 0 0 0 17 0v-.8M16 24.8V29M11.5 29h9"})]})}function ue(){return t.jsx("svg",{className:"deck-glyph deck-glyph--mic",viewBox:"0 0 32 32","aria-hidden":"true",children:t.jsx("path",{d:"M13 19l6-6M11.5 14.5 9 17a4.6 4.6 0 0 0 6.5 6.5l2.5-2.5M20.5 17.5 23 15a4.6 4.6 0 0 0-6.5-6.5L14 11"})})}function gt(){return t.jsx("svg",{className:"deck-glyph",viewBox:"0 0 20 20","aria-hidden":"true",children:t.jsx("path",{d:"M3.5 8h3l4-3.2v10.4L6.5 12h-3zM13.3 7.2a4 4 0 0 1 0 5.6M15.6 5a7 7 0 0 1 0 10"})})}function Le(){return t.jsx("svg",{className:"deck-glyph",viewBox:"0 0 20 20","aria-hidden":"true",children:t.jsx("rect",{x:"5.5",y:"5.5",width:"9",height:"9",rx:"1.6"})})}function vn(){return t.jsxs("svg",{className:"deck-glyph",viewBox:"0 0 20 20","aria-hidden":"true",children:[t.jsx("path",{d:"M3 6h6M13 6h4M3 14h4M11 14h6"}),t.jsx("circle",{cx:"11",cy:"6",r:"2.1"}),t.jsx("circle",{cx:"9",cy:"14",r:"2.1"})]})}function ut(){return t.jsxs("svg",{className:"deck-glyph",viewBox:"0 0 20 20","aria-hidden":"true",children:[t.jsx("path",{d:"M16.5 8.2A6.6 6.6 0 0 0 4.6 6.4M3.5 11.8a6.6 6.6 0 0 0 11.9 1.8"}),t.jsx("path",{d:"M16.8 4.2v4h-4M3.2 15.8v-4h4"})]})}function Re({dir:e}){const n={up:180,down:0,left:90,right:-90}[e];return t.jsx("svg",{className:"deck-glyph",viewBox:"0 0 20 20","aria-hidden":"true",style:{transform:`rotate(${n}deg)`},children:t.jsx("path",{d:"M5 8l5 5 5-5"})})}function aa({model:e}){return t.jsx("div",{className:"deck-switch",role:"group","aria-label":"Controller treatment",children:dn.map(n=>t.jsxs("button",{type:"button",className:"deck-switch__key","data-active":e.treatment===n||void 0,onClick:()=>e.setTreatment(n),"aria-pressed":e.treatment===n,title:ct[n].tagline,children:[ct[n].label,n==="ops"?t.jsx("em",{children:"default"}):null]},n))})}function kn({model:e,size:n="md"}){const s=ht(e.thread),a=!!e.thread?.threadId;return e.adapterAvailable?t.jsxs("div",{className:"deck-binding","data-size":n,"data-bound":a||void 0,children:[t.jsx("span",{className:"deck-binding__label",children:"Scout Codex session"}),t.jsx("strong",{title:s??void 0,children:a?s??"Untitled session":"No session connected"}),t.jsxs("span",{className:"deck-binding__id",children:[e.thread?.threadId?`id ${z(e.thread.threadId)}`:"id —",e.thread?.turnId?` · turn ${z(e.thread.turnId)}`:""]})]}):t.jsxs("div",{className:"deck-binding","data-size":n,children:[t.jsx("span",{className:"deck-binding__label",children:"Selected workspace"}),t.jsx("strong",{children:e.selected?.name??"No lane selected"}),t.jsx("span",{className:"deck-binding__id",children:e.selected?.projectRoot??e.sessionStartUnavailableReason??`${pe(e.selected?.transport)} · view only`})]})}function De({model:e,compact:n=!1}){const s=e.selected;if(!s)return null;const a=zs(e);return t.jsxs("div",{className:"deck-phase","data-tone":e.phaseTone,"data-phase":e.phase,"data-compact":n||void 0,"aria-live":"polite","aria-atomic":"true",children:[t.jsxs("span",{className:"deck-phase__state",children:[t.jsx("i",{className:"deck-lamp"}),pt(e.phase,s.state)]}),t.jsx("span",{className:"deck-phase__detail",children:Fs(e.phase,e.thread,e.threadError,e.notice,s,e.sessionStartUnavailableReason)}),a?t.jsx("span",{className:"deck-phase__clock","data-live":e.phase==="running"||void 0,children:a}):null]})}function Me({model:e,size:n="lg"}){const s=e.primaryAction==="start_codex"?e.sessionBusy?"starting":"start":e.primaryAction==="connect"?"connect":e.voice.input.state,a=fn(e.primaryAction,e.phase,e.voice.input.state,e.sessionStartUnavailableReason),r=e.primaryAction==="start_codex"?!e.canStartCodexSession:e.primaryAction==="connect"?e.threadBusy:!e.canTalk;return t.jsxs("button",{type:"button",className:"deck-primary","data-size":n,"data-action":e.primaryAction,"data-state":s,onClick:e.onPrimary,disabled:r,"aria-label":a,"aria-pressed":e.primaryAction==="talk"?e.voice.input.state==="listening":void 0,"aria-busy":e.primaryAction==="start_codex"&&e.sessionBusy?!0:void 0,title:a,children:[e.primaryAction==="talk"?t.jsx(gn,{}):t.jsx(ue,{}),t.jsx("small",{children:na(e.primaryAction,e.phase,e.voice.input.state)})]})}function bn({model:e,block:n=!1}){return e.canInterrupt?t.jsxs("button",{type:"button",className:"deck-stop","data-block":n||void 0,onClick:e.interruptThread,disabled:e.threadBusy||e.phase==="stopping",children:[t.jsx(Le,{}),t.jsx("span",{children:e.phase==="stopping"?"Stopping":"Stop turn"})]}):null}function $e({model:e}){const n=e.voice.input.state==="listening";return t.jsxs("div",{className:"deck-trace-wrap","data-live":n||void 0,children:[t.jsx("span",{className:"deck-trace__label",title:"The surface contract reports no microphone level, so the Deck plots transcript cadence instead.",children:n?"Listening · cadence":"Input cadence"}),t.jsx("div",{className:"deck-trace","data-live":n||void 0,"aria-hidden":"true",children:e.inputTrace.map((s,a)=>t.jsx("i",{style:{"--level":s}},a))})]})}function ia({model:e}){return t.jsxs("div",{className:"deck-activity","aria-label":"Lane activity over the last five minutes",children:[t.jsx("small",{children:"5m"}),t.jsx("div",{"aria-hidden":"true",children:e.laneActivity.map((n,s)=>t.jsx("i",{style:{"--level":n}},s))}),t.jsx("small",{children:"now"})]})}function Pe({model:e}){return t.jsxs("p",{className:"deck-caption","data-active":e.voiceInputActive||void 0,"data-error":!!e.voiceError||void 0,"aria-live":"polite",children:[t.jsx("i",{"aria-hidden":"true"}),t.jsx("span",{children:e.voiceError??sa(e)})]})}function vt({model:e,rows:n=2}){return t.jsxs("form",{className:"deck-composer",onSubmit:e.onComposerSubmit,"aria-busy":e.threadBusy||void 0,children:[t.jsx("textarea",{value:e.command,onChange:s=>e.setCommand(s.target.value),onKeyDown:e.onComposerKeyDown,placeholder:xn(e.phase,e.voice.input.state),disabled:!e.canCompose,rows:n,"aria-label":e.phase==="running"?"Steer the active Codex turn":"Start a Codex turn"}),t.jsxs("button",{type:"submit",className:"deck-send",disabled:!e.canCompose||!e.command.trim(),children:[e.phase==="running"?"Steer":"Send",t.jsx("em",{children:"⌘↵"})]})]})}function ye(e,n){return`${e} — ${n}`}function kt({model:e,label:n=!0}){const s=e.voice.output.speaking?"Speaking":e.voiceOutEnabled?"Voice out":"Muted",a=e.voiceOutputAvailable?e.voice.output.speaking?"spoken replies are on and playing now":e.voiceOutEnabled?"spoken replies are on":"spoken replies are off":"spoken replies unavailable on this host";return t.jsxs("button",{type:"button",className:Ve("deck-chip deck-chip--voice",n),"data-active":e.voiceOutEnabled||void 0,"data-speaking":e.voice.output.speaking||void 0,onClick:e.toggleVoiceOutput,disabled:!e.voiceOutputAvailable,"aria-pressed":e.voiceOutEnabled,"aria-label":ye(s,a),title:ye(s,a),children:[t.jsx(gt,{}),n?t.jsx("span",{children:s}):null]})}function jn({model:e,label:n=!0}){const s=ye("Audio",e.settingsOpen?"dictation and playback settings, open":"dictation and playback settings");return t.jsxs("button",{type:"button",className:Ve("deck-chip",n),"data-active":e.settingsOpen||void 0,onClick:()=>e.setSettingsOpen(!e.settingsOpen),"aria-expanded":e.settingsOpen,"aria-label":s,title:s,children:[t.jsx(vn,{}),n?t.jsx("span",{children:"Audio"}):null]})}function Sn({model:e,label:n=!0}){const s=ye("Re-read",e.canRefresh?"pull the connected session snapshot from the host again":"unavailable until a session is connected");return t.jsxs("button",{type:"button",className:Ve("deck-chip",n),onClick:e.refreshSnapshot,disabled:!e.canRefresh,"aria-label":s,title:s,children:[t.jsx(ut,{}),n?t.jsx("span",{children:"Re-read"}):null]})}function yn({model:e,label:n=!0}){if(!e.canRebind)return null;const s=e.phase==="failed"?"Retry link":"Reconnect",a=ye(s,e.phase==="failed"?"the last connection failed; reconnect Scout's managed Codex session":"connect Scout's managed Codex session");return t.jsxs("button",{type:"button",className:Ve("deck-chip deck-chip--warn",n),onClick:e.connectThread,disabled:e.threadBusy,"aria-label":a,title:a,children:[t.jsx(ue,{}),n?t.jsx("span",{children:s}):null]})}function Ve(e,n){return n?e:`${e} deck-chip--icon`}function Be({model:e}){if(!e.settingsOpen)return null;const n=e.speechCatalog?.models.find(r=>r.id===e.speechModelId),s=e.speechCatalog?.voices.find(r=>r.id===e.speechVoiceId&&r.modelId===e.speechModelId),a=e.speechOutputPhase==="preparing"?"Synthesizing through Scout…":e.voice.output.speaking?"A reply is being spoken now.":"Ready for the next completed reply.";return t.jsxs("div",{className:"deck-sheet",role:"dialog","aria-label":"Audio and dictation settings",children:[t.jsxs("header",{children:[t.jsx("strong",{children:"Audio & dictation"}),t.jsx("button",{type:"button",className:"deck-chip",onClick:()=>e.setSettingsOpen(!1),children:"Close"})]}),t.jsxs("div",{className:"deck-sheet__row",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Spoken replies"}),t.jsx("small",{children:"Speak each completed Codex reply aloud."})]}),t.jsxs("button",{type:"button",className:"deck-toggle","data-on":e.voiceOutEnabled||void 0,onClick:e.toggleVoiceOutput,disabled:!e.voiceOutputAvailable,"aria-pressed":e.voiceOutEnabled,children:[t.jsx("i",{}),e.voiceOutEnabled?"On":"Off"]})]}),t.jsxs("div",{className:"deck-sheet__voice-grid","aria-label":"Scout speech provider and voice",children:[t.jsxs("label",{children:[t.jsx("span",{children:"Provider & model"}),t.jsx("select",{className:"deck-sheet__select",value:e.speechModelId,onChange:r=>e.selectSpeechModel(r.currentTarget.value),disabled:!e.cloudSpeechAvailable||!e.speechCatalog,children:e.speechCatalog?.models.filter(r=>ra(r.provider)).map(r=>t.jsxs("option",{value:r.id,disabled:!r.available,children:[on(r.provider)," · ",r.name,r.available?"":" · unavailable"]},r.id))??t.jsx("option",{children:e.speechCatalog?"No API models":"Loading Scout voices…"})})]}),t.jsxs("label",{children:[t.jsx("span",{children:"Voice"}),t.jsx("select",{className:"deck-sheet__select",value:e.speechVoiceId,onChange:r=>e.selectSpeechVoice(r.currentTarget.value),disabled:!e.cloudSpeechAvailable||!e.speechCatalog||e.speechCatalog.voices.length===0,children:e.speechCatalog?.voices.filter(r=>r.modelId===e.speechModelId&&r.available).map(r=>t.jsxs("option",{value:r.id,children:[r.name,r.language?` · ${r.language}`:""]},r.id))??t.jsx("option",{children:"Loading…"})})]})]}),t.jsxs("div",{className:"deck-sheet__pace",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Speaking pace"}),t.jsx("small",{children:"Applied by the selected Scout TTS provider."})]}),t.jsx("div",{className:"deck-segment",role:"group","aria-label":"Speaking pace",children:[[.85,"Calm"],[1,"Natural"],[1.15,"Brisk"]].map(([r,l])=>t.jsx("button",{type:"button","data-active":e.speechSpeed===r||void 0,"aria-pressed":e.speechSpeed===r,onClick:()=>e.selectSpeechSpeed(r),disabled:!e.cloudSpeechAvailable,children:l},l))})]}),t.jsxs("div",{className:"deck-sheet__row",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Stopping dictation sends"}),t.jsx("small",{children:"Off keeps the transcript in the composer for editing."})]}),t.jsxs("button",{type:"button",className:"deck-toggle","data-on":e.autoSendOnStop||void 0,onClick:e.toggleAutoSend,"aria-pressed":e.autoSendOnStop,children:[t.jsx("i",{}),e.autoSendOnStop?"On":"Off"]})]}),t.jsxs("div",{className:"deck-sheet__row",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Playback"}),t.jsx("small",{children:a})]}),t.jsxs("div",{className:"deck-sheet__playback",children:[t.jsxs("button",{type:"button",className:"deck-chip",onClick:e.previewSpeechVoice,disabled:!e.voiceOutputAvailable||e.speechOutputPhase!=="idle",children:[t.jsx(gt,{}),t.jsx("span",{children:"Hear voice"})]}),t.jsxs("button",{type:"button",className:"deck-chip deck-chip--warn",onClick:e.stopSpeaking,disabled:!e.voice.output.speaking,children:[t.jsx(Le,{}),t.jsx("span",{children:"Stop"})]})]})]}),t.jsxs("dl",{className:"deck-sheet__facts",children:[t.jsxs("div",{children:[t.jsx("dt",{children:"Voice in"}),t.jsx("dd",{children:e.voiceAvailable?e.voice.input.engine:"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Input"}),t.jsx("dd",{children:e.voiceAvailable?xt(e.voice.input.state):"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Voice out"}),t.jsx("dd",{children:n?on(n.provider):"Scout API"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Route"}),t.jsx("dd",{children:e.speechRoute?.voiceId??s?.name??e.speechVoiceId})]})]}),t.jsx("p",{className:"deck-sheet__note",children:"Scout owns both directions: Scout dictation in; OpenAI or ElevenLabs synthesis out through the paired host API."})]})}function on(e){return e.toLowerCase()==="openai"?"OpenAI":e.toLowerCase()==="elevenlabs"?"ElevenLabs":e.replace(/(^|[-_])([a-z])/g,(n,s,a)=>`${s?" ":""}${a.toUpperCase()}`)}function ra(e){const n=e.toLowerCase();return n==="openai"||n==="elevenlabs"}function ca({lane:e,index:n,model:s,onSelect:a}){const r=e.key===s.selected?.key;return t.jsxs("button",{type:"button",className:"deck-lane","data-active":r||void 0,"data-tone":r&&s.phaseTone!=="quiet"?s.phaseTone:le(e),onClick:()=>{s.selectLane(e),a?.()},"aria-pressed":r,children:[t.jsx("span",{className:"deck-lane__index",children:String(n+1).padStart(2,"0")}),t.jsxs("span",{className:"deck-lane__body",children:[t.jsx("strong",{children:e.name}),t.jsxs("small",{children:[e.hostName," · ",e.harness??"agent"," · ",Y(e.state).toLowerCase()]})]}),t.jsx("i",{className:"deck-lane__signal","aria-hidden":"true"})]})}function bt({model:e}){const{hosts:n}=e;return n.length===0?null:t.jsxs("div",{className:"deck-scope",role:"group","aria-label":"Agent lane scope",children:[n.length>1?t.jsxs("button",{type:"button",className:"deck-scope__key","data-active":e.hostScope==="all"||void 0,onClick:()=>e.selectHostScope("all"),"aria-pressed":e.hostScope==="all",children:[t.jsx("i",{"data-all":"true"}),"All hosts"]}):null,n.map(s=>t.jsxs("button",{type:"button",className:"deck-scope__key","data-state":s.state,"data-active":e.hostScope===s.id||void 0,onClick:()=>e.selectHostScope(s.id),disabled:s.state!=="connected","aria-pressed":e.hostScope===s.id,children:[t.jsx("i",{}),s.name]},s.id))]})}function _n({model:e,onPick:n}){return e.attention.length===0?t.jsx("p",{className:"deck-empty-note",children:"No lanes need intervention."}):t.jsx("div",{className:"deck-attention",children:e.attention.map(s=>t.jsxs("button",{type:"button",className:"deck-attention__row",onClick:()=>{e.selectLane(s),n?.()},children:[t.jsx("i",{"aria-hidden":"true"}),t.jsxs("span",{children:[t.jsx("strong",{children:s.name}),t.jsx("small",{children:s.events[0]?.text??"Needs review"})]})]},s.key))})}function oa({model:e,limit:n=9}){const{thread:s,adapterAvailable:a,threadBusy:r,threadError:l}=e;if(!a)return t.jsx(oe,{glyph:e.sessionBusy?"···":"CX",title:e.sessionError?"Codex did not start":e.sessionBusy?"Starting Codex":"Workspace is view-only",tone:e.sessionError?"error":void 0,children:e.sessionError??(e.sessionBusy?e.sessionLaunchAccepted?"Codex accepted the launch. Scout will switch Deck when its lane appears.":"Scout is launching a broker-managed Codex session.":e.canStartCodexSession?"This lane remains intact when Scout opens its controllable Codex session.":e.sessionStartUnavailableReason??"This workspace remains view-only.")});if(l)return t.jsxs(oe,{glyph:"!",title:"Session connection failed",tone:"error",children:[l,t.jsxs("button",{type:"button",className:"deck-chip deck-chip--warn",onClick:e.connectThread,disabled:r,children:[t.jsx(ue,{}),t.jsx("span",{children:"Retry controller"})]})]});if(!s)return t.jsx(oe,{glyph:"···",title:"Reading the Codex session",children:"Nothing is shown until the host returns a snapshot."});if(s.state==="disconnected")return t.jsxs(oe,{glyph:"CX",title:"Session is disconnected",children:["No turns are readable until Deck reconnects Scout's managed Codex session on the host.",t.jsxs("button",{type:"button",className:"deck-chip deck-chip--warn",onClick:e.connectThread,disabled:r,children:[t.jsx(ue,{}),t.jsx("span",{children:"Reconnect"})]})]});const u=hn(s,n);return u.length===0?t.jsx(oe,{glyph:"●",title:"Codex ready",tone:"connected",children:s.threadId?`Session ${z(s.threadId)} is ready. Start its first turn from the console.`:"The session is connected. Start its first turn from the console."}):t.jsx("div",{className:"deck-stream",children:u.map(p=>t.jsxs("article",{className:"deck-stream__row","data-role":p.role,"data-type":p.block.type,children:[t.jsxs("div",{className:"deck-stream__meta",children:[t.jsx("span",{children:p.role==="operator"?"YOU":p.block.type==="action"?"RUN":p.block.type==="reasoning"?"THINK":"CX"}),t.jsx("time",{children:de(p.at)})]}),t.jsxs("div",{className:"deck-stream__content",children:[t.jsx("strong",{children:Oe(p.block)}),dt(p.block)?t.jsx("p",{children:dt(p.block)}):null]}),t.jsx("span",{className:"deck-stream__status","data-live":p.status==="streaming"||void 0,children:p.status==="streaming"?"live":p.status})]},p.block.id))})}function la({lane:e}){return e.events.length===0?t.jsx(oe,{glyph:"·",title:"No recent activity",children:"Nothing has been observed on this lane recently."}):t.jsx("div",{className:"deck-stream",children:e.events.slice(0,8).map(n=>t.jsxs("article",{className:"deck-stream__row","data-kind":n.kind,children:[t.jsxs("div",{className:"deck-stream__meta",children:[t.jsx("span",{children:n.kind.toUpperCase()}),t.jsx("time",{children:de(n.at)})]}),t.jsxs("div",{className:"deck-stream__content",children:[t.jsx("strong",{children:n.text}),n.detail?t.jsx("p",{children:n.detail}):null]})]},n.id))})}function oe({glyph:e,title:n,tone:s,children:a}){return t.jsxs("div",{className:"deck-stream-empty","data-tone":s,children:[t.jsx("span",{className:"deck-stream-empty__glyph",children:e}),t.jsx("strong",{children:n}),t.jsx("p",{children:a})]})}function jt({model:e}){return t.jsxs("div",{className:"deck-tabs",role:"tablist","aria-label":"Lane view",children:[t.jsx("button",{type:"button",role:"tab","aria-selected":e.view==="thread",onClick:()=>e.setView("thread"),disabled:!e.adapterAvailable,children:"Session turns"}),t.jsx("button",{type:"button",role:"tab","aria-selected":e.view==="signal",onClick:()=>e.setView("signal"),children:"Lane signal"})]})}function St({model:e,limit:n}){return e.view==="signal"&&e.selected?t.jsx(la,{lane:e.selected}):t.jsx(oa,{model:e,limit:n})}function qe({model:e}){return t.jsxs("span",{className:"deck-connection","data-connection":e.connection,children:[t.jsx("i",{className:"deck-lamp"}),Qs(e.connection)]})}function da({model:e}){const n=e.selected;return n?t.jsxs("div",{className:"deck-identity",children:[t.jsx("h2",{children:n.name}),t.jsxs("p",{children:[t.jsx("span",{children:n.projectRoot??"Project unavailable"}),t.jsxs("em",{children:[n.hostName," · ",n.model??"default model"," · ",pe(n.transport)]})]})]}):null}function yt({model:e}){return t.jsxs("div",{className:"deck-standby",children:[t.jsx("i",{className:"deck-lamp"}),t.jsx("span",{className:"deck-kicker",children:"Deck standing by"}),t.jsx("h2",{children:e.connection==="error"?"Host unavailable":"Waiting for a connected host"}),t.jsx("p",{children:e.error??"Connect a trusted Scout host to populate live lanes and enable controls."}),t.jsx(bt,{model:e})]})}function ua({model:e}){const[n,s]=d.useState(()=>e.preview&&new URLSearchParams(window.location.search).get("palette")==="open"),[a,r]=d.useState(""),[l,u]=d.useState(0),p=d.useRef(null),k=e.selected,y=d.useMemo(()=>{const f=[{id:"start-codex",group:"Session",label:e.sessionBusy?"Starting Codex for this workspace":"Start Codex for this workspace",disabled:!e.canStartCodexSession,run:()=>{e.startCodexSession()}},{id:"talk",group:"Turn",label:e.voice.input.state==="listening"?"Stop dictation and send":"Talk to this session",hint:e.phase==="running"?"steers the running turn":"starts a turn",disabled:!e.canTalk,run:()=>{e.toggleVoiceInput()}},{id:"send",group:"Turn",label:e.phase==="running"?"Steer with composer text":"Send composer text",hint:"⌘↵",disabled:!e.canCompose||!e.command.trim(),run:()=>{e.submitTurn(e.command)}},{id:"stop",group:"Turn",label:"Interrupt the running turn",disabled:!e.canInterrupt||e.threadBusy,run:()=>{e.interruptThread()}},{id:"bind",group:"Session",label:e.phase==="failed"?"Retry the Codex connection":"Reconnect the Codex session",disabled:!e.canRebind||e.threadBusy,run:()=>{e.connectThread()}},{id:"refresh",group:"Session",label:"Re-read the session snapshot",disabled:!e.canRefresh,run:()=>{e.refreshSnapshot()}},{id:"view",group:"Session",label:e.view==="thread"?"Show lane signal":"Show session turns",run:()=>e.setView(e.view==="thread"?"signal":"thread")},{id:"voice-out",group:"Audio",label:e.voiceOutEnabled?"Mute spoken replies":"Speak replies aloud",disabled:!e.voiceOutputAvailable,run:()=>{e.toggleVoiceOutput()}},{id:"stop-speaking",group:"Audio",label:"Stop speaking now",disabled:!e.voice.output.speaking,run:()=>{e.stopSpeaking()}},{id:"auto-send",group:"Audio",label:e.autoSendOnStop?"Keep transcript in composer instead of sending":"Send when dictation stops",run:e.toggleAutoSend},{id:"audio",group:"Audio",label:"Open audio and dictation settings",run:()=>e.setSettingsOpen(!0)},{id:"ops",group:"Layout",label:"Switch to Ops (routed agent controller)",run:()=>e.setTreatment("ops")},{id:"yoke",group:"Layout",label:"Switch to Yoke (two-grip cockpit)",run:()=>e.setTreatment("yoke")},{id:"console",group:"Layout",label:"Switch to Console (fleet board)",run:()=>e.setTreatment("console")}];for(const[c,g]of e.scopedLanes.entries())f.push({id:`lane-${g.key}`,group:"Lanes",label:`${String(c+1).padStart(2,"0")} · ${g.name}`,hint:`${g.hostName} · ${Y(g.state).toLowerCase()}`,run:()=>e.selectLane(g)});for(const c of e.hosts)f.push({id:`scope-${c.id}`,group:"Lanes",label:`Scope to ${c.name}`,hint:c.state,disabled:c.state!=="connected",run:()=>e.selectHostScope(c.id)});return e.hosts.length>1&&f.push({id:"scope-all",group:"Lanes",label:"Scope to all hosts",run:()=>e.selectHostScope("all")}),f},[e]),m=d.useMemo(()=>{const f=a.trim().toLowerCase(),c=y.filter(g=>!g.disabled);return f?c.filter(g=>`${g.group} ${g.label} ${g.hint??""}`.toLowerCase().includes(f)):c},[y,a]);if(d.useEffect(()=>{u(0)},[a,n]),d.useEffect(()=>{n&&p.current?.focus()},[n]),d.useEffect(()=>{const f=c=>{if((c.metaKey||c.ctrlKey)&&c.key.toLowerCase()==="k"){c.preventDefault(),r(""),s(g=>!g);return}if(n){if(c.key==="Escape"){c.preventDefault(),s(!1);return}if(c.key==="ArrowDown"||c.key==="ArrowUp"){c.preventDefault(),u(g=>m.length===0?0:(g+(c.key==="ArrowDown"?1:-1)+m.length)%m.length);return}if(c.key==="Enter"){c.preventDefault();const g=m[l];if(!g)return;g.run(),s(!1)}}};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n,m,l]),!k)return t.jsx("div",{className:"brief brief--standby",children:t.jsx(yt,{model:e})});const U=ht(e.thread),E=!!e.thread?.threadId;return t.jsxs("div",{className:"brief",children:[t.jsxs("div",{className:"brief__column",children:[t.jsxs("header",{className:"brief__head",children:[t.jsxs("div",{className:"brief__head-top",children:[t.jsx(qe,{model:e}),t.jsxs("div",{className:"brief__head-keys",children:[t.jsx(kt,{model:e}),t.jsxs("button",{type:"button",className:"brief__jump",onClick:()=>{r(""),s(!0)},children:[t.jsxs("span",{children:[String(e.selectedIndex+1).padStart(2,"0")," / ",String(e.scopedLanes.length).padStart(2,"0")," lanes"]}),t.jsx(Re,{dir:"down"})]})]})]}),t.jsxs("span",{className:"deck-kicker brief__kicker","data-bound":E||void 0,children:[e.adapterAvailable?E?"Scout Codex session":"No session connected":e.sessionBusy?"Starting Codex":"Codex session not started"," · ",k.name," · ",k.hostName]}),t.jsx("h2",{children:E?U??"Untitled session":k.name}),t.jsxs("p",{className:"brief__meta",children:[e.thread?.threadId?`id ${z(e.thread.threadId)}`:"id —",e.thread?.turnId?` · turn ${z(e.thread.turnId)}`:""," · ",k.projectRoot??"project unavailable"," · ",k.model??"default model"," · ",pe(k.transport)]}),t.jsx(De,{model:e})]}),t.jsxs("div",{className:"brief__viewport",children:[t.jsxs("div",{className:"brief__viewport-head",children:[t.jsx(jt,{model:e}),e.canInterrupt?t.jsxs("button",{type:"button",className:"deck-stop",onClick:e.interruptThread,disabled:e.threadBusy||e.phase==="stopping",children:[t.jsx(Le,{}),t.jsx("span",{children:e.phase==="stopping"?"Stopping":"Stop turn"})]}):null]}),t.jsx("div",{className:"brief__viewport-body",children:t.jsx(St,{model:e,limit:14})})]}),t.jsxs("div",{className:"brief__dock",children:[t.jsxs("div",{className:"brief__dock-voice",children:[t.jsx(Me,{model:e,size:"lg"}),t.jsxs("div",{className:"brief__dock-trace",children:[t.jsx($e,{model:e}),t.jsx(Pe,{model:e})]}),t.jsxs("button",{type:"button",className:"brief__commands",onClick:()=>{r(""),s(!0)},"aria-haspopup":"dialog",children:["Commands",t.jsx("em",{children:"⌘K"})]})]}),t.jsx(vt,{model:e,rows:2})]})]}),n?t.jsx("div",{className:"brief__palette-scrim",onClick:()=>s(!1),children:t.jsxs("div",{className:"brief__palette",role:"dialog","aria-label":"Deck commands",onClick:f=>f.stopPropagation(),children:[t.jsx("input",{ref:p,value:a,onChange:f=>r(f.target.value),placeholder:"Run a command or jump to a lane…","aria-label":"Filter commands"}),t.jsxs("div",{className:"brief__palette-list",children:[m.length===0?t.jsx("p",{className:"deck-empty-note",children:"Nothing matches, and nothing was run."}):null,m.map((f,c)=>t.jsxs("button",{type:"button","data-active":c===l||void 0,onMouseEnter:()=>u(c),onClick:()=>{f.run(),s(!1)},children:[t.jsx("span",{className:"brief__palette-group","data-tone":f.group==="Lanes"?pa(e,f.id):void 0,children:f.group}),t.jsx("strong",{children:f.label}),f.hint?t.jsx("em",{children:f.hint}):null]},f.id))]}),t.jsx("footer",{children:"↑↓ move · ↵ run · esc close"})]})}):null,t.jsx(Be,{model:e})]})}function pa(e,n){const s=n.replace(/^lane-/,""),a=e.scopedLanes.find(r=>r.key===s);return a?le(a):void 0}function ha({model:e}){const n=e.selected;return t.jsxs("div",{className:"console",children:[t.jsxs("header",{className:"console__bar",children:[t.jsxs("div",{className:"console__bar-status",children:[t.jsx(qe,{model:e}),t.jsx(kn,{model:e,size:"md"})]}),t.jsx(De,{model:e,compact:!0}),t.jsxs("div",{className:"console__bar-controls",children:[t.jsx(bn,{model:e}),t.jsx(yn,{model:e}),t.jsx(Sn,{model:e}),t.jsx(kt,{model:e}),t.jsx(jn,{model:e}),t.jsx(Me,{model:e,size:"md"})]})]}),t.jsxs("div",{className:"console__body",children:[t.jsxs("aside",{className:"console__bank","aria-label":"Agent lanes",children:[t.jsxs("div",{className:"console__panel-head",children:[t.jsx("span",{className:"deck-kicker",children:"Lanes"}),t.jsxs("span",{className:"deck-kicker",children:[e.activeCount," live / ",e.scopedLanes.length]})]}),t.jsxs("div",{className:"console__lanes",children:[e.scopedLanes.map((s,a)=>t.jsx(ca,{lane:s,index:a,model:e},s.key)),e.scopedLanes.length===0?t.jsx("p",{className:"deck-empty-note",children:"No lanes in this scope."}):null]}),t.jsx(bt,{model:e})]}),t.jsx("section",{className:"console__stage",children:n?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"console__stage-head",children:[t.jsx(da,{model:e}),t.jsxs("div",{className:"console__meter","aria-label":"Lane activity over the last five minutes",children:[t.jsx("small",{children:"5m"}),t.jsx("div",{"aria-hidden":"true",children:e.laneActivity.map((s,a)=>t.jsx("i",{style:{"--level":s}},a))}),t.jsx("small",{children:"now"})]})]}),t.jsxs("div",{className:"console__viewport",children:[t.jsxs("div",{className:"console__panel-head",children:[t.jsx(jt,{model:e}),t.jsxs("span",{className:"deck-kicker",children:[n.hostName," / ",n.id]})]}),t.jsx("div",{className:"console__viewport-body",children:t.jsx(St,{model:e,limit:12})})]}),t.jsxs("div",{className:"console__dock",children:[t.jsx($e,{model:e}),t.jsx(Pe,{model:e}),t.jsx(vt,{model:e,rows:2})]})]}):t.jsx(yt,{model:e})}),t.jsxs("aside",{className:"console__rail","aria-label":"Session readout",children:[t.jsxs("div",{className:"console__panel-head",children:[t.jsx("span",{className:"deck-kicker",children:"Readout"}),t.jsx("span",{className:"deck-kicker",children:e.preview?"Sample":e.adapterAvailable?"Native":"—"})]}),t.jsxs("dl",{className:"console__readout",children:[t.jsxs("div",{children:[t.jsx("dt",{children:"Source"}),t.jsx("dd",{children:e.preview?"sample data":"paired host"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Bridge"}),t.jsx("dd",{children:ea(e.connection)})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Session"}),t.jsx("dd",{children:e.thread?.threadId?z(e.thread.threadId):e.sessionBusy?"starting":e.adapterAvailable?"disconnected":"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Turn"}),t.jsx("dd",{children:e.thread?.turnId?z(e.thread.turnId):"none"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Voice in"}),t.jsx("dd",{children:e.voiceAvailable?xt(e.voice.input.state):"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Voice out"}),t.jsx("dd",{children:e.voiceOutputAvailable?e.voice.output.speaking?"speaking":e.voiceOutEnabled?"armed":"off":"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Queue"}),t.jsx("dd",{title:e.thread?.capabilityNotes.queue,children:e.adapterAvailable?"off":"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Approval"}),t.jsx("dd",{title:e.thread?.capabilityNotes.approvals,children:e.adapterAvailable?"off":"—"})]})]}),t.jsxs("div",{className:"console__panel-head",children:[t.jsx("span",{className:"deck-kicker",children:"Attention"}),t.jsx("span",{className:"deck-kicker",children:String(e.attention.length).padStart(2,"0")})]}),t.jsx(_n,{model:e}),t.jsxs("div",{className:"console__panel-head",children:[t.jsx("span",{className:"deck-kicker",children:"Fleet"}),t.jsx("span",{className:"deck-kicker",children:String(e.hosts.length).padStart(2,"0")})]}),t.jsx("div",{className:"console__fleet",children:e.hosts.map(s=>t.jsxs("div",{className:"console__fleet-row",children:[t.jsx("i",{"data-state":s.state}),t.jsxs("span",{children:[t.jsx("strong",{children:s.name}),t.jsxs("small",{children:[e.lanes.filter(a=>a.hostId===s.id).length," lanes"]})]}),t.jsx("em",{children:s.state})]},s.id))})]})]}),t.jsx(Be,{model:e})]})}function fa({model:e}){const n=e.selected,s=n?e.scopedLanes.findIndex(c=>c.key===n.key)+1:0,a=d.useMemo(()=>e.scopedLanes.flatMap((c,g)=>c.events.map(J=>({id:`${c.key}:${J.id}`,at:J.at,channel:g+1,lane:c,text:J.text,detail:J.detail??""}))).sort((c,g)=>g.at-c.at).slice(0,16),[e.scopedLanes]),r=d.useMemo(()=>n?e.view==="signal"||!e.thread?n.events.slice(0,5).reverse().map(c=>({id:c.id,label:c.kind.toUpperCase(),text:c.text,detail:c.detail??"",at:c.at,live:le(n)==="live"&&c.id===n.events[0]?.id})):hn(e.thread,5).map(c=>({id:c.block.id,label:c.role==="operator"?"YOU":c.block.type==="action"?"RUN":c.block.type==="reasoning"?"THINK":"CX",text:Oe(c.block),detail:dt(c.block),at:c.at,live:c.status==="streaming"})):[],[n,e.thread,e.view]),u=["all",...e.hosts.filter(c=>c.state==="connected").map(c=>c.id)],p=Math.max(0,u.indexOf(e.hostScope)),k=u[(p+1)%Math.max(1,u.length)]??"all",y=e.hostScope==="all"?"All hosts":e.hosts.find(c=>c.id===e.hostScope)?.name??e.hostScope;if(!n)return t.jsx("div",{className:"ops ops--standby",children:t.jsxs("div",{className:"ops__standby",children:[t.jsx(qe,{model:e}),t.jsx("strong",{children:"No agent channels are available"}),t.jsx("p",{children:e.error??"Waiting for a connected host to publish its Scout lanes."})]})});const m=ht(e.thread),U=e.connection==="ready"?"ONLINE":e.connection==="partial"?"DEGRADED":e.connection.toUpperCase(),E=e.preview?"SIMULATED":e.sessionBusy?"STARTING CODEX":e.adapterAvailable?e.thread?.threadId&&(e.connection==="ready"||e.connection==="partial")?"LIVE":e.connection==="ready"||e.connection==="partial"?"SESSION OFFLINE":"OFFLINE":e.canStartCodexSession?"READY TO START":"VIEW ONLY",f=e.preview?"8 SIMULATED CONTROLS":e.connection==="ready"||e.connection==="partial"?"8 HOST CONTROLS":"CONTROLS OFFLINE";return t.jsxs("div",{className:"ops",children:[t.jsx("section",{className:"ops__channels","aria-label":"Agent channels",children:e.scopedLanes.map((c,g)=>t.jsx(xa,{lane:c,index:g,active:c.key===n.key,model:e},c.key))}),t.jsxs("section",{className:"ops__voice","aria-label":"Routed voice control",children:[t.jsx(Me,{model:e,size:"md"}),t.jsx($e,{model:e}),t.jsxs("div",{className:"ops__voice-copy",children:[t.jsx("strong",{children:fn(e.primaryAction,e.phase,e.voice.input.state,e.sessionStartUnavailableReason).toUpperCase()}),t.jsx(Pe,{model:e})]}),t.jsxs("div",{className:"ops__routes",role:"group","aria-label":"Route dictation to agent channel",children:[t.jsx("span",{children:"ROUTE TO"}),t.jsx("div",{children:e.scopedLanes.map((c,g)=>t.jsxs("button",{type:"button","data-active":c.key===n.key||void 0,onClick:()=>e.selectLane(c),"aria-pressed":c.key===n.key,children:["CH ",g+1]},c.key))})]})]}),t.jsxs("section",{className:"ops__enclosure",children:[t.jsxs("header",{className:"ops__enclosure-head",children:[t.jsxs("span",{className:"ops__host",children:[t.jsx("i",{"data-tone":e.phaseTone}),n.hostName]}),t.jsxs("span",{className:"ops__binding",children:[e.adapterAvailable?"SCOUT APP-SERVER":pe(n.transport).toUpperCase(),t.jsx("i",{children:"·"}),m??n.projectRoot??"NO SESSION"]})]}),t.jsxs("div",{className:"ops__workspace",children:[t.jsxs("article",{className:"ops__console",children:[t.jsxs("header",{children:[t.jsx("span",{children:"agent console"}),t.jsx("strong",{"data-tone":e.phaseTone,children:pt(e.phase,n.state)})]}),t.jsxs("div",{className:"ops__agent-line",children:[t.jsx("h2",{children:n.name}),t.jsxs("span",{children:["CH ",String(s).padStart(2,"0")," · ",n.hostName.toUpperCase()]})]}),t.jsx("p",{className:"ops__task",title:m??void 0,children:m??(e.adapterAvailable?"No Codex session connected":e.sessionBusy?"Starting Codex for this workspace…":"Start Codex to control this workspace")}),t.jsx(De,{model:e,compact:!0}),t.jsx("div",{className:"ops__console-rows","data-view":e.view,children:r.length>0?r.map(c=>t.jsxs("div",{className:"ops__console-row","data-live":c.live||void 0,children:[t.jsx("i",{}),t.jsx("span",{children:c.label}),t.jsxs("p",{children:[t.jsx("strong",{children:c.text}),c.detail?t.jsx("small",{children:c.detail}):null]}),t.jsx("time",{children:de(c.at)})]},c.id)):t.jsxs("p",{className:"ops__empty",children:["No ",e.view==="thread"?"session turns":"lane signal"," reported yet."]})}),t.jsxs("form",{className:"ops__composer",onSubmit:e.onComposerSubmit,children:[t.jsx("span",{"aria-hidden":"true",children:"›"}),t.jsx("input",{value:e.command,onChange:c=>e.setCommand(c.target.value),placeholder:xn(e.phase,e.voice.input.state),disabled:!e.canCompose,"aria-label":e.phase==="running"?"Steer the active Codex turn":"Start a Codex turn"}),t.jsx("button",{type:"submit",disabled:!e.canCompose||!e.command.trim(),children:e.phase==="running"?"Steer":"Send"})]}),t.jsxs("div",{className:"ops__console-actions",children:[e.canRebind?t.jsxs("button",{type:"button",onClick:e.connectThread,disabled:e.threadBusy,children:[t.jsx(ue,{}),e.phase==="failed"?"Retry link":"Reconnect"]}):null,t.jsxs("button",{type:"button",onClick:e.refreshSnapshot,disabled:!e.canRefresh,children:[t.jsx(ut,{}),"Re-read"]}),e.canInterrupt?t.jsxs("button",{type:"button",className:"ops__danger",onClick:e.interruptThread,disabled:e.threadBusy,children:[t.jsx(Le,{}),e.phase==="stopping"?"Stopping":"Stop turn"]}):null]}),t.jsxs("footer",{children:[t.jsxs("span",{children:["MODEL ",t.jsx("strong",{children:n.model??"DEFAULT"})]}),t.jsxs("span",{children:["CONTROL ",t.jsx("strong",{children:E})]}),t.jsxs("span",{title:e.thread?.threadId??void 0,children:["SESSION ",t.jsx("strong",{children:e.thread?.threadId?z(e.thread.threadId):"—"})]})]})]}),t.jsxs("aside",{className:"ops__feed",children:[t.jsxs("header",{children:[t.jsx("span",{children:"fleet feed"}),t.jsxs("strong",{children:[e.hostScope==="all"?"ALL HOSTS":y.toUpperCase()," · ",a.length," EVENTS"]})]}),t.jsx("div",{className:"ops__feed-rows",children:a.length>0?a.map(c=>t.jsxs("button",{type:"button","data-active":c.lane.key===n.key||void 0,"data-tone":le(c.lane),onClick:()=>e.selectLane(c.lane),"aria-label":`Channel ${c.channel}, ${c.lane.name}: ${c.text}`,children:[t.jsx("time",{children:de(c.at)}),t.jsxs("span",{children:["CH ",c.channel]}),t.jsx("strong",{children:c.lane.name.toUpperCase()}),t.jsxs("p",{children:[c.text,c.detail?t.jsx("small",{children:c.detail}):null]})]},c.id)):t.jsx("p",{className:"ops__empty",children:"No fleet activity reported yet."})})]})]})]}),t.jsxs("section",{className:"ops__commands","aria-label":"Deck commands",children:[t.jsxs("header",{children:[t.jsx("span",{children:"COMMANDS"}),t.jsx("strong",{children:f})]}),t.jsxs("div",{className:"ops__command-grid",children:[t.jsx(G,{ordinal:"01",label:e.primaryAction==="start_codex"?"Start Codex":"Voice",meta:e.primaryAction==="start_codex"?e.sessionBusy?"Starting":"Workspace":xt(e.voice.input.state),icon:e.primaryAction==="start_codex"?t.jsx(ue,{}):t.jsx(gn,{}),active:e.voiceInputActive,disabled:e.primaryAction==="start_codex"?!e.canStartCodexSession:e.primaryAction==="connect"?e.threadBusy:!e.canTalk,onClick:e.onPrimary}),t.jsx(G,{ordinal:"02",label:"Session turns",meta:"Codex session",glyph:"◎",active:e.view==="thread",disabled:!e.adapterAvailable,onClick:()=>e.setView("thread")}),t.jsx(G,{ordinal:"03",label:"Lane signal",meta:"Scout tail",glyph:"≋",active:e.view==="signal",onClick:()=>e.setView("signal")}),t.jsx(G,{ordinal:"04",label:"Re-read",meta:"Session snapshot",icon:t.jsx(ut,{}),disabled:!e.canRefresh,onClick:()=>{e.refreshSnapshot()}}),t.jsx(G,{ordinal:"05",label:e.voiceOutEnabled?"Voice out":"Muted",meta:e.voice.output.speaking?"Speaking":e.voiceOutEnabled?"Armed":"Off",icon:t.jsx(gt,{}),active:e.voiceOutEnabled,disabled:!e.voiceOutputAvailable,onClick:()=>{e.toggleVoiceOutput()}}),t.jsx(G,{ordinal:"06",label:"Audio",meta:"Dictation",icon:t.jsx(vn,{}),active:e.settingsOpen,onClick:()=>e.setSettingsOpen(!e.settingsOpen)}),t.jsx(G,{ordinal:"07",label:"Host scope",meta:y,glyph:"⌾",disabled:u.length<2,onClick:()=>e.selectHostScope(k)}),t.jsx(G,{ordinal:"08",label:"Next lane",meta:`${s} / ${e.scopedLanes.length}`,icon:t.jsx(Re,{dir:"right"}),disabled:e.scopedLanes.length<2,onClick:()=>e.stepLane(1)})]})]}),t.jsxs("footer",{className:"ops__status",children:[t.jsxs("span",{className:"ops__status-online","data-connection":e.connection,children:[t.jsx("i",{}),U]}),t.jsx("span",{children:n.hostName}),t.jsxs("span",{children:["ROUTE ",t.jsxs("strong",{children:["CH ",s]})]}),e.attention.length>0?t.jsxs("span",{className:"ops__status-attn",children:["ATTN ",e.attention.length]}):null,t.jsxs("span",{children:["HOSTS ",t.jsx("strong",{children:e.hosts.length})]}),t.jsxs("span",{children:["LIVE ",t.jsx("strong",{children:e.activeCount})]}),t.jsxs("span",{children:["VIEW · ",t.jsx("strong",{children:"OPS"})]})]}),t.jsx(Be,{model:e})]})}function xa({lane:e,index:n,active:s,model:a}){const r=e.events[0],l=s&&a.phaseTone!=="quiet"?a.phaseTone:le(e);return t.jsxs("button",{type:"button",className:"ops-channel","data-active":s||void 0,"data-tone":l,onClick:()=>a.selectLane(e),"aria-pressed":s,"aria-label":`Channel ${n+1}, ${e.name}, ${Y(e.state)}`,children:[t.jsxs("span",{className:"ops-channel__head",children:[t.jsxs("small",{children:["CH ",String(n+1).padStart(2,"0")]}),t.jsx("em",{"aria-hidden":"true",children:"▰"}),t.jsx("strong",{children:e.hostName}),t.jsx("i",{}),t.jsx("small",{children:s?pt(a.phase,e.state):Y(e.state)})]}),t.jsx("span",{className:"ops-channel__rule"}),t.jsxs("span",{className:"ops-channel__identity",children:[t.jsx("strong",{children:e.name}),t.jsxs("small",{children:[e.harness??"agent"," · ",e.model??"default"]})]}),t.jsx("span",{className:"ops-channel__task",children:r?.text??e.projectRoot??"No recent activity"}),t.jsxs("span",{className:"ops-channel__signal",children:[t.jsx("i",{}),t.jsx("small",{children:r?.detail||(s?"controller selected":"tap to put on deck")}),t.jsx("time",{children:de(r?.at??e.updatedAt)})]}),t.jsxs("span",{className:"ops-channel__foot",children:[t.jsxs("strong",{children:[t.jsx("i",{}),s?"ON DECK":"TAP TO SWITCH"]}),t.jsx("small",{children:pe(e.transport).toUpperCase()})]})]})}function G({ordinal:e,label:n,meta:s,glyph:a,icon:r,active:l,disabled:u=!1,onClick:p}){return t.jsxs("button",{type:"button",className:"ops-command","data-active":l||void 0,disabled:u,onClick:p,"aria-pressed":l??void 0,title:`${n} · ${s}`,children:[t.jsx("span",{className:"ops-command__icon",children:r??a}),t.jsxs("span",{children:[t.jsx("strong",{children:n}),t.jsxs("small",{children:[e," · ",s.toUpperCase()]})]})]})}function ga({model:e}){const n=e.selected;if(!n)return t.jsx("div",{className:"yoke yoke--standby",children:t.jsx(yt,{model:e})});const s=e.scopedLanes.length,a=Math.max(1,e.selectedIndex+1);return t.jsxs("div",{className:"yoke",children:[t.jsxs("div",{className:"yoke__grip yoke__grip--left",children:[t.jsx(Me,{model:e,size:"xl"}),t.jsx($e,{model:e}),t.jsx(bn,{model:e,block:!0}),t.jsxs("div",{className:"yoke__stepper",role:"group","aria-label":"Lane navigation",children:[t.jsx("button",{type:"button",onClick:()=>e.stepLane(-1),disabled:s<2,"aria-label":"Previous lane",children:t.jsx(Re,{dir:"left"})}),t.jsxs("span",{children:[t.jsx("strong",{children:String(a).padStart(2,"0")}),t.jsxs("small",{children:["of ",String(s).padStart(2,"0")]})]}),t.jsx("button",{type:"button",onClick:()=>e.stepLane(1),disabled:s<2,"aria-label":"Next lane",children:t.jsx(Re,{dir:"right"})})]}),t.jsx("div",{className:"yoke__ladder",role:"group","aria-label":"Lane ladder",children:e.scopedLanes.map((r,l)=>t.jsxs("button",{type:"button","data-active":r.key===n.key||void 0,"data-tone":le(r),onClick:()=>e.selectLane(r),"aria-pressed":r.key===n.key,"aria-label":`${r.name} on ${r.hostName} — ${Y(r.state)}`,title:`${r.name} · ${r.hostName} · ${Y(r.state)}`,children:[t.jsx("span",{children:String(l+1).padStart(2,"0")}),t.jsx("i",{"aria-hidden":"true"})]},r.key))}),t.jsxs("div",{className:"yoke__grip-keys",children:[t.jsx(kt,{model:e}),t.jsx(jn,{model:e})]}),t.jsxs("div",{className:"yoke__grip-foot",children:[t.jsx("span",{className:"deck-kicker",children:"Lane traffic"}),t.jsx(ia,{model:e})]})]}),t.jsxs("section",{className:"yoke__stage",children:[t.jsxs("header",{className:"yoke__head",children:[t.jsx("div",{className:"yoke__head-task",children:t.jsx(kn,{model:e,size:"lg"})}),t.jsxs("div",{className:"yoke__head-lane",children:[t.jsx("h2",{children:n.name}),t.jsx("p",{children:n.projectRoot??"Project unavailable"})]})]}),t.jsx(De,{model:e}),t.jsxs("div",{className:"yoke__viewport",children:[t.jsxs("div",{className:"yoke__viewport-head",children:[t.jsx(jt,{model:e}),t.jsxs("span",{className:"deck-kicker",children:[n.hostName," / ",n.id]})]}),t.jsx("div",{className:"yoke__viewport-body",children:t.jsx(St,{model:e,limit:10})})]}),t.jsxs("div",{className:"yoke__dock",children:[t.jsx(Pe,{model:e}),t.jsx(vt,{model:e,rows:2})]})]}),t.jsxs("aside",{className:"yoke__grip yoke__grip--right","aria-label":"Session status",children:[t.jsxs("div",{className:"yoke__status",children:[t.jsx(qe,{model:e}),t.jsxs("dl",{children:[t.jsxs("div",{children:[t.jsx("dt",{children:"Lane state"}),t.jsx("dd",{children:Y(n.state)})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Harness"}),t.jsx("dd",{children:n.harness??"unknown"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Model"}),t.jsx("dd",{children:n.model??"default"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Transport"}),t.jsx("dd",{title:pe(n.transport),children:Zs(n.transport)})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Live lanes"}),t.jsxs("dd",{children:[e.activeCount," of ",s]})]})]})]}),t.jsxs("div",{className:"yoke__grip-keys",children:[t.jsx(Sn,{model:e}),t.jsx(yn,{model:e})]}),t.jsxs("div",{className:"yoke__attention",children:[t.jsxs("span",{className:"deck-kicker",children:["Needs you · ",String(e.attention.length).padStart(2,"0")]}),t.jsx(_n,{model:e})]}),t.jsxs("div",{className:"yoke__scope",children:[t.jsx("span",{className:"deck-kicker",children:"Host scope"}),t.jsx(bt,{model:e})]})]}),t.jsx(Be,{model:e})]})}function Sa(){const e=Vs(),n=e.hosts.find(a=>a.state==="connected"),s=e.preview?{state:"preview",label:"PREVIEW",detail:"sample lanes · controls simulate locally"}:e.connection==="ready"||e.connection==="partial"?{state:e.connection==="ready"?"live":"partial",label:e.connection==="ready"?"LIVE":"DEGRADED",detail:`${n?.name??"host"} · Scout-managed Codex control`}:{state:"offline",label:"OFFLINE",detail:"no host connected"};return t.jsxs("main",{className:"scout-deck","data-connection":e.connection,"data-treatment":e.treatment,"data-preview":e.preview||void 0,children:[t.jsxs("header",{className:"scout-deck__strip",children:[t.jsxs("div",{className:"scout-deck__brand",children:[e.treatment==="ops"?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"scout-deck__ops-brand",children:[t.jsx("strong",{children:"SCOUT"}),t.jsx("i",{children:"·"}),t.jsx("small",{children:"OPS"})]}),t.jsxs("span",{className:"scout-deck__ops-mode",children:[t.jsx("i",{}),"AGENT DECK"]})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"scout-deck__mark","aria-hidden":"true",children:"S"}),t.jsxs("span",{className:"scout-deck__wordmark",children:[t.jsx("strong",{children:"Deck"}),t.jsx("small",{children:ct[e.treatment].tagline})]})]}),t.jsxs("span",{className:"scout-deck__source","data-state":s.state,title:e.preview?"Every lane, thread, and turn on screen is local sample data. No host is attached.":s.detail,children:[t.jsx("strong",{children:s.label}),t.jsx("small",{children:s.detail})]})]}),e.treatment==="ops"?t.jsxs("span",{className:"scout-deck__ops-count",children:[e.hosts.length," HOST",e.hosts.length===1?"":"S"," · ",e.scopedLanes.length," AGENT",e.scopedLanes.length===1?"":"S"]}):null,t.jsx(aa,{model:e})]}),e.treatment==="ops"?t.jsx(fa,{model:e}):e.treatment==="console"?t.jsx(ha,{model:e}):e.treatment==="brief"?t.jsx(ua,{model:e}):t.jsx(ga,{model:e})]})}export{Sa as ScoutDeckSurface,Bs as buildDeckLanes};
@@ -1,2 +0,0 @@
1
- import{c}from"./createLucideIcon-DCq_3fQn.js";import{j as i}from"./index-BZovGpDk.js";import{l as h}from"./Provider-p-xuaAoE.js";import{u as f}from"./ContextMenu-DnFcmfMR.js";import{B as b}from"./bot-BSGSicKC.js";import{L as k}from"./loader-circle-B-l2Wj3-.js";const m=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],T=c("volume-2",m);const w=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],_=c("volume-x",w),s="openscout:toggle-scoutbot";function g(t){if(typeof window>"u")return;const n={};window.dispatchEvent(new CustomEvent(s,{detail:n}))}function z(t){if(typeof window>"u")return()=>{};const n=o=>{const e=o.detail??{};t(e)};return window.addEventListener(s,n),()=>window.removeEventListener(s,n)}function y(t){switch(t){case"listening":return"listening";case"thinking":return"thinking";case"speaking":return"speaking";case"briefing":return"thinking";default:return""}}function v(t){return t==="thinking"||t==="briefing"}function x(t){return t!=="idle"?{kind:"activity",activity:t,label:y(t)}:{kind:"idle"}}function S(t,n,o){const e=[];return t.kind==="activity"?e.push(`Scout · ${t.label}`):e.push("Toggle Scout"),n&&e.push(n),o&&e.push(o),e.join(`
2
- `)}function V(){const{state:t,actions:n}=h(),o=f(),e=x(t.activity),a=S(e,t.session.title,t.error),r=e.kind==="activity"?"s-scoutbot-chip--activity":"s-scoutbot-chip--idle",u=()=>{g()},l=d=>{const p=[{kind:"action",label:"New chat",onSelect:()=>n.startNewChat()},{kind:"action",label:t.voice.replies?"Turn voice replies off":"Turn voice replies on",onSelect:()=>n.toggleVoiceReplies()},{kind:"separator"},{kind:"action",label:"Open chat",onSelect:()=>n.focusScoutbot()}];o(d,p)};return i.jsxs("button",{type:"button",className:`s-scoutbot-chip ${r}`,onClick:u,onContextMenu:l,title:a,children:[i.jsx(b,{size:14,className:"s-scoutbot-chip-icon","aria-hidden":"true"}),e.kind==="activity"&&i.jsxs(i.Fragment,{children:[v(e.activity)?i.jsx(k,{size:10,className:"s-scoutbot-chip-spinner","aria-hidden":"true"}):i.jsx("span",{className:"s-scoutbot-chip-dot s-scoutbot-chip-dot--pulse","aria-hidden":"true"}),i.jsx("span",{className:"s-scoutbot-chip-text",children:e.label})]})]})}export{V as S,T as V,_ as a,z as o};
@@ -1 +0,0 @@
1
- import{j as e,r as o}from"./index-BZovGpDk.js";import{b as D}from"./Provider-p-xuaAoE.js";import{L as h}from"./loader-circle-B-l2Wj3-.js";import{R as z}from"./radio-BGtkyCG9.js";import{M as B,b as H}from"./DocumentFocusViewer-CZVVIAD5.js";import{C as q}from"./chevron-down-BVg09D6U.js";import{c as u}from"./createLucideIcon-DCq_3fQn.js";import{P as I}from"./plus-BAI0t5g9.js";import{S as K}from"./runtime-picker-BXKJbLot.js";const U=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],F=u("history",U);const Q=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],Y=u("list-tree",Q);const G=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],J=u("play",G);const X=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Z=u("settings-2",X),x="rounded-lg bg-[color-mix(in_srgb,var(--hud-ink)_4.5%,transparent)]",$="rounded-md border border-[color-mix(in_srgb,var(--hud-ink)_10%,transparent)] bg-[color-mix(in_srgb,var(--hud-bg)_70%,transparent)] text-[var(--scout-chrome-ink-strong)] outline-none transition-colors focus:border-lime-300/45",y="rounded-md border border-[color-mix(in_srgb,var(--hud-ink)_8%,transparent)] text-[var(--scout-chrome-ink)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink-strong)] disabled:cursor-not-allowed disabled:opacity-40",N="font-mono text-xs uppercase tracking-[0.11em] text-[var(--scout-chrome-ink-ghost)]";function ee(r){return r==="live"?{label:"Live",detail:"Listening — speak naturally",chip:"border-lime-300/35 bg-lime-300/[0.10] text-lime-100",iconWrap:"border-lime-300/40 bg-lime-300/[0.10] text-lime-200"}:r==="connecting"?{label:"Connecting",detail:"Opening secure audio…",chip:"border-amber-300/30 bg-amber-300/[0.09] text-amber-100/90",iconWrap:"border-amber-300/35 bg-amber-300/[0.09] text-amber-100"}:r==="error"?{label:"Error",detail:"Could not hold the call",chip:"border-red-400/35 bg-red-400/[0.10] text-red-100",iconWrap:"border-red-400/35 bg-red-400/[0.10] text-red-100"}:r==="ended"?{label:"Ended",detail:"Call closed — start again anytime",chip:"border-[color-mix(in_srgb,var(--hud-ink)_12%,transparent)] text-[var(--scout-chrome-ink-faint)]",iconWrap:"border-[color-mix(in_srgb,var(--hud-ink)_10%,transparent)] bg-[color-mix(in_srgb,var(--hud-ink)_4%,transparent)] text-[var(--scout-chrome-ink-faint)]"}:{label:"Ready",detail:"Talk continuously with Scoutbot",chip:"border-transparent bg-[color-mix(in_srgb,var(--hud-ink)_6%,transparent)] text-[var(--scout-chrome-ink-faint)]",iconWrap:"border-transparent bg-[color-mix(in_srgb,var(--hud-ink)_5%,transparent)] text-[var(--scout-chrome-ink-faint)]"}}function ue({state:r,onMinimize:a,onExpand:n,layout:p="compact"}){const i=ee(r),s=p==="page";return e.jsxs("header",{className:`flex items-start ${s?"gap-3.5 px-5 py-4":"gap-2.5 px-3.5 py-3"}`,children:[e.jsx("div",{className:`${s?"size-9":"size-7"} mt-px flex shrink-0 items-center justify-center rounded-md border ${i.iconWrap}`,children:r==="connecting"?e.jsx(h,{size:s?14:12,className:"animate-spin"}):r==="live"?e.jsxs("span",{className:"relative flex size-2",children:[e.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-lime-300/35"}),e.jsx("span",{className:"relative inline-flex size-2 rounded-full bg-lime-300/90"})]}):e.jsx(z,{size:s?14:12})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("h2",{className:`truncate font-medium text-[var(--scout-chrome-ink-strong)] ${s?"text-2xl":"text-base"}`,children:"Live voice"}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsx("span",{className:`rounded border px-1.5 py-px font-mono text-xs uppercase tracking-[0.1em] ${i.chip}`,children:i.label}),n&&e.jsx("button",{type:"button",onClick:n,title:s?"Return to compact live voice view":"Open full live voice view","aria-label":s?"Return to compact live voice view":"Open full live voice view",className:"flex size-6 items-center justify-center rounded-md text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink-strong)]",children:s?e.jsx(B,{size:12}):e.jsx(H,{size:12})}),a&&e.jsx("button",{type:"button",onClick:a,title:"Collapse live voice into the status bar","aria-label":"Collapse live voice into the status bar",className:"flex size-6 items-center justify-center rounded-md text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink-strong)]",children:e.jsx(q,{size:12})})]})]}),e.jsx("p",{className:`mt-0.5 leading-snug text-[var(--scout-chrome-ink-faint)] ${s?"text-base":"text-sm"}`,children:i.detail})]})]})}function pe({dictationActive:r,layout:a="compact"}){const{state:n,error:p,trace:i,chatState:s,sessionAction:v,startCall:M,endCall:L,startNewChat:E,switchChat:T,updatePreferredModel:R,clearTrace:O,openVoiceSettings:P}=D(),b=n==="connecting"||n==="live",[g,V]=o.useState("controls"),w=se(p),m=a==="page",[c,f]=o.useState(""),[k,W]=o.useState(!1),[l,C]=o.useState(!1),[S,d]=o.useState(null);o.useEffect(()=>{!l&&s?.config.model&&f(s.config.model)},[s?.config.model,l]);const _=async()=>{if(!(!c.trim()||l)){C(!0),d(null);try{const t=await R(c);f(t),d("Saved")}catch(t){d(t instanceof Error?t.message:"Could not save model.")}finally{C(!1)}}},j=n==="connecting"?{label:"Cancel connection",icon:e.jsx(h,{size:11,className:"animate-spin"}),tone:"border-amber-300/35 bg-amber-300/[0.10] text-amber-100 hover:bg-amber-300/[0.16]"}:n==="live"?{label:"End live voice",icon:e.jsx(K,{size:9,className:"fill-current"}),tone:"border-red-400/35 bg-red-400/[0.10] text-red-100 hover:bg-red-400/[0.16]"}:{label:"Start live voice",icon:e.jsx(J,{size:10,className:"fill-current"}),tone:"border-lime-300/40 bg-lime-300/[0.12] text-lime-100 hover:bg-lime-300/[0.18]"};return e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[e.jsx("nav",{className:`grid shrink-0 grid-cols-2 border-b border-[var(--scout-chrome-border-soft)] ${m?"px-5":"px-3.5"}`,"aria-label":"Live voice views",children:[{id:"controls",label:"Controls",icon:e.jsx(z,{size:11})},{id:"activity",label:"Activity",icon:e.jsx(Y,{size:11})}].map(t=>e.jsxs("button",{type:"button",onClick:()=>V(t.id),"aria-current":g===t.id,className:`-mb-px flex items-center justify-center gap-1.5 border-b-2 font-mono uppercase tracking-[0.1em] transition-colors ${m?"h-11 text-sm":"h-9 text-xs"} ${g===t.id?"border-lime-300/80 text-[var(--scout-chrome-ink-strong)]":"border-transparent text-[var(--scout-chrome-ink-faint)] hover:text-[var(--scout-chrome-ink-strong)]"}`,children:[t.icon,t.label,t.id==="activity"&&i.length>0&&e.jsx("span",{className:"rounded-full bg-[color-mix(in_srgb,var(--hud-ink)_10%,transparent)] px-1.5 py-px font-mono text-xs text-[var(--scout-chrome-ink-faint)]",children:i.length})]},t.id))}),g==="activity"?e.jsxs("div",{className:`flex min-h-0 flex-1 flex-col ${m?"p-5":"p-3.5"}`,children:[e.jsxs("div",{className:"mb-2 flex shrink-0 items-center justify-between",children:[e.jsx("p",{className:N,children:"Session activity"}),i.length>0&&e.jsx("button",{type:"button",onClick:O,className:"font-mono text-xs uppercase tracking-[0.09em] text-[var(--scout-chrome-ink-ghost)] transition-colors hover:text-[var(--scout-chrome-ink-strong)]",children:"Clear"})]}),i.length===0?e.jsx("div",{className:"flex flex-1 items-center justify-center rounded-lg border border-dashed border-[color-mix(in_srgb,var(--hud-ink)_10%,transparent)] px-6 text-center text-sm leading-relaxed text-[var(--scout-chrome-ink-faint)]",children:"Start a call to record requests, replies, navigation attempts, and delivery results."}):e.jsx("ol",{className:`min-h-0 flex-1 overflow-y-auto ${x}`,children:i.map((t,A)=>e.jsxs("li",{className:`px-2.5 py-2 ${A>0?"border-t border-[var(--scout-chrome-border-soft)]":""}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-1.5",children:[e.jsx("span",{className:`mt-px shrink-0 rounded border px-1 py-px font-mono text-xs uppercase tracking-[0.08em] ${ie(t.kind)}`,children:re(t.kind)}),e.jsx("span",{className:"min-w-0 text-sm leading-snug text-[var(--scout-chrome-ink-strong)]",children:t.label})]}),e.jsx("time",{className:"shrink-0 font-mono text-xs text-[var(--scout-chrome-ink-ghost)]",children:te(t.at)})]}),t.detail&&e.jsx("span",{className:"mt-1 block whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-[var(--scout-chrome-ink-faint)]",children:t.detail})]},t.id))})]}):e.jsxs("div",{className:`flex min-h-0 w-full flex-1 flex-col overflow-y-auto ${m?"mx-auto max-w-2xl gap-4 p-5":"gap-2.5 p-3.5"}`,children:[e.jsxs("section",{className:`${x} shrink-0 p-3`,children:[e.jsx("p",{className:"text-base font-medium text-[var(--scout-chrome-ink-strong)]",children:"Live conversation"}),e.jsx("p",{className:"mt-0.5 text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:n==="live"?"Microphone and spoken replies are active.":n==="connecting"?"Opening the audio connection…":"Start when you are ready to speak."}),e.jsxs("button",{type:"button",disabled:r&&!b,onClick:()=>{b?L():M()},className:`mt-3 flex h-9 w-full items-center justify-center gap-2 rounded-md border font-mono text-sm uppercase tracking-[0.1em] transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${j.tone}`,children:[j.icon,j.label]}),r&&!b&&e.jsx("p",{className:"mt-2 text-xs leading-relaxed text-amber-200/80",children:"Finish dictation before starting a live call."}),w&&e.jsx("p",{className:"mt-2 rounded-md border border-red-400/30 bg-red-400/[0.08] px-2 py-1.5 text-sm leading-relaxed text-red-100",children:w})]}),e.jsxs("section",{className:`${x} shrink-0 p-3`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(F,{size:11,className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]"}),e.jsx("p",{className:N,children:"Live chat"})]}),e.jsx("p",{className:"mt-1.5 truncate text-base text-[var(--scout-chrome-ink-strong)]",title:s?.session.id,children:s?.session.title||"Loading chat…"}),e.jsx("p",{className:"mt-0.5 text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Context stays with this chat when voice stops or the panel closes."}),e.jsxs("div",{className:"mt-2.5 flex min-w-0 items-center gap-1.5",children:[s&&s.sessions.length>1&&e.jsxs("label",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"sr-only",children:"Switch live chat"}),e.jsx("select",{value:s.session.id,disabled:!!v,onChange:t=>{T(t.target.value)},className:`h-8 w-full min-w-0 px-2 font-mono text-sm disabled:cursor-wait disabled:opacity-50 ${$}`,title:"Switch live chat; an active voice connection will end",children:s.sessions.map(t=>e.jsxs("option",{value:t.id,children:[t.title||`Chat ${t.id.slice(0,8)}`," · ",t.messageCount," msg"]},t.id))})]}),e.jsxs("button",{type:"button",onClick:()=>{E()},disabled:!s||!!v,title:"Start a new chat; an active voice connection will end",className:`flex h-8 shrink-0 items-center justify-center gap-1.5 px-2.5 font-mono text-xs uppercase tracking-[0.09em] disabled:cursor-wait ${y}`,children:[v==="new"?e.jsx(h,{size:10,className:"animate-spin"}):e.jsx(I,{size:10}),"New chat"]})]})]}),e.jsxs("section",{className:`${x} shrink-0 p-3`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:N,children:"Scoutbot reply model"}),e.jsx("p",{className:"mt-1 truncate font-mono text-base text-[var(--scout-chrome-ink-strong)]",children:s?.config.model||"—"})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[s?.config.provider&&e.jsx("span",{className:"font-mono text-xs uppercase tracking-[0.08em] text-[var(--scout-chrome-ink-ghost)]",children:s.config.provider}),e.jsx("button",{type:"button",onClick:()=>{d(null),W(t=>!t)},"aria-expanded":k,className:`flex h-7 items-center px-2 font-mono text-xs uppercase tracking-[0.09em] ${y}`,children:k?"Close":"Change"})]})]}),k&&e.jsxs("div",{className:"mt-2.5 border-t border-[var(--scout-chrome-border-soft)] pt-2.5",children:[e.jsx("p",{className:"text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Used for typed and live Scoutbot replies."}),e.jsxs("div",{className:"mt-2 flex gap-1.5",children:[e.jsx("input",{value:c,onChange:t=>{f(t.target.value),d(null)},onKeyDown:t=>{t.key==="Enter"&&_()},placeholder:"gpt-4.1-mini","aria-label":"Preferred Scoutbot model",className:`h-8 min-w-0 flex-1 px-2 font-mono text-sm ${$}`}),e.jsx("button",{type:"button",onClick:()=>{_()},disabled:l||!c.trim()||c.trim()===s?.config.model,className:`flex h-8 min-w-14 items-center justify-center px-2 font-mono text-xs uppercase tracking-[0.09em] ${y}`,children:l?e.jsx(h,{size:10,className:"animate-spin"}):"Apply"})]}),S&&e.jsx("p",{className:"mt-1.5 font-mono text-xs text-[var(--scout-chrome-ink-faint)]",children:S})]})]}),e.jsxs("button",{type:"button",onClick:P,className:"mt-auto flex h-8 w-full shrink-0 items-center justify-center gap-1.5 rounded-md font-mono text-xs uppercase tracking-[0.09em] text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink-strong)]",children:[e.jsx(Z,{size:11}),"Voice settings"]})]})]})}function te(r){return new Date(r).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function se(r){if(!r)return null;const a=r.toLowerCase();return a.includes("active response in progress")||a.includes("conversation already has an active response")?null:a.includes("realtime voice call is already active")?"Live voice is still running on this Scout host. Stop it from the footer, or wait a moment for it to finish closing.":r}function re(r){switch(r){case"navigation":return"Navigate";case"scoutbot":return"Scoutbot";case"agent":return"Agent ask";case"error":return"Error";default:return"Voice"}}function ie(r){switch(r){case"navigation":return"border-sky-300/25 bg-sky-300/[0.06] text-sky-100/80";case"scoutbot":return"border-violet-300/25 bg-violet-300/[0.06] text-violet-100/80";case"agent":return"border-amber-300/25 bg-amber-300/[0.06] text-amber-100/80";case"error":return"border-red-300/25 bg-red-300/[0.06] text-red-100/80";default:return"border-lime-300/20 bg-lime-300/[0.05] text-lime-100/70"}}export{F as H,J as P,ue as S,pe as a};
@@ -1 +0,0 @@
1
- import{r as n,j as e}from"./index-BZovGpDk.js";import{a as j}from"./api-h5zurxmi.js";import{u as g}from"./sse-Bb0EOcU9.js";import{u as N}from"./tail-events-C12pfUax.js";import{B as I}from"./BackToPicker-D6WgIDb-.js";import{ConversationScreen as S}from"./ConversationScreen-Br0QQ3xo.js";import{S as k,a as y}from"./SessionObserve-B-SkP3tu.js";/* empty css */import"./index-BWHgHrtv.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./createLucideIcon-DCq_3fQn.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./keyboard-nav-CHo_xmjw.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-CrGUKNRv.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./file-text-BITQqGtF.js";import"./ConversationComposer-CjRXFkvY.js";import"./Provider-p-xuaAoE.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./message-markup-DlVX-iuc.js";import"./mentions-BjXfeF7t.js";import"./AgentDetailCard-Dtc02KUO.js";import"./AgentLiveActions-DwScaVRF.js";import"./terminal-takeover--05EYhJm.js";import"./openContent-C6XO6kr5.js";import"./eye-DkU59kfl.js";import"./terminal-xGf_F3y7.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./AgentAvatar-CneOa70z.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-CRmdtuL7.js";import"./ConversationFeedRows-CgRTIpAv.js";import"./ConversationPanels-DCkcLIHk.js";import"./use-reduced-motion-C8cWvIZ3.js";import"./activity-DS0u0Itf.js";import"./message-circle-BwVx5X0q.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./ConversationStatus-BJ1CMbAv.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-BkBcDYm-.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-BlmGoxCE.js";import"./ObserveTextFlow-DWNlmTVm.js";import"./SessionObserveEvidence-CF5jnH3-.js";import"./wrench-_tHBGTop.js";import"./external-link-Dd8xaveL.js";function p(o){const s=o?.trim()??"",i=s.split(/[\\/]/).filter(Boolean).at(-1)??s;return i.endsWith(".jsonl")?i.slice(0,-6):i}function R(o){return o.startsWith("native:process:")}function x(o){const[s,i]=n.useState(null),[c,l]=n.useState(!0),[r,d]=n.useState(null),t=n.useRef(null),a=n.useCallback(async()=>{d(null);try{const m=await j(`/api/session-ref/${encodeURIComponent(o)}`);i(m)}catch(m){i(null),d(m instanceof Error?m.message:String(m))}finally{l(!1)}},[o]);n.useEffect(()=>{l(!0),a()},[a]);const u=n.useCallback(()=>{t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,a()},150)},[a]);return g(u),N(m=>{const v=p(m.sessionId),b=p(o),h=s?.kind==="observe"?p(s.observe.sessionId??s.observe.refId):"",f=s?.kind==="observe"?p(s.observe.data.metadata?.session?.externalSessionId):"";v!==b&&(!h||v!==h)&&(!f||v!==f)||u()}),n.useEffect(()=>()=>{t.current&&clearTimeout(t.current)},[]),{lookup:s,loading:c,error:r}}function _e({sessionRef:o}){const{lookup:s,loading:i,error:c}=x(o);return s?.kind==="observe"?e.jsx(y,{data:s.observe.data,agentId:s.observe.agentId??s.session?.agentId??void 0,sessionId:s.observe.sessionId??s.observe.refId,surface:"context",observeSource:s.observe.source,observeFidelity:s.observe.fidelity}):e.jsx("aside",{className:"s-observe-rail s-observe-rail--context",children:e.jsxs("div",{children:[e.jsx("div",{className:"s-observe-rail-label",children:s?.kind==="conversation"?"Conversation":"Session context"}),e.jsx("div",{className:"s-observe-empty",children:i?"Resolving session reference":c?"Session context unavailable":"No observe context captured for this session"})]})})}function es({sessionRef:o,navigate:s,renderBeforeContent:i,showObserveRail:c=!0,onLookup:l}){const{lookup:r,loading:d,error:t}=x(o);if(n.useEffect(()=>{r&&l?.(r)},[r,l]),r?.kind==="conversation")return e.jsxs(e.Fragment,{children:[i?.(r),e.jsx(S,{conversationId:r.conversationId,navigate:s})]});if(r?.kind==="observe")return e.jsxs(e.Fragment,{children:[i?.(r),e.jsx(k,{data:r.observe.data,agentId:r.observe.agentId??r.session?.agentId??void 0,sessionId:r.observe.sessionId??r.observe.refId,conversationId:r.session?.id??null,showRail:c,observeSource:r.observe.source,observeFidelity:r.observe.fidelity})]});if(d)return e.jsx("div",{className:"s-sessions-screen s-inbox-thread-redesign",children:e.jsx("section",{className:"s-thread-overview",children:e.jsxs("div",{className:"s-thread-overview-copy",children:[e.jsxs("div",{className:"s-sessions-header s-thread-overview-heading",children:[e.jsx("h2",{className:"s-page-title",children:"Session"}),e.jsx("span",{className:"s-meta s-tabular",children:o.slice(0,8)})]}),e.jsxs("p",{className:"s-thread-overview-summary s-session-ref-loading",children:[e.jsx("span",{className:"s-session-ref-loading-dot"}),e.jsx("span",{className:"s-session-ref-loading-dot"}),e.jsx("span",{className:"s-session-ref-loading-dot"}),"Resolving session reference"]})]})})});const a=R(o);return e.jsx("div",{className:"s-sessions-screen s-inbox-thread-redesign",children:e.jsx("section",{className:"s-thread-overview",children:e.jsxs("div",{className:"s-thread-overview-copy",children:[e.jsxs("div",{className:"s-sessions-header s-thread-overview-heading",children:[e.jsx("h2",{className:"s-page-title",children:a?"Process trace unavailable":"Session not found"}),e.jsx("span",{className:"s-meta s-tabular",children:o.slice(0,8)})]}),e.jsx("p",{className:"s-thread-overview-summary",children:a?"This is a live process handle, not a transcript session. No replayable session archive is attached yet.":"This session may have ended or the archive is not available on this machine."}),t&&e.jsx("p",{className:"s-session-ref-error-detail",children:t}),e.jsx("div",{className:"s-session-ref-nav-hint",children:e.jsx(I,{slot:"sessions",fallback:{view:"sessions"},navigate:s})})]})})})}export{_e as SessionRefContextRail,es as SessionRefScreen};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-BZovGpDk.js";import{RawSessionsTable as t}from"./RawSessionsTable-B7WKmXrk.js";/* empty css */import"./DataTable-Dzqiaha4.js";/* empty css */import"./api-h5zurxmi.js";import"./time-Dhsh_2EG.js";import"./tail-events-C12pfUax.js";import"./index-BWHgHrtv.js";import"./openContent-C6XO6kr5.js";import"./Provider-p-xuaAoE.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-Bb0EOcU9.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";function W({navigate:o}){return r.jsx(t,{navigate:o})}export{W as SessionsScreen};