@openscout/scout 0.2.106 → 0.2.108

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 (473) hide show
  1. package/README.md +79 -16
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/ActivityScreen-C1H-vL0L.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-CusDRiVO.js → AddProjectForm-4sVXmjfN.js} +1 -1
  6. package/dist/client/assets/{AdventureEvidence-CyegKk1V.js → AdventureEvidence-D5wq1vu8.js} +1 -1
  7. package/dist/client/assets/{AdventureReader-X-hbTOi0.js → AdventureReader-BICypcDY.js} +1 -1
  8. package/dist/client/assets/{AdventureScenery-LPXSVP67.js → AdventureScenery-CGEcG0zV.js} +1 -1
  9. package/dist/client/assets/AgentAdventures-5yBt-Zl3.js +1 -0
  10. package/dist/client/assets/{AgentAvatar-CrP1eXxk.js → AgentAvatar-Dn8TUv5W.js} +1 -1
  11. package/dist/client/assets/AgentConfigurationScreen-C0D9WNyL.js +1 -0
  12. package/dist/client/assets/AgentDefinitionsWorkspace-BzcBdC_s.js +1 -0
  13. package/dist/client/assets/{AgentDetailCard-DtHT3sCo.js → AgentDetailCard-CI-ufaEP.js} +1 -1
  14. package/dist/client/assets/AgentFloorView-D8tlGlgy.js +1 -0
  15. package/dist/client/assets/{AgentFloorWorld-CjoIa6jA.js → AgentFloorWorld-DqmnQexg.js} +1 -1
  16. package/dist/client/assets/AgentInfoScreen-BnRhfcFy.js +1 -0
  17. package/dist/client/assets/{AgentLaneCard-BaZ2g-f8.js → AgentLaneCard-pppHFROz.js} +1 -1
  18. package/dist/client/assets/{AgentLaneChrome-TF1SlJSc.js → AgentLaneChrome-RptImDFc.js} +1 -1
  19. package/dist/client/assets/{AgentLaneDetailSheet-EzEPsn3g.js → AgentLaneDetailSheet-BqbwGskh.js} +1 -1
  20. package/dist/client/assets/{AgentLaneSummaryResize-dpp7YvrX.js → AgentLaneSummaryResize-DaIgwyVh.js} +1 -1
  21. package/dist/client/assets/AgentLanesEmbedScreen-De6C4ZOw.js +1 -0
  22. package/dist/client/assets/{AgentLanesPreflight-Ry-aqDTr.js → AgentLanesPreflight-BQfj2twF.js} +1 -1
  23. package/dist/client/assets/{AgentLanesView-BJi9xXz6.js → AgentLanesView-CiISx7pu.js} +1 -1
  24. package/dist/client/assets/{AgentLiveActions-CfTupTEl.js → AgentLiveActions-CkRGkv13.js} +1 -1
  25. package/dist/client/assets/AgentMasterScreen-CijN_4tN.js +1 -0
  26. package/dist/client/assets/{AgentSessions-B1gOhDBf.js → AgentSessions-ghjQcSrh.js} +2 -2
  27. package/dist/client/assets/AgentsConsole-D8upjDpn.js +1 -0
  28. package/dist/client/assets/AgentsScreen-C17BFqjf.js +1 -0
  29. package/dist/client/assets/AgentsSubnav-_1GVC4hj.js +1 -0
  30. package/dist/client/assets/{AstronautSuit-Cchnc4Ug.js → AstronautSuit-Dzu4GOMR.js} +1 -1
  31. package/dist/client/assets/{AtopView-gkEp4y__.js → AtopView-DJK5b3lZ.js} +1 -1
  32. package/dist/client/assets/{BackToPicker-CUkjnoVk.js → BackToPicker-BPU7kbXq.js} +1 -1
  33. package/dist/client/assets/BriefingDetailScreen-CTvFw523.js +1 -0
  34. package/dist/client/assets/{BriefingsScreen-B1HlBMGZ.js → BriefingsScreen-DpVC3OUk.js} +1 -1
  35. package/dist/client/assets/{BrokerMetadataPanel-Dk242Yh_.js → BrokerMetadataPanel-glRVdwkU.js} +1 -1
  36. package/dist/client/assets/BrokerScreen-CqKsBwEx.js +8 -0
  37. package/dist/client/assets/{CastPicker-BXUtPAGC.js → CastPicker-Y29K5kKk.js} +1 -1
  38. package/dist/client/assets/ChannelComposer-D4EY9jVW.js +1 -0
  39. package/dist/client/assets/{ChannelSidebar-e9DOPulb.js → ChannelSidebar-CVmykV4d.js} +1 -1
  40. package/dist/client/assets/{CharacterFamilyPreview-DMfw7UM_.js → CharacterFamilyPreview-Bj8oMD-5.js} +1 -1
  41. package/dist/client/assets/{ChatAvatar-C3a_o5Hj.js → ChatAvatar-BsAOShUr.js} +1 -1
  42. package/dist/client/assets/{ChatBits-CsvxbToF.js → ChatBits-Cq54CmyB.js} +1 -1
  43. package/dist/client/assets/{ChatCollapsedStrip-FEmQ_G9J.js → ChatCollapsedStrip-B0DdrOo2.js} +1 -1
  44. package/dist/client/assets/{ChatRichInput-DhtwFxQE.js → ChatRichInput-DYJRhGTP.js} +1 -1
  45. package/dist/client/assets/ChatRightPanel-D94Lw7ud.js +1 -0
  46. package/dist/client/assets/ChatSpaceSurface-Cp532VmZ.js +1 -0
  47. package/dist/client/assets/{ChatSpaceTheme-CUH8bTZc.js → ChatSpaceTheme-DPzYpw-v.js} +1 -1
  48. package/dist/client/assets/{CodeDiffPane-DuQRwpgK.js → CodeDiffPane-DCgMUi39.js} +1 -1
  49. package/dist/client/assets/{CodeProjectPicker-ZQ6gSBpg.js → CodeProjectPicker-Dq787L77.js} +1 -1
  50. package/dist/client/assets/{CodeScreen-BXyKeL5T.js → CodeScreen-BN4TkiR0.js} +1 -1
  51. package/dist/client/assets/{CommsCanvas-THp0r_U8.js → CommsCanvas-Dh056d91.js} +1 -1
  52. package/dist/client/assets/{CommsDeck-BVmSMV2V.js → CommsDeck-CRXKIerH.js} +1 -1
  53. package/dist/client/assets/{CommsFlowGraph-DxoOaLF_.js → CommsFlowGraph-Cc48o9u_.js} +1 -1
  54. package/dist/client/assets/{CommsFlowMap-Vi8ziCPg.js → CommsFlowMap-Ckasql5e.js} +1 -1
  55. package/dist/client/assets/{CommsSelection-BUoRbu9o.js → CommsSelection-CuphnUny.js} +1 -1
  56. package/dist/client/assets/{ComposerAttachments-DW0AIb8k.js → ComposerAttachments-9uYp_Lh5.js} +1 -1
  57. package/dist/client/assets/ConversationComposer-hYtLurqy.js +1 -0
  58. package/dist/client/assets/ConversationFeedRows-Bu0ZJcy8.js +1 -0
  59. package/dist/client/assets/ConversationHeader-L9738YVP.js +1 -0
  60. package/dist/client/assets/{ConversationPanels-D9oC0xG5.js → ConversationPanels-D6KuqvGu.js} +2 -2
  61. package/dist/client/assets/ConversationScreen-Pzxy9x4m.js +2 -0
  62. package/dist/client/assets/ConversationStatus-BEefIbXq.js +1 -0
  63. package/dist/client/assets/{CrewAvatar-kTznzqcO.js → CrewAvatar-a_C_F9r_.js} +1 -1
  64. package/dist/client/assets/{CrewSprite-Dhryjx2c.js → CrewSprite-CguHb2Ny.js} +1 -1
  65. package/dist/client/assets/{CrewStage-vdO0qm3D.js → CrewStage-IPpS3Oja.js} +1 -1
  66. package/dist/client/assets/{CrewWorkspaces-DCBzAAS4.js → CrewWorkspaces-BTPtcEcx.js} +1 -1
  67. package/dist/client/assets/{DataTable-aH-jCyDq.js → DataTable-DnL_8SAu.js} +1 -1
  68. package/dist/client/assets/{DispatchAftermath-66uQAorV.js → DispatchAftermath-CoAYaL3B.js} +1 -1
  69. package/dist/client/assets/{DocumentFocusViewer-DJr0v0D_.js → DocumentFocusViewer-mxzPxQQW.js} +1 -1
  70. package/dist/client/assets/{EmbeddableSurfacesLab-BBa70EhJ.js → EmbeddableSurfacesLab-BAZ_eRMc.js} +1 -1
  71. package/dist/client/assets/{EmptyState-CZlrHXy-.js → EmptyState-DLiLgtPK.js} +1 -1
  72. package/dist/client/assets/{FileViewerPane-BAO6mtjD.js → FileViewerPane-Dc7AoVod.js} +1 -1
  73. package/dist/client/assets/{FleetRollCallHud-C5q2567n.js → FleetRollCallHud-VhpxVcGO.js} +1 -1
  74. package/dist/client/assets/FlightObserveScreen-C1kASP3J.js +1 -0
  75. package/dist/client/assets/{FloorContextSheet-2_NVPQor.js → FloorContextSheet-BfrXNoBn.js} +1 -1
  76. package/dist/client/assets/{FloorExchangePanel-BU1pPu8K.js → FloorExchangePanel-DsG1cRzu.js} +1 -1
  77. package/dist/client/assets/{FloorMessagePasses-cLW2UGNP.js → FloorMessagePasses-Cm3LbkHd.js} +1 -1
  78. package/dist/client/assets/{FloorReplay-VFzA6Kxc.js → FloorReplay-Bg7kA-tR.js} +1 -1
  79. package/dist/client/assets/FloorResourcesSheet-Ba9HubO2.js +1 -0
  80. package/dist/client/assets/{FloorSavedWork-BeHDejWz.js → FloorSavedWork-BDOvV3mA.js} +1 -1
  81. package/dist/client/assets/{FloorTacticalHUD-CO-iiFpb.js → FloorTacticalHUD-4d-Hr-YL.js} +1 -1
  82. package/dist/client/assets/{FollowScreen-CFfkIbc6.js → FollowScreen-DFVSlsQV.js} +1 -1
  83. package/dist/client/assets/{HarnessMark-C4naWc16.js → HarnessMark-CP-PWk2W.js} +1 -1
  84. package/dist/client/assets/HarnessesScreen-j-91IoOo.js +1 -0
  85. package/dist/client/assets/{HerdrSession-_t7yM8vX.js → HerdrSession-H2mmxeTK.js} +1 -1
  86. package/dist/client/assets/{HomeHero-DouPyNmz.js → HomeHero-g4H3Ctxg.js} +1 -1
  87. package/dist/client/assets/{HostAdvisorView-CnM1i8hW.js → HostAdvisorView-Cyt3b5Fq.js} +1 -1
  88. package/dist/client/assets/{InviteLandingScreen-CEjG2E34.js → InviteLandingScreen-C3DtAGD4.js} +1 -1
  89. package/dist/client/assets/{InviteSheet-CwxZtWCl.js → InviteSheet-BiGMNpsE.js} +1 -1
  90. package/dist/client/assets/{JumpPalette-O1aJE9gR.js → JumpPalette-goXAVByA.js} +1 -1
  91. package/dist/client/assets/{KnowledgeSearchInspector-32n9baT-.js → KnowledgeSearchInspector-BbOQIqdF.js} +1 -1
  92. package/dist/client/assets/KnowledgeSearchScreen-DC8yX-kA.js +1 -0
  93. package/dist/client/assets/{LaneToolHoverCard-CJa110yk.js → LaneToolHoverCard-B8Am_1DC.js} +1 -1
  94. package/dist/client/assets/LaneTraceDetailSheet-CngYIxdI.js +1 -0
  95. package/dist/client/assets/{LaneTraceEventFocus-TbrNHRj_.js → LaneTraceEventFocus-BRR_jcl9.js} +1 -1
  96. package/dist/client/assets/{MeshCanvas-DWZHYh1A.js → MeshCanvas-DzkuY_XI.js} +1 -1
  97. package/dist/client/assets/{MeshCanvasMinimap-iswYFpIb.js → MeshCanvasMinimap-BrscEPAH.js} +1 -1
  98. package/dist/client/assets/MeshScreen-CAtRB8K6.js +1 -0
  99. package/dist/client/assets/{MeshTopologyView-BVvtqI8q.js → MeshTopologyView-B1I2dAhu.js} +2 -2
  100. package/dist/client/assets/{MessageEmbeds-ksPazAKH.js → MessageEmbeds-B-FbWI7a.js} +1 -1
  101. package/dist/client/assets/MessagesScreen-hq7D3Lfi.js +1 -0
  102. package/dist/client/assets/{MissionContextRail-D62-Wis8.js → MissionContextRail-ClR8amG1.js} +1 -1
  103. package/dist/client/assets/MissionControlView-D6gbMrgx.js +1 -0
  104. package/dist/client/assets/{MissionFocusOverlay-C1zys3Jv.js → MissionFocusOverlay-CzeNgI9Q.js} +1 -1
  105. package/dist/client/assets/MissionLeftAgentRow-CB3cgeYr.js +1 -0
  106. package/dist/client/assets/{MissionLogPane-B19lYSY9.js → MissionLogPane-2PMEoG44.js} +1 -1
  107. package/dist/client/assets/NativeAreaScreen-BnlrAWT8.js +1 -0
  108. package/dist/client/assets/NativeAreaScreen-DSR5Tf6F.js +1 -0
  109. package/dist/client/assets/NativeAreaScreen-fGsxyeC3.js +1 -0
  110. package/dist/client/assets/{NewAgentModal-Bh-L-emz.js → NewAgentModal-4b_3aoZE.js} +1 -1
  111. package/dist/client/assets/{NewChatComposer-C97-iTMK.js → NewChatComposer-D-VB5vdt.js} +1 -1
  112. package/dist/client/assets/{NewChatOrigin-DFbF_XvR.js → NewChatOrigin-BYsEu9dZ.js} +1 -1
  113. package/dist/client/assets/{NodeDetailPanel-CElOEpCh.js → NodeDetailPanel-9NaEnZAQ.js} +1 -1
  114. package/dist/client/assets/{NodeMenu-B-jjHf1c.js → NodeMenu-BgJMmffZ.js} +1 -1
  115. package/dist/client/assets/{ObserveEmbedScreen-B7Qt69Ms.js → ObserveEmbedScreen-W7Q5HbXP.js} +2 -2
  116. package/dist/client/assets/{ObserveTextFlow-PFnG_10h.js → ObserveTextFlow-C0oQEerY.js} +2 -2
  117. package/dist/client/assets/{ObservedTopologyPanel-CUTIoLZJ.js → ObservedTopologyPanel-Ci7emnnj.js} +1 -1
  118. package/dist/client/assets/OpenScoutAppShell-Di9qdmI0.js +22 -0
  119. package/dist/client/assets/OpsAgentsView-DVotOMg2.js +1 -0
  120. package/dist/client/assets/OpsScreen-C955zgr3.js +1 -0
  121. package/dist/client/assets/OpsSubnav-CjMVj7Sk.js +1 -0
  122. package/dist/client/assets/ProjectAgentProfile-B1VqGSmu.js +1 -0
  123. package/dist/client/assets/{ProjectAgentProfileBar-DHuMKJj-.js → ProjectAgentProfileBar-DhVU7zew.js} +1 -1
  124. package/dist/client/assets/ProjectAgentProfileHero-CJk-Dx4t.js +1 -0
  125. package/dist/client/assets/ProjectsInbox-B7kap8nR.js +2 -0
  126. package/dist/client/assets/ProjectsRail-BhSaqbv0.js +1 -0
  127. package/dist/client/assets/ProjectsScreen-CSb7nwjb.js +1 -0
  128. package/dist/client/assets/ProjectsThreadAside-pEJutIO8.js +1 -0
  129. package/dist/client/assets/{Provider-C35yu29I.js → Provider-BEXAZWd9.js} +2 -2
  130. package/dist/client/assets/{RailRow-BjmWK420.js → RailRow-Ddz90weI.js} +1 -1
  131. package/dist/client/assets/RawSessionsTable-TdKlJIPl.js +1 -0
  132. package/dist/client/assets/RealtimeVoiceScreen-BU5KmlNo.js +8 -0
  133. package/dist/client/assets/{RenderedWorkerSprite-Dhlyg89J.js → RenderedWorkerSprite-BNhFXMIo.js} +1 -1
  134. package/dist/client/assets/{ReplayClock-348f17bW.js → ReplayClock-wLpb4VqN.js} +1 -1
  135. package/dist/client/assets/{ReplayLog-CBnAM3ui.js → ReplayLog-IUyQdklN.js} +1 -1
  136. package/dist/client/assets/{ReplayOutpost-DyRPfNFx.js → ReplayOutpost-C4djhjZJ.js} +1 -1
  137. package/dist/client/assets/{RepoDiffEmbedScreen-BWxvRDrS.js → RepoDiffEmbedScreen-BmQX_8E-.js} +1 -1
  138. package/dist/client/assets/{RepoDiffPageScreen-DN94irmY.js → RepoDiffPageScreen-B9oAjrC6.js} +1 -1
  139. package/dist/client/assets/{RepoDiffViewer-_4JVXBIW.js → RepoDiffViewer-Ch_lIMt-.js} +1 -1
  140. package/dist/client/assets/RepoDiffViewerLazy-DL6A2o_z.js +2 -0
  141. package/dist/client/assets/{ReposScreen-uMCpt0e9.js → ReposScreen-D-E7fSAB.js} +2 -2
  142. package/dist/client/assets/{RiggedWorkerCharacter-q6QRc7_o.js → RiggedWorkerCharacter-CF6fhzGd.js} +1 -1
  143. package/dist/client/assets/{SageModelStudio-CNDhZhgD.js → SageModelStudio-CSet_ITs.js} +1 -1
  144. package/dist/client/assets/{ScoutDeckSurface-CUaU4R6T.js → ScoutDeckSurface-BJ-fl8AX.js} +1 -1
  145. package/dist/client/assets/{ScoutSurface-3_25USO_.js → ScoutSurface-BvFRdce6.js} +1 -1
  146. package/dist/client/assets/{ScoutbotFxLab-CRqhYe0a.js → ScoutbotFxLab-CfPzycZ7.js} +1 -1
  147. package/dist/client/assets/{SecondaryNav-D7dbV2qo.js → SecondaryNav-1FjBDWuY.js} +1 -1
  148. package/dist/client/assets/{SessionContextStrip-CXfs9hUD.js → SessionContextStrip-BoiIxXvS.js} +1 -1
  149. package/dist/client/assets/{SessionEmbedScreen-D0zFmou-.js → SessionEmbedScreen-BizGNGOz.js} +1 -1
  150. package/dist/client/assets/{SessionHopMenu-E6VJZrE0.js → SessionHopMenu-DX6PJPNk.js} +1 -1
  151. package/dist/client/assets/{SessionObserve-DXxBvejJ.js → SessionObserve-Dw3bVQYF.js} +1 -1
  152. package/dist/client/assets/{SessionObserveEvidence-Cuj_KHxR.js → SessionObserveEvidence-uD1OX-R5.js} +1 -1
  153. package/dist/client/assets/SessionRefScreen-Ch9H-qVk.js +1 -0
  154. package/dist/client/assets/SessionsScreen-DUeP23Xy.js +1 -0
  155. package/dist/client/assets/{SettingsDrawer-juCpnbH6.js → SettingsDrawer-BVrP6J52.js} +3 -3
  156. package/dist/client/assets/SettingsScreen-BcJ05LE5.js +1 -0
  157. package/dist/client/assets/{SharedFloorCharacter-DNEiaOUh.js → SharedFloorCharacter-dnamlt1p.js} +1 -1
  158. package/dist/client/assets/SharedWorkFloor-H-e2TVj9.js +2 -0
  159. package/dist/client/assets/{ShikiPane-CRtTYkMj.js → ShikiPane-CDiIT_qn.js} +1 -1
  160. package/dist/client/assets/{SlidePanel-_CHAQdOa.js → SlidePanel-D5oPQocF.js} +1 -1
  161. package/dist/client/assets/{SpaceSwitcher-BLgSCf_T.js → SpaceSwitcher-WccPJ0fS.js} +1 -1
  162. package/dist/client/assets/{SpriteAvatar-CpZWf54-.js → SpriteAvatar-D53GaaK3.js} +1 -1
  163. package/dist/client/assets/{SproutActionSprite-BSiTS4en.js → SproutActionSprite-BrFCmgWS.js} +1 -1
  164. package/dist/client/assets/{StatusPill-2gCP6H7A.js → StatusPill-jT--OXbn.js} +1 -1
  165. package/dist/client/assets/{TailView-CYSijNTy.js → TailView-B44cSuyl.js} +2 -2
  166. package/dist/client/assets/Terminal-D0PanmIk.js +4 -0
  167. package/dist/client/assets/TerminalEmbedScreen-Eddi4sts.js +1 -0
  168. package/dist/client/assets/{TerminalHeaderMount-Cq4OD_xN.js → TerminalHeaderMount-CYYcKxQ-.js} +1 -1
  169. package/dist/client/assets/{TextDocumentSurface-D52m7Vd8.js → TextDocumentSurface-DBslUq9k.js} +1 -1
  170. package/dist/client/assets/{TmuxPeek-CXFeweMg.js → TmuxPeek-Ctw5yYO5.js} +1 -1
  171. package/dist/client/assets/{VoiceControlWell-DF3bjcYA.js → VoiceControlWell-BkjuWjYu.js} +1 -1
  172. package/dist/client/assets/{VoicePathDiagram-CmpHWfO-.js → VoicePathDiagram-u0i6ntbx.js} +1 -1
  173. package/dist/client/assets/{VoicePermissionsPanel-Ok2nfxHw.js → VoicePermissionsPanel-9Nuw-xCr.js} +1 -1
  174. package/dist/client/assets/{VoiceTurnDetails-wAByRaNB.js → VoiceTurnDetails-kS7lfbmt.js} +1 -1
  175. package/dist/client/assets/{VoiceTurnStage-edoJalLV.js → VoiceTurnStage-DLY6aYDg.js} +1 -1
  176. package/dist/client/assets/{VoiceTurnView-D-8g5E4r.js → VoiceTurnView-CF4tIldB.js} +1 -1
  177. package/dist/client/assets/{WorkDetailScreen-zQkNVy2F.js → WorkDetailScreen-BrrkENYq.js} +2 -2
  178. package/dist/client/assets/{WorkFilesViewer-vNt01sDd.js → WorkFilesViewer-B63sKRYZ.js} +1 -1
  179. package/dist/client/assets/{WorkRunView-BDkR7Edq.js → WorkRunView-DLIzAsc3.js} +1 -1
  180. package/dist/client/assets/WorldActorTalk-CHhFTiQV.js +1 -0
  181. package/dist/client/assets/{WorldCharacter-CIIlutQq.js → WorldCharacter-CJGx2DVy.js} +1 -1
  182. package/dist/client/assets/{WorldMinimap-B6HNgcDe.js → WorldMinimap-DL12pBw3.js} +1 -1
  183. package/dist/client/assets/{WorldSky-Jm2Z6dfW.js → WorldSky-BlPNvGLo.js} +1 -1
  184. package/dist/client/assets/{activity-CIlFrfPJ.js → activity-CXkZ620t.js} +1 -1
  185. package/dist/client/assets/{addon-fit-dFpj9Kfq.js → addon-fit-G3qi01sy.js} +1 -1
  186. package/dist/client/assets/{addon-webgl-BFCGRtGh.js → addon-webgl-Bo7kSgOB.js} +1 -1
  187. package/dist/client/assets/{agent-essentials-BGGvT5G6.js → agent-essentials-DnfdGmIX.js} +1 -1
  188. package/dist/client/assets/{agent-specialization-DDc7mLCW.js → agent-specialization-DYX_DSlY.js} +1 -1
  189. package/dist/client/assets/{arc.es-C1SQHJ3k.js → arc.es-CLA3XI14.js} +1 -1
  190. package/dist/client/assets/arrow-down--OUDFWIq.js +1 -0
  191. package/dist/client/assets/{arrow-left-MVUKauwQ.js → arrow-left-DNjQHf4C.js} +1 -1
  192. package/dist/client/assets/{arrow-right-Bp-FpE5V.js → arrow-right-A_yyXwoH.js} +1 -1
  193. package/dist/client/assets/arrow-up-DFy-9ghF.js +1 -0
  194. package/dist/client/assets/{arrow-up-right-BPedAgxO.js → arrow-up-right-DUW1A1Hb.js} +1 -1
  195. package/dist/client/assets/{book-open-CV98WMSp.js → book-open-B_idZgTF.js} +1 -1
  196. package/dist/client/assets/{bot-B4zLQ4IN.js → bot-BNv_ZJzi.js} +1 -1
  197. package/dist/client/assets/{chat-api-DSJMBYoT.js → chat-api-BHGHALv2.js} +1 -1
  198. package/dist/client/assets/{chat-message-markup-91DIry6R.js → chat-message-markup-esR-YLtN.js} +1 -1
  199. package/dist/client/assets/{chat-transport-DNS5CB2I.js → chat-transport-CtxnPLMU.js} +1 -1
  200. package/dist/client/assets/{check-lrJ3a73a.js → check-BM6QtbB7.js} +1 -1
  201. package/dist/client/assets/{chevron-down-l1mrh5S9.js → chevron-down-DEDSNJNY.js} +1 -1
  202. package/dist/client/assets/{chevron-right-DrfqcerI.js → chevron-right-B02kAw12.js} +1 -1
  203. package/dist/client/assets/{chevron-up-CETZJzjV.js → chevron-up-CzveykKG.js} +1 -1
  204. package/dist/client/assets/{chunk-HRAB3GC3-DbVLgbWX.js → chunk-HRAB3GC3-DVhUsgOw.js} +1 -1
  205. package/dist/client/assets/chunk-JTPDIGGW-hdpdYwXb.js +46 -0
  206. package/dist/client/assets/chunk-T65CQEWV-G_Z0lqtn.js +1 -0
  207. package/dist/client/assets/chunk-YOZR3KYS-apgUnfXh.js +2 -0
  208. package/dist/client/assets/{clock-BV1aqPkK.js → clock-8tb9t2t9.js} +1 -1
  209. package/dist/client/assets/{code-xml-BhcNbLWU.js → code-xml-E9gBuiVs.js} +1 -1
  210. package/dist/client/assets/{coffee-D7EAOdCk.js → coffee-D0YEK6-l.js} +1 -1
  211. package/dist/client/assets/{compass-63TUaz5_.js → compass-EmGkpxIe.js} +1 -1
  212. package/dist/client/assets/content-B-rn1rka.js +1 -0
  213. package/dist/client/assets/content-BHV-ZU8_.js +1 -0
  214. package/dist/client/assets/content-BI9yWpWC.js +1 -0
  215. package/dist/client/assets/content-BLVuukzF.js +1 -0
  216. package/dist/client/assets/content-BP3cQkAj.js +1 -0
  217. package/dist/client/assets/content-BRY-UTkP.js +1 -0
  218. package/dist/client/assets/content-BXTmYOPB.js +1 -0
  219. package/dist/client/assets/content-C3DZ77HZ.js +1 -0
  220. package/dist/client/assets/content-CPchclaV.js +1 -0
  221. package/dist/client/assets/{content-nGlEZhUI.js → content-CVqPTQnr.js} +1 -1
  222. package/dist/client/assets/content-CjAERU44.js +1 -0
  223. package/dist/client/assets/content-CoYG0nWL.js +1 -0
  224. package/dist/client/assets/content-DK1KeRPw.js +1 -0
  225. package/dist/client/assets/content-iWBSSXa6.js +1 -0
  226. package/dist/client/assets/content-ryJeaQk8.js +1 -0
  227. package/dist/client/assets/content-srNyLgDt.js +1 -0
  228. package/dist/client/assets/{conversation-icons-Tqba2d56.js → conversation-icons-Dxn9N1Kx.js} +1 -1
  229. package/dist/client/assets/conversation-motion-features-BfmPlONx.js +1 -0
  230. package/dist/client/assets/{copy-xKeM5ZtU.js → copy-C1XrY27_.js} +1 -1
  231. package/dist/client/assets/{cpu-BOTa_WLr.js → cpu-DVZ_LhPn.js} +1 -1
  232. package/dist/client/assets/{createLucideIcon-zZ8Hx7er.js → createLucideIcon-CKbjXlwv.js} +1 -1
  233. package/dist/client/assets/direct-voice-DAOUU-kc.js +10 -0
  234. package/dist/client/assets/discover-BNa3BPr_.js +2 -0
  235. package/dist/client/assets/embed-entry-gK3z8Yxi.js +2 -0
  236. package/dist/client/assets/{external-link-CUObqmgX.js → external-link-Df1R34rX.js} +1 -1
  237. package/dist/client/assets/{eye-LrO-cXQt.js → eye-CD-_aphP.js} +1 -1
  238. package/dist/client/assets/{file-code-corner-CsU7jJpu.js → file-code-corner-DtMWHBN3.js} +1 -1
  239. package/dist/client/assets/{file-text-CnISiiw6.js → file-text-BOJQiS8p.js} +1 -1
  240. package/dist/client/assets/{flag-C4wl8z2-.js → flag-CeKO8NoD.js} +1 -1
  241. package/dist/client/assets/{folder-D5prSkzz.js → folder-C2emmTHq.js} +1 -1
  242. package/dist/client/assets/{gauge-D9_5iJEm.js → gauge-BR5CrhRM.js} +1 -1
  243. package/dist/client/assets/{gestures-QZub3Ot9.js → gestures-Dh8szhcU.js} +1 -1
  244. package/dist/client/assets/{git-branch-B0_fPLO7.js → git-branch-C45vy8qT.js} +1 -1
  245. package/dist/client/assets/{go-shortcuts-DicR7sUf.js → go-shortcuts--25Qg0lD.js} +1 -1
  246. package/dist/client/assets/{home-moving-signal-rpMhsOJB.js → home-moving-signal-BiiyEKEb.js} +1 -1
  247. package/dist/client/assets/home-now-card-DaCpqUZe.js +1 -0
  248. package/dist/client/assets/{home-now-card-nano-B5Dv3-pb.js → home-now-card-nano-wbxgyY4q.js} +1 -1
  249. package/dist/client/assets/hooks-JNwYSH18.js +2 -0
  250. package/dist/client/assets/{index-EsrkGBcv.js → index-BFbLvCJn.js} +2 -2
  251. package/dist/client/assets/index-BRNHY2fp.css +1 -0
  252. package/dist/client/assets/index-BrXaMEdK.js +1 -0
  253. package/dist/client/assets/index-CXzJ_hGx.js +1 -0
  254. package/dist/client/assets/{index-CHD0qcfL.js → index-V8FYEUpD.js} +1 -1
  255. package/dist/client/assets/index-mYtyYeAe.js +1 -0
  256. package/dist/client/assets/{inspector-panel-BkgUDn6G.js → inspector-panel-BgU5xUln.js} +2 -2
  257. package/dist/client/assets/{keyboard-nav-DDHegDbx.js → keyboard-nav-CEe-ApvZ.js} +1 -1
  258. package/dist/client/assets/{lane-roster-store-D-RSWjb-.js → lane-roster-store-MraynTHP.js} +1 -1
  259. package/dist/client/assets/{layers-C8PDiMul.js → layers-ClmyjwpB.js} +1 -1
  260. package/dist/client/assets/{layout-grid-Cor2frzj.js → layout-grid-DG2-JaPn.js} +1 -1
  261. package/dist/client/assets/left-B66YR0c5.js +1 -0
  262. package/dist/client/assets/left-BP5P8lzw.js +2 -0
  263. package/dist/client/assets/left-BbCKRDbW.js +1 -0
  264. package/dist/client/assets/left-CaY5FK2k.js +1 -0
  265. package/dist/client/assets/left-CemrfeSs.js +1 -0
  266. package/dist/client/assets/left-DcYA26sH.js +1 -0
  267. package/dist/client/assets/left-DdMMaqFT.js +2 -0
  268. package/dist/client/assets/left-advisor-DBml48M5.js +1 -0
  269. package/dist/client/assets/left-agents-DowYF2ag.js +1 -0
  270. package/dist/client/assets/left-default-Bifaeg_V.js +1 -0
  271. package/dist/client/assets/left-lanes-BGhjdqpD.js +1 -0
  272. package/dist/client/assets/left-mission-CvXPUovR.js +1 -0
  273. package/dist/client/assets/library-CnC8uzJt.js +1 -0
  274. package/dist/client/assets/{loader-circle-OvccU82H.js → loader-circle-CCG7hG7z.js} +1 -1
  275. package/dist/client/assets/{local-agents-BqnoxJrq.js → local-agents-BMcFlY_x.js} +1 -1
  276. package/dist/client/assets/{log-in-7SnYqW5w.js → log-in-VL9mdgeE.js} +1 -1
  277. package/dist/client/assets/{machine-children-DxcqCLmd.js → machine-children-DvCiQxwA.js} +1 -1
  278. package/dist/client/assets/{mentions-ByUvhS-v.js → mentions-s5oW4aQU.js} +1 -1
  279. package/dist/client/assets/{mesh-ops-CiZ8xSAx.js → mesh-ops-9SzD3sPw.js} +1 -1
  280. package/dist/client/assets/{mesh-view-store-DZvJC4KU.js → mesh-view-store-CVqzYz4K.js} +1 -1
  281. package/dist/client/assets/{message-circle-CxRVKNE-.js → message-circle-BB3rFCVD.js} +1 -1
  282. package/dist/client/assets/{message-markup-Zwo3t4cI.js → message-markup-D1C7GzHo.js} +1 -1
  283. package/dist/client/assets/{message-square-BxesYglW.js → message-square-BwqBIfv5.js} +1 -1
  284. package/dist/client/assets/{mission-control-store-elEEsIvb.js → mission-control-store-e8F85JhP.js} +1 -1
  285. package/dist/client/assets/{monitor-DTTYEb73.js → monitor-M0VSmHQ-.js} +1 -1
  286. package/dist/client/assets/{nav-destinations-uorRqFxf.js → nav-destinations-B3R5zxFX.js} +1 -1
  287. package/dist/client/assets/{observe-BJqERJVj.js → observe-M3rLosT5.js} +1 -1
  288. package/dist/client/assets/{page-status-BswZLqvA.js → page-status-BIuh3C5p.js} +1 -1
  289. package/dist/client/assets/{panel-right-Bv7sP_fc.js → panel-right-WKLdPm0F.js} +1 -1
  290. package/dist/client/assets/{paperclip-BjcuP_Hx.js → paperclip-DLf_ABSv.js} +1 -1
  291. package/dist/client/assets/{pause-C2XTlkjs.js → pause-7mmEEvVx.js} +1 -1
  292. package/dist/client/assets/{persistent-state-KRk_yb0q.js → persistent-state-3mbBFRDO.js} +1 -1
  293. package/dist/client/assets/{pin-C2mFOV1l.js → pin-q_0gAA6i.js} +1 -1
  294. package/dist/client/assets/{play-FT6K3It1.js → play-N5-hnPCV.js} +1 -1
  295. package/dist/client/assets/{plus-DFDDeGKu.js → plus-B0hdY0fF.js} +1 -1
  296. package/dist/client/assets/profile-B7ZGToTo.js +1 -0
  297. package/dist/client/assets/{projects-inbox-C0FUCv_p.js → projects-inbox-CMFBjQt0.js} +1 -1
  298. package/dist/client/assets/{proxy-AJsmwA6h.js → proxy-k0ILOVkK.js} +1 -1
  299. package/dist/client/assets/{radio-DRoOZsws.js → radio-Bjqmv997.js} +1 -1
  300. package/dist/client/assets/{refresh-cw-BmVr7sCD.js → refresh-cw-BcqctLqo.js} +1 -1
  301. package/dist/client/assets/resolve-panes-wzGu9d8o.js +1 -0
  302. package/dist/client/assets/resolve-sidebar-context-C8SOo5oZ.js +1 -0
  303. package/dist/client/assets/right-9rMRZN_r.js +1 -0
  304. package/dist/client/assets/right-BHZq648O.js +1 -0
  305. package/dist/client/assets/{right-DWPVB-nK.js → right-BNJzCaH9.js} +1 -1
  306. package/dist/client/assets/right-CAd7lTvY.js +1 -0
  307. package/dist/client/assets/right-Cc57bCTW.js +1 -0
  308. package/dist/client/assets/right-DY49Prjj.js +1 -0
  309. package/dist/client/assets/right-DfU47xKY.js +1 -0
  310. package/dist/client/assets/right-Dr7vxdZl.js +1 -0
  311. package/dist/client/assets/right-DsE4aR3A.js +1 -0
  312. package/dist/client/assets/right-zlkRjnkv.js +1 -0
  313. package/dist/client/assets/{rocket-CGl4RTV7.js → rocket-BahsdUe6.js} +1 -1
  314. package/dist/client/assets/router-CJIx83Ia.js +1 -0
  315. package/dist/client/assets/runtime-picker-IRcTkMZ5.js +1 -0
  316. package/dist/client/assets/{scope-views-RUWwCVAr.js → scope-views-KDtZoLUC.js} +1 -1
  317. package/dist/client/assets/{scout-voice-CZx60X6E.js → scout-voice-Cdh6pCsb.js} +1 -1
  318. package/dist/client/assets/{scoutbot-markdown-BKEBSbG0.js → scoutbot-markdown-7PRQHaAc.js} +1 -1
  319. package/dist/client/assets/{scroll-text-DNjxhyO2.js → scroll-text-CA0QxBHu.js} +1 -1
  320. package/dist/client/assets/{search-DT42oyRW.js → search-Bv2IONmc.js} +1 -1
  321. package/dist/client/assets/secondaryNavConfig-Bmb-oRvD.js +1 -0
  322. package/dist/client/assets/{selection-bridge-x3wFUjxj.js → selection-bridge-CthAuPRw.js} +1 -1
  323. package/dist/client/assets/{send-horizontal-CH0-fbZE.js → send-horizontal-_Tf_It04.js} +1 -1
  324. package/dist/client/assets/{send-to-agent-session-DoKCDBJ4.js → send-to-agent-session-CWDHHgFB.js} +1 -1
  325. package/dist/client/assets/{server-QfsgMLk1.js → server-U_l8A83n.js} +1 -1
  326. package/dist/client/assets/{session-catalog-CvSdPHPe.js → session-catalog-Dx4tl3sx.js} +1 -1
  327. package/dist/client/assets/{session-recap-queue-41l2XVkI.js → session-recap-queue-GeicPLsQ.js} +1 -1
  328. package/dist/client/assets/{session-table-L-pns6Zl.js → session-table-BI62J4NP.js} +1 -1
  329. package/dist/client/assets/{sessions-view-Dc-QAa7O.js → sessions-view-lGMwwZY7.js} +1 -1
  330. package/dist/client/assets/{settings-BVh7kldq.js → settings-bo9X410k.js} +1 -1
  331. package/dist/client/assets/{sliders-horizontal-782VC_yy.js → sliders-horizontal-CPSx6wd2.js} +1 -1
  332. package/dist/client/assets/{sparkles-BjHq_DNK.js → sparkles-Br-bA2aZ.js} +1 -1
  333. package/dist/client/assets/{sse-BCPRocpq.js → sse-BVxO0zNp.js} +1 -1
  334. package/dist/client/assets/{tail-events-d0yAYxR0.js → tail-events-C6NWFB1N.js} +1 -1
  335. package/dist/client/assets/{terminal-hQKQygcf.js → terminal-DMBAZjPP.js} +1 -1
  336. package/dist/client/assets/{terminal-relay-Bxs1hp-j.js → terminal-relay-CpGHpDa8.js} +1 -1
  337. package/dist/client/assets/{terminal-takeover-Ay5C2c-M.js → terminal-takeover-CXwdoZ5j.js} +1 -1
  338. package/dist/client/assets/{triangle-alert-CHoRGdVO.js → triangle-alert-BZikHKuT.js} +1 -1
  339. package/dist/client/assets/use-beside-DopIbJwf.js +1 -0
  340. package/dist/client/assets/{use-conversation-list-CY4JciOV.js → use-conversation-list-CGtcpdPd.js} +1 -1
  341. package/dist/client/assets/{use-fleet-active-asks-CymmXWH4.js → use-fleet-active-asks-DAHOPYPV.js} +1 -1
  342. package/dist/client/assets/{use-mesh-node-state-BvaqtODo.js → use-mesh-node-state-BlWIPTc4.js} +1 -1
  343. package/dist/client/assets/{use-mesh-ops-items-BSYaqH_0.js → use-mesh-ops-items-pKWBro7o.js} +1 -1
  344. package/dist/client/assets/{use-reduced-motion-3gMYZNIp.js → use-reduced-motion-DkdIQBwh.js} +1 -1
  345. package/dist/client/assets/use-scout-dev-flags-CduUFb7l.js +1 -0
  346. package/dist/client/assets/{useAgentHoverCard-BANmpjMh.js → useAgentHoverCard-DNlXPYQf.js} +1 -1
  347. package/dist/client/assets/useContentSecondaryNav-LJGNYG3U.js +1 -0
  348. package/dist/client/assets/{useEmbedHeadline-D6pJRxUg.js → useEmbedHeadline-BeeBDb7E.js} +1 -1
  349. package/dist/client/assets/{usePierreRuntime-BAQdiN0L.js → usePierreRuntime-DUXZ-DTK.js} +1 -1
  350. package/dist/client/assets/useSidebarCollapse-DoMvU_2R.js +1 -0
  351. package/dist/client/assets/{users-BUjx36gx.js → users-BQPEIUfd.js} +1 -1
  352. package/dist/client/assets/{wrench-DR0i5BU7.js → wrench-C-wjicn5.js} +1 -1
  353. package/dist/client/assets/{x-DAehov0E.js → x-BcfhXYiF.js} +1 -1
  354. package/dist/client/assets/{xterm-BXQiLVnI.js → xterm-qXD45dc0.js} +1 -1
  355. package/dist/client/assets/{zap-CEjZNZbI.js → zap-BqL8ttGz.js} +1 -1
  356. package/dist/client/index.html +2 -2
  357. package/dist/main.mjs +1 -1
  358. package/package.json +29 -5
  359. package/server.json +31 -0
  360. package/dist/client/assets/ActivityScreen-CZmGwQ2U.js +0 -1
  361. package/dist/client/assets/AgentAdventures-BAgxdOF8.js +0 -1
  362. package/dist/client/assets/AgentConfigurationScreen-1L0IQm2w.js +0 -1
  363. package/dist/client/assets/AgentDefinitionsWorkspace-DguGs7jZ.js +0 -1
  364. package/dist/client/assets/AgentFloorView-DH4jiDgw.js +0 -1
  365. package/dist/client/assets/AgentInfoScreen-DYtmKkeE.js +0 -1
  366. package/dist/client/assets/AgentLanesEmbedScreen-BlSof_6S.js +0 -1
  367. package/dist/client/assets/AgentMasterScreen-EJhmuKgl.js +0 -1
  368. package/dist/client/assets/AgentsConsole-RXGqRvcb.js +0 -1
  369. package/dist/client/assets/AgentsScreen-ChwMBs11.js +0 -1
  370. package/dist/client/assets/AgentsSubnav-DwNX4yy0.js +0 -1
  371. package/dist/client/assets/BriefingDetailScreen-DrlC3qkm.js +0 -1
  372. package/dist/client/assets/BrokerScreen-DwOF6bMA.js +0 -8
  373. package/dist/client/assets/Canvas-X9pVSkw3.js +0 -1
  374. package/dist/client/assets/ChannelComposer-DoK7IDGa.js +0 -1
  375. package/dist/client/assets/ChatRightPanel-C1h_aIkn.js +0 -1
  376. package/dist/client/assets/ChatSpaceSurface-BXyLYKHn.js +0 -1
  377. package/dist/client/assets/ConversationComposer-CUQyArlk.js +0 -1
  378. package/dist/client/assets/ConversationFeedRows-DWiOfT-y.js +0 -1
  379. package/dist/client/assets/ConversationHeader-C-ZWscKj.js +0 -1
  380. package/dist/client/assets/ConversationScreen-CUfsQ4MR.js +0 -2
  381. package/dist/client/assets/ConversationStatus--IPm2nGh.js +0 -1
  382. package/dist/client/assets/FlightObserveScreen-DZ2mrw91.js +0 -1
  383. package/dist/client/assets/FloorResourcesSheet-C-kQ6Ren.js +0 -1
  384. package/dist/client/assets/HarnessesScreen-DX3NLcDG.js +0 -1
  385. package/dist/client/assets/KnowledgeSearchScreen-Dd6jrQ0A.js +0 -1
  386. package/dist/client/assets/LaneTraceDetailSheet-DYrd0BIf.js +0 -1
  387. package/dist/client/assets/MeshScreen-8nAzQVbm.js +0 -1
  388. package/dist/client/assets/MessagesScreen-C3WB4T21.js +0 -1
  389. package/dist/client/assets/MissionControlView-B9cNPXvl.js +0 -1
  390. package/dist/client/assets/MissionLeftAgentRow-vycMV77n.js +0 -1
  391. package/dist/client/assets/NativeAreaScreen-B1RLa85C.js +0 -1
  392. package/dist/client/assets/NativeAreaScreen-CV0OhGra.js +0 -1
  393. package/dist/client/assets/NativeAreaScreen-CzuZt6o1.js +0 -1
  394. package/dist/client/assets/OpenScoutAppShell-37PDFfA4.js +0 -31
  395. package/dist/client/assets/OpsAgentsView-DajlX8LO.js +0 -1
  396. package/dist/client/assets/OpsScreen-jVcaBKGi.js +0 -1
  397. package/dist/client/assets/OpsSubnav-BOOYShHE.js +0 -1
  398. package/dist/client/assets/ProjectAgentProfile-D_wlW4sQ.js +0 -1
  399. package/dist/client/assets/ProjectAgentProfileHero-Dbebtug1.js +0 -1
  400. package/dist/client/assets/ProjectsInbox-Cgu7B4--.js +0 -2
  401. package/dist/client/assets/ProjectsRail-CDWocin_.js +0 -1
  402. package/dist/client/assets/ProjectsScreen-B_CJycqW.js +0 -1
  403. package/dist/client/assets/ProjectsThreadAside-1MMl_qUD.js +0 -1
  404. package/dist/client/assets/RawSessionsTable-DzT90hWu.js +0 -1
  405. package/dist/client/assets/RealtimeVoiceScreen-B6ylX3WQ.js +0 -16
  406. package/dist/client/assets/RepoDiffViewerLazy-XGVC3WXv.js +0 -2
  407. package/dist/client/assets/SessionRefScreen-DqLSUlCE.js +0 -1
  408. package/dist/client/assets/SessionsScreen-BLIRkohT.js +0 -1
  409. package/dist/client/assets/SettingsScreen-BtGzE2-O.js +0 -1
  410. package/dist/client/assets/SharedWorkFloor-D9mf9KSg.js +0 -2
  411. package/dist/client/assets/Terminal-Bi97yb5s.js +0 -4
  412. package/dist/client/assets/TerminalEmbedScreen-Bqop67Bq.js +0 -1
  413. package/dist/client/assets/TerminalRelay-DrikpUSJ.js +0 -46
  414. package/dist/client/assets/WorldActorTalk-BvSg_b1y.js +0 -1
  415. package/dist/client/assets/content-B1lgE8qr.js +0 -1
  416. package/dist/client/assets/content-B5l11YyQ.js +0 -1
  417. package/dist/client/assets/content-BNZOZEpX.js +0 -1
  418. package/dist/client/assets/content-BRIxP155.js +0 -1
  419. package/dist/client/assets/content-BWd8gt8L.js +0 -1
  420. package/dist/client/assets/content-BfwS2jAK.js +0 -1
  421. package/dist/client/assets/content-C4p43_eT.js +0 -1
  422. package/dist/client/assets/content-CdYfaoDV.js +0 -1
  423. package/dist/client/assets/content-CzldLxw0.js +0 -1
  424. package/dist/client/assets/content-D-olnc4U.js +0 -1
  425. package/dist/client/assets/content-DTioimq4.js +0 -1
  426. package/dist/client/assets/content-LOebm3_d.js +0 -1
  427. package/dist/client/assets/content-oyzDM-LK.js +0 -1
  428. package/dist/client/assets/content-x1PHxED7.js +0 -1
  429. package/dist/client/assets/content-zX3ZY3T9.js +0 -1
  430. package/dist/client/assets/conversation-motion-features-C5zjuNwE.js +0 -1
  431. package/dist/client/assets/direct-voice-BbLPuJ04.js +0 -2
  432. package/dist/client/assets/discover-DJFxyV1k.js +0 -2
  433. package/dist/client/assets/embed-entry-Lyvu0Kfc.js +0 -2
  434. package/dist/client/assets/home-now-card-ByE6Umcx.js +0 -1
  435. package/dist/client/assets/hooks-_eCZZPsR.js +0 -2
  436. package/dist/client/assets/index-724SdE6r.js +0 -1
  437. package/dist/client/assets/index-CN4rBB_s.css +0 -1
  438. package/dist/client/assets/index-D1d98iYf.js +0 -1
  439. package/dist/client/assets/index-gGHPA-By.js +0 -1
  440. package/dist/client/assets/left-Bn5X7x2o.js +0 -2
  441. package/dist/client/assets/left-BqS0fYX1.js +0 -1
  442. package/dist/client/assets/left-CTCeeeD3.js +0 -1
  443. package/dist/client/assets/left-DhtVPVux.js +0 -1
  444. package/dist/client/assets/left-K39b-Wvx.js +0 -2
  445. package/dist/client/assets/left-KGmueNPt.js +0 -1
  446. package/dist/client/assets/left-P_GOYB-s.js +0 -1
  447. package/dist/client/assets/left-advisor-B0N47De2.js +0 -1
  448. package/dist/client/assets/left-agents-CsSNc51Y.js +0 -1
  449. package/dist/client/assets/left-default-BlO5LP2T.js +0 -1
  450. package/dist/client/assets/left-lanes-C4PhaJE6.js +0 -1
  451. package/dist/client/assets/left-mission-BjTE5vPa.js +0 -1
  452. package/dist/client/assets/library-CkWNPHRp.js +0 -1
  453. package/dist/client/assets/profile-DTmzN16I.js +0 -1
  454. package/dist/client/assets/provider-Dojd8quC.js +0 -1
  455. package/dist/client/assets/resolve-panes-pbY1fCWi.js +0 -1
  456. package/dist/client/assets/resolve-sidebar-context-YWkZTq1t.js +0 -1
  457. package/dist/client/assets/right-49kO-6nD.js +0 -1
  458. package/dist/client/assets/right-APtItA8A.js +0 -1
  459. package/dist/client/assets/right-BJwhPqtn.js +0 -1
  460. package/dist/client/assets/right-BPqrf4ek.js +0 -1
  461. package/dist/client/assets/right-D7djOy6K.js +0 -1
  462. package/dist/client/assets/right-DKOUCRob.js +0 -1
  463. package/dist/client/assets/right-DMNrVzg7.js +0 -1
  464. package/dist/client/assets/right-DppeMCy4.js +0 -1
  465. package/dist/client/assets/right-GAL5Mw1v.js +0 -1
  466. package/dist/client/assets/router-DCtl8wqb.js +0 -1
  467. package/dist/client/assets/runtime-picker-DXu2bOTh.js +0 -1
  468. package/dist/client/assets/secondaryNavConfig-CS1svh6n.js +0 -1
  469. package/dist/client/assets/use-beside-DoRC1nt0.js +0 -1
  470. package/dist/client/assets/use-scout-dev-flags-DS_pYYQd.js +0 -1
  471. package/dist/client/assets/useContentSecondaryNav-C6OBu-3_.js +0 -1
  472. package/dist/client/assets/usePersistentState-B8lP7TRb.js +0 -1
  473. package/dist/client/assets/useSidebarCollapse-OL_8J5cL.js +0 -1
