@openscout/scout 0.2.102 → 0.2.105

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 (505) hide show
  1. package/README.md +37 -0
  2. package/bin/scout.mjs +6 -0
  3. package/bin/scoutd +0 -0
  4. package/dist/build-manifest.json +4 -4
  5. package/dist/chat.mjs +285 -0
  6. package/dist/client/assets/ActivityScreen-CcDdQTBK.js +1 -0
  7. package/dist/client/assets/{AddProjectForm-DfbjlFfy.js → AddProjectForm-CHNJ4NnS.js} +1 -1
  8. package/dist/client/assets/{AdventureEvidence-Dzz9VbuE.js → AdventureEvidence-B4mEvXeD.js} +1 -1
  9. package/dist/client/assets/{AdventureReader-ClMxT0e4.js → AdventureReader-ZsBDQITY.js} +1 -1
  10. package/dist/client/assets/{AdventureScenery-D548O0x4.js → AdventureScenery-DSxDlqG1.js} +1 -1
  11. package/dist/client/assets/AgentAdventures-BxrYq_2v.js +1 -0
  12. package/dist/client/assets/{AgentAvatar-BIwg54Tj.js → AgentAvatar-NZOqcsB2.js} +1 -1
  13. package/dist/client/assets/AgentConfigurationScreen-BhD1PEAM.js +1 -0
  14. package/dist/client/assets/AgentDefinitionsWorkspace-BqS6MXqF.js +1 -0
  15. package/dist/client/assets/{AgentDetailCard-CFDE8TLi.js → AgentDetailCard-MIEBKw_S.js} +1 -1
  16. package/dist/client/assets/AgentFloorView-A0dDRlRV.js +1 -0
  17. package/dist/client/assets/{AgentFloorWorld-BDJmXl3C.js → AgentFloorWorld-BTqwmK5G.js} +1 -1
  18. package/dist/client/assets/AgentInfoScreen-DuaN0sgE.js +1 -0
  19. package/dist/client/assets/{AgentLaneCard-C6YmwPxQ.js → AgentLaneCard-C4rKLLdT.js} +1 -1
  20. package/dist/client/assets/{AgentLaneChrome-D9uJ4QY7.js → AgentLaneChrome-fGC-ZrJS.js} +1 -1
  21. package/dist/client/assets/{AgentLaneDetailSheet-KYckCBCX.js → AgentLaneDetailSheet-BTF4_th9.js} +1 -1
  22. package/dist/client/assets/{AgentLaneSummaryResize-BBYBS3DO.js → AgentLaneSummaryResize-DgSeA_vS.js} +1 -1
  23. package/dist/client/assets/AgentLanesEmbedScreen-CeNiaZ9_.js +1 -0
  24. package/dist/client/assets/{AgentLanesPreflight-pw2vMO3Q.js → AgentLanesPreflight-CcS23wij.js} +1 -1
  25. package/dist/client/assets/{AgentLanesView-aAyC7lHf.js → AgentLanesView-WZhEDBFE.js} +1 -1
  26. package/dist/client/assets/{AgentLiveActions-lYzicnNa.js → AgentLiveActions-6Kfr1uOT.js} +1 -1
  27. package/dist/client/assets/AgentMasterScreen-DUDUTAnU.js +1 -0
  28. package/dist/client/assets/{AgentSessions-Cox2zS-e.js → AgentSessions-CO1WGa8Z.js} +2 -2
  29. package/dist/client/assets/AgentsConsole-BQOWkj35.js +1 -0
  30. package/dist/client/assets/AgentsScreen-BMNAj1PH.js +1 -0
  31. package/dist/client/assets/AgentsSubnav-CeHhuzyM.js +1 -0
  32. package/dist/client/assets/{AstronautSuit-C-4I5YKi.js → AstronautSuit-D67fIBdR.js} +1 -1
  33. package/dist/client/assets/{AtopView-DKm-ERYC.js → AtopView-Ck30FbzG.js} +1 -1
  34. package/dist/client/assets/{BackToPicker-Bys9ColC.js → BackToPicker-CkBhGRlD.js} +1 -1
  35. package/dist/client/assets/BriefingDetailScreen-yZG8_m4h.js +1 -0
  36. package/dist/client/assets/{BriefingsScreen-D4Zf31Y6.js → BriefingsScreen-DTxYMr3a.js} +1 -1
  37. package/dist/client/assets/{BrokerMetadataPanel-1GoSl2BV.js → BrokerMetadataPanel-crirZCdo.js} +1 -1
  38. package/dist/client/assets/BrokerScreen-CT37VQiL.js +8 -0
  39. package/dist/client/assets/Canvas-CRP0KjKb.js +1 -0
  40. package/dist/client/assets/{CastPicker-BuwE_JQp.js → CastPicker-ZPomvOf-.js} +1 -1
  41. package/dist/client/assets/ChannelComposer-BVItWlEz.js +1 -0
  42. package/dist/client/assets/ChannelSidebar-B-2spawY.js +1 -0
  43. package/dist/client/assets/{CharacterFamilyPreview-CfO3j8Of.js → CharacterFamilyPreview-ckVkecDO.js} +1 -1
  44. package/dist/client/assets/ChatAvatar-DKBsbOqk.js +1 -0
  45. package/dist/client/assets/ChatBits-CLJ71hTY.js +1 -0
  46. package/dist/client/assets/{ChatCollapsedStrip-TV0j1xTB.js → ChatCollapsedStrip-Co0NmqOO.js} +1 -1
  47. package/dist/client/assets/ChatRightPanel-pKQtkAgl.js +1 -0
  48. package/dist/client/assets/ChatSpaceSurface-NrLwdPkE.js +1 -0
  49. package/dist/client/assets/ChatSpaceTheme-BPMgPdVK.css +1 -0
  50. package/dist/client/assets/ChatSpaceTheme-D37Jk7bl.js +1 -0
  51. package/dist/client/assets/{CodeDiffPane-DB6-mqtX.js → CodeDiffPane-D-iv28LJ.js} +1 -1
  52. package/dist/client/assets/{CodeProjectPicker-B_LNLpIK.js → CodeProjectPicker-CZ3gDdiT.js} +1 -1
  53. package/dist/client/assets/{CodeScreen-C9H160XS.js → CodeScreen-CSC-zbP9.js} +1 -1
  54. package/dist/client/assets/{CommsCanvas-DOKw3Q8i.js → CommsCanvas-DdNAwjGW.js} +1 -1
  55. package/dist/client/assets/{CommsDeck-C18JA7rK.js → CommsDeck-mGWY7Ivi.js} +1 -1
  56. package/dist/client/assets/{CommsFlowGraph-Czg-KTS0.js → CommsFlowGraph-voDD9M5R.js} +1 -1
  57. package/dist/client/assets/{CommsFlowMap-CzBWvSa5.js → CommsFlowMap-C33sgD48.js} +1 -1
  58. package/dist/client/assets/{CommsSelection-g1twA-Lb.js → CommsSelection-BL8aYD7z.js} +1 -1
  59. package/dist/client/assets/{ConversationComposer-B7RU6LKd.js → ConversationComposer-DNcn5U6D.js} +1 -1
  60. package/dist/client/assets/ConversationFeedRows-RnYSa7Io.js +1 -0
  61. package/dist/client/assets/ConversationHeader-Y9TEJxP_.js +1 -0
  62. package/dist/client/assets/{ConversationPanels-C9yCAoJy.js → ConversationPanels-6pprBpmq.js} +2 -2
  63. package/dist/client/assets/ConversationScreen-tpj4cqWs.js +2 -0
  64. package/dist/client/assets/{ConversationStatus-CK-YfLpi.js → ConversationStatus-Cv-7hErW.js} +1 -1
  65. package/dist/client/assets/{CrewAvatar-CJhuqTsJ.js → CrewAvatar-zgzC3cbU.js} +1 -1
  66. package/dist/client/assets/{CrewSprite-hgpA3SWB.js → CrewSprite-Dp9KBBGY.js} +1 -1
  67. package/dist/client/assets/CrewWorkspaces-DDuYMByu.css +1 -0
  68. package/dist/client/assets/CrewWorkspaces-K2jcyLec.js +1 -0
  69. package/dist/client/assets/{DataTable-BMOZ1-z8.js → DataTable-av71ehJV.js} +1 -1
  70. package/dist/client/assets/{DispatchAftermath-DDlwqSCY.js → DispatchAftermath-CcYGUB10.js} +1 -1
  71. package/dist/client/assets/{DocumentFocusViewer-f12RRQpV.js → DocumentFocusViewer-DlMiEALb.js} +1 -1
  72. package/dist/client/assets/{EmbeddableSurfacesLab-DGl9EMRV.js → EmbeddableSurfacesLab-CTkO_tQR.js} +1 -1
  73. package/dist/client/assets/{EmptyState-uyYN5piI.js → EmptyState-CYUwYyAW.js} +1 -1
  74. package/dist/client/assets/{FileViewerPane-HtiDbj9N.js → FileViewerPane-Cxhixtks.js} +1 -1
  75. package/dist/client/assets/FlightObserveScreen-CvzhzuWc.js +1 -0
  76. package/dist/client/assets/{FloorContextSheet-DV-SYA0K.js → FloorContextSheet-Vj_wVZq1.js} +1 -1
  77. package/dist/client/assets/{FloorExchangePanel-D59nvRCF.js → FloorExchangePanel-CjHSDXad.js} +1 -1
  78. package/dist/client/assets/{FloorMessagePasses-BCwsz9VS.js → FloorMessagePasses-BG4ebnX5.js} +1 -1
  79. package/dist/client/assets/{FloorReplay-BHo79HCD.js → FloorReplay-BoYaGY9t.js} +1 -1
  80. package/dist/client/assets/FloorResourcesSheet-_Iy5UqgY.js +1 -0
  81. package/dist/client/assets/{FloorSavedWork-2tjBoy06.js → FloorSavedWork-jbtRs-YE.js} +1 -1
  82. package/dist/client/assets/{FloorTacticalHUD-Bngao6sn.js → FloorTacticalHUD-BhyOqlL5.js} +1 -1
  83. package/dist/client/assets/{FollowScreen-eHXOlK-u.js → FollowScreen-CupyOgt4.js} +1 -1
  84. package/dist/client/assets/HarnessMark-DSvM_H7H.js +1 -0
  85. package/dist/client/assets/HarnessesScreen-DyjqbZ4k.js +1 -0
  86. package/dist/client/assets/{HerdrSession-CtJOUn7H.js → HerdrSession-Dcm3vf9U.js} +1 -1
  87. package/dist/client/assets/{HomeHero-Cvwx2H0w.js → HomeHero-pIZtE1cC.js} +1 -1
  88. package/dist/client/assets/{HostAdvisorView-CTJXIc1Q.js → HostAdvisorView-Dv5meXo2.js} +1 -1
  89. package/dist/client/assets/InviteLandingScreen-xZQ2na1z.js +1 -0
  90. package/dist/client/assets/InviteSheet--5Zjct25.js +1 -0
  91. package/dist/client/assets/JumpPalette-BmiSOEmp.js +1 -0
  92. package/dist/client/assets/{KnowledgeSearchInspector-DwGMVmFL.js → KnowledgeSearchInspector-B8yiM524.js} +1 -1
  93. package/dist/client/assets/KnowledgeSearchScreen-BPqAjHnH.js +1 -0
  94. package/dist/client/assets/{LaneToolHoverCard-C6YehJqD.js → LaneToolHoverCard-D2cnTeUd.js} +1 -1
  95. package/dist/client/assets/LaneTraceDetailSheet-jl4XQmEx.js +1 -0
  96. package/dist/client/assets/{LaneTraceEventFocus-WLNZZVi_.js → LaneTraceEventFocus-BLhVHwff.js} +1 -1
  97. package/dist/client/assets/{MeshCanvas-FDDGE69h.js → MeshCanvas-BR25OBTJ.js} +1 -1
  98. package/dist/client/assets/{MeshCanvasMinimap-CGRzQCac.js → MeshCanvasMinimap-ClVolr4-.js} +1 -1
  99. package/dist/client/assets/MeshScreen-BW1dMFWF.js +1 -0
  100. package/dist/client/assets/{MeshTopologyView-C2Cv_2gx.js → MeshTopologyView-BT3ke2D1.js} +2 -2
  101. package/dist/client/assets/MessagesScreen-CtNMfIvC.js +1 -0
  102. package/dist/client/assets/{MissionContextRail-CVSZJnvX.js → MissionContextRail-CafjuseK.js} +1 -1
  103. package/dist/client/assets/MissionControlView-BjPOViGY.js +1 -0
  104. package/dist/client/assets/{MissionFocusOverlay-B9SiuO-i.js → MissionFocusOverlay-nhy3hkxQ.js} +1 -1
  105. package/dist/client/assets/MissionLeftAgentRow-Dms0DBjO.js +1 -0
  106. package/dist/client/assets/{MissionLogPane-CMBiI29U.js → MissionLogPane-DiUf3vWW.js} +1 -1
  107. package/dist/client/assets/NativeAreaScreen-BQSTo8As.js +1 -0
  108. package/dist/client/assets/NativeAreaScreen-Brix6xDB.js +1 -0
  109. package/dist/client/assets/NativeAreaScreen-D7HyQNlM.js +1 -0
  110. package/dist/client/assets/{NewAgentModal-Cl4nsGhu.js → NewAgentModal-BQ2wQ5gp.js} +1 -1
  111. package/dist/client/assets/NewChatComposer-BEXS8vV6.js +19 -0
  112. package/dist/client/assets/{NewChatOrigin-CyPPWTJP.js → NewChatOrigin-C8ROO4ps.js} +1 -1
  113. package/dist/client/assets/{NodeDetailPanel-BUG8rOb-.js → NodeDetailPanel-BNTqYC7m.js} +1 -1
  114. package/dist/client/assets/{NodeMenu-Fw8ATWQA.js → NodeMenu-CcOeFRCB.js} +1 -1
  115. package/dist/client/assets/{ObserveEmbedScreen-BPiSXXvm.js → ObserveEmbedScreen-Dh30EjAQ.js} +2 -2
  116. package/dist/client/assets/{ObserveTextFlow-ET0dD1wO.js → ObserveTextFlow-CC5mnngm.js} +2 -2
  117. package/dist/client/assets/{ObservedTopologyPanel-DkEkQzo-.js → ObservedTopologyPanel-DF6tRZL_.js} +1 -1
  118. package/dist/client/assets/OpenScoutAppShell-D9pgw36i.js +31 -0
  119. package/dist/client/assets/OpsAgentsView-D3rM0udq.js +1 -0
  120. package/dist/client/assets/OpsScreen-DySeNQ1V.js +1 -0
  121. package/dist/client/assets/OpsSubnav-C9E0r3GZ.js +1 -0
  122. package/dist/client/assets/ProjectAgentProfile-FUav75j2.js +1 -0
  123. package/dist/client/assets/{ProjectAgentProfileBar-C1fR65Eh.js → ProjectAgentProfileBar-C8z22pJ2.js} +1 -1
  124. package/dist/client/assets/ProjectAgentProfileHero-BLK0EwMg.js +1 -0
  125. package/dist/client/assets/ProjectsInbox-DfCXReZK.js +2 -0
  126. package/dist/client/assets/ProjectsRail-CELVubfJ.js +1 -0
  127. package/dist/client/assets/ProjectsScreen-DMw4TLKy.js +1 -0
  128. package/dist/client/assets/ProjectsThreadAside-D1Sh4fnX.js +1 -0
  129. package/dist/client/assets/{Provider-5Hotn7NQ.js → Provider-CNZluAZb.js} +2 -2
  130. package/dist/client/assets/{RailRow-BYguXNm4.js → RailRow-DUPqXMZh.js} +1 -1
  131. package/dist/client/assets/RailToggle-BwmY70B8.js +1 -0
  132. package/dist/client/assets/RawSessionsTable-6OVJq0JZ.js +1 -0
  133. package/dist/client/assets/RealtimeVoiceScreen-D41TYY0x.js +9 -0
  134. package/dist/client/assets/{RenderedWorkerSprite-CvdWO32C.js → RenderedWorkerSprite-C8fxndAh.js} +1 -1
  135. package/dist/client/assets/{ReplayClock-B7JLTp8A.js → ReplayClock-DUVJjrIu.js} +1 -1
  136. package/dist/client/assets/{ReplayLog-DZTpf2CW.js → ReplayLog-Bek1Vc4W.js} +1 -1
  137. package/dist/client/assets/{ReplayOutpost-CvWQa30T.js → ReplayOutpost-DlRg3172.js} +1 -1
  138. package/dist/client/assets/{RepoDiffEmbedScreen-Cbu0_PJW.js → RepoDiffEmbedScreen-CVUMnt6A.js} +1 -1
  139. package/dist/client/assets/{RepoDiffPageScreen-Chwm6GXL.js → RepoDiffPageScreen-D9-s5PyB.js} +1 -1
  140. package/dist/client/assets/{RepoDiffViewer-C2mb0Wj-.js → RepoDiffViewer-D7FN-oyY.js} +1 -1
  141. package/dist/client/assets/RepoDiffViewerLazy-BpMR7tlx.js +2 -0
  142. package/dist/client/assets/{ReposScreen-C7JZQmyh.js → ReposScreen-BQ7HO1om.js} +2 -2
  143. package/dist/client/assets/{RiggedWorkerCharacter-DNe731GE.js → RiggedWorkerCharacter-CJMWlvV-.js} +1 -1
  144. package/dist/client/assets/{SageModelStudio-BR1J2D4R.js → SageModelStudio-B526NSnw.js} +1 -1
  145. package/dist/client/assets/{ScoutDeckSurface-flRamdvE.js → ScoutDeckSurface-ChkvGyEW.js} +1 -1
  146. package/dist/client/assets/{ScoutSurface-BpklGmDL.js → ScoutSurface-6g1f5chk.js} +1 -1
  147. package/dist/client/assets/{ScoutbotFxLab-DeK7ySWZ.js → ScoutbotFxLab-BuwBdnPf.js} +1 -1
  148. package/dist/client/assets/{SecondaryNav-BkTn5tkq.js → SecondaryNav-Bs-_VwTC.js} +1 -1
  149. package/dist/client/assets/{SessionEmbedScreen-CcQN6xlo.js → SessionEmbedScreen-C2wf35-P.js} +1 -1
  150. package/dist/client/assets/{SessionObserve-DaqDhqDI.js → SessionObserve-B64YsYhy.js} +9 -9
  151. package/dist/client/assets/{SessionObserve-BOBJSfs0.css → SessionObserve-CDdJ7fAE.css} +1 -1
  152. package/dist/client/assets/{SessionObserveEvidence-Drv-D8Oh.js → SessionObserveEvidence-CS1aQBpQ.js} +1 -1
  153. package/dist/client/assets/SessionRefScreen-DURV0MpF.js +1 -0
  154. package/dist/client/assets/SessionsScreen-D71ZR-8t.js +1 -0
  155. package/dist/client/assets/{SettingsDrawer-BDapR4E9.js → SettingsDrawer-Nz98oBVl.js} +3 -3
  156. package/dist/client/assets/SettingsScreen-CYBHal6y.js +1 -0
  157. package/dist/client/assets/{SharedFloorCharacter-CSYG_t9t.js → SharedFloorCharacter-V04kD5T9.js} +1 -1
  158. package/dist/client/assets/SharedWorkFloor-C0xxW4SN.js +2 -0
  159. package/dist/client/assets/{ShikiPane-BudrOxNK.js → ShikiPane-XwFI-pCp.js} +1 -1
  160. package/dist/client/assets/{SlidePanel-Datu7XG4.js → SlidePanel-BMpkXai_.js} +1 -1
  161. package/dist/client/assets/SpaceSwitcher-BfeIf-ad.js +1 -0
  162. package/dist/client/assets/{SpriteAvatar-BW1JzkDt.js → SpriteAvatar-aHeF4ZQZ.js} +1 -1
  163. package/dist/client/assets/{SproutActionSprite-DveCzg6l.js → SproutActionSprite-DI5N3gOj.js} +1 -1
  164. package/dist/client/assets/{StatusPill-MxYClPG5.js → StatusPill-Dw4LP7wu.js} +1 -1
  165. package/dist/client/assets/{TailView-Dn7uWmPz.js → TailView-BofjmUMJ.js} +2 -2
  166. package/dist/client/assets/Terminal-jIqnIZZ6.js +4 -0
  167. package/dist/client/assets/TerminalEmbedScreen-3XsjuySR.js +1 -0
  168. package/dist/client/assets/{TerminalHeaderMount-DCGstkZ4.js → TerminalHeaderMount-CwbQhXcI.js} +1 -1
  169. package/dist/client/assets/TerminalRelay--qOBwnbR.js +46 -0
  170. package/dist/client/assets/{TextDocumentSurface-BhYvAB0o.js → TextDocumentSurface-BK6Qy41F.js} +1 -1
  171. package/dist/client/assets/{TmuxPeek-BhK0V9Qt.js → TmuxPeek-DpUT9Tpc.js} +1 -1
  172. package/dist/client/assets/{VoicePermissionsPanel-CecFWzva.js → VoicePermissionsPanel-D35fOnQj.js} +1 -1
  173. package/dist/client/assets/{WorkDetailScreen-CwtRCm_-.js → WorkDetailScreen-Bcf_yHhU.js} +2 -2
  174. package/dist/client/assets/{WorkFilesViewer-DJHftsH9.js → WorkFilesViewer-t8AEyx3Q.js} +1 -1
  175. package/dist/client/assets/{WorkRunView-x5PH1byG.js → WorkRunView-_mhG_FR2.js} +1 -1
  176. package/dist/client/assets/WorldActorTalk-CKerDikx.js +1 -0
  177. package/dist/client/assets/{WorldCharacter-Dn4sIXNP.js → WorldCharacter-BRrj3MQN.js} +1 -1
  178. package/dist/client/assets/{WorldMinimap-Blqg0d5r.js → WorldMinimap-DOptgrc4.js} +1 -1
  179. package/dist/client/assets/{WorldSky-DV9bpvXj.js → WorldSky-D-RJzSa6.js} +1 -1
  180. package/dist/client/assets/{activity-CSUhvjD0.js → activity-BJqFrZyB.js} +1 -1
  181. package/dist/client/assets/{addon-fit-MR98IWES.js → addon-fit-CHohcvS3.js} +1 -1
  182. package/dist/client/assets/{addon-webgl-CIIKXrvK.js → addon-webgl-CaRy2x2b.js} +1 -1
  183. package/dist/client/assets/agent-autocomplete-_u9o5EZu.js +2 -0
  184. package/dist/client/assets/{agent-essentials-8t2il7PV.js → agent-essentials-bKWYOZaH.js} +1 -1
  185. package/dist/client/assets/{agent-floor-actor-3v9drnxh.js → agent-floor-actor-DW8zLht0.js} +1 -1
  186. package/dist/client/assets/{agent-lane-card-model-l0stnU9N.js → agent-lane-card-model-CeqQGp-8.js} +1 -1
  187. package/dist/client/assets/{agent-lane-detail-Db7KyAlf.js → agent-lane-detail-Ti3trpfH.js} +1 -1
  188. package/dist/client/assets/{agent-lane-preview-B8lsQJOQ.js → agent-lane-preview-Dpa3DuOn.js} +1 -1
  189. package/dist/client/assets/{agent-lanes-model-CX0wTcnF.js → agent-lanes-model-DMAdqCmK.js} +1 -1
  190. package/dist/client/assets/{agent-specialization-CiVxQsFT.js → agent-specialization-BplZUa_0.js} +1 -1
  191. package/dist/client/assets/{api-B9_IqFKY.js → api-BQYTwoz6.js} +1 -1
  192. package/dist/client/assets/{api-CaROe5_H.js → api-DSqpVKC7.js} +1 -1
  193. package/dist/client/assets/{arc.es-BzhWalCl.js → arc.es-CubLvQ4W.js} +1 -1
  194. package/dist/client/assets/{arrow-left-PuKdO3NM.js → arrow-left-DFfKAq0d.js} +1 -1
  195. package/dist/client/assets/{arrow-right-ldbfp4SZ.js → arrow-right-DmAWnyAH.js} +1 -1
  196. package/dist/client/assets/{arrow-up-right-Hn754ybA.js → arrow-up-right-B0aLKiyF.js} +1 -1
  197. package/dist/client/assets/at-sign-DM7xeppo.js +1 -0
  198. package/dist/client/assets/{book-open-BlJnpf2U.js → book-open-BL9qvhEI.js} +1 -1
  199. package/dist/client/assets/{bot-CfN9PSBF.js → bot-BhAVbcCA.js} +1 -1
  200. package/dist/client/assets/{cache-DEy9E34b.js → cache-DGBo3vIf.js} +1 -1
  201. package/dist/client/assets/chat-api-BPVC0asu.js +1 -0
  202. package/dist/client/assets/chat-space-model-B6Jg2CY4.js +4 -0
  203. package/dist/client/assets/{check-B8dMv3Is.js → check-g7D7-c1J.js} +1 -1
  204. package/dist/client/assets/{chevron-down-B5eMsn5c.js → chevron-down-CDzRQQGl.js} +1 -1
  205. package/dist/client/assets/{chevron-right-C7UGFpkl.js → chevron-right-DKGTLiqc.js} +1 -1
  206. package/dist/client/assets/{chevron-up-BHOEgHcn.js → chevron-up-DX7R6KY2.js} +1 -1
  207. package/dist/client/assets/{chunk-HRAB3GC3-C5X-kFhb.js → chunk-HRAB3GC3-Dvk_QpRq.js} +1 -1
  208. package/dist/client/assets/{clock-DFcRbtrl.js → clock-CQb4FeMf.js} +1 -1
  209. package/dist/client/assets/{code-xml-BmyLM0I2.js → code-xml-Cmadr3pQ.js} +1 -1
  210. package/dist/client/assets/{coffee-C_D9zooM.js → coffee-ljG1_krY.js} +1 -1
  211. package/dist/client/assets/{compass-DTZdCpv9.js → compass-CvzkzkIh.js} +1 -1
  212. package/dist/client/assets/content-0AXa0klu.js +1 -0
  213. package/dist/client/assets/content-BEyJ19Lx.js +1 -0
  214. package/dist/client/assets/content-BN5weWKW.js +1 -0
  215. package/dist/client/assets/content-BNokkm7C.js +1 -0
  216. package/dist/client/assets/content-BV4PUM9q.js +1 -0
  217. package/dist/client/assets/content-BxUPlcx5.js +1 -0
  218. package/dist/client/assets/content-CIC5sku8.js +1 -0
  219. package/dist/client/assets/content-CKJ9zb7Z.js +1 -0
  220. package/dist/client/assets/content-CdkTyxqk.js +1 -0
  221. package/dist/client/assets/content-CnhhSCZq.js +1 -0
  222. package/dist/client/assets/content-D1Ze_FG9.js +1 -0
  223. package/dist/client/assets/content-DY3F9Vfr.js +1 -0
  224. package/dist/client/assets/content-DrKBYpcb.js +1 -0
  225. package/dist/client/assets/content-LSStQYj5.js +1 -0
  226. package/dist/client/assets/content-YvU-D0hF.js +1 -0
  227. package/dist/client/assets/content-oKQMyVnH.js +1 -0
  228. package/dist/client/assets/{context-budget-DemtXu7E.js → context-budget-8qFKqM-j.js} +1 -1
  229. package/dist/client/assets/{conversation-icons-BQ4OeOmr.js → conversation-icons-CIRaxmid.js} +1 -1
  230. package/dist/client/assets/{conversation-model-BGFHoxQ0.js → conversation-model-m8HhzroS.js} +1 -1
  231. package/dist/client/assets/conversation-motion-features-D9PxLoDt.js +1 -0
  232. package/dist/client/assets/{copy-D9WUpQRf.js → copy-BGOC1tJB.js} +1 -1
  233. package/dist/client/assets/{cpu-Ck_4tB_-.js → cpu-Q6nrHFTN.js} +1 -1
  234. package/dist/client/assets/{createLucideIcon-DkjnzvcJ.js → createLucideIcon-ChvMq-zl.js} +1 -1
  235. package/dist/client/assets/{credentials-C4VXz2hr.js → credentials-OeoF-VKJ.js} +1 -1
  236. package/dist/client/assets/discover-DlwbftpC.js +2 -0
  237. package/dist/client/assets/embed-entry-c0lwtjBG.js +2 -0
  238. package/dist/client/assets/{external-link-RT4Ph-6-.js → external-link-BVccgH0n.js} +1 -1
  239. package/dist/client/assets/{eye-CtqSV8BS.js → eye-CsGfEVR6.js} +1 -1
  240. package/dist/client/assets/{file-code-corner-D_Aptal2.js → file-code-corner-Be6da5l3.js} +1 -1
  241. package/dist/client/assets/{file-text-ChtICwub.js → file-text-DP6txVW-.js} +1 -1
  242. package/dist/client/assets/{flag-CqdOxVkI.js → flag-DAFE2wZ5.js} +1 -1
  243. package/dist/client/assets/{floor-context-model-DZBpo_oD.js → floor-context-model-rWKqaKmV.js} +1 -1
  244. package/dist/client/assets/{floor-message-passes-CJh9f8Jp.js → floor-message-passes-CO3Ix_wR.js} +1 -1
  245. package/dist/client/assets/{folder-0fWevPvQ.js → folder-B_S7gBVr.js} +1 -1
  246. package/dist/client/assets/{gauge-Dgtfxf_o.js → gauge-DQCGlE3o.js} +1 -1
  247. package/dist/client/assets/{gestures-BDCZ1FRG.js → gestures-CofqY4Km.js} +1 -1
  248. package/dist/client/assets/{git-branch-CA3cHKCI.js → git-branch-DcUCsWdJ.js} +1 -1
  249. package/dist/client/assets/{go-shortcuts-DKtw4qYx.js → go-shortcuts-KQy-ZOpV.js} +1 -1
  250. package/dist/client/assets/{home-moving-signal-B7m-ngb2.js → home-moving-signal-BIHUGNfI.js} +1 -1
  251. package/dist/client/assets/home-now-card-CaLgZze2.js +1 -0
  252. package/dist/client/assets/{home-now-card-nano-D1ScGrgv.js → home-now-card-nano-CvU8B61b.js} +1 -1
  253. package/dist/client/assets/hooks-DaUOREpP.js +2 -0
  254. package/dist/client/assets/index-CGbs0SBm.css +1 -0
  255. package/dist/client/assets/index-CbqBwfIW.js +1 -0
  256. package/dist/client/assets/index-CyPMl7Up.js +1 -0
  257. package/dist/client/assets/index-DReVb7jZ.js +10 -0
  258. package/dist/client/assets/index-PQpJveGO.js +1 -0
  259. package/dist/client/assets/{index-CvsM3jm8.js → index-kkXUq-zf.js} +1 -1
  260. package/dist/client/assets/{inspector-panel-BLhDODb3.js → inspector-panel-CLU7wjnT.js} +2 -2
  261. package/dist/client/assets/{keyboard-nav-CXfav14z.js → keyboard-nav-CJXPaHXj.js} +1 -1
  262. package/dist/client/assets/lane-ask-display-BTVSakyo.js +18 -0
  263. package/dist/client/assets/{lane-observe-BD21P8BB.js → lane-observe-CteDwdD-.js} +3 -3
  264. package/dist/client/assets/{lane-roster-store-DzNHP392.js → lane-roster-store-Ch9t6lb0.js} +1 -1
  265. package/dist/client/assets/{layers-Bolb8ejU.js → layers-BOwyWodP.js} +1 -1
  266. package/dist/client/assets/{layout-grid-DI9tVJ2E.js → layout-grid-B36Qsh0y.js} +1 -1
  267. package/dist/client/assets/left-0vBrvrBG.js +2 -0
  268. package/dist/client/assets/left-C6SyaqlJ.js +1 -0
  269. package/dist/client/assets/left-CTuXysZR.js +2 -0
  270. package/dist/client/assets/left-Cc6s4DT2.js +1 -0
  271. package/dist/client/assets/left-DF5caiyh.js +1 -0
  272. package/dist/client/assets/left-DgT4tWCx.js +1 -0
  273. package/dist/client/assets/left-R0wppTTr.js +1 -0
  274. package/dist/client/assets/left-advisor-C-kt8V28.js +1 -0
  275. package/dist/client/assets/left-agents-thnBO156.js +1 -0
  276. package/dist/client/assets/left-default-CT42fnpF.js +1 -0
  277. package/dist/client/assets/left-lanes-CSmZgciK.js +1 -0
  278. package/dist/client/assets/left-mission-C86x6i9h.js +1 -0
  279. package/dist/client/assets/library-DdhYL_9v.js +1 -0
  280. package/dist/client/assets/{loader-circle-DurUYl7E.js → loader-circle-DNUsuPWz.js} +1 -1
  281. package/dist/client/assets/{local-agents-D9fYYRyj.js → local-agents-I40PawYA.js} +1 -1
  282. package/dist/client/assets/{machine-children-RGS4Q0r6.js → machine-children-CdhNzDF0.js} +1 -1
  283. package/dist/client/assets/{mentions-Ctw1ECUC.js → mentions-Ck_Vjnyp.js} +1 -1
  284. package/dist/client/assets/{mesh-ops-CGpRk4ik.js → mesh-ops-DSlvHp-D.js} +1 -1
  285. package/dist/client/assets/{mesh-view-store-CliSYsmt.js → mesh-view-store-C1-mdP3P.js} +1 -1
  286. package/dist/client/assets/{message-circle-CSiJj6yo.js → message-circle-cI5_A5mj.js} +1 -1
  287. package/dist/client/assets/{message-markup-DgFSyb3f.js → message-markup-6Tgo4qFJ.js} +1 -1
  288. package/dist/client/assets/{message-square-NmXWtWLR.js → message-square-CJW4WRlo.js} +1 -1
  289. package/dist/client/assets/{mission-control-store-DZ29Mlj1.js → mission-control-store-p_cboAm4.js} +1 -1
  290. package/dist/client/assets/monitor-C7_cHlkC.js +1 -0
  291. package/dist/client/assets/{nav-destinations-CyXnw9kh.js → nav-destinations-CU_euC-Q.js} +1 -1
  292. package/dist/client/assets/{observe-CkfOxYx_.js → observe-CtS0l3zu.js} +1 -1
  293. package/dist/client/assets/{operator-attention-DGR4kOog.js → operator-attention-DBaRg5ep.js} +1 -1
  294. package/dist/client/assets/{page-status-CkS3SZu-.js → page-status-DwFR4wSw.js} +1 -1
  295. package/dist/client/assets/{panel-right-BNTJhy8M.js → panel-right-qP17MwMl.js} +1 -1
  296. package/dist/client/assets/{pause-DWS7YGQ3.js → pause-B_hliKuR.js} +1 -1
  297. package/dist/client/assets/{persistent-state-xsuk6Kc-.js → persistent-state-BUsTTZFE.js} +1 -1
  298. package/dist/client/assets/{pin-DWlD1BOF.js → pin-Oi4qHR6M.js} +1 -1
  299. package/dist/client/assets/{play-D_Pggug4.js → play-CVeRmqLH.js} +1 -1
  300. package/dist/client/assets/{plus-D_wLGJGT.js → plus-D5NLH_fM.js} +1 -1
  301. package/dist/client/assets/profile-BegEUmB7.js +1 -0
  302. package/dist/client/assets/projects-inbox-CKPLZN8s.css +1 -0
  303. package/dist/client/assets/{projects-inbox-DvbqJO3q.js → projects-inbox-CfwxCTdN.js} +1 -1
  304. package/dist/client/assets/provider-DwmCoSlc.js +1 -0
  305. package/dist/client/assets/{proxy-DOG46ja4.js → proxy-DgzP27W8.js} +1 -1
  306. package/dist/client/assets/{radio-C_jtwbFP.js → radio-Cas2qg1D.js} +1 -1
  307. package/dist/client/assets/{refresh-cw-Da9DDLk2.js → refresh-cw-IcD2lPoT.js} +1 -1
  308. package/dist/client/assets/resolve-panes-pfZTezKo.js +1 -0
  309. package/dist/client/assets/resolve-sidebar-context-D5ksvrb_.js +1 -0
  310. package/dist/client/assets/right-BDaCJ0CF.js +1 -0
  311. package/dist/client/assets/right-BP6lXRFS.js +1 -0
  312. package/dist/client/assets/right-Cb1VCrdj.js +1 -0
  313. package/dist/client/assets/right-CeFaxfBo.js +1 -0
  314. package/dist/client/assets/right-Ck2SrYCj.js +1 -0
  315. package/dist/client/assets/right-D-uv5YfF.js +1 -0
  316. package/dist/client/assets/right-DJMSICky.js +1 -0
  317. package/dist/client/assets/right-Dnljs8ah.js +1 -0
  318. package/dist/client/assets/right-SdCSF8PP.js +1 -0
  319. package/dist/client/assets/{right-BLJsc2-p.js → right-cjPTwPXS.js} +1 -1
  320. package/dist/client/assets/{rocket-DyrYDo8V.js → rocket-DAqYvu8I.js} +1 -1
  321. package/dist/client/assets/router-C-MF5-mb.js +1 -0
  322. package/dist/client/assets/{runtime-picker-DdsttHHc.js → runtime-picker-C_AVYF63.js} +1 -1
  323. package/dist/client/assets/{scope-views-B7PZGlhY.js → scope-views-Dl3ml9OZ.js} +1 -1
  324. package/dist/client/assets/{scout-voice-DOQ_B77g.js → scout-voice-CqAyfblr.js} +1 -1
  325. package/dist/client/assets/{scoutbot-markdown-Bz0Vbto2.js → scoutbot-markdown-DwvGQOWo.js} +1 -1
  326. package/dist/client/assets/{scroll-text-DwC8r2g6.js → scroll-text-B0tKI9Sg.js} +1 -1
  327. package/dist/client/assets/{search-C4VlW_0l.js → search-UsM-9-_W.js} +1 -1
  328. package/dist/client/assets/secondaryNavConfig-D15P1Y9k.css +1 -0
  329. package/dist/client/assets/secondaryNavConfig-DzNHk6IH.js +1 -0
  330. package/dist/client/assets/{selection-bridge-B5jqyMR9.js → selection-bridge-OTS2iFkt.js} +1 -1
  331. package/dist/client/assets/{send-horizontal-pOtGI7FM.js → send-horizontal-BlQsRK6C.js} +1 -1
  332. package/dist/client/assets/{send-to-agent-session-BZGq_ycy.js → send-to-agent-session-C1mgqdow.js} +1 -1
  333. package/dist/client/assets/{server-ms1yxUYJ.js → server-DBlPW0Mp.js} +1 -1
  334. package/dist/client/assets/{session-catalog-s-T_w41t.js → session-catalog-CnpZMB7C.js} +1 -1
  335. package/dist/client/assets/{session-table-CDx_16xf.js → session-table-CGkfG5Yd.js} +1 -1
  336. package/dist/client/assets/{sessions-view-DzYGsKWS.js → sessions-view-Bge4XZ4I.js} +1 -1
  337. package/dist/client/assets/{settings-TJIkkZ0P.js → settings-C69Zjrpq.js} +1 -1
  338. package/dist/client/assets/{shared-work-artifacts-4IIQXQfc.js → shared-work-artifacts-DfNl9KTo.js} +1 -1
  339. package/dist/client/assets/{sliders-horizontal-CHf3ntw0.js → sliders-horizontal-6bzeod7c.js} +1 -1
  340. package/dist/client/assets/{sparkles-BbOFw3d0.js → sparkles-Cc5lPZRv.js} +1 -1
  341. package/dist/client/assets/{sse-v5QLsOHV.js → sse-A8AyLH0g.js} +1 -1
  342. package/dist/client/assets/{tail-events-DQ46QBW1.js → tail-events-C4WdhVeK.js} +1 -1
  343. package/dist/client/assets/{terminal-96JWDYDL.js → terminal-DMZjX1es.js} +1 -1
  344. package/dist/client/assets/{terminal-relay-Bfx8pg80.js → terminal-relay-mO89dX-Y.js} +1 -1
  345. package/dist/client/assets/{terminal-sessions-Ch9aYlgi.js → terminal-sessions-3RfJpen8.js} +1 -1
  346. package/dist/client/assets/{terminal-takeover-BlpxpvSp.js → terminal-takeover-CZZsnPzj.js} +1 -1
  347. package/dist/client/assets/use-beside-D3cJpA5p.js +1 -0
  348. package/dist/client/assets/{use-conversation-list-A_YUf8lo.js → use-conversation-list-D5EnpVba.js} +1 -1
  349. package/dist/client/assets/{use-fleet-active-asks-DFs_u-vM.js → use-fleet-active-asks-D_QOmjg5.js} +1 -1
  350. package/dist/client/assets/{use-mesh-node-state-Ck9CYplv.js → use-mesh-node-state-3V3ADQ-G.js} +1 -1
  351. package/dist/client/assets/{use-mesh-ops-items-Be1WmwCg.js → use-mesh-ops-items-DI9GKWlF.js} +1 -1
  352. package/dist/client/assets/{use-reduced-motion-D7n3vK8t.js → use-reduced-motion-CiaZHMnk.js} +1 -1
  353. package/dist/client/assets/use-scout-dev-flags-CkdAHlDR.js +1 -0
  354. package/dist/client/assets/{useAgentHoverCard-Dr-OjNFF.js → useAgentHoverCard-A3QGXqIy.js} +1 -1
  355. package/dist/client/assets/useContentSecondaryNav-DrL_nkCZ.js +1 -0
  356. package/dist/client/assets/{useEmbedHeadline-BL8wQawZ.js → useEmbedHeadline-atkQVfGw.js} +1 -1
  357. package/dist/client/assets/usePersistentState-Y8XwSTg-.js +1 -0
  358. package/dist/client/assets/{usePierreRuntime-DJkRHMoe.js → usePierreRuntime-DTvcwISe.js} +1 -1
  359. package/dist/client/assets/users-RLK3P5U4.js +1 -0
  360. package/dist/client/assets/{wrench-BsMTSeji.js → wrench-B4maQJai.js} +1 -1
  361. package/dist/client/assets/{x-DI1ktCYb.js → x-rlMdRqJF.js} +1 -1
  362. package/dist/client/assets/{xterm-B1YBE4Gq.js → xterm-B1zHHOLQ.js} +1 -1
  363. package/dist/client/assets/{zap-sKPkh4sQ.js → zap-B4X0OrEw.js} +1 -1
  364. package/dist/client/index.html +15 -3
  365. package/dist/drizzle/0019_session_actor_targets.sql +227 -0
  366. package/dist/drizzle/README.md +19 -0
  367. package/dist/drizzle/meta/0019_snapshot.json +6804 -0
  368. package/dist/drizzle/meta/_journal.json +7 -0
  369. package/dist/highlights-eq9cgrbb.scm +604 -0
  370. package/dist/highlights-ghv9g403.scm +205 -0
  371. package/dist/highlights-hk7bwhj4.scm +284 -0
  372. package/dist/highlights-r812a2qc.scm +150 -0
  373. package/dist/highlights-x6tmsnaa.scm +115 -0
  374. package/dist/injections-73j83es3.scm +27 -0
  375. package/dist/main.mjs +1214 -722
  376. package/dist/node/main.mjs +133 -22
  377. package/dist/pairing-runtime-controller.mjs +715 -492
  378. package/dist/runtime/base-daemon.mjs +14176 -58
  379. package/dist/runtime/broker-daemon.mjs +15520 -445
  380. package/dist/runtime/broker-process-manager.mjs +5 -3
  381. package/dist/runtime/mesh-discover.mjs +5 -3
  382. package/dist/scout-control-plane-web.mjs +21065 -3387
  383. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  384. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  385. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  386. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  387. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  388. package/dist/update-helper.mjs +83 -17
  389. package/package.json +2 -2
  390. package/dist/client/assets/ActivityScreen-DCALiEXY.js +0 -1
  391. package/dist/client/assets/AgentAdventures-NwTKeF0F.js +0 -1
  392. package/dist/client/assets/AgentConfigurationScreen-B2Hw0ce1.js +0 -1
  393. package/dist/client/assets/AgentDefinitionsWorkspace-CwZJ833X.js +0 -1
  394. package/dist/client/assets/AgentFloorView-l2wNKFob.js +0 -1
  395. package/dist/client/assets/AgentInfoScreen-ClZM1wQb.js +0 -1
  396. package/dist/client/assets/AgentLanesEmbedScreen-DqHwqY0X.js +0 -1
  397. package/dist/client/assets/AgentMasterScreen-By6DN0jF.js +0 -1
  398. package/dist/client/assets/AgentsConsole-Dq0S_hRA.js +0 -1
  399. package/dist/client/assets/AgentsScreen-Bi9Lx47B.js +0 -1
  400. package/dist/client/assets/AgentsSubnav-BOobgtGE.js +0 -1
  401. package/dist/client/assets/BriefingDetailScreen-sprFl4Nk.js +0 -1
  402. package/dist/client/assets/BrokerScreen-CejzhRsB.js +0 -8
  403. package/dist/client/assets/ConversationFeedRows-DVqnZQH0.js +0 -1
  404. package/dist/client/assets/ConversationHeader-CCSU8uo_.js +0 -1
  405. package/dist/client/assets/ConversationScreen-tTP6B_F-.js +0 -2
  406. package/dist/client/assets/CrewWorkspaces-4O8dgRUD.js +0 -1
  407. package/dist/client/assets/CrewWorkspaces-Diq11KDq.css +0 -1
  408. package/dist/client/assets/FlightObserveScreen-DDXfNbsw.js +0 -1
  409. package/dist/client/assets/FloorResourcesSheet-Djrgd_ZU.js +0 -1
  410. package/dist/client/assets/HarnessMark-Bt47OeHy.js +0 -1
  411. package/dist/client/assets/HarnessesScreen-M84sFjWY.js +0 -1
  412. package/dist/client/assets/KnowledgeSearchScreen-WC0WhFio.js +0 -1
  413. package/dist/client/assets/LaneTraceDetailSheet-mAhj7MJi.js +0 -1
  414. package/dist/client/assets/MeshScreen-DlfiMlaR.js +0 -1
  415. package/dist/client/assets/MessagesScreen-BZ7yaGJx.js +0 -1
  416. package/dist/client/assets/MissionControlView-DpGhxG4a.js +0 -1
  417. package/dist/client/assets/MissionLeftAgentRow-DhhRRim0.js +0 -1
  418. package/dist/client/assets/NativeAreaScreen-BQyHHRAM.js +0 -1
  419. package/dist/client/assets/NativeAreaScreen-Ditv-TYW.js +0 -1
  420. package/dist/client/assets/NativeAreaScreen-Dq3uPSEI.js +0 -1
  421. package/dist/client/assets/NewChatComposer-JjLbm3W2.js +0 -19
  422. package/dist/client/assets/OpenScoutAppShell-CzKbjwCA.js +0 -22
  423. package/dist/client/assets/OpsAgentsView-CZbtkcQH.js +0 -1
  424. package/dist/client/assets/OpsScreen-DJq-aBmX.js +0 -1
  425. package/dist/client/assets/OpsSubnav-9sURjajO.js +0 -1
  426. package/dist/client/assets/ProjectAgentProfile-q_1tMJIL.js +0 -1
  427. package/dist/client/assets/ProjectAgentProfileHero-DyEFyTFs.js +0 -1
  428. package/dist/client/assets/ProjectsInbox-Bs8I__my.js +0 -2
  429. package/dist/client/assets/ProjectsRail-Deb38OJ1.js +0 -1
  430. package/dist/client/assets/ProjectsScreen-CgLiYiss.js +0 -1
  431. package/dist/client/assets/ProjectsThreadAside-C0Yw3yIL.js +0 -1
  432. package/dist/client/assets/RawSessionsTable-DIhmlvk-.js +0 -1
  433. package/dist/client/assets/RealtimeVoiceScreen-3oU7b7V5.js +0 -1
  434. package/dist/client/assets/RepoDiffViewerLazy-BQ6ZCrsq.js +0 -2
  435. package/dist/client/assets/SessionRefScreen-BOQ1_ydg.js +0 -1
  436. package/dist/client/assets/SessionsScreen-R8QKvoey.js +0 -1
  437. package/dist/client/assets/SettingsScreen-DirtO7Z0.js +0 -1
  438. package/dist/client/assets/SharedWorkFloor-yPWFLZwX.js +0 -2
  439. package/dist/client/assets/Terminal-D-DsQlmV.js +0 -4
  440. package/dist/client/assets/TerminalEmbedScreen-9Gmln759.js +0 -1
  441. package/dist/client/assets/WorldActorTalk-uIH2jGqA.js +0 -1
  442. package/dist/client/assets/agent-autocomplete-CeHQpuG9.js +0 -10
  443. package/dist/client/assets/arrow-down-WoVlkUmg.js +0 -1
  444. package/dist/client/assets/chunk-JTPDIGGW-ZC-98AHT.js +0 -46
  445. package/dist/client/assets/chunk-T65CQEWV-CSVUz2rY.js +0 -1
  446. package/dist/client/assets/chunk-YOZR3KYS-B59jqwO0.js +0 -2
  447. package/dist/client/assets/content-B5Q4pb9R.js +0 -1
  448. package/dist/client/assets/content-BK1IfOZs.js +0 -1
  449. package/dist/client/assets/content-BeEsWLEm.js +0 -1
  450. package/dist/client/assets/content-BkOwEknW.js +0 -1
  451. package/dist/client/assets/content-C32W5kAG.js +0 -1
  452. package/dist/client/assets/content-CoqyLs9v.js +0 -1
  453. package/dist/client/assets/content-CwpdIS5b.js +0 -1
  454. package/dist/client/assets/content-DS2OkJ3Q.js +0 -1
  455. package/dist/client/assets/content-DXKaPDfn.js +0 -1
  456. package/dist/client/assets/content-DZt5-dkI.js +0 -1
  457. package/dist/client/assets/content-DbQJH8L1.js +0 -1
  458. package/dist/client/assets/content-DetoiaHq.js +0 -1
  459. package/dist/client/assets/content-Dhu3wL7J.js +0 -1
  460. package/dist/client/assets/content-Dpv34iZu.js +0 -1
  461. package/dist/client/assets/content-TtQJb61D.js +0 -1
  462. package/dist/client/assets/content-ymNb2R7g.js +0 -1
  463. package/dist/client/assets/conversation-motion-features-9x8uZpwh.js +0 -1
  464. package/dist/client/assets/discover-C8IOY7_K.js +0 -2
  465. package/dist/client/assets/embed-entry-CG3CfCbm.js +0 -2
  466. package/dist/client/assets/home-now-card-DduXkHRR.js +0 -1
  467. package/dist/client/assets/hooks-C6VyQTQe.js +0 -2
  468. package/dist/client/assets/index-C5cX8dkl.js +0 -1
  469. package/dist/client/assets/index-C8uS5szO.js +0 -10
  470. package/dist/client/assets/index-Ck1__1yL.css +0 -1
  471. package/dist/client/assets/index-ClOOrVG1.js +0 -1
  472. package/dist/client/assets/index-Crtgfc9I.js +0 -1
  473. package/dist/client/assets/lane-ask-display-B6iCAVcd.js +0 -18
  474. package/dist/client/assets/left-B-_z_nqj.js +0 -2
  475. package/dist/client/assets/left-B1LY7rJc.js +0 -1
  476. package/dist/client/assets/left-C6bdjWcG.js +0 -2
  477. package/dist/client/assets/left-CF4iuqlz.js +0 -1
  478. package/dist/client/assets/left-DLtNyZl1.js +0 -1
  479. package/dist/client/assets/left-Fpxoq-VY.js +0 -1
  480. package/dist/client/assets/left-N2wXfTlp.js +0 -1
  481. package/dist/client/assets/left-advisor-CeIjCKbd.js +0 -1
  482. package/dist/client/assets/left-agents-upjHVlOj.js +0 -1
  483. package/dist/client/assets/left-default-08gmdCtb.js +0 -1
  484. package/dist/client/assets/left-lanes-Cvsp73Hw.js +0 -1
  485. package/dist/client/assets/left-mission-W1LLaz74.js +0 -1
  486. package/dist/client/assets/library-DLKBVUJ6.js +0 -1
  487. package/dist/client/assets/profile-C3KgiZvc.js +0 -1
  488. package/dist/client/assets/projects-inbox-BIW7nv-H.css +0 -1
  489. package/dist/client/assets/resolve-panes-DuowGRTk.js +0 -1
  490. package/dist/client/assets/resolve-sidebar-context-BkTbqteq.js +0 -1
  491. package/dist/client/assets/right-B9OUA6Ho.js +0 -1
  492. package/dist/client/assets/right-BDQnjetX.js +0 -1
  493. package/dist/client/assets/right-BUbKHmRH.js +0 -1
  494. package/dist/client/assets/right-Ci2IcD4s.js +0 -1
  495. package/dist/client/assets/right-CmCce3e5.js +0 -1
  496. package/dist/client/assets/right-D7w0zM5a.js +0 -1
  497. package/dist/client/assets/right-DIoON_bv.js +0 -1
  498. package/dist/client/assets/right-E0Jr3VN5.js +0 -1
  499. package/dist/client/assets/right-lCdAk9dW.js +0 -1
  500. package/dist/client/assets/router-BKiMcYa7.js +0 -1
  501. package/dist/client/assets/secondaryNavConfig-DAXIFtVd.js +0 -1
  502. package/dist/client/assets/secondaryNavConfig-xssF_ubT.css +0 -1
  503. package/dist/client/assets/use-beside-Df-F2Uvg.js +0 -1
  504. package/dist/client/assets/use-scout-dev-flags-0TXfQcG0.js +0 -1
  505. package/dist/client/assets/useContentSecondaryNav-CGvMOVGY.js +0 -1
