@openscout/scout 0.2.107 → 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 +53 -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 +26 -4
  359. package/server.json +2 -2
  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 @@
1
+ import{r as d,j as s}from"./index-BFbLvCJn.js";import{u as C,s as j}from"./mesh-view-store-CVqzYz4K.js";import{NodeDetailPanel as L}from"./NodeDetailPanel-9NaEnZAQ.js";import{u as O}from"./local-agents-BMcFlY_x.js";import{a as $,s as E}from"./use-mesh-node-state-BlWIPTc4.js";import{t as J}from"./time-Dhsh_2EG.js";import{g as R}from"./Provider-BEXAZWd9.js";import{n as T,a as P}from"./agent-state-DDhnFEEP.js";import{a as N}from"./api-DSqpVKC7.js";/* empty css *//* empty css */import"./theme-vars-DNK0nn3k.js";import"./router-CJIx83Ia.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./machine-scope-DJt9RZ2w.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"./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";function B(a){return a.localNode?.advertiseScope==="mesh"}function _(a){const n=new Map;for(const t of a){const r=(t.harness??t.agentClass??"agent").toLowerCase(),o=n.get(r)??{total:0,working:0};o.total+=1,P(t.state)&&(o.working+=1),n.set(r,o)}return Array.from(n.entries()).map(([t,r])=>({label:t,total:r.total,working:r.working})).sort((t,r)=>r.total-t.total).slice(0,6)}function I(a){return a?a.replace(/^https?:\/\//,"").split("/")[0]??a:"Unavailable"}function U(a){return new Promise(n=>window.setTimeout(n,a))}async function z(a,n){let t=null,r=null;for(let o=0;o<=n.attempts;o+=1){try{if(t=await N("/api/mesh"),j(t),a(t))return t}catch(c){r=c}o<n.attempts&&await U(n.intervalMs)}if(t)return t;throw r instanceof Error?r:new Error("Mesh status is temporarily unavailable.")}function D(a){return a.issues.find(n=>n.code==="local_only"||n.code==="mesh_loopback"||n.code==="tailscale_stopped")?.summary??null}function zs(){const{meshSnapshot:a,selectedId:n,selectedType:t}=C(),{agents:r}=O(),o=$(),c=d.useMemo(()=>R(r),[r]),[w,p]=d.useState(!1),[x,h]=d.useState(null),k=d.useCallback(async()=>{p(!0),h({tone:"info",text:"Joining mesh — announcing broker and syncing peers…"});try{const e=await N("/api/mesh/join",{method:"POST",body:"{}"});j(e);const l=e.identity.discoverable?e:await z(i=>i.identity.discoverable,{attempts:6,intervalMs:750});if(l.identity.discoverable){const i=e.discovery,A=i?.discoveredCount!=null?` Found ${i.discoveredCount} peer node${i.discoveredCount===1?"":"s"}.`:"";h(i.error?{tone:"warning",text:`On mesh, but the initial peer sync failed: ${i.error}`}:{tone:"success",text:`On mesh at ${I(l.identity.announceUrl??l.brokerUrl)}.${A}`})}else h({tone:"warning",text:D(l)??"Joined, but this broker is not peer-reachable yet."})}catch(e){h({tone:"error",text:e instanceof Error?e.message:String(e)})}finally{p(!1)}},[]),M=d.useCallback(async()=>{p(!0),h({tone:"info",text:"Leaving mesh…"});try{const e=await N("/api/mesh/leave",{method:"POST",body:"{}"});j(e),h({tone:"success",text:"Local only — peers will no longer discover this broker."})}catch(e){h({tone:"error",text:e instanceof Error?e.message:String(e)})}finally{p(!1)}},[]),y=d.useMemo(()=>{const e={total:c.length,working:0,ready:0,notReady:0};for(const l of c){const i=T(l.state);i==="in_turn"||i==="in_flight"?e.working+=1:i==="callable"?e.ready+=1:e.notReady+=1}return e},[c]),v=d.useMemo(()=>_(c),[c]);if(!a)return s.jsx("div",{className:"sys-inspector-empty",children:s.jsx("p",{children:"Loading mesh…"})});if(n&&t==="node")return s.jsx(L,{machineId:n,mesh:a,issues:a.issues});const m=a,g=Object.values(m.nodes).filter(e=>e.id!==m.localNode?.id).length,S=m.tailscale.onlineCount??0,f=m.localNode?.hostName?.split(".")[0]??m.localNode?.name??m.identity.name??"this broker",b=Object.values(o.entries),u=b.reduce((e,l)=>{const i=E(l.view??null).tone;return!l.view||l.view.broker==="unknown"?e.unchecked+=1:i==="ok"?e.responding+=1:i==="warn"?e.partial+=1:e.silent+=1,e},{responding:0,partial:0,silent:0,unchecked:0});return s.jsxs("div",{className:"sys-inspector-content mesh-summary",children:[s.jsxs("div",{className:"sys-inspector-head",children:[s.jsx("h3",{className:"sys-inspector-title",children:"Network"}),s.jsx("span",{className:"mesh-summary-mode",children:m.identity.modeLabel})]}),s.jsxs("section",{className:"mesh-summary-section",children:[s.jsxs("div",{className:"mesh-summary-counts",children:[s.jsxs("div",{className:"mesh-summary-count",children:[s.jsx("span",{className:"mesh-summary-count-value",children:b.length||g+1}),s.jsx("span",{className:"mesh-summary-count-label",children:"machines"})]}),s.jsxs("div",{className:"mesh-summary-count mesh-summary-count--working",children:[s.jsx("span",{className:"mesh-summary-count-value",children:u.responding}),s.jsx("span",{className:"mesh-summary-count-label",children:"responding"})]}),u.partial>0&&s.jsxs("div",{className:"mesh-summary-count",children:[s.jsx("span",{className:"mesh-summary-count-value",children:u.partial}),s.jsx("span",{className:"mesh-summary-count-label",children:"partial"})]}),u.silent>0&&s.jsxs("div",{className:"mesh-summary-count mesh-summary-count--offline",children:[s.jsx("span",{className:"mesh-summary-count-value",children:u.silent}),s.jsx("span",{className:"mesh-summary-count-label",children:"no answer"})]}),u.unchecked>0&&s.jsxs("div",{className:"mesh-summary-count",children:[s.jsx("span",{className:"mesh-summary-count-value",children:u.unchecked}),s.jsx("span",{className:"mesh-summary-count-label",children:"not checked"})]})]}),s.jsx("p",{className:"mesh-summary-hint",children:o.updatedAt?`Machines last swept ${J(o.updatedAt)}. Select one to see what is running on it.`:"Select a machine to see what is running on it."})]}),s.jsxs("section",{className:"mesh-summary-section",children:[s.jsxs("div",{className:"sys-inspector-section-label",children:["On ",f]}),s.jsxs("div",{className:"mesh-summary-counts",children:[s.jsxs("div",{className:"mesh-summary-count",children:[s.jsx("span",{className:"mesh-summary-count-value",children:y.total}),s.jsx("span",{className:"mesh-summary-count-label",children:"agents"})]}),s.jsxs("div",{className:"mesh-summary-count mesh-summary-count--working",children:[s.jsx("span",{className:"mesh-summary-count-value",children:y.working}),s.jsx("span",{className:"mesh-summary-count-label",children:"working"})]}),s.jsxs("div",{className:"mesh-summary-count",children:[s.jsx("span",{className:"mesh-summary-count-value",children:y.ready}),s.jsx("span",{className:"mesh-summary-count-label",children:"ready"})]}),s.jsxs("div",{className:"mesh-summary-count mesh-summary-count--offline",children:[s.jsx("span",{className:"mesh-summary-count-value",children:y.notReady}),s.jsx("span",{className:"mesh-summary-count-label",children:"not ready"})]})]})]}),v.length>0&&s.jsxs("section",{className:"mesh-summary-section",children:[s.jsxs("div",{className:"sys-inspector-section-label",children:["By harness, on ",f]}),s.jsx("div",{className:"mesh-summary-harness",children:v.map(e=>s.jsxs("div",{className:"mesh-summary-harness-row",children:[s.jsx("span",{className:"mesh-summary-harness-name",children:e.label}),s.jsx("span",{className:"mesh-summary-harness-count",children:e.total}),e.working>0&&s.jsxs("span",{className:"mesh-summary-harness-working",children:[e.working," working"]})]},e.label))})]}),s.jsxs("section",{className:"mesh-summary-section",children:[s.jsx("div",{className:"sys-inspector-section-label",children:"Peers"}),s.jsxs("div",{className:"mesh-summary-peers",children:[s.jsxs("div",{className:"mesh-summary-peer-row",children:[s.jsx("span",{className:"mesh-summary-peer-label",children:"Mesh"}),s.jsx("span",{className:"mesh-summary-peer-value",children:g})]}),m.tailscale.available&&s.jsxs("div",{className:"mesh-summary-peer-row",children:[s.jsx("span",{className:"mesh-summary-peer-label",children:"Tailnet"}),s.jsx("span",{className:`mesh-summary-peer-value${m.tailscale.running?"":" mesh-summary-peer-value--dim"}`,children:m.tailscale.running?`${S} online`:"stopped"})]})]})]}),s.jsxs("section",{className:"mesh-summary-section mesh-summary-reach",children:[s.jsx("div",{className:"sys-inspector-section-label",children:"Mesh"}),s.jsx(F,{joined:B(m),busy:w,tailscaleAvailable:m.tailscale.available,onJoin:()=>{k()},onLeave:()=>{M()}}),x&&s.jsx("div",{className:`sys-banner mesh-action-message sys-banner-${x.tone}`,children:s.jsx("span",{children:x.text})})]})]})}function F({joined:a,busy:n,tailscaleAvailable:t,onJoin:r,onLeave:o}){return s.jsxs("div",{className:"mesh-reach",children:[s.jsxs("label",{className:"mesh-join-toggle",children:[s.jsx("input",{type:"checkbox",checked:a,disabled:n,onChange:()=>{a?o():r()}}),s.jsx("span",{className:"mesh-join-toggle-copy",children:n?"Working…":a?"On mesh":"Join mesh"})]}),!t&&!a&&s.jsx("p",{className:"mesh-join-hint",children:"Tailscale can add automatic discovery; explicit seeds and LAN peers still work."}),a&&s.jsx("p",{className:"mesh-join-hint",children:"Mesh membership is on. Reachability is reported separately above."})]})}export{zs as MeshInspectorPanel};
@@ -1 +1 @@
1
- import{c}from"./createLucideIcon-zZ8Hx7er.js";const e=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],t=c("rocket",e);export{t as R};
1
+ import{c}from"./createLucideIcon-CKbjXlwv.js";const e=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],t=c("rocket",e);export{t as R};
@@ -0,0 +1 @@
1
+ import{r as L,j as Nt,W as ce,X as Mt,Y as Me,Z as Be,L as Bt,$ as zt,N as T,O as w,a0 as Wt,a1 as J,a2 as Kt,a3 as Gt}from"./index-BFbLvCJn.js";import{b as Ht}from"./api-DSqpVKC7.js";import{n as ue}from"./synthetic-agent-routing-aduMYO7P.js";import{g as Vt,h as ze,j as Yt,k as qt}from"./terminal-sessions-3RfJpen8.js";var We=["local","url","sharedConfig","env"];function Ke(e){const t=Qt(e),n=e.audienceIncludes??Xt(e.audienceOrder),s=new Set;function o(a){!e.warnOnUnknown||s.has(a)||(s.add(a),typeof console<"u"&&typeof console.warn=="function"&&console.warn(`[hudsonkit/flags] Unknown feature flag "${a}" resolved false.`))}const r=e.registry;function i(a){const u=r[a];if(!u)return o(a),{key:a,enabled:!1,value:!1,layer:"default",audience:t,reason:"unknown-flag"};const d=Zt(e.layers,a);return d?{key:a,enabled:d.value,value:d.value,layer:d.layer,audience:t,requiredTier:u.tier,reason:"override",definition:u}:u.defaultEnabled?u.tier&&!n(t,u.tier)?{key:a,enabled:!1,value:!1,layer:"default",audience:t,requiredTier:u.tier,reason:"audience-denied",definition:u}:{key:a,enabled:!0,value:!0,layer:"default",audience:t,requiredTier:u.tier,reason:"default",definition:u}:{key:a,enabled:!1,value:!1,layer:"default",audience:t,requiredTier:u.tier,reason:"default",definition:u}}return{registry:e.registry,isEnabled:a=>i(String(a)).enabled,explain:a=>i(String(a)),all:()=>Object.keys(e.registry).sort().map(i),audience:()=>t}}function Qt(e){let t=e.audience.tier;for(const n of We.slice().reverse()){const s=e.layers?.[n]?.audience;s&&(t=s)}return{...e.audience,tier:t}}function Xt(e){return(t,n)=>{if(t.tier===n)return!0;if(!e||e.length===0)return!1;const s=e.indexOf(t.tier),o=e.indexOf(n);return s<0||o<0?!1:s>=o}}function Zt(e,t){for(const n of We){const s=Jt(e?.[n]?.flags?.[t]);if(s!==null)return{layer:n,value:s}}return null}function Jt(e){return e===!0||e==="on"?!0:e===!1||e==="off"?!1:null}function en(e){if(e===!0||e===!1)return e;if(typeof e=="number"){if(e===1)return!0;if(e===0)return!1}if(typeof e!="string")return;const t=e.trim().toLowerCase();if(["1","true","on","yes","enabled","enable"].includes(t))return!0;if(["0","false","off","no","disabled","disable"].includes(t))return!1;if(["default","null","unset","clear"].includes(t))return"default"}function tn(e,t={}){const n=t.paramPrefix??"ff.",s=t.audienceParam??"ffAudience",o=typeof e=="string"?new URL(e,"http://hudson.local"):e,r={};let i;for(const[a,u]of o.searchParams.entries()){if(a===s&&u.trim()&&(i=u.trim()),!a.startsWith(n))continue;const d=a.slice(n.length),f=en(u);d&&f!==void 0&&(r[d]=f)}return{flags:r,audience:i}}var O=1;function Ge(e){if(typeof window>"u")return{version:O};try{const t=window.localStorage?.getItem(e);return nn(t)}catch{return{version:O}}}function q(e,t){if(typeof window>"u")return;const n=He(t),s=JSON.stringify(n);try{window.localStorage?.setItem(e,s)}catch{}sn(e,s)}function nn(e){if(!e)return{version:O};try{const t=JSON.parse(e);return!t||typeof t!="object"?{version:O}:He(t)}catch{return{version:O}}}function He(e){const t={version:O};if(e.audience&&(t.audience=e.audience),e.flags&&typeof e.flags=="object"){t.flags={};for(const[n,s]of Object.entries(e.flags))(s===!0||s===!1)&&(t.flags[n]=s);Object.keys(t.flags).length===0&&delete t.flags}return t}function sn(e,t){if(!(typeof document>"u"))try{const n=encodeURIComponent(t);document.cookie=`${encodeURIComponent(e)}=${n}; Path=/; SameSite=Lax; Max-Age=31536000`}catch{}}var on="hudson.flags",Ve=L.createContext(null);function Ms({registry:e,audience:t,audienceOrder:n,audienceIncludes:s,initialLayers:o,storageKey:r=on,warnOnUnknown:i=!1,children:a}){const[u,d]=L.useState(()=>{const g=o?.local;return{version:1,audience:g?.audience??void 0,flags:rn(g)}});L.useEffect(()=>{const g=Ge(r);(g.audience||Object.keys(g.flags??{}).length>0)&&d(g)},[r]);const f=L.useMemo(()=>({...o,local:{...o?.local,audience:u.audience??o?.local?.audience,flags:{...o?.local?.flags??{},...u.flags??{}}}}),[o,u]),I=L.useMemo(()=>Ke({registry:e,audience:t,audienceOrder:n,audienceIncludes:s,layers:f,warnOnUnknown:i}),[e,t,n,s,f,i]),R=L.useMemo(()=>({...I,layers:f,storageKey:r,setLocalOverride:(g,h)=>{d(P=>{const U={...P.flags??{}};h===null?delete U[g]:U[g]=h;const _={...P,version:1,flags:U};return q(r,_),_})},setLocalAudienceOverride:g=>{d(h=>{const P={...h,version:1,audience:g??void 0};return q(r,P),P})},resetLocalOverrides:()=>{const g={version:1};q(r,g),d(g)}}),[I,f,r]);return Nt.jsx(Ve.Provider,{value:R,children:a})}function Ye(){return L.useContext(Ve)}function Bs(){const e=Ye();if(!e)throw new Error("useFeatureFlags must be used within FeatureFlagsProvider");return e}function zs(e,t=!0){return Ye()?.isEnabled(e)??t}function rn(e){if(!e?.flags)return;const t={};for(const[n,s]of Object.entries(e.flags))(s===!0||s===!1)&&(t[n]=s);return Object.keys(t).length>0?t:void 0}const an=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal"],cn=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.scoutbot","surface.workflows"];function Ee(e,t){return Object.fromEntries(e.map(n=>[n,t]))}const qe={label:"Surface · Scope",description:`Scope presentation on Scout infra — lean lanes/tail/sessions/agents at ${Mt}/*.`,defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","scope","observability"]},un={...qe,label:"Surface · Scope (legacy alias)",description:`Legacy alias for ${ce}. Prefer the primary flag; ${Me} remains for old dev links.`},Ws=ce;function ln(){return{audience:"everyone",flags:{"ops.control":!0,"ops.lanes":!0,...Ee(an,!1),...Ee(cn,!1)}}}const Qe=["ffBundle","ffVariant","scoutBundle","scoutExperience","ab"],Xe=["ffGlobal","scoutGlobalBundle"],Ze=["ffPersist","persistBundle"],dn=new Set(["no-ops","ffAudience",...Qe,...Xe,...Ze]);function Ks(e){for(const t of[...e.searchParams.keys()])(dn.has(t)||t.startsWith("ff."))&&e.searchParams.delete(t);return e}const fn=["everyone","internal","power"],mn="openscout.flags",ee="openscout.flagBundle",pn={tier:"power"},$e=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal","ops.lanes"],Re=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.mesh-ops","surface.scoutbot","surface.workflows"],gn={"nav.sidebar":{label:"Nav · Sidebar",description:"Classic sidebar chrome (8 primary areas + icon rail). Default on since sco-083 soak; opt out with ?ff.nav.sidebar=off. Not included in max-pro.",defaultEnabled:!0,tier:"everyone",owner:"scout-web",tags:["nav","chrome"]},"ops.control":{label:"Ops · Control",description:"Mission control, issues, and the Ops section shell.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops","nav"]},"ops.mesh":{label:"Ops · Network",description:"Mesh topology and peer status.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.runtime":{label:"Ops · Runtime",description:"Runtime / atop process telemetry.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.plans":{label:"Ops · Plans",description:"Plan documents and plan-mode review.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.terminal":{label:"Ops · Terminal",description:"Observe / takeover terminal sessions.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.lanes":{label:"Ops · Agent Lanes",description:"One column per local agent — follow live harness work in power-user mode.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"surface.search":{label:"Surface · Search",description:"Knowledge + indexer search as a top-level nav entry.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","nav"]},"surface.sessions":{label:"Surface · Sessions",description:"Standalone top-level Sessions entry (still reachable under Agents).",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","nav"]},"surface.briefings":{label:"Surface · Briefings",description:"Briefings list + detail.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.work":{label:"Surface · Work",description:"Work item detail.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.activity":{label:"Surface · Activity",description:"Activity stream.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.follow":{label:"Surface · Follow",description:"Follow view.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.mesh-ops":{label:"Surface · Mesh Ops",description:"Mesh Ops — work-item triage over the mesh (hosts rail, item list, inspector).",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","ops"]},"surface.scoutbot":{label:"Surface · Scoutbot",description:"Scoutbot assistant — the inspector panel, the status-bar broadcast chip, and the Message-Scout command-palette actions.",defaultEnabled:!0,tier:"everyone",owner:"scout-web",tags:["surface","assistant"]},"surface.realtime-voice":{label:"Surface · Realtime voice",description:"Live WebRTC voice conversations with Scoutbot through OpenAI Realtime. Operator enablement lives in Settings → Voice; this flag is a build-level kill switch.",defaultEnabled:!0,tier:"everyone",owner:"scout-web",tags:["surface","assistant","voice"]},"surface.workflows":{label:"Surface · Workflows",description:"Observed harness families / workflow topology telemetry on the Agents directory. Off in the lean view — the directory is just the project-grouped agent board.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","observability"]},[ce]:qe,[Me]:un},hn={a:"light-prod",control:"light-prod",light:"light-prod","light-prod":"light-prod",prod:"light-prod",production:"light-prod",b:"max-pro",max:"max-pro","max-pro":"max-pro",pro:"max-pro",treatment:"max-pro",...zt},Pe=new Set(["clear","default","none","reset","unset"]);function K(e,t){return Object.fromEntries(e.map(n=>[n,t]))}function Je(...e){const t={};for(const n of e)n.audience&&(t.audience=n.audience),n.flags&&Object.keys(n.flags).length>0&&(t.flags={...t.flags??{},...n.flags});return t}function le(e){switch(e){case"light-prod":return{audience:"everyone",flags:{...K($e,!1),...K(Re,!1)}};case"max-pro":return{audience:"power",flags:{...K($e,!0),...K(Re,!0)}};case Bt:return ln()}}function j(e){return e?hn[e.trim().toLowerCase()]??null:null}function te(e,t){for(const n of t){const s=e.get(n);if(s!==null)return s}return null}function et(e){const t=te(e,Qe);return j(t)}function wn(e){const t=te(e,Xe);if(t){const i=t.trim().toLowerCase();if(Pe.has(i))return{action:"clear"};const a=j(t);return a?{action:"set",bundle:a}:null}const n=te(e,Ze);if(!n)return null;const s=n.trim().toLowerCase();if(Pe.has(s))return{action:"clear"};if(["0","false","no"].includes(s))return null;const o=j(n);if(o)return{action:"set",bundle:o};const r=et(e);return r?{action:"set",bundle:r}:null}function tt(){if(typeof window>"u")return null;try{return j(window.localStorage.getItem(ee))}catch{return null}}function In(e){if(!(typeof window>"u"))try{e.action==="clear"?window.localStorage.removeItem(ee):window.localStorage.setItem(ee,e.bundle)}catch{}}function Gs(){return tt()??j(Be())??st}function nt(){const e=tt();return e?le(e):{}}const st="light-prod";function ot(){const e=j(Be())??st;return le(e)}function vn(e){const t=wn(e);t&&In(t)}function rt(e=new URLSearchParams(window.location.search)){const t=tn(window.location.href),n=et(e),s=n?le(n):{},o={audience:t.audience??s.audience,flags:{...s.flags??{},...t.flags??{}}};return e.has("no-ops")&&(o.flags={...o.flags,"ops.control":!1}),o}function Sn(){const e=Ge(mn);return{flags:e.flags,audience:e.audience??void 0}}function Hs(){if(typeof window>"u")return{};const e=new URLSearchParams(window.location.search);return vn(e),{sharedConfig:Je(ot(),nt()),url:rt(e)}}function bn(e){const t=typeof window>"u"?{}:{sharedConfig:Je(ot(),nt()),url:rt(),local:Sn()};return Ke({registry:gn,audience:pn,audienceOrder:fn,layers:t,warnOnUnknown:!1}).isEnabled(e)}function at(){return bn("ops.control")}const ne={sm:408,md:512,lg:616},it=240,ct=640,Ln=24,ut="openscout:lane-deck:v1",yn=new Set(["web.ops","macos.lanes","hud.tail","web.embed"]),de=new Set(["sm","md","lg"]),lt={"web.ops":{defaultLaneWidth:"lg",showAutoLanes:!0},"macos.lanes":{defaultLaneWidth:"md",showAutoLanes:!0},"hud.tail":{defaultLaneWidth:"sm",showAutoLanes:!0,defaultHorizon:"30m"},"web.embed":{defaultLaneWidth:"md",showAutoLanes:!0}},En=lt["web.ops"];function fe(e){return dt(e)?lt[e]:En}const H={pinned_left:0,main:1,pinned_right:2};function dt(e){return yn.has(e)}function Vs(e=window.location.search,t=window.location.pathname){const n=new URLSearchParams(e),s=n.get("profile")?.trim().toLowerCase();if(s&&dt(s))return s;const o=n.get("embed")?.trim().toLowerCase();return o==="hud"?"hud.tail":o==="app"?"macos.lanes":t.includes("/lanes/embed")?"web.embed":(t.includes("/ops/lanes"),"web.ops")}function Ys(e=window.location.search){const t=new URLSearchParams(e),n=(t.get("lanes")??t.get("size"))?.trim().toLowerCase();return n&&de.has(n)?n:"lg"}function qs(e,t){if(typeof e=="number"&&Number.isFinite(e))return Math.min(ct,Math.max(it,Math.round(e)));const n=typeof e=="string"&&de.has(e)?e:t;return ne[n]}function Qs(e){const t=Math.min(ct,Math.max(it,Math.round(e)));let n=null,s=Number.POSITIVE_INFINITY;for(const[o,r]of Object.entries(ne)){const i=Math.abs(r-t);i<s&&(s=i,n=o)}return n&&s<=Ln?{px:ne[n],tier:n}:{px:t,tier:null}}function me(e,t,n){return{version:1,profileId:e,defaultLaneWidth:t??n.defaultLaneWidth,defaultHorizon:n.defaultHorizon,laneWidths:{},laneDefs:[],slots:[],showAutoLanes:n.showAutoLanes,updatedAt:Date.now()}}function Ce(e,t){const n=fe(e);return me(e,t,n)}function se(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&de.has(e))return e}function $n(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.id!="string"||!t.id.trim()||t.kind!=="session"&&t.kind!=="harness"&&t.kind!=="project"&&t.kind!=="attention"||typeof t.title!="string"||!t.title.trim()?null:{id:t.id.trim(),kind:t.kind,title:t.title.trim(),sessionId:typeof t.sessionId=="string"?t.sessionId.trim():void 0,harness:typeof t.harness=="string"?t.harness.trim():void 0,projectPath:typeof t.projectPath=="string"?t.projectPath.trim():void 0}}function Rn(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.id!="string"||!t.id.trim()||typeof t.laneDefId!="string"||!t.laneDefId.trim()||t.zone!=="pinned_left"&&t.zone!=="main"&&t.zone!=="pinned_right"||typeof t.position!="number"||!Number.isFinite(t.position)?null:{id:t.id.trim(),laneDefId:t.laneDefId.trim(),zone:t.zone,position:t.position,width:se(t.width)}}function ft(e,t,n,s){if(!e||typeof e!="object")return me(t,n,s);const o=e,r=Array.isArray(o.laneDefs)?o.laneDefs.map($n).filter(d=>d!==null):[],i=Array.isArray(o.slots)?o.slots.map(Rn).filter(d=>d!==null):[],a={};if(o.laneWidths&&typeof o.laneWidths=="object")for(const[d,f]of Object.entries(o.laneWidths)){const I=se(f);I!==void 0&&(a[d]=I)}const u=se(o.defaultLaneWidth);return{version:1,profileId:t,defaultLaneWidth:(typeof u=="string"?u:void 0)??n??s.defaultLaneWidth,defaultHorizon:typeof o.defaultHorizon=="string"?o.defaultHorizon:s.defaultHorizon,laneWidths:a,laneDefs:r,slots:i,showAutoLanes:typeof o.showAutoLanes=="boolean"?o.showAutoLanes:s.showAutoLanes,updatedAt:typeof o.updatedAt=="number"?o.updatedAt:Date.now()}}function Pn(e,t,n){return ft(e,t,n,fe(t))}function Xs(e,t){const n=fe(e),s=t??n.defaultLaneWidth;try{const o=localStorage.getItem(`${ut}:${e}`);return o?Pn(JSON.parse(o),e,s):Ce(e,s)}catch{return Ce(e,s)}}function Cn(e){try{localStorage.setItem(`${ut}:${e.profileId}`,JSON.stringify({...e,updatedAt:Date.now()}))}catch{}}function Zs(e){return[...e].sort((t,n)=>{const s=H[t.zone]-H[n.zone];return s!==0?s:t.position-n.position})}function Js(e,t){return H[e]-H[t]}function mt(){return`slot:${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function pe(e){return e.trim().toLowerCase().replace(/['"]/gu,"").replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function Y(e){return`session:${e}`}function An(e){return`harness:${pe(e)}`}function _n(e){return`project:${pe(e)}`}const Un="attention:needs-input";function pt(e,t){const n=e.filter(s=>s.zone===t);return n.length===0?0:Math.max(...n.map(s=>s.position))+1}function gt(e,t){const n=e.laneDefs.some(s=>s.id===t.id);return{...e,laneDefs:n?e.laneDefs.map(s=>s.id===t.id?t:s):[...e.laneDefs,t]}}function ht(e,t){const n=e.slots.some(s=>s.id===t.id);return{...e,slots:n?e.slots.map(s=>s.id===t.id?t:s):[...e.slots,t]}}function wt(e,t){return{...e,slots:e.slots.filter(n=>n.laneDefId!==t)}}function kn(e,t){const n=Y(t);return{...wt(e,n),laneDefs:e.laneDefs.filter(s=>s.id!==n)}}function eo(e,t){const n=Y(t);return e.slots.some(s=>s.laneDefId===n&&s.zone!=="main")}function to(e,t){const n=Y(t),s=e.slots.find(o=>o.laneDefId===n);return!s||s.zone==="main"?null:s.zone}function no(e,t){const n=t.zone??"pinned_left",s=Y(t.laneId),o=kn(e,t.laneId),r=gt(o,{id:s,kind:"session",title:t.title,sessionId:t.laneId});return ht(r,{id:mt(),laneDefId:s,zone:n,position:pt(r.slots,n),width:t.width})}function so(e,t){const n=t.zone??"pinned_left",s=t.kind==="attention"?Un:t.kind==="harness"&&t.harness?An(t.harness):t.kind==="project"&&t.projectPath?_n(t.projectPath):`${t.kind}:${pe(t.title)}`,o=wt(e,s),r=gt(o,{id:s,kind:t.kind,title:t.title,harness:t.harness,projectPath:t.projectPath});return ht(r,{id:mt(),laneDefId:s,zone:n,position:pt(r.slots,n),width:t.width})}function oo(e,t,n){return{...e,laneWidths:{...e.laneWidths,[t]:n},updatedAt:Date.now()}}function ro(e,t){return{...e,defaultLaneWidth:t,updatedAt:Date.now()}}function ao(e){const t=new Set(e.slots.filter(n=>n.zone!=="main").map(n=>n.laneDefId));return{...e,slots:e.slots.filter(n=>n.zone==="main"),laneDefs:e.laneDefs.filter(n=>!t.has(n.id))}}const V="scope.lanes",oe={defaultLaneWidth:"md",showAutoLanes:!0,defaultHorizon:"30m"},Fn="openscout:lane-deck:v1";function Ae(e){return me(V,e,oe)}function io(e){const t=e??oe.defaultLaneWidth;try{const n=localStorage.getItem(`${Fn}:${V}`);return n?ft(JSON.parse(n),V,t,oe):Ae(t)}catch{return Ae(t)}}function co(e){Cn(e)}const Tn=[w.lanes,w.tail,w.sessions,w.agents];function xn(e){return Tn.includes(e)}function On(e){return e===Kt||e===Gt}function It(e){return Wt(e)}function Q(e,t={}){switch(e){case w.tail:{const n=new URLSearchParams;t.tailQuery&&n.set("q",t.tailQuery);const s=n.toString();return T(e,s?`?${s}`:"")}case w.sessions:return t.sessionId?T(e,`/${encodeURIComponent(t.sessionId)}`):T(e);case w.lanes:return T(J);case w.agents:return T(e);default:return T(J)}}function vt(e){switch(e.view){case"ops":return!e.mode||e.mode==="lanes"?w.lanes:e.mode==="tail"?w.tail:null;case"sessions":return e.agentId?null:w.sessions;case"agents-v2":return e.agentId||e.projectSlug||e.sessionId||e.conversationId?null:w.agents;default:return null}}function Dn(e){const t=vt(e);return t?t===w.tail&&e.view==="ops"?Q(t,{tailQuery:e.tailQuery}):t===w.sessions&&e.view==="sessions"?Q(t,{sessionId:e.sessionId}):Q(t):null}function jn(e,t,n){if(!On(e[0]))return null;const s=e[1]??J;if(!xn(s))return{view:"ops",mode:"lanes"};switch(s){case w.tail:{const o=t.searchParams.get("q")?.trim();return{view:"ops",mode:"tail",...o?{tailQuery:o}:{}}}case w.sessions:return e[2]?n({view:"sessions",sessionId:decodeURIComponent(e[2])}):n({view:"sessions"});case w.agents:return n({view:"agents-v2"});case w.lanes:default:return{view:"ops",mode:"lanes"}}}const Nn=new Set(["no-ops","ffBundle","ffVariant","scoutBundle","scoutExperience","ab","ffGlobal","scoutGlobalBundle","ffPersist","persistBundle","ffAudience","studio","studioInjection","studioMode"]),Mn=["ff.","studio.","studioMode."];function Bn(e){return Nn.has(e)||Mn.some(t=>e.startsWith(t))}const zn=[{key:"open",prefix:"/messages"}];function Wn(e,t){return zn.some(n=>n.key===e&&(t===n.prefix||t.startsWith(`${n.prefix}/`)))}function St(e,t=""){const n=new URL(e,"http://scout.local");new URLSearchParams(t).forEach((r,i)=>{!Bn(i)&&!Wn(i,n.pathname)||n.searchParams.has(i)||n.searchParams.set(i,r)});const o=n.searchParams.toString();return`${n.pathname}${o?`?${o}`:""}`}function uo(e){switch(e){case w.tail:return{view:"ops",mode:"tail"};case w.sessions:return{view:"sessions"};case w.agents:return{view:"agents-v2"};case w.lanes:default:return{view:"ops",mode:"lanes"}}}function Kn(e=typeof window<"u"?window.location.pathname:""){return It(e)}function lo(){return V}function fo(e=Kn()){return e?{"data-scope-presentation":!0}:void 0}function bt(e,t=typeof window<"u"?window.location.pathname:""){return It(t)?Dn(e):null}function Gn(e,t=typeof window<"u"?window.location.pathname:""){return bt(e,t)!==null}function mo(e,t=typeof window<"u"?window.location.pathname:""){return Gn(e,t)?vt(e):null}const po={days:3,sessionLimit:200,hitLimit:60,debounceMs:180};function re(e){return e.root==="HOME"?`~/${e.relPath}`:e.root==="ABSOLUTE"?e.relPath:`$${e.root}/${e.relPath}`}function _e(e){const t=e?.trim();if(!t)return null;const n=t.replace(/[\\/]+$/,""),s=n.split(/[\\/]/).filter(Boolean).at(-1)??n;return s.endsWith(".jsonl")?s.slice(0,-6):s}function F(e){return e.sourceRefs.find(t=>t.kind==="harness_transcript")??null}function Lt(e){return e.sourceRefs.find(t=>t.kind==="file")??null}function ge(e){return e?_e(e.sessionId)??_e(re(e.path)):null}function go(e){const t=ge(e);if(!t)return null;const n=e?.recordRange;return n?`${t}|records ${n[0]}..${n[1]}`:t}function z(e,t){const n=e.facets[t];return Array.isArray(n)?n.filter(Boolean).join(", "):typeof n=="string"?n:""}function M(e){const t=new Set;return e.split(/[^A-Za-z0-9_./-]+/u).map(n=>n.trim()).filter(n=>n.length>1).filter(n=>{const s=n.toLowerCase();return t.has(s)?!1:(t.add(s),!0)}).slice(0,12)}const Hn=/^(events?\s+window(\s+\d+)?|files?\s+touched|tool\s+calls?|indexed\s+snippet|manifest|summary|decisions?|context\s+pack)\b/iu,Ue=/^(claude|codex|kimi|cursor|gpt|gemini)\b/iu,ke=/^(?:claude|codex|kimi|cursor|gpt|gemini)?\s*[a-z0-9._/-]*\s*(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*\s+\d{1,2}(?:\s+at\s+\d{1,2}:\d{2}\s*(?:am|pm)?)?\s*[-–—:]\s*/iu;function yt(e){return Hn.test(e.replace(/\s+/g," ").trim())}function Vn(e){let t=e.replace(/\s+/g," ").trim();if(!t)return"";if(t=t.replace(/<[^>\n]+>/g," ").replace(/\s+/g," ").trim(),ke.test(t))t=t.replace(ke,"").trim();else{const n=t.match(/^(.{6,72}?)\s[-–—]\s+(.+)$/u);if(n){const s=n[1]??"",o=n[2]??"";(Ue.test(s)||/\b(?:am|pm|\d{1,2}:\d{2}|plugin|session|openscout)\b/iu.test(s))&&(t=o.trim())}}return t=t.replace(Ue,"").replace(/^\s*[-–—:]\s*/,"").trim(),t=t.replace(/\s{2,}/g," ").trim(),t.length>72&&(t=`${t.slice(0,69).replace(/\s+\S*$/u,"").trimEnd()}…`),t}function Yn(e){const t=z(e,"project"),n=e.title.replace(/\s+/g," ").trim();if(n&&!yt(n)){const o=Vn(n);if(o&&o.toLowerCase()!==t.toLowerCase()||o)return o}if(t)return t;const s=ge(F(e));return s?s.length>18?`${s.slice(0,16)}…`:s:"Session match"}function Et(e){const t=B(e,"recordKind",8).map(s=>s.toLowerCase());if(t.length===0&&t.push(...B(e,"recordTag",8).map(s=>s.toLowerCase())),t.some(s=>s.includes("assistant")))return"assistant";if(t.some(s=>s.includes("user")))return"user";if(t.some(s=>s.includes("tool")||s.includes("command")||s.includes("response")))return"tool";const n=we(e);return n==="tool activity"?"tool":n==="overview"?"overview":""}function ho(e,t){const n=Ie(e.snippet,t),s=Et(e),o=he(e);let r="";if(n){const i=M(t).map(d=>d.toLowerCase()),a=n.split(new RegExp("(?<=[.!?])\\s+|\\s+[–—]\\s+|\\s+·\\s+","u")).map(d=>d.replace(/^…+|…+$/gu,"").trim()).filter(d=>d.length>12);r=((i.length>0?a.find(d=>i.some(f=>ae(d,f)>=0)):void 0)??a[0]??n).replace(/^…+|…+$/gu,"").trim()}return r?(r.length>78&&(r=`${r.slice(0,75).replace(/\s+\S*$/u,"").trimEnd()}…`),r):s&&o?`${s} · ${o}`:o||s||Yn(e)}function qn(e){return e.freshness&&e.freshness!=="unknown"?e.freshness:e.title.replace(/\s+/g," ").trim().match(/\b((?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[a-z]*\s+\d{1,2}(?:\s+at\s+\d{1,2}:\d{2}\s*(?:AM|PM)?)?)\b/iu)?.[1]??""}function Fe(e){const t=e.trim().toLowerCase();return t?t==="events"||t.startsWith("events")?"conversation":t==="overview"||t==="summary"?"overview":t==="tool-calls"||t==="tools"?"tool activity":t==="files"||t==="files-touched"?"files touched":t==="manifest"?"session index":t.replace(/[-_]+/g," "):""}function Qn(e){const t=e.trim();return t?t.charAt(0).toUpperCase()+t.slice(1):""}function Xn(e){const t=z(e,"harness")||F(e)?.harness||"";if(!t)return"";const n=t.toLowerCase();return n==="claude"?"Claude":n==="codex"?"Codex":n==="kimi"?"Kimi":n==="cursor"?"Cursor":Qn(t)}function Zn(e){const t=z(e,"sessionId").trim(),n=ge(F(e)),s=(t||n||"").trim();return s?s.length>14?s.slice(0,8):s:""}function he(e){const t=F(e)?.recordRange;if(t){const[s,o]=t;return s===o?`turn ${s}`:o-s<=1?`turns ${s}–${o}`:`turns ${s}–${o}`}const n=e.title.match(/events?\s+window\s+(\d+)/iu);return n?`window ${Number(n[1])}`:""}function Jn(e){const t=B(e,"recordKind",8).map(s=>s.toLowerCase());t.length===0&&t.push(...B(e,"recordTag",8).map(s=>s.toLowerCase()));const n=[];return t.some(s=>s.includes("user"))&&n.push("user"),t.some(s=>s.includes("assistant"))&&n.push("assistant"),t.some(s=>s.includes("tool")||s.includes("command")||s.includes("response"))&&n.push("tool"),n.length===0?"":n.join(" · ")}function we(e){const t=z(e,"documentKind");if(t){const s=t.split(",")[0]?.trim()??t;return Fe(s)}return yt(e.title)?Fe(e.title):Lt(e)?"file":F(e)?"conversation":""}function B(e,t,n=3){const s=e.facets[t];return(Array.isArray(s)?s:typeof s=="string"?s.split(","):[]).map(r=>r.trim()).filter(Boolean).slice(0,n)}function wo(e){return{agent:Xn(e),project:z(e,"project"),session:Zn(e),when:qn(e),turn:he(e),role:Jn(e),where:we(e)}}function Io(e){const t=[],n=he(e);n&&t.push(n);const s=Et(e);s&&t.push(s);const o=we(e);o&&o!=="conversation"&&t.push(o);const r=B(e,"toolName",2);r.length===1&&t.push(r[0]),r.length>1&&t.push(r.join(", "));const i=new Set;return t.filter(a=>{const u=a.toLowerCase();return i.has(u)?!1:(i.add(u),!0)})}function ae(e,t){return new RegExp(`(?<![A-Za-z0-9_./~-])${Pt(t)}(?![A-Za-z0-9_./~-])`,"iu").exec(e)?.index??-1}function Ie(e,t=""){let n=e.replace(/\s+/g," ").trim();if(!n)return"";if(n=n.replace(/\s*-\s*\[\d{3,}\]\s*`[^`]+`(?:\s*\([^)]*\))?\s*-\s*/gu," "),n=n.replace(/\[\d{3,}\]\s*`[^`]+`\s*/gu,""),n=n.replace(/\*\*/gu,""),n=n.replace(/\b(?:assistant_turn|user_turn|agent_reasoning|command_or_tool|response_item|system_record)\b/giu," "),n=n.replace(/(?:~\/|\.\.?\/|\/(?:Users|home|var|tmp|opt)\/)\S+/gu," "),n=n.replace(/https?:\/\/\S+/gu," "),n=n.replace(/\b[\w.-]+\.(?:com|net|org|io|dev|app)(?:\/\S*)?/giu," "),n=n.replace(/\{[^{}]{0,160}\}/gu," "),n=n.replace(/`[^`]{0,64}`/gu,r=>{const i=r.slice(1,-1);return M(t).some(a=>ae(i,a)>=0)||/^[A-Za-z][\w.-]{0,24}$/u.test(i)?i:" "}),n=n.replace(/\s{2,}/g," ").trim(),n=n.replace(/^[\s,;:.\-–—|/]+/u,"").trim(),n.includes("{")||n.includes("[")){const r=n.search(/[\[{]/u);if(r>18){const i=n.slice(0,r).trim().replace(/[-–—,:;]+$/u,"").trim();i&&(n=i)}}const s=M(t),o=200;if(s.length>0&&n.length>o){let r=-1;for(const i of s){const a=ae(n,i);a>=0&&(r<0||a<r)&&(r=a)}if(r<0)for(const i of s){if(i.length<4)continue;const a=n.toLowerCase().indexOf(i.toLowerCase());a>=0&&(r<0||a<r)&&(r=a)}if(r>=0){const a=Math.max(0,r-48),u=Math.min(n.length,a+o),d=n.slice(a,u).trim();n=`${a>0?"…":""}${d}${u<n.length?"…":""}`}else n=`${n.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`}else n.length>o&&(n=`${n.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`);return n.replace(/\s{2,}/g," ").trim()}function vo(e,t,n){const s=Ie(e.snippet,t);return s.length<=n?s:`${s.slice(0,n-1).replace(/\s+\S*$/u,"").trimEnd()}…`}function es(e,t){return M(t).filter(n=>{const s=n.toLowerCase();return e.title.toLowerCase().includes(s)||e.snippet.toLowerCase().includes(s)||Ie(e.snippet,t).toLowerCase().includes(s)})}function $t(e){const t=(e.kind||e.role||e.type||"record").toLowerCase();return t==="assistant_turn"||t==="assistant"?"assistant":t==="user_turn"||t==="user"?"user":t==="system_record"||t==="system"?"system":t==="command_or_tool"||t==="tool_use"?"tool":t==="response_item"?"tool output":t==="agent_reasoning"||t==="reasoning"?"reasoning":t.replace(/_/gu," ")}function Rt(e){const t=(e.kind||e.role||e.type||"").toLowerCase();return t==="assistant"||t==="assistant_turn"||t==="user"||t==="user_turn"||t==="last-prompt"||t==="ai-title"?0:t==="system"||t==="system_record"||t.includes("reasoning")?1:2}function So(e){return e.scoreSource==="hybrid"?"Words and meaning":e.scoreSource==="vector"?"Similar in meaning":"Exact words"}function bo(e,t,n){const s=es(e,t),o=s.length===1?`Matched “${s[0]}”`:s.length>1?`Matched ${s.length} terms`:"Matched in this session";if(!n?.matched)return o;const r=[n.renderedText,n.summary].filter(Boolean).join(" ").toLowerCase(),i=s.filter(d=>r.includes(d.toLowerCase()));if(i.length===0)return o;const a=$t(n),u=a==="assistant"?"an assistant reply":a==="user"?"your message":a==="tool"?"a tool call":a==="tool output"?"tool output":a==="system"?"a system record":a==="reasoning"?"agent reasoning":`a ${a} record`;return i.length===1?`Matched “${i[0]}” in ${u}`:`Matched ${i.length} terms in ${u}`}function Lo(e){const t=F(e);if(t){const s=re(t.path),o=t.recordRange;return o?`${s}#R${o[0]}-R${o[1]}`:s}const n=Lt(e);if(n){const s=re(n.path),o=n.lineRange;return o?`${s}#L${o[0]}-L${o[1]}`:s}return e.id}function ts(e){const t=e.filter(o=>Rt(o)===2).length,n=e.length-t,s=e.some(o=>o.matched)?" · match inside":"";return t>0&&n===0?`${t} tool step${t===1?"":"s"}${s}`:t===0?`${n} process step${n===1?"":"s"}${s}`:`${t} tool + ${n} process step${e.length===1?"":"s"}${s}`}function ns(e){return`${e.length} more conversation turn${e.length===1?"":"s"}`}function yo(e,t={}){if(e.length===0)return[];const n=t.contextRadius??3,s=t.maxTurns??6,o=t.centerRecordIndex===void 0?-1:e.findIndex(h=>h.index===t.centerRecordIndex),r=e.findIndex(h=>h.matched),i=o>=0?o:r>=0?r:0,a=e.slice(Math.max(0,i-n),Math.min(e.length,i+n+1)),u=[];let d=[],f=[],I=0;const R=()=>{d.length!==0&&(u.push({kind:"folded",records:d,summary:ts(d)}),d=[])},g=()=>{f.length!==0&&(u.push({kind:"folded",records:f,summary:ns(f)}),f=[])};for(const h of a){if(Rt(h)>0){g(),d.push(h);continue}if(R(),I>=s){f.push(h);continue}u.push({kind:"turn",record:h,role:$t(h)}),I+=1}return R(),g(),u}function Te(e){const t=F(e)?.recordRange;return t?t[0]:Number.MAX_SAFE_INTEGER}function Eo(e){const t=[],n=new Map;for(const s of e){const o=s.collectionId||s.id,r=n.get(o);r?r.push(s):(t.push(o),n.set(o,[s]))}return t.map(s=>{const o=[...n.get(s)??[]].sort((i,a)=>{const u=Te(i)-Te(a);return u!==0?u:i.score-a.score}),r=n.get(s)?.[0]??o[0];return{collectionId:s,best:r,moments:o}})}function Pt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $o(e,t){const n=M(t);if(n.length===0||e.length===0)return[{text:e,match:!1}];const s=n.map(a=>`(?<![A-Za-z0-9_./~-])${Pt(a)}(?![A-Za-z0-9_./~-])`),o=new RegExp(`(${s.join("|")})`,"giu"),r=[];let i=0;for(const a of e.matchAll(o)){const u=a.index??0;u>i&&r.push({text:e.slice(i,u),match:!1}),r.push({text:a[0],match:!0}),i=u+a[0].length}return i<e.length&&r.push({text:e.slice(i),match:!1}),r.length>0?r:[{text:e,match:!1}]}const Ro={sessions:"Sessions",skills:"Skills",mcp:"MCP",codebase:"Codebase",context_pack:"Context packs",mixed:"Mixed"},Ct=[{value:"1",label:"Last 24h"},{value:"3",label:"Last 3 days"},{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"}],Po=["sessions","skills","mcp","codebase","context_pack"];function Co(){return{query:"",sourceKinds:[],harness:[],project:[],timeWindow:"all"}}function ss(e){return e?Ct.some(t=>t.value===e):!1}function X(e){return e?e.split(",").map(t=>t.trim()).filter(t=>t.length>0):[]}function os(e){const t=e==null?new URLSearchParams:typeof e=="string"?new URLSearchParams(e):e,n=t.get("time"),s=ss(n)?n:"all";return{query:t.get("q")?.trim()??"",sourceKinds:X(t.get("source")),harness:X(t.get("harness")),project:X(t.get("project")),timeWindow:s}}function rs(e,t={}){const n=new URLSearchParams,s=e.query.trim();return s&&n.set("q",s),e.sourceKinds.length>0&&n.set("source",e.sourceKinds.join(",")),e.harness.length>0&&n.set("harness",e.harness.join(",")),e.project.length>0&&n.set("project",e.project.join(",")),e.timeWindow!=="all"&&n.set("time",e.timeWindow),t.hitId&&n.set("hit",t.hitId),n}function Ao(e,t){return e.query.trim()===t.query.trim()&&e.timeWindow===t.timeWindow&&Z(e.sourceKinds,t.sourceKinds)&&Z(e.harness,t.harness)&&Z(e.project,t.project)}function Z(e,t){if(e.length!==t.length)return!1;const n=[...e].map(o=>o.trim().toLowerCase()).sort(),s=[...t].map(o=>o.trim().toLowerCase()).sort();return n.every((o,r)=>o===s[r])}function as(e){return e.query.trim().length>0||e.sourceKinds.length>0||e.harness.length>0||e.project.length>0||e.timeWindow!=="all"}function _o(e){if(e==="all")return null;const t=Number.parseInt(e,10);return!Number.isFinite(t)||t<=0?null:Date.now()-t*24*60*60*1e3}function Uo(e){return e==="all"?"Any time":Ct.find(n=>n.value===e)?.label??e}const At=typeof window<"u"?window.location.href:"http://scout.local/";function _t(e){const t=e.toString();return new URL(t,At)}function is(e){switch(e){case"profile":case"config":case"definitions":return e==="definitions"?"config":e;case"observe":case"message":return e;default:return}}function cs(e){const t=e.trim().replace(/^#/,"");if(!t.startsWith("msg-"))return null;const n=t.slice(4).trim();if(!n)return null;try{return decodeURIComponent(n)}catch{return n}}function us(e){switch(e){case"control":case"mission":case"command":case"warroom":case"conduct":case"conductor":return"mission";case"plan":case"advisor":return"advisor";case"issues":case"errors":case"warnings":return"issues";case"agents":case"tail":case"atop":case"lanes":case"world":return e;default:return}}function ls(e){return e==="delivered"||e==="failed"||e==="all"?e:void 0}function ds(e){return e==="indexer"||e==="knowledge"?e:void 0}function fs(e){switch(e){case"pairing":case"agents":case"appearance":case"operator":case"comms":case"credentials":case"voice":case"devices":case"about":return e;case"communications":return"comms";default:return}}function ms(e){switch(e){case"tail":case"session":case"chat":case"work":return e;default:return}}function ps(e){const t=e?.trim().replace(/\.+$/u,"");return t==="observe"||t==="takeover"?t:void 0}function gs(e){const t=e?.trim().toLowerCase();return t==="pty"||t==="tmux"||t==="zellij"||t==="herdr"?t:void 0}function hs(e){const t=e?.trim().toLowerCase();return t==="shell"||t==="claude"||t==="codex"||t==="pi"?t:void 0}function ws(e){return e==="all"||e==="touched"?"all":e==="changed"?"changed":void 0}function xe(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isSafeInteger(t)&&t>0?t:void 0}function Oe(e){return e==="mission"?"control":e}function Is(e){return e.searchParams.has("no-ops")?!1:typeof window>"u"?!0:at()}function vs(e){return e==="tail"}function Ss(e){return e==="lanes"||e==="world"}function Ut(e){return vs(e)||Ss(e)}const ve="machineId",kt=new Set(["inbox","conversation","agents-v2","messages","sessions","repos","harnesses","mesh","mesh-ops","activity","work","follow"]);function bs(e){return e.searchParams.get(ve)?.trim()||void 0}function Ls(e,t){return!t||!kt.has(e.view)?e:{...e,machineId:t}}function Se(e){return kt.has(e.view)}function ys(e){return"machineId"in e&&e.machineId?e.machineId:null}function De(e,t){if(!Se(e))return e;const n={...e},s=t?.trim();return s?n.machineId=s:delete n.machineId,n}function ko(e){return Se(e)?{...e,machineId:""}:e}function Es(e,t){return Se(e)?"machineId"in e?De(e,e.machineId??null):De(e,ys(t)):e}function k(e,t){"machineId"in t&&t.machineId&&e.set(ve,t.machineId)}function S(e){const t=e.toString();return t?`?${t}`:""}function x(e,t){const n=new URLSearchParams;return k(n,t),`${e}${S(n)}`}function $s(e){return"machineId"in e&&e.machineId?`:machine:${e.machineId}`:""}function be(e){const t=_t(e),n=t.pathname.replace(/^\/+/,"").split("/").filter(Boolean);if(n[0]==="embed"&&["home","search","ops"].includes(n[1]??"")){const c=new URL(t),l=n[1],m=t.searchParams.get("mode");c.pathname=l==="home"?"/":`/${l}${m?`/${encodeURIComponent(m)}`:""}`,c.searchParams.delete("mode");const p=be(c);return l==="ops"&&p.view==="inbox"?{...p,view:"ops",mode:"tail"}:p}const s=bs(t),o=c=>Ls(c,s),r=jn(n,t,o);if(r)return r;const i=cs(t.hash),a=is(t.searchParams.get("tab"))??(i?"message":void 0),u=t.searchParams.get("project")?.trim()||void 0,d=t.searchParams.get("agentId")?.trim()||void 0;if(n[0]==="agent"&&n[1])return{view:"agent-info",conversationId:decodeURIComponent(n[1])};const f=t.searchParams.get("project")?.trim()||void 0,I=t.searchParams.get("harness")?.trim()||void 0,R=t.searchParams.get("node")?.trim()||void 0,g=t.searchParams.get("set")?.trim(),h=g==="live"||g==="ephemeral"||g==="archived"?g:void 0,P=t.searchParams.get("view")?.trim(),U=P==="sessions"||P==="agents"?P:void 0,_=t.searchParams.get("state")?.trim(),Le=_==="needs"||_==="live"||_==="idle"?_:void 0,jt=t.searchParams.get("ephemeral")==="1",W=t.searchParams.get("session")?.trim()||void 0,y=t.searchParams.get("select")?.trim()||void 0,$={...I?{harness:I}:{},...R?{node:R}:{},...h?{set:h}:{},...U?{indexView:U}:{},...Le?{stateFilter:Le}:{},...jt?{showEphemeral:!0}:{}};if(n[0]==="projects"){const c=n[1]?decodeURIComponent(n[1]):void 0;if(!c)return o({view:"agents-v2",...y?{selectedAgentId:y}:{},...$});if(n[2]==="agents"){const l=n[3]?decodeURIComponent(n[3]):void 0;if(l){if(n[4]==="c"&&n[5])return o({view:"agents-v2",projectSlug:c,agentId:l,conversationId:decodeURIComponent(n[5]),tab:a??"message",...$});const m=n[4]==="sessions"&&n[5]?decodeURIComponent(n[5]):W;return o({view:"agents-v2",projectSlug:c,agentId:l,...m?{sessionId:m}:{},...a?{tab:a}:{},...$})}return o({view:"agents-v2",projectSlug:c,indexView:"agents",...y?{selectedAgentId:y}:{},...$})}return n[2]==="sessions"?o({view:"agents-v2",projectSlug:c,indexView:"sessions",...n[3]?{sessionId:decodeURIComponent(n[3])}:{},...y?{selectedAgentId:y}:{},...$}):o({view:"agents-v2",projectSlug:c,...y?{selectedAgentId:y}:{},...$})}if(n[0]==="agents-v2"&&n[1]==="sessions"&&n[2])return o({view:"agents-v2",sessionId:decodeURIComponent(n[2]),...y?{selectedAgentId:y}:{},...f?{projectSlug:f}:{},...$});if(n[0]==="agents-v2"&&n[1]){const c=decodeURIComponent(n[1]);return o({view:"agents-v2",agentId:c,...a?{tab:a}:{},...W?{sessionId:W}:{},...f?{projectSlug:f}:{},...$})}if(n[0]==="agents-v2")return o({view:"agents-v2",...y?{selectedAgentId:y}:{},...f?{projectSlug:f}:{},...$});if(n[0]==="agents"&&n[1]){const c=decodeURIComponent(n[1]),l=n[2]==="sessions"&&n[3]?decodeURIComponent(n[3]):W;return n[2]==="c"&&n[3]?o({view:"agents-v2",agentId:c,conversationId:decodeURIComponent(n[3]),tab:a??"message",...$}):o({view:"agents-v2",agentId:c,...l?{sessionId:l}:{},...a?{tab:a}:{},...$})}if(n[0]==="agents")return o({view:"agents-v2",...y?{selectedAgentId:y}:{},...f?{projectSlug:f}:{},...$});if(n[0]==="agents.deprecated"&&n[1]&&n[2]==="sessions"&&n[3])return o({view:"sessions",agentId:decodeURIComponent(n[1]),sessionId:decodeURIComponent(n[3])});if(n[0]==="agents.deprecated"&&n[1]&&n[2]==="c"&&n[3])return o({view:"agents-v2",agentId:decodeURIComponent(n[1]),conversationId:decodeURIComponent(n[3]),tab:a??"message"});if(n[0]==="agents.deprecated"&&n[1]){const c=decodeURIComponent(n[1]);return o({view:"agents-v2",agentId:c,...a?{tab:a}:{},...!a&&u?{projectSlug:u}:{}})}if(n[0]==="agents.deprecated")return o({view:"agents-v2",...u?{projectSlug:u}:{}});if(n[0]==="fleet")return o({view:"inbox"});if(n[0]==="c"&&n[1])return o({view:"conversation",conversationId:decodeURIComponent(n[1])});if(n[0]==="flights"&&n[1]&&n[2]==="observe"){const c=t.searchParams.get("session")?.trim()||void 0,l=t.searchParams.get("compare")?.trim()||void 0;return o({view:"sessions",flightId:decodeURIComponent(n[1]),...c?{sessionId:c}:{},...l?{compareSessionId:l}:{}})}if(n[0]==="sessions"&&n[1])return o({view:"sessions",sessionId:decodeURIComponent(n[1]),...d?{agentId:d}:{}});if(n[0]==="conversations")return o({view:"messages"});if(n[0]==="messages"){if(n[1]==="agent"&&n[2]){const l=t.searchParams.get("thread")?.trim()||void 0;return o({view:"messages",agentId:decodeURIComponent(n[2]),...l?{threadId:l}:{}})}const c={view:"messages",...n[1]?{conversationId:decodeURIComponent(n[1])}:{}};return o(c)}if(n[0]==="sessions")return o({view:"sessions",...d?{agentId:d}:{}});if(n[0]==="repos"){const c=t.searchParams.get("root")?.trim()||void 0;return o({view:"repos",...c?{root:c}:{}})}if(n[0]==="providers"||n[0]==="harnesses")return o({view:"harnesses"});if(n[0]==="repo-diff"){const c=t.searchParams.get("path")?.trim();if(c){const l=t.searchParams.getAll("layer").filter(v=>v==="unstaged"||v==="staged"||v==="branch"),m=t.searchParams.getAll("file").map(v=>v.trim()).filter(Boolean),p=t.searchParams.get("sessionId")?.trim()||void 0,b=t.searchParams.get("agentId")?.trim()||void 0,E=ws(t.searchParams.get("include"));return{view:"repo-diff",path:c,...l.length>0?{layers:l}:{},...m.length>0?{files:m}:{},...p?{sessionId:p}:{},...b?{agentId:b}:{},...E?{include:E}:{}}}}if(n[0]==="search"){const c=ds(n[1]),l=t.searchParams.get("hit")?.trim()||void 0,m=os(t.searchParams);return{view:"search",...c&&c!=="knowledge"?{mode:c}:{},...l?{hitId:l}:{},...as(m)?{filters:m}:{}}}if(n[0]==="channels"&&n[1])return o({view:"messages",conversationId:decodeURIComponent(n[1])});if(n[0]==="channels")return o({view:"messages"});if(n[0]==="network"||n[0]==="mesh")return o({view:"mesh"});if(n[0]==="mesh-ops")return o({view:"mesh-ops",...n[1]?{itemId:decodeURIComponent(n[1])}:{}});if(n[0]==="dispatch"||n[0]==="broker"){const c=t.searchParams.get("attempt")?.trim()||void 0,l=ls(t.searchParams.get("filter"));return{view:"broker",...c?{attemptId:c}:{},...l&&l!=="all"?{filter:l}:{}}}if(n[0]==="code"){const c=t.searchParams.get("wt")?.trim()||void 0,l=t.searchParams.get("fromConversation")?.trim()||void 0,m=xe(t.searchParams.get("line")),p=xe(t.searchParams.get("endLine")),b=m&&p&&p>=m?p:void 0;if(n[1]){const A=decodeURIComponent(n[1]),C=n.length>2?n.slice(2).map(decodeURIComponent).join("/"):void 0;return{view:"code",project:A,...C?{path:C}:{},...c?{wt:c}:{},...m?{line:m}:{},...b?{endLine:b}:{},...l?{returnConversationId:l}:{}}}const E=t.searchParams.get("root")?.trim()||void 0,v=t.searchParams.get("file")?.trim()||void 0;return{view:"code",...E?{root:E}:{},...v?{file:v}:{},...c?{wt:c}:{},...m?{line:m}:{},...b?{endLine:b}:{},...l?{returnConversationId:l}:{}}}if(n[0]==="briefings"&&n[1])return{view:"briefings",briefingId:decodeURIComponent(n[1])};if(n[0]==="briefings")return{view:"briefings"};if(n[0]==="activity")return o({view:"activity"});if(n[0]==="voice")return{view:"voice"};if(n[0]==="work"&&n[1])return o({view:"work",workId:decodeURIComponent(n[1])});if(n[0]==="follow"){const c=ms(t.searchParams.get("view")),l={view:"follow",...c?{preferredView:c}:{}},m=n[1],p=n[2]?decodeURIComponent(n[2]):"";m==="flight"&&p&&(l.flightId=p),m==="invocation"&&p&&(l.invocationId=p),m==="conversation"&&p&&(l.conversationId=p),m==="work"&&p&&(l.workId=p),m==="session"&&p&&(l.sessionId=p),m==="agent"&&p&&(l.targetAgentId=p);const b=t.searchParams.get("flightId"),E=t.searchParams.get("invocationId"),v=t.searchParams.get("conversationId"),A=t.searchParams.get("workId"),C=t.searchParams.get("sessionId"),ye=t.searchParams.get("targetAgentId");return b&&(l.flightId=b),E&&(l.invocationId=E),v&&(l.conversationId=v),A&&(l.workId=A),C&&(l.sessionId=C),ye&&(l.targetAgentId=ye),o(l)}if(n[0]==="settings"){if(n[1]==="agents")return{view:"settings",section:"agents",...n[2]?{agentId:decodeURIComponent(n[2])}:{}};const c=fs(n[1]);return{view:"settings",...c?{section:c}:{}}}if(n[0]==="terminal"){const c=ps(t.searchParams.get("mode")),l=t.searchParams.get("session")?.trim()||void 0,m=Vt(t.searchParams.get("surface"))??void 0;if(n[1]==="new"){const b=gs(t.searchParams.get("backend"))??"pty",E=hs(t.searchParams.get("agent"))??"shell",v=t.searchParams.get("name")?.trim()||void 0,A=t.searchParams.get("tab")?.trim()||void 0,C=t.searchParams.get("socketDir")?.trim()||void 0;return{view:"terminal",terminalBackend:b,terminalAgent:E,...v?{terminalSessionName:v}:{},...A?{terminalTabId:A}:{},...C?{zellijSocketDir:C}:{}}}const p=n[1]==="s"&&n[2]?ze(decodeURIComponent(n.slice(2).join("/")))?decodeURIComponent(n.slice(2).join("/")):null:Yt(n[1]?decodeURIComponent(n[1]):void 0,n[2]?decodeURIComponent(n.slice(2).join("/")):void 0);return p?{view:"terminal",terminalSurfaceKey:p,...l?{terminalSessionId:l}:{},...c?{mode:c}:{}}:{view:"terminal",...n[1]?{agentId:decodeURIComponent(n[1])}:{},...c?{mode:c}:{},...!n[1]&&l?{terminalSessionId:l}:{},...!n[1]&&m?{terminalSurfaceKey:m}:{}}}if(n[0]==="ops"){const c=us(n[1])??"mission";if(!Ut(c)&&!Is(t))return o({view:"inbox"});const l=c==="tail"?t.searchParams.get("q")?.trim():"",m=c==="advisor"?t.searchParams.get("plan")?.trim():"",p=t.searchParams.get("flightId")?.trim(),b=t.searchParams.get("invocationId")?.trim(),E=t.searchParams.get("conversationId")?.trim(),v=t.searchParams.get("workId")?.trim(),A=t.searchParams.get("sessionId")?.trim(),C=t.searchParams.get("targetAgentId")?.trim()??t.searchParams.get("agentId")?.trim();return{view:"ops",mode:c,...l?{tailQuery:l}:{},...m?{planDocumentId:m}:{},...p?{flightId:p}:{},...b?{invocationId:b}:{},...E?{conversationId:E}:{},...v?{workId:v}:{},...A?{sessionId:A}:{},...C?{targetAgentId:C}:{}}}return o({view:"inbox"})}function Ft(e,t){const n=e.view==="sessions"&&e.flightId?null:bt(e,t);if(n)return n;switch(e.view){case"inbox":return x("/",e);case"conversation":{const s=new URLSearchParams;return k(s,e),`/c/${encodeURIComponent(e.conversationId)}${S(s)}`}case"agent-info":return`/agent/${encodeURIComponent(e.conversationId)}`;case"agents-v2":{const s=new URLSearchParams;e.harness&&s.set("harness",e.harness),e.node&&s.set("node",e.node),e.set&&s.set("set",e.set),!e.projectSlug&&e.indexView&&e.indexView!=="agents"&&s.set("view",e.indexView),e.stateFilter&&s.set("state",e.stateFilter),e.showEphemeral&&s.set("ephemeral","1"),e.selectedAgentId&&!e.agentId&&!e.sessionId&&s.set("select",e.selectedAgentId);const o=e.conversationId?"message":"profile";e.agentId&&e.tab&&e.tab!==o&&s.set("tab",e.tab),k(s,e);const r=e.projectSlug?`/projects/${encodeURIComponent(e.projectSlug)}`:null;return`${r?e.agentId?e.conversationId?`${r}/agents/${encodeURIComponent(e.agentId)}/c/${encodeURIComponent(e.conversationId)}`:e.sessionId?`${r}/agents/${encodeURIComponent(e.agentId)}/sessions/${encodeURIComponent(e.sessionId)}`:`${r}/agents/${encodeURIComponent(e.agentId)}`:e.sessionId?`${r}/sessions/${encodeURIComponent(e.sessionId)}`:e.indexView==="sessions"?`${r}/sessions`:e.indexView==="agents"?`${r}/agents`:r:e.agentId?e.conversationId?`/agents/${encodeURIComponent(e.agentId)}/c/${encodeURIComponent(e.conversationId)}`:e.sessionId?`/agents/${encodeURIComponent(e.agentId)}/sessions/${encodeURIComponent(e.sessionId)}`:`/agents/${encodeURIComponent(e.agentId)}`:e.sessionId?`/sessions/${encodeURIComponent(e.sessionId)}`:"/projects"}${S(s)}`}case"messages":{const s=new URLSearchParams;return e.agentId&&e.threadId&&s.set("thread",e.threadId),k(s,e),`${e.agentId?`/messages/agent/${encodeURIComponent(e.agentId)}`:e.conversationId?`/messages/${encodeURIComponent(e.conversationId)}`:"/messages"}${S(s)}`}case"sessions":{const s=new URLSearchParams;return e.agentId&&s.set("agentId",e.agentId),e.flightId?(e.sessionId&&s.set("session",e.sessionId),e.compareSessionId&&s.set("compare",e.compareSessionId),k(s,e),`/flights/${encodeURIComponent(e.flightId)}/observe${S(s)}`):(k(s,e),`${e.sessionId?`/sessions/${encodeURIComponent(e.sessionId)}`:"/sessions"}${S(s)}`)}case"repos":{const s=new URLSearchParams;return e.root&&s.set("root",e.root),k(s,e),`/repos${S(s)}`}case"harnesses":return x("/providers",e);case"repo-diff":{const s=new URLSearchParams;s.set("path",e.path);for(const o of e.layers??[])s.append("layer",o);for(const o of e.files??[])s.append("file",o);return e.sessionId&&s.set("sessionId",e.sessionId),e.agentId&&s.set("agentId",e.agentId),e.include&&s.set("include",e.include),`/repo-diff${S(s)}`}case"search":{const s=e.mode==="indexer"?"/search/indexer":"/search",o=e.filters?rs(e.filters,{hitId:e.hitId??null}):new URLSearchParams;return!e.filters&&e.hitId&&o.set("hit",e.hitId),`${s}${S(o)}`}case"mesh":return x("/network",e);case"mesh-ops":return x(e.itemId?`/mesh-ops/${encodeURIComponent(e.itemId)}`:"/mesh-ops",e);case"broker":{const s=new URLSearchParams;return e.attemptId&&s.set("attempt",e.attemptId),e.filter&&e.filter!=="all"&&s.set("filter",e.filter),`/dispatch${S(s)}`}case"code":{const s=new URLSearchParams;if(e.wt&&s.set("wt",e.wt),e.line&&s.set("line",String(e.line)),e.line&&e.endLine&&e.endLine>=e.line&&s.set("endLine",String(e.endLine)),e.project){e.returnConversationId&&s.set("fromConversation",e.returnConversationId);const r=[encodeURIComponent(e.project)];return e.path&&r.push(...e.path.split("/").map(encodeURIComponent)),`${`/code/${r.join("/")}`}${S(s)}`}e.root&&s.set("root",e.root),e.file&&s.set("file",e.file),e.returnConversationId&&s.set("fromConversation",e.returnConversationId);const o=s.toString();return o?`/code?${o}`:"/code"}case"briefings":return e.briefingId?`/briefings/${encodeURIComponent(e.briefingId)}`:"/briefings";case"activity":return x("/activity",e);case"voice":return"/voice";case"work":return x(`/work/${encodeURIComponent(e.workId)}`,e);case"settings":return e.section==="agents"?e.agentId?`/settings/agents/${encodeURIComponent(e.agentId)}`:"/settings/agents":e.section?e.section==="pairing"?"/settings/pairing":e.section==="comms"?"/settings/comms":`/settings/${e.section}`:"/settings";case"ops":if(!e.mode)return"/ops";if(e.mode==="tail"||e.mode==="advisor"){const s=new URLSearchParams;return e.mode==="tail"&&e.tailQuery&&s.set("q",e.tailQuery),e.mode==="advisor"&&e.planDocumentId&&s.set("plan",e.planDocumentId),e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),`/ops/${Oe(e.mode)}${S(s)}`}return`/ops/${Oe(e.mode)}`;case"follow":{const s=new URLSearchParams;e.preferredView&&s.set("view",e.preferredView),e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),e.machineId&&s.set(ve,e.machineId);const o=s.toString();return`/follow${o?`?${o}`:""}`}case"terminal":if(e.agentId){const s=new URLSearchParams;return e.mode&&s.set("mode",e.mode),`/terminal/${encodeURIComponent(e.agentId)}${S(s)}`}{const s=new URLSearchParams;if(e.terminalBackend)return e.terminalBackend!=="pty"&&s.set("backend",e.terminalBackend),e.terminalAgent&&e.terminalAgent!=="shell"&&s.set("agent",e.terminalAgent),e.terminalSessionName&&s.set("name",e.terminalSessionName),e.terminalTabId&&s.set("tab",e.terminalTabId),e.zellijSocketDir&&s.set("socketDir",e.zellijSocketDir),`/terminal/new${S(s)}`;e.mode&&s.set("mode",e.mode);const o=qt(e.terminalSurfaceKey);return o?`/terminal/${encodeURIComponent(o.backend)}/${encodeURIComponent(o.sessionName)}${S(s)}`:ze(e.terminalSurfaceKey)?`/terminal/s/${encodeURIComponent(e.terminalSurfaceKey)}${S(s)}`:(e.terminalSessionId&&s.set("session",e.terminalSessionId),e.terminalSurfaceKey&&s.set("surface",e.terminalSurfaceKey),`/terminal${S(s)}`)}}}function N(e){const t=$s(e);switch(e.view){case"conversation":return`conv:${e.conversationId}${t}`;case"agent-info":return`agent-info:${e.conversationId}`;case"settings":return`settings:${e.section??"pairing"}:${e.agentId??""}`;case"agents-v2":return["agents-v2",e.projectSlug??"",e.harness??"",e.node??"",e.set??"",e.indexView??"agents",e.stateFilter??"",e.showEphemeral?"eph":"",e.agentId??"",e.sessionId??"",t].join(":");case"sessions":return e.flightId?`flight-observe:${e.flightId}:${e.sessionId??""}:${e.compareSessionId??""}${t}`:e.sessionId?`session:${e.agentId??""}:${e.sessionId}${t}`:`sessions${t}`;case"messages":return["messages",e.conversationId??"",e.agentId??"",e.threadId??"",t].join(":");case"work":return`work:${e.workId}${t}`;case"ops":return`ops:${e.mode??"advisor"}:${e.tailQuery??""}:${e.planDocumentId??""}:${e.flightId??""}:${e.invocationId??""}:${e.workId??""}:${e.conversationId??""}:${e.sessionId??""}:${e.targetAgentId??""}`;case"search":return`search:${e.mode??"knowledge"}:${e.hitId??""}`;case"broker":return`broker:${e.attemptId??""}`;case"follow":return`follow:${e.flightId??e.invocationId??e.conversationId??e.workId??e.sessionId??e.targetAgentId??""}:${e.preferredView??""}${t}`;case"terminal":return`terminal:${e.agentId??""}:${e.terminalSessionId??""}:${e.terminalSurfaceKey??""}:${e.terminalBackend??""}:${e.terminalAgent??""}:${e.terminalSessionName??""}:${e.terminalTabId??""}:${e.mode??"detail"}`;case"repo-diff":return`repo-diff:${e.path}`;default:return`${e.view}${t}`}}function G(e,t){return ue(be(`${e}${t}`))}function Tt(e){return e?`#${e}`:""}function Rs(e){return e.startsWith("/embed/")||e==="/ops/lanes/embed"}function je(){if(typeof window>"u"){const e=new URL(At);return{pathname:e.pathname,searchStr:e.search,hash:e.hash.replace(/^#/,""),state:null}}return{pathname:window.location.pathname,searchStr:window.location.search,hash:window.location.hash.replace(/^#/,""),state:window.history.state}}function Ps(e,t){return e.pathname===t.pathname&&e.searchStr===t.searchStr&&e.hash===t.hash&&Object.is(e.state,t.state)}function Cs(e){let t=e.read();const n=new Set;let s=null;const o=()=>{const r=e.read();if(!Ps(t,r)){t=r;for(const i of n)i()}};return{getSnapshot:()=>t,subscribe(r){return s||(s=e.observe(o)),n.add(r),()=>{n.delete(r)}},navigateTo(r,i={}){const a=t.pathname,u=i.state===void 0?t.state:i.state;i.replace?e.replace(r,u):e.push(r,u),o(),t.pathname!==a&&Ht(a,t.pathname)}}}function As(){return typeof window>"u"?{read:je,push:()=>{},replace:()=>{},observe:()=>()=>{}}:{read:je,push:(e,t)=>window.history.pushState(t,"",e),replace:(e,t)=>window.history.replaceState(t,"",e),observe:e=>(window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)})}}const D=Cs(As());function _s(){return L.useSyncExternalStore(D.subscribe,D.getSnapshot,D.getSnapshot)}function ie(e,t={}){D.navigateTo(e,t)}function xt(){return typeof window>"u"?null:window.navigation??null}function Ot(){if(typeof window>"u")return!1;const e=xt();return e?e.canGoBack:window.history.length>1}function Us(){if(!Ot())return;const e=xt();if(e){e.back();return}window.history.back()}function Fo(e){if(!e||typeof e!="object")return null;const t=e.returnTo;return!t||typeof t!="object"||typeof t.view!="string"?null:t}function To(e){return!e||typeof e!="object"?!1:e.returnUseHistory===!0}function Ne(e){if(!e||typeof e!="object")return e;const{returnTo:t,returnUseHistory:n,settingsEntry:s,...o}=e;return o}function ks(e,t){if(t.returnTo!==void 0){const n=t.state!==void 0?t.state:Ne(e),s=n&&typeof n=="object"?{...n}:{};return s.returnTo=t.returnTo,s.returnUseHistory=t.replace!==!0,s}return t.state!==void 0?t.state:t.replace?e:Ne(e)}function Dt(e){return e?e.replace(/^#/,""):""}function Fs(e,t,n={}){const s=G(e.pathname,e.searchStr),o=Es(t,s),r=n.preserveSearch===!1?"":e.searchStr;let i=Ft(o,e.pathname);if({"/embed/home":"inbox","/embed/search":"search","/embed/ops":"ops"}[e.pathname]===o.view){const f=_t(i),I=f.pathname.split("/").filter(Boolean)[1];f.pathname=e.pathname;const R=new URLSearchParams(e.searchStr);for(const g of["embed","profile","theme","themeVars","_nav"]){const h=R.get(g);h!==null&&f.searchParams.set(g,h)}I&&f.searchParams.set("mode",I),i=f.pathname+f.search}const u=St(i,r),d=Dt(n.hash);return{route:o,href:`${u}${d?`#${d}`:""}`}}function Ts(e,t){const n=new URLSearchParams(e.searchStr);for(const[r,i]of Object.entries(t.searchPatch??{}))i===null?n.delete(r):n.set(r,i);const s=n.toString(),o=t.hash===void 0?e.hash:Dt(t.hash);return`${e.pathname}${s?`?${s}`:""}${o?`#${o}`:""}`}function xo(e){const t=D.getSnapshot(),n=Ts(t,e),s=`${t.pathname}${t.searchStr}${Tt(t.hash)}`;n!==s&&ie(n,{replace:e.replace??!0,state:e.state})}function xs(e,t,n){if(Rs(e))return null;const s=`${e}${t}`,o=be(s),r=ue(o),i=St(Ft(r,e),t);return!(N(o)!==N(r)||r.view==="agents-v2"||s!==i)||s===i?null:`${i}${Tt(n)}`}function Oo(){const{pathname:e,searchStr:t,hash:n}=_s(),s=`${e}${t}`,o=L.useMemo(()=>G(e,t),[e,t]),r=L.useRef({}),i=L.useRef(s);L.useEffect(()=>{const f=xs(e,t,n);f&&ie(f,{replace:!0})},[e,t,n]),L.useEffect(()=>{if(i.current===s)return;const f=G(e,t);requestAnimationFrame(()=>{window.scrollTo(0,r.current[N(f)]??0)}),i.current=s},[s,e,t]);const a=L.useCallback((f,I={})=>{const R=ue(f.view==="ops"&&!at()&&!Ut(f.mode)?{view:"inbox"}:f),g=G(e,t),{route:h,href:P}=Fs({pathname:e,searchStr:t},R,I);r.current[N(g)]=window.scrollY;const U=D.getSnapshot().state,_=ks(U,I);ie(P,{replace:I.replace,state:_}),requestAnimationFrame(()=>{window.scrollTo(0,r.current[N(h)]??0)})},[e,t]),u=L.useCallback(()=>Us(),[]),d=Ot();return{route:o,navigate:a,navigateBack:u,canNavigateBack:d}}export{Un as $,as as A,Ao as B,Po as C,Ro as D,Ct as E,Ms as F,wo as G,Yn as H,ge as I,F as J,po as K,ho as L,vo as M,Io as N,_o as O,$o as P,Uo as Q,uo as R,mn as S,vt as T,It as U,fo as V,Se as W,Zs as X,qs as Y,Js as Z,_n as _,Ft as a,Xs as a0,Cn as a1,no as a2,kn as a3,oo as a4,ro as a5,so as a6,ao as a7,eo as a8,to as a9,Lo as aA,Rt as aB,yo as aC,re as aD,bo as aE,So as aF,$t as aG,Qs as aa,ct as ab,it as ac,Oo as ad,io as ae,co as af,V as ag,ne as ah,Ws as ai,oe as aj,Q as ak,Dn as al,Kn as am,jn as an,St as ao,Gn as ap,ln as aq,lo as ar,bt as as,qe as at,mo as au,Ye as av,Jt as aw,Lt as ax,z as ay,go as az,ys as b,ko as c,xo as d,Fo as e,Bs as f,tt as g,Gs as h,le as i,Ks as j,zs as k,Vs as l,Ys as m,To as n,fn as o,pn as p,gn as q,be as r,De as s,Hs as t,_s as u,rs as v,In as w,Co as x,os as y,Eo as z};
@@ -0,0 +1 @@
1
+ import{r as s,j as n,a4 as Oe}from"./index-BFbLvCJn.js";import{g as Xe,e as Ye,b as He,c as Ce,d as Ue,h as Je}from"./scout-voice-Cdh6pCsb.js";import{createLevelHistory as Qe,energyFromPartialDelta as ke,tryStartMicLevelMeter as et,VOICE_WAVE_BARS as Ne}from"./voice-levels-Dcr3jglk.js";import{L as tt}from"./loader-circle-CCG7hG7z.js";import{c as Re}from"./createLucideIcon-CKbjXlwv.js";import{ad as nt}from"./router-CJIx83Ia.js";const rt=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],st=Re("mic",rt);const ot=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],it=Re("square",ot);function Nt(e){if(!e)return null;const t=e.replace(/_/g," ");return t.toLowerCase()==="relay agent"?"agent":t}function ct(e,t=!1){return e.key==="Enter"&&!e.shiftKey&&(t||!!(e.metaKey||e.ctrlKey))&&!e.nativeEvent?.isComposing}const at=40,Rt=1500,lt=250;function _e(e,t,o=at){if(Math.hypot(e,t)<o)return"rest";const p=(Math.atan2(t,e)*180/Math.PI+360)%360,c=Math.round(p/45)%8;return["right","down-right","down","down-left","left","up-left","up","up-right"][c]}function _t(e,t){if(e==="rest"||!t||t.length===0)return;const o=l=>t.includes(l),p=`look-${e}`;if(o(p))return p;const[c,m]=e.split("-");if(m){if(o(`look-${m}`))return`look-${m}`;if(o(`look-${c}`))return`look-${c}`}}const ce=new Set;let ae={x:0,y:0,at:0,gone:!0},V=0,le=!1;function Ve(){V=0;for(const e of ce)e(ae)}function ue(e){ae={x:e.clientX,y:e.clientY,at:performance.now(),gone:!1},V||(V=window.requestAnimationFrame(Ve))}function de(){ae={...ae,gone:!0},V||(V=window.requestAnimationFrame(Ve))}function ut(){le||typeof window>"u"||(le=!0,window.addEventListener("pointermove",ue,{passive:!0}),window.addEventListener("pointerdown",ue,{passive:!0}),document.addEventListener("pointerleave",de),window.addEventListener("blur",de))}function dt(){le&&(le=!1,window.removeEventListener("pointermove",ue),window.removeEventListener("pointerdown",ue),document.removeEventListener("pointerleave",de),window.removeEventListener("blur",de),V&&(window.cancelAnimationFrame(V),V=0))}function Vt(e){return ce.add(e),ut(),()=>{ce.delete(e),ce.size===0&&dt()}}function mt(e){return Math.max(160,e*4)}function Tt(e){const t=mt(e);let o=null,p=0;return{sample(c,m){if(c.gone||((!o||c.at-p>lt)&&(o=m(),p=c.at),!o||o.width===0))return"rest";const l=c.x-(o.left+o.width/2),f=c.y-(o.top+o.height/2);return Math.hypot(l,f)>t?"rest":_e(l,f)}}}const Pt=1400,ve=new Set;let we=null;function ft(){return typeof performance<"u"?performance.now():Date.now()}function Ee(e){const t=e?.getBoundingClientRect();we=t&&t.width>0?{x:t.left+t.width/2,y:t.top+t.height/2,at:ft()}:null;for(const o of ve)o(we)}function Le(){return we}function Bt(e){return ve.add(e),()=>{ve.delete(e)}}function Dt(e,t){return!t||t.width===0?"rest":_e(e.x-(t.left+t.width/2),e.y-(t.top+t.height/2))}function ht(e){switch(e){case"starting":return"starting";case"recording":return"recording";case"processing":return"processing";default:return"idle"}}function pt(e,t,o){if(o)return o;switch(e){case"starting":return"Starting voice…";case"recording":return t.trim()?t.trim():null;case"processing":return"Transcribing…";default:return null}}function Me(e){return new Promise(t=>window.setTimeout(t,e))}function gt({onAppend:e,onError:t,onStatus:o,disabled:p,className:c}){const m=s.useRef(Xe()),l=s.useRef(null),f=s.useRef(Qe(Ne)),Z=s.useRef(null),E=s.useRef(!1),b=s.useRef(""),D=s.useRef(0),w=s.useRef(0),[v,y]=s.useState("idle"),[ee,T]=s.useState(""),[te,F]=s.useState("probing"),[me,I]=s.useState(null),[L,P]=s.useState(null),[N,O]=s.useState(null),[fe,M]=s.useState(0),S=s.useCallback(()=>{w.current&&(window.cancelAnimationFrame(w.current),w.current=0),Z.current?.stop(),Z.current=null,E.current=!1},[]),j=s.useCallback(r=>{O(r),t?.(r)},[t]),ne=s.useCallback((r,u,a,g)=>{o?.({state:r,partial:u,message:pt(r,u,a),tone:a?"error":r==="recording"?"recording":r==="processing"?"processing":"neutral",levels:r==="idle"&&!a?[]:f.current.snapshot(),levelsLive:E.current,issue:a?g:null})},[o]);s.useEffect(()=>{ne(v,ee,N,L)},[ne,L,N,ee,v,fe]);const R=s.useCallback(async(r=!1)=>{const u=m.current;F(g=>g==="launching"?g:"probing");const a=await u.probe(r?{force:!0}:void 0);return I(a),F("idle"),a},[]);s.useEffect(()=>{Ye();const r=m.current,u=He(a=>{I(a.ok),F("idle")});return r.connectionState==="unknown"?R():(I(r.connectionState==="connected"),P(null),F("idle")),()=>{u(),S();const a=l.current;a&&(a.cancel().catch(()=>{}),l.current=null)}},[R,S]);const q=s.useCallback(r=>{f.current.push(r),M(u=>u+1)},[]),$=s.useCallback(()=>{if(w.current)return;let r=performance.now();const u=a=>{if(a-r>=36){r=a;const g=a-(D.current||a),k=ke(b.current,b.current,g);f.current.push(Math.max(.05,k)),M(d=>d+1)}w.current=window.requestAnimationFrame(u)};w.current=window.requestAnimationFrame(u)},[]),re=s.useCallback(async()=>{const r=m.current;O(null),P(null),T(""),b.current="",D.current=performance.now(),f.current.clear(),M(d=>d+1),y("starting"),S();let u=await Ce({surface:"chat-composer",requestPermissions:!0});if(!u.ready&&u.issue?.code==="microphone_not_requested"&&(await Me(1800),u=await Ce({surface:"chat-composer"})),!(u.ready||u.issue?.code==="microphone_not_requested")){y("idle");const d=u.issue;d?(P(d),j(Ue(d))):j("Scout voice is not ready."),R(!0);return}P(null),I(!0);let g=null,k=!1;try{if(g=await r.startLive({onState:h=>y(ht(h)),onPartial:h=>{const H=b.current;if(b.current=h,D.current=performance.now(),T(h),!E.current){const U=ke(H,h,0);q(U)}},onLevel:h=>{k=!0,E.current=!0,w.current&&(window.cancelAnimationFrame(w.current),w.current=0),q(h)}}),l.current=g,y("recording"),await Me(140),l.current&&!k&&!E.current){const h=await et(H=>{k=!0,E.current=!0,w.current&&(window.cancelAnimationFrame(w.current),w.current=0),q(H)});h&&l.current?Z.current=h:l.current&&!E.current&&(E.current=!1,$())}const d=await g.result;l.current=null,S(),y("idle");const K=b.current.trim();T(""),b.current="",O(null),f.current.clear(),M(h=>h+1);const _=d.text?.trim()||K;_?e(_):j("No speech was detected. Check your microphone in Settings → Voice."),R(!0)}catch(d){l.current=null,S(),y("idle");const K=b.current.trim();T(""),b.current="",f.current.clear(),M(h=>h+1);const _=d instanceof Error?d.message:"Scout voice recording failed.";if(K){e(K),d instanceof Error&&d.name==="AbortError"||j(`Recording ended early, but Scout recovered the partial transcript. ${_}`);return}if(d instanceof Error&&d.name==="AbortError")return;j(_),R(!0)}},[e,R,q,j,$,S]),se=s.useCallback(async()=>{const r=l.current;if(!r)return;y("processing"),S();const u=window.setInterval(()=>{f.current.decay(.82),M(a=>a+1)},50);window.setTimeout(()=>window.clearInterval(u),600);try{await r.stop()}catch(a){try{await r.cancel()}catch{}l.current=null,y("idle");const g=b.current.trim();T(""),b.current="",f.current.clear(),M(d=>d+1);const k=a instanceof Error?a.message:"Scout voice recording did not finish.";g?(e(g),j(`Recording ended early, but Scout recovered the partial transcript. ${k}`)):j(k)}},[e,j,S]),he=s.useCallback(()=>{if(v==="recording"){se();return}v==="processing"||v==="starting"||re()},[v,re,se]),C=v==="recording",x=te==="launching"||v==="starting"||v==="processing",B=(m.current.canRequestMicrophone||L?.action==="request_microphone"||L?.action==="request_speech")&&!C&&!x,X=(m.current.isMicrophoneHardDenied||L?.action==="open_microphone_settings")&&!C&&!x,oe=(me===!1||L!==null)&&!B&&!X&&!C&&!x,z=N||(L?L.title:X?"Microphone blocked. Open Privacy & Security → Microphone to change it.":B?"Allow microphone access":oe?"Scout voice is not ready":te==="probing"?"Checking voice…":C?"Stop recording":v==="processing"?"Transcribing…":v==="starting"?"Starting voice…":"Start recording"),Y=N?"s-dictation-mic--error":C?"s-dictation-mic--recording":X?"s-dictation-mic--error":B?"s-dictation-mic--needs-permission":oe?"s-dictation-mic--unavailable":x?"s-dictation-mic--busy":"",pe=x?tt:C?it:st,G=C?12:14;return n.jsx("button",{type:"button",title:z,"aria-label":z,"aria-pressed":C,onClick:he,disabled:p||v==="processing",className:["s-dictation-mic",Y,c].filter(Boolean).join(" "),children:n.jsx(pe,{size:G,className:x?"s-dictation-mic-spin":C?"fill-current":""})})}function vt({samples:e,active:t,processing:o=!1,className:p}){const c=wt(e,Ne,o?.06:.04),m=["s-msg-compose-wave",t?"s-msg-compose-wave--live":"",o?"s-msg-compose-wave--processing":"",p??""].filter(Boolean).join(" ");return n.jsx("div",{className:m,"aria-hidden":"true","data-wave-source":e&&e.length>0?"levels":"floor",children:c.map((l,f)=>n.jsx("span",{className:"s-msg-compose-wave-bar",style:{transform:`scaleY(${Math.max(.08,l)})`,opacity:o?.28+l*.35:t?.4+l*.55:.25}},f))})}function wt(e,t,o){if(!e||e.length===0)return Array.from({length:t},()=>o);if(e.length===t)return e.map(c=>Math.max(o,Math.min(1,c)));const p=new Array(t);for(let c=0;c<t;c+=1){const m=Math.min(e.length-1,Math.round(c/Math.max(1,t-1)*(e.length-1)));p[c]=Math.max(o,Math.min(1,e[m]??o))}return p}function bt(){return n.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[n.jsx("path",{d:"M12 19V5"}),n.jsx("path",{d:"m5 12 7-7 7 7"})]})}function xt(){return n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:n.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})})}function St(){return n.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n.jsx("path",{d:"M21.44 11.05 12.05 20.44a5.5 5.5 0 0 1-7.78-7.78l9.19-9.19a3.5 3.5 0 0 1 4.95 4.95l-9.2 9.19a1.5 1.5 0 0 1-2.12-2.12l8.49-8.48"})})}function Ae(e,t){e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,t)}px`}function yt(e){return e.tone==="error"?"Voice":e.state==="recording"?"Listening":e.state==="processing"?"Transcribing":e.state==="starting"?"Starting":"Voice"}function Ft({renderWhenEmbedded:e=!1,...t}){return Oe()&&!e?null:n.jsx(jt,{...t})}function jt({value:e,onChange:t,onSend:o,placeholder:p="Type a message…",disabled:c=!1,sending:m=!1,canSend:l,stopMode:f=!1,onStop:Z,sendTitle:E="Send (Cmd+Enter)",sendAriaLabel:b="Send message (Cmd+Enter)",stopAriaLabel:D="Stop agent",showDictation:w=!0,onDictationStatusChange:v,onDictationCommit:y,showAttach:ee=!1,onAttach:T,attachTitle:te="Add attachment",attachAriaLabel:F="Add attachment",onPaste:me,dropHandlers:I,dragActive:L=!1,secondaryAction:P,leadingTools:N,tools:O,footer:fe,header:M,above:S,aboveAttached:j=!1,input:ne,overlay:R,status:q,textareaRef:$,onKeyDown:re,sendOnEnter:se=!1,onSelect:he,onBlur:C,density:x="panel",as:B="form",className:X,rows:oe=1,autoResize:z=!0,maxHeightPx:Y=160,"aria-label":pe="Message"}){const G=s.useRef(null),[r,u]=s.useState(null),[a,g]=s.useState(!1),[k,d]=s.useState(null),K=s.useCallback(i=>{G.current=i,$&&($.current=i)},[$]),_=s.useRef(null),h=s.useRef(null),H=s.useCallback(()=>{Ee(_.current??G.current),h.current=Le()?.at??null},[]),U=s.useCallback(()=>{const i=h.current;h.current=null,i!==null&&Le()?.at===i&&Ee(null)},[]);s.useEffect(()=>U,[U]),s.useEffect(()=>{if(!z)return;const i=G.current;i&&Ae(i,Y)},[e,z,Y]);const Te=(l??e.trim().length>0)&&!m&&!c,be=O??fe,ie=r?.state==="recording"||r?.state==="starting",J=r?.state==="processing",Pe=!!(r&&(r.tone==="error"||ie||J||r.partial&&r.partial.trim())),ge=s.useCallback(()=>{f||!(l??e.trim().length>0)||m||c||o()},[l,c,o,m,f,e]),Be=i=>{i.preventDefault(),ge()},De=i=>{if(re?.(i)){i.preventDefault();return}if(ct(i,se)){i.preventDefault(),ge();return}},Fe=i=>{const W=i.target.value;t(W,{caret:i.target.selectionStart??W.length}),z&&Ae(i.target,Y)},Ie=i=>{const W=e.trim()?`${e.trimEnd()} ${i}`:i;if(t(W,{caret:W.length}),y){y(W);return}requestAnimationFrame(()=>G.current?.focus())},qe=s.useCallback(i=>{u(i),i.issue||d(null),v?.(i)},[v]),xe=["s-msg-compose",`s-msg-compose--${x}`,x==="thread"?"s-thread-compose":"",X??""].filter(Boolean).join(" "),$e=["s-msg-compose-shell",x==="thread"?"s-thread-compose-shell":""].filter(Boolean).join(" "),ze=["s-msg-compose-input",x==="thread"?"s-thread-compose-input":""].filter(Boolean).join(" "),Se=["s-msg-compose-send",x==="thread"?"s-thread-compose-send":"",f?"s-msg-compose-send--agent-stop s-thread-compose-send--stop":""].filter(Boolean).join(" "),Ge=["s-msg-compose-voice",r?.tone==="recording"||ie?"s-msg-compose-voice--recording":"",r?.tone==="processing"||J?"s-msg-compose-voice--processing":"",r?.tone==="error"?"s-msg-compose-voice--error":""].filter(Boolean).join(" "),{navigate:Ke}=nt(),Q=r?.tone==="error",We=r?.partial?.trim()||null,A=Q?r?.issue??null:null,ye=Q?r?.message:J?"Finalizing transcript…":We,Ze=n.jsxs("div",{ref:_,className:$e,"data-drag-active":L?"true":void 0,...I,children:[M?n.jsx("div",{className:"s-msg-compose-header",children:M}):null,n.jsxs("div",{className:"s-msg-compose-body",children:[ne??n.jsx("textarea",{ref:K,className:ze,placeholder:p,value:e,disabled:c,rows:oe,"aria-label":pe,onChange:Fe,onKeyDown:De,onSelect:he,onFocus:H,onBlur:()=>{U(),C?.()},onPaste:me}),Pe?n.jsxs("div",{className:Ge,role:Q?"alert":"status","aria-live":Q?"assertive":"polite",children:[!Q&&(ie||J)?n.jsx(vt,{samples:r?.levels,active:ie,processing:J}):null,n.jsxs("div",{className:"s-msg-compose-voice-meta",children:[n.jsx("span",{className:"s-msg-compose-voice-label",children:r?yt(r):"Voice"}),A?n.jsxs("span",{className:"s-msg-compose-voice-issue",children:[n.jsx("span",{className:"s-msg-compose-voice-issue-title",children:A.title}),A.hint?n.jsx("span",{className:"s-msg-compose-voice-issue-hint",children:A.hint}):null,A.action!=="none"&&A.actionLabel?n.jsx("button",{type:"button",className:"s-msg-compose-voice-issue-action",disabled:a,onClick:()=>{d(null),A.action==="open_voice_settings"?Ke({view:"settings",section:"voice"}):(g(!0),Je(A.action).catch(i=>d(i instanceof Error?i.message:String(i))).finally(()=>g(!1)))},children:A.actionLabel}):null,k?n.jsx("span",{children:k}):null]}):ye?n.jsx("span",{className:"s-msg-compose-voice-text",children:ye}):null]})]}):null]}),n.jsxs("div",{className:["s-msg-compose-toolbar",x==="thread"?"s-thread-compose-footer":""].filter(Boolean).join(" "),children:[n.jsxs("div",{className:"s-msg-compose-toolbar-start",children:[N,ee?n.jsx("button",{type:"button",className:"s-msg-compose-icon-btn",title:te,"aria-label":F,disabled:c||m,onClick:T,children:n.jsx(St,{})}):N?null:n.jsx("span",{className:"s-msg-compose-toolbar-spacer","aria-hidden":"true"})]}),n.jsxs("div",{className:"s-msg-compose-toolbar-end",children:[be?n.jsx("div",{className:"s-msg-compose-tools",children:be}):null,w?n.jsx(gt,{onAppend:Ie,onStatus:qe,disabled:c||m}):null,P?n.jsx("div",{className:"s-msg-compose-secondary",children:P}):null,f?n.jsx("button",{type:"button",className:Se,onClick:Z,title:D,"aria-label":D,children:n.jsx(xt,{})}):n.jsx("button",{type:B==="form"?"submit":"button",className:Se,disabled:!Te,title:E,"aria-label":b,"data-action":"send",onClick:B==="div"?()=>ge():void 0,children:n.jsx(bt,{})})]})]}),q]}),je=n.jsxs("div",{className:"s-msg-compose-frame","data-above-attached":S&&j?"true":void 0,children:[R,S?n.jsx("div",{className:"s-msg-compose-above",children:S}):null,Ze]});return B==="div"?n.jsx("div",{className:xe,children:je}):n.jsx("form",{className:xe,onSubmit:Be,children:je})}export{gt as D,Rt as G,Ft as M,it as S,Bt as a,Dt as b,Pt as c,Tt as d,st as e,Nt as f,_t as g,ct as i,Vt as s};
@@ -1 +1 @@
1
- import{L as a,N as l,O as n,P as r,r as m}from"./index-EsrkGBcv.js";import{R as p,T as i,U as c,u as E,V as S}from"./router-DCtl8wqb.js";const _={path:l(n.lanes),bundle:`?ffBundle=${a}`,deploy:`OPENSCOUT_WEB_FLAG_BUNDLE=${a}`},o=[{key:"lanes",label:"Agent Lanes",segment:n.lanes},{key:"sessions",label:"Sessions",segment:n.sessions},{key:"tail",label:"Live Activity",segment:n.tail},{key:"agents",label:"Agents",segment:n.agents}],b=o.map(e=>({key:e.key,label:e.label,route:p(e.segment)}));function A(e){const t=i(e);return o.find(s=>s.segment===t)?.key??"lanes"}function d(e){const t=i(e);return o.find(s=>s.segment===t)?.label??r}function u(){const{pathname:e}=E();return c(e)}function P(){return S(u())}function L(e){const t=u();return m.useEffect(()=>(t?document.documentElement.setAttribute("data-scope-presentation",""):document.documentElement.removeAttribute("data-scope-presentation"),()=>document.documentElement.removeAttribute("data-scope-presentation")),[t]),{active:t,brandLabel:t?d(e.route):r}}function O(){return c(typeof window<"u"?window.location.pathname:"")}export{b as S,u as a,_ as b,d as c,L as d,O as i,A as s,P as u};
1
+ import{L as a,N as l,O as n,P as r,r as m}from"./index-BFbLvCJn.js";import{R as p,T as i,U as c,u as E,V as S}from"./router-CJIx83Ia.js";const _={path:l(n.lanes),bundle:`?ffBundle=${a}`,deploy:`OPENSCOUT_WEB_FLAG_BUNDLE=${a}`},o=[{key:"lanes",label:"Agent Lanes",segment:n.lanes},{key:"sessions",label:"Sessions",segment:n.sessions},{key:"tail",label:"Live Activity",segment:n.tail},{key:"agents",label:"Agents",segment:n.agents}],b=o.map(e=>({key:e.key,label:e.label,route:p(e.segment)}));function A(e){const t=i(e);return o.find(s=>s.segment===t)?.key??"lanes"}function d(e){const t=i(e);return o.find(s=>s.segment===t)?.label??r}function u(){const{pathname:e}=E();return c(e)}function P(){return S(u())}function L(e){const t=u();return m.useEffect(()=>(t?document.documentElement.setAttribute("data-scope-presentation",""):document.documentElement.removeAttribute("data-scope-presentation"),()=>document.documentElement.removeAttribute("data-scope-presentation")),[t]),{active:t,brandLabel:t?d(e.route):r}}function O(){return c(typeof window<"u"?window.location.pathname:"")}export{b as S,u as a,_ as b,d as c,L as d,O as i,A as s,P as u};
@@ -1 +1 @@
1
- import{_ as B}from"./index-EsrkGBcv.js";import{b as H,p as j,V as G,D as z}from"./fx-z37u1o2z.js";function J(){return{code:"host_offline",title:"Scout Menu is not connected",message:"No voice host has registered with this web server.",hint:"The browser never records audio — Scout Menu is the voice host. If it is already running, this clears on its own; otherwise launch it.",action:"launch_host",actionLabel:"Launch Scout Menu"}}function W(t){return!t||t.granted?null:t.canRequest?{code:"microphone_not_requested",title:"Microphone access needed",message:"Scout Menu needs microphone access before dictation can start.",hint:"Request access or tap the mic again to show the macOS prompt.",action:"request_microphone",actionLabel:"Request access"}:t.status==="denied"?{code:"microphone_denied",title:"Microphone blocked",message:"Scout Menu cannot record because microphone access is off.",hint:"Scout is opening macOS Microphone settings and will detect the change automatically.",action:"open_microphone_settings",actionLabel:"Open Microphone settings"}:{code:"microphone_denied",title:"Microphone unavailable",message:"Scout Menu cannot access the microphone on this Mac.",hint:"Open Privacy & Security → Microphone to review it.",action:"open_microphone_settings",actionLabel:"Open Microphone settings"}}function X(t){return!t||t.granted?null:t.canRequest?{code:"speech_not_requested",title:"Speech recognition needed",message:"Scout Menu needs speech recognition for live partials and Apple Speech fallback.",hint:"Request access to show the macOS prompt.",action:"request_speech",actionLabel:"Request access"}:{code:"speech_denied",title:"Speech recognition blocked",message:"Speech recognition is off for Scout Menu.",hint:"Choose Retry access to reopen macOS Speech Recognition settings.",action:"open_speech_settings",actionLabel:"Open Speech settings"}}function K(){return{code:"no_input_device",title:"No microphone detected",message:"Scout Menu did not report any audio input devices.",hint:"Plug in a microphone, check Sound settings, then refresh Settings → Voice.",action:"open_voice_settings",actionLabel:"Open Voice settings"}}function Te(t){return t?t.hint?`${t.message} ${t.hint}`:t.message:"Scout voice is unavailable."}let x=!1,T=0;function Pe(t){x=t}function q(){T+=1}function N(){T=Math.max(0,T-1)}function Re(){return x?"Live voice is active.":T>0?"Another Scout playback is active.":null}async function Ie(t){switch(t){case"request_microphone":await R("microphone");return;case"request_speech":await R("speechRecognition");return;case"open_microphone_settings":await D("microphone");return;case"open_speech_settings":await D("speechRecognition");return;case"launch_host":await U().launch({source:"openscout"});return;case"open_voice_settings":case"none":return}}async function Oe(t={}){const e=await fetch("/api/voice/engage",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(e.status===404)return Q(t);if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(b(n,e.status))}return await e.json()}async function Q(t={}){const e=await Ee(),n=e.settings,s=e.devices,r=s.length>0||(n.permissions?.length??0)>0,o=n.permissions?.find(h=>h.kind==="microphone")??null,i=n.permissions?.find(h=>h.kind==="speechRecognition")??null,c=Y(n,s);if(t.requestPermissions&&(o&&!o.granted&&o.status!=="restricted"?await R("microphone").catch(()=>{}):(o?.granted??!1)&&i&&!i.granted&&i.status!=="restricted"&&await R("speechRecognition").catch(()=>{})),!r)return{ready:!1,issue:J(),warnings:[],settings:n,devices:s,inputDevice:null,hostOnline:!1};const l=W(o);if(l)return{ready:!1,issue:l,warnings:[],settings:n,devices:s,inputDevice:c,hostOnline:r};if(!c)return{ready:!1,issue:K(),warnings:[],settings:n,devices:s,inputDevice:null,hostOnline:r};const u=X(i);return{ready:!0,issue:null,warnings:u?[u]:[],settings:n,devices:s,inputDevice:c,hostOnline:r}}function Y(t,e){if(e.length===0)return null;const n=t.inputDeviceId?e.find(o=>o.id===t.inputDeviceId):null,s=e.find(o=>o.isDefault)??e[0]??null,r=n??s;return r?{id:r.id,name:r.name}:null}function Z(t,e){switch(e){case"microphone_permission":return"Microphone access is off for Scout Menu. Tap the mic to retry; Scout will open macOS Microphone settings.";case"empty_transcript":return"No speech was detected. Check your microphone input in Settings → Voice.";default:return t}}const ee=6e4,te=3e3,ne=2e4,oe=8e3,re=45e3;let I=null,_=null,p=null,C=!1;const O=new Set;function ie(){return typeof window>"u"?!1:typeof fetch=="function"}function U(){return I||(I=new se),I}function Ce(t){return O.add(t),p&&t(p),()=>{O.delete(t)}}function Le(){if(C||!ie())return;C=!0;const t=U();t.probe();const e=()=>{t.probeIfStale()};window.addEventListener("focus",e),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function L(t){for(const e of O)e(t)}function V(t,e=Date.now()){const n=t.ok?ne:oe;return e-t.probedAt<n}class se{state="unknown";unavailableReason=null;captureMode=null;hostReachable=!1;microphoneGranted=null;microphoneCanRequest=null;inputDeviceName=null;get connectionState(){return this.state}get lastUnavailableReason(){return this.unavailableReason}get preferredCaptureMode(){return this.captureMode}get isVoiceHostReachable(){return this.hostReachable}get activeInputDeviceName(){return this.inputDeviceName}get isMicrophoneGranted(){return this.microphoneGranted}get canRequestMicrophone(){return this.hostReachable&&this.microphoneGranted===!1&&this.microphoneCanRequest===!0}get isMicrophoneHardDenied(){return this.hostReachable&&this.microphoneGranted===!1&&this.microphoneCanRequest===!1}get isMicrophoneDenied(){return this.isMicrophoneHardDenied}async probeIfStale(){const e=Date.now();return p&&V(p,e)?(this.applyProbeSnapshot(p),p.ok):p&&p.ok&&e-p.probedAt<re?(this.applyProbeSnapshot(p),!0):p&&!p.ok?this.probe({force:!0}):this.probe()}async probe(e={}){const n=typeof e=="number"?{timeoutMs:e}:e,s=n.force??!1,r=n.timeoutMs??te,o=Date.now();return!s&&p&&V(p,o)?(this.applyProbeSnapshot(p),p.ok):_||(this.state="probing",_=this.fetchProbe(r).finally(()=>{_=null}),_)}async fetchProbe(e){const n=new AbortController,s=window.setTimeout(()=>n.abort(),e);try{const r=await fetch("/api/voice/health?quiet=1",{signal:n.signal}),o=await r.json().catch(()=>({})),i=!!o.host?.hostId,c=typeof o.microphoneGranted=="boolean"?o.microphoneGranted:null,l=typeof o.microphoneCanRequest=="boolean"?o.microphoneCanRequest:null,u=typeof o.inputDevice?.name=="string"&&o.inputDevice.name.trim()?o.inputDevice.name.trim():null,h=o.capture==="browser"?"browser":"native",m=r.ok&&o.ok===!0,g=m?null:o.detail??o.error??(i?"Scout voice is not ready.":"Scout voice service is unavailable."),w={ok:m,reason:g,captureMode:m?h:null,hostReachable:i,microphoneGranted:c,microphoneCanRequest:l,inputDeviceName:u,probedAt:Date.now()};return p=w,this.applyProbeSnapshot(w),L(w),m}catch(r){const i={ok:!1,reason:r instanceof Error&&r.name==="AbortError"?"Scout voice service did not respond.":"Scout voice service is unavailable.",captureMode:null,hostReachable:!1,microphoneGranted:null,microphoneCanRequest:null,inputDeviceName:null,probedAt:Date.now()};return p=i,this.applyProbeSnapshot(i),L(i),!1}finally{window.clearTimeout(s)}}applyProbeSnapshot(e){if(this.hostReachable=e.hostReachable,this.microphoneGranted=e.microphoneGranted,this.microphoneCanRequest=e.microphoneCanRequest,this.inputDeviceName=e.inputDeviceName,e.ok){this.unavailableReason=null,this.captureMode=e.captureMode,this.state="connected";return}this.unavailableReason=e.reason,this.captureMode=null,this.state="unavailable"}async launch(e={}){window.location.href="scout://hud/show"}async startLive(e={},n={}){return this.captureMode!=="browser"?await ae(e,n):await ce(e)}}async function ae(t={},e={}){t.onState?.("starting");const n=await fetch("/api/voice/session",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({clientId:"openscout-web",surface:e.surface?.trim()||"chat-composer"})});if(!n.ok){const a=await n.text().catch(()=>"");throw new Error(b(a,n.status))}const r=(await n.json()).sessionId?.trim();if(!r)throw new Error("Scout voice did not return a session id.");let o=!1,i,c;const l=new Promise((a,f)=>{i=a,c=f});let u=null;const h=()=>{u&&window.clearTimeout(u),u=window.setTimeout(()=>{g(new Error("Scout voice transcription timed out. Try again or check voice settings."))},ee)},m=()=>{u&&(window.clearTimeout(u),u=null)},g=(a,f="error")=>{o||(o=!0,m(),S.close(),t.onState?.(f),c(a))},w=a=>{o||(o=!0,m(),S.close(),t.onFinal?.(a),t.onState?.("done"),i(a))},S=new EventSource(`/api/voice/session/${encodeURIComponent(r)}/events`),d=a=>f=>{if(o)return;let v={};try{v=JSON.parse(f.data)}catch{return}if(a==="session.partial"){const M=typeof v.text=="string"?v.text:"";t.onPartial?.(M);return}if(a==="session.state"){const M=ue(v.state);M&&(t.onState?.(M),M==="processing"&&h());return}if(a==="session.final"){w({sessionId:r,text:typeof v.text=="string"?v.text.trim():"",durationMs:Number(v.durationMs??0)});return}if(a==="session.cancelled"){g(P(),"cancelled");return}if(a==="session.error"){const M=typeof v.message=="string"?v.message:"Scout voice session failed.",F=typeof v.code=="string"?v.code:null;g(new Error(Z(M,F)))}};return S.addEventListener("session.started",()=>{t.onState?.("starting")}),S.addEventListener("session.state",d("session.state")),S.addEventListener("session.partial",d("session.partial")),S.addEventListener("session.final",d("session.final")),S.addEventListener("session.cancelled",d("session.cancelled")),S.addEventListener("session.error",d("session.error")),S.onerror=()=>{o||g(new Error("Scout voice event stream disconnected."))},{get sessionId(){return r},result:l,stop:async()=>{t.onState?.("processing"),h();const a=await fetch(`/api/voice/session/${encodeURIComponent(r)}/stop`,{method:"POST"});if(!a.ok){const f=await a.text().catch(()=>"");throw new Error(b(f,a.status))}},cancel:async()=>{o=!0,m(),S.close();const a=await fetch(`/api/voice/session/${encodeURIComponent(r)}/cancel`,{method:"POST"});if(!a.ok){const f=await a.text().catch(()=>"");throw new Error(b(f,a.status))}t.onState?.("cancelled"),c(P())}}}async function ce(t={}){if(typeof MediaRecorder>"u"||!navigator.mediaDevices?.getUserMedia)throw new Error("Scout voice capture is unavailable in this browser.");const{startStreamLevelMeter:e}=await B(async()=>{const{startStreamLevelMeter:d}=await import("./voice-levels-Dcr3jglk.js");return{startStreamLevelMeter:d}},[]),n=be(),s=[];let r=null,o=null,i=null,c=!1,l=!1,u,h;const m=new Promise((d,a)=>{u=d,h=a}),g=()=>{i?.stop(),i=null;for(const d of r?.getTracks()??[])d.stop();r=null},w=(d,a="error")=>{l||(l=!0,g(),t.onState?.(a),h(d))},S=async()=>{if(l)return;if(g(),c){w(P(),"cancelled");return}t.onState?.("processing");const d=o?.mimeType||A()||"application/octet-stream",a=new Blob(s,{type:d});if(a.size===0){w(new Error("No voice audio was captured."));return}try{const f=await we(a,{sessionId:n});if(l)return;l=!0,t.onFinal?.(f),t.onState?.("done"),u(f)}catch(f){w(f instanceof Error?f:new Error(String(f)))}};try{t.onState?.("starting"),r=await navigator.mediaDevices.getUserMedia({audio:!0}),t.onLevel&&(i=e(r,t.onLevel));const d=A();o=new MediaRecorder(r,d?{mimeType:d}:void 0),o.addEventListener("dataavailable",a=>{a.data.size>0&&s.push(a.data)}),o.addEventListener("error",()=>{w(new Error("Scout voice recorder failed."))}),o.addEventListener("stop",()=>{S()},{once:!0}),o.start(),t.onPartial?.(""),t.onState?.("recording")}catch(d){const a=d instanceof Error?d:new Error(String(d));throw w(a),m.catch(()=>{}),a}return{get sessionId(){return n},result:m,stop:async()=>{!o||o.state==="inactive"||o.stop()},cancel:async()=>{if(c=!0,o&&o.state!=="inactive"){o.stop();return}w(P(),"cancelled")}}}function ue(t){return t==="starting"||t==="recording"||t==="processing"||t==="done"||t==="cancelled"||t==="error"?t:null}function b(t,e){try{return JSON.parse(t).error??`Scout voice returned HTTP ${e}`}catch{return t||`Scout voice returned HTTP ${e}`}}function de(t){return t instanceof Error&&t.name==="AbortError"}async function $(t,e={}){const n={text:t,speed:ye(e.speed)};e.modelId&&(n.modelId=e.modelId),e.voiceId&&(n.voiceId=e.voiceId),e.originAppId&&(n.originAppId=e.originAppId),e.utteranceId&&(n.utteranceId=e.utteranceId),e.instructions&&(n.instructions=e.instructions),e.speechTiming?.enabled&&(n.speechTiming=e.speechTiming),e.playback&&(n.playback=e.playback);const s=await fetch("/api/voice/speak",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n),signal:e.signal});if(!s.ok){const r=await s.text().catch(()=>"");try{const o=JSON.parse(r);throw new Error(o.error??`Scout voice returned HTTP ${s.status}`)}catch(o){throw o instanceof SyntaxError?new Error(r||`Scout voice returned HTTP ${s.status}`):o}}return await s.json()}async function Ve(t){const e=t?`?modelId=${encodeURIComponent(t)}`:"",n=await fetch(`/api/voice/catalog${e}`,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(`Scout voice catalog returned HTTP ${n.status}`);return await n.json()}function ke(t,e,n){if(t.voices.find(i=>i.id===n&&i.modelId===e))return{modelId:e,voiceId:n};const r=t.voices.filter(i=>i.modelId===e),o=r.find(i=>i.isDefault&&i.available!==!1)??r.find(i=>i.available!==!1)??r[0];return{modelId:e,voiceId:o?.id??n}}let y=null;function le(){return typeof window>"u"?null:window.AudioContext??window.webkitAudioContext??null}function Ae(){const t=le();if(!t)return;let e=null;try{(!y||y.state==="closed")&&(y=new t),y.resume().catch(()=>{});const n=y.createBuffer(1,1,y.sampleRate);e=y.createBufferSource(),e.buffer=n,e.connect(y.destination);const s=e;e.onended=()=>s.disconnect(),e.start(0)}catch{e?.disconnect()}}function k(t,e){return new Promise((n,s)=>{if(e?.aborted){s(E());return}const r=()=>{clearTimeout(i),e?.removeEventListener("abort",o)},o=()=>{r(),s(E())},i=setTimeout(()=>{r(),s(new Error("Scout audio preparation timed out."))},1500);e?.addEventListener("abort",o,{once:!0});try{t().then(c=>{r(),n(c)},c=>{r(),s(c)})}catch(c){r(),s(c)}})}async function pe(t,e){const n=y;if(!n||n.state==="closed"||!t.audioBase64)throw new Error("no primed context");if(n.state!=="running"&&await k(()=>n.resume(),e.signal),n.state!=="running")throw new Error("primed context is unavailable");const s=atob(t.audioBase64),r=Uint8Array.from(s,c=>c.charCodeAt(0)),o=await k(()=>n.decodeAudioData(r.buffer),e.signal);if(e.signal?.aborted)throw E();const i=n.createBufferSource();i.buffer=o,i.connect(n.destination),await new Promise((c,l)=>{const u=()=>{i.onended=null,e.signal?.removeEventListener("abort",h),i.disconnect()},h=()=>{u();try{i.stop()}catch{}l(E())};if(e.signal?.aborted){h();return}e.signal?.addEventListener("abort",h,{once:!0}),i.onended=()=>{u(),c()};try{i.start(0),e.onPlaybackStart?.()}catch(m){u();try{i.stop()}catch{}l(m)}})}async function fe(t,e={}){if(e.signal?.aborted)throw E();if(t.playedOnHost)return e.onPlaybackStart?.(),t;if(!t.audioBase64)throw new Error("Scout voice returned no audio to play.");try{return await pe(t,e),t}catch(r){if(de(r))throw r}if(e.signal?.aborted)throw E();const n=new Audio(`data:${t.contentType};base64,${t.audioBase64}`),s=()=>{n.pause(),n.currentTime=0};e.signal?.addEventListener("abort",s,{once:!0}),await n.play(),e.onPlaybackStart?.();try{return await new Promise((r,o)=>{const i=()=>{n.removeEventListener("ended",c),n.removeEventListener("error",l),e.signal?.removeEventListener("abort",u)},c=()=>{i(),r()},l=()=>{i(),o(new Error("Scout voice playback failed."))},u=()=>{i(),o(E())};if(e.signal?.aborted){u();return}n.addEventListener("ended",c,{once:!0}),n.addEventListener("error",l,{once:!0}),e.signal?.addEventListener("abort",u,{once:!0})}),t}finally{e.signal?.removeEventListener("abort",s)}}async function he(t,e={}){q();try{const n=await $(t,e);return await fe(n,{signal:e.signal,onPlaybackStart:e.onPlaybackStart})}finally{N()}}function De(t,e={}){const n=new AbortController;return{promise:he(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function me(t,e={}){q();try{const n=await $(t,e);if(e.signal?.aborted)throw E();if(n.playedOnHost)return e.onPlaybackStart?.(),n;const s=await H(n.audioBase64,n.contentType),r=ge(e.presetId,e.params),o=j(s,{params:r,signal:e.signal});return e.onPlaybackStart?.(),await o.promise,n}finally{N()}}function xe(t,e={}){const n=new AbortController;return{promise:me(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function we(t,e){const n=new FormData,s=Se(t.type);n.append("audio",t,`audio.${ve(t.type)}`),n.append("sessionId",e.sessionId),s&&n.append("format",s);const r=await fetch("/api/voice/transcribe",{method:"POST",body:n});if(!r.ok){const i=await r.text().catch(()=>"");try{const c=JSON.parse(i);throw new Error(c.error??`Scout voice returned HTTP ${r.status}`)}catch(c){throw c instanceof SyntaxError?new Error(i||`Scout voice returned HTTP ${r.status}`):c}}const o=await r.json();return{sessionId:e.sessionId,text:o.text?.trim()??"",durationMs:Number(o.durationMs??0)}}function E(){const t=new Error("Speech stopped.");return t.name="AbortError",t}function P(){const t=new Error("Voice recording was cancelled.");return t.name="AbortError",t}function A(){return typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"?void 0:["audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/mp4","audio/webm","audio/wav"].find(e=>{try{return MediaRecorder.isTypeSupported(e)}catch{return!1}})}function Se(t){const e=t.toLowerCase();if(e.includes("mp3")||e.includes("mpeg"))return"mp3";if(e.includes("wav"))return"wav";if(e.includes("aac")||e.includes("mp4"))return"aac";if(e.includes("opus")||e.includes("ogg")||e.includes("webm"))return"opus"}function ve(t){const e=t.toLowerCase();return e.includes("webm")?"webm":e.includes("ogg")||e.includes("opus")?"opus":e.includes("mp4")||e.includes("aac")?"m4a":e.includes("wav")?"wav":e.includes("mp3")||e.includes("mpeg")?"mp3":"audio"}function ge(t,e){const n=t?G.find(s=>s.id===t)?.params:void 0;return{...z,...n??{},...e??{}}}function ye(t){if(!(t===void 0||!Number.isFinite(t)))return Math.min(2,Math.max(.5,Number(t.toFixed(2))))}function be(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`scout-voice:${crypto.randomUUID()}`:`scout-voice:${Date.now().toString(36)}:${Math.random().toString(36).slice(2)}`}async function Ee(){const t=await fetch("/api/voice/settings");if(!t.ok){const e=await t.text().catch(()=>"");throw new Error(b(e,t.status))}return await t.json()}async function D(t="microphone"){const e=await fetch("/api/voice/permissions/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:t})});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(b(n,e.status))}}async function R(t="microphone"){const e=await fetch("/api/voice/permissions/request",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:t})});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(b(n,e.status))}}async function qe(t=12){const e=await fetch(`/api/voice/history?limit=${t}`);if(!e.ok){const s=await e.text().catch(()=>"");throw new Error(b(s,e.status))}return(await e.json()).sessions??[]}async function Ne(t){const e=await fetch("/api/voice/settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(b(n,e.status))}return await e.json()}export{Re as a,Ce as b,Oe as c,Te as d,Le as e,Ve as f,U as g,Ie as h,ke as i,fe as j,de as k,Pe as l,Ee as m,N as n,D as o,$ as p,q,R as r,De as s,xe as t,Ae as u,qe as v,Ne as w};
1
+ import{_ as B}from"./index-BFbLvCJn.js";import{b as H,p as j,V as G,D as z}from"./fx-z37u1o2z.js";function J(){return{code:"host_offline",title:"Scout Menu is not connected",message:"No voice host has registered with this web server.",hint:"The browser never records audio — Scout Menu is the voice host. If it is already running, this clears on its own; otherwise launch it.",action:"launch_host",actionLabel:"Launch Scout Menu"}}function W(t){return!t||t.granted?null:t.canRequest?{code:"microphone_not_requested",title:"Microphone access needed",message:"Scout Menu needs microphone access before dictation can start.",hint:"Request access or tap the mic again to show the macOS prompt.",action:"request_microphone",actionLabel:"Request access"}:t.status==="denied"?{code:"microphone_denied",title:"Microphone blocked",message:"Scout Menu cannot record because microphone access is off.",hint:"Scout is opening macOS Microphone settings and will detect the change automatically.",action:"open_microphone_settings",actionLabel:"Open Microphone settings"}:{code:"microphone_denied",title:"Microphone unavailable",message:"Scout Menu cannot access the microphone on this Mac.",hint:"Open Privacy & Security → Microphone to review it.",action:"open_microphone_settings",actionLabel:"Open Microphone settings"}}function X(t){return!t||t.granted?null:t.canRequest?{code:"speech_not_requested",title:"Speech recognition needed",message:"Scout Menu needs speech recognition for live partials and Apple Speech fallback.",hint:"Request access to show the macOS prompt.",action:"request_speech",actionLabel:"Request access"}:{code:"speech_denied",title:"Speech recognition blocked",message:"Speech recognition is off for Scout Menu.",hint:"Choose Retry access to reopen macOS Speech Recognition settings.",action:"open_speech_settings",actionLabel:"Open Speech settings"}}function K(){return{code:"no_input_device",title:"No microphone detected",message:"Scout Menu did not report any audio input devices.",hint:"Plug in a microphone, check Sound settings, then refresh Settings → Voice.",action:"open_voice_settings",actionLabel:"Open Voice settings"}}function Te(t){return t?t.hint?`${t.message} ${t.hint}`:t.message:"Scout voice is unavailable."}let x=!1,T=0;function Pe(t){x=t}function q(){T+=1}function N(){T=Math.max(0,T-1)}function Re(){return x?"Live voice is active.":T>0?"Another Scout playback is active.":null}async function Ie(t){switch(t){case"request_microphone":await R("microphone");return;case"request_speech":await R("speechRecognition");return;case"open_microphone_settings":await D("microphone");return;case"open_speech_settings":await D("speechRecognition");return;case"launch_host":await U().launch({source:"openscout"});return;case"open_voice_settings":case"none":return}}async function Oe(t={}){const e=await fetch("/api/voice/engage",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(e.status===404)return Q(t);if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(b(n,e.status))}return await e.json()}async function Q(t={}){const e=await Ee(),n=e.settings,s=e.devices,r=s.length>0||(n.permissions?.length??0)>0,o=n.permissions?.find(h=>h.kind==="microphone")??null,i=n.permissions?.find(h=>h.kind==="speechRecognition")??null,c=Y(n,s);if(t.requestPermissions&&(o&&!o.granted&&o.status!=="restricted"?await R("microphone").catch(()=>{}):(o?.granted??!1)&&i&&!i.granted&&i.status!=="restricted"&&await R("speechRecognition").catch(()=>{})),!r)return{ready:!1,issue:J(),warnings:[],settings:n,devices:s,inputDevice:null,hostOnline:!1};const l=W(o);if(l)return{ready:!1,issue:l,warnings:[],settings:n,devices:s,inputDevice:c,hostOnline:r};if(!c)return{ready:!1,issue:K(),warnings:[],settings:n,devices:s,inputDevice:null,hostOnline:r};const u=X(i);return{ready:!0,issue:null,warnings:u?[u]:[],settings:n,devices:s,inputDevice:c,hostOnline:r}}function Y(t,e){if(e.length===0)return null;const n=t.inputDeviceId?e.find(o=>o.id===t.inputDeviceId):null,s=e.find(o=>o.isDefault)??e[0]??null,r=n??s;return r?{id:r.id,name:r.name}:null}function Z(t,e){switch(e){case"microphone_permission":return"Microphone access is off for Scout Menu. Tap the mic to retry; Scout will open macOS Microphone settings.";case"empty_transcript":return"No speech was detected. Check your microphone input in Settings → Voice.";default:return t}}const ee=6e4,te=3e3,ne=2e4,oe=8e3,re=45e3;let I=null,_=null,p=null,C=!1;const O=new Set;function ie(){return typeof window>"u"?!1:typeof fetch=="function"}function U(){return I||(I=new se),I}function Ce(t){return O.add(t),p&&t(p),()=>{O.delete(t)}}function Le(){if(C||!ie())return;C=!0;const t=U();t.probe();const e=()=>{t.probeIfStale()};window.addEventListener("focus",e),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function L(t){for(const e of O)e(t)}function V(t,e=Date.now()){const n=t.ok?ne:oe;return e-t.probedAt<n}class se{state="unknown";unavailableReason=null;captureMode=null;hostReachable=!1;microphoneGranted=null;microphoneCanRequest=null;inputDeviceName=null;get connectionState(){return this.state}get lastUnavailableReason(){return this.unavailableReason}get preferredCaptureMode(){return this.captureMode}get isVoiceHostReachable(){return this.hostReachable}get activeInputDeviceName(){return this.inputDeviceName}get isMicrophoneGranted(){return this.microphoneGranted}get canRequestMicrophone(){return this.hostReachable&&this.microphoneGranted===!1&&this.microphoneCanRequest===!0}get isMicrophoneHardDenied(){return this.hostReachable&&this.microphoneGranted===!1&&this.microphoneCanRequest===!1}get isMicrophoneDenied(){return this.isMicrophoneHardDenied}async probeIfStale(){const e=Date.now();return p&&V(p,e)?(this.applyProbeSnapshot(p),p.ok):p&&p.ok&&e-p.probedAt<re?(this.applyProbeSnapshot(p),!0):p&&!p.ok?this.probe({force:!0}):this.probe()}async probe(e={}){const n=typeof e=="number"?{timeoutMs:e}:e,s=n.force??!1,r=n.timeoutMs??te,o=Date.now();return!s&&p&&V(p,o)?(this.applyProbeSnapshot(p),p.ok):_||(this.state="probing",_=this.fetchProbe(r).finally(()=>{_=null}),_)}async fetchProbe(e){const n=new AbortController,s=window.setTimeout(()=>n.abort(),e);try{const r=await fetch("/api/voice/health?quiet=1",{signal:n.signal}),o=await r.json().catch(()=>({})),i=!!o.host?.hostId,c=typeof o.microphoneGranted=="boolean"?o.microphoneGranted:null,l=typeof o.microphoneCanRequest=="boolean"?o.microphoneCanRequest:null,u=typeof o.inputDevice?.name=="string"&&o.inputDevice.name.trim()?o.inputDevice.name.trim():null,h=o.capture==="browser"?"browser":"native",m=r.ok&&o.ok===!0,g=m?null:o.detail??o.error??(i?"Scout voice is not ready.":"Scout voice service is unavailable."),w={ok:m,reason:g,captureMode:m?h:null,hostReachable:i,microphoneGranted:c,microphoneCanRequest:l,inputDeviceName:u,probedAt:Date.now()};return p=w,this.applyProbeSnapshot(w),L(w),m}catch(r){const i={ok:!1,reason:r instanceof Error&&r.name==="AbortError"?"Scout voice service did not respond.":"Scout voice service is unavailable.",captureMode:null,hostReachable:!1,microphoneGranted:null,microphoneCanRequest:null,inputDeviceName:null,probedAt:Date.now()};return p=i,this.applyProbeSnapshot(i),L(i),!1}finally{window.clearTimeout(s)}}applyProbeSnapshot(e){if(this.hostReachable=e.hostReachable,this.microphoneGranted=e.microphoneGranted,this.microphoneCanRequest=e.microphoneCanRequest,this.inputDeviceName=e.inputDeviceName,e.ok){this.unavailableReason=null,this.captureMode=e.captureMode,this.state="connected";return}this.unavailableReason=e.reason,this.captureMode=null,this.state="unavailable"}async launch(e={}){window.location.href="scout://hud/show"}async startLive(e={},n={}){return this.captureMode!=="browser"?await ae(e,n):await ce(e)}}async function ae(t={},e={}){t.onState?.("starting");const n=await fetch("/api/voice/session",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({clientId:"openscout-web",surface:e.surface?.trim()||"chat-composer"})});if(!n.ok){const a=await n.text().catch(()=>"");throw new Error(b(a,n.status))}const r=(await n.json()).sessionId?.trim();if(!r)throw new Error("Scout voice did not return a session id.");let o=!1,i,c;const l=new Promise((a,f)=>{i=a,c=f});let u=null;const h=()=>{u&&window.clearTimeout(u),u=window.setTimeout(()=>{g(new Error("Scout voice transcription timed out. Try again or check voice settings."))},ee)},m=()=>{u&&(window.clearTimeout(u),u=null)},g=(a,f="error")=>{o||(o=!0,m(),S.close(),t.onState?.(f),c(a))},w=a=>{o||(o=!0,m(),S.close(),t.onFinal?.(a),t.onState?.("done"),i(a))},S=new EventSource(`/api/voice/session/${encodeURIComponent(r)}/events`),d=a=>f=>{if(o)return;let v={};try{v=JSON.parse(f.data)}catch{return}if(a==="session.partial"){const M=typeof v.text=="string"?v.text:"";t.onPartial?.(M);return}if(a==="session.state"){const M=ue(v.state);M&&(t.onState?.(M),M==="processing"&&h());return}if(a==="session.final"){w({sessionId:r,text:typeof v.text=="string"?v.text.trim():"",durationMs:Number(v.durationMs??0)});return}if(a==="session.cancelled"){g(P(),"cancelled");return}if(a==="session.error"){const M=typeof v.message=="string"?v.message:"Scout voice session failed.",F=typeof v.code=="string"?v.code:null;g(new Error(Z(M,F)))}};return S.addEventListener("session.started",()=>{t.onState?.("starting")}),S.addEventListener("session.state",d("session.state")),S.addEventListener("session.partial",d("session.partial")),S.addEventListener("session.final",d("session.final")),S.addEventListener("session.cancelled",d("session.cancelled")),S.addEventListener("session.error",d("session.error")),S.onerror=()=>{o||g(new Error("Scout voice event stream disconnected."))},{get sessionId(){return r},result:l,stop:async()=>{t.onState?.("processing"),h();const a=await fetch(`/api/voice/session/${encodeURIComponent(r)}/stop`,{method:"POST"});if(!a.ok){const f=await a.text().catch(()=>"");throw new Error(b(f,a.status))}},cancel:async()=>{o=!0,m(),S.close();const a=await fetch(`/api/voice/session/${encodeURIComponent(r)}/cancel`,{method:"POST"});if(!a.ok){const f=await a.text().catch(()=>"");throw new Error(b(f,a.status))}t.onState?.("cancelled"),c(P())}}}async function ce(t={}){if(typeof MediaRecorder>"u"||!navigator.mediaDevices?.getUserMedia)throw new Error("Scout voice capture is unavailable in this browser.");const{startStreamLevelMeter:e}=await B(async()=>{const{startStreamLevelMeter:d}=await import("./voice-levels-Dcr3jglk.js");return{startStreamLevelMeter:d}},[]),n=be(),s=[];let r=null,o=null,i=null,c=!1,l=!1,u,h;const m=new Promise((d,a)=>{u=d,h=a}),g=()=>{i?.stop(),i=null;for(const d of r?.getTracks()??[])d.stop();r=null},w=(d,a="error")=>{l||(l=!0,g(),t.onState?.(a),h(d))},S=async()=>{if(l)return;if(g(),c){w(P(),"cancelled");return}t.onState?.("processing");const d=o?.mimeType||A()||"application/octet-stream",a=new Blob(s,{type:d});if(a.size===0){w(new Error("No voice audio was captured."));return}try{const f=await we(a,{sessionId:n});if(l)return;l=!0,t.onFinal?.(f),t.onState?.("done"),u(f)}catch(f){w(f instanceof Error?f:new Error(String(f)))}};try{t.onState?.("starting"),r=await navigator.mediaDevices.getUserMedia({audio:!0}),t.onLevel&&(i=e(r,t.onLevel));const d=A();o=new MediaRecorder(r,d?{mimeType:d}:void 0),o.addEventListener("dataavailable",a=>{a.data.size>0&&s.push(a.data)}),o.addEventListener("error",()=>{w(new Error("Scout voice recorder failed."))}),o.addEventListener("stop",()=>{S()},{once:!0}),o.start(),t.onPartial?.(""),t.onState?.("recording")}catch(d){const a=d instanceof Error?d:new Error(String(d));throw w(a),m.catch(()=>{}),a}return{get sessionId(){return n},result:m,stop:async()=>{!o||o.state==="inactive"||o.stop()},cancel:async()=>{if(c=!0,o&&o.state!=="inactive"){o.stop();return}w(P(),"cancelled")}}}function ue(t){return t==="starting"||t==="recording"||t==="processing"||t==="done"||t==="cancelled"||t==="error"?t:null}function b(t,e){try{return JSON.parse(t).error??`Scout voice returned HTTP ${e}`}catch{return t||`Scout voice returned HTTP ${e}`}}function de(t){return t instanceof Error&&t.name==="AbortError"}async function $(t,e={}){const n={text:t,speed:ye(e.speed)};e.modelId&&(n.modelId=e.modelId),e.voiceId&&(n.voiceId=e.voiceId),e.originAppId&&(n.originAppId=e.originAppId),e.utteranceId&&(n.utteranceId=e.utteranceId),e.instructions&&(n.instructions=e.instructions),e.speechTiming?.enabled&&(n.speechTiming=e.speechTiming),e.playback&&(n.playback=e.playback);const s=await fetch("/api/voice/speak",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n),signal:e.signal});if(!s.ok){const r=await s.text().catch(()=>"");try{const o=JSON.parse(r);throw new Error(o.error??`Scout voice returned HTTP ${s.status}`)}catch(o){throw o instanceof SyntaxError?new Error(r||`Scout voice returned HTTP ${s.status}`):o}}return await s.json()}async function Ve(t){const e=t?`?modelId=${encodeURIComponent(t)}`:"",n=await fetch(`/api/voice/catalog${e}`,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(`Scout voice catalog returned HTTP ${n.status}`);return await n.json()}function ke(t,e,n){if(t.voices.find(i=>i.id===n&&i.modelId===e))return{modelId:e,voiceId:n};const r=t.voices.filter(i=>i.modelId===e),o=r.find(i=>i.isDefault&&i.available!==!1)??r.find(i=>i.available!==!1)??r[0];return{modelId:e,voiceId:o?.id??n}}let y=null;function le(){return typeof window>"u"?null:window.AudioContext??window.webkitAudioContext??null}function Ae(){const t=le();if(!t)return;let e=null;try{(!y||y.state==="closed")&&(y=new t),y.resume().catch(()=>{});const n=y.createBuffer(1,1,y.sampleRate);e=y.createBufferSource(),e.buffer=n,e.connect(y.destination);const s=e;e.onended=()=>s.disconnect(),e.start(0)}catch{e?.disconnect()}}function k(t,e){return new Promise((n,s)=>{if(e?.aborted){s(E());return}const r=()=>{clearTimeout(i),e?.removeEventListener("abort",o)},o=()=>{r(),s(E())},i=setTimeout(()=>{r(),s(new Error("Scout audio preparation timed out."))},1500);e?.addEventListener("abort",o,{once:!0});try{t().then(c=>{r(),n(c)},c=>{r(),s(c)})}catch(c){r(),s(c)}})}async function pe(t,e){const n=y;if(!n||n.state==="closed"||!t.audioBase64)throw new Error("no primed context");if(n.state!=="running"&&await k(()=>n.resume(),e.signal),n.state!=="running")throw new Error("primed context is unavailable");const s=atob(t.audioBase64),r=Uint8Array.from(s,c=>c.charCodeAt(0)),o=await k(()=>n.decodeAudioData(r.buffer),e.signal);if(e.signal?.aborted)throw E();const i=n.createBufferSource();i.buffer=o,i.connect(n.destination),await new Promise((c,l)=>{const u=()=>{i.onended=null,e.signal?.removeEventListener("abort",h),i.disconnect()},h=()=>{u();try{i.stop()}catch{}l(E())};if(e.signal?.aborted){h();return}e.signal?.addEventListener("abort",h,{once:!0}),i.onended=()=>{u(),c()};try{i.start(0),e.onPlaybackStart?.()}catch(m){u();try{i.stop()}catch{}l(m)}})}async function fe(t,e={}){if(e.signal?.aborted)throw E();if(t.playedOnHost)return e.onPlaybackStart?.(),t;if(!t.audioBase64)throw new Error("Scout voice returned no audio to play.");try{return await pe(t,e),t}catch(r){if(de(r))throw r}if(e.signal?.aborted)throw E();const n=new Audio(`data:${t.contentType};base64,${t.audioBase64}`),s=()=>{n.pause(),n.currentTime=0};e.signal?.addEventListener("abort",s,{once:!0}),await n.play(),e.onPlaybackStart?.();try{return await new Promise((r,o)=>{const i=()=>{n.removeEventListener("ended",c),n.removeEventListener("error",l),e.signal?.removeEventListener("abort",u)},c=()=>{i(),r()},l=()=>{i(),o(new Error("Scout voice playback failed."))},u=()=>{i(),o(E())};if(e.signal?.aborted){u();return}n.addEventListener("ended",c,{once:!0}),n.addEventListener("error",l,{once:!0}),e.signal?.addEventListener("abort",u,{once:!0})}),t}finally{e.signal?.removeEventListener("abort",s)}}async function he(t,e={}){q();try{const n=await $(t,e);return await fe(n,{signal:e.signal,onPlaybackStart:e.onPlaybackStart})}finally{N()}}function De(t,e={}){const n=new AbortController;return{promise:he(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function me(t,e={}){q();try{const n=await $(t,e);if(e.signal?.aborted)throw E();if(n.playedOnHost)return e.onPlaybackStart?.(),n;const s=await H(n.audioBase64,n.contentType),r=ge(e.presetId,e.params),o=j(s,{params:r,signal:e.signal});return e.onPlaybackStart?.(),await o.promise,n}finally{N()}}function xe(t,e={}){const n=new AbortController;return{promise:me(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function we(t,e){const n=new FormData,s=Se(t.type);n.append("audio",t,`audio.${ve(t.type)}`),n.append("sessionId",e.sessionId),s&&n.append("format",s);const r=await fetch("/api/voice/transcribe",{method:"POST",body:n});if(!r.ok){const i=await r.text().catch(()=>"");try{const c=JSON.parse(i);throw new Error(c.error??`Scout voice returned HTTP ${r.status}`)}catch(c){throw c instanceof SyntaxError?new Error(i||`Scout voice returned HTTP ${r.status}`):c}}const o=await r.json();return{sessionId:e.sessionId,text:o.text?.trim()??"",durationMs:Number(o.durationMs??0)}}function E(){const t=new Error("Speech stopped.");return t.name="AbortError",t}function P(){const t=new Error("Voice recording was cancelled.");return t.name="AbortError",t}function A(){return typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"?void 0:["audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/mp4","audio/webm","audio/wav"].find(e=>{try{return MediaRecorder.isTypeSupported(e)}catch{return!1}})}function Se(t){const e=t.toLowerCase();if(e.includes("mp3")||e.includes("mpeg"))return"mp3";if(e.includes("wav"))return"wav";if(e.includes("aac")||e.includes("mp4"))return"aac";if(e.includes("opus")||e.includes("ogg")||e.includes("webm"))return"opus"}function ve(t){const e=t.toLowerCase();return e.includes("webm")?"webm":e.includes("ogg")||e.includes("opus")?"opus":e.includes("mp4")||e.includes("aac")?"m4a":e.includes("wav")?"wav":e.includes("mp3")||e.includes("mpeg")?"mp3":"audio"}function ge(t,e){const n=t?G.find(s=>s.id===t)?.params:void 0;return{...z,...n??{},...e??{}}}function ye(t){if(!(t===void 0||!Number.isFinite(t)))return Math.min(2,Math.max(.5,Number(t.toFixed(2))))}function be(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`scout-voice:${crypto.randomUUID()}`:`scout-voice:${Date.now().toString(36)}:${Math.random().toString(36).slice(2)}`}async function Ee(){const t=await fetch("/api/voice/settings");if(!t.ok){const e=await t.text().catch(()=>"");throw new Error(b(e,t.status))}return await t.json()}async function D(t="microphone"){const e=await fetch("/api/voice/permissions/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:t})});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(b(n,e.status))}}async function R(t="microphone"){const e=await fetch("/api/voice/permissions/request",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:t})});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(b(n,e.status))}}async function qe(t=12){const e=await fetch(`/api/voice/history?limit=${t}`);if(!e.ok){const s=await e.text().catch(()=>"");throw new Error(b(s,e.status))}return(await e.json()).sessions??[]}async function Ne(t){const e=await fetch("/api/voice/settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(b(n,e.status))}return await e.json()}export{Re as a,Ce as b,Oe as c,Te as d,Le as e,Ve as f,U as g,Ie as h,fe as i,N as j,q as k,xe as l,de as m,Ae as n,D as o,$ as p,Ee as q,R as r,De as s,ke as t,Pe as u,qe as v,Ne as w};
@@ -1,4 +1,4 @@
1
- import{j as i,r as p}from"./index-EsrkGBcv.js";import{u as m}from"./Provider-C35yu29I.js";import{a as x}from"./api-DSqpVKC7.js";import{E as g}from"./external-link-CUObqmgX.js";const h=new RegExp("(?:^|(?<=[\\s(`'\"<>]))(?:~\\/|\\/(?:Users|home|opt|var|etc|tmp|private)\\/)[^\\s)`'\"<>]+\\.[A-Za-z0-9]{1,8}\\b","g");function b(n){const e=n.replace(/\r\n?/g,`
1
+ import{j as i,r as p}from"./index-BFbLvCJn.js";import{u as m}from"./Provider-BEXAZWd9.js";import{a as x}from"./api-DSqpVKC7.js";import{E as g}from"./external-link-Df1R34rX.js";const h=new RegExp("(?:^|(?<=[\\s(`'\"<>]))(?:~\\/|\\/(?:Users|home|opt|var|etc|tmp|private)\\/)[^\\s)`'\"<>]+\\.[A-Za-z0-9]{1,8}\\b","g");function b(n){const e=n.replace(/\r\n?/g,`
2
2
  `).split(`
3
3
  `),t=[];let s=0;for(;s<e.length;){const r=e[s];if(r.trim()===""){s+=1;continue}if(r.startsWith("```")){const l=[];for(s+=1;s<e.length&&!e[s].startsWith("```");)l.push(e[s]),s+=1;s<e.length&&(s+=1),t.push({kind:"code",body:l.join(`
4
4
  `)});continue}const c=r.match(/^(#{1,3})\s+(.*\S)\s*$/);if(c){const l=c[1].length;t.push({kind:"heading",level:l,tokens:d(c[2])}),s+=1;continue}if(u(r)){const l=[];for(;s<e.length&&u(e[s]);)l.push(d(k(e[s]))),s+=1;t.push({kind:"list",items:l});continue}const o=[];for(;s<e.length&&e[s].trim()!==""&&!e[s].startsWith("```")&&!u(e[s])&&!/^#{1,3}\s+\S/.test(e[s]);)o.push(d(e[s])),s+=1;t.push({kind:"paragraph",lines:o})}return t}const f=/^\s*[-*]\s+/;function u(n){return f.test(n)}function k(n){return n.replace(f,"")}function d(n){const e=[];let t=0,s="";const r=()=>{s&&(e.push({kind:"text",body:s}),s="")};for(;t<n.length;){const c=n[t];if(c==="`"){const o=n.indexOf("`",t+1);if(o!==-1&&o>t+1){r(),e.push({kind:"code",body:n.slice(t+1,o)}),t=o+1;continue}}else if(c==="*"&&n[t+1]==="*"){const o=n.indexOf("**",t+2);if(o!==-1&&o>t+2){r(),e.push({kind:"bold",body:n.slice(t+2,o)}),t=o+2;continue}}else if(c==="*"||c==="_"){const o=y(n,t+1,c);if(o!==-1){r(),e.push({kind:"italic",body:n.slice(t+1,o)}),t=o+1;continue}}s+=c,t+=1}return r(),j(e)}function j(n){const e=[];for(const t of n){if(t.kind!=="text"){e.push(t);continue}const s=v(t.body);s.length===1&&s[0].kind==="text"?e.push(t):e.push(...s)}return e}function v(n){if(!n)return[];const e=[];let t=0;h.lastIndex=0;let s;for(;(s=h.exec(n))!==null;){const r=s.index,c=r+s[0].length;r>t&&e.push({kind:"text",body:n.slice(t,r)}),e.push({kind:"file-path",body:s[0]}),t=c}return t===0?[{kind:"text",body:n}]:(t<n.length&&e.push({kind:"text",body:n.slice(t)}),e)}function y(n,e,t){if(n[e]===void 0||/\s/.test(n[e]))return-1;for(let s=e;s<n.length;s+=1){const r=n[s];if(r===t){const c=n[s-1];if(c&&!/\s/.test(c)&&n[s+1]!==t)return s}if(r===`
@@ -1 +1 @@
1
- import{c as a}from"./createLucideIcon-zZ8Hx7er.js";const t=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],c=a("scroll-text",t);export{c as S};
1
+ import{c as a}from"./createLucideIcon-CKbjXlwv.js";const t=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],c=a("scroll-text",t);export{c as S};
@@ -1 +1 @@
1
- import{c}from"./createLucideIcon-zZ8Hx7er.js";const e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],o=c("search",e);export{o as S};
1
+ import{c}from"./createLucideIcon-CKbjXlwv.js";const e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],o=c("search",e);export{o as S};
@@ -0,0 +1 @@
1
+ import{a,b as o}from"./nav-destinations-B3R5zxFX.js";const r=o(),t=a();export{r as A,t as O};
@@ -1 +1 @@
1
- import{j as r,r as o}from"./index-EsrkGBcv.js";import{j as l}from"./ui-LM8pS8qE.js";function p({branch:t,fallback:s}){const e=l(t,s);return e.detached?r.jsx("span",{className:"pre",children:e.sha??"detached"}):e.prefix?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"pre",children:e.prefix}),e.leaf]}):r.jsx(r.Fragment,{children:e.leaf})}const a={worktree:null,project:null,generatedAt:0,tone:"warm"};let n=a;const c=new Set;function i(){for(const t of c)t()}function h(t){n=t,i()}function d(){n!==a&&(n=a,i())}function m(){const[t,s]=o.useState(()=>n);return o.useEffect(()=>{s(n);const e=()=>s(n);return c.add(e),()=>{c.delete(e)}},[]),t}export{p as B,d as c,h as p,m as u};
1
+ import{j as r,r as o}from"./index-BFbLvCJn.js";import{j as l}from"./ui-LM8pS8qE.js";function p({branch:t,fallback:s}){const e=l(t,s);return e.detached?r.jsx("span",{className:"pre",children:e.sha??"detached"}):e.prefix?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"pre",children:e.prefix}),e.leaf]}):r.jsx(r.Fragment,{children:e.leaf})}const a={worktree:null,project:null,generatedAt:0,tone:"warm"};let n=a;const c=new Set;function i(){for(const t of c)t()}function h(t){n=t,i()}function d(){n!==a&&(n=a,i())}function m(){const[t,s]=o.useState(()=>n);return o.useEffect(()=>{s(n);const e=()=>s(n);return c.add(e),()=>{c.delete(e)}},[]),t}export{p as B,d as c,h as p,m as u};
@@ -1 +1 @@
1
- import{c as a}from"./createLucideIcon-zZ8Hx7er.js";const o=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],e=a("send-horizontal",o);export{e as S};
1
+ import{c as a}from"./createLucideIcon-CKbjXlwv.js";const o=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],e=a("send-horizontal",o);export{e as S};
@@ -1 +1 @@
1
- import{a as o}from"./api-DSqpVKC7.js";import{h as r}from"./NewChatComposer-C97-iTMK.js";function a(s){return s.agentClass==="native-session"||s.id.startsWith("native:")}function c(s,n){const t=s.harnessSessionId?.trim();if(!t)throw new Error("This native session has no session id to continue.");const e=s.projectRoot?.trim()||s.cwd?.trim();if(!e)throw new Error("This native session has no project path to route from.");const i=s.harness?.trim();return{target:{projectPath:e},execution:{session:"existing",targetSessionId:t,...i?{harness:i}:{}},agent:{persistence:"one_time",...s.handle?.trim()?{handle:s.handle.trim()}:{}},seed:{instructions:n}}}async function m(s,n){if(a(s)){const i=Date.now();return await o("/api/sessions",{method:"POST",body:JSON.stringify(c(s,n))}),{conversationId:null,sentAt:i}}const t=await r(s),e=Date.now();return await o("/api/send",{method:"POST",body:JSON.stringify({body:n,chatId:t})}),{conversationId:t,sentAt:e}}export{a as i,m as s};
1
+ import{a as o}from"./api-DSqpVKC7.js";import{h as r}from"./NewChatComposer-D-VB5vdt.js";function a(s){return s.agentClass==="native-session"||s.id.startsWith("native:")}function c(s,n){const t=s.harnessSessionId?.trim();if(!t)throw new Error("This native session has no session id to continue.");const e=s.projectRoot?.trim()||s.cwd?.trim();if(!e)throw new Error("This native session has no project path to route from.");const i=s.harness?.trim();return{target:{projectPath:e},execution:{session:"existing",targetSessionId:t,...i?{harness:i}:{}},agent:{persistence:"one_time",...s.handle?.trim()?{handle:s.handle.trim()}:{}},seed:{instructions:n}}}async function m(s,n){if(a(s)){const i=Date.now();return await o("/api/sessions",{method:"POST",body:JSON.stringify(c(s,n))}),{conversationId:null,sentAt:i}}const t=await r(s),e=Date.now();return await o("/api/send",{method:"POST",body:JSON.stringify({body:n,chatId:t})}),{conversationId:t,sentAt:e}}export{a as i,m as s};
@@ -1 +1 @@
1
- import{c as e}from"./createLucideIcon-zZ8Hx7er.js";const r=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],i=e("server",r);export{i as S};
1
+ import{c as e}from"./createLucideIcon-CKbjXlwv.js";const r=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],i=e("server",r);export{i as S};
@@ -1 +1 @@
1
- import{r as d}from"./terminal-relay-Bxs1hp-j.js";function S(r,e){const s=d(r),n=s?r.harnessSessionId??s.sessionName:null;return e?.activeSessionId??n}function I(r,e){return[...r].sort((s,n)=>{const t=s.id===e?1:0,o=n.id===e?1:0;return t!==o?o-t:(n.endedAt??n.startedAt)-(s.endedAt??s.startedAt)})}function c(r){const e=r;return[e.id,e.surfaceSessionId,e.harnessSessionId,e.externalSessionId,e.threadId,e.runtimeSessionId,e.runtimeSessionRef,e.runtimeRef,e.sourceSessionId,e.sessionId,e.refId].flatMap(s=>{const n=s?.trim();return n?[n]:[]})}function u(r){const e=/^relay-(.+)-(claude|codex)$/iu.exec(r);return e?{scope:e[1].toLowerCase(),harness:e[2].toLowerCase()}:null}function l(r,e){const s=u(r),n=u(e);return!s||!n?!1:s.harness===n.harness&&(s.scope===n.scope||s.scope.startsWith(`${n.scope}-`))}function f(r,e){const s=r?.trim();if(!s)return null;const n=e.find(a=>c(a).some(i=>i===s));if(n)return n.id;const t=e.filter(a=>c(a).some(i=>l(i,s)));return new Set(t.map(a=>a.id)).size===1?t[0]?.id??null:null}function h(r,e,s,n,t){const o=f(t,n);return o||(s??n[0]?.id??null)}function A(r,e,s,n){const t=!!d(r),o=n&&(!!s.canObserve||t),a=n&&(!!s.canTakeover||t||!!e?.resumeCommand);return{canObserve:o,canTakeover:a}}export{h as a,f as b,A as c,S as r,I as s};
1
+ import{r as d}from"./terminal-relay-CpGHpDa8.js";function S(r,e){const s=d(r),n=s?r.harnessSessionId??s.sessionName:null;return e?.activeSessionId??n}function I(r,e){return[...r].sort((s,n)=>{const t=s.id===e?1:0,o=n.id===e?1:0;return t!==o?o-t:(n.endedAt??n.startedAt)-(s.endedAt??s.startedAt)})}function c(r){const e=r;return[e.id,e.surfaceSessionId,e.harnessSessionId,e.externalSessionId,e.threadId,e.runtimeSessionId,e.runtimeSessionRef,e.runtimeRef,e.sourceSessionId,e.sessionId,e.refId].flatMap(s=>{const n=s?.trim();return n?[n]:[]})}function u(r){const e=/^relay-(.+)-(claude|codex)$/iu.exec(r);return e?{scope:e[1].toLowerCase(),harness:e[2].toLowerCase()}:null}function l(r,e){const s=u(r),n=u(e);return!s||!n?!1:s.harness===n.harness&&(s.scope===n.scope||s.scope.startsWith(`${n.scope}-`))}function f(r,e){const s=r?.trim();if(!s)return null;const n=e.find(a=>c(a).some(i=>i===s));if(n)return n.id;const t=e.filter(a=>c(a).some(i=>l(i,s)));return new Set(t.map(a=>a.id)).size===1?t[0]?.id??null:null}function h(r,e,s,n,t){const o=f(t,n);return o||(s??n[0]?.id??null)}function A(r,e,s,n){const t=!!d(r),o=n&&(!!s.canObserve||t),a=n&&(!!s.canTakeover||t||!!e?.resumeCommand);return{canObserve:o,canTakeover:a}}export{h as a,f as b,A as c,S as r,I as s};
@@ -1 +1 @@
1
- import{a as x}from"./api-DSqpVKC7.js";import{f as O,s as _,a as A}from"./scout-voice-CZx60X6E.js";import{g as K,a as T}from"./session-recap-lanes-D-eVJnpY.js";function F(e){return(e.split(/[/:]/u).filter(Boolean).at(-1)??e).replace(/^session[-_]?/i,"").slice(0,8)}function C(e){return((e.observe?.metadata?.session?.adapterType??e.observe?.metadata?.session?.source??e.agent.harness)?.trim().toLowerCase()??"")||null}function L(e){return((e.observe?.metadata?.session?.externalSessionId??e.agent.harnessSessionId??e.observe?.metadata?.session?.threadId)?.trim()??"")||null}function P(e,t,o){return[o??"local",e,t].join("|")}function E(e){const t=new Map;for(const a of e){const r=C(a),u=L(a);if(!r||!u)continue;const d=`${r}\0${u}`,p=t.get(d)??[];p.push(a),t.set(d,p)}const o=[];for(const a of t.values()){const r=a[0],u=C(r),d=L(r),p=r.agent.homeNodeId?.trim()||null,m=`${u} · ${F(d)}`,n=a.filter(s=>s.source==="scout"),y=n.length===1&&a.length===1,f=n[0]?.agent;o.push({sessionRef:d,harness:u,voiceKey:y&&f?f.id:P(u,d,p),displayLabel:y&&f?f.handle?.trim()||f.name:m,identityVerified:y,sourceExact:m,observedAt:r.lastActiveAt>0?r.lastActiveAt:null,reportedState:r.agent.state,nodeId:p})}return o}const N="scout.recapVoices.v1",V="scout.recapVoices.consent.v1";function M(e){return[...e].reduce((t,o)=>t*31+o.charCodeAt(0)>>>0,0)}function q(e,t){return e.voices.filter(o=>o.modelId===t&&o.available!==!1)}function B(){try{const e=window.localStorage.getItem(N);if(!e)return{};const t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function j(e){try{window.localStorage.setItem(N,JSON.stringify(e))}catch{}}function J(){try{return window.localStorage.getItem(V)==="1"}catch{return!1}}function z(){try{window.localStorage.setItem(V,"1")}catch{}}function D(e,t){const o=e.models.find(a=>a.id===t);return o?o.provider!=="system"&&o.available!==!1:!0}function G(e,t,o,a={}){const r=q(t,o),u={...a},d=[],p=new Set;for(const m of e){const n=u[m];if(n&&n.modelId===o&&r.some(i=>i.id===n.voiceId)){p.add(n.voiceId);continue}n&&n.voiceId&&d.push(`Assigned voice ${n.voiceId} is unavailable; using a fallback.`);const y=r.filter(i=>!p.has(i.id)),f=y.length>0?y:r;if(f.length===0){d.push("No supported Scout speech voice is available for this model.");continue}const s=f[M(m)%f.length];u[m]={modelId:o,voiceId:s.id},p.add(s.id)}return{assignments:u,notices:d}}const Q="openscout-recap";let l={running:!1,speaker:null,notice:null,items:[]};const k=new Set;let v=null,b=null,h=0;function c(e){l=e;for(const t of k)t()}function Z(){return l}function ee(e){return k.add(e),()=>{k.delete(e)}}function S(){h+=1,v?.abort(),v=null,b?.stop(),b=null,c({running:!1,speaker:null,notice:l.notice,items:l.items.map(e=>e.status==="queued"||e.status==="summarizing"||e.status==="speaking"?{...e,status:"skipped",reason:e.reason??"Stopped."}:e)})}function Y(e,t){return x("/api/scoutbot/session-recap",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionRef:e.sessionRef,harness:e.harness}),signal:t})}async function $(e,t={}){if(l.running){S();return}const o=A();if(o){c({running:!1,speaker:null,notice:o,items:[]});return}if(e.length===0){c({running:!1,speaker:null,notice:"No visible sessions to recap.",items:[]});return}const a=++h,r=new AbortController;v=r,c({running:!0,speaker:null,notice:null,items:[]});let u;try{u=t.catalog??await(t.fetchCatalog?.()??O(t.modelId))}catch(s){if(h!==a)return;v=null,c({running:!1,speaker:null,notice:s instanceof Error?s.message:"Speech catalog unavailable.",items:[]});return}if(h!==a||r.signal.aborted)return;const d=A();if(d){v=null,c({running:!1,speaker:null,notice:d,items:[]});return}const p=t.modelId??u.defaultModelId;if((t.requireConsent??!0)&&D(u,p)&&!J()){c({running:!1,speaker:null,notice:"Configured TTS may be metered. Run Fleet roll call again to speak.",items:[]}),v=null,z();return}const m=G(e.map(s=>s.voiceKey),u,p,B());j(m.assignments);const n=e.map(s=>({target:s,status:"queued",summary:"",reason:null,spokenText:null}));c({running:!0,speaker:null,notice:m.notices[0]??null,items:n});const y=t.fetchRecap??Y,f=t.speak??((s,i)=>_(s,{modelId:i.modelId,voiceId:i.voiceId,originAppId:Q,utteranceId:`recap:${Date.now()}`}));for(let s=0;s<n.length;s+=1){if(h!==a||r.signal.aborted)return;const i=n[s];n[s]={...i,status:"summarizing"},c({running:!0,speaker:i.target.displayLabel,notice:l.notice,items:[...n]});try{const g=await y(i.target,r.signal);if(h!==a)return;if(g.status!=="ready"||!g.summary.trim()){n[s]={...n[s],status:"skipped",reason:"Source unavailable.",summary:g.summary},c({running:!0,speaker:i.target.displayLabel,notice:l.notice,items:[...n]});continue}const I=`${i.target.identityVerified?`${i.target.displayLabel}. `:`${i.target.displayLabel}. Identity not verified. `}${g.summary}`,R=m.assignments[i.target.voiceKey];if(!R){n[s]={...n[s],status:"failed",reason:"No Scout speech voice is assigned.",summary:g.summary},c({running:!0,speaker:i.target.displayLabel,notice:l.notice,items:[...n]});continue}n[s]={...n[s],status:"speaking",summary:g.summary,spokenText:I},c({running:!0,speaker:i.target.displayLabel,notice:l.notice,items:[...n]});const w=f(I,R);if(b=w,await w.promise,h!==a)return;b=null,n[s]={...n[s],status:"done"},c({running:!0,speaker:i.target.displayLabel,notice:l.notice,items:[...n]})}catch(g){if(h!==a||r.signal.aborted)return;b=null,n[s]={...n[s],status:"failed",reason:g instanceof Error?g.message:"Recap failed."},c({running:!0,speaker:null,notice:l.notice,items:[...n]})}}h===a&&(v=null,c({running:!1,speaker:null,notice:l.notice,items:[...n]}))}function te(){if(l.running){S();return}$(E(T()))}function ne(){if(l.running){S();return}const e=T(),t=K(),o=(t?e.find(r=>r.id===t):null)??e[0],a=E(o?[o]:[]);if(a.length===0){c({running:!1,speaker:null,notice:"No visible session to recap.",items:[]});return}$(a)}export{S as a,ne as b,Z as g,ee as s,te as t};
1
+ import{a as x}from"./api-DSqpVKC7.js";import{f as O,s as _,a as A}from"./scout-voice-Cdh6pCsb.js";import{g as K,a as T}from"./session-recap-lanes-D-eVJnpY.js";function F(e){return(e.split(/[/:]/u).filter(Boolean).at(-1)??e).replace(/^session[-_]?/i,"").slice(0,8)}function C(e){return((e.observe?.metadata?.session?.adapterType??e.observe?.metadata?.session?.source??e.agent.harness)?.trim().toLowerCase()??"")||null}function L(e){return((e.observe?.metadata?.session?.externalSessionId??e.agent.harnessSessionId??e.observe?.metadata?.session?.threadId)?.trim()??"")||null}function P(e,t,o){return[o??"local",e,t].join("|")}function E(e){const t=new Map;for(const a of e){const r=C(a),u=L(a);if(!r||!u)continue;const d=`${r}\0${u}`,p=t.get(d)??[];p.push(a),t.set(d,p)}const o=[];for(const a of t.values()){const r=a[0],u=C(r),d=L(r),p=r.agent.homeNodeId?.trim()||null,m=`${u} · ${F(d)}`,n=a.filter(s=>s.source==="scout"),y=n.length===1&&a.length===1,f=n[0]?.agent;o.push({sessionRef:d,harness:u,voiceKey:y&&f?f.id:P(u,d,p),displayLabel:y&&f?f.handle?.trim()||f.name:m,identityVerified:y,sourceExact:m,observedAt:r.lastActiveAt>0?r.lastActiveAt:null,reportedState:r.agent.state,nodeId:p})}return o}const N="scout.recapVoices.v1",V="scout.recapVoices.consent.v1";function M(e){return[...e].reduce((t,o)=>t*31+o.charCodeAt(0)>>>0,0)}function q(e,t){return e.voices.filter(o=>o.modelId===t&&o.available!==!1)}function B(){try{const e=window.localStorage.getItem(N);if(!e)return{};const t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function j(e){try{window.localStorage.setItem(N,JSON.stringify(e))}catch{}}function J(){try{return window.localStorage.getItem(V)==="1"}catch{return!1}}function z(){try{window.localStorage.setItem(V,"1")}catch{}}function D(e,t){const o=e.models.find(a=>a.id===t);return o?o.provider!=="system"&&o.available!==!1:!0}function G(e,t,o,a={}){const r=q(t,o),u={...a},d=[],p=new Set;for(const m of e){const n=u[m];if(n&&n.modelId===o&&r.some(i=>i.id===n.voiceId)){p.add(n.voiceId);continue}n&&n.voiceId&&d.push(`Assigned voice ${n.voiceId} is unavailable; using a fallback.`);const y=r.filter(i=>!p.has(i.id)),f=y.length>0?y:r;if(f.length===0){d.push("No supported Scout speech voice is available for this model.");continue}const s=f[M(m)%f.length];u[m]={modelId:o,voiceId:s.id},p.add(s.id)}return{assignments:u,notices:d}}const Q="openscout-recap";let l={running:!1,speaker:null,notice:null,items:[]};const k=new Set;let v=null,b=null,h=0;function c(e){l=e;for(const t of k)t()}function Z(){return l}function ee(e){return k.add(e),()=>{k.delete(e)}}function S(){h+=1,v?.abort(),v=null,b?.stop(),b=null,c({running:!1,speaker:null,notice:l.notice,items:l.items.map(e=>e.status==="queued"||e.status==="summarizing"||e.status==="speaking"?{...e,status:"skipped",reason:e.reason??"Stopped."}:e)})}function Y(e,t){return x("/api/scoutbot/session-recap",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionRef:e.sessionRef,harness:e.harness}),signal:t})}async function $(e,t={}){if(l.running){S();return}const o=A();if(o){c({running:!1,speaker:null,notice:o,items:[]});return}if(e.length===0){c({running:!1,speaker:null,notice:"No visible sessions to recap.",items:[]});return}const a=++h,r=new AbortController;v=r,c({running:!0,speaker:null,notice:null,items:[]});let u;try{u=t.catalog??await(t.fetchCatalog?.()??O(t.modelId))}catch(s){if(h!==a)return;v=null,c({running:!1,speaker:null,notice:s instanceof Error?s.message:"Speech catalog unavailable.",items:[]});return}if(h!==a||r.signal.aborted)return;const d=A();if(d){v=null,c({running:!1,speaker:null,notice:d,items:[]});return}const p=t.modelId??u.defaultModelId;if((t.requireConsent??!0)&&D(u,p)&&!J()){c({running:!1,speaker:null,notice:"Configured TTS may be metered. Run Fleet roll call again to speak.",items:[]}),v=null,z();return}const m=G(e.map(s=>s.voiceKey),u,p,B());j(m.assignments);const n=e.map(s=>({target:s,status:"queued",summary:"",reason:null,spokenText:null}));c({running:!0,speaker:null,notice:m.notices[0]??null,items:n});const y=t.fetchRecap??Y,f=t.speak??((s,i)=>_(s,{modelId:i.modelId,voiceId:i.voiceId,originAppId:Q,utteranceId:`recap:${Date.now()}`}));for(let s=0;s<n.length;s+=1){if(h!==a||r.signal.aborted)return;const i=n[s];n[s]={...i,status:"summarizing"},c({running:!0,speaker:i.target.displayLabel,notice:l.notice,items:[...n]});try{const g=await y(i.target,r.signal);if(h!==a)return;if(g.status!=="ready"||!g.summary.trim()){n[s]={...n[s],status:"skipped",reason:"Source unavailable.",summary:g.summary},c({running:!0,speaker:i.target.displayLabel,notice:l.notice,items:[...n]});continue}const I=`${i.target.identityVerified?`${i.target.displayLabel}. `:`${i.target.displayLabel}. Identity not verified. `}${g.summary}`,R=m.assignments[i.target.voiceKey];if(!R){n[s]={...n[s],status:"failed",reason:"No Scout speech voice is assigned.",summary:g.summary},c({running:!0,speaker:i.target.displayLabel,notice:l.notice,items:[...n]});continue}n[s]={...n[s],status:"speaking",summary:g.summary,spokenText:I},c({running:!0,speaker:i.target.displayLabel,notice:l.notice,items:[...n]});const w=f(I,R);if(b=w,await w.promise,h!==a)return;b=null,n[s]={...n[s],status:"done"},c({running:!0,speaker:i.target.displayLabel,notice:l.notice,items:[...n]})}catch(g){if(h!==a||r.signal.aborted)return;b=null,n[s]={...n[s],status:"failed",reason:g instanceof Error?g.message:"Recap failed."},c({running:!0,speaker:null,notice:l.notice,items:[...n]})}}h===a&&(v=null,c({running:!1,speaker:null,notice:l.notice,items:[...n]}))}function te(){if(l.running){S();return}$(E(T()))}function ne(){if(l.running){S();return}const e=T(),t=K(),o=(t?e.find(r=>r.id===t):null)??e[0],a=E(o?[o]:[]);if(a.length===0){c({running:!1,speaker:null,notice:"No visible session to recap.",items:[]});return}$(a)}export{S as a,ne as b,Z as g,ee as s,te as t};
@@ -1 +1 @@
1
- import{c as u}from"./createLucideIcon-zZ8Hx7er.js";const l=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],b=u("power",l),d=10080*60*1e3,f=720*60*60*1e3,p={column:"state",direction:"desc"},S=[{id:"name",label:"Session",initialDirection:"asc"},{id:"host",label:"Host",initialDirection:"asc"},{id:"state",label:"State",initialDirection:"desc"},{id:"project",label:"Project",initialDirection:"asc"},{id:"activity",label:"Activity",initialDirection:"desc"}];function c(t){const e=typeof t.session.metadata?.attachedClients=="number"?t.session.metadata.attachedClients:0;return t.surface.state==="exited"?0:e>0?3:t.surface.state==="detached"?1:2}function y(t){const e=typeof t.session.metadata?.attachedClients=="number"?t.session.metadata.attachedClients:null;return t.surface.state==="exited"?"exited":e&&e>0?`${e} attached`:t.surface.state??"live"}function o(t){const e=t.session.metadata?.activityAt;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t.session.metadata?.startedAt;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:t.origin==="backend"?null:t.session.updatedAt||null}function v(t,e=Date.now()){const n=t.session.metadata?.activityAt,i=typeof n=="number"&&Number.isFinite(n)&&n>0?n:t.origin==="backend"?null:t.session.updatedAt||null;if(i===null)return"current";const a=Math.max(0,e-i);return a>=f?"review":a>=d?"inactive":"current"}function s(t,e){return t.localeCompare(e,void 0,{numeric:!0,sensitivity:"base"})}function _(t,e){const n=e.direction==="asc"?1:-1;return[...t].sort((i,a)=>{const r=m(i,a,e.column)*n;return r!==0?r:s(i.title,a.title)})}function m(t,e,n){switch(n){case"name":return s(t.title,e.title);case"host":return s(t.surface.backend,e.surface.backend);case"state":return c(t)-c(e);case"project":return s(t.project,e.project);case"activity":{const i=o(t),a=o(e);return i===null&&a===null?0:i===null?-1:a===null?1:i-a}}}function E(t,e){if(t.column===e)return{column:e,direction:t.direction==="asc"?"desc":"asc"};const n=S.find(i=>i.id===e)?.initialDirection??"asc";return{column:e,direction:n}}export{p as D,b as P,S as T,o as a,v as b,E as c,y as d,_ as s,c as t};
1
+ import{c as u}from"./createLucideIcon-CKbjXlwv.js";const l=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],b=u("power",l),d=10080*60*1e3,f=720*60*60*1e3,p={column:"state",direction:"desc"},S=[{id:"name",label:"Session",initialDirection:"asc"},{id:"host",label:"Host",initialDirection:"asc"},{id:"state",label:"State",initialDirection:"desc"},{id:"project",label:"Project",initialDirection:"asc"},{id:"activity",label:"Activity",initialDirection:"desc"}];function c(t){const e=typeof t.session.metadata?.attachedClients=="number"?t.session.metadata.attachedClients:0;return t.surface.state==="exited"?0:e>0?3:t.surface.state==="detached"?1:2}function y(t){const e=typeof t.session.metadata?.attachedClients=="number"?t.session.metadata.attachedClients:null;return t.surface.state==="exited"?"exited":e&&e>0?`${e} attached`:t.surface.state??"live"}function o(t){const e=t.session.metadata?.activityAt;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t.session.metadata?.startedAt;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:t.origin==="backend"?null:t.session.updatedAt||null}function v(t,e=Date.now()){const n=t.session.metadata?.activityAt,i=typeof n=="number"&&Number.isFinite(n)&&n>0?n:t.origin==="backend"?null:t.session.updatedAt||null;if(i===null)return"current";const a=Math.max(0,e-i);return a>=f?"review":a>=d?"inactive":"current"}function s(t,e){return t.localeCompare(e,void 0,{numeric:!0,sensitivity:"base"})}function _(t,e){const n=e.direction==="asc"?1:-1;return[...t].sort((i,a)=>{const r=m(i,a,e.column)*n;return r!==0?r:s(i.title,a.title)})}function m(t,e,n){switch(n){case"name":return s(t.title,e.title);case"host":return s(t.surface.backend,e.surface.backend);case"state":return c(t)-c(e);case"project":return s(t.project,e.project);case"activity":{const i=o(t),a=o(e);return i===null&&a===null?0:i===null?-1:a===null?1:i-a}}}function E(t,e){if(t.column===e)return{column:e,direction:t.direction==="asc"?"desc":"asc"};const n=S.find(i=>i.id===e)?.initialDirection??"asc";return{column:e,direction:n}}export{p as D,b as P,S as T,o as a,v as b,E as c,y as d,_ as s,c as t};
@@ -1 +1 @@
1
- import{f as d}from"./use-fleet-active-asks-CymmXWH4.js";import{c as g}from"./message-visibility-DwxgcgYK.js";const l="No project",p="Recent";function m(e){const n=e?.project?.trim();if(n)return n;const o=e?.projectRoot?.trim();if(o){const s=o.replace(/\/+$/,"").split("/").pop();if(s)return s}return l}function _(e){const n=(e.title??"").trim()||e.agentName||e.id,o=(e.agentName??"").trim().toLowerCase();if(n&&n.trim().toLowerCase()!==o)return n;const s=e.preview?g(e.preview).replace(/\s+/g," ").trim():"";return s?s.length>64?`${s.slice(0,61)}…`:s:e.currentBranch??n}const f={needs_you:"Needs you",working:"Working",queued:"Starting",quiet:"Quiet"},w=["needs_you","working","queued","quiet"];function k(e){return e?.status==="needs_attention"?"needs_you":e?.status==="working"?"working":e?.status==="queued"?"queued":"quiet"}const A=1440*60*1e3,E=["Today","Yesterday","This week","Earlier"];function L(e,n){if(!e)return"Earlier";const o=c=>{const u=new Date(c);return u.setHours(0,0,0,0),u.getTime()},s=Math.round((o(n)-o(e))/A);return s<=0?"Today":s===1?"Yesterday":s<7?"This week":"Earlier"}function S(e,n,o,s,c){if(n==="recent"){if(e.length===0)return[];const t=[...e].sort((r,a)=>(a.lastMessageAt??0)-(r.lastMessageAt??0));return[{label:p,sessions:t}]}const u=t=>{const r=t.agentId?o.get(t.agentId):void 0;switch(n){case"project":return m(r);case"agent":return r?.name??t.agentName??"Unknown agent";case"day":return L(t.lastMessageAt,c);case"state":return f[k(d(s,t))]}},i=new Map;for(const t of e){const r=u(t),a=i.get(r);a?a.push(t):i.set(r,[t])}for(const t of i.values())t.sort((r,a)=>(a.lastMessageAt??0)-(r.lastMessageAt??0));return(()=>{const t=[...i.keys()];return n==="day"?E.filter(r=>i.has(r)):n==="state"?w.map(r=>f[r]).filter(r=>i.has(r)):t.sort((r,a)=>r===l?1:a===l?-1:r.localeCompare(a))})().map(t=>({label:t,sessions:i.get(t)}))}export{l as N,S as g,m as p,_ as t};
1
+ import{f as d}from"./use-fleet-active-asks-DAHOPYPV.js";import{c as g}from"./message-visibility-DwxgcgYK.js";const l="No project",p="Recent";function m(e){const n=e?.project?.trim();if(n)return n;const o=e?.projectRoot?.trim();if(o){const s=o.replace(/\/+$/,"").split("/").pop();if(s)return s}return l}function _(e){const n=(e.title??"").trim()||e.agentName||e.id,o=(e.agentName??"").trim().toLowerCase();if(n&&n.trim().toLowerCase()!==o)return n;const s=e.preview?g(e.preview).replace(/\s+/g," ").trim():"";return s?s.length>64?`${s.slice(0,61)}…`:s:e.currentBranch??n}const f={needs_you:"Needs you",working:"Working",queued:"Starting",quiet:"Quiet"},w=["needs_you","working","queued","quiet"];function k(e){return e?.status==="needs_attention"?"needs_you":e?.status==="working"?"working":e?.status==="queued"?"queued":"quiet"}const A=1440*60*1e3,E=["Today","Yesterday","This week","Earlier"];function L(e,n){if(!e)return"Earlier";const o=c=>{const u=new Date(c);return u.setHours(0,0,0,0),u.getTime()},s=Math.round((o(n)-o(e))/A);return s<=0?"Today":s===1?"Yesterday":s<7?"This week":"Earlier"}function S(e,n,o,s,c){if(n==="recent"){if(e.length===0)return[];const t=[...e].sort((r,a)=>(a.lastMessageAt??0)-(r.lastMessageAt??0));return[{label:p,sessions:t}]}const u=t=>{const r=t.agentId?o.get(t.agentId):void 0;switch(n){case"project":return m(r);case"agent":return r?.name??t.agentName??"Unknown agent";case"day":return L(t.lastMessageAt,c);case"state":return f[k(d(s,t))]}},i=new Map;for(const t of e){const r=u(t),a=i.get(r);a?a.push(t):i.set(r,[t])}for(const t of i.values())t.sort((r,a)=>(a.lastMessageAt??0)-(r.lastMessageAt??0));return(()=>{const t=[...i.keys()];return n==="day"?E.filter(r=>i.has(r)):n==="state"?w.map(r=>f[r]).filter(r=>i.has(r)):t.sort((r,a)=>r===l?1:a===l?-1:r.localeCompare(a))})().map(t=>({label:t,sessions:i.get(t)}))}export{l as N,S as g,m as p,_ as t};
@@ -1 +1 @@
1
- import{c}from"./createLucideIcon-zZ8Hx7er.js";const e=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],o=c("settings",e);export{o as S};
1
+ import{c}from"./createLucideIcon-CKbjXlwv.js";const e=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],o=c("settings",e);export{o as S};
@@ -1 +1 @@
1
- import{c as t}from"./createLucideIcon-zZ8Hx7er.js";const a=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],h=t("sliders-horizontal",a);export{h as S};
1
+ import{c as t}from"./createLucideIcon-CKbjXlwv.js";const a=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],h=t("sliders-horizontal",a);export{h as S};
@@ -1 +1 @@
1
- import{c as a}from"./createLucideIcon-zZ8Hx7er.js";const e=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],l=a("sparkles",e);export{l as S};
1
+ import{c as a}from"./createLucideIcon-CKbjXlwv.js";const e=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],l=a("sparkles",e);export{l as S};
@@ -1 +1 @@
1
- import{r as n,c as R}from"./index-EsrkGBcv.js";import{c as v,a as k,w as p}from"./index-BWHgHrtv.js";const u=new Set;let i=null,a=null,c=null,s=null;function b(e){for(const r of[...u])r(e)}function E(){s||u.size===0||(s=setTimeout(()=>{s=null,d()},2e3))}function d(){c||u.size===0||(i||(i=v({url:R()}),a=k({links:[p({client:i})]})),c=a.control.events.subscribe(void 0,{onData:e=>{const r=e.data;r&&b(r)},onError:()=>{c=null,E()}}),b({kind:"unknown",payload:{reason:"control_subscription_started"}}))}function w(){s&&(clearTimeout(s),s=null),c?.unsubscribe(),c=null}function S(e){return u.add(e),d(),()=>{u.delete(e),!(u.size>0)&&w()}}function T(e){const r=n.useRef(e);r.current=e,n.useEffect(()=>S(o=>{r.current(o)}),[])}function z(e,r,o=250){const l=n.useRef(e);l.current=e;const f=n.useRef(r);f.current=r;const t=n.useRef(null);T(m=>{l.current(m)&&(t.current||(t.current=setTimeout(()=>{t.current=null,f.current()},o)))}),n.useEffect(()=>()=>{t.current&&(clearTimeout(t.current),t.current=null)},[])}export{z as a,T as u};
1
+ import{r as n,c as R}from"./index-BFbLvCJn.js";import{c as v,a as k,w as p}from"./index-BWHgHrtv.js";const u=new Set;let i=null,a=null,c=null,s=null;function b(e){for(const r of[...u])r(e)}function E(){s||u.size===0||(s=setTimeout(()=>{s=null,d()},2e3))}function d(){c||u.size===0||(i||(i=v({url:R()}),a=k({links:[p({client:i})]})),c=a.control.events.subscribe(void 0,{onData:e=>{const r=e.data;r&&b(r)},onError:()=>{c=null,E()}}),b({kind:"unknown",payload:{reason:"control_subscription_started"}}))}function w(){s&&(clearTimeout(s),s=null),c?.unsubscribe(),c=null}function S(e){return u.add(e),d(),()=>{u.delete(e),!(u.size>0)&&w()}}function T(e){const r=n.useRef(e);r.current=e,n.useEffect(()=>S(o=>{r.current(o)}),[])}function z(e,r,o=250){const l=n.useRef(e);l.current=e;const f=n.useRef(r);f.current=r;const t=n.useRef(null);T(m=>{l.current(m)&&(t.current||(t.current=setTimeout(()=>{t.current=null,f.current()},o)))}),n.useEffect(()=>()=>{t.current&&(clearTimeout(t.current),t.current=null)},[])}export{z as a,T as u};
@@ -1 +1 @@
1
- import{r as c,i as o}from"./index-EsrkGBcv.js";import{c as f,a as b,w as d}from"./index-BWHgHrtv.js";const r=new Set;let n=null,l=null,s=null;function p(t){for(const e of[...r])e(t)}function S(){s||(n||(n=f({url:o()}),l=b({links:[d({client:n})]})),s=l.tail.events.subscribe(void 0,{onData:t=>{const e=t.data;e&&p(e)}}))}function m(){s?.unsubscribe(),s=null}function C(t,e=!0){const i=c.useRef(t);i.current=t,c.useEffect(()=>{if(!e)return;const u=a=>i.current(a);return r.add(u),S(),()=>{r.delete(u),r.size===0&&m()}},[e])}export{C as u};
1
+ import{r as c,i as o}from"./index-BFbLvCJn.js";import{c as f,a as b,w as d}from"./index-BWHgHrtv.js";const r=new Set;let n=null,l=null,s=null;function p(t){for(const e of[...r])e(t)}function S(){s||(n||(n=f({url:o()}),l=b({links:[d({client:n})]})),s=l.tail.events.subscribe(void 0,{onData:t=>{const e=t.data;e&&p(e)}}))}function m(){s?.unsubscribe(),s=null}function C(t,e=!0){const i=c.useRef(t);i.current=t,c.useEffect(()=>{if(!e)return;const u=a=>i.current(a);return r.add(u),S(),()=>{r.delete(u),r.size===0&&m()}},[e])}export{C as u};
@@ -1 +1 @@
1
- import{c as e}from"./createLucideIcon-zZ8Hx7er.js";const o=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],a=e("terminal",o);export{a as T};
1
+ import{c as e}from"./createLucideIcon-CKbjXlwv.js";const o=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],a=e("terminal",o);export{a as T};
@@ -1 +1 @@
1
- import{a as i}from"./api-DSqpVKC7.js";import{a as c}from"./router-DCtl8wqb.js";import{s as l}from"./terminal-sessions-3RfJpen8.js";const v=132,b=44;function u(e){return e==="codex"?"codex":e==="pi"?"pi":void 0}function a(e){return e==="observe"?"observe":"takeover"}function f(e,n,t="takeover"){return`scout-tmux-${e}-${n}-${t}`}function m(e){return e?e.terminalSurface?e.terminalSurface:e.transport==="tmux"&&e.harnessSessionId?{backend:"tmux",sessionName:e.harnessSessionId,paneId:null,socketDir:null}:null:null}function g(e,n){if(!n)return e;try{const t=new URL(e);return t.searchParams.set("agentId",n),t.toString()}catch{const t=e.includes("?")?"&":"?";return`${e}${t}agentId=${encodeURIComponent(n)}`}}function $(e,n){return n==="takeover"&&!!e&&!m(e)}function y(e){return e?{backend:e.backend,terminalSession:e.sessionName,...e.backend==="tmux"?{tmuxSession:e.sessionName}:{},...e.backend==="zellij"?{zellijSession:e.sessionName,...e.socketDir?{zellijSocketDir:e.socketDir}:{}}:{},...e.backend==="herdr"?{herdrSession:e.sessionName,tmuxSession:e.sessionName}:{}}:null}function T(e){const{agentId:n,agent:t,terminalSurface:o,registeredTarget:s}=e,r=a(e.mode),d=o&&t?`scout-terminal-${o.backend}-${t.id}-${o.sessionName}-${r}`:s&&o?`scout-terminal-registry-${s.session.id}-${o.backend}-${o.sessionName}-${r}`:n?`scout-takeover-${n}-${r}`:`scout-takeover-${r}`;return o?.backend==="tmux"&&t?f(t.id,o.sessionName,r):d}function N(e){const n=T({agentId:e.agentId,agent:e.agent,terminalSurface:e.terminalSurface,registeredTarget:e.registeredTarget,mode:e.mode}),t=a(e.mode);return{relayStorageSessionKey:n,scopedRelayUrl:g(e.relayUrl,e.agentId),cwd:e.cwd??void 0,relayAgent:u(e.harness),surfaceOptions:y(e.terminalSurface),orphanTTL:e.terminalSurface?1e3:void 0,controlMode:t}}function h(e){return e.registeredTarget?{view:"terminal",terminalSessionId:e.registeredTarget.session.id,terminalSurfaceKey:l(e.registeredTarget.surface)}:e.agentId?{view:"terminal",agentId:e.agentId}:{view:"terminal"}}function R(e,n){return n?{...e,mode:n}:e}function w(e){const n=c(e);return typeof window>"u"?n:new URL(n,window.location.href).toString()}function x(e,n){return i("/api/terminal-sessions/control",{method:"POST",body:JSON.stringify({backend:e.backend,sessionName:e.sessionName,action:n})})}function O(e){return i("/api/terminal-relay/session/destroy",{method:"POST",body:JSON.stringify({sessionId:e})})}function U(e){try{window.localStorage.removeItem(`hudson.relay.${e}`)}catch{}}export{v as S,b as a,N as b,x as c,h as d,w as e,U as f,O as g,m as r,$ as s,R as w};
1
+ import{a as i}from"./api-DSqpVKC7.js";import{a as c}from"./router-CJIx83Ia.js";import{s as l}from"./terminal-sessions-3RfJpen8.js";const v=132,b=44;function u(e){return e==="codex"?"codex":e==="pi"?"pi":void 0}function a(e){return e==="observe"?"observe":"takeover"}function f(e,n,t="takeover"){return`scout-tmux-${e}-${n}-${t}`}function m(e){return e?e.terminalSurface?e.terminalSurface:e.transport==="tmux"&&e.harnessSessionId?{backend:"tmux",sessionName:e.harnessSessionId,paneId:null,socketDir:null}:null:null}function g(e,n){if(!n)return e;try{const t=new URL(e);return t.searchParams.set("agentId",n),t.toString()}catch{const t=e.includes("?")?"&":"?";return`${e}${t}agentId=${encodeURIComponent(n)}`}}function $(e,n){return n==="takeover"&&!!e&&!m(e)}function y(e){return e?{backend:e.backend,terminalSession:e.sessionName,...e.backend==="tmux"?{tmuxSession:e.sessionName}:{},...e.backend==="zellij"?{zellijSession:e.sessionName,...e.socketDir?{zellijSocketDir:e.socketDir}:{}}:{},...e.backend==="herdr"?{herdrSession:e.sessionName,tmuxSession:e.sessionName}:{}}:null}function T(e){const{agentId:n,agent:t,terminalSurface:o,registeredTarget:s}=e,r=a(e.mode),d=o&&t?`scout-terminal-${o.backend}-${t.id}-${o.sessionName}-${r}`:s&&o?`scout-terminal-registry-${s.session.id}-${o.backend}-${o.sessionName}-${r}`:n?`scout-takeover-${n}-${r}`:`scout-takeover-${r}`;return o?.backend==="tmux"&&t?f(t.id,o.sessionName,r):d}function N(e){const n=T({agentId:e.agentId,agent:e.agent,terminalSurface:e.terminalSurface,registeredTarget:e.registeredTarget,mode:e.mode}),t=a(e.mode);return{relayStorageSessionKey:n,scopedRelayUrl:g(e.relayUrl,e.agentId),cwd:e.cwd??void 0,relayAgent:u(e.harness),surfaceOptions:y(e.terminalSurface),orphanTTL:e.terminalSurface?1e3:void 0,controlMode:t}}function h(e){return e.registeredTarget?{view:"terminal",terminalSessionId:e.registeredTarget.session.id,terminalSurfaceKey:l(e.registeredTarget.surface)}:e.agentId?{view:"terminal",agentId:e.agentId}:{view:"terminal"}}function R(e,n){return n?{...e,mode:n}:e}function w(e){const n=c(e);return typeof window>"u"?n:new URL(n,window.location.href).toString()}function x(e,n){return i("/api/terminal-sessions/control",{method:"POST",body:JSON.stringify({backend:e.backend,sessionName:e.sessionName,action:n})})}function O(e){return i("/api/terminal-relay/session/destroy",{method:"POST",body:JSON.stringify({sessionId:e})})}function U(e){try{window.localStorage.removeItem(`hudson.relay.${e}`)}catch{}}export{v as S,b as a,N as b,x as c,h as d,w as e,U as f,O as g,m as r,$ as s,R as w};
@@ -1 +1 @@
1
- import{d as o}from"./index-EsrkGBcv.js";async function n(e){if(t(e.agentId),!(await fetch(o("terminalRunPath"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e.command,...e.cwd?{cwd:e.cwd}:{},...e.agentId?{agentId:e.agentId}:{}})})).ok)throw new Error("Failed to queue takeover")}function t(e){if(!(typeof window>"u"))try{window.localStorage.removeItem("hudson.relay.scout-takeover"),e&&window.localStorage.removeItem(`hudson.relay.scout-takeover-${e}`)}catch{}}export{n as q};
1
+ import{d as o}from"./index-BFbLvCJn.js";async function n(e){if(t(e.agentId),!(await fetch(o("terminalRunPath"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e.command,...e.cwd?{cwd:e.cwd}:{},...e.agentId?{agentId:e.agentId}:{}})})).ok)throw new Error("Failed to queue takeover")}function t(e){if(!(typeof window>"u"))try{window.localStorage.removeItem("hudson.relay.scout-takeover"),e&&window.localStorage.removeItem(`hudson.relay.scout-takeover-${e}`)}catch{}}export{n as q};
@@ -1 +1 @@
1
- import{c as e}from"./createLucideIcon-zZ8Hx7er.js";const a=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],o=e("triangle-alert",a);export{o as T};
1
+ import{c as e}from"./createLucideIcon-CKbjXlwv.js";const a=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],o=e("triangle-alert",a);export{o as T};