@openscout/scout 0.2.78 → 0.2.80

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 (428) hide show
  1. package/README.md +19 -0
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/ActivityScreen-BXm6nJ6L.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-DMnobKch.js → AddProjectForm-CtEiLQnm.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-D90c1Rzk.js → AgentAvatar-CszU5eaU.js} +1 -1
  7. package/dist/client/assets/AgentConfigurationScreen-CfBXxrsD.js +1 -0
  8. package/dist/client/assets/AgentDefinitionsWorkspace-4Z0aN8AR.js +1 -0
  9. package/dist/client/assets/{AgentDetailCard-BcRBRp88.js → AgentDetailCard-sZuHl1de.js} +1 -1
  10. package/dist/client/assets/AgentFloorView-DMivAYHU.js +1 -0
  11. package/dist/client/assets/AgentInfoScreen-CPkLg1pK.js +1 -0
  12. package/dist/client/assets/{AgentLaneCard-RrNnDZu8.js → AgentLaneCard-nB68f2CI.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-D9ZwUKrl.js → AgentLaneChrome-O9Yf0uR-.js} +1 -1
  14. package/dist/client/assets/AgentLaneDetailSheet-BfhpaEQ3.js +4 -0
  15. package/dist/client/assets/{AgentLaneSummaryResize-BhFmGNzT.js → AgentLaneSummaryResize-Ct3b0TQR.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-CjHMvy3v.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-eSAoDsPi.js → AgentLanesPreflight-DNGvZvjd.js} +1 -1
  18. package/dist/client/assets/AgentLanesView-DqRK5-d2.js +2 -0
  19. package/dist/client/assets/{AgentLiveActions-DBtnD0qE.js → AgentLiveActions-DI4ooSHW.js} +1 -1
  20. package/dist/client/assets/{AgentSessions-DyqOf4nG.js → AgentSessions-BxWIPkWh.js} +2 -2
  21. package/dist/client/assets/AgentsConsole-D6VHSCfZ.js +1 -0
  22. package/dist/client/assets/AgentsScreen-zR6b2bUL.js +1 -0
  23. package/dist/client/assets/AgentsSubnav-q0xcZi6C.js +1 -0
  24. package/dist/client/assets/{AtopView-BCkae3e1.js → AtopView-VZkk40v0.js} +1 -1
  25. package/dist/client/assets/BackToPicker-DZg_4nHL.js +1 -0
  26. package/dist/client/assets/{BriefingDetailScreen-BwFyysT8.js → BriefingDetailScreen-BZU4qMwE.js} +1 -1
  27. package/dist/client/assets/{BriefingsScreen-BQEevztH.js → BriefingsScreen-Bfc3tqPp.js} +1 -1
  28. package/dist/client/assets/{BrokerMetadataPanel-7UjcuNjd.js → BrokerMetadataPanel-CaFe6kdh.js} +1 -1
  29. package/dist/client/assets/BrokerScreen-Chh8sGen.js +5 -0
  30. package/dist/client/assets/{ChatCollapsedStrip-CQSYSd8s.js → ChatCollapsedStrip-Cov54p9V.js} +1 -1
  31. package/dist/client/assets/CodeDiffPane-C1ebFt-Y.js +1 -0
  32. package/dist/client/assets/{CodeProjectPicker-DqKFCpLU.js → CodeProjectPicker-tsCly-f3.js} +1 -1
  33. package/dist/client/assets/CodeScreen-D0hpZNLP.js +1 -0
  34. package/dist/client/assets/{ContextMenu-bARZqTzD.js → ContextMenu-N-Z6X0Z1.js} +1 -1
  35. package/dist/client/assets/ConversationComposer-CiEF7dhd.js +1 -0
  36. package/dist/client/assets/ConversationFeedRows-5it6QNBV.js +1 -0
  37. package/dist/client/assets/ConversationHeader-BGgbITvr.js +1 -0
  38. package/dist/client/assets/ConversationPanels-vI9YuQJh.js +2 -0
  39. package/dist/client/assets/ConversationScreen-C-PrCRz1.js +1 -0
  40. package/dist/client/assets/ConversationScreen-yIKEsm-8.css +1 -0
  41. package/dist/client/assets/ConversationStatus-COEj5loj.js +1 -0
  42. package/dist/client/assets/{DataTable-E8s_MmoA.js → DataTable-BoofV-_4.js} +1 -1
  43. package/dist/client/assets/{DispatchAftermath-Dpe88DFX.js → DispatchAftermath-OXYlMbT1.js} +1 -1
  44. package/dist/client/assets/{DocumentFocusViewer-BeVwwl26.js → DocumentFocusViewer-BCG2kOmd.js} +1 -1
  45. package/dist/client/assets/{EmbeddableSurfacesLab-BQqFQVnI.js → EmbeddableSurfacesLab-C2SZvrHJ.js} +1 -1
  46. package/dist/client/assets/{EmptyState-4F9XDFQm.js → EmptyState-DypEjx0V.js} +1 -1
  47. package/dist/client/assets/{FileViewerPane-CLgUhSm4.js → FileViewerPane-CXCq-oKj.js} +1 -1
  48. package/dist/client/assets/{FleetSearch-Dz5euQJe.js → FleetSearch-Dj7-CfNi.js} +1 -1
  49. package/dist/client/assets/FlightObserveScreen-Yq5NtQQJ.js +1 -0
  50. package/dist/client/assets/FollowScreen-DRgYuAvp.js +1 -0
  51. package/dist/client/assets/HarnessMark-BE-YSyci.js +1 -0
  52. package/dist/client/assets/HarnessesScreen-L-emPcXd.js +1 -0
  53. package/dist/client/assets/HerdrSession-DKFCJMst.js +4 -0
  54. package/dist/client/assets/{HomeHero-B3uYd-pP.js → HomeHero-CAEg8Yg5.js} +1 -1
  55. package/dist/client/assets/KnowledgeSearchInspector-C2EZsQ5i.js +1 -0
  56. package/dist/client/assets/KnowledgeSearchScreen-DvdOFh-b.js +1 -0
  57. package/dist/client/assets/{LaneToolHoverCard-Bla0gBdm.js → LaneToolHoverCard-DrPXYZvQ.js} +1 -1
  58. package/dist/client/assets/LaneTraceDetailSheet-Dl7foF88.js +1 -0
  59. package/dist/client/assets/{LaneTraceEventFocus-BF9ERP5O.js → LaneTraceEventFocus-X4-DDFEo.js} +1 -1
  60. package/dist/client/assets/{MeshCanvas-DFEPkpqY.js → MeshCanvas-rtCBD7s6.js} +2 -2
  61. package/dist/client/assets/{MeshCanvasMinimap-CyVFYixr.js → MeshCanvasMinimap-CuvXOkc7.js} +1 -1
  62. package/dist/client/assets/MeshScreen-D5zzTn0o.js +1 -0
  63. package/dist/client/assets/{MeshTopologyView-CalkZghg.js → MeshTopologyView-CeTShs-U.js} +2 -2
  64. package/dist/client/assets/{MessageComposerSuggestions-DpxN9WiB.js → MessageComposerSuggestions-Cs9u-F_3.js} +1 -1
  65. package/dist/client/assets/MessagesScreen-BhOJ7_tj.js +1 -0
  66. package/dist/client/assets/MissionContextRail-0O-Zu1Tn.js +1 -0
  67. package/dist/client/assets/MissionControlView-D2JO9u-y.js +1 -0
  68. package/dist/client/assets/{MissionFocusOverlay-wlCmWDCT.js → MissionFocusOverlay-LnjmqBiW.js} +1 -1
  69. package/dist/client/assets/MissionLeftAgentRow-nc1Jyq3D.js +1 -0
  70. package/dist/client/assets/MissionLogPane-lZ9vUftY.js +1 -0
  71. package/dist/client/assets/{NewAgentModal-Bg-eWHpY.js → NewAgentModal-K1cvdmZr.js} +1 -1
  72. package/dist/client/assets/NewChatComposer-C5LT7MF7.css +1 -0
  73. package/dist/client/assets/NewChatComposer-DXDxV2Mh.js +19 -0
  74. package/dist/client/assets/{NewChatOrigin-Bk2OyVjI.js → NewChatOrigin-CnjoswTG.js} +1 -1
  75. package/dist/client/assets/ObserveEmbedScreen-CRpzYf0Y.js +2 -0
  76. package/dist/client/assets/{ObserveTextFlow-rsFj_rVo.js → ObserveTextFlow-DJxQc2H6.js} +2 -2
  77. package/dist/client/assets/{ObservedTopologyPanel-DyUeV98H.js → ObservedTopologyPanel-C1AQM0Mq.js} +1 -1
  78. package/dist/client/assets/OpenScoutAppShell-DrHYD_pd.js +87 -0
  79. package/dist/client/assets/OpsAgentsView-BnMX0vEY.js +1 -0
  80. package/dist/client/assets/OpsScreen-BeC0lieE.js +1 -0
  81. package/dist/client/assets/OpsSubnav-D5Bpowtk.js +1 -0
  82. package/dist/client/assets/{PlanView-C1CjH3PG.js → PlanView-DDXdC19M.js} +1 -1
  83. package/dist/client/assets/ProjectAgentProfile-zE1cApxw.js +1 -0
  84. package/dist/client/assets/{ProjectAgentProfileBar-CtTpj6fU.js → ProjectAgentProfileBar-MODhG0P6.js} +1 -1
  85. package/dist/client/assets/ProjectAgentProfileHero-C1ImgGDu.js +1 -0
  86. package/dist/client/assets/ProjectsInbox-C3Jd6JTk.js +2 -0
  87. package/dist/client/assets/{ProjectsRail-BgiuV4LR.js → ProjectsRail-B1zrQLZe.js} +1 -1
  88. package/dist/client/assets/ProjectsScreen-PW_NH5VK.js +1 -0
  89. package/dist/client/assets/ProjectsThreadAside-DaCEUWN1.js +1 -0
  90. package/dist/client/assets/Provider-DSsb2gLR.js +1 -0
  91. package/dist/client/assets/{RailRow-BoGxAHNF.js → RailRow-DerXOXQS.js} +1 -1
  92. package/dist/client/assets/RawSessionsTable-LWEvXJzj.js +1 -0
  93. package/dist/client/assets/RealtimeVoiceScreen-XtxbCjOs.js +1 -0
  94. package/dist/client/assets/{RepoDiffEmbedScreen-C0rumUME.js → RepoDiffEmbedScreen-C9oLCcZX.js} +1 -1
  95. package/dist/client/assets/{RepoDiffPageScreen-DMv6DioL.js → RepoDiffPageScreen-CGEMAv2Z.js} +1 -1
  96. package/dist/client/assets/RepoDiffViewer-CB8PSVey.js +7 -0
  97. package/dist/client/assets/RepoDiffViewerLazy-DIxkiMto.js +2 -0
  98. package/dist/client/assets/{ReposScreen-CB_YBWYf.js → ReposScreen-BN1lVjOj.js} +2 -2
  99. package/dist/client/assets/{ScoutDeckSurface-CxIYFyWx.js → ScoutDeckSurface-BCpl0QCx.js} +1 -1
  100. package/dist/client/assets/{ScoutSurface-CYz_TcWC.js → ScoutSurface-BEnDlynn.js} +1 -1
  101. package/dist/client/assets/{ScoutbotBroadcastChip-L_R9atj0.js → ScoutbotBroadcastChip-z9R_pC_U.js} +1 -1
  102. package/dist/client/assets/{ScoutbotFxLab-CgiZMDMW.js → ScoutbotFxLab-fAROyIfz.js} +1 -1
  103. package/dist/client/assets/{ScoutbotRealtimeVoiceCall-FMQOr1Np.js → ScoutbotRealtimeVoiceCall-CDyFJX8m.js} +1 -1
  104. package/dist/client/assets/{SecondaryNav-B3-nh5dM.js → SecondaryNav-Hv5AJ3Fv.js} +1 -1
  105. package/dist/client/assets/SessionEmbedScreen-CDRpQc3g.js +1 -0
  106. package/dist/client/assets/SessionObserve-BmmJ8dEh.js +12 -0
  107. package/dist/client/assets/SessionObserve-CLrHfAKZ.css +1 -0
  108. package/dist/client/assets/SessionObserveEvidence-CEedIk2a.js +1 -0
  109. package/dist/client/assets/SessionRefScreen-Dk-O4OVt.js +1 -0
  110. package/dist/client/assets/SessionsScreen-BJEjuo2X.js +1 -0
  111. package/dist/client/assets/{SettingsDrawer-XfdAa_nD.js → SettingsDrawer-DL-SVLdd.js} +3 -3
  112. package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +1 -0
  113. package/dist/client/assets/SettingsScreen-DJ-BhBwR.js +1 -0
  114. package/dist/client/assets/{ShikiPane-Ap1iPxYb.js → ShikiPane-B7O4if20.js} +1 -1
  115. package/dist/client/assets/{SlidePanel-COwtoJqR.js → SlidePanel-B3gc5HnM.js} +1 -1
  116. package/dist/client/assets/SpriteAvatar-BpQDpOkq.js +1 -0
  117. package/dist/client/assets/{StatusPill-DhBL__p8.js → StatusPill-B33sQinT.js} +1 -1
  118. package/dist/client/assets/{TailView-DGj_5HA9.js → TailView-DL3YZkzE.js} +2 -2
  119. package/dist/client/assets/Terminal-Dp1FSGIS.js +1 -0
  120. package/dist/client/assets/TerminalEmbedScreen-DP9IM4xf.js +1 -0
  121. package/dist/client/assets/{TextDocumentSurface-BpAw4eQS.js → TextDocumentSurface-DRjctOIt.js} +1 -1
  122. package/dist/client/assets/{TmuxPeek-m1osv33Q.js → TmuxPeek-DNC4uWky.js} +1 -1
  123. package/dist/client/assets/{VoicePermissionsPanel-DsK53ar4.js → VoicePermissionsPanel-WLN0V-Xv.js} +1 -1
  124. package/dist/client/assets/{WorkDetailScreen-Bx0JimPC.js → WorkDetailScreen-D2Yl0mYZ.js} +3 -3
  125. package/dist/client/assets/{WorkFilesViewer-Btl6C2Q1.js → WorkFilesViewer-BbVfcUN-.js} +1 -1
  126. package/dist/client/assets/{activity-CA8qS6PI.js → activity-BxwKkT8z.js} +1 -1
  127. package/dist/client/assets/{addon-fit-BZ-kXjeN.js → addon-fit-B9O2vJoh.js} +1 -1
  128. package/dist/client/assets/{addon-webgl-D9-EQVEK.js → addon-webgl-BhRZFDcn.js} +1 -1
  129. package/dist/client/assets/{agent-essentials-BSY1o46q.js → agent-essentials-SrzMYEXV.js} +1 -1
  130. package/dist/client/assets/agent-identity-BxCsXnDp.js +1 -0
  131. package/dist/client/assets/agent-lane-card-BkWVDYM8.css +1 -0
  132. package/dist/client/assets/{agent-lane-card-model-r2frk57c.js → agent-lane-card-model-DSWdGu-v.js} +1 -1
  133. package/dist/client/assets/agent-lane-detail-BNNm6FNu.js +2 -0
  134. package/dist/client/assets/{agent-lane-preview-CmHVe3dU.js → agent-lane-preview-C33Dwpn7.js} +1 -1
  135. package/dist/client/assets/{agent-lanes-model-B4YTt4OF.js → agent-lanes-model-CPgQRenB.js} +2 -2
  136. package/dist/client/assets/{arc.es-CQBb-dVu.js → arc.es-NlJw-19N.js} +1 -1
  137. package/dist/client/assets/{arrow-down-BPLe0am9.js → arrow-down-D3-IbArq.js} +1 -1
  138. package/dist/client/assets/{arrow-left-DEZzHiPS.js → arrow-left-_vS7itsV.js} +1 -1
  139. package/dist/client/assets/{arrow-up-right-ClxBnsi7.js → arrow-up-right-CcrWONpD.js} +1 -1
  140. package/dist/client/assets/{bot-eu8pBNvI.js → bot-BRINYlC6.js} +1 -1
  141. package/dist/client/assets/{check-DjgFiBxb.js → check-COxArFXG.js} +1 -1
  142. package/dist/client/assets/{chevron-down-BGk5qoEw.js → chevron-down-DRCbnzyY.js} +1 -1
  143. package/dist/client/assets/{chevron-right-XiIHsk4m.js → chevron-right-CNE6QAVr.js} +1 -1
  144. package/dist/client/assets/chunk-HRAB3GC3-CAeEKaf5.js +1 -0
  145. package/dist/client/assets/chunk-JTPDIGGW-s6WbxdjC.js +46 -0
  146. package/dist/client/assets/{chunk-T65CQEWV-CrzwSeEt.js → chunk-T65CQEWV-CiZ_ICHW.js} +1 -1
  147. package/dist/client/assets/chunk-YOZR3KYS-DLOc92uD.js +2 -0
  148. package/dist/client/assets/clock-CyfvRmj6.js +1 -0
  149. package/dist/client/assets/{code-xml-B6jOCM4V.js → code-xml--LjSM4Mv.js} +1 -1
  150. package/dist/client/assets/content-7ZeCPAEt.js +1 -0
  151. package/dist/client/assets/content-BHUcUCH5.js +1 -0
  152. package/dist/client/assets/content-BUhvLPkv.js +1 -0
  153. package/dist/client/assets/content-BomQ5YWo.js +1 -0
  154. package/dist/client/assets/content-C39ELNgC.js +1 -0
  155. package/dist/client/assets/content-C4RYKHut.js +1 -0
  156. package/dist/client/assets/content-CCiZfG4H.js +1 -0
  157. package/dist/client/assets/content-CDpDtVI-.js +1 -0
  158. package/dist/client/assets/content-CO-9CeFd.js +1 -0
  159. package/dist/client/assets/content-CuOLxp1x.js +1 -0
  160. package/dist/client/assets/content-CvtLIjXS.js +1 -0
  161. package/dist/client/assets/content-CzwTUb9n.js +1 -0
  162. package/dist/client/assets/content-DQXbo2RO.js +1 -0
  163. package/dist/client/assets/content-DRTQ9QQb.js +1 -0
  164. package/dist/client/assets/content-LCELs6zg.js +1 -0
  165. package/dist/client/assets/content-Uqt8AG-s.css +1 -0
  166. package/dist/client/assets/content-qsDjA4Au.js +1 -0
  167. package/dist/client/assets/{context-budget-CbB4BDcO.js → context-budget-DX_fwUs3.js} +1 -1
  168. package/dist/client/assets/{conversation-icons-IIG5ha6D.js → conversation-icons-c-hXv7hY.js} +1 -1
  169. package/dist/client/assets/conversation-model-CHwHZNw-.js +1 -0
  170. package/dist/client/assets/conversation-motion-features-T8vF9zED.js +1 -0
  171. package/dist/client/assets/{copy-CQGYbxdu.js → copy-4LfKIdQJ.js} +1 -1
  172. package/dist/client/assets/{createLucideIcon-OpA4Amw5.js → createLucideIcon-ClCdc3F9.js} +1 -1
  173. package/dist/client/assets/discover-7Ks00w-M.js +2 -0
  174. package/dist/client/assets/embed-entry-n2ThmSSX.js +2 -0
  175. package/dist/client/assets/{external-link-CXBytO9o.js → external-link-CnaI1QFS.js} +1 -1
  176. package/dist/client/assets/{eye-0PvebX_a.js → eye-BFlhMzQL.js} +1 -1
  177. package/dist/client/assets/{file-text-BODxCjcz.js → file-text-DG-pufl1.js} +1 -1
  178. package/dist/client/assets/{gestures-CcwOTu8C.js → gestures-CxG3Dphs.js} +1 -1
  179. package/dist/client/assets/home-live-action-BkqGLVRY.js +1 -0
  180. package/dist/client/assets/home-moving-signal-aNJusIzL.js +1 -0
  181. package/dist/client/assets/home-now-card-BQK4EFHx.js +1 -0
  182. package/dist/client/assets/{home-now-card-nano-BcjnOU9H.js → home-now-card-nano-CdtzqSIF.js} +1 -1
  183. package/dist/client/assets/hooks-Dst1TH7n.js +2 -0
  184. package/dist/client/assets/inbox-thread-redesign-B_1ocqaX.css +1 -0
  185. package/dist/client/assets/index-9as_JTUs.css +1 -0
  186. package/dist/client/assets/index-CU9dtwJk.js +1 -0
  187. package/dist/client/assets/{index-DMiGbrBt.js → index-CzVeWScw.js} +6 -6
  188. package/dist/client/assets/index-Dewd56RX.js +1 -0
  189. package/dist/client/assets/index-_YQXKEhb.js +1 -0
  190. package/dist/client/assets/{inspector-panel-DPoCWxKs.js → inspector-panel-DgOM8nCo.js} +2 -2
  191. package/dist/client/assets/keyboard-nav-BJnFoFDP.js +1 -0
  192. package/dist/client/assets/knowledge-search-D_bLoYtC.css +1 -0
  193. package/dist/client/assets/{lane-observe-D0rfKDnU.js → lane-observe-BA3g9aVd.js} +1 -1
  194. package/dist/client/assets/{lane-roster-store-D8x1jac2.js → lane-roster-store-pR4ZaYQm.js} +1 -1
  195. package/dist/client/assets/left-BhzPp-_E.js +1 -0
  196. package/dist/client/assets/left-CN1MABD0.js +2 -0
  197. package/dist/client/assets/left-DDgbsio7.js +1 -0
  198. package/dist/client/assets/left-Dpf2R9uD.js +1 -0
  199. package/dist/client/assets/left-HwwbMVtl.js +2 -0
  200. package/dist/client/assets/left-YfH0daht.js +1 -0
  201. package/dist/client/assets/left-agents-CYUwAy2Z.js +1 -0
  202. package/dist/client/assets/left-default-vEGZALPv.js +1 -0
  203. package/dist/client/assets/left-lanes-bphF-vlX.js +1 -0
  204. package/dist/client/assets/left-mission-B54-c3hq.js +1 -0
  205. package/dist/client/assets/left-np5USKqG.js +1 -0
  206. package/dist/client/assets/left-plan-BNBuDoPQ.js +2 -0
  207. package/dist/client/assets/library-DbCVJG_O.js +1 -0
  208. package/dist/client/assets/{loader-circle-CbHjZsz1.js → loader-circle-Byb9kSFx.js} +1 -1
  209. package/dist/client/assets/{local-agents--00gLMqr.js → local-agents-DBaUbP-_.js} +1 -1
  210. package/dist/client/assets/{mentions-jSuTGeet.js → mentions-fbQJ2mBI.js} +1 -1
  211. package/dist/client/assets/mesh-ops-B1kDjizF.css +1 -0
  212. package/dist/client/assets/mesh-ops-Cnw3vwAu.js +1 -0
  213. package/dist/client/assets/{mesh-view-store-CWidRbTE.js → mesh-view-store-Btlyc7rW.js} +1 -1
  214. package/dist/client/assets/{message-circle-CG-96zts.js → message-circle-aGOfQWm2.js} +1 -1
  215. package/dist/client/assets/{message-markup-3J9pi3nx.js → message-markup-mGF07emJ.js} +1 -1
  216. package/dist/client/assets/{message-square-DSaGpjFU.js → message-square-CIXda-Y7.js} +1 -1
  217. package/dist/client/assets/mission-control-m3BTDQ9l.css +1 -0
  218. package/dist/client/assets/{mission-control-store-BlnEhiCq.js → mission-control-store-CcoNeQHG.js} +1 -1
  219. package/dist/client/assets/mission-wall-CocIM1cF.js +1 -0
  220. package/dist/client/assets/{model-CpAxGuis.js → model-IGCUEsMy.js} +1 -1
  221. package/dist/client/assets/{observe-CuLGD9Zp.js → observe-BNFzh-7B.js} +1 -1
  222. package/dist/client/assets/openAgent-Dbv5wfuL.js +1 -0
  223. package/dist/client/assets/{page-status-DpkedE1F.js → page-status-DDvNdA8s.js} +1 -1
  224. package/dist/client/assets/paperclip-DfpJkR4s.js +1 -0
  225. package/dist/client/assets/{plus--b1raV_O.js → plus-CmFQp9Uj.js} +1 -1
  226. package/dist/client/assets/profile-s3KRbip1.js +1 -0
  227. package/dist/client/assets/{projects-inbox-CHyUFQ6w.js → projects-inbox-Diddml6e.js} +1 -1
  228. package/dist/client/assets/{radio-Bz8ZePxj.js → radio-PauJIekM.js} +1 -1
  229. package/dist/client/assets/{refresh-cw-BBmAnCB7.js → refresh-cw-4oeFn1Jn.js} +1 -1
  230. package/dist/client/assets/repo-diff-DyYmQMSA.css +1 -0
  231. package/dist/client/assets/resolve-panes-cp6eNewO.js +1 -0
  232. package/dist/client/assets/resolve-sidebar-context-Dbo-5PWx.js +1 -0
  233. package/dist/client/assets/right-09W2JJFg.js +1 -0
  234. package/dist/client/assets/right-B-MKhiJ6.js +1 -0
  235. package/dist/client/assets/right-B91Zl8lQ.js +1 -0
  236. package/dist/client/assets/{right-DjRXbnRP.js → right-BcFnuse9.js} +1 -1
  237. package/dist/client/assets/right-BdtMzn35.js +1 -0
  238. package/dist/client/assets/right-BqmKXLtf.js +1 -0
  239. package/dist/client/assets/right-BzeB-Dpt.js +1 -0
  240. package/dist/client/assets/right-CkGOs-sq.js +1 -0
  241. package/dist/client/assets/right-CzGiNBzB.js +1 -0
  242. package/dist/client/assets/right-Dc7uqv7l.js +1 -0
  243. package/dist/client/assets/{rocket-BSNS_rLs.js → rocket-C-AskjZH.js} +1 -1
  244. package/dist/client/assets/router-B-K15T7B.js +1 -0
  245. package/dist/client/assets/{runtime-picker-Bcl5iIX5.js → runtime-picker-BCQD7d4K.js} +1 -1
  246. package/dist/client/assets/{scope-views-U-ucT9m0.js → scope-views-BhkbIFPY.js} +1 -1
  247. package/dist/client/assets/{scout-voice-CU5c0LGi.js → scout-voice-S5_YZ2v8.js} +1 -1
  248. package/dist/client/assets/{scroll-text-D6Pdnar7.js → scroll-text-BV-BB7v-.js} +1 -1
  249. package/dist/client/assets/{search-CWfZtOt2.js → search-C3bSJluv.js} +1 -1
  250. package/dist/client/assets/secondaryNavConfig-Bg4Tc0gT.js +1 -0
  251. package/dist/client/assets/{selection-bridge-16pk1qyG.js → selection-bridge-B1dmkX3P.js} +1 -1
  252. package/dist/client/assets/{send-horizontal-Bg5-QggH.js → send-horizontal-CqogPmbY.js} +1 -1
  253. package/dist/client/assets/{server-CPp4ZJhZ.js → server-Brw5Y1Gh.js} +1 -1
  254. package/dist/client/assets/{session-catalog-BmoyVTJ_.js → session-catalog-9FqXmjBw.js} +1 -1
  255. package/dist/client/assets/session-table-1xdSxSXq.js +1 -0
  256. package/dist/client/assets/{sliders-horizontal-1oW76Xc9.js → sliders-horizontal-CUiOH26y.js} +1 -1
  257. package/dist/client/assets/sparkles-BjCA3Evu.js +1 -0
  258. package/dist/client/assets/{sse-CjIkKo46.js → sse-QcU9bikk.js} +1 -1
  259. package/dist/client/assets/synthetic-agent-routing-aduMYO7P.js +1 -0
  260. package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +1 -0
  261. package/dist/client/assets/{tail-display-BdyoLvzY.js → tail-display-BRcJltQa.js} +2 -2
  262. package/dist/client/assets/{tail-events-D19uAGe3.js → tail-events-C6K7bCWB.js} +1 -1
  263. package/dist/client/assets/{terminal-B9AOZQKR.js → terminal-DrTkVXIj.js} +1 -1
  264. package/dist/client/assets/{terminal-relay-CWbJ1RCW.js → terminal-relay-BkXjjSkq.js} +1 -1
  265. package/dist/client/assets/{terminal-screen-19jAI0Cw.css → terminal-screen-BqVnCwl0.css} +1 -1
  266. package/dist/client/assets/terminal-sessions-C3qU8tnY.js +1 -0
  267. package/dist/client/assets/{terminal-takeover-B8UeD9OX.js → terminal-takeover-KvmTwABa.js} +1 -1
  268. package/dist/client/assets/{time-DltNTpLl.js → time-Dhsh_2EG.js} +1 -1
  269. package/dist/client/assets/{use-conversation-list-Byab41G6.js → use-conversation-list-C5sF6WBR.js} +1 -1
  270. package/dist/client/assets/{use-fleet-active-asks-BIbQx5AS.js → use-fleet-active-asks-BOMPW0nl.js} +1 -1
  271. package/dist/client/assets/use-mesh-ops-items-Co05vcTV.js +1 -0
  272. package/dist/client/assets/{use-reduced-motion-RRBkmVkk.js → use-reduced-motion-Dla-G_Jz.js} +1 -1
  273. package/dist/client/assets/use-scout-dev-flags-BOQF3fW2.js +1 -0
  274. package/dist/client/assets/{useAgentHoverCard-DMrbBif0.js → useAgentHoverCard-FtCmY-b9.js} +1 -1
  275. package/dist/client/assets/useContentSecondaryNav-BX7Sq7vy.js +1 -0
  276. package/dist/client/assets/usePierreRuntime-Bo4lD7Ui.js +50 -0
  277. package/dist/client/assets/{wrench-Bkc_0lKF.js → wrench-CeCdjiPF.js} +1 -1
  278. package/dist/client/assets/{x-D3GElQbe.js → x-D4X_y1j_.js} +1 -1
  279. package/dist/client/assets/{xterm-BKR8oAkR.js → xterm-D2a5wrkJ.js} +1 -1
  280. package/dist/client/index.html +2 -2
  281. package/dist/drizzle/0007_lean_venus.sql +26 -0
  282. package/dist/drizzle/0008_luxuriant_ted_forrester.sql +1 -0
  283. package/dist/drizzle/meta/0007_snapshot.json +5767 -0
  284. package/dist/drizzle/meta/0008_snapshot.json +5774 -0
  285. package/dist/drizzle/meta/_journal.json +14 -0
  286. package/dist/main.mjs +29271 -4824
  287. package/dist/node/main.mjs +31635 -11915
  288. package/dist/openscout-terminal-relay.mjs +16 -4
  289. package/dist/pairing-runtime-controller.mjs +37812 -16924
  290. package/dist/runtime/base-daemon.mjs +109 -18
  291. package/dist/runtime/broker-daemon.mjs +22247 -2746
  292. package/dist/runtime/broker-process-manager.mjs +122 -12
  293. package/dist/runtime/mesh-discover.mjs +90 -13
  294. package/dist/scout-control-plane-web.mjs +23083 -3481
  295. package/dist/scout-web-server.mjs +23083 -3481
  296. package/dist/statusline.mjs +2 -0
  297. package/package.json +3 -1
  298. package/dist/client/assets/ActivityScreen-Cu_1V4bq.js +0 -1
  299. package/dist/client/assets/AgentConfigurationScreen-BqfOz90D.js +0 -1
  300. package/dist/client/assets/AgentDefinitionsWorkspace-CUpUrY57.js +0 -1
  301. package/dist/client/assets/AgentFloorView-8LoAEBwS.js +0 -1
  302. package/dist/client/assets/AgentInfoScreen-DZs2_ibL.js +0 -1
  303. package/dist/client/assets/AgentLaneDetailSheet-BXbPls9N.js +0 -5
  304. package/dist/client/assets/AgentLanesEmbedScreen-W3qs022h.js +0 -1
  305. package/dist/client/assets/AgentLanesView-B9vuEEmZ.js +0 -2
  306. package/dist/client/assets/AgentsConsole-BgiYP2wR.js +0 -1
  307. package/dist/client/assets/AgentsScreen-DBi8x4MB.js +0 -1
  308. package/dist/client/assets/AgentsSubnav-DIEO4NPx.js +0 -1
  309. package/dist/client/assets/BackToPicker-BRvfostO.js +0 -1
  310. package/dist/client/assets/BrokerScreen-7ekklu88.js +0 -5
  311. package/dist/client/assets/CodeDiffPane-DDPt6KPh.js +0 -1
  312. package/dist/client/assets/CodeScreen-BxCrpRHd.js +0 -1
  313. package/dist/client/assets/ConversationComposer-Bla3DDvM.js +0 -1
  314. package/dist/client/assets/ConversationFeedRows-B_gPxcqA.js +0 -1
  315. package/dist/client/assets/ConversationHeader-DE3FC0m-.js +0 -1
  316. package/dist/client/assets/ConversationPanels-DLek4H6A.js +0 -2
  317. package/dist/client/assets/ConversationScreen-BDRhx-RU.js +0 -1
  318. package/dist/client/assets/ConversationScreen-C9yMAMYF.css +0 -1
  319. package/dist/client/assets/ConversationStatus-BwVLiiO4.js +0 -1
  320. package/dist/client/assets/FlightObserveScreen-6RpZYwVz.js +0 -1
  321. package/dist/client/assets/FollowScreen-DZ4qfYOY.js +0 -1
  322. package/dist/client/assets/HarnessMark-Cbv3Ib0c.js +0 -1
  323. package/dist/client/assets/HarnessesScreen-CznAImej.js +0 -1
  324. package/dist/client/assets/KnowledgeSearchInspector-Dgdkfvvz.js +0 -1
  325. package/dist/client/assets/KnowledgeSearchScreen-DJDGGaqC.js +0 -1
  326. package/dist/client/assets/LaneTraceDetailSheet-D1CspRbl.js +0 -1
  327. package/dist/client/assets/MeshScreen-DFgevn8N.js +0 -1
  328. package/dist/client/assets/MessagesScreen-C8YKW10Y.js +0 -1
  329. package/dist/client/assets/MissionControlView-lUeAiSVg.js +0 -1
  330. package/dist/client/assets/MissionLeftAgentRow-BpZWntfl.js +0 -1
  331. package/dist/client/assets/MissionLogPane-__MVtEl9.js +0 -1
  332. package/dist/client/assets/NewChatComposer-Cs6OsxK6.js +0 -19
  333. package/dist/client/assets/NewChatComposer-W-t-L4oV.css +0 -1
  334. package/dist/client/assets/ObserveEmbedScreen-y2EpuqRZ.js +0 -2
  335. package/dist/client/assets/OpenScoutAppShell-C_URc8sV.js +0 -87
  336. package/dist/client/assets/OpsAgentsView-UN7iOscs.js +0 -1
  337. package/dist/client/assets/OpsScreen-Buf3LKjb.js +0 -1
  338. package/dist/client/assets/OpsSubnav-DsuXzHah.js +0 -1
  339. package/dist/client/assets/ProjectAgentProfile-DJusrAV-.js +0 -1
  340. package/dist/client/assets/ProjectAgentProfileHero-BFwNJo_N.js +0 -1
  341. package/dist/client/assets/ProjectsInbox-GhVMxOhw.js +0 -2
  342. package/dist/client/assets/ProjectsScreen-eNUBy4YU.js +0 -1
  343. package/dist/client/assets/ProjectsThreadAside-CoBgnHmr.js +0 -1
  344. package/dist/client/assets/Provider-C7UKGHQy.js +0 -1
  345. package/dist/client/assets/RawSessionsTable-DL8y_eEy.js +0 -1
  346. package/dist/client/assets/RealtimeVoiceScreen-ffS-39zy.js +0 -1
  347. package/dist/client/assets/RepoDiffViewer-D_exm6xK.js +0 -7
  348. package/dist/client/assets/RepoDiffViewerLazy-BPgF92Bg.js +0 -2
  349. package/dist/client/assets/SessionEmbedScreen-BVC7yvWF.js +0 -1
  350. package/dist/client/assets/SessionObserve-BpggNO_M.css +0 -1
  351. package/dist/client/assets/SessionObserve-yfXFafp8.js +0 -12
  352. package/dist/client/assets/SessionRefScreen-DRgJu7Jo.js +0 -1
  353. package/dist/client/assets/SessionsScreen-D6XUsZfA.js +0 -1
  354. package/dist/client/assets/SettingsDrawer-CmJt72ww.css +0 -1
  355. package/dist/client/assets/SettingsScreen-Cy8z-EuR.js +0 -1
  356. package/dist/client/assets/SpriteAvatar-DyaGuhik.js +0 -1
  357. package/dist/client/assets/Terminal-CqvGbjXU.js +0 -1
  358. package/dist/client/assets/TerminalEmbedScreen-DuZZFFzW.js +0 -1
  359. package/dist/client/assets/agent-chat-Bfjd9y6c.js +0 -1
  360. package/dist/client/assets/agent-lane-card-Dm7YWoew.css +0 -1
  361. package/dist/client/assets/agent-lane-detail-Djm3YJEa.js +0 -1
  362. package/dist/client/assets/chunk-YOZR3KYS-Bet8khjg.js +0 -47
  363. package/dist/client/assets/content-BDt9VBPk.js +0 -1
  364. package/dist/client/assets/content-BIXf4cKR.js +0 -1
  365. package/dist/client/assets/content-BLm0NBJM.js +0 -1
  366. package/dist/client/assets/content-C2EwTb2y.js +0 -1
  367. package/dist/client/assets/content-C5UbLsDF.js +0 -1
  368. package/dist/client/assets/content-CHU0wwA3.css +0 -1
  369. package/dist/client/assets/content-CR3vdrYY.js +0 -1
  370. package/dist/client/assets/content-CSPVmo2s.js +0 -1
  371. package/dist/client/assets/content-C_FGqx1X.js +0 -1
  372. package/dist/client/assets/content-CvlVUOG8.js +0 -1
  373. package/dist/client/assets/content-D5kJmfgl.js +0 -1
  374. package/dist/client/assets/content-DTpQsomG.js +0 -1
  375. package/dist/client/assets/content-DikVsqLf.js +0 -1
  376. package/dist/client/assets/content-DlUe5Ono.js +0 -1
  377. package/dist/client/assets/content-GIBv_55n.js +0 -1
  378. package/dist/client/assets/content-Q2oclDzi.js +0 -1
  379. package/dist/client/assets/conversation-model-B47vYmWN.js +0 -1
  380. package/dist/client/assets/conversation-motion-features-BdAONVls.js +0 -1
  381. package/dist/client/assets/discover-C1YwpBDE.js +0 -2
  382. package/dist/client/assets/embed-entry-BAcGL3g9.js +0 -2
  383. package/dist/client/assets/home-live-action-B22u89j7.js +0 -1
  384. package/dist/client/assets/home-moving-signal-CK147hxn.js +0 -1
  385. package/dist/client/assets/home-now-card-BgvNWuea.js +0 -1
  386. package/dist/client/assets/hooks-B6y_O2FB.js +0 -2
  387. package/dist/client/assets/inbox-thread-redesign-Bz4FjWzr.css +0 -1
  388. package/dist/client/assets/index-BcuhqXLe.js +0 -1
  389. package/dist/client/assets/index-CJXzfjo9.js +0 -1
  390. package/dist/client/assets/index-DQPvraRS.js +0 -1
  391. package/dist/client/assets/index-DxGoC5l5.css +0 -1
  392. package/dist/client/assets/keyboard-nav-2kv_tGUS.js +0 -1
  393. package/dist/client/assets/knowledge-search-CVxQwxPn.js +0 -1
  394. package/dist/client/assets/knowledge-search-DjrQdiiW.css +0 -1
  395. package/dist/client/assets/left-C--GiIh8.js +0 -2
  396. package/dist/client/assets/left-Cj7Rt89X.js +0 -1
  397. package/dist/client/assets/left-CpNEtFEg.js +0 -1
  398. package/dist/client/assets/left-CzXAuK_t.js +0 -2
  399. package/dist/client/assets/left-agents-Bo9sO1by.js +0 -1
  400. package/dist/client/assets/left-bN4PCAXa.js +0 -1
  401. package/dist/client/assets/left-default-DV9GdvYi.js +0 -1
  402. package/dist/client/assets/left-jYYGAOYD.js +0 -1
  403. package/dist/client/assets/left-lanes-D0l_Co7V.js +0 -1
  404. package/dist/client/assets/left-mission-Ci7zREkQ.js +0 -1
  405. package/dist/client/assets/left-plan-D4U1uflW.js +0 -2
  406. package/dist/client/assets/library-D-RxGiCw.js +0 -1
  407. package/dist/client/assets/mission-control-D3ikEPND.css +0 -1
  408. package/dist/client/assets/openAgent-Bjt57GdM.js +0 -1
  409. package/dist/client/assets/profile-CVRziEDA.js +0 -1
  410. package/dist/client/assets/repo-diff-C9Qs-bEn.css +0 -1
  411. package/dist/client/assets/resolve-panes-r9B3mpW7.js +0 -1
  412. package/dist/client/assets/resolve-sidebar-context-DcG8xGaB.js +0 -1
  413. package/dist/client/assets/right-BHeiIaty.js +0 -1
  414. package/dist/client/assets/right-BkgKo9VT.js +0 -1
  415. package/dist/client/assets/right-BpEU5jWE.js +0 -1
  416. package/dist/client/assets/right-CRZXoy-X.js +0 -1
  417. package/dist/client/assets/right-ChF_pbPy.js +0 -1
  418. package/dist/client/assets/right-DMoUT3KN.js +0 -1
  419. package/dist/client/assets/right-T4Ue6EqM.js +0 -1
  420. package/dist/client/assets/right-wzrLXKur.js +0 -1
  421. package/dist/client/assets/router-Bq5dwf78.js +0 -1
  422. package/dist/client/assets/secondaryNavConfig-DqUIp0Es.js +0 -1
  423. package/dist/client/assets/session-table-DZcrKoIH.js +0 -1
  424. package/dist/client/assets/sparkles-ClfRJQ6w.js +0 -1
  425. package/dist/client/assets/system-surfaces-redesign-CD26LFc0.css +0 -1
  426. package/dist/client/assets/terminal-sessions-D5CIR2OL.js +0 -1
  427. package/dist/client/assets/useContentSecondaryNav-DMl1WNm7.js +0 -1
  428. package/dist/client/assets/usePierreRuntime-wC-yMtBb.js +0 -50
