@openscout/scout 0.2.84 → 0.2.86
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/README.md +1 -1
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/ActivityScreen-C7AwUogt.js +1 -0
- package/dist/client/assets/{AddProjectForm-Czb5uwou.js → AddProjectForm-BNRpRPod.js} +1 -1
- package/dist/client/assets/AgentAvatar-B1xvQ7ej.js +1 -0
- package/dist/client/assets/AgentConfigurationScreen-BoBQpyz5.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-rw3vh8Lm.js +1 -0
- package/dist/client/assets/{AgentDetailCard-Biq8b2gv.js → AgentDetailCard-FelCxQrT.js} +1 -1
- package/dist/client/assets/AgentFloorView-Crdw8Uo5.js +1 -0
- package/dist/client/assets/AgentInfoScreen-Cge7HHbV.js +1 -0
- package/dist/client/assets/{AgentLaneCard-C4DMQR-c.js → AgentLaneCard-CRDG74C1.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-D1xNNf7A.js → AgentLaneChrome-CWFqUdch.js} +1 -1
- package/dist/client/assets/AgentLaneDetailSheet-DCIIg3Zp.js +4 -0
- package/dist/client/assets/{AgentLaneSummaryResize-C9loK-st.js → AgentLaneSummaryResize-yTM4GQAJ.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-BJLwXSNp.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-M7iDXdP2.js → AgentLanesPreflight-DJeDRTAN.js} +1 -1
- package/dist/client/assets/AgentLanesView-CbY9qD0z.js +2 -0
- package/dist/client/assets/{AgentLiveActions-0iy8QZ1T.js → AgentLiveActions-Bn3zeZBN.js} +1 -1
- package/dist/client/assets/AgentSessions-czl5zT7A.js +6 -0
- package/dist/client/assets/AgentsConsole-CoT2crwq.js +1 -0
- package/dist/client/assets/{AgentsScreen-Bww6HgFs.js → AgentsScreen-BcPM-z1T.js} +1 -1
- package/dist/client/assets/AgentsSubnav-3_vpn2bT.js +1 -0
- package/dist/client/assets/AstronautSuit-BADl7m8x.js +1 -0
- package/dist/client/assets/{AtopView-h_aFoNkP.js → AtopView-DymBCiXv.js} +1 -1
- package/dist/client/assets/{BackToPicker-BXp5E2ck.js → BackToPicker-CqYhOaLB.js} +1 -1
- package/dist/client/assets/BriefingDetailScreen-DDfZ8ci1.js +1 -0
- package/dist/client/assets/{BriefingsScreen-BTsvr5fv.js → BriefingsScreen-CLvSOJjy.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-jg7odHQp.js → BrokerMetadataPanel-DFAH-NO6.js} +1 -1
- package/dist/client/assets/BrokerScreen-Bkvu92jk.js +5 -0
- package/dist/client/assets/{Canvas-BePL08RR.js → Canvas-KyTsDJlB.js} +1 -1
- package/dist/client/assets/ChatCollapsedStrip-Bjjqa30K.js +1 -0
- package/dist/client/assets/{CodeDiffPane-86odpBSt.js → CodeDiffPane-C9HT1dCT.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-8svr_S_A.js → CodeProjectPicker-5Y3GvXkM.js} +1 -1
- package/dist/client/assets/{CodeScreen-CJ2RgB32.js → CodeScreen-DpN9kQvm.js} +1 -1
- package/dist/client/assets/ConversationComposer-Ce7Byw48.js +1 -0
- package/dist/client/assets/ConversationFeedRows-DygDfQn_.js +1 -0
- package/dist/client/assets/ConversationHeader-C3sg0ULI.js +1 -0
- package/dist/client/assets/ConversationPanels-Dg4Y2GgX.js +6 -0
- package/dist/client/assets/ConversationScreen-BP5tdz2k.css +1 -0
- package/dist/client/assets/ConversationScreen-CjWWmuuh.js +1 -0
- package/dist/client/assets/ConversationStatus-BhVIYQza.js +1 -0
- package/dist/client/assets/CrewWorkspaces-B6YIyw1z.css +1 -0
- package/dist/client/assets/CrewWorkspaces-CDU-wy1Y.js +1 -0
- package/dist/client/assets/{DataTable-CGw5CECG.js → DataTable-oJP339bX.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-DowTb7uO.js → DispatchAftermath-CH02HAVw.js} +1 -1
- package/dist/client/assets/DocumentFocusViewer-DmtFisY9.js +1 -0
- package/dist/client/assets/{EmbeddableSurfacesLab-CxfJXS2g.js → EmbeddableSurfacesLab-84b9I3fy.js} +1 -1
- package/dist/client/assets/{EmptyState-BUvllvA6.js → EmptyState-BnDda92b.js} +1 -1
- package/dist/client/assets/{FileViewerPane-BM4AD_bo.js → FileViewerPane-Dg7_88pv.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-DL3Xhl0h.js +1 -0
- package/dist/client/assets/{FollowScreen-DG0osbUp.js → FollowScreen-DcFBqr6l.js} +1 -1
- package/dist/client/assets/{HarnessMark-MztYnrGK.js → HarnessMark-DGZ6o6Ct.js} +1 -1
- package/dist/client/assets/{HarnessesScreen-BWqirBjK.js → HarnessesScreen-DTDL-XaA.js} +1 -1
- package/dist/client/assets/{HerdrSession-6sFln7WX.js → HerdrSession-DV2hD6Yh.js} +1 -1
- package/dist/client/assets/HomeHero-7JwycwFY.css +1 -0
- package/dist/client/assets/HomeHero-CENwVZ45.js +1 -0
- package/dist/client/assets/HostAdvisorView-PgiZUkd_.js +1 -0
- package/dist/client/assets/{KnowledgeSearchInspector-BOIhFWd2.js → KnowledgeSearchInspector-DNQjeWZO.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-Bj80IgR0.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-CcEiQC6B.js → LaneToolHoverCard-197xYmRp.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-BztwvOv9.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-Bl9L0EYb.js → LaneTraceEventFocus-C9cmqxnK.js} +1 -1
- package/dist/client/assets/{MeshCanvas-ZjIuMiRo.js → MeshCanvas-C3_2p9B6.js} +2 -2
- package/dist/client/assets/{MeshCanvasMinimap-C-LQtiX6.js → MeshCanvasMinimap-ZTjYWXTZ.js} +1 -1
- package/dist/client/assets/{MeshScreen-Bs3soujg.js → MeshScreen-lJKaOyGB.js} +1 -1
- package/dist/client/assets/{MeshTopologyView-C0LUyT3K.js → MeshTopologyView-CBjHbAZw.js} +2 -2
- package/dist/client/assets/MessagesScreen-D6MVLvdg.js +1 -0
- package/dist/client/assets/{MissionContextRail-CjGAEGu8.js → MissionContextRail-DXkrbcnZ.js} +1 -1
- package/dist/client/assets/MissionControlView-BCH-Zsp4.js +1 -0
- package/dist/client/assets/MissionFocusOverlay-DbAliOSF.js +1 -0
- package/dist/client/assets/MissionLeftAgentRow-Bx6Pg8_O.js +1 -0
- package/dist/client/assets/MissionLogPane-D06c29Y8.js +1 -0
- package/dist/client/assets/{NewAgentModal-D5e0YUAo.js → NewAgentModal-C18Ajovd.js} +1 -1
- package/dist/client/assets/NewChatComposer-Bgqes0UQ.js +19 -0
- package/dist/client/assets/{NewChatOrigin-BEz6jyqf.js → NewChatOrigin-DpHS2Wmt.js} +1 -1
- package/dist/client/assets/ObserveEmbedScreen-Cmhwai4X.js +2 -0
- package/dist/client/assets/ObserveTextFlow-C1f5oize.js +2 -0
- package/dist/client/assets/ObservedTopologyPanel-D85P6RAk.js +2 -0
- package/dist/client/assets/OpenScoutAppShell-IDI4fuUE.js +88 -0
- package/dist/client/assets/OpsAgentsView-yt0JavoB.js +1 -0
- package/dist/client/assets/OpsScreen-C3yNQqJE.js +1 -0
- package/dist/client/assets/OpsSubnav-BijKI3yG.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-DnIeC16r.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-B1VpwzGD.js → ProjectAgentProfileBar-IDEpKZvI.js} +1 -1
- package/dist/client/assets/ProjectAgentProfileHero-Bh_aISs-.js +1 -0
- package/dist/client/assets/ProjectsInbox-B8Srlklk.js +2 -0
- package/dist/client/assets/ProjectsRail-DqAbdvCf.js +1 -0
- package/dist/client/assets/ProjectsScreen-DKHQ2iEv.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-DpkjYLL2.js +1 -0
- package/dist/client/assets/Provider-Ve8yXaWR.js +1 -0
- package/dist/client/assets/RailRow-B0sRaJc6.css +1 -0
- package/dist/client/assets/RailRow-C4GNGR80.js +1 -0
- package/dist/client/assets/RawSessionsTable-Co3vzwsf.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-DMd1CBAf.js +9 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-VLg4caej.js → RepoDiffEmbedScreen-C97Euf4s.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-BelnvgnP.js → RepoDiffPageScreen-DUKLzkrW.js} +1 -1
- package/dist/client/assets/RepoDiffViewer-CovKjSgb.js +7 -0
- package/dist/client/assets/RepoDiffViewerLazy-zIiEmh-e.js +2 -0
- package/dist/client/assets/{ReposScreen-IINK-CFn.js → ReposScreen-BR1LqTf1.js} +6 -6
- package/dist/client/assets/ScoutDeckSurface-BGsVicc2.js +1 -0
- package/dist/client/assets/{ScoutSurface-x_QbcRyk.js → ScoutSurface-BMKW7hSu.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-7t9JVvZg.js → ScoutbotFxLab-0O2iDRrF.js} +1 -1
- package/dist/client/assets/{SecondaryNav-Dj30epYF.js → SecondaryNav-cYTw2p39.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-s2mJ5Fg9.js → SessionEmbedScreen-mNjT0R6j.js} +1 -1
- package/dist/client/assets/{SessionObserve-DaUrJCMq.js → SessionObserve-zAlFbwFn.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-ClUW8jpV.js → SessionObserveEvidence-BVawzqoE.js} +1 -1
- package/dist/client/assets/SessionRefScreen-BmKhf29o.js +1 -0
- package/dist/client/assets/SessionsScreen-CsSqjIY2.js +1 -0
- package/dist/client/assets/SettingsDrawer-Dsj-On_x.css +1 -0
- package/dist/client/assets/SettingsDrawer-DwYQTGi8.js +3 -0
- package/dist/client/assets/SettingsScreen-Btaku7YM.js +1 -0
- package/dist/client/assets/{ShikiPane-Dkwyx--r.js → ShikiPane-DyEJdcvb.js} +1 -1
- package/dist/client/assets/{SlidePanel-CuTeirnk.js → SlidePanel-Dg8_styW.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-DQ3PTb8L.js → SpriteAvatar-DMrSssNZ.js} +1 -1
- package/dist/client/assets/{StatusPill-BJ1ierIR.js → StatusPill-NFFnphtx.js} +1 -1
- package/dist/client/assets/{TailView-CufWcrvf.js → TailView-BfObcZu3.js} +2 -2
- package/dist/client/assets/Terminal-Dr-M9U4u.js +1 -0
- package/dist/client/assets/TerminalEmbedScreen-BmyZkonh.js +1 -0
- package/dist/client/assets/{TerminalRelay-rvUzI9Ek.js → TerminalRelay-lJ2KdMCW.js} +3 -3
- package/dist/client/assets/{TextDocumentSurface-Bc-kHPgG.js → TextDocumentSurface-C7fGlzY8.js} +1 -1
- package/dist/client/assets/{TmuxPeek-DLyDkq_D.js → TmuxPeek-BSeKIjnX.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-CD903y9K.js → VoicePermissionsPanel-BkIGTzgw.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-D51oI0dH.js → WorkDetailScreen-Cwe-KWK4.js} +3 -3
- package/dist/client/assets/WorkFilesViewer-BBtKRBPv.js +1 -0
- package/dist/client/assets/{activity-BvGruxWG.js → activity-D4W2XZY2.js} +1 -1
- package/dist/client/assets/{addon-fit-Cfq4Ayjd.js → addon-fit-Celjj2yn.js} +1 -1
- package/dist/client/assets/{addon-webgl-B8sIf9-s.js → addon-webgl-Cu4tJ21-.js} +1 -1
- package/dist/client/assets/{ScoutbotBroadcastChip-CxtYZWPZ.css → agent-autocomplete-C7xwIcwd.css} +1 -1
- package/dist/client/assets/agent-autocomplete-Dv-_9dAw.js +2 -0
- package/dist/client/assets/{agent-essentials-yb4wIJlX.js → agent-essentials-CngjUhQj.js} +1 -1
- package/dist/client/assets/agent-identity-DzHGhLdJ.js +1 -0
- package/dist/client/assets/{agent-lane-card-model-q4cwzLX4.js → agent-lane-card-model-CSugZCdy.js} +1 -1
- package/dist/client/assets/{agent-lane-detail-BNNm6FNu.js → agent-lane-detail-D5EIlX7_.js} +1 -1
- package/dist/client/assets/{agent-lane-preview-C33Dwpn7.js → agent-lane-preview-BhplDYGf.js} +1 -1
- package/dist/client/assets/{agent-lanes-BDNktFBZ.css → agent-lanes-DlqcEf0l.css} +1 -1
- package/dist/client/assets/{agent-lanes-model-VYQ5a68i.js → agent-lanes-model-BKOs_32K.js} +2 -2
- package/dist/client/assets/agent-specialization-CNrsRbKA.js +1 -0
- package/dist/client/assets/{api-BkjHJfgJ.js → api-BHHEUSS3.js} +1 -1
- package/dist/client/assets/api-DEHEgJ9m.js +1 -0
- package/dist/client/assets/{arc.es-BBTfhvLE.js → arc.es-DNT50Y-_.js} +1 -1
- package/dist/client/assets/archive-DH49QqFG.js +1 -0
- package/dist/client/assets/{arrow-left-BOht-YQu.js → arrow-left-i-h6JAgs.js} +1 -1
- package/dist/client/assets/arrow-right-B0Yi01Zr.js +1 -0
- package/dist/client/assets/{arrow-up-right-hoR8_oUz.js → arrow-up-right-RBC6k8nn.js} +1 -1
- package/dist/client/assets/{bot-BUK7dOPS.js → bot-r2IuAuJd.js} +1 -1
- package/dist/client/assets/broker-display-Q75fupqG.js +2 -0
- package/dist/client/assets/{cache-Dr0why2k.js → cache-BO2Bd_LV.js} +1 -1
- package/dist/client/assets/{check--esHw52j.js → check-Bfs7hMb1.js} +1 -1
- package/dist/client/assets/{chevron-down-NAhBUkFd.js → chevron-down-Da5tV19_.js} +1 -1
- package/dist/client/assets/{chevron-right-C10o7t_X.js → chevron-right-BMqtBds_.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-DF8R9rPv.js → chunk-HRAB3GC3-BUVYXXAp.js} +1 -1
- package/dist/client/assets/{clock-of01sAB6.js → clock-DaKLp6Xd.js} +1 -1
- package/dist/client/assets/{code-xml-CLn3TDWF.js → code-xml-ByQsfOI_.js} +1 -1
- package/dist/client/assets/collapsed-strip-raJWthAH.css +1 -0
- package/dist/client/assets/compass-BepM5iWH.js +1 -0
- package/dist/client/assets/{content-Cgj5AWqT.js → content-5hnDC9WE.js} +1 -1
- package/dist/client/assets/content-BRFZ-a6m.js +1 -0
- package/dist/client/assets/content-BYykncDo.js +1 -0
- package/dist/client/assets/content-Be6yyWbJ.js +1 -0
- package/dist/client/assets/content-Bgl_X3ao.js +1 -0
- package/dist/client/assets/content-BopJW1Zx.js +1 -0
- package/dist/client/assets/content-Bv2sfg0w.js +1 -0
- package/dist/client/assets/content-CMBiIZTg.js +1 -0
- package/dist/client/assets/content-CPVqvf5o.js +1 -0
- package/dist/client/assets/content-CbwyFqdI.js +1 -0
- package/dist/client/assets/content-ClQjAWYi.js +1 -0
- package/dist/client/assets/content-Cv2tSAbv.js +1 -0
- package/dist/client/assets/content-DFFe3-Ot.js +1 -0
- package/dist/client/assets/content-DY5hwBmm.js +1 -0
- package/dist/client/assets/content-_IXoxGno.js +1 -0
- package/dist/client/assets/content-j_tewJdE.js +1 -0
- package/dist/client/assets/{conversation-icons-ClBJi21l.js → conversation-icons-C4amK8Sa.js} +1 -1
- package/dist/client/assets/conversation-model-CigSPlKA.js +1 -0
- package/dist/client/assets/conversation-motion-features-_95aZx_1.js +1 -0
- package/dist/client/assets/{copy-Dty8ZYsM.js → copy-De4s38o2.js} +1 -1
- package/dist/client/assets/cpu-Bc268H9Q.js +1 -0
- package/dist/client/assets/{createLucideIcon-Bt67PWH-.js → createLucideIcon-DLlxGjKt.js} +1 -1
- package/dist/client/assets/credentials-qwds23lv.js +1 -0
- package/dist/client/assets/ctx-panel-D_HJ3nhb.css +1 -0
- package/dist/client/assets/discover-DOlk1hG7.js +2 -0
- package/dist/client/assets/embed-entry-BqDJfa87.js +2 -0
- package/dist/client/assets/{external-link-Dem738OJ.js → external-link-BGHC_naA.js} +1 -1
- package/dist/client/assets/{eye-B3lBIwJZ.js → eye-BeCSqJn1.js} +1 -1
- package/dist/client/assets/file-code-corner-CX53Cd9y.js +1 -0
- package/dist/client/assets/{file-text-iF0hyVyU.js → file-text-BVhkMWyC.js} +1 -1
- package/dist/client/assets/gauge-CPcEPmNt.js +1 -0
- package/dist/client/assets/gestures-BXIGYk_p.js +1 -0
- package/dist/client/assets/git-branch-q8Ayc8py.js +1 -0
- package/dist/client/assets/home-moving-signal-DMguaRWR.css +1 -0
- package/dist/client/assets/home-moving-signal-Dm2Z2x0p.js +1 -0
- package/dist/client/assets/{home-now-card-nano-hZl9klbP.js → home-now-card-nano-Djhy6ax0.js} +1 -1
- package/dist/client/assets/home-now-card-xU5LGP7q.js +1 -0
- package/dist/client/assets/hooks-CdKx1CxP.js +2 -0
- package/dist/client/assets/host-advisor-B2Fqs5Dd.css +1 -0
- package/dist/client/assets/index-Bli6bTLU.js +10 -0
- package/dist/client/assets/index-D7UEHxaY.js +1 -0
- package/dist/client/assets/index-DFdlQs_c.js +1 -0
- package/dist/client/assets/index-DhfOMK0D.js +1 -0
- package/dist/client/assets/index-DzlEgstl.css +1 -0
- package/dist/client/assets/index-wLwc74Pu.css +1 -0
- package/dist/client/assets/inspector-panel-B8pigRsg.js +2 -0
- package/dist/client/assets/{keyboard-nav-Chf51dns.js → keyboard-nav-7iEtvu9P.js} +1 -1
- package/dist/client/assets/{lane-observe-BA3g9aVd.js → lane-observe-vfyACHi0.js} +1 -1
- package/dist/client/assets/{lane-roster-store-BiIVlYmG.js → lane-roster-store-pHT3TAVs.js} +1 -1
- package/dist/client/assets/layers-BiZA-Clc.js +1 -0
- package/dist/client/assets/layout-grid-DMpv9CZM.js +1 -0
- package/dist/client/assets/left-BayK4ocL.js +1 -0
- package/dist/client/assets/left-BhZhSrS2.js +1 -0
- package/dist/client/assets/left-BhgU6NOA.js +1 -0
- package/dist/client/assets/left-CY_FGnN7.js +1 -0
- package/dist/client/assets/left-Cq8mjamr.js +1 -0
- package/dist/client/assets/left-DH44V4I_.css +1 -0
- package/dist/client/assets/left-Dnqla0b5.js +2 -0
- package/dist/client/assets/left-Dy403II2.js +2 -0
- package/dist/client/assets/left-R2OOE7VG.css +1 -0
- package/dist/client/assets/left-advisor-oOAtJ9YE.js +1 -0
- package/dist/client/assets/left-agents-TIKe8vW8.js +1 -0
- package/dist/client/assets/left-default-owH0Lwxo.js +1 -0
- package/dist/client/assets/left-lanes-BE_co2lP.js +1 -0
- package/dist/client/assets/left-mission-C_nWUtfA.js +1 -0
- package/dist/client/assets/library-BSVrjn_m.js +1 -0
- package/dist/client/assets/{loader-circle-4LDsy4Ke.js → loader-circle-DoT8gpw6.js} +1 -1
- package/dist/client/assets/{local-agents-DIi2EacM.js → local-agents-BMadXuP1.js} +1 -1
- package/dist/client/assets/mentions-Cd6XticV.js +1 -0
- package/dist/client/assets/{mesh-ops-JZwGuAPn.js → mesh-ops-C0zCLTR8.js} +1 -1
- package/dist/client/assets/{mesh-view-store-Du7VqIT_.js → mesh-view-store-Cpqil_2D.js} +1 -1
- package/dist/client/assets/{message-circle-BM3XgevU.js → message-circle-44KSmbvQ.js} +1 -1
- package/dist/client/assets/{message-markup-BcY1lShv.js → message-markup-DAnnGpWr.js} +1 -1
- package/dist/client/assets/{message-square-ER1_q2pe.js → message-square-DlY4EneU.js} +1 -1
- package/dist/client/assets/mission-control-CnU7dNt1.css +1 -0
- package/dist/client/assets/{mission-control-store-C6w5iVfg.js → mission-control-store-DtjtRs9Z.js} +1 -1
- package/dist/client/assets/{observe-3-jn4SXb.js → observe-DL5_8-Zj.js} +1 -1
- package/dist/client/assets/{operator-attention-BwSPeheT.js → operator-attention-BqoWAlhp.js} +1 -1
- package/dist/client/assets/{page-status-0LPfBC8S.js → page-status-CW8co39E.js} +1 -1
- package/dist/client/assets/persistent-state-DYjP8lqN.js +1 -0
- package/dist/client/assets/{plus-C-2gTcPK.js → plus-64n9qucr.js} +1 -1
- package/dist/client/assets/profile-BkmuseW7.js +1 -0
- package/dist/client/assets/projects-inbox-C0umZMSY.js +1 -0
- package/dist/client/assets/{provider-BvAxRQfE.js → provider-CX9EWecp.js} +1 -1
- package/dist/client/assets/proxy-C35W-YHZ.js +1 -0
- package/dist/client/assets/{radio-v7UAMZGh.js → radio-BjpQTKT0.js} +1 -1
- package/dist/client/assets/{refresh-cw-B5To7b6B.js → refresh-cw-IgN2fZLM.js} +1 -1
- package/dist/client/assets/resolve-panes-CCqRkQdM.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-JkxY8qsV.js +1 -0
- package/dist/client/assets/right-B3PQUHd5.js +1 -0
- package/dist/client/assets/right-B96CBzrV.js +1 -0
- package/dist/client/assets/right-BPirlFC8.js +1 -0
- package/dist/client/assets/right-BUP2Ro_M.js +1 -0
- package/dist/client/assets/right-BVWYPIFX.js +1 -0
- package/dist/client/assets/right-BoAJxwA3.js +1 -0
- package/dist/client/assets/right-C2aOC2li.js +1 -0
- package/dist/client/assets/right-CtPJjgOV.js +1 -0
- package/dist/client/assets/{right-BvoGOUKH.js → right-DqiVyo8v.js} +1 -1
- package/dist/client/assets/right-SfSu0zHC.js +1 -0
- package/dist/client/assets/{rocket-BQQQv2L5.js → rocket-DnmN_YOD.js} +1 -1
- package/dist/client/assets/{router-C65cZYPn.js → router-B0YclXYg.js} +1 -1
- package/dist/client/assets/{scope-views-BOOmgmwx.js → scope-views-Z8aoAmtU.js} +1 -1
- package/dist/client/assets/scout-voice-DvG_3stJ.js +1 -0
- package/dist/client/assets/{scoutbot-BTIErYHo.js → scoutbot-D4vuKzOL.js} +2 -2
- package/dist/client/assets/scoutbot-markdown-BJJyaPu2.js +6 -0
- package/dist/client/assets/{scroll-text-BuneRiAD.js → scroll-text-DRidbcse.js} +1 -1
- package/dist/client/assets/{search-7_n7CxWl.js → search-BbgsEMXa.js} +1 -1
- package/dist/client/assets/secondaryNavConfig-DyC_P9Wx.js +1 -0
- package/dist/client/assets/{selection-bridge-SlGsgHw2.js → selection-bridge-CpzFGx3-.js} +1 -1
- package/dist/client/assets/{send-horizontal-DP16OOIW.js → send-horizontal-BXo2uz3Z.js} +1 -1
- package/dist/client/assets/{server-pYOMFjrT.js → server-Dt3tpiBj.js} +1 -1
- package/dist/client/assets/{session-catalog-_QfQ7fhZ.js → session-catalog-CUQ8LUJY.js} +1 -1
- package/dist/client/assets/{session-table-CYN8e4s3.js → session-table-B4JOKevn.js} +1 -1
- package/dist/client/assets/settings-BzWCF3NF.js +1 -0
- package/dist/client/assets/{sliders-horizontal-D2Z8gz6J.js → sliders-horizontal-7V8B3xsf.js} +1 -1
- package/dist/client/assets/{sparkles-Bth2iK7t.js → sparkles-ytTwpCbZ.js} +1 -1
- package/dist/client/assets/{sse-CL6gctHY.js → sse-CSozY6mp.js} +1 -1
- package/dist/client/assets/system-surfaces-redesign-QVXNeGYw.css +1 -0
- package/dist/client/assets/{tail-display-BRcJltQa.js → tail-display-DcliDVkW.js} +1 -1
- package/dist/client/assets/{tail-events-NLIWLq27.js → tail-events-CrN-Rmxj.js} +1 -1
- package/dist/client/assets/{terminal-By1Lw2i2.js → terminal-BiNIXhna.js} +1 -1
- package/dist/client/assets/{terminal-relay-CjkI5aUy.js → terminal-relay-pSm7_An6.js} +1 -1
- package/dist/client/assets/{terminal-sessions-AmSgHklm.js → terminal-sessions-D4dHTRkt.js} +1 -1
- package/dist/client/assets/{terminal-takeover-7AvNpnkC.js → terminal-takeover-CtA3wcXh.js} +1 -1
- package/dist/client/assets/{runtime-picker-eDEvx2Mz.js → text-BR9Bap0E.js} +1 -1
- package/dist/client/assets/text-rLpBg4_z.css +1 -0
- package/dist/client/assets/{use-conversation-list-BCzY032j.js → use-conversation-list-C0bEXFeH.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-CJ6-oj5k.js → use-fleet-active-asks-CK4aw-3G.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-D5L-CKe_.js → use-mesh-ops-items-QixBijmT.js} +1 -1
- package/dist/client/assets/use-reduced-motion-BLn59zLn.js +1 -0
- package/dist/client/assets/{use-scout-dev-flags-BohC8seq.js → use-scout-dev-flags-JKb1EhFh.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-RsLUYyeh.js → useAgentHoverCard-6N8b7qsU.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-D-hVKzM9.js +1 -0
- package/dist/client/assets/{usePersistentState-D3M4m2Ou.js → usePersistentState-DOEahRlt.js} +1 -1
- package/dist/client/assets/{usePierreRuntime-B4hbNWTz.js → usePierreRuntime-Bq6mXrgd.js} +1 -1
- package/dist/client/assets/{wrench-M4G7WtYB.js → wrench-CQvdf7KT.js} +1 -1
- package/dist/client/assets/{x-ynOfVadO.js → x-BJyPzFnn.js} +1 -1
- package/dist/client/assets/{xterm-DZHyijPp.js → xterm-D6dE_wMr.js} +1 -1
- package/dist/client/assets/zap-rw7uwZht.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/main.mjs +629 -167
- package/dist/node/main.mjs +454 -270
- package/dist/pairing-runtime-controller.mjs +607 -357
- package/dist/runtime/base-daemon.mjs +384 -21
- package/dist/runtime/broker-daemon.mjs +11024 -10023
- package/dist/runtime/broker-process-manager.mjs +9 -3
- package/dist/runtime/mesh-discover.mjs +9 -3
- package/dist/scout-control-plane-web.mjs +1590 -984
- package/dist/scout-web-server.mjs +1590 -984
- package/package.json +4 -4
- package/dist/client/assets/ActivityScreen-aewI4Ul1.js +0 -1
- package/dist/client/assets/AgentAvatar-DMov24_o.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-BjG6ECjl.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-D4MbSMXp.js +0 -1
- package/dist/client/assets/AgentFloorView-h9KDJdw0.js +0 -1
- package/dist/client/assets/AgentInfoScreen-SjhK_SBh.js +0 -1
- package/dist/client/assets/AgentLaneDetailSheet-DnAKe4e3.js +0 -4
- package/dist/client/assets/AgentLanesEmbedScreen-BNOYF16R.js +0 -1
- package/dist/client/assets/AgentLanesView-Ct-Gz5WD.js +0 -2
- package/dist/client/assets/AgentSessions-CDfSfNiE.js +0 -6
- package/dist/client/assets/AgentsConsole-BVxhBqRa.js +0 -1
- package/dist/client/assets/AgentsSubnav-CiIuzxnZ.js +0 -1
- package/dist/client/assets/BriefingDetailScreen-C83o2YfN.js +0 -6
- package/dist/client/assets/BrokerScreen-DplF8d_X.js +0 -5
- package/dist/client/assets/ChatCollapsedStrip-BRljIymi.js +0 -1
- package/dist/client/assets/ContextMenu-CxkmFQcN.js +0 -1
- package/dist/client/assets/ConversationComposer-CWohCCmn.js +0 -1
- package/dist/client/assets/ConversationFeedRows-IWh0JSIL.js +0 -1
- package/dist/client/assets/ConversationHeader-BxTzXl8e.js +0 -1
- package/dist/client/assets/ConversationPanels-D9UCwNkS.js +0 -2
- package/dist/client/assets/ConversationScreen-oZSitVtX.js +0 -1
- package/dist/client/assets/ConversationScreen-yIKEsm-8.css +0 -1
- package/dist/client/assets/ConversationStatus-B6pAbo2w.js +0 -1
- package/dist/client/assets/DocumentFocusViewer-DRKjNG9s.js +0 -1
- package/dist/client/assets/FleetSearch-CYeWn85V.js +0 -1
- package/dist/client/assets/FleetSearch-EXOe8ulE.css +0 -1
- package/dist/client/assets/FlightObserveScreen-DYJJ3Z2B.js +0 -1
- package/dist/client/assets/HomeHero-BPBArHXa.js +0 -1
- package/dist/client/assets/HomeHero-DEl-WBsT.css +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-BP8tD-Bh.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-B4i1Ut4R.js +0 -1
- package/dist/client/assets/MessageComposerSuggestions-Dfc3PH2y.js +0 -1
- package/dist/client/assets/MessagesScreen-TgSL5KMc.js +0 -1
- package/dist/client/assets/MissionControlView-D629w2A8.js +0 -1
- package/dist/client/assets/MissionFocusOverlay-Bubrr8Gc.js +0 -1
- package/dist/client/assets/MissionLeftAgentRow-DokImu4Y.js +0 -1
- package/dist/client/assets/MissionLogPane-Cs0LuIkn.js +0 -1
- package/dist/client/assets/NewChatComposer-S08F6_La.js +0 -19
- package/dist/client/assets/ObserveEmbedScreen-CHx2sEAA.js +0 -2
- package/dist/client/assets/ObserveTextFlow-_ApDwRCO.js +0 -2
- package/dist/client/assets/ObservedTopologyPanel-ByW7Ar7p.js +0 -2
- package/dist/client/assets/OpenScoutAppShell-DTmnbG-h.js +0 -88
- package/dist/client/assets/OpsAgentsView-DiFuHcJs.js +0 -1
- package/dist/client/assets/OpsScreen-CCR3U_9P.js +0 -1
- package/dist/client/assets/OpsSubnav-CZs_OL2N.js +0 -1
- package/dist/client/assets/PlanView-C54eAzig.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-BEfYOaxc.js +0 -1
- package/dist/client/assets/ProjectAgentProfileHero-B4f_AoCr.js +0 -1
- package/dist/client/assets/ProjectsInbox-DoPZ17FC.js +0 -2
- package/dist/client/assets/ProjectsRail-CWOkZjsY.js +0 -1
- package/dist/client/assets/ProjectsScreen-Dse0Q6p6.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-DMnfyPLE.js +0 -1
- package/dist/client/assets/Provider-DKZWuzSR.js +0 -1
- package/dist/client/assets/RailRow-Cf9LOiEj.css +0 -1
- package/dist/client/assets/RailRow-DIGd3MMM.js +0 -1
- package/dist/client/assets/RawSessionsTable-Zkl4YDvz.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-B_PMJxY_.js +0 -1
- package/dist/client/assets/RepoDiffViewer-VrUJw33u.js +0 -7
- package/dist/client/assets/RepoDiffViewerLazy-BPg_JkYW.js +0 -2
- package/dist/client/assets/ScoutDeckSurface-MbwGp6Ab.js +0 -1
- package/dist/client/assets/ScoutbotBroadcastChip-DAKQKB25.js +0 -2
- package/dist/client/assets/ScoutbotRealtimeVoiceCall-Br4bYVAx.js +0 -1
- package/dist/client/assets/SessionRefScreen-DLZNFZFK.js +0 -1
- package/dist/client/assets/SessionsScreen-D-hN1n4k.js +0 -1
- package/dist/client/assets/SettingsDrawer-BFsnww-k.js +0 -3
- package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +0 -1
- package/dist/client/assets/SettingsScreen-Bc3Xtv5V.js +0 -1
- package/dist/client/assets/Terminal-D_OmdFmr.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-D21ytNXW.js +0 -1
- package/dist/client/assets/WorkFilesViewer-BDMNbxE4.js +0 -1
- package/dist/client/assets/agent-identity-BxCsXnDp.js +0 -1
- package/dist/client/assets/api-h5zurxmi.js +0 -1
- package/dist/client/assets/broker-display-pp33bLsu.js +0 -2
- package/dist/client/assets/collapsed-strip-Dz-of2SM.css +0 -1
- package/dist/client/assets/content-B-SUUhXj.js +0 -1
- package/dist/client/assets/content-BRY2vo1_.js +0 -1
- package/dist/client/assets/content-BTm0mVyD.js +0 -1
- package/dist/client/assets/content-BTqvyb5E.js +0 -1
- package/dist/client/assets/content-BjDaXmSD.js +0 -1
- package/dist/client/assets/content-BrR6deGh.js +0 -1
- package/dist/client/assets/content-C5yvBEMy.js +0 -1
- package/dist/client/assets/content-CkhG__-v.js +0 -1
- package/dist/client/assets/content-CudIBsiP.js +0 -1
- package/dist/client/assets/content-DBb7ppd5.js +0 -1
- package/dist/client/assets/content-DEw_kGyK.js +0 -1
- package/dist/client/assets/content-DIy0DCzK.js +0 -1
- package/dist/client/assets/content-THl9hRAo.js +0 -1
- package/dist/client/assets/content-vi9FbmV9.js +0 -1
- package/dist/client/assets/content-wcgPMGVf.js +0 -1
- package/dist/client/assets/conversation-model-CHwHZNw-.js +0 -1
- package/dist/client/assets/conversation-motion-features-zU0k3Agz.js +0 -1
- package/dist/client/assets/ctx-panel-B4s49N9e.css +0 -1
- package/dist/client/assets/discover-NDAqNvKt.js +0 -2
- package/dist/client/assets/embed-entry-BVR09F6e.js +0 -2
- package/dist/client/assets/home-moving-signal-C8dTXieA.js +0 -1
- package/dist/client/assets/home-moving-signal-CAa0V91u.css +0 -1
- package/dist/client/assets/home-now-card-BgvVcE83.js +0 -1
- package/dist/client/assets/hooks-DBIezYS2.js +0 -2
- package/dist/client/assets/index-BMwKgdz_.js +0 -1
- package/dist/client/assets/index-Bu-fckyR.css +0 -1
- package/dist/client/assets/index-BxoufAPA.js +0 -1
- package/dist/client/assets/index-Cj7NnSxI.js +0 -1
- package/dist/client/assets/index-CvF09yvf.css +0 -1
- package/dist/client/assets/index-o4FKpU7Z.js +0 -10
- package/dist/client/assets/inspector-panel-Dy2cVTCi.js +0 -2
- package/dist/client/assets/left-BC7p5QbT.js +0 -1
- package/dist/client/assets/left-BCSGqccQ.js +0 -1
- package/dist/client/assets/left-BSyj8PuJ.js +0 -2
- package/dist/client/assets/left-Bk3XnxPD.css +0 -1
- package/dist/client/assets/left-CCoobxPS.css +0 -1
- package/dist/client/assets/left-DDnxNUxd.js +0 -1
- package/dist/client/assets/left-DLoDKxT5.js +0 -2
- package/dist/client/assets/left-O-TBH7JB.js +0 -1
- package/dist/client/assets/left-agents-Dk9Y89lb.js +0 -1
- package/dist/client/assets/left-default-B3JBRQNJ.js +0 -1
- package/dist/client/assets/left-lanes-30Oe_3RM.js +0 -1
- package/dist/client/assets/left-mission-DEl4-7xu.js +0 -1
- package/dist/client/assets/left-plan-B4qdm4Gn.js +0 -2
- package/dist/client/assets/left-rvUOB14X.js +0 -1
- package/dist/client/assets/library-DDKSLFJ_.js +0 -1
- package/dist/client/assets/mentions-CvDaviLJ.js +0 -1
- package/dist/client/assets/mission-control-m3BTDQ9l.css +0 -1
- package/dist/client/assets/model-Co0zkMIc.js +0 -1
- package/dist/client/assets/plan-view-D56fneVF.css +0 -1
- package/dist/client/assets/profile-DW80Gn5k.js +0 -1
- package/dist/client/assets/projects-inbox-DCeD3FfV.js +0 -1
- package/dist/client/assets/resolve-panes-BDi9Qx4R.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-HE-5eZYa.js +0 -1
- package/dist/client/assets/right-BDf_yTv6.js +0 -1
- package/dist/client/assets/right-C-bgjYg-.js +0 -1
- package/dist/client/assets/right-C3JdEfYQ.js +0 -1
- package/dist/client/assets/right-CYIs2tEe.js +0 -1
- package/dist/client/assets/right-CyRCv6Up.js +0 -1
- package/dist/client/assets/right-DBYGtoRv.js +0 -1
- package/dist/client/assets/right-o3LHMiKa.js +0 -1
- package/dist/client/assets/right-oPrcx9MX.js +0 -1
- package/dist/client/assets/right-sSvBUK-j.js +0 -1
- package/dist/client/assets/runtime-picker-vhm0gtLs.css +0 -1
- package/dist/client/assets/scout-voice-B7kXlkcl.js +0 -1
- package/dist/client/assets/secondaryNavConfig-CSFDCQAf.js +0 -1
- package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +0 -1
- package/dist/client/assets/text-DsBWV_4k.js +0 -1
- package/dist/client/assets/use-reduced-motion-CqXpVXv-.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-DOr5yHbT.js +0 -1
- /package/dist/client/assets/{document-focus-viewer-BSC_JwVE.css → DocumentFocusViewer-BSC_JwVE.css} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as p,j as s}from"./index-Bli6bTLU.js";import{u as R,s as v,a as b}from"./mesh-view-store-Cpqil_2D.js";import{u as E}from"./local-agents-BMadXuP1.js";import{n as _,b as B,a as P}from"./colors-BtO5_zlx.js";import{a as g}from"./api-DEHEgJ9m.js";import{t as U}from"./time-Dhsh_2EG.js";/* empty css *//* empty css */import"./Provider-Ve8yXaWR.js";import"./provider-CX9EWecp.js";import"./router-B0YclXYg.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./sse-CSozY6mp.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./createLucideIcon-DLlxGjKt.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./file-text-BVhkMWyC.js";import"./x-BJyPzFnn.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-7iEtvu9P.js";import"./NewChatComposer-Bgqes0UQ.js";import"./text-BR9Bap0E.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DoT8gpw6.js";import"./conversation-model-CigSPlKA.js";import"./index-DFdlQs_c.js";import"./HarnessMark-DGZ6o6Ct.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./chevron-down-Da5tV19_.js";import"./search-BbgsEMXa.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";function D(e){return e.issues.some(t=>t.code==="mesh_loopback")?"loopback":e.identity.discoverable?"discoverable":e.tailscale.available?e.tailscale.running?"local-only":"tailnet-stopped":"unavailable"}function F(e){const t=new Map;for(const i of e){const r=(i.harness??i.agentClass??"agent").toLowerCase(),c=t.get(r)??{total:0,working:0};c.total+=1,P(i.state)&&(c.working+=1),t.set(r,c)}return Array.from(t.entries()).map(([i,r])=>({label:i,total:r.total,working:r.working})).sort((i,r)=>r.total-i.total).slice(0,6)}function S(e){return e?e.replace(/^https?:\/\//,"").split("/")[0]??e:"Unavailable"}function z(e){return e.split("/")[0]}function H(e){return new Promise(t=>window.setTimeout(t,e))}async function T(e,t){let i=null,r=null;for(let c=0;c<=t.attempts;c+=1){try{if(i=await g("/api/mesh"),v(i),e(i))return i}catch(u){r=u}c<t.attempts&&await H(t.intervalMs)}if(i)return i;throw r instanceof Error?r:new Error("Mesh status is temporarily unavailable.")}function W(e){return e.issues.find(t=>t.code==="local_only"||t.code==="mesh_loopback"||t.code==="tailscale_stopped")?.summary??null}function Is(){const{meshSnapshot:e,selectedId:t,selectedType:i,probeCache:r}=R(),{agents:c}=E(),[u,f]=p.useState(!1),[C,k]=p.useState(!1),[x,h]=p.useState(null),A=p.useCallback(async()=>{f(!0),h({tone:"info",text:"Restarting broker with mesh discovery enabled..."});try{const l=await g("/api/mesh/announce",{method:"POST",body:"{}"});v(l);const a=l.identity.discoverable?l:await T(n=>n.identity.discoverable,{attempts:6,intervalMs:750});a.identity.discoverable?h({tone:"success",text:`Discoverable at ${S(a.identity.announceUrl??a.brokerUrl)}.`}):h({tone:"warning",text:W(a)??"Scout restarted the broker, but it is not discoverable yet."})}catch(l){h({tone:"error",text:l instanceof Error?l.message:String(l)})}finally{f(!1)}},[]),M=p.useCallback(async()=>{k(!0),h({tone:"info",text:"Opening Tailscale and waiting for the backend..."});try{const l=await g("/api/mesh/tailscale",{method:"POST",body:JSON.stringify({action:"open_app"})});v(l);const a=l.tailscale.running?l:await T(n=>n.tailscale.running,{attempts:12,intervalMs:1e3});a.tailscale.running?h({tone:"success",text:`Tailscale is running with ${a.tailscale.onlineCount} online peer${a.tailscale.onlineCount===1?"":"s"}.`}):h({tone:"warning",text:`Tailscale opened, but the backend is still ${a.tailscale.backendState??"not running"}. Finish startup or sign-in in Tailscale.app.`})}catch(l){h({tone:"error",text:l instanceof Error?l.message:String(l)})}finally{k(!1)}},[]),y=p.useMemo(()=>{const l={total:c.length,working:0,ready:0,notReady:0};for(const a of c){const n=_(a.state);n==="in_turn"||n==="in_flight"?l.working+=1:n==="callable"?l.ready+=1:l.notReady+=1}return l},[c]),w=p.useMemo(()=>F(c),[c]);if(!e)return s.jsx("div",{className:"sys-inspector-empty",children:s.jsx("p",{children:"Loading mesh…"})});if(t?.startsWith("tailnet:")&&i==="node"){const l=t.slice(8),a=e.tailscale.peers.find(m=>m.id===l),n=r[t]??null,d=a?.addresses?.[0]?z(a.addresses[0]):null,N=a?.hostName?.split(".")[0]??a?.hostName??"Tailnet peer";return s.jsxs("div",{className:"sys-inspector-content",children:[s.jsxs("div",{className:"sys-inspector-head",children:[s.jsx("h3",{className:"sys-inspector-title",children:N}),s.jsx("span",{className:`sys-chip sys-chip-${a?.online?"success":"failed"}`,children:a?.online?"Online":"Offline"})]}),s.jsxs("div",{className:"sys-detail-grid",children:[d&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Address"}),s.jsx("code",{className:"sys-detail-value",children:d})]}),a?.os&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Platform"}),s.jsx("span",{className:"sys-detail-value",children:a.os})]}),n?.result?.node?.meshId&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Mesh ID"}),s.jsxs("code",{className:"sys-detail-value",children:[n.result.node.meshId.slice(0,14),"…"]})]}),n?.result?.node?.name&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Node name"}),s.jsx("span",{className:"sys-detail-value",children:n.result.node.name})]})]}),(!n||n.status==="loading")&&s.jsx("div",{className:"sys-banner sys-banner-muted",style:{marginTop:8},children:s.jsx("span",{children:"Connecting to Scout broker…"})}),n?.status==="error"&&s.jsxs("div",{className:"sys-banner sys-banner-warning",style:{marginTop:8},children:[s.jsx("strong",{children:"Broker unreachable."}),s.jsx("span",{children:n.result?.error??"Could not reach the remote broker."})]}),n?.status==="done"&&n.result?.node?.capabilities?.length&&s.jsxs("div",{style:{marginTop:10},children:[s.jsx("div",{className:"sys-inspector-section-label",children:"Capabilities"}),s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:n.result.node.capabilities.map(m=>s.jsx("span",{className:"sys-chip sys-chip-neutral",children:m},m))})]}),n?.status==="done"&&n.result?.home&&s.jsxs("div",{style:{marginTop:14},children:[s.jsxs("div",{className:"sys-inspector-section-label",children:["Agents — ",n.result.home.agents.length," registered"]}),n.result.home.agents.length===0?s.jsx("div",{className:"sys-list-empty",style:{marginTop:4},children:s.jsx("p",{children:"No agents registered on this broker."})}):s.jsx("div",{className:"mesh-agent-table",style:{marginTop:4},children:n.result.home.agents.map(m=>{const j=B(m.state);return s.jsxs("div",{className:"mesh-detail-agent",style:{padding:"4px 0"},children:[s.jsx("span",{className:`mesh-detail-dot mesh-detail-dot--${j}`}),s.jsxs("div",{className:"mesh-detail-agent-body",children:[s.jsx("span",{className:"mesh-detail-agent-name",style:{fontSize:12},children:m.title}),m.activeTask&&s.jsx("span",{className:"mesh-detail-agent-task",children:m.activeTask})]}),s.jsx("span",{className:`mesh-detail-agent-state mesh-detail-agent-state--${j}`,children:m.statusLabel||j})]},m.id)})})]}),s.jsx("button",{type:"button",className:"s-btn",style:{marginTop:14},onClick:()=>b(null,null),children:"Clear selection"})]})}if(t&&i==="node"){const a=Object.values(e.nodes).find(d=>d.id===t)??(e.localNode?.id===t?e.localNode:null),n=e.localNode?.id===t;return a?s.jsxs("div",{className:"sys-inspector-content",children:[s.jsxs("div",{className:"sys-inspector-head",children:[s.jsx("h3",{className:"sys-inspector-title",children:a.hostName?.split(".")[0]??a.name??"Node"}),n&&s.jsx("span",{className:"sys-chip sys-chip-neutral",children:"this broker"})]}),s.jsxs("div",{className:"sys-detail-grid",children:[s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Node ID"}),s.jsxs("code",{className:"sys-detail-value",children:[a.id.slice(0,16),"…"]})]}),a.brokerUrl&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Broker URL"}),s.jsx("code",{className:"sys-detail-value",children:S(a.brokerUrl)})]}),a.hostName&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Host"}),s.jsx("span",{className:"sys-detail-value",children:a.hostName})]}),!n&&"lastSeenAt"in a&&typeof a.lastSeenAt=="number"&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Last seen"}),s.jsx("span",{className:"sys-detail-value",children:U(a.lastSeenAt)})]}),!n&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Scope"}),s.jsx("span",{className:"sys-detail-value",children:a.advertiseScope==="mesh"?"Announced to mesh":"Local only"})]})]}),n&&e.issues.length>0&&s.jsx("div",{className:"sys-issue-grid",style:{marginTop:12},children:e.issues.map((d,N)=>s.jsxs("article",{className:`sys-issue-card sys-issue-card-${d.severity==="error"?"error":"warning"}`,children:[s.jsx("div",{className:"sys-issue-head",children:s.jsx("h3",{className:"sys-issue-title",children:d.title})}),s.jsx("p",{className:"sys-issue-body",children:d.summary}),d.actionCommand&&s.jsx("div",{className:"sys-issue-action",children:s.jsx("code",{className:"sys-code-inline",children:d.actionCommand})})]},N))}),s.jsx("button",{type:"button",className:"s-btn",style:{marginTop:12},onClick:()=>b(null,null),children:"Clear selection"})]}):s.jsxs("div",{className:"sys-inspector-empty",children:[s.jsx("p",{children:"Node not found."}),s.jsx("button",{type:"button",className:"s-btn",onClick:()=>b(null,null),children:"Clear"})]})}const o=e,L=D(o),$=Object.values(o.nodes).filter(l=>l.id!==o.localNode?.id).length,I=o.tailscale.onlineCount??0,O=o.localNode?.hostName?.split(".")[0]??o.localNode?.name??o.identity.name??"this broker";return s.jsxs("div",{className:"sys-inspector-content mesh-summary",children:[s.jsxs("div",{className:"sys-inspector-head",children:[s.jsx("h3",{className:"sys-inspector-title",children:O}),s.jsx("span",{className:"mesh-summary-mode",children:o.identity.modeLabel})]}),s.jsx("section",{className:"mesh-summary-section",children:s.jsxs("div",{className:"mesh-summary-counts",children:[s.jsxs("div",{className:"mesh-summary-count",children:[s.jsx("span",{className:"mesh-summary-count-value",children:y.total}),s.jsx("span",{className:"mesh-summary-count-label",children:"agents"})]}),s.jsxs("div",{className:"mesh-summary-count mesh-summary-count--working",children:[s.jsx("span",{className:"mesh-summary-count-value",children:y.working}),s.jsx("span",{className:"mesh-summary-count-label",children:"working"})]}),s.jsxs("div",{className:"mesh-summary-count",children:[s.jsx("span",{className:"mesh-summary-count-value",children:y.ready}),s.jsx("span",{className:"mesh-summary-count-label",children:"ready"})]}),s.jsxs("div",{className:"mesh-summary-count mesh-summary-count--offline",children:[s.jsx("span",{className:"mesh-summary-count-value",children:y.notReady}),s.jsx("span",{className:"mesh-summary-count-label",children:"not ready"})]})]})}),w.length>0&&s.jsxs("section",{className:"mesh-summary-section",children:[s.jsx("div",{className:"sys-inspector-section-label",children:"By harness"}),s.jsx("div",{className:"mesh-summary-harness",children:w.map(l=>s.jsxs("div",{className:"mesh-summary-harness-row",children:[s.jsx("span",{className:"mesh-summary-harness-name",children:l.label}),s.jsx("span",{className:"mesh-summary-harness-count",children:l.total}),l.working>0&&s.jsxs("span",{className:"mesh-summary-harness-working",children:[l.working," working"]})]},l.label))})]}),s.jsxs("section",{className:"mesh-summary-section",children:[s.jsx("div",{className:"sys-inspector-section-label",children:"Peers"}),s.jsxs("div",{className:"mesh-summary-peers",children:[s.jsxs("div",{className:"mesh-summary-peer-row",children:[s.jsx("span",{className:"mesh-summary-peer-label",children:"Mesh"}),s.jsx("span",{className:"mesh-summary-peer-value",children:$})]}),o.tailscale.available&&s.jsxs("div",{className:"mesh-summary-peer-row",children:[s.jsx("span",{className:"mesh-summary-peer-label",children:"Tailnet"}),s.jsx("span",{className:`mesh-summary-peer-value${o.tailscale.running?"":" mesh-summary-peer-value--dim"}`,children:o.tailscale.running?`${I} online`:"stopped"})]})]})]}),s.jsxs("section",{className:"mesh-summary-section mesh-summary-reach",children:[s.jsx("div",{className:"sys-inspector-section-label",children:"Reach"}),s.jsx(J,{state:L,tailscaleAvailable:o.tailscale.available,announcing:u,tailscaleBusy:C,onAnnounce:()=>{A()},onStartTailscale:()=>{M()}}),x&&s.jsx("div",{className:`sys-banner mesh-action-message sys-banner-${x.tone}`,children:s.jsx("span",{children:x.text})})]})]})}function J({state:e,tailscaleAvailable:t,announcing:i,tailscaleBusy:r,onAnnounce:c,onStartTailscale:u}){return e==="discoverable"?s.jsxs("div",{className:"mesh-reach mesh-reach--on",children:[s.jsx("span",{className:"mesh-reach-dot"}),s.jsx("span",{className:"mesh-reach-label",children:"Discoverable on mesh"})]}):e==="tailnet-stopped"?s.jsxs("div",{className:"mesh-reach",children:[s.jsxs("div",{className:"mesh-reach-row",children:[s.jsx("span",{className:"mesh-reach-dot mesh-reach-dot--off"}),s.jsx("span",{className:"mesh-reach-label",children:"Tailscale stopped"})]}),s.jsx("button",{type:"button",className:"s-btn mesh-reach-action",disabled:r,onClick:u,children:r?"Opening…":"Start Tailscale"})]}):e==="loopback"?s.jsxs("div",{className:"mesh-reach",children:[s.jsxs("div",{className:"mesh-reach-row",children:[s.jsx("span",{className:"mesh-reach-dot mesh-reach-dot--off"}),s.jsx("span",{className:"mesh-reach-label",children:"Announcement broken"})]}),s.jsx("button",{type:"button",className:"s-btn mesh-reach-action",disabled:i,onClick:c,children:i?"Fixing…":"Fix announcement"})]}):e==="unavailable"?s.jsxs("div",{className:"mesh-reach mesh-reach--neutral",children:[s.jsx("span",{className:"mesh-reach-dot mesh-reach-dot--off"}),s.jsx("span",{className:"mesh-reach-label",children:"Local only — no tailnet on this host"})]}):s.jsxs("div",{className:"mesh-reach",children:[s.jsxs("div",{className:"mesh-reach-row",children:[s.jsx("span",{className:"mesh-reach-dot mesh-reach-dot--off"}),s.jsx("span",{className:"mesh-reach-label",children:"Local only"})]}),s.jsx("button",{type:"button",className:"s-btn s-btn-primary mesh-reach-action",disabled:i||!t,onClick:c,children:i?"Announcing…":"Make discoverable"})]})}export{Is as MeshInspectorPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as d,j as e}from"./index-Bli6bTLU.js";import{u as k}from"./Provider-Ve8yXaWR.js";import{c as y}from"./colors-BtO5_zlx.js";import{A as S}from"./AgentAvatar-B1xvQ7ej.js";import{t as N}from"./time-Dhsh_2EG.js";import{f as w}from"./text-BR9Bap0E.js";import{c as I}from"./clipboard-e3fSpeo7.js";import{f as T,r as C,t as R}from"./terminal-sessions-D4dHTRkt.js";import"./provider-CX9EWecp.js";import"./router-B0YclXYg.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./api-DEHEgJ9m.js";import"./sse-CSozY6mp.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./createLucideIcon-DLlxGjKt.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./file-text-BVhkMWyC.js";import"./x-BJyPzFnn.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-7iEtvu9P.js";import"./NewChatComposer-Bgqes0UQ.js";import"./conversation-model-CigSPlKA.js";import"./index-DFdlQs_c.js";import"./HarnessMark-DGZ6o6Ct.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./chevron-down-Da5tV19_.js";import"./search-BbgsEMXa.js";import"./loader-circle-DoT8gpw6.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./SpriteAvatar-DMrSssNZ.js";import"./agent-identity-DzHGhLdJ.js";import"./voice-levels-Dcr3jglk.js";function ge(){const{route:t,agents:o,navigate:s}=k();if(t.view!=="terminal")return null;const r=t.agentId?o.find(i=>i.id===t.agentId)??null:null,l=t.mode??"takeover",[f,p]=d.useState(null);d.useEffect(()=>{if(t.view!=="terminal"||t.agentId||!t.terminalSurfaceKey){p(null);return}let i=!1;return T().then(g=>{i||p(C(g,t.terminalSessionId,t.terminalSurfaceKey))}).catch(()=>{i||p(null)}),()=>{i=!0}},[t.agentId,t.terminalSessionId,t.terminalSurfaceKey,t.view]);const j=f?R(f.surface):null,n=(r?$(r):null)??j,c=d.useMemo(()=>n?A(n):null,[n]);return r?e.jsxs("div",{className:"flex h-full flex-col gap-4 overflow-y-auto p-4 text-sm frame-scrollbar",children:[e.jsx(D,{agent:r}),e.jsxs(u,{label:"Terminal",children:[e.jsx(a,{label:"Mode",value:v(l)}),e.jsx(a,{label:"Backend",value:n?.backend??"pty"}),n&&e.jsx(a,{label:"Session",value:n.sessionName}),n?.paneId&&e.jsx(a,{label:"Pane",value:n.paneId}),e.jsx(a,{label:"State",value:y(r.state)})]}),c&&e.jsx(h,{label:"Open in your own terminal",command:c}),e.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[n&&e.jsx(m,{active:l==="observe",label:"Observe",onClick:()=>s(b(r.id,"observe"))}),e.jsx(m,{active:l==="takeover",label:"Takeover",onClick:()=>s(b(r.id,"takeover"))}),e.jsx(m,{label:"Profile",onClick:()=>s({view:"agents-v2",agentId:r.id,tab:"profile"})}),e.jsx(m,{label:"Trace",onClick:()=>s({view:"agents-v2",agentId:r.id,tab:"observe"})})]}),e.jsxs(u,{label:"Agent",children:[e.jsx(a,{label:"Harness",value:r.harness??"-"}),e.jsx(a,{label:"Transport",value:r.transport??"-"}),r.role&&e.jsx(a,{label:"Role",value:w(r.role)??r.role}),r.handle&&e.jsx(a,{label:"Handle",value:`@${r.handle}`}),r.updatedAt&&e.jsx(a,{label:"Updated",value:N(r.updatedAt)})]}),(r.project||r.branch||r.cwd||r.projectRoot)&&e.jsxs(u,{label:"Workspace",children:[r.project&&e.jsx(a,{label:"Name",value:r.project}),r.branch&&e.jsx(a,{label:"Branch",value:r.branch}),r.cwd&&e.jsx(a,{label:"Cwd",value:r.cwd}),!r.cwd&&r.projectRoot&&e.jsx(a,{label:"Root",value:r.projectRoot})]})]}):e.jsxs("div",{className:"flex h-full flex-col gap-4 overflow-y-auto p-4 text-sm frame-scrollbar",children:[e.jsxs(u,{label:"Terminal",children:[e.jsx(a,{label:"Mode",value:v(l)}),t.agentId&&e.jsx(a,{label:"Agent",value:t.agentId}),n&&e.jsx(a,{label:"Backend",value:n.backend}),n&&e.jsx(a,{label:"Session",value:n.sessionName})]}),c&&e.jsx(h,{label:"Open in your own terminal",command:c})]})}function x(t){return/^[A-Za-z0-9_./:@%+=,-]+$/u.test(t)?t:`'${t.replace(/'/gu,"'\\''")}'`}function A(t){return t.backend==="tmux"?`tmux attach -t ${x(t.sessionName)}`:`${t.socketDir?`ZELLIJ_SOCKET_DIR=${x(t.socketDir)} `:""}zellij attach ${x(t.sessionName)}`}function b(t,o){return{view:"terminal",agentId:t,mode:o}}function $(t){return t.terminalSurface?t.terminalSurface:t.transport==="tmux"&&t.harnessSessionId?{backend:"tmux",sessionName:t.harnessSessionId,paneId:null,socketDir:null}:null}function v(t){return t==="observe"?"Read-only observe":"Interactive takeover"}function D({agent:t}){return e.jsx("div",{className:"border-b border-[var(--scout-chrome-border-soft)] pb-3",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(S,{agent:t,placement:"row",size:32,presence:!1}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-lg leading-snug text-[var(--scout-chrome-ink-strong)]",children:t.name}),t.handle&&e.jsxs("div",{className:"truncate font-mono text-xs text-cyan-400/70",children:["@",t.handle]})]})]})})}function m({active:t,label:o,onClick:s}){return e.jsx("button",{type:"button",onClick:s,className:`h-7 rounded border px-2 font-mono text-2xs uppercase tracking-[0.1em] transition-colors ${t?"border-cyan-400/35 bg-cyan-400/[0.12] text-cyan-200":"border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)] text-[var(--scout-chrome-ink-soft)] hover:bg-[var(--scout-chrome-active)] hover:text-[var(--scout-chrome-ink)]"}`,children:o})}function h({label:t,command:o}){const[s,r]=d.useState(!1);return e.jsxs("details",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)] p-2",children:[e.jsx("summary",{className:"cursor-pointer select-none font-mono text-2xs uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)]",children:t}),e.jsx("div",{className:"mb-1.5 mt-2 flex items-center justify-end gap-2",children:e.jsx("button",{type:"button",className:"rounded border border-cyan-400/20 bg-cyan-400/[0.08] px-2 py-1 font-mono text-2xs uppercase tracking-[0.1em] text-cyan-100/80 hover:bg-cyan-400/[0.14]",onClick:()=>{I(o).then(l=>{l&&(r(!0),window.setTimeout(()=>r(!1),1200))})},children:s?"Copied":"Copy"})}),e.jsx("code",{className:"block select-text break-all rounded bg-black/25 p-2 font-mono text-xs leading-relaxed text-[var(--scout-chrome-ink)]",children:o})]})}function u({label:t,children:o}){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"mb-1.5 text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)]",children:t}),o]})}function a({label:t,value:o}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-2 py-0.5",children:[e.jsx("span",{className:"shrink-0 text-xs font-mono uppercase tracking-wider text-[var(--scout-chrome-ink-faint)]",children:t}),e.jsx("span",{className:"truncate text-right text-sm font-mono text-[var(--scout-chrome-ink)]",children:o})]})}export{ge as TerminalInspector};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as d,j as s}from"./index-
|
|
1
|
+
import{r as d,j as s}from"./index-Bli6bTLU.js";/* empty css */import{a as P}from"./api-DEHEgJ9m.js";import{u as U,a as $,b as M,c as H,r as X,w as V,f as o,d as Y,e as _,t as z,g as Q,h as Z,i as ss,s as es}from"./ui-LM8pS8qE.js";import{B as as,u as ns}from"./selection-bridge-CpzFGx3-.js";function ts(n){return n.error!=null?{label:"SCAN ERR",cls:"err"}:n.status.conflicts>0?{label:"CONFLICT",cls:"conflict"}:n.status.clean?{label:"CLEAN",cls:"clean"}:{label:"DIRTY",cls:"dirty"}}function cs(n){const t=(n.state??"").toLowerCase();return t==="active"?"ACTIVE":t==="idle"?"IDLE":t==="waiting"?"WAITING":"—"}function ls(n){const t=n.lastIndexOf("/");return t<0?{dir:"",file:n}:{dir:n.slice(0,t+1),file:n.slice(t+1)}}function is(n){return n.status.clean?"clean":`staged ${n.status.staged}, unstaged ${n.status.unstaged}, untracked ${n.status.untracked}, conflicts ${n.status.conflicts}, changed files ${n.status.changedFiles}`}function rs(n,t,u){const l=["Operator request:",n,"","Repo Watch context:",`- Project: ${u.name}`,`- Project root: ${u.root}`,`- Project attention: ${u.attention}`,`- Worktree: ${t.path}`,`- Branch: ${t.branch.name??t.branch.head??"detached"}`];t.branch.upstream&&l.push(`- Upstream: ${t.branch.upstream}`),l.push(`- Drift: ahead ${t.branch.ahead}, behind ${t.branch.behind}`,`- Status: ${is(t)}`);const p=M(t),i=H(t);if(p.has&&l.push(`- Branch churn: +${p.add} -${p.del}`),i.has&&l.push(`- Working-tree churn: +${i.add} -${i.del}`),t.attentionReasons.length>0&&l.push(`- Attention reasons: ${t.attentionReasons.join("; ")}`),t.status.files.length>0){const T=t.status.files.slice(0,8).map(h=>`${h.status}: ${h.path}`).join(", ");l.push(`- Changed files: ${T}`)}return l.join(`
|
|
2
2
|
`)}function ds({worktree:n,project:t,generatedAt:u}){const[l,p]=d.useState(""),[i,T]=d.useState("scout"),[h,k]=d.useState(!1),[R,g]=d.useState(null),[O,A]=d.useState(null),[B,K]=d.useState(!1),x=d.useMemo(()=>n?U(n):[],[n]),E=d.useMemo(()=>x.slice(0,8),[x]),I=d.useMemo(()=>{if(i==="scout")return"Scout";const e=i.replace(/^agent:/,""),c=E.find(m=>m.id===e);return c?$(c):"Agent"},[E,i]);async function w(){const e=l.trim();if(!(!e||h||!n||!t)){k(!0),g(null),A(null);try{const c=rs(e,n,t);if(i==="scout")await P("/api/send",{method:"POST",body:JSON.stringify({body:c})}),g("Sent to Scout");else{const m=i.replace(/^agent:/,"");await P("/api/ask",{method:"POST",body:JSON.stringify({body:c,targetAgentId:m,targetLabel:m,metadata:{source:"repo-watch",originSurface:"repo-watch",handoffKind:"repo-watch-agent-ask",targetAgentId:m}})}),g(`Sent to ${I}`)}p("")}catch(c){A(c instanceof Error?c.message:String(c))}finally{k(!1)}}}if(!n||!t)return s.jsx("aside",{className:"rw-ctx","aria-label":"Worktree detail",children:s.jsxs("div",{className:"rw-ctx-empty",children:[s.jsx("span",{className:"eb",children:"CONTEXT · WORKTREE"}),s.jsx("span",{className:"msg",children:"Select a worktree to inspect"})]})});const a=n,r=a.branch,N=5,f=x.length+a.sessions.length,b=!B&&f>N,y=b?x.slice(0,N):x,D=b?a.sessions.slice(0,Math.max(0,N-y.length)):a.sessions,q=f-y.length-D.length,L=ts(a),j=M(a),v=H(a),{add:S,del:C,has:G}=X(a),W=S+C||1,F=[{label:"staged",n:a.status.staged},{label:"unstaged",n:a.status.unstaged},{label:"untracked",n:a.status.untracked},{label:"conflicts",n:a.status.conflicts,cls:"conf"}].filter(e=>e.n>0);return s.jsxs("aside",{className:"rw-ctx","aria-label":"Worktree detail",children:[s.jsxs("div",{className:"ctx-h",children:[s.jsx("div",{className:"ctx-eyebrow",children:s.jsx("span",{children:"CONTEXT · WORKTREE"})}),s.jsxs("div",{className:"ctx-repo",children:[s.jsx("span",{className:"dot "+V(a)}),s.jsx("span",{className:"rn",children:t.name}),s.jsx("span",{className:"ctx-state "+L.cls,children:L.label})]}),s.jsx("div",{className:"ctx-branch",children:s.jsx(as,{branch:r,fallback:a.name})}),s.jsxs("div",{className:"ctx-path",children:[a.path,r.upstream?s.jsxs("span",{className:"ref",children:[" · ",r.upstream]}):null]})]}),s.jsxs("div",{className:"ctx-stats",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"v"+(r.ahead>0?" mint":" dim"),children:["↑",r.ahead]}),s.jsx("div",{className:"k",children:"AHEAD"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"v"+(r.behind>0?" amber":" dim"),children:["↓",r.behind]}),s.jsx("div",{className:"k",children:"BEHIND"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"v"+(a.status.changedFiles>0?"":" dim"),children:a.status.changedFiles}),s.jsx("div",{className:"k",children:"FILES"})]})]}),F.length>0?s.jsx("div",{className:"ctx-breakdown",children:F.map(e=>s.jsxs("span",{className:"ctx-chip"+(e.cls?" "+e.cls:""),children:[s.jsx("span",{className:"n",children:e.n}),e.label]},e.label))}):null,s.jsxs("div",{className:"ctx-body",children:[a.attentionReasons.length>0?s.jsxs("div",{className:"ctx-sec",children:[s.jsxs("div",{className:"ctx-sec-h",children:[s.jsx("span",{children:"ATTENTION"}),s.jsx("span",{className:"n",children:a.attentionReasons.length})]}),s.jsx("div",{className:"ctx-why",children:a.attentionReasons.map((e,c)=>s.jsx("span",{className:"pill",children:e},c))})]}):null,a.error?s.jsxs("div",{className:"ctx-sec",children:[s.jsx("div",{className:"ctx-sec-h",children:s.jsx("span",{children:"SCAN ERROR"})}),s.jsx("div",{className:"ctx-err",children:a.error})]}):null,s.jsxs("div",{className:"ctx-sec",children:[s.jsxs("div",{className:"ctx-sec-h",children:[s.jsx("span",{children:"CHURN"}),s.jsx("span",{className:"n",children:j.has?"reviewable":"working tree"})]}),G?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ctx-churn",children:[s.jsxs("span",{className:"nums",children:[s.jsxs("span",{className:"add",children:["+",o(S)]}),s.jsx("span",{className:"sl",children:"/"}),s.jsxs("span",{className:"del",children:["−",o(C)]})]}),s.jsxs("span",{className:"cbar",title:`+${o(S)} −${o(C)}`,children:[s.jsx("span",{className:"g",style:{width:S/W*100+"%"}}),s.jsx("span",{className:"r",style:{width:C/W*100+"%"}})]})]}),s.jsxs("span",{className:"ctx-churn-clean",children:[j.has?`branch +${o(j.add)} −${o(j.del)}`:null,j.has&&v.has?" · ":null,v.has?`working tree +${o(v.add)} −${o(v.del)}`:null]})]}):s.jsx("div",{className:"ctx-churn-clean",children:a.status.clean?"working tree clean":"no line changes"})]}),a.status.files.length>0?s.jsxs("div",{className:"ctx-sec",children:[s.jsxs("div",{className:"ctx-sec-h",children:[s.jsx("span",{children:"FILES CHANGED"}),s.jsx("span",{className:"n",children:a.status.files.length})]}),a.status.files.map(e=>{const c=Y(e.status),{dir:m,file:J}=ls(e.path);return s.jsxs("div",{className:"ctx-fchg",children:[s.jsx("span",{className:"badge",style:{color:Q(c),background:z(c)},title:e.status,children:_(e.status)}),s.jsxs("span",{className:"fp",title:e.path,children:[s.jsx("span",{className:"dir",children:m}),J]})]},e.path)})]}):null,s.jsxs("div",{className:"ctx-sec",children:[s.jsx("div",{className:"ctx-sec-h",children:s.jsx("span",{children:"LAST COMMIT"})}),s.jsx("div",{className:"ctx-commit",children:a.lastCommitAt!=null||r.head?s.jsxs(s.Fragment,{children:[r.head?s.jsx("span",{className:"hash",children:r.head.slice(0,7)}):null,s.jsxs("span",{className:"t",children:[Z(a.lastCommitAt,u)," ago"]})]}):s.jsx("span",{className:"none",children:"no commit data"})})]}),s.jsxs("div",{className:"ctx-sec",children:[s.jsxs("div",{className:"ctx-sec-h",children:[s.jsx("span",{children:"ATTACHED SESSIONS"}),s.jsxs("span",{className:"n",children:[x.length," handle",x.length===1?"":"s",a.sessions.length>0?` · ${a.sessions.length} session${a.sessions.length===1?"":"s"}`:""]})]}),f>0?s.jsxs(s.Fragment,{children:[y.map(e=>s.jsxs("div",{className:"ctx-agent",children:[s.jsx("span",{className:"d "+(ss(e)?"on":"off")}),s.jsx("span",{className:"h",children:$(e)}),s.jsx("span",{className:"role",children:cs(e)})]},$(e))),D.map(e=>s.jsxs("div",{className:"ctx-agent",children:[s.jsx("span",{className:"d off"}),s.jsx("span",{className:"h",children:es(e)}),s.jsx("span",{className:"role",children:"SESSION"})]},e.id)),f>N?s.jsx("button",{type:"button",className:"ctx-more",onClick:()=>K(e=>!e),"aria-expanded":!b,children:b?`+${q} more`:"Show less"}):null]}):s.jsx("div",{className:"ctx-none",children:"no attached sessions"})]})]}),s.jsxs("div",{className:"ctx-ask",children:[s.jsx("textarea",{value:l,onChange:e=>{p(e.currentTarget.value),g(null),A(null)},onKeyDown:e=>{e.stopPropagation(),(e.metaKey||e.ctrlKey)&&e.key==="Enter"&&(e.preventDefault(),w())},disabled:h,rows:3,placeholder:i==="scout"?"Message Scout about this worktree":"Message this agent about the worktree"}),s.jsxs("div",{className:"ctx-ask-bar",children:[s.jsxs("select",{value:i,onChange:e=>T(e.currentTarget.value),onKeyDown:e=>e.stopPropagation(),disabled:h,"aria-label":"Message target",children:[s.jsx("option",{value:"scout",children:"Scout"}),E.map(e=>s.jsx("option",{value:`agent:${e.id}`,children:$(e)},e.id))]}),s.jsx("button",{className:"ctx-btn primary",type:"button",disabled:h||l.trim().length===0,onClick:()=>{w()},children:h?"Sending":"Send"})]}),s.jsxs("div",{className:"ctx-ask-foot",children:[O?s.jsx("span",{className:"err",children:O}):R?s.jsx("span",{className:"ok",children:R}):s.jsxs("span",{children:["Repo Watch context included · ",I]}),s.jsx("button",{type:"button",title:"Copy worktree path",onClick:()=>{navigator.clipboard?.writeText(a.path)},children:"Copy path"})]})]})]})}function ps(){const{worktree:n,project:t,generatedAt:u,tone:l}=ns();return s.jsx("div",{className:"rw-scope rw-ctx-rail-scope tone-"+l,children:s.jsx(ds,{worktree:n,project:t,generatedAt:u})})}export{ps as ReposInspector,ps as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as y,j as e}from"./index-Bli6bTLU.js";import{a as O}from"./api-DEHEgJ9m.js";import{a as r,t as f}from"./time-Dhsh_2EG.js";import{u as M,j as R}from"./mesh-ops-C0zCLTR8.js";import{u as L}from"./mesh-view-store-Cpqil_2D.js";import{u as H}from"./Provider-Ve8yXaWR.js";/* empty css */import"./provider-CX9EWecp.js";import"./router-B0YclXYg.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./sse-CSozY6mp.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./createLucideIcon-DLlxGjKt.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./file-text-BVhkMWyC.js";import"./x-BJyPzFnn.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-7iEtvu9P.js";import"./NewChatComposer-Bgqes0UQ.js";import"./text-BR9Bap0E.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DoT8gpw6.js";import"./conversation-model-CigSPlKA.js";import"./index-DFdlQs_c.js";import"./HarnessMark-DGZ6o6Ct.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./chevron-down-Da5tV19_.js";import"./search-BbgsEMXa.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";function E(o){return o.state==="waiting"&&o.nextMoveOwnerId==="operator"&&o.waitingOn?.label==="Held by operator"}function t({label:o,value:c}){return c?e.jsxs("div",{className:"mesh-ops-detail-row",children:[e.jsx("span",{className:"mesh-ops-detail-label",children:o}),e.jsx("span",{className:"mesh-ops-detail-value",children:c})]}):null}function ye(){const{navigate:o}=H(),{items:c,hosts:h,selectedItemId:w,lab:A}=M(),{meshSnapshot:p}=L(),[i,x]=y.useState(null),[v,j]=y.useState(null),s=c.find(l=>l.id===w)??null,u=async l=>{if(!(!s||i)){x(l),j(null);try{await O(`/api/mesh-ops/items/${encodeURIComponent(s.id)}/${l}`,{method:"POST",body:"{}"}),R()}catch(d){j(d instanceof Error?d.message:String(d))}finally{x(null)}}};if(!s){const l=new Map;for(const n of c)n.hostNodeId&&l.set(n.hostNodeId,(l.get(n.hostNodeId)??0)+1);const d=p?.localNode?.id??null;return e.jsxs("div",{className:"ctx-panel mesh-ops-inspector",children:[e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Mesh"}),h.map(n=>e.jsx(t,{label:n.nodeId===d?"this host":"peer",value:`${n.label} · ${l.get(n.nodeId)??0} items${n.liveSessionCount>0?` · ${n.liveSessionCount} live`:""}`},n.nodeId)),h.length===0&&e.jsx("div",{className:"ctx-panel-empty",children:"No hosts yet."})]}),e.jsx("div",{className:"ctx-panel-section",children:e.jsx("p",{className:"mesh-ops-inspector-note",children:"Select an item to inspect it. Counts are items attributed to each host; the map stays in the mesh screen."})})]})}if(s.kind==="session"&&s.session){const l=s.session;return e.jsxs("div",{className:"ctx-panel mesh-ops-inspector",children:[e.jsxs("div",{className:"mesh-ops-inspector-header",children:[e.jsx("div",{className:"mesh-ops-inspector-title",children:s.title}),e.jsxs("div",{className:"mesh-ops-inspector-summary",children:[l.live?`Live ${l.harness} session`:l.endedAt!==null?`Ended ${l.harness} session`:`Lost ${l.harness} session — no end marker, last seen ${r(l.lastSeenAt)}`,l.alias?` · ${l.alias}`:""]})]}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Session"}),e.jsx(t,{label:"harness",value:l.harness}),e.jsx(t,{label:"state",value:l.endedAt!==null?"ended":l.state}),e.jsx(t,{label:"agent",value:s.ownerId}),e.jsx(t,{label:"started",value:l.startedAt!==null?r(l.startedAt):null}),e.jsx(t,{label:"last seen",value:r(l.lastSeenAt)}),e.jsx(t,{label:"ended",value:l.endedAt!==null?r(l.endedAt):null})]}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Venue"}),e.jsx(t,{label:"host",value:s.hostLabel}),e.jsx(t,{label:"project",value:s.projectRoot}),e.jsx(t,{label:"cwd",value:l.cwd})]})]})}const S=E(s),I=s.state==="done"||s.state==="cancelled",$=s.state==="open"||s.state==="working",C=S,m=s.state==="review",a=s.latestFlight,k=a!==null&&(a.state==="running"||a.state==="queued"),b=p?.localNode?.hostName?.split(".")[0]??p?.localNode?.name??"here",N=s.hostLabel??"unattributed",g=N===b||s.hostNodeId===null;return e.jsxs("div",{className:"ctx-panel mesh-ops-inspector",children:[e.jsxs("div",{className:"mesh-ops-inspector-header",children:[e.jsx("div",{className:"mesh-ops-inspector-title",children:s.title}),s.summary&&e.jsx("div",{className:"mesh-ops-inspector-summary",children:s.summary})]}),A.routeStrip&&e.jsx("div",{className:"mesh-ops-routestrip","aria-hidden":!0,children:e.jsxs("svg",{viewBox:"0 0 260 40",className:"mesh-ops-routestrip-svg",children:[e.jsx("line",{x1:"24",y1:"18",x2:"236",y2:"18",className:`mesh-ops-routestrip-line${k&&!g?" mesh-ops-routestrip-line--moving":""}`}),e.jsx("rect",{x:"14",y:"12",width:"12",height:"12",rx:"2",className:"mesh-ops-routestrip-node"}),e.jsx("rect",{x:"234",y:"12",width:"12",height:"12",rx:"2",className:"mesh-ops-routestrip-node"}),e.jsx("text",{x:"20",y:"36",textAnchor:"middle",className:"mesh-ops-routestrip-label",children:b}),e.jsx("text",{x:"246",y:"36",textAnchor:"end",className:"mesh-ops-routestrip-label",children:g?"(same host)":N})]})}),!I&&e.jsxs("div",{className:"mesh-ops-actions",children:[C?e.jsx("button",{type:"button",className:"mesh-ops-button",disabled:i!==null,onClick:()=>{u("release")},children:i==="release"?"Releasing…":"Release"}):$?e.jsx("button",{type:"button",className:"mesh-ops-button",disabled:i!==null,onClick:()=>{u("hold")},children:i==="hold"?"Holding…":"Hold"}):null,(s.state==="review"||s.attention!=="silent")&&e.jsx("button",{type:"button",className:"mesh-ops-button",disabled:i!==null,onClick:()=>{u(m?"accept":"clear")},title:m?"Accept this work item":"Dismiss this item from the attention queue",children:i==="accept"||i==="clear"?m?"Accepting…":"Clearing…":m?"Accept":"Clear"}),e.jsx("button",{type:"button",className:"mesh-ops-button",onClick:()=>o({view:"work",workId:s.id}),title:"Open the full work item",children:"Open item"})]}),v&&e.jsx("div",{className:"ctx-panel-empty","data-tone":"error",children:v}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"State"}),e.jsx(t,{label:"phase",value:s.currentPhase}),e.jsx(t,{label:"state",value:s.state}),e.jsx(t,{label:"attention",value:s.attention==="silent"?null:s.attention}),e.jsx(t,{label:"waiting on",value:s.waitingOn?.label??null}),e.jsx(t,{label:"acceptance",value:s.acceptanceState==="none"?null:s.acceptanceState}),e.jsx(t,{label:"priority",value:s.priority}),e.jsx(t,{label:"labels",value:s.labels.length>0?s.labels.join(", "):null})]}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Venue"}),e.jsx(t,{label:"owner",value:s.ownerName??s.ownerId}),e.jsx(t,{label:"host",value:s.hostLabel??(s.hostNodeId?s.hostNodeId:null)}),e.jsx(t,{label:"project",value:s.projectRoot})]}),a&&e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Latest flight"}),e.jsx(t,{label:"state",value:a.state}),e.jsx(t,{label:"summary",value:a.summary}),e.jsx(t,{label:"started",value:a.startedAt!==null?r(a.startedAt):null}),e.jsx(t,{label:"completed",value:a.completedAt!==null?r(a.completedAt):null}),s.activeFlightCount>0&&e.jsx(t,{label:"active",value:`${s.activeFlightCount} in flight`})]}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Activity"}),e.jsx(t,{label:"last",value:s.lastMeaningfulSummary}),e.jsx(t,{label:"updated",value:`${f(s.updatedAt)} · created ${f(s.createdAt)}`})]})]})}export{ye as MeshOpsInspector};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"./createLucideIcon-
|
|
1
|
+
import{c}from"./createLucideIcon-DLlxGjKt.js";const e=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],t=c("rocket",e);export{t as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as ie,q as Dn,t as je,v as Ne,k as Fn,w as On,s as k,l as g,x as xn,y as Z,z as jn,A as Nn,r as P}from"./index-o4FKpU7Z.js";import{n as ce}from"./synthetic-agent-routing-aduMYO7P.js";import{o as Mn,q as Me,n as Bn,u as zn}from"./terminal-sessions-AmSgHklm.js";const Be=["local","url","sharedConfig","env"];function Wn(e){const n=Kn(e),t=e.audienceIncludes??Gn(e.audienceOrder),s=new Set;function o(a){!e.warnOnUnknown||s.has(a)||(s.add(a),typeof console<"u"&&typeof console.warn=="function"&&console.warn(`[hudsonkit/flags] Unknown feature flag "${a}" resolved false.`))}const r=e.registry;function i(a){const u=r[a];if(!u)return o(a),{key:a,enabled:!1,value:!1,layer:"default",audience:n,reason:"unknown-flag"};const d=Hn(e.layers,a);return d?{key:a,enabled:d.value,value:d.value,layer:d.layer,audience:n,requiredTier:u.tier,reason:"override",definition:u}:u.defaultEnabled?u.tier&&!t(n,u.tier)?{key:a,enabled:!1,value:!1,layer:"default",audience:n,requiredTier:u.tier,reason:"audience-denied",definition:u}:{key:a,enabled:!0,value:!0,layer:"default",audience:n,requiredTier:u.tier,reason:"default",definition:u}:{key:a,enabled:!1,value:!1,layer:"default",audience:n,requiredTier:u.tier,reason:"default",definition:u}}return{registry:e.registry,isEnabled:a=>i(String(a)).enabled,explain:a=>i(String(a)),all:()=>Object.keys(e.registry).sort().map(i),audience:()=>n}}function Kn(e){let n=e.audience.tier;for(const t of Be.slice().reverse()){const s=e.layers?.[t]?.audience;s&&(n=s)}return{...e.audience,tier:n}}function Gn(e){return(n,t)=>{if(n.tier===t)return!0;if(!e||e.length===0)return!1;const s=e.indexOf(n.tier),o=e.indexOf(t);return s<0||o<0?!1:s>=o}}function Hn(e,n){for(const t of Be){const s=Vn(e?.[t]?.flags?.[n]);if(s!==null)return{layer:t,value:s}}return null}function Vn(e){return e===!0||e==="on"?!0:e===!1||e==="off"?!1:null}function Yn(e){if(e===!0||e===!1)return e;if(typeof e=="number"){if(e===1)return!0;if(e===0)return!1}if(typeof e!="string")return;const n=e.trim().toLowerCase();if(["1","true","on","yes","enabled","enable"].includes(n))return!0;if(["0","false","off","no","disabled","disable"].includes(n))return!1;if(["default","null","unset","clear"].includes(n))return"default"}function qn(e,n={}){const t=n.paramPrefix??"ff.",s=n.audienceParam??"ffAudience",o=typeof e=="string"?new URL(e,"http://hudson.local"):e,r={};let i;for(const[a,u]of o.searchParams.entries()){if(a===s&&u.trim()&&(i=u.trim()),!a.startsWith(t))continue;const d=a.slice(t.length),f=Yn(u);d&&f!==void 0&&(r[d]=f)}return{flags:r,audience:i}}const D=1;function Qn(e){if(typeof window>"u")return{version:D};try{const n=window.localStorage?.getItem(e);return Xn(n)}catch{return{version:D}}}function _s(e,n){if(typeof window>"u")return;const t=ze(n),s=JSON.stringify(t);try{window.localStorage?.setItem(e,s)}catch{}Zn(e,s)}function Xn(e){if(!e)return{version:D};try{const n=JSON.parse(e);return!n||typeof n!="object"?{version:D}:ze(n)}catch{return{version:D}}}function ze(e){const n={version:D};if(e.audience&&(n.audience=e.audience),e.flags&&typeof e.flags=="object"){n.flags={};for(const[t,s]of Object.entries(e.flags))(s===!0||s===!1)&&(n.flags[t]=s);Object.keys(n.flags).length===0&&delete n.flags}return n}function Zn(e,n){if(!(typeof document>"u"))try{const t=encodeURIComponent(n);document.cookie=`${encodeURIComponent(e)}=${t}; Path=/; SameSite=Lax; Max-Age=31536000`}catch{}}const Jn=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal"],et=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.scoutbot","surface.workflows"];function Le(e,n){return Object.fromEntries(e.map(t=>[t,n]))}const We={label:"Surface · Scope",description:`Scope presentation on Scout infra — lean lanes/tail/sessions/agents at ${Dn}/*.`,defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","scope","observability"]},nt={...We,label:"Surface · Scope (legacy alias)",description:`Legacy alias for ${ie}. Prefer the primary flag; ${je} remains for old dev links.`},Us=ie;function tt(){return{audience:"everyone",flags:{"ops.control":!0,"ops.lanes":!0,...Le(Jn,!1),...Le(et,!1)}}}const Ke=["ffBundle","ffVariant","scoutBundle","scoutExperience","ab"],Ge=["ffGlobal","scoutGlobalBundle"],He=["ffPersist","persistBundle"],st=new Set(["no-ops","ffAudience",...Ke,...Ge,...He]);function ks(e){for(const n of[...e.searchParams.keys()])(st.has(n)||n.startsWith("ff."))&&e.searchParams.delete(n);return e}const ot=["everyone","internal","power"],rt="openscout.flags",J="openscout.flagBundle",at={tier:"power"},ye=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal","ops.lanes"],$e=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.mesh-ops","surface.scoutbot","surface.realtime-voice","surface.workflows"],it={"nav.sidebar":{label:"Nav · Sidebar",description:"Classic sidebar chrome (8 primary areas + icon rail). Default on since sco-083 soak; opt out with ?ff.nav.sidebar=off. Not included in max-pro.",defaultEnabled:!0,tier:"everyone",owner:"scout-web",tags:["nav","chrome"]},"ops.control":{label:"Ops · Control",description:"Mission control, issues, and the Ops section shell.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops","nav"]},"ops.mesh":{label:"Ops · Mesh",description:"Mesh topology and peer status.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.runtime":{label:"Ops · Runtime",description:"Runtime / atop process telemetry.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.plans":{label:"Ops · Plans",description:"Plan documents and plan-mode review.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.terminal":{label:"Ops · Terminal",description:"Observe / takeover terminal sessions.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.lanes":{label:"Ops · Agent Lanes",description:"One column per local agent — follow live harness work in power-user mode.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"surface.search":{label:"Surface · Search",description:"Knowledge + indexer search as a top-level nav entry.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","nav"]},"surface.sessions":{label:"Surface · Sessions",description:"Standalone top-level Sessions entry (still reachable under Agents).",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","nav"]},"surface.briefings":{label:"Surface · Briefings",description:"Briefings list + detail.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.work":{label:"Surface · Work",description:"Work item detail.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.activity":{label:"Surface · Activity",description:"Activity stream.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.follow":{label:"Surface · Follow",description:"Follow view.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.mesh-ops":{label:"Surface · Mesh Ops",description:"Mesh Ops — work-item triage over the mesh (hosts rail, item list, inspector).",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","ops"]},"surface.scoutbot":{label:"Surface · Scoutbot",description:"Scoutbot assistant — the inspector panel, the status-bar broadcast chip, and the Message-Scout command-palette actions.",defaultEnabled:!0,tier:"everyone",owner:"scout-web",tags:["surface","assistant"]},"surface.realtime-voice":{label:"Surface · Realtime voice",description:"Live WebRTC voice conversations with Scoutbot through OpenAI Realtime.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","assistant","voice"]},"surface.workflows":{label:"Surface · Workflows",description:"Observed harness families / workflow topology telemetry on the Agents directory. Off in the lean view — the directory is just the project-grouped agent board.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","observability"]},[ie]:We,[je]:nt},ct={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",...On},Ee=new Set(["clear","default","none","reset","unset"]);function K(e,n){return Object.fromEntries(e.map(t=>[t,n]))}function Ve(...e){const n={};for(const t of e)t.audience&&(n.audience=t.audience),t.flags&&Object.keys(t.flags).length>0&&(n.flags={...n.flags??{},...t.flags});return n}function ue(e){switch(e){case"light-prod":return{audience:"everyone",flags:{...K(ye,!1),...K($e,!1)}};case"max-pro":return{audience:"power",flags:{...K(ye,!0),...K($e,!0)}};case Fn:return tt()}}function O(e){return e?ct[e.trim().toLowerCase()]??null:null}function ee(e,n){for(const t of n){const s=e.get(t);if(s!==null)return s}return null}function Ye(e){const n=ee(e,Ke);return O(n)}function ut(e){const n=ee(e,Ge);if(n){const i=n.trim().toLowerCase();if(Ee.has(i))return{action:"clear"};const a=O(n);return a?{action:"set",bundle:a}:null}const t=ee(e,He);if(!t)return null;const s=t.trim().toLowerCase();if(Ee.has(s))return{action:"clear"};if(["0","false","no"].includes(s))return null;const o=O(t);if(o)return{action:"set",bundle:o};const r=Ye(e);return r?{action:"set",bundle:r}:null}function qe(){if(typeof window>"u")return null;try{return O(window.localStorage.getItem(J))}catch{return null}}function lt(e){if(!(typeof window>"u"))try{e.action==="clear"?window.localStorage.removeItem(J):window.localStorage.setItem(J,e.bundle)}catch{}}function Ts(){return qe()??O(Ne())??Xe}function Qe(){const e=qe();return e?ue(e):{}}const Xe="light-prod";function Ze(){const e=O(Ne())??Xe;return ue(e)}function dt(e){const n=ut(e);n&<(n)}function Je(e=new URLSearchParams(window.location.search)){const n=qn(window.location.href),t=Ye(e),s=t?ue(t):{},o={audience:n.audience??s.audience,flags:{...s.flags??{},...n.flags??{}}};return e.has("no-ops")&&(o.flags={...o.flags,"ops.control":!1}),o}function ft(){const e=Qn(rt);return{flags:e.flags,audience:e.audience??void 0}}function Ds(){if(typeof window>"u")return{};const e=new URLSearchParams(window.location.search);return dt(e),{sharedConfig:Ve(Ze(),Qe()),url:Je(e)}}function mt(e){const n=typeof window>"u"?{}:{sharedConfig:Ve(Ze(),Qe()),url:Je(),local:ft()};return Wn({registry:it,audience:at,audienceOrder:ot,layers:n,warnOnUnknown:!1}).isEnabled(e)}function en(){return mt("ops.control")}const ne={sm:408,md:512,lg:616},nn=240,tn=640,pt=24,sn="openscout:lane-deck:v1",gt=new Set(["web.ops","macos.lanes","hud.tail","web.embed"]),le=new Set(["sm","md","lg"]),on={"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}},ht=on["web.ops"];function de(e){return rn(e)?on[e]:ht}const H={pinned_left:0,main:1,pinned_right:2};function rn(e){return gt.has(e)}function Fs(e=window.location.search,n=window.location.pathname){const t=new URLSearchParams(e),s=t.get("profile")?.trim().toLowerCase();if(s&&rn(s))return s;const o=t.get("embed")?.trim().toLowerCase();return o==="hud"?"hud.tail":o==="app"?"macos.lanes":n.includes("/lanes/embed")?"web.embed":(n.includes("/ops/lanes"),"web.ops")}function Os(e=window.location.search){const n=new URLSearchParams(e),t=(n.get("lanes")??n.get("size"))?.trim().toLowerCase();return t&&le.has(t)?t:"lg"}function xs(e,n){if(typeof e=="number"&&Number.isFinite(e))return Math.min(tn,Math.max(nn,Math.round(e)));const t=typeof e=="string"&&le.has(e)?e:n;return ne[t]}function js(e){const n=Math.min(tn,Math.max(nn,Math.round(e)));let t=null,s=Number.POSITIVE_INFINITY;for(const[o,r]of Object.entries(ne)){const i=Math.abs(r-n);i<s&&(s=i,t=o)}return t&&s<=pt?{px:ne[t],tier:t}:{px:n,tier:null}}function fe(e,n,t){return{version:1,profileId:e,defaultLaneWidth:n??t.defaultLaneWidth,defaultHorizon:t.defaultHorizon,laneWidths:{},laneDefs:[],slots:[],showAutoLanes:t.showAutoLanes,updatedAt:Date.now()}}function Re(e,n){const t=de(e);return fe(e,n,t)}function te(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&le.has(e))return e}function wt(e){if(!e||typeof e!="object")return null;const n=e;return typeof n.id!="string"||!n.id.trim()||n.kind!=="session"&&n.kind!=="harness"&&n.kind!=="project"&&n.kind!=="attention"||typeof n.title!="string"||!n.title.trim()?null:{id:n.id.trim(),kind:n.kind,title:n.title.trim(),sessionId:typeof n.sessionId=="string"?n.sessionId.trim():void 0,harness:typeof n.harness=="string"?n.harness.trim():void 0,projectPath:typeof n.projectPath=="string"?n.projectPath.trim():void 0}}function It(e){if(!e||typeof e!="object")return null;const n=e;return typeof n.id!="string"||!n.id.trim()||typeof n.laneDefId!="string"||!n.laneDefId.trim()||n.zone!=="pinned_left"&&n.zone!=="main"&&n.zone!=="pinned_right"||typeof n.position!="number"||!Number.isFinite(n.position)?null:{id:n.id.trim(),laneDefId:n.laneDefId.trim(),zone:n.zone,position:n.position,width:te(n.width)}}function an(e,n,t,s){if(!e||typeof e!="object")return fe(n,t,s);const o=e,r=Array.isArray(o.laneDefs)?o.laneDefs.map(wt).filter(d=>d!==null):[],i=Array.isArray(o.slots)?o.slots.map(It).filter(d=>d!==null):[],a={};if(o.laneWidths&&typeof o.laneWidths=="object")for(const[d,f]of Object.entries(o.laneWidths)){const L=te(f);L!==void 0&&(a[d]=L)}const u=te(o.defaultLaneWidth);return{version:1,profileId:n,defaultLaneWidth:(typeof u=="string"?u:void 0)??t??s.defaultLaneWidth,defaultHorizon:typeof o.defaultHorizon=="string"?o.defaultHorizon:s.defaultHorizon,laneWidths:a,laneDefs:r,slots:i,showAutoLanes:typeof o.showAutoLanes=="boolean"?o.showAutoLanes:s.showAutoLanes,updatedAt:typeof o.updatedAt=="number"?o.updatedAt:Date.now()}}function vt(e,n,t){return an(e,n,t,de(n))}function Ns(e,n){const t=de(e),s=n??t.defaultLaneWidth;try{const o=localStorage.getItem(`${sn}:${e}`);return o?vt(JSON.parse(o),e,s):Re(e,s)}catch{return Re(e,s)}}function St(e){try{localStorage.setItem(`${sn}:${e.profileId}`,JSON.stringify({...e,updatedAt:Date.now()}))}catch{}}function Ms(e){return[...e].sort((n,t)=>{const s=H[n.zone]-H[t.zone];return s!==0?s:n.position-t.position})}function Bs(e,n){return H[e]-H[n]}function cn(){return`slot:${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function me(e){return e.trim().toLowerCase().replace(/['"]/gu,"").replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function Y(e){return`session:${e}`}function bt(e){return`harness:${me(e)}`}function Lt(e){return`project:${me(e)}`}const yt="attention:needs-input";function un(e,n){const t=e.filter(s=>s.zone===n);return t.length===0?0:Math.max(...t.map(s=>s.position))+1}function ln(e,n){const t=e.laneDefs.some(s=>s.id===n.id);return{...e,laneDefs:t?e.laneDefs.map(s=>s.id===n.id?n:s):[...e.laneDefs,n]}}function dn(e,n){const t=e.slots.some(s=>s.id===n.id);return{...e,slots:t?e.slots.map(s=>s.id===n.id?n:s):[...e.slots,n]}}function fn(e,n){return{...e,slots:e.slots.filter(t=>t.laneDefId!==n)}}function $t(e,n){const t=Y(n);return{...fn(e,t),laneDefs:e.laneDefs.filter(s=>s.id!==t)}}function zs(e,n){const t=Y(n);return e.slots.some(s=>s.laneDefId===t&&s.zone!=="main")}function Ws(e,n){const t=Y(n),s=e.slots.find(o=>o.laneDefId===t);return!s||s.zone==="main"?null:s.zone}function Ks(e,n){const t=n.zone??"pinned_left",s=Y(n.laneId),o=$t(e,n.laneId),r=ln(o,{id:s,kind:"session",title:n.title,sessionId:n.laneId});return dn(r,{id:cn(),laneDefId:s,zone:t,position:un(r.slots,t),width:n.width})}function Gs(e,n){const t=n.zone??"pinned_left",s=n.kind==="attention"?yt:n.kind==="harness"&&n.harness?bt(n.harness):n.kind==="project"&&n.projectPath?Lt(n.projectPath):`${n.kind}:${me(n.title)}`,o=fn(e,s),r=ln(o,{id:s,kind:n.kind,title:n.title,harness:n.harness,projectPath:n.projectPath});return dn(r,{id:cn(),laneDefId:s,zone:t,position:un(r.slots,t),width:n.width})}function Hs(e,n,t){return{...e,laneWidths:{...e.laneWidths,[n]:t},updatedAt:Date.now()}}function Vs(e,n){return{...e,defaultLaneWidth:n,updatedAt:Date.now()}}function Ys(e){const n=new Set(e.slots.filter(t=>t.zone!=="main").map(t=>t.laneDefId));return{...e,slots:e.slots.filter(t=>t.zone==="main"),laneDefs:e.laneDefs.filter(t=>!n.has(t.id))}}const V="scope.lanes",se={defaultLaneWidth:"md",showAutoLanes:!0,defaultHorizon:"30m"},Et="openscout:lane-deck:v1";function Pe(e){return fe(V,e,se)}function qs(e){const n=e??se.defaultLaneWidth;try{const t=localStorage.getItem(`${Et}:${V}`);return t?an(JSON.parse(t),V,n,se):Pe(n)}catch{return Pe(n)}}function Qs(e){St(e)}const Rt=[g.lanes,g.tail,g.sessions,g.agents];function Pt(e){return Rt.includes(e)}function Ct(e){return e===jn||e===Nn}function mn(e){return xn(e)}function q(e,n={}){switch(e){case g.tail:{const t=new URLSearchParams;n.tailQuery&&t.set("q",n.tailQuery);const s=t.toString();return k(e,s?`?${s}`:"")}case g.sessions:return n.sessionId?k(e,`/${encodeURIComponent(n.sessionId)}`):k(e);case g.lanes:return k(Z);case g.agents:return k(e);default:return k(Z)}}function pn(e){switch(e.view){case"ops":return!e.mode||e.mode==="lanes"?g.lanes:e.mode==="tail"?g.tail:null;case"sessions":return e.agentId?null:g.sessions;case"agents-v2":return e.agentId||e.projectSlug||e.sessionId||e.conversationId?null:g.agents;default:return null}}function At(e){const n=pn(e);return n?n===g.tail&&e.view==="ops"?q(n,{tailQuery:e.tailQuery}):n===g.sessions&&e.view==="sessions"?q(n,{sessionId:e.sessionId}):q(n):null}function _t(e,n,t){if(!Ct(e[0]))return null;const s=e[1]??Z;if(!Pt(s))return{view:"ops",mode:"lanes"};switch(s){case g.tail:{const o=n.searchParams.get("q")?.trim();return{view:"ops",mode:"tail",...o?{tailQuery:o}:{}}}case g.sessions:return e[2]?t({view:"sessions",sessionId:decodeURIComponent(e[2])}):t({view:"sessions"});case g.agents:return t({view:"agents-v2"});case g.lanes:default:return{view:"ops",mode:"lanes"}}}const Ut=new Set(["no-ops","ffBundle","ffVariant","scoutBundle","scoutExperience","ab","ffGlobal","scoutGlobalBundle","ffPersist","persistBundle","ffAudience","studio","studioInjection","studioMode"]),kt=["ff.","studio.","studioMode."];function Tt(e){return Ut.has(e)||kt.some(n=>e.startsWith(n))}function gn(e,n=""){const t=new URL(e,"http://scout.local");new URLSearchParams(n).forEach((r,i)=>{Tt(i)&&(t.searchParams.has(i)||t.searchParams.set(i,r))});const o=t.searchParams.toString();return`${t.pathname}${o?`?${o}`:""}`}function Xs(e){switch(e){case g.tail:return{view:"ops",mode:"tail"};case g.sessions:return{view:"sessions"};case g.agents:return{view:"agents-v2"};case g.lanes:default:return{view:"ops",mode:"lanes"}}}function Dt(e=typeof window<"u"?window.location.pathname:""){return mn(e)}function Zs(){return V}function Js(e=Dt()){return e?{"data-scope-presentation":!0}:void 0}function hn(e,n=typeof window<"u"?window.location.pathname:""){return mn(n)?At(e):null}function Ft(e,n=typeof window<"u"?window.location.pathname:""){return hn(e,n)!==null}function eo(e,n=typeof window<"u"?window.location.pathname:""){return Ft(e,n)?pn(e):null}const no={days:3,sessionLimit:200,hitLimit:60,debounceMs:180};function oe(e){return e.root==="HOME"?`~/${e.relPath}`:e.root==="ABSOLUTE"?e.relPath:`$${e.root}/${e.relPath}`}function Ce(e){const n=e?.trim();if(!n)return null;const t=n.replace(/[\\/]+$/,""),s=t.split(/[\\/]/).filter(Boolean).at(-1)??t;return s.endsWith(".jsonl")?s.slice(0,-6):s}function _(e){return e.sourceRefs.find(n=>n.kind==="harness_transcript")??null}function wn(e){return e.sourceRefs.find(n=>n.kind==="file")??null}function pe(e){return e?Ce(e.sessionId)??Ce(oe(e.path)):null}function to(e){const n=pe(e);if(!n)return null;const t=e?.recordRange;return t?`${n}|records ${t[0]}..${t[1]}`:n}function B(e,n){const t=e.facets[n];return Array.isArray(t)?t.filter(Boolean).join(", "):typeof t=="string"?t:""}function N(e){const n=new Set;return e.split(/[^A-Za-z0-9_./-]+/u).map(t=>t.trim()).filter(t=>t.length>1).filter(t=>{const s=t.toLowerCase();return n.has(s)?!1:(n.add(s),!0)}).slice(0,12)}const Ot=/^(events?\s+window(\s+\d+)?|files?\s+touched|tool\s+calls?|indexed\s+snippet|manifest|summary|decisions?|context\s+pack)\b/iu,Ae=/^(claude|codex|kimi|cursor|gpt|gemini)\b/iu,_e=/^(?: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 In(e){return Ot.test(e.replace(/\s+/g," ").trim())}function xt(e){let n=e.replace(/\s+/g," ").trim();if(!n)return"";if(n=n.replace(/<[^>\n]+>/g," ").replace(/\s+/g," ").trim(),_e.test(n))n=n.replace(_e,"").trim();else{const t=n.match(/^(.{6,72}?)\s[-–—]\s+(.+)$/u);if(t){const s=t[1]??"",o=t[2]??"";(Ae.test(s)||/\b(?:am|pm|\d{1,2}:\d{2}|plugin|session|openscout)\b/iu.test(s))&&(n=o.trim())}}return n=n.replace(Ae,"").replace(/^\s*[-–—:]\s*/,"").trim(),n=n.replace(/\s{2,}/g," ").trim(),n.length>72&&(n=`${n.slice(0,69).replace(/\s+\S*$/u,"").trimEnd()}…`),n}function jt(e){const n=B(e,"project"),t=e.title.replace(/\s+/g," ").trim();if(t&&!In(t)){const o=xt(t);if(o&&o.toLowerCase()!==n.toLowerCase()||o)return o}if(n)return n;const s=pe(_(e));return s?s.length>18?`${s.slice(0,16)}…`:s:"Session match"}function vn(e){const n=M(e,"recordKind",8).map(s=>s.toLowerCase());if(n.length===0&&n.push(...M(e,"recordTag",8).map(s=>s.toLowerCase())),n.some(s=>s.includes("assistant")))return"assistant";if(n.some(s=>s.includes("user")))return"user";if(n.some(s=>s.includes("tool")||s.includes("command")||s.includes("response")))return"tool";const t=he(e);return t==="tool activity"?"tool":t==="overview"?"overview":""}function so(e,n){const t=we(e.snippet,n),s=vn(e),o=ge(e);let r="";if(t){const i=N(n).map(d=>d.toLowerCase()),a=t.split(new RegExp("(?<=[.!?])\\s+|\\s+[–—]\\s+|\\s+·\\s+","u")).map(d=>d.replace(/^…+|…+$/gu,"").trim()).filter(d=>d.length>12);r=((i.length>0?a.find(d=>i.some(f=>re(d,f)>=0)):void 0)??a[0]??t).replace(/^…+|…+$/gu,"").trim()}return r?(r.length>78&&(r=`${r.slice(0,75).replace(/\s+\S*$/u,"").trimEnd()}…`),r):s&&o?`${s} · ${o}`:o||s||jt(e)}function Nt(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 Ue(e){const n=e.trim().toLowerCase();return n?n==="events"||n.startsWith("events")?"conversation":n==="overview"||n==="summary"?"overview":n==="tool-calls"||n==="tools"?"tool activity":n==="files"||n==="files-touched"?"files touched":n==="manifest"?"session index":n.replace(/[-_]+/g," "):""}function Mt(e){const n=e.trim();return n?n.charAt(0).toUpperCase()+n.slice(1):""}function Bt(e){const n=B(e,"harness")||_(e)?.harness||"";if(!n)return"";const t=n.toLowerCase();return t==="claude"?"Claude":t==="codex"?"Codex":t==="kimi"?"Kimi":t==="cursor"?"Cursor":Mt(n)}function zt(e){const n=B(e,"sessionId").trim(),t=pe(_(e)),s=(n||t||"").trim();return s?s.length>14?s.slice(0,8):s:""}function ge(e){const n=_(e)?.recordRange;if(n){const[s,o]=n;return s===o?`turn ${s}`:o-s<=1?`turns ${s}–${o}`:`turns ${s}–${o}`}const t=e.title.match(/events?\s+window\s+(\d+)/iu);return t?`window ${Number(t[1])}`:""}function Wt(e){const n=M(e,"recordKind",8).map(s=>s.toLowerCase());n.length===0&&n.push(...M(e,"recordTag",8).map(s=>s.toLowerCase()));const t=[];return n.some(s=>s.includes("user"))&&t.push("user"),n.some(s=>s.includes("assistant"))&&t.push("assistant"),n.some(s=>s.includes("tool")||s.includes("command")||s.includes("response"))&&t.push("tool"),t.length===0?"":t.join(" · ")}function he(e){const n=B(e,"documentKind");if(n){const s=n.split(",")[0]?.trim()??n;return Ue(s)}return In(e.title)?Ue(e.title):wn(e)?"file":_(e)?"conversation":""}function M(e,n,t=3){const s=e.facets[n];return(Array.isArray(s)?s:typeof s=="string"?s.split(","):[]).map(r=>r.trim()).filter(Boolean).slice(0,t)}function oo(e){return{agent:Bt(e),project:B(e,"project"),session:zt(e),when:Nt(e),turn:ge(e),role:Wt(e),where:he(e)}}function ro(e){const n=[],t=ge(e);t&&n.push(t);const s=vn(e);s&&n.push(s);const o=he(e);o&&o!=="conversation"&&n.push(o);const r=M(e,"toolName",2);r.length===1&&n.push(r[0]),r.length>1&&n.push(r.join(", "));const i=new Set;return n.filter(a=>{const u=a.toLowerCase();return i.has(u)?!1:(i.add(u),!0)})}function re(e,n){return new RegExp(`(?<![A-Za-z0-9_./~-])${Ln(n)}(?![A-Za-z0-9_./~-])`,"iu").exec(e)?.index??-1}function we(e,n=""){let t=e.replace(/\s+/g," ").trim();if(!t)return"";if(t=t.replace(/\s*-\s*\[\d{3,}\]\s*`[^`]+`(?:\s*\([^)]*\))?\s*-\s*/gu," "),t=t.replace(/\[\d{3,}\]\s*`[^`]+`\s*/gu,""),t=t.replace(/\*\*/gu,""),t=t.replace(/\b(?:assistant_turn|user_turn|agent_reasoning|command_or_tool|response_item|system_record)\b/giu," "),t=t.replace(/(?:~\/|\.\.?\/|\/(?:Users|home|var|tmp|opt)\/)\S+/gu," "),t=t.replace(/https?:\/\/\S+/gu," "),t=t.replace(/\b[\w.-]+\.(?:com|net|org|io|dev|app)(?:\/\S*)?/giu," "),t=t.replace(/\{[^{}]{0,160}\}/gu," "),t=t.replace(/`[^`]{0,64}`/gu,r=>{const i=r.slice(1,-1);return N(n).some(a=>re(i,a)>=0)||/^[A-Za-z][\w.-]{0,24}$/u.test(i)?i:" "}),t=t.replace(/\s{2,}/g," ").trim(),t=t.replace(/^[\s,;:.\-–—|/]+/u,"").trim(),t.includes("{")||t.includes("[")){const r=t.search(/[\[{]/u);if(r>18){const i=t.slice(0,r).trim().replace(/[-–—,:;]+$/u,"").trim();i&&(t=i)}}const s=N(n),o=200;if(s.length>0&&t.length>o){let r=-1;for(const i of s){const a=re(t,i);a>=0&&(r<0||a<r)&&(r=a)}if(r<0)for(const i of s){if(i.length<4)continue;const a=t.toLowerCase().indexOf(i.toLowerCase());a>=0&&(r<0||a<r)&&(r=a)}if(r>=0){const a=Math.max(0,r-48),u=Math.min(t.length,a+o),d=t.slice(a,u).trim();t=`${a>0?"…":""}${d}${u<t.length?"…":""}`}else t=`${t.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`}else t.length>o&&(t=`${t.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`);return t.replace(/\s{2,}/g," ").trim()}function ao(e,n,t){const s=we(e.snippet,n);return s.length<=t?s:`${s.slice(0,t-1).replace(/\s+\S*$/u,"").trimEnd()}…`}function Kt(e,n){return N(n).filter(t=>{const s=t.toLowerCase();return e.title.toLowerCase().includes(s)||e.snippet.toLowerCase().includes(s)||we(e.snippet,n).toLowerCase().includes(s)})}function Sn(e){const n=(e.kind||e.role||e.type||"record").toLowerCase();return n==="assistant_turn"||n==="assistant"?"assistant":n==="user_turn"||n==="user"?"user":n==="system_record"||n==="system"?"system":n==="command_or_tool"||n==="tool_use"?"tool":n==="response_item"?"tool output":n==="agent_reasoning"||n==="reasoning"?"reasoning":n.replace(/_/gu," ")}function bn(e){const n=(e.kind||e.role||e.type||"").toLowerCase();return n==="assistant"||n==="assistant_turn"||n==="user"||n==="user_turn"||n==="last-prompt"||n==="ai-title"?0:n==="system"||n==="system_record"||n.includes("reasoning")?1:2}function io(e){return e.scoreSource==="hybrid"?"Words and meaning":e.scoreSource==="vector"?"Similar in meaning":"Exact words"}function co(e,n,t){const s=Kt(e,n),o=s.length===1?`Matched “${s[0]}”`:s.length>1?`Matched ${s.length} terms`:"Matched in this session";if(!t?.matched)return o;const r=[t.renderedText,t.summary].filter(Boolean).join(" ").toLowerCase(),i=s.filter(d=>r.includes(d.toLowerCase()));if(i.length===0)return o;const a=Sn(t),u=a==="assistant"?"an assistant reply":a==="user"?"your message":a==="tool"?"a tool call":a==="tool output"?"tool output":a==="system"?"a system record":a==="reasoning"?"agent reasoning":`a ${a} record`;return i.length===1?`Matched “${i[0]}” in ${u}`:`Matched ${i.length} terms in ${u}`}function uo(e){const n=_(e);if(n){const s=oe(n.path),o=n.recordRange;return o?`${s}#R${o[0]}-R${o[1]}`:s}const t=wn(e);if(t){const s=oe(t.path),o=t.lineRange;return o?`${s}#L${o[0]}-L${o[1]}`:s}return e.id}function Gt(e){const n=e.filter(o=>bn(o)===2).length,t=e.length-n,s=e.some(o=>o.matched)?" · match inside":"";return n>0&&t===0?`${n} tool step${n===1?"":"s"}${s}`:n===0?`${t} process step${t===1?"":"s"}${s}`:`${n} tool + ${t} process step${e.length===1?"":"s"}${s}`}function Ht(e){return`${e.length} more conversation turn${e.length===1?"":"s"}`}function lo(e,n={}){if(e.length===0)return[];const t=n.contextRadius??3,s=n.maxTurns??6,o=n.centerRecordIndex===void 0?-1:e.findIndex(v=>v.index===n.centerRecordIndex),r=e.findIndex(v=>v.matched),i=o>=0?o:r>=0?r:0,a=e.slice(Math.max(0,i-t),Math.min(e.length,i+t+1)),u=[];let d=[],f=[],L=0;const C=()=>{d.length!==0&&(u.push({kind:"folded",records:d,summary:Gt(d)}),d=[])},R=()=>{f.length!==0&&(u.push({kind:"folded",records:f,summary:Ht(f)}),f=[])};for(const v of a){if(bn(v)>0){R(),d.push(v);continue}if(C(),L>=s){f.push(v);continue}u.push({kind:"turn",record:v,role:Sn(v)}),L+=1}return C(),R(),u}function ke(e){const n=_(e)?.recordRange;return n?n[0]:Number.MAX_SAFE_INTEGER}function fo(e){const n=[],t=new Map;for(const s of e){const o=s.collectionId||s.id,r=t.get(o);r?r.push(s):(n.push(o),t.set(o,[s]))}return n.map(s=>{const o=[...t.get(s)??[]].sort((i,a)=>{const u=ke(i)-ke(a);return u!==0?u:i.score-a.score}),r=t.get(s)?.[0]??o[0];return{collectionId:s,best:r,moments:o}})}function Ln(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mo(e,n){const t=N(n);if(t.length===0||e.length===0)return[{text:e,match:!1}];const s=t.map(a=>`(?<![A-Za-z0-9_./~-])${Ln(a)}(?![A-Za-z0-9_./~-])`),o=new RegExp(`(${s.join("|")})`,"giu"),r=[];let i=0;for(const a of e.matchAll(o)){const u=a.index??0;u>i&&r.push({text:e.slice(i,u),match:!1}),r.push({text:a[0],match:!0}),i=u+a[0].length}return i<e.length&&r.push({text:e.slice(i),match:!1}),r.length>0?r:[{text:e,match:!1}]}const po={sessions:"Sessions",skills:"Skills",mcp:"MCP",codebase:"Codebase",context_pack:"Context packs",mixed:"Mixed"},yn=[{value:"1",label:"Last 24h"},{value:"3",label:"Last 3 days"},{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"}],go=["sessions","skills","mcp","codebase","context_pack"];function ho(){return{query:"",sourceKinds:[],harness:[],project:[],timeWindow:"all"}}function Vt(e){return e?yn.some(n=>n.value===e):!1}function Q(e){return e?e.split(",").map(n=>n.trim()).filter(n=>n.length>0):[]}function Yt(e){const n=e==null?new URLSearchParams:typeof e=="string"?new URLSearchParams(e):e,t=n.get("time"),s=Vt(t)?t:"all";return{query:n.get("q")?.trim()??"",sourceKinds:Q(n.get("source")),harness:Q(n.get("harness")),project:Q(n.get("project")),timeWindow:s}}function qt(e,n={}){const t=new URLSearchParams,s=e.query.trim();return s&&t.set("q",s),e.sourceKinds.length>0&&t.set("source",e.sourceKinds.join(",")),e.harness.length>0&&t.set("harness",e.harness.join(",")),e.project.length>0&&t.set("project",e.project.join(",")),e.timeWindow!=="all"&&t.set("time",e.timeWindow),n.hitId&&t.set("hit",n.hitId),t}function wo(e,n){return e.query.trim()===n.query.trim()&&e.timeWindow===n.timeWindow&&X(e.sourceKinds,n.sourceKinds)&&X(e.harness,n.harness)&&X(e.project,n.project)}function X(e,n){if(e.length!==n.length)return!1;const t=[...e].map(o=>o.trim().toLowerCase()).sort(),s=[...n].map(o=>o.trim().toLowerCase()).sort();return t.every((o,r)=>o===s[r])}function Qt(e){return e.query.trim().length>0||e.sourceKinds.length>0||e.harness.length>0||e.project.length>0||e.timeWindow!=="all"}function Io(e){if(e==="all")return null;const n=Number.parseInt(e,10);return!Number.isFinite(n)||n<=0?null:Date.now()-n*24*60*60*1e3}function vo(e){return e==="all"?"Any time":yn.find(t=>t.value===e)?.label??e}const $n=typeof window<"u"?window.location.href:"http://scout.local/";function Xt(e){const n=e.toString();return new URL(n,$n)}function Zt(e){switch(e){case"profile":case"config":case"definitions":return e==="definitions"?"config":e;case"observe":case"message":return e;default:return}}function Jt(e){const n=e.trim().replace(/^#/,"");if(!n.startsWith("msg-"))return null;const t=n.slice(4).trim();if(!t)return null;try{return decodeURIComponent(t)}catch{return t}}function es(e){switch(e){case"control":case"mission":case"command":case"warroom":case"conduct":case"conductor":return"mission";case"plan":return"plan";case"issues":case"errors":case"warnings":return"issues";case"agents":case"tail":case"atop":case"lanes":return e;default:return}}function ns(e){return e==="delivered"||e==="failed"||e==="all"?e:void 0}function ts(e){return e==="indexer"||e==="knowledge"?e:void 0}function ss(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 os(e){switch(e){case"tail":case"session":case"chat":case"work":return e;default:return}}function rs(e){const n=e?.trim().replace(/\.+$/u,"");return n==="observe"||n==="takeover"?n:void 0}function as(e){const n=e?.trim().toLowerCase();return n==="pty"||n==="tmux"||n==="zellij"||n==="herdr"?n:void 0}function is(e){const n=e?.trim().toLowerCase();return n==="shell"||n==="claude"||n==="codex"||n==="pi"?n:void 0}function cs(e){return e==="all"||e==="touched"?"all":e==="changed"?"changed":void 0}function Te(e){if(!e)return;const n=Number.parseInt(e,10);return Number.isSafeInteger(n)&&n>0?n:void 0}function De(e){return e==="mission"?"control":e}function us(e){return e.searchParams.has("no-ops")?!1:typeof window>"u"?!0:en()}function ls(e){return e==="tail"}function ds(e){return e==="lanes"}function En(e){return ls(e)||ds(e)}const Ie="machineId",Rn=new Set(["inbox","conversation","agents-v2","messages","sessions","repos","harnesses","mesh","mesh-ops","activity","work","follow"]);function fs(e){return e.searchParams.get(Ie)?.trim()||void 0}function ms(e,n){return!n||!Rn.has(e.view)?e:{...e,machineId:n}}function ve(e){return Rn.has(e.view)}function ps(e){return"machineId"in e&&e.machineId?e.machineId:null}function Fe(e,n){if(!ve(e))return e;const t={...e},s=n?.trim();return s?t.machineId=s:delete t.machineId,t}function So(e){return ve(e)?{...e,machineId:""}:e}function gs(e,n){return ve(e)?"machineId"in e?Fe(e,e.machineId??null):Fe(e,ps(n)):e}function A(e,n){"machineId"in n&&n.machineId&&e.set(Ie,n.machineId)}function w(e){const n=e.toString();return n?`?${n}`:""}function T(e,n){const t=new URLSearchParams;return A(t,n),`${e}${w(t)}`}function hs(e){return"machineId"in e&&e.machineId?`:machine:${e.machineId}`:""}function Pn(e){const n=Xt(e),t=n.pathname.replace(/^\/+/,"").split("/").filter(Boolean),s=fs(n),o=c=>ms(c,s),r=_t(t,n,o);if(r)return r;const i=Jt(n.hash),a=Zt(n.searchParams.get("tab"))??(i?"message":void 0),u=n.searchParams.get("project")?.trim()||void 0,d=n.searchParams.get("agentId")?.trim()||void 0;if(t[0]==="agent"&&t[1])return{view:"agent-info",conversationId:decodeURIComponent(t[1])};const f=n.searchParams.get("project")?.trim()||void 0,L=n.searchParams.get("harness")?.trim()||void 0,C=n.searchParams.get("node")?.trim()||void 0,R=n.searchParams.get("set")?.trim(),v=R==="live"||R==="ephemeral"||R==="archived"?R:void 0,x=n.searchParams.get("view")?.trim(),z=x==="sessions"||x==="agents"?x:void 0,U=n.searchParams.get("state")?.trim(),Se=U==="needs"||U==="live"||U==="idle"?U:void 0,Tn=n.searchParams.get("ephemeral")==="1",W=n.searchParams.get("session")?.trim()||void 0,S=n.searchParams.get("select")?.trim()||void 0,y={...L?{harness:L}:{},...C?{node:C}:{},...v?{set:v}:{},...z?{indexView:z}:{},...Se?{stateFilter:Se}:{},...Tn?{showEphemeral:!0}:{}};if(t[0]==="projects"){const c=t[1]?decodeURIComponent(t[1]):void 0;if(!c)return o({view:"agents-v2",...S?{selectedAgentId:S}:{},...y});if(t[2]==="agents"){const l=t[3]?decodeURIComponent(t[3]):void 0;if(l){if(t[4]==="c"&&t[5])return o({view:"agents-v2",projectSlug:c,agentId:l,conversationId:decodeURIComponent(t[5]),tab:a??"message",...y});const m=t[4]==="sessions"&&t[5]?decodeURIComponent(t[5]):W;return o({view:"agents-v2",projectSlug:c,agentId:l,...m?{sessionId:m}:{},...a?{tab:a}:{},...y})}return o({view:"agents-v2",projectSlug:c,indexView:"agents",...S?{selectedAgentId:S}:{},...y})}return t[2]==="sessions"?o({view:"agents-v2",projectSlug:c,indexView:"sessions",...t[3]?{sessionId:decodeURIComponent(t[3])}:{},...S?{selectedAgentId:S}:{},...y}):o({view:"agents-v2",projectSlug:c,...S?{selectedAgentId:S}:{},...y})}if(t[0]==="agents-v2"&&t[1]==="sessions"&&t[2])return o({view:"agents-v2",sessionId:decodeURIComponent(t[2]),...S?{selectedAgentId:S}:{},...f?{projectSlug:f}:{},...y});if(t[0]==="agents-v2"&&t[1]){const c=decodeURIComponent(t[1]);return o({view:"agents-v2",agentId:c,...a?{tab:a}:{},...W?{sessionId:W}:{},...f?{projectSlug:f}:{},...y})}if(t[0]==="agents-v2")return o({view:"agents-v2",...S?{selectedAgentId:S}:{},...f?{projectSlug:f}:{},...y});if(t[0]==="agents"&&t[1]){const c=decodeURIComponent(t[1]),l=t[2]==="sessions"&&t[3]?decodeURIComponent(t[3]):W;return t[2]==="c"&&t[3]?o({view:"agents-v2",agentId:c,conversationId:decodeURIComponent(t[3]),tab:a??"message",...y}):o({view:"agents-v2",agentId:c,...l?{sessionId:l}:{},...a?{tab:a}:{},...y})}if(t[0]==="agents")return o({view:"agents-v2",...S?{selectedAgentId:S}:{},...f?{projectSlug:f}:{},...y});if(t[0]==="agents.deprecated"&&t[1]&&t[2]==="sessions"&&t[3])return o({view:"sessions",agentId:decodeURIComponent(t[1]),sessionId:decodeURIComponent(t[3])});if(t[0]==="agents.deprecated"&&t[1]&&t[2]==="c"&&t[3])return o({view:"agents-v2",agentId:decodeURIComponent(t[1]),conversationId:decodeURIComponent(t[3]),tab:a??"message"});if(t[0]==="agents.deprecated"&&t[1]){const c=decodeURIComponent(t[1]);return o({view:"agents-v2",agentId:c,...a?{tab:a}:{},...!a&&u?{projectSlug:u}:{}})}if(t[0]==="agents.deprecated")return o({view:"agents-v2",...u?{projectSlug:u}:{}});if(t[0]==="fleet")return o({view:"inbox"});if(t[0]==="c"&&t[1])return o({view:"conversation",conversationId:decodeURIComponent(t[1])});if(t[0]==="flights"&&t[1]&&t[2]==="observe"){const c=n.searchParams.get("session")?.trim()||void 0,l=n.searchParams.get("compare")?.trim()||void 0;return o({view:"sessions",flightId:decodeURIComponent(t[1]),...c?{sessionId:c}:{},...l?{compareSessionId:l}:{}})}if(t[0]==="sessions"&&t[1])return o({view:"sessions",sessionId:decodeURIComponent(t[1]),...d?{agentId:d}:{}});if(t[0]==="conversations")return o({view:"messages"});if(t[0]==="messages"){const c={view:"messages",...t[1]?{conversationId:decodeURIComponent(t[1])}:{}};return o(c)}if(t[0]==="sessions")return o({view:"sessions",...d?{agentId:d}:{}});if(t[0]==="repos"){const c=n.searchParams.get("root")?.trim()||void 0;return o({view:"repos",...c?{root:c}:{}})}if(t[0]==="providers"||t[0]==="harnesses")return o({view:"harnesses"});if(t[0]==="repo-diff"){const c=n.searchParams.get("path")?.trim();if(c){const l=n.searchParams.getAll("layer").filter(h=>h==="unstaged"||h==="staged"||h==="branch"),m=n.searchParams.getAll("file").map(h=>h.trim()).filter(Boolean),p=n.searchParams.get("sessionId")?.trim()||void 0,I=n.searchParams.get("agentId")?.trim()||void 0,b=cs(n.searchParams.get("include"));return{view:"repo-diff",path:c,...l.length>0?{layers:l}:{},...m.length>0?{files:m}:{},...p?{sessionId:p}:{},...I?{agentId:I}:{},...b?{include:b}:{}}}}if(t[0]==="search"){const c=ts(t[1]),l=n.searchParams.get("hit")?.trim()||void 0,m=Yt(n.searchParams);return{view:"search",...c&&c!=="knowledge"?{mode:c}:{},...l?{hitId:l}:{},...Qt(m)?{filters:m}:{}}}if(t[0]==="channels"&&t[1])return o({view:"messages",conversationId:decodeURIComponent(t[1])});if(t[0]==="channels")return o({view:"messages"});if(t[0]==="mesh")return o({view:"mesh"});if(t[0]==="mesh-ops")return o({view:"mesh-ops",...t[1]?{itemId:decodeURIComponent(t[1])}:{}});if(t[0]==="dispatch"||t[0]==="broker"){const c=n.searchParams.get("attempt")?.trim()||void 0,l=ns(n.searchParams.get("filter"));return{view:"broker",...c?{attemptId:c}:{},...l&&l!=="all"?{filter:l}:{}}}if(t[0]==="code"){const c=n.searchParams.get("wt")?.trim()||void 0,l=n.searchParams.get("fromConversation")?.trim()||void 0,m=Te(n.searchParams.get("line")),p=Te(n.searchParams.get("endLine")),I=m&&p&&p>=m?p:void 0;if(t[1]){const E=decodeURIComponent(t[1]),$=t.length>2?t.slice(2).map(decodeURIComponent).join("/"):void 0;return{view:"code",project:E,...$?{path:$}:{},...c?{wt:c}:{},...m?{line:m}:{},...I?{endLine:I}:{},...l?{returnConversationId:l}:{}}}const b=n.searchParams.get("root")?.trim()||void 0,h=n.searchParams.get("file")?.trim()||void 0;return{view:"code",...b?{root:b}:{},...h?{file:h}:{},...c?{wt:c}:{},...m?{line:m}:{},...I?{endLine:I}:{},...l?{returnConversationId:l}:{}}}if(t[0]==="briefings"&&t[1])return{view:"briefings",briefingId:decodeURIComponent(t[1])};if(t[0]==="briefings")return{view:"briefings"};if(t[0]==="activity")return o({view:"activity"});if(t[0]==="voice")return{view:"voice"};if(t[0]==="work"&&t[1])return o({view:"work",workId:decodeURIComponent(t[1])});if(t[0]==="follow"){const c=os(n.searchParams.get("view")),l={view:"follow",...c?{preferredView:c}:{}},m=t[1],p=t[2]?decodeURIComponent(t[2]):"";m==="flight"&&p&&(l.flightId=p),m==="invocation"&&p&&(l.invocationId=p),m==="conversation"&&p&&(l.conversationId=p),m==="work"&&p&&(l.workId=p),m==="session"&&p&&(l.sessionId=p),m==="agent"&&p&&(l.targetAgentId=p);const I=n.searchParams.get("flightId"),b=n.searchParams.get("invocationId"),h=n.searchParams.get("conversationId"),E=n.searchParams.get("workId"),$=n.searchParams.get("sessionId"),be=n.searchParams.get("targetAgentId");return I&&(l.flightId=I),b&&(l.invocationId=b),h&&(l.conversationId=h),E&&(l.workId=E),$&&(l.sessionId=$),be&&(l.targetAgentId=be),o(l)}if(t[0]==="settings"){if(t[1]==="agents")return{view:"settings",section:"agents",...t[2]?{agentId:decodeURIComponent(t[2])}:{}};const c=ss(t[1]);return{view:"settings",...c?{section:c}:{}}}if(t[0]==="terminal"){const c=rs(n.searchParams.get("mode")),l=n.searchParams.get("session")?.trim()||void 0,m=Mn(n.searchParams.get("surface"))??void 0;if(t[1]==="new"){const I=as(n.searchParams.get("backend"))??"pty",b=is(n.searchParams.get("agent"))??"shell",h=n.searchParams.get("name")?.trim()||void 0,E=n.searchParams.get("tab")?.trim()||void 0,$=n.searchParams.get("socketDir")?.trim()||void 0;return{view:"terminal",terminalBackend:I,terminalAgent:b,...h?{terminalSessionName:h}:{},...E?{terminalTabId:E}:{},...$?{zellijSocketDir:$}:{}}}const p=t[1]==="s"&&t[2]?Me(decodeURIComponent(t.slice(2).join("/")))?decodeURIComponent(t.slice(2).join("/")):null:Bn(t[1]?decodeURIComponent(t[1]):void 0,t[2]?decodeURIComponent(t.slice(2).join("/")):void 0);return p?{view:"terminal",terminalSurfaceKey:p,...l?{terminalSessionId:l}:{},...c?{mode:c}:{}}:{view:"terminal",...t[1]?{agentId:decodeURIComponent(t[1])}:{},...c?{mode:c}:{},...!t[1]&&l?{terminalSessionId:l}:{},...!t[1]&&m?{terminalSurfaceKey:m}:{}}}if(t[0]==="ops"){const c=es(t[1])??"mission";if(!En(c)&&!us(n))return o({view:"inbox"});const l=c==="tail"?n.searchParams.get("q")?.trim():"",m=c==="plan"?n.searchParams.get("plan")?.trim():"",p=n.searchParams.get("flightId")?.trim(),I=n.searchParams.get("invocationId")?.trim(),b=n.searchParams.get("conversationId")?.trim(),h=n.searchParams.get("workId")?.trim(),E=n.searchParams.get("sessionId")?.trim(),$=n.searchParams.get("targetAgentId")?.trim()??n.searchParams.get("agentId")?.trim();return{view:"ops",mode:c,...l?{tailQuery:l}:{},...m?{planDocumentId:m}:{},...p?{flightId:p}:{},...I?{invocationId:I}:{},...b?{conversationId:b}:{},...h?{workId:h}:{},...E?{sessionId:E}:{},...$?{targetAgentId:$}:{}}}return o({view:"inbox"})}function Cn(e,n){const t=e.view==="sessions"&&e.flightId?null:hn(e,n);if(t)return t;switch(e.view){case"inbox":return T("/",e);case"conversation":{const s=new URLSearchParams;return A(s,e),`/c/${encodeURIComponent(e.conversationId)}${w(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),A(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"}${w(s)}`}case"messages":{const s=new URLSearchParams;return A(s,e),`${e.conversationId?`/messages/${encodeURIComponent(e.conversationId)}`:"/messages"}${w(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),A(s,e),`/flights/${encodeURIComponent(e.flightId)}/observe${w(s)}`):(A(s,e),`${e.sessionId?`/sessions/${encodeURIComponent(e.sessionId)}`:"/sessions"}${w(s)}`)}case"repos":{const s=new URLSearchParams;return e.root&&s.set("root",e.root),A(s,e),`/repos${w(s)}`}case"harnesses":return T("/providers",e);case"repo-diff":{const s=new URLSearchParams;s.set("path",e.path);for(const o of e.layers??[])s.append("layer",o);for(const o of e.files??[])s.append("file",o);return e.sessionId&&s.set("sessionId",e.sessionId),e.agentId&&s.set("agentId",e.agentId),e.include&&s.set("include",e.include),`/repo-diff${w(s)}`}case"search":{const s=e.mode==="indexer"?"/search/indexer":"/search",o=e.filters?qt(e.filters,{hitId:e.hitId??null}):new URLSearchParams;return!e.filters&&e.hitId&&o.set("hit",e.hitId),`${s}${w(o)}`}case"mesh":return T("/mesh",e);case"mesh-ops":return T(e.itemId?`/mesh-ops/${encodeURIComponent(e.itemId)}`:"/mesh-ops",e);case"broker":{const s=new URLSearchParams;return e.attemptId&&s.set("attempt",e.attemptId),e.filter&&e.filter!=="all"&&s.set("filter",e.filter),`/dispatch${w(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("/")}`}${w(s)}`}e.root&&s.set("root",e.root),e.file&&s.set("file",e.file),e.returnConversationId&&s.set("fromConversation",e.returnConversationId);const o=s.toString();return o?`/code?${o}`:"/code"}case"briefings":return e.briefingId?`/briefings/${encodeURIComponent(e.briefingId)}`:"/briefings";case"activity":return T("/activity",e);case"voice":return"/voice";case"work":return T(`/work/${encodeURIComponent(e.workId)}`,e);case"settings":return e.section==="agents"?e.agentId?`/settings/agents/${encodeURIComponent(e.agentId)}`:"/settings/agents":e.section?e.section==="pairing"?"/settings/pairing":e.section==="comms"?"/settings/comms":`/settings/${e.section}`:"/settings";case"ops":if(!e.mode)return"/ops";if(e.mode==="tail"||e.mode==="plan"){const s=new URLSearchParams;return e.mode==="tail"&&e.tailQuery&&s.set("q",e.tailQuery),e.mode==="plan"&&e.planDocumentId&&s.set("plan",e.planDocumentId),e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),`/ops/${De(e.mode)}${w(s)}`}return`/ops/${De(e.mode)}`;case"follow":{const s=new URLSearchParams;e.preferredView&&s.set("view",e.preferredView),e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),e.machineId&&s.set(Ie,e.machineId);const o=s.toString();return`/follow${o?`?${o}`:""}`}case"terminal":if(e.agentId){const s=new URLSearchParams;return e.mode&&s.set("mode",e.mode),`/terminal/${encodeURIComponent(e.agentId)}${w(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${w(s)}`;e.mode&&s.set("mode",e.mode);const o=zn(e.terminalSurfaceKey);return o?`/terminal/${encodeURIComponent(o.backend)}/${encodeURIComponent(o.sessionName)}${w(s)}`:Me(e.terminalSurfaceKey)?`/terminal/s/${encodeURIComponent(e.terminalSurfaceKey)}${w(s)}`:(e.terminalSessionId&&s.set("session",e.terminalSessionId),e.terminalSurfaceKey&&s.set("surface",e.terminalSurfaceKey),`/terminal${w(s)}`)}}}function j(e){const n=hs(e);switch(e.view){case"conversation":return`conv:${e.conversationId}${n}`;case"agent-info":return`agent-info:${e.conversationId}`;case"settings":return`settings:${e.section??"pairing"}:${e.agentId??""}`;case"agents-v2":return["agents-v2",e.projectSlug??"",e.harness??"",e.node??"",e.set??"",e.indexView??"agents",e.stateFilter??"",e.showEphemeral?"eph":"",e.agentId??"",e.sessionId??"",n].join(":");case"sessions":return e.flightId?`flight-observe:${e.flightId}:${e.sessionId??""}:${e.compareSessionId??""}${n}`:e.sessionId?`session:${e.agentId??""}:${e.sessionId}${n}`:`sessions${n}`;case"messages":return e.conversationId?`messages:${e.conversationId}${n}`:`messages${n}`;case"work":return`work:${e.workId}${n}`;case"ops":return`ops:${e.mode??"plan"}:${e.tailQuery??""}:${e.planDocumentId??""}:${e.flightId??""}:${e.invocationId??""}:${e.workId??""}:${e.conversationId??""}:${e.sessionId??""}:${e.targetAgentId??""}`;case"search":return`search:${e.mode??"knowledge"}:${e.hitId??""}`;case"broker":return`broker:${e.attemptId??""}`;case"follow":return`follow:${e.flightId??e.invocationId??e.conversationId??e.workId??e.sessionId??e.targetAgentId??""}:${e.preferredView??""}${n}`;case"terminal":return`terminal:${e.agentId??""}:${e.terminalSessionId??""}:${e.terminalSurfaceKey??""}:${e.terminalBackend??""}:${e.terminalAgent??""}:${e.terminalSessionName??""}:${e.terminalTabId??""}:${e.mode??"detail"}`;case"repo-diff":return`repo-diff:${e.path}`;default:return`${e.view}${n}`}}function G(e,n){return ce(Pn(`${e}${n}`))}function An(e){return e?`#${e}`:""}function ws(e){return e.startsWith("/embed/")||e==="/ops/lanes/embed"}function Oe(){if(typeof window>"u"){const e=new URL($n);return{pathname:e.pathname,searchStr:e.search,hash:e.hash.replace(/^#/,""),state:null}}return{pathname:window.location.pathname,searchStr:window.location.search,hash:window.location.hash.replace(/^#/,""),state:window.history.state}}function Is(e,n){return e.pathname===n.pathname&&e.searchStr===n.searchStr&&e.hash===n.hash&&Object.is(e.state,n.state)}function vs(e){let n=e.read();const t=new Set;let s=null;const o=()=>{const r=e.read();if(!Is(n,r)){n=r;for(const i of t)i()}};return{getSnapshot:()=>n,subscribe(r){return s||(s=e.observe(o)),t.add(r),()=>{t.delete(r)}},navigateTo(r,i={}){const a=i.state===void 0?n.state:i.state;i.replace?e.replace(r,a):e.push(r,a),o()}}}function Ss(){return typeof window>"u"?{read:Oe,push:()=>{},replace:()=>{},observe:()=>()=>{}}:{read:Oe,push:(e,n)=>window.history.pushState(n,"",e),replace:(e,n)=>window.history.replaceState(n,"",e),observe:e=>(window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)})}}const F=vs(Ss());function bs(){return P.useSyncExternalStore(F.subscribe,F.getSnapshot,F.getSnapshot)}function ae(e,n={}){F.navigateTo(e,n)}function _n(){return typeof window>"u"?null:window.navigation??null}function Un(){if(typeof window>"u")return!1;const e=_n();return e?e.canGoBack:window.history.length>1}function Ls(){if(!Un())return;const e=_n();if(e){e.back();return}window.history.back()}function bo(e){if(!e||typeof e!="object")return null;const n=e.returnTo;return!n||typeof n!="object"||typeof n.view!="string"?null:n}function Lo(e){return!e||typeof e!="object"?!1:e.returnUseHistory===!0}function xe(e){if(!e||typeof e!="object")return e;const{returnTo:n,returnUseHistory:t,settingsEntry:s,...o}=e;return o}function ys(e,n){if(n.returnTo!==void 0){const t=n.state!==void 0?n.state:xe(e),s=t&&typeof t=="object"?{...t}:{};return s.returnTo=n.returnTo,s.returnUseHistory=n.replace!==!0,s}return n.state!==void 0?n.state:n.replace?e:xe(e)}function kn(e){return e?e.replace(/^#/,""):""}function $s(e,n,t={}){const s=G(e.pathname,e.searchStr),o=gs(n,s),r=t.preserveSearch===!1?"":e.searchStr,i=gn(Cn(o,e.pathname),r),a=kn(t.hash);return{route:o,href:`${i}${a?`#${a}`:""}`}}function Es(e,n){const t=new URLSearchParams(e.searchStr);for(const[r,i]of Object.entries(n.searchPatch??{}))i===null?t.delete(r):t.set(r,i);const s=t.toString(),o=n.hash===void 0?e.hash:kn(n.hash);return`${e.pathname}${s?`?${s}`:""}${o?`#${o}`:""}`}function yo(e){const n=F.getSnapshot(),t=Es(n,e),s=`${n.pathname}${n.searchStr}${An(n.hash)}`;t!==s&&ae(t,{replace:e.replace??!0,state:e.state})}function Rs(e,n,t){if(ws(e))return null;const s=`${e}${n}`,o=Pn(s),r=ce(o),i=gn(Cn(r,e),n);return!(j(o)!==j(r)||r.view==="agents-v2"||s!==i)||s===i?null:`${i}${An(t)}`}function $o(){const{pathname:e,searchStr:n,hash:t}=bs(),s=`${e}${n}`,o=P.useMemo(()=>G(e,n),[e,n]),r=P.useRef({}),i=P.useRef(s);P.useEffect(()=>{const f=Rs(e,n,t);f&&ae(f,{replace:!0})},[e,n,t]),P.useEffect(()=>{if(i.current===s)return;const f=G(e,n);requestAnimationFrame(()=>{window.scrollTo(0,r.current[j(f)]??0)}),i.current=s},[s,e,n]);const a=P.useCallback((f,L={})=>{const C=ce(f.view==="ops"&&!en()&&!En(f.mode)?{view:"inbox"}:f),R=G(e,n),{route:v,href:x}=$s({pathname:e,searchStr:n},C,L);r.current[j(R)]=window.scrollY;const z=F.getSnapshot().state,U=ys(z,L);ae(x,{replace:L.replace,state:U}),requestAnimationFrame(()=>{window.scrollTo(0,r.current[j(v)]??0)})},[e,n]),u=P.useCallback(()=>Ls(),[]),d=Un();return{route:o,navigate:a,navigateBack:u,canNavigateBack:d}}export{Ks as $,jt as A,pe as B,_ as C,so as D,ao as E,ro as F,Io as G,mo as H,vo as I,rt as J,no as K,ot as L,at as M,it as N,Ds as O,yo as P,Xs as Q,pn as R,go as S,mn as T,Js as U,Ms as V,xs as W,Bs as X,yt as Y,Ns as Z,St as _,Cn as a,$t as a0,Hs as a1,Vs as a2,Gs as a3,Ys as a4,zs as a5,Ws as a6,js as a7,tn as a8,nn as a9,oe as aA,co as aB,io as aC,Sn as aD,ve as aa,qs as ab,Qs as ac,V as ad,ne as ae,Us as af,se as ag,q as ah,At as ai,Dt as aj,_t as ak,gn as al,Ft as am,tt as an,Zs as ao,hn as ap,We as aq,eo as ar,$o as as,Vn as at,wn as au,B as av,to as aw,uo as ax,bn as ay,lo as az,Qn as b,Wn as c,ps as d,So as e,qe as f,Ts as g,ue as h,lt as i,ks as j,Fs as k,Os as l,bo as m,Lo as n,ho as o,Yt as p,fo as q,Pn as r,Fe as s,Qt as t,bs as u,wo as v,_s as w,po as x,yn as y,oo as z};
|
|
1
|
+
import{t as ie,v as Dn,w as je,x as Ne,k as Fn,y as On,s as k,l as g,z as xn,A as Z,B as jn,C as Nn,r as P}from"./index-Bli6bTLU.js";import{n as ce}from"./synthetic-agent-routing-aduMYO7P.js";import{o as Mn,q as Me,n as Bn,u as zn}from"./terminal-sessions-D4dHTRkt.js";const Be=["local","url","sharedConfig","env"];function Wn(e){const n=Kn(e),t=e.audienceIncludes??Gn(e.audienceOrder),s=new Set;function o(a){!e.warnOnUnknown||s.has(a)||(s.add(a),typeof console<"u"&&typeof console.warn=="function"&&console.warn(`[hudsonkit/flags] Unknown feature flag "${a}" resolved false.`))}const r=e.registry;function i(a){const u=r[a];if(!u)return o(a),{key:a,enabled:!1,value:!1,layer:"default",audience:n,reason:"unknown-flag"};const d=Hn(e.layers,a);return d?{key:a,enabled:d.value,value:d.value,layer:d.layer,audience:n,requiredTier:u.tier,reason:"override",definition:u}:u.defaultEnabled?u.tier&&!t(n,u.tier)?{key:a,enabled:!1,value:!1,layer:"default",audience:n,requiredTier:u.tier,reason:"audience-denied",definition:u}:{key:a,enabled:!0,value:!0,layer:"default",audience:n,requiredTier:u.tier,reason:"default",definition:u}:{key:a,enabled:!1,value:!1,layer:"default",audience:n,requiredTier:u.tier,reason:"default",definition:u}}return{registry:e.registry,isEnabled:a=>i(String(a)).enabled,explain:a=>i(String(a)),all:()=>Object.keys(e.registry).sort().map(i),audience:()=>n}}function Kn(e){let n=e.audience.tier;for(const t of Be.slice().reverse()){const s=e.layers?.[t]?.audience;s&&(n=s)}return{...e.audience,tier:n}}function Gn(e){return(n,t)=>{if(n.tier===t)return!0;if(!e||e.length===0)return!1;const s=e.indexOf(n.tier),o=e.indexOf(t);return s<0||o<0?!1:s>=o}}function Hn(e,n){for(const t of Be){const s=Vn(e?.[t]?.flags?.[n]);if(s!==null)return{layer:t,value:s}}return null}function Vn(e){return e===!0||e==="on"?!0:e===!1||e==="off"?!1:null}function Yn(e){if(e===!0||e===!1)return e;if(typeof e=="number"){if(e===1)return!0;if(e===0)return!1}if(typeof e!="string")return;const n=e.trim().toLowerCase();if(["1","true","on","yes","enabled","enable"].includes(n))return!0;if(["0","false","off","no","disabled","disable"].includes(n))return!1;if(["default","null","unset","clear"].includes(n))return"default"}function qn(e,n={}){const t=n.paramPrefix??"ff.",s=n.audienceParam??"ffAudience",o=typeof e=="string"?new URL(e,"http://hudson.local"):e,r={};let i;for(const[a,u]of o.searchParams.entries()){if(a===s&&u.trim()&&(i=u.trim()),!a.startsWith(t))continue;const d=a.slice(t.length),f=Yn(u);d&&f!==void 0&&(r[d]=f)}return{flags:r,audience:i}}const D=1;function Qn(e){if(typeof window>"u")return{version:D};try{const n=window.localStorage?.getItem(e);return Xn(n)}catch{return{version:D}}}function _s(e,n){if(typeof window>"u")return;const t=ze(n),s=JSON.stringify(t);try{window.localStorage?.setItem(e,s)}catch{}Zn(e,s)}function Xn(e){if(!e)return{version:D};try{const n=JSON.parse(e);return!n||typeof n!="object"?{version:D}:ze(n)}catch{return{version:D}}}function ze(e){const n={version:D};if(e.audience&&(n.audience=e.audience),e.flags&&typeof e.flags=="object"){n.flags={};for(const[t,s]of Object.entries(e.flags))(s===!0||s===!1)&&(n.flags[t]=s);Object.keys(n.flags).length===0&&delete n.flags}return n}function Zn(e,n){if(!(typeof document>"u"))try{const t=encodeURIComponent(n);document.cookie=`${encodeURIComponent(e)}=${t}; Path=/; SameSite=Lax; Max-Age=31536000`}catch{}}const Jn=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal"],et=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.scoutbot","surface.workflows"];function Le(e,n){return Object.fromEntries(e.map(t=>[t,n]))}const We={label:"Surface · Scope",description:`Scope presentation on Scout infra — lean lanes/tail/sessions/agents at ${Dn}/*.`,defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","scope","observability"]},nt={...We,label:"Surface · Scope (legacy alias)",description:`Legacy alias for ${ie}. Prefer the primary flag; ${je} remains for old dev links.`},Us=ie;function tt(){return{audience:"everyone",flags:{"ops.control":!0,"ops.lanes":!0,...Le(Jn,!1),...Le(et,!1)}}}const Ke=["ffBundle","ffVariant","scoutBundle","scoutExperience","ab"],Ge=["ffGlobal","scoutGlobalBundle"],He=["ffPersist","persistBundle"],st=new Set(["no-ops","ffAudience",...Ke,...Ge,...He]);function ks(e){for(const n of[...e.searchParams.keys()])(st.has(n)||n.startsWith("ff."))&&e.searchParams.delete(n);return e}const ot=["everyone","internal","power"],rt="openscout.flags",J="openscout.flagBundle",at={tier:"power"},ye=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal","ops.lanes"],$e=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.mesh-ops","surface.scoutbot","surface.realtime-voice","surface.workflows"],it={"nav.sidebar":{label:"Nav · Sidebar",description:"Classic sidebar chrome (8 primary areas + icon rail). Default on since sco-083 soak; opt out with ?ff.nav.sidebar=off. Not included in max-pro.",defaultEnabled:!0,tier:"everyone",owner:"scout-web",tags:["nav","chrome"]},"ops.control":{label:"Ops · Control",description:"Mission control, issues, and the Ops section shell.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops","nav"]},"ops.mesh":{label:"Ops · Mesh",description:"Mesh topology and peer status.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.runtime":{label:"Ops · Runtime",description:"Runtime / atop process telemetry.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.plans":{label:"Ops · Plans",description:"Plan documents and plan-mode review.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.terminal":{label:"Ops · Terminal",description:"Observe / takeover terminal sessions.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.lanes":{label:"Ops · Agent Lanes",description:"One column per local agent — follow live harness work in power-user mode.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"surface.search":{label:"Surface · Search",description:"Knowledge + indexer search as a top-level nav entry.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","nav"]},"surface.sessions":{label:"Surface · Sessions",description:"Standalone top-level Sessions entry (still reachable under Agents).",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","nav"]},"surface.briefings":{label:"Surface · Briefings",description:"Briefings list + detail.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.work":{label:"Surface · Work",description:"Work item detail.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.activity":{label:"Surface · Activity",description:"Activity stream.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.follow":{label:"Surface · Follow",description:"Follow view.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.mesh-ops":{label:"Surface · Mesh Ops",description:"Mesh Ops — work-item triage over the mesh (hosts rail, item list, inspector).",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","ops"]},"surface.scoutbot":{label:"Surface · Scoutbot",description:"Scoutbot assistant — the inspector panel, the status-bar broadcast chip, and the Message-Scout command-palette actions.",defaultEnabled:!0,tier:"everyone",owner:"scout-web",tags:["surface","assistant"]},"surface.realtime-voice":{label:"Surface · Realtime voice",description:"Live WebRTC voice conversations with Scoutbot through OpenAI Realtime.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","assistant","voice"]},"surface.workflows":{label:"Surface · Workflows",description:"Observed harness families / workflow topology telemetry on the Agents directory. Off in the lean view — the directory is just the project-grouped agent board.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","observability"]},[ie]:We,[je]:nt},ct={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",...On},Ee=new Set(["clear","default","none","reset","unset"]);function K(e,n){return Object.fromEntries(e.map(t=>[t,n]))}function Ve(...e){const n={};for(const t of e)t.audience&&(n.audience=t.audience),t.flags&&Object.keys(t.flags).length>0&&(n.flags={...n.flags??{},...t.flags});return n}function ue(e){switch(e){case"light-prod":return{audience:"everyone",flags:{...K(ye,!1),...K($e,!1)}};case"max-pro":return{audience:"power",flags:{...K(ye,!0),...K($e,!0)}};case Fn:return tt()}}function O(e){return e?ct[e.trim().toLowerCase()]??null:null}function ee(e,n){for(const t of n){const s=e.get(t);if(s!==null)return s}return null}function Ye(e){const n=ee(e,Ke);return O(n)}function ut(e){const n=ee(e,Ge);if(n){const i=n.trim().toLowerCase();if(Ee.has(i))return{action:"clear"};const a=O(n);return a?{action:"set",bundle:a}:null}const t=ee(e,He);if(!t)return null;const s=t.trim().toLowerCase();if(Ee.has(s))return{action:"clear"};if(["0","false","no"].includes(s))return null;const o=O(t);if(o)return{action:"set",bundle:o};const r=Ye(e);return r?{action:"set",bundle:r}:null}function qe(){if(typeof window>"u")return null;try{return O(window.localStorage.getItem(J))}catch{return null}}function lt(e){if(!(typeof window>"u"))try{e.action==="clear"?window.localStorage.removeItem(J):window.localStorage.setItem(J,e.bundle)}catch{}}function Ts(){return qe()??O(Ne())??Xe}function Qe(){const e=qe();return e?ue(e):{}}const Xe="light-prod";function Ze(){const e=O(Ne())??Xe;return ue(e)}function dt(e){const n=ut(e);n&<(n)}function Je(e=new URLSearchParams(window.location.search)){const n=qn(window.location.href),t=Ye(e),s=t?ue(t):{},o={audience:n.audience??s.audience,flags:{...s.flags??{},...n.flags??{}}};return e.has("no-ops")&&(o.flags={...o.flags,"ops.control":!1}),o}function ft(){const e=Qn(rt);return{flags:e.flags,audience:e.audience??void 0}}function Ds(){if(typeof window>"u")return{};const e=new URLSearchParams(window.location.search);return dt(e),{sharedConfig:Ve(Ze(),Qe()),url:Je(e)}}function mt(e){const n=typeof window>"u"?{}:{sharedConfig:Ve(Ze(),Qe()),url:Je(),local:ft()};return Wn({registry:it,audience:at,audienceOrder:ot,layers:n,warnOnUnknown:!1}).isEnabled(e)}function en(){return mt("ops.control")}const ne={sm:408,md:512,lg:616},nn=240,tn=640,pt=24,sn="openscout:lane-deck:v1",gt=new Set(["web.ops","macos.lanes","hud.tail","web.embed"]),le=new Set(["sm","md","lg"]),on={"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}},ht=on["web.ops"];function de(e){return rn(e)?on[e]:ht}const H={pinned_left:0,main:1,pinned_right:2};function rn(e){return gt.has(e)}function Fs(e=window.location.search,n=window.location.pathname){const t=new URLSearchParams(e),s=t.get("profile")?.trim().toLowerCase();if(s&&rn(s))return s;const o=t.get("embed")?.trim().toLowerCase();return o==="hud"?"hud.tail":o==="app"?"macos.lanes":n.includes("/lanes/embed")?"web.embed":(n.includes("/ops/lanes"),"web.ops")}function Os(e=window.location.search){const n=new URLSearchParams(e),t=(n.get("lanes")??n.get("size"))?.trim().toLowerCase();return t&&le.has(t)?t:"lg"}function xs(e,n){if(typeof e=="number"&&Number.isFinite(e))return Math.min(tn,Math.max(nn,Math.round(e)));const t=typeof e=="string"&&le.has(e)?e:n;return ne[t]}function js(e){const n=Math.min(tn,Math.max(nn,Math.round(e)));let t=null,s=Number.POSITIVE_INFINITY;for(const[o,r]of Object.entries(ne)){const i=Math.abs(r-n);i<s&&(s=i,t=o)}return t&&s<=pt?{px:ne[t],tier:t}:{px:n,tier:null}}function fe(e,n,t){return{version:1,profileId:e,defaultLaneWidth:n??t.defaultLaneWidth,defaultHorizon:t.defaultHorizon,laneWidths:{},laneDefs:[],slots:[],showAutoLanes:t.showAutoLanes,updatedAt:Date.now()}}function Re(e,n){const t=de(e);return fe(e,n,t)}function te(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&le.has(e))return e}function wt(e){if(!e||typeof e!="object")return null;const n=e;return typeof n.id!="string"||!n.id.trim()||n.kind!=="session"&&n.kind!=="harness"&&n.kind!=="project"&&n.kind!=="attention"||typeof n.title!="string"||!n.title.trim()?null:{id:n.id.trim(),kind:n.kind,title:n.title.trim(),sessionId:typeof n.sessionId=="string"?n.sessionId.trim():void 0,harness:typeof n.harness=="string"?n.harness.trim():void 0,projectPath:typeof n.projectPath=="string"?n.projectPath.trim():void 0}}function It(e){if(!e||typeof e!="object")return null;const n=e;return typeof n.id!="string"||!n.id.trim()||typeof n.laneDefId!="string"||!n.laneDefId.trim()||n.zone!=="pinned_left"&&n.zone!=="main"&&n.zone!=="pinned_right"||typeof n.position!="number"||!Number.isFinite(n.position)?null:{id:n.id.trim(),laneDefId:n.laneDefId.trim(),zone:n.zone,position:n.position,width:te(n.width)}}function an(e,n,t,s){if(!e||typeof e!="object")return fe(n,t,s);const o=e,r=Array.isArray(o.laneDefs)?o.laneDefs.map(wt).filter(d=>d!==null):[],i=Array.isArray(o.slots)?o.slots.map(It).filter(d=>d!==null):[],a={};if(o.laneWidths&&typeof o.laneWidths=="object")for(const[d,f]of Object.entries(o.laneWidths)){const L=te(f);L!==void 0&&(a[d]=L)}const u=te(o.defaultLaneWidth);return{version:1,profileId:n,defaultLaneWidth:(typeof u=="string"?u:void 0)??t??s.defaultLaneWidth,defaultHorizon:typeof o.defaultHorizon=="string"?o.defaultHorizon:s.defaultHorizon,laneWidths:a,laneDefs:r,slots:i,showAutoLanes:typeof o.showAutoLanes=="boolean"?o.showAutoLanes:s.showAutoLanes,updatedAt:typeof o.updatedAt=="number"?o.updatedAt:Date.now()}}function vt(e,n,t){return an(e,n,t,de(n))}function Ns(e,n){const t=de(e),s=n??t.defaultLaneWidth;try{const o=localStorage.getItem(`${sn}:${e}`);return o?vt(JSON.parse(o),e,s):Re(e,s)}catch{return Re(e,s)}}function St(e){try{localStorage.setItem(`${sn}:${e.profileId}`,JSON.stringify({...e,updatedAt:Date.now()}))}catch{}}function Ms(e){return[...e].sort((n,t)=>{const s=H[n.zone]-H[t.zone];return s!==0?s:n.position-t.position})}function Bs(e,n){return H[e]-H[n]}function cn(){return`slot:${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function me(e){return e.trim().toLowerCase().replace(/['"]/gu,"").replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function Y(e){return`session:${e}`}function bt(e){return`harness:${me(e)}`}function Lt(e){return`project:${me(e)}`}const yt="attention:needs-input";function un(e,n){const t=e.filter(s=>s.zone===n);return t.length===0?0:Math.max(...t.map(s=>s.position))+1}function ln(e,n){const t=e.laneDefs.some(s=>s.id===n.id);return{...e,laneDefs:t?e.laneDefs.map(s=>s.id===n.id?n:s):[...e.laneDefs,n]}}function dn(e,n){const t=e.slots.some(s=>s.id===n.id);return{...e,slots:t?e.slots.map(s=>s.id===n.id?n:s):[...e.slots,n]}}function fn(e,n){return{...e,slots:e.slots.filter(t=>t.laneDefId!==n)}}function $t(e,n){const t=Y(n);return{...fn(e,t),laneDefs:e.laneDefs.filter(s=>s.id!==t)}}function zs(e,n){const t=Y(n);return e.slots.some(s=>s.laneDefId===t&&s.zone!=="main")}function Ws(e,n){const t=Y(n),s=e.slots.find(o=>o.laneDefId===t);return!s||s.zone==="main"?null:s.zone}function Ks(e,n){const t=n.zone??"pinned_left",s=Y(n.laneId),o=$t(e,n.laneId),r=ln(o,{id:s,kind:"session",title:n.title,sessionId:n.laneId});return dn(r,{id:cn(),laneDefId:s,zone:t,position:un(r.slots,t),width:n.width})}function Gs(e,n){const t=n.zone??"pinned_left",s=n.kind==="attention"?yt:n.kind==="harness"&&n.harness?bt(n.harness):n.kind==="project"&&n.projectPath?Lt(n.projectPath):`${n.kind}:${me(n.title)}`,o=fn(e,s),r=ln(o,{id:s,kind:n.kind,title:n.title,harness:n.harness,projectPath:n.projectPath});return dn(r,{id:cn(),laneDefId:s,zone:t,position:un(r.slots,t),width:n.width})}function Hs(e,n,t){return{...e,laneWidths:{...e.laneWidths,[n]:t},updatedAt:Date.now()}}function Vs(e,n){return{...e,defaultLaneWidth:n,updatedAt:Date.now()}}function Ys(e){const n=new Set(e.slots.filter(t=>t.zone!=="main").map(t=>t.laneDefId));return{...e,slots:e.slots.filter(t=>t.zone==="main"),laneDefs:e.laneDefs.filter(t=>!n.has(t.id))}}const V="scope.lanes",se={defaultLaneWidth:"md",showAutoLanes:!0,defaultHorizon:"30m"},Et="openscout:lane-deck:v1";function Pe(e){return fe(V,e,se)}function qs(e){const n=e??se.defaultLaneWidth;try{const t=localStorage.getItem(`${Et}:${V}`);return t?an(JSON.parse(t),V,n,se):Pe(n)}catch{return Pe(n)}}function Qs(e){St(e)}const Rt=[g.lanes,g.tail,g.sessions,g.agents];function Pt(e){return Rt.includes(e)}function Ct(e){return e===jn||e===Nn}function mn(e){return xn(e)}function q(e,n={}){switch(e){case g.tail:{const t=new URLSearchParams;n.tailQuery&&t.set("q",n.tailQuery);const s=t.toString();return k(e,s?`?${s}`:"")}case g.sessions:return n.sessionId?k(e,`/${encodeURIComponent(n.sessionId)}`):k(e);case g.lanes:return k(Z);case g.agents:return k(e);default:return k(Z)}}function pn(e){switch(e.view){case"ops":return!e.mode||e.mode==="lanes"?g.lanes:e.mode==="tail"?g.tail:null;case"sessions":return e.agentId?null:g.sessions;case"agents-v2":return e.agentId||e.projectSlug||e.sessionId||e.conversationId?null:g.agents;default:return null}}function At(e){const n=pn(e);return n?n===g.tail&&e.view==="ops"?q(n,{tailQuery:e.tailQuery}):n===g.sessions&&e.view==="sessions"?q(n,{sessionId:e.sessionId}):q(n):null}function _t(e,n,t){if(!Ct(e[0]))return null;const s=e[1]??Z;if(!Pt(s))return{view:"ops",mode:"lanes"};switch(s){case g.tail:{const o=n.searchParams.get("q")?.trim();return{view:"ops",mode:"tail",...o?{tailQuery:o}:{}}}case g.sessions:return e[2]?t({view:"sessions",sessionId:decodeURIComponent(e[2])}):t({view:"sessions"});case g.agents:return t({view:"agents-v2"});case g.lanes:default:return{view:"ops",mode:"lanes"}}}const Ut=new Set(["no-ops","ffBundle","ffVariant","scoutBundle","scoutExperience","ab","ffGlobal","scoutGlobalBundle","ffPersist","persistBundle","ffAudience","studio","studioInjection","studioMode"]),kt=["ff.","studio.","studioMode."];function Tt(e){return Ut.has(e)||kt.some(n=>e.startsWith(n))}function gn(e,n=""){const t=new URL(e,"http://scout.local");new URLSearchParams(n).forEach((r,i)=>{Tt(i)&&(t.searchParams.has(i)||t.searchParams.set(i,r))});const o=t.searchParams.toString();return`${t.pathname}${o?`?${o}`:""}`}function Xs(e){switch(e){case g.tail:return{view:"ops",mode:"tail"};case g.sessions:return{view:"sessions"};case g.agents:return{view:"agents-v2"};case g.lanes:default:return{view:"ops",mode:"lanes"}}}function Dt(e=typeof window<"u"?window.location.pathname:""){return mn(e)}function Zs(){return V}function Js(e=Dt()){return e?{"data-scope-presentation":!0}:void 0}function hn(e,n=typeof window<"u"?window.location.pathname:""){return mn(n)?At(e):null}function Ft(e,n=typeof window<"u"?window.location.pathname:""){return hn(e,n)!==null}function eo(e,n=typeof window<"u"?window.location.pathname:""){return Ft(e,n)?pn(e):null}const no={days:3,sessionLimit:200,hitLimit:60,debounceMs:180};function oe(e){return e.root==="HOME"?`~/${e.relPath}`:e.root==="ABSOLUTE"?e.relPath:`$${e.root}/${e.relPath}`}function Ce(e){const n=e?.trim();if(!n)return null;const t=n.replace(/[\\/]+$/,""),s=t.split(/[\\/]/).filter(Boolean).at(-1)??t;return s.endsWith(".jsonl")?s.slice(0,-6):s}function _(e){return e.sourceRefs.find(n=>n.kind==="harness_transcript")??null}function wn(e){return e.sourceRefs.find(n=>n.kind==="file")??null}function pe(e){return e?Ce(e.sessionId)??Ce(oe(e.path)):null}function to(e){const n=pe(e);if(!n)return null;const t=e?.recordRange;return t?`${n}|records ${t[0]}..${t[1]}`:n}function B(e,n){const t=e.facets[n];return Array.isArray(t)?t.filter(Boolean).join(", "):typeof t=="string"?t:""}function N(e){const n=new Set;return e.split(/[^A-Za-z0-9_./-]+/u).map(t=>t.trim()).filter(t=>t.length>1).filter(t=>{const s=t.toLowerCase();return n.has(s)?!1:(n.add(s),!0)}).slice(0,12)}const Ot=/^(events?\s+window(\s+\d+)?|files?\s+touched|tool\s+calls?|indexed\s+snippet|manifest|summary|decisions?|context\s+pack)\b/iu,Ae=/^(claude|codex|kimi|cursor|gpt|gemini)\b/iu,_e=/^(?: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 In(e){return Ot.test(e.replace(/\s+/g," ").trim())}function xt(e){let n=e.replace(/\s+/g," ").trim();if(!n)return"";if(n=n.replace(/<[^>\n]+>/g," ").replace(/\s+/g," ").trim(),_e.test(n))n=n.replace(_e,"").trim();else{const t=n.match(/^(.{6,72}?)\s[-–—]\s+(.+)$/u);if(t){const s=t[1]??"",o=t[2]??"";(Ae.test(s)||/\b(?:am|pm|\d{1,2}:\d{2}|plugin|session|openscout)\b/iu.test(s))&&(n=o.trim())}}return n=n.replace(Ae,"").replace(/^\s*[-–—:]\s*/,"").trim(),n=n.replace(/\s{2,}/g," ").trim(),n.length>72&&(n=`${n.slice(0,69).replace(/\s+\S*$/u,"").trimEnd()}…`),n}function jt(e){const n=B(e,"project"),t=e.title.replace(/\s+/g," ").trim();if(t&&!In(t)){const o=xt(t);if(o&&o.toLowerCase()!==n.toLowerCase()||o)return o}if(n)return n;const s=pe(_(e));return s?s.length>18?`${s.slice(0,16)}…`:s:"Session match"}function vn(e){const n=M(e,"recordKind",8).map(s=>s.toLowerCase());if(n.length===0&&n.push(...M(e,"recordTag",8).map(s=>s.toLowerCase())),n.some(s=>s.includes("assistant")))return"assistant";if(n.some(s=>s.includes("user")))return"user";if(n.some(s=>s.includes("tool")||s.includes("command")||s.includes("response")))return"tool";const t=he(e);return t==="tool activity"?"tool":t==="overview"?"overview":""}function so(e,n){const t=we(e.snippet,n),s=vn(e),o=ge(e);let r="";if(t){const i=N(n).map(d=>d.toLowerCase()),a=t.split(new RegExp("(?<=[.!?])\\s+|\\s+[–—]\\s+|\\s+·\\s+","u")).map(d=>d.replace(/^…+|…+$/gu,"").trim()).filter(d=>d.length>12);r=((i.length>0?a.find(d=>i.some(f=>re(d,f)>=0)):void 0)??a[0]??t).replace(/^…+|…+$/gu,"").trim()}return r?(r.length>78&&(r=`${r.slice(0,75).replace(/\s+\S*$/u,"").trimEnd()}…`),r):s&&o?`${s} · ${o}`:o||s||jt(e)}function Nt(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 Ue(e){const n=e.trim().toLowerCase();return n?n==="events"||n.startsWith("events")?"conversation":n==="overview"||n==="summary"?"overview":n==="tool-calls"||n==="tools"?"tool activity":n==="files"||n==="files-touched"?"files touched":n==="manifest"?"session index":n.replace(/[-_]+/g," "):""}function Mt(e){const n=e.trim();return n?n.charAt(0).toUpperCase()+n.slice(1):""}function Bt(e){const n=B(e,"harness")||_(e)?.harness||"";if(!n)return"";const t=n.toLowerCase();return t==="claude"?"Claude":t==="codex"?"Codex":t==="kimi"?"Kimi":t==="cursor"?"Cursor":Mt(n)}function zt(e){const n=B(e,"sessionId").trim(),t=pe(_(e)),s=(n||t||"").trim();return s?s.length>14?s.slice(0,8):s:""}function ge(e){const n=_(e)?.recordRange;if(n){const[s,o]=n;return s===o?`turn ${s}`:o-s<=1?`turns ${s}–${o}`:`turns ${s}–${o}`}const t=e.title.match(/events?\s+window\s+(\d+)/iu);return t?`window ${Number(t[1])}`:""}function Wt(e){const n=M(e,"recordKind",8).map(s=>s.toLowerCase());n.length===0&&n.push(...M(e,"recordTag",8).map(s=>s.toLowerCase()));const t=[];return n.some(s=>s.includes("user"))&&t.push("user"),n.some(s=>s.includes("assistant"))&&t.push("assistant"),n.some(s=>s.includes("tool")||s.includes("command")||s.includes("response"))&&t.push("tool"),t.length===0?"":t.join(" · ")}function he(e){const n=B(e,"documentKind");if(n){const s=n.split(",")[0]?.trim()??n;return Ue(s)}return In(e.title)?Ue(e.title):wn(e)?"file":_(e)?"conversation":""}function M(e,n,t=3){const s=e.facets[n];return(Array.isArray(s)?s:typeof s=="string"?s.split(","):[]).map(r=>r.trim()).filter(Boolean).slice(0,t)}function oo(e){return{agent:Bt(e),project:B(e,"project"),session:zt(e),when:Nt(e),turn:ge(e),role:Wt(e),where:he(e)}}function ro(e){const n=[],t=ge(e);t&&n.push(t);const s=vn(e);s&&n.push(s);const o=he(e);o&&o!=="conversation"&&n.push(o);const r=M(e,"toolName",2);r.length===1&&n.push(r[0]),r.length>1&&n.push(r.join(", "));const i=new Set;return n.filter(a=>{const u=a.toLowerCase();return i.has(u)?!1:(i.add(u),!0)})}function re(e,n){return new RegExp(`(?<![A-Za-z0-9_./~-])${Ln(n)}(?![A-Za-z0-9_./~-])`,"iu").exec(e)?.index??-1}function we(e,n=""){let t=e.replace(/\s+/g," ").trim();if(!t)return"";if(t=t.replace(/\s*-\s*\[\d{3,}\]\s*`[^`]+`(?:\s*\([^)]*\))?\s*-\s*/gu," "),t=t.replace(/\[\d{3,}\]\s*`[^`]+`\s*/gu,""),t=t.replace(/\*\*/gu,""),t=t.replace(/\b(?:assistant_turn|user_turn|agent_reasoning|command_or_tool|response_item|system_record)\b/giu," "),t=t.replace(/(?:~\/|\.\.?\/|\/(?:Users|home|var|tmp|opt)\/)\S+/gu," "),t=t.replace(/https?:\/\/\S+/gu," "),t=t.replace(/\b[\w.-]+\.(?:com|net|org|io|dev|app)(?:\/\S*)?/giu," "),t=t.replace(/\{[^{}]{0,160}\}/gu," "),t=t.replace(/`[^`]{0,64}`/gu,r=>{const i=r.slice(1,-1);return N(n).some(a=>re(i,a)>=0)||/^[A-Za-z][\w.-]{0,24}$/u.test(i)?i:" "}),t=t.replace(/\s{2,}/g," ").trim(),t=t.replace(/^[\s,;:.\-–—|/]+/u,"").trim(),t.includes("{")||t.includes("[")){const r=t.search(/[\[{]/u);if(r>18){const i=t.slice(0,r).trim().replace(/[-–—,:;]+$/u,"").trim();i&&(t=i)}}const s=N(n),o=200;if(s.length>0&&t.length>o){let r=-1;for(const i of s){const a=re(t,i);a>=0&&(r<0||a<r)&&(r=a)}if(r<0)for(const i of s){if(i.length<4)continue;const a=t.toLowerCase().indexOf(i.toLowerCase());a>=0&&(r<0||a<r)&&(r=a)}if(r>=0){const a=Math.max(0,r-48),u=Math.min(t.length,a+o),d=t.slice(a,u).trim();t=`${a>0?"…":""}${d}${u<t.length?"…":""}`}else t=`${t.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`}else t.length>o&&(t=`${t.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`);return t.replace(/\s{2,}/g," ").trim()}function ao(e,n,t){const s=we(e.snippet,n);return s.length<=t?s:`${s.slice(0,t-1).replace(/\s+\S*$/u,"").trimEnd()}…`}function Kt(e,n){return N(n).filter(t=>{const s=t.toLowerCase();return e.title.toLowerCase().includes(s)||e.snippet.toLowerCase().includes(s)||we(e.snippet,n).toLowerCase().includes(s)})}function Sn(e){const n=(e.kind||e.role||e.type||"record").toLowerCase();return n==="assistant_turn"||n==="assistant"?"assistant":n==="user_turn"||n==="user"?"user":n==="system_record"||n==="system"?"system":n==="command_or_tool"||n==="tool_use"?"tool":n==="response_item"?"tool output":n==="agent_reasoning"||n==="reasoning"?"reasoning":n.replace(/_/gu," ")}function bn(e){const n=(e.kind||e.role||e.type||"").toLowerCase();return n==="assistant"||n==="assistant_turn"||n==="user"||n==="user_turn"||n==="last-prompt"||n==="ai-title"?0:n==="system"||n==="system_record"||n.includes("reasoning")?1:2}function io(e){return e.scoreSource==="hybrid"?"Words and meaning":e.scoreSource==="vector"?"Similar in meaning":"Exact words"}function co(e,n,t){const s=Kt(e,n),o=s.length===1?`Matched “${s[0]}”`:s.length>1?`Matched ${s.length} terms`:"Matched in this session";if(!t?.matched)return o;const r=[t.renderedText,t.summary].filter(Boolean).join(" ").toLowerCase(),i=s.filter(d=>r.includes(d.toLowerCase()));if(i.length===0)return o;const a=Sn(t),u=a==="assistant"?"an assistant reply":a==="user"?"your message":a==="tool"?"a tool call":a==="tool output"?"tool output":a==="system"?"a system record":a==="reasoning"?"agent reasoning":`a ${a} record`;return i.length===1?`Matched “${i[0]}” in ${u}`:`Matched ${i.length} terms in ${u}`}function uo(e){const n=_(e);if(n){const s=oe(n.path),o=n.recordRange;return o?`${s}#R${o[0]}-R${o[1]}`:s}const t=wn(e);if(t){const s=oe(t.path),o=t.lineRange;return o?`${s}#L${o[0]}-L${o[1]}`:s}return e.id}function Gt(e){const n=e.filter(o=>bn(o)===2).length,t=e.length-n,s=e.some(o=>o.matched)?" · match inside":"";return n>0&&t===0?`${n} tool step${n===1?"":"s"}${s}`:n===0?`${t} process step${t===1?"":"s"}${s}`:`${n} tool + ${t} process step${e.length===1?"":"s"}${s}`}function Ht(e){return`${e.length} more conversation turn${e.length===1?"":"s"}`}function lo(e,n={}){if(e.length===0)return[];const t=n.contextRadius??3,s=n.maxTurns??6,o=n.centerRecordIndex===void 0?-1:e.findIndex(v=>v.index===n.centerRecordIndex),r=e.findIndex(v=>v.matched),i=o>=0?o:r>=0?r:0,a=e.slice(Math.max(0,i-t),Math.min(e.length,i+t+1)),u=[];let d=[],f=[],L=0;const C=()=>{d.length!==0&&(u.push({kind:"folded",records:d,summary:Gt(d)}),d=[])},R=()=>{f.length!==0&&(u.push({kind:"folded",records:f,summary:Ht(f)}),f=[])};for(const v of a){if(bn(v)>0){R(),d.push(v);continue}if(C(),L>=s){f.push(v);continue}u.push({kind:"turn",record:v,role:Sn(v)}),L+=1}return C(),R(),u}function ke(e){const n=_(e)?.recordRange;return n?n[0]:Number.MAX_SAFE_INTEGER}function fo(e){const n=[],t=new Map;for(const s of e){const o=s.collectionId||s.id,r=t.get(o);r?r.push(s):(n.push(o),t.set(o,[s]))}return n.map(s=>{const o=[...t.get(s)??[]].sort((i,a)=>{const u=ke(i)-ke(a);return u!==0?u:i.score-a.score}),r=t.get(s)?.[0]??o[0];return{collectionId:s,best:r,moments:o}})}function Ln(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mo(e,n){const t=N(n);if(t.length===0||e.length===0)return[{text:e,match:!1}];const s=t.map(a=>`(?<![A-Za-z0-9_./~-])${Ln(a)}(?![A-Za-z0-9_./~-])`),o=new RegExp(`(${s.join("|")})`,"giu"),r=[];let i=0;for(const a of e.matchAll(o)){const u=a.index??0;u>i&&r.push({text:e.slice(i,u),match:!1}),r.push({text:a[0],match:!0}),i=u+a[0].length}return i<e.length&&r.push({text:e.slice(i),match:!1}),r.length>0?r:[{text:e,match:!1}]}const po={sessions:"Sessions",skills:"Skills",mcp:"MCP",codebase:"Codebase",context_pack:"Context packs",mixed:"Mixed"},yn=[{value:"1",label:"Last 24h"},{value:"3",label:"Last 3 days"},{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"}],go=["sessions","skills","mcp","codebase","context_pack"];function ho(){return{query:"",sourceKinds:[],harness:[],project:[],timeWindow:"all"}}function Vt(e){return e?yn.some(n=>n.value===e):!1}function Q(e){return e?e.split(",").map(n=>n.trim()).filter(n=>n.length>0):[]}function Yt(e){const n=e==null?new URLSearchParams:typeof e=="string"?new URLSearchParams(e):e,t=n.get("time"),s=Vt(t)?t:"all";return{query:n.get("q")?.trim()??"",sourceKinds:Q(n.get("source")),harness:Q(n.get("harness")),project:Q(n.get("project")),timeWindow:s}}function qt(e,n={}){const t=new URLSearchParams,s=e.query.trim();return s&&t.set("q",s),e.sourceKinds.length>0&&t.set("source",e.sourceKinds.join(",")),e.harness.length>0&&t.set("harness",e.harness.join(",")),e.project.length>0&&t.set("project",e.project.join(",")),e.timeWindow!=="all"&&t.set("time",e.timeWindow),n.hitId&&t.set("hit",n.hitId),t}function wo(e,n){return e.query.trim()===n.query.trim()&&e.timeWindow===n.timeWindow&&X(e.sourceKinds,n.sourceKinds)&&X(e.harness,n.harness)&&X(e.project,n.project)}function X(e,n){if(e.length!==n.length)return!1;const t=[...e].map(o=>o.trim().toLowerCase()).sort(),s=[...n].map(o=>o.trim().toLowerCase()).sort();return t.every((o,r)=>o===s[r])}function Qt(e){return e.query.trim().length>0||e.sourceKinds.length>0||e.harness.length>0||e.project.length>0||e.timeWindow!=="all"}function Io(e){if(e==="all")return null;const n=Number.parseInt(e,10);return!Number.isFinite(n)||n<=0?null:Date.now()-n*24*60*60*1e3}function vo(e){return e==="all"?"Any time":yn.find(t=>t.value===e)?.label??e}const $n=typeof window<"u"?window.location.href:"http://scout.local/";function Xt(e){const n=e.toString();return new URL(n,$n)}function Zt(e){switch(e){case"profile":case"config":case"definitions":return e==="definitions"?"config":e;case"observe":case"message":return e;default:return}}function Jt(e){const n=e.trim().replace(/^#/,"");if(!n.startsWith("msg-"))return null;const t=n.slice(4).trim();if(!t)return null;try{return decodeURIComponent(t)}catch{return t}}function es(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 ns(e){return e==="delivered"||e==="failed"||e==="all"?e:void 0}function ts(e){return e==="indexer"||e==="knowledge"?e:void 0}function ss(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 os(e){switch(e){case"tail":case"session":case"chat":case"work":return e;default:return}}function rs(e){const n=e?.trim().replace(/\.+$/u,"");return n==="observe"||n==="takeover"?n:void 0}function as(e){const n=e?.trim().toLowerCase();return n==="pty"||n==="tmux"||n==="zellij"||n==="herdr"?n:void 0}function is(e){const n=e?.trim().toLowerCase();return n==="shell"||n==="claude"||n==="codex"||n==="pi"?n:void 0}function cs(e){return e==="all"||e==="touched"?"all":e==="changed"?"changed":void 0}function Te(e){if(!e)return;const n=Number.parseInt(e,10);return Number.isSafeInteger(n)&&n>0?n:void 0}function De(e){return e==="mission"?"control":e}function us(e){return e.searchParams.has("no-ops")?!1:typeof window>"u"?!0:en()}function ls(e){return e==="tail"}function ds(e){return e==="lanes"}function En(e){return ls(e)||ds(e)}const Ie="machineId",Rn=new Set(["inbox","conversation","agents-v2","messages","sessions","repos","harnesses","mesh","mesh-ops","activity","work","follow"]);function fs(e){return e.searchParams.get(Ie)?.trim()||void 0}function ms(e,n){return!n||!Rn.has(e.view)?e:{...e,machineId:n}}function ve(e){return Rn.has(e.view)}function ps(e){return"machineId"in e&&e.machineId?e.machineId:null}function Fe(e,n){if(!ve(e))return e;const t={...e},s=n?.trim();return s?t.machineId=s:delete t.machineId,t}function So(e){return ve(e)?{...e,machineId:""}:e}function gs(e,n){return ve(e)?"machineId"in e?Fe(e,e.machineId??null):Fe(e,ps(n)):e}function A(e,n){"machineId"in n&&n.machineId&&e.set(Ie,n.machineId)}function w(e){const n=e.toString();return n?`?${n}`:""}function T(e,n){const t=new URLSearchParams;return A(t,n),`${e}${w(t)}`}function hs(e){return"machineId"in e&&e.machineId?`:machine:${e.machineId}`:""}function Pn(e){const n=Xt(e),t=n.pathname.replace(/^\/+/,"").split("/").filter(Boolean),s=fs(n),o=c=>ms(c,s),r=_t(t,n,o);if(r)return r;const i=Jt(n.hash),a=Zt(n.searchParams.get("tab"))??(i?"message":void 0),u=n.searchParams.get("project")?.trim()||void 0,d=n.searchParams.get("agentId")?.trim()||void 0;if(t[0]==="agent"&&t[1])return{view:"agent-info",conversationId:decodeURIComponent(t[1])};const f=n.searchParams.get("project")?.trim()||void 0,L=n.searchParams.get("harness")?.trim()||void 0,C=n.searchParams.get("node")?.trim()||void 0,R=n.searchParams.get("set")?.trim(),v=R==="live"||R==="ephemeral"||R==="archived"?R:void 0,x=n.searchParams.get("view")?.trim(),z=x==="sessions"||x==="agents"?x:void 0,U=n.searchParams.get("state")?.trim(),Se=U==="needs"||U==="live"||U==="idle"?U:void 0,Tn=n.searchParams.get("ephemeral")==="1",W=n.searchParams.get("session")?.trim()||void 0,S=n.searchParams.get("select")?.trim()||void 0,y={...L?{harness:L}:{},...C?{node:C}:{},...v?{set:v}:{},...z?{indexView:z}:{},...Se?{stateFilter:Se}:{},...Tn?{showEphemeral:!0}:{}};if(t[0]==="projects"){const c=t[1]?decodeURIComponent(t[1]):void 0;if(!c)return o({view:"agents-v2",...S?{selectedAgentId:S}:{},...y});if(t[2]==="agents"){const l=t[3]?decodeURIComponent(t[3]):void 0;if(l){if(t[4]==="c"&&t[5])return o({view:"agents-v2",projectSlug:c,agentId:l,conversationId:decodeURIComponent(t[5]),tab:a??"message",...y});const m=t[4]==="sessions"&&t[5]?decodeURIComponent(t[5]):W;return o({view:"agents-v2",projectSlug:c,agentId:l,...m?{sessionId:m}:{},...a?{tab:a}:{},...y})}return o({view:"agents-v2",projectSlug:c,indexView:"agents",...S?{selectedAgentId:S}:{},...y})}return t[2]==="sessions"?o({view:"agents-v2",projectSlug:c,indexView:"sessions",...t[3]?{sessionId:decodeURIComponent(t[3])}:{},...S?{selectedAgentId:S}:{},...y}):o({view:"agents-v2",projectSlug:c,...S?{selectedAgentId:S}:{},...y})}if(t[0]==="agents-v2"&&t[1]==="sessions"&&t[2])return o({view:"agents-v2",sessionId:decodeURIComponent(t[2]),...S?{selectedAgentId:S}:{},...f?{projectSlug:f}:{},...y});if(t[0]==="agents-v2"&&t[1]){const c=decodeURIComponent(t[1]);return o({view:"agents-v2",agentId:c,...a?{tab:a}:{},...W?{sessionId:W}:{},...f?{projectSlug:f}:{},...y})}if(t[0]==="agents-v2")return o({view:"agents-v2",...S?{selectedAgentId:S}:{},...f?{projectSlug:f}:{},...y});if(t[0]==="agents"&&t[1]){const c=decodeURIComponent(t[1]),l=t[2]==="sessions"&&t[3]?decodeURIComponent(t[3]):W;return t[2]==="c"&&t[3]?o({view:"agents-v2",agentId:c,conversationId:decodeURIComponent(t[3]),tab:a??"message",...y}):o({view:"agents-v2",agentId:c,...l?{sessionId:l}:{},...a?{tab:a}:{},...y})}if(t[0]==="agents")return o({view:"agents-v2",...S?{selectedAgentId:S}:{},...f?{projectSlug:f}:{},...y});if(t[0]==="agents.deprecated"&&t[1]&&t[2]==="sessions"&&t[3])return o({view:"sessions",agentId:decodeURIComponent(t[1]),sessionId:decodeURIComponent(t[3])});if(t[0]==="agents.deprecated"&&t[1]&&t[2]==="c"&&t[3])return o({view:"agents-v2",agentId:decodeURIComponent(t[1]),conversationId:decodeURIComponent(t[3]),tab:a??"message"});if(t[0]==="agents.deprecated"&&t[1]){const c=decodeURIComponent(t[1]);return o({view:"agents-v2",agentId:c,...a?{tab:a}:{},...!a&&u?{projectSlug:u}:{}})}if(t[0]==="agents.deprecated")return o({view:"agents-v2",...u?{projectSlug:u}:{}});if(t[0]==="fleet")return o({view:"inbox"});if(t[0]==="c"&&t[1])return o({view:"conversation",conversationId:decodeURIComponent(t[1])});if(t[0]==="flights"&&t[1]&&t[2]==="observe"){const c=n.searchParams.get("session")?.trim()||void 0,l=n.searchParams.get("compare")?.trim()||void 0;return o({view:"sessions",flightId:decodeURIComponent(t[1]),...c?{sessionId:c}:{},...l?{compareSessionId:l}:{}})}if(t[0]==="sessions"&&t[1])return o({view:"sessions",sessionId:decodeURIComponent(t[1]),...d?{agentId:d}:{}});if(t[0]==="conversations")return o({view:"messages"});if(t[0]==="messages"){const c={view:"messages",...t[1]?{conversationId:decodeURIComponent(t[1])}:{}};return o(c)}if(t[0]==="sessions")return o({view:"sessions",...d?{agentId:d}:{}});if(t[0]==="repos"){const c=n.searchParams.get("root")?.trim()||void 0;return o({view:"repos",...c?{root:c}:{}})}if(t[0]==="providers"||t[0]==="harnesses")return o({view:"harnesses"});if(t[0]==="repo-diff"){const c=n.searchParams.get("path")?.trim();if(c){const l=n.searchParams.getAll("layer").filter(h=>h==="unstaged"||h==="staged"||h==="branch"),m=n.searchParams.getAll("file").map(h=>h.trim()).filter(Boolean),p=n.searchParams.get("sessionId")?.trim()||void 0,I=n.searchParams.get("agentId")?.trim()||void 0,b=cs(n.searchParams.get("include"));return{view:"repo-diff",path:c,...l.length>0?{layers:l}:{},...m.length>0?{files:m}:{},...p?{sessionId:p}:{},...I?{agentId:I}:{},...b?{include:b}:{}}}}if(t[0]==="search"){const c=ts(t[1]),l=n.searchParams.get("hit")?.trim()||void 0,m=Yt(n.searchParams);return{view:"search",...c&&c!=="knowledge"?{mode:c}:{},...l?{hitId:l}:{},...Qt(m)?{filters:m}:{}}}if(t[0]==="channels"&&t[1])return o({view:"messages",conversationId:decodeURIComponent(t[1])});if(t[0]==="channels")return o({view:"messages"});if(t[0]==="mesh")return o({view:"mesh"});if(t[0]==="mesh-ops")return o({view:"mesh-ops",...t[1]?{itemId:decodeURIComponent(t[1])}:{}});if(t[0]==="dispatch"||t[0]==="broker"){const c=n.searchParams.get("attempt")?.trim()||void 0,l=ns(n.searchParams.get("filter"));return{view:"broker",...c?{attemptId:c}:{},...l&&l!=="all"?{filter:l}:{}}}if(t[0]==="code"){const c=n.searchParams.get("wt")?.trim()||void 0,l=n.searchParams.get("fromConversation")?.trim()||void 0,m=Te(n.searchParams.get("line")),p=Te(n.searchParams.get("endLine")),I=m&&p&&p>=m?p:void 0;if(t[1]){const E=decodeURIComponent(t[1]),$=t.length>2?t.slice(2).map(decodeURIComponent).join("/"):void 0;return{view:"code",project:E,...$?{path:$}:{},...c?{wt:c}:{},...m?{line:m}:{},...I?{endLine:I}:{},...l?{returnConversationId:l}:{}}}const b=n.searchParams.get("root")?.trim()||void 0,h=n.searchParams.get("file")?.trim()||void 0;return{view:"code",...b?{root:b}:{},...h?{file:h}:{},...c?{wt:c}:{},...m?{line:m}:{},...I?{endLine:I}:{},...l?{returnConversationId:l}:{}}}if(t[0]==="briefings"&&t[1])return{view:"briefings",briefingId:decodeURIComponent(t[1])};if(t[0]==="briefings")return{view:"briefings"};if(t[0]==="activity")return o({view:"activity"});if(t[0]==="voice")return{view:"voice"};if(t[0]==="work"&&t[1])return o({view:"work",workId:decodeURIComponent(t[1])});if(t[0]==="follow"){const c=os(n.searchParams.get("view")),l={view:"follow",...c?{preferredView:c}:{}},m=t[1],p=t[2]?decodeURIComponent(t[2]):"";m==="flight"&&p&&(l.flightId=p),m==="invocation"&&p&&(l.invocationId=p),m==="conversation"&&p&&(l.conversationId=p),m==="work"&&p&&(l.workId=p),m==="session"&&p&&(l.sessionId=p),m==="agent"&&p&&(l.targetAgentId=p);const I=n.searchParams.get("flightId"),b=n.searchParams.get("invocationId"),h=n.searchParams.get("conversationId"),E=n.searchParams.get("workId"),$=n.searchParams.get("sessionId"),be=n.searchParams.get("targetAgentId");return I&&(l.flightId=I),b&&(l.invocationId=b),h&&(l.conversationId=h),E&&(l.workId=E),$&&(l.sessionId=$),be&&(l.targetAgentId=be),o(l)}if(t[0]==="settings"){if(t[1]==="agents")return{view:"settings",section:"agents",...t[2]?{agentId:decodeURIComponent(t[2])}:{}};const c=ss(t[1]);return{view:"settings",...c?{section:c}:{}}}if(t[0]==="terminal"){const c=rs(n.searchParams.get("mode")),l=n.searchParams.get("session")?.trim()||void 0,m=Mn(n.searchParams.get("surface"))??void 0;if(t[1]==="new"){const I=as(n.searchParams.get("backend"))??"pty",b=is(n.searchParams.get("agent"))??"shell",h=n.searchParams.get("name")?.trim()||void 0,E=n.searchParams.get("tab")?.trim()||void 0,$=n.searchParams.get("socketDir")?.trim()||void 0;return{view:"terminal",terminalBackend:I,terminalAgent:b,...h?{terminalSessionName:h}:{},...E?{terminalTabId:E}:{},...$?{zellijSocketDir:$}:{}}}const p=t[1]==="s"&&t[2]?Me(decodeURIComponent(t.slice(2).join("/")))?decodeURIComponent(t.slice(2).join("/")):null:Bn(t[1]?decodeURIComponent(t[1]):void 0,t[2]?decodeURIComponent(t.slice(2).join("/")):void 0);return p?{view:"terminal",terminalSurfaceKey:p,...l?{terminalSessionId:l}:{},...c?{mode:c}:{}}:{view:"terminal",...t[1]?{agentId:decodeURIComponent(t[1])}:{},...c?{mode:c}:{},...!t[1]&&l?{terminalSessionId:l}:{},...!t[1]&&m?{terminalSurfaceKey:m}:{}}}if(t[0]==="ops"){const c=es(t[1])??"mission";if(!En(c)&&!us(n))return o({view:"inbox"});const l=c==="tail"?n.searchParams.get("q")?.trim():"",m=c==="advisor"?n.searchParams.get("plan")?.trim():"",p=n.searchParams.get("flightId")?.trim(),I=n.searchParams.get("invocationId")?.trim(),b=n.searchParams.get("conversationId")?.trim(),h=n.searchParams.get("workId")?.trim(),E=n.searchParams.get("sessionId")?.trim(),$=n.searchParams.get("targetAgentId")?.trim()??n.searchParams.get("agentId")?.trim();return{view:"ops",mode:c,...l?{tailQuery:l}:{},...m?{planDocumentId:m}:{},...p?{flightId:p}:{},...I?{invocationId:I}:{},...b?{conversationId:b}:{},...h?{workId:h}:{},...E?{sessionId:E}:{},...$?{targetAgentId:$}:{}}}return o({view:"inbox"})}function Cn(e,n){const t=e.view==="sessions"&&e.flightId?null:hn(e,n);if(t)return t;switch(e.view){case"inbox":return T("/",e);case"conversation":{const s=new URLSearchParams;return A(s,e),`/c/${encodeURIComponent(e.conversationId)}${w(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),A(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"}${w(s)}`}case"messages":{const s=new URLSearchParams;return A(s,e),`${e.conversationId?`/messages/${encodeURIComponent(e.conversationId)}`:"/messages"}${w(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),A(s,e),`/flights/${encodeURIComponent(e.flightId)}/observe${w(s)}`):(A(s,e),`${e.sessionId?`/sessions/${encodeURIComponent(e.sessionId)}`:"/sessions"}${w(s)}`)}case"repos":{const s=new URLSearchParams;return e.root&&s.set("root",e.root),A(s,e),`/repos${w(s)}`}case"harnesses":return T("/providers",e);case"repo-diff":{const s=new URLSearchParams;s.set("path",e.path);for(const o of e.layers??[])s.append("layer",o);for(const o of e.files??[])s.append("file",o);return e.sessionId&&s.set("sessionId",e.sessionId),e.agentId&&s.set("agentId",e.agentId),e.include&&s.set("include",e.include),`/repo-diff${w(s)}`}case"search":{const s=e.mode==="indexer"?"/search/indexer":"/search",o=e.filters?qt(e.filters,{hitId:e.hitId??null}):new URLSearchParams;return!e.filters&&e.hitId&&o.set("hit",e.hitId),`${s}${w(o)}`}case"mesh":return T("/mesh",e);case"mesh-ops":return T(e.itemId?`/mesh-ops/${encodeURIComponent(e.itemId)}`:"/mesh-ops",e);case"broker":{const s=new URLSearchParams;return e.attemptId&&s.set("attempt",e.attemptId),e.filter&&e.filter!=="all"&&s.set("filter",e.filter),`/dispatch${w(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("/")}`}${w(s)}`}e.root&&s.set("root",e.root),e.file&&s.set("file",e.file),e.returnConversationId&&s.set("fromConversation",e.returnConversationId);const o=s.toString();return o?`/code?${o}`:"/code"}case"briefings":return e.briefingId?`/briefings/${encodeURIComponent(e.briefingId)}`:"/briefings";case"activity":return T("/activity",e);case"voice":return"/voice";case"work":return T(`/work/${encodeURIComponent(e.workId)}`,e);case"settings":return e.section==="agents"?e.agentId?`/settings/agents/${encodeURIComponent(e.agentId)}`:"/settings/agents":e.section?e.section==="pairing"?"/settings/pairing":e.section==="comms"?"/settings/comms":`/settings/${e.section}`:"/settings";case"ops":if(!e.mode)return"/ops";if(e.mode==="tail"||e.mode==="advisor"){const s=new URLSearchParams;return e.mode==="tail"&&e.tailQuery&&s.set("q",e.tailQuery),e.mode==="advisor"&&e.planDocumentId&&s.set("plan",e.planDocumentId),e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),`/ops/${De(e.mode)}${w(s)}`}return`/ops/${De(e.mode)}`;case"follow":{const s=new URLSearchParams;e.preferredView&&s.set("view",e.preferredView),e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),e.machineId&&s.set(Ie,e.machineId);const o=s.toString();return`/follow${o?`?${o}`:""}`}case"terminal":if(e.agentId){const s=new URLSearchParams;return e.mode&&s.set("mode",e.mode),`/terminal/${encodeURIComponent(e.agentId)}${w(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${w(s)}`;e.mode&&s.set("mode",e.mode);const o=zn(e.terminalSurfaceKey);return o?`/terminal/${encodeURIComponent(o.backend)}/${encodeURIComponent(o.sessionName)}${w(s)}`:Me(e.terminalSurfaceKey)?`/terminal/s/${encodeURIComponent(e.terminalSurfaceKey)}${w(s)}`:(e.terminalSessionId&&s.set("session",e.terminalSessionId),e.terminalSurfaceKey&&s.set("surface",e.terminalSurfaceKey),`/terminal${w(s)}`)}}}function j(e){const n=hs(e);switch(e.view){case"conversation":return`conv:${e.conversationId}${n}`;case"agent-info":return`agent-info:${e.conversationId}`;case"settings":return`settings:${e.section??"pairing"}:${e.agentId??""}`;case"agents-v2":return["agents-v2",e.projectSlug??"",e.harness??"",e.node??"",e.set??"",e.indexView??"agents",e.stateFilter??"",e.showEphemeral?"eph":"",e.agentId??"",e.sessionId??"",n].join(":");case"sessions":return e.flightId?`flight-observe:${e.flightId}:${e.sessionId??""}:${e.compareSessionId??""}${n}`:e.sessionId?`session:${e.agentId??""}:${e.sessionId}${n}`:`sessions${n}`;case"messages":return e.conversationId?`messages:${e.conversationId}${n}`:`messages${n}`;case"work":return`work:${e.workId}${n}`;case"ops":return`ops:${e.mode??"advisor"}:${e.tailQuery??""}:${e.planDocumentId??""}:${e.flightId??""}:${e.invocationId??""}:${e.workId??""}:${e.conversationId??""}:${e.sessionId??""}:${e.targetAgentId??""}`;case"search":return`search:${e.mode??"knowledge"}:${e.hitId??""}`;case"broker":return`broker:${e.attemptId??""}`;case"follow":return`follow:${e.flightId??e.invocationId??e.conversationId??e.workId??e.sessionId??e.targetAgentId??""}:${e.preferredView??""}${n}`;case"terminal":return`terminal:${e.agentId??""}:${e.terminalSessionId??""}:${e.terminalSurfaceKey??""}:${e.terminalBackend??""}:${e.terminalAgent??""}:${e.terminalSessionName??""}:${e.terminalTabId??""}:${e.mode??"detail"}`;case"repo-diff":return`repo-diff:${e.path}`;default:return`${e.view}${n}`}}function G(e,n){return ce(Pn(`${e}${n}`))}function An(e){return e?`#${e}`:""}function ws(e){return e.startsWith("/embed/")||e==="/ops/lanes/embed"}function Oe(){if(typeof window>"u"){const e=new URL($n);return{pathname:e.pathname,searchStr:e.search,hash:e.hash.replace(/^#/,""),state:null}}return{pathname:window.location.pathname,searchStr:window.location.search,hash:window.location.hash.replace(/^#/,""),state:window.history.state}}function Is(e,n){return e.pathname===n.pathname&&e.searchStr===n.searchStr&&e.hash===n.hash&&Object.is(e.state,n.state)}function vs(e){let n=e.read();const t=new Set;let s=null;const o=()=>{const r=e.read();if(!Is(n,r)){n=r;for(const i of t)i()}};return{getSnapshot:()=>n,subscribe(r){return s||(s=e.observe(o)),t.add(r),()=>{t.delete(r)}},navigateTo(r,i={}){const a=i.state===void 0?n.state:i.state;i.replace?e.replace(r,a):e.push(r,a),o()}}}function Ss(){return typeof window>"u"?{read:Oe,push:()=>{},replace:()=>{},observe:()=>()=>{}}:{read:Oe,push:(e,n)=>window.history.pushState(n,"",e),replace:(e,n)=>window.history.replaceState(n,"",e),observe:e=>(window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)})}}const F=vs(Ss());function bs(){return P.useSyncExternalStore(F.subscribe,F.getSnapshot,F.getSnapshot)}function ae(e,n={}){F.navigateTo(e,n)}function _n(){return typeof window>"u"?null:window.navigation??null}function Un(){if(typeof window>"u")return!1;const e=_n();return e?e.canGoBack:window.history.length>1}function Ls(){if(!Un())return;const e=_n();if(e){e.back();return}window.history.back()}function bo(e){if(!e||typeof e!="object")return null;const n=e.returnTo;return!n||typeof n!="object"||typeof n.view!="string"?null:n}function Lo(e){return!e||typeof e!="object"?!1:e.returnUseHistory===!0}function xe(e){if(!e||typeof e!="object")return e;const{returnTo:n,returnUseHistory:t,settingsEntry:s,...o}=e;return o}function ys(e,n){if(n.returnTo!==void 0){const t=n.state!==void 0?n.state:xe(e),s=t&&typeof t=="object"?{...t}:{};return s.returnTo=n.returnTo,s.returnUseHistory=n.replace!==!0,s}return n.state!==void 0?n.state:n.replace?e:xe(e)}function kn(e){return e?e.replace(/^#/,""):""}function $s(e,n,t={}){const s=G(e.pathname,e.searchStr),o=gs(n,s),r=t.preserveSearch===!1?"":e.searchStr,i=gn(Cn(o,e.pathname),r),a=kn(t.hash);return{route:o,href:`${i}${a?`#${a}`:""}`}}function Es(e,n){const t=new URLSearchParams(e.searchStr);for(const[r,i]of Object.entries(n.searchPatch??{}))i===null?t.delete(r):t.set(r,i);const s=t.toString(),o=n.hash===void 0?e.hash:kn(n.hash);return`${e.pathname}${s?`?${s}`:""}${o?`#${o}`:""}`}function yo(e){const n=F.getSnapshot(),t=Es(n,e),s=`${n.pathname}${n.searchStr}${An(n.hash)}`;t!==s&&ae(t,{replace:e.replace??!0,state:e.state})}function Rs(e,n,t){if(ws(e))return null;const s=`${e}${n}`,o=Pn(s),r=ce(o),i=gn(Cn(r,e),n);return!(j(o)!==j(r)||r.view==="agents-v2"||s!==i)||s===i?null:`${i}${An(t)}`}function $o(){const{pathname:e,searchStr:n,hash:t}=bs(),s=`${e}${n}`,o=P.useMemo(()=>G(e,n),[e,n]),r=P.useRef({}),i=P.useRef(s);P.useEffect(()=>{const f=Rs(e,n,t);f&&ae(f,{replace:!0})},[e,n,t]),P.useEffect(()=>{if(i.current===s)return;const f=G(e,n);requestAnimationFrame(()=>{window.scrollTo(0,r.current[j(f)]??0)}),i.current=s},[s,e,n]);const a=P.useCallback((f,L={})=>{const C=ce(f.view==="ops"&&!en()&&!En(f.mode)?{view:"inbox"}:f),R=G(e,n),{route:v,href:x}=$s({pathname:e,searchStr:n},C,L);r.current[j(R)]=window.scrollY;const z=F.getSnapshot().state,U=ys(z,L);ae(x,{replace:L.replace,state:U}),requestAnimationFrame(()=>{window.scrollTo(0,r.current[j(v)]??0)})},[e,n]),u=P.useCallback(()=>Ls(),[]),d=Un();return{route:o,navigate:a,navigateBack:u,canNavigateBack:d}}export{Ks as $,jt as A,pe as B,_ as C,so as D,ao as E,ro as F,Io as G,mo as H,vo as I,rt as J,no as K,ot as L,at as M,it as N,Ds as O,yo as P,Xs as Q,pn as R,go as S,mn as T,Js as U,Ms as V,xs as W,Bs as X,yt as Y,Ns as Z,St as _,Cn as a,$t as a0,Hs as a1,Vs as a2,Gs as a3,Ys as a4,zs as a5,Ws as a6,js as a7,tn as a8,nn as a9,oe as aA,co as aB,io as aC,Sn as aD,ve as aa,qs as ab,Qs as ac,V as ad,ne as ae,Us as af,se as ag,q as ah,At as ai,Dt as aj,_t as ak,gn as al,Ft as am,tt as an,Zs as ao,hn as ap,We as aq,eo as ar,$o as as,Vn as at,wn as au,B as av,to as aw,uo as ax,bn as ay,lo as az,Qn as b,Wn as c,ps as d,So as e,qe as f,Ts as g,ue as h,lt as i,ks as j,Fs as k,Os as l,bo as m,Lo as n,ho as o,Yt as p,fo as q,Pn as r,Fe as s,Qt as t,bs as u,wo as v,_s as w,po as x,yn as y,oo as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as a,s as l,l as n,m as r,r as m}from"./index-
|
|
1
|
+
import{k as a,s as l,l as n,m as r,r as m}from"./index-Bli6bTLU.js";import{Q as p,R as i,T as c,u as E,U as S}from"./router-B0YclXYg.js";const _={path:l(n.lanes),bundle:`?ffBundle=${a}`,deploy:`OPENSCOUT_WEB_FLAG_BUNDLE=${a}`},o=[{key:"lanes",label:"Agent Lanes",segment:n.lanes},{key:"sessions",label:"Sessions",segment:n.sessions},{key:"tail",label:"Live Activity",segment:n.tail},{key:"agents",label:"Agents",segment:n.agents}],b=o.map(e=>({key:e.key,label:e.label,route:p(e.segment)}));function A(e){const t=i(e);return o.find(s=>s.segment===t)?.key??"lanes"}function d(e){const t=i(e);return o.find(s=>s.segment===t)?.label??r}function u(){const{pathname:e}=E();return c(e)}function P(){return S(u())}function T(e){const t=u();return m.useEffect(()=>(t?document.documentElement.setAttribute("data-scope-presentation",""):document.documentElement.removeAttribute("data-scope-presentation"),()=>document.documentElement.removeAttribute("data-scope-presentation")),[t]),{active:t,brandLabel:t?d(e.route):r}}function L(){return c(typeof window<"u"?window.location.pathname:"")}export{b as S,u as a,_ as b,d as c,T as d,L as i,A as s,P as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as x}from"./index-Bli6bTLU.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,ge as b,te as c,de as d,we as e,he as f,K as g,ve as h,Se as i,ye as j,Ee as k,Te as l,be as o,D as p,C as r,me as s};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const g="scoutbot",O="scout:scoutbot-submit",h=new Set([g,"scoutbot","@scoutbot"]),S=new Set(["plan","conductor","conduct","warroom","command","mission","control","issues","errors","warnings","agents","tail","atop"]),_=new Set(["available","working","active","idle","waiting","registered"]);function U(t=globalThis.window){const e=t.webkit?.messageHandlers;return!!(e?.scoutNativeUI??e?.scoutRealtimeVoice)}function j(t,e=globalThis.window){const o=e.webkit?.messageHandlers,n=o?.scoutNativeUI??o?.scoutRealtimeVoice;if(!n)return!1;try{return n.postMessage({kind:"ui-action",action:t}),!0}catch{return!1}}function y(t){return[t.id,t.name,t.handle??"",t.selector??"",t.role??""].map(o=>o.trim().toLowerCase()).some(o=>h.has(o)||o==="scoutbot"||o.startsWith("scoutbot.")||o.includes(".scoutbot.")||o.includes(" scoutbot"))}function A(t){return _.has(t.state?.trim().toLowerCase()??"")}function m(t){if(!y(t))return Number.NEGATIVE_INFINITY;let e=0;return A(t)&&(e+=100),t.handle?.trim().toLowerCase()==="scoutbot"&&(e+=20),t.selector?.trim().toLowerCase()==="@scoutbot"&&(e+=20),t.role?.trim().toLowerCase()==="scoutbot"&&(e+=10),t.id===g&&(e+=1),e}function N(t){return t.filter(y).sort((e,o)=>{const n=m(o)-m(e);return n!==0?n:(o.updatedAt??0)-(e.updatedAt??0)})[0]??null}function C(t){return N(t)?.id??g}const T=new Set(["scout-ui","scout-ui-action","scoutbot-ui"]),b=/```([a-zA-Z0-9_-]*)\s*([\s\S]*?)```/g;function I(t){const e=[];let o="",n=0;b.lastIndex=0;let s;for(;(s=b.exec(t))!==null;){const[l,r,i]=s,a=(r??"").toLowerCase(),u=i??"";let d=[],f=!1;T.has(a)?(f=!0,d=w(u)):(a==="json"||a==="")&&(d=w(u),d.length>0&&(f=!0)),f&&(e.push(...d),o+=t.slice(n,s.index),n=s.index+l.length)}return o+=t.slice(n),{stripped:o.replace(/\n{3,}/g,`
|
|
1
|
+
const g="scoutbot",O="scout:scoutbot-submit",h=new Set([g,"scoutbot","@scoutbot"]),S=new Set(["advisor","plan","conductor","conduct","warroom","command","mission","control","issues","errors","warnings","agents","tail","atop"]),_=new Set(["available","working","active","idle","waiting","registered"]);function U(t=globalThis.window){const e=t.webkit?.messageHandlers;return!!(e?.scoutNativeUI??e?.scoutRealtimeVoice)}function j(t,e=globalThis.window){const o=e.webkit?.messageHandlers,n=o?.scoutNativeUI??o?.scoutRealtimeVoice;if(!n)return!1;try{return n.postMessage({kind:"ui-action",action:t}),!0}catch{return!1}}function y(t){return[t.id,t.name,t.handle??"",t.selector??"",t.role??""].map(o=>o.trim().toLowerCase()).some(o=>h.has(o)||o==="scoutbot"||o.startsWith("scoutbot.")||o.includes(".scoutbot.")||o.includes(" scoutbot"))}function A(t){return _.has(t.state?.trim().toLowerCase()??"")}function m(t){if(!y(t))return Number.NEGATIVE_INFINITY;let e=0;return A(t)&&(e+=100),t.handle?.trim().toLowerCase()==="scoutbot"&&(e+=20),t.selector?.trim().toLowerCase()==="@scoutbot"&&(e+=20),t.role?.trim().toLowerCase()==="scoutbot"&&(e+=10),t.id===g&&(e+=1),e}function N(t){return t.filter(y).sort((e,o)=>{const n=m(o)-m(e);return n!==0?n:(o.updatedAt??0)-(e.updatedAt??0)})[0]??null}function C(t){return N(t)?.id??g}const T=new Set(["scout-ui","scout-ui-action","scoutbot-ui"]),b=/```([a-zA-Z0-9_-]*)\s*([\s\S]*?)```/g;function I(t){const e=[];let o="",n=0;b.lastIndex=0;let s;for(;(s=b.exec(t))!==null;){const[l,r,i]=s,a=(r??"").toLowerCase(),u=i??"";let d=[],f=!1;T.has(a)?(f=!0,d=w(u)):(a==="json"||a==="")&&(d=w(u),d.length>0&&(f=!0)),f&&(e.push(...d),o+=t.slice(n,s.index),n=s.index+l.length)}return o+=t.slice(n),{stripped:o.replace(/\n{3,}/g,`
|
|
2
2
|
|
|
3
|
-
`).trim(),actions:e}}function x(t){return I(t).actions}function F(t){return I(t).stripped}function w(t){const e=t.trim();if(!e)return[];try{const o=JSON.parse(e);return(Array.isArray(o)?o:[o]).map(s=>v(s)).filter(s=>!!s)}catch{return[]}}function v(t){if(!t||typeof t!="object")return null;const e=t,o=e.scoutUi??e.scout_ui??e.scoutbotUi??e.scoutbot_ui;if(o)return v(o);const n=typeof e.type=="string"?e.type:typeof e.action=="string"?e.action:"",s=typeof e.reason=="string"?e.reason:void 0;if(n==="open-scoutbot"||n==="open_scoutbot"){const r=e.mode==="tell"?"tell":e.mode==="ask"?"ask":void 0;return{type:"open-scoutbot",...r?{mode:r}:{},...s?{reason:s}:{}}}if(n==="refresh")return{type:"refresh",...s?{reason:s}:{}};if(n==="ask-agent"||n==="ask_agent"||n==="scout-ask"||n==="scout_ask"){const r=c(e.targetLabel,e.target_label,e.target,e.to,e.agent,e.handle),i=c(e.targetAgentId,e.target_agent_id,e.agentId,e.agent_id),a=c(e.body,e.message,e.prompt,e.task,e.question),u=c(e.channel);return!a?.trim()||!r?.trim()&&!i?.trim()?null:{type:"ask-agent",targetLabel:(r??i??"").trim(),body:a.trim(),...i?.trim()?{targetAgentId:i.trim()}:{},...u?.trim()?{channel:u.trim()}:{},...s?{reason:s}:{}}}if(n==="view-file"||n==="view_file"||n==="open-file"||n==="open_file"){const r=c(e.path,e.file,e.target);return r?.trim()?{type:"view-file",path:r.trim(),...s?{reason:s}:{}}:null}if(n==="reminder"||n==="set-reminder"||n==="set_reminder"||n==="remind"){const r=c(e.body,e.text,e.prompt,e.message);if(!r?.trim())return null;const i=c(e.title,e.label),a=k(e.dueAt??e.due_at),u=p(e.delayMs??e.delay_ms),d=p(e.delayMinutes??e.delay_minutes);return{type:"reminder",body:r.trim(),...i?.trim()?{title:i.trim()}:{},...a!==null?{dueAt:a}:{},...u!==null?{delayMs:u}:{},...d!==null?{delayMinutes:d}:{},...s?{reason:s}:{}}}if(n!=="navigate"&&n!=="open")return null;const l=L(e.route??e);return l?{type:"navigate",route:l,...s?{reason:s}:{}}:null}function c(...t){for(const e of t)if(typeof e=="string"&&e.trim())return e;return null}function p(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t!="string")return null;const e=Number(t.trim());return Number.isFinite(e)?e:null}function k(t){const e=p(t);if(e!==null)return e;if(typeof t!="string")return null;const o=Date.parse(t);return Number.isFinite(o)?o:null}function L(t){if(!t||typeof t!="object")return null;const e=t;switch(typeof e.view=="string"?e.view:""){case"home":case"inbox":return{view:"inbox"};case"fleet":return{view:"inbox"};case"agents":case"projects":case"agents-v2":return{view:"agents-v2",...typeof e.agentId=="string"?{agentId:e.agentId}:{},...typeof e.conversationId=="string"?{conversationId:e.conversationId}:{},...typeof e.sessionId=="string"?{sessionId:e.sessionId}:{},...typeof e.projectSlug=="string"?{projectSlug:e.projectSlug}:{},...e.tab==="profile"||e.tab==="observe"||e.tab==="message"?{tab:e.tab}:{}};case"chat":case"messages":return{view:"messages",...typeof e.conversationId=="string"?{conversationId:e.conversationId}:{}};case"sessions":return{view:"sessions",...typeof e.sessionId=="string"?{sessionId:e.sessionId}:{}};case"repos":return{view:"repos",...typeof e.root=="string"?{root:e.root}:{}};case"harnesses":return{view:"harnesses"};case"repo-diff":return typeof e.path=="string"?{view:"repo-diff",path:e.path,...typeof e.sessionId=="string"?{sessionId:e.sessionId}:{},...typeof e.agentId=="string"?{agentId:e.agentId}:{}}:null;case"search":return{view:"search",...e.mode==="knowledge"||e.mode==="indexer"?{mode:e.mode}:{},...typeof e.hitId=="string"?{hitId:e.hitId}:{}};case"channels":return{view:"messages",...typeof e.channelId=="string"?{conversationId:e.channelId}:{}};case"mesh":return{view:"mesh"};case"broker":return{view:"broker"};case"activity":return{view:"activity"};case"settings":return{view:"settings",...e.section==="pairing"||e.section==="agents"||e.section==="operator"||e.section==="comms"||e.section==="credentials"||e.section==="voice"||e.section==="devices"?{section:e.section}:{},...typeof e.agentId=="string"?{agentId:e.agentId}:{}};case"code":{const n=c(e.project,e.projectSlug,e.project_slug,e.projectName,e.project_name,e.repository,e.repo),s=c(e.path,e.relativePath,e.relative_path),l=c(e.wt,e.worktree,e.worktreeName,e.worktree_name),r=typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0?e.line:void 0,i=typeof e.endLine=="number"&&Number.isSafeInteger(e.endLine)&&e.endLine>0?e.endLine:void 0,a=r&&i&&i>=r?i:void 0;return{view:"code",...typeof e.root=="string"?{root:e.root}:{},...typeof e.file=="string"?{file:e.file}:{},...n?{project:n}:{},...s?{path:s}:{},...l?{wt:l}:{},...r?{line:r}:{},...a?{endLine:a}:{}}}case"briefings":return{view:"briefings",...typeof e.briefingId=="string"?{briefingId:e.briefingId}:{}};case"terminal":return{view:"terminal",...typeof e.agentId=="string"?{agentId:e.agentId}:{}};case"work":return typeof e.workId=="string"?{view:"work",workId:e.workId}:null;case"conversation":return typeof e.conversationId=="string"?{view:"conversation",conversationId:e.conversationId}:null;case"ops":{const n=typeof e.mode=="string"&&S.has(e.mode)?E(e.mode):void 0;return{view:"ops",...n?{mode:n}:{}}}default:return null}}function E(t){switch(t){case"control":case"mission":case"command":case"warroom":case"conduct":case"conductor":return"mission";case"plan":return"
|
|
3
|
+
`).trim(),actions:e}}function x(t){return I(t).actions}function F(t){return I(t).stripped}function w(t){const e=t.trim();if(!e)return[];try{const o=JSON.parse(e);return(Array.isArray(o)?o:[o]).map(s=>v(s)).filter(s=>!!s)}catch{return[]}}function v(t){if(!t||typeof t!="object")return null;const e=t,o=e.scoutUi??e.scout_ui??e.scoutbotUi??e.scoutbot_ui;if(o)return v(o);const n=typeof e.type=="string"?e.type:typeof e.action=="string"?e.action:"",s=typeof e.reason=="string"?e.reason:void 0;if(n==="open-scoutbot"||n==="open_scoutbot"){const r=e.mode==="tell"?"tell":e.mode==="ask"?"ask":void 0;return{type:"open-scoutbot",...r?{mode:r}:{},...s?{reason:s}:{}}}if(n==="refresh")return{type:"refresh",...s?{reason:s}:{}};if(n==="ask-agent"||n==="ask_agent"||n==="scout-ask"||n==="scout_ask"){const r=c(e.targetLabel,e.target_label,e.target,e.to,e.agent,e.handle),i=c(e.targetAgentId,e.target_agent_id,e.agentId,e.agent_id),a=c(e.body,e.message,e.prompt,e.task,e.question),u=c(e.channel);return!a?.trim()||!r?.trim()&&!i?.trim()?null:{type:"ask-agent",targetLabel:(r??i??"").trim(),body:a.trim(),...i?.trim()?{targetAgentId:i.trim()}:{},...u?.trim()?{channel:u.trim()}:{},...s?{reason:s}:{}}}if(n==="view-file"||n==="view_file"||n==="open-file"||n==="open_file"){const r=c(e.path,e.file,e.target);return r?.trim()?{type:"view-file",path:r.trim(),...s?{reason:s}:{}}:null}if(n==="reminder"||n==="set-reminder"||n==="set_reminder"||n==="remind"){const r=c(e.body,e.text,e.prompt,e.message);if(!r?.trim())return null;const i=c(e.title,e.label),a=k(e.dueAt??e.due_at),u=p(e.delayMs??e.delay_ms),d=p(e.delayMinutes??e.delay_minutes);return{type:"reminder",body:r.trim(),...i?.trim()?{title:i.trim()}:{},...a!==null?{dueAt:a}:{},...u!==null?{delayMs:u}:{},...d!==null?{delayMinutes:d}:{},...s?{reason:s}:{}}}if(n!=="navigate"&&n!=="open")return null;const l=L(e.route??e);return l?{type:"navigate",route:l,...s?{reason:s}:{}}:null}function c(...t){for(const e of t)if(typeof e=="string"&&e.trim())return e;return null}function p(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t!="string")return null;const e=Number(t.trim());return Number.isFinite(e)?e:null}function k(t){const e=p(t);if(e!==null)return e;if(typeof t!="string")return null;const o=Date.parse(t);return Number.isFinite(o)?o:null}function L(t){if(!t||typeof t!="object")return null;const e=t;switch(typeof e.view=="string"?e.view:""){case"home":case"inbox":return{view:"inbox"};case"fleet":return{view:"inbox"};case"agents":case"projects":case"agents-v2":return{view:"agents-v2",...typeof e.agentId=="string"?{agentId:e.agentId}:{},...typeof e.conversationId=="string"?{conversationId:e.conversationId}:{},...typeof e.sessionId=="string"?{sessionId:e.sessionId}:{},...typeof e.projectSlug=="string"?{projectSlug:e.projectSlug}:{},...e.tab==="profile"||e.tab==="observe"||e.tab==="message"?{tab:e.tab}:{}};case"chat":case"messages":return{view:"messages",...typeof e.conversationId=="string"?{conversationId:e.conversationId}:{}};case"sessions":return{view:"sessions",...typeof e.sessionId=="string"?{sessionId:e.sessionId}:{}};case"repos":return{view:"repos",...typeof e.root=="string"?{root:e.root}:{}};case"harnesses":return{view:"harnesses"};case"repo-diff":return typeof e.path=="string"?{view:"repo-diff",path:e.path,...typeof e.sessionId=="string"?{sessionId:e.sessionId}:{},...typeof e.agentId=="string"?{agentId:e.agentId}:{}}:null;case"search":return{view:"search",...e.mode==="knowledge"||e.mode==="indexer"?{mode:e.mode}:{},...typeof e.hitId=="string"?{hitId:e.hitId}:{}};case"channels":return{view:"messages",...typeof e.channelId=="string"?{conversationId:e.channelId}:{}};case"mesh":return{view:"mesh"};case"broker":return{view:"broker"};case"activity":return{view:"activity"};case"settings":return{view:"settings",...e.section==="pairing"||e.section==="agents"||e.section==="operator"||e.section==="comms"||e.section==="credentials"||e.section==="voice"||e.section==="devices"?{section:e.section}:{},...typeof e.agentId=="string"?{agentId:e.agentId}:{}};case"code":{const n=c(e.project,e.projectSlug,e.project_slug,e.projectName,e.project_name,e.repository,e.repo),s=c(e.path,e.relativePath,e.relative_path),l=c(e.wt,e.worktree,e.worktreeName,e.worktree_name),r=typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0?e.line:void 0,i=typeof e.endLine=="number"&&Number.isSafeInteger(e.endLine)&&e.endLine>0?e.endLine:void 0,a=r&&i&&i>=r?i:void 0;return{view:"code",...typeof e.root=="string"?{root:e.root}:{},...typeof e.file=="string"?{file:e.file}:{},...n?{project:n}:{},...s?{path:s}:{},...l?{wt:l}:{},...r?{line:r}:{},...a?{endLine:a}:{}}}case"briefings":return{view:"briefings",...typeof e.briefingId=="string"?{briefingId:e.briefingId}:{}};case"terminal":return{view:"terminal",...typeof e.agentId=="string"?{agentId:e.agentId}:{}};case"work":return typeof e.workId=="string"?{view:"work",workId:e.workId}:null;case"conversation":return typeof e.conversationId=="string"?{view:"conversation",conversationId:e.conversationId}:null;case"ops":{const n=typeof e.mode=="string"&&S.has(e.mode)?E(e.mode):void 0;return{view:"ops",...n?{mode:n}:{}}}default:return null}}function E(t){switch(t){case"control":case"mission":case"command":case"warroom":case"conduct":case"conductor":return"mission";case"advisor":case"plan":return"advisor";case"issues":case"errors":case"warnings":return"issues";case"agents":case"tail":case"atop":case"lanes":return t;default:return}}export{O as S,C as a,x as e,j as f,U as i,N as r,F as s};
|