@@ -1 +0,0 @@
1
- import{j as r}from"./index-C8uS5szO.js";import{RawSessionsTable as t}from"./RawSessionsTable-DIhmlvk-.js";/* empty css */import"./DataTable-BMOZ1-z8.js";/* empty css */import"./api-CaROe5_H.js";import"./time-Dhsh_2EG.js";import"./tail-events-DQ46QBW1.js";import"./index-BWHgHrtv.js";import"./openContent-C6XO6kr5.js";import"./Provider-5Hotn7NQ.js";import"./router-BKiMcYa7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-v5QLsOHV.js";import"./surface-activity-B1rgWB1i.js";import"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-JjLbm3W2.js";import"./runtime-picker-DdsttHHc.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./createLucideIcon-DkjnzvcJ.js";import"./conversation-model-BGFHoxQ0.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-C5cX8dkl.js";import"./HarnessMark-Bt47OeHy.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./file-text-ChtICwub.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";function Z({navigate:o}){return r.jsx(t,{navigate:o})}export{Z as SessionsScreen};
@@ -1 +0,0 @@
1
- import{j as i,r as d}from"./index-C8uS5szO.js";import{E as it}from"./EmptyState-uyYN5piI.js";import{S as B}from"./StatusPill-MxYClPG5.js";import{a as M}from"./api-CaROe5_H.js";import{p as Rt}from"./status-tone-BM_zuRy1.js";import{t as ot}from"./time-Dhsh_2EG.js";import{AgentConfigurationScreen as Mt}from"./AgentConfigurationScreen-B2Hw0ce1.js";import{S as At}from"./SettingsDrawer-BDapR4E9.js";/* empty css */import"./CastPicker-BuwE_JQp.js";import"./CrewAvatar-CJhuqTsJ.js";import"./HarnessMark-Bt47OeHy.js";import"./check-B8dMv3Is.js";import"./createLucideIcon-DkjnzvcJ.js";import"./NewChatComposer-JjLbm3W2.js";import"./runtime-picker-DdsttHHc.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./router-BKiMcYa7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./conversation-model-BGFHoxQ0.js";import"./agent-state-DDhnFEEP.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-C5cX8dkl.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./file-text-ChtICwub.js";import"./Provider-5Hotn7NQ.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./openContent-C6XO6kr5.js";import"./AgentsSubnav-BOobgtGE.js";import"./SecondaryNav-BkTn5tkq.js";import"./secondaryNavConfig-DAXIFtVd.js";import"./nav-destinations-CyXnw9kh.js";import"./message-square-NmXWtWLR.js";import"./terminal-96JWDYDL.js";import"./compass-DTZdCpv9.js";import"./settings-TJIkkZ0P.js";import"./git-branch-CA3cHKCI.js";import"./scroll-text-DwC8r2g6.js";import"./refresh-cw-Da9DDLk2.js";import"./bot-CfN9PSBF.js";import"./wrench-BsMTSeji.js";import"./server-ms1yxUYJ.js";import"./cpu-Ck_4tB_-.js";import"./credentials-C4VXz2hr.js";import"./AgentAvatar-BIwg54Tj.js";import"./SpriteAvatar-BW1JzkDt.js";import"./VoicePermissionsPanel-CecFWzva.js";import"./copy-D9WUpQRf.js";import"./sparkles-BbOFw3d0.js";var k=(t=>(t[t.Border=-1]="Border",t[t.Data=0]="Data",t[t.Function=1]="Function",t[t.Position=2]="Position",t[t.Timing=3]="Timing",t[t.Alignment=4]="Alignment",t))(k||{});const Ct=[0,1],dt=[1,0],ht=[2,3],ft=[3,2],It={L:Ct,M:dt,Q:ht,H:ft},zt=/^\d*$/,Ft=/^[A-Z0-9 $%*+./:-]*$/,L="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",T=1,q=40,at=3,Bt=3,I=40,Lt=10,mt=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],pt=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class _t{constructor(e,s,n,r){if(this.version=e,this.ecc=s,e<T||e>q)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=e*4+17;const o=Array.from({length:this.size}).fill(!1);for(let c=0;c<this.size;c++)this.modules.push(o.slice()),this.types.push(o.map(()=>0));this.drawFunctionPatterns();const a=this.addEccAndInterleave(n);if(this.drawCodewords(a),r===-1){let c=1e9;for(let u=0;u<8;u++){this.applyMask(u),this.drawFormatBits(u);const h=this.getPenaltyScore();h<c&&(r=u,c=h),this.applyMask(u)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,s){return e>=0&&e<this.size&&s>=0&&s<this.size&&this.modules[s][e]}drawFunctionPatterns(){for(let n=0;n<this.size;n++)this.setFunctionModule(6,n,n%2===0,k.Timing),this.setFunctionModule(n,6,n%2===0,k.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),s=e.length;for(let n=0;n<s;n++)for(let r=0;r<s;r++)n===0&&r===0||n===0&&r===s-1||n===s-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const s=this.ecc[1]<<3|e;let n=s;for(let o=0;o<10;o++)n=n<<1^(n>>>9)*1335;const r=(s<<10|n)^21522;for(let o=0;o<=5;o++)this.setFunctionModule(8,o,x(r,o));this.setFunctionModule(8,7,x(r,6)),this.setFunctionModule(8,8,x(r,7)),this.setFunctionModule(7,8,x(r,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,x(r,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,x(r,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,x(r,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let n=0;n<12;n++)e=e<<1^(e>>>11)*7973;const s=this.version<<12|e;for(let n=0;n<18;n++){const r=x(s,n),o=this.size-11+n%3,a=Math.floor(n/3);this.setFunctionModule(o,a,r),this.setFunctionModule(a,o,r)}}drawFinderPattern(e,s){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(n)),a=e+r,c=s+n;a>=0&&a<this.size&&c>=0&&c<this.size&&this.setFunctionModule(a,c,o!==2&&o!==4,k.Position)}}drawAlignmentPattern(e,s){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,s+n,Math.max(Math.abs(r),Math.abs(n))!==1,k.Alignment)}setFunctionModule(e,s,n,r=k.Function){this.modules[s][e]=n,this.types[s][e]=r}addEccAndInterleave(e){const s=this.version,n=this.ecc;if(e.length!==z(s,n))throw new RangeError("Invalid argument");const r=pt[n[0]][s],o=mt[n[0]][s],a=Math.floor(O(s)/8),c=r-a%r,u=Math.floor(a/r),h=[],p=Yt(o);for(let f=0,b=0;f<r;f++){const g=e.slice(b,b+u-o+(f<c?0:1));b+=g.length;const E=Gt(g,p);f<c&&g.push(0),h.push(g.concat(E))}const m=[];for(let f=0;f<h[0].length;f++)h.forEach((b,g)=>{(f!==u-o||g>=c)&&m.push(b[f])});return m}drawCodewords(e){if(e.length!==Math.floor(O(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let o=0;o<2;o++){const a=n-o,u=(n+1&2)===0?this.size-1-r:r;!this.types[u][a]&&s<e.length*8&&(this.modules[u][a]=x(e[s>>>3],7-(s&7)),s++)}}}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+s)%2===0;break;case 1:r=s%2===0;break;case 2:r=n%3===0;break;case 3:r=(n+s)%3===0;break;case 4:r=(Math.floor(n/3)+Math.floor(s/2))%2===0;break;case 5:r=n*s%2+n*s%3===0;break;case 6:r=(n*s%2+n*s%3)%2===0;break;case 7:r=((n+s)%2+n*s%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[s][n]&&r&&(this.modules[s][n]=!this.modules[s][n])}}getPenaltyScore(){let e=0;for(let o=0;o<this.size;o++){let a=!1,c=0;const u=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[o][h]===a?(c++,c===5?e+=at:c>5&&e++):(this.finderPenaltyAddHistory(c,u),a||(e+=this.finderPenaltyCountPatterns(u)*I),a=this.modules[o][h],c=1);e+=this.finderPenaltyTerminateAndCount(a,c,u)*I}for(let o=0;o<this.size;o++){let a=!1,c=0;const u=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][o]===a?(c++,c===5?e+=at:c>5&&e++):(this.finderPenaltyAddHistory(c,u),a||(e+=this.finderPenaltyCountPatterns(u)*I),a=this.modules[h][o],c=1);e+=this.finderPenaltyTerminateAndCount(a,c,u)*I}for(let o=0;o<this.size-1;o++)for(let a=0;a<this.size-1;a++){const c=this.modules[o][a];c===this.modules[o][a+1]&&c===this.modules[o+1][a]&&c===this.modules[o+1][a+1]&&(e+=Bt)}let s=0;for(const o of this.modules)s=o.reduce((a,c)=>a+(c?1:0),s);const n=this.size*this.size,r=Math.ceil(Math.abs(s*20-n*10)/n)-1;return e+=r*Lt,e}getAlignmentPatternPositions(){if(this.version===1)return[];{const e=Math.floor(this.version/7)+2,s=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=s)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){const s=e[1],n=s>0&&e[2]===s&&e[3]===s*3&&e[4]===s&&e[5]===s;return(n&&e[0]>=s*4&&e[6]>=s?1:0)+(n&&e[6]>=s*4&&e[0]>=s?1:0)}finderPenaltyTerminateAndCount(e,s,n){return e&&(this.finderPenaltyAddHistory(s,n),s=0),s+=this.size,this.finderPenaltyAddHistory(s,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,s){s[0]===0&&(e+=this.size),s.pop(),s.unshift(e)}}function N(t,e,s){if(e<0||e>31||t>>>e)throw new RangeError("Value out of range");for(let n=e-1;n>=0;n--)s.push(t>>>n&1)}function x(t,e){return(t>>>e&1)!==0}class V{constructor(e,s,n){if(this.mode=e,this.numChars=s,this.bitData=n,s<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}getData(){return this.bitData.slice()}}const $t=[1,10,12,14],Ot=[2,9,11,13],Ut=[4,8,16,16];function gt(t,e){return t[Math.floor((e+7)/17)+1]}function yt(t){const e=[];for(const s of t)N(s,8,e);return new V(Ut,t.length,e)}function Dt(t){if(!bt(t))throw new RangeError("String contains non-numeric characters");const e=[];for(let s=0;s<t.length;){const n=Math.min(t.length-s,3);N(Number.parseInt(t.substring(s,s+n),10),n*3+1,e),s+=n}return new V($t,t.length,e)}function Tt(t){if(!vt(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");const e=[];let s;for(s=0;s+2<=t.length;s+=2){let n=L.indexOf(t.charAt(s))*45;n+=L.indexOf(t.charAt(s+1)),N(n,11,e)}return s<t.length&&N(L.indexOf(t.charAt(s)),6,e),new V(Ot,t.length,e)}function qt(t){return t===""?[]:bt(t)?[Dt(t)]:vt(t)?[Tt(t)]:[yt(Ht(t))]}function bt(t){return zt.test(t)}function vt(t){return Ft.test(t)}function Vt(t,e){let s=0;for(const n of t){const r=gt(n.mode,e);if(n.numChars>=1<<r)return Number.POSITIVE_INFINITY;s+=4+r+n.bitData.length}return s}function Ht(t){t=encodeURI(t);const e=[];for(let s=0;s<t.length;s++)t.charAt(s)!=="%"?e.push(t.charCodeAt(s)):(e.push(Number.parseInt(t.substring(s+1,s+3),16)),s+=2);return e}function O(t){if(t<T||t>q)throw new RangeError("Version number out of range");let e=(16*t+128)*t+64;if(t>=2){const s=Math.floor(t/7)+2;e-=(25*s-10)*s-55,t>=7&&(e-=36)}return e}function z(t,e){return Math.floor(O(t)/8)-mt[e[0]][t]*pt[e[0]][t]}function Yt(t){if(t<1||t>255)throw new RangeError("Degree out of range");const e=[];for(let n=0;n<t-1;n++)e.push(0);e.push(1);let s=1;for(let n=0;n<t;n++){for(let r=0;r<e.length;r++)e[r]=U(e[r],s),r+1<e.length&&(e[r]^=e[r+1]);s=U(s,2)}return e}function Gt(t,e){const s=e.map(n=>0);for(const n of t){const r=n^s.shift();s.push(0),e.forEach((o,a)=>s[a]^=U(o,r))}return s}function U(t,e){if(t>>>8||e>>>8)throw new RangeError("Byte out of range");let s=0;for(let n=7;n>=0;n--)s=s<<1^(s>>>7)*285,s^=(e>>>n&1)*t;return s}function Wt(t,e,s=1,n=40,r=-1,o=!0){if(!(T<=s&&s<=n&&n<=q)||r<-1||r>7)throw new RangeError("Invalid value");let a,c;for(a=s;;a++){const m=z(a,e)*8,f=Vt(t,a);if(f<=m){c=f;break}if(a>=n)throw new RangeError("Data too long")}for(const m of[dt,ht,ft])o&&c<=z(a,m)*8&&(e=m);const u=[];for(const m of t){N(m.mode[0],4,u),N(m.numChars,gt(m.mode,a),u);for(const f of m.getData())u.push(f)}const h=z(a,e)*8;N(0,Math.min(4,h-u.length),u),N(0,(8-u.length%8)%8,u);for(let m=236;u.length<h;m^=253)N(m,8,u);const p=Array.from({length:Math.ceil(u.length/8)},()=>0);return u.forEach((m,f)=>p[f>>>3]|=m<<7-(f&7)),new _t(a,e,p,r)}function Xt(t,e){const{ecc:s="L",boostEcc:n=!1,minVersion:r=1,maxVersion:o=40,maskPattern:a=-1,border:c=1}=e||{},u=typeof t=="string"?qt(t):Array.isArray(t)?[yt(t)]:void 0;if(!u)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof t}`);const h=Wt(u,It[s],r,o,a,n),p=Jt({version:h.version,maskPattern:h.mask,size:h.size,data:h.modules,types:h.types},c);return e?.invert&&(p.data=p.data.map(m=>m.map(f=>!f))),e?.onEncoded?.(p),p}function Jt(t,e=1){if(!e)return t;const{size:s}=t,n=s+e*2;t.size=n,t.data.forEach(o=>{for(let a=0;a<e;a++)o.unshift(!1),o.push(!1)});for(let o=0;o<e;o++)t.data.unshift(Array.from({length:n},a=>!1)),t.data.push(Array.from({length:n},a=>!1));const r=k.Border;t.types.forEach(o=>{for(let a=0;a<e;a++)o.unshift(r),o.push(r)});for(let o=0;o<e;o++)t.types.unshift(Array.from({length:n},a=>r)),t.types.push(Array.from({length:n},a=>r));return t}function lt(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Kt(t,e={}){const s=Xt(t,e),{pixelSize:n=10,whiteColor:r="white",blackColor:o="black"}=e,a=s.size*n,c=s.size*n;let u=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${c} ${a}">`;const h=[];for(let p=0;p<s.size;p++)for(let m=0;m<s.size;m++){const f=m*n,b=p*n;s.data[p][m]&&h.push(`M${f},${b}h${n}v${n}h-${n}z`)}return u+=`<rect fill="${lt(r)}" width="${c}" height="${a}"/>`,u+=`<path fill="${lt(o)}" d="${h.join("")}"/>`,u+="</svg>",u}const Zt="scout",Qt="pair";function _(t){const e=typeof t=="string"?t.trim():"";return e?`${Zt}://${Qt}?payload=${encodeURIComponent(e)}`:null}function te(t){const e=ee(t),s=_(t);if(!e)return{default:s,lan:null,tailnet:null};const n=xt(e.relay,e.fallbackRelays??[]),r=n.find(se),o=n.find(ne);return{default:s,lan:r?_(JSON.stringify(ct(e,r))):null,tailnet:o?_(JSON.stringify(ct(e,o))):null}}function ee(t){const e=typeof t=="string"?t.trim():"";if(!e)return null;try{const s=JSON.parse(e);return!s||typeof s!="object"||typeof s.relay!="string"?null:s}catch{return null}}function ct(t,e){const s=xt(e,[t.relay,...Array.isArray(t.fallbackRelays)?t.fallbackRelays:[]]),n={...t,relay:s[0]};return s.length>1?n.fallbackRelays=s.slice(1):delete n.fallbackRelays,n}function xt(t,e){const s=[],n=new Set;for(const r of[t,...e]){if(typeof r!="string")continue;const o=r.trim();!o||n.has(o)||(n.add(o),s.push(o))}return s}function se(t){const e=Nt(t);if(!e)return!1;if(e.endsWith(".local"))return!0;const s=wt(e);if(!s)return!1;const[n,r]=s;return n===10||n===192&&r===168||n===172&&r>=16&&r<=31||n===169&&r===254}function ne(t){const e=Nt(t);if(!e)return!1;if(e.endsWith(".ts.net"))return!0;const s=wt(e);if(!s)return!1;const[n,r]=s;return n===100&&r>=64&&r<=127}function Nt(t){try{return new URL(t).hostname.toLowerCase()}catch{return""}}function wt(t){const e=t.split(".");if(e.length!==4)return null;const s=e.map(n=>{if(!/^\d+$/.test(n))return Number.NaN;const r=Number(n);return r>=0&&r<=255?r:Number.NaN});return s.every(Number.isFinite)?s:null}function re(t){return t?t.replace(/^wss?:\/\//,"").replace(/:\d+$/,""):null}function ut(t){return t?t.length<=18?t:`${t.slice(0,10)}...${t.slice(-6)}`:null}function ie(t,e){if(!t)return null;const s=Math.max(0,Math.floor((t-e)/1e3));if(s===0)return null;if(s<60)return`${s}s`;const n=Math.floor(s/60),r=s%60;return r>0?`${n}m ${r}s`:`${n}m`}function D({value:t}){const[e,s]=d.useState(!1),n=d.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[t]);return i.jsx("button",{type:"button",className:"sys-copy-btn",onClick:n,title:"Copy",children:e?i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})}):i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),i.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}function $({label:t,value:e}){return i.jsxs("span",{className:"sys-settings-route-link",children:[i.jsx("a",{className:"sys-settings-link",href:e,title:e,"aria-label":`Open Scout ${t} pairing link`,children:i.jsx("code",{children:t})}),i.jsx(D,{value:e})]})}function oe({agentId:t,navigate:e}){return d.useEffect(()=>{e({view:"agents-v2",agentId:t,tab:"config"})},[t,e]),null}function Rs({navigate:t,section:e,agentId:s}){if(e==="agents"&&s)return i.jsx(oe,{agentId:s,navigate:t});if(e==="agents")return i.jsx(Mt,{navigate:t,selectedAgentId:s});if(e===void 0||e==="appearance"||e==="operator"||e==="comms"||e==="credentials"||e==="voice"||e==="devices"||e==="about"){const n=e??"appearance";return i.jsx(At,{section:n,onSectionChange:r=>t({view:"settings",section:r})})}return i.jsx(ae,{})}function ae(){const[t,e]=d.useState(null),[s,n]=d.useState(""),[r,o]=d.useState(""),[a,c]=d.useState(!0),[u,h]=d.useState(!1),[p,m]=d.useState(!1),[f,b]=d.useState(null),[g,E]=d.useState(null),[H,A]=d.useState(null),[C,Y]=d.useState(null),[jt,G]=d.useState(()=>Date.now()),[W,X]=d.useState(null),J=d.useRef(null),w=d.useRef(0),K=d.useRef(null);d.useEffect(()=>{J.current=t},[t]),d.useEffect(()=>{K.current=f},[f]),d.useEffect(()=>{!t||window.location.hash!=="#trusted-peers"||window.requestAnimationFrame(()=>{document.getElementById("trusted-peers")?.scrollIntoView({block:"start"})})},[t]);const j=d.useCallback(async(l="initial")=>{if(l==="background"&&K.current)return;const v=++w.current;!(J.current!==null)&&l!=="background"?(c(!0),E(null)):h(!0);try{const R=await M(l==="manual"?"/api/pairing-state/refresh":"/api/pairing-state");if(v!==w.current)return;e(R),E(null),Y(Date.now())}catch(R){if(v!==w.current)return;E(R instanceof Error?R.message:String(R))}finally{v===w.current&&(c(!1),h(!1))}},[]),Z=d.useCallback(async()=>{try{const l=await M("/api/user");o(l.name),n(l.name),A(null)}catch(l){A(l instanceof Error?l.message:String(l))}},[]),Q=d.useRef(!1);d.useEffect(()=>{j("initial"),Z()},[j,Z]),d.useEffect(()=>{const l=setInterval(()=>{j("background")},1e4);return()=>clearInterval(l)},[j]),d.useEffect(()=>{if(!t?.pairing?.expiresAt)return;G(Date.now());const l=setInterval(()=>{G(Date.now())},1e3);return()=>clearInterval(l)},[t?.pairing?.expiresAt]);const tt=d.useCallback(async()=>{m(!0),A(null);try{const l=await M("/api/user",{method:"POST",body:JSON.stringify({name:s})});o(l.name),n(l.name)}catch(l){A(l instanceof Error?l.message:String(l))}finally{m(!1)}},[s]),S=d.useCallback(async l=>{const v=++w.current;b(l),E(null);try{const P=await M("/api/pairing/control",{method:"POST",body:JSON.stringify({action:l})});if(v!==w.current)return;e(P),Y(Date.now())}catch(P){if(v!==w.current)return;E(P instanceof Error?P.message:String(P))}finally{v===w.current&&b(null)}},[]);d.useEffect(()=>{!t||t.isRunning||Q.current||(Q.current=!0,S("start"))},[t,S]);const Et=d.useCallback(async l=>{X(l);try{await M(`/api/pairing/peers/${encodeURIComponent(l)}`,{method:"DELETE"}),j("manual")}catch{}finally{X(null)}},[j]),et=d.useMemo(()=>{const l=t?.pairing?.qrValue?.trim();return l?Kt(l,{border:2,ecc:"M",pixelSize:8}):null},[t?.pairing?.qrValue]),y=d.useMemo(()=>te(t?.pairing?.qrValue),[t?.pairing?.qrValue]),kt=!!(y.lan||y.tailnet||y.default),F=re(t?.pairing?.relay??t?.relay??null),st=ie(t?.pairing?.expiresAt,jt),nt=(t?.trustedPeers.find(l=>l.fingerprint===t.connectedPeerFingerprint)??null)?.name??ut(t?.connectedPeerFingerprint??null),Pt=Rt(t),rt=s.trim()!==r,St=!a&&!t&&!!g;return i.jsxs("div",{className:"sys-surface-page sys-settings-page",children:[i.jsxs("div",{className:"sys-page-head",children:[i.jsxs("div",{className:"sys-page-title-group",children:[i.jsx("h2",{className:"sys-page-title",children:"Settings"}),i.jsx("p",{className:"sys-page-subtitle",children:"Identity, pairing, and trusted devices."})]}),i.jsxs("div",{className:"sys-page-actions",children:[t&&i.jsx(B,{tone:Pt,children:t.statusLabel}),i.jsx("div",{className:"sys-sync-note",children:a?"Loading...":g&&t?`Snapshot from ${C?ot(C):"earlier"}`:C?`Updated ${ot(C)}`:""}),i.jsx("button",{type:"button",className:"s-btn",disabled:a||u||!!f,onClick:()=>{j("manual")},children:u?"Refreshing...":"Refresh"})]})]}),g&&t&&i.jsxs("div",{className:"sys-banner sys-banner-warning",children:[i.jsx("strong",{children:"Refresh failed."}),i.jsx("span",{children:g})]}),H&&i.jsxs("div",{className:"sys-banner sys-banner-warning",children:[i.jsx("strong",{children:"Identity error."}),i.jsx("span",{children:H})]}),a&&!t&&i.jsx(it,{title:"Loading settings",body:"Checking relay status and trusted peers."}),St&&i.jsx(it,{className:"sys-state-card-error",title:"Pairing unavailable",body:g,action:i.jsx("button",{type:"button",className:"s-btn",onClick:()=>{j("manual")},children:"Try again"})}),i.jsxs("div",{className:"sys-settings-hero",children:[i.jsx("div",{className:"sys-settings-qr-col",children:et?i.jsxs("div",{className:"sys-settings-qr-frame",children:[i.jsx("div",{className:"s-qr",dangerouslySetInnerHTML:{__html:et}}),st&&i.jsxs("span",{className:"sys-settings-qr-expires",children:["Expires in ",st]})]}):i.jsx("div",{className:"sys-settings-qr-empty",children:i.jsx("span",{className:"sys-settings-qr-empty-label",children:"Generating QR..."})})}),i.jsxs("div",{className:"sys-settings-info-col",children:[i.jsxs("div",{className:"sys-input-row",children:[i.jsx("input",{className:"sys-input",type:"text",placeholder:"Your name",value:s,onChange:l=>n(l.target.value),onKeyDown:l=>{l.key==="Enter"&&rt&&!p&&tt()}}),i.jsx("button",{type:"button",className:"s-btn s-btn-primary",disabled:!rt||p,onClick:()=>{tt()},children:p?"Saving...":"Save"})]}),i.jsxs("div",{className:"sys-settings-kv-list",children:[t?.identityFingerprint&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Fingerprint"}),i.jsxs("span",{className:"sys-settings-kv-value",children:[i.jsx("code",{children:t.identityFingerprint}),i.jsx(D,{value:t.identityFingerprint})]})]}),F&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Relay"}),i.jsxs("span",{className:"sys-settings-kv-value",children:[i.jsx("code",{children:F}),i.jsx(D,{value:F})]})]}),kt&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Links"}),i.jsxs("span",{className:"sys-settings-kv-value sys-settings-link-list",children:[y.lan&&i.jsx($,{label:"LAN",value:y.lan}),y.tailnet&&i.jsx($,{label:"TSN",value:y.tailnet}),!y.lan&&!y.tailnet&&y.default&&i.jsx($,{label:"PAIR",value:y.default})]})]}),t?.statusDetail&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Status"}),i.jsx("span",{className:"sys-settings-kv-value sys-settings-kv-nowrap",children:t.statusDetail})]}),nt&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Connected"}),i.jsx("span",{className:"sys-settings-kv-value",children:nt})]}),t?.secure&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Security"}),i.jsx("span",{className:"sys-settings-kv-value",children:i.jsx(B,{tone:"success",children:"Noise XX"})})]})]}),t&&i.jsx("div",{className:"sys-inline-actions sys-settings-controls",children:t.isRunning?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"s-btn",disabled:!!f,onClick:()=>{S("restart")},children:f==="restart"?"Restarting...":"Restart"}),i.jsx("button",{type:"button",className:"s-btn",disabled:!!f,onClick:()=>{S("stop")},children:f==="stop"?"Stopping...":"Stop"})]}):i.jsx("button",{type:"button",className:"s-btn s-btn-primary",disabled:!!f,onClick:()=>{S("start")},children:f==="start"?"Starting...":"Start pairing"})})]})]}),t&&i.jsxs("section",{className:"sys-settings-peers",id:"trusted-peers",children:[i.jsx("div",{className:"sys-section-head",children:i.jsxs("div",{children:[i.jsx("h3",{className:"sys-section-title",children:"Trusted peers"}),i.jsxs("p",{className:"sys-section-subtitle",children:[t.trustedPeers.length," device",t.trustedPeers.length!==1?"s":""," paired with this broker."]})]})}),t.trustedPeers.length===0?i.jsxs("div",{className:"sys-list-empty",children:[i.jsx("h3",{children:"No trusted peers"}),i.jsx("p",{children:"Devices appear here after completing pairing."})]}):i.jsxs("table",{className:"sys-peers-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Device"}),i.jsx("th",{children:"Fingerprint"}),i.jsx("th",{children:"Paired"}),i.jsx("th",{children:"Last seen"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:t.trustedPeers.map(l=>{const v=l.fingerprint===t.connectedPeerFingerprint;return i.jsxs("tr",{className:v?"sys-peers-row-connected":"",children:[i.jsx("td",{children:i.jsxs("span",{className:"sys-peers-name",children:[l.name??ut(l.fingerprint)??"Peer",v&&i.jsx(B,{tone:"success",className:"sys-peers-badge",children:"Connected"})]})}),i.jsx("td",{children:i.jsx("code",{className:"sys-peers-fp",children:l.fingerprint})}),i.jsx("td",{children:l.pairedAtLabel??"—"}),i.jsx("td",{children:l.lastSeenLabel??"—"}),i.jsx("td",{children:i.jsx("button",{type:"button",className:"sys-peers-remove",disabled:W===l.fingerprint,onClick:()=>{Et(l.fingerprint)},title:"Remove peer",children:W===l.fingerprint?"...":"Remove"})})]},l.fingerprint)})})]})]})]})}export{Rs as SettingsScreen};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SageModelStudio-BR1J2D4R.js","assets/index-C8uS5szO.js","assets/index-Ck1__1yL.css","assets/SageModelStudio-768dRQr4.css"])))=>i.map(i=>d[i]);
2
- import{r,x as Ce,m as xt,j as t,_ as yt}from"./index-C8uS5szO.js";import{a as bt}from"./api-CaROe5_H.js";import{p as jt,W as wt,w as kt,z as _t,c as Pt,a as Ct,u as Mt,Z as Xe}from"./WorldMinimap-Blqg0d5r.js";import{WorldSky as St}from"./WorldSky-DV9bpvXj.js";import{WorldActorTalk as vt}from"./WorldActorTalk-uIH2jGqA.js";import{f as Nt,F as At}from"./FloorExchangePanel-D59nvRCF.js";import{CharacterFamilyPreview as Et}from"./CharacterFamilyPreview-CfO3j8Of.js";import{w as ze}from"./RenderedWorkerSprite-CvdWO32C.js";import{f as Tt}from"./floor-preview-text-HrORUJ7D.js";import{FloorMessagePasses as $t}from"./FloorMessagePasses-BCwsz9VS.js";import{f as Rt}from"./floor-character-name-CqJPOlXb.js";import{WorkRunView as It}from"./WorkRunView-x5PH1byG.js";import{b as me}from"./agent-lane-detail-Db7KyAlf.js";import{f as Ot}from"./floor-memory-YMM8AlLY.js";import{f as Dt}from"./floor-context-model-DZBpo_oD.js";import{f as pe}from"./agent-floor-actor-3v9drnxh.js";import{b as Ze}from"./shared-work-artifacts-4IIQXQfc.js";import{u as Wt}from"./Provider-5Hotn7NQ.js";import{SharedFloorCharacter as Ft}from"./SharedFloorCharacter-CSYG_t9t.js";import{j as Lt}from"./agent-lanes-model-CX0wTcnF.js";import{F as Ht}from"./file-code-corner-D_Aptal2.js";import"./runtime-picker-DdsttHHc.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./createLucideIcon-DkjnzvcJ.js";import"./router-BKiMcYa7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./index-C5cX8dkl.js";import"./NewChatComposer-JjLbm3W2.js";import"./conversation-model-BGFHoxQ0.js";import"./agent-state-DDhnFEEP.js";import"./colors-CFlbwC25.js";import"./time-Dhsh_2EG.js";import"./conversations-Cbg9h_Af.js";import"./HarnessMark-Bt47OeHy.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./file-text-ChtICwub.js";import"./send-to-agent-session-BZGq_ycy.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./floor-message-passes-CJh9f8Jp.js";import"./lane-observe-BD21P8BB.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./CrewSprite-hgpA3SWB.js";import"./SpriteAvatar-BW1JzkDt.js";import"./lane-ask-display-B6iCAVcd.js";import"./context-budget-DemtXu7E.js";import"./WorldCharacter-Dn4sIXNP.js";import"./RiggedWorkerCharacter-DNe731GE.js";function Bt(){const[a,c]=r.useState([]);return r.useEffect(()=>{let h=!1,d;const j=async()=>{try{const w=await bt("/api/world/messages");h||c(w)}catch{}h||(d=setTimeout(j,3e3))};return j(),()=>{h=!0,clearTimeout(d)}},[]),a}const ve=715,fe=Math.round(ve*809/647),Kt=647/809,Me=.22,qe=.78,Se=.36,et=.58,Yt=.16,Xt=.981,zt=64,tt=84,Zt=84,Gt=132,Ut=95,Ge=.12,Jt=.85,Qt=.5,Ue=[6,-5,3,-3,5],Je=205,Qe=60,q=30;function st(a){const c=a<=6?3:a<=12?4:5;return{columns:c,rows:Math.max(1,Math.ceil(Math.max(a,1)/c))}}function Vt(a){const{columns:c,rows:h}=st(a),d=(qe-Me)*ve,j=(et-Se)*fe,w=Math.max(1,c*Gt/d,h*Ut/j);return Math.round(fe*w)}function qt(a,c,h){const{columns:d,rows:j}=st(a),w=Me*c,$=(qe-Me)*c,u=Se*h,f=(et-Se)*h;return Array.from({length:a},(g,x)=>{const y=Math.floor(x/d),m=x%d,b=Math.min(d,a-y*d),S=j===1?Qt:Ge+(Jt-Ge)*(y/(j-1)),p=(1-S)*Yt*$,k=$-p*2-tt,O=d>1?k*(b-1)/(d-1):0,D=b>1?O/(b-1):0;return{x:Math.round(w+p+(k-O)/2+m*D),y:Math.round(u+S*f-Zt+Ue[m%Ue.length])}})}function es(a){const c=(a.facts?.cwd||me(a).cwd||"").trim();if(!c.startsWith("/"))return"";const h=[];for(const d of c.split("/"))d===".."?h.pop():d&&d!=="."&&h.push(d);return`/${h.join("/")}`}function ts(a,c){const h=new Map;for(const u of a){const f=es(u),g=JSON.stringify(f?["workspace",f]:["lane",u.id]),x=h.get(g)??{cwd:f,lanes:new Map};x.lanes.set(u.id,u),h.set(g,x)}const d={groups:c?.groups.map(u=>({...u,laneIds:[...u.laneIds]}))??[]};for(const[u,f]of h){let g=d.groups.find(x=>x.key===u);g||(g={key:u,laneIds:[],height:fe},d.groups.push(g));for(const x of f.lanes.keys())g.laneIds.includes(x)||g.laneIds.push(x);g.height=Math.max(g.height,Vt(g.laneIds.length))}const j=[];let w=q,$=q*2+ve;for(let u=0;u<d.groups.length;u+=2){const f=d.groups.slice(u,u+2),g=Math.max(...f.map(m=>m.height),fe),x=w;let y=q;for(const m of f){const b=h.get(m.key),S=Math.round(m.height*Kt);if(b){const p=qt(m.laneIds.length,S,m.height),k=y,O=m.laneIds.flatMap((D,ee)=>{const te=b.lanes.get(D);if(!te)return[];const{x:Y,y:se}=p[ee];return[{lane:te,x:Y,y:se,centerX:k+Y+tt/2,centerY:x+se+70}]});j.push({key:m.key,cwd:b.cwd,lanes:O.map(D=>D.lane),x:k,y:x,width:S,height:m.height,actors:O})}y+=S+Je}$=Math.max($,y-Je+q),w=x+Math.round(g*Xt)+zt+Qe}return{memory:d,groups:j,worldWidth:$,worldHeight:Math.max(320,d.groups.length?w-Qe+q:w)}}const ss="/assets/world-outposts-v1-DOt0i98W.png",os="/assets/solar-system-scope-2k-stars-points-1FwHnkj0.png",rs=r.lazy(()=>yt(()=>import("./SageModelStudio-BR1J2D4R.js"),__vite__mapDeps([0,1,2,3])));function Ve(a){return a>=1?`${Number(a.toFixed(a<10?1:0))}:1`:`1:${Math.round(1/a).toLocaleString()}`}function ns(a){let c=0;for(const h of a)c=c*31+h.charCodeAt(0)>>>0;return{outpostPosition:`${c%3*50}% center`,skyPosition:`${c%100}% ${18+c%58}%`}}function Po({lanes:a,now:c,onActor:h}){const{openFilePreview:d}=Wt(),j=Bt(),[w,$]=r.useState(null),[u,f]=r.useState(null),[g,x]=r.useState(!1),[y,m]=r.useState(null),[b,S]=r.useState([]),[p,k]=r.useState(null),[O,D]=r.useState(null),[ee,te]=r.useState(!1),[Y,se]=r.useState(!0),[X,ot]=r.useState("crew"),oe=r.useRef({});for(const e of[...a].sort((s,n)=>s.id.localeCompare(n.id)))if(!oe.current[e.id]){const s=Object.values(oe.current);oe.current[e.id]=xt(e.agent.name)??Ce.find(n=>!s.includes(n.slug))?.slug??Ce[s.length%Ce.length].slug}const[rt,Ne]=r.useState(!1),[nt,Ae]=r.useState(!1),[Ee,at]=r.useState(!0),re=r.useRef([]);for(const e of a){if(re.current.length>=ze.length)break;re.current.includes(e.id)||re.current.push(e.id)}const[ge,it]=r.useState(!1),[Te,ct]=r.useState(!1),[xe,lt]=r.useState(!1),[ye,ne]=r.useState(!1),[F,dt]=r.useState(!1),ae=r.useRef(null),[ie,ut]=r.useState({width:900,height:500}),[N,$e]=r.useState(null),[A,ht]=r.useState("flat"),[v,be]=r.useState(1),[_,ce]=r.useState({x:0,y:0}),[z,pt]=r.useState({}),[je,we]=r.useState(null),L=r.useRef(null),H=r.useRef(!1),P=r.useRef(null);r.useEffect(()=>{if(!ae.current)return;const e=new ResizeObserver(([s])=>ut({width:s.contentRect.width,height:s.contentRect.height}));return e.observe(ae.current),()=>e.disconnect()},[g]);const Re=r.useRef(void 0),R=r.useMemo(()=>ts(a,Re.current),[a]);r.useEffect(()=>{Re.current=R.memory},[R]);const E=new Map(R.groups.map(e=>[e.key,e]));[...E];const le=E,W=a.find(e=>e.id===y)??null,mt=W?Ze(a).filter(e=>e.owners.some(s=>s.id===W.id)):[],Z=new Map;for(const e of mt)for(const s of e.owners)s.id!==y&&Z.set(s.id,{lane:s,reason:"Shared file activity"});const B=Ot(a),Ie=[...new Map(B.map(({parent:e})=>[e.id,e])).values()],de=e=>Rt(e).label;for(const e of B)e.child.id===y&&Z.set(e.parent.id,{lane:e.parent,reason:"Parent session"}),e.parent.id===y&&Z.set(e.child.id,{lane:e.child,reason:"Child session"});const Oe=new Set(Z.keys());p&&p.forEach(e=>Oe.add(e));const De=Nt(a,c,j),G=new Map;for(const e of De)G.set([e.from,e.to].sort().join(":"),[e.from,e.to]);for(const{parent:e,child:s}of B){const n=[e.id,s.id].sort().join(":");G.has(n)||G.set(n,[e.id,s.id])}const We=!!p&&[...G.values()].some(e=>e.every(s=>p.includes(s)));r.useEffect(()=>{p&&!We&&k(null)},[We,p]);const Fe=e=>{m(null),k(e)},U=new Map(R.groups.flatMap(e=>e.actors.map(s=>[s.lane.id,{x:s.centerX+(z[s.lane.id]?.x??0),y:s.centerY+(z[s.lane.id]?.y??0)}]))),J=y?U.get(y):null;W&&Dt([W],c,["tool","message","ask"]).slice(0,3),W&&pe(W,c);const C=R.worldWidth,M=R.worldHeight,Le=A==="iso"?Math.sqrt(3)/2*(C+M):C,He=A==="iso"?(C+M)/2:M,Be=Math.min((ie.width-36)/Le,(ie.height-70)/He),I=Math.max(.12,Be)*v,ue=r.useRef({zoom:v,pan:_});ue.current={zoom:v,pan:_};const ke=(e,s)=>{const n=Math.max(.12,Be)*s;return Pt(e,{width:Le*n,height:He*n},ie)},_e=(e,s)=>{const n=_t(ue.current.zoom,ue.current.pan,e,s);n.pan=ke(n.pan,n.zoom),ue.current=n,be(n.zoom),ce(n.pan)};r.useEffect(()=>{const e=ae.current;if(!e)return;const s=n=>{if(n.target.closest(".shared-floor__inspect"))return;n.preventDefault();const o=e.getBoundingClientRect();_e(kt(n.deltaY,n.deltaMode),{x:n.clientX-o.left-o.width/2,y:n.clientY-o.top-o.height/2})};return e.addEventListener("wheel",s,{passive:!1}),()=>e.removeEventListener("wheel",s)});const Pe=Ct(v),ft=r.useMemo(()=>R.groups.map(e=>{const s=jt(e.x+e.width/2-C/2,e.y+e.height/2-M/2,A);return{x:s.x*I+_.x,y:s.y*I+_.y,spread:e.width*I}}),[R.groups,A,I,_,C,M]),Q=e=>{k(null),m(e.id),h(e)},Ke=e=>{S(s=>s.includes(e.id)?s.filter(n=>n!==e.id):[...s,e.id]),Q(e)};return r.useEffect(()=>{S(e=>{const s=e.filter(n=>a.some(o=>o.id===n));return s.length===e.length?e:s})},[a]),r.useEffect(()=>{if(!y&&!p&&b.length===0)return;const e=s=>{s.key==="Escape"&&(m(null),k(null),S([]))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[y,p,b.length]),g?t.jsxs("div",{className:"shared-floor shared-floor__experiment",children:[t.jsx("button",{className:"shared-floor__back",type:"button",onClick:()=>x(!1),children:"← Back to world"}),t.jsx(It,{lanes:a,now:c,onActor:h})]}):t.jsxs("div",{className:`shared-floor is-map is-${A}${W||p?" has-selection":""}${Te?" has-boundaries":""}${F?" is-paused":""}`,children:[u?t.jsx(vt,{...u,onSent:()=>{$(u.lane.id),m(u.lane.id)},onTalk:()=>f({...u,compose:!0,voice:!1}),onDictate:()=>f({...u,compose:!0,voice:!0}),onProfile:()=>{Q(u.lane),f(null)},onClose:()=>f(null)},u.lane.id):null,nt?t.jsx(r.Suspense,{fallback:t.jsx("div",{role:"status",children:"Loading 3D studio…"}),children:t.jsx(rs,{onClose:()=>Ae(!1)})}):null,p?t.jsx(At,{pair:p,lanes:a,now:c,onClose:()=>k(null),onFile:d,onSpeaker:D},p.join(":")):null,rt?t.jsx(Et,{onClose:()=>Ne(!1)}):null,t.jsxs("div",{className:"shared-floor__teams",children:[t.jsxs("button",{type:"button","aria-expanded":xe,onClick:()=>lt(!xe),children:["Agent teams",B.length?` · ${B.length}`:""]}),xe?t.jsxs("section",{"aria-label":"Agent families",children:[t.jsx("strong",{children:"Parent → subagents"}),Ie.length?Ie.map(e=>t.jsxs("div",{children:[t.jsx("button",{type:"button",onClick:()=>Q(e),children:de(e)}),B.filter(s=>s.parent.id===e.id).map(({child:s})=>t.jsxs("button",{className:"shared-floor__team-child",type:"button",onClick:()=>Q(s),children:["↳ ",de(s),t.jsx("small",{children:pe(s,c).label})]},s.id))]},e.id)):t.jsx("p",{children:"No parent links reported in this roster yet."})]}):null]}),t.jsxs("div",{className:"shared-floor__layers",children:[t.jsx("button",{type:"button","aria-expanded":ye,onClick:()=>ne(!ye),children:"Layers"}),ye?t.jsxs("div",{children:[t.jsxs("label",{children:[t.jsx("input",{type:"checkbox","aria-label":"Work surfaces",checked:ge,onChange:e=>it(e.target.checked)}),"Work surfaces"]}),t.jsxs("label",{children:[t.jsx("input",{type:"checkbox","aria-label":"Boundaries",checked:Te,onChange:e=>ct(e.target.checked)}),"Boundaries"]}),t.jsxs("label",{children:[t.jsx("input",{type:"checkbox","aria-label":"Playful motion",checked:ee,onChange:e=>te(e.target.checked)}),"Playful motion"]}),t.jsxs("label",{children:["Characters",t.jsxs("select",{"aria-label":"Map character style",value:X,onChange:e=>ot(e.target.value),children:[t.jsx("option",{value:"crew",children:"Crew"}),t.jsx("option",{value:"chip",children:"Pixel Chip"}),t.jsx("option",{value:"prototype",children:"Prototype rigs"})]})]}),X==="prototype"?t.jsxs("label",{children:[t.jsx("input",{type:"checkbox","aria-label":"Character rig",checked:Y,onChange:e=>se(e.target.checked)}),"Character rig"]}):null,t.jsx("button",{type:"button",onClick:()=>{Ne(!0),ne(!1)},children:"Preview character family →"}),t.jsx("button",{type:"button",onClick:()=>{Ae(!0),ne(!1)},children:"3D character studio →"}),X==="prototype"?t.jsxs("label",{children:[t.jsx("input",{type:"checkbox","aria-label":"Rendered characters",checked:Ee,onChange:e=>at(e.target.checked)}),"Rendered characters"]}):null,t.jsx("button",{type:"button",className:"shared-floor__run-link",onClick:()=>{ne(!1),x(!0)},children:"Try Work run →"})]}):null]}),t.jsxs("div",{className:"shared-floor__camera","aria-label":"Map camera",children:[t.jsx("button",{type:"button","aria-pressed":F,onClick:()=>dt(!F),children:F?"Resume":"Pause"}),t.jsx("div",{role:"group","aria-label":"Map projection",children:["flat","iso"].map(e=>t.jsx("button",{type:"button","aria-pressed":A===e,onClick:()=>ht(e),children:e==="iso"?"Iso":"Flat"},e))}),t.jsx("button",{type:"button","aria-label":"Zoom shared map out",onClick:()=>_e(1/Xe),children:"−"}),t.jsx("button",{type:"button",onClick:()=>{be(1),ce({x:0,y:0})},children:"Fit"}),t.jsx("button",{type:"button","aria-label":"Zoom shared map in",onClick:()=>_e(Xe),children:"+"}),t.jsx("output",{className:"shared-floor__zoom-readout","aria-label":`Zoom ${Ve(v)}`,children:Ve(v)})]}),t.jsx(wt,{width:C,height:M,projection:A,size:ie,scale:I,zoom:v,pan:_,onPan:e=>ce(ke(e,v)),onZoom:be,workspaces:[...E].map(([e,s])=>({id:e,label:`Locate workspace ${s.cwd||"unknown"}, ${s.lanes.length} actors`,x:s.x+s.width/2,y:s.y+s.height/2}))}),N&&E.has(N)?t.jsxs("aside",{className:"shared-floor__workspace-panel","aria-label":"Workspace details",children:[t.jsxs("header",{children:[t.jsx("strong",{children:E.get(N).cwd.split("/").filter(Boolean).at(-1)||"Workspace"}),t.jsx("button",{type:"button","aria-label":"Close workspace details",onClick:()=>$e(null),children:"×"})]}),t.jsx("p",{children:E.get(N).cwd}),t.jsx("h4",{children:"Reported branches"}),t.jsx("small",{children:[...new Set(E.get(N).lanes.map(e=>e.facts?.branch||me(e).branch).filter(Boolean))].join(" · ")||"Branch not reported"}),t.jsx("h4",{children:"Actors in this workspace"}),E.get(N).lanes.map(e=>t.jsxs("button",{className:"shared-floor__workspace-actor",type:"button",onClick:()=>Q(e),children:[t.jsxs("span",{className:"shared-floor__workspace-actor-heading",children:[t.jsx("strong",{children:de(e)}),t.jsx("small",{children:pe(e,c).label})]}),t.jsx("span",{className:"shared-floor__workspace-runtime",children:[e.agent.harness,e.facts?.model||me(e).model].filter(Boolean).join(" · ")||"Runtime not reported"}),t.jsx("span",{className:"shared-floor__workspace-task",children:Tt(e.facts?.currentTask)||"No task reported"}),t.jsxs("span",{className:"shared-floor__workspace-runtime",children:[e.facts?.branch||me(e).branch||"Branch not reported"," · ",e.id.slice(-5)]})]},e.id))]}):null,t.jsxs("div",{className:"shared-floor__viewport",ref:ae,onPointerDown:e=>{e.button!==0||e.target.closest("button")||(P.current={x:e.clientX,y:e.clientY,px:_.x,py:_.y},e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{P.current&&ce(ke({x:P.current.px+e.clientX-P.current.x,y:P.current.py+e.clientY-P.current.y},v))},onPointerUp:e=>{P.current&&Math.hypot(e.clientX-P.current.x,e.clientY-P.current.y)<4&&(m(null),k(null)),P.current=null},onPointerCancel:()=>{P.current=null},children:[t.jsx(St,{zoom:v,pan:_,beacons:ft,beaconStrength:Pe.beacons}),t.jsxs("div",{className:"shared-floor__benches",style:{opacity:Pe.world,visibility:Pe.world>0?void 0:"hidden",width:C,height:M,transform:`translate(${_.x}px, ${_.y}px) scale(${I})${A==="iso"?" matrix(0.8660254, 0.5, -0.8660254, 0.5, 0, 0)":""}`,marginLeft:-C/2,marginTop:-M/2},children:[t.jsx("svg",{className:"floor-exchange-links",width:C,height:M,"aria-label":"Agent exchange links",children:[...G].map(([e,s])=>{const n=U.get(s[0]),o=U.get(s[1]);if(!n||!o)return null;const V=s.map(l=>{const T=a.find(he=>he.id===l);return T?de(T):"Actor"}).join(" and "),K=De.some(l=>s.includes(l.from)&&s.includes(l.to)),i=`M ${n.x} ${n.y} Q ${(n.x+o.x)/2} ${Math.min(n.y,o.y)-30} ${o.x} ${o.y}`;return t.jsxs("g",{role:"button",tabIndex:0,"aria-label":`${K?"Open exchanges":"Inspect relationship"} between ${V}`,className:`${K?"is-exchange":"is-family"}${p?.includes(s[0])&&p.includes(s[1])?" is-active":""}`,onPointerDown:l=>l.stopPropagation(),onClick:l=>{l.stopPropagation(),Fe(s)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),Fe(s))},children:[t.jsxs("title",{children:[K?"Recent exchanges":"Parent relationship"," · ",V]}),t.jsx("path",{className:"exchange-line",d:i}),t.jsx("path",{className:"exchange-hit",d:i})]},e)})}),t.jsx($t,{broker:j,lanes:a,now:c,positions:U,paused:F}),J?t.jsx("svg",{className:"shared-floor__connections",width:C,height:M,"aria-hidden":"true",children:[...Z].map(([e,s])=>{const n=U.get(e);return n?t.jsx("path",{className:s.reason==="Shared file activity"?"is-shared":"is-lineage",d:`M ${J.x} ${J.y} Q ${(J.x+n.x)/2} ${Math.min(J.y,n.y)-35} ${n.x} ${n.y}`},e):null})}):null,[...E].map(([e,s])=>{const n=ns(e);return t.jsxs("section",{className:`shared-floor__island${s.actors.length>1||ge?" has-place":""}${N===e?" is-open":""}`,"aria-label":s.cwd||"Agent gathering",style:{left:le.get(e).x,top:le.get(e).y,height:le.get(e).height,width:le.get(e).width},children:[t.jsxs("div",{className:"shared-floor__place-presentation",children:[t.jsx("div",{className:"shared-floor__sky","aria-hidden":"true",style:{backgroundImage:`url(${os})`,backgroundPosition:n.skyPosition}}),t.jsx("div",{className:"shared-floor__outpost","aria-hidden":"true",style:{backgroundImage:`url(${ss})`,backgroundPosition:n.outpostPosition}}),t.jsx("span",{className:"shared-floor__label-anchor","aria-hidden":"true"}),t.jsxs("button",{type:"button",className:"shared-floor__gathering-label","aria-expanded":N===e,onPointerDown:o=>o.stopPropagation(),onClick:()=>$e(N===e?null:e),children:[t.jsx("strong",{children:s.cwd==="~"?"Home":s.cwd.split("/").filter(Boolean).at(-1)||"Unassigned"}),t.jsx("small",{children:s.cwd||"Workspace not reported"})]})]}),ge?t.jsxs("div",{className:"shared-floor__optional-table",children:[t.jsx("span",{children:s.cwd.split("/").filter(Boolean).at(-1)||"Workspace"}),t.jsx("div",{children:Ze(s.lanes).slice(0,4).map(o=>t.jsxs("button",{type:"button",title:o.path,"aria-label":`Preview ${o.path}`,disabled:!o.resolvedPath,onClick:()=>o.resolvedPath&&d(o.resolvedPath),children:[t.jsx(Ht,{size:25}),t.jsx("small",{children:o.path.split("/").at(-1)})]},o.id))})]}):null,t.jsx("div",{className:"shared-floor__crew",children:s.actors.map(({lane:o,x:V,y:K})=>t.jsxs("div",{className:`shared-floor__wanderer${y===o.id?" is-selected":""}${b.includes(o.id)?" is-pinned":""}${Oe.has(o.id)?" is-connected":""}${O===o.id?" is-speaking":""}`,style:{left:V+(z[o.id]?.x??0),top:K+(z[o.id]?.y??0),zIndex:je===o.id?10:b.includes(o.id)?7+b.indexOf(o.id):void 0},"data-dragging":je===o.id||void 0,onPointerDown:i=>{if(i.button!==0)return;if(i.shiftKey||i.altKey||i.metaKey||i.ctrlKey){i.stopPropagation(),H.current=!0;const T=i.currentTarget.getBoundingClientRect();f({lane:o,x:T.left+T.width/2,y:T.bottom+32,compose:!0,voice:i.shiftKey});return}i.stopPropagation(),H.current=!1;const l=z[o.id]??{x:0,y:0};L.current={id:o.id,sx:i.clientX,sy:i.clientY,...l,baseX:s.x+V,baseY:s.y+K,moved:!1},i.currentTarget.setPointerCapture(i.pointerId)},onPointerMove:i=>{const l=L.current;if(!l||l.id!==o.id)return;i.stopPropagation();const T=i.clientX-l.sx,he=i.clientY-l.sy;if(!l.moved&&Math.hypot(T,he)<5)return;l.moved=!0,we(o.id);const Ye=Mt(T/I,he/I,A);pt(gt=>({...gt,[o.id]:{x:Math.max(0,Math.min(C-84,l.baseX+l.x+Ye.x))-l.baseX,y:Math.max(20,Math.min(M-120,l.baseY+l.y+Ye.y))-l.baseY}}))},onPointerUp:i=>{L.current?.id===o.id&&(i.stopPropagation(),L.current.moved||Ke(o),H.current=!0,L.current=null,we(null),i.currentTarget.hasPointerCapture(i.pointerId)&&i.currentTarget.releasePointerCapture(i.pointerId))},onContextMenu:i=>{i.preventDefault(),i.stopPropagation();const l=i.currentTarget.getBoundingClientRect();f({lane:o,x:l.left+l.width/2,y:l.bottom+32,compose:!1})},onPointerCancel:()=>{L.current=null,H.current=!0,we(null)},onClickCapture:i=>{H.current&&(i.stopPropagation(),H.current=!1)},children:[w===o.id?t.jsxs("span",{className:"shared-floor__talk-follow",title:"Message accepted · following observed agent status",children:["↗ You ",t.jsx("span",{children:pe(o,c).label})]}):null,t.jsx(Ft,{crewSlug:X!=="prototype"?oe.current[o.id]:void 0,pixelCrew:X==="chip",rigged:Y,lane:o,now:c,paused:F||je===o.id,playful:ee,character:Ee?ze[re.current.indexOf(o.id)]:void 0,displayName:Lt(o.agent)?o.agent.harness||"Agent":void 0,pinned:b.includes(o.id),onActor:Ke})]},o.id))})]},e)})]})]})]})}export{Po as SharedWorkFloor};
@@ -1,4 +0,0 @@
1
- import{r as i,j as s,I as Ps,J as zs}from"./index-C8uS5szO.js";/* empty css */import{a as _s,u as Lt}from"./Provider-5Hotn7NQ.js";import{a as Oe}from"./api-CaROe5_H.js";import{c as cs}from"./clipboard-e3fSpeo7.js";import{a as Dt}from"./colors-CFlbwC25.js";import{r as ve,S as Fs,a as Ks,w as ds,s as Kn,b as Bn,d as Un,c as Hn,e as Wt,f as as,g as qn}from"./terminal-relay-Bfx8pg80.js";import{p as $t,m as Ot,f as Pt,a as zt,n as _t,s as se,d as As,o as Ls,r as Ft,i as Kt,t as Bs,q as Yn,u as Vn,j as Jn,e as Bt}from"./terminal-sessions-Ch9aYlgi.js";import{f as Gn,H as Xn,u as Us,a as Qn,c as Zn,h as er,b as sr,A as tr}from"./HerdrSession-CtJOUn7H.js";import{a as Ut,t as nr,D as rr,c as ar,P as ir,d as Hs,s as vs,T as lr}from"./session-table-CDx_16xf.js";import{i as or,c as Ht}from"./agent-state-DDhnFEEP.js";import{b as cr}from"./keyboard-nav-CXfav14z.js";import{T as dr}from"./chunk-JTPDIGGW-ZC-98AHT.js";import{u as is,L as qs}from"./chunk-YOZR3KYS-B59jqwO0.js";import{q as ur}from"./terminal-takeover-BlpxpvSp.js";import{t as mr}from"./time-Dhsh_2EG.js";import{B as Qe}from"./BackToPicker-Bys9ColC.js";import{T as qt}from"./TmuxPeek-BhK0V9Qt.js";import{TerminalHeaderMount as Ts}from"./TerminalHeaderMount-DCGstkZ4.js";import{R as Yt}from"./refresh-cw-Da9DDLk2.js";import{P as Ue}from"./plus-D_wLGJGT.js";import{c as Ys}from"./createLucideIcon-DkjnzvcJ.js";import{T as ue}from"./terminal-96JWDYDL.js";import{Z as Vt}from"./zap-sKPkh4sQ.js";import{S as pr}from"./runtime-picker-DdsttHHc.js";import{S as hr}from"./search-C4VlW_0l.js";import{X as Ze}from"./x-DI1ktCYb.js";import{E as fr}from"./eye-CtqSV8BS.js";import{E as Jt}from"./external-link-RT4Ph-6-.js";const Gt=6,Xt=2;function us(e){if(e.layout?.mode)return{mode:e.layout.mode,...e.layout.columns===void 0?{}:{columns:kr(e.layout.columns)}};const t=e.cellCount??0,n=ps(e.columns??Xt);return t<=1?{mode:"solo"}:n>=t?{mode:"lanes",columns:n}:{mode:"grid",columns:n}}function ms(e,t){const n=Math.max(1,Math.floor(t.tileCount)||1);if(e.mode==="solo")return 1;if(e.columns===void 0||e.columns==="dynamic"){const a=e.mode==="lanes"?n:Math.ceil(Math.sqrt(n));return Math.max(1,Math.min(Gt,a))}return ps(e.columns)}function kr(e){return e==="dynamic"?"dynamic":ps(e)}function br(e){if(e.mode==="solo")return"Solo";const t=e.mode==="lanes"?"Lanes":"Grid";return e.columns===void 0||e.columns==="dynamic"?`${t} · dynamic`:`${t} · ${e.columns} column${e.columns===1?"":"s"}`}function ps(e){return typeof e!="number"||!Number.isFinite(e)?Xt:Math.max(1,Math.min(Gt,Math.floor(e)))}const xr=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Ds=Ys("ellipsis",xr);const yr=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],Qt=Ys("grid-2x2",yr);const gr=[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]],jr=Ys("grip-horizontal",gr),Vs=6;function Sr(e="main",t="Main"){return{version:1,activeWorkspaceId:e,workspaces:[{id:e,name:t,tiles:[]}]}}function Js(){return{version:1,activeWorkspaceId:"",workspaces:[]}}function mt(e,t,n={}){const a=()=>n.allowEmpty?Js():Sr();if(!e||typeof e!="object")return a();const c=e;if(!Array.isArray(c.workspaces))return a();const o=[],u=new Set;for(const l of c.workspaces){if(!l||typeof l!="object")continue;const p=typeof l.id=="string"?l.id.trim():"",k=typeof l.name=="string"?l.name.trim():"";if(!p||!k||u.has(p)||!Array.isArray(l.tiles))continue;u.add(p);const g=typeof l.purpose=="string"?l.purpose.trim():"",S=Cr(l.columns),C=wr(l.layout),E=typeof l.updatedAt=="number"&&Number.isFinite(l.updatedAt)&&l.updatedAt>=0?l.updatedAt:null;o.push({id:p,name:k,tiles:l.tiles.filter(t),...g?{purpose:g}:{},...S?{columns:S}:{},...C?{layout:C}:{},...E===null?{}:{updatedAt:E}})}return o.length===0?a():{version:1,activeWorkspaceId:typeof c.activeWorkspaceId=="string"&&u.has(c.activeWorkspaceId)?c.activeWorkspaceId:o[0].id,workspaces:o}}function wr(e){if(!e||typeof e!="object")return null;const t=e;if(t.mode!=="solo"&&t.mode!=="lanes"&&t.mode!=="grid")return null;if(t.columns===void 0)return{mode:t.mode};if(t.columns==="dynamic")return{mode:t.mode,columns:"dynamic"};const n=ps(t.columns);return{mode:t.mode,columns:n}}function Cr(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.floor(e);return t<1?null:Math.min(t,Vs)}function pt(e,t){const n=t.id.trim();if(!n)return e;const a={...t,id:n},o=e.workspaces.some(u=>u.id===n)?e.workspaces.map(u=>u.id===n?a:u):[a,...e.workspaces];return{...e,activeWorkspaceId:n,workspaces:o}}function ht(e,t,n){const a=e.workspaces.findIndex(m=>m.id===t);if(a<0)return e;const c=e.workspaces[a],o={...c,...n};return Object.keys(n).every(m=>c[m]===o[m])?e:{...e,workspaces:e.workspaces.map((m,l)=>l===a?o:m)}}function Nr(e,t){return t===e.activeWorkspaceId||!e.workspaces.some(n=>n.id===t)?e:{...e,activeWorkspaceId:t}}function vr(e,t,n={}){if(e.workspaces.length<=1)return n.allowEmpty&&e.workspaces[0]?.id===t?Js():e;const a=e.workspaces.findIndex(u=>u.id===t);if(a<0)return e;const c=e.workspaces.filter(u=>u.id!==t),o=e.activeWorkspaceId===t?c[Math.min(a,c.length-1)].id:e.activeWorkspaceId;return{...e,activeWorkspaceId:o,workspaces:c}}function Tr(e,t,n){return n>1?{axis:"horizontal",edge:e.x<t.left+t.width/2?"before":"after"}:{axis:"vertical",edge:e.y<t.top+t.height/2?"before":"after"}}function Ir(e,t,n,a){if(t===n)return[...e];const c=e.findIndex(k=>k.id===t),o=e.findIndex(k=>k.id===n);if(c<0||o<0)return[...e];const u=[...e],[m]=u.splice(c,1);if(!m)return[...e];const l=u.findIndex(k=>k.id===n),p=a==="after"?l+1:l;return u.splice(Math.max(0,p),0,m),u}const Rr="openscout.terminal.workspaces.v1",Er=2,Mr="openscout.terminal.workspace-view.v1",Is=2;function os(e){const t=typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);return`${e}-${Date.now().toString(36)}-${t}`}const Ar=24;function Zt(e,t,n){const a=t.replace(/[^A-Za-z0-9_-]+/gu,"-").replace(/^[^A-Za-z0-9_]+/u,"").slice(0,Ar).replace(/-+$/u,""),c=Lr(JSON.stringify([n,t,e]));return`scout-${e}-${a||"cell"}-${c}`}function Lr(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,"0")}function Ve(e,t="shell"){return{id:os("cell"),kind:"fresh",backend:e,agent:t}}function ft(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id!="string"||!t.id.trim()?!1:t.kind==="fresh"?typeof t.backend=="string"&&typeof t.agent=="string":t.kind==="registered"?typeof t.terminalSessionId=="string"&&typeof t.terminalSurfaceKey=="string":!1}function kt(e){return{id:e.id,name:e.name,...e.purpose?{purpose:e.purpose}:{},columns:e.columns,...e.layout?{layout:e.layout}:{},updatedAt:e.updatedAt,tiles:e.cells.map(t=>t.surfaceId&&t.terminalSessionId?{id:t.id,kind:"registered",terminalSessionId:t.terminalSessionId,terminalSurfaceKey:t.surfaceId}:{id:t.id,kind:"fresh",backend:Wr(t.intent.hostId)?t.intent.hostId:"pty",agent:"shell"})}}function Rs(e,t={}){return{id:e.id,name:e.name,purpose:e.purpose??"",columns:ms(us({layout:e.layout,columns:e.columns,cellCount:e.tiles.length}),{tileCount:e.tiles.length}),layout:us({layout:e.layout,columns:e.columns,cellCount:e.tiles.length}),cells:e.tiles.map(n=>n.kind==="registered"?{id:n.id,surfaceId:n.terminalSurfaceKey,terminalSessionId:n.terminalSessionId,intent:Dr(n,t.sessions??[])}:{id:n.id,intent:{hostId:n.backend,sessionName:n.backend==="pty"?null:Zt(n.backend,n.id,e.id)}})}}function Dr(e,t){const n=$t(e.terminalSurfaceKey),a=t.find(c=>c.id===e.terminalSessionId||c.surfaces.some(o=>Ot(o,e.terminalSurfaceKey)));return{...n?{hostId:n.backend,sessionName:n.hostSession}:{},...a?.cwd?{cwd:a.cwd}:{},...a?.harness?{harness:a.harness}:{},...a?.resumeCommand?{resumeCommand:a.resumeCommand}:{}}}function Wr(e){return e==="pty"||e==="tmux"||e==="zellij"||e==="herdr"}function $r(e){if(!Array.isArray(e))return mt(e,ft,{allowEmpty:!0});const t=e.flatMap(n=>{if(!n||typeof n!="object")return[];const a=n;if(typeof a.id!="string"||!a.id.trim())return[];const c=Array.isArray(a.cells)?a.cells:[];return[{id:a.id,name:typeof a.name=="string"&&a.name.trim()?a.name:a.id,purpose:a.purpose,columns:a.columns,updatedAt:a.updatedAt,tiles:c.map((o,u)=>({...o,id:`${a.id}-${u}`}))}]});return mt({activeWorkspaceId:t[0]?.id??"",workspaces:t},ft,{allowEmpty:!0})}function Or(e,t,n){const a=e.find(c=>c.id===t);return a?a.capabilities.control.includes(n)||a.capabilities.harnessControl.includes(n):!1}function Pr(e,t){return e.find(n=>n.id===t)??null}function zr(e){return[{value:"pty",label:"Shell",detail:"Disposable local shell",relayAttach:!0},...e.filter(t=>t.availability.installed&&t.capabilities.create).map(t=>({value:t.id,label:t.label,detail:t.description,relayAttach:t.capabilities.relayAttach})).sort((t,n)=>Number(n.relayAttach)-Number(t.relayAttach)||t.value.localeCompare(n.value))]}const bt={name:"name",session:"name",title:"name",project:"project",repo:"project",in:"project",cwd:"cwd",path:"cwd",dir:"cwd",harness:"harness",agent:"harness",owner:"owner",by:"owner",backend:"backend",host:"backend",mux:"backend",multiplexer:"backend",branch:"branch",model:"model",role:"role",node:"node",machine:"node",delivery:"delivery",msg:"delivery",message:"delivery",cmd:"command",command:"command",run:"command",screen:"screen",output:"screen",pane:"panes",panes:"panes",inside:"panes",is:"is",state:"is"},_r={name:100,owner:80,command:60,panes:55,screen:50,delivery:45,project:40,harness:34,branch:30,model:26,role:26,backend:24,condition:20,node:20,cwd:18},en=new Set(["screen","panes","delivery"]),Fr=["name","owner","command","panes","screen","delivery","project","harness","branch","model","role","backend","condition","cwd"];function sn(e){const t=[],n=/(-?)(?:([a-z]+):)?(?:"([^"]*)"|(\S+))/gi;for(const a of e.matchAll(n)){const[,c,o,u,m]=a,l=(u??m??"").trim().toLowerCase(),p=o?bt[o.toLowerCase()]??null:null;if(l&&!(!o&&l.endsWith(":")&&bt[l.slice(0,-1)])){if(o&&p===null){t.push({field:null,value:`${o.toLowerCase()}:${l}`,negated:c==="-"});continue}t.push({field:p,value:l,negated:c==="-"})}}return t}function Kr(e){return e.some(t=>t.field==="screen")}function Br(e){return e.some(t=>t.field==="delivery")}function Ur(e){return e.some(t=>t.field==="panes")}function xt(e,t){switch(t){case"name":return e.name;case"owner":return e.owner??"";case"project":return e.project;case"cwd":return e.cwd;case"harness":return e.harness;case"backend":return e.backend;case"branch":return e.branch??"";case"model":return e.model??"";case"role":return e.role??"";case"node":return e.node??"";case"delivery":return e.delivery??"";case"command":return e.command;case"condition":return e.condition;case"screen":return e.screen??"";case"panes":return e.panes??"";default:return""}}function Hr(e,t){if(!e||!t)return 0;const n=e.toLowerCase(),a=n.indexOf(t);if(a<0)return 0;if(n===t)return 1;const c=a===0?"":n[a-1];return a===0||!/[a-z0-9]/.test(c)?.75:.4}function qr(e,t){switch(t){case"live":case"running":case"active":return e.live;case"idle":case"inactive":case"dead":case"exited":return!e.live;case"agent":return e.kind==="agent"||!!e.owner;case"multiplexer":case"multi":return e.kind==="multiplexer";case"herdr":case"tmux":case"zellij":return e.backend.toLowerCase()===t;case"session":case"plain":return e.kind==="session";default:return e.condition.toLowerCase().includes(t)}}function tn(e,t){return e===null||e<=0?1:1+.5/(1+Math.max(0,t-e)/36e5)}function Yr(e,t,n){if(t.length===0)return{score:Vr(e,n),matchedOn:[],excerpt:null,excerptField:null};let a=0;const c=new Map;let o=null,u=null;for(const m of t){if(m.field==="is"){const g=qr(e,m.value);if(g===m.negated)return null;g&&(a+=30);continue}const l=m.field?[m.field]:Fr;let p=0,k="";for(const g of l){const S=Hr(xt(e,g),m.value);if(S<=0)continue;const C=S*(_r[g]??10);C>p&&(p=C,k=g)}if(m.negated){if(p>0)return null;continue}if(p<=0)return null;a+=p,c.set(k,Math.max(c.get(k)??0,p)),en.has(k)&&!o&&(o=Jr(xt(e,k),m.value),o&&(u=k))}return{score:a*tn(e.activityAt,n)+(e.live?12:0),matchedOn:[...c.entries()].sort((m,l)=>l[1]-m[1]).map(([m])=>m),excerpt:o,excerptField:u}}function Vr(e,t){return(e.live?1e3:0)+tn(e.activityAt,t)*10}function Jr(e,t,n=120){if(!e||!t)return null;for(const a of e.split(`
2
- `)){const c=a.toLowerCase().indexOf(t);if(c<0)continue;const o=a.trim();if(o.length<=n)return o;const u=Math.max(0,c-Math.floor(n/3));return`${u>0?"…":""}${a.slice(u,u+n).trim()}${u+n<a.length?"…":""}`}return null}function Gr(e,t,n=Date.now()){const a=sn(t),c=[];for(const o of e){const u=Yr(o.target,a,n);u&&c.push({target:o.target,item:o.item,score:u.score,matchedOn:u.matchedOn,excerpt:u.excerpt,excerptField:u.excerptField})}return c.sort((o,u)=>u.score-o.score||(u.target.activityAt??0)-(o.target.activityAt??0)||o.target.name.localeCompare(u.target.name))}function Xr(e,t){const n=e?.[t];return typeof n=="string"?n:""}function yt(e,t={}){return{id:e.id,name:e.title||e.surface.sessionName,owner:t.owner??"",branch:t.branch??"",model:t.model??"",role:t.role??"",node:t.node??"",delivery:t.delivery??"",project:e.project,cwd:e.session.cwd||e.cwdLabel,harness:e.session.harness,backend:e.surface.backend,command:Xr(e.session.metadata,"currentCommand"),condition:e.condition,kind:t.kind??(e.origin==="backend"?"multiplexer":"session"),live:nr(e)>0,activityAt:Ut(e),...t.screen===void 0?{}:{screen:t.screen},...t.panes===void 0?{}:{panes:t.panes}}}function Qr(e){return[e.name,e.handle?`@${e.handle}`:""].filter(Boolean).join(" ")}function nn(e){return{owner:Qr(e),branch:e.branch??"",model:e.model??"",role:e.role??e.agentClass??"",node:[e.homeNodeName,e.authorityNodeName].filter(t=>!!t).filter((t,n,a)=>a.indexOf(t)===n).join(" "),delivery:rn(e)}}function rn(e){return(e.brokerActivity??[]).map(t=>[t.kind,t.state??"",t.summary].filter(Boolean).join(" ")).join(`
3
- `)}function Zr(e,t={}){return{id:`agent:${e.id}`,name:e.name,...nn(e),project:e.project??e.projectRoot??"",cwd:e.cwd??e.projectRoot??"",harness:e.harness??"",backend:t.backend??e.transport??"",command:"",condition:Ht(e.state,e),kind:"agent",live:t.live??or(e.state,e),activityAt:e.updatedAt}}function ea(e){const t=[],n=[];for(const a of e)a.negated||!a.value||(a.field===null?t.push(a.value):en.has(a.field)&&n.push(a.value));return{text:t,screen:n}}function sa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ta(e,t){const n=t.filter(c=>c.length>0);if(!e||n.length===0)return[{text:e,match:!1}];const a=new RegExp(`(${n.map(sa).join("|")})`,"ig");return e.split(a).map((c,o)=>({text:c,match:o%2===1})).filter(c=>c.text.length>0)}const na=2e4,ra=100;let ls=null;async function aa(){const e=await Oe(`/api/agents?limit=${ra}`),t=new Map;for(const n of e){const a=rn(n);a&&t.set(n.id,a)}return t}function ia(e){const[t,n]=i.useState(new Map),[a,c]=i.useState(!1),o=i.useRef(0);return i.useEffect(()=>{if(!e){c(!1);return}const u=ls&&Date.now()-ls.at<na?ls.deliveries:null;if(u){n(u),c(!1);return}const m=++o.current;return c(!0),aa().then(l=>{ls={deliveries:l,at:Date.now()},o.current===m&&n(l)}).catch(()=>{}).finally(()=>{o.current===m&&c(!1)}),()=>{o.current+=1}},[e]),{deliveries:t,reading:a}}function la(e,t){const n=e?.trim()??"";return n&&t!=null&&n!==String(t)?`${n} ${t}`:n||(t!=null?String(t):"")}function oa(e,t){const n=e?.trim()??"";return n&&n!==String(t)?n:t!=null?String(t):n}function ca(e){const t=[];for(const n of e.workspaces){const a=la(n.label,n.number);for(const c of n.tabs){const o=oa(c.label,c.number);for(const u of c.panes){const m=[a,o,u.label?.trim()??"",u.agent??""].map(l=>l.trim()).filter(Boolean);!u.label?.trim()&&!u.agent&&m.push("shell"),u.agent&&u.agentStatus!=="unknown"&&m.push(u.agentStatus),t.push(m.join(" › "))}}}return t.join(`
4
- `)}const da=2e4,Ws=12,ua=3,gt=new Map;async function ma(e){try{const t=await Gn(e.surface.sessionName),n=ca(t);return n.length>0?n:null}catch{return null}}async function pa(e,t,n){let a=0;const c=async()=>{for(;a<e.length&&!n();){const o=e[a++];await t(o)}};await Promise.all(Array.from({length:Math.min(ua,e.length)},c))}function ha(e){return e.filter(t=>t.surface.backend==="herdr")}function fa(e,t){const[n,a]=i.useState(new Map),[c,o]=i.useState(!1),u=e.map(l=>l.id).join("|"),m=i.useRef(0);return i.useEffect(()=>{if(!t){o(!1);return}const l=++m.current,p=()=>m.current!==l,k=[...e].sort((E,j)=>(j.session.updatedAt??0)-(E.session.updatedAt??0)).slice(0,Ws),g=Date.now(),S=new Map,C=[];for(const E of k){const j=gt.get(E.id);j&&g-j.at<da?S.set(E.id,j.body):C.push(E)}if(a(S),C.length===0){o(!1);return}return o(!0),pa(C,async E=>{const j=await ma(E);p()||j!==null&&(gt.set(E.id,{body:j,at:Date.now()}),a(N=>new Map(N).set(E.id,j)))},p).finally(()=>{p()||o(!1)}),()=>{m.current+=1}},[t,u]),{panes:n,reading:c}}const ka=2e4,ba=200,$s=24,xa=4,jt=new Map;async function ya(e){const t=new URLSearchParams({backend:e.surface.backend,sessionName:e.surface.sessionName,lines:String(ba)});e.surface.paneId&&t.set("paneId",e.surface.paneId);try{const n=await Oe(`/api/terminal-sessions/peek?${t.toString()}`);return n.available&&n.body?n.body:null}catch{return null}}async function ga(e,t,n){let a=0;const c=async()=>{for(;a<e.length&&!n();){const o=e[a++];await t(o)}};await Promise.all(Array.from({length:Math.min(xa,e.length)},c))}function ja(e,t){const[n,a]=i.useState(new Map),[c,o]=i.useState(!1),u=e.map(l=>l.id).join("|"),m=i.useRef(0);return i.useEffect(()=>{if(!t){o(!1);return}const l=++m.current,p=()=>m.current!==l,k=[...e].sort((E,j)=>(j.session.updatedAt??0)-(E.session.updatedAt??0)).slice(0,$s),g=Date.now(),S=new Map,C=[];for(const E of k){const j=jt.get(E.id);j&&g-j.at<ka?S.set(E.id,j.body):C.push(E)}if(a(S),C.length===0){o(!1);return}return o(!0),ga(C,async E=>{const j=await ya(E);p()||j!==null&&(jt.set(E.id,{body:j,at:Date.now()}),a(N=>new Map(N).set(E.id,j)))},p).finally(()=>{p()||o(!1)}),()=>{m.current+=1}},[t,u]),{screens:n,capturing:c}}async function Sa(){return Oe("/api/terminal-workspaces")}async function St(e){return(await Oe(`/api/terminal-workspaces/${encodeURIComponent(e.id)}`,{method:"PUT",body:JSON.stringify(e)})).workspace}async function wa(e,t){return Oe(`/api/terminal-workspaces/${encodeURIComponent(e)}/cells/${encodeURIComponent(t)}/revive`,{method:"POST",body:"{}"})}async function Ca(e){return(await Oe(`/api/terminal-workspaces/${encodeURIComponent(e)}`,{method:"DELETE"})).deleted}function Na(e){const t=new Map;for(const n of e?.cells??[])t.set(n.cellId,n);return t}var wt=["terminal:ack"];function Gs(e={}){const{url:t="ws://localhost:3600",healthUrl:n,token:a,systemPrompt:c,cwd:o,workspaceFiles:u,autoConnect:m=!1,sessionKey:l,orphanTTL:p,backend:k,controlMode:g="owner",tmuxSession:S,zellijSession:C,zellijSocketDir:E,agent:j,provider:N,model:b,flowControl:z}=e,D=l?`hudson.relay.${l}`:null,v=()=>{if(!D)return null;try{const y=localStorage.getItem(D);if(!y)return null;if(y.startsWith("{")){const L=JSON.parse(y);return typeof L.id!="string"?null:{id:L.id,reconnectToken:typeof L.reconnectToken=="string"?L.reconnectToken:null}}return{id:y,reconnectToken:null}}catch{return null}},T=i.useCallback((y,L=null)=>{if(D)try{y?localStorage.setItem(D,JSON.stringify({id:y,reconnectToken:L})):localStorage.removeItem(D)}catch{}},[D]),[A,W]=i.useState("disconnected"),[x,I]=i.useState(null),[M,X]=i.useState(null),[oe,ce]=i.useState(null),[me,pe]=i.useState(o||"~"),q=i.useRef(null),te=i.useRef(null),B=i.useRef({cols:80,rows:24}),Z=i.useRef(!1),Q=i.useRef([]),ie=i.useRef(0),le=i.useRef(0),de=i.useRef(0),ye=i.useRef(me);ye.current=me;const ge=i.useRef(!1),je=i.useRef(null);ge.current||(ge.current=!0,je.current=v());const ne=i.useRef(je.current?.id??null),U=i.useRef(je.current?.reconnectToken??null),w=i.useRef(null),F=i.useRef(null),P=i.useRef(null),Y=i.useRef(new Set),V=z?.maxBufferedBytes??512*1024,H=i.useCallback(y=>{const L=q.current;L&&L.readyState===WebSocket.OPEN&&L.send(JSON.stringify(y))},[]),Pe=i.useCallback((y,L)=>{typeof y=="number"&&L===de.current&&H({type:"terminal:ack",seq:y})},[H]),Te=i.useCallback(()=>{de.current+=1,Q.current=[],ie.current=0},[]),Ie=i.useCallback((y,L=null)=>{const ee=de.current;if(!y){Pe(L,ee);return}let _=!1;const re=()=>{_||(_=!0,Pe(L,ee))};if(w.current)try{w.current(y,re)}catch{re()}else for(Q.current.push({data:y,seq:L,ack:re}),ie.current+=y.length;ie.current>V&&Q.current.length>0;){const G=Q.current.shift();if(!G)break;ie.current-=G.data.length,G.ack()}if(Y.current.size>0)for(const G of Y.current)try{G(y)}catch{}},[Pe,V]),Re=i.useCallback((y,L)=>{typeof y!="number"||typeof L!="number"||y<=0||L<=0||(P.current={cols:y,rows:L},F.current?.(y,L))},[]),he=i.useCallback(()=>{const y=q.current;y&&(y.close(),q.current=null)},[]),Se=i.useCallback(()=>{le.current+=1,te.current&&(clearTimeout(te.current),te.current=null),he(),Z.current=!1,W("disconnected")},[he]),we=i.useCallback(()=>{const y=ye.current;return{type:"session:init",cols:B.current.cols,rows:B.current.rows,clientCapabilities:[...wt],...c?{systemPrompt:c}:{},...y?{cwd:y}:{},...u?{workspaceFiles:u}:{},...p?{orphanTTL:p}:{},...k?{backend:k}:{},...g!=="owner"?{controlMode:g}:{},...S?{tmuxSession:S}:{},...C?{zellijSession:C}:{},...E?{zellijSocketDir:E}:{},...j?{agent:j}:{},...N?{provider:N}:{},...b?{model:b}:{}}},[j,k,g,b,p,N,c,S,u,C,E]),Ee=i.useCallback(()=>{Z.current||(Z.current=!0,ne.current?H({type:"session:reconnect",sessionId:ne.current,...U.current?{reconnectToken:U.current}:{},cols:B.current.cols,rows:B.current.rows,clientCapabilities:[...wt],...g!=="owner"?{controlMode:g}:{}}):H(we()))},[H,we,g]),Ne=i.useCallback(async()=>{const y=le.current+1;le.current=y,he(),de.current+=1,Z.current=!1,W("connecting"),X(null),ce(null);const L=n||`${t.replace(/^ws(s?):\/\//,"http$1://")}/health`;try{const G=await fetch(L,{signal:AbortSignal.timeout(2e3)});if(!G.ok)throw new Error(`Relay health check failed: ${G.status}`)}catch{if(le.current!==y)return;W("error"),X("Relay service is not running");return}if(le.current!==y)return;he();const ee=a?`${t}${t.includes("?")?"&":"?"}token=${encodeURIComponent(a)}`:t,_=new WebSocket(ee);q.current=_;const re=()=>le.current===y&&q.current===_;_.onopen=()=>{if(!re()){_.close();return}Ee()},_.onmessage=G=>{if(re())try{const K=JSON.parse(G.data);switch(K.type){case"session:ready":Re(K.cols,K.rows),ne.current=K.sessionId,U.current=typeof K.reconnectToken=="string"?K.reconnectToken:null,T(K.sessionId,U.current),I(K.sessionId),W("connected"),X(null),ce(null);break;case"terminal:dimensions":Re(K.cols,K.rows);break;case"session:expired":{ne.current=null,U.current=null,T(null),Z.current=!1,Te(),Ie("\x1B[2J\x1B[H",null),H(we()),Z.current=!0;break}case"session:error":W("error"),X(K.error||"Session failed to start");break;case"terminal:data":Ie(K.data||"",typeof K.seq=="number"?K.seq:null);break;case"session:exit":ne.current=null,U.current=null,T(null),Te(),I(null),ce(K.exitCode??null),K.exitCode!==0?(W("error"),X(K.reason||`Process exited with code ${K.exitCode}`)):W("disconnected");break;case"session:detached":ne.current=null,U.current=null,T(null),I(null);break}}catch{}},_.onclose=()=>{re()&&(q.current=null,Z.current=!1,W(G=>G==="error"?G:"disconnected"))},_.onerror=()=>{re()&&(W("error"),X("Could not connect to relay"))}},[t,n,a,Ee,he,H,Ie,we,T,Te]),fe=i.useCallback(y=>{g!=="observe"&&H({type:"terminal:input",data:y})},[g,H]),es=i.useCallback(y=>{g!=="observe"&&H({type:"terminal:input",data:y+"\r"})},[g,H]),J=i.useCallback((y,L)=>{B.current={cols:y,rows:L},Z.current&&H({type:"terminal:resize",cols:y,rows:L})},[H]),ke=i.useCallback(y=>{if(w.current=y,!y||Q.current.length===0)return;const L=Q.current;Q.current=[],ie.current=0;for(const ee of L)try{y(ee.data,ee.ack)}catch{ee.ack()}},[]),Ce=i.useCallback(y=>{F.current=y;const L=P.current;y&&L&&y(L.cols,L.rows)},[]),ze=i.useCallback(y=>(Y.current.add(y),()=>{Y.current.delete(y)}),[]);i.useEffect(()=>(m&&Ne(),()=>{Se()}),[]);const _e=i.useCallback(()=>{Se(),ne.current=null,U.current=null,I(null),T(null),Te(),X(null),ce(null),te.current=setTimeout(()=>{te.current=null,Ne()},200)},[Se,Ne,T,Te]);return{status:A,sessionId:x,error:M,exitCode:oe,cwd:me,controlMode:g,setCwd:pe,onData:ke,onDimensions:Ce,subscribeData:ze,sendInput:fe,sendLine:es,resize:J,connect:Ne,disconnect:Se,restart:_e}}const Ct="scout:terminal-send-line";function va(e){const t=e.detail;if(!t||typeof t!="object"||!("line"in t))return null;const n=t.line;return typeof n=="string"&&n.trim().length>0?n:null}function Ta(e){const t=e?.modes?.mouseTrackingMode;return typeof t=="string"&&t!=="none"}function an(){const e=i.useRef(null),t=i.useCallback(l=>{e.current=l??null},[]),n=i.useCallback(()=>{try{return e.current?.getSelection?.()??""}catch{return""}},[]),a=i.useCallback(()=>{const l=n();l&&cs(l)},[n]),c=i.useCallback((l,p)=>{const k=e.current;if(typeof k?.paste=="function"){k.paste(l);return}p(l)},[]),o=i.useCallback(l=>{navigator.clipboard?.readText&&navigator.clipboard.readText().then(p=>{p&&c(p,l)}).catch(()=>{})},[c]),u=i.useCallback(l=>!l.shiftKey&&Ta(e.current),[]),m=i.useCallback(l=>{if(l.key.toLowerCase()!=="c"||!(l.metaKey&&!l.ctrlKey&&!l.altKey||l.ctrlKey&&l.shiftKey&&!l.metaKey&&!l.altKey))return;const k=n();k&&(l.preventDefault(),l.stopPropagation(),cs(k))},[n]);return{copySelection:a,handleCopyShortcut:m,handleTerminalReady:t,pasteClipboardText:o,pasteText:c,readSelection:n,rightClickBelongsToApp:u}}function ln(e){const{focusTerminal:t,readOnly:n=!1,sendInput:a}=e,c=an(),o=_s(),{copySelection:u,pasteClipboardText:m,readSelection:l,rightClickBelongsToApp:p}=c,k=i.useCallback(g=>{if(g.preventDefault(),p(g))return;const S=l(),C=[];S.trim()&&C.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:u}),n||C.push({kind:"action",label:"Paste",shortcut:"⌘V",onSelect:()=>m(a)}),C.length>0&&C.push({kind:"separator"}),C.push({kind:"action",label:"Focus Terminal",onSelect:t}),o(g,C)},[u,t,m,n,l,p,a,o]);return i.useMemo(()=>({handleContextMenu:k,handleCopyShortcut:c.handleCopyShortcut,handleTerminalReady:c.handleTerminalReady}),[k,c.handleCopyShortcut,c.handleTerminalReady])}const We=["multiplexer","agent","session"];function Ia(e,t){if(t==="Home")return We[0];if(t==="End")return We[We.length-1];const n=t==="ArrowRight"||t==="ArrowDown"?1:t==="ArrowLeft"||t==="ArrowUp"?-1:0;if(n===0)return null;const c=(We.indexOf(e)+n+We.length)%We.length;return We[c]??null}function Es(e){return`terminal-picker-tab-${e}`}function Nt(){return"terminal-picker-panel"}const Je=typeof window>"u"?i.useEffect:i.useLayoutEffect,Ra=[["all","All"],["running","Running"],["exited","Exited"]],Ea="openscout.terminal.picker-view.v1",Ma="openscout.terminal.picker-source.v1",vt={mode:"grid",columns:"dynamic"},Tt=[{mode:"solo",label:"Solo",detail:"One terminal, full width",minimumCells:1},{mode:"lanes",label:"Lanes",detail:"Side by side, one row",minimumCells:2},{mode:"grid",label:"Grid",detail:"Rows and columns",minimumCells:4}],on=[{value:"shell",label:"Shell"},{value:"codex",label:"Codex"},{value:"claude",label:"Claude"},{value:"pi",label:"Pi"}],Ms="'JetBrainsMono Nerd Font', 'JetBrainsMonoNL Nerd Font', 'MesloLGS Nerd Font Mono', 'Hack Nerd Font Mono', 'JetBrains Mono', monospace",It=e=>{},Aa=()=>{};function La(){if(typeof window>"u")return{fontFamily:Ms,fontSize:13};const e=new URLSearchParams(window.location.search),t=e.get("terminalFontFamily")?.trim(),n=Number(e.get("terminalFontSize"));return{fontFamily:t?`'${t.replaceAll("'","\\'")}', ${Ms}`:Ms,fontSize:Number.isFinite(n)&&n>=9&&n<=32?n:13}}function Xs(e){const t=La();return s.jsx(dr,{...e,renderer:e.renderer??"auto",fontFamily:t.fontFamily,fontSize:t.fontSize})}function Da(e,t){const[n,a]=i.useState({state:"loading",sessions:[]}),c=i.useCallback(()=>{a(u=>({state:"loading",sessions:u.sessions})),Pt({includeDiscovered:!0}).then(u=>{a({state:"ready",sessions:u})}).catch(u=>{a(m=>({state:"failed",sessions:m.sessions,error:u instanceof Error?u.message:String(u)}))})},[]);return i.useEffect(()=>{c()},[c]),{target:i.useMemo(()=>Ft(n.sessions,e,t),[n.sessions,e,t]),loadState:n.state,loadSessions:c,hasSessionHint:!!e}}function Wa(e,t,n){const a=Kn(t,n),[c,o]=i.useState(a?{state:"preparing"}:{state:"ready"}),[u,m]=i.useState(0);return i.useEffect(()=>{if(!a||!e){o({state:"ready"});return}let l=!1;return o({state:"preparing"}),Oe(`/api/agents/${encodeURIComponent(e)}/session-catalog`).then(p=>{if(p.resumeCommand)return ur({command:p.resumeCommand,cwd:p.resumeCwd,agentId:e})}).then(()=>{l||o({state:"ready"})}).catch(p=>{l||o({state:"failed",error:p instanceof Error?p.message:String(p)})}),()=>{l=!0}},[e,a,u]),{ready:c.state==="ready",label:c.state==="failed"?"TAKEOVER FAILED":"PREPARING TAKEOVER",status:c.state==="failed"?c.error:"Resolving live session...",onRetry:c.state==="failed"?()=>m(l=>l+1):void 0}}function $a(e){const{agentId:t,agent:n,mode:a,navigate:c,registeredTarget:o,showContextMenu:u}=e,{hosts:m}=Us(),l=n?Dt(n.name):"var(--accent)",p=i.useRef(null),{handleCopyShortcut:k,handleTerminalReady:g,pasteClipboardText:S,readSelection:C,rightClickBelongsToApp:E}=an(),j=o?Bs(o.surface):ve(n),N=a==="observe",b=o?.session.cwd??n?.cwd??n?.projectRoot??void 0,z=Ps(),D=zs(),v=Bn({agentId:t,agent:n,registeredTarget:o,terminalSurface:j,relayUrl:z,harness:o?.session.harness??n?.harness,cwd:b,mode:a}),T=Gs({url:v.scopedRelayUrl,healthUrl:D,autoConnect:!0,...N?{}:{sessionKey:v.relayStorageSessionKey},...v.surfaceOptions??{},...v.orphanTTL?{orphanTTL:v.orphanTTL}:{},...v.cwd?{cwd:v.cwd}:{},...v.relayAgent?{agent:v.relayAgent}:{},controlMode:v.controlMode});Je(()=>{T.resize(Fs,Ks)},[T.resize]);const A=i.useMemo(()=>N?{...T,sendInput:It,sendLine:It,restart:Aa}:T,[N,T]),W=Un({agentId:t,registeredTarget:o}),x=ds(W,a),I=i.useCallback(()=>{const w=p.current;w?.querySelector(".xterm-helper-textarea")?.focus(),w?.querySelector(".xterm")?.focus()},[]);i.useEffect(()=>{const w=Y=>{const V=Y.detail?.line;return typeof V=="string"&&V.length>0?V:null},F=Y=>{const V=w(Y);!V||N||(A.sendInput(V),I())},P=Y=>{const V=w(Y);!V||N||(A.sendLine(V),I())};return window.addEventListener("scout:terminal-send-input",F),window.addEventListener("scout:terminal-send-line",P),()=>{window.removeEventListener("scout:terminal-send-input",F),window.removeEventListener("scout:terminal-send-line",P)}},[I,N,A]);const M=i.useCallback(w=>j?Hn(j,w):null,[j]),X=i.useCallback(()=>{cs(Wt(x))},[x]),oe=i.useCallback(()=>{N||S(A.sendInput)},[S,N,A]),ce=i.useCallback(()=>{as(v.relayStorageSessionKey);const w=M("detach");if(w){w.finally(()=>T.disconnect());return}T.disconnect()},[v.relayStorageSessionKey,T,M]),me=i.useCallback(()=>{as(v.relayStorageSessionKey);const w=M("force-quit-bridge");if(w){w.finally(()=>{T.connect(),window.setTimeout(I,250)});return}T.connect(),window.setTimeout(I,250)},[v.relayStorageSessionKey,I,T,M]),pe=i.useCallback(()=>{if(N)return;const w=M("interrupt");w?w.catch(()=>A.sendInput("")):A.sendInput(""),I()},[I,N,M,A]),q=i.useCallback(()=>{if(N)return;const w=M("quit");w?w.catch(()=>A.sendInput("")):A.sendInput(""),I()},[I,N,M,A]),te=i.useCallback(()=>{if(N)return;const w=M("stop-job");if(w){w.finally(I);return}I()},[I,N,M]),B=i.useCallback(()=>{if(as(v.relayStorageSessionKey),j&&!window.confirm(`Force quit Claude in ${Ls(j.sessionName)}?`))return;const w=M("force-quit");if(w){w.finally(()=>T.disconnect());return}const F=T.sessionId;if(!F){T.disconnect();return}qn(F).catch(()=>{}).finally(()=>T.disconnect())},[v.relayStorageSessionKey,T,M,j]),Z=i.useCallback(()=>{if(!j||!window.confirm(`Restart Claude in ${Ls(j.sessionName)} and resume its latest session?`))return;as(v.relayStorageSessionKey);const w=M("restart-resume");w&&w.finally(()=>{T.disconnect(),window.setTimeout(()=>{T.connect(),window.setTimeout(I,250)},600)})},[v.relayStorageSessionKey,I,T,M,j]),Q=i.useCallback(w=>{c(ds(W,w))},[c,W]),ie=i.useCallback(()=>{c(W)},[c,W]),le=!!(o||j),de=!N&&!!(j||T.status==="connected"),ye=!N&&!!j,ge=i.useMemo(()=>{const w=j?.backend??null,F=V=>Or(m,w,V),P=[];(!w||F("detach"))&&P.push({kind:"action",label:"Leave this session running",onSelect:ce}),P.push({kind:"action",label:"Reconnect",onSelect:me});const Y=[];return F("restart-resume")&&Y.push({kind:"action",label:"Restart Claude and resume",onSelect:Z}),F("force-quit")&&Y.push({kind:"action",label:"Force quit Claude",onSelect:B}),Y.length>0&&P.push({kind:"separator"},...Y),P},[ce,B,me,Z,m,j?.backend]),je=i.useMemo(()=>{const w=[...ge],F=[];de&&F.push({kind:"action",label:"Send Ctrl-C",shortcut:"⌃C",onSelect:pe},{kind:"action",label:"Quit With Ctrl-D",shortcut:"⌃D",onSelect:q}),ye&&F.push({kind:"action",label:"Stop Running Job",onSelect:te}),F.length>0&&w.push({kind:"separator"},...F);const P=[];return j&&P.push({kind:"action",label:N?"Open Takeover":"Open Observe",onSelect:()=>Q(N?"takeover":"observe")}),o&&P.push({kind:"action",label:"Open Summary",onSelect:ie}),P.length>0&&w.push({kind:"separator"},...P),w},[de,ye,pe,Q,ie,q,N,o,ge,te,j]),ne=i.useCallback(w=>{u(w,je)},[je,u]),U=i.useCallback(w=>{if(w.preventDefault(),E(w))return;const F=C(),P=[];F.trim()&&P.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{cs(F)}}),N||P.push({kind:"action",label:"Paste",shortcut:"⌘V",onSelect:oe},{kind:"action",label:"Send Ctrl-C",shortcut:"⌃C",onSelect:pe},{kind:"action",label:"Quit With Ctrl-D",shortcut:"⌃D",onSelect:q},{kind:"action",label:"Stop Running Job",onSelect:te}),P.length>0&&P.push({kind:"separator"}),P.push({kind:"action",label:"Focus Terminal",onSelect:I},...ge,{kind:"separator"},{kind:"action",label:N?"Open Takeover":"Open Observe",onSelect:()=>Q(N?"takeover":"observe")},{kind:"action",label:"Open Summary",onSelect:ie},{kind:"action",label:"Copy Terminal Link",onSelect:X}),u(w,P)},[X,I,pe,Q,ie,oe,q,N,C,ge,E,u,te]);return{color:l,terminalBodyRef:p,terminalSurface:j,readOnly:N,relay:T,terminalRelay:A,healthUrl:D,scopedRelayUrl:v.scopedRelayUrl,hasViewActions:le,canSignalTerminal:de,canStopTerminalJob:ye,handleCopyShortcut:k,handleSessionMenu:ne,handleTerminalContextMenu:U,handleTerminalReady:g,openMode:Q,openSummary:ie,interruptTerminal:pe,quitTerminal:q,stopTerminalJob:te,terminalRouteBase:W}}function Oa({agent:e,agentId:t,color:n,navigate:a,label:c,status:o,onRetry:u}){return s.jsxs("div",{className:"s-term",children:[s.jsxs("div",{className:"s-term-bar",children:[s.jsx(Qe,{slot:"terminal",fallback:{view:"terminal"},navigate:a,className:"s-term-back"}),e&&s.jsxs("div",{className:"s-term-agent",children:[s.jsx("div",{className:"s-ops-avatar",style:{"--size":"18px",background:n},children:e.name[0]?.toUpperCase()}),s.jsx("span",{className:"s-term-agent-name",children:e.name}),e.handle&&s.jsxs("span",{className:"s-term-agent-handle",children:["@",e.handle]})]}),s.jsx("span",{className:"s-term-label",children:c}),s.jsx("div",{className:"s-term-status",children:u?"OFFLINE":"CONNECTING"})]}),s.jsx("div",{className:"s-term-body s-term-body--placeholder",children:s.jsxs("div",{className:"s-term-placeholder",children:[s.jsx("span",{children:o}),u&&s.jsx("button",{type:"button",onClick:u,children:"Retry"})]})})]})}function Pa({target:e,navigate:t}){const n=i.useMemo(()=>zt([e.session]).find(u=>se(u.surface)===se(e.surface)),[e]),a={view:"terminal",terminalSessionId:e.session.id,terminalSurfaceKey:se(e.surface)},c=Yn(e.session,e.surface),o=Vn(e);return s.jsx("div",{className:"s-term s-term--summary",children:s.jsxs("div",{className:"s-term-summary",children:[s.jsxs("div",{className:"s-term-summary-main",children:[s.jsx(Qe,{slot:"terminal",fallback:{view:"terminal"},navigate:t,className:"s-term-back"}),s.jsxs("div",{className:"s-term-summary-mark",children:[s.jsx(ue,{size:18,strokeWidth:1.7}),s.jsx("span",{children:"Terminal"})]}),s.jsxs("div",{className:"s-term-summary-heading",children:[s.jsx("h1",{children:n?.title??e.surface.sessionName}),s.jsxs("p",{children:[e.surface.backend," · ",c]})]}),s.jsxs("div",{className:"s-term-summary-actions",children:[s.jsxs("button",{type:"button",className:"s-term-summary-action s-term-summary-action--primary",onClick:()=>t(ds(a,"takeover")),children:[s.jsx(qs,{size:14,strokeWidth:1.8}),s.jsx("span",{children:"Enter"})]}),s.jsxs("button",{type:"button",className:"s-term-summary-action",onClick:()=>t(ds(a,"observe")),children:[s.jsx(fr,{size:14,strokeWidth:1.8}),s.jsx("span",{children:"Observe"})]})]})]}),s.jsx("div",{className:"s-term-summary-preview",children:s.jsx(qt,{surface:Bs(e.surface),lines:26,columns:112,pollMs:3e4,idlePollMs:3e4,className:"s-term-preview-peek"})}),s.jsx("dl",{className:"s-term-summary-details",children:o.map(([u,m])=>s.jsxs("div",{className:"s-term-summary-detail",children:[s.jsx("dt",{children:u}),s.jsx("dd",{title:m,children:m})]},u))})]})})}function Qs({agentId:e,agent:t,mode:n,navigate:a,registeredTarget:c,embedded:o=!1,tileActions:u}){const m=_s(),l=$a({agentId:e,agent:t,mode:n,navigate:a,registeredTarget:c,showContextMenu:m}),p=l.relay.status==="connected"?"LIVE":l.relay.status==="connecting"?"CONNECTING":"OFFLINE",k=l.relay.status==="connected"?"live":l.relay.status==="connecting"?"connecting":"offline";return s.jsxs("div",{className:`s-term${o?" s-term--embedded":""}`,children:[!o&&s.jsxs("div",{className:"s-term-bar s-term-bar--takeover",children:[s.jsxs("div",{className:"s-term-bar-left",children:[s.jsx(Qe,{slot:"terminal",fallback:{view:"terminal"},navigate:a,className:"s-term-back"}),t&&s.jsxs("div",{className:"s-term-agent",children:[s.jsx("div",{className:"s-ops-avatar",style:{"--size":"18px",background:l.color},children:t.name[0]?.toUpperCase()}),s.jsx("span",{className:"s-term-agent-name",children:t.name}),t.handle&&s.jsxs("span",{className:"s-term-agent-handle",children:["@",t.handle]})]}),c&&s.jsxs("div",{className:"s-term-registered-chip",children:[s.jsx(ue,{size:14,strokeWidth:1.8}),s.jsx("span",{children:c.session.harness}),s.jsx("span",{children:c.session.sourceSessionId})]})]}),s.jsxs("div",{className:"s-term-bar-meta",children:[s.jsx("span",{className:"s-term-label",children:l.terminalSurface?l.readOnly?"TERMINAL OBSERVE":"TERMINAL TAKEOVER":"TAKEOVER"}),l.terminalSurface&&s.jsx("span",{className:"s-term-session",title:l.terminalSurface.sessionName,children:Ls(l.terminalSurface.sessionName)})]}),s.jsxs("div",{className:"s-term-bar-actions",children:[l.hasViewActions&&s.jsxs("div",{className:"s-term-action-cluster s-term-action-cluster--view","aria-label":"Terminal view actions",children:[c&&s.jsx("button",{type:"button",className:"s-term-action",onClick:l.openSummary,title:"Leave the terminal canvas and show the session summary",children:"Summary"}),l.terminalSurface&&s.jsx("button",{type:"button",className:"s-term-action",onClick:()=>l.openMode(l.readOnly?"takeover":"observe"),title:l.readOnly?"Switch to interactive takeover":"Switch to read-only terminal observe",children:l.readOnly?"Takeover":"Observe"})]}),(l.canSignalTerminal||l.canStopTerminalJob)&&s.jsxs("div",{className:"s-term-action-cluster s-term-action-cluster--signals","aria-label":"Terminal signal actions",children:[l.canSignalTerminal&&s.jsxs("button",{type:"button",className:"s-term-action s-term-action--warn",onClick:l.interruptTerminal,title:"Send Ctrl-C to the terminal",children:[s.jsx(Vt,{size:13,strokeWidth:1.8}),s.jsx("span",{children:"Ctrl-C"})]}),l.canSignalTerminal&&s.jsxs("button",{type:"button",className:"s-term-action s-term-action--warn",onClick:l.quitTerminal,title:"Send Ctrl-D / EOF to the terminal",children:[s.jsx(ir,{size:13,strokeWidth:1.8}),s.jsx("span",{children:"Quit"})]}),l.canStopTerminalJob&&s.jsxs("button",{type:"button",className:"s-term-action s-term-action--warn",onClick:l.stopTerminalJob,title:"Stop Claude's current shell/tool job without quitting Claude",children:[s.jsx(pr,{size:12,strokeWidth:2}),s.jsx("span",{children:"Stop Job"})]})]}),s.jsxs("button",{type:"button",className:"s-term-action s-term-session-menu",onClick:l.handleSessionMenu,title:"Open session, recovery, and external handoff actions",children:[s.jsx(Ds,{size:14,strokeWidth:1.8}),s.jsx("span",{children:"Session"})]}),s.jsx("div",{className:"s-term-status",children:p}),u]})]}),s.jsxs("div",{ref:l.terminalBodyRef,className:"s-term-body",onContextMenuCapture:l.handleTerminalContextMenu,onKeyDownCapture:l.handleCopyShortcut,children:[o&&s.jsxs("div",{className:"s-term-float","aria-label":"Terminal tile actions",children:[s.jsx("span",{className:"s-term-float-grip",title:"Drag to move","aria-hidden":"true",onPointerDown:g=>g.preventDefault(),children:s.jsx(jr,{size:14,strokeWidth:1.8})}),c&&s.jsxs("span",{className:"s-term-float-identity",title:`${c.session.harness} ${c.session.sourceSessionId}`,children:[s.jsx("span",{children:c.session.harness}),s.jsx("span",{children:c.session.sourceSessionId})]}),s.jsx("span",{className:`s-term-float-mark s-term-float-mark--${k}`,role:"status",title:p,"aria-label":`Relay ${p.toLowerCase()}`}),s.jsx("button",{type:"button",className:"s-term-icon-button",onClick:l.handleSessionMenu,title:"Session actions","aria-label":"Session actions",children:s.jsx(Ds,{size:14,strokeWidth:1.8})}),u]}),s.jsx(Xs,{relay:l.terminalRelay,readOnly:l.readOnly,onReady:l.handleTerminalReady,quiet:!0,configItems:[...l.terminalSurface?[{label:"backend",value:l.terminalSurface.backend},{label:"session",value:l.terminalSurface.sessionName},...l.terminalSurface.paneId?[{label:"pane",value:l.terminalSurface.paneId}]:[],...l.terminalSurface.socketDir?[{label:"socket",value:l.terminalSurface.socketDir}]:[],{label:"mode",value:l.readOnly?"read-only":"takeover"}]:[],{label:"ws",value:l.scopedRelayUrl},{label:"health",value:l.healthUrl}]})]})]})}function za({terminalSessionId:e,terminalSurfaceKey:t,mode:n,navigate:a}){const{target:c,loadState:o,loadSessions:u,hasSessionHint:m}=Da(e,t);return c&&n?s.jsx(Qs,{agent:null,mode:n,navigate:a,registeredTarget:c},`${se(c.surface)}:${n}`):c?s.jsx(Pa,{target:c,navigate:a}):s.jsx("div",{className:"s-term s-term--empty-main",children:s.jsxs("div",{className:"s-term-empty-main-mark",children:[s.jsx(ue,{size:18,strokeWidth:1.6}),s.jsx("span",{children:o==="loading"?"Loading terminal":o==="failed"?"Terminal list unavailable":m?"Terminal unavailable":"Select a terminal"}),o==="failed"&&s.jsx("button",{type:"button",className:"s-term-empty-action",onClick:u,children:"Retry"})]})})}function _a(e,t){return e.kind!=="fresh"||!e.sessionName?!1:t.some(n=>n.surfaces.some(a=>a.backend===e.backend&&a.sessionName===e.sessionName&&a.state!=="exited"))}function $e(e){return`${e.session.id}:${se(e.surface)}`}function Fa(e,t,n){if(e.kind==="fresh")return{id:e.id,kind:"fresh",backend:e.backend,agent:e.agent,...e.backend==="pty"?{}:{sessionName:Zt(e.backend,e.id,n)}};const a=Ft(t,e.terminalSessionId,e.terminalSurfaceKey);return a?{id:e.id,kind:"registered",target:a}:{id:e.id,kind:"unavailable",terminalSessionId:e.terminalSessionId,terminalSurfaceKey:e.terminalSurfaceKey}}function xe(e){return{session:e.session,surface:e.surface}}function Ka(e){const t=e.backend;return t!=="pty"&&!Kt(t)?null:{view:"terminal",terminalBackend:t,terminalAgent:e.agent,terminalTabId:e.id,...e.sessionName?{terminalSessionName:e.sessionName}:{},...e.zellijSocketDir?{zellijSocketDir:e.zellijSocketDir}:{}}}function Ba(e,t="takeover"){return{view:"terminal",terminalSessionId:e.session.id,terminalSurfaceKey:se(e.surface),mode:t}}function cn(e,t){if(typeof window>"u"){t(e);return}window.open(Wt(e),"_blank","noopener,noreferrer")}function Ua({navigate:e}){const{agents:t}=Lt(),n=_s(),{hosts:a}=Us(),c=i.useMemo(()=>zr(a),[a]),[o,u]=is(Rr,Js(),{version:Er,migrate:$r}),[m,l]=is(Mr,"library"),p=i.useRef(new Map),[k,g]=i.useState(null),[S,C]=i.useState(""),[E,j]=i.useState(""),[N,b]=i.useState(vt),[z,D]=i.useState(()=>Array.from({length:4},()=>Ve("pty"))),[v,T]=i.useState(0),[A,W]=i.useState({state:"loading",sessions:[]}),[x,I]=i.useState(0),[M,X]=i.useState(""),[oe,ce]=i.useState("all"),me=i.useRef(null),pe=i.useCallback(()=>{X(""),ce("all")},[]);cr(i.useCallback(()=>me.current,[]));const[q,te]=is(Ea,"list"),[B,Z]=is(Ma,"multiplexer"),[Q,ie]=i.useState(rr),[le,de]=i.useState(null),[ye,ge]=i.useState([]),[je,ne]=i.useState(null),[U,w]=i.useState(null),[F,P]=i.useState(null),[Y,V]=i.useState(!1),[H,Pe]=i.useState(null),[Te,Ie]=i.useState(null),Re=i.useRef(null),he=i.useRef(null),Se=i.useRef("after"),we=i.useRef(null),Ee=i.useRef(null),Ne=i.useRef(!1),fe=i.useCallback((r={})=>{r.silent||W(d=>({state:"loading",sessions:d.sessions})),Pt({includeDiscovered:!0}).then(d=>W({state:"ready",sessions:d})).catch(d=>{r.silent||W(h=>({state:"failed",sessions:h.sessions,error:d instanceof Error?d.message:String(d)}))})},[]);i.useEffect(()=>{fe()},[fe]),i.useEffect(()=>{const r=()=>{document.visibilityState==="visible"&&fe({silent:!0})},d=window.setInterval(r,8e3);return window.addEventListener("focus",r),document.addEventListener("visibilitychange",r),()=>{window.clearInterval(d),window.removeEventListener("focus",r),document.removeEventListener("visibilitychange",r)}},[fe]),i.useEffect(()=>{let r=!1;return Sa().then(d=>{if(!r){ge(d.resolutions);for(const h of d.workspaces)p.current.set(h.id,JSON.stringify(Rs(kt(h),{sessions:A.sessions})));d.workspaces.length!==0&&u(h=>{let f=h;for(const R of d.workspaces)f=pt(f,kt(R));return{...f,activeWorkspaceId:h.activeWorkspaceId||f.activeWorkspaceId}})}}).catch(()=>{}),()=>{r=!0}},[u]);const es=i.useMemo(()=>zt(A.sessions),[A.sessions]),J=i.useMemo(()=>es.filter(r=>r.surface.state!=="exited"),[es]),{managed:ke}=i.useMemo(()=>_t(J),[J]),Ce=i.useMemo(()=>J.filter(r=>r.origin==="scout"),[J]),ze=i.useMemo(()=>Et(t).filter(r=>!!ve(r)&&J.some(d=>Ge(d,[r])?.id===r.id)),[t,J]),_e=ke.find(r=>r.id===le)??ke[0]??null;i.useEffect(()=>{_e?.id!==le&&de(_e?.id??null)},[_e?.id,le]);const y=i.useMemo(()=>{if(B==="multiplexer")return ke;if(B==="session")return Ce;const r=new Set;return ze.flatMap(d=>{const h=J.find(f=>Ge(f,[d])?.id===d.id);return!h||r.has(h.id)?[]:(r.add(h.id),[h])})},[Ce,J,ke,B,ze]),L=i.useMemo(()=>Et(t),[t]),ee=i.useMemo(()=>{const r=new Map,d=(h,f)=>{r.has(h.id)||r.set(h.id,{id:h.id,item:h,agent:null,kind:f})};for(const h of ke)d(h,"multiplexer");for(const h of Ce)d(h,"session");for(const h of L){const f=J.find($=>Ge($,[h])?.id===h.id)??null;if(!f){r.set(`agent:${h.id}`,{id:`agent:${h.id}`,item:null,agent:h,kind:"agent"});continue}const R=r.get(f.id);R?R.agent??=h:r.set(f.id,{id:f.id,item:f,agent:h,kind:"agent"})}return[...r.values()]},[Ce,J,ke,L]),_=M.trim().length>0,re=i.useMemo(()=>sn(M.trim().toLowerCase()),[M]),G=_&&Kr(re),K=i.useMemo(()=>ee.flatMap(r=>r.item&&yt(r.item).live?[r.item]:[]),[ee]),{screens:He,capturing:hn}=ja(K,G),hs=_&&Ur(re),fs=i.useMemo(()=>ha(ee.flatMap(r=>r.item?[r.item]:[])),[ee]),{panes:qe,reading:fn}=fa(fs,hs),ks=_&&Br(re),{deliveries:bs,reading:kn}=ia(ks),xs=hn?`Reading screens · ${He.size} of ${Math.min(K.length,$s)}`:fn?`Reading panes · ${qe.size} of ${Math.min(fs.length,Ws)}`:kn?"Reading what the broker delivered":null,ys=xs!==null,gs=i.useMemo(()=>ee.map(r=>{const d=r.item?yt(r.item,{kind:r.kind,screen:He.get(r.item.id),panes:qe.get(r.item.id),...r.agent?nn(r.agent):{}}):Zr(r.agent,Qa(r.agent)),h=r.agent?bs.get(r.agent.id):void 0;return{target:h===void 0?d:{...d,delivery:h},item:r}}),[bs,qe,He,ee]),be=i.useMemo(()=>_?Gr(gs,M):[],[M,gs,_]),bn=i.useMemo(()=>{const r=be.filter(d=>d.target.live).length;return{all:be.length,running:r,exited:be.length-r}},[be]),Me=i.useMemo(()=>oe==="all"?be:be.filter(r=>r.target.live===(oe==="running")),[be,oe]),xn=i.useMemo(()=>ea(re),[re]),st=A.state==="failed"?A.error:null,tt=o.workspaces,O=o.workspaces.find(r=>r.id===o.activeWorkspaceId)??null,Fe=us({layout:O?.layout,columns:O?.columns,cellCount:O?.tiles.length??0}),Ae=i.useMemo(()=>(O?.tiles??[]).map(r=>Fa(r,A.sessions,O?.id??"")),[O?.id,O?.tiles,A.sessions]),js=ms(Fe,{tileCount:Ae.length});i.useEffect(()=>{if(!O||!p.current.has(O.id))return;const r=Rs(O,{sessions:A.sessions}),d=JSON.stringify(r);p.current.get(O.id)!==d&&(p.current.set(O.id,d),St(r).catch(h=>ne(h instanceof Error?h.message:String(h))))},[O,A.sessions]);const Ke=m==="workspace"&&!O?"library":m,ae=i.useCallback(r=>{u(d=>{const h=d.workspaces.find(R=>R.id===d.activeWorkspaceId);if(!h)return d;const f=r(h.tiles);return f===h.tiles?d:ht(d,h.id,{tiles:f,updatedAt:Date.now()})})},[u]),ss=i.useCallback(r=>{u(d=>d.activeWorkspaceId?ht(d,d.activeWorkspaceId,{layout:r,updatedAt:Date.now()}):d)},[u]),nt=i.useCallback(r=>{u(d=>Nr(d,r.id)),l("workspace")},[u,l]),Ss=i.useCallback(()=>{l("library")},[l]),Le=i.useCallback(r=>{g(r?.id??null),C(r?.name??""),j(r?.purpose??""),b(r?us({layout:r.layout,columns:r.columns,cellCount:r.tiles.length}):vt),D(r?.tiles??Array.from({length:4},()=>Ve("pty"))),T(0),l("builder")},[l]),yn=i.useCallback(r=>{b(d=>r.mode==="solo"?{mode:"solo"}:{mode:r.mode,columns:d.columns??"dynamic"}),D(d=>d.length>=r.minimumCells?d:[...d,...Array.from({length:r.minimumCells-d.length},()=>Ve("pty"))]),T(d=>Math.max(0,Math.min(d,r.minimumCells-1)))},[]),gn=i.useCallback(r=>{b(d=>d.mode==="solo"?{mode:"lanes",columns:r}:{...d,columns:r})},[]),jn=i.useCallback(()=>{D(r=>{const d=[...r,Ve("pty")];return T(d.length-1),d})},[]),Sn=i.useCallback(r=>{D(d=>{if(d.length<=1)return d;const h=d.filter((f,R)=>R!==r);return T(f=>Math.min(f,h.length-1)),h})},[]),wn=i.useCallback(()=>{const r=S.trim();if(!r)return;const d={id:k??os("workspace"),name:r,purpose:E.trim(),columns:ms(N,{tileCount:z.length}),layout:N,tiles:z,updatedAt:Date.now()};u(f=>pt(f,d));const h=Rs(d,{sessions:A.sessions});p.current.set(d.id,JSON.stringify(h)),St(h).catch(f=>ne(f instanceof Error?f.message:String(f))),l("workspace")},[k,u,l,A.sessions,z,N,S,E]),Cn=i.useCallback(r=>{u(d=>vr(d,r,{allowEmpty:!0})),Ca(r).catch(()=>{})},[u]),rt=i.useCallback((r,d="shell")=>{ae(h=>[...h,Ve(r,d)])},[ae]),Ye=i.useCallback((r,d)=>{const h={kind:"registered",terminalSessionId:r.session.id,terminalSurfaceKey:se(r.surface)};ae(f=>{const R=f.some($=>$.kind==="registered"&&$.terminalSessionId===h.terminalSessionId&&As($.terminalSurfaceKey,h.terminalSurfaceKey));return d?f.some($=>$.id===d)?f.map($=>$.id===d?{...h,id:$.id}:$):f:R?f:[...f,{...h,id:os("cell")}]})},[ae]),ts=i.useCallback(r=>{Ye(r)},[Ye]),ns=i.useMemo(()=>new Set(Ae.filter(r=>r.kind==="registered").map(r=>$e(r.target))),[Ae]),rs=i.useCallback(r=>{r?.currentTarget.hasPointerCapture(r.pointerId)&&r.currentTarget.releasePointerCapture(r.pointerId),we.current=null,Ee.current=null,Ne.current=!1,w(null),P(null),V(!1)},[]),Nn=i.useCallback((r,d)=>{const h=r.target;r.button!==0||h instanceof Element&&h.closest("button, a")||(we.current={pointerId:r.pointerId,target:xe(d),targetId:$e(xe(d)),startX:r.clientX,startY:r.clientY},r.currentTarget.setPointerCapture(r.pointerId))},[]),vn=i.useCallback(r=>{const d=we.current;if(!d||d.pointerId!==r.pointerId||Math.hypot(r.clientX-d.startX,r.clientY-d.startY)<6&&!U)return;U||w(d.targetId);const f=document.querySelector(".s-term--workspace");if(f){const ut=f.getBoundingClientRect();r.clientY<ut.top+72&&(f.scrollTop-=28),r.clientY>ut.bottom-72&&(f.scrollTop+=28)}const R=document.elementFromPoint(r.clientX,r.clientY),$=R?.closest(".s-term-workspace-cell"),De=!!(R?.closest(".s-term-workspace-add-cell")||!$&&R?.closest(".s-term--workspace")&&!R?.closest(".s-term-picker")),dt=De?null:$?.dataset.terminalTileId??null;Ee.current=dt,Ne.current=De,P(dt),V(De)},[U]),Tn=i.useCallback(r=>{const d=we.current;!d||d.pointerId!==r.pointerId||(Ne.current?Ye(d.target):Ee.current&&Ye(d.target,Ee.current),rs(r))},[rs,Ye]),In=i.useCallback(r=>{rs(r)},[rs]),Rn=i.useCallback(()=>{const r=y.map(xe);r.length!==0&&ae(d=>{const h=d.filter(R=>R.kind==="registered"),f=r.filter(R=>!h.some($=>$.kind==="registered"&&$.terminalSessionId===R.session.id&&As($.terminalSurfaceKey,se(R.surface)))).map(R=>({id:os("cell"),kind:"registered",terminalSessionId:R.session.id,terminalSurfaceKey:se(R.surface)}));return f.length===0?d:[...d,...f]})},[y,ae]),ws=i.useCallback(r=>{ae(d=>{const h=d.filter(f=>f.id!==r);return h.length===d.length?d:h})},[ae]),at=i.useCallback((r,d,h)=>{r!==d&&ae(f=>Ir(f,r,d,h))},[ae]),Cs=i.useCallback((r,d)=>{ae(h=>{const f=h.findIndex(De=>De.id===r),R=f+d;if(f<0||R<0||R>=h.length)return h;const $=[...h];return[$[f],$[R]]=[$[R],$[f]],$})},[ae]),it=i.useCallback((r,d)=>{ae(h=>h.map(f=>f.id===r?{id:f.id,kind:"fresh",backend:d,agent:"shell"}:f))},[ae]),Be=i.useCallback(()=>[...Tt.map(r=>({kind:"action",label:r.label,onSelect:()=>ss(r.mode==="solo"?{mode:"solo"}:{mode:r.mode,columns:Fe.columns??"dynamic"})})),...Fe.mode==="solo"?[]:[{kind:"separator"},{kind:"action",label:"Dynamic columns",onSelect:()=>ss({...Fe,columns:"dynamic"})},...Array.from({length:Vs},(r,d)=>({kind:"action",label:d===0?"One column":`${d+1} columns`,onSelect:()=>ss({...Fe,columns:d+1})}))],{kind:"separator"},{kind:"action",label:"Edit workspace…",onSelect:()=>O&&Le(O)}],[O,ss,Le,Fe]),En=i.useCallback(r=>{n(r,Be())},[Be,n]),Mn=i.useCallback(r=>{n(r,on.map(d=>({kind:"action",label:d.value==="shell"?"New shell":`New ${d.label} terminal`,onSelect:()=>rt("pty",d.value)})))},[rt,n]),An=i.useCallback((r,d)=>{const h=Ae.findIndex(R=>R.id===d.id),f=[];h>0&&f.push({kind:"action",label:"Move left",onSelect:()=>Cs(d.id,-1)}),h>=0&&h<Ae.length-1&&f.push({kind:"action",label:"Move right",onSelect:()=>Cs(d.id,1)}),f.length>0&&f.push({kind:"separator"}),f.push(...c.map(R=>({kind:"action",label:R.value==="pty"?"Replace with a disposable shell":`Replace with a session that survives (${R.label})`,onSelect:()=>it(d.id,R.value)})),{kind:"separator"},{kind:"action",label:"Remove cell",onSelect:()=>ws(d.id)},{kind:"separator"},...Be()),n(r,f)},[ws,Be,Cs,it,n,c,Ae]),Ln=i.useCallback((r,d)=>{const h=r.target;r.button===0&&h instanceof Element&&h.closest(".s-term-bar, .s-term-float-grip")&&!h.closest("button, a")&&(Re.current={pointerId:r.pointerId,tileId:d,startX:r.clientX,startY:r.clientY},r.currentTarget.setPointerCapture(r.pointerId))},[]),Dn=i.useCallback(r=>{const d=Re.current;if(!d||d.pointerId!==r.pointerId||Math.hypot(r.clientX-d.startX,r.clientY-d.startY)<6&&!H)return;H||Pe(d.tileId);const f=document.elementFromPoint(r.clientX,r.clientY)?.closest(".s-term-workspace-cell"),R=f?.dataset.terminalTileId??null;if(!f||!R||R===d.tileId){he.current=null,Se.current="after",Ie(null);return}const $=f.getBoundingClientRect(),De=Tr({x:r.clientX,y:r.clientY},{left:$.left,top:$.top,width:$.width,height:$.height},js);he.current=R,Se.current=De.edge,Ie(R)},[H,js]),lt=i.useCallback(r=>{const d=Re.current;if(!d||d.pointerId!==r.pointerId)return;const h=he.current;h&&at(d.tileId,h,Se.current),r.currentTarget.hasPointerCapture(r.pointerId)&&r.currentTarget.releasePointerCapture(r.pointerId),Re.current=null,he.current=null,Se.current="after",Pe(null),Ie(null)},[at]),Wn=i.useMemo(()=>Na(ye.find(r=>r.workspaceId===O?.id)),[O?.id,ye]),ot=i.useCallback(r=>{ie(d=>ar(d,r))},[]),$n=i.useCallback((r,d)=>{const h=Ia(d,r.key);h&&(r.preventDefault(),Z(h),document.getElementById(Es(h))?.focus())},[Z]),ct=i.useCallback(()=>{fe(),I(r=>r+1)},[fe]),On=i.useCallback(r=>{O&&wa(O.id,r).then(()=>{ne(null),fe()}).catch(d=>ne(d instanceof Error?d.message:String(d)))},[O,fe]),Pn=i.useCallback(()=>{l(O?"workspace":"library")},[O,l]),zn=i.useCallback(r=>{n(r,[...Be(),{kind:"separator"},{kind:"action",label:"Workspaces…",onSelect:Ss},{kind:"action",label:"Reload terminals",onSelect:ct},{kind:"action",label:"Focus terminal (⌘⇧B)",onSelect:()=>window.dispatchEvent(new Event("scout:terminal-focus-toggle"))},{kind:"separator"},{kind:"action",label:"Open in Scout",onSelect:()=>{window.location.href="scout://terminal"}}])},[Be,ct,n,Ss]),_n=s.jsx(Ts,{slot:"crumb",children:s.jsxs("div",{className:"s-term-desks",role:"tablist","aria-label":"Workspaces",children:[tt.map(r=>{const d=Ke==="workspace"&&r.id===O?.id;return s.jsx("button",{type:"button",role:"tab","aria-selected":d,className:`s-term-desk${d?" is-selected":""}`,title:r.purpose?.trim()||r.name,onClick:()=>nt(r),onContextMenu:h=>{h.preventDefault(),n(h,[{kind:"action",label:"Edit workspace…",onSelect:()=>Le(r)},{kind:"action",label:"All workspaces…",onSelect:Ss}])},children:r.name},r.id)}),s.jsx("button",{type:"button",className:"s-term-desk s-term-desk--new",title:"New workspace","aria-label":"New workspace",onClick:()=>Le(),children:s.jsx(Ue,{size:12,strokeWidth:1.9})})]})}),Fn=Ke==="workspace"?s.jsx(Ts,{slot:"search",children:s.jsxs("label",{className:"s-term-picker-search s-term-topfind",children:[s.jsx(hr,{size:14,strokeWidth:1.8,"aria-hidden":"true"}),s.jsx("input",{ref:me,"data-terminal-find":"",type:"search",value:M,onChange:r=>{X(r.target.value),r.target.value.trim()||ce("all")},onKeyDown:r=>{r.key==="Escape"&&M&&(r.preventDefault(),pe())},placeholder:"Search terminals, agents, panes and screens","aria-label":"Search terminals",title:"Narrow with name: in: harness: mux: branch: model: role: node: owner: cmd: msg: is: pane: screen: — quote values with spaces, prefix with - to exclude"}),_?ys?s.jsxs("span",{className:"s-term-picker-find-trail","aria-live":"polite",children:[s.jsx("i",{className:"s-term-picker-find-dot","aria-hidden":"true"}),xs]}):s.jsx("button",{type:"button",className:"s-term-picker-find-clear",onClick:pe,title:"Esc",children:"Clear"}):s.jsx("kbd",{className:"s-term-picker-find-key","aria-hidden":"true",children:"/"})]})}):null,Ns=s.jsxs(s.Fragment,{children:[_n,Fn,s.jsx(Ts,{children:s.jsx("div",{className:"s-term-topline","aria-label":"Terminal workspace controls",children:s.jsx("div",{className:"s-term-topline-actions",children:Ke==="library"?s.jsxs("button",{type:"button",className:"s-term-topline-button is-primary",onClick:()=>Le(),children:[s.jsx(Ue,{size:13,strokeWidth:1.9}),s.jsx("span",{children:"New workspace"})]}):Ke==="builder"?s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"s-term-topline-button",onClick:Pn,children:"Cancel"}),s.jsx("button",{type:"button",className:"s-term-topline-button is-primary",onClick:wn,disabled:!S.trim(),children:k?"Save":"Create"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",className:"s-term-topline-button is-primary",onClick:Mn,children:[s.jsx(Ue,{size:13,strokeWidth:1.9}),s.jsx("span",{children:"New"})]}),s.jsx("button",{type:"button",className:"s-term-topline-icon",onClick:zn,title:"Layout, columns, focus and more","aria-label":"Workspace menu",children:s.jsx(Ds,{size:14,strokeWidth:1.8})})]})})})})]});return Ke==="library"?s.jsx(Ha,{header:Ns,workspaces:tt,sessionsReady:A.state!=="loading",onOpen:nt,onCreate:()=>Le(),onEdit:Le,onDelete:Cn}):Ke==="builder"?s.jsx(Ya,{header:Ns,editing:!!k,name:S,purpose:E,modes:Tt,layout:N,startOptions:c,cells:z,selectedSlot:v,terminalItems:J,onNameChange:C,onPurposeChange:j,onApplyMode:yn,onColumnsChange:gn,onSelectSlot:T,onAddCell:jn,onRemoveCell:Sn,pickerView:q,pickerSort:Q,onPickerView:te,onPickerSort:ot,onAssignFresh:(r,d="shell")=>D(h=>h.map((f,R)=>R===v?{id:f.id,kind:"fresh",backend:r,agent:d}:f)),onAssignRegistered:r=>D(d=>d.map((h,f)=>f===v?{id:h.id,kind:"registered",terminalSessionId:r.session.id,terminalSurfaceKey:se(r.surface)}:h))}):s.jsxs("div",{className:"s-term s-term--workspace",children:[Ns,s.jsxs("div",{className:"s-term-workspace",children:[s.jsx("h1",{className:"s-term-visually-hidden",children:O?.name??"Terminal workspace"}),st&&s.jsxs("div",{className:"s-term-home-error",children:[s.jsx("span",{children:"Terminal registry unavailable"}),s.jsx("code",{children:st})]}),je&&s.jsxs("div",{className:"s-term-home-error",children:[s.jsx("span",{children:"This workspace is not saved to Scout — it will not follow you to another device"}),s.jsx("code",{children:je})]}),!_&&s.jsxs("div",{className:"s-term-workspace-grid","aria-label":"Terminal tiles",style:{"--terminal-grid-columns":js},onContextMenu:En,children:[Ae.map(r=>s.jsx("div",{className:`s-term-workspace-cell${H===r.id?" s-term-workspace-cell--dragging":""}${Te===r.id||F===r.id?" s-term-workspace-cell--drop-target":""}`,"data-terminal-tile-id":r.id,onPointerDownCapture:d=>Ln(d,r.id),onPointerMove:Dn,onPointerUp:lt,onPointerCancel:lt,onContextMenu:d=>An(d,r),children:s.jsx(Za,{tile:r,navigate:e,onClose:ws,resolution:Wn.get(r.id)??null,onRevive:On,live:_a(r,A.sessions)})},`${r.id}:${x}`)),s.jsxs("button",{type:"button",className:`s-term-workspace-add-cell${Y?" s-term-workspace-add-cell--target":""}`,onClick:()=>me.current?.focus(),children:[s.jsx(Ue,{size:20,strokeWidth:1.7}),s.jsx("strong",{children:"New slot"}),s.jsx("span",{children:U?"Drop to add":"Drag a terminal here"})]})]}),s.jsxs("section",{className:`s-term-picker${_?" s-term-picker--results":""}`,..._?{"aria-label":"Search results"}:{"aria-labelledby":"terminal-picker-title"},onPointerDownCapture:r=>{const d=r.target;if(!(d instanceof Element))return;const h=d.closest("[data-picker-item-id]")?.dataset.pickerItemId,f=J.find(R=>R.id===h);f&&Nn(r,f)},onPointerMove:vn,onPointerUp:Tn,onPointerCancel:In,children:[!_&&s.jsxs("header",{className:"s-term-picker-head",children:[s.jsxs("div",{className:"s-term-picker-title",children:[s.jsx(ue,{size:14,strokeWidth:1.8}),s.jsx("h2",{id:"terminal-picker-title",children:"Add to workspace"}),s.jsxs("span",{className:"s-term-picker-head-count",children:[J.length," terminal",J.length===1?"":"s"," on this host"]})]}),s.jsxs("div",{className:"s-term-picker-actions",children:[B==="session"&&s.jsx("div",{className:"s-term-picker-views",role:"group","aria-label":"Picker view",children:["list","table"].map(r=>s.jsx("button",{type:"button",className:q===r?"is-selected":"",onClick:()=>te(r),"aria-pressed":q===r,children:r==="list"?"List":"Table"},r))}),s.jsxs("button",{type:"button",className:"s-term-workspace-action",onClick:Rn,disabled:y.length===0,children:[s.jsx(qs,{size:13,strokeWidth:1.8}),s.jsx("span",{children:"Add all"})]})]})]}),s.jsxs(s.Fragment,{children:[_?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"s-term-picker-facets",role:"group","aria-label":"Narrow results",children:[Ra.map(([r,d])=>s.jsxs("button",{type:"button",className:oe===r?"is-selected":"","aria-pressed":oe===r,onClick:()=>ce(r),children:[d,s.jsx("em",{children:bn[r]})]},r)),s.jsx("span",{className:"s-term-picker-count",children:ys?`${Me.length} so far`:G?`${Me.length} of ${He.size} screens match`:hs?`${Me.length} of ${qe.size} sessions' panes match`:ks?`${Me.length} of ${bs.size} agents' deliveries match`:`${Me.length} of ${gs.length} match`})]}),s.jsxs("p",{className:"s-term-picker-hint s-term-picker-find-hint",children:["Every setup, agent surface and session · ",s.jsx("code",{children:"in:"})," ",s.jsx("code",{children:"harness:"})," ",s.jsx("code",{children:"mux:"})," ",s.jsx("code",{children:"branch:"})," ",s.jsx("code",{children:"model:"})," ",s.jsx("code",{children:"role:"})," ",s.jsx("code",{children:"node:"})," ",s.jsx("code",{children:"cmd:"})," ",s.jsx("code",{children:"is:live"})," · ",s.jsx("code",{children:"msg:"})," searches what the broker delivered ·"," ",s.jsx("code",{children:"pane:"})," searches inside a multiplexer session · ",s.jsx("code",{children:"screen:"})," searches what a terminal is printing"]})]}):s.jsx("div",{className:"s-term-picker-sources",role:"tablist","aria-label":"Ways to find a terminal",children:[{source:"multiplexer",label:"Multiplexer setups",detail:"Multi-pane · Herdr, tmux, Zellij",count:ke.length,icon:Qt},{source:"agent",label:"Agent sessions",detail:"Agent-owned · managed terminals",count:ze.length,icon:Vt},{source:"session",label:"Recent sessions",detail:"Individual · previously opened by Scout",count:Ce.length,icon:ue}].map(({source:r,label:d,detail:h,count:f,icon:R})=>s.jsxs("button",{type:"button",role:"tab",id:Es(r),"aria-controls":Nt(),className:B===r?"is-selected":"","aria-selected":B===r,tabIndex:B===r?0:-1,onClick:()=>Z(r),onKeyDown:$=>$n($,r),children:[s.jsx(R,{size:16,strokeWidth:1.7,"aria-hidden":"true"}),s.jsxs("span",{children:[s.jsx("strong",{children:d}),s.jsx("small",{children:h})]}),s.jsx("em",{"aria-label":`${A.state==="loading"?"Loading":f} ${d.toLowerCase()}`,children:A.state==="loading"?"·":f})]},r))}),_?s.jsx("div",{className:"s-term-picker-panel","aria-label":"Search results",children:Me.length===0?s.jsx("div",{className:"s-term-picker-empty s-term-picker-empty--explained",children:ys?s.jsxs("strong",{children:[xs,"…"]}):be.length>0?s.jsxs(s.Fragment,{children:[s.jsxs("strong",{children:["No ",oe," terminal matches “",M.trim(),"”"]}),s.jsxs("span",{children:[be.length," ",be.length===1?"match is":"matches are"," in the other tier."]})]}):G?s.jsxs(s.Fragment,{children:[s.jsxs("strong",{children:["Nothing on screen matches “",M.trim(),"”"]}),s.jsxs("span",{children:[He.size," of ",Math.min(K.length,$s)," live screens read. A host that cannot capture its panes does not answer ",s.jsx("code",{children:"screen:"})," queries."]})]}):ks?s.jsxs(s.Fragment,{children:[s.jsxs("strong",{children:["Nothing the broker carried matches “",M.trim(),"”"]}),s.jsxs("span",{children:[s.jsx("code",{children:"msg:"})," searches the asks, replies and invocations the broker has delivered for each agent lately — not a terminal's own output, which is ",s.jsx("code",{children:"screen:"}),"."]})]}):hs?s.jsxs(s.Fragment,{children:[s.jsxs("strong",{children:["No pane matches “",M.trim(),"”"]}),s.jsxs("span",{children:[qe.size," of ",Math.min(fs.length,Ws)," herdr sessions read. ",s.jsx("code",{children:"pane:"})," asks herdr what is inside a session; tmux and zellij rows do not answer it."]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("strong",{children:["No terminal matches “",M.trim(),"”"]}),s.jsxs("span",{children:["Search spans every setup, agent surface and session. Try a directory, a harness, or"," ",s.jsx("code",{children:"is:live"}),"."]})]})}):s.jsx(Ja,{hits:Me,highlight:xn,attachedIds:ns,draggedTargetId:U,onAttach:ts,navigate:e})}):s.jsxs("div",{className:"s-term-picker-panel",role:"tabpanel",id:Nt(),"aria-labelledby":Es(B),children:[s.jsx("p",{className:"s-term-picker-hint",children:B==="multiplexer"?"Preview a complete multiplexer setup, then open it or add the host-owned layout to this workspace.":B==="agent"?"Start from ownership: open the terminal associated with a managed agent, or add that surface here.":"Return to individual terminal sessions Scout has already opened or registered."}),B==="multiplexer"?s.jsx(Ga,{items:ke,selectedId:_e?.id??null,attachedIds:ns,draggedTargetId:U,onSelect:de,onAttach:ts,navigate:e}):B==="agent"?s.jsx(Xa,{agents:ze,items:J,attachedIds:ns,onAttach:ts,navigate:e}):Ce.length===0&&A.state!=="loading"?s.jsxs("div",{className:"s-term-picker-empty s-term-picker-empty--explained",children:[s.jsx("strong",{children:"No recent sessions yet"}),s.jsx("span",{children:"Open or register a terminal session and it will appear here."})]}):s.jsx(mn,{items:Ce,view:q,sort:Q,attachedIds:ns,draggedTargetId:U,onSort:ot,onAttach:ts,navigate:e,groupManaged:!1})]})]})]})]})]})}function Ha({header:e,workspaces:t,sessionsReady:n,onOpen:a,onCreate:c,onEdit:o,onDelete:u}){return s.jsxs("div",{className:"s-term s-term--workspace-library",children:[e,s.jsxs("main",{className:"s-term-workspace-library",children:[s.jsx("h1",{className:"s-term-visually-hidden",children:"Terminal workspaces"}),t.length===0?s.jsxs("section",{className:"s-term-workspace-library-empty",children:[s.jsx(Qt,{size:24,strokeWidth:1.5}),s.jsx("h2",{children:"Create your first terminal workspace"}),s.jsx("p",{children:"Choose a layout, give it a purpose, place sessions, then enter the grid."}),s.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:c,children:[s.jsx(Ue,{size:14,strokeWidth:1.9}),s.jsx("span",{children:"Create workspace"})]})]}):s.jsx("div",{className:"s-term-workspace-library-grid",children:t.map(m=>s.jsxs("article",{className:"s-term-workspace-card",children:[s.jsx("div",{className:"s-term-workspace-card-preview",style:{"--terminal-grid-columns":m.columns??Is},children:m.tiles.map(l=>s.jsx("span",{className:l.kind==="registered"?"is-session":"is-shell"},l.id))}),s.jsxs("div",{className:"s-term-workspace-card-copy",children:[s.jsxs("span",{children:[m.columns??Is," column",(m.columns??Is)===1?"":"s"," · ",m.tiles.length," cells"]}),s.jsx("h2",{children:m.name}),s.jsx("p",{children:m.purpose||"No purpose added yet."})]}),s.jsxs("div",{className:"s-term-workspace-card-actions",children:[s.jsx("button",{type:"button",className:"s-term-workspace-action",onClick:()=>o(m),children:"Edit"}),s.jsx("button",{type:"button",className:"s-term-workspace-action",onClick:()=>u(m.id),children:"Delete"}),s.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:()=>a(m),disabled:!n,children:"Enter workspace"})]})]},m.id))})]})]})}function Os(e,t){return e==="solo"?1:e==="lanes"?Math.max(2,Math.min(4,t)):Math.max(2,Math.min(3,t))}function qa(e,t){return e==="solo"?1:e==="lanes"?Os(e,t):Os(e,t)*2}function Ya({header:e,editing:t,name:n,purpose:a,modes:c,layout:o,startOptions:u,cells:m,selectedSlot:l,terminalItems:p,onNameChange:k,onPurposeChange:g,onApplyMode:S,onColumnsChange:C,onSelectSlot:E,onAddCell:j,onRemoveCell:N,pickerView:b,pickerSort:z,onPickerView:D,onPickerSort:v,onAssignFresh:T,onAssignRegistered:A}){const W=ms(o,{tileCount:m.length});return s.jsxs("div",{className:"s-term s-term--workspace-builder",children:[e,s.jsxs("main",{className:"s-term-workspace-builder",children:[s.jsx("h1",{className:"s-term-visually-hidden",children:t?"Edit terminal workspace":"Create terminal workspace"}),s.jsxs("section",{className:"s-term-workspace-builder-identity","aria-label":"Workspace identity",children:[s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{value:n,onChange:x=>k(x.target.value),placeholder:"Release desk",autoFocus:!0})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Purpose"}),s.jsx("input",{value:a,onChange:x=>g(x.target.value),placeholder:"Cross-project release monitoring"})]})]}),s.jsxs("section",{className:"s-term-workspace-builder-layout","aria-labelledby":"workspace-layout-title",children:[s.jsxs("div",{className:"s-term-workspace-builder-section-head",children:[s.jsxs("div",{children:[s.jsx("span",{children:"Step 1"}),s.jsx("h2",{id:"workspace-layout-title",children:"Choose the layout"})]}),s.jsxs("p",{children:[br(o)," · ",m.length," cell",m.length===1?"":"s"]})]}),s.jsx("div",{className:"s-term-grid-presets","aria-label":"Workspace layout",children:c.map(x=>s.jsxs("button",{type:"button",className:`s-term-grid-preset${x.mode===o.mode?" s-term-grid-preset--selected":""}`,onClick:()=>S(x),"aria-pressed":x.mode===o.mode,children:[s.jsx("span",{className:"s-term-grid-preset-map",style:{"--terminal-preset-columns":Os(x.mode,W)},"aria-hidden":"true",children:Array.from({length:qa(x.mode,W)},(I,M)=>s.jsx("i",{},M))}),s.jsx("span",{className:"s-term-grid-preset-label",children:x.label}),s.jsx("span",{className:"s-term-grid-preset-detail",children:x.detail})]},x.mode))}),o.mode!=="solo"&&s.jsxs("div",{className:"s-term-workspace-builder-columns",role:"group","aria-label":"Columns",children:[s.jsx("span",{children:"Columns"}),s.jsx("button",{type:"button",className:o.columns==="dynamic"||o.columns===void 0?"is-selected":"",onClick:()=>C("dynamic"),"aria-pressed":o.columns==="dynamic"||o.columns===void 0,title:"Fit the columns to the number of tiles",children:"Dynamic"}),Array.from({length:Vs},(x,I)=>s.jsx("button",{type:"button",className:o.columns===I+1?"is-selected":"",onClick:()=>C(I+1),"aria-pressed":o.columns===I+1,children:I+1},I)),(o.columns==="dynamic"||o.columns===void 0)&&s.jsxs("em",{children:[W," right now"]})]})]}),s.jsxs("section",{className:"s-term-workspace-builder-placement","aria-labelledby":"workspace-placement-title",children:[s.jsxs("div",{className:"s-term-workspace-builder-section-head",children:[s.jsxs("div",{children:[s.jsx("span",{children:"Step 2"}),s.jsx("h2",{id:"workspace-placement-title",children:"Place terminals"})]}),s.jsx("p",{children:"Select a cell, then choose a session or shell. Add as many cells as the work needs."})]}),s.jsxs("div",{className:"s-term-workspace-builder-canvas",children:[s.jsxs("div",{className:"s-term-workspace-builder-grid",style:{"--terminal-grid-columns":W},children:[m.map((x,I)=>{const M=x.kind==="registered"?p.find(X=>X.session.id===x.terminalSessionId&&As(se(X.surface),x.terminalSurfaceKey)):null;return s.jsxs("div",{className:`s-term-workspace-builder-cell${l===I?" is-selected":""}`,children:[s.jsxs("button",{type:"button",className:"s-term-workspace-builder-cell-select",onClick:()=>E(I),"aria-pressed":l===I,children:[s.jsx("span",{children:String(I+1).padStart(2,"0")}),s.jsx(ue,{size:17,strokeWidth:1.7}),s.jsx("strong",{children:x.kind==="registered"?M?.title??"Unavailable session":et(x.backend,x.agent).title}),s.jsx("small",{children:x.kind==="registered"?M?.cwdLabel||M?.detail:x.backend})]}),m.length>1&&s.jsx("button",{type:"button",className:"s-term-workspace-builder-cell-remove",onClick:()=>N(I),title:"Remove this cell","aria-label":`Remove cell ${I+1}`,children:s.jsx(Ze,{size:13,strokeWidth:1.9})})]},x.id)}),s.jsxs("button",{type:"button",className:"s-term-workspace-builder-cell s-term-workspace-builder-cell--add",onClick:j,children:[s.jsx(Ue,{size:18,strokeWidth:1.7}),s.jsx("strong",{children:"Add cell"})]})]}),s.jsxs("aside",{className:"s-term-workspace-builder-source",children:[s.jsxs("span",{children:["Cell ",String(l+1).padStart(2,"0")]}),s.jsx("h3",{children:"Start something new"}),s.jsxs("div",{className:"s-term-workspace-builder-source-actions",children:[on.map(x=>s.jsx("button",{type:"button",onClick:()=>T("pty",x.value),children:x.label},x.value)),u.filter(x=>x.value!=="pty").map(x=>s.jsxs("button",{type:"button",onClick:()=>T(x.value,"shell"),title:x.relayAttach?x.detail:`${x.detail} — Scout starts it; open it in ${x.label} to use it`,children:[x.label,!x.relayAttach&&s.jsx("sup",{"aria-label":"opens outside Scout",children:" ↗"})]},x.value))]}),s.jsxs("div",{className:"s-term-workspace-builder-source-head",children:[s.jsx("h3",{children:"Or use a live session"}),s.jsx("div",{className:"s-term-picker-views",role:"group","aria-label":"Session picker view",children:["list","table"].map(x=>s.jsx("button",{type:"button",className:b===x?"is-selected":"",onClick:()=>D(x),"aria-pressed":b===x,children:x==="list"?"List":"Table"},x))})]}),s.jsx("div",{className:"s-term-workspace-builder-sessions",children:p.length===0?s.jsx("span",{className:"s-term-workspace-builder-no-sessions",children:"No live sessions"}):s.jsx(mn,{items:p,view:b,sort:z,attachedIds:new Set,draggedTargetId:null,onSort:v,onAttach:x=>{const I=p.find(M=>M.session.id===x.session.id&&M.surface.sessionName===x.surface.sessionName);I&&A(I)}})})]})]})]})]})]})}function Xe({text:e,needles:t}){return t.length===0?s.jsx(s.Fragment,{children:e}):s.jsx(s.Fragment,{children:ta(e,t).map((n,a)=>n.match?s.jsx("mark",{children:n.text},a):s.jsx(i.Fragment,{children:n.text},a))})}const Va={screen:"screen",panes:"pane",delivery:"message"};function dn({hit:e,highlight:t}){if(!e)return null;if(e.excerpt){const a=Va[e.excerptField??""]??"screen";return s.jsxs("span",{className:"s-term-picker-item-because s-term-picker-item-because--screen",children:[s.jsx("em",{children:a}),s.jsx("code",{children:s.jsx(Xe,{text:e.excerpt,needles:t?.screen??[]})})]})}const n=e.matchedOn[0];return!n||n==="name"?null:s.jsxs("span",{className:"s-term-picker-item-because",children:["matched ",n]})}function Ja({hits:e,highlight:t,attachedIds:n,draggedTargetId:a,onAttach:c,navigate:o}){return s.jsx("div",{className:"s-term-picker-list s-term-picker-list--ranked","aria-label":"Ranked terminals",children:e.map(u=>{const m=u.item;if(!m.item)return s.jsx(un,{agent:m.agent,item:null,attachedIds:n,onAttach:c,navigate:o,hit:u,highlight:t},m.id);const{item:l,agent:p}=m,k=$e(xe(l));return s.jsx(Zs,{item:l,attached:n.has(k),dragging:a===k,onAttach:c,onOpen:()=>o(p?{view:"terminal",agentId:p.id,mode:"takeover"}:{view:"terminal",terminalSessionId:l.session.id,terminalSurfaceKey:se(l.surface)}),hit:u,highlight:t},m.id)})})}function Zs({item:e,attached:t,dragging:n,selected:a=!1,onSelect:c,onAttach:o,onOpen:u,hit:m,highlight:l}){const p=l?.text??[],k=s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"s-term-picker-grip","aria-hidden":"true",children:"⠿"}),s.jsxs("div",{className:"s-term-picker-item-main",children:[s.jsx("strong",{title:e.surface.sessionName,children:s.jsx(Xe,{text:e.title,needles:p})}),s.jsx("span",{title:e.session.cwd??e.detail,children:s.jsx(Xe,{text:e.cwdLabel||e.detail,needles:p})}),s.jsx(dn,{hit:m,highlight:l})]}),s.jsxs("div",{className:"s-term-picker-item-meta",children:[s.jsx("span",{children:e.surface.backend}),s.jsx("span",{children:Hs(e)}),s.jsx("span",{title:e.session.cwd??void 0,children:e.project})]})]});return s.jsxs("article",{className:`s-term-picker-item${t?" s-term-picker-item--attached":""}${n?" s-term-picker-item--dragging":""}${a?" s-term-picker-item--selected":""}${c?" s-term-picker-item--selectable":""}`,"data-picker-item-id":e.id,role:c?"listitem":void 0,children:[c?s.jsx("button",{type:"button",className:"s-term-picker-item-summary s-term-picker-item-select","aria-pressed":a,onClick:c,children:k}):s.jsx("div",{className:"s-term-picker-item-summary",children:k}),u&&s.jsx("button",{type:"button",className:"s-term-picker-add",onClick:u,children:"Open"}),s.jsx("button",{type:"button",className:"s-term-picker-add",onClick:()=>o(xe(e)),disabled:t,children:t?"In grid":"Add"})]})}function Ga({items:e,selectedId:t,attachedIds:n,draggedTargetId:a,onSelect:c,onAttach:o,navigate:u}){const m=e.find(p=>p.id===t)??e[0]??null;if(!m)return s.jsx("div",{className:"s-term-picker-empty",children:"No multiplexers discovered"});const l=Bs(m.surface);return s.jsxs("div",{className:"s-term-picker-explorer",children:[s.jsx("div",{className:"s-term-picker-list s-term-picker-list--explorer",role:"list","aria-label":"Managed multiplexers",children:e.map(p=>{const k=xe(p),g=$e(k);return s.jsx(Zs,{item:p,attached:n.has(g),dragging:a===g,selected:p.id===m.id,onSelect:()=>c(p.id),onAttach:o,onOpen:()=>u({view:"terminal",terminalSessionId:p.session.id,terminalSurfaceKey:se(p.surface)})},p.id)})}),s.jsxs("section",{className:"s-term-picker-preview","aria-label":`${m.title} live preview`,children:[s.jsxs("div",{className:"s-term-picker-preview-title",children:[s.jsxs("div",{children:[s.jsx("strong",{children:m.title}),s.jsxs("span",{children:[m.surface.backend," · ",m.project," · ",Hs(m)]})]}),s.jsx("span",{children:ti(m,Ge(m,[]))})]}),l?s.jsx(qt,{surface:l,lines:28,columns:112,className:"s-term-multiplexer-peek"}):s.jsx("div",{className:"s-term-picker-empty",children:"This host does not expose a web preview"})]})]})}function Xa({agents:e,items:t,attachedIds:n,onAttach:a,navigate:c}){return e.length===0?s.jsxs("div",{className:"s-term-picker-empty s-term-picker-empty--explained",children:[s.jsx("strong",{children:"No agent owns a terminal on this host right now"}),s.jsx("span",{children:"Agents whose terminal has exited still turn up in search, under Exited."})]}):s.jsx("div",{className:"s-term-picker-list","aria-label":"Terminal-backed agents",children:e.map(o=>s.jsx(un,{agent:o,item:t.find(u=>Ge(u,[o])?.id===o.id)??null,attachedIds:n,onAttach:a,navigate:c},o.id))})}function Qa(e){const t=ve(e);return t?{backend:t.backend,live:!1}:{}}function un({agent:e,item:t,attachedIds:n,onAttach:a,navigate:c,hit:o,highlight:u}){const m=ve(e),l=t?xe(t):null,p=l?n.has($e(l)):!1,k=u?.text??[];return s.jsxs("article",{className:`s-term-picker-item${p?" s-term-picker-item--attached":""}`,"data-picker-item-id":t?.id,children:[s.jsxs("div",{className:"s-term-picker-item-summary",children:[s.jsx("span",{className:"s-term-picker-grip","aria-hidden":"true",children:s.jsx("span",{className:"s-term-picker-agent-dot","data-state":e.state})}),s.jsxs("div",{className:"s-term-picker-item-main",children:[s.jsx("strong",{title:e.name,children:s.jsx(Xe,{text:e.name,needles:k})}),s.jsx("span",{title:e.cwd??e.projectRoot??void 0,children:s.jsx(Xe,{text:e.handle?`@${e.handle}`:Bt(e.cwd??e.projectRoot),needles:k})}),s.jsx(dn,{hit:o,highlight:u})]}),s.jsxs("div",{className:"s-term-picker-item-meta",children:[s.jsx("span",{children:m?.backend??e.harness}),s.jsx("span",{children:Ht(e.state)}),s.jsx("span",{children:ri(e)})]})]}),s.jsx("button",{type:"button",className:"s-term-picker-add",onClick:()=>c({view:"terminal",agentId:e.id,mode:"takeover"}),children:"Open"}),s.jsx("button",{type:"button",className:"s-term-picker-add",onClick:()=>l&&a(l),disabled:!l||p,title:l?void 0:"This agent has no registered terminal surface to add",children:p?"In grid":"Add"})]})}function mn({items:e,view:t,sort:n,attachedIds:a,draggedTargetId:c,onSort:o,onAttach:u,navigate:m,groupManaged:l=!0,ranked:p=!1}){const k=i.useMemo(()=>p?e:vs(e,n),[e,p,n]),{managed:g,regular:S}=i.useMemo(()=>l&&!p?_t(e):{managed:[],regular:e},[l,e,p]),C=i.useMemo(()=>vs(g,n),[g,n]),E=i.useMemo(()=>p?S:vs(S,n),[p,S,n]),j=b=>{m?.({view:"terminal",terminalSessionId:b.session.id,terminalSurfaceKey:se(b.surface)})},N=(b,z)=>{const D=$e(xe(b));return s.jsx(Zs,{item:b,attached:a.has(D),dragging:c===D,onAttach:u,onOpen:z&&m?()=>j(b):void 0},b.id)};return t==="table"?s.jsx("div",{className:"s-term-picker-table-wrap",children:s.jsxs("table",{className:"s-term-picker-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[lr.map(b=>s.jsx("th",{scope:"col","aria-sort":n.column===b.id?n.direction==="asc"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",onClick:()=>o(b.id),children:[s.jsx("span",{children:b.label}),s.jsx("em",{"aria-hidden":"true",children:n.column===b.id?n.direction==="asc"?"▲":"▼":"·"})]})},b.id)),s.jsx("th",{scope:"col","aria-label":"Place"})]})}),s.jsx("tbody",{children:k.map(b=>{const z=$e(xe(b)),D=Ut(b);return s.jsxs("tr",{"data-picker-item-id":b.id,className:a.has(z)?"is-attached":void 0,children:[s.jsx("td",{title:b.surface.sessionName,children:b.title}),s.jsx("td",{children:b.surface.backend}),s.jsx("td",{children:Hs(b)}),s.jsx("td",{title:b.session.cwd??void 0,children:b.project}),s.jsx("td",{children:D?mr(D):"—"}),s.jsx("td",{children:s.jsx("button",{type:"button",className:"s-term-picker-add",onClick:()=>u(xe(b)),disabled:a.has(z),children:a.has(z)?"In grid":"Add"})})]},b.id)})})]})}):s.jsxs("div",{className:"s-term-picker-list","aria-label":"Available terminals",children:[C.length>0&&s.jsxs("section",{className:"s-term-picker-group","aria-label":"Managed sessions",children:[s.jsx("h3",{className:"s-term-picker-group-title",children:"Managed sessions"}),C.map(b=>N(b,!0))]}),C.length>0&&E.length>0?s.jsxs("section",{className:"s-term-picker-group","aria-label":"Terminals",children:[s.jsx("h3",{className:"s-term-picker-group-title",children:"Terminals"}),E.map(b=>N(b,!1))]}):E.map(b=>N(b,!1))]})}function Za({tile:e,navigate:t,onClose:n,resolution:a,onRevive:c,live:o=!1}){if(e.kind==="registered")return e.target.surface.backend==="herdr"?s.jsx(Rt,{tileId:e.id,backend:"herdr",sessionName:e.target.surface.sessionName,live:e.target.surface.state==="live",onClose:n,navigate:t}):s.jsx(si,{tile:e,navigate:t,onClose:n});if(e.kind==="unavailable"){const u=a?.status==="revivable"&&!!c;return s.jsxs("section",{className:"s-term-workspace-tile s-term-workspace-tile--unavailable","aria-label":"Unavailable terminal session",children:[s.jsxs("div",{className:"s-term-bar",children:[s.jsxs("div",{className:"s-term-bar-left",children:[s.jsx("span",{className:"s-term-workspace-tile-mark",children:s.jsx(ue,{size:14,strokeWidth:1.8})}),s.jsx("span",{className:"s-term-workspace-tile-name",children:"Not running"})]}),s.jsx("div",{className:"s-term-bar-actions",children:s.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>n(e.id),title:"Remove cell","aria-label":"Remove cell",children:s.jsx(Ze,{size:14,strokeWidth:1.8})})})]}),s.jsxs("div",{className:"s-term-workspace-unavailable-body",children:[s.jsx(ue,{size:22,strokeWidth:1.5}),s.jsx("strong",{children:u?"This tile is not running.":"This saved session is not currently live."}),s.jsx("span",{children:a?.detail??"Show the terminal picker to replace it, or wait for the session to reconnect."}),u&&s.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:()=>c?.(e.id),children:"Start it again"})]})]})}return!Kt(e.backend)&&e.backend!=="pty"?s.jsx(Rt,{tileId:e.id,backend:e.backend,sessionName:e.sessionName,live:o,onClose:n,navigate:t}):s.jsx(ei,{tile:e,navigate:t,onClose:n})}function Rt({tileId:e,backend:t,sessionName:n,live:a,onClose:c,navigate:o}){const{hosts:u}=Us(),m=Pr(u,t),[l,p]=i.useState("idle"),[k,g]=i.useState(null),S=t==="herdr",{topology:C}=Qn(S?n??null:null,{enabled:S&&a}),E=i.useCallback(()=>{n&&(p("starting"),g(null),Zn(t,{sessionName:n}).then(()=>p("idle")).catch(v=>{p("failed"),g(v instanceof Error?v.message:String(v))}))},[t,n]),j=i.useCallback(()=>{if(!o||!n)return;const v=Jn(t,n);v&&o({view:"terminal",terminalSurfaceKey:v})},[o,t,n]),N=i.useCallback(()=>{!o||!n||o(er(n))},[o,n]),b=S&&C?.running?C.workspaces.flatMap(v=>v.tabs.map(T=>({workspace:v,tab:T}))):[],z=b.flatMap(({tab:v})=>v.panes),D=new Set(z.map(v=>v.agent).filter(v=>!!v)).size;return s.jsxs("section",{className:"s-term-workspace-tile s-term-workspace-tile--hosted","aria-label":`${m?.label??t} session`,children:[s.jsxs("div",{className:"s-term-bar",children:[s.jsxs("div",{className:"s-term-bar-left",children:[s.jsx("span",{className:"s-term-workspace-tile-mark",children:s.jsx(ue,{size:14,strokeWidth:1.8})}),s.jsx("span",{className:"s-term-workspace-tile-name",children:m?.label??t})]}),s.jsxs("div",{className:"s-term-bar-meta",children:[s.jsx("span",{className:"s-term-label",children:a?"running":"not running"}),n&&s.jsx("span",{className:"s-term-session",title:n,children:n})]}),s.jsxs("div",{className:"s-term-bar-actions",children:[S&&a&&n&&o&&s.jsx("button",{type:"button",className:"s-term-icon-button",onClick:N,title:"Enter — open a live web terminal attached to this session","aria-label":"Enter — open a live web terminal attached to this session",children:s.jsx(qs,{size:14,strokeWidth:1.8})}),s.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>c(e),title:"Remove cell","aria-label":"Remove cell",children:s.jsx(Ze,{size:14,strokeWidth:1.8})})]})]}),b.length>0?s.jsxs("button",{type:"button",className:"s-term-workspace-hosted-body s-term-workspace-hosted-body--link",onClick:j,children:[s.jsxs("span",{className:"s-term-workspace-hosted-stat",children:[b.length," ",b.length===1?"workspace":"workspaces"," · ",z.length," ",z.length===1?"pane":"panes",D>0&&s.jsxs(s.Fragment,{children:[" · ",D," ",D===1?"agent":"agents"]})]}),b.map(({workspace:v,tab:T})=>{const A=sr(v,T),W=T.panes.find(I=>I.focused)??T.panes[0]??null,x=W?.label??(W?.agent?null:"shell");return s.jsxs("span",{className:"s-term-workspace-hosted-tab",title:[A.label,W?.agent,x].filter(Boolean).join(" · "),children:[s.jsx("span",{className:"s-term-workspace-hosted-tab-dots",children:A.statuses.map((I,M)=>s.jsx(tr,{status:I},`${T.tabId}:${M}`))}),s.jsx("span",{className:"s-term-workspace-hosted-tab-label",children:A.label}),W?.agent&&s.jsx("span",{className:"s-term-workspace-hosted-tab-agent",children:W.agent}),s.jsx("span",{className:"s-term-workspace-hosted-tab-subject",children:x}),s.jsx("span",{className:"s-term-workspace-hosted-tab-count",children:A.statuses.length})]},T.tabId)}),s.jsx("span",{className:"s-term-workspace-hosted-hint",children:"Open the session"})]}):s.jsxs("div",{className:"s-term-workspace-unavailable-body",children:[s.jsx(ue,{size:22,strokeWidth:1.5}),s.jsx("strong",{children:a?`Running in ${m?.label??t}`:"Not running yet"}),s.jsx("span",{children:a?`Scout keeps this session for you. Open it in ${m?.label??t} to use it.`:`Scout can start a ${m?.label??t} session and keep it for you.`}),!a&&s.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:E,disabled:l==="starting"||!n,children:l==="starting"?"Starting…":"Start it"}),k&&s.jsx("code",{children:k})]})]})}function ei({tile:e,navigate:t,onClose:n}){const a=i.useRef(null),c=Ps(),o=zs(),u=et(e.backend,e.agent),m=Ka(e),l=["scout-terminal-workspace",e.id,e.backend,e.agent,e.sessionName??"pty"].join("-"),p=Gs({url:c,healthUrl:o,autoConnect:!0,sessionKey:l,backend:e.backend,...e.sessionName?{terminalSession:e.sessionName}:{},...e.backend==="tmux"&&e.sessionName?{tmuxSession:e.sessionName}:{},...e.backend==="zellij"&&e.sessionName?{zellijSession:e.sessionName}:{},...e.backend==="zellij"&&e.zellijSocketDir?{zellijSocketDir:e.zellijSocketDir}:{},...e.backend==="herdr"&&e.sessionName?{tmuxSession:e.sessionName}:{},agent:e.agent,controlMode:"takeover"});Je(()=>{p.resize(Fs,Ks)},[p.resize]);const k=i.useCallback(()=>{const C=a.current;C?.querySelector(".xterm-helper-textarea")?.focus(),C?.querySelector(".xterm")?.focus()},[]),g=ln({focusTerminal:k,sendInput:p.sendInput}),S=i.useCallback(()=>{m&&cn(m,t)},[t,m]);return s.jsx("section",{className:"s-term-workspace-tile","aria-label":u.title,children:s.jsxs("div",{className:"s-term s-term--embedded",children:[s.jsxs("div",{className:"s-term-bar s-term-bar--fresh",children:[s.jsxs("div",{className:"s-term-bar-left",children:[s.jsx("span",{className:"s-term-workspace-tile-mark",children:s.jsx(ue,{size:14,strokeWidth:1.8})}),s.jsx("span",{className:"s-term-workspace-tile-name",children:u.title})]}),s.jsxs("div",{className:"s-term-bar-meta",children:[s.jsx("span",{className:"s-term-label",children:e.backend}),s.jsx("span",{className:"s-term-session",children:u.detail})]}),s.jsxs("div",{className:"s-term-bar-actions",children:[s.jsx("button",{type:"button",className:"s-term-icon-button",onClick:()=>p.restart(),title:"Restart terminal","aria-label":"Restart terminal",children:s.jsx(Yt,{size:14,strokeWidth:1.8})}),s.jsx("button",{type:"button",className:"s-term-icon-button",onClick:S,title:"Open terminal in a new window","aria-label":"Open terminal in a new window",children:s.jsx(Jt,{size:14,strokeWidth:1.8})}),s.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>n(e.id),title:"Close tile","aria-label":"Close tile",children:s.jsx(Ze,{size:14,strokeWidth:1.8})})]})]}),s.jsx("div",{ref:a,className:"s-term-body",onMouseDown:k,onContextMenuCapture:g.handleContextMenu,onKeyDownCapture:g.handleCopyShortcut,children:s.jsx(Xs,{relay:p,onReady:g.handleTerminalReady,quiet:!0,configItems:[{label:"backend",value:e.backend},{label:"agent",value:e.agent},...e.sessionName?[{label:"session",value:e.sessionName}]:[],...e.zellijSocketDir?[{label:"socket",value:e.zellijSocketDir}]:[],{label:"ws",value:c},{label:"health",value:o}]})})]})})}function si({tile:e,navigate:t,onClose:n}){const a=i.useCallback(()=>{cn(Ba(e.target),t)},[t,e.target]);return s.jsx("section",{className:"s-term-workspace-tile","aria-label":e.target.surface.sessionName,children:s.jsx(Qs,{agent:null,mode:"takeover",navigate:t,registeredTarget:e.target,embedded:!0,tileActions:s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"s-term-icon-button",onClick:a,title:"Open terminal in a new window","aria-label":"Open terminal in a new window",children:s.jsx(Jt,{size:14,strokeWidth:1.8})}),s.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>n(e.id),title:"Close tile","aria-label":"Close tile",children:s.jsx(Ze,{size:14,strokeWidth:1.8})})]})})})}function Et(e){return[...e].filter(t=>!t.retiredFromFleet).sort((t,n)=>{const a=+!!ve(n)-+!!ve(t);if(a!==0)return a;const c=(n.updatedAt??0)-(t.updatedAt??0);return c!==0?c:t.name.localeCompare(n.name)})}function Ge(e,t){const n=se(e.surface),a=t.find(o=>{const u=ve(o);return u?Ot(u,n):!1});if(a)return a;const c=new Set([e.session.id,e.session.sourceSessionId,e.surface.sessionName].map(o=>o.trim()).filter(Boolean));return t.find(o=>[o.harnessSessionId,o.conversationId,o.terminalSurface?.sessionName].some(u=>u&&c.has(u)))??null}function ti(e,t){const n=Mt(e.session.metadata,"currentCommand"),a=Bt(Mt(e.session.metadata,"currentPath"));if(n&&a)return`${n} in ${a}`;if(n)return`running ${n}`;if(t?.handle)return`owned by @${t.handle}`;if(t)return`owned by ${t.name}`;if(e.surface.paneId)return`pane ${e.surface.paneId}`;const c=ni(e.session.metadata,"windows");return c!==null?`${c} window${c===1?"":"s"}`:`${e.surface.backend} surface`}function Mt(e,t){const n=e?.[t];return typeof n=="string"&&n.trim()?n.trim():null}function ni(e,t){const n=e?.[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function ri(e){return e.project??At(e.projectRoot)??At(e.cwd)??e.workspaceQualifier??e.definitionId}function At(e){const t=e?.trim().replace(/\/+$/u,"");return t?t.split("/").pop()||t:null}function ai({route:e,navigate:t}){const n=i.useRef(null),a=e.terminalBackend??"pty",c=e.terminalAgent??"shell",o=e.terminalTabId??"adhoc",u=a==="pty"?void 0:`scout-${a}-${o}`,m=e.terminalSessionName??u,l=Ps(),p=zs(),k=et(a,c),g=["scout-terminal-new",a,c,m??o].join("-"),S=Gs({url:l,healthUrl:p,autoConnect:!0,sessionKey:g,backend:a,...m?{terminalSession:m}:{},...a==="tmux"&&m?{tmuxSession:m}:{},...a==="zellij"&&m?{zellijSession:m}:{},...a==="zellij"&&e.zellijSocketDir?{zellijSocketDir:e.zellijSocketDir}:{},...a==="herdr"&&m?{tmuxSession:m}:{},agent:c,controlMode:"takeover"}),C=i.useRef([]),E=i.useRef({status:S.status,sendLine:S.sendLine});E.current={status:S.status,sendLine:S.sendLine},Je(()=>{const b=z=>{const D=va(z);if(!D)return;const v=E.current;if(v.status==="connected"){v.sendLine(D);return}C.current=[...C.current.slice(-15),D]};return window.addEventListener(Ct,b),()=>window.removeEventListener(Ct,b)},[]),Je(()=>{if(S.status!=="connected"||C.current.length===0)return;const b=C.current;C.current=[];for(const z of b)S.sendLine(z)},[S.sendLine,S.status]);const j=i.useCallback(()=>{const b=n.current;b?.querySelector(".xterm-helper-textarea")?.focus(),b?.querySelector(".xterm")?.focus()},[]),N=ln({focusTerminal:j,sendInput:S.sendInput});return Je(()=>{S.resize(Fs,Ks)},[S.resize]),s.jsxs("div",{className:"s-term",children:[s.jsxs("div",{className:"s-term-bar",children:[s.jsx(Qe,{slot:"terminal",fallback:{view:"terminal"},navigate:t,className:"s-term-back"}),s.jsx("span",{className:"s-term-label",children:k.title}),s.jsx("div",{className:"s-term-status",children:k.detail}),s.jsx("div",{className:"s-term-actions",children:s.jsx("button",{type:"button",className:"s-term-icon-button",onClick:()=>S.restart(),title:"Restart terminal","aria-label":"Restart terminal",children:s.jsx(Yt,{size:14,strokeWidth:1.8})})})]}),s.jsx("div",{ref:n,className:"s-term-body",onMouseDown:j,onContextMenuCapture:N.handleContextMenu,onKeyDownCapture:N.handleCopyShortcut,children:s.jsx(Xs,{relay:S,onReady:N.handleTerminalReady,quiet:!0,configItems:[{label:"backend",value:a},{label:"agent",value:c},...m?[{label:"session",value:m}]:[],...e.zellijSocketDir?[{label:"socket",value:e.zellijSocketDir}]:[],{label:"ws",value:l},{label:"health",value:p}]})})]})}function et(e,t){const n=t==="shell"?"Shell":t==="codex"?"Codex":t==="pi"?"Pi":"Claude";return e==="pty"?{title:n,detail:"fresh PTY tab"}:{title:`${n} ${e}`,detail:`fresh ${e} backed tab`}}function ii({agentId:e,agent:t,mode:n,navigate:a,children:c}){const o=Wa(e,t,n);return o.ready?s.jsx(s.Fragment,{children:c}):s.jsx(Oa,{agent:t,agentId:e,color:Dt(t.name),navigate:a,label:o.label,status:o.status,onRetry:o.onRetry})}function li({navigate:e}){return s.jsx("div",{className:"s-term",children:s.jsxs("div",{className:"s-term-bar",children:[s.jsx(Qe,{slot:"terminal",fallback:{view:"terminal"},navigate:e,className:"s-term-back"}),s.jsx("span",{className:"s-term-label",children:"Terminal"}),s.jsx("div",{className:"s-term-status",children:"Resolving agent..."})]})})}function pn({route:e,navigate:t}){const{agentId:n,mode:a,terminalSessionId:c,terminalSurfaceKey:o}=e,{agents:u}=Lt();if(e.terminalBackend)return s.jsx(ai,{route:e,navigate:t});const m=e.terminalSurfaceKey?$t(e.terminalSurfaceKey):null;if(!n&&m?.backend==="herdr")return s.jsx(Xn,{sessionName:m.hostSession,navigate:t});if(!n)return!c&&!o?s.jsx(Ua,{navigate:t}):s.jsx(za,{terminalSessionId:c,terminalSurfaceKey:o,mode:a,navigate:t});const l=u.find(g=>g.id===n)??null;if(!l)return s.jsx(li,{navigate:t});const p=ve(l),k=p?`${p.backend}:${l.id}:${p.sessionName}:${a??"takeover"}`:`takeover:${n}:${a??"takeover"}`;return s.jsx(ii,{agentId:n,agent:l,mode:a,navigate:t,children:s.jsx(Qs,{agentId:n,agent:l,mode:a,navigate:t})},k)}function oi({agentId:e,mode:t,terminalSessionId:n,terminalSurfaceKey:a,navigate:c}){const o={view:"terminal",agentId:e,mode:t,terminalSessionId:n,terminalSurfaceKey:a};return s.jsx(pn,{route:o,navigate:c})}const Pi=Object.freeze(Object.defineProperty({__proto__:null,TerminalContent:pn,TerminalScreen:oi},Symbol.toStringTag,{value:"Module"}));export{pn as T,Pi as a,Gs as u};
@@ -1 +0,0 @@
1
- import{r as e,j as l,a as A,b as C,S as k}from"./index-C8uS5szO.js";import{L as y,D as T,S as L,C as x}from"./Provider-5Hotn7NQ.js";import{a as R}from"./api-CaROe5_H.js";import{f as P}from"./machine-scope-DJt9RZ2w.js";import{i as I}from"./agent-state-DDhnFEEP.js";import{r as j,a as D}from"./router-BKiMcYa7.js";import{T as H}from"./Terminal-D-DsQlmV.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-JjLbm3W2.js";import"./runtime-picker-DdsttHHc.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./createLucideIcon-DkjnzvcJ.js";import"./conversation-model-BGFHoxQ0.js";import"./colors-CFlbwC25.js";import"./time-Dhsh_2EG.js";import"./conversations-Cbg9h_Af.js";import"./index-C5cX8dkl.js";import"./HarnessMark-Bt47OeHy.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./file-text-ChtICwub.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";/* empty css */import"./clipboard-e3fSpeo7.js";import"./terminal-relay-Bfx8pg80.js";import"./HerdrSession-CtJOUn7H.js";import"./chunk-YOZR3KYS-B59jqwO0.js";import"./arrow-down-WoVlkUmg.js";import"./terminal-96JWDYDL.js";import"./refresh-cw-Da9DDLk2.js";import"./check-B8dMv3Is.js";import"./copy-D9WUpQRf.js";import"./eye-CtqSV8BS.js";import"./session-table-CDx_16xf.js";import"./chunk-JTPDIGGW-ZC-98AHT.js";import"./terminal-takeover-BlpxpvSp.js";import"./BackToPicker-Bys9ColC.js";import"./TmuxPeek-BhK0V9Qt.js";/* empty css */import"./TerminalHeaderMount-DCGstkZ4.js";import"./plus-D_wLGJGT.js";import"./zap-sKPkh4sQ.js";import"./external-link-RT4Ph-6-.js";function g(){const t=new URLSearchParams(window.location.search).get("route")?.trim()||"/terminal",s=j(t);return s.view==="terminal"?s:{view:"terminal"}}function S(o){const t=new URLSearchParams(window.location.search);return t.set("route",D(o)),t.has("profile")||t.set("profile","macos.terminal"),`${window.location.pathname}?${t.toString()}${window.location.hash}`}function Ge(){const[o,t]=e.useState(()=>g()),s=!!(o.terminalBackend||o.agentId||o.terminalSessionId||o.terminalSurfaceKey);e.useEffect(()=>{const i=()=>t(g());return window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)},[]);const n=e.useCallback(i=>{if(i.view!=="terminal"){const p={view:"terminal"},a=S(p);window.history.pushState(null,"",a),t(p);return}const c=S(i);window.history.pushState(null,"",c),t(i)},[]);return l.jsx(M,{route:o,navigate:n,children:l.jsx("div",{className:`s-terminal-embed${s?" s-terminal-embed--surface":""}`,children:l.jsx(H,{route:o,navigate:n})})})}function M({route:o,navigate:t,children:s}){const[n,i]=e.useState([]),[c,p]=e.useState({status:"checking",message:null,lastCheckedAt:null}),a=e.useRef(null),u=e.useMemo(()=>A(),[]),f=e.useMemo(()=>C(),[]),b=e.useMemo(()=>({...u==="light"?y:T,...f??{}}),[u,f]),w=e.useCallback(()=>{p({status:"online",message:null,lastCheckedAt:Date.now()})},[]),h=e.useCallback(r=>{p({status:"offline",message:P(r),lastCheckedAt:Date.now()})},[]),m=e.useCallback(async()=>{if(a.current)return a.current;const r=(async()=>{try{i(await R("/api/agents")),w()}catch(d){h(d)}})();a.current=r;try{await r}finally{a.current=null}},[h,w]);e.useEffect(()=>{m()},[m]),e.useEffect(()=>{const r=()=>{document.visibilityState!=="hidden"&&m()},d=window.setInterval(r,15e3);return window.addEventListener("focus",r),document.addEventListener("visibilitychange",r),()=>{window.clearInterval(d),window.removeEventListener("focus",r),document.removeEventListener("visibilitychange",r)}},[m]);const v=e.useMemo(()=>n.filter(r=>I(r.state)).length,[n]),E=e.useMemo(()=>({route:o,navigate:t,navigateBack:()=>{typeof window<"u"&&window.history.back()},canNavigateBack:typeof window<"u"&&window.history.length>1,agents:n,agentsLoaded:c.status!=="checking",onlineCount:v,apiConnection:c,appearanceDetails:k,updateAppearanceDetails:()=>{},reload:m,onboarding:null,operatorName:null,refreshOnboarding:async()=>{},onboardingSkipped:!0,skipOnboarding:()=>{},settingsOpen:!1,openSettings:()=>{},closeSettings:()=>{},scoutbotAgentId:"scoutbot",scoutbotConversationId:null,applyScoutbotUiAction:()=>{},selectedBrokerAttempt:null,inspectBrokerAttempt:()=>{},clearBrokerAttempt:()=>{},selectedKnowledgeHit:null,selectedKnowledgeQuery:"",inspectKnowledgeHit:()=>{},clearKnowledgeHit:()=>{},focusedSession:null,focusSession:()=>{},openFilePreview:()=>{},closeFilePreview:()=>{},openContextCapture:()=>{},closeContextCapture:()=>{}}),[n,c,t,v,m,o]);return l.jsx(L.Provider,{value:E,children:l.jsx("div",{"data-scout-theme":u,"data-scout-theme-mode":u,style:b,children:l.jsx(x,{children:s})})})}export{Ge as TerminalEmbedScreen};
@@ -1 +0,0 @@
1
- import{r as i,j as t}from"./index-C8uS5szO.js";import{M as H}from"./runtime-picker-DdsttHHc.js";import{a as U}from"./api-CaROe5_H.js";import"./index-C5cX8dkl.js";import{s as G}from"./scout-voice-DOQ_B77g.js";import{h as V}from"./NewChatComposer-JjLbm3W2.js";import{s as X,i as Y}from"./send-to-agent-session-BZGq_ycy.js";import{u as z}from"./Provider-5Hotn7NQ.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./createLucideIcon-DkjnzvcJ.js";import"./router-BKiMcYa7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./fx-z37u1o2z.js";import"./conversation-model-BGFHoxQ0.js";import"./agent-state-DDhnFEEP.js";import"./colors-CFlbwC25.js";import"./time-Dhsh_2EG.js";import"./conversations-Cbg9h_Af.js";import"./HarnessMark-Bt47OeHy.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./file-text-ChtICwub.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";const J=240;function Q(e){return e.replace(/```[\s\S]*?```/g," ").replace(/~~~[\s\S]*?~~~/g," ").replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}#{1,6}\s+/gm,"").replace(/^\s{0,3}>\s?/gm,"").replace(/^\s{0,3}[-*+]\s+/gm,"").replace(/^\s{0,3}\d+[.)]\s+/gm,"").replace(/(\*\*|__|\*|_|~~)/g,"").replace(/\s+/g," ").trim()}function Z(e,o=J){const r=Q(e??"");if(!r)return"";if(r.length<=o)return r;const s=r.slice(0,o+1),a=Math.max(s.lastIndexOf(". "),s.lastIndexOf("! "),s.lastIndexOf("? "));if(a>o*.4)return s.slice(0,a+1).trim();const l=s.lastIndexOf(" ");return`${(l>0?s.slice(0,l):r.slice(0,o)).trim()}…`}function tt(e,o){const r=Z(o);return r?`${e} says: ${r}`:`${e} replied, but there was nothing to read out.`}const D=2500,et=5*6e4;function nt(e,o,r,s=(a,l)=>{const p=setTimeout(a,l);return()=>clearTimeout(p)}){const a=new AbortController;let l=!1,p=()=>{},b=()=>{};const c=()=>{l=!0,a.abort(),p(),b()},v=async()=>{if(!l){try{const A=await o(a.signal);if(l)return;const g=A.filter(u=>u.class==="agent"&&u.createdAt>=e).reduce((u,y)=>!u||y.createdAt<u.createdAt?y:u,null);if(g){c(),r({status:"received",reply:g});return}}catch{}l||(p=s(()=>{v()},D))}};return r({status:"waiting",reply:null}),b=s(()=>{l||(c(),r({status:"timed-out",reply:null}))},et),p=s(()=>{v()},D),c}function st(e,o){const[r,s]=i.useState(null);return i.useEffect(()=>{if(!(!e||o===null))return nt(o,a=>U(`/api/messages?conversationId=${encodeURIComponent(e)}&limit=8`,{signal:a}),a=>s({conversationId:e,since:o,state:a}))},[e,o]),!e||o===null?{status:"idle",reply:null}:r?.conversationId!==e||r.since!==o?{status:"waiting",reply:null}:r.state}const L="scout.world.talkBack";function rt(){try{return window.localStorage.getItem(L)==="1"}catch{return!1}}function ot(e){try{window.localStorage.setItem(L,e?"1":"0")}catch{}}function Yt({lane:e,x:o,y:r,compose:s,voice:a=!1,onTalk:l,onDictate:p,onProfile:b,onClose:c,onSent:v}){const{route:A,navigate:g}=z(),[u,y]=i.useState(""),[h,T]=i.useState(!1),[E,k]=i.useState(""),[m,P]=i.useState(null),[f,F]=i.useState(rt),[O,C]=i.useState(!1),M=i.useRef(null),N=i.useRef(!1),S=i.useRef(null),j=e.agent.handle||e.agent.name;i.useEffect(()=>{s?M.current?.focus():S.current?.querySelector("button")?.focus()},[s]),i.useEffect(()=>{if(s&&a&&!N.current){const n=S.current?.querySelector(".s-dictation-mic");n&&!n.disabled&&(N.current=!0,n.click())}},[s,a]),i.useEffect(()=>{const n=d=>{!S.current?.contains(d.target)&&!h&&!u&&c()};return document.addEventListener("pointerdown",n),()=>document.removeEventListener("pointerdown",n)},[c,h,u]);const _=st(f&&m?m.conversationId:null,m?.at??null),R=_.status==="received"?_.reply:null;i.useEffect(()=>{if(!R||!f)return;const n=G(tt(j,R.body));return n.promise.catch(()=>k("Reply arrived, but Scout could not speak it.")),()=>n.stop()},[R,f,j]);async function $(n=u){const d=n.trim();if(!(!d||h)){T(!0),k("");try{const w=await X(e.agent,d);y(""),P({conversationId:w.conversationId,at:w.sentAt}),v()}catch(w){k(w instanceof Error?w.message:"Could not send message")}finally{T(!1)}}}const x=A.machineId,I=i.useCallback(n=>{g({view:"agents-v2",agentId:e.agent.id,...x?{machineId:x}:{},...n}),c()},[g,e.agent.id,x,c]),K=()=>F(n=>(ot(!n),!n)),B=t.jsxs("button",{className:`world-actor-talk__talkback${f?" is-on":""}`,type:"button",onClick:K,"aria-pressed":f,title:"Scout reads the first reply to your latest message aloud",children:[t.jsxs("span",{children:["Read replies aloud",f&&m?.conversationId?t.jsx("small",{children:_.status==="received"?"Reply received":_.status==="timed-out"?"Stopped waiting after five minutes. Open chat to check for replies.":"Listening for a reply…"}):null]}),t.jsxs("span",{className:"world-actor-talk__state",children:[t.jsx("small",{children:f?"On":"Off"}),t.jsx("span",{className:"world-actor-talk__switch","aria-hidden":"true"})]})]}),W=async()=>{if(O)return;const n=m?.conversationId;if(n){I({conversationId:n,tab:"message"});return}if(Y(e.agent)){const d=e.agent.harnessSessionId?.trim();if(!d){k("This native session has no session id to open.");return}g({view:"sessions",sessionId:d,...x?{machineId:x}:{}}),c();return}C(!0),k("");try{I({conversationId:await V(e.agent),tab:"message"})}catch(d){k(d instanceof Error?d.message:"Could not open the chat.")}finally{C(!1)}},q=m?t.jsxs("div",{className:"world-actor-talk__receipt",role:"status",children:[t.jsxs("strong",{children:["Sent to ",j]}),m.conversationId?t.jsx("div",{className:"world-actor-talk__links",children:t.jsx("button",{type:"button",onClick:()=>I({conversationId:m.conversationId,tab:"message"}),children:"Open chat →"})}):t.jsx("small",{children:"Native session — continued by session id, so there is no conversation to open."})]}):null;return t.jsx("div",{ref:S,className:"world-actor-talk",style:{left:Math.max(12,Math.min(o-180,window.innerWidth-372)),top:Math.max(12,Math.min(r,window.innerHeight-(s?430:300)))},onPointerDown:n=>n.stopPropagation(),onKeyDown:n=>{n.stopPropagation(),n.key==="Escape"&&!h&&c()},"aria-label":`Talk to ${e.agent.name}`,children:s?t.jsxs(t.Fragment,{children:[t.jsxs("header",{children:[t.jsxs("strong",{children:["Talk to ",j]}),t.jsx("span",{className:"world-actor-talk__header-actions",children:t.jsx("button",{type:"button",onClick:c,disabled:h,"aria-label":"Close composer",children:"×"})})]}),t.jsx(H,{density:"panel",value:u,onChange:y,onSend:()=>{$()},onDictationCommit:a?n=>{$(n)}:void 0,sending:h,textareaRef:M,rows:4,placeholder:"Send a message…","aria-label":"Message to this agent"}),B,q,t.jsx("small",{role:"status",children:E||(a?"Dictation sends on stop · ⌥-click to type instead":"Option-click to type · Shift-click to dictate and send")})]}):t.jsxs(t.Fragment,{children:[t.jsxs("button",{type:"button",onClick:l,children:["Talk ",t.jsx("small",{children:"⌥ / Alt + click"})]}),p?t.jsxs("button",{type:"button",onClick:p,children:["Dictate & send ",t.jsx("small",{children:"⇧ / Shift + click"})]}):null,B,t.jsxs("button",{type:"button",onClick:()=>{W()},disabled:O,children:["Open chat ",t.jsx("small",{children:O?"Opening…":"Full conversation"})]}),t.jsx("button",{type:"button",onClick:()=>I({tab:"profile"}),children:"Open agent profile"}),t.jsx("button",{type:"button",onClick:b,children:"Focus on floor"}),t.jsx("button",{type:"button",onClick:c,children:"Dismiss"}),E?t.jsx("small",{role:"status",children:E}):null]})})}export{Yt as WorldActorTalk};