@@ -0,0 +1 @@
1
+ import{r as L,j as Nn,p as ce,q as Mn,t as Ne,v as Me,k as Bn,w as zn,s as T,l as h,x as Wn,y as J,z as Kn,A as Gn}from"./index-CzVeWScw.js";import{n as ue}from"./synthetic-agent-routing-aduMYO7P.js";import{o as Hn,q as Be,n as Vn,u as Yn}from"./terminal-sessions-C3qU8tnY.js";var ze=["local","url","sharedConfig","env"];function We(e){const n=qn(e),t=e.audienceIncludes??Qn(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=Xn(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 qn(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 Qn(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 Xn(e,n){for(const t of ze){const s=Zn(e?.[t]?.flags?.[n]);if(s!==null)return{layer:t,value:s}}return null}function Zn(e){return e===!0||e==="on"?!0:e===!1||e==="off"?!1:null}function Jn(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 et(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=Jn(u);d&&f!==void 0&&(r[d]=f)}return{flags:r,audience:i}}var x=1;function Ke(e){if(typeof window>"u")return{version:x};try{const n=window.localStorage?.getItem(e);return nt(n)}catch{return{version:x}}}function q(e,n){if(typeof window>"u")return;const t=Ge(n),s=JSON.stringify(t);try{window.localStorage?.setItem(e,s)}catch{}tt(e,s)}function nt(e){if(!e)return{version:x};try{const n=JSON.parse(e);return!n||typeof n!="object"?{version:x}:Ge(n)}catch{return{version:x}}}function Ge(e){const n={version:x};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 tt(e,n){if(!(typeof document>"u"))try{const t=encodeURIComponent(n);document.cookie=`${encodeURIComponent(e)}=${t}; Path=/; SameSite=Lax; Max-Age=31536000`}catch{}}var st="hudson.flags",He=L.createContext(null);function xs({registry:e,audience:n,audienceOrder:t,audienceIncludes:s,initialLayers:o,storageKey:r=st,warnOnUnknown:i=!1,children:a}){const[u,d]=L.useState(()=>{const g=o?.local;return{version:1,audience:g?.audience??void 0,flags:ot(g)}});L.useEffect(()=>{const g=Ke(r);(g.audience||Object.keys(g.flags??{}).length>0)&&d(g)},[r]);const f=L.useMemo(()=>({...o,local:{...o?.local,audience:u.audience??o?.local?.audience,flags:{...o?.local?.flags??{},...u.flags??{}}}}),[o,u]),S=L.useMemo(()=>We({registry:e,audience:n,audienceOrder:t,audienceIncludes:s,layers:f,warnOnUnknown:i}),[e,n,t,s,f,i]),A=L.useMemo(()=>({...S,layers:f,storageKey:r,setLocalOverride:(g,w)=>{d(R=>{const U={...R.flags??{}};w===null?delete U[g]:U[g]=w;const _={...R,version:1,flags:U};return q(r,_),_})},setLocalAudienceOverride:g=>{d(w=>{const R={...w,version:1,audience:g??void 0};return q(r,R),R})},resetLocalOverrides:()=>{const g={version:1};q(r,g),d(g)}}),[S,f,r]);return Nn.jsx(He.Provider,{value:A,children:a})}function Ve(){return L.useContext(He)}function Ds(){const e=Ve();if(!e)throw new Error("useFeatureFlags must be used within FeatureFlagsProvider");return e}function js(e,n=!0){return Ve()?.isEnabled(e)??n}function ot(e){if(!e?.flags)return;const n={};for(const[t,s]of Object.entries(e.flags))(s===!0||s===!1)&&(n[t]=s);return Object.keys(n).length>0?n:void 0}const rt=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal"],at=["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 Ye={label:"Surface · Scope",description:`Scope presentation on Scout infra — lean lanes/tail/sessions/agents at ${Mn}/*.`,defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","scope","observability"]},it={...Ye,label:"Surface · Scope (legacy alias)",description:`Legacy alias for ${ce}. Prefer the primary flag; ${Ne} remains for old dev links.`},Ns=ce;function ct(){return{audience:"everyone",flags:{"ops.control":!0,"ops.lanes":!0,...ye(rt,!1),...ye(at,!1)}}}const qe=["ffBundle","ffVariant","scoutBundle","scoutExperience","ab"],Qe=["ffGlobal","scoutGlobalBundle"],Xe=["ffPersist","persistBundle"],ut=new Set(["no-ops","ffAudience",...qe,...Qe,...Xe]);function Ms(e){for(const n of[...e.searchParams.keys()])(ut.has(n)||n.startsWith("ff."))&&e.searchParams.delete(n);return e}const lt=["everyone","internal","power"],dt="openscout.flags",ee="openscout.flagBundle",ft={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.realtime-voice","surface.workflows"],mt={"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 · Mesh",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.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","assistant","voice"]},"surface.workflows":{label:"Surface · Workflows",description:"Observed harness families / workflow topology telemetry on the Agents directory. Off in the lean view — the directory is just the project-grouped agent board.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","observability"]},[ce]:Ye,[Ne]:it},pt={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",...zn},Re=new Set(["clear","default","none","reset","unset"]);function K(e,n){return Object.fromEntries(e.map(t=>[t,n]))}function Ze(...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 le(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 Bn:return ct()}}function j(e){return e?pt[e.trim().toLowerCase()]??null:null}function ne(e,n){for(const t of n){const s=e.get(t);if(s!==null)return s}return null}function Je(e){const n=ne(e,qe);return j(n)}function gt(e){const n=ne(e,Qe);if(n){const i=n.trim().toLowerCase();if(Re.has(i))return{action:"clear"};const a=j(n);return a?{action:"set",bundle:a}:null}const t=ne(e,Xe);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=j(t);if(o)return{action:"set",bundle:o};const r=Je(e);return r?{action:"set",bundle:r}:null}function en(){if(typeof window>"u")return null;try{return j(window.localStorage.getItem(ee))}catch{return null}}function ht(e){if(!(typeof window>"u"))try{e.action==="clear"?window.localStorage.removeItem(ee):window.localStorage.setItem(ee,e.bundle)}catch{}}function Bs(){return en()??j(Me())??tn}function nn(){const e=en();return e?le(e):{}}const tn="light-prod";function sn(){const e=j(Me())??tn;return le(e)}function wt(e){const n=gt(e);n&&ht(n)}function on(e=new URLSearchParams(window.location.search)){const n=et(window.location.href),t=Je(e),s=t?le(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 It(){const e=Ke(dt);return{flags:e.flags,audience:e.audience??void 0}}function zs(){if(typeof window>"u")return{};const e=new URLSearchParams(window.location.search);return wt(e),{sharedConfig:Ze(sn(),nn()),url:on(e)}}function vt(e){const n=typeof window>"u"?{}:{sharedConfig:Ze(sn(),nn()),url:on(),local:It()};return We({registry:mt,audience:ft,audienceOrder:lt,layers:n,warnOnUnknown:!1}).isEnabled(e)}function rn(){return vt("ops.control")}const te={sm:408,md:512,lg:616},an=240,cn=640,St=24,un="openscout:lane-deck:v1",bt=new Set(["web.ops","macos.lanes","hud.tail","web.embed"]),de=new Set(["sm","md","lg"]),ln={"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}},Lt=ln["web.ops"];function fe(e){return dn(e)?ln[e]:Lt}const H={pinned_left:0,main:1,pinned_right:2};function dn(e){return bt.has(e)}function Ws(e=window.location.search,n=window.location.pathname){const t=new URLSearchParams(e),s=t.get("profile")?.trim().toLowerCase();if(s&&dn(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 Ks(e=window.location.search){const n=new URLSearchParams(e),t=(n.get("lanes")??n.get("size"))?.trim().toLowerCase();return t&&de.has(t)?t:"lg"}function Gs(e,n){if(typeof e=="number"&&Number.isFinite(e))return Math.min(cn,Math.max(an,Math.round(e)));const t=typeof e=="string"&&de.has(e)?e:n;return te[t]}function Hs(e){const n=Math.min(cn,Math.max(an,Math.round(e)));let t=null,s=Number.POSITIVE_INFINITY;for(const[o,r]of Object.entries(te)){const i=Math.abs(r-n);i<s&&(s=i,t=o)}return t&&s<=St?{px:te[t],tier:t}:{px:n,tier:null}}function me(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=fe(e);return me(e,n,t)}function se(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&de.has(e))return e}function yt(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 Et(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:se(n.width)}}function fn(e,n,t,s){if(!e||typeof e!="object")return me(n,t,s);const o=e,r=Array.isArray(o.laneDefs)?o.laneDefs.map(yt).filter(d=>d!==null):[],i=Array.isArray(o.slots)?o.slots.map(Et).filter(d=>d!==null):[],a={};if(o.laneWidths&&typeof o.laneWidths=="object")for(const[d,f]of Object.entries(o.laneWidths)){const S=se(f);S!==void 0&&(a[d]=S)}const u=se(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 $t(e,n,t){return fn(e,n,t,fe(n))}function Vs(e,n){const t=fe(e),s=n??t.defaultLaneWidth;try{const o=localStorage.getItem(`${un}:${e}`);return o?$t(JSON.parse(o),e,s):Pe(e,s)}catch{return Pe(e,s)}}function Rt(e){try{localStorage.setItem(`${un}:${e.profileId}`,JSON.stringify({...e,updatedAt:Date.now()}))}catch{}}function Ys(e){return[...e].sort((n,t)=>{const s=H[n.zone]-H[t.zone];return s!==0?s:n.position-t.position})}function qs(e,n){return H[e]-H[n]}function mn(){return`slot:${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function pe(e){return e.trim().toLowerCase().replace(/['"]/gu,"").replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function Y(e){return`session:${e}`}function Pt(e){return`harness:${pe(e)}`}function Ct(e){return`project:${pe(e)}`}const At="attention:needs-input";function pn(e,n){const t=e.filter(s=>s.zone===n);return t.length===0?0:Math.max(...t.map(s=>s.position))+1}function gn(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 hn(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 wn(e,n){return{...e,slots:e.slots.filter(t=>t.laneDefId!==n)}}function _t(e,n){const t=Y(n);return{...wn(e,t),laneDefs:e.laneDefs.filter(s=>s.id!==t)}}function Qs(e,n){const t=Y(n);return e.slots.some(s=>s.laneDefId===t&&s.zone!=="main")}function Xs(e,n){const t=Y(n),s=e.slots.find(o=>o.laneDefId===t);return!s||s.zone==="main"?null:s.zone}function Zs(e,n){const t=n.zone??"pinned_left",s=Y(n.laneId),o=_t(e,n.laneId),r=gn(o,{id:s,kind:"session",title:n.title,sessionId:n.laneId});return hn(r,{id:mn(),laneDefId:s,zone:t,position:pn(r.slots,t),width:n.width})}function Js(e,n){const t=n.zone??"pinned_left",s=n.kind==="attention"?At:n.kind==="harness"&&n.harness?Pt(n.harness):n.kind==="project"&&n.projectPath?Ct(n.projectPath):`${n.kind}:${pe(n.title)}`,o=wn(e,s),r=gn(o,{id:s,kind:n.kind,title:n.title,harness:n.harness,projectPath:n.projectPath});return hn(r,{id:mn(),laneDefId:s,zone:t,position:pn(r.slots,t),width:n.width})}function eo(e,n,t){return{...e,laneWidths:{...e.laneWidths,[n]:t},updatedAt:Date.now()}}function no(e,n){return{...e,defaultLaneWidth:n,updatedAt:Date.now()}}function to(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 V="scope.lanes",oe={defaultLaneWidth:"md",showAutoLanes:!0,defaultHorizon:"30m"},Ut="openscout:lane-deck:v1";function Ce(e){return me(V,e,oe)}function so(e){const n=e??oe.defaultLaneWidth;try{const t=localStorage.getItem(`${Ut}:${V}`);return t?fn(JSON.parse(t),V,n,oe):Ce(n)}catch{return Ce(n)}}function oo(e){Rt(e)}const kt=[h.lanes,h.tail,h.sessions,h.agents];function Ft(e){return kt.includes(e)}function Tt(e){return e===Kn||e===Gn}function In(e){return Wn(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 T(e,s?`?${s}`:"")}case h.sessions:return n.sessionId?T(e,`/${encodeURIComponent(n.sessionId)}`):T(e);case h.lanes:return T(J);case h.agents:return T(e);default:return T(J)}}function vn(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 Ot(e){const n=vn(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 xt(e,n,t){if(!Tt(e[0]))return null;const s=e[1]??J;if(!Ft(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 Dt=new Set(["no-ops","ffBundle","ffVariant","scoutBundle","scoutExperience","ab","ffGlobal","scoutGlobalBundle","ffPersist","persistBundle","ffAudience","studio","studioInjection","studioMode"]),jt=["ff.","studio.","studioMode."];function Nt(e){return Dt.has(e)||jt.some(n=>e.startsWith(n))}function Sn(e,n=""){const t=new URL(e,"http://scout.local");new URLSearchParams(n).forEach((r,i)=>{Nt(i)&&(t.searchParams.has(i)||t.searchParams.set(i,r))});const o=t.searchParams.toString();return`${t.pathname}${o?`?${o}`:""}`}function ro(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 Mt(e=typeof window<"u"?window.location.pathname:""){return In(e)}function ao(){return V}function io(e=Mt()){return e?{"data-scope-presentation":!0}:void 0}function bn(e,n=typeof window<"u"?window.location.pathname:""){return In(n)?Ot(e):null}function Bt(e,n=typeof window<"u"?window.location.pathname:""){return bn(e,n)!==null}function co(e,n=typeof window<"u"?window.location.pathname:""){return Bt(e,n)?vn(e):null}const uo={days:3,sessionLimit:200,hitLimit:60,debounceMs:180};function re(e){return e.root==="HOME"?`~/${e.relPath}`:e.root==="ABSOLUTE"?e.relPath:`$${e.root}/${e.relPath}`}function Ae(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 F(e){return e.sourceRefs.find(n=>n.kind==="harness_transcript")??null}function Ln(e){return e.sourceRefs.find(n=>n.kind==="file")??null}function ge(e){return e?Ae(e.sessionId)??Ae(re(e.path)):null}function lo(e){const n=ge(e);if(!n)return null;const t=e?.recordRange;return t?`${n}|records ${t[0]}..${t[1]}`:n}function z(e,n){const t=e.facets[n];return Array.isArray(t)?t.filter(Boolean).join(", "):typeof t=="string"?t:""}function M(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 zt=/^(events?\s+window(\s+\d+)?|files?\s+touched|tool\s+calls?|indexed\s+snippet|manifest|summary|decisions?|context\s+pack)\b/iu,_e=/^(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 yn(e){return zt.test(e.replace(/\s+/g," ").trim())}function Wt(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]??"";(_e.test(s)||/\b(?:am|pm|\d{1,2}:\d{2}|plugin|session|openscout)\b/iu.test(s))&&(n=o.trim())}}return n=n.replace(_e,"").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 Kt(e){const n=z(e,"project"),t=e.title.replace(/\s+/g," ").trim();if(t&&!yn(t)){const o=Wt(t);if(o&&o.toLowerCase()!==n.toLowerCase()||o)return o}if(n)return n;const s=ge(F(e));return s?s.length>18?`${s.slice(0,16)}…`:s:"Session match"}function En(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=we(e);return t==="tool activity"?"tool":t==="overview"?"overview":""}function fo(e,n){const t=Ie(e.snippet,n),s=En(e),o=he(e);let r="";if(t){const i=M(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=>ae(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||Kt(e)}function Gt(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 Ht(e){const n=e.trim();return n?n.charAt(0).toUpperCase()+n.slice(1):""}function Vt(e){const n=z(e,"harness")||F(e)?.harness||"";if(!n)return"";const t=n.toLowerCase();return t==="claude"?"Claude":t==="codex"?"Codex":t==="kimi"?"Kimi":t==="cursor"?"Cursor":Ht(n)}function Yt(e){const n=z(e,"sessionId").trim(),t=ge(F(e)),s=(n||t||"").trim();return s?s.length>14?s.slice(0,8):s:""}function he(e){const n=F(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 qt(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 we(e){const n=z(e,"documentKind");if(n){const s=n.split(",")[0]?.trim()??n;return ke(s)}return yn(e.title)?ke(e.title):Ln(e)?"file":F(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 mo(e){return{agent:Vt(e),project:z(e,"project"),session:Yt(e),when:Gt(e),turn:he(e),role:qt(e),where:we(e)}}function po(e){const n=[],t=he(e);t&&n.push(t);const s=En(e);s&&n.push(s);const o=we(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 ae(e,n){return new RegExp(`(?<![A-Za-z0-9_./~-])${Pn(n)}(?![A-Za-z0-9_./~-])`,"iu").exec(e)?.index??-1}function Ie(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 M(n).some(a=>ae(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=M(n),o=200;if(s.length>0&&t.length>o){let r=-1;for(const i of s){const a=ae(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 go(e,n,t){const s=Ie(e.snippet,n);return s.length<=t?s:`${s.slice(0,t-1).replace(/\s+\S*$/u,"").trimEnd()}…`}function Qt(e,n){return M(n).filter(t=>{const s=t.toLowerCase();return e.title.toLowerCase().includes(s)||e.snippet.toLowerCase().includes(s)||Ie(e.snippet,n).toLowerCase().includes(s)})}function $n(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 Rn(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 ho(e){return e.scoreSource==="hybrid"?"Words and meaning":e.scoreSource==="vector"?"Similar in meaning":"Exact words"}function wo(e,n,t){const s=Qt(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=$n(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 Io(e){const n=F(e);if(n){const s=re(n.path),o=n.recordRange;return o?`${s}#R${o[0]}-R${o[1]}`:s}const t=Ln(e);if(t){const s=re(t.path),o=t.lineRange;return o?`${s}#L${o[0]}-L${o[1]}`:s}return e.id}function Xt(e){const n=e.filter(o=>Rn(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 Zt(e){return`${e.length} more conversation turn${e.length===1?"":"s"}`}function vo(e,n={}){if(e.length===0)return[];const t=n.contextRadius??3,s=n.maxTurns??6,o=n.centerRecordIndex===void 0?-1:e.findIndex(w=>w.index===n.centerRecordIndex),r=e.findIndex(w=>w.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=[],S=0;const A=()=>{d.length!==0&&(u.push({kind:"folded",records:d,summary:Xt(d)}),d=[])},g=()=>{f.length!==0&&(u.push({kind:"folded",records:f,summary:Zt(f)}),f=[])};for(const w of a){if(Rn(w)>0){g(),d.push(w);continue}if(A(),S>=s){f.push(w);continue}u.push({kind:"turn",record:w,role:$n(w)}),S+=1}return A(),g(),u}function Fe(e){const n=F(e)?.recordRange;return n?n[0]:Number.MAX_SAFE_INTEGER}function So(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=Fe(i)-Fe(a);return u!==0?u:i.score-a.score}),r=t.get(s)?.[0]??o[0];return{collectionId:s,best:r,moments:o}})}function Pn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bo(e,n){const t=M(n);if(t.length===0||e.length===0)return[{text:e,match:!1}];const s=t.map(a=>`(?<![A-Za-z0-9_./~-])${Pn(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 Lo={sessions:"Sessions",skills:"Skills",mcp:"MCP",codebase:"Codebase",context_pack:"Context packs",mixed:"Mixed"},Cn=[{value:"1",label:"Last 24h"},{value:"3",label:"Last 3 days"},{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"}],yo=["sessions","skills","mcp","codebase","context_pack"];function Eo(){return{query:"",sourceKinds:[],harness:[],project:[],timeWindow:"all"}}function Jt(e){return e?Cn.some(n=>n.value===e):!1}function X(e){return e?e.split(",").map(n=>n.trim()).filter(n=>n.length>0):[]}function es(e){const n=e==null?new URLSearchParams:typeof e=="string"?new URLSearchParams(e):e,t=n.get("time"),s=Jt(t)?t:"all";return{query:n.get("q")?.trim()??"",sourceKinds:X(n.get("source")),harness:X(n.get("harness")),project:X(n.get("project")),timeWindow:s}}function ns(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 $o(e,n){return e.query.trim()===n.query.trim()&&e.timeWindow===n.timeWindow&&Z(e.sourceKinds,n.sourceKinds)&&Z(e.harness,n.harness)&&Z(e.project,n.project)}function Z(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 ts(e){return e.query.trim().length>0||e.sourceKinds.length>0||e.harness.length>0||e.project.length>0||e.timeWindow!=="all"}function Ro(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 Po(e){return e==="all"?"Any time":Cn.find(t=>t.value===e)?.label??e}const An=typeof window<"u"?window.location.href:"http://scout.local/";function ss(e){const n=e.toString();return new URL(n,An)}function os(e){switch(e){case"profile":case"config":case"definitions":return e==="definitions"?"config":e;case"observe":case"message":return e;default:return}}function rs(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 as(e){switch(e){case"control":case"mission":case"command":case"warroom":case"conduct":case"conductor":return"mission";case"plan":return"plan";case"issues":case"errors":case"warnings":return"issues";case"agents":case"tail":case"atop":case"lanes":return e;default:return}}function is(e){return e==="delivered"||e==="failed"||e==="all"?e:void 0}function cs(e){return e==="indexer"||e==="knowledge"?e:void 0}function us(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 ls(e){switch(e){case"tail":case"session":case"chat":case"work":return e;default:return}}function ds(e){const n=e?.trim().replace(/\.+$/u,"");return n==="observe"||n==="takeover"?n:void 0}function fs(e){const n=e?.trim().toLowerCase();return n==="pty"||n==="tmux"||n==="zellij"||n==="herdr"?n:void 0}function ms(e){const n=e?.trim().toLowerCase();return n==="shell"||n==="claude"||n==="codex"||n==="pi"?n:void 0}function ps(e){return e==="all"||e==="touched"?"all":e==="changed"?"changed":void 0}function Te(e){if(!e)return;const n=Number.parseInt(e,10);return Number.isSafeInteger(n)&&n>0?n:void 0}function Oe(e){return e==="mission"?"control":e}function gs(e){return e.searchParams.has("no-ops")?!1:typeof window>"u"?!0:rn()}function hs(e){return e==="tail"}function ws(e){return e==="lanes"}function _n(e){return hs(e)||ws(e)}const ve="machineId",Un=new Set(["inbox","conversation","agents-v2","messages","sessions","repos","harnesses","mesh","mesh-ops","activity","work","follow"]);function Is(e){return e.searchParams.get(ve)?.trim()||void 0}function vs(e,n){return!n||!Un.has(e.view)?e:{...e,machineId:n}}function Se(e){return Un.has(e.view)}function Ss(e){return"machineId"in e&&e.machineId?e.machineId:null}function xe(e,n){if(!Se(e))return e;const t={...e},s=n?.trim();return s?t.machineId=s:delete t.machineId,t}function Co(e){return Se(e)?{...e,machineId:""}:e}function bs(e,n){return Se(e)?"machineId"in e?xe(e,e.machineId??null):xe(e,Ss(n)):e}function k(e,n){"machineId"in n&&n.machineId&&e.set(ve,n.machineId)}function v(e){const n=e.toString();return n?`?${n}`:""}function O(e,n){const t=new URLSearchParams;return k(t,n),`${e}${v(t)}`}function Ls(e){return"machineId"in e&&e.machineId?`:machine:${e.machineId}`:""}function kn(e){const n=ss(e),t=n.pathname.replace(/^\/+/,"").split("/").filter(Boolean),s=Is(n),o=c=>vs(c,s),r=xt(t,n,o);if(r)return r;const i=rs(n.hash),a=os(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,S=n.searchParams.get("harness")?.trim()||void 0,A=n.searchParams.get("node")?.trim()||void 0,g=n.searchParams.get("set")?.trim(),w=g==="live"||g==="ephemeral"||g==="archived"?g:void 0,R=n.searchParams.get("view")?.trim(),U=R==="sessions"||R==="agents"?R:void 0,_=n.searchParams.get("state")?.trim(),be=_==="needs"||_==="live"||_==="idle"?_:void 0,jn=n.searchParams.get("ephemeral")==="1",W=n.searchParams.get("session")?.trim()||void 0,y=n.searchParams.get("select")?.trim()||void 0,$={...S?{harness:S}:{},...A?{node:A}:{},...w?{set:w}:{},...U?{indexView:U}:{},...be?{stateFilter:be}:{},...jn?{showEphemeral:!0}:{}};if(t[0]==="projects"){const c=t[1]?decodeURIComponent(t[1]):void 0;if(!c)return o({view:"agents-v2",...y?{selectedAgentId:y}:{},...$});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",...$});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}:{},...$})}return o({view:"agents-v2",projectSlug:c,indexView:"agents",...y?{selectedAgentId:y}:{},...$})}return t[2]==="sessions"?o({view:"agents-v2",projectSlug:c,indexView:"sessions",...t[3]?{sessionId:decodeURIComponent(t[3])}:{},...y?{selectedAgentId:y}:{},...$}):o({view:"agents-v2",projectSlug:c,...y?{selectedAgentId:y}:{},...$})}if(t[0]==="agents-v2"&&t[1]==="sessions"&&t[2])return o({view:"agents-v2",sessionId:decodeURIComponent(t[2]),...y?{selectedAgentId:y}:{},...f?{projectSlug:f}:{},...$});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}:{},...$})}if(t[0]==="agents-v2")return o({view:"agents-v2",...y?{selectedAgentId:y}:{},...f?{projectSlug:f}:{},...$});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",...$}):o({view:"agents-v2",agentId:c,...l?{sessionId:l}:{},...a?{tab:a}:{},...$})}if(t[0]==="agents")return o({view:"agents-v2",...y?{selectedAgentId:y}:{},...f?{projectSlug:f}:{},...$});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"){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(I=>I==="unstaged"||I==="staged"||I==="branch"),m=n.searchParams.getAll("file").map(I=>I.trim()).filter(Boolean),p=n.searchParams.get("sessionId")?.trim()||void 0,b=n.searchParams.get("agentId")?.trim()||void 0,E=ps(n.searchParams.get("include"));return{view:"repo-diff",path:c,...l.length>0?{layers:l}:{},...m.length>0?{files:m}:{},...p?{sessionId:p}:{},...b?{agentId:b}:{},...E?{include:E}:{}}}}if(t[0]==="search"){const c=cs(t[1]),l=n.searchParams.get("hit")?.trim()||void 0,m=es(n.searchParams);return{view:"search",...c&&c!=="knowledge"?{mode:c}:{},...l?{hitId:l}:{},...ts(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]==="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=is(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=Te(n.searchParams.get("line")),p=Te(n.searchParams.get("endLine")),b=m&&p&&p>=m?p:void 0;if(t[1]){const C=decodeURIComponent(t[1]),P=t.length>2?t.slice(2).map(decodeURIComponent).join("/"):void 0;return{view:"code",project:C,...P?{path:P}:{},...c?{wt:c}:{},...m?{line:m}:{},...b?{endLine:b}:{},...l?{returnConversationId:l}:{}}}const E=n.searchParams.get("root")?.trim()||void 0,I=n.searchParams.get("file")?.trim()||void 0;return{view:"code",...E?{root:E}:{},...I?{file:I}:{},...c?{wt:c}:{},...m?{line:m}:{},...b?{endLine:b}:{},...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=ls(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 b=n.searchParams.get("flightId"),E=n.searchParams.get("invocationId"),I=n.searchParams.get("conversationId"),C=n.searchParams.get("workId"),P=n.searchParams.get("sessionId"),Le=n.searchParams.get("targetAgentId");return b&&(l.flightId=b),E&&(l.invocationId=E),I&&(l.conversationId=I),C&&(l.workId=C),P&&(l.sessionId=P),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=us(t[1]);return{view:"settings",...c?{section:c}:{}}}if(t[0]==="terminal"){const c=ds(n.searchParams.get("mode")),l=n.searchParams.get("session")?.trim()||void 0,m=Hn(n.searchParams.get("surface"))??void 0;if(t[1]==="new"){const b=fs(n.searchParams.get("backend"))??"pty",E=ms(n.searchParams.get("agent"))??"shell",I=n.searchParams.get("name")?.trim()||void 0,C=n.searchParams.get("tab")?.trim()||void 0,P=n.searchParams.get("socketDir")?.trim()||void 0;return{view:"terminal",terminalBackend:b,terminalAgent:E,...I?{terminalSessionName:I}:{},...C?{terminalTabId:C}:{},...P?{zellijSocketDir:P}:{}}}const p=t[1]==="s"&&t[2]?Be(decodeURIComponent(t.slice(2).join("/")))?decodeURIComponent(t.slice(2).join("/")):null:Vn(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=as(t[1])??"mission";if(!_n(c)&&!gs(n))return o({view:"inbox"});const l=c==="tail"?n.searchParams.get("q")?.trim():"",m=c==="plan"?n.searchParams.get("plan")?.trim():"",p=n.searchParams.get("flightId")?.trim(),b=n.searchParams.get("invocationId")?.trim(),E=n.searchParams.get("conversationId")?.trim(),I=n.searchParams.get("workId")?.trim(),C=n.searchParams.get("sessionId")?.trim(),P=n.searchParams.get("targetAgentId")?.trim()??n.searchParams.get("agentId")?.trim();return{view:"ops",mode:c,...l?{tailQuery:l}:{},...m?{planDocumentId:m}:{},...p?{flightId:p}:{},...b?{invocationId:b}:{},...E?{conversationId:E}:{},...I?{workId:I}:{},...C?{sessionId:C}:{},...P?{targetAgentId:P}:{}}}return o({view:"inbox"})}function Fn(e,n){const t=e.view==="sessions"&&e.flightId?null:bn(e,n);if(t)return t;switch(e.view){case"inbox":return O("/",e);case"conversation":{const s=new URLSearchParams;return k(s,e),`/c/${encodeURIComponent(e.conversationId)}${v(s)}`}case"agent-info":return`/agent/${encodeURIComponent(e.conversationId)}`;case"agents-v2":{const s=new URLSearchParams;e.harness&&s.set("harness",e.harness),e.node&&s.set("node",e.node),e.set&&s.set("set",e.set),!e.projectSlug&&e.indexView&&e.indexView!=="agents"&&s.set("view",e.indexView),e.stateFilter&&s.set("state",e.stateFilter),e.showEphemeral&&s.set("ephemeral","1"),e.selectedAgentId&&!e.agentId&&!e.sessionId&&s.set("select",e.selectedAgentId);const o=e.conversationId?"message":"profile";e.agentId&&e.tab&&e.tab!==o&&s.set("tab",e.tab),k(s,e);const r=e.projectSlug?`/projects/${encodeURIComponent(e.projectSlug)}`:null;return`${r?e.agentId?e.conversationId?`${r}/agents/${encodeURIComponent(e.agentId)}/c/${encodeURIComponent(e.conversationId)}`:e.sessionId?`${r}/agents/${encodeURIComponent(e.agentId)}/sessions/${encodeURIComponent(e.sessionId)}`:`${r}/agents/${encodeURIComponent(e.agentId)}`:e.sessionId?`${r}/sessions/${encodeURIComponent(e.sessionId)}`:e.indexView==="sessions"?`${r}/sessions`:e.indexView==="agents"?`${r}/agents`:r:e.agentId?e.conversationId?`/agents/${encodeURIComponent(e.agentId)}/c/${encodeURIComponent(e.conversationId)}`:e.sessionId?`/agents/${encodeURIComponent(e.agentId)}/sessions/${encodeURIComponent(e.sessionId)}`:`/agents/${encodeURIComponent(e.agentId)}`:e.sessionId?`/sessions/${encodeURIComponent(e.sessionId)}`:"/projects"}${v(s)}`}case"messages":{const s=new URLSearchParams;return k(s,e),`${e.conversationId?`/messages/${encodeURIComponent(e.conversationId)}`:"/messages"}${v(s)}`}case"sessions":{const s=new URLSearchParams;return e.agentId&&s.set("agentId",e.agentId),e.flightId?(e.sessionId&&s.set("session",e.sessionId),e.compareSessionId&&s.set("compare",e.compareSessionId),k(s,e),`/flights/${encodeURIComponent(e.flightId)}/observe${v(s)}`):(k(s,e),`${e.sessionId?`/sessions/${encodeURIComponent(e.sessionId)}`:"/sessions"}${v(s)}`)}case"repos":{const s=new URLSearchParams;return e.root&&s.set("root",e.root),k(s,e),`/repos${v(s)}`}case"harnesses":return O("/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${v(s)}`}case"search":{const s=e.mode==="indexer"?"/search/indexer":"/search",o=e.filters?ns(e.filters,{hitId:e.hitId??null}):new URLSearchParams;return!e.filters&&e.hitId&&o.set("hit",e.hitId),`${s}${v(o)}`}case"mesh":return O("/mesh",e);case"mesh-ops":return O(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${v(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("/")}`}${v(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 O("/activity",e);case"voice":return"/voice";case"work":return O(`/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==="plan"){const s=new URLSearchParams;return e.mode==="tail"&&e.tailQuery&&s.set("q",e.tailQuery),e.mode==="plan"&&e.planDocumentId&&s.set("plan",e.planDocumentId),e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),`/ops/${Oe(e.mode)}${v(s)}`}return`/ops/${Oe(e.mode)}`;case"follow":{const s=new URLSearchParams;e.preferredView&&s.set("view",e.preferredView),e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),e.machineId&&s.set(ve,e.machineId);const o=s.toString();return`/follow${o?`?${o}`:""}`}case"terminal":if(e.agentId){const s=new URLSearchParams;return e.mode&&s.set("mode",e.mode),`/terminal/${encodeURIComponent(e.agentId)}${v(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${v(s)}`;e.mode&&s.set("mode",e.mode);const o=Yn(e.terminalSurfaceKey);return o?`/terminal/${encodeURIComponent(o.backend)}/${encodeURIComponent(o.sessionName)}${v(s)}`:Be(e.terminalSurfaceKey)?`/terminal/s/${encodeURIComponent(e.terminalSurfaceKey)}${v(s)}`:(e.terminalSessionId&&s.set("session",e.terminalSessionId),e.terminalSurfaceKey&&s.set("surface",e.terminalSurfaceKey),`/terminal${v(s)}`)}}}function N(e){const n=Ls(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 e.conversationId?`messages:${e.conversationId}${n}`:`messages${n}`;case"work":return`work:${e.workId}${n}`;case"ops":return`ops:${e.mode??"plan"}:${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 ue(kn(`${e}${n}`))}function Tn(e){return e?`#${e}`:""}function ys(e){return e.startsWith("/embed/")||e==="/ops/lanes/embed"}function De(){if(typeof window>"u"){const e=new URL(An);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 Es(e,n){return e.pathname===n.pathname&&e.searchStr===n.searchStr&&e.hash===n.hash&&Object.is(e.state,n.state)}function $s(e){let n=e.read();const t=new Set;let s=null;const o=()=>{const r=e.read();if(!Es(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=i.state===void 0?n.state:i.state;i.replace?e.replace(r,a):e.push(r,a),o()}}}function Rs(){return typeof window>"u"?{read:De,push:()=>{},replace:()=>{},observe:()=>()=>{}}:{read:De,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=$s(Rs());function Ps(){return L.useSyncExternalStore(D.subscribe,D.getSnapshot,D.getSnapshot)}function ie(e,n={}){D.navigateTo(e,n)}function On(){return typeof window>"u"?null:window.navigation??null}function xn(){if(typeof window>"u")return!1;const e=On();return e?e.canGoBack:window.history.length>1}function Cs(){if(!xn())return;const e=On();if(e){e.back();return}window.history.back()}function Ao(e){if(!e||typeof e!="object")return null;const n=e.returnTo;return!n||typeof n!="object"||typeof n.view!="string"?null:n}function _o(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 As(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 Dn(e){return e?e.replace(/^#/,""):""}function _s(e,n,t={}){const s=G(e.pathname,e.searchStr),o=bs(n,s),r=t.preserveSearch===!1?"":e.searchStr,i=Sn(Fn(o,e.pathname),r),a=Dn(t.hash);return{route:o,href:`${i}${a?`#${a}`:""}`}}function Us(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:Dn(n.hash);return`${e.pathname}${s?`?${s}`:""}${o?`#${o}`:""}`}function Uo(e){const n=D.getSnapshot(),t=Us(n,e),s=`${n.pathname}${n.searchStr}${Tn(n.hash)}`;t!==s&&ie(t,{replace:e.replace??!0,state:e.state})}function ks(e,n,t){if(ys(e))return null;const s=`${e}${n}`,o=kn(s),r=ue(o),i=Sn(Fn(r,e),n);return!(N(o)!==N(r)||r.view==="agents-v2"||s!==i)||s===i?null:`${i}${Tn(t)}`}function ko(){const{pathname:e,searchStr:n,hash:t}=Ps(),s=`${e}${n}`,o=L.useMemo(()=>G(e,n),[e,n]),r=L.useRef({}),i=L.useRef(s);L.useEffect(()=>{const f=ks(e,n,t);f&&ie(f,{replace:!0})},[e,n,t]),L.useEffect(()=>{if(i.current===s)return;const f=G(e,n);requestAnimationFrame(()=>{window.scrollTo(0,r.current[N(f)]??0)}),i.current=s},[s,e,n]);const a=L.useCallback((f,S={})=>{const A=ue(f.view==="ops"&&!rn()&&!_n(f.mode)?{view:"inbox"}:f),g=G(e,n),{route:w,href:R}=_s({pathname:e,searchStr:n},A,S);r.current[N(g)]=window.scrollY;const U=D.getSnapshot().state,_=As(U,S);ie(R,{replace:S.replace,state:_}),requestAnimationFrame(()=>{window.scrollTo(0,r.current[N(w)]??0)})},[e,n]),u=L.useCallback(()=>Cs(),[]),d=xn();return{route:o,navigate:a,navigateBack:u,canNavigateBack:d}}export{Zs as $,ge as A,F as B,fo as C,go as D,po as E,Ro as F,bo as G,Po as H,xs as I,dt as J,uo as K,lt as L,ft as M,mt as N,zs as O,Uo as P,ro as Q,vn as R,yo as S,In as T,io as U,Ys as V,Gs as W,qs as X,At as Y,Vs as Z,Rt as _,Fn as a,_t as a0,eo as a1,no as a2,Js as a3,to as a4,Qs as a5,Xs as a6,Hs as a7,cn as a8,an as a9,vo as aA,re as aB,wo as aC,ho as aD,$n as aE,Se as aa,so as ab,oo as ac,V as ad,te as ae,Ns as af,oe as ag,Q as ah,Ot as ai,Mt as aj,xt as ak,Sn as al,Bt as am,ct as an,ao,bn as ap,Ye as aq,co as ar,ko as as,Ve as at,Zn as au,Ln as av,z as aw,lo as ax,Io as ay,Rn as az,Ss as b,Co as c,Ds as d,en as e,Bs as f,le as g,Ms as h,Ws as i,Ks as j,Ps as k,Ao as l,_o as m,Eo as n,So as o,es as p,ts as q,kn as r,xe as s,$o as t,js as u,Lo as v,ht as w,Cn as x,mo as y,Kt as z};
@@ -1 +1 @@
1
- import{r,j as t,u as Ce}from"./index-DMiGbrBt.js";import{g as ke,e as Ne,s as Me,a as de,f as Re}from"./scout-voice-CU5c0LGi.js";import{createLevelHistory as Ee,energyFromPartialDelta as me,tryStartMicLevelMeter as Le,VOICE_WAVE_BARS as he}from"./voice-levels-Dcr3jglk.js";import{L as Ve}from"./loader-circle-CbHjZsz1.js";import{c as ge}from"./createLucideIcon-OpA4Amw5.js";const Ae=[["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"}]],Be=ge("mic",Ae);const _e=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Pe=ge("square",_e);function Te(e,n=!1){return e.key==="Enter"&&!e.shiftKey&&(n||!!(e.metaKey||e.ctrlKey))&&!e.nativeEvent?.isComposing}function De(e){switch(e){case"starting":return"starting";case"recording":return"recording";case"processing":return"processing";default:return"idle"}}function qe(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 fe(e){return new Promise(n=>window.setTimeout(n,e))}function Fe({onAppend:e,onError:n,onStatus:l,disabled:L,className:m}){const h=r.useRef(ke()),u=r.useRef(null),g=r.useRef(Ee(he)),K=r.useRef(null),C=r.useRef(!1),S=r.useRef(""),T=r.useRef(0),b=r.useRef(0),[v,k]=r.useState("idle"),[G,_]=r.useState(""),[J,D]=r.useState("probing"),[se,q]=r.useState(null),[R,V]=r.useState(null),[P,W]=r.useState(null),[Q,y]=r.useState(0),N=r.useCallback(()=>{b.current&&(window.cancelAnimationFrame(b.current),b.current=0),K.current?.stop(),K.current=null,C.current=!1},[]),j=r.useCallback(s=>{W(s),n?.(s)},[n]),X=r.useCallback((s,i,o)=>{l?.({state:s,partial:i,message:qe(s,i,o),tone:o?"error":s==="recording"?"recording":s==="processing"?"processing":"neutral",levels:s==="idle"&&!o?[]:g.current.snapshot(),levelsLive:C.current})},[l]);r.useEffect(()=>{X(v,G,P)},[X,P,G,v,Q]);const A=r.useCallback(async(s=!1)=>{const i=h.current;D(x=>x==="launching"?x:"probing");const o=await i.probe(s?{force:!0}:void 0);return q(o),V(null),D("idle"),o},[]);r.useEffect(()=>{Ne();const s=h.current,i=Me(o=>{q(o.ok),V(null),D("idle")});return s.connectionState==="unknown"?A():(q(s.connectionState==="connected"),V(null),D("idle")),()=>{i(),N();const o=u.current;o&&(o.cancel().catch(()=>{}),u.current=null)}},[A,N]);const B=r.useCallback(s=>{g.current.push(s),y(i=>i+1)},[]),Z=r.useCallback(()=>{if(b.current)return;let s=performance.now();const i=o=>{if(o-s>=36){s=o;const x=o-(T.current||o),w=me(S.current,S.current,x);g.current.push(Math.max(.05,w)),y(c=>c+1)}b.current=window.requestAnimationFrame(i)};b.current=window.requestAnimationFrame(i)},[]),ee=r.useCallback(async()=>{const s=h.current;W(null),_(""),S.current="",T.current=performance.now(),g.current.clear(),y(c=>c+1),k("starting"),N();let i=await de({surface:"chat-composer",requestPermissions:!0});if(!i.ready&&i.issue?.code==="microphone_not_requested"&&(await fe(1800),i=await de({surface:"chat-composer"})),!(i.ready||i.issue?.code==="microphone_not_requested")){k("idle");const c=i.issue;c?(V(c),j(Re(c))):j("Scout voice is not ready."),A(!0);return}V(null),q(!0);let x=null,w=!1;try{if(x=await s.startLive({onState:p=>k(De(p)),onPartial:p=>{const U=S.current;if(S.current=p,T.current=performance.now(),_(p),!C.current){const ce=me(U,p,0);B(ce)}},onLevel:p=>{w=!0,C.current=!0,b.current&&(window.cancelAnimationFrame(b.current),b.current=0),B(p)}}),u.current=x,k("recording"),await fe(140),u.current&&!w&&!C.current){const p=await Le(U=>{w=!0,C.current=!0,b.current&&(window.cancelAnimationFrame(b.current),b.current=0),B(U)});p&&u.current?K.current=p:u.current&&!C.current&&(C.current=!1,Z())}const c=await x.result;u.current=null,N(),k("idle");const $=S.current.trim();_(""),S.current="",W(null),g.current.clear(),y(p=>p+1);const E=c.text?.trim()||$;E?e(E):j("No speech was detected. Check your microphone in Settings → Voice."),A(!0)}catch(c){u.current=null,N(),k("idle");const $=S.current.trim();_(""),S.current="",g.current.clear(),y(p=>p+1);const E=c instanceof Error?c.message:"Scout voice recording failed.";if($){e($),c instanceof Error&&c.name==="AbortError"||j(`Recording ended early, but Scout recovered the partial transcript. ${E}`);return}if(c instanceof Error&&c.name==="AbortError")return;j(E),A(!0)}},[e,A,B,j,Z,N]),te=r.useCallback(async()=>{const s=u.current;if(!s)return;k("processing"),N();const i=window.setInterval(()=>{g.current.decay(.82),y(o=>o+1)},50);window.setTimeout(()=>window.clearInterval(i),600);try{await s.stop()}catch(o){try{await s.cancel()}catch{}u.current=null,k("idle");const x=S.current.trim();_(""),S.current="",g.current.clear(),y(c=>c+1);const w=o instanceof Error?o.message:"Scout voice recording did not finish.";x?(e(x),j(`Recording ended early, but Scout recovered the partial transcript. ${w}`)):j(w)}},[e,j,N]),ne=r.useCallback(()=>{if(v==="recording"){te();return}v==="processing"||v==="starting"||ee()},[v,ee,te]),f=v==="recording",M=J==="launching"||v==="starting"||v==="processing",z=(h.current.canRequestMicrophone||R?.action==="request_microphone"||R?.action==="request_speech")&&!f&&!M,O=(h.current.isMicrophoneHardDenied||R?.action==="open_microphone_settings")&&!f&&!M,F=(se===!1||R!==null)&&!z&&!O&&!f&&!M,I=P||(R?R.title:O?"Microphone blocked. Open Privacy & Security → Microphone to change it.":z?"Allow microphone access":F?"Scout voice is not ready":J==="probing"?"Checking voice…":f?"Stop recording":v==="processing"?"Transcribing…":v==="starting"?"Starting voice…":"Start recording"),oe=P?"s-dictation-mic--error":f?"s-dictation-mic--recording":O?"s-dictation-mic--error":z?"s-dictation-mic--needs-permission":F?"s-dictation-mic--unavailable":M?"s-dictation-mic--busy":"",H=M?Ve:f?Pe:Be,d=f?12:14;return t.jsx("button",{type:"button",title:I,"aria-label":I,"aria-pressed":f,onClick:ne,disabled:L||v==="processing",className:["s-dictation-mic",oe,m].filter(Boolean).join(" "),children:t.jsx(H,{size:d,className:M?"s-dictation-mic-spin":f?"fill-current":""})})}function Ie({samples:e,active:n,processing:l=!1,className:L}){const m=$e(e,he,l?.06:.04),h=["s-msg-compose-wave",n?"s-msg-compose-wave--live":"",l?"s-msg-compose-wave--processing":"",L??""].filter(Boolean).join(" ");return t.jsx("div",{className:h,"aria-hidden":"true","data-wave-source":e&&e.length>0?"levels":"floor",children:m.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 $e(e,n,l){if(!e||e.length===0)return Array.from({length:n},()=>l);if(e.length===n)return e.map(m=>Math.max(l,Math.min(1,m)));const L=new Array(n);for(let m=0;m<n;m+=1){const h=Math.min(e.length-1,Math.round(m/Math.max(1,n-1)*(e.length-1)));L[m]=Math.max(l,Math.min(1,e[h]??l))}return L}function Ke(){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 We(){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 pe(e,n){e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,n)}px`}function Oe(e){return e.tone==="error"?"Voice":e.state==="recording"?"Listening":e.state==="processing"?"Transcribing":e.state==="starting"?"Starting":"Voice"}function Xe({renderWhenEmbedded:e=!1,...n}){return Ce()&&!e?null:t.jsx(He,{...n})}function He({value:e,onChange:n,onSend:l,placeholder:L="Type a message…",disabled:m=!1,sending:h=!1,canSend:u,stopMode:g=!1,onStop:K,sendTitle:C="Send (Cmd+Enter)",sendAriaLabel:S="Send message (Cmd+Enter)",stopAriaLabel:T="Stop agent",showDictation:b=!0,onDictationStatusChange:v,showAttach:k=!1,onAttach:G,attachTitle:_="Add attachment",attachAriaLabel:J="Add attachment",onPaste:D,dropHandlers:se,dragActive:q=!1,secondaryAction:R,leadingTools:V,tools:P,footer:W,header:Q,above:y,aboveAttached:N=!1,input:j,overlay:X,status:A,textareaRef:B,onKeyDown:Z,sendOnEnter:ee=!1,onSelect:te,onBlur:ne,density:f="panel",as:M="form",className:z,rows:O=1,autoResize:F=!0,maxHeightPx:I=160,"aria-label":oe="Message"}){const H=r.useRef(null),[d,s]=r.useState(null),i=r.useCallback(a=>{H.current=a,B&&(B.current=a)},[B]);r.useEffect(()=>{if(!F)return;const a=H.current;a&&pe(a,I)},[e,F,I]);const o=(u??e.trim().length>0)&&!h&&!m,x=P??W,w=d?.state==="recording"||d?.state==="starting",c=d?.state==="processing",$=!!(d&&(d.tone==="error"||w||c||d.partial&&d.partial.trim())),E=r.useCallback(()=>{g||!(u??e.trim().length>0)||h||m||l()},[u,m,l,h,g,e]),p=a=>{a.preventDefault(),E()},U=a=>{if(Z?.(a)){a.preventDefault();return}if(Te(a,ee)){a.preventDefault(),E();return}},ce=a=>{const Y=a.target.value;n(Y,{caret:a.target.selectionStart??Y.length}),F&&pe(a.target,I)},ve=a=>{const Y=e.trim()?`${e.trimEnd()} ${a}`:a;n(Y,{caret:Y.length}),requestAnimationFrame(()=>H.current?.focus())},be=r.useCallback(a=>{s(a),v?.(a)},[v]),ie=["s-msg-compose",`s-msg-compose--${f}`,f==="thread"?"s-thread-compose":"",z??""].filter(Boolean).join(" "),xe=["s-msg-compose-shell",f==="thread"?"s-thread-compose-shell":""].filter(Boolean).join(" "),Se=["s-msg-compose-input",f==="thread"?"s-thread-compose-input":""].filter(Boolean).join(" "),ae=["s-msg-compose-send",f==="thread"?"s-thread-compose-send":"",g?"s-msg-compose-send--agent-stop s-thread-compose-send--stop":""].filter(Boolean).join(" "),we=["s-msg-compose-voice",d?.tone==="recording"||w?"s-msg-compose-voice--recording":"",d?.tone==="processing"||c?"s-msg-compose-voice--processing":"",d?.tone==="error"?"s-msg-compose-voice--error":""].filter(Boolean).join(" "),re=d?.tone==="error",ye=d?.partial?.trim()||null,le=re?d?.message:c?"Finalizing transcript…":ye,je=t.jsxs("div",{className:xe,"data-drag-active":q?"true":void 0,...se,children:[Q?t.jsx("div",{className:"s-msg-compose-header",children:Q}):null,t.jsxs("div",{className:"s-msg-compose-body",children:[j??t.jsx("textarea",{ref:i,className:Se,placeholder:L,value:e,disabled:m,rows:O,"aria-label":oe,onChange:ce,onKeyDown:U,onSelect:te,onBlur:ne,onPaste:D}),$?t.jsxs("div",{className:we,role:re?"alert":"status","aria-live":re?"assertive":"polite",children:[!re&&(w||c)?t.jsx(Ie,{samples:d?.levels,active:w,processing:c}):null,t.jsxs("div",{className:"s-msg-compose-voice-meta",children:[t.jsx("span",{className:"s-msg-compose-voice-label",children:d?Oe(d):"Voice"}),le?t.jsx("span",{className:"s-msg-compose-voice-text",children:le}):null]})]}):null]}),t.jsxs("div",{className:["s-msg-compose-toolbar",f==="thread"?"s-thread-compose-footer":""].filter(Boolean).join(" "),children:[t.jsxs("div",{className:"s-msg-compose-toolbar-start",children:[V,k?t.jsx("button",{type:"button",className:"s-msg-compose-icon-btn",title:_,"aria-label":J,disabled:m||h,onClick:G,children:t.jsx(ze,{})}):V?null:t.jsx("span",{className:"s-msg-compose-toolbar-spacer","aria-hidden":"true"})]}),t.jsxs("div",{className:"s-msg-compose-toolbar-end",children:[x?t.jsx("div",{className:"s-msg-compose-tools",children:x}):null,b?t.jsx(Fe,{onAppend:ve,onStatus:be,disabled:m||h}):null,R?t.jsx("div",{className:"s-msg-compose-secondary",children:R}):null,g?t.jsx("button",{type:"button",className:ae,onClick:K,title:T,"aria-label":T,children:t.jsx(We,{})}):t.jsx("button",{type:M==="form"?"submit":"button",className:ae,disabled:!o,title:C,"aria-label":S,"data-action":"send",onClick:M==="div"?()=>E():void 0,children:t.jsx(Ke,{})})]})]}),A]}),ue=t.jsxs("div",{className:"s-msg-compose-frame","data-above-attached":y&&N?"true":void 0,children:[X,y?t.jsx("div",{className:"s-msg-compose-above",children:y}):null,je]});return M==="div"?t.jsx("div",{className:ie,children:ue}):t.jsx("form",{className:ie,onSubmit:p,children:ue})}export{Fe as D,Xe as M,Pe as S,Be as a,Te as i};
1
+ import{r,j as t,u as Ce}from"./index-CzVeWScw.js";import{g as ke,e as Ne,s as Me,a as de,f as Re}from"./scout-voice-S5_YZ2v8.js";import{createLevelHistory as Ee,energyFromPartialDelta as me,tryStartMicLevelMeter as Le,VOICE_WAVE_BARS as he}from"./voice-levels-Dcr3jglk.js";import{L as Ve}from"./loader-circle-Byb9kSFx.js";import{c as ge}from"./createLucideIcon-ClCdc3F9.js";const Ae=[["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"}]],Be=ge("mic",Ae);const _e=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Pe=ge("square",_e);function Te(e,n=!1){return e.key==="Enter"&&!e.shiftKey&&(n||!!(e.metaKey||e.ctrlKey))&&!e.nativeEvent?.isComposing}function De(e){switch(e){case"starting":return"starting";case"recording":return"recording";case"processing":return"processing";default:return"idle"}}function qe(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 fe(e){return new Promise(n=>window.setTimeout(n,e))}function Fe({onAppend:e,onError:n,onStatus:l,disabled:L,className:m}){const h=r.useRef(ke()),u=r.useRef(null),g=r.useRef(Ee(he)),K=r.useRef(null),C=r.useRef(!1),S=r.useRef(""),T=r.useRef(0),b=r.useRef(0),[v,k]=r.useState("idle"),[G,_]=r.useState(""),[J,D]=r.useState("probing"),[se,q]=r.useState(null),[R,V]=r.useState(null),[P,W]=r.useState(null),[Q,y]=r.useState(0),N=r.useCallback(()=>{b.current&&(window.cancelAnimationFrame(b.current),b.current=0),K.current?.stop(),K.current=null,C.current=!1},[]),j=r.useCallback(s=>{W(s),n?.(s)},[n]),X=r.useCallback((s,i,o)=>{l?.({state:s,partial:i,message:qe(s,i,o),tone:o?"error":s==="recording"?"recording":s==="processing"?"processing":"neutral",levels:s==="idle"&&!o?[]:g.current.snapshot(),levelsLive:C.current})},[l]);r.useEffect(()=>{X(v,G,P)},[X,P,G,v,Q]);const A=r.useCallback(async(s=!1)=>{const i=h.current;D(x=>x==="launching"?x:"probing");const o=await i.probe(s?{force:!0}:void 0);return q(o),V(null),D("idle"),o},[]);r.useEffect(()=>{Ne();const s=h.current,i=Me(o=>{q(o.ok),V(null),D("idle")});return s.connectionState==="unknown"?A():(q(s.connectionState==="connected"),V(null),D("idle")),()=>{i(),N();const o=u.current;o&&(o.cancel().catch(()=>{}),u.current=null)}},[A,N]);const B=r.useCallback(s=>{g.current.push(s),y(i=>i+1)},[]),Z=r.useCallback(()=>{if(b.current)return;let s=performance.now();const i=o=>{if(o-s>=36){s=o;const x=o-(T.current||o),w=me(S.current,S.current,x);g.current.push(Math.max(.05,w)),y(c=>c+1)}b.current=window.requestAnimationFrame(i)};b.current=window.requestAnimationFrame(i)},[]),ee=r.useCallback(async()=>{const s=h.current;W(null),_(""),S.current="",T.current=performance.now(),g.current.clear(),y(c=>c+1),k("starting"),N();let i=await de({surface:"chat-composer",requestPermissions:!0});if(!i.ready&&i.issue?.code==="microphone_not_requested"&&(await fe(1800),i=await de({surface:"chat-composer"})),!(i.ready||i.issue?.code==="microphone_not_requested")){k("idle");const c=i.issue;c?(V(c),j(Re(c))):j("Scout voice is not ready."),A(!0);return}V(null),q(!0);let x=null,w=!1;try{if(x=await s.startLive({onState:p=>k(De(p)),onPartial:p=>{const U=S.current;if(S.current=p,T.current=performance.now(),_(p),!C.current){const ce=me(U,p,0);B(ce)}},onLevel:p=>{w=!0,C.current=!0,b.current&&(window.cancelAnimationFrame(b.current),b.current=0),B(p)}}),u.current=x,k("recording"),await fe(140),u.current&&!w&&!C.current){const p=await Le(U=>{w=!0,C.current=!0,b.current&&(window.cancelAnimationFrame(b.current),b.current=0),B(U)});p&&u.current?K.current=p:u.current&&!C.current&&(C.current=!1,Z())}const c=await x.result;u.current=null,N(),k("idle");const $=S.current.trim();_(""),S.current="",W(null),g.current.clear(),y(p=>p+1);const E=c.text?.trim()||$;E?e(E):j("No speech was detected. Check your microphone in Settings → Voice."),A(!0)}catch(c){u.current=null,N(),k("idle");const $=S.current.trim();_(""),S.current="",g.current.clear(),y(p=>p+1);const E=c instanceof Error?c.message:"Scout voice recording failed.";if($){e($),c instanceof Error&&c.name==="AbortError"||j(`Recording ended early, but Scout recovered the partial transcript. ${E}`);return}if(c instanceof Error&&c.name==="AbortError")return;j(E),A(!0)}},[e,A,B,j,Z,N]),te=r.useCallback(async()=>{const s=u.current;if(!s)return;k("processing"),N();const i=window.setInterval(()=>{g.current.decay(.82),y(o=>o+1)},50);window.setTimeout(()=>window.clearInterval(i),600);try{await s.stop()}catch(o){try{await s.cancel()}catch{}u.current=null,k("idle");const x=S.current.trim();_(""),S.current="",g.current.clear(),y(c=>c+1);const w=o instanceof Error?o.message:"Scout voice recording did not finish.";x?(e(x),j(`Recording ended early, but Scout recovered the partial transcript. ${w}`)):j(w)}},[e,j,N]),ne=r.useCallback(()=>{if(v==="recording"){te();return}v==="processing"||v==="starting"||ee()},[v,ee,te]),f=v==="recording",M=J==="launching"||v==="starting"||v==="processing",z=(h.current.canRequestMicrophone||R?.action==="request_microphone"||R?.action==="request_speech")&&!f&&!M,O=(h.current.isMicrophoneHardDenied||R?.action==="open_microphone_settings")&&!f&&!M,F=(se===!1||R!==null)&&!z&&!O&&!f&&!M,I=P||(R?R.title:O?"Microphone blocked. Open Privacy & Security → Microphone to change it.":z?"Allow microphone access":F?"Scout voice is not ready":J==="probing"?"Checking voice…":f?"Stop recording":v==="processing"?"Transcribing…":v==="starting"?"Starting voice…":"Start recording"),oe=P?"s-dictation-mic--error":f?"s-dictation-mic--recording":O?"s-dictation-mic--error":z?"s-dictation-mic--needs-permission":F?"s-dictation-mic--unavailable":M?"s-dictation-mic--busy":"",H=M?Ve:f?Pe:Be,d=f?12:14;return t.jsx("button",{type:"button",title:I,"aria-label":I,"aria-pressed":f,onClick:ne,disabled:L||v==="processing",className:["s-dictation-mic",oe,m].filter(Boolean).join(" "),children:t.jsx(H,{size:d,className:M?"s-dictation-mic-spin":f?"fill-current":""})})}function Ie({samples:e,active:n,processing:l=!1,className:L}){const m=$e(e,he,l?.06:.04),h=["s-msg-compose-wave",n?"s-msg-compose-wave--live":"",l?"s-msg-compose-wave--processing":"",L??""].filter(Boolean).join(" ");return t.jsx("div",{className:h,"aria-hidden":"true","data-wave-source":e&&e.length>0?"levels":"floor",children:m.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 $e(e,n,l){if(!e||e.length===0)return Array.from({length:n},()=>l);if(e.length===n)return e.map(m=>Math.max(l,Math.min(1,m)));const L=new Array(n);for(let m=0;m<n;m+=1){const h=Math.min(e.length-1,Math.round(m/Math.max(1,n-1)*(e.length-1)));L[m]=Math.max(l,Math.min(1,e[h]??l))}return L}function Ke(){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 We(){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 pe(e,n){e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,n)}px`}function Oe(e){return e.tone==="error"?"Voice":e.state==="recording"?"Listening":e.state==="processing"?"Transcribing":e.state==="starting"?"Starting":"Voice"}function Xe({renderWhenEmbedded:e=!1,...n}){return Ce()&&!e?null:t.jsx(He,{...n})}function He({value:e,onChange:n,onSend:l,placeholder:L="Type a message…",disabled:m=!1,sending:h=!1,canSend:u,stopMode:g=!1,onStop:K,sendTitle:C="Send (Cmd+Enter)",sendAriaLabel:S="Send message (Cmd+Enter)",stopAriaLabel:T="Stop agent",showDictation:b=!0,onDictationStatusChange:v,showAttach:k=!1,onAttach:G,attachTitle:_="Add attachment",attachAriaLabel:J="Add attachment",onPaste:D,dropHandlers:se,dragActive:q=!1,secondaryAction:R,leadingTools:V,tools:P,footer:W,header:Q,above:y,aboveAttached:N=!1,input:j,overlay:X,status:A,textareaRef:B,onKeyDown:Z,sendOnEnter:ee=!1,onSelect:te,onBlur:ne,density:f="panel",as:M="form",className:z,rows:O=1,autoResize:F=!0,maxHeightPx:I=160,"aria-label":oe="Message"}){const H=r.useRef(null),[d,s]=r.useState(null),i=r.useCallback(a=>{H.current=a,B&&(B.current=a)},[B]);r.useEffect(()=>{if(!F)return;const a=H.current;a&&pe(a,I)},[e,F,I]);const o=(u??e.trim().length>0)&&!h&&!m,x=P??W,w=d?.state==="recording"||d?.state==="starting",c=d?.state==="processing",$=!!(d&&(d.tone==="error"||w||c||d.partial&&d.partial.trim())),E=r.useCallback(()=>{g||!(u??e.trim().length>0)||h||m||l()},[u,m,l,h,g,e]),p=a=>{a.preventDefault(),E()},U=a=>{if(Z?.(a)){a.preventDefault();return}if(Te(a,ee)){a.preventDefault(),E();return}},ce=a=>{const Y=a.target.value;n(Y,{caret:a.target.selectionStart??Y.length}),F&&pe(a.target,I)},ve=a=>{const Y=e.trim()?`${e.trimEnd()} ${a}`:a;n(Y,{caret:Y.length}),requestAnimationFrame(()=>H.current?.focus())},be=r.useCallback(a=>{s(a),v?.(a)},[v]),ie=["s-msg-compose",`s-msg-compose--${f}`,f==="thread"?"s-thread-compose":"",z??""].filter(Boolean).join(" "),xe=["s-msg-compose-shell",f==="thread"?"s-thread-compose-shell":""].filter(Boolean).join(" "),Se=["s-msg-compose-input",f==="thread"?"s-thread-compose-input":""].filter(Boolean).join(" "),ae=["s-msg-compose-send",f==="thread"?"s-thread-compose-send":"",g?"s-msg-compose-send--agent-stop s-thread-compose-send--stop":""].filter(Boolean).join(" "),we=["s-msg-compose-voice",d?.tone==="recording"||w?"s-msg-compose-voice--recording":"",d?.tone==="processing"||c?"s-msg-compose-voice--processing":"",d?.tone==="error"?"s-msg-compose-voice--error":""].filter(Boolean).join(" "),re=d?.tone==="error",ye=d?.partial?.trim()||null,le=re?d?.message:c?"Finalizing transcript…":ye,je=t.jsxs("div",{className:xe,"data-drag-active":q?"true":void 0,...se,children:[Q?t.jsx("div",{className:"s-msg-compose-header",children:Q}):null,t.jsxs("div",{className:"s-msg-compose-body",children:[j??t.jsx("textarea",{ref:i,className:Se,placeholder:L,value:e,disabled:m,rows:O,"aria-label":oe,onChange:ce,onKeyDown:U,onSelect:te,onBlur:ne,onPaste:D}),$?t.jsxs("div",{className:we,role:re?"alert":"status","aria-live":re?"assertive":"polite",children:[!re&&(w||c)?t.jsx(Ie,{samples:d?.levels,active:w,processing:c}):null,t.jsxs("div",{className:"s-msg-compose-voice-meta",children:[t.jsx("span",{className:"s-msg-compose-voice-label",children:d?Oe(d):"Voice"}),le?t.jsx("span",{className:"s-msg-compose-voice-text",children:le}):null]})]}):null]}),t.jsxs("div",{className:["s-msg-compose-toolbar",f==="thread"?"s-thread-compose-footer":""].filter(Boolean).join(" "),children:[t.jsxs("div",{className:"s-msg-compose-toolbar-start",children:[V,k?t.jsx("button",{type:"button",className:"s-msg-compose-icon-btn",title:_,"aria-label":J,disabled:m||h,onClick:G,children:t.jsx(ze,{})}):V?null:t.jsx("span",{className:"s-msg-compose-toolbar-spacer","aria-hidden":"true"})]}),t.jsxs("div",{className:"s-msg-compose-toolbar-end",children:[x?t.jsx("div",{className:"s-msg-compose-tools",children:x}):null,b?t.jsx(Fe,{onAppend:ve,onStatus:be,disabled:m||h}):null,R?t.jsx("div",{className:"s-msg-compose-secondary",children:R}):null,g?t.jsx("button",{type:"button",className:ae,onClick:K,title:T,"aria-label":T,children:t.jsx(We,{})}):t.jsx("button",{type:M==="form"?"submit":"button",className:ae,disabled:!o,title:C,"aria-label":S,"data-action":"send",onClick:M==="div"?()=>E():void 0,children:t.jsx(Ke,{})})]})]}),A]}),ue=t.jsxs("div",{className:"s-msg-compose-frame","data-above-attached":y&&N?"true":void 0,children:[X,y?t.jsx("div",{className:"s-msg-compose-above",children:y}):null,je]});return M==="div"?t.jsx("div",{className:ie,children:ue}):t.jsx("form",{className:ie,onSubmit:p,children:ue})}export{Fe as D,Xe as M,Pe as S,Be as a,Te as i};
@@ -1 +1 @@
1
- import{k as a,s as m,l as n,m as r,r as l}from"./index-DMiGbrBt.js";import{m as p,n as i,o as c,e as E,p as S}from"./router-Bq5dwf78.js";const _={path:m(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 l.useEffect(()=>(t?document.documentElement.setAttribute("data-scope-presentation",""):document.documentElement.removeAttribute("data-scope-presentation"),()=>document.documentElement.removeAttribute("data-scope-presentation")),[t]),{active:t,brandLabel:t?d(e.route):r}}function O(){return c(typeof window<"u"?window.location.pathname:"")}export{b as S,u as a,_ as b,d as c,L as d,O as i,A as s,P as u};
1
+ import{k as a,s as l,l as n,m as r,r as m}from"./index-CzVeWScw.js";import{Q as p,R as i,T as c,k as E,U as S}from"./router-B-K15T7B.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 +1 @@
1
- import{_ as x}from"./index-DMiGbrBt.js";import{b as k,p as D,V as A,D as q}from"./fx-z37u1o2z.js";function le(t){return t?t.hint?`${t.message} ${t.hint}`:t.message:"Scout voice is unavailable."}async function pe(t={}){const e=await fetch("/api/voice/engage",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(e.status===404)return j(t);if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(g(n,e.status))}return await e.json()}async function j(t={}){const e=await ce(),n=e.settings,i=e.devices,r=i.length>0||(n.permissions?.length??0)>0,o=n.permissions?.find(f=>f.kind==="microphone")??null,a=n.permissions?.find(f=>f.kind==="speechRecognition")??null,u=U(n,i);if(t.requestPermissions&&(o&&!o.granted&&o.status!=="restricted"?await C("microphone").catch(()=>{}):(o?.granted??!1)&&a&&!a.granted&&a.status!=="restricted"&&await C("speechRecognition").catch(()=>{})),!r)return{ready:!1,issue:{code:"host_offline",title:"Scout Menu is not running",message:"Launch Scout Menu on this Mac to dictate in web chat.",hint:"Restart the web server if you just updated Scout — `scout server restart` or restart `bun run server/index.ts`.",action:"launch_host"},warnings:[],settings:n,devices:i,inputDevice:null,hostOnline:!1};const h=$(o);if(h)return{ready:!1,issue:h,warnings:[],settings:n,devices:i,inputDevice:u,hostOnline:r};if(!u)return{ready:!1,issue:{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"},warnings:[],settings:n,devices:i,inputDevice:null,hostOnline:r};const d=F(a);return{ready:!0,issue:null,warnings:d?[d]:[],settings:n,devices:i,inputDevice:u,hostOnline:r}}function U(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 $(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"}:{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"}}function F(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.",hint:"Request access to show the macOS prompt.",action:"request_speech"}:{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"}}function N(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 H=6e4,G=3e3,J=2e4,z=8e3,B=45e3;let M=null,E=null,l=null,_=!1;const R=new Set;function W(){return typeof window>"u"?!1:typeof fetch=="function"}function X(){return M||(M=new K),M}function he(t){return R.add(t),l&&t(l),()=>{R.delete(t)}}function fe(){if(_||!W())return;_=!0;const t=X();t.probe();const e=()=>{t.probeIfStale()};window.addEventListener("focus",e),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function I(t){for(const e of R)e(t)}function O(t,e=Date.now()){const n=t.ok?J:z;return e-t.probedAt<n}class K{state="unknown";unavailableReason=null;captureMode=null;hostReachable=!1;microphoneGranted=null;microphoneCanRequest=null;get connectionState(){return this.state}get lastUnavailableReason(){return this.unavailableReason}get preferredCaptureMode(){return this.captureMode}get isVoiceHostReachable(){return this.hostReachable}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&&O(l,e)?(this.applyProbeSnapshot(l),l.ok):l&&l.ok&&e-l.probedAt<B?(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??G,o=Date.now();return!i&&l&&O(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(()=>({})),a=!!o.host?.hostId,u=typeof o.microphoneGranted=="boolean"?o.microphoneGranted:null,h=typeof o.microphoneCanRequest=="boolean"?o.microphoneCanRequest:null,d=o.capture==="browser"?"browser":"native",f=r.ok&&o.ok===!0,v=f?null:o.detail??o.error??(a?"Scout voice is not ready.":"Scout voice service is unavailable."),w={ok:f,reason:v,captureMode:f?d:null,hostReachable:a,microphoneGranted:u,microphoneCanRequest:h,probedAt:Date.now()};return l=w,this.applyProbeSnapshot(w),I(w),f}catch(r){const a={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,probedAt:Date.now()};return l=a,this.applyProbeSnapshot(a),I(a),!1}finally{window.clearTimeout(i)}}applyProbeSnapshot(e){if(this.hostReachable=e.hostReachable,this.microphoneGranted=e.microphoneGranted,this.microphoneCanRequest=e.microphoneCanRequest,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={}){try{const i=await(await fetch("/api/scout-services/restart-link",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({target:"all"})})).json().catch(()=>({}));if(i.url?.startsWith("scout://services/restart/")){window.location.href=i.url;return}}catch{}window.location.href="scout://hud/show"}async startLive(e={},n={}){return this.captureMode!=="browser"?await Q(e,n):await Y(e)}}async function Q(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 s=await n.text().catch(()=>"");throw new Error(g(s,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,a,u;const h=new Promise((s,p)=>{a=s,u=p});let d=null;const f=()=>{d&&window.clearTimeout(d),d=window.setTimeout(()=>{w(new Error("Scout voice transcription timed out. Try again or check voice settings."))},H)},v=()=>{d&&(window.clearTimeout(d),d=null)},w=(s,p="error")=>{o||(o=!0,v(),m.close(),t.onState?.(p),u(s))},y=s=>{o||(o=!0,v(),m.close(),t.onFinal?.(s),t.onState?.("done"),a(s))},m=new EventSource(`/api/voice/session/${encodeURIComponent(r)}/events`),c=s=>p=>{if(o)return;let S={};try{S=JSON.parse(p.data)}catch{return}if(s==="session.partial"){const b=typeof S.text=="string"?S.text:"";t.onPartial?.(b);return}if(s==="session.state"){const b=Z(S.state);b&&(t.onState?.(b),b==="processing"&&f());return}if(s==="session.final"){y({sessionId:r,text:typeof S.text=="string"?S.text.trim():"",durationMs:Number(S.durationMs??0)});return}if(s==="session.cancelled"){w(T(),"cancelled");return}if(s==="session.error"){const b=typeof S.message=="string"?S.message:"Scout voice session failed.",L=typeof S.code=="string"?S.code:null;w(new Error(N(b,L)))}};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||w(new Error("Scout voice event stream disconnected."))},{get sessionId(){return r},result:h,stop:async()=>{t.onState?.("processing"),f();const s=await fetch(`/api/voice/session/${encodeURIComponent(r)}/stop`,{method:"POST"});if(!s.ok){const p=await s.text().catch(()=>"");throw new Error(g(p,s.status))}},cancel:async()=>{o=!0,v(),m.close();const s=await fetch(`/api/voice/session/${encodeURIComponent(r)}/cancel`,{method:"POST"});if(!s.ok){const p=await s.text().catch(()=>"");throw new Error(g(p,s.status))}t.onState?.("cancelled"),u(T())}}}async function Y(t={}){if(typeof MediaRecorder>"u"||!navigator.mediaDevices?.getUserMedia)throw new Error("Scout voice capture is unavailable in this browser.");const{startStreamLevelMeter:e}=await x(async()=>{const{startStreamLevelMeter:c}=await import("./voice-levels-Dcr3jglk.js");return{startStreamLevelMeter:c}},[]),n=ae(),i=[];let r=null,o=null,a=null,u=!1,h=!1,d,f;const v=new Promise((c,s)=>{d=c,f=s}),w=()=>{a?.stop(),a=null;for(const c of r?.getTracks()??[])c.stop();r=null},y=(c,s="error")=>{h||(h=!0,w(),t.onState?.(s),f(c))},m=async()=>{if(h)return;if(w(),u){y(T(),"cancelled");return}t.onState?.("processing");const c=o?.mimeType||V()||"application/octet-stream",s=new Blob(i,{type:c});if(s.size===0){y(new Error("No voice audio was captured."));return}try{const p=await ne(s,{sessionId:n});if(h)return;h=!0,t.onFinal?.(p),t.onState?.("done"),d(p)}catch(p){y(p instanceof Error?p:new Error(String(p)))}};try{t.onState?.("starting"),r=await navigator.mediaDevices.getUserMedia({audio:!0}),t.onLevel&&(a=e(r,t.onLevel));const c=V();o=new MediaRecorder(r,c?{mimeType:c}:void 0),o.addEventListener("dataavailable",s=>{s.data.size>0&&i.push(s.data)}),o.addEventListener("error",()=>{y(new Error("Scout voice recorder failed."))}),o.addEventListener("stop",()=>{m()},{once:!0}),o.start(),t.onPartial?.(""),t.onState?.("recording")}catch(c){const s=c instanceof Error?c:new Error(String(c));throw y(s),v.catch(()=>{}),s}return{get sessionId(){return n},result:v,stop:async()=>{!o||o.state==="inactive"||o.stop()},cancel:async()=>{if(u=!0,o&&o.state!=="inactive"){o.stop();return}y(T(),"cancelled")}}}function Z(t){return t==="starting"||t==="recording"||t==="processing"||t==="done"||t==="cancelled"||t==="error"?t:null}function g(t,e){try{return JSON.parse(t).error??`Scout voice returned HTTP ${e}`}catch{return t||`Scout voice returned HTTP ${e}`}}function me(t){return t instanceof Error&&t.name==="AbortError"}async function ee(t,e={}){const n={text:t,speed:se(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);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 we(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()}async function Se(t,e={}){if(e.signal?.aborted)throw P();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 a=()=>{n.removeEventListener("ended",u),n.removeEventListener("error",h),e.signal?.removeEventListener("abort",d)},u=()=>{a(),r()},h=()=>{a(),o(new Error("Scout voice playback failed."))},d=()=>{a(),o(P())};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 te(t,e={}){const n=await ee(t,e);if(e.signal?.aborted)throw P();const i=await k(n.audioBase64,n.contentType),r=ie(e.presetId,e.params);return await D(i,{params:r,signal:e.signal}).promise,n}function ge(t,e={}){const n=new AbortController;return{promise:te(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function ne(t,e){const n=new FormData,i=oe(t.type);n.append("audio",t,`audio.${re(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 a=await r.text().catch(()=>"");try{const u=JSON.parse(a);throw new Error(u.error??`Scout voice returned HTTP ${r.status}`)}catch(u){throw u instanceof SyntaxError?new Error(a||`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 P(){const t=new Error("Speech stopped.");return t.name="AbortError",t}function T(){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 oe(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 re(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 ie(t,e){const n=t?A.find(i=>i.id===t)?.params:void 0;return{...q,...n??{},...e??{}}}function se(t){if(!(t===void 0||!Number.isFinite(t)))return Math.min(2,Math.max(.5,Number(t.toFixed(2))))}function ae(){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 ce(){const t=await fetch("/api/voice/settings");if(!t.ok){const e=await t.text().catch(()=>"");throw new Error(g(e,t.status))}return await t.json()}async function ve(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(g(n,e.status))}}async function C(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(g(n,e.status))}}async function ye(t=12){const e=await fetch(`/api/voice/history?limit=${t}`);if(!e.ok){const i=await e.text().catch(()=>"");throw new Error(g(i,e.status))}return(await e.json()).sessions??[]}async function be(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(g(n,e.status))}return await e.json()}export{pe as a,we as b,Se as c,ge as d,fe as e,le as f,X as g,ce as h,me as i,ye as j,be as k,ve as o,ee as p,C as r,he as s};
1
+ import{_ as x}from"./index-CzVeWScw.js";import{b as k,p as D,V as A,D as q}from"./fx-z37u1o2z.js";function le(t){return t?t.hint?`${t.message} ${t.hint}`:t.message:"Scout voice is unavailable."}async function pe(t={}){const e=await fetch("/api/voice/engage",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(e.status===404)return j(t);if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(g(n,e.status))}return await e.json()}async function j(t={}){const e=await ce(),n=e.settings,i=e.devices,r=i.length>0||(n.permissions?.length??0)>0,o=n.permissions?.find(f=>f.kind==="microphone")??null,a=n.permissions?.find(f=>f.kind==="speechRecognition")??null,u=U(n,i);if(t.requestPermissions&&(o&&!o.granted&&o.status!=="restricted"?await C("microphone").catch(()=>{}):(o?.granted??!1)&&a&&!a.granted&&a.status!=="restricted"&&await C("speechRecognition").catch(()=>{})),!r)return{ready:!1,issue:{code:"host_offline",title:"Scout Menu is not running",message:"Launch Scout Menu on this Mac to dictate in web chat.",hint:"Restart the web server if you just updated Scout — `scout server restart` or restart `bun run server/index.ts`.",action:"launch_host"},warnings:[],settings:n,devices:i,inputDevice:null,hostOnline:!1};const h=$(o);if(h)return{ready:!1,issue:h,warnings:[],settings:n,devices:i,inputDevice:u,hostOnline:r};if(!u)return{ready:!1,issue:{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"},warnings:[],settings:n,devices:i,inputDevice:null,hostOnline:r};const d=F(a);return{ready:!0,issue:null,warnings:d?[d]:[],settings:n,devices:i,inputDevice:u,hostOnline:r}}function U(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 $(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"}:{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"}}function F(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.",hint:"Request access to show the macOS prompt.",action:"request_speech"}:{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"}}function N(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 H=6e4,G=3e3,J=2e4,z=8e3,B=45e3;let M=null,E=null,l=null,_=!1;const R=new Set;function W(){return typeof window>"u"?!1:typeof fetch=="function"}function X(){return M||(M=new K),M}function he(t){return R.add(t),l&&t(l),()=>{R.delete(t)}}function fe(){if(_||!W())return;_=!0;const t=X();t.probe();const e=()=>{t.probeIfStale()};window.addEventListener("focus",e),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function I(t){for(const e of R)e(t)}function O(t,e=Date.now()){const n=t.ok?J:z;return e-t.probedAt<n}class K{state="unknown";unavailableReason=null;captureMode=null;hostReachable=!1;microphoneGranted=null;microphoneCanRequest=null;get connectionState(){return this.state}get lastUnavailableReason(){return this.unavailableReason}get preferredCaptureMode(){return this.captureMode}get isVoiceHostReachable(){return this.hostReachable}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&&O(l,e)?(this.applyProbeSnapshot(l),l.ok):l&&l.ok&&e-l.probedAt<B?(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??G,o=Date.now();return!i&&l&&O(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(()=>({})),a=!!o.host?.hostId,u=typeof o.microphoneGranted=="boolean"?o.microphoneGranted:null,h=typeof o.microphoneCanRequest=="boolean"?o.microphoneCanRequest:null,d=o.capture==="browser"?"browser":"native",f=r.ok&&o.ok===!0,v=f?null:o.detail??o.error??(a?"Scout voice is not ready.":"Scout voice service is unavailable."),w={ok:f,reason:v,captureMode:f?d:null,hostReachable:a,microphoneGranted:u,microphoneCanRequest:h,probedAt:Date.now()};return l=w,this.applyProbeSnapshot(w),I(w),f}catch(r){const a={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,probedAt:Date.now()};return l=a,this.applyProbeSnapshot(a),I(a),!1}finally{window.clearTimeout(i)}}applyProbeSnapshot(e){if(this.hostReachable=e.hostReachable,this.microphoneGranted=e.microphoneGranted,this.microphoneCanRequest=e.microphoneCanRequest,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={}){try{const i=await(await fetch("/api/scout-services/restart-link",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({target:"all"})})).json().catch(()=>({}));if(i.url?.startsWith("scout://services/restart/")){window.location.href=i.url;return}}catch{}window.location.href="scout://hud/show"}async startLive(e={},n={}){return this.captureMode!=="browser"?await Q(e,n):await Y(e)}}async function Q(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 s=await n.text().catch(()=>"");throw new Error(g(s,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,a,u;const h=new Promise((s,p)=>{a=s,u=p});let d=null;const f=()=>{d&&window.clearTimeout(d),d=window.setTimeout(()=>{w(new Error("Scout voice transcription timed out. Try again or check voice settings."))},H)},v=()=>{d&&(window.clearTimeout(d),d=null)},w=(s,p="error")=>{o||(o=!0,v(),m.close(),t.onState?.(p),u(s))},y=s=>{o||(o=!0,v(),m.close(),t.onFinal?.(s),t.onState?.("done"),a(s))},m=new EventSource(`/api/voice/session/${encodeURIComponent(r)}/events`),c=s=>p=>{if(o)return;let S={};try{S=JSON.parse(p.data)}catch{return}if(s==="session.partial"){const b=typeof S.text=="string"?S.text:"";t.onPartial?.(b);return}if(s==="session.state"){const b=Z(S.state);b&&(t.onState?.(b),b==="processing"&&f());return}if(s==="session.final"){y({sessionId:r,text:typeof S.text=="string"?S.text.trim():"",durationMs:Number(S.durationMs??0)});return}if(s==="session.cancelled"){w(T(),"cancelled");return}if(s==="session.error"){const b=typeof S.message=="string"?S.message:"Scout voice session failed.",L=typeof S.code=="string"?S.code:null;w(new Error(N(b,L)))}};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||w(new Error("Scout voice event stream disconnected."))},{get sessionId(){return r},result:h,stop:async()=>{t.onState?.("processing"),f();const s=await fetch(`/api/voice/session/${encodeURIComponent(r)}/stop`,{method:"POST"});if(!s.ok){const p=await s.text().catch(()=>"");throw new Error(g(p,s.status))}},cancel:async()=>{o=!0,v(),m.close();const s=await fetch(`/api/voice/session/${encodeURIComponent(r)}/cancel`,{method:"POST"});if(!s.ok){const p=await s.text().catch(()=>"");throw new Error(g(p,s.status))}t.onState?.("cancelled"),u(T())}}}async function Y(t={}){if(typeof MediaRecorder>"u"||!navigator.mediaDevices?.getUserMedia)throw new Error("Scout voice capture is unavailable in this browser.");const{startStreamLevelMeter:e}=await x(async()=>{const{startStreamLevelMeter:c}=await import("./voice-levels-Dcr3jglk.js");return{startStreamLevelMeter:c}},[]),n=ae(),i=[];let r=null,o=null,a=null,u=!1,h=!1,d,f;const v=new Promise((c,s)=>{d=c,f=s}),w=()=>{a?.stop(),a=null;for(const c of r?.getTracks()??[])c.stop();r=null},y=(c,s="error")=>{h||(h=!0,w(),t.onState?.(s),f(c))},m=async()=>{if(h)return;if(w(),u){y(T(),"cancelled");return}t.onState?.("processing");const c=o?.mimeType||V()||"application/octet-stream",s=new Blob(i,{type:c});if(s.size===0){y(new Error("No voice audio was captured."));return}try{const p=await ne(s,{sessionId:n});if(h)return;h=!0,t.onFinal?.(p),t.onState?.("done"),d(p)}catch(p){y(p instanceof Error?p:new Error(String(p)))}};try{t.onState?.("starting"),r=await navigator.mediaDevices.getUserMedia({audio:!0}),t.onLevel&&(a=e(r,t.onLevel));const c=V();o=new MediaRecorder(r,c?{mimeType:c}:void 0),o.addEventListener("dataavailable",s=>{s.data.size>0&&i.push(s.data)}),o.addEventListener("error",()=>{y(new Error("Scout voice recorder failed."))}),o.addEventListener("stop",()=>{m()},{once:!0}),o.start(),t.onPartial?.(""),t.onState?.("recording")}catch(c){const s=c instanceof Error?c:new Error(String(c));throw y(s),v.catch(()=>{}),s}return{get sessionId(){return n},result:v,stop:async()=>{!o||o.state==="inactive"||o.stop()},cancel:async()=>{if(u=!0,o&&o.state!=="inactive"){o.stop();return}y(T(),"cancelled")}}}function Z(t){return t==="starting"||t==="recording"||t==="processing"||t==="done"||t==="cancelled"||t==="error"?t:null}function g(t,e){try{return JSON.parse(t).error??`Scout voice returned HTTP ${e}`}catch{return t||`Scout voice returned HTTP ${e}`}}function me(t){return t instanceof Error&&t.name==="AbortError"}async function ee(t,e={}){const n={text:t,speed:se(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);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 we(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()}async function Se(t,e={}){if(e.signal?.aborted)throw P();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 a=()=>{n.removeEventListener("ended",u),n.removeEventListener("error",h),e.signal?.removeEventListener("abort",d)},u=()=>{a(),r()},h=()=>{a(),o(new Error("Scout voice playback failed."))},d=()=>{a(),o(P())};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 te(t,e={}){const n=await ee(t,e);if(e.signal?.aborted)throw P();const i=await k(n.audioBase64,n.contentType),r=ie(e.presetId,e.params);return await D(i,{params:r,signal:e.signal}).promise,n}function ge(t,e={}){const n=new AbortController;return{promise:te(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function ne(t,e){const n=new FormData,i=oe(t.type);n.append("audio",t,`audio.${re(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 a=await r.text().catch(()=>"");try{const u=JSON.parse(a);throw new Error(u.error??`Scout voice returned HTTP ${r.status}`)}catch(u){throw u instanceof SyntaxError?new Error(a||`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 P(){const t=new Error("Speech stopped.");return t.name="AbortError",t}function T(){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 oe(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 re(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 ie(t,e){const n=t?A.find(i=>i.id===t)?.params:void 0;return{...q,...n??{},...e??{}}}function se(t){if(!(t===void 0||!Number.isFinite(t)))return Math.min(2,Math.max(.5,Number(t.toFixed(2))))}function ae(){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 ce(){const t=await fetch("/api/voice/settings");if(!t.ok){const e=await t.text().catch(()=>"");throw new Error(g(e,t.status))}return await t.json()}async function ve(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(g(n,e.status))}}async function C(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(g(n,e.status))}}async function ye(t=12){const e=await fetch(`/api/voice/history?limit=${t}`);if(!e.ok){const i=await e.text().catch(()=>"");throw new Error(g(i,e.status))}return(await e.json()).sessions??[]}async function be(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(g(n,e.status))}return await e.json()}export{pe as a,we as b,Se as c,ge as d,fe as e,le as f,X as g,ce as h,me as i,ye as j,be as k,ve as o,ee as p,C as r,he as s};
@@ -1 +1 @@
1
- import{c as a}from"./createLucideIcon-OpA4Amw5.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-ClCdc3F9.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-OpA4Amw5.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-ClCdc3F9.js";const e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],o=c("search",e);export{o as S};
@@ -0,0 +1 @@
1
+ import{c as a}from"./createLucideIcon-ClCdc3F9.js";import{M as w}from"./message-square-CIXda-Y7.js";import{F as l}from"./file-text-DG-pufl1.js";import{S as c}from"./search-C3bSJluv.js";import{T as y}from"./terminal-DrTkVXIj.js";import{C as k}from"./code-xml--LjSM4Mv.js";import{S as g}from"./scroll-text-BV-BB7v-.js";const O=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],p=a("compass",O);const S=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],_=a("folder-kanban",S);const A=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],N=a("git-branch",A);const j=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],v=a("house",j);const E=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],u=a("send",E);const R=[["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"}]],C=a("settings",R),M=[{id:"home",label:"Home",icon:v,defaultRoute:{view:"inbox"},section:"navigate"},{id:"chat",label:"Messages",icon:w,defaultRoute:{view:"messages"},section:"navigate"},{id:"projects",label:"Projects",icon:_,defaultRoute:{view:"agents-v2"},section:"navigate"},{id:"sessions",label:"Sessions",icon:l,defaultRoute:{view:"sessions"},section:"navigate"},{id:"dispatch",label:"Dispatch",icon:u,defaultRoute:{view:"broker"},section:"navigate"},{id:"search",label:"Search",icon:c,defaultRoute:{view:"search"},section:"navigate"},{id:"ops",label:"Operations",icon:p,defaultRoute:{view:"ops",mode:"mission"},section:"system"},{id:"settings",label:"Settings",icon:C,defaultRoute:{view:"settings",section:"appearance"},section:"system"}],d={inbox:"home",activity:"home",briefings:"home","agents-v2":"projects","agent-info":"projects",repos:"projects","repo-diff":"projects",code:"projects",sessions:"sessions",terminal:"sessions",messages:"chat",conversation:"chat",broker:"dispatch",work:"dispatch",follow:"dispatch",search:"search",ops:"ops",mesh:"ops","mesh-ops":"ops",harnesses:"ops",settings:"settings",voice:"settings"},T=new Map(M.map(e=>[e.id,e]));function G(e){const i=T.get(e);if(!i)throw new Error(`Unknown primary area: ${e}`);return i}function se(e){if(e.view==="follow"&&e.preferredView)switch(e.preferredView){case"tail":return"ops";case"session":return"sessions";case"chat":return"chat";case"work":return"dispatch"}return d[e.view]}function ae(e,i){const t=G(e);return e==="ops"?i?.opsControlEnabled??!0?{view:"ops",mode:"mission"}:{view:"ops",mode:"tail"}:t.defaultRoute}function P(e){return e.view==="ops"&&(e.mode===void 0||e.mode==="mission"||e.mode==="issues")}const D=[{id:"home",label:"Home",route:{view:"inbox"},active:e=>e.view==="inbox"},{id:"projects",label:"Projects",route:{view:"agents-v2"},active:e=>e.view==="agents-v2"||e.view==="agent-info"},{id:"sessions",label:"Sessions",route:{view:"sessions"},active:e=>e.view==="sessions"},{id:"chat",label:"Messages",route:{view:"messages"},active:e=>e.view==="messages"||e.view==="conversation"},{id:"search",label:"Search",route:{view:"search"},active:e=>e.view==="search"},{id:"terminals",label:"Terminals",route:{view:"terminal"},active:e=>e.view==="terminal"},{id:"tail",label:"Live Activity",route:{view:"ops",mode:"tail"},active:e=>e.view==="ops"&&e.mode==="tail"},{id:"dispatch",label:"Dispatch",route:{view:"broker"},active:e=>e.view==="broker"},{id:"activity",label:"Activity Log",route:{view:"activity"},active:e=>e.view==="activity"},{id:"mesh",label:"Network",route:{view:"mesh"},active:e=>e.view==="mesh"},{id:"mesh-ops",label:"Mesh Ops",route:{view:"mesh-ops"},active:e=>e.view==="mesh-ops",capability:"surface.mesh-ops"},{id:"mission-control",label:"Mission Control",route:{view:"ops",mode:"mission"},active:P,capability:"ops.control"},{id:"lanes",label:"Agent Lanes",route:{view:"ops",mode:"lanes"},active:e=>e.view==="ops"&&e.mode==="lanes"},{id:"repos",label:"Repositories",route:{view:"repos"},active:e=>e.view==="repos"||e.view==="repo-diff"},{id:"code",label:"Code Browser",route:{view:"code"},active:e=>e.view==="code"},{id:"providers",label:"Agent Providers",route:{view:"harnesses"},active:e=>e.view==="harnesses"},{id:"runtime",label:"Runtime Monitor",route:{view:"ops",mode:"atop"},active:e=>e.view==="ops"&&e.mode==="atop",capability:"ops.control"},{id:"plans",label:"Plans",route:{view:"ops",mode:"plan"},active:e=>e.view==="ops"&&e.mode==="plan"},{id:"agent-config",label:"Agent Configuration",route:{view:"settings",section:"agents"},active:e=>e.view==="settings"&&e.section==="agents"}],x=new Map(D.map(e=>[e.id,e]));function s(e){const i=x.get(e);if(!i)throw new Error(`Unknown nav destination: ${e}`);return i}function n(e,i){const t=s(e);return{id:t.id,label:i?.label??t.label,route:i?.route??t.route,active:i?.active??t.active,capability:t.capability}}const V=[{destinationId:"home",key:"home"},{destinationId:"projects",key:"agents",label:"Projects"},{destinationId:"sessions",key:"sessions"},{destinationId:"chat",key:"chat",label:"Messages"}];function ne(){return V.map(e=>{const i=s(e.destinationId);return{key:e.key,label:e.label??i.label,route:i.route}})}const B=[{destinationId:"search",key:"search"},{destinationId:"terminals",key:"terminals"},{destinationId:"tail",key:"tail"},{destinationId:"dispatch",key:"dispatch"}],J=[{destinationId:"mission-control",key:"control"},{destinationId:"lanes",key:"lanes"},{destinationId:"repos",key:"repos"},{destinationId:"code",key:"code"},{destinationId:"providers",key:"providers"},{destinationId:"mesh",key:"mesh"},{destinationId:"mesh-ops",key:"mesh-ops"},{destinationId:"runtime",key:"runtime"},{destinationId:"plans",key:"plans"}];function b(e){const i=n(e.destinationId,{label:e.label});return{key:e.key,label:i.label,route:i.route,active:i.active,destinationId:i.id,capability:i.capability}}function de(){return B.map(b)}function re(){return J.map(b)}function m(e){return{items:e.map(i=>{const t=n(i.destinationId,{label:i.label,route:i.route,active:i.active});return{id:i.id,label:t.label,route:t.route,active:t.active}})}}function U(){return[m([{destinationId:"agent-config",id:"config",label:"Agent Configuration"}])]}function F(){return[m([{destinationId:"lanes",id:"lanes"},{destinationId:"mission-control",id:"control"},{destinationId:"providers",id:"harnesses",label:"Agent Providers"},{destinationId:"mesh",id:"mesh"},{destinationId:"tail",id:"tail"},{destinationId:"runtime",id:"runtime"},{destinationId:"plans",id:"plans"}])]}const L=[{key:"h",label:"Go home",destinationId:"home"},{key:"i",label:"Go to messages",destinationId:"chat"},{key:"c",label:"Go to messages",destinationId:"chat"},{key:"p",label:"Go to projects",destinationId:"projects"},{key:"s",label:"Go to sessions",destinationId:"sessions"},{key:"t",label:"Go to terminals",destinationId:"terminals"},{key:"r",label:"Go to repositories",destinationId:"repos"},{key:"b",label:"Go to code browser",destinationId:"code"},{key:"f",label:"Go to search",destinationId:"search"},{key:"l",label:"Go to live activity",destinationId:"tail"},{key:"o",label:"Go to operations",destinationId:"mission-control",route:{view:"ops"}},{key:"d",label:"Go to dispatch",destinationId:"dispatch"},{key:"m",label:"Go to network",destinationId:"mesh"},{key:"a",label:"Go to activity log",destinationId:"activity"}];function le(){return L.map(e=>{const i=s(e.destinationId);return{key:e.key,label:e.label,route:e.route??i.route,destinationId:e.destinationId}})}const Y=[{destinationId:"sessions",id:"sessions",icon:l},{destinationId:"terminals",id:"terminals",icon:y},{destinationId:"repos",id:"repos",icon:N},{destinationId:"code",id:"code",icon:k},{destinationId:"search",id:"search",icon:c},{destinationId:"tail",id:"tail",icon:g},{destinationId:"mission-control",id:"ops",label:"Operations",icon:p,route:{view:"ops",mode:"mission"},opsGated:!0},{destinationId:"home",id:"home",icon:v},{destinationId:"dispatch",id:"dispatch",icon:u}];function ce(){return Y.map(e=>{const i=s(e.destinationId);return{id:e.id,label:e.label??i.label,icon:e.icon,route:e.route??i.route,destinationId:e.destinationId,opsGated:e.opsGated??i.capability==="ops.control"}})}const H=[{id:"nav:home",label:"Go to Home",destinationId:"home",shortcut:"Cmd+1"},{id:"nav:agents",label:"Go to Projects",destinationId:"projects",shortcut:"Cmd+2"},{id:"nav:messages",label:"Go to Chat",destinationId:"chat",shortcut:"Cmd+3"},{id:"nav:sessions",label:"Open Sessions",destinationId:"sessions"},{id:"nav:terminals",label:"Open Terminals",destinationId:"terminals"},{id:"nav:search",label:"Go to Search",destinationId:"search",shortcut:"Cmd+4"},{id:"nav:activity",label:"Open Activity",destinationId:"activity"},{id:"nav:mesh",label:"Open Mesh",destinationId:"mesh"},{id:"nav:dispatch",label:"Open Dispatch",destinationId:"dispatch"},{id:"nav:repos",label:"Open Repos",destinationId:"repos"},{id:"nav:code",label:"Open Code Browser",destinationId:"code"},{id:"nav:harnesses",label:"Open Providers",destinationId:"providers"},{id:"nav:ops-lanes",label:"Open Agent Lanes",destinationId:"lanes"},{id:"nav:ops",label:"Go to Ops",destinationId:"mission-control",route:{view:"ops"},shortcut:"Cmd+5",capability:"ops.control"},{id:"nav:ops-atop",label:"Open Runtime",destinationId:"runtime",capability:"ops.control"},{id:"nav:agent-config",label:"Open Agent Configuration",destinationId:"agent-config"}];function $(e){const i=e?.opsEnabled??!0;return H.filter(t=>!((t.capability??s(t.destinationId).capability)==="ops.control"&&!i)).map(t=>{const o=s(t.destinationId);return{id:t.id,label:t.label,destinationId:t.destinationId,route:t.route??o.route,shortcut:t.shortcut,capability:t.capability??o.capability}})}function pe(e,i){return $(i).map(t=>({id:t.id,label:t.label,action:()=>e(t.route),shortcut:t.shortcut}))}const h={projects:[{destinationId:"projects",id:"projects",label:"Projects"},{destinationId:"repos",id:"repos"},{destinationId:"code",id:"code"}],sessions:[{destinationId:"sessions",id:"sessions"},{destinationId:"terminals",id:"terminals"}]};function z(e){const i=n(e.destinationId,{label:e.label});return{id:e.id,label:i.label,route:i.route,active:i.active,destinationId:i.id}}function q(e){return h[e].map(z)}function ve(e){const i=d[e.view];if(i!=="projects"&&i!=="sessions")return null;const t=i;return{areaId:t,items:q(t)}}const r={...h,dispatch:[{destinationId:"dispatch",id:"dispatch-all",label:"All Dispatches",route:{view:"broker"},active:e=>e.view==="broker"&&(e.filter===void 0||e.filter==="all")},{destinationId:"dispatch",id:"dispatch-delivered",label:"Delivered",route:{view:"broker",filter:"delivered"},active:e=>e.view==="broker"&&e.filter==="delivered"},{destinationId:"dispatch",id:"dispatch-failed",label:"Failed",route:{view:"broker",filter:"failed"},active:e=>e.view==="broker"&&e.filter==="failed"}],ops:[{destinationId:"lanes",id:"lanes",label:"Lanes"},{destinationId:"mission-control",id:"control"},{destinationId:"providers",id:"harnesses",label:"Providers"},{destinationId:"runtime",id:"runtime",label:"Runtime"},{destinationId:"mesh",id:"mesh"},{destinationId:"tail",id:"tail"},{destinationId:"plans",id:"plans"}]};function K(e){const i=n(e.destinationId,{label:e.label,route:e.route,active:e.active});return{id:e.id,label:i.label,route:i.route,active:i.active,destinationId:i.id}}function ue(e,i){const t=d[e.view];if(!(t in r))return null;const o=t,I=r[o].map(K).filter(f=>s(f.destinationId).capability!=="ops.control"||i?.opsControlEnabled!==!1);return{areaId:o,items:I}}const be=U(),me=F();export{be as A,me as O,M as P,C as S,de as a,re as b,pe as c,ce as d,le as e,se as f,ae as g,G as h,ve as i,ne as p,ue as s};
@@ -1 +1 @@
1
- import{j as r,r as o}from"./index-DMiGbrBt.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-CzVeWScw.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-OpA4Amw5.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-ClCdc3F9.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{c as e}from"./createLucideIcon-OpA4Amw5.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-ClCdc3F9.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-CWbJ1RCW.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-BkXjjSkq.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};
@@ -0,0 +1 @@
1
+ import{c as u}from"./createLucideIcon-ClCdc3F9.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{c as t}from"./createLucideIcon-OpA4Amw5.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-ClCdc3F9.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};
@@ -0,0 +1 @@
1
+ import{c as a}from"./createLucideIcon-ClCdc3F9.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 o,c as f}from"./index-DMiGbrBt.js";import{c as b,a as d,w as m}from"./index-BWHgHrtv.js";const n=new Set;let u=null,i=null,s=null,r=null;function c(e){for(const t of[...n])t(e)}function p(){r||n.size===0||(r=setTimeout(()=>{r=null,l()},2e3))}function l(){s||n.size===0||(u||(u=b({url:f()}),i=d({links:[m({client:u})]})),s=i.control.events.subscribe(void 0,{onData:e=>{const t=e.data;t&&c(t)},onError:()=>{s=null,p()}}),c({kind:"unknown",payload:{reason:"control_subscription_started"}}))}function v(){r&&(clearTimeout(r),r=null),s?.unsubscribe(),s=null}function k(e){return n.add(e),l(),()=>{n.delete(e),!(n.size>0)&&v()}}function S(e){const t=o.useRef(e);t.current=e,o.useEffect(()=>k(a=>{t.current(a)}),[])}export{S as u};
1
+ import{r as o,c as f}from"./index-CzVeWScw.js";import{c as b,a as d,w as m}from"./index-BWHgHrtv.js";const n=new Set;let u=null,i=null,s=null,r=null;function c(e){for(const t of[...n])t(e)}function p(){r||n.size===0||(r=setTimeout(()=>{r=null,l()},2e3))}function l(){s||n.size===0||(u||(u=b({url:f()}),i=d({links:[m({client:u})]})),s=i.control.events.subscribe(void 0,{onData:e=>{const t=e.data;t&&c(t)},onError:()=>{s=null,p()}}),c({kind:"unknown",payload:{reason:"control_subscription_started"}}))}function v(){r&&(clearTimeout(r),r=null),s?.unsubscribe(),s=null}function k(e){return n.add(e),l(),()=>{n.delete(e),!(n.size>0)&&v()}}function S(e){const t=o.useRef(e);t.current=e,o.useEffect(()=>k(a=>{t.current(a)}),[])}export{S as u};
@@ -0,0 +1 @@
1
+ function s(n){return!!n?.startsWith("native:")}function r(n){if(!s(n))return null;const e=n.slice(7).split(":");if(e.length<2)return null;const i=e[1];return i==="path"?null:i==="terminal"?e.slice(2).join(":")||null:i||null}function a(n){return n.harnessSessionId?.trim()||r(n.id)}function c(n){if(n.view!=="agents-v2"||!n.agentId||!s(n.agentId))return n;const t=r(n.agentId);return t?{view:"sessions",sessionId:t,...n.machineId?{machineId:n.machineId}:{}}:n}function l(n){return c(n)}export{s as i,l as n,a as s};