@@ -0,0 +1,4 @@
1
+ import{r as i,j as s,T as Ps,U as zs}from"./index-BFbLvCJn.js";/* empty css */import{a as _s,u as Lt}from"./Provider-BEXAZWd9.js";import{a as Oe}from"./api-DSqpVKC7.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-CpGHpDa8.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-3RfJpen8.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-H2mmxeTK.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-BI62J4NP.js";import{i as or,c as Ht}from"./agent-state-DDhnFEEP.js";import{b as cr}from"./keyboard-nav-CEe-ApvZ.js";import{T as dr}from"./chunk-JTPDIGGW-hdpdYwXb.js";import{u as is}from"./chunk-YOZR3KYS-apgUnfXh.js";import{q as ur}from"./terminal-takeover-CXwdoZ5j.js";import{t as mr}from"./time-Dhsh_2EG.js";import{B as Qe}from"./BackToPicker-BPU7kbXq.js";import{T as qt}from"./TmuxPeek-Ctw5yYO5.js";import{TerminalHeaderMount as Ts}from"./TerminalHeaderMount-CYYcKxQ-.js";import{R as Yt}from"./refresh-cw-BcqctLqo.js";import{P as Ue}from"./plus-B0hdY0fF.js";import{c as qs}from"./createLucideIcon-CKbjXlwv.js";import{T as ue}from"./terminal-DMBAZjPP.js";import{L as Ys}from"./log-in-VL9mdgeE.js";import{Z as Vt}from"./zap-BqL8ttGz.js";import{S as pr}from"./runtime-picker-IRcTkMZ5.js";import{S as hr}from"./search-Bv2IONmc.js";import{X as Ze}from"./x-BcfhXYiF.js";import{E as fr}from"./eye-CD-_aphP.js";import{E as Jt}from"./external-link-Df1R34rX.js";const kr=[["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=qs("ellipsis",kr);const br=[["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"}]],Gt=qs("grid-2x2",br);const xr=[["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"}]],yr=qs("grip-horizontal",xr);var mt=["terminal:ack"];function Vs(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:[...mt],...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:[...mt],...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 Xt=6,Qt=2;function us(e){if(e.layout?.mode)return{mode:e.layout.mode,...e.layout.columns===void 0?{}:{columns:gr(e.layout.columns)}};const t=e.cellCount??0,n=ps(e.columns??Qt);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(Xt,a))}return ps(e.columns)}function gr(e){return e==="dynamic"?"dynamic":ps(e)}function jr(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)?Qt:Math.max(1,Math.min(Xt,Math.floor(e)))}const Js=6;function Sr(e="main",t="Main"){return{version:1,activeWorkspaceId:e,workspaces:[{id:e,name:t,tiles:[]}]}}function Gs(){return{version:1,activeWorkspaceId:"",workspaces:[]}}function pt(e,t,n={}){const a=()=>n.allowEmpty?Gs():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,Js)}function ht(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 ft(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?Gs():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 kt(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 bt(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 pt(e,kt,{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 pt({activeWorkspaceId:t[0]?.id??"",workspaces:t},kt,{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 xt={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?xt[o.toLowerCase()]??null:null;if(l&&!(!o&&l.endsWith(":")&&xt[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 yt(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(yt(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(yt(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 gt(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,jt=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=jt.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&&(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]),{panes:n,reading:c}}const ka=2e4,ba=200,$s=24,xa=4,St=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=St.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&&(St.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 wt(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}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=Vs({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(Ys,{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(yr,{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,Gs(),{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(bt(h),{sessions:A.sessions})));d.workspaces.length!==0&&u(h=>{let f=h;for(const R of d.workspaces)f=ht(f,bt(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&&gt(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?gt(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),wt(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:ft(d,h.id,{tiles:f,updatedAt:Date.now()})})},[u]),ss=i.useCallback(r=>{u(d=>d.activeWorkspaceId?ft(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=>ht(f,d));const h=Rs(d,{sessions:A.sessions});p.current.set(d.id,JSON.stringify(h)),wt(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:Js},(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(Ys,{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:Gt},{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(Gt,{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:[jr(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:Js},(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(Ys,{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=Vs({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=Vs({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 zi=Object.freeze(Object.defineProperty({__proto__:null,TerminalContent:pn,TerminalScreen:oi},Symbol.toStringTag,{value:"Module"}));export{pn as T,zi as a,Vs as u};
@@ -0,0 +1 @@
1
+ import{r as t,j as l,a as A,b as C,S as k}from"./index-BFbLvCJn.js";import{S as y,C as T}from"./Provider-BEXAZWd9.js";import{a as L}from"./api-DSqpVKC7.js";import{f as x}from"./machine-scope-DJt9RZ2w.js";import{i as R}from"./agent-state-DDhnFEEP.js";import{r as P,a as I}from"./router-CJIx83Ia.js";import{T as j}from"./Terminal-D0PanmIk.js";import{L as D,D as H}from"./theme-vars-DNK0nn3k.js";import"./sse-BVxO0zNp.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-D-VB5vdt.js";import"./runtime-picker-IRcTkMZ5.js";import"./scout-voice-Cdh6pCsb.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-CCG7hG7z.js";import"./createLucideIcon-CKbjXlwv.js";import"./media-blobs-Bi8pxr1u.js";import"./index-CXzJ_hGx.js";import"./HarnessMark-CP-PWk2W.js";import"./conversation-model-FxDeWlle.js";import"./time-Dhsh_2EG.js";import"./conversations-DoAAO6kA.js";import"./colors-CFlbwC25.js";import"./NewChatOrigin-BYsEu9dZ.js";import"./keyboard-nav-CEe-ApvZ.js";import"./x-BcfhXYiF.js";import"./chevron-down-DEDSNJNY.js";import"./search-Bv2IONmc.js";import"./file-text-BOJQiS8p.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-mxzPxQQW.js";import"./TextDocumentSurface-DBslUq9k.js";import"./index-V8FYEUpD.js";import"./chevron-right-B02kAw12.js";import"./folder-C2emmTHq.js";import"./chevron-up-CzveykKG.js";import"./code-xml-E9gBuiVs.js";import"./arrow-left-DNjQHf4C.js";import"./arrow-right-A_yyXwoH.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DVhUsgOw.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";/* empty css */import"./clipboard-e3fSpeo7.js";import"./terminal-relay-CpGHpDa8.js";import"./HerdrSession-H2mmxeTK.js";import"./chunk-YOZR3KYS-apgUnfXh.js";import"./arrow-up-DFy-9ghF.js";import"./arrow-down--OUDFWIq.js";import"./terminal-DMBAZjPP.js";import"./log-in-VL9mdgeE.js";import"./refresh-cw-BcqctLqo.js";import"./check-BM6QtbB7.js";import"./copy-C1XrY27_.js";import"./eye-CD-_aphP.js";import"./session-table-BI62J4NP.js";import"./chunk-JTPDIGGW-hdpdYwXb.js";import"./terminal-takeover-CXwdoZ5j.js";import"./BackToPicker-BPU7kbXq.js";import"./TmuxPeek-Ctw5yYO5.js";/* empty css */import"./TerminalHeaderMount-CYYcKxQ-.js";import"./plus-B0hdY0fF.js";import"./zap-BqL8ttGz.js";import"./external-link-Df1R34rX.js";function g(){const e=new URLSearchParams(window.location.search).get("route")?.trim()||"/terminal",s=P(e);return s.view==="terminal"?s:{view:"terminal"}}function S(o){const e=new URLSearchParams(window.location.search);return e.set("route",I(o)),e.has("profile")||e.set("profile","macos.terminal"),`${window.location.pathname}?${e.toString()}${window.location.hash}`}function Xt(){const[o,e]=t.useState(()=>g()),s=!!(o.terminalBackend||o.agentId||o.terminalSessionId||o.terminalSurfaceKey);t.useEffect(()=>{const i=()=>e(g());return window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)},[]);const n=t.useCallback(i=>{if(i.view!=="terminal"){const c={view:"terminal"},a=S(c);window.history.pushState(null,"",a),e(c);return}const p=S(i);window.history.pushState(null,"",p),e(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(j,{route:o,navigate:n})})})}function M({route:o,navigate:e,children:s}){const[n,i]=t.useState([]),[p,c]=t.useState({status:"checking",message:null,lastCheckedAt:null}),a=t.useRef(null),u=t.useMemo(()=>A(),[]),f=t.useMemo(()=>C(),[]),b=t.useMemo(()=>({...u==="light"?D:H,...f??{}}),[u,f]),w=t.useCallback(()=>{c({status:"online",message:null,lastCheckedAt:Date.now()})},[]),h=t.useCallback(r=>{c({status:"offline",message:x(r),lastCheckedAt:Date.now()})},[]),m=t.useCallback(async()=>{if(a.current)return a.current;const r=(async()=>{try{i(await L("/api/agents")),w()}catch(d){h(d)}})();a.current=r;try{await r}finally{a.current=null}},[h,w]);t.useEffect(()=>{m()},[m]),t.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=t.useMemo(()=>n.filter(r=>R(r.state)).length,[n]),E=t.useMemo(()=>({route:o,navigate:e,navigateBack:()=>{typeof window<"u"&&window.history.back()},canNavigateBack:typeof window<"u"&&window.history.length>1,agents:n,agentsLoaded:p.status!=="checking",onlineCount:v,apiConnection:p,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,p,e,v,m,o]);return l.jsx(y.Provider,{value:E,children:l.jsx("div",{"data-scout-theme":u,"data-scout-theme-mode":u,style:b,children:l.jsx(T,{children:s})})})}export{Xt as TerminalEmbedScreen};
@@ -1 +1 @@
1
- import{r as t,j as c}from"./index-EsrkGBcv.js";import{r as u}from"./index-724SdE6r.js";const i="scout-terminal-header-slot",d={crumb:"scout-terminal-header-crumb-slot",search:"scout-terminal-header-search-slot",actions:i},m=typeof window>"u"?t.useEffect:t.useLayoutEffect;function s(e){return typeof document>"u"?null:document.getElementById(d[e])}function E({slot:e="actions",children:n}){const[r,a]=t.useState(()=>s(e));m(()=>{a(s(e))},[e]);const o=r?.isConnected?r:null;return o?u.createPortal(n,o):c.jsx("div",{className:`s-term-inline-header s-term-inline-header--${e}`,"data-scout-terminal-header-fallback":e,children:n})}export{i as SCOUT_TERMINAL_HEADER_SLOT_ID,d as SCOUT_TERMINAL_HEADER_SLOT_IDS,E as TerminalHeaderMount};
1
+ import{r as t,j as c}from"./index-BFbLvCJn.js";import{r as u}from"./index-CXzJ_hGx.js";const i="scout-terminal-header-slot",d={crumb:"scout-terminal-header-crumb-slot",search:"scout-terminal-header-search-slot",actions:i},m=typeof window>"u"?t.useEffect:t.useLayoutEffect;function s(e){return typeof document>"u"?null:document.getElementById(d[e])}function E({slot:e="actions",children:n}){const[r,a]=t.useState(()=>s(e));m(()=>{a(s(e))},[e]);const o=r?.isConnected?r:null;return o?u.createPortal(n,o):c.jsx("div",{className:`s-term-inline-header s-term-inline-header--${e}`,"data-scout-terminal-header-fallback":e,children:n})}export{i as SCOUT_TERMINAL_HEADER_SLOT_ID,d as SCOUT_TERMINAL_HEADER_SLOT_IDS,E as TerminalHeaderMount};
@@ -1,4 +1,4 @@
1
- import{j as i,r as I}from"./index-EsrkGBcv.js";const N={cjs:"javascript",css:"css",htm:"html",html:"html",js:"javascript",jsx:"javascript",json:"json",mjs:"javascript",md:"markdown",mdx:"markdown",sh:"shell",ts:"typescript",tsx:"typescript",txt:"plain"},L=new Set(["cjs","css","htm","html","js","jsx","json","mjs","sh","ts","tsx"]);function b(t){const s=(t.filename??t.title??t.uri??"").split(/[?#]/)[0],n=s.split("/").pop()??s,r=n.lastIndexOf(".");return r>=0?n.slice(r+1).toLowerCase():""}function S(t){const e=t.mediaType?.toLowerCase()??"";return e.includes("json")?"json":e.includes("markdown")?"markdown":e.includes("javascript")?"javascript":e.includes("typescript")?"typescript":e.includes("html")?"html":e.includes("css")?"css":e.includes("shell")||e.includes("x-sh")?"shell":N[b(t)]??"plain"}function E(t){const e=t.mediaType?.toLowerCase()??"",s=b(t);if(e.includes("markdown")||s==="md"||s==="mdx")return"markdown";if(e.includes("json")||e.includes("javascript")||e.includes("typescript")||e.includes("html")||e.includes("xml")||e.includes("css")||L.has(s))return"code";if(e.startsWith("text/")||s==="txt")return"text";const n=t.value.trim();return/^#{1,6}\s+/m.test(n)||/```[\s\S]*```/.test(n)?"markdown":"text"}function it(t){const e=t.title??t.filename??t.uri?.split("/").pop()??"Untitled",s=t.language??S(t);return{id:t.id??t.uri??e,title:e,uri:t.uri,mediaType:t.mediaType,language:s,kind:t.kind??E(t),value:t.value,readOnly:t.readOnly}}function ct({document:t,mode:e,className:s}){const n=e??(t.kind==="markdown"?"preview":"read"),r=t.kind==="markdown"&&n==="preview"?i.jsx(k,{markdown:t.value}):i.jsx(W,{document:t});return i.jsx("div",{className:`s-text-document-surface s-text-document-surface-${t.kind}${s?` ${s}`:""}`,children:r})}function W({document:t}){const e=I.useMemo(()=>_(t.value,t.language??t.kind),[t.language,t.kind,t.value]);return i.jsx("pre",{className:"s-text-document-code","data-language":t.language??t.kind,children:i.jsx("code",{children:e})})}function k({markdown:t}){const e=A(t);return i.jsx("div",{className:"s-text-document-markdown",children:e.length>0?e:i.jsx("p",{})})}function A(t){const e=t.replace(/\r\n/g,`
1
+ import{j as i,r as I}from"./index-BFbLvCJn.js";const N={cjs:"javascript",css:"css",htm:"html",html:"html",js:"javascript",jsx:"javascript",json:"json",mjs:"javascript",md:"markdown",mdx:"markdown",sh:"shell",ts:"typescript",tsx:"typescript",txt:"plain"},L=new Set(["cjs","css","htm","html","js","jsx","json","mjs","sh","ts","tsx"]);function b(t){const s=(t.filename??t.title??t.uri??"").split(/[?#]/)[0],n=s.split("/").pop()??s,r=n.lastIndexOf(".");return r>=0?n.slice(r+1).toLowerCase():""}function S(t){const e=t.mediaType?.toLowerCase()??"";return e.includes("json")?"json":e.includes("markdown")?"markdown":e.includes("javascript")?"javascript":e.includes("typescript")?"typescript":e.includes("html")?"html":e.includes("css")?"css":e.includes("shell")||e.includes("x-sh")?"shell":N[b(t)]??"plain"}function E(t){const e=t.mediaType?.toLowerCase()??"",s=b(t);if(e.includes("markdown")||s==="md"||s==="mdx")return"markdown";if(e.includes("json")||e.includes("javascript")||e.includes("typescript")||e.includes("html")||e.includes("xml")||e.includes("css")||L.has(s))return"code";if(e.startsWith("text/")||s==="txt")return"text";const n=t.value.trim();return/^#{1,6}\s+/m.test(n)||/```[\s\S]*```/.test(n)?"markdown":"text"}function it(t){const e=t.title??t.filename??t.uri?.split("/").pop()??"Untitled",s=t.language??S(t);return{id:t.id??t.uri??e,title:e,uri:t.uri,mediaType:t.mediaType,language:s,kind:t.kind??E(t),value:t.value,readOnly:t.readOnly}}function ct({document:t,mode:e,className:s}){const n=e??(t.kind==="markdown"?"preview":"read"),r=t.kind==="markdown"&&n==="preview"?i.jsx(k,{markdown:t.value}):i.jsx(W,{document:t});return i.jsx("div",{className:`s-text-document-surface s-text-document-surface-${t.kind}${s?` ${s}`:""}`,children:r})}function W({document:t}){const e=I.useMemo(()=>_(t.value,t.language??t.kind),[t.language,t.kind,t.value]);return i.jsx("pre",{className:"s-text-document-code","data-language":t.language??t.kind,children:i.jsx("code",{children:e})})}function k({markdown:t}){const e=A(t);return i.jsx("div",{className:"s-text-document-markdown",children:e.length>0?e:i.jsx("p",{})})}function A(t){const e=t.replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),s=[];let n=0;for(;n<e.length;){const r=e[n]??"";if(!r.trim()){n+=1;continue}const c=/^```(\S*)\s*$/.exec(r);if(c){const l=[];for(n+=1;n<e.length&&!/^```\s*$/.test(e[n]??"");)l.push(e[n]??""),n+=1;n<e.length&&(n+=1),s.push({kind:"code",content:l.join(`
4
4
  `),language:c[1]||void 0});continue}const a=/^(#{1,6})\s+(.+)$/.exec(r);if(a){s.push({kind:"heading",depth:z(a[1].length),content:a[2].trim()}),n+=1;continue}if(/^ {0,3}([-*_])(?:\s*\1){2,}\s*$/.test(r)){s.push({kind:"hr"}),n+=1;continue}if(/^>\s?/.test(r)){const l=[];for(;n<e.length&&/^>\s?/.test(e[n]??"");)l.push((e[n]??"").replace(/^>\s?/,"")),n+=1;s.push({kind:"blockquote",content:l.join(" ")});continue}const o=/^(\s*)([-*+]|\d+[.)])\s+(.+)$/.exec(r);if(o){const l=/\d/.test(o[2]),m=[];for(;n<e.length;){const f=/^(\s*)([-*+]|\d+[.)])\s+(.+)$/.exec(e[n]??"");if(!f||/\d/.test(f[2])!==l)break;m.push(f[3]),n+=1}s.push({kind:"list",ordered:l,items:m});continue}const u=y(e,n);if(u){s.push(u.block),n=u.nextIndex;continue}const p=[];for(;n<e.length;){const l=e[n]??"";if(!l.trim()||/^```/.test(l)||/^(#{1,6})\s+/.test(l)||/^ {0,3}([-*_])(?:\s*\1){2,}\s*$/.test(l)||/^>\s?/.test(l)||/^(\s*)([-*+]|\d+[.)])\s+/.test(l)||y(e,n))break;p.push(l.trim()),n+=1}s.push({kind:"paragraph",content:p.join(" ")})}return s.map((r,c)=>C(r,c))}function z(t){return t<=1?1:t===2?2:t===3?3:t===4?4:t===5?5:6}function C(t,e){switch(t.kind){case"heading":{const n=`h${t.depth}`;return i.jsx(n,{children:d(t.content)},e)}case"paragraph":return i.jsx("p",{children:d(t.content)},e);case"blockquote":return i.jsx("blockquote",{children:d(t.content)},e);case"list":{const n=t.ordered?"ol":"ul";return i.jsx(n,{children:t.items.map((r,c)=>i.jsx("li",{children:d(r)},`${e}:${c}`))},e)}case"code":const s=$(t.language);return i.jsx("pre",{className:"s-text-document-fenced-code","data-language":s,children:i.jsx("code",{children:_(t.content,s)})},e);case"hr":return i.jsx("hr",{},e);case"table":return i.jsx("div",{className:"s-text-document-table-wrap",children:i.jsxs("table",{className:"s-text-document-table",children:[i.jsx("thead",{children:i.jsx("tr",{children:t.headers.map((n,r)=>i.jsx("th",{"data-align":t.alignments[r]??void 0,children:d(n)},`${e}:h:${r}`))})}),i.jsx("tbody",{children:t.rows.map((n,r)=>i.jsx("tr",{children:n.map((c,a)=>i.jsx("td",{"data-align":t.alignments[a]??void 0,children:d(c)},`${e}:r:${r}:${a}`))},`${e}:r:${r}`))})]})},e)}}function y(t,e){const s=w(t[e]??""),n=R(t[e+1]??"");if(!s||!n||s.length!==n.length)return null;const r=s.length,c=[];let a=e+2;for(;a<t.length;){const o=w(t[a]??"");if(!o||o.length<2)break;c.push(T(o,r)),a+=1}return{block:{kind:"table",alignments:n,headers:T(s,r),rows:c},nextIndex:a}}function w(t){const e=t.trim();if(!e.includes("|"))return null;let s=e;s.startsWith("|")&&(s=s.slice(1)),s.endsWith("|")&&!s.endsWith("\\|")&&(s=s.slice(0,-1));const n=[];let r="";for(let c=0;c<s.length;c+=1){const a=s[c];if(a==="\\"&&s[c+1]==="|"){r+="|",c+=1;continue}if(a==="|"){n.push(r.trim()),r="";continue}r+=a}return n.push(r.trim()),n.length>=2?n:null}function R(t){const e=w(t);if(!e||e.length<2)return null;const s=[];for(const n of e){const r=n.replace(/\s/g,"");if(!/^:?-{3,}:?$/u.test(r))return null;r.startsWith(":")&&r.endsWith(":")?s.push("center"):r.endsWith(":")?s.push("right"):r.startsWith(":")?s.push("left"):s.push(null)}return s}function T(t,e){const s=t.slice(0,e);for(;s.length<e;)s.push("");return s}const M=/\/\/[^\n]*|\/\*[\s\S]*?\*\/|`(?:\\[\s\S]|[^`\\])*`|'(?:\\.|[^'\\\n])*'|"(?:\\.|[^"\\\n])*"|\b\d+(?:\.\d+)?(?:e[+-]?\d+)?n?\b|\b[A-Za-z_$][\w$]*\b|=>|[{}()[\].,;:?]|[-+*/%=&|!<>~^]+/giu,D=/"(?:\\.|[^"\\])*"|-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b|\b(?:true|false|null)\b|[{}\[\]:,]/giu,O=/\/\*[\s\S]*?\*\/|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|#[0-9a-f]{3,8}\b|@[a-z-]+|--[a-z0-9-]+|[a-z-]+(?=\s*:)|\b\d+(?:\.\d+)?(?:%|px|r?em|vh|vw|vmin|vmax|s|ms|deg|fr)?\b|[{}():;,]|\.[a-z_][\w-]*|#[a-z_][\w-]*|[a-z_][\w-]*/giu,v=/<!--[\s\S]*?-->|<!doctype[^>]*>|<\/?[a-z][\w:-]*|\/?>|[a-z_:][\w:.-]*(?==)|=|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|&[a-z0-9#]+;/giu,P=/#[^\n]*|"(?:\\.|[^"\\])*"|'[^']*'|\$\{?[\w?@#$!-]+\}?|--?[A-Za-z0-9][\w-]*(?:=[^\s]+)?|\b(?:case|cd|do|done|echo|elif|else|esac|exit|export|fi|for|function|if|in|local|return|set|source|test|then|unset|while)\b|\b\d+\b|[|&;(){}<>]/giu,H=new Set(["abstract","as","async","await","break","case","catch","class","const","continue","declare","default","delete","do","else","enum","export","extends","finally","for","from","function","get","if","implements","import","in","infer","interface","is","keyof","let","new","of","private","protected","public","readonly","return","satisfies","set","static","switch","throw","try","type","typeof","var","void","while","with","yield"]),B=new Set(["false","null","super","this","true","undefined"]);function _(t,e){switch($(e)){case"css":return g(t,O,Z);case"html":return g(t,v,U);case"javascript":case"typescript":return g(t,M,K);case"json":return g(t,D,q);case"shell":return g(t,P,Y);default:return[t]}}function g(t,e,s){const n=[];let r=0,c=0;e.lastIndex=0;let a;for(;(a=e.exec(t))!==null;){const o=a[0];if(!o){e.lastIndex+=1;continue}a.index>r&&n.push(t.slice(r,a.index));const u=s(o,a.index,a.index+o.length,t);n.push(u?i.jsx("span",{className:`s-syntax s-syntax-${u}`,children:o},`syntax-${c++}`):o),r=a.index+o.length}return r<t.length&&n.push(t.slice(r)),n.length>0?n:[t]}function $(t){const e=String(t??"").toLowerCase().replace(/^\./,"");return e==="bash"||e==="sh"||e==="shell"||e==="zsh"?"shell":e==="css"||e==="scss"?"css":e==="html"||e==="htm"||e==="xml"||e==="svg"?"html":e==="js"||e==="jsx"||e==="javascript"||e==="mjs"||e==="cjs"?"javascript":e==="json"||e==="jsonc"?"json":e==="markdown"||e==="md"||e==="mdx"?"markdown":e==="ts"||e==="tsx"||e==="typescript"?"typescript":"plain"}function K(t,e,s,n){return t.startsWith("//")||t.startsWith("/*")?"comment":x(t)?"string":/^\d/u.test(t)?"number":H.has(t)?"keyword":B.has(t)?"literal":/^[A-Z][\w$]*$/u.test(t)?"type":/^[A-Za-z_$][\w$]*$/u.test(t)&&n.slice(s).trimStart().startsWith("(")?"function":/^[{}()[\].,;:?]$/u.test(t)?"punctuation":/^(?:=>|[-+*/%=&|!<>~^]+)$/u.test(t)?"operator":null}function q(t,e,s,n){return x(t)?n.slice(s).trimStart().startsWith(":")?"property":"string":/^-?\d/u.test(t)?"number":t==="true"||t==="false"||t==="null"?"literal":"punctuation"}function Z(t,e,s,n){return t.startsWith("/*")?"comment":x(t)?"string":t.startsWith("@")?"keyword":t.startsWith("#")&&/^#[0-9a-f]/iu.test(t)||/^\d/u.test(t)?"number":t.startsWith(".")||t.startsWith("#")?"tag":/^--/u.test(t)||n.slice(s).trimStart().startsWith(":")?"property":/^[{}():;,]$/u.test(t)?"punctuation":null}function U(t){return t.startsWith("<!--")?"comment":/^<!doctype/iu.test(t)||t.startsWith("&")?"meta":t.startsWith("<")?"tag":x(t)?"string":t==="="?"operator":t===">"||t==="/>"?"punctuation":"attribute"}function Y(t){return t.startsWith("#")?"comment":x(t)?"string":t.startsWith("$")?"property":t.startsWith("-")?"attribute":/^\d/u.test(t)?"number":/^[|&;(){}<>]$/u.test(t)?"operator":G.has(t)?"keyword":null}const G=new Set(["case","cd","do","done","echo","elif","else","esac","exit","export","fi","for","function","if","in","local","return","set","source","test","then","unset","while"]);function x(t){return t.startsWith('"')||t.startsWith("'")||t.startsWith("`")}const J=/`([^`]+)`/y,X=/\[([^\]]+)\]\(([^)\s]+)\)/y,F=/\*\*\*(.+?)\*\*\*/y,Q=/\*\*(.+?)\*\*/y,V=/__(.+?)__(?!\w)/y,tt=/~~(.+?)~~/y,et=/\*(?!\s)([^*]+?)\*/y,nt=/_(?!\s)([^_]+?)_(?!\w)/y;function h(t,e,s){t.lastIndex=s;const n=t.exec(e);return n&&n.index===s?n:null}function d(t){const e=[];let s="",n=0,r=0;const c=()=>{s&&(e.push(s),s="")};for(;n<t.length;){const a=n===0||/[^\w]/.test(t[n-1]??""),o=h(J,t,n);if(o){c(),e.push(i.jsx("code",{children:o[1]},r++)),n+=o[0].length;continue}const u=h(X,t,n);if(u){c();const j=st(u[2]);e.push(j?i.jsx("a",{href:j,target:"_blank",rel:"noreferrer",children:d(u[1])},r++):i.jsx("span",{children:d(u[1])},r++)),n+=u[0].length;continue}const p=h(F,t,n);if(p){c(),e.push(i.jsx("strong",{children:i.jsx("em",{children:d(p[1])})},r++)),n+=p[0].length;continue}const l=h(Q,t,n)??(a?h(V,t,n):null);if(l){c(),e.push(i.jsx("strong",{children:d(l[1])},r++)),n+=l[0].length;continue}const m=h(tt,t,n);if(m){c(),e.push(i.jsx("del",{children:d(m[1])},r++)),n+=m[0].length;continue}const f=h(et,t,n)??(a?h(nt,t,n):null);if(f){c(),e.push(i.jsx("em",{children:d(f[1])},r++)),n+=f[0].length;continue}s+=t[n],n+=1}return c(),e}function st(t){if(!t)return null;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"||e.protocol==="mailto:"?t:null}catch{return null}}export{ct as T,it as c};
@@ -1 +1 @@
1
- import{r as l,j as a}from"./index-EsrkGBcv.js";import{a as D}from"./api-DSqpVKC7.js";import{f as v}from"./time-Dhsh_2EG.js";/* empty css */import{R as F}from"./refresh-cw-BmVr7sCD.js";const M=44,B=132,H=3500,V=7e3;function W(e,t){return!!(e&&e.available===t.available&&e.sessionId===t.sessionId&&e.body===t.body&&e.lineCount===t.lineCount&&e.columnCount===t.columnCount&&e.truncated===t.truncated&&e.reason===t.reason)}function q(e){const t=new URLSearchParams({lines:String(e.lines),cols:String(e.columns)});return e.agentId?`/api/agents/${encodeURIComponent(e.agentId)}/tmux-peek?${t.toString()}`:e.surface?(t.set("backend",e.surface.backend),t.set("sessionName",e.surface.sessionName),`/api/terminal-sessions/peek?${t.toString()}`):null}function ee({agentId:e,surface:t,enabled:x=!0,lines:E=M,columns:L=B,pollMs:h=H,idlePollMs:u=V,className:N}){const[n,T]=l.useState(null),[k,m]=l.useState(!1),[A,b]=l.useState(null),[U,K]=l.useState(0),c=q({agentId:e,surface:t,lines:E,columns:L});if(l.useEffect(()=>{T(null),b(null),m(!1)},[c]),l.useEffect(()=>{if(!x||!c){m(!1);return}let r=!1,f,y=!0;const R=d=>{window.clearTimeout(f),f=window.setTimeout(()=>{S()},d)},S=async()=>{if(r)return;if(document.visibilityState!=="visible"){R(u);return}y&&m(!0);let d=h;try{const i=await D(c);if(r)return;b(null),T(o=>o&&W(o.payload,i)?o.steady?o:{...o,steady:!0}:{payload:i,observedAt:o?.observedAt??i.capturedAt,changedAt:o?i.capturedAt:null,steady:!1}),d=i.available?h:u}catch(i){if(r)return;b(i instanceof Error?i.message:String(i)),d=u}finally{r||(y&&m(!1),y=!1,R(d))}},$=()=>{document.visibilityState==="visible"&&(window.clearTimeout(f),S())};return S(),document.addEventListener("visibilitychange",$),()=>{r=!0,window.clearTimeout(f),document.removeEventListener("visibilitychange",$)}},[x,u,c,h,U]),!x||!c)return null;const s=n?.payload??null,g=s?.body??"",p=s?.lineCount??E,j=s?.columnCount??L,w=6,I=1.32,O={"--tmux-peek-columns":String(j),"--tmux-peek-rows":String(p),"--tmux-peek-font-size":`${w}px`,"--tmux-peek-line-height":String(I),"--tmux-peek-height":`${Math.ceil(p*w*I+18)}px`},C=!!(s?.available&&g),X=A||(k&&!n?"Loading terminal peek...":s?.available===!1?s.reason??"No tmux pane is available.":C?null:s?.available?"Pane is empty.":"Loading terminal peek..."),_=n?n.changedAt&&!n.steady?"Changed":n.steady?"At rest":"Peeked":null,P=n?.changedAt??n?.observedAt??null,z=n?n.changedAt?n.steady?`No terminal content change since ${v(n.changedAt)}`:`Terminal content changed ${v(n.changedAt)}`:`First terminal peek observed ${v(n.observedAt)}`:void 0;return a.jsxs("div",{className:`ctx-panel-tmux-peek${N?` ${N}`:""}`,style:O,children:[a.jsxs("div",{className:"ctx-panel-tmux-peek-head",children:[a.jsx("span",{children:"Terminal peek"}),a.jsxs("span",{className:"ctx-panel-tmux-peek-grid",children:[j,"x",p]}),s?.sessionId&&a.jsx("span",{className:"ctx-panel-tmux-peek-session",title:s.sessionId,children:s.sessionId.length>12?s.sessionId.slice(0,10):s.sessionId}),_&&P&&a.jsx("time",{className:"ctx-panel-tmux-peek-state",dateTime:new Date(P).toISOString(),title:z,children:_}),a.jsxs("button",{type:"button",className:"ctx-panel-tmux-peek-refresh",onClick:()=>K(r=>r+1),disabled:k,title:"Refresh terminal peek","aria-label":"Refresh terminal peek",children:[a.jsx(F,{size:12,strokeWidth:1.8}),a.jsx("span",{children:k?"Refreshing":"Refresh"})]})]}),C?a.jsx("pre",{className:"ctx-panel-tmux-peek-screen",children:g}):a.jsx("div",{className:"ctx-panel-tmux-peek-empty",children:X}),s?.truncated&&g&&a.jsxs("div",{className:"ctx-panel-tmux-peek-foot",children:["Last ",p," rows from tmux pane"]})]})}export{ee as T};
1
+ import{r as l,j as a}from"./index-BFbLvCJn.js";import{a as D}from"./api-DSqpVKC7.js";import{f as v}from"./time-Dhsh_2EG.js";/* empty css */import{R as F}from"./refresh-cw-BcqctLqo.js";const M=44,B=132,H=3500,V=7e3;function W(e,t){return!!(e&&e.available===t.available&&e.sessionId===t.sessionId&&e.body===t.body&&e.lineCount===t.lineCount&&e.columnCount===t.columnCount&&e.truncated===t.truncated&&e.reason===t.reason)}function q(e){const t=new URLSearchParams({lines:String(e.lines),cols:String(e.columns)});return e.agentId?`/api/agents/${encodeURIComponent(e.agentId)}/tmux-peek?${t.toString()}`:e.surface?(t.set("backend",e.surface.backend),t.set("sessionName",e.surface.sessionName),`/api/terminal-sessions/peek?${t.toString()}`):null}function ee({agentId:e,surface:t,enabled:x=!0,lines:E=M,columns:L=B,pollMs:h=H,idlePollMs:u=V,className:N}){const[n,T]=l.useState(null),[k,m]=l.useState(!1),[A,b]=l.useState(null),[U,K]=l.useState(0),c=q({agentId:e,surface:t,lines:E,columns:L});if(l.useEffect(()=>{T(null),b(null),m(!1)},[c]),l.useEffect(()=>{if(!x||!c){m(!1);return}let r=!1,f,y=!0;const R=d=>{window.clearTimeout(f),f=window.setTimeout(()=>{S()},d)},S=async()=>{if(r)return;if(document.visibilityState!=="visible"){R(u);return}y&&m(!0);let d=h;try{const i=await D(c);if(r)return;b(null),T(o=>o&&W(o.payload,i)?o.steady?o:{...o,steady:!0}:{payload:i,observedAt:o?.observedAt??i.capturedAt,changedAt:o?i.capturedAt:null,steady:!1}),d=i.available?h:u}catch(i){if(r)return;b(i instanceof Error?i.message:String(i)),d=u}finally{r||(y&&m(!1),y=!1,R(d))}},$=()=>{document.visibilityState==="visible"&&(window.clearTimeout(f),S())};return S(),document.addEventListener("visibilitychange",$),()=>{r=!0,window.clearTimeout(f),document.removeEventListener("visibilitychange",$)}},[x,u,c,h,U]),!x||!c)return null;const s=n?.payload??null,g=s?.body??"",p=s?.lineCount??E,j=s?.columnCount??L,w=6,I=1.32,O={"--tmux-peek-columns":String(j),"--tmux-peek-rows":String(p),"--tmux-peek-font-size":`${w}px`,"--tmux-peek-line-height":String(I),"--tmux-peek-height":`${Math.ceil(p*w*I+18)}px`},C=!!(s?.available&&g),X=A||(k&&!n?"Loading terminal peek...":s?.available===!1?s.reason??"No tmux pane is available.":C?null:s?.available?"Pane is empty.":"Loading terminal peek..."),_=n?n.changedAt&&!n.steady?"Changed":n.steady?"At rest":"Peeked":null,P=n?.changedAt??n?.observedAt??null,z=n?n.changedAt?n.steady?`No terminal content change since ${v(n.changedAt)}`:`Terminal content changed ${v(n.changedAt)}`:`First terminal peek observed ${v(n.observedAt)}`:void 0;return a.jsxs("div",{className:`ctx-panel-tmux-peek${N?` ${N}`:""}`,style:O,children:[a.jsxs("div",{className:"ctx-panel-tmux-peek-head",children:[a.jsx("span",{children:"Terminal peek"}),a.jsxs("span",{className:"ctx-panel-tmux-peek-grid",children:[j,"x",p]}),s?.sessionId&&a.jsx("span",{className:"ctx-panel-tmux-peek-session",title:s.sessionId,children:s.sessionId.length>12?s.sessionId.slice(0,10):s.sessionId}),_&&P&&a.jsx("time",{className:"ctx-panel-tmux-peek-state",dateTime:new Date(P).toISOString(),title:z,children:_}),a.jsxs("button",{type:"button",className:"ctx-panel-tmux-peek-refresh",onClick:()=>K(r=>r+1),disabled:k,title:"Refresh terminal peek","aria-label":"Refresh terminal peek",children:[a.jsx(F,{size:12,strokeWidth:1.8}),a.jsx("span",{children:k?"Refreshing":"Refresh"})]})]}),C?a.jsx("pre",{className:"ctx-panel-tmux-peek-screen",children:g}):a.jsx("div",{className:"ctx-panel-tmux-peek-empty",children:X}),s?.truncated&&g&&a.jsxs("div",{className:"ctx-panel-tmux-peek-foot",children:["Last ",p," rows from tmux pane"]})]})}export{ee as T};
@@ -1 +1 @@
1
- import{j as t}from"./index-EsrkGBcv.js";function h({enabled:e,state:r,error:b,clock:u,meterLine:o,inputLabel:s,micMuted:v,playbackMuted:d,dictationActive:c=!1,newChatBusy:a=!1}){let n;c?n={label:"Start live voice",disabled:!0}:r==="connecting"?n={label:"Cancel connection",busy:!0}:r==="live"?n={label:"End live voice",tone:"end",clock:u}:e?n={label:"Start live voice",tone:"start"}:n={label:"Open voice settings",tone:"end"};let i,l=!1;return b?(i=b,l=!0):c?i="Dictation owns the microphone — live voice waits.":r==="connecting"?i="mic consent → SDP answer → Live readiness":r==="live"?i="the meter is running · billed per second":e?i="the meter starts on connect → clock · $ · metered":i="live voice is off · flip it on in Voice settings",{title:"Live conversation",sub:o,cta:n,note:i,noteError:l,flags:[{key:"mic",label:"Mute mic",on:v,title:"the mic stays hot until End"},{key:"speaker",label:"Quiet",on:d,title:"playback keeps flowing"}],flagNote:r==="live"?"the meter runs while the call is live":v||d?"armed now · applies on connect":void 0,input:`input · ${s}`,newChatBusy:a}}function m({phase:e,voiceReplies:r,inputLabel:b,inputWarn:u,speechIdentity:o,assistantModel:s,recordingClock:v}){const d=o?`${[o.providerLabel,o.modelId].filter(Boolean).join(" ")} · voice ${o.voiceLabel} · ${o.metered?"metered per reply":"unmetered"}`:"voice host resolving…",c=s?.trim();let a;switch(e){case"listening":a={label:"Send turn",tone:"start",clock:v};break;case"speaking":a={label:"Stop spoken reply",tone:"end"};break;case"unavailable":a={label:"Retry voice connection",tone:"end"};break;case"checking":a={label:"Checking voice…",busy:!0,disabled:!0};break;case"processing":a={label:"Cancel turn",tone:"end"};break;case"thinking":a={label:"Cancel turn",tone:"end"};break;case"ready":a={label:"Start voice turn",tone:"start"};break}let n;switch(e){case"ready":n=`audio stays on this Mac${c?` · reply text still hits ${c}`:""}`;break;case"checking":n="checking microphone and speech services";break;case"unavailable":n="voice is offline · nothing can record";break;case"listening":n="recording · nothing is sent until Send";break;case"processing":n="turning speech into text";break;case"thinking":n=c?`your turn is in · ${c} is replying`:"your turn is in";break;case"speaking":n=o?.metered?"spoken reply · metered":"spoken reply · unmetered";break}const i=[];e==="listening"&&i.push({key:"mic",label:"Discard",momentary:!0,title:"drop this take — nothing is sent"}),i.push({key:"speaker",label:"Spoken replies",on:r,disabled:e!=="ready"&&e!=="listening",title:"the reply voice speaks, or the reply lands as text"});let l;switch(e){case"ready":l=r?`TTS is prepared per reply · ${o?.metered?"metered":"unmetered"}`:"reply lands as text · nothing metered";break;case"listening":l="the mic closes on Send or Discard";break;case"processing":l="the take is in · the meter is Scout's reply";break;case"thinking":l="the reply is paid, not the take";break;case"speaking":l=o?.metered?"speech is a paid reply":"speech is on this Mac";break;case"checking":l="device permission resolves the flag row";break;case"unavailable":l="resolve the input, then turn-taking works";break}return{title:"Turn-based conversation",sub:d,cta:a,note:n,flags:i,flagNote:l,input:`input · ${b}`,inputWarn:u}}function p({spec:e,onCta:r,onFlag:b,onTail:u,layout:o="card"}){const{cta:s}=e,v=s.tone==="start"?"start":s.busy||/^(cancel|stop)\b/i.test(s.label)?"ghost":"end",d=l=>t.jsxs("button",{type:"button",className:`voice-well-cta voice-well-cta--${l}`,disabled:s.disabled,"aria-busy":s.busy||void 0,onClick:r,children:[t.jsx("span",{children:s.label}),s.clock&&t.jsx("span",{className:"voice-well-cta-clock",children:s.clock})]}),c=e.flags.map(l=>t.jsx("button",{type:"button",className:`voice-well-flag${l.on?" voice-well-flag--on":""}`,disabled:l.disabled,"aria-pressed":l.momentary?void 0:!!l.on,title:l.title,onClick:()=>b(l.key,l),children:l.label},l.key)),a=e.note?t.jsx("p",{className:`voice-well-note${e.noteError?" voice-well-note--error":""}`,role:e.noteError?"alert":void 0,children:e.note}):null,n=t.jsx("span",{className:`voice-well-input${e.inputWarn?" voice-well-input--warn":""}`,children:e.input}),i=t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"voice-well-tail-action",disabled:e.newChatBusy,onClick:()=>u("new-chat"),children:"New chat"}),t.jsx("button",{type:"button",className:"voice-well-tail-action",onClick:()=>u("settings"),children:"Voice settings"})]});return o==="row"?t.jsxs("section",{className:"voice-well voice-well--row","aria-label":e.title,children:[n,t.jsxs("div",{className:"voice-well-flags",children:[c,e.flagNote&&t.jsx("span",{className:"voice-well-flag-note",children:e.flagNote}),a,i]}),d(v)]}):t.jsxs("section",{className:"voice-well","aria-label":e.title,children:[t.jsx("div",{className:"voice-well-title",children:e.title}),t.jsx("div",{className:"voice-well-sub",children:e.sub}),d(s.tone==="end"?"end":"start"),a,t.jsxs("div",{className:"voice-well-flags",children:[c,e.flagNote&&t.jsx("span",{className:"voice-well-flag-note",children:e.flagNote})]}),t.jsxs("div",{className:"voice-well-tail",children:[n,i]})]})}export{p as VoiceControlWell,h as gptLiveWellSpec,m as localLiveWellSpec};
1
+ import{j as t}from"./index-BFbLvCJn.js";function h({enabled:e,state:r,error:b,clock:u,meterLine:o,inputLabel:s,micMuted:v,playbackMuted:d,dictationActive:c=!1,newChatBusy:a=!1}){let n;c?n={label:"Start live voice",disabled:!0}:r==="connecting"?n={label:"Cancel connection",busy:!0}:r==="live"?n={label:"End live voice",tone:"end",clock:u}:e?n={label:"Start live voice",tone:"start"}:n={label:"Open voice settings",tone:"end"};let i,l=!1;return b?(i=b,l=!0):c?i="Dictation owns the microphone — live voice waits.":r==="connecting"?i="mic consent → SDP answer → Live readiness":r==="live"?i="the meter is running · billed per second":e?i="the meter starts on connect → clock · $ · metered":i="live voice is off · flip it on in Voice settings",{title:"Live conversation",sub:o,cta:n,note:i,noteError:l,flags:[{key:"mic",label:"Mute mic",on:v,title:"the mic stays hot until End"},{key:"speaker",label:"Quiet",on:d,title:"playback keeps flowing"}],flagNote:r==="live"?"the meter runs while the call is live":v||d?"armed now · applies on connect":void 0,input:`input · ${s}`,newChatBusy:a}}function m({phase:e,voiceReplies:r,inputLabel:b,inputWarn:u,speechIdentity:o,assistantModel:s,recordingClock:v}){const d=o?`${[o.providerLabel,o.modelId].filter(Boolean).join(" ")} · voice ${o.voiceLabel} · ${o.metered?"metered per reply":"unmetered"}`:"voice host resolving…",c=s?.trim();let a;switch(e){case"listening":a={label:"Send turn",tone:"start",clock:v};break;case"speaking":a={label:"Stop spoken reply",tone:"end"};break;case"unavailable":a={label:"Retry voice connection",tone:"end"};break;case"checking":a={label:"Checking voice…",busy:!0,disabled:!0};break;case"processing":a={label:"Cancel turn",tone:"end"};break;case"thinking":a={label:"Cancel turn",tone:"end"};break;case"ready":a={label:"Start voice turn",tone:"start"};break}let n;switch(e){case"ready":n=`audio stays on this Mac${c?` · reply text still hits ${c}`:""}`;break;case"checking":n="checking microphone and speech services";break;case"unavailable":n="voice is offline · nothing can record";break;case"listening":n="recording · nothing is sent until Send";break;case"processing":n="turning speech into text";break;case"thinking":n=c?`your turn is in · ${c} is replying`:"your turn is in";break;case"speaking":n=o?.metered?"spoken reply · metered":"spoken reply · unmetered";break}const i=[];e==="listening"&&i.push({key:"mic",label:"Discard",momentary:!0,title:"drop this take — nothing is sent"}),i.push({key:"speaker",label:"Spoken replies",on:r,disabled:e!=="ready"&&e!=="listening",title:"the reply voice speaks, or the reply lands as text"});let l;switch(e){case"ready":l=r?`TTS is prepared per reply · ${o?.metered?"metered":"unmetered"}`:"reply lands as text · nothing metered";break;case"listening":l="the mic closes on Send or Discard";break;case"processing":l="the take is in · the meter is Scout's reply";break;case"thinking":l="the reply is paid, not the take";break;case"speaking":l=o?.metered?"speech is a paid reply":"speech is on this Mac";break;case"checking":l="device permission resolves the flag row";break;case"unavailable":l="resolve the input, then turn-taking works";break}return{title:"Turn-based conversation",sub:d,cta:a,note:n,flags:i,flagNote:l,input:`input · ${b}`,inputWarn:u}}function p({spec:e,onCta:r,onFlag:b,onTail:u,layout:o="card"}){const{cta:s}=e,v=s.tone==="start"?"start":s.busy||/^(cancel|stop)\b/i.test(s.label)?"ghost":"end",d=l=>t.jsxs("button",{type:"button",className:`voice-well-cta voice-well-cta--${l}`,disabled:s.disabled,"aria-busy":s.busy||void 0,onClick:r,children:[t.jsx("span",{children:s.label}),s.clock&&t.jsx("span",{className:"voice-well-cta-clock",children:s.clock})]}),c=e.flags.map(l=>t.jsx("button",{type:"button",className:`voice-well-flag${l.on?" voice-well-flag--on":""}`,disabled:l.disabled,"aria-pressed":l.momentary?void 0:!!l.on,title:l.title,onClick:()=>b(l.key,l),children:l.label},l.key)),a=e.note?t.jsx("p",{className:`voice-well-note${e.noteError?" voice-well-note--error":""}`,role:e.noteError?"alert":void 0,children:e.note}):null,n=t.jsx("span",{className:`voice-well-input${e.inputWarn?" voice-well-input--warn":""}`,children:e.input}),i=t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"voice-well-tail-action",disabled:e.newChatBusy,onClick:()=>u("new-chat"),children:"New chat"}),t.jsx("button",{type:"button",className:"voice-well-tail-action",onClick:()=>u("settings"),children:"Voice settings"})]});return o==="row"?t.jsxs("section",{className:"voice-well voice-well--row","aria-label":e.title,children:[n,t.jsxs("div",{className:"voice-well-flags",children:[c,e.flagNote&&t.jsx("span",{className:"voice-well-flag-note",children:e.flagNote}),a,i]}),d(v)]}):t.jsxs("section",{className:"voice-well","aria-label":e.title,children:[t.jsx("div",{className:"voice-well-title",children:e.title}),t.jsx("div",{className:"voice-well-sub",children:e.sub}),d(s.tone==="end"?"end":"start"),a,t.jsxs("div",{className:"voice-well-flags",children:[c,e.flagNote&&t.jsx("span",{className:"voice-well-flag-note",children:e.flagNote})]}),t.jsxs("div",{className:"voice-well-tail",children:[n,i]})]})}export{p as VoiceControlWell,h as gptLiveWellSpec,m as localLiveWellSpec};
@@ -1 +1 @@
1
- import{j as e}from"./index-EsrkGBcv.js";/* empty css */const k=3;function c({node:r}){const s=r.x+14,a=r.y+r.h/2;return e.jsxs("g",{className:`vpd-node vpd-node--${r.state}${r.tone?` vpd-node--${r.tone}`:""}`,children:[e.jsx("rect",{x:r.x,y:r.y,width:r.w,height:r.h,rx:r.rx,className:"vpd-node-plate"}),e.jsx("circle",{cx:s,cy:a,r:3,className:"vpd-node-dot"}),e.jsx("text",{x:r.x+24,y:a+k,className:"vpd-node-label",children:r.label})]})}function p(){return e.jsxs("defs",{children:[e.jsx("marker",{id:"vpd-arrow-ink",viewBox:"0 0 8 8",refX:7,refY:4,markerWidth:7,markerHeight:7,orient:"auto-start-reverse",children:e.jsx("path",{d:"M 0 0.5 L 8 4 L 0 7.5 Z",className:"vpd-arrow vpd-arrow--ink"})}),e.jsx("marker",{id:"vpd-arrow-sky",viewBox:"0 0 8 8",refX:7,refY:4,markerWidth:7,markerHeight:7,orient:"auto-start-reverse",children:e.jsx("path",{d:"M 0 0.5 L 8 4 L 0 7.5 Z",className:"vpd-arrow vpd-arrow--sky"})}),e.jsx("marker",{id:"vpd-arrow-sky-dim",viewBox:"0 0 8 8",refX:7,refY:4,markerWidth:7,markerHeight:7,orient:"auto-start-reverse",children:e.jsx("path",{d:"M 0 0.5 L 8 4 L 0 7.5 Z",className:"vpd-arrow vpd-arrow--sky-dim"})})]})}function x({label:r}){return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:24,y:96,width:672,height:72,rx:8,className:"vpd-frame"}),e.jsx("text",{x:38,y:111,className:"vpd-frame-label",children:r})]})}function h(r){const s=r==="live",a=r==="connecting",i=r==="error",t=i?"error":s?"ok":a?"working":"dim";return[{id:"mic",label:"MIC",x:44,y:122,w:64,h:32,rx:16,state:t},{id:"webrtc",label:"WEBRTC",x:148,y:122,w:88,h:32,rx:16,state:t},{id:"openai",label:"OPENAI REALTIME",x:288,y:8,w:176,h:32,rx:16,state:i?"error":s?"ok":a?"working":"dim",tone:"sky"},{id:"scoutbot",label:"SCOUTBOT",x:560,y:122,w:112,h:32,rx:16,state:t}]}function y({state:r}){const s=r==="live",a=s?"Call live.":r==="connecting"?"Call connecting.":r==="error"?"Call in error.":"No call; idle.";return e.jsxs("svg",{viewBox:"0 0 720 176",className:"vpd",role:"img","aria-live":"polite","aria-label":`GPT Live path: microphone and WebRTC on this machine, audio arches out to OpenAI Realtime in the cloud and back to Scoutbot. ${a}`,children:[e.jsx(p,{}),e.jsx(x,{label:"THIS MACHINE"}),e.jsx("text",{x:476,y:27,className:"vpd-cloud-label",children:"CLOUD"}),e.jsx("line",{x1:108,y1:138,x2:148,y2:138,className:`vpd-link${s?" vpd-flow":""}`,markerStart:"url(#vpd-arrow-ink)",markerEnd:"url(#vpd-arrow-ink)"}),e.jsx("path",{d:"M 192 122 C 192 80, 300 66, 334 40",className:`vpd-link vpd-link--sky${s?" vpd-flow":""}`,markerEnd:s?"url(#vpd-arrow-sky)":"url(#vpd-arrow-sky-dim)"}),e.jsx("path",{d:"M 418 42 C 452 66, 616 80, 616 122",className:`vpd-link vpd-link--sky${s?" vpd-flow":""}`,markerEnd:s?"url(#vpd-arrow-sky)":"url(#vpd-arrow-sky-dim)"}),e.jsx("circle",{cx:209,cy:96,r:2.5,className:"vpd-crossing"}),e.jsx("circle",{cx:590,cy:96,r:2.5,className:"vpd-crossing"}),h(r).map(i=>e.jsx(c,{node:i},i.id))]})}function w(r,s,a){const i=r?.hostReachable===!0,t=r?r.microphoneGranted===!0?"ready":"warn":"dim",l=r?i?"ready":"warn":"dim",n=[{id:"mic",label:"MIC",x:44,y:122,w:60,h:32,rx:6,state:t},{id:"stt",label:"STT",x:140,y:122,w:64,h:32,rx:6,state:l},{id:"turn",label:"TURN ENGINE",x:244,y:122,w:128,h:32,rx:6,state:"pending"},{id:"scoutbot",label:"SCOUTBOT",x:416,y:122,w:104,h:32,rx:6,state:s?"ready":"dim"},{id:"tts",label:"TTS",x:560,y:122,w:60,h:32,rx:6,state:l}];return a==="listening"?(n[0].state="working",n[1].state="working"):a==="processing"?n[1].state="working":a==="thinking"?n[3].state="working":a==="speaking"&&(n[4].state="working"),n}function g({probe:r,replyModel:s,phase:a,ttsProviderLabel:i,ttsMetered:t}){const l=a==="listening",n=a==="processing"||a==="thinking",d=a==="speaking",v=!a||a==="ready"?"Idle.":a==="listening"?"Listening to a turn.":n?"Transcribing or thinking.":a==="speaking"?"Speaking a reply.":"Checking the voice host.",m=t&&i?` Spoken replies send reply text to ${i} TTS.`:" Spoken replies are synthesized on-device.";return e.jsxs("svg",{viewBox:"0 88 720 116",className:"vpd",role:"img","aria-live":"polite","aria-label":`Local Live path: microphone, speech-to-text, turn engine, Scoutbot, and text-to-speech as one chain inside this machine, ending at the speaker. The turn engine is not wired yet. Reply text leaves the chain to the configured reply model.${m} ${v}`,children:[e.jsx(p,{}),e.jsx(x,{label:"THIS MACHINE — AUDIO NEVER LEAVES"}),e.jsx("line",{x1:104,y1:138,x2:140,y2:138,className:`vpd-link${l?" vpd-flow":""}`,markerEnd:"url(#vpd-arrow-ink)"}),e.jsx("line",{x1:204,y1:138,x2:244,y2:138,className:`vpd-link vpd-link--pending${n?" vpd-flow":""}`,markerEnd:"url(#vpd-arrow-ink)"}),e.jsx("line",{x1:372,y1:138,x2:416,y2:138,className:`vpd-link vpd-link--pending${n?" vpd-flow":""}`,markerEnd:"url(#vpd-arrow-ink)"}),e.jsx("line",{x1:520,y1:138,x2:560,y2:138,className:`vpd-link${d?" vpd-flow":""}`,markerEnd:"url(#vpd-arrow-ink)"}),e.jsx("line",{x1:620,y1:138,x2:648,y2:138,className:`vpd-link${d?" vpd-flow":""}`,markerEnd:"url(#vpd-arrow-ink)"}),e.jsxs("g",{className:d?"vpd-speaker-live":void 0,children:[e.jsx("path",{d:"M 652 135 L 657 135 L 663 130 L 663 146 L 657 141 L 652 141 Z",className:"vpd-speaker"}),e.jsx("path",{d:"M 666 133 Q 669 138 666 143",className:"vpd-speaker-arc"}),e.jsx("path",{d:"M 669 131 Q 673 138 669 145",className:"vpd-speaker-arc"})]}),e.jsx("line",{x1:468,y1:154,x2:468,y2:182,className:`vpd-stub${n?" vpd-flow":""}`}),e.jsx("text",{x:478,y:185,className:"vpd-stub-label",children:"TEXT TO REPLY MODEL"}),t&&i&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:590,y1:154,x2:590,y2:196,className:`vpd-stub${d?" vpd-flow":""}`}),e.jsx("text",{x:598,y:199,className:"vpd-stub-label",children:`TEXT TO ${i.toUpperCase()} TTS`})]}),w(r,s,a).map(o=>e.jsx(c,{node:o},o.id))]})}function N({mode:r,liveState:s,probe:a,replyModel:i,localPhase:t=null,ttsProviderLabel:l=null,ttsMetered:n=!1}){return e.jsx("div",{className:"vpd-wrap","data-mode":r,children:r==="gpt-live"?e.jsx(y,{state:s}):e.jsx(g,{probe:a,replyModel:i,phase:t,ttsProviderLabel:l,ttsMetered:n})})}export{N as VoicePathDiagram};
1
+ import{j as e}from"./index-BFbLvCJn.js";/* empty css */const k=3;function c({node:r}){const s=r.x+14,a=r.y+r.h/2;return e.jsxs("g",{className:`vpd-node vpd-node--${r.state}${r.tone?` vpd-node--${r.tone}`:""}`,children:[e.jsx("rect",{x:r.x,y:r.y,width:r.w,height:r.h,rx:r.rx,className:"vpd-node-plate"}),e.jsx("circle",{cx:s,cy:a,r:3,className:"vpd-node-dot"}),e.jsx("text",{x:r.x+24,y:a+k,className:"vpd-node-label",children:r.label})]})}function p(){return e.jsxs("defs",{children:[e.jsx("marker",{id:"vpd-arrow-ink",viewBox:"0 0 8 8",refX:7,refY:4,markerWidth:7,markerHeight:7,orient:"auto-start-reverse",children:e.jsx("path",{d:"M 0 0.5 L 8 4 L 0 7.5 Z",className:"vpd-arrow vpd-arrow--ink"})}),e.jsx("marker",{id:"vpd-arrow-sky",viewBox:"0 0 8 8",refX:7,refY:4,markerWidth:7,markerHeight:7,orient:"auto-start-reverse",children:e.jsx("path",{d:"M 0 0.5 L 8 4 L 0 7.5 Z",className:"vpd-arrow vpd-arrow--sky"})}),e.jsx("marker",{id:"vpd-arrow-sky-dim",viewBox:"0 0 8 8",refX:7,refY:4,markerWidth:7,markerHeight:7,orient:"auto-start-reverse",children:e.jsx("path",{d:"M 0 0.5 L 8 4 L 0 7.5 Z",className:"vpd-arrow vpd-arrow--sky-dim"})})]})}function x({label:r}){return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:24,y:96,width:672,height:72,rx:8,className:"vpd-frame"}),e.jsx("text",{x:38,y:111,className:"vpd-frame-label",children:r})]})}function h(r){const s=r==="live",a=r==="connecting",i=r==="error",t=i?"error":s?"ok":a?"working":"dim";return[{id:"mic",label:"MIC",x:44,y:122,w:64,h:32,rx:16,state:t},{id:"webrtc",label:"WEBRTC",x:148,y:122,w:88,h:32,rx:16,state:t},{id:"openai",label:"OPENAI REALTIME",x:288,y:8,w:176,h:32,rx:16,state:i?"error":s?"ok":a?"working":"dim",tone:"sky"},{id:"scoutbot",label:"SCOUTBOT",x:560,y:122,w:112,h:32,rx:16,state:t}]}function y({state:r}){const s=r==="live",a=s?"Call live.":r==="connecting"?"Call connecting.":r==="error"?"Call in error.":"No call; idle.";return e.jsxs("svg",{viewBox:"0 0 720 176",className:"vpd",role:"img","aria-live":"polite","aria-label":`GPT Live path: microphone and WebRTC on this machine, audio arches out to OpenAI Realtime in the cloud and back to Scoutbot. ${a}`,children:[e.jsx(p,{}),e.jsx(x,{label:"THIS MACHINE"}),e.jsx("text",{x:476,y:27,className:"vpd-cloud-label",children:"CLOUD"}),e.jsx("line",{x1:108,y1:138,x2:148,y2:138,className:`vpd-link${s?" vpd-flow":""}`,markerStart:"url(#vpd-arrow-ink)",markerEnd:"url(#vpd-arrow-ink)"}),e.jsx("path",{d:"M 192 122 C 192 80, 300 66, 334 40",className:`vpd-link vpd-link--sky${s?" vpd-flow":""}`,markerEnd:s?"url(#vpd-arrow-sky)":"url(#vpd-arrow-sky-dim)"}),e.jsx("path",{d:"M 418 42 C 452 66, 616 80, 616 122",className:`vpd-link vpd-link--sky${s?" vpd-flow":""}`,markerEnd:s?"url(#vpd-arrow-sky)":"url(#vpd-arrow-sky-dim)"}),e.jsx("circle",{cx:209,cy:96,r:2.5,className:"vpd-crossing"}),e.jsx("circle",{cx:590,cy:96,r:2.5,className:"vpd-crossing"}),h(r).map(i=>e.jsx(c,{node:i},i.id))]})}function w(r,s,a){const i=r?.hostReachable===!0,t=r?r.microphoneGranted===!0?"ready":"warn":"dim",l=r?i?"ready":"warn":"dim",n=[{id:"mic",label:"MIC",x:44,y:122,w:60,h:32,rx:6,state:t},{id:"stt",label:"STT",x:140,y:122,w:64,h:32,rx:6,state:l},{id:"turn",label:"TURN ENGINE",x:244,y:122,w:128,h:32,rx:6,state:"pending"},{id:"scoutbot",label:"SCOUTBOT",x:416,y:122,w:104,h:32,rx:6,state:s?"ready":"dim"},{id:"tts",label:"TTS",x:560,y:122,w:60,h:32,rx:6,state:l}];return a==="listening"?(n[0].state="working",n[1].state="working"):a==="processing"?n[1].state="working":a==="thinking"?n[3].state="working":a==="speaking"&&(n[4].state="working"),n}function g({probe:r,replyModel:s,phase:a,ttsProviderLabel:i,ttsMetered:t}){const l=a==="listening",n=a==="processing"||a==="thinking",d=a==="speaking",v=!a||a==="ready"?"Idle.":a==="listening"?"Listening to a turn.":n?"Transcribing or thinking.":a==="speaking"?"Speaking a reply.":"Checking the voice host.",m=t&&i?` Spoken replies send reply text to ${i} TTS.`:" Spoken replies are synthesized on-device.";return e.jsxs("svg",{viewBox:"0 88 720 116",className:"vpd",role:"img","aria-live":"polite","aria-label":`Local Live path: microphone, speech-to-text, turn engine, Scoutbot, and text-to-speech as one chain inside this machine, ending at the speaker. The turn engine is not wired yet. Reply text leaves the chain to the configured reply model.${m} ${v}`,children:[e.jsx(p,{}),e.jsx(x,{label:"THIS MACHINE — AUDIO NEVER LEAVES"}),e.jsx("line",{x1:104,y1:138,x2:140,y2:138,className:`vpd-link${l?" vpd-flow":""}`,markerEnd:"url(#vpd-arrow-ink)"}),e.jsx("line",{x1:204,y1:138,x2:244,y2:138,className:`vpd-link vpd-link--pending${n?" vpd-flow":""}`,markerEnd:"url(#vpd-arrow-ink)"}),e.jsx("line",{x1:372,y1:138,x2:416,y2:138,className:`vpd-link vpd-link--pending${n?" vpd-flow":""}`,markerEnd:"url(#vpd-arrow-ink)"}),e.jsx("line",{x1:520,y1:138,x2:560,y2:138,className:`vpd-link${d?" vpd-flow":""}`,markerEnd:"url(#vpd-arrow-ink)"}),e.jsx("line",{x1:620,y1:138,x2:648,y2:138,className:`vpd-link${d?" vpd-flow":""}`,markerEnd:"url(#vpd-arrow-ink)"}),e.jsxs("g",{className:d?"vpd-speaker-live":void 0,children:[e.jsx("path",{d:"M 652 135 L 657 135 L 663 130 L 663 146 L 657 141 L 652 141 Z",className:"vpd-speaker"}),e.jsx("path",{d:"M 666 133 Q 669 138 666 143",className:"vpd-speaker-arc"}),e.jsx("path",{d:"M 669 131 Q 673 138 669 145",className:"vpd-speaker-arc"})]}),e.jsx("line",{x1:468,y1:154,x2:468,y2:182,className:`vpd-stub${n?" vpd-flow":""}`}),e.jsx("text",{x:478,y:185,className:"vpd-stub-label",children:"TEXT TO REPLY MODEL"}),t&&i&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:590,y1:154,x2:590,y2:196,className:`vpd-stub${d?" vpd-flow":""}`}),e.jsx("text",{x:598,y:199,className:"vpd-stub-label",children:`TEXT TO ${i.toUpperCase()} TTS`})]}),w(r,s,a).map(o=>e.jsx(c,{node:o},o.id))]})}function N({mode:r,liveState:s,probe:a,replyModel:i,localPhase:t=null,ttsProviderLabel:l=null,ttsMetered:n=!1}){return e.jsx("div",{className:"vpd-wrap","data-mode":r,children:r==="gpt-live"?e.jsx(y,{state:s}):e.jsx(g,{probe:a,replyModel:i,phase:t,ttsProviderLabel:l,ttsMetered:n})})}export{N as VoicePathDiagram};
@@ -1 +1 @@
1
- import{j as n,r as h}from"./index-EsrkGBcv.js";import{r as w,o as g}from"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";const p={microphone:{label:"Microphone",privacyPane:"Microphone",hint:"Scout Menu captures audio for web dictation. The browser never records.",appLabel:"Scout Menu"},speechRecognition:{label:"Speech recognition",privacyPane:"Speech Recognition",hint:"Live partials and Apple Speech fallback while Parakeet warms.",appLabel:"Scout Menu"}};function x(e){return e?e.granted?"ok":e.canRequest?"warn":e.status==="denied"||e.status==="restricted"?"fail":"warn":"idle"}function y(e){if(!e)return"Unknown";if(e.granted)return"Granted";switch(e.status){case"notDetermined":return"Not requested";case"denied":return"Denied";case"restricted":return"Restricted";case"authorized":return"Granted";default:return e.status}}function M(e,s){return e?e.granted?`${p[s].appLabel} is allowed to use ${p[s].label.toLowerCase()}.`:e.canRequest?`Click Request to show the macOS permission dialog for ${p[s].appLabel}.`:e.status==="denied"?`Choose Retry access. Scout Menu will open macOS ${p[s].privacyPane} settings and detect the change automatically.`:e.status==="restricted"?`${p[s].label} access is restricted on this Mac.`:`${p[s].appLabel} needs ${p[s].label.toLowerCase()} access before dictation works.`:"Launch Scout Menu on this Mac, then refresh."}function j(e){return!!(e&&!e.granted&&!e.canRequest&&e.status!=="unknown")}function R(e){return!!(e&&!e.granted&&e.status!=="restricted"&&e.status!=="unknown")}function L({hostOnline:e,micPermission:s,speechPermission:r,modelReady:l}){const c=s?.granted??!1,d=r?.granted??!1,u=e&&c&&d;let i="fail",t="Scout Menu not connected",a="Launch Scout Menu on this Mac. Web dictation uses the Scout voice host — not the browser microphone.";return e&&!c&&(s?.status==="denied"||s?.status==="restricted")?(i="fail",t="Microphone blocked for Scout Menu",a=s?.status==="restricted"?"Microphone access is restricted on this Mac.":"Choose Retry access below. Scout will open the right macOS pane and detect the change."):e&&!c&&s?.canRequest?(i="warn",t="Microphone access needed",a="Request permission below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&c&&!d&&(r?.status==="denied"||r?.status==="restricted")?(i="warn",t="Speech recognition blocked for Scout Menu",a=r?.status==="restricted"?"Speech recognition is restricted on this Mac.":"Open Privacy & Security → Speech Recognition to change it."):e&&c&&!d?(i="warn",t="Speech recognition needed",a="Request access below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&u?(i="ok",t=l?"Dictation ready":"Dictation ready · model warming",a="Scout Menu is running as the voice host. The browser does not capture audio."):e&&(i="warn",t="Voice host connected",a="Finish permissions below to enable dictation."),n.jsxs("div",{className:`s-voice-host-banner s-voice-host-banner--${i}`,children:[n.jsx("div",{className:"s-voice-host-banner-dot","aria-hidden":!0}),n.jsxs("div",{className:"s-voice-host-banner-copy",children:[n.jsx("div",{className:"s-voice-host-banner-title",children:t}),n.jsx("div",{className:"s-voice-host-banner-detail",children:a}),n.jsxs("div",{className:"s-voice-host-banner-meta",children:[n.jsx("span",{children:"Voice host · Scout Menu"}),n.jsx("span",{children:e?"Connected":"Offline"}),n.jsx("span",{children:"Capture · native"})]})]})]})}function f({kind:e,status:s,disabled:r,onActionError:l,onRefresh:c}){const[d,u]=h.useState(!1),i=h.useRef(s),t=p[e],a=x(s);h.useEffect(()=>{i.current=s},[s]);const m=h.useCallback(async()=>{for(let o=0;o<30;o+=1)if(await new Promise(S=>window.setTimeout(S,1e3)),await c(),i.current?.granted)return},[c]),v=h.useCallback(async()=>{u(!0);try{await w(e),await m()}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l,m]),b=h.useCallback(async()=>{u(!0);try{await g(e)}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l]);return n.jsxs("div",{className:`s-voice-permission-card s-voice-permission-card--${a}`,children:[n.jsxs("div",{className:"s-voice-permission-card-head",children:[n.jsx("span",{className:"s-voice-permission-card-dot","aria-hidden":!0}),n.jsxs("div",{children:[n.jsx("div",{className:"s-voice-permission-card-label",children:t.label}),n.jsxs("div",{className:"s-voice-permission-card-app",children:["via ",t.appLabel]})]}),n.jsx("span",{className:`s-voice-permission-card-status s-voice-permission-card-status--${a}`,children:y(s)})]}),n.jsx("p",{className:"s-voice-permission-card-hint",children:t.hint}),n.jsx("p",{className:"s-voice-permission-card-detail",children:M(s,e)}),n.jsxs("div",{className:"s-voice-permission-card-actions",children:[R(s)?n.jsx("button",{type:"button",className:"s-voice-permission-btn s-voice-permission-btn--primary",disabled:r||d,onClick:()=>{v()},children:d?s?.canRequest?"Requesting…":"Waiting for macOS…":s?.canRequest?"Request access":"Retry access"}):null,j(s)?n.jsxs("button",{type:"button",className:"s-voice-permission-btn",disabled:r||d,onClick:()=>{b()},children:["Open Privacy & Security → ",t.privacyPane]}):null]})]})}function P({permissions:e,hostOnline:s,disabled:r,onError:l,onRefresh:c}){const d=e?.find(i=>i.kind==="microphone")??null,u=e?.find(i=>i.kind==="speechRecognition")??null;return n.jsxs("div",{className:"s-voice-permissions-panel",children:[n.jsx(f,{kind:"microphone",status:s?d:null,disabled:r||!s,onActionError:l,onRefresh:c}),n.jsx(f,{kind:"speechRecognition",status:s?u:null,disabled:r||!s,onActionError:l,onRefresh:c}),s?null:n.jsx("p",{className:"s-voice-permissions-offline",children:"Scout Menu is not reporting to this web server. Permissions are managed on the Mac where Scout Menu runs."})]})}export{L as VoiceHostStatusBanner,P as VoicePermissionsPanel};
1
+ import{j as n,r as h}from"./index-BFbLvCJn.js";import{r as w,o as g}from"./scout-voice-Cdh6pCsb.js";import"./fx-z37u1o2z.js";const p={microphone:{label:"Microphone",privacyPane:"Microphone",hint:"Scout Menu captures audio for web dictation. The browser never records.",appLabel:"Scout Menu"},speechRecognition:{label:"Speech recognition",privacyPane:"Speech Recognition",hint:"Live partials and Apple Speech fallback while Parakeet warms.",appLabel:"Scout Menu"}};function x(e){return e?e.granted?"ok":e.canRequest?"warn":e.status==="denied"||e.status==="restricted"?"fail":"warn":"idle"}function y(e){if(!e)return"Unknown";if(e.granted)return"Granted";switch(e.status){case"notDetermined":return"Not requested";case"denied":return"Denied";case"restricted":return"Restricted";case"authorized":return"Granted";default:return e.status}}function M(e,s){return e?e.granted?`${p[s].appLabel} is allowed to use ${p[s].label.toLowerCase()}.`:e.canRequest?`Click Request to show the macOS permission dialog for ${p[s].appLabel}.`:e.status==="denied"?`Choose Retry access. Scout Menu will open macOS ${p[s].privacyPane} settings and detect the change automatically.`:e.status==="restricted"?`${p[s].label} access is restricted on this Mac.`:`${p[s].appLabel} needs ${p[s].label.toLowerCase()} access before dictation works.`:"Launch Scout Menu on this Mac, then refresh."}function j(e){return!!(e&&!e.granted&&!e.canRequest&&e.status!=="unknown")}function R(e){return!!(e&&!e.granted&&e.status!=="restricted"&&e.status!=="unknown")}function L({hostOnline:e,micPermission:s,speechPermission:r,modelReady:l}){const c=s?.granted??!1,d=r?.granted??!1,u=e&&c&&d;let i="fail",t="Scout Menu not connected",a="Launch Scout Menu on this Mac. Web dictation uses the Scout voice host — not the browser microphone.";return e&&!c&&(s?.status==="denied"||s?.status==="restricted")?(i="fail",t="Microphone blocked for Scout Menu",a=s?.status==="restricted"?"Microphone access is restricted on this Mac.":"Choose Retry access below. Scout will open the right macOS pane and detect the change."):e&&!c&&s?.canRequest?(i="warn",t="Microphone access needed",a="Request permission below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&c&&!d&&(r?.status==="denied"||r?.status==="restricted")?(i="warn",t="Speech recognition blocked for Scout Menu",a=r?.status==="restricted"?"Speech recognition is restricted on this Mac.":"Open Privacy & Security → Speech Recognition to change it."):e&&c&&!d?(i="warn",t="Speech recognition needed",a="Request access below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&u?(i="ok",t=l?"Dictation ready":"Dictation ready · model warming",a="Scout Menu is running as the voice host. The browser does not capture audio."):e&&(i="warn",t="Voice host connected",a="Finish permissions below to enable dictation."),n.jsxs("div",{className:`s-voice-host-banner s-voice-host-banner--${i}`,children:[n.jsx("div",{className:"s-voice-host-banner-dot","aria-hidden":!0}),n.jsxs("div",{className:"s-voice-host-banner-copy",children:[n.jsx("div",{className:"s-voice-host-banner-title",children:t}),n.jsx("div",{className:"s-voice-host-banner-detail",children:a}),n.jsxs("div",{className:"s-voice-host-banner-meta",children:[n.jsx("span",{children:"Voice host · Scout Menu"}),n.jsx("span",{children:e?"Connected":"Offline"}),n.jsx("span",{children:"Capture · native"})]})]})]})}function f({kind:e,status:s,disabled:r,onActionError:l,onRefresh:c}){const[d,u]=h.useState(!1),i=h.useRef(s),t=p[e],a=x(s);h.useEffect(()=>{i.current=s},[s]);const m=h.useCallback(async()=>{for(let o=0;o<30;o+=1)if(await new Promise(S=>window.setTimeout(S,1e3)),await c(),i.current?.granted)return},[c]),v=h.useCallback(async()=>{u(!0);try{await w(e),await m()}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l,m]),b=h.useCallback(async()=>{u(!0);try{await g(e)}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l]);return n.jsxs("div",{className:`s-voice-permission-card s-voice-permission-card--${a}`,children:[n.jsxs("div",{className:"s-voice-permission-card-head",children:[n.jsx("span",{className:"s-voice-permission-card-dot","aria-hidden":!0}),n.jsxs("div",{children:[n.jsx("div",{className:"s-voice-permission-card-label",children:t.label}),n.jsxs("div",{className:"s-voice-permission-card-app",children:["via ",t.appLabel]})]}),n.jsx("span",{className:`s-voice-permission-card-status s-voice-permission-card-status--${a}`,children:y(s)})]}),n.jsx("p",{className:"s-voice-permission-card-hint",children:t.hint}),n.jsx("p",{className:"s-voice-permission-card-detail",children:M(s,e)}),n.jsxs("div",{className:"s-voice-permission-card-actions",children:[R(s)?n.jsx("button",{type:"button",className:"s-voice-permission-btn s-voice-permission-btn--primary",disabled:r||d,onClick:()=>{v()},children:d?s?.canRequest?"Requesting…":"Waiting for macOS…":s?.canRequest?"Request access":"Retry access"}):null,j(s)?n.jsxs("button",{type:"button",className:"s-voice-permission-btn",disabled:r||d,onClick:()=>{b()},children:["Open Privacy & Security → ",t.privacyPane]}):null]})]})}function P({permissions:e,hostOnline:s,disabled:r,onError:l,onRefresh:c}){const d=e?.find(i=>i.kind==="microphone")??null,u=e?.find(i=>i.kind==="speechRecognition")??null;return n.jsxs("div",{className:"s-voice-permissions-panel",children:[n.jsx(f,{kind:"microphone",status:s?d:null,disabled:r||!s,onActionError:l,onRefresh:c}),n.jsx(f,{kind:"speechRecognition",status:s?u:null,disabled:r||!s,onActionError:l,onRefresh:c}),s?null:n.jsx("p",{className:"s-voice-permissions-offline",children:"Scout Menu is not reporting to this web server. Permissions are managed on the Mac where Scout Menu runs."})]})}export{L as VoiceHostStatusBanner,P as VoicePermissionsPanel};
@@ -1,4 +1,4 @@
1
- import{r as x,j as s}from"./index-EsrkGBcv.js";import{a as C}from"./api-DSqpVKC7.js";import{t as _}from"./voice-turn-ledger-BMZxlSjg.js";const $=t=>`${Math.round(t).toLocaleString("en-US")} ms`,F=t=>`${t.toFixed(3)}s`,K=t=>new Date(t).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",second:"2-digit"}),H=(t,n)=>`${t>=n?"+":"−"}${(Math.abs(t-n)/1e3).toFixed(3)}s`;async function Q(t,n){const l=[],a=await fetch(`/api/voice/session/${encodeURIComponent(t)}/events`,{headers:{accept:"text/event-stream"},signal:n});if(!a.ok||!a.body)return l;const o=a.body.getReader(),i=new TextDecoder;let d="";const f=Date.now()+1600,r=()=>{d=d.replace(/\r\n/g,`
1
+ import{r as x,j as s}from"./index-BFbLvCJn.js";import{a as C}from"./api-DSqpVKC7.js";import{t as _}from"./voice-turn-ledger-BMZxlSjg.js";const $=t=>`${Math.round(t).toLocaleString("en-US")} ms`,F=t=>`${t.toFixed(3)}s`,K=t=>new Date(t).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",second:"2-digit"}),H=(t,n)=>`${t>=n?"+":"−"}${(Math.abs(t-n)/1e3).toFixed(3)}s`;async function Q(t,n){const l=[],a=await fetch(`/api/voice/session/${encodeURIComponent(t)}/events`,{headers:{accept:"text/event-stream"},signal:n});if(!a.ok||!a.body)return l;const o=a.body.getReader(),i=new TextDecoder;let d="";const f=Date.now()+1600,r=()=>{d=d.replace(/\r\n/g,`
2
2
  `);let h=d.indexOf(`
3
3
 
4
4
  `);for(;h>=0;){const w=d.slice(0,h);d=d.slice(h+2);let p="message";const T=[];for(const j of w.split(`
@@ -1 +1 @@
1
- import{j as a,r as b}from"./index-EsrkGBcv.js";import{a as x}from"./voice-turn-ledger-BMZxlSjg.js";const u=l=>`${l.toFixed(1)}s`;function g(l,n,i){return[{key:"you",label:"you",match:e=>e.lane==="you"},{key:"stt",label:"stt",match:e=>e.lane==="host"},{key:"reply",label:"reply model",match:e=>e.lane==="scoutbot",ticks:!0},{key:"voice",label:i??"voice",match:e=>e.lane==="voice"&&e.tone==="prep"},{key:"speaker",label:"speaker",match:e=>e.lane==="voice"&&e.tone==="speak"}].map(e=>{const r=l?l.spans.filter(e.match):[];if(r.length===0)return{key:e.key,label:e.label,state:"pending"};const o=r.find(s=>s.end===null);if(o&&n!==void 0)return{key:e.key,label:e.label,state:"active",sec:Math.max(0,n-o.start)};const p=Math.min(...r.map(s=>s.start)),t=Math.max(...r.map(s=>s.end??n??s.start),...e.ticks&&l?l.ticks.map(s=>s.at):[0]);return{key:e.key,label:e.label,state:"done",sec:Math.max(0,t-p)}})}function $({state:l,floorWho:n,speakOpen:i=!1,voiceName:c}){const e=[{key:"you",label:"you",state:"pending"},{key:"webrtc",label:"webrtc",state:"pending"},{key:"reply",label:"openai realtime",sky:!0,state:"pending"},{key:"voice",label:c??"voice",sky:!0,state:"pending"},{key:"speaker",label:"speaker",state:"pending"}];if(l!=="live")return e;const r=n==="you"?0:n==="Scoutbot"?2:n==="Scout"?i?4:2:-1;return e.map((o,p)=>({...o,state:p===r?"active":"done"}))}function S({mode:l,stops:n,connecting:i=!1,error:c=!1,continuous:e=!1}){const r=["vp7-track",i?"vp7-track--connecting":"",c?"vp7-track--error":""].filter(Boolean).join(" "),o=i?"; connecting station by station":e?`; circuit open end to end${n.some(t=>t.state==="active")?"":"; current speaker not observed"}`:c?"; in error":"",p=n.map(t=>{const s=e&&t.state==="done"?"connected":t.state,v=!e&&t.sec!==void 0?`, ${u(t.sec)}`:"";return`${t.label}: ${s}${v}`}).join("; ");return a.jsx("div",{className:r,role:"img","aria-label":`${l==="gpt-live"?"GPT Live":"Local Live"} path: ${p}${o}.`,children:n.map((t,s)=>a.jsxs(b.Fragment,{children:[s>0&&a.jsx("span",{className:`vp7-link${t.sky?" vp7-link--sky":""}${e||t.state!=="pending"?" vp7-link--filled":""}${!e&&t.state==="active"?" vp7-link--filling":""}`,style:{"--i":s},"aria-hidden":"true",children:t.state==="active"&&a.jsx("i",{})}),a.jsxs("span",{className:`vp7-stop vp7-stop--${t.state}${t.sky?" vp7-stop--sky":""}`,style:{"--i":s},children:[a.jsx("span",{className:"vp7-dot","aria-hidden":"true"}),a.jsx("span",{className:"vp7-stop-label",children:t.label}),a.jsx("span",{className:"vp7-stop-time",children:e||t.sec===void 0?"":u(t.sec)})]})]},t.key))})}const j={you:"you",live:"sky",host:"transcribe",snap:"transcribe",model:"reply",scout:"reply",prep:"transcribe",speak:"speak",quiet:"quiet"};function q(l){return l?.spans[0]?.lane==="you"?"you":void 0}function T({who:l,whoTone:n="dim",clock:i,story:c,quote:e,quoteWho:r,placeholder:o,turn:p,now:t,live:s=!1,lanesOpen:v=!1,onToggleLanes:y}){const m=p?x(p,t):null,d=m&&m.length>0?a.jsx(a.Fragment,{children:m.map((h,k)=>a.jsx("span",{className:`vp7-share-seg vp7-share-seg--${j[h.tone]}${s&&k===m.length-1&&h.tone!=="quiet"?" vp7-share-seg--live":""}`,style:{flexGrow:Math.max(h.to-h.from,.08)}},k))}):null;return a.jsxs("div",{className:"vp7-hero",children:[a.jsxs("p",{className:"vp7-hero-eyebrow",children:[a.jsx("b",{className:`vp7-who vp7-who--${n}`,children:l}),i?a.jsx("span",{className:"vp7-hero-clock",children:i}):null,c?a.jsx("span",{className:"vp7-hero-story",children:c}):null]}),e?a.jsxs("p",{className:"vp7-hero-quote",children:[a.jsx("span",{className:"vp7-quote-mark",children:"“"}),e,a.jsx("span",{className:"vp7-quote-mark",children:"”"}),r&&a.jsxs("span",{className:"vp7-quote-who",children:[" — ",r]})]}):a.jsx("p",{className:"vp7-hero-quote vp7-hero-quote--rest",children:o??"…"}),d?y?a.jsx("button",{type:"button",className:"vp7-share",onClick:y,"aria-pressed":v,"aria-label":"Share of the turn — toggle the lanes timeline",title:"Turn lanes",children:d}):a.jsx("div",{className:"vp7-share",role:"img","aria-label":"Share of the turn",children:d}):null]})}export{T as VoiceTurnHero,S as VoiceTurnStageTrack,$ as gptStageStops,g as localStageStops,q as voiceTurnQuoteWho};
1
+ import{j as a,r as b}from"./index-BFbLvCJn.js";import{a as x}from"./voice-turn-ledger-BMZxlSjg.js";const u=l=>`${l.toFixed(1)}s`;function g(l,n,i){return[{key:"you",label:"you",match:e=>e.lane==="you"},{key:"stt",label:"stt",match:e=>e.lane==="host"},{key:"reply",label:"reply model",match:e=>e.lane==="scoutbot",ticks:!0},{key:"voice",label:i??"voice",match:e=>e.lane==="voice"&&e.tone==="prep"},{key:"speaker",label:"speaker",match:e=>e.lane==="voice"&&e.tone==="speak"}].map(e=>{const r=l?l.spans.filter(e.match):[];if(r.length===0)return{key:e.key,label:e.label,state:"pending"};const o=r.find(s=>s.end===null);if(o&&n!==void 0)return{key:e.key,label:e.label,state:"active",sec:Math.max(0,n-o.start)};const p=Math.min(...r.map(s=>s.start)),t=Math.max(...r.map(s=>s.end??n??s.start),...e.ticks&&l?l.ticks.map(s=>s.at):[0]);return{key:e.key,label:e.label,state:"done",sec:Math.max(0,t-p)}})}function $({state:l,floorWho:n,speakOpen:i=!1,voiceName:c}){const e=[{key:"you",label:"you",state:"pending"},{key:"webrtc",label:"webrtc",state:"pending"},{key:"reply",label:"openai realtime",sky:!0,state:"pending"},{key:"voice",label:c??"voice",sky:!0,state:"pending"},{key:"speaker",label:"speaker",state:"pending"}];if(l!=="live")return e;const r=n==="you"?0:n==="Scoutbot"?2:n==="Scout"?i?4:2:-1;return e.map((o,p)=>({...o,state:p===r?"active":"done"}))}function S({mode:l,stops:n,connecting:i=!1,error:c=!1,continuous:e=!1}){const r=["vp7-track",i?"vp7-track--connecting":"",c?"vp7-track--error":""].filter(Boolean).join(" "),o=i?"; connecting station by station":e?`; circuit open end to end${n.some(t=>t.state==="active")?"":"; current speaker not observed"}`:c?"; in error":"",p=n.map(t=>{const s=e&&t.state==="done"?"connected":t.state,v=!e&&t.sec!==void 0?`, ${u(t.sec)}`:"";return`${t.label}: ${s}${v}`}).join("; ");return a.jsx("div",{className:r,role:"img","aria-label":`${l==="gpt-live"?"GPT Live":"Local Live"} path: ${p}${o}.`,children:n.map((t,s)=>a.jsxs(b.Fragment,{children:[s>0&&a.jsx("span",{className:`vp7-link${t.sky?" vp7-link--sky":""}${e||t.state!=="pending"?" vp7-link--filled":""}${!e&&t.state==="active"?" vp7-link--filling":""}`,style:{"--i":s},"aria-hidden":"true",children:t.state==="active"&&a.jsx("i",{})}),a.jsxs("span",{className:`vp7-stop vp7-stop--${t.state}${t.sky?" vp7-stop--sky":""}`,style:{"--i":s},children:[a.jsx("span",{className:"vp7-dot","aria-hidden":"true"}),a.jsx("span",{className:"vp7-stop-label",children:t.label}),a.jsx("span",{className:"vp7-stop-time",children:e||t.sec===void 0?"":u(t.sec)})]})]},t.key))})}const j={you:"you",live:"sky",host:"transcribe",snap:"transcribe",model:"reply",scout:"reply",prep:"transcribe",speak:"speak",quiet:"quiet"};function q(l){return l?.spans[0]?.lane==="you"?"you":void 0}function T({who:l,whoTone:n="dim",clock:i,story:c,quote:e,quoteWho:r,placeholder:o,turn:p,now:t,live:s=!1,lanesOpen:v=!1,onToggleLanes:y}){const m=p?x(p,t):null,d=m&&m.length>0?a.jsx(a.Fragment,{children:m.map((h,k)=>a.jsx("span",{className:`vp7-share-seg vp7-share-seg--${j[h.tone]}${s&&k===m.length-1&&h.tone!=="quiet"?" vp7-share-seg--live":""}`,style:{flexGrow:Math.max(h.to-h.from,.08)}},k))}):null;return a.jsxs("div",{className:"vp7-hero",children:[a.jsxs("p",{className:"vp7-hero-eyebrow",children:[a.jsx("b",{className:`vp7-who vp7-who--${n}`,children:l}),i?a.jsx("span",{className:"vp7-hero-clock",children:i}):null,c?a.jsx("span",{className:"vp7-hero-story",children:c}):null]}),e?a.jsxs("p",{className:"vp7-hero-quote",children:[a.jsx("span",{className:"vp7-quote-mark",children:"“"}),e,a.jsx("span",{className:"vp7-quote-mark",children:"”"}),r&&a.jsxs("span",{className:"vp7-quote-who",children:[" — ",r]})]}):a.jsx("p",{className:"vp7-hero-quote vp7-hero-quote--rest",children:o??"…"}),d?y?a.jsx("button",{type:"button",className:"vp7-share",onClick:y,"aria-pressed":v,"aria-label":"Share of the turn — toggle the lanes timeline",title:"Turn lanes",children:d}):a.jsx("div",{className:"vp7-share",role:"img","aria-label":"Share of the turn",children:d}):null]})}export{T as VoiceTurnHero,S as VoiceTurnStageTrack,$ as gptStageStops,g as localStageStops,q as voiceTurnQuoteWho};
@@ -1 +1 @@
1
- import{j as t}from"./index-EsrkGBcv.js";import{t as x,b as N,c as b,i as y,a as S,f as k}from"./voice-turn-ledger-BMZxlSjg.js";/* empty css */const g=["you","live","scoutbot","scout"],T=["you","host","scoutbot","scout","voice"],$={you:"you",live:"Scout",host:"transcribe",scoutbot:"Scoutbot",scout:"tools",voice:"speak"},d=(e,i)=>`${e/i*100}%`;function f(e){return e<=16?2:e<=40?5:10}function A({window:e}){const i=f(e),o=Array.from({length:Math.floor(e/i)+1},(l,r)=>r*i);return t.jsx("div",{className:"vtl-axis","aria-hidden":"true",children:o.map(l=>t.jsx("span",{style:{left:d(l,e)},children:l===0?"0s":l},l))})}function q({window:e}){const i=f(e),o=Array.from({length:Math.floor(e/i)},(l,r)=>(r+1)*i);return t.jsx(t.Fragment,{children:o.map(l=>t.jsx("span",{className:"vtl-grid",style:{left:d(l,e)},"aria-hidden":"true"},l))})}function E(e,i){if(i==="local-live")return T;const o=new Set(e.spans.map(l=>l.lane));return g.filter(l=>l==="you"||l==="live"||l==="scoutbot"||l==="scout"||o.has(l))}function L(e){return k(e.quote)||void 0}function G({turn:e,now:i,mode:o}){const l=i??x(e),r=i!==void 0,n=N(e,i),u=E(e,o),a=r?b(e,l):null;return t.jsxs("div",{className:"vtl vtl--lanes",children:[a&&t.jsxs("p",{className:"vtl-lanes-kicker",children:[t.jsx("b",{children:a.who}),t.jsxs("span",{children:[" ",a.since.toFixed(1),"s"]}),a.beneath?t.jsxs("span",{className:"vtl-beneath",children:[" · ",a.beneath]}):null]}),t.jsxs("div",{className:"vtl-lanes",children:[t.jsx("div",{className:"vtl-labels",children:u.map(c=>t.jsx("span",{children:$[c]},c))}),t.jsxs("div",{className:"vtl-track",children:[t.jsx(q,{window:n}),u.map(c=>t.jsxs("div",{className:"vtl-lane",children:[e.spans.filter(s=>s.lane===c).map(s=>{const m=s.end??i??s.start,p=s.end===null&&r;return t.jsxs("span",{children:[s.label&&t.jsx("span",{className:`vtl-label${s.quote?" is-quote":""}`,style:{left:d(s.start,n),"--l":d(s.start,n)},children:s.label}),t.jsx("span",{className:`vtl-span vtl-t-${s.tone}${p?" is-open":""}`,style:{left:d(s.start,n),width:d(Math.max(m-s.start,.08),n)}})]},s.id)}),e.ticks.filter(s=>s.lane===c).map(s=>t.jsxs("span",{children:[t.jsx("span",{className:"vtl-tick",style:{left:d(s.at,n)}}),t.jsx("span",{className:"vtl-tick-label",style:{left:`calc(${d(s.at,n)} + 4px)`},children:s.label})]},s.id))]},c)),r&&t.jsx("span",{className:"vtl-now",style:{left:d(l,n)},"aria-hidden":"true"}),t.jsx(A,{window:n})]})]})]})}function O({turns:e,selectedId:i,onSelect:o,mode:l,liveId:r,now:n}){const u=e.filter(a=>!y(a)||a.id===r);return u.length===0?t.jsx(V,{mode:l}):t.jsx("ol",{className:"vtl-settle",children:[...u].reverse().map(a=>{const c=L(a),s=a.id===i,m=a.id===r,p=S(a,m?n:void 0),j=x(a,m?n:void 0);return t.jsx("li",{className:`${s?"is-selected":""}${m?" is-live":""}`.trim()||void 0,children:t.jsxs("button",{type:"button",className:"vtl-settle-hit",onClick:()=>o?.(a.id),"aria-pressed":s,children:[t.jsxs("div",{children:[t.jsxs("span",{className:"vtl-settle-quote",children:[m&&t.jsx("span",{className:"vtl-live-dot","aria-hidden":"true"}),c?`“${c}”`:"turn"]}),t.jsxs("span",{className:"vtl-settle-meta",children:[t.jsx("span",{className:"vtl-mini-strip","aria-hidden":"true",children:p.map((h,v)=>t.jsx("i",{className:`vtl-t-${h.tone}${m&&v===p.length-1&&h.tone!=="quiet"?" is-live":""}`,style:{flexGrow:Math.max(h.to-h.from,.08)}},v))}),t.jsxs("span",{className:"vtl-settle-total",children:[j.toFixed(1),"s"]})]})]}),t.jsx("time",{dateTime:new Date(a.origin).toISOString(),children:new Date(a.origin).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",second:"2-digit"})})]})},a.id)})})}function V({mode:e}){return t.jsx("p",{className:"vtl-empty-line",children:e==="gpt-live"?"Start a call. Seconds and tools land here after the first turn.":"Tap to talk. Seconds and tools land here after the first turn."})}export{V as VoiceTurnEmpty,O as VoiceTurnSettle,G as VoiceTurnView};
1
+ import{j as t}from"./index-BFbLvCJn.js";import{t as x,b as N,c as b,i as y,a as S,f as k}from"./voice-turn-ledger-BMZxlSjg.js";/* empty css */const g=["you","live","scoutbot","scout"],T=["you","host","scoutbot","scout","voice"],$={you:"you",live:"Scout",host:"transcribe",scoutbot:"Scoutbot",scout:"tools",voice:"speak"},d=(e,i)=>`${e/i*100}%`;function f(e){return e<=16?2:e<=40?5:10}function A({window:e}){const i=f(e),o=Array.from({length:Math.floor(e/i)+1},(l,r)=>r*i);return t.jsx("div",{className:"vtl-axis","aria-hidden":"true",children:o.map(l=>t.jsx("span",{style:{left:d(l,e)},children:l===0?"0s":l},l))})}function q({window:e}){const i=f(e),o=Array.from({length:Math.floor(e/i)},(l,r)=>(r+1)*i);return t.jsx(t.Fragment,{children:o.map(l=>t.jsx("span",{className:"vtl-grid",style:{left:d(l,e)},"aria-hidden":"true"},l))})}function E(e,i){if(i==="local-live")return T;const o=new Set(e.spans.map(l=>l.lane));return g.filter(l=>l==="you"||l==="live"||l==="scoutbot"||l==="scout"||o.has(l))}function L(e){return k(e.quote)||void 0}function G({turn:e,now:i,mode:o}){const l=i??x(e),r=i!==void 0,n=N(e,i),u=E(e,o),a=r?b(e,l):null;return t.jsxs("div",{className:"vtl vtl--lanes",children:[a&&t.jsxs("p",{className:"vtl-lanes-kicker",children:[t.jsx("b",{children:a.who}),t.jsxs("span",{children:[" ",a.since.toFixed(1),"s"]}),a.beneath?t.jsxs("span",{className:"vtl-beneath",children:[" · ",a.beneath]}):null]}),t.jsxs("div",{className:"vtl-lanes",children:[t.jsx("div",{className:"vtl-labels",children:u.map(c=>t.jsx("span",{children:$[c]},c))}),t.jsxs("div",{className:"vtl-track",children:[t.jsx(q,{window:n}),u.map(c=>t.jsxs("div",{className:"vtl-lane",children:[e.spans.filter(s=>s.lane===c).map(s=>{const m=s.end??i??s.start,p=s.end===null&&r;return t.jsxs("span",{children:[s.label&&t.jsx("span",{className:`vtl-label${s.quote?" is-quote":""}`,style:{left:d(s.start,n),"--l":d(s.start,n)},children:s.label}),t.jsx("span",{className:`vtl-span vtl-t-${s.tone}${p?" is-open":""}`,style:{left:d(s.start,n),width:d(Math.max(m-s.start,.08),n)}})]},s.id)}),e.ticks.filter(s=>s.lane===c).map(s=>t.jsxs("span",{children:[t.jsx("span",{className:"vtl-tick",style:{left:d(s.at,n)}}),t.jsx("span",{className:"vtl-tick-label",style:{left:`calc(${d(s.at,n)} + 4px)`},children:s.label})]},s.id))]},c)),r&&t.jsx("span",{className:"vtl-now",style:{left:d(l,n)},"aria-hidden":"true"}),t.jsx(A,{window:n})]})]})]})}function O({turns:e,selectedId:i,onSelect:o,mode:l,liveId:r,now:n}){const u=e.filter(a=>!y(a)||a.id===r);return u.length===0?t.jsx(V,{mode:l}):t.jsx("ol",{className:"vtl-settle",children:[...u].reverse().map(a=>{const c=L(a),s=a.id===i,m=a.id===r,p=S(a,m?n:void 0),j=x(a,m?n:void 0);return t.jsx("li",{className:`${s?"is-selected":""}${m?" is-live":""}`.trim()||void 0,children:t.jsxs("button",{type:"button",className:"vtl-settle-hit",onClick:()=>o?.(a.id),"aria-pressed":s,children:[t.jsxs("div",{children:[t.jsxs("span",{className:"vtl-settle-quote",children:[m&&t.jsx("span",{className:"vtl-live-dot","aria-hidden":"true"}),c?`“${c}”`:"turn"]}),t.jsxs("span",{className:"vtl-settle-meta",children:[t.jsx("span",{className:"vtl-mini-strip","aria-hidden":"true",children:p.map((h,v)=>t.jsx("i",{className:`vtl-t-${h.tone}${m&&v===p.length-1&&h.tone!=="quiet"?" is-live":""}`,style:{flexGrow:Math.max(h.to-h.from,.08)}},v))}),t.jsxs("span",{className:"vtl-settle-total",children:[j.toFixed(1),"s"]})]})]}),t.jsx("time",{dateTime:new Date(a.origin).toISOString(),children:new Date(a.origin).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",second:"2-digit"})})]})},a.id)})})}function V({mode:e}){return t.jsx("p",{className:"vtl-empty-line",children:e==="gpt-live"?"Start a call. Seconds and tools land here after the first turn.":"Tap to talk. Seconds and tools land here after the first turn."})}export{V as VoiceTurnEmpty,O as VoiceTurnSettle,G as VoiceTurnView};