@openscout/scout 0.2.94 → 0.2.96
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.
- package/NOTICE +14 -0
- package/README.md +164 -342
- package/bin/scout +26 -10
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/{ActivityScreen--eANwuxa.js → ActivityScreen-BnoaUkVZ.js} +1 -1
- package/dist/client/assets/{AddProjectForm-CcD6qvV8.js → AddProjectForm-IqOtJfRs.js} +1 -1
- package/dist/client/assets/{AgentAvatar-CYhf6twS.js → AgentAvatar-6-KBVKUu.js} +1 -1
- package/dist/client/assets/{AgentConfigurationScreen-BTI24HQX.js → AgentConfigurationScreen-CuZJy07q.js} +1 -1
- package/dist/client/assets/{AgentDefinitionsWorkspace-srmN6-vj.js → AgentDefinitionsWorkspace-Iyl4BesU.js} +1 -1
- package/dist/client/assets/{AgentDetailCard-UqPNpcvB.js → AgentDetailCard-C9rn3Fj5.js} +1 -1
- package/dist/client/assets/{AgentFloorView-XXNgI5Cj.js → AgentFloorView-YT-Jjccf.js} +1 -1
- package/dist/client/assets/{AgentInfoScreen-CimdOnZ9.js → AgentInfoScreen-Dr99gQEZ.js} +1 -1
- package/dist/client/assets/{AgentLaneCard-Z-aOBR3W.js → AgentLaneCard-DI2iW9zO.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-CyhA1reW.js → AgentLaneChrome-D8bARHMx.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-BNzjMjIH.js → AgentLaneDetailSheet-52un7dKC.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-Box8-_rS.js → AgentLaneSummaryResize-CEBjmPTa.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-Dgcm7zd_.js +1 -0
- package/dist/client/assets/AgentLanesPreflight-q20mTjms.js +1 -0
- package/dist/client/assets/AgentLanesView-CetZZDyF.js +2 -0
- package/dist/client/assets/{AgentLiveActions-BwuzOE8h.js → AgentLiveActions-DrEJDJef.js} +1 -1
- package/dist/client/assets/AgentMasterScreen-DJPnstoD.js +1 -0
- package/dist/client/assets/{AgentSessions-CsZwoukw.js → AgentSessions-DCPCG4xb.js} +1 -1
- package/dist/client/assets/{AgentsConsole-KCao4XmX.js → AgentsConsole-CsYOoFJi.js} +1 -1
- package/dist/client/assets/{AgentsScreen-CtPAmwRX.js → AgentsScreen-k8LvBuU_.js} +1 -1
- package/dist/client/assets/AgentsSubnav-C4xpQhsv.js +1 -0
- package/dist/client/assets/{AstronautSuit-Ckx7lu7G.js → AstronautSuit-DbjQtfD_.js} +1 -1
- package/dist/client/assets/{AtopView-DYlpgEHf.js → AtopView-Daq_ob3z.js} +1 -1
- package/dist/client/assets/{BackToPicker-4JaeRvDm.js → BackToPicker-CXZjBRAe.js} +1 -1
- package/dist/client/assets/{BriefingDetailScreen-D6-xqrpo.js → BriefingDetailScreen-CUCXO-KH.js} +1 -1
- package/dist/client/assets/{BriefingsScreen-DKxSDEmk.js → BriefingsScreen-B5oMTGKv.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-BbREmsbK.js → BrokerMetadataPanel-BsiU8lTD.js} +1 -1
- package/dist/client/assets/{BrokerScreen-fbPIouMw.js → BrokerScreen-BPbOHhCS.js} +1 -1
- package/dist/client/assets/{CastPicker-BcA2vDDV.js → CastPicker-_5E5hNUe.js} +1 -1
- package/dist/client/assets/ChatCollapsedStrip-D-eXhzPf.js +1 -0
- package/dist/client/assets/{CodeDiffPane-Cn8Y9hAt.js → CodeDiffPane-n7W4iGUG.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-nPFktrco.js → CodeProjectPicker-CMsbSTDq.js} +1 -1
- package/dist/client/assets/{CodeScreen-BlAxtxE5.js → CodeScreen-CeuO3EhR.js} +1 -1
- package/dist/client/assets/{ConversationComposer-2HjbGPL9.js → ConversationComposer-CXPKx86g.js} +1 -1
- package/dist/client/assets/{ConversationFeedRows-C6wUqJrx.js → ConversationFeedRows-WrH-YI3L.js} +1 -1
- package/dist/client/assets/{ConversationHeader-C8vfXaTF.js → ConversationHeader-BQWzGzLK.js} +1 -1
- package/dist/client/assets/{ConversationPanels-CNCIbpqU.js → ConversationPanels-Dujvnmup.js} +2 -2
- package/dist/client/assets/ConversationScreen-CR9pWB65.js +2 -0
- package/dist/client/assets/{ConversationStatus-DZuyKsWN.js → ConversationStatus-DVzSb2Hv.js} +1 -1
- package/dist/client/assets/{CrewAvatar-CTIuxp4G.js → CrewAvatar-BwXjyg8N.js} +1 -1
- package/dist/client/assets/CrewWorkspaces-CkQDhyie.css +1 -0
- package/dist/client/assets/CrewWorkspaces-NKujRzwh.js +1 -0
- package/dist/client/assets/{DataTable-6IDhanr5.js → DataTable-Bp8tU9AK.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-DC1u9itO.js → DispatchAftermath-B-6rmXzL.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-DZVhS7as.js → DocumentFocusViewer-Do3wQ_3Z.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-BKUFJMCV.js → EmbeddableSurfacesLab-C1orRyP9.js} +1 -1
- package/dist/client/assets/{EmptyState-CeBl0iGd.js → EmptyState-CJzXj1l5.js} +1 -1
- package/dist/client/assets/{FileViewerPane-DQlpNt2S.js → FileViewerPane-Df6VzXjA.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-6mGnmWQA.js +1 -0
- package/dist/client/assets/{FollowScreen-BXHOp3gb.js → FollowScreen-DvnxYLVh.js} +1 -1
- package/dist/client/assets/{HarnessMark-D5CA5uSp.js → HarnessMark-B979GCSB.js} +1 -1
- package/dist/client/assets/{HarnessesScreen-DhFXq1qz.js → HarnessesScreen-CHTuv8p6.js} +1 -1
- package/dist/client/assets/{HerdrSession-BRhs5LIR.js → HerdrSession-B3McuYgi.js} +1 -1
- package/dist/client/assets/{HomeHero-DMABJuze.js → HomeHero-CdUVPjkG.js} +1 -1
- package/dist/client/assets/{HostAdvisorView-RAociATV.js → HostAdvisorView-Bok5Sk5c.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-CZPyVNSw.js → KnowledgeSearchInspector-B7XSoJsu.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchScreen-mGTKIg00.js → KnowledgeSearchScreen-D3o3IODW.js} +1 -1
- package/dist/client/assets/{LaneToolHoverCard-D_DMlBeT.js → LaneToolHoverCard-HByf2ndx.js} +1 -1
- package/dist/client/assets/{LaneTraceDetailSheet-BEHg3LmH.js → LaneTraceDetailSheet-BUgHz-sd.js} +1 -1
- package/dist/client/assets/{LaneTraceEventFocus-DVimcizS.js → LaneTraceEventFocus-DM-hoPxG.js} +1 -1
- package/dist/client/assets/{MeshCanvas-BOuZx4AM.js → MeshCanvas-DCLJRsBy.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-wL-1N94e.js → MeshCanvasMinimap-cEFS9eW7.js} +1 -1
- package/dist/client/assets/{MeshScreen-DMY9Bmh5.js → MeshScreen-BcxPkhm6.js} +1 -1
- package/dist/client/assets/{MeshTopologyView-DiDcX5f4.js → MeshTopologyView-CCRPd8PU.js} +2 -2
- package/dist/client/assets/MessagesScreen-Bb5l13MO.js +1 -0
- package/dist/client/assets/{MissionContextRail-DrNKXG5u.js → MissionContextRail-DF0_kiU7.js} +1 -1
- package/dist/client/assets/{MissionControlView-ByBlHVN8.js → MissionControlView-E3V7bENU.js} +1 -1
- package/dist/client/assets/{MissionFocusOverlay-D1i6R6Zt.js → MissionFocusOverlay-h15sQFvP.js} +1 -1
- package/dist/client/assets/{MissionLeftAgentRow-DN9NcCML.js → MissionLeftAgentRow-KPdk9rSa.js} +1 -1
- package/dist/client/assets/{MissionLogPane-DSeIv3Xo.js → MissionLogPane-BbdDKjUl.js} +1 -1
- package/dist/client/assets/{NewAgentModal-V7yK6J6j.js → NewAgentModal-DfHxad34.js} +1 -1
- package/dist/client/assets/NewChatComposer-_Stj0fZy.js +19 -0
- package/dist/client/assets/{NewChatOrigin-DdpzE4kz.js → NewChatOrigin-B1u7ki70.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-l_Q3ts2q.js → ObserveEmbedScreen-Co0xTii6.js} +1 -1
- package/dist/client/assets/{ObserveTextFlow-BSEtYTxU.js → ObserveTextFlow-ZQWwrK3i.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-CdGUXxGR.js → ObservedTopologyPanel-BJUhDSuQ.js} +1 -1
- package/dist/client/assets/{OpenScoutAppShell-DN8dOSK4.js → OpenScoutAppShell-CUd2yOLu.js} +25 -25
- package/dist/client/assets/{OpsAgentsView-ntGr4pz4.js → OpsAgentsView-DI5wu1si.js} +1 -1
- package/dist/client/assets/OpsScreen-D8fQafCl.js +1 -0
- package/dist/client/assets/OpsSubnav-1K4Jaf__.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-Bdjd_dAx.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-BQET-qrY.js → ProjectAgentProfileBar-k2QHHHsQ.js} +1 -1
- package/dist/client/assets/{ProjectAgentProfileHero-Ck8mThtx.js → ProjectAgentProfileHero-Bpxk1ui2.js} +1 -1
- package/dist/client/assets/ProjectsInbox-C_bMHLCc.js +2 -0
- package/dist/client/assets/ProjectsRail-J-aH_pxT.js +1 -0
- package/dist/client/assets/ProjectsScreen-cVUkGbPz.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-_ourdM-Q.js +1 -0
- package/dist/client/assets/{Provider-B2xuo3rf.js → Provider-CtXJeLrP.js} +1 -1
- package/dist/client/assets/{RailRow-B-GycCBx.js → RailRow-CEH2MFBw.js} +1 -1
- package/dist/client/assets/{RawSessionsTable-AQThi6sm.js → RawSessionsTable-CDyrom-F.js} +1 -1
- package/dist/client/assets/RealtimeVoiceScreen-DBl3DN1H.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-DXWoRF_c.js → RepoDiffEmbedScreen-kY2pHjIs.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-D_274ExO.js → RepoDiffPageScreen-C6LhoKrn.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-DbedmHDX.js → RepoDiffViewer-BhcIIQQg.js} +1 -1
- package/dist/client/assets/{RepoDiffViewerLazy-C0--fPtk.js → RepoDiffViewerLazy-Csy_j9LD.js} +2 -2
- package/dist/client/assets/{ReposScreen-D39_YG4H.js → ReposScreen-B_cB0zu7.js} +1 -1
- package/dist/client/assets/ScoutDeckSurface-CSy_fjcG.js +1 -0
- package/dist/client/assets/{ScoutSurface-UsRy0t-I.js → ScoutSurface-CQVcSrin.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-Fmdfboxs.js → ScoutbotFxLab-DqGiLYNy.js} +1 -1
- package/dist/client/assets/{SecondaryNav-o2RL9H8H.js → SecondaryNav-BR4VRdgh.js} +1 -1
- package/dist/client/assets/SessionEmbedScreen-BTlZ9gAg.js +1 -0
- package/dist/client/assets/{SessionObserve-Dsd0j05N.js → SessionObserve-dQDN23pP.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-DopQYDkD.js → SessionObserveEvidence-BRBGKAgd.js} +1 -1
- package/dist/client/assets/SessionRefScreen-COVQMbtE.js +1 -0
- package/dist/client/assets/SessionsScreen--5OJ3p3v.js +1 -0
- package/dist/client/assets/{SettingsDrawer-_AwuopMS.js → SettingsDrawer-RGVK_bmE.js} +1 -1
- package/dist/client/assets/{SettingsScreen-Cw4DDfJP.js → SettingsScreen-CCxzy5IU.js} +1 -1
- package/dist/client/assets/{ShikiPane-BfHc_3pM.js → ShikiPane-DYI9Hkge.js} +1 -1
- package/dist/client/assets/{SlidePanel-C-q7XwTa.js → SlidePanel-B9ugxWgA.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-Bs68ZENy.js → SpriteAvatar-z5hHesx9.js} +1 -1
- package/dist/client/assets/{StatusPill-ZZQwxB1a.js → StatusPill-BFvMjmZV.js} +1 -1
- package/dist/client/assets/{TailView-Q4FVMsUH.js → TailView-0uEIj2JH.js} +1 -1
- package/dist/client/assets/{Terminal-D7zqHwHV.js → Terminal-DouZeNxc.js} +1 -1
- package/dist/client/assets/{TerminalEmbedScreen-CXIJ7qv6.js → TerminalEmbedScreen-dMNUbzXr.js} +1 -1
- package/dist/client/assets/{TerminalHeaderMount-BnBLOPbb.js → TerminalHeaderMount-BL07cd0q.js} +1 -1
- package/dist/client/assets/{TextDocumentSurface-CKQP-cBT.js → TextDocumentSurface-BflAwXeZ.js} +1 -1
- package/dist/client/assets/{TmuxPeek-V9dGESfO.js → TmuxPeek-BTnjOQi0.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-k7sbLXx2.js → VoicePermissionsPanel-CgQ6GGS-.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-60p9litn.js → WorkDetailScreen-CaLG-zDs.js} +1 -1
- package/dist/client/assets/{WorkFilesViewer-BjJS7GyM.js → WorkFilesViewer-B9Sil_No.js} +1 -1
- package/dist/client/assets/{activity-Bj3Hnbj3.js → activity-DcrMApUY.js} +1 -1
- package/dist/client/assets/{addon-fit-BL-NTWRU.js → addon-fit-DMVrz5Sv.js} +1 -1
- package/dist/client/assets/{addon-webgl-CIMgmNjg.js → addon-webgl-BYvpZUyu.js} +1 -1
- package/dist/client/assets/{agent-autocomplete-DXlvdc4b.js → agent-autocomplete-B-5QTeas.js} +1 -1
- package/dist/client/assets/{agent-essentials-BOMHR0_U.js → agent-essentials-D7KRGYvF.js} +1 -1
- package/dist/client/assets/{agent-lane-card-model-CTLxf3R4.js → agent-lane-card-model-CNZMPkhc.js} +1 -1
- package/dist/client/assets/{agent-lanes-model-AfrjRNK5.js → agent-lanes-model-DXqjs0OK.js} +2 -2
- package/dist/client/assets/agent-master-I1W-5d-x.css +1 -0
- package/dist/client/assets/agent-master-model-DqjrVI2h.js +1 -0
- package/dist/client/assets/{agent-specialization-BIPIBW8u.js → agent-specialization-BujJVUTD.js} +1 -1
- package/dist/client/assets/{arc.es-IR5r6sj_.js → arc.es-NHqHWohb.js} +1 -1
- package/dist/client/assets/{arrow-down-BydciYFZ.js → arrow-down-CKtSUjmW.js} +1 -1
- package/dist/client/assets/{arrow-left-CghA0kTw.js → arrow-left-Czpf-AE4.js} +1 -1
- package/dist/client/assets/{arrow-right-iJFv3jNh.js → arrow-right-BuzMnLYP.js} +1 -1
- package/dist/client/assets/{arrow-up-right-CCfZXPqD.js → arrow-up-right-C6Wl-1uw.js} +1 -1
- package/dist/client/assets/{bot-B5sub1-i.js → bot-rd0awxD3.js} +1 -1
- package/dist/client/assets/{check-C18YQC90.js → check-ofKUE8yH.js} +1 -1
- package/dist/client/assets/{chevron-down-Mp9mu_yd.js → chevron-down-wciXnOQz.js} +1 -1
- package/dist/client/assets/{chevron-right-CzH-TaSF.js → chevron-right-D-HdlPg8.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-swV8PA2k.js → chunk-HRAB3GC3-Tyv9rzx7.js} +1 -1
- package/dist/client/assets/{chunk-JTPDIGGW-BKXqcLKw.js → chunk-JTPDIGGW-BC2Mandc.js} +3 -3
- package/dist/client/assets/{chunk-T65CQEWV-vYbNJ8E6.js → chunk-T65CQEWV-C1AWTYZZ.js} +1 -1
- package/dist/client/assets/{chunk-YOZR3KYS-U65yUmqt.js → chunk-YOZR3KYS-DwHPHa6f.js} +1 -1
- package/dist/client/assets/{clock-B4PTFi5m.js → clock-B88r8OrZ.js} +1 -1
- package/dist/client/assets/{code-xml-Jtxsp5d1.js → code-xml-D7pOQM9l.js} +1 -1
- package/dist/client/assets/{compass-0_54-vz3.js → compass-Dt1AMXz2.js} +1 -1
- package/dist/client/assets/content-9K38QchR.js +1 -0
- package/dist/client/assets/content-BRgnyXWh.js +1 -0
- package/dist/client/assets/{content-CHghn-rT.js → content-BWPNyXJ0.js} +1 -1
- package/dist/client/assets/content-BdkI07v3.js +1 -0
- package/dist/client/assets/content-C4oWa8SB.js +1 -0
- package/dist/client/assets/content-C9ijJxyl.js +1 -0
- package/dist/client/assets/content-CFZ4rghn.js +1 -0
- package/dist/client/assets/content-CIqu_Ci_.js +1 -0
- package/dist/client/assets/content-CnJF9DGO.js +1 -0
- package/dist/client/assets/content-CriW8Y8u.js +1 -0
- package/dist/client/assets/content-DDCyPPk_.js +1 -0
- package/dist/client/assets/content-DtcZeh5m.js +1 -0
- package/dist/client/assets/content-U9tsdtle.js +1 -0
- package/dist/client/assets/content-hFLK3CON.js +1 -0
- package/dist/client/assets/{content-DMbawvqU.js → content-nkx0swDe.js} +1 -1
- package/dist/client/assets/content-p00KQrtD.js +1 -0
- package/dist/client/assets/{conversation-icons-BV10B2Me.js → conversation-icons-tp9BX6X2.js} +1 -1
- package/dist/client/assets/{conversation-model-CwF6Y9gx.js → conversation-model-Dc02NsGp.js} +1 -1
- package/dist/client/assets/conversation-motion-features-D9-RmBSq.js +1 -0
- package/dist/client/assets/{copy-Dtpx4FOE.js → copy-CWWAJ75H.js} +1 -1
- package/dist/client/assets/{cpu-BjVis9mc.js → cpu-DrqejfkB.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DXpqZP7I.js → createLucideIcon-DezKXSG2.js} +1 -1
- package/dist/client/assets/{ctx-panel-D_HJ3nhb.css → ctx-panel-F05jXK4Q.css} +1 -1
- package/dist/client/assets/discover-C2CZO4Tk.js +2 -0
- package/dist/client/assets/embed-entry-BSMUykuG.js +2 -0
- package/dist/client/assets/{external-link-Ckiyzjwo.js → external-link-Dp_a2vRZ.js} +1 -1
- package/dist/client/assets/{eye-CpfyvdLq.js → eye-BRyD0jno.js} +1 -1
- package/dist/client/assets/{file-code-corner-7mo7EviR.js → file-code-corner-muIVH_xO.js} +1 -1
- package/dist/client/assets/{file-text-KijGBnME.js → file-text-CqJgwxmv.js} +1 -1
- package/dist/client/assets/{gauge-y-Xg8Mrv.js → gauge-hU--hKVP.js} +1 -1
- package/dist/client/assets/{gestures-Bq9XnSqY.js → gestures-DN4hEeqv.js} +1 -1
- package/dist/client/assets/{git-branch-BQ_x8KZL.js → git-branch-CK5v8F2v.js} +1 -1
- package/dist/client/assets/{home-moving-signal-DtRpiNa0.js → home-moving-signal-BjDtEJUP.js} +1 -1
- package/dist/client/assets/{home-now-card-DFb4GOgM.js → home-now-card-nF8OotI-.js} +1 -1
- package/dist/client/assets/{home-now-card-nano-D--m9jpq.js → home-now-card-nano-C-r_bBg5.js} +1 -1
- package/dist/client/assets/{hooks-9d1SoaQA.js → hooks-D46bABUP.js} +1 -1
- package/dist/client/assets/index-CPrU5q04.js +1 -0
- package/dist/client/assets/{index-CZ-05hKz.js → index-DvLtl7rV.js} +5 -5
- package/dist/client/assets/index-kL1WLbeS.js +1 -0
- package/dist/client/assets/index-zvhpRHao.js +1 -0
- package/dist/client/assets/{inspector-panel-C-EhEDYy.js → inspector-panel-Dkc7rLvY.js} +1 -1
- package/dist/client/assets/{keyboard-nav-DFhAJkW3.js → keyboard-nav-BLYDhL3Z.js} +1 -1
- package/dist/client/assets/{lane-roster-store-gUBsydNf.js → lane-roster-store-DOdI1O13.js} +1 -1
- package/dist/client/assets/{layers-CGou-LwV.js → layers-CSsg3JVP.js} +1 -1
- package/dist/client/assets/{layout-grid-BrZt31QH.js → layout-grid-DOChPJdZ.js} +1 -1
- package/dist/client/assets/left-B-SdEJSJ.js +1 -0
- package/dist/client/assets/{left-B_o51JV6.js → left-B3wSE6ql.js} +1 -1
- package/dist/client/assets/{left-CwHZCGO3.js → left-BNRFiRsb.js} +1 -1
- package/dist/client/assets/{left-DA0amyfu.js → left-BggzhgXN.js} +1 -1
- package/dist/client/assets/left-CARCvvxS.js +2 -0
- package/dist/client/assets/left-CpokZYHt.js +1 -0
- package/dist/client/assets/{left-CwLs0okF.js → left-YT7mIGuH.js} +1 -1
- package/dist/client/assets/{left-advisor-DU3s01gk.js → left-advisor-CCY0vkcO.js} +1 -1
- package/dist/client/assets/left-agents-trhO5sL8.js +1 -0
- package/dist/client/assets/{left-default-uvuvDmt0.js → left-default-CG33elBs.js} +1 -1
- package/dist/client/assets/{left-lanes-DnNLgec8.js → left-lanes-CitMgeTp.js} +1 -1
- package/dist/client/assets/{left-mission-DN3-NLPC.js → left-mission-Zl2m_5eU.js} +1 -1
- package/dist/client/assets/{library-DIo5NiGP.js → library-DkALuCh5.js} +1 -1
- package/dist/client/assets/{loader-circle-BiohlpM3.js → loader-circle-pM56HNhR.js} +1 -1
- package/dist/client/assets/{local-agents-wUIaBcEr.js → local-agents-C8xAhbO5.js} +1 -1
- package/dist/client/assets/{mentions-CcPFMbmZ.js → mentions-DG6OQrsc.js} +1 -1
- package/dist/client/assets/{mesh-buckets-ByyFXdKT.js → mesh-buckets-6y3ZIibI.js} +1 -1
- package/dist/client/assets/{mesh-ops-CvGyjK84.js → mesh-ops-BZ1h5RQs.js} +1 -1
- package/dist/client/assets/{mesh-roster-n2nDpEmA.js → mesh-roster-Bc7T4b7z.js} +1 -1
- package/dist/client/assets/{mesh-view-store-BpxGm71b.js → mesh-view-store-ChUOASK8.js} +1 -1
- package/dist/client/assets/{message-circle-B2ddzBrX.js → message-circle-mZCv8tvB.js} +1 -1
- package/dist/client/assets/{message-markup-RkfmDfME.js → message-markup-C2LQDm_k.js} +1 -1
- package/dist/client/assets/{message-square-D9YYWE0x.js → message-square-C7t_qtuj.js} +1 -1
- package/dist/client/assets/{message-visibility-DwxgcgYK.js → message-visibility-CGOmSSKs.js} +1 -1
- package/dist/client/assets/{mission-control-store-Bf4b54MV.js → mission-control-store-nDLdUZPA.js} +1 -1
- package/dist/client/assets/{observe-CJRIvOCn.js → observe-BpEm1INu.js} +1 -1
- package/dist/client/assets/{page-status-BptpTdQ-.js → page-status-E5jnk48p.js} +1 -1
- package/dist/client/assets/{paperclip-B1UNGl5d.js → paperclip-C64lkcbM.js} +1 -1
- package/dist/client/assets/{persistent-state-YI-WHSCF.js → persistent-state-EHXw8WNy.js} +1 -1
- package/dist/client/assets/{plus-CuU_X0-8.js → plus-Co-dqKul.js} +1 -1
- package/dist/client/assets/{profile-rY8jO38P.js → profile-APxDsN2P.js} +1 -1
- package/dist/client/assets/projects-inbox-Cg4X2lUQ.js +1 -0
- package/dist/client/assets/projects-inbox-DRBl2N85.css +1 -0
- package/dist/client/assets/{proxy-DnLpZIi9.js → proxy-BiW5suC7.js} +1 -1
- package/dist/client/assets/{radio-Dm1ItnA4.js → radio-BOxBQX-T.js} +1 -1
- package/dist/client/assets/{refresh-cw-BRn9Oxxl.js → refresh-cw-DMxGzDwn.js} +1 -1
- package/dist/client/assets/resolve-panes-DeVJbS9c.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-BQe5J6xF.js +1 -0
- package/dist/client/assets/{right-BJltPRnd.js → right-Bmfd3pjP.js} +1 -1
- package/dist/client/assets/{right-Beh3nCUB.js → right-BqI-nr9G.js} +1 -1
- package/dist/client/assets/{right-D3aTKf1F.js → right-BuCgE0fZ.js} +1 -1
- package/dist/client/assets/{right-Shpw_xDy.js → right-BwlW6E57.js} +1 -1
- package/dist/client/assets/{right-CPP7GyOm.js → right-C0ybUw0j.js} +1 -1
- package/dist/client/assets/{right-BbyYdzHn.js → right-CdkcrmeD.js} +1 -1
- package/dist/client/assets/{right-CJnB_Bg7.js → right-CimaAvQN.js} +1 -1
- package/dist/client/assets/{right-C1yumXNx.js → right-CkCCPbCX.js} +1 -1
- package/dist/client/assets/{right-DI1B79nR.js → right-D3eSiy41.js} +1 -1
- package/dist/client/assets/{right-DtsRNX5b.js → right-Dz_xD0Vj.js} +1 -1
- package/dist/client/assets/{rocket-DOwXHKWA.js → rocket-BQm5_CvR.js} +1 -1
- package/dist/client/assets/router-B9vQkNJL.js +1 -0
- package/dist/client/assets/{scope-views-A4_vP97W.js → scope-views-1IYJdl41.js} +1 -1
- package/dist/client/assets/{scout-voice-BhPzrc6P.js → scout-voice-BVUqGhth.js} +1 -1
- package/dist/client/assets/{scoutbot-markdown-jh7tzFB1.js → scoutbot-markdown-BQ_Ee2Ic.js} +1 -1
- package/dist/client/assets/{scroll-text-DO0GQzvN.js → scroll-text-Dze_dXtQ.js} +1 -1
- package/dist/client/assets/{search-D1tJSAWe.js → search-CDko0PKE.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-B9IF8wXl.js → secondaryNavConfig-BoQ_zYR9.js} +1 -1
- package/dist/client/assets/{selection-bridge-i2S9zpf8.js → selection-bridge-Din6yV3h.js} +1 -1
- package/dist/client/assets/{send-horizontal-CgLppsIC.js → send-horizontal-CSjIm6xg.js} +1 -1
- package/dist/client/assets/{server-Dymv5Emh.js → server-Bzj7lPIx.js} +1 -1
- package/dist/client/assets/{session-catalog-DNaOEzoQ.js → session-catalog-DsaZJXZt.js} +1 -1
- package/dist/client/assets/session-ref-lookup-state-SATH_jAP.js +1 -0
- package/dist/client/assets/{session-table-PTQVoTyc.js → session-table-BQfR7u6r.js} +1 -1
- package/dist/client/assets/{settings-2fC_G9nX.js → settings-Dyvpkb1D.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-BPSMHhbm.js → sliders-horizontal-C8njVwfg.js} +1 -1
- package/dist/client/assets/{sparkles-Dy8p5xN8.js → sparkles-CETYrxGA.js} +1 -1
- package/dist/client/assets/{sse-CiOSzE5n.js → sse-CD9MMUxl.js} +1 -1
- package/dist/client/assets/{tail-events-BMQmSx1n.js → tail-events-Ps8KpKah.js} +1 -1
- package/dist/client/assets/{terminal-yN9xN-h9.js → terminal-9GRS_Qdc.js} +1 -1
- package/dist/client/assets/{terminal-relay-9lhzEp2V.js → terminal-relay-GYMIvKs1.js} +1 -1
- package/dist/client/assets/{terminal-takeover-DANQfTcy.js → terminal-takeover-_Jyys4me.js} +1 -1
- package/dist/client/assets/{text-CnZ0e1-V.js → text-BP3oyl8-.js} +1 -1
- package/dist/client/assets/{text-rLpBg4_z.css → text-BYAFNLNq.css} +1 -1
- package/dist/client/assets/{use-conversation-list-D9BNLfnW.js → use-conversation-list-C9ABzjXI.js} +1 -1
- package/dist/client/assets/use-fleet-active-asks-DAspZQjE.js +1 -0
- package/dist/client/assets/{use-mesh-ops-items-BIvIHlqe.js → use-mesh-ops-items-Dh54ymEp.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-CKkhq9c5.js → use-reduced-motion-x8pJMVrG.js} +1 -1
- package/dist/client/assets/{use-scout-dev-flags-B2KCzPxn.js → use-scout-dev-flags-DhCbiDK3.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-CHBsxcbp.js → useAgentHoverCard-DoBwV0LX.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-pZe2Zfk1.js +1 -0
- package/dist/client/assets/{usePierreRuntime-DUuXH5yp.js → usePierreRuntime-ejq9dCWV.js} +1 -1
- package/dist/client/assets/{wrench-YcXMlsh2.js → wrench-DjkoAOQt.js} +1 -1
- package/dist/client/assets/{x-e3h2hDsp.js → x-CAbNespN.js} +1 -1
- package/dist/client/assets/{xterm-Byp1Hep_.js → xterm-Cf-ngcGP.js} +1 -1
- package/dist/client/assets/{zap-nMcjPoWB.js → zap-Cq8eWkcF.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/drizzle/0009_old_korg.sql +72 -0
- package/dist/drizzle/0010_sparkling_colonel_america.sql +2 -0
- package/dist/drizzle/0011_funny_onslaught.sql +4 -0
- package/dist/drizzle/0012_high_blazing_skull.sql +16 -0
- package/dist/drizzle/0013_perfect_juggernaut.sql +1 -0
- package/dist/drizzle/0014_legal_meggan.sql +6 -0
- package/dist/drizzle/0015_lame_marvel_boy.sql +12 -0
- package/dist/drizzle/0016_early_goliath.sql +6 -0
- package/dist/drizzle/meta/0009_snapshot.json +6262 -0
- package/dist/drizzle/meta/0010_snapshot.json +6286 -0
- package/dist/drizzle/meta/0011_snapshot.json +6337 -0
- package/dist/drizzle/meta/0012_snapshot.json +6458 -0
- package/dist/drizzle/meta/0013_snapshot.json +6465 -0
- package/dist/drizzle/meta/0014_snapshot.json +6503 -0
- package/dist/drizzle/meta/0015_snapshot.json +6596 -0
- package/dist/drizzle/meta/0016_snapshot.json +6611 -0
- package/dist/drizzle/meta/_journal.json +56 -0
- package/dist/main.mjs +1311 -363
- package/dist/node/main.mjs +314 -12
- package/dist/pairing-runtime-controller.mjs +608 -108
- package/dist/runtime/base-daemon.mjs +30 -3
- package/dist/runtime/broker-daemon.mjs +4771 -529
- package/dist/runtime/broker-process-manager.mjs +23 -2
- package/dist/runtime/mesh-discover.mjs +23 -2
- package/dist/scout-control-plane-web.mjs +1914 -478
- package/package.json +25 -6
- package/dist/client/assets/AgentLanesEmbedScreen-BmLnN4on.js +0 -1
- package/dist/client/assets/AgentLanesPreflight-5B6sXvRB.js +0 -1
- package/dist/client/assets/AgentLanesView-DHyzVBk6.js +0 -2
- package/dist/client/assets/AgentsSubnav-CDMjKeYC.js +0 -1
- package/dist/client/assets/ChatCollapsedStrip-Ycm0ecaX.js +0 -1
- package/dist/client/assets/ConversationScreen-BNULZAp2.js +0 -2
- package/dist/client/assets/CrewWorkspaces-CJhBKVoZ.css +0 -1
- package/dist/client/assets/CrewWorkspaces-CkPYIA46.js +0 -1
- package/dist/client/assets/FlightObserveScreen-CDWGSKZg.js +0 -1
- package/dist/client/assets/MessagesScreen-Eulveud3.js +0 -1
- package/dist/client/assets/NewChatComposer-hlWT-nbR.js +0 -19
- package/dist/client/assets/OpsScreen-Ppen_Lmj.js +0 -1
- package/dist/client/assets/OpsSubnav-GAKsoSor.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-BLlp2e6t.js +0 -1
- package/dist/client/assets/ProjectsInbox-Dlt8OQ8O.js +0 -2
- package/dist/client/assets/ProjectsRail-DCfNMmnW.js +0 -1
- package/dist/client/assets/ProjectsScreen-BP-hmI1m.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-CWpMjGIH.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-D7zZHK_t.js +0 -1
- package/dist/client/assets/ScoutDeckSurface-CKT3qdqY.js +0 -1
- package/dist/client/assets/SessionEmbedScreen-RD5XOx7R.js +0 -1
- package/dist/client/assets/SessionRefScreen-B_cTv47v.js +0 -1
- package/dist/client/assets/SessionsScreen-Bq0Z77On.js +0 -1
- package/dist/client/assets/archive-BjcGiAy8.js +0 -1
- package/dist/client/assets/content-6RvWTrtk.js +0 -1
- package/dist/client/assets/content-BCgwMUqz.js +0 -1
- package/dist/client/assets/content-Bf2VLhx0.js +0 -1
- package/dist/client/assets/content-BrU_38-m.js +0 -1
- package/dist/client/assets/content-BvvJN8rN.js +0 -1
- package/dist/client/assets/content-CAeEqYPw.js +0 -1
- package/dist/client/assets/content-CI_Z9DXk.js +0 -1
- package/dist/client/assets/content-CbyKONhW.js +0 -1
- package/dist/client/assets/content-Czogvp43.js +0 -1
- package/dist/client/assets/content-DFk0zNzX.js +0 -1
- package/dist/client/assets/content-DHe4DgkA.js +0 -1
- package/dist/client/assets/content-DTz7cKjo.js +0 -1
- package/dist/client/assets/content-E3kudY-W.js +0 -1
- package/dist/client/assets/content-LpO0aO_U.js +0 -1
- package/dist/client/assets/conversation-motion-features-BKkCRaWR.js +0 -1
- package/dist/client/assets/discover-CHbrEItO.js +0 -2
- package/dist/client/assets/embed-entry-vil28MyU.js +0 -2
- package/dist/client/assets/index-BVlMw8x_.js +0 -1
- package/dist/client/assets/index-Cn0GR-q1.js +0 -1
- package/dist/client/assets/index-DosI4AG9.js +0 -1
- package/dist/client/assets/left-BpgWnaah.js +0 -1
- package/dist/client/assets/left-Cx0kv6pe.js +0 -1
- package/dist/client/assets/left-agents-qL5PpUY-.js +0 -1
- package/dist/client/assets/left-z-6CkuBe.js +0 -2
- package/dist/client/assets/projects-inbox-BBs1hG13.css +0 -1
- package/dist/client/assets/projects-inbox-D-zAb9Gp.js +0 -1
- package/dist/client/assets/resolve-panes-DO6LkwhQ.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-CIF288wY.js +0 -1
- package/dist/client/assets/router-DJj2WbDg.js +0 -1
- package/dist/client/assets/use-fleet-active-asks-BeAdcl09.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-D0mUhxTF.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as L,j as jt,N as ce,O as Nt,P as Ne,Q as Me,A as Mt,R as Bt,B as k,D as h,T as zt,U as J,V as Wt,W as Kt}from"./index-DvLtl7rV.js";import{b as Gt}from"./perf-PX8Rx0EP.js";import{n as ue}from"./synthetic-agent-routing-aduMYO7P.js";import{o as Ht,q as Be,n as Vt,u as Yt}from"./terminal-sessions-BQ6t92tJ.js";var ze=["local","url","sharedConfig","env"];function We(e){const t=qt(e),n=e.audienceIncludes??Qt(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 c=r[a];if(!c)return o(a),{key:a,enabled:!1,value:!1,layer:"default",audience:t,reason:"unknown-flag"};const d=Xt(e.layers,a);return d?{key:a,enabled:d.value,value:d.value,layer:d.layer,audience:t,requiredTier:c.tier,reason:"override",definition:c}:c.defaultEnabled?c.tier&&!n(t,c.tier)?{key:a,enabled:!1,value:!1,layer:"default",audience:t,requiredTier:c.tier,reason:"audience-denied",definition:c}:{key:a,enabled:!0,value:!0,layer:"default",audience:t,requiredTier:c.tier,reason:"default",definition:c}:{key:a,enabled:!1,value:!1,layer:"default",audience:t,requiredTier:c.tier,reason:"default",definition:c}}return{registry:e.registry,isEnabled:a=>i(String(a)).enabled,explain:a=>i(String(a)),all:()=>Object.keys(e.registry).sort().map(i),audience:()=>t}}function qt(e){let t=e.audience.tier;for(const n of ze.slice().reverse()){const s=e.layers?.[n]?.audience;s&&(t=s)}return{...e.audience,tier:t}}function Qt(e){return(t,n)=>{if(t.tier===n)return!0;if(!e||e.length===0)return!1;const s=e.indexOf(t.tier),o=e.indexOf(n);return s<0||o<0?!1:s>=o}}function Xt(e,t){for(const n of ze){const s=Zt(e?.[n]?.flags?.[t]);if(s!==null)return{layer:n,value:s}}return null}function Zt(e){return e===!0||e==="on"?!0:e===!1||e==="off"?!1:null}function Jt(e){if(e===!0||e===!1)return e;if(typeof e=="number"){if(e===1)return!0;if(e===0)return!1}if(typeof e!="string")return;const t=e.trim().toLowerCase();if(["1","true","on","yes","enabled","enable"].includes(t))return!0;if(["0","false","off","no","disabled","disable"].includes(t))return!1;if(["default","null","unset","clear"].includes(t))return"default"}function en(e,t={}){const n=t.paramPrefix??"ff.",s=t.audienceParam??"ffAudience",o=typeof e=="string"?new URL(e,"http://hudson.local"):e,r={};let i;for(const[a,c]of o.searchParams.entries()){if(a===s&&c.trim()&&(i=c.trim()),!a.startsWith(n))continue;const d=a.slice(n.length),f=Jt(c);d&&f!==void 0&&(r[d]=f)}return{flags:r,audience:i}}var D=1;function Ke(e){if(typeof window>"u")return{version:D};try{const t=window.localStorage?.getItem(e);return tn(t)}catch{return{version:D}}}function q(e,t){if(typeof window>"u")return;const n=Ge(t),s=JSON.stringify(n);try{window.localStorage?.setItem(e,s)}catch{}nn(e,s)}function tn(e){if(!e)return{version:D};try{const t=JSON.parse(e);return!t||typeof t!="object"?{version:D}:Ge(t)}catch{return{version:D}}}function Ge(e){const t={version:D};if(e.audience&&(t.audience=e.audience),e.flags&&typeof e.flags=="object"){t.flags={};for(const[n,s]of Object.entries(e.flags))(s===!0||s===!1)&&(t.flags[n]=s);Object.keys(t.flags).length===0&&delete t.flags}return t}function nn(e,t){if(!(typeof document>"u"))try{const n=encodeURIComponent(t);document.cookie=`${encodeURIComponent(e)}=${n}; Path=/; SameSite=Lax; Max-Age=31536000`}catch{}}var sn="hudson.flags",He=L.createContext(null);function js({registry:e,audience:t,audienceOrder:n,audienceIncludes:s,initialLayers:o,storageKey:r=sn,warnOnUnknown:i=!1,children:a}){const[c,d]=L.useState(()=>{const g=o?.local;return{version:1,audience:g?.audience??void 0,flags:on(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:c.audience??o?.local?.audience,flags:{...o?.local?.flags??{},...c.flags??{}}}}),[o,c]),S=L.useMemo(()=>We({registry:e,audience:t,audienceOrder:n,audienceIncludes:s,layers:f,warnOnUnknown:i}),[e,t,n,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 jt.jsx(He.Provider,{value:A,children:a})}function Ve(){return L.useContext(He)}function Ns(){const e=Ve();if(!e)throw new Error("useFeatureFlags must be used within FeatureFlagsProvider");return e}function Ms(e,t=!0){return Ve()?.isEnabled(e)??t}function on(e){if(!e?.flags)return;const t={};for(const[n,s]of Object.entries(e.flags))(s===!0||s===!1)&&(t[n]=s);return Object.keys(t).length>0?t:void 0}const rn=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal"],an=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.scoutbot","surface.workflows"];function ye(e,t){return Object.fromEntries(e.map(n=>[n,t]))}const Ye={label:"Surface · Scope",description:`Scope presentation on Scout infra — lean lanes/tail/sessions/agents at ${Nt}/*.`,defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","scope","observability"]},cn={...Ye,label:"Surface · Scope (legacy alias)",description:`Legacy alias for ${ce}. Prefer the primary flag; ${Ne} remains for old dev links.`},Bs=ce;function un(){return{audience:"everyone",flags:{"ops.control":!0,"ops.lanes":!0,...ye(rn,!1),...ye(an,!1)}}}const qe=["ffBundle","ffVariant","scoutBundle","scoutExperience","ab"],Qe=["ffGlobal","scoutGlobalBundle"],Xe=["ffPersist","persistBundle"],ln=new Set(["no-ops","ffAudience",...qe,...Qe,...Xe]);function zs(e){for(const t of[...e.searchParams.keys()])(ln.has(t)||t.startsWith("ff."))&&e.searchParams.delete(t);return e}const dn=["everyone","internal","power"],fn="openscout.flags",ee="openscout.flagBundle",mn={tier:"power"},Ee=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal","ops.lanes"],$e=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.mesh-ops","surface.scoutbot","surface.workflows"],pn={"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. Operator enablement lives in Settings → Voice; this flag is a build-level kill switch.",defaultEnabled:!0,tier:"everyone",owner:"scout-web",tags:["surface","assistant","voice"]},"surface.workflows":{label:"Surface · Workflows",description:"Observed harness families / workflow topology telemetry on the Agents directory. Off in the lean view — the directory is just the project-grouped agent board.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","observability"]},[ce]:Ye,[Ne]:cn},gn={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",...Bt},Re=new Set(["clear","default","none","reset","unset"]);function K(e,t){return Object.fromEntries(e.map(n=>[n,t]))}function Ze(...e){const t={};for(const n of e)n.audience&&(t.audience=n.audience),n.flags&&Object.keys(n.flags).length>0&&(t.flags={...t.flags??{},...n.flags});return t}function le(e){switch(e){case"light-prod":return{audience:"everyone",flags:{...K(Ee,!1),...K($e,!1)}};case"max-pro":return{audience:"power",flags:{...K(Ee,!0),...K($e,!0)}};case Mt:return un()}}function j(e){return e?gn[e.trim().toLowerCase()]??null:null}function te(e,t){for(const n of t){const s=e.get(n);if(s!==null)return s}return null}function Je(e){const t=te(e,qe);return j(t)}function hn(e){const t=te(e,Qe);if(t){const i=t.trim().toLowerCase();if(Re.has(i))return{action:"clear"};const a=j(t);return a?{action:"set",bundle:a}:null}const n=te(e,Xe);if(!n)return null;const s=n.trim().toLowerCase();if(Re.has(s))return{action:"clear"};if(["0","false","no"].includes(s))return null;const o=j(n);if(o)return{action:"set",bundle:o};const r=Je(e);return r?{action:"set",bundle:r}:null}function et(){if(typeof window>"u")return null;try{return j(window.localStorage.getItem(ee))}catch{return null}}function wn(e){if(!(typeof window>"u"))try{e.action==="clear"?window.localStorage.removeItem(ee):window.localStorage.setItem(ee,e.bundle)}catch{}}function Ws(){return et()??j(Me())??nt}function tt(){const e=et();return e?le(e):{}}const nt="light-prod";function st(){const e=j(Me())??nt;return le(e)}function In(e){const t=hn(e);t&&wn(t)}function ot(e=new URLSearchParams(window.location.search)){const t=en(window.location.href),n=Je(e),s=n?le(n):{},o={audience:t.audience??s.audience,flags:{...s.flags??{},...t.flags??{}}};return e.has("no-ops")&&(o.flags={...o.flags,"ops.control":!1}),o}function vn(){const e=Ke(fn);return{flags:e.flags,audience:e.audience??void 0}}function Ks(){if(typeof window>"u")return{};const e=new URLSearchParams(window.location.search);return In(e),{sharedConfig:Ze(st(),tt()),url:ot(e)}}function Sn(e){const t=typeof window>"u"?{}:{sharedConfig:Ze(st(),tt()),url:ot(),local:vn()};return We({registry:pn,audience:mn,audienceOrder:dn,layers:t,warnOnUnknown:!1}).isEnabled(e)}function rt(){return Sn("ops.control")}const ne={sm:408,md:512,lg:616},at=240,it=640,bn=24,ct="openscout:lane-deck:v1",Ln=new Set(["web.ops","macos.lanes","hud.tail","web.embed"]),de=new Set(["sm","md","lg"]),ut={"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}},yn=ut["web.ops"];function fe(e){return lt(e)?ut[e]:yn}const H={pinned_left:0,main:1,pinned_right:2};function lt(e){return Ln.has(e)}function Gs(e=window.location.search,t=window.location.pathname){const n=new URLSearchParams(e),s=n.get("profile")?.trim().toLowerCase();if(s&<(s))return s;const o=n.get("embed")?.trim().toLowerCase();return o==="hud"?"hud.tail":o==="app"?"macos.lanes":t.includes("/lanes/embed")?"web.embed":(t.includes("/ops/lanes"),"web.ops")}function Hs(e=window.location.search){const t=new URLSearchParams(e),n=(t.get("lanes")??t.get("size"))?.trim().toLowerCase();return n&&de.has(n)?n:"lg"}function Vs(e,t){if(typeof e=="number"&&Number.isFinite(e))return Math.min(it,Math.max(at,Math.round(e)));const n=typeof e=="string"&&de.has(e)?e:t;return ne[n]}function Ys(e){const t=Math.min(it,Math.max(at,Math.round(e)));let n=null,s=Number.POSITIVE_INFINITY;for(const[o,r]of Object.entries(ne)){const i=Math.abs(r-t);i<s&&(s=i,n=o)}return n&&s<=bn?{px:ne[n],tier:n}:{px:t,tier:null}}function me(e,t,n){return{version:1,profileId:e,defaultLaneWidth:t??n.defaultLaneWidth,defaultHorizon:n.defaultHorizon,laneWidths:{},laneDefs:[],slots:[],showAutoLanes:n.showAutoLanes,updatedAt:Date.now()}}function Pe(e,t){const n=fe(e);return me(e,t,n)}function se(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&de.has(e))return e}function En(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.id!="string"||!t.id.trim()||t.kind!=="session"&&t.kind!=="harness"&&t.kind!=="project"&&t.kind!=="attention"||typeof t.title!="string"||!t.title.trim()?null:{id:t.id.trim(),kind:t.kind,title:t.title.trim(),sessionId:typeof t.sessionId=="string"?t.sessionId.trim():void 0,harness:typeof t.harness=="string"?t.harness.trim():void 0,projectPath:typeof t.projectPath=="string"?t.projectPath.trim():void 0}}function $n(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.id!="string"||!t.id.trim()||typeof t.laneDefId!="string"||!t.laneDefId.trim()||t.zone!=="pinned_left"&&t.zone!=="main"&&t.zone!=="pinned_right"||typeof t.position!="number"||!Number.isFinite(t.position)?null:{id:t.id.trim(),laneDefId:t.laneDefId.trim(),zone:t.zone,position:t.position,width:se(t.width)}}function dt(e,t,n,s){if(!e||typeof e!="object")return me(t,n,s);const o=e,r=Array.isArray(o.laneDefs)?o.laneDefs.map(En).filter(d=>d!==null):[],i=Array.isArray(o.slots)?o.slots.map($n).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 c=se(o.defaultLaneWidth);return{version:1,profileId:t,defaultLaneWidth:(typeof c=="string"?c:void 0)??n??s.defaultLaneWidth,defaultHorizon:typeof o.defaultHorizon=="string"?o.defaultHorizon:s.defaultHorizon,laneWidths:a,laneDefs:r,slots:i,showAutoLanes:typeof o.showAutoLanes=="boolean"?o.showAutoLanes:s.showAutoLanes,updatedAt:typeof o.updatedAt=="number"?o.updatedAt:Date.now()}}function Rn(e,t,n){return dt(e,t,n,fe(t))}function qs(e,t){const n=fe(e),s=t??n.defaultLaneWidth;try{const o=localStorage.getItem(`${ct}:${e}`);return o?Rn(JSON.parse(o),e,s):Pe(e,s)}catch{return Pe(e,s)}}function Pn(e){try{localStorage.setItem(`${ct}:${e.profileId}`,JSON.stringify({...e,updatedAt:Date.now()}))}catch{}}function Qs(e){return[...e].sort((t,n)=>{const s=H[t.zone]-H[n.zone];return s!==0?s:t.position-n.position})}function Xs(e,t){return H[e]-H[t]}function ft(){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 Cn(e){return`harness:${pe(e)}`}function An(e){return`project:${pe(e)}`}const _n="attention:needs-input";function mt(e,t){const n=e.filter(s=>s.zone===t);return n.length===0?0:Math.max(...n.map(s=>s.position))+1}function pt(e,t){const n=e.laneDefs.some(s=>s.id===t.id);return{...e,laneDefs:n?e.laneDefs.map(s=>s.id===t.id?t:s):[...e.laneDefs,t]}}function gt(e,t){const n=e.slots.some(s=>s.id===t.id);return{...e,slots:n?e.slots.map(s=>s.id===t.id?t:s):[...e.slots,t]}}function ht(e,t){return{...e,slots:e.slots.filter(n=>n.laneDefId!==t)}}function Un(e,t){const n=Y(t);return{...ht(e,n),laneDefs:e.laneDefs.filter(s=>s.id!==n)}}function Zs(e,t){const n=Y(t);return e.slots.some(s=>s.laneDefId===n&&s.zone!=="main")}function Js(e,t){const n=Y(t),s=e.slots.find(o=>o.laneDefId===n);return!s||s.zone==="main"?null:s.zone}function eo(e,t){const n=t.zone??"pinned_left",s=Y(t.laneId),o=Un(e,t.laneId),r=pt(o,{id:s,kind:"session",title:t.title,sessionId:t.laneId});return gt(r,{id:ft(),laneDefId:s,zone:n,position:mt(r.slots,n),width:t.width})}function to(e,t){const n=t.zone??"pinned_left",s=t.kind==="attention"?_n:t.kind==="harness"&&t.harness?Cn(t.harness):t.kind==="project"&&t.projectPath?An(t.projectPath):`${t.kind}:${pe(t.title)}`,o=ht(e,s),r=pt(o,{id:s,kind:t.kind,title:t.title,harness:t.harness,projectPath:t.projectPath});return gt(r,{id:ft(),laneDefId:s,zone:n,position:mt(r.slots,n),width:t.width})}function no(e,t,n){return{...e,laneWidths:{...e.laneWidths,[t]:n},updatedAt:Date.now()}}function so(e,t){return{...e,defaultLaneWidth:t,updatedAt:Date.now()}}function oo(e){const t=new Set(e.slots.filter(n=>n.zone!=="main").map(n=>n.laneDefId));return{...e,slots:e.slots.filter(n=>n.zone==="main"),laneDefs:e.laneDefs.filter(n=>!t.has(n.id))}}const V="scope.lanes",oe={defaultLaneWidth:"md",showAutoLanes:!0,defaultHorizon:"30m"},Fn="openscout:lane-deck:v1";function Ce(e){return me(V,e,oe)}function ro(e){const t=e??oe.defaultLaneWidth;try{const n=localStorage.getItem(`${Fn}:${V}`);return n?dt(JSON.parse(n),V,t,oe):Ce(t)}catch{return Ce(t)}}function ao(e){Pn(e)}const Tn=[h.lanes,h.tail,h.sessions,h.agents];function kn(e){return Tn.includes(e)}function On(e){return e===Wt||e===Kt}function wt(e){return zt(e)}function Q(e,t={}){switch(e){case h.tail:{const n=new URLSearchParams;t.tailQuery&&n.set("q",t.tailQuery);const s=n.toString();return k(e,s?`?${s}`:"")}case h.sessions:return t.sessionId?k(e,`/${encodeURIComponent(t.sessionId)}`):k(e);case h.lanes:return k(J);case h.agents:return k(e);default:return k(J)}}function It(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 Dn(e){const t=It(e);return t?t===h.tail&&e.view==="ops"?Q(t,{tailQuery:e.tailQuery}):t===h.sessions&&e.view==="sessions"?Q(t,{sessionId:e.sessionId}):Q(t):null}function xn(e,t,n){if(!On(e[0]))return null;const s=e[1]??J;if(!kn(s))return{view:"ops",mode:"lanes"};switch(s){case h.tail:{const o=t.searchParams.get("q")?.trim();return{view:"ops",mode:"tail",...o?{tailQuery:o}:{}}}case h.sessions:return e[2]?n({view:"sessions",sessionId:decodeURIComponent(e[2])}):n({view:"sessions"});case h.agents:return n({view:"agents-v2"});case h.lanes:default:return{view:"ops",mode:"lanes"}}}const jn=new Set(["no-ops","ffBundle","ffVariant","scoutBundle","scoutExperience","ab","ffGlobal","scoutGlobalBundle","ffPersist","persistBundle","ffAudience","studio","studioInjection","studioMode"]),Nn=["ff.","studio.","studioMode."];function Mn(e){return jn.has(e)||Nn.some(t=>e.startsWith(t))}function vt(e,t=""){const n=new URL(e,"http://scout.local");new URLSearchParams(t).forEach((r,i)=>{Mn(i)&&(n.searchParams.has(i)||n.searchParams.set(i,r))});const o=n.searchParams.toString();return`${n.pathname}${o?`?${o}`:""}`}function io(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 Bn(e=typeof window<"u"?window.location.pathname:""){return wt(e)}function co(){return V}function uo(e=Bn()){return e?{"data-scope-presentation":!0}:void 0}function St(e,t=typeof window<"u"?window.location.pathname:""){return wt(t)?Dn(e):null}function zn(e,t=typeof window<"u"?window.location.pathname:""){return St(e,t)!==null}function lo(e,t=typeof window<"u"?window.location.pathname:""){return zn(e,t)?It(e):null}const fo={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 t=e?.trim();if(!t)return null;const n=t.replace(/[\\/]+$/,""),s=n.split(/[\\/]/).filter(Boolean).at(-1)??n;return s.endsWith(".jsonl")?s.slice(0,-6):s}function T(e){return e.sourceRefs.find(t=>t.kind==="harness_transcript")??null}function bt(e){return e.sourceRefs.find(t=>t.kind==="file")??null}function ge(e){return e?Ae(e.sessionId)??Ae(re(e.path)):null}function mo(e){const t=ge(e);if(!t)return null;const n=e?.recordRange;return n?`${t}|records ${n[0]}..${n[1]}`:t}function z(e,t){const n=e.facets[t];return Array.isArray(n)?n.filter(Boolean).join(", "):typeof n=="string"?n:""}function M(e){const t=new Set;return e.split(/[^A-Za-z0-9_./-]+/u).map(n=>n.trim()).filter(n=>n.length>1).filter(n=>{const s=n.toLowerCase();return t.has(s)?!1:(t.add(s),!0)}).slice(0,12)}const Wn=/^(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 Lt(e){return Wn.test(e.replace(/\s+/g," ").trim())}function Kn(e){let t=e.replace(/\s+/g," ").trim();if(!t)return"";if(t=t.replace(/<[^>\n]+>/g," ").replace(/\s+/g," ").trim(),Ue.test(t))t=t.replace(Ue,"").trim();else{const n=t.match(/^(.{6,72}?)\s[-–—]\s+(.+)$/u);if(n){const s=n[1]??"",o=n[2]??"";(_e.test(s)||/\b(?:am|pm|\d{1,2}:\d{2}|plugin|session|openscout)\b/iu.test(s))&&(t=o.trim())}}return t=t.replace(_e,"").replace(/^\s*[-–—:]\s*/,"").trim(),t=t.replace(/\s{2,}/g," ").trim(),t.length>72&&(t=`${t.slice(0,69).replace(/\s+\S*$/u,"").trimEnd()}…`),t}function Gn(e){const t=z(e,"project"),n=e.title.replace(/\s+/g," ").trim();if(n&&!Lt(n)){const o=Kn(n);if(o&&o.toLowerCase()!==t.toLowerCase()||o)return o}if(t)return t;const s=ge(T(e));return s?s.length>18?`${s.slice(0,16)}…`:s:"Session match"}function yt(e){const t=B(e,"recordKind",8).map(s=>s.toLowerCase());if(t.length===0&&t.push(...B(e,"recordTag",8).map(s=>s.toLowerCase())),t.some(s=>s.includes("assistant")))return"assistant";if(t.some(s=>s.includes("user")))return"user";if(t.some(s=>s.includes("tool")||s.includes("command")||s.includes("response")))return"tool";const n=we(e);return n==="tool activity"?"tool":n==="overview"?"overview":""}function po(e,t){const n=Ie(e.snippet,t),s=yt(e),o=he(e);let r="";if(n){const i=M(t).map(d=>d.toLowerCase()),a=n.split(new RegExp("(?<=[.!?])\\s+|\\s+[–—]\\s+|\\s+·\\s+","u")).map(d=>d.replace(/^…+|…+$/gu,"").trim()).filter(d=>d.length>12);r=((i.length>0?a.find(d=>i.some(f=>ae(d,f)>=0)):void 0)??a[0]??n).replace(/^…+|…+$/gu,"").trim()}return r?(r.length>78&&(r=`${r.slice(0,75).replace(/\s+\S*$/u,"").trimEnd()}…`),r):s&&o?`${s} · ${o}`:o||s||Gn(e)}function Hn(e){return e.freshness&&e.freshness!=="unknown"?e.freshness:e.title.replace(/\s+/g," ").trim().match(/\b((?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[a-z]*\s+\d{1,2}(?:\s+at\s+\d{1,2}:\d{2}\s*(?:AM|PM)?)?)\b/iu)?.[1]??""}function Fe(e){const t=e.trim().toLowerCase();return t?t==="events"||t.startsWith("events")?"conversation":t==="overview"||t==="summary"?"overview":t==="tool-calls"||t==="tools"?"tool activity":t==="files"||t==="files-touched"?"files touched":t==="manifest"?"session index":t.replace(/[-_]+/g," "):""}function Vn(e){const t=e.trim();return t?t.charAt(0).toUpperCase()+t.slice(1):""}function Yn(e){const t=z(e,"harness")||T(e)?.harness||"";if(!t)return"";const n=t.toLowerCase();return n==="claude"?"Claude":n==="codex"?"Codex":n==="kimi"?"Kimi":n==="cursor"?"Cursor":Vn(t)}function qn(e){const t=z(e,"sessionId").trim(),n=ge(T(e)),s=(t||n||"").trim();return s?s.length>14?s.slice(0,8):s:""}function he(e){const t=T(e)?.recordRange;if(t){const[s,o]=t;return s===o?`turn ${s}`:o-s<=1?`turns ${s}–${o}`:`turns ${s}–${o}`}const n=e.title.match(/events?\s+window\s+(\d+)/iu);return n?`window ${Number(n[1])}`:""}function Qn(e){const t=B(e,"recordKind",8).map(s=>s.toLowerCase());t.length===0&&t.push(...B(e,"recordTag",8).map(s=>s.toLowerCase()));const n=[];return t.some(s=>s.includes("user"))&&n.push("user"),t.some(s=>s.includes("assistant"))&&n.push("assistant"),t.some(s=>s.includes("tool")||s.includes("command")||s.includes("response"))&&n.push("tool"),n.length===0?"":n.join(" · ")}function we(e){const t=z(e,"documentKind");if(t){const s=t.split(",")[0]?.trim()??t;return Fe(s)}return Lt(e.title)?Fe(e.title):bt(e)?"file":T(e)?"conversation":""}function B(e,t,n=3){const s=e.facets[t];return(Array.isArray(s)?s:typeof s=="string"?s.split(","):[]).map(r=>r.trim()).filter(Boolean).slice(0,n)}function go(e){return{agent:Yn(e),project:z(e,"project"),session:qn(e),when:Hn(e),turn:he(e),role:Qn(e),where:we(e)}}function ho(e){const t=[],n=he(e);n&&t.push(n);const s=yt(e);s&&t.push(s);const o=we(e);o&&o!=="conversation"&&t.push(o);const r=B(e,"toolName",2);r.length===1&&t.push(r[0]),r.length>1&&t.push(r.join(", "));const i=new Set;return t.filter(a=>{const c=a.toLowerCase();return i.has(c)?!1:(i.add(c),!0)})}function ae(e,t){return new RegExp(`(?<![A-Za-z0-9_./~-])${Rt(t)}(?![A-Za-z0-9_./~-])`,"iu").exec(e)?.index??-1}function Ie(e,t=""){let n=e.replace(/\s+/g," ").trim();if(!n)return"";if(n=n.replace(/\s*-\s*\[\d{3,}\]\s*`[^`]+`(?:\s*\([^)]*\))?\s*-\s*/gu," "),n=n.replace(/\[\d{3,}\]\s*`[^`]+`\s*/gu,""),n=n.replace(/\*\*/gu,""),n=n.replace(/\b(?:assistant_turn|user_turn|agent_reasoning|command_or_tool|response_item|system_record)\b/giu," "),n=n.replace(/(?:~\/|\.\.?\/|\/(?:Users|home|var|tmp|opt)\/)\S+/gu," "),n=n.replace(/https?:\/\/\S+/gu," "),n=n.replace(/\b[\w.-]+\.(?:com|net|org|io|dev|app)(?:\/\S*)?/giu," "),n=n.replace(/\{[^{}]{0,160}\}/gu," "),n=n.replace(/`[^`]{0,64}`/gu,r=>{const i=r.slice(1,-1);return M(t).some(a=>ae(i,a)>=0)||/^[A-Za-z][\w.-]{0,24}$/u.test(i)?i:" "}),n=n.replace(/\s{2,}/g," ").trim(),n=n.replace(/^[\s,;:.\-–—|/]+/u,"").trim(),n.includes("{")||n.includes("[")){const r=n.search(/[\[{]/u);if(r>18){const i=n.slice(0,r).trim().replace(/[-–—,:;]+$/u,"").trim();i&&(n=i)}}const s=M(t),o=200;if(s.length>0&&n.length>o){let r=-1;for(const i of s){const a=ae(n,i);a>=0&&(r<0||a<r)&&(r=a)}if(r<0)for(const i of s){if(i.length<4)continue;const a=n.toLowerCase().indexOf(i.toLowerCase());a>=0&&(r<0||a<r)&&(r=a)}if(r>=0){const a=Math.max(0,r-48),c=Math.min(n.length,a+o),d=n.slice(a,c).trim();n=`${a>0?"…":""}${d}${c<n.length?"…":""}`}else n=`${n.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`}else n.length>o&&(n=`${n.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`);return n.replace(/\s{2,}/g," ").trim()}function wo(e,t,n){const s=Ie(e.snippet,t);return s.length<=n?s:`${s.slice(0,n-1).replace(/\s+\S*$/u,"").trimEnd()}…`}function Xn(e,t){return M(t).filter(n=>{const s=n.toLowerCase();return e.title.toLowerCase().includes(s)||e.snippet.toLowerCase().includes(s)||Ie(e.snippet,t).toLowerCase().includes(s)})}function Et(e){const t=(e.kind||e.role||e.type||"record").toLowerCase();return t==="assistant_turn"||t==="assistant"?"assistant":t==="user_turn"||t==="user"?"user":t==="system_record"||t==="system"?"system":t==="command_or_tool"||t==="tool_use"?"tool":t==="response_item"?"tool output":t==="agent_reasoning"||t==="reasoning"?"reasoning":t.replace(/_/gu," ")}function $t(e){const t=(e.kind||e.role||e.type||"").toLowerCase();return t==="assistant"||t==="assistant_turn"||t==="user"||t==="user_turn"||t==="last-prompt"||t==="ai-title"?0:t==="system"||t==="system_record"||t.includes("reasoning")?1:2}function Io(e){return e.scoreSource==="hybrid"?"Words and meaning":e.scoreSource==="vector"?"Similar in meaning":"Exact words"}function vo(e,t,n){const s=Xn(e,t),o=s.length===1?`Matched “${s[0]}”`:s.length>1?`Matched ${s.length} terms`:"Matched in this session";if(!n?.matched)return o;const r=[n.renderedText,n.summary].filter(Boolean).join(" ").toLowerCase(),i=s.filter(d=>r.includes(d.toLowerCase()));if(i.length===0)return o;const a=Et(n),c=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 ${c}`:`Matched ${i.length} terms in ${c}`}function So(e){const t=T(e);if(t){const s=re(t.path),o=t.recordRange;return o?`${s}#R${o[0]}-R${o[1]}`:s}const n=bt(e);if(n){const s=re(n.path),o=n.lineRange;return o?`${s}#L${o[0]}-L${o[1]}`:s}return e.id}function Zn(e){const t=e.filter(o=>$t(o)===2).length,n=e.length-t,s=e.some(o=>o.matched)?" · match inside":"";return t>0&&n===0?`${t} tool step${t===1?"":"s"}${s}`:t===0?`${n} process step${n===1?"":"s"}${s}`:`${t} tool + ${n} process step${e.length===1?"":"s"}${s}`}function Jn(e){return`${e.length} more conversation turn${e.length===1?"":"s"}`}function bo(e,t={}){if(e.length===0)return[];const n=t.contextRadius??3,s=t.maxTurns??6,o=t.centerRecordIndex===void 0?-1:e.findIndex(w=>w.index===t.centerRecordIndex),r=e.findIndex(w=>w.matched),i=o>=0?o:r>=0?r:0,a=e.slice(Math.max(0,i-n),Math.min(e.length,i+n+1)),c=[];let d=[],f=[],S=0;const A=()=>{d.length!==0&&(c.push({kind:"folded",records:d,summary:Zn(d)}),d=[])},g=()=>{f.length!==0&&(c.push({kind:"folded",records:f,summary:Jn(f)}),f=[])};for(const w of a){if($t(w)>0){g(),d.push(w);continue}if(A(),S>=s){f.push(w);continue}c.push({kind:"turn",record:w,role:Et(w)}),S+=1}return A(),g(),c}function Te(e){const t=T(e)?.recordRange;return t?t[0]:Number.MAX_SAFE_INTEGER}function Lo(e){const t=[],n=new Map;for(const s of e){const o=s.collectionId||s.id,r=n.get(o);r?r.push(s):(t.push(o),n.set(o,[s]))}return t.map(s=>{const o=[...n.get(s)??[]].sort((i,a)=>{const c=Te(i)-Te(a);return c!==0?c:i.score-a.score}),r=n.get(s)?.[0]??o[0];return{collectionId:s,best:r,moments:o}})}function Rt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yo(e,t){const n=M(t);if(n.length===0||e.length===0)return[{text:e,match:!1}];const s=n.map(a=>`(?<![A-Za-z0-9_./~-])${Rt(a)}(?![A-Za-z0-9_./~-])`),o=new RegExp(`(${s.join("|")})`,"giu"),r=[];let i=0;for(const a of e.matchAll(o)){const c=a.index??0;c>i&&r.push({text:e.slice(i,c),match:!1}),r.push({text:a[0],match:!0}),i=c+a[0].length}return i<e.length&&r.push({text:e.slice(i),match:!1}),r.length>0?r:[{text:e,match:!1}]}const Eo={sessions:"Sessions",skills:"Skills",mcp:"MCP",codebase:"Codebase",context_pack:"Context packs",mixed:"Mixed"},Pt=[{value:"1",label:"Last 24h"},{value:"3",label:"Last 3 days"},{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"}],$o=["sessions","skills","mcp","codebase","context_pack"];function Ro(){return{query:"",sourceKinds:[],harness:[],project:[],timeWindow:"all"}}function es(e){return e?Pt.some(t=>t.value===e):!1}function X(e){return e?e.split(",").map(t=>t.trim()).filter(t=>t.length>0):[]}function ts(e){const t=e==null?new URLSearchParams:typeof e=="string"?new URLSearchParams(e):e,n=t.get("time"),s=es(n)?n:"all";return{query:t.get("q")?.trim()??"",sourceKinds:X(t.get("source")),harness:X(t.get("harness")),project:X(t.get("project")),timeWindow:s}}function ns(e,t={}){const n=new URLSearchParams,s=e.query.trim();return s&&n.set("q",s),e.sourceKinds.length>0&&n.set("source",e.sourceKinds.join(",")),e.harness.length>0&&n.set("harness",e.harness.join(",")),e.project.length>0&&n.set("project",e.project.join(",")),e.timeWindow!=="all"&&n.set("time",e.timeWindow),t.hitId&&n.set("hit",t.hitId),n}function Po(e,t){return e.query.trim()===t.query.trim()&&e.timeWindow===t.timeWindow&&Z(e.sourceKinds,t.sourceKinds)&&Z(e.harness,t.harness)&&Z(e.project,t.project)}function Z(e,t){if(e.length!==t.length)return!1;const n=[...e].map(o=>o.trim().toLowerCase()).sort(),s=[...t].map(o=>o.trim().toLowerCase()).sort();return n.every((o,r)=>o===s[r])}function ss(e){return e.query.trim().length>0||e.sourceKinds.length>0||e.harness.length>0||e.project.length>0||e.timeWindow!=="all"}function Co(e){if(e==="all")return null;const t=Number.parseInt(e,10);return!Number.isFinite(t)||t<=0?null:Date.now()-t*24*60*60*1e3}function Ao(e){return e==="all"?"Any time":Pt.find(n=>n.value===e)?.label??e}const Ct=typeof window<"u"?window.location.href:"http://scout.local/";function os(e){const t=e.toString();return new URL(t,Ct)}function rs(e){switch(e){case"profile":case"config":case"definitions":return e==="definitions"?"config":e;case"observe":case"message":return e;default:return}}function as(e){const t=e.trim().replace(/^#/,"");if(!t.startsWith("msg-"))return null;const n=t.slice(4).trim();if(!n)return null;try{return decodeURIComponent(n)}catch{return n}}function is(e){switch(e){case"control":case"mission":case"command":case"warroom":case"conduct":case"conductor":return"mission";case"plan":case"advisor":return"advisor";case"issues":case"errors":case"warnings":return"issues";case"agents":case"tail":case"atop":case"lanes":return e;default:return}}function cs(e){return e==="delivered"||e==="failed"||e==="all"?e:void 0}function us(e){return e==="indexer"||e==="knowledge"?e:void 0}function ls(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 ds(e){switch(e){case"tail":case"session":case"chat":case"work":return e;default:return}}function fs(e){const t=e?.trim().replace(/\.+$/u,"");return t==="observe"||t==="takeover"?t:void 0}function ms(e){const t=e?.trim().toLowerCase();return t==="pty"||t==="tmux"||t==="zellij"||t==="herdr"?t:void 0}function ps(e){const t=e?.trim().toLowerCase();return t==="shell"||t==="claude"||t==="codex"||t==="pi"?t:void 0}function gs(e){return e==="all"||e==="touched"?"all":e==="changed"?"changed":void 0}function ke(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isSafeInteger(t)&&t>0?t:void 0}function Oe(e){return e==="mission"?"control":e}function hs(e){return e.searchParams.has("no-ops")?!1:typeof window>"u"?!0:rt()}function ws(e){return e==="tail"}function Is(e){return e==="lanes"}function At(e){return ws(e)||Is(e)}const ve="machineId",_t=new Set(["inbox","conversation","agents-v2","messages","sessions","repos","harnesses","mesh","mesh-ops","activity","work","follow"]);function vs(e){return e.searchParams.get(ve)?.trim()||void 0}function Ss(e,t){return!t||!_t.has(e.view)?e:{...e,machineId:t}}function Se(e){return _t.has(e.view)}function bs(e){return"machineId"in e&&e.machineId?e.machineId:null}function De(e,t){if(!Se(e))return e;const n={...e},s=t?.trim();return s?n.machineId=s:delete n.machineId,n}function _o(e){return Se(e)?{...e,machineId:""}:e}function Ls(e,t){return Se(e)?"machineId"in e?De(e,e.machineId??null):De(e,bs(t)):e}function F(e,t){"machineId"in t&&t.machineId&&e.set(ve,t.machineId)}function v(e){const t=e.toString();return t?`?${t}`:""}function O(e,t){const n=new URLSearchParams;return F(n,t),`${e}${v(n)}`}function ys(e){return"machineId"in e&&e.machineId?`:machine:${e.machineId}`:""}function Ut(e){const t=os(e),n=t.pathname.replace(/^\/+/,"").split("/").filter(Boolean),s=vs(t),o=u=>Ss(u,s),r=xn(n,t,o);if(r)return r;const i=as(t.hash),a=rs(t.searchParams.get("tab"))??(i?"message":void 0),c=t.searchParams.get("project")?.trim()||void 0,d=t.searchParams.get("agentId")?.trim()||void 0;if(n[0]==="agent"&&n[1])return{view:"agent-info",conversationId:decodeURIComponent(n[1])};const f=t.searchParams.get("project")?.trim()||void 0,S=t.searchParams.get("harness")?.trim()||void 0,A=t.searchParams.get("node")?.trim()||void 0,g=t.searchParams.get("set")?.trim(),w=g==="live"||g==="ephemeral"||g==="archived"?g:void 0,R=t.searchParams.get("view")?.trim(),U=R==="sessions"||R==="agents"?R:void 0,_=t.searchParams.get("state")?.trim(),be=_==="needs"||_==="live"||_==="idle"?_:void 0,xt=t.searchParams.get("ephemeral")==="1",W=t.searchParams.get("session")?.trim()||void 0,y=t.searchParams.get("select")?.trim()||void 0,$={...S?{harness:S}:{},...A?{node:A}:{},...w?{set:w}:{},...U?{indexView:U}:{},...be?{stateFilter:be}:{},...xt?{showEphemeral:!0}:{}};if(n[0]==="projects"){const u=n[1]?decodeURIComponent(n[1]):void 0;if(!u)return o({view:"agents-v2",...y?{selectedAgentId:y}:{},...$});if(n[2]==="agents"){const l=n[3]?decodeURIComponent(n[3]):void 0;if(l){if(n[4]==="c"&&n[5])return o({view:"agents-v2",projectSlug:u,agentId:l,conversationId:decodeURIComponent(n[5]),tab:a??"message",...$});const m=n[4]==="sessions"&&n[5]?decodeURIComponent(n[5]):W;return o({view:"agents-v2",projectSlug:u,agentId:l,...m?{sessionId:m}:{},...a?{tab:a}:{},...$})}return o({view:"agents-v2",projectSlug:u,indexView:"agents",...y?{selectedAgentId:y}:{},...$})}return n[2]==="sessions"?o({view:"agents-v2",projectSlug:u,indexView:"sessions",...n[3]?{sessionId:decodeURIComponent(n[3])}:{},...y?{selectedAgentId:y}:{},...$}):o({view:"agents-v2",projectSlug:u,...y?{selectedAgentId:y}:{},...$})}if(n[0]==="agents-v2"&&n[1]==="sessions"&&n[2])return o({view:"agents-v2",sessionId:decodeURIComponent(n[2]),...y?{selectedAgentId:y}:{},...f?{projectSlug:f}:{},...$});if(n[0]==="agents-v2"&&n[1]){const u=decodeURIComponent(n[1]);return o({view:"agents-v2",agentId:u,...a?{tab:a}:{},...W?{sessionId:W}:{},...f?{projectSlug:f}:{},...$})}if(n[0]==="agents-v2")return o({view:"agents-v2",...y?{selectedAgentId:y}:{},...f?{projectSlug:f}:{},...$});if(n[0]==="agents"&&n[1]){const u=decodeURIComponent(n[1]),l=n[2]==="sessions"&&n[3]?decodeURIComponent(n[3]):W;return n[2]==="c"&&n[3]?o({view:"agents-v2",agentId:u,conversationId:decodeURIComponent(n[3]),tab:a??"message",...$}):o({view:"agents-v2",agentId:u,...l?{sessionId:l}:{},...a?{tab:a}:{},...$})}if(n[0]==="agents")return o({view:"agents-v2",...y?{selectedAgentId:y}:{},...f?{projectSlug:f}:{},...$});if(n[0]==="agents.deprecated"&&n[1]&&n[2]==="sessions"&&n[3])return o({view:"sessions",agentId:decodeURIComponent(n[1]),sessionId:decodeURIComponent(n[3])});if(n[0]==="agents.deprecated"&&n[1]&&n[2]==="c"&&n[3])return o({view:"agents-v2",agentId:decodeURIComponent(n[1]),conversationId:decodeURIComponent(n[3]),tab:a??"message"});if(n[0]==="agents.deprecated"&&n[1]){const u=decodeURIComponent(n[1]);return o({view:"agents-v2",agentId:u,...a?{tab:a}:{},...!a&&c?{projectSlug:c}:{}})}if(n[0]==="agents.deprecated")return o({view:"agents-v2",...c?{projectSlug:c}:{}});if(n[0]==="fleet")return o({view:"inbox"});if(n[0]==="c"&&n[1])return o({view:"conversation",conversationId:decodeURIComponent(n[1])});if(n[0]==="flights"&&n[1]&&n[2]==="observe"){const u=t.searchParams.get("session")?.trim()||void 0,l=t.searchParams.get("compare")?.trim()||void 0;return o({view:"sessions",flightId:decodeURIComponent(n[1]),...u?{sessionId:u}:{},...l?{compareSessionId:l}:{}})}if(n[0]==="sessions"&&n[1])return o({view:"sessions",sessionId:decodeURIComponent(n[1]),...d?{agentId:d}:{}});if(n[0]==="conversations")return o({view:"messages"});if(n[0]==="messages"){if(n[1]==="agent"&&n[2]){const l=t.searchParams.get("thread")?.trim()||void 0;return o({view:"messages",agentId:decodeURIComponent(n[2]),...l?{threadId:l}:{}})}const u={view:"messages",...n[1]?{conversationId:decodeURIComponent(n[1])}:{}};return o(u)}if(n[0]==="sessions")return o({view:"sessions",...d?{agentId:d}:{}});if(n[0]==="repos"){const u=t.searchParams.get("root")?.trim()||void 0;return o({view:"repos",...u?{root:u}:{}})}if(n[0]==="providers"||n[0]==="harnesses")return o({view:"harnesses"});if(n[0]==="repo-diff"){const u=t.searchParams.get("path")?.trim();if(u){const l=t.searchParams.getAll("layer").filter(I=>I==="unstaged"||I==="staged"||I==="branch"),m=t.searchParams.getAll("file").map(I=>I.trim()).filter(Boolean),p=t.searchParams.get("sessionId")?.trim()||void 0,b=t.searchParams.get("agentId")?.trim()||void 0,E=gs(t.searchParams.get("include"));return{view:"repo-diff",path:u,...l.length>0?{layers:l}:{},...m.length>0?{files:m}:{},...p?{sessionId:p}:{},...b?{agentId:b}:{},...E?{include:E}:{}}}}if(n[0]==="search"){const u=us(n[1]),l=t.searchParams.get("hit")?.trim()||void 0,m=ts(t.searchParams);return{view:"search",...u&&u!=="knowledge"?{mode:u}:{},...l?{hitId:l}:{},...ss(m)?{filters:m}:{}}}if(n[0]==="channels"&&n[1])return o({view:"messages",conversationId:decodeURIComponent(n[1])});if(n[0]==="channels")return o({view:"messages"});if(n[0]==="mesh")return o({view:"mesh"});if(n[0]==="mesh-ops")return o({view:"mesh-ops",...n[1]?{itemId:decodeURIComponent(n[1])}:{}});if(n[0]==="dispatch"||n[0]==="broker"){const u=t.searchParams.get("attempt")?.trim()||void 0,l=cs(t.searchParams.get("filter"));return{view:"broker",...u?{attemptId:u}:{},...l&&l!=="all"?{filter:l}:{}}}if(n[0]==="code"){const u=t.searchParams.get("wt")?.trim()||void 0,l=t.searchParams.get("fromConversation")?.trim()||void 0,m=ke(t.searchParams.get("line")),p=ke(t.searchParams.get("endLine")),b=m&&p&&p>=m?p:void 0;if(n[1]){const C=decodeURIComponent(n[1]),P=n.length>2?n.slice(2).map(decodeURIComponent).join("/"):void 0;return{view:"code",project:C,...P?{path:P}:{},...u?{wt:u}:{},...m?{line:m}:{},...b?{endLine:b}:{},...l?{returnConversationId:l}:{}}}const E=t.searchParams.get("root")?.trim()||void 0,I=t.searchParams.get("file")?.trim()||void 0;return{view:"code",...E?{root:E}:{},...I?{file:I}:{},...u?{wt:u}:{},...m?{line:m}:{},...b?{endLine:b}:{},...l?{returnConversationId:l}:{}}}if(n[0]==="briefings"&&n[1])return{view:"briefings",briefingId:decodeURIComponent(n[1])};if(n[0]==="briefings")return{view:"briefings"};if(n[0]==="activity")return o({view:"activity"});if(n[0]==="voice")return{view:"voice"};if(n[0]==="work"&&n[1])return o({view:"work",workId:decodeURIComponent(n[1])});if(n[0]==="follow"){const u=ds(t.searchParams.get("view")),l={view:"follow",...u?{preferredView:u}:{}},m=n[1],p=n[2]?decodeURIComponent(n[2]):"";m==="flight"&&p&&(l.flightId=p),m==="invocation"&&p&&(l.invocationId=p),m==="conversation"&&p&&(l.conversationId=p),m==="work"&&p&&(l.workId=p),m==="session"&&p&&(l.sessionId=p),m==="agent"&&p&&(l.targetAgentId=p);const b=t.searchParams.get("flightId"),E=t.searchParams.get("invocationId"),I=t.searchParams.get("conversationId"),C=t.searchParams.get("workId"),P=t.searchParams.get("sessionId"),Le=t.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(n[0]==="settings"){if(n[1]==="agents")return{view:"settings",section:"agents",...n[2]?{agentId:decodeURIComponent(n[2])}:{}};const u=ls(n[1]);return{view:"settings",...u?{section:u}:{}}}if(n[0]==="terminal"){const u=fs(t.searchParams.get("mode")),l=t.searchParams.get("session")?.trim()||void 0,m=Ht(t.searchParams.get("surface"))??void 0;if(n[1]==="new"){const b=ms(t.searchParams.get("backend"))??"pty",E=ps(t.searchParams.get("agent"))??"shell",I=t.searchParams.get("name")?.trim()||void 0,C=t.searchParams.get("tab")?.trim()||void 0,P=t.searchParams.get("socketDir")?.trim()||void 0;return{view:"terminal",terminalBackend:b,terminalAgent:E,...I?{terminalSessionName:I}:{},...C?{terminalTabId:C}:{},...P?{zellijSocketDir:P}:{}}}const p=n[1]==="s"&&n[2]?Be(decodeURIComponent(n.slice(2).join("/")))?decodeURIComponent(n.slice(2).join("/")):null:Vt(n[1]?decodeURIComponent(n[1]):void 0,n[2]?decodeURIComponent(n.slice(2).join("/")):void 0);return p?{view:"terminal",terminalSurfaceKey:p,...l?{terminalSessionId:l}:{},...u?{mode:u}:{}}:{view:"terminal",...n[1]?{agentId:decodeURIComponent(n[1])}:{},...u?{mode:u}:{},...!n[1]&&l?{terminalSessionId:l}:{},...!n[1]&&m?{terminalSurfaceKey:m}:{}}}if(n[0]==="ops"){const u=is(n[1])??"mission";if(!At(u)&&!hs(t))return o({view:"inbox"});const l=u==="tail"?t.searchParams.get("q")?.trim():"",m=u==="advisor"?t.searchParams.get("plan")?.trim():"",p=t.searchParams.get("flightId")?.trim(),b=t.searchParams.get("invocationId")?.trim(),E=t.searchParams.get("conversationId")?.trim(),I=t.searchParams.get("workId")?.trim(),C=t.searchParams.get("sessionId")?.trim(),P=t.searchParams.get("targetAgentId")?.trim()??t.searchParams.get("agentId")?.trim();return{view:"ops",mode:u,...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 Ft(e,t){const n=e.view==="sessions"&&e.flightId?null:St(e,t);if(n)return n;switch(e.view){case"inbox":return O("/",e);case"conversation":{const s=new URLSearchParams;return F(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),F(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 e.agentId&&e.threadId&&s.set("thread",e.threadId),F(s,e),`${e.agentId?`/messages/agent/${encodeURIComponent(e.agentId)}`: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),F(s,e),`/flights/${encodeURIComponent(e.flightId)}/observe${v(s)}`):(F(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),F(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==="advisor"){const s=new URLSearchParams;return e.mode==="tail"&&e.tailQuery&&s.set("q",e.tailQuery),e.mode==="advisor"&&e.planDocumentId&&s.set("plan",e.planDocumentId),e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),`/ops/${Oe(e.mode)}${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=Yt(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 t=ys(e);switch(e.view){case"conversation":return`conv:${e.conversationId}${t}`;case"agent-info":return`agent-info:${e.conversationId}`;case"settings":return`settings:${e.section??"pairing"}:${e.agentId??""}`;case"agents-v2":return["agents-v2",e.projectSlug??"",e.harness??"",e.node??"",e.set??"",e.indexView??"agents",e.stateFilter??"",e.showEphemeral?"eph":"",e.agentId??"",e.sessionId??"",t].join(":");case"sessions":return e.flightId?`flight-observe:${e.flightId}:${e.sessionId??""}:${e.compareSessionId??""}${t}`:e.sessionId?`session:${e.agentId??""}:${e.sessionId}${t}`:`sessions${t}`;case"messages":return["messages",e.conversationId??"",e.agentId??"",e.threadId??"",t].join(":");case"work":return`work:${e.workId}${t}`;case"ops":return`ops:${e.mode??"advisor"}:${e.tailQuery??""}:${e.planDocumentId??""}:${e.flightId??""}:${e.invocationId??""}:${e.workId??""}:${e.conversationId??""}:${e.sessionId??""}:${e.targetAgentId??""}`;case"search":return`search:${e.mode??"knowledge"}:${e.hitId??""}`;case"broker":return`broker:${e.attemptId??""}`;case"follow":return`follow:${e.flightId??e.invocationId??e.conversationId??e.workId??e.sessionId??e.targetAgentId??""}:${e.preferredView??""}${t}`;case"terminal":return`terminal:${e.agentId??""}:${e.terminalSessionId??""}:${e.terminalSurfaceKey??""}:${e.terminalBackend??""}:${e.terminalAgent??""}:${e.terminalSessionName??""}:${e.terminalTabId??""}:${e.mode??"detail"}`;case"repo-diff":return`repo-diff:${e.path}`;default:return`${e.view}${t}`}}function G(e,t){return ue(Ut(`${e}${t}`))}function Tt(e){return e?`#${e}`:""}function Es(e){return e.startsWith("/embed/")||e==="/ops/lanes/embed"}function xe(){if(typeof window>"u"){const e=new URL(Ct);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 $s(e,t){return e.pathname===t.pathname&&e.searchStr===t.searchStr&&e.hash===t.hash&&Object.is(e.state,t.state)}function Rs(e){let t=e.read();const n=new Set;let s=null;const o=()=>{const r=e.read();if(!$s(t,r)){t=r;for(const i of n)i()}};return{getSnapshot:()=>t,subscribe(r){return s||(s=e.observe(o)),n.add(r),()=>{n.delete(r)}},navigateTo(r,i={}){const a=t.pathname,c=i.state===void 0?t.state:i.state;i.replace?e.replace(r,c):e.push(r,c),o(),t.pathname!==a&&Gt(a,t.pathname)}}}function Ps(){return typeof window>"u"?{read:xe,push:()=>{},replace:()=>{},observe:()=>()=>{}}:{read:xe,push:(e,t)=>window.history.pushState(t,"",e),replace:(e,t)=>window.history.replaceState(t,"",e),observe:e=>(window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)})}}const x=Rs(Ps());function Cs(){return L.useSyncExternalStore(x.subscribe,x.getSnapshot,x.getSnapshot)}function ie(e,t={}){x.navigateTo(e,t)}function kt(){return typeof window>"u"?null:window.navigation??null}function Ot(){if(typeof window>"u")return!1;const e=kt();return e?e.canGoBack:window.history.length>1}function As(){if(!Ot())return;const e=kt();if(e){e.back();return}window.history.back()}function Uo(e){if(!e||typeof e!="object")return null;const t=e.returnTo;return!t||typeof t!="object"||typeof t.view!="string"?null:t}function Fo(e){return!e||typeof e!="object"?!1:e.returnUseHistory===!0}function je(e){if(!e||typeof e!="object")return e;const{returnTo:t,returnUseHistory:n,settingsEntry:s,...o}=e;return o}function _s(e,t){if(t.returnTo!==void 0){const n=t.state!==void 0?t.state:je(e),s=n&&typeof n=="object"?{...n}:{};return s.returnTo=t.returnTo,s.returnUseHistory=t.replace!==!0,s}return t.state!==void 0?t.state:t.replace?e:je(e)}function Dt(e){return e?e.replace(/^#/,""):""}function Us(e,t,n={}){const s=G(e.pathname,e.searchStr),o=Ls(t,s),r=n.preserveSearch===!1?"":e.searchStr,i=vt(Ft(o,e.pathname),r),a=Dt(n.hash);return{route:o,href:`${i}${a?`#${a}`:""}`}}function Fs(e,t){const n=new URLSearchParams(e.searchStr);for(const[r,i]of Object.entries(t.searchPatch??{}))i===null?n.delete(r):n.set(r,i);const s=n.toString(),o=t.hash===void 0?e.hash:Dt(t.hash);return`${e.pathname}${s?`?${s}`:""}${o?`#${o}`:""}`}function To(e){const t=x.getSnapshot(),n=Fs(t,e),s=`${t.pathname}${t.searchStr}${Tt(t.hash)}`;n!==s&&ie(n,{replace:e.replace??!0,state:e.state})}function Ts(e,t,n){if(Es(e))return null;const s=`${e}${t}`,o=Ut(s),r=ue(o),i=vt(Ft(r,e),t);return!(N(o)!==N(r)||r.view==="agents-v2"||s!==i)||s===i?null:`${i}${Tt(n)}`}function ko(){const{pathname:e,searchStr:t,hash:n}=Cs(),s=`${e}${t}`,o=L.useMemo(()=>G(e,t),[e,t]),r=L.useRef({}),i=L.useRef(s);L.useEffect(()=>{const f=Ts(e,t,n);f&&ie(f,{replace:!0})},[e,t,n]),L.useEffect(()=>{if(i.current===s)return;const f=G(e,t);requestAnimationFrame(()=>{window.scrollTo(0,r.current[N(f)]??0)}),i.current=s},[s,e,t]);const a=L.useCallback((f,S={})=>{const A=ue(f.view==="ops"&&!rt()&&!At(f.mode)?{view:"inbox"}:f),g=G(e,t),{route:w,href:R}=Us({pathname:e,searchStr:t},A,S);r.current[N(g)]=window.scrollY;const U=x.getSnapshot().state,_=_s(U,S);ie(R,{replace:S.replace,state:_}),requestAnimationFrame(()=>{window.scrollTo(0,r.current[N(w)]??0)})},[e,t]),c=L.useCallback(()=>As(),[]),d=Ot();return{route:o,navigate:a,navigateBack:c,canNavigateBack:d}}export{qs as $,Po as A,$o as B,Eo as C,Pt as D,go as E,js as F,Gn as G,ge as H,T as I,po as J,fo as K,wo as L,ho as M,Co as N,yo as O,Ao as P,To as Q,io as R,fn as S,It as T,wt as U,uo as V,Qs as W,Vs as X,Xs as Y,An as Z,_n as _,Ft as a,Pn as a0,eo as a1,Un as a2,no as a3,so as a4,to as a5,oo as a6,Zs as a7,Js as a8,Ys as a9,So as aA,$t as aB,bo as aC,re as aD,vo as aE,Io as aF,Et as aG,it as aa,at as ab,Se as ac,ro as ad,ao as ae,V as af,ne as ag,Bs as ah,oe as ai,Q as aj,Dn as ak,Bn as al,xn as am,vt as an,zn as ao,un as ap,co as aq,St as ar,Ye as as,lo as at,ko as au,Ve as av,Zt as aw,bt as ax,z as ay,mo as az,bs as b,_o as c,et as d,Ws as e,le as f,zs as g,Ms as h,Gs as i,Hs as j,Cs as k,Uo as l,Fo as m,dn as n,mn as o,pn as p,Ks as q,Ut as r,De as s,ns as t,Ns as u,Ro as v,wn as w,ts as x,Lo as y,ss as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as a,B as l,D as n,E as r,r as m}from"./index-
|
|
1
|
+
import{A as a,B as l,D as n,E as r,r as m}from"./index-DvLtl7rV.js";import{R as p,T as i,U as c,k as E,V as S}from"./router-B9vQkNJL.js";const A={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}],_=o.map(e=>({key:e.key,label:e.label,route:p(e.segment)}));function b(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{_ as S,u as a,A as b,d as c,T as d,L as i,b as s,P as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as x}from"./index-CZ-05hKz.js";import{b as k,p as A,V as q,D as N}from"./fx-z37u1o2z.js";function he(t){return t?t.hint?`${t.message} ${t.hint}`:t.message:"Scout voice is unavailable."}async function fe(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(y(n,e.status))}return await e.json()}async function j(t={}){const e=await de(),n=e.settings,i=e.devices,r=i.length>0||(n.permissions?.length??0)>0,o=n.permissions?.find(w=>w.kind==="microphone")??null,a=n.permissions?.find(w=>w.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 H(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 G=6e4,J=3e3,z=2e4,B=8e3,W=45e3;let M=null,E=null,l=null,_=!1;const R=new Set;function X(){return typeof window>"u"?!1:typeof fetch=="function"}function K(){return M||(M=new Q),M}function me(t){return R.add(t),l&&t(l),()=>{R.delete(t)}}function we(){if(_||!X())return;_=!0;const t=K();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?z:B;return e-t.probedAt<n}class Q{state="unknown";unavailableReason=null;captureMode=null;hostReachable=!1;microphoneGranted=null;microphoneCanRequest=null;inputDeviceName=null;get connectionState(){return this.state}get lastUnavailableReason(){return this.unavailableReason}get preferredCaptureMode(){return this.captureMode}get isVoiceHostReachable(){return this.hostReachable}get activeInputDeviceName(){return this.inputDeviceName}get isMicrophoneGranted(){return this.microphoneGranted}get canRequestMicrophone(){return this.hostReachable&&this.microphoneGranted===!1&&this.microphoneCanRequest===!0}get isMicrophoneHardDenied(){return this.hostReachable&&this.microphoneGranted===!1&&this.microphoneCanRequest===!1}get isMicrophoneDenied(){return this.isMicrophoneHardDenied}async probeIfStale(){const e=Date.now();return l&&O(l,e)?(this.applyProbeSnapshot(l),l.ok):l&&l.ok&&e-l.probedAt<W?(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??J,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=typeof o.inputDevice?.name=="string"&&o.inputDevice.name.trim()?o.inputDevice.name.trim():null,w=o.capture==="browser"?"browser":"native",S=r.ok&&o.ok===!0,v=S?null:o.detail??o.error??(a?"Scout voice is not ready.":"Scout voice service is unavailable."),f={ok:S,reason:v,captureMode:S?w:null,hostReachable:a,microphoneGranted:u,microphoneCanRequest:h,inputDeviceName:d,probedAt:Date.now()};return l=f,this.applyProbeSnapshot(f),I(f),S}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,inputDeviceName: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,this.inputDeviceName=e.inputDeviceName,e.ok){this.unavailableReason=null,this.captureMode=e.captureMode,this.state="connected";return}this.unavailableReason=e.reason,this.captureMode=null,this.state="unavailable"}async launch(e={}){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 Y(e,n):await Z(e)}}async function Y(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(y(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 w=()=>{d&&window.clearTimeout(d),d=window.setTimeout(()=>{v(new Error("Scout voice transcription timed out. Try again or check voice settings."))},G)},S=()=>{d&&(window.clearTimeout(d),d=null)},v=(s,p="error")=>{o||(o=!0,S(),m.close(),t.onState?.(p),u(s))},f=s=>{o||(o=!0,S(),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 g={};try{g=JSON.parse(p.data)}catch{return}if(s==="session.partial"){const b=typeof g.text=="string"?g.text:"";t.onPartial?.(b);return}if(s==="session.state"){const b=ee(g.state);b&&(t.onState?.(b),b==="processing"&&w());return}if(s==="session.final"){f({sessionId:r,text:typeof g.text=="string"?g.text.trim():"",durationMs:Number(g.durationMs??0)});return}if(s==="session.cancelled"){v(T(),"cancelled");return}if(s==="session.error"){const b=typeof g.message=="string"?g.message:"Scout voice session failed.",L=typeof g.code=="string"?g.code:null;v(new Error(H(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||v(new Error("Scout voice event stream disconnected."))},{get sessionId(){return r},result:h,stop:async()=>{t.onState?.("processing"),w();const s=await fetch(`/api/voice/session/${encodeURIComponent(r)}/stop`,{method:"POST"});if(!s.ok){const p=await s.text().catch(()=>"");throw new Error(y(p,s.status))}},cancel:async()=>{o=!0,S(),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(y(p,s.status))}t.onState?.("cancelled"),u(T())}}}async function Z(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=ue(),i=[];let r=null,o=null,a=null,u=!1,h=!1,d,w;const S=new Promise((c,s)=>{d=c,w=s}),v=()=>{a?.stop(),a=null;for(const c of r?.getTracks()??[])c.stop();r=null},f=(c,s="error")=>{h||(h=!0,v(),t.onState?.(s),w(c))},m=async()=>{if(h)return;if(v(),u){f(T(),"cancelled");return}t.onState?.("processing");const c=o?.mimeType||V()||"application/octet-stream",s=new Blob(i,{type:c});if(s.size===0){f(new Error("No voice audio was captured."));return}try{const p=await re(s,{sessionId:n});if(h)return;h=!0,t.onFinal?.(p),t.onState?.("done"),d(p)}catch(p){f(p instanceof Error?p:new Error(String(p)))}};try{t.onState?.("starting"),r=await navigator.mediaDevices.getUserMedia({audio:!0}),t.onLevel&&(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",()=>{f(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 f(s),S.catch(()=>{}),s}return{get sessionId(){return n},result:S,stop:async()=>{!o||o.state==="inactive"||o.stop()},cancel:async()=>{if(u=!0,o&&o.state!=="inactive"){o.stop();return}f(T(),"cancelled")}}}function ee(t){return t==="starting"||t==="recording"||t==="processing"||t==="done"||t==="cancelled"||t==="error"?t:null}function y(t,e){try{return JSON.parse(t).error??`Scout voice returned HTTP ${e}`}catch{return t||`Scout voice returned HTTP ${e}`}}function Se(t){return t instanceof Error&&t.name==="AbortError"}async function D(t,e={}){const n={text:t,speed:ce(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 ge(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 te(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 ne(t,e={}){const n=await D(t,e);return await te(n,{signal:e.signal})}function ve(t,e={}){const n=new AbortController;return{promise:ne(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function oe(t,e={}){const n=await D(t,e);if(e.signal?.aborted)throw P();const i=await k(n.audioBase64,n.contentType),r=ae(e.presetId,e.params);return await A(i,{params:r,signal:e.signal}).promise,n}function ye(t,e={}){const n=new AbortController;return{promise:oe(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function re(t,e){const n=new FormData,i=ie(t.type);n.append("audio",t,`audio.${se(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 ie(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 se(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 ae(t,e){const n=t?q.find(i=>i.id===t)?.params:void 0;return{...N,...n??{},...e??{}}}function ce(t){if(!(t===void 0||!Number.isFinite(t)))return Math.min(2,Math.max(.5,Number(t.toFixed(2))))}function ue(){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 de(){const t=await fetch("/api/voice/settings");if(!t.ok){const e=await t.text().catch(()=>"");throw new Error(y(e,t.status))}return await t.json()}async function be(t="microphone"){const e=await fetch("/api/voice/permissions/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:t})});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(y(n,e.status))}}async function 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(y(n,e.status))}}async function Ee(t=12){const e=await fetch(`/api/voice/history?limit=${t}`);if(!e.ok){const i=await e.text().catch(()=>"");throw new Error(y(i,e.status))}return(await e.json()).sessions??[]}async function Te(t){const e=await fetch("/api/voice/settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(y(n,e.status))}return await e.json()}export{fe as a,ve as b,ye as c,ge as d,we as e,he as f,K as g,te as h,Se as i,de as j,Ee as k,Te as l,be as o,D as p,C as r,me as s};
|
|
1
|
+
import{_ as x}from"./index-DvLtl7rV.js";import{b as k,p as A,V as q,D as N}from"./fx-z37u1o2z.js";function he(t){return t?t.hint?`${t.message} ${t.hint}`:t.message:"Scout voice is unavailable."}async function fe(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(y(n,e.status))}return await e.json()}async function j(t={}){const e=await de(),n=e.settings,i=e.devices,r=i.length>0||(n.permissions?.length??0)>0,o=n.permissions?.find(w=>w.kind==="microphone")??null,a=n.permissions?.find(w=>w.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 H(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 G=6e4,J=3e3,z=2e4,B=8e3,W=45e3;let M=null,E=null,l=null,_=!1;const R=new Set;function X(){return typeof window>"u"?!1:typeof fetch=="function"}function K(){return M||(M=new Q),M}function me(t){return R.add(t),l&&t(l),()=>{R.delete(t)}}function we(){if(_||!X())return;_=!0;const t=K();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?z:B;return e-t.probedAt<n}class Q{state="unknown";unavailableReason=null;captureMode=null;hostReachable=!1;microphoneGranted=null;microphoneCanRequest=null;inputDeviceName=null;get connectionState(){return this.state}get lastUnavailableReason(){return this.unavailableReason}get preferredCaptureMode(){return this.captureMode}get isVoiceHostReachable(){return this.hostReachable}get activeInputDeviceName(){return this.inputDeviceName}get isMicrophoneGranted(){return this.microphoneGranted}get canRequestMicrophone(){return this.hostReachable&&this.microphoneGranted===!1&&this.microphoneCanRequest===!0}get isMicrophoneHardDenied(){return this.hostReachable&&this.microphoneGranted===!1&&this.microphoneCanRequest===!1}get isMicrophoneDenied(){return this.isMicrophoneHardDenied}async probeIfStale(){const e=Date.now();return l&&O(l,e)?(this.applyProbeSnapshot(l),l.ok):l&&l.ok&&e-l.probedAt<W?(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??J,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=typeof o.inputDevice?.name=="string"&&o.inputDevice.name.trim()?o.inputDevice.name.trim():null,w=o.capture==="browser"?"browser":"native",S=r.ok&&o.ok===!0,v=S?null:o.detail??o.error??(a?"Scout voice is not ready.":"Scout voice service is unavailable."),f={ok:S,reason:v,captureMode:S?w:null,hostReachable:a,microphoneGranted:u,microphoneCanRequest:h,inputDeviceName:d,probedAt:Date.now()};return l=f,this.applyProbeSnapshot(f),I(f),S}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,inputDeviceName: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,this.inputDeviceName=e.inputDeviceName,e.ok){this.unavailableReason=null,this.captureMode=e.captureMode,this.state="connected";return}this.unavailableReason=e.reason,this.captureMode=null,this.state="unavailable"}async launch(e={}){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 Y(e,n):await Z(e)}}async function Y(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(y(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 w=()=>{d&&window.clearTimeout(d),d=window.setTimeout(()=>{v(new Error("Scout voice transcription timed out. Try again or check voice settings."))},G)},S=()=>{d&&(window.clearTimeout(d),d=null)},v=(s,p="error")=>{o||(o=!0,S(),m.close(),t.onState?.(p),u(s))},f=s=>{o||(o=!0,S(),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 g={};try{g=JSON.parse(p.data)}catch{return}if(s==="session.partial"){const b=typeof g.text=="string"?g.text:"";t.onPartial?.(b);return}if(s==="session.state"){const b=ee(g.state);b&&(t.onState?.(b),b==="processing"&&w());return}if(s==="session.final"){f({sessionId:r,text:typeof g.text=="string"?g.text.trim():"",durationMs:Number(g.durationMs??0)});return}if(s==="session.cancelled"){v(T(),"cancelled");return}if(s==="session.error"){const b=typeof g.message=="string"?g.message:"Scout voice session failed.",L=typeof g.code=="string"?g.code:null;v(new Error(H(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||v(new Error("Scout voice event stream disconnected."))},{get sessionId(){return r},result:h,stop:async()=>{t.onState?.("processing"),w();const s=await fetch(`/api/voice/session/${encodeURIComponent(r)}/stop`,{method:"POST"});if(!s.ok){const p=await s.text().catch(()=>"");throw new Error(y(p,s.status))}},cancel:async()=>{o=!0,S(),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(y(p,s.status))}t.onState?.("cancelled"),u(T())}}}async function Z(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=ue(),i=[];let r=null,o=null,a=null,u=!1,h=!1,d,w;const S=new Promise((c,s)=>{d=c,w=s}),v=()=>{a?.stop(),a=null;for(const c of r?.getTracks()??[])c.stop();r=null},f=(c,s="error")=>{h||(h=!0,v(),t.onState?.(s),w(c))},m=async()=>{if(h)return;if(v(),u){f(T(),"cancelled");return}t.onState?.("processing");const c=o?.mimeType||V()||"application/octet-stream",s=new Blob(i,{type:c});if(s.size===0){f(new Error("No voice audio was captured."));return}try{const p=await re(s,{sessionId:n});if(h)return;h=!0,t.onFinal?.(p),t.onState?.("done"),d(p)}catch(p){f(p instanceof Error?p:new Error(String(p)))}};try{t.onState?.("starting"),r=await navigator.mediaDevices.getUserMedia({audio:!0}),t.onLevel&&(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",()=>{f(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 f(s),S.catch(()=>{}),s}return{get sessionId(){return n},result:S,stop:async()=>{!o||o.state==="inactive"||o.stop()},cancel:async()=>{if(u=!0,o&&o.state!=="inactive"){o.stop();return}f(T(),"cancelled")}}}function ee(t){return t==="starting"||t==="recording"||t==="processing"||t==="done"||t==="cancelled"||t==="error"?t:null}function y(t,e){try{return JSON.parse(t).error??`Scout voice returned HTTP ${e}`}catch{return t||`Scout voice returned HTTP ${e}`}}function Se(t){return t instanceof Error&&t.name==="AbortError"}async function D(t,e={}){const n={text:t,speed:ce(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 ge(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 te(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 ne(t,e={}){const n=await D(t,e);return await te(n,{signal:e.signal})}function ve(t,e={}){const n=new AbortController;return{promise:ne(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function oe(t,e={}){const n=await D(t,e);if(e.signal?.aborted)throw P();const i=await k(n.audioBase64,n.contentType),r=ae(e.presetId,e.params);return await A(i,{params:r,signal:e.signal}).promise,n}function ye(t,e={}){const n=new AbortController;return{promise:oe(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function re(t,e){const n=new FormData,i=ie(t.type);n.append("audio",t,`audio.${se(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 ie(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 se(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 ae(t,e){const n=t?q.find(i=>i.id===t)?.params:void 0;return{...N,...n??{},...e??{}}}function ce(t){if(!(t===void 0||!Number.isFinite(t)))return Math.min(2,Math.max(.5,Number(t.toFixed(2))))}function ue(){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 de(){const t=await fetch("/api/voice/settings");if(!t.ok){const e=await t.text().catch(()=>"");throw new Error(y(e,t.status))}return await t.json()}async function be(t="microphone"){const e=await fetch("/api/voice/permissions/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:t})});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(y(n,e.status))}}async function 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(y(n,e.status))}}async function Ee(t=12){const e=await fetch(`/api/voice/history?limit=${t}`);if(!e.ok){const i=await e.text().catch(()=>"");throw new Error(y(i,e.status))}return(await e.json()).sessions??[]}async function Te(t){const e=await fetch("/api/voice/settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(y(n,e.status))}return await e.json()}export{fe as a,ve as b,ye as c,ge as d,we as e,he as f,K as g,te as h,Se as i,de as j,Ee as k,Te as l,be as o,D as p,C as r,me as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as i,r as p}from"./index-
|
|
1
|
+
import{j as i,r as p}from"./index-DvLtl7rV.js";import{u as m}from"./Provider-CtXJeLrP.js";import{a as x}from"./api-Co9aQ2Jw.js";import{E as g}from"./external-link-Dp_a2vRZ.js";const h=new RegExp("(?:^|(?<=[\\s(`'\"<>]))(?:~\\/|\\/(?:Users|home|opt|var|etc|tmp|private)\\/)[^\\s)`'\"<>]+\\.[A-Za-z0-9]{1,8}\\b","g");function b(n){const e=n.replace(/\r\n?/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),t=[];let s=0;for(;s<e.length;){const r=e[s];if(r.trim()===""){s+=1;continue}if(r.startsWith("```")){const l=[];for(s+=1;s<e.length&&!e[s].startsWith("```");)l.push(e[s]),s+=1;s<e.length&&(s+=1),t.push({kind:"code",body:l.join(`
|
|
4
4
|
`)});continue}const c=r.match(/^(#{1,3})\s+(.*\S)\s*$/);if(c){const l=c[1].length;t.push({kind:"heading",level:l,tokens:d(c[2])}),s+=1;continue}if(u(r)){const l=[];for(;s<e.length&&u(e[s]);)l.push(d(k(e[s]))),s+=1;t.push({kind:"list",items:l});continue}const o=[];for(;s<e.length&&e[s].trim()!==""&&!e[s].startsWith("```")&&!u(e[s])&&!/^#{1,3}\s+\S/.test(e[s]);)o.push(d(e[s])),s+=1;t.push({kind:"paragraph",lines:o})}return t}const f=/^\s*[-*]\s+/;function u(n){return f.test(n)}function k(n){return n.replace(f,"")}function d(n){const e=[];let t=0,s="";const r=()=>{s&&(e.push({kind:"text",body:s}),s="")};for(;t<n.length;){const c=n[t];if(c==="`"){const o=n.indexOf("`",t+1);if(o!==-1&&o>t+1){r(),e.push({kind:"code",body:n.slice(t+1,o)}),t=o+1;continue}}else if(c==="*"&&n[t+1]==="*"){const o=n.indexOf("**",t+2);if(o!==-1&&o>t+2){r(),e.push({kind:"bold",body:n.slice(t+2,o)}),t=o+2;continue}}else if(c==="*"||c==="_"){const o=y(n,t+1,c);if(o!==-1){r(),e.push({kind:"italic",body:n.slice(t+1,o)}),t=o+1;continue}}s+=c,t+=1}return r(),j(e)}function j(n){const e=[];for(const t of n){if(t.kind!=="text"){e.push(t);continue}const s=v(t.body);s.length===1&&s[0].kind==="text"?e.push(t):e.push(...s)}return e}function v(n){if(!n)return[];const e=[];let t=0;h.lastIndex=0;let s;for(;(s=h.exec(n))!==null;){const r=s.index,c=r+s[0].length;r>t&&e.push({kind:"text",body:n.slice(t,r)}),e.push({kind:"file-path",body:s[0]}),t=c}return t===0?[{kind:"text",body:n}]:(t<n.length&&e.push({kind:"text",body:n.slice(t)}),e)}function y(n,e,t){if(n[e]===void 0||/\s/.test(n[e]))return-1;for(let s=e;s<n.length;s+=1){const r=n[s];if(r===t){const c=n[s-1];if(c&&!/\s/.test(c)&&n[s+1]!==t)return s}if(r===`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a}from"./createLucideIcon-
|
|
1
|
+
import{c as a}from"./createLucideIcon-DezKXSG2.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-
|
|
1
|
+
import{c}from"./createLucideIcon-DezKXSG2.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};
|
package/dist/client/assets/{secondaryNavConfig-B9IF8wXl.js → secondaryNavConfig-BoQ_zYR9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n}from"./createLucideIcon-DXpqZP7I.js";import{M as f}from"./message-square-D9YYWE0x.js";import{F as l}from"./file-text-KijGBnME.js";import{S as c}from"./search-D1tJSAWe.js";import{C as p}from"./compass-0_54-vz3.js";import{S as g}from"./settings-2fC_G9nX.js";import{T as k}from"./terminal-yN9xN-h9.js";import{G as y}from"./git-branch-BQ_x8KZL.js";import{C as O}from"./code-xml-Jtxsp5d1.js";import{S}from"./scroll-text-DO0GQzvN.js";const A=[["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"}]],C=n("folder-kanban",A);const _=[["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=n("house",_);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=n("send",E),R=[{id:"home",label:"Home",icon:v,defaultRoute:{view:"inbox"},section:"navigate"},{id:"chat",label:"Messages",icon:f,defaultRoute:{view:"messages"},section:"navigate"},{id:"projects",label:"Crew",icon:C,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:g,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"},N=new Map(R.map(e=>[e.id,e]));function j(e){const i=N.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=j(e);return e==="ops"?i?.opsControlEnabled??!0?{view:"ops",mode:"mission"}:{view:"ops",mode:"tail"}:t.defaultRoute}function T(e){return e.view==="ops"&&(e.mode===void 0||e.mode==="mission"||e.mode==="issues")}const G=[{id:"home",label:"Home",route:{view:"inbox"},active:e=>e.view==="inbox"},{id:"projects",label:"Crew & Workspaces",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:T,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:"advisor",label:"Host Advisor",route:{view:"ops",mode:"advisor"},active:e=>e.view==="ops"&&e.mode==="advisor"},{id:"agent-config",label:"Agent Configuration",route:{view:"settings",section:"agents"},active:e=>e.view==="settings"&&e.section==="agents"}],M=new Map(G.map(e=>[e.id,e]));function s(e){const i=M.get(e);if(!i)throw new Error(`Unknown nav destination: ${e}`);return i}function a(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 P=[{destinationId:"home",key:"home"},{destinationId:"projects",key:"agents",label:"Crew"},{destinationId:"sessions",key:"sessions"},{destinationId:"chat",key:"chat",label:"Messages"}];function ne(){return P.map(e=>{const i=s(e.destinationId);return{key:e.key,label:e.label??i.label,route:i.route}})}const D=[{destinationId:"search",key:"search"},{destinationId:"terminals",key:"terminals"},{destinationId:"tail",key:"tail"},{destinationId:"dispatch",key:"dispatch"}],x=[{destinationId:"mission-control",key:"control"},{destinationId:"lanes",key:"lanes"},{destinationId:"providers",key:"providers"},{destinationId:"mesh",key:"mesh"},{destinationId:"mesh-ops",key:"mesh-ops"},{destinationId:"runtime",key:"runtime"},{destinationId:"advisor",key:"advisor"}];function m(e){const i=a(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 D.map(m)}function re(){return x.map(m)}function b(e){return{items:e.map(i=>{const t=a(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 B(){return[b([{destinationId:"agent-config",id:"config",label:"Agent Configuration"}])]}function J(){return[b([{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:"advisor",id:"advisor"}])]}const V=[{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 crew",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 V.map(e=>{const i=s(e.destinationId);return{key:e.key,label:e.label,route:e.route??i.route,destinationId:e.destinationId}})}const U=[{destinationId:"sessions",id:"sessions",icon:l},{destinationId:"terminals",id:"terminals",icon:k},{destinationId:"repos",id:"repos",icon:y},{destinationId:"code",id:"code",icon:O},{destinationId:"search",id:"search",icon:c},{destinationId:"tail",id:"tail",icon:S},{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 U.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 F=[{id:"nav:home",label:"Go to Home",destinationId:"home",shortcut:"Cmd+1"},{id:"nav:agents",label:"Go to Crew",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 Repositories",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 H(e){const i=e?.opsEnabled??!0;return F.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 H(i).map(t=>({id:t.id,label:t.label,action:()=>e(t.route),shortcut:t.shortcut}))}const h={projects:[{destinationId:"projects",id:"projects"},{destinationId:"repos",id:"repos"},{destinationId:"code",id:"code"}],sessions:[{destinationId:"sessions",id:"sessions"},{destinationId:"terminals",id:"terminals"}]};function Y(e){const i=a(e.destinationId,{label:e.label});return{id:e.id,label:i.label,route:i.route,active:i.active,destinationId:i.id}}function L(e){return h[e].map(Y)}function ve(e){const i=d[e.view];if(i!=="projects"&&i!=="sessions")return null;const t=i;return{areaId:t,items:L(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:"advisor",id:"advisor"}]};function $(e){const i=a(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($).filter(w=>s(w.destinationId).capability!=="ops.control"||i?.opsControlEnabled!==!1);return{areaId:o,items:I}}const me=B(),be=J();export{me as A,be as O,R as P,ne as a,de as b,re as c,pe as d,le as e,se as f,ae as g,j as h,ve as i,ce as p,ue as s};
|
|
1
|
+
import{c as n}from"./createLucideIcon-DezKXSG2.js";import{M as f}from"./message-square-C7t_qtuj.js";import{F as l}from"./file-text-CqJgwxmv.js";import{S as c}from"./search-CDko0PKE.js";import{C as p}from"./compass-Dt1AMXz2.js";import{S as g}from"./settings-Dyvpkb1D.js";import{T as k}from"./terminal-9GRS_Qdc.js";import{G as y}from"./git-branch-CK5v8F2v.js";import{C as O}from"./code-xml-D7pOQM9l.js";import{S}from"./scroll-text-Dze_dXtQ.js";const A=[["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"}]],C=n("folder-kanban",A);const _=[["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=n("house",_);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=n("send",E),R=[{id:"home",label:"Home",icon:v,defaultRoute:{view:"inbox"},section:"navigate"},{id:"chat",label:"Messages",icon:f,defaultRoute:{view:"messages"},section:"navigate"},{id:"projects",label:"Crew",icon:C,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:g,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"},N=new Map(R.map(e=>[e.id,e]));function j(e){const i=N.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=j(e);return e==="ops"?i?.opsControlEnabled??!0?{view:"ops",mode:"mission"}:{view:"ops",mode:"tail"}:t.defaultRoute}function T(e){return e.view==="ops"&&(e.mode===void 0||e.mode==="mission"||e.mode==="issues")}const G=[{id:"home",label:"Home",route:{view:"inbox"},active:e=>e.view==="inbox"},{id:"projects",label:"Crew & Workspaces",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:T,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:"advisor",label:"Host Advisor",route:{view:"ops",mode:"advisor"},active:e=>e.view==="ops"&&e.mode==="advisor"},{id:"agent-config",label:"Agent Configuration",route:{view:"settings",section:"agents"},active:e=>e.view==="settings"&&e.section==="agents"}],M=new Map(G.map(e=>[e.id,e]));function s(e){const i=M.get(e);if(!i)throw new Error(`Unknown nav destination: ${e}`);return i}function a(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 P=[{destinationId:"home",key:"home"},{destinationId:"projects",key:"agents",label:"Crew"},{destinationId:"sessions",key:"sessions"},{destinationId:"chat",key:"chat",label:"Messages"}];function ne(){return P.map(e=>{const i=s(e.destinationId);return{key:e.key,label:e.label??i.label,route:i.route}})}const D=[{destinationId:"search",key:"search"},{destinationId:"terminals",key:"terminals"},{destinationId:"tail",key:"tail"},{destinationId:"dispatch",key:"dispatch"}],x=[{destinationId:"mission-control",key:"control"},{destinationId:"lanes",key:"lanes"},{destinationId:"providers",key:"providers"},{destinationId:"mesh",key:"mesh"},{destinationId:"mesh-ops",key:"mesh-ops"},{destinationId:"runtime",key:"runtime"},{destinationId:"advisor",key:"advisor"}];function m(e){const i=a(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 D.map(m)}function re(){return x.map(m)}function b(e){return{items:e.map(i=>{const t=a(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 B(){return[b([{destinationId:"agent-config",id:"config",label:"Agent Configuration"}])]}function J(){return[b([{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:"advisor",id:"advisor"}])]}const V=[{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 crew",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 V.map(e=>{const i=s(e.destinationId);return{key:e.key,label:e.label,route:e.route??i.route,destinationId:e.destinationId}})}const U=[{destinationId:"sessions",id:"sessions",icon:l},{destinationId:"terminals",id:"terminals",icon:k},{destinationId:"repos",id:"repos",icon:y},{destinationId:"code",id:"code",icon:O},{destinationId:"search",id:"search",icon:c},{destinationId:"tail",id:"tail",icon:S},{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 U.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 F=[{id:"nav:home",label:"Go to Home",destinationId:"home",shortcut:"Cmd+1"},{id:"nav:agents",label:"Go to Crew",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 Repositories",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 H(e){const i=e?.opsEnabled??!0;return F.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 H(i).map(t=>({id:t.id,label:t.label,action:()=>e(t.route),shortcut:t.shortcut}))}const h={projects:[{destinationId:"projects",id:"projects"},{destinationId:"repos",id:"repos"},{destinationId:"code",id:"code"}],sessions:[{destinationId:"sessions",id:"sessions"},{destinationId:"terminals",id:"terminals"}]};function Y(e){const i=a(e.destinationId,{label:e.label});return{id:e.id,label:i.label,route:i.route,active:i.active,destinationId:i.id}}function L(e){return h[e].map(Y)}function ve(e){const i=d[e.view];if(i!=="projects"&&i!=="sessions")return null;const t=i;return{areaId:t,items:L(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:"advisor",id:"advisor"}]};function $(e){const i=a(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($).filter(w=>s(w.destinationId).capability!=="ops.control"||i?.opsControlEnabled!==!1);return{areaId:o,items:I}}const me=B(),be=J();export{me as A,be as O,R as P,ne as a,de as b,re as c,pe as d,le as e,se as f,ae as g,j as h,ve as i,ce as p,ue as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,r as o}from"./index-
|
|
1
|
+
import{j as r,r as o}from"./index-DvLtl7rV.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-
|
|
1
|
+
import{c as a}from"./createLucideIcon-DezKXSG2.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-
|
|
1
|
+
import{c as e}from"./createLucideIcon-DezKXSG2.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-
|
|
1
|
+
import{r as d}from"./terminal-relay-GYMIvKs1.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
|
+
function f(e){const n=Math.max(0,e.debounceMs),r=Math.max(n,e.minimumIntervalMs);if(e.lastRefreshAtMs===null)return n;const t=Math.max(0,e.nowMs-e.lastRefreshAtMs);return Math.max(n,r-t)}function i(e){const n=e.trim().toLowerCase();if(!n)return[];const t=/^session:[^:]+:(.+)$/u.exec(n)?.[1]??n,o=t.split(/[\\/]/u).filter(Boolean).at(-1)??t,s=o.endsWith(".jsonl")?o.slice(0,-6):o;return[...new Set([n,t,o,s])]}function u(e,n){if(!e||!n)return!1;const r=new Set(i(e));return i(n).some(t=>r.has(t))}function a(e,n,r=0){return r>6||e===null||e===void 0?!1:typeof e=="string"?n.some(t=>u(e,t)):Array.isArray(e)?e.some(t=>a(t,n,r+1)):typeof e=="object"?Object.values(e).some(t=>a(t,n,r+1)):!1}function c(e,n){if(e.kind==="unknown")return!0;const r=n.filter(t=>!!t?.trim());return r.length>0&&a(e.payload,r)}function l(e,n){return e.sessionRef===n?e:{sessionRef:n,lookup:null,loading:!0,error:null}}function m(e,n){let r=0;return{async request(t){const o=++r;try{const s=await e(t);if(o!==r)return;n({sessionRef:t,result:{ok:!0,lookup:s}})}catch(s){if(o!==r)return;n({sessionRef:t,result:{ok:!1,error:s}})}},invalidate(){r+=1}}}export{l as a,c as b,m as c,f as d,u as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u}from"./createLucideIcon-
|
|
1
|
+
import{c as u}from"./createLucideIcon-DezKXSG2.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}from"./createLucideIcon-
|
|
1
|
+
import{c}from"./createLucideIcon-DezKXSG2.js";const e=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],o=c("settings",e);export{o as S};
|
package/dist/client/assets/{sliders-horizontal-BPSMHhbm.js → sliders-horizontal-C8njVwfg.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t}from"./createLucideIcon-
|
|
1
|
+
import{c as t}from"./createLucideIcon-DezKXSG2.js";const a=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],h=t("sliders-horizontal",a);export{h as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a}from"./createLucideIcon-
|
|
1
|
+
import{c as a}from"./createLucideIcon-DezKXSG2.js";const e=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],l=a("sparkles",e);export{l as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,c as R}from"./index-
|
|
1
|
+
import{r as n,c as R}from"./index-DvLtl7rV.js";import{c as v,a as k,w as p}from"./index-BWHgHrtv.js";const u=new Set;let i=null,a=null,c=null,s=null;function b(e){for(const r of[...u])r(e)}function E(){s||u.size===0||(s=setTimeout(()=>{s=null,d()},2e3))}function d(){c||u.size===0||(i||(i=v({url:R()}),a=k({links:[p({client:i})]})),c=a.control.events.subscribe(void 0,{onData:e=>{const r=e.data;r&&b(r)},onError:()=>{c=null,E()}}),b({kind:"unknown",payload:{reason:"control_subscription_started"}}))}function w(){s&&(clearTimeout(s),s=null),c?.unsubscribe(),c=null}function S(e){return u.add(e),d(),()=>{u.delete(e),!(u.size>0)&&w()}}function T(e){const r=n.useRef(e);r.current=e,n.useEffect(()=>S(o=>{r.current(o)}),[])}function z(e,r,o=250){const l=n.useRef(e);l.current=e;const f=n.useRef(r);f.current=r;const t=n.useRef(null);T(m=>{l.current(m)&&(t.current||(t.current=setTimeout(()=>{t.current=null,f.current()},o)))}),n.useEffect(()=>()=>{t.current&&(clearTimeout(t.current),t.current=null)},[])}export{z as a,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,i as o}from"./index-
|
|
1
|
+
import{r as c,i as o}from"./index-DvLtl7rV.js";import{c as f,a as b,w as d}from"./index-BWHgHrtv.js";const r=new Set;let n=null,l=null,s=null;function p(t){for(const e of[...r])e(t)}function S(){s||(n||(n=f({url:o()}),l=b({links:[d({client:n})]})),s=l.tail.events.subscribe(void 0,{onData:t=>{const e=t.data;e&&p(e)}}))}function m(){s?.unsubscribe(),s=null}function C(t,e=!0){const i=c.useRef(t);i.current=t,c.useEffect(()=>{if(!e)return;const u=a=>i.current(a);return r.add(u),S(),()=>{r.delete(u),r.size===0&&m()}},[e])}export{C as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./createLucideIcon-
|
|
1
|
+
import{c as e}from"./createLucideIcon-DezKXSG2.js";const o=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],a=e("terminal",o);export{a as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./api-Co9aQ2Jw.js";import{a as c}from"./router-
|
|
1
|
+
import{a as i}from"./api-Co9aQ2Jw.js";import{a as c}from"./router-B9vQkNJL.js";import{s as l}from"./terminal-sessions-BQ6t92tJ.js";const v=132,b=44;function u(e){return e==="codex"?"codex":e==="pi"?"pi":void 0}function a(e){return e==="observe"?"observe":"takeover"}function f(e,n,t="takeover"){return`scout-tmux-${e}-${n}-${t}`}function m(e){return e?e.terminalSurface?e.terminalSurface:e.transport==="tmux"&&e.harnessSessionId?{backend:"tmux",sessionName:e.harnessSessionId,paneId:null,socketDir:null}:null:null}function g(e,n){if(!n)return e;try{const t=new URL(e);return t.searchParams.set("agentId",n),t.toString()}catch{const t=e.includes("?")?"&":"?";return`${e}${t}agentId=${encodeURIComponent(n)}`}}function $(e,n){return n==="takeover"&&!!e&&!m(e)}function y(e){return e?{backend:e.backend,terminalSession:e.sessionName,...e.backend==="tmux"?{tmuxSession:e.sessionName}:{},...e.backend==="zellij"?{zellijSession:e.sessionName,...e.socketDir?{zellijSocketDir:e.socketDir}:{}}:{},...e.backend==="herdr"?{herdrSession:e.sessionName,tmuxSession:e.sessionName}:{}}:null}function T(e){const{agentId:n,agent:t,terminalSurface:o,registeredTarget:s}=e,r=a(e.mode),d=o&&t?`scout-terminal-${o.backend}-${t.id}-${o.sessionName}-${r}`:s&&o?`scout-terminal-registry-${s.session.id}-${o.backend}-${o.sessionName}-${r}`:n?`scout-takeover-${n}-${r}`:`scout-takeover-${r}`;return o?.backend==="tmux"&&t?f(t.id,o.sessionName,r):d}function N(e){const n=T({agentId:e.agentId,agent:e.agent,terminalSurface:e.terminalSurface,registeredTarget:e.registeredTarget,mode:e.mode}),t=a(e.mode);return{relayStorageSessionKey:n,scopedRelayUrl:g(e.relayUrl,e.agentId),cwd:e.cwd??void 0,relayAgent:u(e.harness),surfaceOptions:y(e.terminalSurface),orphanTTL:e.terminalSurface?1e3:void 0,controlMode:t}}function h(e){return e.registeredTarget?{view:"terminal",terminalSessionId:e.registeredTarget.session.id,terminalSurfaceKey:l(e.registeredTarget.surface)}:e.agentId?{view:"terminal",agentId:e.agentId}:{view:"terminal"}}function R(e,n){return n?{...e,mode:n}:e}function w(e){const n=c(e);return typeof window>"u"?n:new URL(n,window.location.href).toString()}function x(e,n){return i("/api/terminal-sessions/control",{method:"POST",body:JSON.stringify({backend:e.backend,sessionName:e.sessionName,action:n})})}function O(e){return i("/api/terminal-relay/session/destroy",{method:"POST",body:JSON.stringify({sessionId:e})})}function U(e){try{window.localStorage.removeItem(`hudson.relay.${e}`)}catch{}}export{v as S,b as a,N as b,x as c,h as d,w as e,U as f,O as g,m as r,$ as s,R as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as o}from"./index-
|
|
1
|
+
import{d as o}from"./index-DvLtl7rV.js";async function n(e){if(t(e.agentId),!(await fetch(o("terminalRunPath"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e.command,...e.cwd?{cwd:e.cwd}:{},...e.agentId?{agentId:e.agentId}:{}})})).ok)throw new Error("Failed to queue takeover")}function t(e){if(!(typeof window>"u"))try{window.localStorage.removeItem("hudson.relay.scout-takeover"),e&&window.localStorage.removeItem(`hudson.relay.scout-takeover-${e}`)}catch{}}export{n as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as t,N as Ce}from"./index-CZ-05hKz.js";import{g as ke,e as Ne,s as Me,a as de,f as Re}from"./scout-voice-BhPzrc6P.js";import{createLevelHistory as Ee,energyFromPartialDelta as me,tryStartMicLevelMeter as Le,VOICE_WAVE_BARS as pe}from"./voice-levels-Dcr3jglk.js";import{L as Ve}from"./loader-circle-BiohlpM3.js";import{c as he}from"./createLucideIcon-DXpqZP7I.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=he("mic",Ae);const _e=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Pe=he("square",_e);function Te(e,s=!1){return e.key==="Enter"&&!e.shiftKey&&(s||!!(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,s,l){if(l)return l;switch(e){case"starting":return"Starting voice…";case"recording":return s.trim()?s.trim():null;case"processing":return"Transcribing…";default:return null}}function fe(e){return new Promise(s=>window.setTimeout(s,e))}function Fe({onAppend:e,onError:s,onStatus:l,disabled:L,className:m}){const p=r.useRef(ke()),u=r.useRef(null),h=r.useRef(Ee(pe)),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(n=>{W(n),s?.(n)},[s]),X=r.useCallback((n,i,o)=>{l?.({state:n,partial:i,message:qe(n,i,o),tone:o?"error":n==="recording"?"recording":n==="processing"?"processing":"neutral",levels:n==="idle"&&!o?[]:h.current.snapshot(),levelsLive:C.current})},[l]);r.useEffect(()=>{X(v,G,P)},[X,P,G,v,Q]);const A=r.useCallback(async(n=!1)=>{const i=p.current;D(x=>x==="launching"?x:"probing");const o=await i.probe(n?{force:!0}:void 0);return q(o),V(null),D("idle"),o},[]);r.useEffect(()=>{Ne();const n=p.current,i=Me(o=>{q(o.ok),V(null),D("idle")});return n.connectionState==="unknown"?A():(q(n.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(n=>{h.current.push(n),y(i=>i+1)},[]),Z=r.useCallback(()=>{if(b.current)return;let n=performance.now();const i=o=>{if(o-n>=36){n=o;const x=o-(T.current||o),w=me(S.current,S.current,x);h.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 n=p.current;W(null),_(""),S.current="",T.current=performance.now(),h.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 n.startLive({onState:g=>k(De(g)),onPartial:g=>{const U=S.current;if(S.current=g,T.current=performance.now(),_(g),!C.current){const ce=me(U,g,0);B(ce)}},onLevel:g=>{w=!0,C.current=!0,b.current&&(window.cancelAnimationFrame(b.current),b.current=0),B(g)}}),u.current=x,k("recording"),await fe(140),u.current&&!w&&!C.current){const g=await Le(U=>{w=!0,C.current=!0,b.current&&(window.cancelAnimationFrame(b.current),b.current=0),B(U)});g&&u.current?K.current=g: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),h.current.clear(),y(g=>g+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="",h.current.clear(),y(g=>g+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 n=u.current;if(!n)return;k("processing"),N();const i=window.setInterval(()=>{h.current.decay(.82),y(o=>o+1)},50);window.setTimeout(()=>window.clearInterval(i),600);try{await n.stop()}catch(o){try{await n.cancel()}catch{}u.current=null,k("idle");const x=S.current.trim();_(""),S.current="",h.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=(p.current.canRequestMicrophone||R?.action==="request_microphone"||R?.action==="request_speech")&&!f&&!M,O=(p.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:s,processing:l=!1,className:L}){const m=$e(e,pe,l?.06:.04),p=["s-msg-compose-wave",s?"s-msg-compose-wave--live":"",l?"s-msg-compose-wave--processing":"",L??""].filter(Boolean).join(" ");return t.jsx("div",{className:p,"aria-hidden":"true","data-wave-source":e&&e.length>0?"levels":"floor",children:m.map((u,h)=>t.jsx("span",{className:"s-msg-compose-wave-bar",style:{transform:`scaleY(${Math.max(.08,u)})`,opacity:l?.28+u*.35:s?.4+u*.55:.25}},h))})}function $e(e,s,l){if(!e||e.length===0)return Array.from({length:s},()=>l);if(e.length===s)return e.map(m=>Math.max(l,Math.min(1,m)));const L=new Array(s);for(let m=0;m<s;m+=1){const p=Math.min(e.length-1,Math.round(m/Math.max(1,s-1)*(e.length-1)));L[m]=Math.max(l,Math.min(1,e[p]??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 ge(e,s){e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,s)}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,...s}){return Ce()&&!e?null:t.jsx(He,{...s})}function He({value:e,onChange:s,onSend:l,placeholder:L="Type a message…",disabled:m=!1,sending:p=!1,canSend:u,stopMode:h=!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,n]=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&&ge(a,I)},[e,F,I]);const o=(u??e.trim().length>0)&&!p&&!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(()=>{h||!(u??e.trim().length>0)||p||m||l()},[u,m,l,p,h,e]),g=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;s(Y,{caret:a.target.selectionStart??Y.length}),F&&ge(a.target,I)},ve=a=>{const Y=e.trim()?`${e.trimEnd()} ${a}`:a;s(Y,{caret:Y.length}),requestAnimationFrame(()=>H.current?.focus())},be=r.useCallback(a=>{n(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":"",h?"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||p,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||p}):null,R?t.jsx("div",{className:"s-msg-compose-secondary",children:R}):null,h?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:g,children:ue})}function Ze(e){if(!e)return null;const s=e.replace(/_/g," ");return s.toLowerCase()==="relay agent"?"agent":s}export{Fe as D,Xe as M,Pe as S,Be as a,Ze as f,Te as i};
|
|
1
|
+
import{r,j as t,L as Ce}from"./index-DvLtl7rV.js";import{g as ke,e as Ne,s as Me,a as de,f as Re}from"./scout-voice-BVUqGhth.js";import{createLevelHistory as Ee,energyFromPartialDelta as me,tryStartMicLevelMeter as Le,VOICE_WAVE_BARS as pe}from"./voice-levels-Dcr3jglk.js";import{L as Ve}from"./loader-circle-pM56HNhR.js";import{c as he}from"./createLucideIcon-DezKXSG2.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=he("mic",Ae);const _e=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Pe=he("square",_e);function Te(e,s=!1){return e.key==="Enter"&&!e.shiftKey&&(s||!!(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,s,l){if(l)return l;switch(e){case"starting":return"Starting voice…";case"recording":return s.trim()?s.trim():null;case"processing":return"Transcribing…";default:return null}}function fe(e){return new Promise(s=>window.setTimeout(s,e))}function Fe({onAppend:e,onError:s,onStatus:l,disabled:L,className:m}){const p=r.useRef(ke()),u=r.useRef(null),h=r.useRef(Ee(pe)),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(n=>{W(n),s?.(n)},[s]),X=r.useCallback((n,i,o)=>{l?.({state:n,partial:i,message:qe(n,i,o),tone:o?"error":n==="recording"?"recording":n==="processing"?"processing":"neutral",levels:n==="idle"&&!o?[]:h.current.snapshot(),levelsLive:C.current})},[l]);r.useEffect(()=>{X(v,G,P)},[X,P,G,v,Q]);const A=r.useCallback(async(n=!1)=>{const i=p.current;D(x=>x==="launching"?x:"probing");const o=await i.probe(n?{force:!0}:void 0);return q(o),V(null),D("idle"),o},[]);r.useEffect(()=>{Ne();const n=p.current,i=Me(o=>{q(o.ok),V(null),D("idle")});return n.connectionState==="unknown"?A():(q(n.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(n=>{h.current.push(n),y(i=>i+1)},[]),Z=r.useCallback(()=>{if(b.current)return;let n=performance.now();const i=o=>{if(o-n>=36){n=o;const x=o-(T.current||o),w=me(S.current,S.current,x);h.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 n=p.current;W(null),_(""),S.current="",T.current=performance.now(),h.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 n.startLive({onState:g=>k(De(g)),onPartial:g=>{const U=S.current;if(S.current=g,T.current=performance.now(),_(g),!C.current){const ce=me(U,g,0);B(ce)}},onLevel:g=>{w=!0,C.current=!0,b.current&&(window.cancelAnimationFrame(b.current),b.current=0),B(g)}}),u.current=x,k("recording"),await fe(140),u.current&&!w&&!C.current){const g=await Le(U=>{w=!0,C.current=!0,b.current&&(window.cancelAnimationFrame(b.current),b.current=0),B(U)});g&&u.current?K.current=g: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),h.current.clear(),y(g=>g+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="",h.current.clear(),y(g=>g+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 n=u.current;if(!n)return;k("processing"),N();const i=window.setInterval(()=>{h.current.decay(.82),y(o=>o+1)},50);window.setTimeout(()=>window.clearInterval(i),600);try{await n.stop()}catch(o){try{await n.cancel()}catch{}u.current=null,k("idle");const x=S.current.trim();_(""),S.current="",h.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=(p.current.canRequestMicrophone||R?.action==="request_microphone"||R?.action==="request_speech")&&!f&&!M,O=(p.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:s,processing:l=!1,className:L}){const m=$e(e,pe,l?.06:.04),p=["s-msg-compose-wave",s?"s-msg-compose-wave--live":"",l?"s-msg-compose-wave--processing":"",L??""].filter(Boolean).join(" ");return t.jsx("div",{className:p,"aria-hidden":"true","data-wave-source":e&&e.length>0?"levels":"floor",children:m.map((u,h)=>t.jsx("span",{className:"s-msg-compose-wave-bar",style:{transform:`scaleY(${Math.max(.08,u)})`,opacity:l?.28+u*.35:s?.4+u*.55:.25}},h))})}function $e(e,s,l){if(!e||e.length===0)return Array.from({length:s},()=>l);if(e.length===s)return e.map(m=>Math.max(l,Math.min(1,m)));const L=new Array(s);for(let m=0;m<s;m+=1){const p=Math.min(e.length-1,Math.round(m/Math.max(1,s-1)*(e.length-1)));L[m]=Math.max(l,Math.min(1,e[p]??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 ge(e,s){e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,s)}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,...s}){return Ce()&&!e?null:t.jsx(He,{...s})}function He({value:e,onChange:s,onSend:l,placeholder:L="Type a message…",disabled:m=!1,sending:p=!1,canSend:u,stopMode:h=!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,n]=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&&ge(a,I)},[e,F,I]);const o=(u??e.trim().length>0)&&!p&&!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(()=>{h||!(u??e.trim().length>0)||p||m||l()},[u,m,l,p,h,e]),g=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;s(Y,{caret:a.target.selectionStart??Y.length}),F&&ge(a.target,I)},ve=a=>{const Y=e.trim()?`${e.trimEnd()} ${a}`:a;s(Y,{caret:Y.length}),requestAnimationFrame(()=>H.current?.focus())},be=r.useCallback(a=>{n(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":"",h?"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||p,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||p}):null,R?t.jsx("div",{className:"s-msg-compose-secondary",children:R}):null,h?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:g,children:ue})}function Ze(e){if(!e)return null;const s=e.replace(/_/g," ");return s.toLowerCase()==="relay agent"?"agent":s}export{Fe as D,Xe as M,Pe as S,Be as a,Ze as f,Te as i};
|