@openscout/scout 0.2.102 → 0.2.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (505) hide show
  1. package/README.md +37 -0
  2. package/bin/scout.mjs +6 -0
  3. package/bin/scoutd +0 -0
  4. package/dist/build-manifest.json +4 -4
  5. package/dist/chat.mjs +285 -0
  6. package/dist/client/assets/ActivityScreen-CcDdQTBK.js +1 -0
  7. package/dist/client/assets/{AddProjectForm-DfbjlFfy.js → AddProjectForm-CHNJ4NnS.js} +1 -1
  8. package/dist/client/assets/{AdventureEvidence-Dzz9VbuE.js → AdventureEvidence-B4mEvXeD.js} +1 -1
  9. package/dist/client/assets/{AdventureReader-ClMxT0e4.js → AdventureReader-ZsBDQITY.js} +1 -1
  10. package/dist/client/assets/{AdventureScenery-D548O0x4.js → AdventureScenery-DSxDlqG1.js} +1 -1
  11. package/dist/client/assets/AgentAdventures-BxrYq_2v.js +1 -0
  12. package/dist/client/assets/{AgentAvatar-BIwg54Tj.js → AgentAvatar-NZOqcsB2.js} +1 -1
  13. package/dist/client/assets/AgentConfigurationScreen-BhD1PEAM.js +1 -0
  14. package/dist/client/assets/AgentDefinitionsWorkspace-BqS6MXqF.js +1 -0
  15. package/dist/client/assets/{AgentDetailCard-CFDE8TLi.js → AgentDetailCard-MIEBKw_S.js} +1 -1
  16. package/dist/client/assets/AgentFloorView-A0dDRlRV.js +1 -0
  17. package/dist/client/assets/{AgentFloorWorld-BDJmXl3C.js → AgentFloorWorld-BTqwmK5G.js} +1 -1
  18. package/dist/client/assets/AgentInfoScreen-DuaN0sgE.js +1 -0
  19. package/dist/client/assets/{AgentLaneCard-C6YmwPxQ.js → AgentLaneCard-C4rKLLdT.js} +1 -1
  20. package/dist/client/assets/{AgentLaneChrome-D9uJ4QY7.js → AgentLaneChrome-fGC-ZrJS.js} +1 -1
  21. package/dist/client/assets/{AgentLaneDetailSheet-KYckCBCX.js → AgentLaneDetailSheet-BTF4_th9.js} +1 -1
  22. package/dist/client/assets/{AgentLaneSummaryResize-BBYBS3DO.js → AgentLaneSummaryResize-DgSeA_vS.js} +1 -1
  23. package/dist/client/assets/AgentLanesEmbedScreen-CeNiaZ9_.js +1 -0
  24. package/dist/client/assets/{AgentLanesPreflight-pw2vMO3Q.js → AgentLanesPreflight-CcS23wij.js} +1 -1
  25. package/dist/client/assets/{AgentLanesView-aAyC7lHf.js → AgentLanesView-WZhEDBFE.js} +1 -1
  26. package/dist/client/assets/{AgentLiveActions-lYzicnNa.js → AgentLiveActions-6Kfr1uOT.js} +1 -1
  27. package/dist/client/assets/AgentMasterScreen-DUDUTAnU.js +1 -0
  28. package/dist/client/assets/{AgentSessions-Cox2zS-e.js → AgentSessions-CO1WGa8Z.js} +2 -2
  29. package/dist/client/assets/AgentsConsole-BQOWkj35.js +1 -0
  30. package/dist/client/assets/AgentsScreen-BMNAj1PH.js +1 -0
  31. package/dist/client/assets/AgentsSubnav-CeHhuzyM.js +1 -0
  32. package/dist/client/assets/{AstronautSuit-C-4I5YKi.js → AstronautSuit-D67fIBdR.js} +1 -1
  33. package/dist/client/assets/{AtopView-DKm-ERYC.js → AtopView-Ck30FbzG.js} +1 -1
  34. package/dist/client/assets/{BackToPicker-Bys9ColC.js → BackToPicker-CkBhGRlD.js} +1 -1
  35. package/dist/client/assets/BriefingDetailScreen-yZG8_m4h.js +1 -0
  36. package/dist/client/assets/{BriefingsScreen-D4Zf31Y6.js → BriefingsScreen-DTxYMr3a.js} +1 -1
  37. package/dist/client/assets/{BrokerMetadataPanel-1GoSl2BV.js → BrokerMetadataPanel-crirZCdo.js} +1 -1
  38. package/dist/client/assets/BrokerScreen-CT37VQiL.js +8 -0
  39. package/dist/client/assets/Canvas-CRP0KjKb.js +1 -0
  40. package/dist/client/assets/{CastPicker-BuwE_JQp.js → CastPicker-ZPomvOf-.js} +1 -1
  41. package/dist/client/assets/ChannelComposer-BVItWlEz.js +1 -0
  42. package/dist/client/assets/ChannelSidebar-B-2spawY.js +1 -0
  43. package/dist/client/assets/{CharacterFamilyPreview-CfO3j8Of.js → CharacterFamilyPreview-ckVkecDO.js} +1 -1
  44. package/dist/client/assets/ChatAvatar-DKBsbOqk.js +1 -0
  45. package/dist/client/assets/ChatBits-CLJ71hTY.js +1 -0
  46. package/dist/client/assets/{ChatCollapsedStrip-TV0j1xTB.js → ChatCollapsedStrip-Co0NmqOO.js} +1 -1
  47. package/dist/client/assets/ChatRightPanel-pKQtkAgl.js +1 -0
  48. package/dist/client/assets/ChatSpaceSurface-NrLwdPkE.js +1 -0
  49. package/dist/client/assets/ChatSpaceTheme-BPMgPdVK.css +1 -0
  50. package/dist/client/assets/ChatSpaceTheme-D37Jk7bl.js +1 -0
  51. package/dist/client/assets/{CodeDiffPane-DB6-mqtX.js → CodeDiffPane-D-iv28LJ.js} +1 -1
  52. package/dist/client/assets/{CodeProjectPicker-B_LNLpIK.js → CodeProjectPicker-CZ3gDdiT.js} +1 -1
  53. package/dist/client/assets/{CodeScreen-C9H160XS.js → CodeScreen-CSC-zbP9.js} +1 -1
  54. package/dist/client/assets/{CommsCanvas-DOKw3Q8i.js → CommsCanvas-DdNAwjGW.js} +1 -1
  55. package/dist/client/assets/{CommsDeck-C18JA7rK.js → CommsDeck-mGWY7Ivi.js} +1 -1
  56. package/dist/client/assets/{CommsFlowGraph-Czg-KTS0.js → CommsFlowGraph-voDD9M5R.js} +1 -1
  57. package/dist/client/assets/{CommsFlowMap-CzBWvSa5.js → CommsFlowMap-C33sgD48.js} +1 -1
  58. package/dist/client/assets/{CommsSelection-g1twA-Lb.js → CommsSelection-BL8aYD7z.js} +1 -1
  59. package/dist/client/assets/{ConversationComposer-B7RU6LKd.js → ConversationComposer-DNcn5U6D.js} +1 -1
  60. package/dist/client/assets/ConversationFeedRows-RnYSa7Io.js +1 -0
  61. package/dist/client/assets/ConversationHeader-Y9TEJxP_.js +1 -0
  62. package/dist/client/assets/{ConversationPanels-C9yCAoJy.js → ConversationPanels-6pprBpmq.js} +2 -2
  63. package/dist/client/assets/ConversationScreen-tpj4cqWs.js +2 -0
  64. package/dist/client/assets/{ConversationStatus-CK-YfLpi.js → ConversationStatus-Cv-7hErW.js} +1 -1
  65. package/dist/client/assets/{CrewAvatar-CJhuqTsJ.js → CrewAvatar-zgzC3cbU.js} +1 -1
  66. package/dist/client/assets/{CrewSprite-hgpA3SWB.js → CrewSprite-Dp9KBBGY.js} +1 -1
  67. package/dist/client/assets/CrewWorkspaces-DDuYMByu.css +1 -0
  68. package/dist/client/assets/CrewWorkspaces-K2jcyLec.js +1 -0
  69. package/dist/client/assets/{DataTable-BMOZ1-z8.js → DataTable-av71ehJV.js} +1 -1
  70. package/dist/client/assets/{DispatchAftermath-DDlwqSCY.js → DispatchAftermath-CcYGUB10.js} +1 -1
  71. package/dist/client/assets/{DocumentFocusViewer-f12RRQpV.js → DocumentFocusViewer-DlMiEALb.js} +1 -1
  72. package/dist/client/assets/{EmbeddableSurfacesLab-DGl9EMRV.js → EmbeddableSurfacesLab-CTkO_tQR.js} +1 -1
  73. package/dist/client/assets/{EmptyState-uyYN5piI.js → EmptyState-CYUwYyAW.js} +1 -1
  74. package/dist/client/assets/{FileViewerPane-HtiDbj9N.js → FileViewerPane-Cxhixtks.js} +1 -1
  75. package/dist/client/assets/FlightObserveScreen-CvzhzuWc.js +1 -0
  76. package/dist/client/assets/{FloorContextSheet-DV-SYA0K.js → FloorContextSheet-Vj_wVZq1.js} +1 -1
  77. package/dist/client/assets/{FloorExchangePanel-D59nvRCF.js → FloorExchangePanel-CjHSDXad.js} +1 -1
  78. package/dist/client/assets/{FloorMessagePasses-BCwsz9VS.js → FloorMessagePasses-BG4ebnX5.js} +1 -1
  79. package/dist/client/assets/{FloorReplay-BHo79HCD.js → FloorReplay-BoYaGY9t.js} +1 -1
  80. package/dist/client/assets/FloorResourcesSheet-_Iy5UqgY.js +1 -0
  81. package/dist/client/assets/{FloorSavedWork-2tjBoy06.js → FloorSavedWork-jbtRs-YE.js} +1 -1
  82. package/dist/client/assets/{FloorTacticalHUD-Bngao6sn.js → FloorTacticalHUD-BhyOqlL5.js} +1 -1
  83. package/dist/client/assets/{FollowScreen-eHXOlK-u.js → FollowScreen-CupyOgt4.js} +1 -1
  84. package/dist/client/assets/HarnessMark-DSvM_H7H.js +1 -0
  85. package/dist/client/assets/HarnessesScreen-DyjqbZ4k.js +1 -0
  86. package/dist/client/assets/{HerdrSession-CtJOUn7H.js → HerdrSession-Dcm3vf9U.js} +1 -1
  87. package/dist/client/assets/{HomeHero-Cvwx2H0w.js → HomeHero-pIZtE1cC.js} +1 -1
  88. package/dist/client/assets/{HostAdvisorView-CTJXIc1Q.js → HostAdvisorView-Dv5meXo2.js} +1 -1
  89. package/dist/client/assets/InviteLandingScreen-xZQ2na1z.js +1 -0
  90. package/dist/client/assets/InviteSheet--5Zjct25.js +1 -0
  91. package/dist/client/assets/JumpPalette-BmiSOEmp.js +1 -0
  92. package/dist/client/assets/{KnowledgeSearchInspector-DwGMVmFL.js → KnowledgeSearchInspector-B8yiM524.js} +1 -1
  93. package/dist/client/assets/KnowledgeSearchScreen-BPqAjHnH.js +1 -0
  94. package/dist/client/assets/{LaneToolHoverCard-C6YehJqD.js → LaneToolHoverCard-D2cnTeUd.js} +1 -1
  95. package/dist/client/assets/LaneTraceDetailSheet-jl4XQmEx.js +1 -0
  96. package/dist/client/assets/{LaneTraceEventFocus-WLNZZVi_.js → LaneTraceEventFocus-BLhVHwff.js} +1 -1
  97. package/dist/client/assets/{MeshCanvas-FDDGE69h.js → MeshCanvas-BR25OBTJ.js} +1 -1
  98. package/dist/client/assets/{MeshCanvasMinimap-CGRzQCac.js → MeshCanvasMinimap-ClVolr4-.js} +1 -1
  99. package/dist/client/assets/MeshScreen-BW1dMFWF.js +1 -0
  100. package/dist/client/assets/{MeshTopologyView-C2Cv_2gx.js → MeshTopologyView-BT3ke2D1.js} +2 -2
  101. package/dist/client/assets/MessagesScreen-CtNMfIvC.js +1 -0
  102. package/dist/client/assets/{MissionContextRail-CVSZJnvX.js → MissionContextRail-CafjuseK.js} +1 -1
  103. package/dist/client/assets/MissionControlView-BjPOViGY.js +1 -0
  104. package/dist/client/assets/{MissionFocusOverlay-B9SiuO-i.js → MissionFocusOverlay-nhy3hkxQ.js} +1 -1
  105. package/dist/client/assets/MissionLeftAgentRow-Dms0DBjO.js +1 -0
  106. package/dist/client/assets/{MissionLogPane-CMBiI29U.js → MissionLogPane-DiUf3vWW.js} +1 -1
  107. package/dist/client/assets/NativeAreaScreen-BQSTo8As.js +1 -0
  108. package/dist/client/assets/NativeAreaScreen-Brix6xDB.js +1 -0
  109. package/dist/client/assets/NativeAreaScreen-D7HyQNlM.js +1 -0
  110. package/dist/client/assets/{NewAgentModal-Cl4nsGhu.js → NewAgentModal-BQ2wQ5gp.js} +1 -1
  111. package/dist/client/assets/NewChatComposer-BEXS8vV6.js +19 -0
  112. package/dist/client/assets/{NewChatOrigin-CyPPWTJP.js → NewChatOrigin-C8ROO4ps.js} +1 -1
  113. package/dist/client/assets/{NodeDetailPanel-BUG8rOb-.js → NodeDetailPanel-BNTqYC7m.js} +1 -1
  114. package/dist/client/assets/{NodeMenu-Fw8ATWQA.js → NodeMenu-CcOeFRCB.js} +1 -1
  115. package/dist/client/assets/{ObserveEmbedScreen-BPiSXXvm.js → ObserveEmbedScreen-Dh30EjAQ.js} +2 -2
  116. package/dist/client/assets/{ObserveTextFlow-ET0dD1wO.js → ObserveTextFlow-CC5mnngm.js} +2 -2
  117. package/dist/client/assets/{ObservedTopologyPanel-DkEkQzo-.js → ObservedTopologyPanel-DF6tRZL_.js} +1 -1
  118. package/dist/client/assets/OpenScoutAppShell-D9pgw36i.js +31 -0
  119. package/dist/client/assets/OpsAgentsView-D3rM0udq.js +1 -0
  120. package/dist/client/assets/OpsScreen-DySeNQ1V.js +1 -0
  121. package/dist/client/assets/OpsSubnav-C9E0r3GZ.js +1 -0
  122. package/dist/client/assets/ProjectAgentProfile-FUav75j2.js +1 -0
  123. package/dist/client/assets/{ProjectAgentProfileBar-C1fR65Eh.js → ProjectAgentProfileBar-C8z22pJ2.js} +1 -1
  124. package/dist/client/assets/ProjectAgentProfileHero-BLK0EwMg.js +1 -0
  125. package/dist/client/assets/ProjectsInbox-DfCXReZK.js +2 -0
  126. package/dist/client/assets/ProjectsRail-CELVubfJ.js +1 -0
  127. package/dist/client/assets/ProjectsScreen-DMw4TLKy.js +1 -0
  128. package/dist/client/assets/ProjectsThreadAside-D1Sh4fnX.js +1 -0
  129. package/dist/client/assets/{Provider-5Hotn7NQ.js → Provider-CNZluAZb.js} +2 -2
  130. package/dist/client/assets/{RailRow-BYguXNm4.js → RailRow-DUPqXMZh.js} +1 -1
  131. package/dist/client/assets/RailToggle-BwmY70B8.js +1 -0
  132. package/dist/client/assets/RawSessionsTable-6OVJq0JZ.js +1 -0
  133. package/dist/client/assets/RealtimeVoiceScreen-D41TYY0x.js +9 -0
  134. package/dist/client/assets/{RenderedWorkerSprite-CvdWO32C.js → RenderedWorkerSprite-C8fxndAh.js} +1 -1
  135. package/dist/client/assets/{ReplayClock-B7JLTp8A.js → ReplayClock-DUVJjrIu.js} +1 -1
  136. package/dist/client/assets/{ReplayLog-DZTpf2CW.js → ReplayLog-Bek1Vc4W.js} +1 -1
  137. package/dist/client/assets/{ReplayOutpost-CvWQa30T.js → ReplayOutpost-DlRg3172.js} +1 -1
  138. package/dist/client/assets/{RepoDiffEmbedScreen-Cbu0_PJW.js → RepoDiffEmbedScreen-CVUMnt6A.js} +1 -1
  139. package/dist/client/assets/{RepoDiffPageScreen-Chwm6GXL.js → RepoDiffPageScreen-D9-s5PyB.js} +1 -1
  140. package/dist/client/assets/{RepoDiffViewer-C2mb0Wj-.js → RepoDiffViewer-D7FN-oyY.js} +1 -1
  141. package/dist/client/assets/RepoDiffViewerLazy-BpMR7tlx.js +2 -0
  142. package/dist/client/assets/{ReposScreen-C7JZQmyh.js → ReposScreen-BQ7HO1om.js} +2 -2
  143. package/dist/client/assets/{RiggedWorkerCharacter-DNe731GE.js → RiggedWorkerCharacter-CJMWlvV-.js} +1 -1
  144. package/dist/client/assets/{SageModelStudio-BR1J2D4R.js → SageModelStudio-B526NSnw.js} +1 -1
  145. package/dist/client/assets/{ScoutDeckSurface-flRamdvE.js → ScoutDeckSurface-ChkvGyEW.js} +1 -1
  146. package/dist/client/assets/{ScoutSurface-BpklGmDL.js → ScoutSurface-6g1f5chk.js} +1 -1
  147. package/dist/client/assets/{ScoutbotFxLab-DeK7ySWZ.js → ScoutbotFxLab-BuwBdnPf.js} +1 -1
  148. package/dist/client/assets/{SecondaryNav-BkTn5tkq.js → SecondaryNav-Bs-_VwTC.js} +1 -1
  149. package/dist/client/assets/{SessionEmbedScreen-CcQN6xlo.js → SessionEmbedScreen-C2wf35-P.js} +1 -1
  150. package/dist/client/assets/{SessionObserve-DaqDhqDI.js → SessionObserve-B64YsYhy.js} +9 -9
  151. package/dist/client/assets/{SessionObserve-BOBJSfs0.css → SessionObserve-CDdJ7fAE.css} +1 -1
  152. package/dist/client/assets/{SessionObserveEvidence-Drv-D8Oh.js → SessionObserveEvidence-CS1aQBpQ.js} +1 -1
  153. package/dist/client/assets/SessionRefScreen-DURV0MpF.js +1 -0
  154. package/dist/client/assets/SessionsScreen-D71ZR-8t.js +1 -0
  155. package/dist/client/assets/{SettingsDrawer-BDapR4E9.js → SettingsDrawer-Nz98oBVl.js} +3 -3
  156. package/dist/client/assets/SettingsScreen-CYBHal6y.js +1 -0
  157. package/dist/client/assets/{SharedFloorCharacter-CSYG_t9t.js → SharedFloorCharacter-V04kD5T9.js} +1 -1
  158. package/dist/client/assets/SharedWorkFloor-C0xxW4SN.js +2 -0
  159. package/dist/client/assets/{ShikiPane-BudrOxNK.js → ShikiPane-XwFI-pCp.js} +1 -1
  160. package/dist/client/assets/{SlidePanel-Datu7XG4.js → SlidePanel-BMpkXai_.js} +1 -1
  161. package/dist/client/assets/SpaceSwitcher-BfeIf-ad.js +1 -0
  162. package/dist/client/assets/{SpriteAvatar-BW1JzkDt.js → SpriteAvatar-aHeF4ZQZ.js} +1 -1
  163. package/dist/client/assets/{SproutActionSprite-DveCzg6l.js → SproutActionSprite-DI5N3gOj.js} +1 -1
  164. package/dist/client/assets/{StatusPill-MxYClPG5.js → StatusPill-Dw4LP7wu.js} +1 -1
  165. package/dist/client/assets/{TailView-Dn7uWmPz.js → TailView-BofjmUMJ.js} +2 -2
  166. package/dist/client/assets/Terminal-jIqnIZZ6.js +4 -0
  167. package/dist/client/assets/TerminalEmbedScreen-3XsjuySR.js +1 -0
  168. package/dist/client/assets/{TerminalHeaderMount-DCGstkZ4.js → TerminalHeaderMount-CwbQhXcI.js} +1 -1
  169. package/dist/client/assets/TerminalRelay--qOBwnbR.js +46 -0
  170. package/dist/client/assets/{TextDocumentSurface-BhYvAB0o.js → TextDocumentSurface-BK6Qy41F.js} +1 -1
  171. package/dist/client/assets/{TmuxPeek-BhK0V9Qt.js → TmuxPeek-DpUT9Tpc.js} +1 -1
  172. package/dist/client/assets/{VoicePermissionsPanel-CecFWzva.js → VoicePermissionsPanel-D35fOnQj.js} +1 -1
  173. package/dist/client/assets/{WorkDetailScreen-CwtRCm_-.js → WorkDetailScreen-Bcf_yHhU.js} +2 -2
  174. package/dist/client/assets/{WorkFilesViewer-DJHftsH9.js → WorkFilesViewer-t8AEyx3Q.js} +1 -1
  175. package/dist/client/assets/{WorkRunView-x5PH1byG.js → WorkRunView-_mhG_FR2.js} +1 -1
  176. package/dist/client/assets/WorldActorTalk-CKerDikx.js +1 -0
  177. package/dist/client/assets/{WorldCharacter-Dn4sIXNP.js → WorldCharacter-BRrj3MQN.js} +1 -1
  178. package/dist/client/assets/{WorldMinimap-Blqg0d5r.js → WorldMinimap-DOptgrc4.js} +1 -1
  179. package/dist/client/assets/{WorldSky-DV9bpvXj.js → WorldSky-D-RJzSa6.js} +1 -1
  180. package/dist/client/assets/{activity-CSUhvjD0.js → activity-BJqFrZyB.js} +1 -1
  181. package/dist/client/assets/{addon-fit-MR98IWES.js → addon-fit-CHohcvS3.js} +1 -1
  182. package/dist/client/assets/{addon-webgl-CIIKXrvK.js → addon-webgl-CaRy2x2b.js} +1 -1
  183. package/dist/client/assets/agent-autocomplete-_u9o5EZu.js +2 -0
  184. package/dist/client/assets/{agent-essentials-8t2il7PV.js → agent-essentials-bKWYOZaH.js} +1 -1
  185. package/dist/client/assets/{agent-floor-actor-3v9drnxh.js → agent-floor-actor-DW8zLht0.js} +1 -1
  186. package/dist/client/assets/{agent-lane-card-model-l0stnU9N.js → agent-lane-card-model-CeqQGp-8.js} +1 -1
  187. package/dist/client/assets/{agent-lane-detail-Db7KyAlf.js → agent-lane-detail-Ti3trpfH.js} +1 -1
  188. package/dist/client/assets/{agent-lane-preview-B8lsQJOQ.js → agent-lane-preview-Dpa3DuOn.js} +1 -1
  189. package/dist/client/assets/{agent-lanes-model-CX0wTcnF.js → agent-lanes-model-DMAdqCmK.js} +1 -1
  190. package/dist/client/assets/{agent-specialization-CiVxQsFT.js → agent-specialization-BplZUa_0.js} +1 -1
  191. package/dist/client/assets/{api-B9_IqFKY.js → api-BQYTwoz6.js} +1 -1
  192. package/dist/client/assets/{api-CaROe5_H.js → api-DSqpVKC7.js} +1 -1
  193. package/dist/client/assets/{arc.es-BzhWalCl.js → arc.es-CubLvQ4W.js} +1 -1
  194. package/dist/client/assets/{arrow-left-PuKdO3NM.js → arrow-left-DFfKAq0d.js} +1 -1
  195. package/dist/client/assets/{arrow-right-ldbfp4SZ.js → arrow-right-DmAWnyAH.js} +1 -1
  196. package/dist/client/assets/{arrow-up-right-Hn754ybA.js → arrow-up-right-B0aLKiyF.js} +1 -1
  197. package/dist/client/assets/at-sign-DM7xeppo.js +1 -0
  198. package/dist/client/assets/{book-open-BlJnpf2U.js → book-open-BL9qvhEI.js} +1 -1
  199. package/dist/client/assets/{bot-CfN9PSBF.js → bot-BhAVbcCA.js} +1 -1
  200. package/dist/client/assets/{cache-DEy9E34b.js → cache-DGBo3vIf.js} +1 -1
  201. package/dist/client/assets/chat-api-BPVC0asu.js +1 -0
  202. package/dist/client/assets/chat-space-model-B6Jg2CY4.js +4 -0
  203. package/dist/client/assets/{check-B8dMv3Is.js → check-g7D7-c1J.js} +1 -1
  204. package/dist/client/assets/{chevron-down-B5eMsn5c.js → chevron-down-CDzRQQGl.js} +1 -1
  205. package/dist/client/assets/{chevron-right-C7UGFpkl.js → chevron-right-DKGTLiqc.js} +1 -1
  206. package/dist/client/assets/{chevron-up-BHOEgHcn.js → chevron-up-DX7R6KY2.js} +1 -1
  207. package/dist/client/assets/{chunk-HRAB3GC3-C5X-kFhb.js → chunk-HRAB3GC3-Dvk_QpRq.js} +1 -1
  208. package/dist/client/assets/{clock-DFcRbtrl.js → clock-CQb4FeMf.js} +1 -1
  209. package/dist/client/assets/{code-xml-BmyLM0I2.js → code-xml-Cmadr3pQ.js} +1 -1
  210. package/dist/client/assets/{coffee-C_D9zooM.js → coffee-ljG1_krY.js} +1 -1
  211. package/dist/client/assets/{compass-DTZdCpv9.js → compass-CvzkzkIh.js} +1 -1
  212. package/dist/client/assets/content-0AXa0klu.js +1 -0
  213. package/dist/client/assets/content-BEyJ19Lx.js +1 -0
  214. package/dist/client/assets/content-BN5weWKW.js +1 -0
  215. package/dist/client/assets/content-BNokkm7C.js +1 -0
  216. package/dist/client/assets/content-BV4PUM9q.js +1 -0
  217. package/dist/client/assets/content-BxUPlcx5.js +1 -0
  218. package/dist/client/assets/content-CIC5sku8.js +1 -0
  219. package/dist/client/assets/content-CKJ9zb7Z.js +1 -0
  220. package/dist/client/assets/content-CdkTyxqk.js +1 -0
  221. package/dist/client/assets/content-CnhhSCZq.js +1 -0
  222. package/dist/client/assets/content-D1Ze_FG9.js +1 -0
  223. package/dist/client/assets/content-DY3F9Vfr.js +1 -0
  224. package/dist/client/assets/content-DrKBYpcb.js +1 -0
  225. package/dist/client/assets/content-LSStQYj5.js +1 -0
  226. package/dist/client/assets/content-YvU-D0hF.js +1 -0
  227. package/dist/client/assets/content-oKQMyVnH.js +1 -0
  228. package/dist/client/assets/{context-budget-DemtXu7E.js → context-budget-8qFKqM-j.js} +1 -1
  229. package/dist/client/assets/{conversation-icons-BQ4OeOmr.js → conversation-icons-CIRaxmid.js} +1 -1
  230. package/dist/client/assets/{conversation-model-BGFHoxQ0.js → conversation-model-m8HhzroS.js} +1 -1
  231. package/dist/client/assets/conversation-motion-features-D9PxLoDt.js +1 -0
  232. package/dist/client/assets/{copy-D9WUpQRf.js → copy-BGOC1tJB.js} +1 -1
  233. package/dist/client/assets/{cpu-Ck_4tB_-.js → cpu-Q6nrHFTN.js} +1 -1
  234. package/dist/client/assets/{createLucideIcon-DkjnzvcJ.js → createLucideIcon-ChvMq-zl.js} +1 -1
  235. package/dist/client/assets/{credentials-C4VXz2hr.js → credentials-OeoF-VKJ.js} +1 -1
  236. package/dist/client/assets/discover-DlwbftpC.js +2 -0
  237. package/dist/client/assets/embed-entry-c0lwtjBG.js +2 -0
  238. package/dist/client/assets/{external-link-RT4Ph-6-.js → external-link-BVccgH0n.js} +1 -1
  239. package/dist/client/assets/{eye-CtqSV8BS.js → eye-CsGfEVR6.js} +1 -1
  240. package/dist/client/assets/{file-code-corner-D_Aptal2.js → file-code-corner-Be6da5l3.js} +1 -1
  241. package/dist/client/assets/{file-text-ChtICwub.js → file-text-DP6txVW-.js} +1 -1
  242. package/dist/client/assets/{flag-CqdOxVkI.js → flag-DAFE2wZ5.js} +1 -1
  243. package/dist/client/assets/{floor-context-model-DZBpo_oD.js → floor-context-model-rWKqaKmV.js} +1 -1
  244. package/dist/client/assets/{floor-message-passes-CJh9f8Jp.js → floor-message-passes-CO3Ix_wR.js} +1 -1
  245. package/dist/client/assets/{folder-0fWevPvQ.js → folder-B_S7gBVr.js} +1 -1
  246. package/dist/client/assets/{gauge-Dgtfxf_o.js → gauge-DQCGlE3o.js} +1 -1
  247. package/dist/client/assets/{gestures-BDCZ1FRG.js → gestures-CofqY4Km.js} +1 -1
  248. package/dist/client/assets/{git-branch-CA3cHKCI.js → git-branch-DcUCsWdJ.js} +1 -1
  249. package/dist/client/assets/{go-shortcuts-DKtw4qYx.js → go-shortcuts-KQy-ZOpV.js} +1 -1
  250. package/dist/client/assets/{home-moving-signal-B7m-ngb2.js → home-moving-signal-BIHUGNfI.js} +1 -1
  251. package/dist/client/assets/home-now-card-CaLgZze2.js +1 -0
  252. package/dist/client/assets/{home-now-card-nano-D1ScGrgv.js → home-now-card-nano-CvU8B61b.js} +1 -1
  253. package/dist/client/assets/hooks-DaUOREpP.js +2 -0
  254. package/dist/client/assets/index-CGbs0SBm.css +1 -0
  255. package/dist/client/assets/index-CbqBwfIW.js +1 -0
  256. package/dist/client/assets/index-CyPMl7Up.js +1 -0
  257. package/dist/client/assets/index-DReVb7jZ.js +10 -0
  258. package/dist/client/assets/index-PQpJveGO.js +1 -0
  259. package/dist/client/assets/{index-CvsM3jm8.js → index-kkXUq-zf.js} +1 -1
  260. package/dist/client/assets/{inspector-panel-BLhDODb3.js → inspector-panel-CLU7wjnT.js} +2 -2
  261. package/dist/client/assets/{keyboard-nav-CXfav14z.js → keyboard-nav-CJXPaHXj.js} +1 -1
  262. package/dist/client/assets/lane-ask-display-BTVSakyo.js +18 -0
  263. package/dist/client/assets/{lane-observe-BD21P8BB.js → lane-observe-CteDwdD-.js} +3 -3
  264. package/dist/client/assets/{lane-roster-store-DzNHP392.js → lane-roster-store-Ch9t6lb0.js} +1 -1
  265. package/dist/client/assets/{layers-Bolb8ejU.js → layers-BOwyWodP.js} +1 -1
  266. package/dist/client/assets/{layout-grid-DI9tVJ2E.js → layout-grid-B36Qsh0y.js} +1 -1
  267. package/dist/client/assets/left-0vBrvrBG.js +2 -0
  268. package/dist/client/assets/left-C6SyaqlJ.js +1 -0
  269. package/dist/client/assets/left-CTuXysZR.js +2 -0
  270. package/dist/client/assets/left-Cc6s4DT2.js +1 -0
  271. package/dist/client/assets/left-DF5caiyh.js +1 -0
  272. package/dist/client/assets/left-DgT4tWCx.js +1 -0
  273. package/dist/client/assets/left-R0wppTTr.js +1 -0
  274. package/dist/client/assets/left-advisor-C-kt8V28.js +1 -0
  275. package/dist/client/assets/left-agents-thnBO156.js +1 -0
  276. package/dist/client/assets/left-default-CT42fnpF.js +1 -0
  277. package/dist/client/assets/left-lanes-CSmZgciK.js +1 -0
  278. package/dist/client/assets/left-mission-C86x6i9h.js +1 -0
  279. package/dist/client/assets/library-DdhYL_9v.js +1 -0
  280. package/dist/client/assets/{loader-circle-DurUYl7E.js → loader-circle-DNUsuPWz.js} +1 -1
  281. package/dist/client/assets/{local-agents-D9fYYRyj.js → local-agents-I40PawYA.js} +1 -1
  282. package/dist/client/assets/{machine-children-RGS4Q0r6.js → machine-children-CdhNzDF0.js} +1 -1
  283. package/dist/client/assets/{mentions-Ctw1ECUC.js → mentions-Ck_Vjnyp.js} +1 -1
  284. package/dist/client/assets/{mesh-ops-CGpRk4ik.js → mesh-ops-DSlvHp-D.js} +1 -1
  285. package/dist/client/assets/{mesh-view-store-CliSYsmt.js → mesh-view-store-C1-mdP3P.js} +1 -1
  286. package/dist/client/assets/{message-circle-CSiJj6yo.js → message-circle-cI5_A5mj.js} +1 -1
  287. package/dist/client/assets/{message-markup-DgFSyb3f.js → message-markup-6Tgo4qFJ.js} +1 -1
  288. package/dist/client/assets/{message-square-NmXWtWLR.js → message-square-CJW4WRlo.js} +1 -1
  289. package/dist/client/assets/{mission-control-store-DZ29Mlj1.js → mission-control-store-p_cboAm4.js} +1 -1
  290. package/dist/client/assets/monitor-C7_cHlkC.js +1 -0
  291. package/dist/client/assets/{nav-destinations-CyXnw9kh.js → nav-destinations-CU_euC-Q.js} +1 -1
  292. package/dist/client/assets/{observe-CkfOxYx_.js → observe-CtS0l3zu.js} +1 -1
  293. package/dist/client/assets/{operator-attention-DGR4kOog.js → operator-attention-DBaRg5ep.js} +1 -1
  294. package/dist/client/assets/{page-status-CkS3SZu-.js → page-status-DwFR4wSw.js} +1 -1
  295. package/dist/client/assets/{panel-right-BNTJhy8M.js → panel-right-qP17MwMl.js} +1 -1
  296. package/dist/client/assets/{pause-DWS7YGQ3.js → pause-B_hliKuR.js} +1 -1
  297. package/dist/client/assets/{persistent-state-xsuk6Kc-.js → persistent-state-BUsTTZFE.js} +1 -1
  298. package/dist/client/assets/{pin-DWlD1BOF.js → pin-Oi4qHR6M.js} +1 -1
  299. package/dist/client/assets/{play-D_Pggug4.js → play-CVeRmqLH.js} +1 -1
  300. package/dist/client/assets/{plus-D_wLGJGT.js → plus-D5NLH_fM.js} +1 -1
  301. package/dist/client/assets/profile-BegEUmB7.js +1 -0
  302. package/dist/client/assets/projects-inbox-CKPLZN8s.css +1 -0
  303. package/dist/client/assets/{projects-inbox-DvbqJO3q.js → projects-inbox-CfwxCTdN.js} +1 -1
  304. package/dist/client/assets/provider-DwmCoSlc.js +1 -0
  305. package/dist/client/assets/{proxy-DOG46ja4.js → proxy-DgzP27W8.js} +1 -1
  306. package/dist/client/assets/{radio-C_jtwbFP.js → radio-Cas2qg1D.js} +1 -1
  307. package/dist/client/assets/{refresh-cw-Da9DDLk2.js → refresh-cw-IcD2lPoT.js} +1 -1
  308. package/dist/client/assets/resolve-panes-pfZTezKo.js +1 -0
  309. package/dist/client/assets/resolve-sidebar-context-D5ksvrb_.js +1 -0
  310. package/dist/client/assets/right-BDaCJ0CF.js +1 -0
  311. package/dist/client/assets/right-BP6lXRFS.js +1 -0
  312. package/dist/client/assets/right-Cb1VCrdj.js +1 -0
  313. package/dist/client/assets/right-CeFaxfBo.js +1 -0
  314. package/dist/client/assets/right-Ck2SrYCj.js +1 -0
  315. package/dist/client/assets/right-D-uv5YfF.js +1 -0
  316. package/dist/client/assets/right-DJMSICky.js +1 -0
  317. package/dist/client/assets/right-Dnljs8ah.js +1 -0
  318. package/dist/client/assets/right-SdCSF8PP.js +1 -0
  319. package/dist/client/assets/{right-BLJsc2-p.js → right-cjPTwPXS.js} +1 -1
  320. package/dist/client/assets/{rocket-DyrYDo8V.js → rocket-DAqYvu8I.js} +1 -1
  321. package/dist/client/assets/router-C-MF5-mb.js +1 -0
  322. package/dist/client/assets/{runtime-picker-DdsttHHc.js → runtime-picker-C_AVYF63.js} +1 -1
  323. package/dist/client/assets/{scope-views-B7PZGlhY.js → scope-views-Dl3ml9OZ.js} +1 -1
  324. package/dist/client/assets/{scout-voice-DOQ_B77g.js → scout-voice-CqAyfblr.js} +1 -1
  325. package/dist/client/assets/{scoutbot-markdown-Bz0Vbto2.js → scoutbot-markdown-DwvGQOWo.js} +1 -1
  326. package/dist/client/assets/{scroll-text-DwC8r2g6.js → scroll-text-B0tKI9Sg.js} +1 -1
  327. package/dist/client/assets/{search-C4VlW_0l.js → search-UsM-9-_W.js} +1 -1
  328. package/dist/client/assets/secondaryNavConfig-D15P1Y9k.css +1 -0
  329. package/dist/client/assets/secondaryNavConfig-DzNHk6IH.js +1 -0
  330. package/dist/client/assets/{selection-bridge-B5jqyMR9.js → selection-bridge-OTS2iFkt.js} +1 -1
  331. package/dist/client/assets/{send-horizontal-pOtGI7FM.js → send-horizontal-BlQsRK6C.js} +1 -1
  332. package/dist/client/assets/{send-to-agent-session-BZGq_ycy.js → send-to-agent-session-C1mgqdow.js} +1 -1
  333. package/dist/client/assets/{server-ms1yxUYJ.js → server-DBlPW0Mp.js} +1 -1
  334. package/dist/client/assets/{session-catalog-s-T_w41t.js → session-catalog-CnpZMB7C.js} +1 -1
  335. package/dist/client/assets/{session-table-CDx_16xf.js → session-table-CGkfG5Yd.js} +1 -1
  336. package/dist/client/assets/{sessions-view-DzYGsKWS.js → sessions-view-Bge4XZ4I.js} +1 -1
  337. package/dist/client/assets/{settings-TJIkkZ0P.js → settings-C69Zjrpq.js} +1 -1
  338. package/dist/client/assets/{shared-work-artifacts-4IIQXQfc.js → shared-work-artifacts-DfNl9KTo.js} +1 -1
  339. package/dist/client/assets/{sliders-horizontal-CHf3ntw0.js → sliders-horizontal-6bzeod7c.js} +1 -1
  340. package/dist/client/assets/{sparkles-BbOFw3d0.js → sparkles-Cc5lPZRv.js} +1 -1
  341. package/dist/client/assets/{sse-v5QLsOHV.js → sse-A8AyLH0g.js} +1 -1
  342. package/dist/client/assets/{tail-events-DQ46QBW1.js → tail-events-C4WdhVeK.js} +1 -1
  343. package/dist/client/assets/{terminal-96JWDYDL.js → terminal-DMZjX1es.js} +1 -1
  344. package/dist/client/assets/{terminal-relay-Bfx8pg80.js → terminal-relay-mO89dX-Y.js} +1 -1
  345. package/dist/client/assets/{terminal-sessions-Ch9aYlgi.js → terminal-sessions-3RfJpen8.js} +1 -1
  346. package/dist/client/assets/{terminal-takeover-BlpxpvSp.js → terminal-takeover-CZZsnPzj.js} +1 -1
  347. package/dist/client/assets/use-beside-D3cJpA5p.js +1 -0
  348. package/dist/client/assets/{use-conversation-list-A_YUf8lo.js → use-conversation-list-D5EnpVba.js} +1 -1
  349. package/dist/client/assets/{use-fleet-active-asks-DFs_u-vM.js → use-fleet-active-asks-D_QOmjg5.js} +1 -1
  350. package/dist/client/assets/{use-mesh-node-state-Ck9CYplv.js → use-mesh-node-state-3V3ADQ-G.js} +1 -1
  351. package/dist/client/assets/{use-mesh-ops-items-Be1WmwCg.js → use-mesh-ops-items-DI9GKWlF.js} +1 -1
  352. package/dist/client/assets/{use-reduced-motion-D7n3vK8t.js → use-reduced-motion-CiaZHMnk.js} +1 -1
  353. package/dist/client/assets/use-scout-dev-flags-CkdAHlDR.js +1 -0
  354. package/dist/client/assets/{useAgentHoverCard-Dr-OjNFF.js → useAgentHoverCard-A3QGXqIy.js} +1 -1
  355. package/dist/client/assets/useContentSecondaryNav-DrL_nkCZ.js +1 -0
  356. package/dist/client/assets/{useEmbedHeadline-BL8wQawZ.js → useEmbedHeadline-atkQVfGw.js} +1 -1
  357. package/dist/client/assets/usePersistentState-Y8XwSTg-.js +1 -0
  358. package/dist/client/assets/{usePierreRuntime-DJkRHMoe.js → usePierreRuntime-DTvcwISe.js} +1 -1
  359. package/dist/client/assets/users-RLK3P5U4.js +1 -0
  360. package/dist/client/assets/{wrench-BsMTSeji.js → wrench-B4maQJai.js} +1 -1
  361. package/dist/client/assets/{x-DI1ktCYb.js → x-rlMdRqJF.js} +1 -1
  362. package/dist/client/assets/{xterm-B1YBE4Gq.js → xterm-B1zHHOLQ.js} +1 -1
  363. package/dist/client/assets/{zap-sKPkh4sQ.js → zap-B4X0OrEw.js} +1 -1
  364. package/dist/client/index.html +15 -3
  365. package/dist/drizzle/0019_session_actor_targets.sql +227 -0
  366. package/dist/drizzle/README.md +19 -0
  367. package/dist/drizzle/meta/0019_snapshot.json +6804 -0
  368. package/dist/drizzle/meta/_journal.json +7 -0
  369. package/dist/highlights-eq9cgrbb.scm +604 -0
  370. package/dist/highlights-ghv9g403.scm +205 -0
  371. package/dist/highlights-hk7bwhj4.scm +284 -0
  372. package/dist/highlights-r812a2qc.scm +150 -0
  373. package/dist/highlights-x6tmsnaa.scm +115 -0
  374. package/dist/injections-73j83es3.scm +27 -0
  375. package/dist/main.mjs +1214 -722
  376. package/dist/node/main.mjs +133 -22
  377. package/dist/pairing-runtime-controller.mjs +715 -492
  378. package/dist/runtime/base-daemon.mjs +14176 -58
  379. package/dist/runtime/broker-daemon.mjs +15520 -445
  380. package/dist/runtime/broker-process-manager.mjs +5 -3
  381. package/dist/runtime/mesh-discover.mjs +5 -3
  382. package/dist/scout-control-plane-web.mjs +21065 -3387
  383. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  384. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  385. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  386. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  387. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  388. package/dist/update-helper.mjs +83 -17
  389. package/package.json +2 -2
  390. package/dist/client/assets/ActivityScreen-DCALiEXY.js +0 -1
  391. package/dist/client/assets/AgentAdventures-NwTKeF0F.js +0 -1
  392. package/dist/client/assets/AgentConfigurationScreen-B2Hw0ce1.js +0 -1
  393. package/dist/client/assets/AgentDefinitionsWorkspace-CwZJ833X.js +0 -1
  394. package/dist/client/assets/AgentFloorView-l2wNKFob.js +0 -1
  395. package/dist/client/assets/AgentInfoScreen-ClZM1wQb.js +0 -1
  396. package/dist/client/assets/AgentLanesEmbedScreen-DqHwqY0X.js +0 -1
  397. package/dist/client/assets/AgentMasterScreen-By6DN0jF.js +0 -1
  398. package/dist/client/assets/AgentsConsole-Dq0S_hRA.js +0 -1
  399. package/dist/client/assets/AgentsScreen-Bi9Lx47B.js +0 -1
  400. package/dist/client/assets/AgentsSubnav-BOobgtGE.js +0 -1
  401. package/dist/client/assets/BriefingDetailScreen-sprFl4Nk.js +0 -1
  402. package/dist/client/assets/BrokerScreen-CejzhRsB.js +0 -8
  403. package/dist/client/assets/ConversationFeedRows-DVqnZQH0.js +0 -1
  404. package/dist/client/assets/ConversationHeader-CCSU8uo_.js +0 -1
  405. package/dist/client/assets/ConversationScreen-tTP6B_F-.js +0 -2
  406. package/dist/client/assets/CrewWorkspaces-4O8dgRUD.js +0 -1
  407. package/dist/client/assets/CrewWorkspaces-Diq11KDq.css +0 -1
  408. package/dist/client/assets/FlightObserveScreen-DDXfNbsw.js +0 -1
  409. package/dist/client/assets/FloorResourcesSheet-Djrgd_ZU.js +0 -1
  410. package/dist/client/assets/HarnessMark-Bt47OeHy.js +0 -1
  411. package/dist/client/assets/HarnessesScreen-M84sFjWY.js +0 -1
  412. package/dist/client/assets/KnowledgeSearchScreen-WC0WhFio.js +0 -1
  413. package/dist/client/assets/LaneTraceDetailSheet-mAhj7MJi.js +0 -1
  414. package/dist/client/assets/MeshScreen-DlfiMlaR.js +0 -1
  415. package/dist/client/assets/MessagesScreen-BZ7yaGJx.js +0 -1
  416. package/dist/client/assets/MissionControlView-DpGhxG4a.js +0 -1
  417. package/dist/client/assets/MissionLeftAgentRow-DhhRRim0.js +0 -1
  418. package/dist/client/assets/NativeAreaScreen-BQyHHRAM.js +0 -1
  419. package/dist/client/assets/NativeAreaScreen-Ditv-TYW.js +0 -1
  420. package/dist/client/assets/NativeAreaScreen-Dq3uPSEI.js +0 -1
  421. package/dist/client/assets/NewChatComposer-JjLbm3W2.js +0 -19
  422. package/dist/client/assets/OpenScoutAppShell-CzKbjwCA.js +0 -22
  423. package/dist/client/assets/OpsAgentsView-CZbtkcQH.js +0 -1
  424. package/dist/client/assets/OpsScreen-DJq-aBmX.js +0 -1
  425. package/dist/client/assets/OpsSubnav-9sURjajO.js +0 -1
  426. package/dist/client/assets/ProjectAgentProfile-q_1tMJIL.js +0 -1
  427. package/dist/client/assets/ProjectAgentProfileHero-DyEFyTFs.js +0 -1
  428. package/dist/client/assets/ProjectsInbox-Bs8I__my.js +0 -2
  429. package/dist/client/assets/ProjectsRail-Deb38OJ1.js +0 -1
  430. package/dist/client/assets/ProjectsScreen-CgLiYiss.js +0 -1
  431. package/dist/client/assets/ProjectsThreadAside-C0Yw3yIL.js +0 -1
  432. package/dist/client/assets/RawSessionsTable-DIhmlvk-.js +0 -1
  433. package/dist/client/assets/RealtimeVoiceScreen-3oU7b7V5.js +0 -1
  434. package/dist/client/assets/RepoDiffViewerLazy-BQ6ZCrsq.js +0 -2
  435. package/dist/client/assets/SessionRefScreen-BOQ1_ydg.js +0 -1
  436. package/dist/client/assets/SessionsScreen-R8QKvoey.js +0 -1
  437. package/dist/client/assets/SettingsScreen-DirtO7Z0.js +0 -1
  438. package/dist/client/assets/SharedWorkFloor-yPWFLZwX.js +0 -2
  439. package/dist/client/assets/Terminal-D-DsQlmV.js +0 -4
  440. package/dist/client/assets/TerminalEmbedScreen-9Gmln759.js +0 -1
  441. package/dist/client/assets/WorldActorTalk-uIH2jGqA.js +0 -1
  442. package/dist/client/assets/agent-autocomplete-CeHQpuG9.js +0 -10
  443. package/dist/client/assets/arrow-down-WoVlkUmg.js +0 -1
  444. package/dist/client/assets/chunk-JTPDIGGW-ZC-98AHT.js +0 -46
  445. package/dist/client/assets/chunk-T65CQEWV-CSVUz2rY.js +0 -1
  446. package/dist/client/assets/chunk-YOZR3KYS-B59jqwO0.js +0 -2
  447. package/dist/client/assets/content-B5Q4pb9R.js +0 -1
  448. package/dist/client/assets/content-BK1IfOZs.js +0 -1
  449. package/dist/client/assets/content-BeEsWLEm.js +0 -1
  450. package/dist/client/assets/content-BkOwEknW.js +0 -1
  451. package/dist/client/assets/content-C32W5kAG.js +0 -1
  452. package/dist/client/assets/content-CoqyLs9v.js +0 -1
  453. package/dist/client/assets/content-CwpdIS5b.js +0 -1
  454. package/dist/client/assets/content-DS2OkJ3Q.js +0 -1
  455. package/dist/client/assets/content-DXKaPDfn.js +0 -1
  456. package/dist/client/assets/content-DZt5-dkI.js +0 -1
  457. package/dist/client/assets/content-DbQJH8L1.js +0 -1
  458. package/dist/client/assets/content-DetoiaHq.js +0 -1
  459. package/dist/client/assets/content-Dhu3wL7J.js +0 -1
  460. package/dist/client/assets/content-Dpv34iZu.js +0 -1
  461. package/dist/client/assets/content-TtQJb61D.js +0 -1
  462. package/dist/client/assets/content-ymNb2R7g.js +0 -1
  463. package/dist/client/assets/conversation-motion-features-9x8uZpwh.js +0 -1
  464. package/dist/client/assets/discover-C8IOY7_K.js +0 -2
  465. package/dist/client/assets/embed-entry-CG3CfCbm.js +0 -2
  466. package/dist/client/assets/home-now-card-DduXkHRR.js +0 -1
  467. package/dist/client/assets/hooks-C6VyQTQe.js +0 -2
  468. package/dist/client/assets/index-C5cX8dkl.js +0 -1
  469. package/dist/client/assets/index-C8uS5szO.js +0 -10
  470. package/dist/client/assets/index-Ck1__1yL.css +0 -1
  471. package/dist/client/assets/index-ClOOrVG1.js +0 -1
  472. package/dist/client/assets/index-Crtgfc9I.js +0 -1
  473. package/dist/client/assets/lane-ask-display-B6iCAVcd.js +0 -18
  474. package/dist/client/assets/left-B-_z_nqj.js +0 -2
  475. package/dist/client/assets/left-B1LY7rJc.js +0 -1
  476. package/dist/client/assets/left-C6bdjWcG.js +0 -2
  477. package/dist/client/assets/left-CF4iuqlz.js +0 -1
  478. package/dist/client/assets/left-DLtNyZl1.js +0 -1
  479. package/dist/client/assets/left-Fpxoq-VY.js +0 -1
  480. package/dist/client/assets/left-N2wXfTlp.js +0 -1
  481. package/dist/client/assets/left-advisor-CeIjCKbd.js +0 -1
  482. package/dist/client/assets/left-agents-upjHVlOj.js +0 -1
  483. package/dist/client/assets/left-default-08gmdCtb.js +0 -1
  484. package/dist/client/assets/left-lanes-Cvsp73Hw.js +0 -1
  485. package/dist/client/assets/left-mission-W1LLaz74.js +0 -1
  486. package/dist/client/assets/library-DLKBVUJ6.js +0 -1
  487. package/dist/client/assets/profile-C3KgiZvc.js +0 -1
  488. package/dist/client/assets/projects-inbox-BIW7nv-H.css +0 -1
  489. package/dist/client/assets/resolve-panes-DuowGRTk.js +0 -1
  490. package/dist/client/assets/resolve-sidebar-context-BkTbqteq.js +0 -1
  491. package/dist/client/assets/right-B9OUA6Ho.js +0 -1
  492. package/dist/client/assets/right-BDQnjetX.js +0 -1
  493. package/dist/client/assets/right-BUbKHmRH.js +0 -1
  494. package/dist/client/assets/right-Ci2IcD4s.js +0 -1
  495. package/dist/client/assets/right-CmCce3e5.js +0 -1
  496. package/dist/client/assets/right-D7w0zM5a.js +0 -1
  497. package/dist/client/assets/right-DIoON_bv.js +0 -1
  498. package/dist/client/assets/right-E0Jr3VN5.js +0 -1
  499. package/dist/client/assets/right-lCdAk9dW.js +0 -1
  500. package/dist/client/assets/router-BKiMcYa7.js +0 -1
  501. package/dist/client/assets/secondaryNavConfig-DAXIFtVd.js +0 -1
  502. package/dist/client/assets/secondaryNavConfig-xssF_ubT.css +0 -1
  503. package/dist/client/assets/use-beside-Df-F2Uvg.js +0 -1
  504. package/dist/client/assets/use-scout-dev-flags-0TXfQcG0.js +0 -1
  505. package/dist/client/assets/useContentSecondaryNav-CGvMOVGY.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as u,j as e}from"./index-DReVb7jZ.js";import{u as j}from"./Provider-CNZluAZb.js";import{o as b}from"./openContent-C6XO6kr5.js";import{a as N}from"./api-DSqpVKC7.js";import{u as w}from"./sse-A8AyLH0g.js";import{t as g,b as p}from"./time-Dhsh_2EG.js";import{C as y}from"./chevron-down-CDzRQQGl.js";import{C as I}from"./chevron-right-DKGTLiqc.js";import{M as C}from"./message-square-CJW4WRlo.js";import"./provider-DwmCoSlc.js";import"./router-C-MF5-mb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./machine-scope-DJt9RZ2w.js";import"./surface-activity-B1rgWB1i.js";import"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-BEXS8vV6.js";import"./runtime-picker-C_AVYF63.js";import"./scout-voice-CqAyfblr.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DNUsuPWz.js";import"./createLucideIcon-ChvMq-zl.js";import"./conversation-model-m8HhzroS.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-CbqBwfIW.js";import"./HarnessMark-DSvM_H7H.js";import"./NewChatOrigin-C8ROO4ps.js";import"./keyboard-nav-CJXPaHXj.js";import"./x-rlMdRqJF.js";import"./search-UsM-9-_W.js";import"./file-text-DP6txVW-.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DlMiEALb.js";import"./TextDocumentSurface-BK6Qy41F.js";import"./index-kkXUq-zf.js";import"./folder-B_S7gBVr.js";import"./chevron-up-DX7R6KY2.js";import"./code-xml-Cmadr3pQ.js";import"./arrow-left-DFfKAq0d.js";import"./arrow-right-DmAWnyAH.js";import"./chunk-HRAB3GC3-Dvk_QpRq.js";import"./index-BWHgHrtv.js";const M=5;function Ie(){const{route:t,navigate:s}=j(),a=t.view==="work"?t.workId:null,[r,o]=u.useState(null),i=u.useCallback(async()=>{if(!a){o(null);return}try{o(await N(`/api/work/${encodeURIComponent(a)}`))}catch{o(null)}},[a]);if(u.useEffect(()=>{i()},[i]),w(()=>{a&&i()}),t.view!=="work")return null;if(!r)return e.jsx("div",{className:"flex h-full items-center justify-center px-4 text-center text-sm font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-ghost)]",children:"Loading work item…"});const d=O(r.state),m=T(r.attention),f=r.ownerName??r.ownerId??"Unassigned",l=r.nextMoveOwnerName??r.nextMoveOwnerId??null,h=l!==null&&(r.ownerId??null)!==(r.nextMoveOwnerId??null)&&l!==f,k=1+(h?1:0)+(r.priority?1:0)+2+(r.parentId?1:0)+(r.conversationId?1:0);return e.jsxs("div",{className:"flex flex-col h-full overflow-y-auto frame-scrollbar text-sm",children:[e.jsx("div",{className:"sticky top-0 z-10 border-b border-[var(--scout-chrome-border-soft)] bg-black/55 px-4 py-2 backdrop-blur",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${d.dot}`}),e.jsx("span",{className:`font-mono text-xs uppercase tracking-[0.15em] ${d.text}`,children:L(r.state)}),e.jsxs("span",{className:"min-w-0 flex-1 truncate text-xs text-[var(--scout-chrome-ink-faint)]",children:[e.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:f}),h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"px-1 text-[var(--scout-chrome-ink-ghost)]",children:"→"}),e.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:l})]})]}),m&&e.jsx("span",{className:"shrink-0 rounded border border-amber-400/30 bg-amber-400/10 px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-amber-300/90",children:m})]})}),e.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[e.jsxs(c,{label:"Case facts",children:[e.jsx(n,{label:"Phase",value:r.currentPhase}),e.jsx(n,{label:"Acceptance",value:r.acceptanceState.replace(/_/g," ")}),r.priority&&e.jsx(n,{label:"Priority",value:r.priority})]}),e.jsx(c,{label:"Timeline",children:r.timeline.length===0?e.jsx("div",{className:"text-xs text-[var(--scout-chrome-ink-faint)]",children:"No activity yet."}):e.jsx("div",{className:"flex flex-col gap-1.5",children:r.timeline.slice(0,M).map(x=>e.jsx(W,{item:x,onOpen:x.conversationId?()=>b(s,{view:"conversation",conversationId:x.conversationId},{returnTo:t}):void 0},x.id))})}),e.jsxs(c,{label:"Routing",collapsible:!0,defaultOpen:!1,count:k,children:[e.jsx(n,{label:"Owner",value:f}),h&&l&&e.jsx(n,{label:"Next move",value:l}),r.priority&&e.jsx(n,{label:"Priority",value:r.priority}),e.jsx(n,{label:"Children",value:`${r.activeChildWorkCount}`}),e.jsx(n,{label:"Flights",value:`${r.activeFlightCount}`}),r.lastMeaningfulAt&&e.jsx(n,{label:"Last update",value:g(r.lastMeaningfulAt)}),(r.conversationId||r.parentId)&&e.jsxs("div",{className:"mt-2 flex flex-col gap-1.5",children:[r.conversationId&&e.jsx(v,{label:"Open thread",onClick:()=>b(s,{view:"conversation",conversationId:r.conversationId},{returnTo:t})}),r.parentId&&r.parentTitle&&e.jsx(v,{label:r.parentTitle,eyebrow:"Parent",onClick:()=>b(s,{view:"work",workId:r.parentId},{returnTo:t})})]})]}),e.jsxs(c,{label:"Record",collapsible:!0,defaultOpen:!1,children:[e.jsx(n,{label:"Case ID",value:r.id}),e.jsx(n,{label:"Created",value:p(r.createdAt)}),e.jsx(n,{label:"Updated",value:p(r.updatedAt)}),e.jsx(n,{label:"Last activity",value:p(r.lastMeaningfulAt)})]}),r.lastMeaningfulSummary&&e.jsxs(c,{label:"Hudson context",collapsible:!0,defaultOpen:!1,children:[e.jsx("div",{className:"text-sm italic leading-relaxed text-[var(--scout-chrome-ink-soft)]",children:r.lastMeaningfulSummary}),e.jsxs("div",{className:"mt-2 flex gap-1.5",children:[e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Plan"}),e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Docs"}),e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Code"})]})]})]})]})}function L(t){switch(t){case"review":return"In review";case"waiting":return"Waiting";case"working":return"Working";case"done":return"Done";default:return t.replace(/_/g," ")}}function T(t){switch(t){case"badge":return"Noteworthy";case"interrupt":return"Blocked";default:return null}}function O(t){return/complete|done|finished/i.test(t)?{dot:"bg-emerald-400",text:"text-emerald-300/90"}:/fail|error/i.test(t)?{dot:"bg-red-400",text:"text-red-300/90"}:/block|wait|pause/i.test(t)?{dot:"bg-amber-400",text:"text-amber-300/90"}:/active|working|in[_-]?progress/i.test(t)?{dot:"bg-cyan-400",text:"text-cyan-300/90"}:{dot:"bg-[var(--scout-chrome-ink-faint)]",text:"text-[var(--scout-chrome-ink)]"}}function c({label:t,children:s,collapsible:a=!1,defaultOpen:r=!0,count:o}){const[i,d]=u.useState(r);return a?e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("button",{type:"button",onClick:()=>d(m=>!m),className:"flex items-center gap-1.5 text-left text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)] hover:text-[var(--scout-chrome-ink)]",children:[i?e.jsx(y,{"aria-hidden":"true",size:10,strokeWidth:2}):e.jsx(I,{"aria-hidden":"true",size:10,strokeWidth:2}),e.jsx("span",{children:t}),typeof o=="number"&&o>0&&e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1 py-0 font-mono text-3xs tracking-[0.1em] text-[var(--scout-chrome-ink-faint)]",children:o})]}),i&&e.jsx("div",{className:"mt-1.5",children:s})]}):e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"mb-1.5 text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)]",children:t}),s]})}function v({label:t,eyebrow:s,onClick:a}){return e.jsxs("button",{type:"button",onClick:a,className:"flex items-center justify-between gap-2 rounded border border-[var(--scout-chrome-border-soft)] bg-white/[0.025] px-2 py-1.5 text-left hover:border-cyan-400/25 hover:bg-cyan-400/10",children:[e.jsxs("span",{className:"min-w-0",children:[s&&e.jsx("span",{className:"block font-mono text-2xs uppercase tracking-[0.14em] text-[var(--scout-chrome-ink-faint)]",children:s}),e.jsx("span",{className:"block truncate font-mono text-xs text-[var(--scout-chrome-ink)]",children:t})]}),e.jsx(C,{"aria-hidden":"true",size:11,strokeWidth:1.8,className:"shrink-0 text-cyan-300/75"})]})}function W({item:t,onOpen:s}){const a=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:`mt-1 h-1.5 w-1.5 shrink-0 rounded-full ${A(t)}`}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-mono text-2xs text-[var(--scout-chrome-ink-faint)]",children:g(t.at)}),e.jsx("span",{className:"shrink-0 rounded border border-[var(--scout-chrome-border-soft)] px-1 py-0.5 font-mono text-3xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:_(t)})]}),e.jsx("span",{className:"mt-0.5 block truncate text-xs font-semibold text-[var(--scout-chrome-ink-strong)]",children:t.actorName??"system"}),t.title&&e.jsx("span",{className:"mt-0.5 block truncate text-xs leading-snug text-[var(--scout-chrome-ink)]",children:t.title}),t.summary&&e.jsx("span",{className:"mt-0.5 block text-xs leading-relaxed text-[var(--scout-chrome-ink-faint)]",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,overflow:"hidden"},children:t.summary})]})]}),r="flex gap-2 border-t border-[var(--scout-chrome-border-soft)] pt-1.5 first:border-t-0 first:pt-0",o=p(t.at);return s?e.jsx("button",{type:"button",onClick:s,title:o,className:`${r} text-left hover:text-cyan-300/90`,children:a}):e.jsx("div",{className:r,title:o,children:a})}function _(t){switch(t.kind){case"flight_started":return"flight started";case"flight_completed":return t.detailKind?`flight ${t.detailKind}`:"flight ended";case"message":return"message";default:return t.title??t.detailKind??"event"}}function A(t){return t.kind==="message"?"bg-cyan-400":t.kind==="flight_started"?"bg-lime-400":t.kind==="flight_completed"?t.detailKind?.includes("fail")?"bg-red-400":"bg-emerald-400":t.detailKind?.includes("interrupt")||t.detailKind?.includes("block")?"bg-amber-400":"bg-[var(--scout-chrome-ink-faint)]"}function n({label:t,value:s}){return e.jsxs("div",{className:"flex items-baseline justify-between py-0.5 gap-2",children:[e.jsx("span",{className:"shrink-0 text-xs font-mono uppercase tracking-wider text-[var(--scout-chrome-ink-faint)]",children:t}),e.jsx("span",{className:"truncate text-sm font-mono text-[var(--scout-chrome-ink)]",children:s})]})}export{Ie as WorkInspector};
@@ -1,2 +1,2 @@
1
- import{r as d,j as s}from"./index-C8uS5szO.js";/* empty css */import{a as P}from"./api-CaROe5_H.js";import{u as U,a as $,b as M,c as H,r as X,w as V,f as o,d as Y,e as _,t as z,g as Q,h as Z,i as ss,s as es}from"./ui-LM8pS8qE.js";import{B as as,u as ns}from"./selection-bridge-B5jqyMR9.js";function ts(n){return n.error!=null?{label:"SCAN ERR",cls:"err"}:n.status.conflicts>0?{label:"CONFLICT",cls:"conflict"}:n.status.clean?{label:"CLEAN",cls:"clean"}:{label:"DIRTY",cls:"dirty"}}function cs(n){const t=(n.state??"").toLowerCase();return t==="active"?"ACTIVE":t==="idle"?"IDLE":t==="waiting"?"WAITING":"—"}function ls(n){const t=n.lastIndexOf("/");return t<0?{dir:"",file:n}:{dir:n.slice(0,t+1),file:n.slice(t+1)}}function is(n){return n.status.clean?"clean":`staged ${n.status.staged}, unstaged ${n.status.unstaged}, untracked ${n.status.untracked}, conflicts ${n.status.conflicts}, changed files ${n.status.changedFiles}`}function rs(n,t,u){const l=["Operator request:",n,"","Repo Watch context:",`- Project: ${u.name}`,`- Project root: ${u.root}`,`- Project attention: ${u.attention}`,`- Worktree: ${t.path}`,`- Branch: ${t.branch.name??t.branch.head??"detached"}`];t.branch.upstream&&l.push(`- Upstream: ${t.branch.upstream}`),l.push(`- Drift: ahead ${t.branch.ahead}, behind ${t.branch.behind}`,`- Status: ${is(t)}`);const p=M(t),i=H(t);if(p.has&&l.push(`- Branch churn: +${p.add} -${p.del}`),i.has&&l.push(`- Working-tree churn: +${i.add} -${i.del}`),t.attentionReasons.length>0&&l.push(`- Attention reasons: ${t.attentionReasons.join("; ")}`),t.status.files.length>0){const T=t.status.files.slice(0,8).map(h=>`${h.status}: ${h.path}`).join(", ");l.push(`- Changed files: ${T}`)}return l.join(`
1
+ import{r as d,j as s}from"./index-DReVb7jZ.js";/* empty css */import{a as P}from"./api-DSqpVKC7.js";import{u as U,a as $,b as M,c as H,r as X,w as V,f as o,d as Y,e as _,t as z,g as Q,h as Z,i as ss,s as es}from"./ui-LM8pS8qE.js";import{B as as,u as ns}from"./selection-bridge-OTS2iFkt.js";function ts(n){return n.error!=null?{label:"SCAN ERR",cls:"err"}:n.status.conflicts>0?{label:"CONFLICT",cls:"conflict"}:n.status.clean?{label:"CLEAN",cls:"clean"}:{label:"DIRTY",cls:"dirty"}}function cs(n){const t=(n.state??"").toLowerCase();return t==="active"?"ACTIVE":t==="idle"?"IDLE":t==="waiting"?"WAITING":"—"}function ls(n){const t=n.lastIndexOf("/");return t<0?{dir:"",file:n}:{dir:n.slice(0,t+1),file:n.slice(t+1)}}function is(n){return n.status.clean?"clean":`staged ${n.status.staged}, unstaged ${n.status.unstaged}, untracked ${n.status.untracked}, conflicts ${n.status.conflicts}, changed files ${n.status.changedFiles}`}function rs(n,t,u){const l=["Operator request:",n,"","Repo Watch context:",`- Project: ${u.name}`,`- Project root: ${u.root}`,`- Project attention: ${u.attention}`,`- Worktree: ${t.path}`,`- Branch: ${t.branch.name??t.branch.head??"detached"}`];t.branch.upstream&&l.push(`- Upstream: ${t.branch.upstream}`),l.push(`- Drift: ahead ${t.branch.ahead}, behind ${t.branch.behind}`,`- Status: ${is(t)}`);const p=M(t),i=H(t);if(p.has&&l.push(`- Branch churn: +${p.add} -${p.del}`),i.has&&l.push(`- Working-tree churn: +${i.add} -${i.del}`),t.attentionReasons.length>0&&l.push(`- Attention reasons: ${t.attentionReasons.join("; ")}`),t.status.files.length>0){const T=t.status.files.slice(0,8).map(h=>`${h.status}: ${h.path}`).join(", ");l.push(`- Changed files: ${T}`)}return l.join(`
2
2
  `)}function ds({worktree:n,project:t,generatedAt:u}){const[l,p]=d.useState(""),[i,T]=d.useState("scout"),[h,k]=d.useState(!1),[R,g]=d.useState(null),[O,A]=d.useState(null),[B,K]=d.useState(!1),x=d.useMemo(()=>n?U(n):[],[n]),E=d.useMemo(()=>x.slice(0,8),[x]),I=d.useMemo(()=>{if(i==="scout")return"Scout";const e=i.replace(/^agent:/,""),c=E.find(m=>m.id===e);return c?$(c):"Agent"},[E,i]);async function w(){const e=l.trim();if(!(!e||h||!n||!t)){k(!0),g(null),A(null);try{const c=rs(e,n,t);if(i==="scout")await P("/api/send",{method:"POST",body:JSON.stringify({body:c})}),g("Sent to Scout");else{const m=i.replace(/^agent:/,"");await P("/api/ask",{method:"POST",body:JSON.stringify({body:c,targetAgentId:m,targetLabel:m,metadata:{source:"repo-watch",originSurface:"repo-watch",handoffKind:"repo-watch-agent-ask",targetAgentId:m}})}),g(`Sent to ${I}`)}p("")}catch(c){A(c instanceof Error?c.message:String(c))}finally{k(!1)}}}if(!n||!t)return s.jsx("aside",{className:"rw-ctx","aria-label":"Worktree detail",children:s.jsxs("div",{className:"rw-ctx-empty",children:[s.jsx("span",{className:"eb",children:"CONTEXT · WORKTREE"}),s.jsx("span",{className:"msg",children:"Select a worktree to inspect"})]})});const a=n,r=a.branch,N=5,f=x.length+a.sessions.length,b=!B&&f>N,y=b?x.slice(0,N):x,D=b?a.sessions.slice(0,Math.max(0,N-y.length)):a.sessions,q=f-y.length-D.length,L=ts(a),j=M(a),v=H(a),{add:S,del:C,has:G}=X(a),W=S+C||1,F=[{label:"staged",n:a.status.staged},{label:"unstaged",n:a.status.unstaged},{label:"untracked",n:a.status.untracked},{label:"conflicts",n:a.status.conflicts,cls:"conf"}].filter(e=>e.n>0);return s.jsxs("aside",{className:"rw-ctx","aria-label":"Worktree detail",children:[s.jsxs("div",{className:"ctx-h",children:[s.jsx("div",{className:"ctx-eyebrow",children:s.jsx("span",{children:"CONTEXT · WORKTREE"})}),s.jsxs("div",{className:"ctx-repo",children:[s.jsx("span",{className:"dot "+V(a)}),s.jsx("span",{className:"rn",children:t.name}),s.jsx("span",{className:"ctx-state "+L.cls,children:L.label})]}),s.jsx("div",{className:"ctx-branch",children:s.jsx(as,{branch:r,fallback:a.name})}),s.jsxs("div",{className:"ctx-path",children:[a.path,r.upstream?s.jsxs("span",{className:"ref",children:[" · ",r.upstream]}):null]})]}),s.jsxs("div",{className:"ctx-stats",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"v"+(r.ahead>0?" mint":" dim"),children:["↑",r.ahead]}),s.jsx("div",{className:"k",children:"AHEAD"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"v"+(r.behind>0?" amber":" dim"),children:["↓",r.behind]}),s.jsx("div",{className:"k",children:"BEHIND"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"v"+(a.status.changedFiles>0?"":" dim"),children:a.status.changedFiles}),s.jsx("div",{className:"k",children:"FILES"})]})]}),F.length>0?s.jsx("div",{className:"ctx-breakdown",children:F.map(e=>s.jsxs("span",{className:"ctx-chip"+(e.cls?" "+e.cls:""),children:[s.jsx("span",{className:"n",children:e.n}),e.label]},e.label))}):null,s.jsxs("div",{className:"ctx-body",children:[a.attentionReasons.length>0?s.jsxs("div",{className:"ctx-sec",children:[s.jsxs("div",{className:"ctx-sec-h",children:[s.jsx("span",{children:"ATTENTION"}),s.jsx("span",{className:"n",children:a.attentionReasons.length})]}),s.jsx("div",{className:"ctx-why",children:a.attentionReasons.map((e,c)=>s.jsx("span",{className:"pill",children:e},c))})]}):null,a.error?s.jsxs("div",{className:"ctx-sec",children:[s.jsx("div",{className:"ctx-sec-h",children:s.jsx("span",{children:"SCAN ERROR"})}),s.jsx("div",{className:"ctx-err",children:a.error})]}):null,s.jsxs("div",{className:"ctx-sec",children:[s.jsxs("div",{className:"ctx-sec-h",children:[s.jsx("span",{children:"CHURN"}),s.jsx("span",{className:"n",children:j.has?"reviewable":"working tree"})]}),G?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ctx-churn",children:[s.jsxs("span",{className:"nums",children:[s.jsxs("span",{className:"add",children:["+",o(S)]}),s.jsx("span",{className:"sl",children:"/"}),s.jsxs("span",{className:"del",children:["−",o(C)]})]}),s.jsxs("span",{className:"cbar",title:`+${o(S)} −${o(C)}`,children:[s.jsx("span",{className:"g",style:{width:S/W*100+"%"}}),s.jsx("span",{className:"r",style:{width:C/W*100+"%"}})]})]}),s.jsxs("span",{className:"ctx-churn-clean",children:[j.has?`branch +${o(j.add)} −${o(j.del)}`:null,j.has&&v.has?" · ":null,v.has?`working tree +${o(v.add)} −${o(v.del)}`:null]})]}):s.jsx("div",{className:"ctx-churn-clean",children:a.status.clean?"working tree clean":"no line changes"})]}),a.status.files.length>0?s.jsxs("div",{className:"ctx-sec",children:[s.jsxs("div",{className:"ctx-sec-h",children:[s.jsx("span",{children:"FILES CHANGED"}),s.jsx("span",{className:"n",children:a.status.files.length})]}),a.status.files.map(e=>{const c=Y(e.status),{dir:m,file:J}=ls(e.path);return s.jsxs("div",{className:"ctx-fchg",children:[s.jsx("span",{className:"badge",style:{color:Q(c),background:z(c)},title:e.status,children:_(e.status)}),s.jsxs("span",{className:"fp",title:e.path,children:[s.jsx("span",{className:"dir",children:m}),J]})]},e.path)})]}):null,s.jsxs("div",{className:"ctx-sec",children:[s.jsx("div",{className:"ctx-sec-h",children:s.jsx("span",{children:"LAST COMMIT"})}),s.jsx("div",{className:"ctx-commit",children:a.lastCommitAt!=null||r.head?s.jsxs(s.Fragment,{children:[r.head?s.jsx("span",{className:"hash",children:r.head.slice(0,7)}):null,s.jsxs("span",{className:"t",children:[Z(a.lastCommitAt,u)," ago"]})]}):s.jsx("span",{className:"none",children:"no commit data"})})]}),s.jsxs("div",{className:"ctx-sec",children:[s.jsxs("div",{className:"ctx-sec-h",children:[s.jsx("span",{children:"ATTACHED SESSIONS"}),s.jsxs("span",{className:"n",children:[x.length," handle",x.length===1?"":"s",a.sessions.length>0?` · ${a.sessions.length} session${a.sessions.length===1?"":"s"}`:""]})]}),f>0?s.jsxs(s.Fragment,{children:[y.map(e=>s.jsxs("div",{className:"ctx-agent",children:[s.jsx("span",{className:"d "+(ss(e)?"on":"off")}),s.jsx("span",{className:"h",children:$(e)}),s.jsx("span",{className:"role",children:cs(e)})]},$(e))),D.map(e=>s.jsxs("div",{className:"ctx-agent",children:[s.jsx("span",{className:"d off"}),s.jsx("span",{className:"h",children:es(e)}),s.jsx("span",{className:"role",children:"SESSION"})]},e.id)),f>N?s.jsx("button",{type:"button",className:"ctx-more",onClick:()=>K(e=>!e),"aria-expanded":!b,children:b?`+${q} more`:"Show less"}):null]}):s.jsx("div",{className:"ctx-none",children:"no attached sessions"})]})]}),s.jsxs("div",{className:"ctx-ask",children:[s.jsx("textarea",{value:l,onChange:e=>{p(e.currentTarget.value),g(null),A(null)},onKeyDown:e=>{e.stopPropagation(),(e.metaKey||e.ctrlKey)&&e.key==="Enter"&&(e.preventDefault(),w())},disabled:h,rows:3,placeholder:i==="scout"?"Message Scout about this worktree":"Message this agent about the worktree"}),s.jsxs("div",{className:"ctx-ask-bar",children:[s.jsxs("select",{value:i,onChange:e=>T(e.currentTarget.value),onKeyDown:e=>e.stopPropagation(),disabled:h,"aria-label":"Message target",children:[s.jsx("option",{value:"scout",children:"Scout"}),E.map(e=>s.jsx("option",{value:`agent:${e.id}`,children:$(e)},e.id))]}),s.jsx("button",{className:"ctx-btn primary",type:"button",disabled:h||l.trim().length===0,onClick:()=>{w()},children:h?"Sending":"Send"})]}),s.jsxs("div",{className:"ctx-ask-foot",children:[O?s.jsx("span",{className:"err",children:O}):R?s.jsx("span",{className:"ok",children:R}):s.jsxs("span",{children:["Repo Watch context included · ",I]}),s.jsx("button",{type:"button",title:"Copy worktree path",onClick:()=>{navigator.clipboard?.writeText(a.path)},children:"Copy path"})]})]})]})}function ps(){const{worktree:n,project:t,generatedAt:u,tone:l}=ns();return s.jsx("div",{className:"rw-scope rw-ctx-rail-scope tone-"+l,children:s.jsx(ds,{worktree:n,project:t,generatedAt:u})})}export{ps as ReposInspector,ps as default};
@@ -1 +1 @@
1
- import{c}from"./createLucideIcon-DkjnzvcJ.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-ChvMq-zl.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{U as ie,V as Dn,W as Ne,X as Be,K as On,Y as xn,L as k,N as h,Z as jn,$ as Z,a0 as Nn,a1 as Bn,r as C}from"./index-DReVb7jZ.js";import{b as Mn}from"./api-DSqpVKC7.js";import{n as ce}from"./synthetic-agent-routing-aduMYO7P.js";import{g as zn,h as Me,j as Wn,k as Kn}from"./terminal-sessions-3RfJpen8.js";const ze=["local","url","sharedConfig","env"];function Gn(e){const n=Vn(e),t=e.audienceIncludes??Hn(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:n,reason:"unknown-flag"};const d=Yn(e.layers,a);return d?{key:a,enabled:d.value,value:d.value,layer:d.layer,audience:n,requiredTier:u.tier,reason:"override",definition:u}:u.defaultEnabled?u.tier&&!t(n,u.tier)?{key:a,enabled:!1,value:!1,layer:"default",audience:n,requiredTier:u.tier,reason:"audience-denied",definition:u}:{key:a,enabled:!0,value:!0,layer:"default",audience:n,requiredTier:u.tier,reason:"default",definition:u}:{key:a,enabled:!1,value:!1,layer:"default",audience:n,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:()=>n}}function Vn(e){let n=e.audience.tier;for(const t of ze.slice().reverse()){const s=e.layers?.[t]?.audience;s&&(n=s)}return{...e.audience,tier:n}}function Hn(e){return(n,t)=>{if(n.tier===t)return!0;if(!e||e.length===0)return!1;const s=e.indexOf(n.tier),o=e.indexOf(t);return s<0||o<0?!1:s>=o}}function Yn(e,n){for(const t of ze){const s=qn(e?.[t]?.flags?.[n]);if(s!==null)return{layer:t,value:s}}return null}function qn(e){return e===!0||e==="on"?!0:e===!1||e==="off"?!1:null}function Qn(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 n=e.trim().toLowerCase();if(["1","true","on","yes","enabled","enable"].includes(n))return!0;if(["0","false","off","no","disabled","disable"].includes(n))return!1;if(["default","null","unset","clear"].includes(n))return"default"}function Xn(e,n={}){const t=n.paramPrefix??"ff.",s=n.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(t))continue;const d=a.slice(t.length),f=Qn(u);d&&f!==void 0&&(r[d]=f)}return{flags:r,audience:i}}const F=1;function Zn(e){if(typeof window>"u")return{version:F};try{const n=window.localStorage?.getItem(e);return Jn(n)}catch{return{version:F}}}function Fs(e,n){if(typeof window>"u")return;const t=We(n),s=JSON.stringify(t);try{window.localStorage?.setItem(e,s)}catch{}et(e,s)}function Jn(e){if(!e)return{version:F};try{const n=JSON.parse(e);return!n||typeof n!="object"?{version:F}:We(n)}catch{return{version:F}}}function We(e){const n={version:F};if(e.audience&&(n.audience=e.audience),e.flags&&typeof e.flags=="object"){n.flags={};for(const[t,s]of Object.entries(e.flags))(s===!0||s===!1)&&(n.flags[t]=s);Object.keys(n.flags).length===0&&delete n.flags}return n}function et(e,n){if(!(typeof document>"u"))try{const t=encodeURIComponent(n);document.cookie=`${encodeURIComponent(e)}=${t}; Path=/; SameSite=Lax; Max-Age=31536000`}catch{}}const nt=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal"],tt=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.scoutbot","surface.workflows"];function ye(e,n){return Object.fromEntries(e.map(t=>[t,n]))}const Ke={label:"Surface · Scope",description:`Scope presentation on Scout infra — lean lanes/tail/sessions/agents at ${Dn}/*.`,defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","scope","observability"]},st={...Ke,label:"Surface · Scope (legacy alias)",description:`Legacy alias for ${ie}. Prefer the primary flag; ${Ne} remains for old dev links.`},Ds=ie;function ot(){return{audience:"everyone",flags:{"ops.control":!0,"ops.lanes":!0,...ye(nt,!1),...ye(tt,!1)}}}const Ge=["ffBundle","ffVariant","scoutBundle","scoutExperience","ab"],Ve=["ffGlobal","scoutGlobalBundle"],He=["ffPersist","persistBundle"],rt=new Set(["no-ops","ffAudience",...Ge,...Ve,...He]);function Os(e){for(const n of[...e.searchParams.keys()])(rt.has(n)||n.startsWith("ff."))&&e.searchParams.delete(n);return e}const at=["everyone","internal","power"],it="openscout.flags",J="openscout.flagBundle",ct={tier:"power"},Ee=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal","ops.lanes"],$e=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.mesh-ops","surface.scoutbot","surface.workflows"],ut={"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"]},[ie]:Ke,[Ne]:st},lt={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",...xn},Re=new Set(["clear","default","none","reset","unset"]);function K(e,n){return Object.fromEntries(e.map(t=>[t,n]))}function Ye(...e){const n={};for(const t of e)t.audience&&(n.audience=t.audience),t.flags&&Object.keys(t.flags).length>0&&(n.flags={...n.flags??{},...t.flags});return n}function ue(e){switch(e){case"light-prod":return{audience:"everyone",flags:{...K(Ee,!1),...K($e,!1)}};case"max-pro":return{audience:"power",flags:{...K(Ee,!0),...K($e,!0)}};case On:return ot()}}function O(e){return e?lt[e.trim().toLowerCase()]??null:null}function ee(e,n){for(const t of n){const s=e.get(t);if(s!==null)return s}return null}function qe(e){const n=ee(e,Ge);return O(n)}function dt(e){const n=ee(e,Ve);if(n){const i=n.trim().toLowerCase();if(Re.has(i))return{action:"clear"};const a=O(n);return a?{action:"set",bundle:a}:null}const t=ee(e,He);if(!t)return null;const s=t.trim().toLowerCase();if(Re.has(s))return{action:"clear"};if(["0","false","no"].includes(s))return null;const o=O(t);if(o)return{action:"set",bundle:o};const r=qe(e);return r?{action:"set",bundle:r}:null}function Qe(){if(typeof window>"u")return null;try{return O(window.localStorage.getItem(J))}catch{return null}}function ft(e){if(!(typeof window>"u"))try{e.action==="clear"?window.localStorage.removeItem(J):window.localStorage.setItem(J,e.bundle)}catch{}}function xs(){return Qe()??O(Be())??Ze}function Xe(){const e=Qe();return e?ue(e):{}}const Ze="light-prod";function Je(){const e=O(Be())??Ze;return ue(e)}function mt(e){const n=dt(e);n&&ft(n)}function en(e=new URLSearchParams(window.location.search)){const n=Xn(window.location.href),t=qe(e),s=t?ue(t):{},o={audience:n.audience??s.audience,flags:{...s.flags??{},...n.flags??{}}};return e.has("no-ops")&&(o.flags={...o.flags,"ops.control":!1}),o}function pt(){const e=Zn(it);return{flags:e.flags,audience:e.audience??void 0}}function js(){if(typeof window>"u")return{};const e=new URLSearchParams(window.location.search);return mt(e),{sharedConfig:Ye(Je(),Xe()),url:en(e)}}function ht(e){const n=typeof window>"u"?{}:{sharedConfig:Ye(Je(),Xe()),url:en(),local:pt()};return Gn({registry:ut,audience:ct,audienceOrder:at,layers:n,warnOnUnknown:!1}).isEnabled(e)}function nn(){return ht("ops.control")}const ne={sm:408,md:512,lg:616},tn=240,sn=640,gt=24,on="openscout:lane-deck:v1",wt=new Set(["web.ops","macos.lanes","hud.tail","web.embed"]),le=new Set(["sm","md","lg"]),rn={"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}},It=rn["web.ops"];function de(e){return an(e)?rn[e]:It}const V={pinned_left:0,main:1,pinned_right:2};function an(e){return wt.has(e)}function Ns(e=window.location.search,n=window.location.pathname){const t=new URLSearchParams(e),s=t.get("profile")?.trim().toLowerCase();if(s&&an(s))return s;const o=t.get("embed")?.trim().toLowerCase();return o==="hud"?"hud.tail":o==="app"?"macos.lanes":n.includes("/lanes/embed")?"web.embed":(n.includes("/ops/lanes"),"web.ops")}function Bs(e=window.location.search){const n=new URLSearchParams(e),t=(n.get("lanes")??n.get("size"))?.trim().toLowerCase();return t&&le.has(t)?t:"lg"}function Ms(e,n){if(typeof e=="number"&&Number.isFinite(e))return Math.min(sn,Math.max(tn,Math.round(e)));const t=typeof e=="string"&&le.has(e)?e:n;return ne[t]}function zs(e){const n=Math.min(sn,Math.max(tn,Math.round(e)));let t=null,s=Number.POSITIVE_INFINITY;for(const[o,r]of Object.entries(ne)){const i=Math.abs(r-n);i<s&&(s=i,t=o)}return t&&s<=gt?{px:ne[t],tier:t}:{px:n,tier:null}}function fe(e,n,t){return{version:1,profileId:e,defaultLaneWidth:n??t.defaultLaneWidth,defaultHorizon:t.defaultHorizon,laneWidths:{},laneDefs:[],slots:[],showAutoLanes:t.showAutoLanes,updatedAt:Date.now()}}function Pe(e,n){const t=de(e);return fe(e,n,t)}function te(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&le.has(e))return e}function vt(e){if(!e||typeof e!="object")return null;const n=e;return typeof n.id!="string"||!n.id.trim()||n.kind!=="session"&&n.kind!=="harness"&&n.kind!=="project"&&n.kind!=="attention"||typeof n.title!="string"||!n.title.trim()?null:{id:n.id.trim(),kind:n.kind,title:n.title.trim(),sessionId:typeof n.sessionId=="string"?n.sessionId.trim():void 0,harness:typeof n.harness=="string"?n.harness.trim():void 0,projectPath:typeof n.projectPath=="string"?n.projectPath.trim():void 0}}function St(e){if(!e||typeof e!="object")return null;const n=e;return typeof n.id!="string"||!n.id.trim()||typeof n.laneDefId!="string"||!n.laneDefId.trim()||n.zone!=="pinned_left"&&n.zone!=="main"&&n.zone!=="pinned_right"||typeof n.position!="number"||!Number.isFinite(n.position)?null:{id:n.id.trim(),laneDefId:n.laneDefId.trim(),zone:n.zone,position:n.position,width:te(n.width)}}function cn(e,n,t,s){if(!e||typeof e!="object")return fe(n,t,s);const o=e,r=Array.isArray(o.laneDefs)?o.laneDefs.map(vt).filter(d=>d!==null):[],i=Array.isArray(o.slots)?o.slots.map(St).filter(d=>d!==null):[],a={};if(o.laneWidths&&typeof o.laneWidths=="object")for(const[d,f]of Object.entries(o.laneWidths)){const v=te(f);v!==void 0&&(a[d]=v)}const u=te(o.defaultLaneWidth);return{version:1,profileId:n,defaultLaneWidth:(typeof u=="string"?u:void 0)??t??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 bt(e,n,t){return cn(e,n,t,de(n))}function Ws(e,n){const t=de(e),s=n??t.defaultLaneWidth;try{const o=localStorage.getItem(`${on}:${e}`);return o?bt(JSON.parse(o),e,s):Pe(e,s)}catch{return Pe(e,s)}}function Lt(e){try{localStorage.setItem(`${on}:${e.profileId}`,JSON.stringify({...e,updatedAt:Date.now()}))}catch{}}function Ks(e){return[...e].sort((n,t)=>{const s=V[n.zone]-V[t.zone];return s!==0?s:n.position-t.position})}function Gs(e,n){return V[e]-V[n]}function un(){return`slot:${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function me(e){return e.trim().toLowerCase().replace(/['"]/gu,"").replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function Y(e){return`session:${e}`}function yt(e){return`harness:${me(e)}`}function Et(e){return`project:${me(e)}`}const $t="attention:needs-input";function ln(e,n){const t=e.filter(s=>s.zone===n);return t.length===0?0:Math.max(...t.map(s=>s.position))+1}function dn(e,n){const t=e.laneDefs.some(s=>s.id===n.id);return{...e,laneDefs:t?e.laneDefs.map(s=>s.id===n.id?n:s):[...e.laneDefs,n]}}function fn(e,n){const t=e.slots.some(s=>s.id===n.id);return{...e,slots:t?e.slots.map(s=>s.id===n.id?n:s):[...e.slots,n]}}function mn(e,n){return{...e,slots:e.slots.filter(t=>t.laneDefId!==n)}}function Rt(e,n){const t=Y(n);return{...mn(e,t),laneDefs:e.laneDefs.filter(s=>s.id!==t)}}function Vs(e,n){const t=Y(n);return e.slots.some(s=>s.laneDefId===t&&s.zone!=="main")}function Hs(e,n){const t=Y(n),s=e.slots.find(o=>o.laneDefId===t);return!s||s.zone==="main"?null:s.zone}function Ys(e,n){const t=n.zone??"pinned_left",s=Y(n.laneId),o=Rt(e,n.laneId),r=dn(o,{id:s,kind:"session",title:n.title,sessionId:n.laneId});return fn(r,{id:un(),laneDefId:s,zone:t,position:ln(r.slots,t),width:n.width})}function qs(e,n){const t=n.zone??"pinned_left",s=n.kind==="attention"?$t:n.kind==="harness"&&n.harness?yt(n.harness):n.kind==="project"&&n.projectPath?Et(n.projectPath):`${n.kind}:${me(n.title)}`,o=mn(e,s),r=dn(o,{id:s,kind:n.kind,title:n.title,harness:n.harness,projectPath:n.projectPath});return fn(r,{id:un(),laneDefId:s,zone:t,position:ln(r.slots,t),width:n.width})}function Qs(e,n,t){return{...e,laneWidths:{...e.laneWidths,[n]:t},updatedAt:Date.now()}}function Xs(e,n){return{...e,defaultLaneWidth:n,updatedAt:Date.now()}}function Zs(e){const n=new Set(e.slots.filter(t=>t.zone!=="main").map(t=>t.laneDefId));return{...e,slots:e.slots.filter(t=>t.zone==="main"),laneDefs:e.laneDefs.filter(t=>!n.has(t.id))}}const H="scope.lanes",se={defaultLaneWidth:"md",showAutoLanes:!0,defaultHorizon:"30m"},Pt="openscout:lane-deck:v1";function Ce(e){return fe(H,e,se)}function Js(e){const n=e??se.defaultLaneWidth;try{const t=localStorage.getItem(`${Pt}:${H}`);return t?cn(JSON.parse(t),H,n,se):Ce(n)}catch{return Ce(n)}}function eo(e){Lt(e)}const Ct=[h.lanes,h.tail,h.sessions,h.agents];function _t(e){return Ct.includes(e)}function At(e){return e===Nn||e===Bn}function pn(e){return jn(e)}function q(e,n={}){switch(e){case h.tail:{const t=new URLSearchParams;n.tailQuery&&t.set("q",n.tailQuery);const s=t.toString();return k(e,s?`?${s}`:"")}case h.sessions:return n.sessionId?k(e,`/${encodeURIComponent(n.sessionId)}`):k(e);case h.lanes:return k(Z);case h.agents:return k(e);default:return k(Z)}}function hn(e){switch(e.view){case"ops":return!e.mode||e.mode==="lanes"?h.lanes:e.mode==="tail"?h.tail:null;case"sessions":return e.agentId?null:h.sessions;case"agents-v2":return e.agentId||e.projectSlug||e.sessionId||e.conversationId?null:h.agents;default:return null}}function Ut(e){const n=hn(e);return n?n===h.tail&&e.view==="ops"?q(n,{tailQuery:e.tailQuery}):n===h.sessions&&e.view==="sessions"?q(n,{sessionId:e.sessionId}):q(n):null}function kt(e,n,t){if(!At(e[0]))return null;const s=e[1]??Z;if(!_t(s))return{view:"ops",mode:"lanes"};switch(s){case h.tail:{const o=n.searchParams.get("q")?.trim();return{view:"ops",mode:"tail",...o?{tailQuery:o}:{}}}case h.sessions:return e[2]?t({view:"sessions",sessionId:decodeURIComponent(e[2])}):t({view:"sessions"});case h.agents:return t({view:"agents-v2"});case h.lanes:default:return{view:"ops",mode:"lanes"}}}const Tt=new Set(["no-ops","ffBundle","ffVariant","scoutBundle","scoutExperience","ab","ffGlobal","scoutGlobalBundle","ffPersist","persistBundle","ffAudience","studio","studioInjection","studioMode"]),Ft=["ff.","studio.","studioMode."];function Dt(e){return Tt.has(e)||Ft.some(n=>e.startsWith(n))}const Ot=[{key:"open",prefix:"/messages"}];function xt(e,n){return Ot.some(t=>t.key===e&&(n===t.prefix||n.startsWith(`${t.prefix}/`)))}function gn(e,n=""){const t=new URL(e,"http://scout.local");new URLSearchParams(n).forEach((r,i)=>{!Dt(i)&&!xt(i,t.pathname)||t.searchParams.has(i)||t.searchParams.set(i,r)});const o=t.searchParams.toString();return`${t.pathname}${o?`?${o}`:""}`}function no(e){switch(e){case h.tail:return{view:"ops",mode:"tail"};case h.sessions:return{view:"sessions"};case h.agents:return{view:"agents-v2"};case h.lanes:default:return{view:"ops",mode:"lanes"}}}function jt(e=typeof window<"u"?window.location.pathname:""){return pn(e)}function to(){return H}function so(e=jt()){return e?{"data-scope-presentation":!0}:void 0}function wn(e,n=typeof window<"u"?window.location.pathname:""){return pn(n)?Ut(e):null}function Nt(e,n=typeof window<"u"?window.location.pathname:""){return wn(e,n)!==null}function oo(e,n=typeof window<"u"?window.location.pathname:""){return Nt(e,n)?hn(e):null}const ro={days:3,sessionLimit:200,hitLimit:60,debounceMs:180};function oe(e){return e.root==="HOME"?`~/${e.relPath}`:e.root==="ABSOLUTE"?e.relPath:`$${e.root}/${e.relPath}`}function _e(e){const n=e?.trim();if(!n)return null;const t=n.replace(/[\\/]+$/,""),s=t.split(/[\\/]/).filter(Boolean).at(-1)??t;return s.endsWith(".jsonl")?s.slice(0,-6):s}function A(e){return e.sourceRefs.find(n=>n.kind==="harness_transcript")??null}function In(e){return e.sourceRefs.find(n=>n.kind==="file")??null}function pe(e){return e?_e(e.sessionId)??_e(oe(e.path)):null}function ao(e){const n=pe(e);if(!n)return null;const t=e?.recordRange;return t?`${n}|records ${t[0]}..${t[1]}`:n}function M(e,n){const t=e.facets[n];return Array.isArray(t)?t.filter(Boolean).join(", "):typeof t=="string"?t:""}function N(e){const n=new Set;return e.split(/[^A-Za-z0-9_./-]+/u).map(t=>t.trim()).filter(t=>t.length>1).filter(t=>{const s=t.toLowerCase();return n.has(s)?!1:(n.add(s),!0)}).slice(0,12)}const Bt=/^(events?\s+window(\s+\d+)?|files?\s+touched|tool\s+calls?|indexed\s+snippet|manifest|summary|decisions?|context\s+pack)\b/iu,Ae=/^(claude|codex|kimi|cursor|gpt|gemini)\b/iu,Ue=/^(?: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 vn(e){return Bt.test(e.replace(/\s+/g," ").trim())}function Mt(e){let n=e.replace(/\s+/g," ").trim();if(!n)return"";if(n=n.replace(/<[^>\n]+>/g," ").replace(/\s+/g," ").trim(),Ue.test(n))n=n.replace(Ue,"").trim();else{const t=n.match(/^(.{6,72}?)\s[-–—]\s+(.+)$/u);if(t){const s=t[1]??"",o=t[2]??"";(Ae.test(s)||/\b(?:am|pm|\d{1,2}:\d{2}|plugin|session|openscout)\b/iu.test(s))&&(n=o.trim())}}return n=n.replace(Ae,"").replace(/^\s*[-–—:]\s*/,"").trim(),n=n.replace(/\s{2,}/g," ").trim(),n.length>72&&(n=`${n.slice(0,69).replace(/\s+\S*$/u,"").trimEnd()}…`),n}function zt(e){const n=M(e,"project"),t=e.title.replace(/\s+/g," ").trim();if(t&&!vn(t)){const o=Mt(t);if(o&&o.toLowerCase()!==n.toLowerCase()||o)return o}if(n)return n;const s=pe(A(e));return s?s.length>18?`${s.slice(0,16)}…`:s:"Session match"}function Sn(e){const n=B(e,"recordKind",8).map(s=>s.toLowerCase());if(n.length===0&&n.push(...B(e,"recordTag",8).map(s=>s.toLowerCase())),n.some(s=>s.includes("assistant")))return"assistant";if(n.some(s=>s.includes("user")))return"user";if(n.some(s=>s.includes("tool")||s.includes("command")||s.includes("response")))return"tool";const t=ge(e);return t==="tool activity"?"tool":t==="overview"?"overview":""}function io(e,n){const t=we(e.snippet,n),s=Sn(e),o=he(e);let r="";if(t){const i=N(n).map(d=>d.toLowerCase()),a=t.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=>re(d,f)>=0)):void 0)??a[0]??t).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||zt(e)}function Wt(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 ke(e){const n=e.trim().toLowerCase();return n?n==="events"||n.startsWith("events")?"conversation":n==="overview"||n==="summary"?"overview":n==="tool-calls"||n==="tools"?"tool activity":n==="files"||n==="files-touched"?"files touched":n==="manifest"?"session index":n.replace(/[-_]+/g," "):""}function Kt(e){const n=e.trim();return n?n.charAt(0).toUpperCase()+n.slice(1):""}function Gt(e){const n=M(e,"harness")||A(e)?.harness||"";if(!n)return"";const t=n.toLowerCase();return t==="claude"?"Claude":t==="codex"?"Codex":t==="kimi"?"Kimi":t==="cursor"?"Cursor":Kt(n)}function Vt(e){const n=M(e,"sessionId").trim(),t=pe(A(e)),s=(n||t||"").trim();return s?s.length>14?s.slice(0,8):s:""}function he(e){const n=A(e)?.recordRange;if(n){const[s,o]=n;return s===o?`turn ${s}`:o-s<=1?`turns ${s}–${o}`:`turns ${s}–${o}`}const t=e.title.match(/events?\s+window\s+(\d+)/iu);return t?`window ${Number(t[1])}`:""}function Ht(e){const n=B(e,"recordKind",8).map(s=>s.toLowerCase());n.length===0&&n.push(...B(e,"recordTag",8).map(s=>s.toLowerCase()));const t=[];return n.some(s=>s.includes("user"))&&t.push("user"),n.some(s=>s.includes("assistant"))&&t.push("assistant"),n.some(s=>s.includes("tool")||s.includes("command")||s.includes("response"))&&t.push("tool"),t.length===0?"":t.join(" · ")}function ge(e){const n=M(e,"documentKind");if(n){const s=n.split(",")[0]?.trim()??n;return ke(s)}return vn(e.title)?ke(e.title):In(e)?"file":A(e)?"conversation":""}function B(e,n,t=3){const s=e.facets[n];return(Array.isArray(s)?s:typeof s=="string"?s.split(","):[]).map(r=>r.trim()).filter(Boolean).slice(0,t)}function co(e){return{agent:Gt(e),project:M(e,"project"),session:Vt(e),when:Wt(e),turn:he(e),role:Ht(e),where:ge(e)}}function uo(e){const n=[],t=he(e);t&&n.push(t);const s=Sn(e);s&&n.push(s);const o=ge(e);o&&o!=="conversation"&&n.push(o);const r=B(e,"toolName",2);r.length===1&&n.push(r[0]),r.length>1&&n.push(r.join(", "));const i=new Set;return n.filter(a=>{const u=a.toLowerCase();return i.has(u)?!1:(i.add(u),!0)})}function re(e,n){return new RegExp(`(?<![A-Za-z0-9_./~-])${yn(n)}(?![A-Za-z0-9_./~-])`,"iu").exec(e)?.index??-1}function we(e,n=""){let t=e.replace(/\s+/g," ").trim();if(!t)return"";if(t=t.replace(/\s*-\s*\[\d{3,}\]\s*`[^`]+`(?:\s*\([^)]*\))?\s*-\s*/gu," "),t=t.replace(/\[\d{3,}\]\s*`[^`]+`\s*/gu,""),t=t.replace(/\*\*/gu,""),t=t.replace(/\b(?:assistant_turn|user_turn|agent_reasoning|command_or_tool|response_item|system_record)\b/giu," "),t=t.replace(/(?:~\/|\.\.?\/|\/(?:Users|home|var|tmp|opt)\/)\S+/gu," "),t=t.replace(/https?:\/\/\S+/gu," "),t=t.replace(/\b[\w.-]+\.(?:com|net|org|io|dev|app)(?:\/\S*)?/giu," "),t=t.replace(/\{[^{}]{0,160}\}/gu," "),t=t.replace(/`[^`]{0,64}`/gu,r=>{const i=r.slice(1,-1);return N(n).some(a=>re(i,a)>=0)||/^[A-Za-z][\w.-]{0,24}$/u.test(i)?i:" "}),t=t.replace(/\s{2,}/g," ").trim(),t=t.replace(/^[\s,;:.\-–—|/]+/u,"").trim(),t.includes("{")||t.includes("[")){const r=t.search(/[\[{]/u);if(r>18){const i=t.slice(0,r).trim().replace(/[-–—,:;]+$/u,"").trim();i&&(t=i)}}const s=N(n),o=200;if(s.length>0&&t.length>o){let r=-1;for(const i of s){const a=re(t,i);a>=0&&(r<0||a<r)&&(r=a)}if(r<0)for(const i of s){if(i.length<4)continue;const a=t.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(t.length,a+o),d=t.slice(a,u).trim();t=`${a>0?"…":""}${d}${u<t.length?"…":""}`}else t=`${t.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`}else t.length>o&&(t=`${t.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`);return t.replace(/\s{2,}/g," ").trim()}function lo(e,n,t){const s=we(e.snippet,n);return s.length<=t?s:`${s.slice(0,t-1).replace(/\s+\S*$/u,"").trimEnd()}…`}function Yt(e,n){return N(n).filter(t=>{const s=t.toLowerCase();return e.title.toLowerCase().includes(s)||e.snippet.toLowerCase().includes(s)||we(e.snippet,n).toLowerCase().includes(s)})}function bn(e){const n=(e.kind||e.role||e.type||"record").toLowerCase();return n==="assistant_turn"||n==="assistant"?"assistant":n==="user_turn"||n==="user"?"user":n==="system_record"||n==="system"?"system":n==="command_or_tool"||n==="tool_use"?"tool":n==="response_item"?"tool output":n==="agent_reasoning"||n==="reasoning"?"reasoning":n.replace(/_/gu," ")}function Ln(e){const n=(e.kind||e.role||e.type||"").toLowerCase();return n==="assistant"||n==="assistant_turn"||n==="user"||n==="user_turn"||n==="last-prompt"||n==="ai-title"?0:n==="system"||n==="system_record"||n.includes("reasoning")?1:2}function fo(e){return e.scoreSource==="hybrid"?"Words and meaning":e.scoreSource==="vector"?"Similar in meaning":"Exact words"}function mo(e,n,t){const s=Yt(e,n),o=s.length===1?`Matched “${s[0]}”`:s.length>1?`Matched ${s.length} terms`:"Matched in this session";if(!t?.matched)return o;const r=[t.renderedText,t.summary].filter(Boolean).join(" ").toLowerCase(),i=s.filter(d=>r.includes(d.toLowerCase()));if(i.length===0)return o;const a=bn(t),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 po(e){const n=A(e);if(n){const s=oe(n.path),o=n.recordRange;return o?`${s}#R${o[0]}-R${o[1]}`:s}const t=In(e);if(t){const s=oe(t.path),o=t.lineRange;return o?`${s}#L${o[0]}-L${o[1]}`:s}return e.id}function qt(e){const n=e.filter(o=>Ln(o)===2).length,t=e.length-n,s=e.some(o=>o.matched)?" · match inside":"";return n>0&&t===0?`${n} tool step${n===1?"":"s"}${s}`:n===0?`${t} process step${t===1?"":"s"}${s}`:`${n} tool + ${t} process step${e.length===1?"":"s"}${s}`}function Qt(e){return`${e.length} more conversation turn${e.length===1?"":"s"}`}function ho(e,n={}){if(e.length===0)return[];const t=n.contextRadius??3,s=n.maxTurns??6,o=n.centerRecordIndex===void 0?-1:e.findIndex(g=>g.index===n.centerRecordIndex),r=e.findIndex(g=>g.matched),i=o>=0?o:r>=0?r:0,a=e.slice(Math.max(0,i-t),Math.min(e.length,i+t+1)),u=[];let d=[],f=[],v=0;const P=()=>{d.length!==0&&(u.push({kind:"folded",records:d,summary:qt(d)}),d=[])},y=()=>{f.length!==0&&(u.push({kind:"folded",records:f,summary:Qt(f)}),f=[])};for(const g of a){if(Ln(g)>0){y(),d.push(g);continue}if(P(),v>=s){f.push(g);continue}u.push({kind:"turn",record:g,role:bn(g)}),v+=1}return P(),y(),u}function Te(e){const n=A(e)?.recordRange;return n?n[0]:Number.MAX_SAFE_INTEGER}function go(e){const n=[],t=new Map;for(const s of e){const o=s.collectionId||s.id,r=t.get(o);r?r.push(s):(n.push(o),t.set(o,[s]))}return n.map(s=>{const o=[...t.get(s)??[]].sort((i,a)=>{const u=Te(i)-Te(a);return u!==0?u:i.score-a.score}),r=t.get(s)?.[0]??o[0];return{collectionId:s,best:r,moments:o}})}function yn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wo(e,n){const t=N(n);if(t.length===0||e.length===0)return[{text:e,match:!1}];const s=t.map(a=>`(?<![A-Za-z0-9_./~-])${yn(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 Io={sessions:"Sessions",skills:"Skills",mcp:"MCP",codebase:"Codebase",context_pack:"Context packs",mixed:"Mixed"},En=[{value:"1",label:"Last 24h"},{value:"3",label:"Last 3 days"},{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"}],vo=["sessions","skills","mcp","codebase","context_pack"];function So(){return{query:"",sourceKinds:[],harness:[],project:[],timeWindow:"all"}}function Xt(e){return e?En.some(n=>n.value===e):!1}function Q(e){return e?e.split(",").map(n=>n.trim()).filter(n=>n.length>0):[]}function Zt(e){const n=e==null?new URLSearchParams:typeof e=="string"?new URLSearchParams(e):e,t=n.get("time"),s=Xt(t)?t:"all";return{query:n.get("q")?.trim()??"",sourceKinds:Q(n.get("source")),harness:Q(n.get("harness")),project:Q(n.get("project")),timeWindow:s}}function Jt(e,n={}){const t=new URLSearchParams,s=e.query.trim();return s&&t.set("q",s),e.sourceKinds.length>0&&t.set("source",e.sourceKinds.join(",")),e.harness.length>0&&t.set("harness",e.harness.join(",")),e.project.length>0&&t.set("project",e.project.join(",")),e.timeWindow!=="all"&&t.set("time",e.timeWindow),n.hitId&&t.set("hit",n.hitId),t}function bo(e,n){return e.query.trim()===n.query.trim()&&e.timeWindow===n.timeWindow&&X(e.sourceKinds,n.sourceKinds)&&X(e.harness,n.harness)&&X(e.project,n.project)}function X(e,n){if(e.length!==n.length)return!1;const t=[...e].map(o=>o.trim().toLowerCase()).sort(),s=[...n].map(o=>o.trim().toLowerCase()).sort();return t.every((o,r)=>o===s[r])}function es(e){return e.query.trim().length>0||e.sourceKinds.length>0||e.harness.length>0||e.project.length>0||e.timeWindow!=="all"}function Lo(e){if(e==="all")return null;const n=Number.parseInt(e,10);return!Number.isFinite(n)||n<=0?null:Date.now()-n*24*60*60*1e3}function yo(e){return e==="all"?"Any time":En.find(t=>t.value===e)?.label??e}const $n=typeof window<"u"?window.location.href:"http://scout.local/";function Rn(e){const n=e.toString();return new URL(n,$n)}function ns(e){switch(e){case"profile":case"config":case"definitions":return e==="definitions"?"config":e;case"observe":case"message":return e;default:return}}function ts(e){const n=e.trim().replace(/^#/,"");if(!n.startsWith("msg-"))return null;const t=n.slice(4).trim();if(!t)return null;try{return decodeURIComponent(t)}catch{return t}}function ss(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 os(e){return e==="delivered"||e==="failed"||e==="all"?e:void 0}function rs(e){return e==="indexer"||e==="knowledge"?e:void 0}function as(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 is(e){switch(e){case"tail":case"session":case"chat":case"work":return e;default:return}}function cs(e){const n=e?.trim().replace(/\.+$/u,"");return n==="observe"||n==="takeover"?n:void 0}function us(e){const n=e?.trim().toLowerCase();return n==="pty"||n==="tmux"||n==="zellij"||n==="herdr"?n:void 0}function ls(e){const n=e?.trim().toLowerCase();return n==="shell"||n==="claude"||n==="codex"||n==="pi"?n:void 0}function ds(e){return e==="all"||e==="touched"?"all":e==="changed"?"changed":void 0}function Fe(e){if(!e)return;const n=Number.parseInt(e,10);return Number.isSafeInteger(n)&&n>0?n:void 0}function De(e){return e==="mission"?"control":e}function fs(e){return e.searchParams.has("no-ops")?!1:typeof window>"u"?!0:nn()}function ms(e){return e==="tail"}function ps(e){return e==="lanes"||e==="world"}function Pn(e){return ms(e)||ps(e)}const Ie="machineId",Cn=new Set(["inbox","conversation","agents-v2","messages","sessions","repos","harnesses","mesh","mesh-ops","activity","work","follow"]);function hs(e){return e.searchParams.get(Ie)?.trim()||void 0}function gs(e,n){return!n||!Cn.has(e.view)?e:{...e,machineId:n}}function ve(e){return Cn.has(e.view)}function ws(e){return"machineId"in e&&e.machineId?e.machineId:null}function Oe(e,n){if(!ve(e))return e;const t={...e},s=n?.trim();return s?t.machineId=s:delete t.machineId,t}function Eo(e){return ve(e)?{...e,machineId:""}:e}function Is(e,n){return ve(e)?"machineId"in e?Oe(e,e.machineId??null):Oe(e,ws(n)):e}function _(e,n){"machineId"in n&&n.machineId&&e.set(Ie,n.machineId)}function I(e){const n=e.toString();return n?`?${n}`:""}function T(e,n){const t=new URLSearchParams;return _(t,n),`${e}${I(t)}`}function vs(e){return"machineId"in e&&e.machineId?`:machine:${e.machineId}`:""}function Se(e){const n=Rn(e),t=n.pathname.replace(/^\/+/,"").split("/").filter(Boolean);if(t[0]==="embed"&&["home","search","ops"].includes(t[1]??"")){const c=new URL(n),l=t[1],m=n.searchParams.get("mode");c.pathname=l==="home"?"/":`/${l}${m?`/${encodeURIComponent(m)}`:""}`,c.searchParams.delete("mode");const p=Se(c);return l==="ops"&&p.view==="inbox"?{...p,view:"ops",mode:"tail"}:p}const s=hs(n),o=c=>gs(c,s),r=kt(t,n,o);if(r)return r;const i=ts(n.hash),a=ns(n.searchParams.get("tab"))??(i?"message":void 0),u=n.searchParams.get("project")?.trim()||void 0,d=n.searchParams.get("agentId")?.trim()||void 0;if(t[0]==="agent"&&t[1])return{view:"agent-info",conversationId:decodeURIComponent(t[1])};const f=n.searchParams.get("project")?.trim()||void 0,v=n.searchParams.get("harness")?.trim()||void 0,P=n.searchParams.get("node")?.trim()||void 0,y=n.searchParams.get("set")?.trim(),g=y==="live"||y==="ephemeral"||y==="archived"?y:void 0,x=n.searchParams.get("view")?.trim(),z=x==="sessions"||x==="agents"?x:void 0,U=n.searchParams.get("state")?.trim(),be=U==="needs"||U==="live"||U==="idle"?U:void 0,Fn=n.searchParams.get("ephemeral")==="1",W=n.searchParams.get("session")?.trim()||void 0,b=n.searchParams.get("select")?.trim()||void 0,E={...v?{harness:v}:{},...P?{node:P}:{},...g?{set:g}:{},...z?{indexView:z}:{},...be?{stateFilter:be}:{},...Fn?{showEphemeral:!0}:{}};if(t[0]==="projects"){const c=t[1]?decodeURIComponent(t[1]):void 0;if(!c)return o({view:"agents-v2",...b?{selectedAgentId:b}:{},...E});if(t[2]==="agents"){const l=t[3]?decodeURIComponent(t[3]):void 0;if(l){if(t[4]==="c"&&t[5])return o({view:"agents-v2",projectSlug:c,agentId:l,conversationId:decodeURIComponent(t[5]),tab:a??"message",...E});const m=t[4]==="sessions"&&t[5]?decodeURIComponent(t[5]):W;return o({view:"agents-v2",projectSlug:c,agentId:l,...m?{sessionId:m}:{},...a?{tab:a}:{},...E})}return o({view:"agents-v2",projectSlug:c,indexView:"agents",...b?{selectedAgentId:b}:{},...E})}return t[2]==="sessions"?o({view:"agents-v2",projectSlug:c,indexView:"sessions",...t[3]?{sessionId:decodeURIComponent(t[3])}:{},...b?{selectedAgentId:b}:{},...E}):o({view:"agents-v2",projectSlug:c,...b?{selectedAgentId:b}:{},...E})}if(t[0]==="agents-v2"&&t[1]==="sessions"&&t[2])return o({view:"agents-v2",sessionId:decodeURIComponent(t[2]),...b?{selectedAgentId:b}:{},...f?{projectSlug:f}:{},...E});if(t[0]==="agents-v2"&&t[1]){const c=decodeURIComponent(t[1]);return o({view:"agents-v2",agentId:c,...a?{tab:a}:{},...W?{sessionId:W}:{},...f?{projectSlug:f}:{},...E})}if(t[0]==="agents-v2")return o({view:"agents-v2",...b?{selectedAgentId:b}:{},...f?{projectSlug:f}:{},...E});if(t[0]==="agents"&&t[1]){const c=decodeURIComponent(t[1]),l=t[2]==="sessions"&&t[3]?decodeURIComponent(t[3]):W;return t[2]==="c"&&t[3]?o({view:"agents-v2",agentId:c,conversationId:decodeURIComponent(t[3]),tab:a??"message",...E}):o({view:"agents-v2",agentId:c,...l?{sessionId:l}:{},...a?{tab:a}:{},...E})}if(t[0]==="agents")return o({view:"agents-v2",...b?{selectedAgentId:b}:{},...f?{projectSlug:f}:{},...E});if(t[0]==="agents.deprecated"&&t[1]&&t[2]==="sessions"&&t[3])return o({view:"sessions",agentId:decodeURIComponent(t[1]),sessionId:decodeURIComponent(t[3])});if(t[0]==="agents.deprecated"&&t[1]&&t[2]==="c"&&t[3])return o({view:"agents-v2",agentId:decodeURIComponent(t[1]),conversationId:decodeURIComponent(t[3]),tab:a??"message"});if(t[0]==="agents.deprecated"&&t[1]){const c=decodeURIComponent(t[1]);return o({view:"agents-v2",agentId:c,...a?{tab:a}:{},...!a&&u?{projectSlug:u}:{}})}if(t[0]==="agents.deprecated")return o({view:"agents-v2",...u?{projectSlug:u}:{}});if(t[0]==="fleet")return o({view:"inbox"});if(t[0]==="c"&&t[1])return o({view:"conversation",conversationId:decodeURIComponent(t[1])});if(t[0]==="flights"&&t[1]&&t[2]==="observe"){const c=n.searchParams.get("session")?.trim()||void 0,l=n.searchParams.get("compare")?.trim()||void 0;return o({view:"sessions",flightId:decodeURIComponent(t[1]),...c?{sessionId:c}:{},...l?{compareSessionId:l}:{}})}if(t[0]==="sessions"&&t[1])return o({view:"sessions",sessionId:decodeURIComponent(t[1]),...d?{agentId:d}:{}});if(t[0]==="conversations")return o({view:"messages"});if(t[0]==="messages"){if(t[1]==="agent"&&t[2]){const l=n.searchParams.get("thread")?.trim()||void 0;return o({view:"messages",agentId:decodeURIComponent(t[2]),...l?{threadId:l}:{}})}const c={view:"messages",...t[1]?{conversationId:decodeURIComponent(t[1])}:{}};return o(c)}if(t[0]==="sessions")return o({view:"sessions",...d?{agentId:d}:{}});if(t[0]==="repos"){const c=n.searchParams.get("root")?.trim()||void 0;return o({view:"repos",...c?{root:c}:{}})}if(t[0]==="providers"||t[0]==="harnesses")return o({view:"harnesses"});if(t[0]==="repo-diff"){const c=n.searchParams.get("path")?.trim();if(c){const l=n.searchParams.getAll("layer").filter(w=>w==="unstaged"||w==="staged"||w==="branch"),m=n.searchParams.getAll("file").map(w=>w.trim()).filter(Boolean),p=n.searchParams.get("sessionId")?.trim()||void 0,S=n.searchParams.get("agentId")?.trim()||void 0,L=ds(n.searchParams.get("include"));return{view:"repo-diff",path:c,...l.length>0?{layers:l}:{},...m.length>0?{files:m}:{},...p?{sessionId:p}:{},...S?{agentId:S}:{},...L?{include:L}:{}}}}if(t[0]==="search"){const c=rs(t[1]),l=n.searchParams.get("hit")?.trim()||void 0,m=Zt(n.searchParams);return{view:"search",...c&&c!=="knowledge"?{mode:c}:{},...l?{hitId:l}:{},...es(m)?{filters:m}:{}}}if(t[0]==="channels"&&t[1])return o({view:"messages",conversationId:decodeURIComponent(t[1])});if(t[0]==="channels")return o({view:"messages"});if(t[0]==="network"||t[0]==="mesh")return o({view:"mesh"});if(t[0]==="mesh-ops")return o({view:"mesh-ops",...t[1]?{itemId:decodeURIComponent(t[1])}:{}});if(t[0]==="dispatch"||t[0]==="broker"){const c=n.searchParams.get("attempt")?.trim()||void 0,l=os(n.searchParams.get("filter"));return{view:"broker",...c?{attemptId:c}:{},...l&&l!=="all"?{filter:l}:{}}}if(t[0]==="code"){const c=n.searchParams.get("wt")?.trim()||void 0,l=n.searchParams.get("fromConversation")?.trim()||void 0,m=Fe(n.searchParams.get("line")),p=Fe(n.searchParams.get("endLine")),S=m&&p&&p>=m?p:void 0;if(t[1]){const R=decodeURIComponent(t[1]),$=t.length>2?t.slice(2).map(decodeURIComponent).join("/"):void 0;return{view:"code",project:R,...$?{path:$}:{},...c?{wt:c}:{},...m?{line:m}:{},...S?{endLine:S}:{},...l?{returnConversationId:l}:{}}}const L=n.searchParams.get("root")?.trim()||void 0,w=n.searchParams.get("file")?.trim()||void 0;return{view:"code",...L?{root:L}:{},...w?{file:w}:{},...c?{wt:c}:{},...m?{line:m}:{},...S?{endLine:S}:{},...l?{returnConversationId:l}:{}}}if(t[0]==="briefings"&&t[1])return{view:"briefings",briefingId:decodeURIComponent(t[1])};if(t[0]==="briefings")return{view:"briefings"};if(t[0]==="activity")return o({view:"activity"});if(t[0]==="voice")return{view:"voice"};if(t[0]==="work"&&t[1])return o({view:"work",workId:decodeURIComponent(t[1])});if(t[0]==="follow"){const c=is(n.searchParams.get("view")),l={view:"follow",...c?{preferredView:c}:{}},m=t[1],p=t[2]?decodeURIComponent(t[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 S=n.searchParams.get("flightId"),L=n.searchParams.get("invocationId"),w=n.searchParams.get("conversationId"),R=n.searchParams.get("workId"),$=n.searchParams.get("sessionId"),Le=n.searchParams.get("targetAgentId");return S&&(l.flightId=S),L&&(l.invocationId=L),w&&(l.conversationId=w),R&&(l.workId=R),$&&(l.sessionId=$),Le&&(l.targetAgentId=Le),o(l)}if(t[0]==="settings"){if(t[1]==="agents")return{view:"settings",section:"agents",...t[2]?{agentId:decodeURIComponent(t[2])}:{}};const c=as(t[1]);return{view:"settings",...c?{section:c}:{}}}if(t[0]==="terminal"){const c=cs(n.searchParams.get("mode")),l=n.searchParams.get("session")?.trim()||void 0,m=zn(n.searchParams.get("surface"))??void 0;if(t[1]==="new"){const S=us(n.searchParams.get("backend"))??"pty",L=ls(n.searchParams.get("agent"))??"shell",w=n.searchParams.get("name")?.trim()||void 0,R=n.searchParams.get("tab")?.trim()||void 0,$=n.searchParams.get("socketDir")?.trim()||void 0;return{view:"terminal",terminalBackend:S,terminalAgent:L,...w?{terminalSessionName:w}:{},...R?{terminalTabId:R}:{},...$?{zellijSocketDir:$}:{}}}const p=t[1]==="s"&&t[2]?Me(decodeURIComponent(t.slice(2).join("/")))?decodeURIComponent(t.slice(2).join("/")):null:Wn(t[1]?decodeURIComponent(t[1]):void 0,t[2]?decodeURIComponent(t.slice(2).join("/")):void 0);return p?{view:"terminal",terminalSurfaceKey:p,...l?{terminalSessionId:l}:{},...c?{mode:c}:{}}:{view:"terminal",...t[1]?{agentId:decodeURIComponent(t[1])}:{},...c?{mode:c}:{},...!t[1]&&l?{terminalSessionId:l}:{},...!t[1]&&m?{terminalSurfaceKey:m}:{}}}if(t[0]==="ops"){const c=ss(t[1])??"mission";if(!Pn(c)&&!fs(n))return o({view:"inbox"});const l=c==="tail"?n.searchParams.get("q")?.trim():"",m=c==="advisor"?n.searchParams.get("plan")?.trim():"",p=n.searchParams.get("flightId")?.trim(),S=n.searchParams.get("invocationId")?.trim(),L=n.searchParams.get("conversationId")?.trim(),w=n.searchParams.get("workId")?.trim(),R=n.searchParams.get("sessionId")?.trim(),$=n.searchParams.get("targetAgentId")?.trim()??n.searchParams.get("agentId")?.trim();return{view:"ops",mode:c,...l?{tailQuery:l}:{},...m?{planDocumentId:m}:{},...p?{flightId:p}:{},...S?{invocationId:S}:{},...L?{conversationId:L}:{},...w?{workId:w}:{},...R?{sessionId:R}:{},...$?{targetAgentId:$}:{}}}return o({view:"inbox"})}function _n(e,n){const t=e.view==="sessions"&&e.flightId?null:wn(e,n);if(t)return t;switch(e.view){case"inbox":return T("/",e);case"conversation":{const s=new URLSearchParams;return _(s,e),`/c/${encodeURIComponent(e.conversationId)}${I(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),_(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"}${I(s)}`}case"messages":{const s=new URLSearchParams;return e.agentId&&e.threadId&&s.set("thread",e.threadId),_(s,e),`${e.agentId?`/messages/agent/${encodeURIComponent(e.agentId)}`:e.conversationId?`/messages/${encodeURIComponent(e.conversationId)}`:"/messages"}${I(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),_(s,e),`/flights/${encodeURIComponent(e.flightId)}/observe${I(s)}`):(_(s,e),`${e.sessionId?`/sessions/${encodeURIComponent(e.sessionId)}`:"/sessions"}${I(s)}`)}case"repos":{const s=new URLSearchParams;return e.root&&s.set("root",e.root),_(s,e),`/repos${I(s)}`}case"harnesses":return T("/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${I(s)}`}case"search":{const s=e.mode==="indexer"?"/search/indexer":"/search",o=e.filters?Jt(e.filters,{hitId:e.hitId??null}):new URLSearchParams;return!e.filters&&e.hitId&&o.set("hit",e.hitId),`${s}${I(o)}`}case"mesh":return T("/network",e);case"mesh-ops":return T(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${I(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("/")}`}${I(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 T("/activity",e);case"voice":return"/voice";case"work":return T(`/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/${De(e.mode)}${I(s)}`}return`/ops/${De(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(Ie,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)}${I(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${I(s)}`;e.mode&&s.set("mode",e.mode);const o=Kn(e.terminalSurfaceKey);return o?`/terminal/${encodeURIComponent(o.backend)}/${encodeURIComponent(o.sessionName)}${I(s)}`:Me(e.terminalSurfaceKey)?`/terminal/s/${encodeURIComponent(e.terminalSurfaceKey)}${I(s)}`:(e.terminalSessionId&&s.set("session",e.terminalSessionId),e.terminalSurfaceKey&&s.set("surface",e.terminalSurfaceKey),`/terminal${I(s)}`)}}}function j(e){const n=vs(e);switch(e.view){case"conversation":return`conv:${e.conversationId}${n}`;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??"",n].join(":");case"sessions":return e.flightId?`flight-observe:${e.flightId}:${e.sessionId??""}:${e.compareSessionId??""}${n}`:e.sessionId?`session:${e.agentId??""}:${e.sessionId}${n}`:`sessions${n}`;case"messages":return["messages",e.conversationId??"",e.agentId??"",e.threadId??"",n].join(":");case"work":return`work:${e.workId}${n}`;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??""}${n}`;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}${n}`}}function G(e,n){return ce(Se(`${e}${n}`))}function An(e){return e?`#${e}`:""}function Ss(e){return e.startsWith("/embed/")||e==="/ops/lanes/embed"}function xe(){if(typeof window>"u"){const e=new URL($n);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 bs(e,n){return e.pathname===n.pathname&&e.searchStr===n.searchStr&&e.hash===n.hash&&Object.is(e.state,n.state)}function Ls(e){let n=e.read();const t=new Set;let s=null;const o=()=>{const r=e.read();if(!bs(n,r)){n=r;for(const i of t)i()}};return{getSnapshot:()=>n,subscribe(r){return s||(s=e.observe(o)),t.add(r),()=>{t.delete(r)}},navigateTo(r,i={}){const a=n.pathname,u=i.state===void 0?n.state:i.state;i.replace?e.replace(r,u):e.push(r,u),o(),n.pathname!==a&&Mn(a,n.pathname)}}}function ys(){return typeof window>"u"?{read:xe,push:()=>{},replace:()=>{},observe:()=>()=>{}}:{read:xe,push:(e,n)=>window.history.pushState(n,"",e),replace:(e,n)=>window.history.replaceState(n,"",e),observe:e=>(window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)})}}const D=Ls(ys());function Es(){return C.useSyncExternalStore(D.subscribe,D.getSnapshot,D.getSnapshot)}function ae(e,n={}){D.navigateTo(e,n)}function Un(){return typeof window>"u"?null:window.navigation??null}function kn(){if(typeof window>"u")return!1;const e=Un();return e?e.canGoBack:window.history.length>1}function $s(){if(!kn())return;const e=Un();if(e){e.back();return}window.history.back()}function $o(e){if(!e||typeof e!="object")return null;const n=e.returnTo;return!n||typeof n!="object"||typeof n.view!="string"?null:n}function Ro(e){return!e||typeof e!="object"?!1:e.returnUseHistory===!0}function je(e){if(!e||typeof e!="object")return e;const{returnTo:n,returnUseHistory:t,settingsEntry:s,...o}=e;return o}function Rs(e,n){if(n.returnTo!==void 0){const t=n.state!==void 0?n.state:je(e),s=t&&typeof t=="object"?{...t}:{};return s.returnTo=n.returnTo,s.returnUseHistory=n.replace!==!0,s}return n.state!==void 0?n.state:n.replace?e:je(e)}function Tn(e){return e?e.replace(/^#/,""):""}function Ps(e,n,t={}){const s=G(e.pathname,e.searchStr),o=Is(n,s),r=t.preserveSearch===!1?"":e.searchStr;let i=_n(o,e.pathname);if({"/embed/home":"inbox","/embed/search":"search","/embed/ops":"ops"}[e.pathname]===o.view){const f=Rn(i),v=f.pathname.split("/").filter(Boolean)[1];f.pathname=e.pathname;const P=new URLSearchParams(e.searchStr);for(const y of["embed","profile","theme","themeVars","_nav"]){const g=P.get(y);g!==null&&f.searchParams.set(y,g)}v&&f.searchParams.set("mode",v),i=f.pathname+f.search}const u=gn(i,r),d=Tn(t.hash);return{route:o,href:`${u}${d?`#${d}`:""}`}}function Cs(e,n){const t=new URLSearchParams(e.searchStr);for(const[r,i]of Object.entries(n.searchPatch??{}))i===null?t.delete(r):t.set(r,i);const s=t.toString(),o=n.hash===void 0?e.hash:Tn(n.hash);return`${e.pathname}${s?`?${s}`:""}${o?`#${o}`:""}`}function Po(e){const n=D.getSnapshot(),t=Cs(n,e),s=`${n.pathname}${n.searchStr}${An(n.hash)}`;t!==s&&ae(t,{replace:e.replace??!0,state:e.state})}function _s(e,n,t){if(Ss(e))return null;const s=`${e}${n}`,o=Se(s),r=ce(o),i=gn(_n(r,e),n);return!(j(o)!==j(r)||r.view==="agents-v2"||s!==i)||s===i?null:`${i}${An(t)}`}function Co(){const{pathname:e,searchStr:n,hash:t}=Es(),s=`${e}${n}`,o=C.useMemo(()=>G(e,n),[e,n]),r=C.useRef({}),i=C.useRef(s);C.useEffect(()=>{const f=_s(e,n,t);f&&ae(f,{replace:!0})},[e,n,t]),C.useEffect(()=>{if(i.current===s)return;const f=G(e,n);requestAnimationFrame(()=>{window.scrollTo(0,r.current[j(f)]??0)}),i.current=s},[s,e,n]);const a=C.useCallback((f,v={})=>{const P=ce(f.view==="ops"&&!nn()&&!Pn(f.mode)?{view:"inbox"}:f),y=G(e,n),{route:g,href:x}=Ps({pathname:e,searchStr:n},P,v);r.current[j(y)]=window.scrollY;const z=D.getSnapshot().state,U=Rs(z,v);ae(x,{replace:v.replace,state:U}),requestAnimationFrame(()=>{window.scrollTo(0,r.current[j(g)]??0)})},[e,n]),u=C.useCallback(()=>$s(),[]),d=kn();return{route:o,navigate:a,navigateBack:u,canNavigateBack:d}}export{$t as $,go as A,es as B,bo as C,vo as D,Io as E,En as F,co as G,zt as H,pe as I,A as J,ro as K,io as L,lo as M,uo as N,Lo as O,wo as P,yo as Q,no as R,it as S,hn as T,pn as U,so as V,ve as W,Ks as X,Ms as Y,Gs as Z,Et as _,_n as a,Ws as a0,Lt as a1,Ys as a2,Rt as a3,Qs as a4,Xs as a5,qs as a6,Zs as a7,Vs as a8,Hs as a9,Ln as aA,ho as aB,oe as aC,mo as aD,fo as aE,bn as aF,zs as aa,sn as ab,tn as ac,Co as ad,Js as ae,eo as af,H as ag,ne as ah,Ds as ai,se as aj,q as ak,Ut as al,jt as am,kt as an,gn as ao,Nt as ap,ot as aq,to as ar,wn as as,Ke as at,oo as au,qn as av,In as aw,M as ax,ao as ay,po as az,Zn as b,Gn as c,ws as d,Eo as e,Po as f,$o as g,Qe as h,xs as i,ue as j,ft as k,Os as l,Ns as m,Bs as n,Ro as o,at as p,ct as q,Se as r,Oe as s,ut as t,Es as u,js as v,Fs as w,Jt as x,So as y,Zt as z};
@@ -1 +1 @@
1
- import{r as s,j as t,N as Ae}from"./index-C8uS5szO.js";import{g as Ve,e as _e,a as Be,b as fe,f as Pe,c as Ie}from"./scout-voice-DOQ_B77g.js";import{createLevelHistory as Te,energyFromPartialDelta as pe,tryStartMicLevelMeter as qe,VOICE_WAVE_BARS as ve}from"./voice-levels-Dcr3jglk.js";import{L as De}from"./loader-circle-DurUYl7E.js";import{c as be}from"./createLucideIcon-DkjnzvcJ.js";import{ad as Fe}from"./router-BKiMcYa7.js";function at(e){if(!e)return null;const n=e.replace(/_/g," ");return n.toLowerCase()==="relay agent"?"agent":n}const $e=[["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"}]],Ke=be("mic",$e);const We=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],ze=be("square",We);function Oe(e,n=!1){return e.key==="Enter"&&!e.shiftKey&&(n||!!(e.metaKey||e.ctrlKey))&&!e.nativeEvent?.isComposing}function He(e){switch(e){case"starting":return"starting";case"recording":return"recording";case"processing":return"processing";default:return"idle"}}function Ue(e,n,l){if(l)return l;switch(e){case"starting":return"Starting voice…";case"recording":return n.trim()?n.trim():null;case"processing":return"Transcribing…";default:return null}}function ge(e){return new Promise(n=>window.setTimeout(n,e))}function Ye({onAppend:e,onError:n,onStatus:l,disabled:R,className:d}){const p=s.useRef(Ve()),u=s.useRef(null),g=s.useRef(Te(ve)),H=s.useRef(null),k=s.useRef(!1),b=s.useRef(""),q=s.useRef(0),v=s.useRef(0),[h,w]=s.useState("idle"),[X,_]=s.useState(""),[Z,D]=s.useState("probing"),[ne,F]=s.useState(null),[N,B]=s.useState(null),[L,U]=s.useState(null),[oe,E]=s.useState(0),S=s.useCallback(()=>{v.current&&(window.cancelAnimationFrame(v.current),v.current=0),H.current?.stop(),H.current=null,k.current=!1},[]),j=s.useCallback(r=>{U(r),n?.(r)},[n]),ee=s.useCallback((r,i,c,f)=>{l?.({state:r,partial:i,message:Ue(r,i,c),tone:c?"error":r==="recording"?"recording":r==="processing"?"processing":"neutral",levels:r==="idle"&&!c?[]:g.current.snapshot(),levelsLive:k.current,issue:c?f:null})},[l]);s.useEffect(()=>{ee(h,X,L,N)},[ee,N,L,X,h,oe]);const A=s.useCallback(async(r=!1)=>{const i=p.current;D(f=>f==="launching"?f:"probing");const c=await i.probe(r?{force:!0}:void 0);return F(c),D("idle"),c},[]);s.useEffect(()=>{_e();const r=p.current,i=Be(c=>{F(c.ok),D("idle")});return r.connectionState==="unknown"?A():(F(r.connectionState==="connected"),B(null),D("idle")),()=>{i(),S();const c=u.current;c&&(c.cancel().catch(()=>{}),u.current=null)}},[A,S]);const $=s.useCallback(r=>{g.current.push(r),E(i=>i+1)},[]),K=s.useCallback(()=>{if(v.current)return;let r=performance.now();const i=c=>{if(c-r>=36){r=c;const f=c-(q.current||c),C=pe(b.current,b.current,f);g.current.push(Math.max(.05,C)),E(a=>a+1)}v.current=window.requestAnimationFrame(i)};v.current=window.requestAnimationFrame(i)},[]),te=s.useCallback(async()=>{const r=p.current;U(null),B(null),_(""),b.current="",q.current=performance.now(),g.current.clear(),E(a=>a+1),w("starting"),S();let i=await fe({surface:"chat-composer",requestPermissions:!0});if(!i.ready&&i.issue?.code==="microphone_not_requested"&&(await ge(1800),i=await fe({surface:"chat-composer"})),!(i.ready||i.issue?.code==="microphone_not_requested")){w("idle");const a=i.issue;a?(B(a),j(Pe(a))):j("Scout voice is not ready."),A(!0);return}B(null),F(!0);let f=null,C=!1;try{if(f=await r.startLive({onState:m=>w(He(m)),onPartial:m=>{const V=b.current;if(b.current=m,q.current=performance.now(),_(m),!k.current){const T=pe(V,m,0);$(T)}},onLevel:m=>{C=!0,k.current=!0,v.current&&(window.cancelAnimationFrame(v.current),v.current=0),$(m)}}),u.current=f,w("recording"),await ge(140),u.current&&!C&&!k.current){const m=await qe(V=>{C=!0,k.current=!0,v.current&&(window.cancelAnimationFrame(v.current),v.current=0),$(V)});m&&u.current?H.current=m:u.current&&!k.current&&(k.current=!1,K())}const a=await f.result;u.current=null,S(),w("idle");const z=b.current.trim();_(""),b.current="",U(null),g.current.clear(),E(m=>m+1);const I=a.text?.trim()||z;I?e(I):j("No speech was detected. Check your microphone in Settings → Voice."),A(!0)}catch(a){u.current=null,S(),w("idle");const z=b.current.trim();_(""),b.current="",g.current.clear(),E(m=>m+1);const I=a instanceof Error?a.message:"Scout voice recording failed.";if(z){e(z),a instanceof Error&&a.name==="AbortError"||j(`Recording ended early, but Scout recovered the partial transcript. ${I}`);return}if(a instanceof Error&&a.name==="AbortError")return;j(I),A(!0)}},[e,A,$,j,K,S]),re=s.useCallback(async()=>{const r=u.current;if(!r)return;w("processing"),S();const i=window.setInterval(()=>{g.current.decay(.82),E(c=>c+1)},50);window.setTimeout(()=>window.clearInterval(i),600);try{await r.stop()}catch(c){try{await r.cancel()}catch{}u.current=null,w("idle");const f=b.current.trim();_(""),b.current="",g.current.clear(),E(a=>a+1);const C=c instanceof Error?c.message:"Scout voice recording did not finish.";f?(e(f),j(`Recording ended early, but Scout recovered the partial transcript. ${C}`)):j(C)}},[e,j,S]),ce=s.useCallback(()=>{if(h==="recording"){re();return}h==="processing"||h==="starting"||te()},[h,te,re]),y=h==="recording",x=Z==="launching"||h==="starting"||h==="processing",P=(p.current.canRequestMicrophone||N?.action==="request_microphone"||N?.action==="request_speech")&&!y&&!x,Y=(p.current.isMicrophoneHardDenied||N?.action==="open_microphone_settings")&&!y&&!x,se=(ne===!1||N!==null)&&!P&&!Y&&!y&&!x,W=L||(N?N.title:Y?"Microphone blocked. Open Privacy & Security → Microphone to change it.":P?"Allow microphone access":se?"Scout voice is not ready":Z==="probing"?"Checking voice…":y?"Stop recording":h==="processing"?"Transcribing…":h==="starting"?"Starting voice…":"Start recording"),G=L?"s-dictation-mic--error":y?"s-dictation-mic--recording":Y?"s-dictation-mic--error":P?"s-dictation-mic--needs-permission":se?"s-dictation-mic--unavailable":x?"s-dictation-mic--busy":"",ie=x?De:y?ze:Ke,J=y?12:14;return t.jsx("button",{type:"button",title:W,"aria-label":W,"aria-pressed":y,onClick:ce,disabled:R||h==="processing",className:["s-dictation-mic",G,d].filter(Boolean).join(" "),children:t.jsx(ie,{size:J,className:x?"s-dictation-mic-spin":y?"fill-current":""})})}function Ge({samples:e,active:n,processing:l=!1,className:R}){const d=Je(e,ve,l?.06:.04),p=["s-msg-compose-wave",n?"s-msg-compose-wave--live":"",l?"s-msg-compose-wave--processing":"",R??""].filter(Boolean).join(" ");return t.jsx("div",{className:p,"aria-hidden":"true","data-wave-source":e&&e.length>0?"levels":"floor",children:d.map((u,g)=>t.jsx("span",{className:"s-msg-compose-wave-bar",style:{transform:`scaleY(${Math.max(.08,u)})`,opacity:l?.28+u*.35:n?.4+u*.55:.25}},g))})}function Je(e,n,l){if(!e||e.length===0)return Array.from({length:n},()=>l);if(e.length===n)return e.map(d=>Math.max(l,Math.min(1,d)));const R=new Array(n);for(let d=0;d<n;d+=1){const p=Math.min(e.length-1,Math.round(d/Math.max(1,n-1)*(e.length-1)));R[d]=Math.max(l,Math.min(1,e[p]??l))}return R}function Qe(){return t.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:[t.jsx("path",{d:"M12 19V5"}),t.jsx("path",{d:"m5 12 7-7 7 7"})]})}function Xe(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})})}function Ze(){return t.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:t.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 he(e,n){e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,n)}px`}function et(e){return e.tone==="error"?"Voice":e.state==="recording"?"Listening":e.state==="processing"?"Transcribing":e.state==="starting"?"Starting":"Voice"}function lt({renderWhenEmbedded:e=!1,...n}){return Ae()&&!e?null:t.jsx(tt,{...n})}function tt({value:e,onChange:n,onSend:l,placeholder:R="Type a message…",disabled:d=!1,sending:p=!1,canSend:u,stopMode:g=!1,onStop:H,sendTitle:k="Send (Cmd+Enter)",sendAriaLabel:b="Send message (Cmd+Enter)",stopAriaLabel:q="Stop agent",showDictation:v=!0,onDictationStatusChange:h,onDictationCommit:w,showAttach:X=!1,onAttach:_,attachTitle:Z="Add attachment",attachAriaLabel:D="Add attachment",onPaste:ne,dropHandlers:F,dragActive:N=!1,secondaryAction:B,leadingTools:L,tools:U,footer:oe,header:E,above:S,aboveAttached:j=!1,input:ee,overlay:A,status:$,textareaRef:K,onKeyDown:te,sendOnEnter:re=!1,onSelect:ce,onBlur:y,density:x="panel",as:P="form",className:Y,rows:se=1,autoResize:W=!0,maxHeightPx:G=160,"aria-label":ie="Message"}){const J=s.useRef(null),[r,i]=s.useState(null),[c,f]=s.useState(!1),[C,a]=s.useState(null),z=s.useCallback(o=>{J.current=o,K&&(K.current=o)},[K]);s.useEffect(()=>{if(!W)return;const o=J.current;o&&he(o,G)},[e,W,G]);const I=(u??e.trim().length>0)&&!p&&!d,m=U??oe,V=r?.state==="recording"||r?.state==="starting",T=r?.state==="processing",xe=!!(r&&(r.tone==="error"||V||T||r.partial&&r.partial.trim())),ae=s.useCallback(()=>{g||!(u??e.trim().length>0)||p||d||l()},[u,d,l,p,g,e]),Se=o=>{o.preventDefault(),ae()},we=o=>{if(te?.(o)){o.preventDefault();return}if(Oe(o,re)){o.preventDefault(),ae();return}},je=o=>{const O=o.target.value;n(O,{caret:o.target.selectionStart??O.length}),W&&he(o.target,G)},ye=o=>{const O=e.trim()?`${e.trimEnd()} ${o}`:o;if(n(O,{caret:O.length}),w){w(O);return}requestAnimationFrame(()=>J.current?.focus())},Ce=s.useCallback(o=>{i(o),o.issue||a(null),h?.(o)},[h]),le=["s-msg-compose",`s-msg-compose--${x}`,x==="thread"?"s-thread-compose":"",Y??""].filter(Boolean).join(" "),ke=["s-msg-compose-shell",x==="thread"?"s-thread-compose-shell":""].filter(Boolean).join(" "),Ne=["s-msg-compose-input",x==="thread"?"s-thread-compose-input":""].filter(Boolean).join(" "),ue=["s-msg-compose-send",x==="thread"?"s-thread-compose-send":"",g?"s-msg-compose-send--agent-stop s-thread-compose-send--stop":""].filter(Boolean).join(" "),Ee=["s-msg-compose-voice",r?.tone==="recording"||V?"s-msg-compose-voice--recording":"",r?.tone==="processing"||T?"s-msg-compose-voice--processing":"",r?.tone==="error"?"s-msg-compose-voice--error":""].filter(Boolean).join(" "),{navigate:Me}=Fe(),Q=r?.tone==="error",Re=r?.partial?.trim()||null,M=Q?r?.issue??null:null,de=Q?r?.message:T?"Finalizing transcript…":Re,Le=t.jsxs("div",{className:ke,"data-drag-active":N?"true":void 0,...F,children:[E?t.jsx("div",{className:"s-msg-compose-header",children:E}):null,t.jsxs("div",{className:"s-msg-compose-body",children:[ee??t.jsx("textarea",{ref:z,className:Ne,placeholder:R,value:e,disabled:d,rows:se,"aria-label":ie,onChange:je,onKeyDown:we,onSelect:ce,onBlur:y,onPaste:ne}),xe?t.jsxs("div",{className:Ee,role:Q?"alert":"status","aria-live":Q?"assertive":"polite",children:[!Q&&(V||T)?t.jsx(Ge,{samples:r?.levels,active:V,processing:T}):null,t.jsxs("div",{className:"s-msg-compose-voice-meta",children:[t.jsx("span",{className:"s-msg-compose-voice-label",children:r?et(r):"Voice"}),M?t.jsxs("span",{className:"s-msg-compose-voice-issue",children:[t.jsx("span",{className:"s-msg-compose-voice-issue-title",children:M.title}),M.hint?t.jsx("span",{className:"s-msg-compose-voice-issue-hint",children:M.hint}):null,M.action!=="none"&&M.actionLabel?t.jsx("button",{type:"button",className:"s-msg-compose-voice-issue-action",disabled:c,onClick:()=>{a(null),M.action==="open_voice_settings"?Me({view:"settings",section:"voice"}):(f(!0),Ie(M.action).catch(o=>a(o instanceof Error?o.message:String(o))).finally(()=>f(!1)))},children:M.actionLabel}):null,C?t.jsx("span",{children:C}):null]}):de?t.jsx("span",{className:"s-msg-compose-voice-text",children:de}):null]})]}):null]}),t.jsxs("div",{className:["s-msg-compose-toolbar",x==="thread"?"s-thread-compose-footer":""].filter(Boolean).join(" "),children:[t.jsxs("div",{className:"s-msg-compose-toolbar-start",children:[L,X?t.jsx("button",{type:"button",className:"s-msg-compose-icon-btn",title:Z,"aria-label":D,disabled:d||p,onClick:_,children:t.jsx(Ze,{})}):L?null:t.jsx("span",{className:"s-msg-compose-toolbar-spacer","aria-hidden":"true"})]}),t.jsxs("div",{className:"s-msg-compose-toolbar-end",children:[m?t.jsx("div",{className:"s-msg-compose-tools",children:m}):null,v?t.jsx(Ye,{onAppend:ye,onStatus:Ce,disabled:d||p}):null,B?t.jsx("div",{className:"s-msg-compose-secondary",children:B}):null,g?t.jsx("button",{type:"button",className:ue,onClick:H,title:q,"aria-label":q,children:t.jsx(Xe,{})}):t.jsx("button",{type:P==="form"?"submit":"button",className:ue,disabled:!I,title:k,"aria-label":b,"data-action":"send",onClick:P==="div"?()=>ae():void 0,children:t.jsx(Qe,{})})]})]}),$]}),me=t.jsxs("div",{className:"s-msg-compose-frame","data-above-attached":S&&j?"true":void 0,children:[A,S?t.jsx("div",{className:"s-msg-compose-above",children:S}):null,Le]});return P==="div"?t.jsx("div",{className:le,children:me}):t.jsx("form",{className:le,onSubmit:Se,children:me})}export{Ye as D,lt as M,ze as S,Ke as a,at as f,Oe as i};
1
+ import{r as s,j as t,T as Ae}from"./index-DReVb7jZ.js";import{g as Ve,e as _e,a as Be,b as fe,f as Pe,c as Te}from"./scout-voice-CqAyfblr.js";import{createLevelHistory as Ie,energyFromPartialDelta as pe,tryStartMicLevelMeter as qe,VOICE_WAVE_BARS as ve}from"./voice-levels-Dcr3jglk.js";import{L as De}from"./loader-circle-DNUsuPWz.js";import{c as be}from"./createLucideIcon-ChvMq-zl.js";import{ad as Fe}from"./router-C-MF5-mb.js";function at(e){if(!e)return null;const n=e.replace(/_/g," ");return n.toLowerCase()==="relay agent"?"agent":n}const $e=[["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"}]],Ke=be("mic",$e);const We=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],ze=be("square",We);function Oe(e,n=!1){return e.key==="Enter"&&!e.shiftKey&&(n||!!(e.metaKey||e.ctrlKey))&&!e.nativeEvent?.isComposing}function He(e){switch(e){case"starting":return"starting";case"recording":return"recording";case"processing":return"processing";default:return"idle"}}function Ue(e,n,l){if(l)return l;switch(e){case"starting":return"Starting voice…";case"recording":return n.trim()?n.trim():null;case"processing":return"Transcribing…";default:return null}}function ge(e){return new Promise(n=>window.setTimeout(n,e))}function Ye({onAppend:e,onError:n,onStatus:l,disabled:R,className:d}){const p=s.useRef(Ve()),u=s.useRef(null),g=s.useRef(Ie(ve)),H=s.useRef(null),k=s.useRef(!1),b=s.useRef(""),q=s.useRef(0),v=s.useRef(0),[h,w]=s.useState("idle"),[X,_]=s.useState(""),[Z,D]=s.useState("probing"),[ne,F]=s.useState(null),[N,B]=s.useState(null),[L,U]=s.useState(null),[oe,E]=s.useState(0),S=s.useCallback(()=>{v.current&&(window.cancelAnimationFrame(v.current),v.current=0),H.current?.stop(),H.current=null,k.current=!1},[]),j=s.useCallback(r=>{U(r),n?.(r)},[n]),ee=s.useCallback((r,i,c,f)=>{l?.({state:r,partial:i,message:Ue(r,i,c),tone:c?"error":r==="recording"?"recording":r==="processing"?"processing":"neutral",levels:r==="idle"&&!c?[]:g.current.snapshot(),levelsLive:k.current,issue:c?f:null})},[l]);s.useEffect(()=>{ee(h,X,L,N)},[ee,N,L,X,h,oe]);const A=s.useCallback(async(r=!1)=>{const i=p.current;D(f=>f==="launching"?f:"probing");const c=await i.probe(r?{force:!0}:void 0);return F(c),D("idle"),c},[]);s.useEffect(()=>{_e();const r=p.current,i=Be(c=>{F(c.ok),D("idle")});return r.connectionState==="unknown"?A():(F(r.connectionState==="connected"),B(null),D("idle")),()=>{i(),S();const c=u.current;c&&(c.cancel().catch(()=>{}),u.current=null)}},[A,S]);const $=s.useCallback(r=>{g.current.push(r),E(i=>i+1)},[]),K=s.useCallback(()=>{if(v.current)return;let r=performance.now();const i=c=>{if(c-r>=36){r=c;const f=c-(q.current||c),C=pe(b.current,b.current,f);g.current.push(Math.max(.05,C)),E(a=>a+1)}v.current=window.requestAnimationFrame(i)};v.current=window.requestAnimationFrame(i)},[]),te=s.useCallback(async()=>{const r=p.current;U(null),B(null),_(""),b.current="",q.current=performance.now(),g.current.clear(),E(a=>a+1),w("starting"),S();let i=await fe({surface:"chat-composer",requestPermissions:!0});if(!i.ready&&i.issue?.code==="microphone_not_requested"&&(await ge(1800),i=await fe({surface:"chat-composer"})),!(i.ready||i.issue?.code==="microphone_not_requested")){w("idle");const a=i.issue;a?(B(a),j(Pe(a))):j("Scout voice is not ready."),A(!0);return}B(null),F(!0);let f=null,C=!1;try{if(f=await r.startLive({onState:m=>w(He(m)),onPartial:m=>{const V=b.current;if(b.current=m,q.current=performance.now(),_(m),!k.current){const I=pe(V,m,0);$(I)}},onLevel:m=>{C=!0,k.current=!0,v.current&&(window.cancelAnimationFrame(v.current),v.current=0),$(m)}}),u.current=f,w("recording"),await ge(140),u.current&&!C&&!k.current){const m=await qe(V=>{C=!0,k.current=!0,v.current&&(window.cancelAnimationFrame(v.current),v.current=0),$(V)});m&&u.current?H.current=m:u.current&&!k.current&&(k.current=!1,K())}const a=await f.result;u.current=null,S(),w("idle");const z=b.current.trim();_(""),b.current="",U(null),g.current.clear(),E(m=>m+1);const T=a.text?.trim()||z;T?e(T):j("No speech was detected. Check your microphone in Settings → Voice."),A(!0)}catch(a){u.current=null,S(),w("idle");const z=b.current.trim();_(""),b.current="",g.current.clear(),E(m=>m+1);const T=a instanceof Error?a.message:"Scout voice recording failed.";if(z){e(z),a instanceof Error&&a.name==="AbortError"||j(`Recording ended early, but Scout recovered the partial transcript. ${T}`);return}if(a instanceof Error&&a.name==="AbortError")return;j(T),A(!0)}},[e,A,$,j,K,S]),re=s.useCallback(async()=>{const r=u.current;if(!r)return;w("processing"),S();const i=window.setInterval(()=>{g.current.decay(.82),E(c=>c+1)},50);window.setTimeout(()=>window.clearInterval(i),600);try{await r.stop()}catch(c){try{await r.cancel()}catch{}u.current=null,w("idle");const f=b.current.trim();_(""),b.current="",g.current.clear(),E(a=>a+1);const C=c instanceof Error?c.message:"Scout voice recording did not finish.";f?(e(f),j(`Recording ended early, but Scout recovered the partial transcript. ${C}`)):j(C)}},[e,j,S]),ce=s.useCallback(()=>{if(h==="recording"){re();return}h==="processing"||h==="starting"||te()},[h,te,re]),y=h==="recording",x=Z==="launching"||h==="starting"||h==="processing",P=(p.current.canRequestMicrophone||N?.action==="request_microphone"||N?.action==="request_speech")&&!y&&!x,Y=(p.current.isMicrophoneHardDenied||N?.action==="open_microphone_settings")&&!y&&!x,se=(ne===!1||N!==null)&&!P&&!Y&&!y&&!x,W=L||(N?N.title:Y?"Microphone blocked. Open Privacy & Security → Microphone to change it.":P?"Allow microphone access":se?"Scout voice is not ready":Z==="probing"?"Checking voice…":y?"Stop recording":h==="processing"?"Transcribing…":h==="starting"?"Starting voice…":"Start recording"),G=L?"s-dictation-mic--error":y?"s-dictation-mic--recording":Y?"s-dictation-mic--error":P?"s-dictation-mic--needs-permission":se?"s-dictation-mic--unavailable":x?"s-dictation-mic--busy":"",ie=x?De:y?ze:Ke,J=y?12:14;return t.jsx("button",{type:"button",title:W,"aria-label":W,"aria-pressed":y,onClick:ce,disabled:R||h==="processing",className:["s-dictation-mic",G,d].filter(Boolean).join(" "),children:t.jsx(ie,{size:J,className:x?"s-dictation-mic-spin":y?"fill-current":""})})}function Ge({samples:e,active:n,processing:l=!1,className:R}){const d=Je(e,ve,l?.06:.04),p=["s-msg-compose-wave",n?"s-msg-compose-wave--live":"",l?"s-msg-compose-wave--processing":"",R??""].filter(Boolean).join(" ");return t.jsx("div",{className:p,"aria-hidden":"true","data-wave-source":e&&e.length>0?"levels":"floor",children:d.map((u,g)=>t.jsx("span",{className:"s-msg-compose-wave-bar",style:{transform:`scaleY(${Math.max(.08,u)})`,opacity:l?.28+u*.35:n?.4+u*.55:.25}},g))})}function Je(e,n,l){if(!e||e.length===0)return Array.from({length:n},()=>l);if(e.length===n)return e.map(d=>Math.max(l,Math.min(1,d)));const R=new Array(n);for(let d=0;d<n;d+=1){const p=Math.min(e.length-1,Math.round(d/Math.max(1,n-1)*(e.length-1)));R[d]=Math.max(l,Math.min(1,e[p]??l))}return R}function Qe(){return t.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:[t.jsx("path",{d:"M12 19V5"}),t.jsx("path",{d:"m5 12 7-7 7 7"})]})}function Xe(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})})}function Ze(){return t.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:t.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 he(e,n){e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,n)}px`}function et(e){return e.tone==="error"?"Voice":e.state==="recording"?"Listening":e.state==="processing"?"Transcribing":e.state==="starting"?"Starting":"Voice"}function lt({renderWhenEmbedded:e=!1,...n}){return Ae()&&!e?null:t.jsx(tt,{...n})}function tt({value:e,onChange:n,onSend:l,placeholder:R="Type a message…",disabled:d=!1,sending:p=!1,canSend:u,stopMode:g=!1,onStop:H,sendTitle:k="Send (Cmd+Enter)",sendAriaLabel:b="Send message (Cmd+Enter)",stopAriaLabel:q="Stop agent",showDictation:v=!0,onDictationStatusChange:h,onDictationCommit:w,showAttach:X=!1,onAttach:_,attachTitle:Z="Add attachment",attachAriaLabel:D="Add attachment",onPaste:ne,dropHandlers:F,dragActive:N=!1,secondaryAction:B,leadingTools:L,tools:U,footer:oe,header:E,above:S,aboveAttached:j=!1,input:ee,overlay:A,status:$,textareaRef:K,onKeyDown:te,sendOnEnter:re=!1,onSelect:ce,onBlur:y,density:x="panel",as:P="form",className:Y,rows:se=1,autoResize:W=!0,maxHeightPx:G=160,"aria-label":ie="Message"}){const J=s.useRef(null),[r,i]=s.useState(null),[c,f]=s.useState(!1),[C,a]=s.useState(null),z=s.useCallback(o=>{J.current=o,K&&(K.current=o)},[K]);s.useEffect(()=>{if(!W)return;const o=J.current;o&&he(o,G)},[e,W,G]);const T=(u??e.trim().length>0)&&!p&&!d,m=U??oe,V=r?.state==="recording"||r?.state==="starting",I=r?.state==="processing",xe=!!(r&&(r.tone==="error"||V||I||r.partial&&r.partial.trim())),ae=s.useCallback(()=>{g||!(u??e.trim().length>0)||p||d||l()},[u,d,l,p,g,e]),Se=o=>{o.preventDefault(),ae()},we=o=>{if(te?.(o)){o.preventDefault();return}if(Oe(o,re)){o.preventDefault(),ae();return}},je=o=>{const O=o.target.value;n(O,{caret:o.target.selectionStart??O.length}),W&&he(o.target,G)},ye=o=>{const O=e.trim()?`${e.trimEnd()} ${o}`:o;if(n(O,{caret:O.length}),w){w(O);return}requestAnimationFrame(()=>J.current?.focus())},Ce=s.useCallback(o=>{i(o),o.issue||a(null),h?.(o)},[h]),le=["s-msg-compose",`s-msg-compose--${x}`,x==="thread"?"s-thread-compose":"",Y??""].filter(Boolean).join(" "),ke=["s-msg-compose-shell",x==="thread"?"s-thread-compose-shell":""].filter(Boolean).join(" "),Ne=["s-msg-compose-input",x==="thread"?"s-thread-compose-input":""].filter(Boolean).join(" "),ue=["s-msg-compose-send",x==="thread"?"s-thread-compose-send":"",g?"s-msg-compose-send--agent-stop s-thread-compose-send--stop":""].filter(Boolean).join(" "),Ee=["s-msg-compose-voice",r?.tone==="recording"||V?"s-msg-compose-voice--recording":"",r?.tone==="processing"||I?"s-msg-compose-voice--processing":"",r?.tone==="error"?"s-msg-compose-voice--error":""].filter(Boolean).join(" "),{navigate:Me}=Fe(),Q=r?.tone==="error",Re=r?.partial?.trim()||null,M=Q?r?.issue??null:null,de=Q?r?.message:I?"Finalizing transcript…":Re,Le=t.jsxs("div",{className:ke,"data-drag-active":N?"true":void 0,...F,children:[E?t.jsx("div",{className:"s-msg-compose-header",children:E}):null,t.jsxs("div",{className:"s-msg-compose-body",children:[ee??t.jsx("textarea",{ref:z,className:Ne,placeholder:R,value:e,disabled:d,rows:se,"aria-label":ie,onChange:je,onKeyDown:we,onSelect:ce,onBlur:y,onPaste:ne}),xe?t.jsxs("div",{className:Ee,role:Q?"alert":"status","aria-live":Q?"assertive":"polite",children:[!Q&&(V||I)?t.jsx(Ge,{samples:r?.levels,active:V,processing:I}):null,t.jsxs("div",{className:"s-msg-compose-voice-meta",children:[t.jsx("span",{className:"s-msg-compose-voice-label",children:r?et(r):"Voice"}),M?t.jsxs("span",{className:"s-msg-compose-voice-issue",children:[t.jsx("span",{className:"s-msg-compose-voice-issue-title",children:M.title}),M.hint?t.jsx("span",{className:"s-msg-compose-voice-issue-hint",children:M.hint}):null,M.action!=="none"&&M.actionLabel?t.jsx("button",{type:"button",className:"s-msg-compose-voice-issue-action",disabled:c,onClick:()=>{a(null),M.action==="open_voice_settings"?Me({view:"settings",section:"voice"}):(f(!0),Te(M.action).catch(o=>a(o instanceof Error?o.message:String(o))).finally(()=>f(!1)))},children:M.actionLabel}):null,C?t.jsx("span",{children:C}):null]}):de?t.jsx("span",{className:"s-msg-compose-voice-text",children:de}):null]})]}):null]}),t.jsxs("div",{className:["s-msg-compose-toolbar",x==="thread"?"s-thread-compose-footer":""].filter(Boolean).join(" "),children:[t.jsxs("div",{className:"s-msg-compose-toolbar-start",children:[L,X?t.jsx("button",{type:"button",className:"s-msg-compose-icon-btn",title:Z,"aria-label":D,disabled:d||p,onClick:_,children:t.jsx(Ze,{})}):L?null:t.jsx("span",{className:"s-msg-compose-toolbar-spacer","aria-hidden":"true"})]}),t.jsxs("div",{className:"s-msg-compose-toolbar-end",children:[m?t.jsx("div",{className:"s-msg-compose-tools",children:m}):null,v?t.jsx(Ye,{onAppend:ye,onStatus:Ce,disabled:d||p}):null,B?t.jsx("div",{className:"s-msg-compose-secondary",children:B}):null,g?t.jsx("button",{type:"button",className:ue,onClick:H,title:q,"aria-label":q,children:t.jsx(Xe,{})}):t.jsx("button",{type:P==="form"?"submit":"button",className:ue,disabled:!T,title:k,"aria-label":b,"data-action":"send",onClick:P==="div"?()=>ae():void 0,children:t.jsx(Qe,{})})]})]}),$]}),me=t.jsxs("div",{className:"s-msg-compose-frame","data-above-attached":S&&j?"true":void 0,children:[A,S?t.jsx("div",{className:"s-msg-compose-above",children:S}):null,Le]});return P==="div"?t.jsx("div",{className:le,children:me}):t.jsx("form",{className:le,onSubmit:Se,children:me})}export{Ye as D,lt as M,ze as S,Ke as a,at as f,Oe as i};
@@ -1 +1 @@
1
- import{B as a,D as l,E as n,G as r,r as m}from"./index-C8uS5szO.js";import{R as p,T as i,U as c,u as E,V as S}from"./router-BKiMcYa7.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 T(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 L(){return c(typeof window<"u"?window.location.pathname:"")}export{b as S,u as a,_ as b,d as c,T as d,L as i,A as s,P as u};
1
+ import{K as a,L as l,N as n,O as r,r as m}from"./index-DReVb7jZ.js";import{R as p,T as i,U as c,u as E,V as S}from"./router-C-MF5-mb.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 A}from"./index-C8uS5szO.js";import{b as q,p as N,V as U,D as $}from"./fx-z37u1o2z.js";function F(){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 j(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 H(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 G(){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 we(t){return t?t.hint?`${t.message} ${t.hint}`:t.message:"Scout voice is unavailable."}async function Se(t){switch(t){case"request_microphone":await _("microphone");return;case"request_speech":await _("speechRecognition");return;case"open_microphone_settings":await C("microphone");return;case"open_speech_settings":await C("speechRecognition");return;case"launch_host":await D().launch({source:"openscout"});return;case"open_voice_settings":case"none":return}}async function ge(t={}){const e=await fetch("/api/voice/engage",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(e.status===404)return z(t);if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(y(n,e.status))}return await e.json()}async function z(t={}){const e=await he(),n=e.settings,i=e.devices,r=i.length>0||(n.permissions?.length??0)>0,o=n.permissions?.find(w=>w.kind==="microphone")??null,s=n.permissions?.find(w=>w.kind==="speechRecognition")??null,u=B(n,i);if(t.requestPermissions&&(o&&!o.granted&&o.status!=="restricted"?await _("microphone").catch(()=>{}):(o?.granted??!1)&&s&&!s.granted&&s.status!=="restricted"&&await _("speechRecognition").catch(()=>{})),!r)return{ready:!1,issue:F(),warnings:[],settings:n,devices:i,inputDevice:null,hostOnline:!1};const h=j(o);if(h)return{ready:!1,issue:h,warnings:[],settings:n,devices:i,inputDevice:u,hostOnline:r};if(!u)return{ready:!1,issue:G(),warnings:[],settings:n,devices:i,inputDevice:null,hostOnline:r};const d=H(s);return{ready:!0,issue:null,warnings:d?[d]:[],settings:n,devices:i,inputDevice:u,hostOnline:r}}function B(t,e){if(e.length===0)return null;const n=t.inputDeviceId?e.find(o=>o.id===t.inputDeviceId):null,i=e.find(o=>o.isDefault)??e[0]??null,r=n??i;return r?{id:r.id,name:r.name}:null}function J(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 W=6e4,X=3e3,K=2e4,Q=8e3,Y=45e3;let T=null,E=null,l=null,P=!1;const R=new Set;function Z(){return typeof window>"u"?!1:typeof fetch=="function"}function D(){return T||(T=new ee),T}function ve(t){return R.add(t),l&&t(l),()=>{R.delete(t)}}function ye(){if(P||!Z())return;P=!0;const t=D();t.probe();const e=()=>{t.probeIfStale()};window.addEventListener("focus",e),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function O(t){for(const e of R)e(t)}function L(t,e=Date.now()){const n=t.ok?K:Q;return e-t.probedAt<n}class ee{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 l&&L(l,e)?(this.applyProbeSnapshot(l),l.ok):l&&l.ok&&e-l.probedAt<Y?(this.applyProbeSnapshot(l),!0):l&&!l.ok?this.probe({force:!0}):this.probe()}async probe(e={}){const n=typeof e=="number"?{timeoutMs:e}:e,i=n.force??!1,r=n.timeoutMs??X,o=Date.now();return!i&&l&&L(l,o)?(this.applyProbeSnapshot(l),l.ok):E||(this.state="probing",E=this.fetchProbe(r).finally(()=>{E=null}),E)}async fetchProbe(e){const n=new AbortController,i=window.setTimeout(()=>n.abort(),e);try{const r=await fetch("/api/voice/health?quiet=1",{signal:n.signal}),o=await r.json().catch(()=>({})),s=!!o.host?.hostId,u=typeof o.microphoneGranted=="boolean"?o.microphoneGranted:null,h=typeof o.microphoneCanRequest=="boolean"?o.microphoneCanRequest:null,d=typeof o.inputDevice?.name=="string"&&o.inputDevice.name.trim()?o.inputDevice.name.trim():null,w=o.capture==="browser"?"browser":"native",S=r.ok&&o.ok===!0,v=S?null:o.detail??o.error??(s?"Scout voice is not ready.":"Scout voice service is unavailable."),f={ok:S,reason:v,captureMode:S?w:null,hostReachable:s,microphoneGranted:u,microphoneCanRequest:h,inputDeviceName:d,probedAt:Date.now()};return l=f,this.applyProbeSnapshot(f),O(f),S}catch(r){const s={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 l=s,this.applyProbeSnapshot(s),O(s),!1}finally{window.clearTimeout(i)}}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 te(e,n):await ne(e)}}async function te(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(y(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,s,u;const h=new Promise((a,p)=>{s=a,u=p});let d=null;const w=()=>{d&&window.clearTimeout(d),d=window.setTimeout(()=>{v(new Error("Scout voice transcription timed out. Try again or check voice settings."))},W)},S=()=>{d&&(window.clearTimeout(d),d=null)},v=(a,p="error")=>{o||(o=!0,S(),m.close(),t.onState?.(p),u(a))},f=a=>{o||(o=!0,S(),m.close(),t.onFinal?.(a),t.onState?.("done"),s(a))},m=new EventSource(`/api/voice/session/${encodeURIComponent(r)}/events`),c=a=>p=>{if(o)return;let g={};try{g=JSON.parse(p.data)}catch{return}if(a==="session.partial"){const b=typeof g.text=="string"?g.text:"";t.onPartial?.(b);return}if(a==="session.state"){const b=oe(g.state);b&&(t.onState?.(b),b==="processing"&&w());return}if(a==="session.final"){f({sessionId:r,text:typeof g.text=="string"?g.text.trim():"",durationMs:Number(g.durationMs??0)});return}if(a==="session.cancelled"){v(M(),"cancelled");return}if(a==="session.error"){const b=typeof g.message=="string"?g.message:"Scout voice session failed.",x=typeof g.code=="string"?g.code:null;v(new Error(J(b,x)))}};return m.addEventListener("session.started",()=>{t.onState?.("starting")}),m.addEventListener("session.state",c("session.state")),m.addEventListener("session.partial",c("session.partial")),m.addEventListener("session.final",c("session.final")),m.addEventListener("session.cancelled",c("session.cancelled")),m.addEventListener("session.error",c("session.error")),m.onerror=()=>{o||v(new Error("Scout voice event stream disconnected."))},{get sessionId(){return r},result:h,stop:async()=>{t.onState?.("processing"),w();const a=await fetch(`/api/voice/session/${encodeURIComponent(r)}/stop`,{method:"POST"});if(!a.ok){const p=await a.text().catch(()=>"");throw new Error(y(p,a.status))}},cancel:async()=>{o=!0,S(),m.close();const a=await fetch(`/api/voice/session/${encodeURIComponent(r)}/cancel`,{method:"POST"});if(!a.ok){const p=await a.text().catch(()=>"");throw new Error(y(p,a.status))}t.onState?.("cancelled"),u(M())}}}async function ne(t={}){if(typeof MediaRecorder>"u"||!navigator.mediaDevices?.getUserMedia)throw new Error("Scout voice capture is unavailable in this browser.");const{startStreamLevelMeter:e}=await A(async()=>{const{startStreamLevelMeter:c}=await import("./voice-levels-Dcr3jglk.js");return{startStreamLevelMeter:c}},[]),n=pe(),i=[];let r=null,o=null,s=null,u=!1,h=!1,d,w;const S=new Promise((c,a)=>{d=c,w=a}),v=()=>{s?.stop(),s=null;for(const c of r?.getTracks()??[])c.stop();r=null},f=(c,a="error")=>{h||(h=!0,v(),t.onState?.(a),w(c))},m=async()=>{if(h)return;if(v(),u){f(M(),"cancelled");return}t.onState?.("processing");const c=o?.mimeType||V()||"application/octet-stream",a=new Blob(i,{type:c});if(a.size===0){f(new Error("No voice audio was captured."));return}try{const p=await ae(a,{sessionId:n});if(h)return;h=!0,t.onFinal?.(p),t.onState?.("done"),d(p)}catch(p){f(p instanceof Error?p:new Error(String(p)))}};try{t.onState?.("starting"),r=await navigator.mediaDevices.getUserMedia({audio:!0}),t.onLevel&&(s=e(r,t.onLevel));const c=V();o=new MediaRecorder(r,c?{mimeType:c}:void 0),o.addEventListener("dataavailable",a=>{a.data.size>0&&i.push(a.data)}),o.addEventListener("error",()=>{f(new Error("Scout voice recorder failed."))}),o.addEventListener("stop",()=>{m()},{once:!0}),o.start(),t.onPartial?.(""),t.onState?.("recording")}catch(c){const a=c instanceof Error?c:new Error(String(c));throw f(a),S.catch(()=>{}),a}return{get sessionId(){return n},result:S,stop:async()=>{!o||o.state==="inactive"||o.stop()},cancel:async()=>{if(u=!0,o&&o.state!=="inactive"){o.stop();return}f(M(),"cancelled")}}}function oe(t){return t==="starting"||t==="recording"||t==="processing"||t==="done"||t==="cancelled"||t==="error"?t:null}function y(t,e){try{return JSON.parse(t).error??`Scout voice returned HTTP ${e}`}catch{return t||`Scout voice returned HTTP ${e}`}}function be(t){return t instanceof Error&&t.name==="AbortError"}async function k(t,e={}){const n={text:t,speed:le(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 i=await fetch("/api/voice/speak",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n),signal:e.signal});if(!i.ok){const r=await i.text().catch(()=>"");try{const o=JSON.parse(r);throw new Error(o.error??`Scout voice returned HTTP ${i.status}`)}catch(o){throw o instanceof SyntaxError?new Error(r||`Scout voice returned HTTP ${i.status}`):o}}return await i.json()}async function Ee(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 Me(t,e,n){if(t.voices.find(s=>s.id===n&&s.modelId===e))return{modelId:e,voiceId:n};const r=t.voices.filter(s=>s.modelId===e),o=r.find(s=>s.isDefault&&s.available!==!1)??r.find(s=>s.available!==!1)??r[0];return{modelId:e,voiceId:o?.id??n}}async function re(t,e={}){if(e.signal?.aborted)throw I();if(t.playedOnHost)return e.onPlaybackStart?.(),t;const n=new Audio(`data:${t.contentType};base64,${t.audioBase64}`),i=()=>{n.pause(),n.currentTime=0};e.signal?.addEventListener("abort",i,{once:!0}),await n.play(),e.onPlaybackStart?.();try{return await new Promise((r,o)=>{const s=()=>{n.removeEventListener("ended",u),n.removeEventListener("error",h),e.signal?.removeEventListener("abort",d)},u=()=>{s(),r()},h=()=>{s(),o(new Error("Scout voice playback failed."))},d=()=>{s(),o(I())};if(e.signal?.aborted){d();return}n.addEventListener("ended",u,{once:!0}),n.addEventListener("error",h,{once:!0}),e.signal?.addEventListener("abort",d,{once:!0})}),t}finally{e.signal?.removeEventListener("abort",i)}}async function ie(t,e={}){const n=await k(t,e);return await re(n,{signal:e.signal})}function _e(t,e={}){const n=new AbortController;return{promise:ie(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function se(t,e={}){const n=await k(t,e);if(e.signal?.aborted)throw I();if(n.playedOnHost)return n;const i=await q(n.audioBase64,n.contentType),r=de(e.presetId,e.params);return await N(i,{params:r,signal:e.signal}).promise,n}function Te(t,e={}){const n=new AbortController;return{promise:se(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function ae(t,e){const n=new FormData,i=ce(t.type);n.append("audio",t,`audio.${ue(t.type)}`),n.append("sessionId",e.sessionId),i&&n.append("format",i);const r=await fetch("/api/voice/transcribe",{method:"POST",body:n});if(!r.ok){const s=await r.text().catch(()=>"");try{const u=JSON.parse(s);throw new Error(u.error??`Scout voice returned HTTP ${r.status}`)}catch(u){throw u instanceof SyntaxError?new Error(s||`Scout voice returned HTTP ${r.status}`):u}}const o=await r.json();return{sessionId:e.sessionId,text:o.text?.trim()??"",durationMs:Number(o.durationMs??0)}}function I(){const t=new Error("Speech stopped.");return t.name="AbortError",t}function M(){const t=new Error("Voice recording was cancelled.");return t.name="AbortError",t}function V(){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 ce(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 ue(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 de(t,e){const n=t?U.find(i=>i.id===t)?.params:void 0;return{...$,...n??{},...e??{}}}function le(t){if(!(t===void 0||!Number.isFinite(t)))return Math.min(2,Math.max(.5,Number(t.toFixed(2))))}function pe(){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 he(){const t=await fetch("/api/voice/settings");if(!t.ok){const e=await t.text().catch(()=>"");throw new Error(y(e,t.status))}return await t.json()}async function C(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(y(n,e.status))}}async function _(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(y(n,e.status))}}async function Re(t=12){const e=await fetch(`/api/voice/history?limit=${t}`);if(!e.ok){const i=await e.text().catch(()=>"");throw new Error(y(i,e.status))}return(await e.json()).sessions??[]}async function Ie(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(y(n,e.status))}return await e.json()}export{ve as a,ge as b,Se as c,Te as d,ye as e,we as f,D as g,Ee as h,be as i,Me as j,re as k,he as l,Re as m,Ie as n,C as o,k as p,_ as r,_e as s};
1
+ import{_ as A}from"./index-DReVb7jZ.js";import{b as q,p as N,V as U,D as $}from"./fx-z37u1o2z.js";function F(){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 j(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 H(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 G(){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 we(t){return t?t.hint?`${t.message} ${t.hint}`:t.message:"Scout voice is unavailable."}async function Se(t){switch(t){case"request_microphone":await _("microphone");return;case"request_speech":await _("speechRecognition");return;case"open_microphone_settings":await C("microphone");return;case"open_speech_settings":await C("speechRecognition");return;case"launch_host":await D().launch({source:"openscout"});return;case"open_voice_settings":case"none":return}}async function ge(t={}){const e=await fetch("/api/voice/engage",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(e.status===404)return z(t);if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(y(n,e.status))}return await e.json()}async function z(t={}){const e=await he(),n=e.settings,i=e.devices,r=i.length>0||(n.permissions?.length??0)>0,o=n.permissions?.find(w=>w.kind==="microphone")??null,s=n.permissions?.find(w=>w.kind==="speechRecognition")??null,u=B(n,i);if(t.requestPermissions&&(o&&!o.granted&&o.status!=="restricted"?await _("microphone").catch(()=>{}):(o?.granted??!1)&&s&&!s.granted&&s.status!=="restricted"&&await _("speechRecognition").catch(()=>{})),!r)return{ready:!1,issue:F(),warnings:[],settings:n,devices:i,inputDevice:null,hostOnline:!1};const h=j(o);if(h)return{ready:!1,issue:h,warnings:[],settings:n,devices:i,inputDevice:u,hostOnline:r};if(!u)return{ready:!1,issue:G(),warnings:[],settings:n,devices:i,inputDevice:null,hostOnline:r};const d=H(s);return{ready:!0,issue:null,warnings:d?[d]:[],settings:n,devices:i,inputDevice:u,hostOnline:r}}function B(t,e){if(e.length===0)return null;const n=t.inputDeviceId?e.find(o=>o.id===t.inputDeviceId):null,i=e.find(o=>o.isDefault)??e[0]??null,r=n??i;return r?{id:r.id,name:r.name}:null}function J(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 W=6e4,X=3e3,K=2e4,Q=8e3,Y=45e3;let T=null,E=null,l=null,P=!1;const R=new Set;function Z(){return typeof window>"u"?!1:typeof fetch=="function"}function D(){return T||(T=new ee),T}function ve(t){return R.add(t),l&&t(l),()=>{R.delete(t)}}function ye(){if(P||!Z())return;P=!0;const t=D();t.probe();const e=()=>{t.probeIfStale()};window.addEventListener("focus",e),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function O(t){for(const e of R)e(t)}function L(t,e=Date.now()){const n=t.ok?K:Q;return e-t.probedAt<n}class ee{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 l&&L(l,e)?(this.applyProbeSnapshot(l),l.ok):l&&l.ok&&e-l.probedAt<Y?(this.applyProbeSnapshot(l),!0):l&&!l.ok?this.probe({force:!0}):this.probe()}async probe(e={}){const n=typeof e=="number"?{timeoutMs:e}:e,i=n.force??!1,r=n.timeoutMs??X,o=Date.now();return!i&&l&&L(l,o)?(this.applyProbeSnapshot(l),l.ok):E||(this.state="probing",E=this.fetchProbe(r).finally(()=>{E=null}),E)}async fetchProbe(e){const n=new AbortController,i=window.setTimeout(()=>n.abort(),e);try{const r=await fetch("/api/voice/health?quiet=1",{signal:n.signal}),o=await r.json().catch(()=>({})),s=!!o.host?.hostId,u=typeof o.microphoneGranted=="boolean"?o.microphoneGranted:null,h=typeof o.microphoneCanRequest=="boolean"?o.microphoneCanRequest:null,d=typeof o.inputDevice?.name=="string"&&o.inputDevice.name.trim()?o.inputDevice.name.trim():null,w=o.capture==="browser"?"browser":"native",S=r.ok&&o.ok===!0,v=S?null:o.detail??o.error??(s?"Scout voice is not ready.":"Scout voice service is unavailable."),f={ok:S,reason:v,captureMode:S?w:null,hostReachable:s,microphoneGranted:u,microphoneCanRequest:h,inputDeviceName:d,probedAt:Date.now()};return l=f,this.applyProbeSnapshot(f),O(f),S}catch(r){const s={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 l=s,this.applyProbeSnapshot(s),O(s),!1}finally{window.clearTimeout(i)}}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 te(e,n):await ne(e)}}async function te(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(y(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,s,u;const h=new Promise((a,p)=>{s=a,u=p});let d=null;const w=()=>{d&&window.clearTimeout(d),d=window.setTimeout(()=>{v(new Error("Scout voice transcription timed out. Try again or check voice settings."))},W)},S=()=>{d&&(window.clearTimeout(d),d=null)},v=(a,p="error")=>{o||(o=!0,S(),m.close(),t.onState?.(p),u(a))},f=a=>{o||(o=!0,S(),m.close(),t.onFinal?.(a),t.onState?.("done"),s(a))},m=new EventSource(`/api/voice/session/${encodeURIComponent(r)}/events`),c=a=>p=>{if(o)return;let g={};try{g=JSON.parse(p.data)}catch{return}if(a==="session.partial"){const b=typeof g.text=="string"?g.text:"";t.onPartial?.(b);return}if(a==="session.state"){const b=oe(g.state);b&&(t.onState?.(b),b==="processing"&&w());return}if(a==="session.final"){f({sessionId:r,text:typeof g.text=="string"?g.text.trim():"",durationMs:Number(g.durationMs??0)});return}if(a==="session.cancelled"){v(M(),"cancelled");return}if(a==="session.error"){const b=typeof g.message=="string"?g.message:"Scout voice session failed.",x=typeof g.code=="string"?g.code:null;v(new Error(J(b,x)))}};return m.addEventListener("session.started",()=>{t.onState?.("starting")}),m.addEventListener("session.state",c("session.state")),m.addEventListener("session.partial",c("session.partial")),m.addEventListener("session.final",c("session.final")),m.addEventListener("session.cancelled",c("session.cancelled")),m.addEventListener("session.error",c("session.error")),m.onerror=()=>{o||v(new Error("Scout voice event stream disconnected."))},{get sessionId(){return r},result:h,stop:async()=>{t.onState?.("processing"),w();const a=await fetch(`/api/voice/session/${encodeURIComponent(r)}/stop`,{method:"POST"});if(!a.ok){const p=await a.text().catch(()=>"");throw new Error(y(p,a.status))}},cancel:async()=>{o=!0,S(),m.close();const a=await fetch(`/api/voice/session/${encodeURIComponent(r)}/cancel`,{method:"POST"});if(!a.ok){const p=await a.text().catch(()=>"");throw new Error(y(p,a.status))}t.onState?.("cancelled"),u(M())}}}async function ne(t={}){if(typeof MediaRecorder>"u"||!navigator.mediaDevices?.getUserMedia)throw new Error("Scout voice capture is unavailable in this browser.");const{startStreamLevelMeter:e}=await A(async()=>{const{startStreamLevelMeter:c}=await import("./voice-levels-Dcr3jglk.js");return{startStreamLevelMeter:c}},[]),n=pe(),i=[];let r=null,o=null,s=null,u=!1,h=!1,d,w;const S=new Promise((c,a)=>{d=c,w=a}),v=()=>{s?.stop(),s=null;for(const c of r?.getTracks()??[])c.stop();r=null},f=(c,a="error")=>{h||(h=!0,v(),t.onState?.(a),w(c))},m=async()=>{if(h)return;if(v(),u){f(M(),"cancelled");return}t.onState?.("processing");const c=o?.mimeType||V()||"application/octet-stream",a=new Blob(i,{type:c});if(a.size===0){f(new Error("No voice audio was captured."));return}try{const p=await ae(a,{sessionId:n});if(h)return;h=!0,t.onFinal?.(p),t.onState?.("done"),d(p)}catch(p){f(p instanceof Error?p:new Error(String(p)))}};try{t.onState?.("starting"),r=await navigator.mediaDevices.getUserMedia({audio:!0}),t.onLevel&&(s=e(r,t.onLevel));const c=V();o=new MediaRecorder(r,c?{mimeType:c}:void 0),o.addEventListener("dataavailable",a=>{a.data.size>0&&i.push(a.data)}),o.addEventListener("error",()=>{f(new Error("Scout voice recorder failed."))}),o.addEventListener("stop",()=>{m()},{once:!0}),o.start(),t.onPartial?.(""),t.onState?.("recording")}catch(c){const a=c instanceof Error?c:new Error(String(c));throw f(a),S.catch(()=>{}),a}return{get sessionId(){return n},result:S,stop:async()=>{!o||o.state==="inactive"||o.stop()},cancel:async()=>{if(u=!0,o&&o.state!=="inactive"){o.stop();return}f(M(),"cancelled")}}}function oe(t){return t==="starting"||t==="recording"||t==="processing"||t==="done"||t==="cancelled"||t==="error"?t:null}function y(t,e){try{return JSON.parse(t).error??`Scout voice returned HTTP ${e}`}catch{return t||`Scout voice returned HTTP ${e}`}}function be(t){return t instanceof Error&&t.name==="AbortError"}async function k(t,e={}){const n={text:t,speed:le(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 i=await fetch("/api/voice/speak",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n),signal:e.signal});if(!i.ok){const r=await i.text().catch(()=>"");try{const o=JSON.parse(r);throw new Error(o.error??`Scout voice returned HTTP ${i.status}`)}catch(o){throw o instanceof SyntaxError?new Error(r||`Scout voice returned HTTP ${i.status}`):o}}return await i.json()}async function Ee(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 Me(t,e,n){if(t.voices.find(s=>s.id===n&&s.modelId===e))return{modelId:e,voiceId:n};const r=t.voices.filter(s=>s.modelId===e),o=r.find(s=>s.isDefault&&s.available!==!1)??r.find(s=>s.available!==!1)??r[0];return{modelId:e,voiceId:o?.id??n}}async function re(t,e={}){if(e.signal?.aborted)throw I();if(t.playedOnHost)return e.onPlaybackStart?.(),t;const n=new Audio(`data:${t.contentType};base64,${t.audioBase64}`),i=()=>{n.pause(),n.currentTime=0};e.signal?.addEventListener("abort",i,{once:!0}),await n.play(),e.onPlaybackStart?.();try{return await new Promise((r,o)=>{const s=()=>{n.removeEventListener("ended",u),n.removeEventListener("error",h),e.signal?.removeEventListener("abort",d)},u=()=>{s(),r()},h=()=>{s(),o(new Error("Scout voice playback failed."))},d=()=>{s(),o(I())};if(e.signal?.aborted){d();return}n.addEventListener("ended",u,{once:!0}),n.addEventListener("error",h,{once:!0}),e.signal?.addEventListener("abort",d,{once:!0})}),t}finally{e.signal?.removeEventListener("abort",i)}}async function ie(t,e={}){const n=await k(t,e);return await re(n,{signal:e.signal})}function _e(t,e={}){const n=new AbortController;return{promise:ie(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function se(t,e={}){const n=await k(t,e);if(e.signal?.aborted)throw I();if(n.playedOnHost)return n;const i=await q(n.audioBase64,n.contentType),r=de(e.presetId,e.params);return await N(i,{params:r,signal:e.signal}).promise,n}function Te(t,e={}){const n=new AbortController;return{promise:se(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function ae(t,e){const n=new FormData,i=ce(t.type);n.append("audio",t,`audio.${ue(t.type)}`),n.append("sessionId",e.sessionId),i&&n.append("format",i);const r=await fetch("/api/voice/transcribe",{method:"POST",body:n});if(!r.ok){const s=await r.text().catch(()=>"");try{const u=JSON.parse(s);throw new Error(u.error??`Scout voice returned HTTP ${r.status}`)}catch(u){throw u instanceof SyntaxError?new Error(s||`Scout voice returned HTTP ${r.status}`):u}}const o=await r.json();return{sessionId:e.sessionId,text:o.text?.trim()??"",durationMs:Number(o.durationMs??0)}}function I(){const t=new Error("Speech stopped.");return t.name="AbortError",t}function M(){const t=new Error("Voice recording was cancelled.");return t.name="AbortError",t}function V(){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 ce(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 ue(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 de(t,e){const n=t?U.find(i=>i.id===t)?.params:void 0;return{...$,...n??{},...e??{}}}function le(t){if(!(t===void 0||!Number.isFinite(t)))return Math.min(2,Math.max(.5,Number(t.toFixed(2))))}function pe(){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 he(){const t=await fetch("/api/voice/settings");if(!t.ok){const e=await t.text().catch(()=>"");throw new Error(y(e,t.status))}return await t.json()}async function C(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(y(n,e.status))}}async function _(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(y(n,e.status))}}async function Re(t=12){const e=await fetch(`/api/voice/history?limit=${t}`);if(!e.ok){const i=await e.text().catch(()=>"");throw new Error(y(i,e.status))}return(await e.json()).sessions??[]}async function Ie(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(y(n,e.status))}return await e.json()}export{ve as a,ge as b,Se as c,Ee as d,ye as e,we as f,D as g,Me as h,re as i,be as j,he as k,Te as l,Re as m,Ie as n,C as o,k as p,_ as r,_e as s};
@@ -1,4 +1,4 @@
1
- import{j as i,r as p}from"./index-C8uS5szO.js";import{u as m}from"./Provider-5Hotn7NQ.js";import{a as x}from"./api-CaROe5_H.js";import{E as g}from"./external-link-RT4Ph-6-.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-DReVb7jZ.js";import{u as m}from"./Provider-CNZluAZb.js";import{a as x}from"./api-DSqpVKC7.js";import{E as g}from"./external-link-BVccgH0n.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-DkjnzvcJ.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-ChvMq-zl.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-DkjnzvcJ.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-ChvMq-zl.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
+ .s-secondary-nav{display:flex;align-items:center;justify-content:safe center;gap:var(--space-sm);min-width:0;max-width:100%;overflow-x:auto;scrollbar-width:none;padding:0 var(--space-xs)}.s-secondary-nav-shell{display:flex;flex:1 1 auto;flex-direction:column;height:100%;min-height:0;background:var(--bg)}.s-secondary-nav-bar{flex:none;min-height:44px;display:flex;align-items:center;justify-content:safe center;padding:0 var(--space-md);border-bottom:1px solid var(--border);background:color-mix(in srgb,var(--surface) 52%,transparent)}.s-secondary-nav-body{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;overflow:hidden}.s-secondary-nav-body>*{flex:1 1 auto;min-height:0}.s-secondary-nav-body--scroll{overflow:auto}.s-secondary-nav::-webkit-scrollbar{display:none}.s-secondary-nav-group{flex:none;display:inline-flex;align-items:center;gap:var(--space-2xs);min-width:0}.s-secondary-nav-label{font-family:var(--font-mono);font-size:var(--text-2xs);letter-spacing:var(--tracking-lg);text-transform:uppercase;color:var(--dim);opacity:.7;white-space:nowrap}.s-secondary-nav-switch{display:inline-flex;align-items:center;gap:var(--space-3xs);padding:var(--space-3xs);border:1px solid color-mix(in srgb,var(--border) 78%,transparent);border-radius:var(--radius-sm);background:linear-gradient(180deg,color-mix(in srgb,var(--surface) 82%,transparent),transparent),color-mix(in srgb,var(--bg) 68%,transparent);box-shadow:inset 0 1px color-mix(in srgb,white 5%,transparent)}.s-secondary-nav-button{flex:none;min-height:24px;padding:var(--space-3xs) var(--space-md);border:0;border-radius:calc(var(--radius-sm) - 2px);background:transparent;color:var(--dim);cursor:pointer;font-family:var(--font-mono);font-size:var(--text-xs);letter-spacing:var(--tracking-md);line-height:var(--leading-none);white-space:nowrap;transition:background .12s,color .12s,box-shadow .12s}.s-secondary-nav-button:hover{color:var(--ink);background:color-mix(in srgb,var(--ink) 5%,transparent)}.s-secondary-nav-button--active{background:color-mix(in srgb,var(--accent) 90%,white 4%);color:var(--bg);box-shadow:inset 0 1px color-mix(in srgb,white 16%,transparent),0 0 0 1px color-mix(in srgb,var(--accent) 52%,transparent)}
@@ -0,0 +1 @@
1
+ import{a,b as o}from"./nav-destinations-CU_euC-Q.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-C8uS5szO.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-DReVb7jZ.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-DkjnzvcJ.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-ChvMq-zl.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-CaROe5_H.js";import{h as r}from"./NewChatComposer-JjLbm3W2.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-BEXS8vV6.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-DkjnzvcJ.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-ChvMq-zl.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-Bfx8pg80.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-mO89dX-Y.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{c as u}from"./createLucideIcon-DkjnzvcJ.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-ChvMq-zl.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-DFs_u-vM.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-D_QOmjg5.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-DkjnzvcJ.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-ChvMq-zl.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{b as w,a as b}from"./agent-lane-detail-Db7KyAlf.js";function c(a){const n=a.startsWith("/"),t=[];for(const s of a.split("/"))!s||s==="."||(s===".."&&t.length&&t.at(-1)!==".."?t.pop():(s!==".."||!n)&&t.push(s));return`${n?"/":""}${t.join("/")}`}function g(a){const n=new Map;for(const t of a){const s=(t.facts?.cwd||w(t).cwd||"").trim(),e=s.startsWith("/")?c(s):null,p=b({files:t.facts?.touchedFiles??t.observe?.files??[]},1/0);for(const i of p){if(i.state==="read")continue;const l=i.path.startsWith("/")?c(i.path):e?c(`${e}/${i.path}`):null,o=l??c(i.path);if(!o||o==="/"||o==="..")continue;const d=e==="/"?"/":`${e}/`,u=e&&o.startsWith(d)?o.slice(d.length):o,f=JSON.stringify([e?"workspace":"lane",e??t.id,o]),r=n.get(f);r?(r.owners.some(h=>h.id===t.id)||r.owners.push(t),i.state==="created"&&(r.state="created")):n.set(f,{id:f,workspace:e,path:u,resolvedPath:l,owners:[t],state:i.state})}}return[...n.values()].sort((t,s)=>t.id.localeCompare(s.id))}export{g as b};
1
+ import{b as w,a as b}from"./agent-lane-detail-Ti3trpfH.js";function c(a){const n=a.startsWith("/"),t=[];for(const s of a.split("/"))!s||s==="."||(s===".."&&t.length&&t.at(-1)!==".."?t.pop():(s!==".."||!n)&&t.push(s));return`${n?"/":""}${t.join("/")}`}function g(a){const n=new Map;for(const t of a){const s=(t.facts?.cwd||w(t).cwd||"").trim(),e=s.startsWith("/")?c(s):null,p=b({files:t.facts?.touchedFiles??t.observe?.files??[]},1/0);for(const i of p){if(i.state==="read")continue;const l=i.path.startsWith("/")?c(i.path):e?c(`${e}/${i.path}`):null,o=l??c(i.path);if(!o||o==="/"||o==="..")continue;const d=e==="/"?"/":`${e}/`,u=e&&o.startsWith(d)?o.slice(d.length):o,f=JSON.stringify([e?"workspace":"lane",e??t.id,o]),r=n.get(f);r?(r.owners.some(h=>h.id===t.id)||r.owners.push(t),i.state==="created"&&(r.state="created")):n.set(f,{id:f,workspace:e,path:u,resolvedPath:l,owners:[t],state:i.state})}}return[...n.values()].sort((t,s)=>t.id.localeCompare(s.id))}export{g as b};
@@ -1 +1 @@
1
- import{c as t}from"./createLucideIcon-DkjnzvcJ.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-ChvMq-zl.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-DkjnzvcJ.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-ChvMq-zl.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-C8uS5szO.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-DReVb7jZ.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};