@openscout/scout 0.2.86 → 0.2.87
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/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/{ActivityScreen-C7AwUogt.js → ActivityScreen-DRHTQIxu.js} +1 -1
- package/dist/client/assets/{AddProjectForm-BNRpRPod.js → AddProjectForm-Dw2oyCcz.js} +1 -1
- package/dist/client/assets/AgentAvatar-CQqJcwOQ.js +1 -0
- package/dist/client/assets/AgentAvatar-CUZZARWG.css +1 -0
- package/dist/client/assets/{AgentConfigurationScreen-BoBQpyz5.js → AgentConfigurationScreen-C3OI6JmZ.js} +1 -1
- package/dist/client/assets/{AgentDefinitionsWorkspace-rw3vh8Lm.js → AgentDefinitionsWorkspace-D0LDEqfl.js} +1 -1
- package/dist/client/assets/{AgentDetailCard-FelCxQrT.js → AgentDetailCard-2DZQahiN.js} +1 -1
- package/dist/client/assets/{AgentFloorView-Crdw8Uo5.js → AgentFloorView-CoGh2q5f.js} +1 -1
- package/dist/client/assets/{AgentInfoScreen-Cge7HHbV.js → AgentInfoScreen-5ybfIL9p.js} +1 -1
- package/dist/client/assets/{AgentLaneCard-CRDG74C1.js → AgentLaneCard-CeSjWWwh.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-CWFqUdch.js → AgentLaneChrome-Do7CXwin.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-DCIIg3Zp.js → AgentLaneDetailSheet-BD8B51ka.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-yTM4GQAJ.js → AgentLaneSummaryResize--lHgnncr.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-FRTVASPw.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-DJeDRTAN.js → AgentLanesPreflight-BwkGk8JH.js} +1 -1
- package/dist/client/assets/{AgentLanesView-CbY9qD0z.js → AgentLanesView-Bm85ittm.js} +1 -1
- package/dist/client/assets/{AgentLiveActions-Bn3zeZBN.js → AgentLiveActions-BmXDRxER.js} +1 -1
- package/dist/client/assets/{AgentSessions-czl5zT7A.js → AgentSessions-C_tAfGN2.js} +1 -1
- package/dist/client/assets/{AgentsConsole-CoT2crwq.js → AgentsConsole-DsHWsaOJ.js} +1 -1
- package/dist/client/assets/{AgentsScreen-BcPM-z1T.js → AgentsScreen-Bod6AHlA.js} +1 -1
- package/dist/client/assets/AgentsSubnav-CsvYzzQ-.js +1 -0
- package/dist/client/assets/{AstronautSuit-BADl7m8x.js → AstronautSuit-C05Ezxl9.js} +1 -1
- package/dist/client/assets/{AtopView-DymBCiXv.js → AtopView-DOKJbiJL.js} +1 -1
- package/dist/client/assets/{BackToPicker-CqYhOaLB.js → BackToPicker-CXsbxbHM.js} +1 -1
- package/dist/client/assets/{BriefingDetailScreen-DDfZ8ci1.js → BriefingDetailScreen-Uvnk3t0v.js} +1 -1
- package/dist/client/assets/{BriefingsScreen-CLvSOJjy.js → BriefingsScreen-DLIJ8eYj.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-DFAH-NO6.js → BrokerMetadataPanel-C8WERmHF.js} +1 -1
- package/dist/client/assets/{BrokerScreen-Bkvu92jk.js → BrokerScreen-LZ3T7hGG.js} +1 -1
- package/dist/client/assets/{Canvas-KyTsDJlB.js → Canvas-BO9mx5_P.js} +1 -1
- package/dist/client/assets/{ChatCollapsedStrip-Bjjqa30K.js → ChatCollapsedStrip-CtLPTLTY.js} +1 -1
- package/dist/client/assets/{CodeDiffPane-C9HT1dCT.js → CodeDiffPane-CtgqIuS0.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-5Y3GvXkM.js → CodeProjectPicker-C4W_udc7.js} +1 -1
- package/dist/client/assets/{CodeScreen-DpN9kQvm.js → CodeScreen-WhTvVUKY.js} +1 -1
- package/dist/client/assets/{ConversationComposer-Ce7Byw48.js → ConversationComposer-DPWu3HvK.js} +1 -1
- package/dist/client/assets/{ConversationFeedRows-DygDfQn_.js → ConversationFeedRows-MhcPfxUr.js} +1 -1
- package/dist/client/assets/{ConversationHeader-C3sg0ULI.js → ConversationHeader-Ce7TENb9.js} +1 -1
- package/dist/client/assets/{ConversationPanels-Dg4Y2GgX.js → ConversationPanels-D-b5SLO-.js} +2 -2
- package/dist/client/assets/ConversationScreen-C5HnXd5w.css +1 -0
- package/dist/client/assets/{ConversationScreen-CjWWmuuh.js → ConversationScreen-D77SoLos.js} +1 -1
- package/dist/client/assets/{ConversationStatus-BhVIYQza.js → ConversationStatus-lIvSKRic.js} +1 -1
- package/dist/client/assets/CrewWorkspaces-CJhBKVoZ.css +1 -0
- package/dist/client/assets/CrewWorkspaces-CdojnRMG.js +1 -0
- package/dist/client/assets/{DataTable-oJP339bX.js → DataTable-DFacT2uu.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-CH02HAVw.js → DispatchAftermath-D797PbCe.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-DmtFisY9.js → DocumentFocusViewer-CetjnYut.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-84b9I3fy.js → EmbeddableSurfacesLab-JczLmmF-.js} +1 -1
- package/dist/client/assets/{EmptyState-BnDda92b.js → EmptyState-uQbB-bvP.js} +1 -1
- package/dist/client/assets/{FileViewerPane-Dg7_88pv.js → FileViewerPane-ebbCtnHE.js} +1 -1
- package/dist/client/assets/{FlightObserveScreen-DL3Xhl0h.js → FlightObserveScreen-sqvt7HUO.js} +1 -1
- package/dist/client/assets/{FollowScreen-DcFBqr6l.js → FollowScreen-Bfu2_KtU.js} +1 -1
- package/dist/client/assets/{HarnessMark-DGZ6o6Ct.js → HarnessMark-CEzmPFHC.js} +1 -1
- package/dist/client/assets/{HarnessesScreen-DTDL-XaA.js → HarnessesScreen-CGhRsqD5.js} +1 -1
- package/dist/client/assets/{HerdrSession-DV2hD6Yh.js → HerdrSession-BDLa_rrK.js} +1 -1
- package/dist/client/assets/{HomeHero-CENwVZ45.js → HomeHero-DdxTQ-6a.js} +1 -1
- package/dist/client/assets/{HostAdvisorView-PgiZUkd_.js → HostAdvisorView-BAUi5ZxX.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-DNQjeWZO.js → KnowledgeSearchInspector-GjmxYBi_.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchScreen-Bj80IgR0.js → KnowledgeSearchScreen-CRei9pyl.js} +1 -1
- package/dist/client/assets/{LaneToolHoverCard-197xYmRp.js → LaneToolHoverCard-DCY-m0JK.js} +1 -1
- package/dist/client/assets/{LaneTraceDetailSheet-BztwvOv9.js → LaneTraceDetailSheet-CFsCvKa3.js} +1 -1
- package/dist/client/assets/{LaneTraceEventFocus-C9cmqxnK.js → LaneTraceEventFocus-BfKZ7G5c.js} +1 -1
- package/dist/client/assets/{MeshCanvas-C3_2p9B6.js → MeshCanvas-CZYHLTvw.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-ZTjYWXTZ.js → MeshCanvasMinimap-D3mJ78CM.js} +1 -1
- package/dist/client/assets/{MeshScreen-lJKaOyGB.js → MeshScreen-dxNxRtKm.js} +1 -1
- package/dist/client/assets/{MeshTopologyView-CBjHbAZw.js → MeshTopologyView-A-wh0Ad1.js} +2 -2
- package/dist/client/assets/{MessagesScreen-D6MVLvdg.js → MessagesScreen-CR5v-WIE.js} +1 -1
- package/dist/client/assets/{MissionContextRail-DXkrbcnZ.js → MissionContextRail-MTL2EAnr.js} +1 -1
- package/dist/client/assets/{MissionControlView-BCH-Zsp4.js → MissionControlView-BGj1qnI2.js} +1 -1
- package/dist/client/assets/{MissionFocusOverlay-DbAliOSF.js → MissionFocusOverlay-hWi6y87j.js} +1 -1
- package/dist/client/assets/{MissionLeftAgentRow-Bx6Pg8_O.js → MissionLeftAgentRow-BSRRiiig.js} +1 -1
- package/dist/client/assets/{MissionLogPane-D06c29Y8.js → MissionLogPane-bbG_pM9B.js} +1 -1
- package/dist/client/assets/{NewAgentModal-C18Ajovd.js → NewAgentModal-Ctixol4_.js} +1 -1
- package/dist/client/assets/{NewChatComposer-Bgqes0UQ.js → NewChatComposer-BPsg8shF.js} +1 -1
- package/dist/client/assets/{NewChatOrigin-DpHS2Wmt.js → NewChatOrigin-CCiPg_WR.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-Cmhwai4X.js → ObserveEmbedScreen-Be87Chod.js} +1 -1
- package/dist/client/assets/{ObserveTextFlow-C1f5oize.js → ObserveTextFlow-CKYltTPJ.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-D85P6RAk.js → ObservedTopologyPanel-CfHYu-4Z.js} +1 -1
- package/dist/client/assets/{OpenScoutAppShell-IDI4fuUE.js → OpenScoutAppShell-DPeP1vtK.js} +2 -2
- package/dist/client/assets/{OpsAgentsView-yt0JavoB.js → OpsAgentsView-dEtw9yt-.js} +1 -1
- package/dist/client/assets/OpsScreen-QXRJY8Vf.js +1 -0
- package/dist/client/assets/OpsSubnav-BK9Fj3gU.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-BjykZ2Xd.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-IDEpKZvI.js → ProjectAgentProfileBar-B4RqrI0Q.js} +1 -1
- package/dist/client/assets/{ProjectAgentProfileHero-Bh_aISs-.js → ProjectAgentProfileHero-Bc0g8rhW.js} +1 -1
- package/dist/client/assets/{ProjectsInbox-B8Srlklk.js → ProjectsInbox--ZIqo-IE.js} +1 -1
- package/dist/client/assets/{ProjectsRail-DqAbdvCf.js → ProjectsRail-CzS0qTCI.js} +1 -1
- package/dist/client/assets/ProjectsScreen-0gx7f30h.js +1 -0
- package/dist/client/assets/{ProjectsThreadAside-DpkjYLL2.js → ProjectsThreadAside-BsQRFbdy.js} +1 -1
- package/dist/client/assets/{Provider-Ve8yXaWR.js → Provider-Cd-QZltN.js} +1 -1
- package/dist/client/assets/{RailRow-C4GNGR80.js → RailRow-BY6fxePa.js} +1 -1
- package/dist/client/assets/{RawSessionsTable-Co3vzwsf.js → RawSessionsTable-CbopOF34.js} +1 -1
- package/dist/client/assets/{RealtimeVoiceScreen-DMd1CBAf.js → RealtimeVoiceScreen-CU4uXz4C.js} +1 -1
- package/dist/client/assets/{RepoDiffEmbedScreen-C97Euf4s.js → RepoDiffEmbedScreen-Cr1SL5ht.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-DUKLzkrW.js → RepoDiffPageScreen-DeC8fsh_.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-CovKjSgb.js → RepoDiffViewer-CiTOWK_Z.js} +1 -1
- package/dist/client/assets/{RepoDiffViewerLazy-zIiEmh-e.js → RepoDiffViewerLazy-BU3V7Kwq.js} +2 -2
- package/dist/client/assets/{ReposScreen-BR1LqTf1.js → ReposScreen-BQwIShXf.js} +1 -1
- package/dist/client/assets/{ScoutDeckSurface-BGsVicc2.js → ScoutDeckSurface-BncYKicb.js} +1 -1
- package/dist/client/assets/{ScoutSurface-BMKW7hSu.js → ScoutSurface-DdVzN3DA.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-0O2iDRrF.js → ScoutbotFxLab-sLjfSKtS.js} +1 -1
- package/dist/client/assets/{SecondaryNav-cYTw2p39.js → SecondaryNav-CCQqTT3e.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-mNjT0R6j.js → SessionEmbedScreen-BrLMZJ3N.js} +1 -1
- package/dist/client/assets/{SessionObserve-zAlFbwFn.js → SessionObserve-pbozyqVv.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-BVawzqoE.js → SessionObserveEvidence-C54Xvbps.js} +1 -1
- package/dist/client/assets/{SessionRefScreen-BmKhf29o.js → SessionRefScreen-UVNVrwAf.js} +1 -1
- package/dist/client/assets/SessionsScreen-KeDb5gz4.js +1 -0
- package/dist/client/assets/SettingsDrawer-CWdj0VvN.js +3 -0
- package/dist/client/assets/SettingsDrawer-J-8x1eII.css +1 -0
- package/dist/client/assets/SettingsScreen-C7zJgZzj.js +1 -0
- package/dist/client/assets/{ShikiPane-DyEJdcvb.js → ShikiPane-CiVH-45m.js} +1 -1
- package/dist/client/assets/{SlidePanel-Dg8_styW.js → SlidePanel-BLrLF9dt.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-DMrSssNZ.js → SpriteAvatar-vpHO-rXs.js} +1 -1
- package/dist/client/assets/{StatusPill-NFFnphtx.js → StatusPill-a3XBw1GG.js} +1 -1
- package/dist/client/assets/{TailView-BfObcZu3.js → TailView-C3rjOV7i.js} +1 -1
- package/dist/client/assets/{Terminal-Dr-M9U4u.js → Terminal-CMQFmHnn.js} +1 -1
- package/dist/client/assets/{TerminalEmbedScreen-BmyZkonh.js → TerminalEmbedScreen-GvpoGERN.js} +1 -1
- package/dist/client/assets/{TerminalRelay-lJ2KdMCW.js → TerminalRelay-CIHlLVf1.js} +3 -3
- package/dist/client/assets/{TextDocumentSurface-C7fGlzY8.js → TextDocumentSurface-B29xZNlI.js} +1 -1
- package/dist/client/assets/{TmuxPeek-BSeKIjnX.js → TmuxPeek-eVfqPB4m.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-BkIGTzgw.js → VoicePermissionsPanel-DpInOlVq.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-Cwe-KWK4.js → WorkDetailScreen-DYwgGaJs.js} +1 -1
- package/dist/client/assets/{WorkFilesViewer-BBtKRBPv.js → WorkFilesViewer-C7H5fXaZ.js} +1 -1
- package/dist/client/assets/{activity-D4W2XZY2.js → activity-DTqqWiyV.js} +1 -1
- package/dist/client/assets/{addon-fit-Celjj2yn.js → addon-fit-CcaylYTX.js} +1 -1
- package/dist/client/assets/{addon-webgl-Cu4tJ21-.js → addon-webgl-B37iuzOG.js} +1 -1
- package/dist/client/assets/{agent-autocomplete-Dv-_9dAw.js → agent-autocomplete-cOPLtuhM.js} +1 -1
- package/dist/client/assets/{agent-essentials-CngjUhQj.js → agent-essentials-DbbJm3ne.js} +1 -1
- package/dist/client/assets/{agent-identity-DzHGhLdJ.js → agent-identity-CIMT7oV6.js} +1 -1
- package/dist/client/assets/{agent-specialization-CNrsRbKA.js → agent-specialization-D3-sqwhU.js} +1 -1
- package/dist/client/assets/{arc.es-DNT50Y-_.js → arc.es-BRPqOKIx.js} +1 -1
- package/dist/client/assets/{archive-DH49QqFG.js → archive-DPMdoW_D.js} +1 -1
- package/dist/client/assets/{arrow-left-i-h6JAgs.js → arrow-left-B0CdJdAC.js} +1 -1
- package/dist/client/assets/{arrow-right-B0Yi01Zr.js → arrow-right-YRBoTTyf.js} +1 -1
- package/dist/client/assets/{arrow-up-right-RBC6k8nn.js → arrow-up-right-CilNLf4t.js} +1 -1
- package/dist/client/assets/{bot-r2IuAuJd.js → bot-Ba3gcRVa.js} +1 -1
- package/dist/client/assets/{check-Bfs7hMb1.js → check-BdovFDz8.js} +1 -1
- package/dist/client/assets/{chevron-down-Da5tV19_.js → chevron-down-Jh540uf3.js} +1 -1
- package/dist/client/assets/{chevron-right-BMqtBds_.js → chevron-right-CV7sEVBS.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-BUVYXXAp.js → chunk-HRAB3GC3-BYQZ1LOn.js} +1 -1
- package/dist/client/assets/{clock-DaKLp6Xd.js → clock-DpfYdWcr.js} +1 -1
- package/dist/client/assets/{code-xml-ByQsfOI_.js → code-xml-CPzpZkhu.js} +1 -1
- package/dist/client/assets/{compass-BepM5iWH.js → compass-D5Io6BIV.js} +1 -1
- package/dist/client/assets/{content-Bgl_X3ao.js → content-3b_jmxEx.js} +1 -1
- package/dist/client/assets/content-B-i0XY-t.js +1 -0
- package/dist/client/assets/content-BD-DNFmb.js +1 -0
- package/dist/client/assets/content-BGeo5tgd.js +1 -0
- package/dist/client/assets/content-BMvXPLiQ.js +1 -0
- package/dist/client/assets/content-BWTbfMDg.js +1 -0
- package/dist/client/assets/content-BwCmeUmF.js +1 -0
- package/dist/client/assets/content-C1K3NcZa.js +1 -0
- package/dist/client/assets/{content-Cv2tSAbv.js → content-C34J5_Af.js} +1 -1
- package/dist/client/assets/content-CGRtIS2m.js +1 -0
- package/dist/client/assets/content-CIJo_-JS.js +1 -0
- package/dist/client/assets/content-CvqIqVAV.js +1 -0
- package/dist/client/assets/content-DRnwm-Vu.js +1 -0
- package/dist/client/assets/{content-5hnDC9WE.js → content-Dh39SSvP.js} +1 -1
- package/dist/client/assets/content-DoypqDj5.js +1 -0
- package/dist/client/assets/content-n3mvc6NQ.js +1 -0
- package/dist/client/assets/{conversation-icons-C4amK8Sa.js → conversation-icons-bHIIZ9z3.js} +1 -1
- package/dist/client/assets/{conversation-model-CigSPlKA.js → conversation-model-CIzM7aXT.js} +1 -1
- package/dist/client/assets/conversation-motion-features-CrP5K-dk.js +1 -0
- package/dist/client/assets/{copy-De4s38o2.js → copy-DQAM0eSY.js} +1 -1
- package/dist/client/assets/{cpu-Bc268H9Q.js → cpu-CtQc0Z9D.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DLlxGjKt.js → createLucideIcon-Da0lq809.js} +1 -1
- package/dist/client/assets/discover-DdkMhTAV.js +2 -0
- package/dist/client/assets/embed-entry-DoSM1GZB.js +2 -0
- package/dist/client/assets/{external-link-BGHC_naA.js → external-link-BheHazeW.js} +1 -1
- package/dist/client/assets/{eye-BeCSqJn1.js → eye-B908WSFH.js} +1 -1
- package/dist/client/assets/{file-code-corner-CX53Cd9y.js → file-code-corner-C5Pc6znt.js} +1 -1
- package/dist/client/assets/{file-text-BVhkMWyC.js → file-text-BGVkHS4_.js} +1 -1
- package/dist/client/assets/{gauge-CPcEPmNt.js → gauge-sc_gb5Zw.js} +1 -1
- package/dist/client/assets/{gestures-BXIGYk_p.js → gestures-AzPBSf20.js} +1 -1
- package/dist/client/assets/{git-branch-q8Ayc8py.js → git-branch-CdJU49Af.js} +1 -1
- package/dist/client/assets/{home-moving-signal-Dm2Z2x0p.js → home-moving-signal-CZo2bYBi.js} +1 -1
- package/dist/client/assets/{home-now-card-xU5LGP7q.js → home-now-card-DgxfZHcR.js} +1 -1
- package/dist/client/assets/{home-now-card-nano-Djhy6ax0.js → home-now-card-nano-iwd10r9G.js} +1 -1
- package/dist/client/assets/{hooks-CdKx1CxP.js → hooks-CeCCO6Yg.js} +1 -1
- package/dist/client/assets/{index-DhfOMK0D.js → index-BIiI9gfa.js} +1 -1
- package/dist/client/assets/index-CD2foMB8.js +1 -0
- package/dist/client/assets/{index-D7UEHxaY.js → index-DReHD_4U.js} +1 -1
- package/dist/client/assets/{index-Bli6bTLU.js → index-NRbRrZw-.js} +6 -6
- package/dist/client/assets/{inspector-panel-B8pigRsg.js → inspector-panel-CBf8pW7s.js} +1 -1
- package/dist/client/assets/{keyboard-nav-7iEtvu9P.js → keyboard-nav-feLCB3Zm.js} +1 -1
- package/dist/client/assets/{lane-roster-store-pHT3TAVs.js → lane-roster-store-BAmj273z.js} +1 -1
- package/dist/client/assets/{layers-BiZA-Clc.js → layers-D9fblkql.js} +1 -1
- package/dist/client/assets/{layout-grid-DMpv9CZM.js → layout-grid-Vd1chalc.js} +1 -1
- package/dist/client/assets/left-41_3QKk1.js +1 -0
- package/dist/client/assets/{left-Dy403II2.js → left-B3ofA1Pr.js} +2 -2
- package/dist/client/assets/{left-BhgU6NOA.js → left-BWBZQhxQ.js} +1 -1
- package/dist/client/assets/{left-CY_FGnN7.js → left-BhA6essi.js} +1 -1
- package/dist/client/assets/{left-Cq8mjamr.js → left-BmTKCv4f.js} +1 -1
- package/dist/client/assets/{left-Dnqla0b5.js → left-CCGR6tIF.js} +1 -1
- package/dist/client/assets/{left-BhZhSrS2.js → left-Dfwzkwh_.js} +1 -1
- package/dist/client/assets/{left-advisor-oOAtJ9YE.js → left-advisor-yrzW1Kwz.js} +1 -1
- package/dist/client/assets/{left-agents-TIKe8vW8.js → left-agents-Bgahk0FF.js} +1 -1
- package/dist/client/assets/{left-default-owH0Lwxo.js → left-default-CtkfAquc.js} +1 -1
- package/dist/client/assets/{left-lanes-BE_co2lP.js → left-lanes-CpujaVN3.js} +1 -1
- package/dist/client/assets/{left-mission-C_nWUtfA.js → left-mission-Bbd-fW6W.js} +1 -1
- package/dist/client/assets/{library-BSVrjn_m.js → library-Dx14WNGd.js} +1 -1
- package/dist/client/assets/{loader-circle-DoT8gpw6.js → loader-circle-Be0T8xv2.js} +1 -1
- package/dist/client/assets/{local-agents-BMadXuP1.js → local-agents-Q6KQ12B9.js} +1 -1
- package/dist/client/assets/{mentions-Cd6XticV.js → mentions-KNASbAjG.js} +1 -1
- package/dist/client/assets/{mesh-ops-C0zCLTR8.js → mesh-ops-C-i8OMiM.js} +1 -1
- package/dist/client/assets/{mesh-view-store-Cpqil_2D.js → mesh-view-store-B0lqpw8M.js} +1 -1
- package/dist/client/assets/{message-circle-44KSmbvQ.js → message-circle-2v9Udia0.js} +1 -1
- package/dist/client/assets/{message-markup-DAnnGpWr.js → message-markup-BP2nH9kQ.js} +1 -1
- package/dist/client/assets/{message-square-DlY4EneU.js → message-square-DURSOrUr.js} +1 -1
- package/dist/client/assets/{mission-control-store-DtjtRs9Z.js → mission-control-store-HeCy97KT.js} +1 -1
- package/dist/client/assets/{observe-DL5_8-Zj.js → observe-DkAhvkfn.js} +1 -1
- package/dist/client/assets/{page-status-CW8co39E.js → page-status-CEP5pGf3.js} +1 -1
- package/dist/client/assets/{persistent-state-DYjP8lqN.js → persistent-state-Bm_0TmZL.js} +1 -1
- package/dist/client/assets/{plus-64n9qucr.js → plus-ZReaTFF-.js} +1 -1
- package/dist/client/assets/{profile-BkmuseW7.js → profile-Y0X7HZHc.js} +1 -1
- package/dist/client/assets/{projects-inbox-C0umZMSY.js → projects-inbox-Cbfj4Hx7.js} +1 -1
- package/dist/client/assets/{provider-CX9EWecp.js → provider-Bq0ScH3v.js} +1 -1
- package/dist/client/assets/{proxy-C35W-YHZ.js → proxy-DtC2iXnT.js} +1 -1
- package/dist/client/assets/{radio-BjpQTKT0.js → radio-BC9TO5Pl.js} +1 -1
- package/dist/client/assets/{refresh-cw-IgN2fZLM.js → refresh-cw-C4E58VJK.js} +1 -1
- package/dist/client/assets/resolve-panes-BI3WdDS-.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-_g0pIxOr.js +1 -0
- package/dist/client/assets/{right-B3PQUHd5.js → right-BA0F8fPI.js} +1 -1
- package/dist/client/assets/{right-B96CBzrV.js → right-BarpRgcv.js} +1 -1
- package/dist/client/assets/{right-BPirlFC8.js → right-C4GXB45w.js} +1 -1
- package/dist/client/assets/{right-DqiVyo8v.js → right-CIzaNH58.js} +1 -1
- package/dist/client/assets/{right-C2aOC2li.js → right-CXetlD8X.js} +1 -1
- package/dist/client/assets/{right-CtPJjgOV.js → right-CnRcQS_I.js} +1 -1
- package/dist/client/assets/{right-BVWYPIFX.js → right-D2_rmbAH.js} +1 -1
- package/dist/client/assets/{right-SfSu0zHC.js → right-Dqp--KwX.js} +1 -1
- package/dist/client/assets/{right-BUP2Ro_M.js → right-HJJzRuGD.js} +1 -1
- package/dist/client/assets/{right-BoAJxwA3.js → right-WCMb8YXJ.js} +1 -1
- package/dist/client/assets/{rocket-DnmN_YOD.js → rocket-BahfIwFz.js} +1 -1
- package/dist/client/assets/{router-B0YclXYg.js → router-Bx1tiwVe.js} +1 -1
- package/dist/client/assets/{scope-views-Z8aoAmtU.js → scope-views-CmG2X_S0.js} +1 -1
- package/dist/client/assets/{scout-voice-DvG_3stJ.js → scout-voice-BT3gYDhU.js} +1 -1
- package/dist/client/assets/{scoutbot-markdown-BJJyaPu2.js → scoutbot-markdown-DIhLsYxz.js} +1 -1
- package/dist/client/assets/{scroll-text-DRidbcse.js → scroll-text-uulNqrf7.js} +1 -1
- package/dist/client/assets/{search-BbgsEMXa.js → search-HmdKXdtR.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-DyC_P9Wx.js → secondaryNavConfig-BVQiyAXu.js} +1 -1
- package/dist/client/assets/{selection-bridge-CpzFGx3-.js → selection-bridge-n4wNTm1B.js} +1 -1
- package/dist/client/assets/{send-horizontal-BXo2uz3Z.js → send-horizontal-DOjHkZCD.js} +1 -1
- package/dist/client/assets/{server-Dt3tpiBj.js → server-CX-xQjJA.js} +1 -1
- package/dist/client/assets/{session-catalog-CUQ8LUJY.js → session-catalog-b7B1Sof1.js} +1 -1
- package/dist/client/assets/{session-table-B4JOKevn.js → session-table-Djain1Qr.js} +1 -1
- package/dist/client/assets/{settings-BzWCF3NF.js → settings-BpKRzxOD.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-7V8B3xsf.js → sliders-horizontal-D2O6QiDN.js} +1 -1
- package/dist/client/assets/{sparkles-ytTwpCbZ.js → sparkles-CgTby-ap.js} +1 -1
- package/dist/client/assets/{sse-CSozY6mp.js → sse-QSbhyq9A.js} +1 -1
- package/dist/client/assets/{tail-events-CrN-Rmxj.js → tail-events-B7BrDaFi.js} +1 -1
- package/dist/client/assets/{terminal-BiNIXhna.js → terminal-DNZTCr6a.js} +1 -1
- package/dist/client/assets/{terminal-relay-pSm7_An6.js → terminal-relay-C2TUIuh1.js} +1 -1
- package/dist/client/assets/{terminal-takeover-CtA3wcXh.js → terminal-takeover-BArLfNtd.js} +1 -1
- package/dist/client/assets/{text-BR9Bap0E.js → text-B2UZi3l9.js} +1 -1
- package/dist/client/assets/{use-conversation-list-C0bEXFeH.js → use-conversation-list-htp0Ui63.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-CK4aw-3G.js → use-fleet-active-asks-BhuTn5mV.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-QixBijmT.js → use-mesh-ops-items-CD-qsvNX.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-BLn59zLn.js → use-reduced-motion-0fAsybdo.js} +1 -1
- package/dist/client/assets/{use-scout-dev-flags-JKb1EhFh.js → use-scout-dev-flags-DV_I6URU.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-6N8b7qsU.js → useAgentHoverCard-BIrm8esH.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-4atpGgFw.js +1 -0
- package/dist/client/assets/{usePersistentState-DOEahRlt.js → usePersistentState-InmPXIN4.js} +1 -1
- package/dist/client/assets/{usePierreRuntime-Bq6mXrgd.js → usePierreRuntime-CVTMzChM.js} +1 -1
- package/dist/client/assets/{wrench-CQvdf7KT.js → wrench-DwFKomxg.js} +1 -1
- package/dist/client/assets/{x-BJyPzFnn.js → x-DuzAbpk5.js} +1 -1
- package/dist/client/assets/{xterm-D6dE_wMr.js → xterm-xQGYNyB-.js} +1 -1
- package/dist/client/assets/{zap-rw7uwZht.js → zap-CocRNtyr.js} +1 -1
- package/dist/client/crew/brik-bust.webp +0 -0
- package/dist/client/crew/brik-chip-id.webp +0 -0
- package/dist/client/crew/lulu-bust.webp +0 -0
- package/dist/client/crew/milo-bust.webp +0 -0
- package/dist/client/crew/milo-chip-id.webp +0 -0
- package/dist/client/crew/nori-bust.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/blink-half.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/blink-shut.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/look-left.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/look-right.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/look-up.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/rest.webp +0 -0
- package/dist/client/crew/sheets/sprout/blink-half.webp +0 -0
- package/dist/client/crew/sheets/sprout/blink-shut.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-left.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-right.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-up.webp +0 -0
- package/dist/client/crew/sprout-bust.webp +0 -0
- package/dist/client/crew/sprout-chip-id.webp +0 -0
- package/dist/client/crew/vex-bust.webp +0 -0
- package/dist/client/crew/vex-chip-id.webp +0 -0
- package/dist/client/crew/wrench-bust.webp +0 -0
- package/dist/client/crew/wrench-chip-id.webp +0 -0
- package/dist/client/index.html +1 -1
- package/dist/main.mjs +1 -1
- package/package.json +1 -1
- package/dist/client/assets/AgentAvatar-B1xvQ7ej.js +0 -1
- package/dist/client/assets/AgentLanesEmbedScreen-BJLwXSNp.js +0 -1
- package/dist/client/assets/AgentsSubnav-3_vpn2bT.js +0 -1
- package/dist/client/assets/ConversationScreen-BP5tdz2k.css +0 -1
- package/dist/client/assets/CrewWorkspaces-B6YIyw1z.css +0 -1
- package/dist/client/assets/CrewWorkspaces-CDU-wy1Y.js +0 -1
- package/dist/client/assets/OpsScreen-C3yNQqJE.js +0 -1
- package/dist/client/assets/OpsSubnav-BijKI3yG.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-DnIeC16r.js +0 -1
- package/dist/client/assets/ProjectsScreen-DKHQ2iEv.js +0 -1
- package/dist/client/assets/SessionsScreen-CsSqjIY2.js +0 -1
- package/dist/client/assets/SettingsDrawer-Dsj-On_x.css +0 -1
- package/dist/client/assets/SettingsDrawer-DwYQTGi8.js +0 -3
- package/dist/client/assets/SettingsScreen-Btaku7YM.js +0 -1
- package/dist/client/assets/content-BRFZ-a6m.js +0 -1
- package/dist/client/assets/content-BYykncDo.js +0 -1
- package/dist/client/assets/content-Be6yyWbJ.js +0 -1
- package/dist/client/assets/content-BopJW1Zx.js +0 -1
- package/dist/client/assets/content-Bv2sfg0w.js +0 -1
- package/dist/client/assets/content-CMBiIZTg.js +0 -1
- package/dist/client/assets/content-CPVqvf5o.js +0 -1
- package/dist/client/assets/content-CbwyFqdI.js +0 -1
- package/dist/client/assets/content-ClQjAWYi.js +0 -1
- package/dist/client/assets/content-DFFe3-Ot.js +0 -1
- package/dist/client/assets/content-DY5hwBmm.js +0 -1
- package/dist/client/assets/content-_IXoxGno.js +0 -1
- package/dist/client/assets/content-j_tewJdE.js +0 -1
- package/dist/client/assets/conversation-motion-features-_95aZx_1.js +0 -1
- package/dist/client/assets/discover-DOlk1hG7.js +0 -2
- package/dist/client/assets/embed-entry-BqDJfa87.js +0 -2
- package/dist/client/assets/index-DFdlQs_c.js +0 -1
- package/dist/client/assets/left-BayK4ocL.js +0 -1
- package/dist/client/assets/resolve-panes-CCqRkQdM.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-JkxY8qsV.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-D-hVKzM9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as e}from"./index-Bli6bTLU.js";import{u as ct}from"./Provider-Ve8yXaWR.js";import{o as $e}from"./openContent-C6XO6kr5.js";import{a as B}from"./api-DEHEgJ9m.js";import{u as rt}from"./sse-CSozY6mp.js";import{u as lt}from"./tail-events-CrN-Rmxj.js";import{n as ot,a as dt,s as Me,c as _e}from"./colors-BtO5_zlx.js";import{A as ut}from"./AgentLiveActions-Bn3zeZBN.js";import{i as mt}from"./message-visibility-kJM8XcSG.js";import{h as pt,j as ht,k as vt,m as xt,c as Be,l as ft}from"./conversation-model-CigSPlKA.js";import{c as jt,e as gt,t as W,f as oe}from"./time-Dhsh_2EG.js";import{d as Nt}from"./router-B0YclXYg.js";import{T as yt}from"./TmuxPeek-BSeKIjnX.js";import{S as It}from"./scroll-text-DRidbcse.js";import"./provider-CX9EWecp.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"./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";import"./index-BWHgHrtv.js";import"./terminal-takeover-CtA3wcXh.js";import"./eye-BeCSqJn1.js";import"./terminal-BiNIXhna.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";/* empty css */import"./refresh-cw-IgN2fZLM.js";const wt=20;function de(t){if(!t)return null;const s=t.replace(/[\\/]+$/,"");return s?s.split(/[\\/]/).filter(Boolean).at(-1)??s:null}function ue(t){const s=t?.trim();return s?s.length>18?`${s.slice(0,8)}...${s.slice(-6)}`:s:null}function b(t){const s=new Set,a=[];for(const c of t){const m=c?.trim();if(!m)continue;const h=m.toLowerCase();s.has(h)||(s.add(h),a.push(m))}return a}function Ue(t,s){const a=t?.trim().replace(/[\\/]+$/,""),c=s.trim().replace(/[\\/]+$/,"");if(!a||!c)return!1;if(a===c)return!0;if(c.startsWith("~/")){const m=c.slice(1);if(a.endsWith(m)||a.includes(`${m}/`))return!0}if(a.startsWith("~/")){const m=a.slice(1);if(c.endsWith(m)||c.includes(`${m}/`))return!0}return a.startsWith(`${c}/`)||c.startsWith(`${a}/`)}function Fe(t,s){const a=t?.trim().toLowerCase(),c=s.trim().toLowerCase();return!a||!c?!1:a.includes(c)||c.includes(a)}function Ve(t,s){const a=t?.trim().toLowerCase(),c=s.trim().toLowerCase();return!a||!c?!1:a===c}function St(t){const{activeSessionId:s,agent:a,sessionMeta:c}=t,m=b([s,a?.harnessSessionId]),h=b([a?.cwd,a?.projectRoot,c?.workspaceRoot]),r=b([a?.project,de(a?.cwd),de(a?.projectRoot),de(c?.workspaceRoot)]).filter(U=>U.length>2),o=b([...m.slice(0,2),...r.slice(0,2)]).join("|");return{sessionIds:m,paths:h,projects:r,query:o}}function he(t,s){return!!(s.sessionIds.some(a=>Fe(t.sessionId,a))||s.paths.some(a=>Ue(t.cwd,a))||s.projects.some(a=>Ve(t.project,a)))}function Tt(t,s){const a=s.filter(r=>he(r,t)),c=b(a.filter(r=>t.sessionIds.some(o=>Fe(r.sessionId,o))).map(r=>r.sessionId));if(c[0])return c[0];const m=b(a.filter(r=>t.paths.some(o=>Ue(r.cwd,o))).map(r=>r.sessionId));if(m[0])return m[0];const h=b(a.filter(r=>t.projects.some(o=>Ve(r.project,o))).map(r=>r.sessionId));return h[0]?h[0]:t.paths[0]?t.paths[0]:t.sessionIds[0]?t.sessionIds[0]:t.projects[0]?t.projects[0]:t.query}function X(t,s){const a=new Map;for(const c of[...s,...t])a.set(c.id,c);return[...a.values()].sort((c,m)=>jt(c.ts,m.ts)).slice(0,wt)}function bt(t){return t==="tool-result"?"tool result":t}function kt(t){const s=t.replace(/\s+/g," ").trim();return s.length<=180?s:`${s.slice(0,177)}...`}const At={direct:"Conversation",channel:"Conversation",group_direct:"Conversation",thread:"Thread"},Ct=1800,Et=4800,We=2,Lt=120,Rt=650,Pt=1800;function me(t,s){try{return JSON.stringify(t)===JSON.stringify(s)?t:s}catch{return s}}function ze(t){if(!t)return null;const s=t.replace(/[\\/]+$/,"");return s?s.split(/[\\/]/).filter(Boolean).at(-1)??s:null}function $t(t){if(!t)return null;const s=t.replace(/[\\/]+$/,"");return s?s.replace(/^\/Users\/[^/]+(?=\/|$)/,"~"):null}function z(t){switch(t){case"queued":return"Queued";case"waking":return"Waking";case"waiting":return"Thinking";case"running":return"Working";default:return t.replace(/_/g," ")}}function Ms(){const{route:t,agents:s,navigate:a,apiConnection:c,reload:m}=ct(),h=Nt(t),r=t.view==="conversation"||t.view==="messages"?t.conversationId??null:null,[o,U]=i.useState(null),[E,ve]=i.useState([]),[G,xe]=i.useState(null),[He,F]=i.useState(!1),V=i.useCallback(async()=>{if(!r){U(null),ve([]),xe(null),F(!0);return}try{const[n,l,f]=await Promise.all([B(`/api/session/${encodeURIComponent(r)}`).catch(()=>null),B(`/api/flights?conversationId=${encodeURIComponent(r)}`).catch(()=>[]),B(`/api/messages?conversationId=${encodeURIComponent(r)}&limit=8`).catch(()=>[])]);U(p=>me(p,n)),ve(p=>me(p,l??[])),xe(p=>me(p,f?.filter(_=>!mt(_)).sort((_,it)=>gt(_.createdAt,it.createdAt)).at(-1)??null)),F(!0)}catch{F(!0)}},[r]);i.useEffect(()=>{F(!1),V()},[V]);const j=o?.agentId??null,d=i.useMemo(()=>j?s.find(n=>n.id===j)??null:null,[s,j]),H=d?.id??null,fe=pt(o),ee=ht({resolvedAgentId:H,sessionId:fe,machineId:h}),[je,ge]=i.useState(null),[L,te]=i.useState([]),[w,se]=i.useState([]),Ne=i.useRef([]),S=i.useRef(null),O=i.useRef(null),x=i.useRef([]),g=i.useRef(null),N=i.useRef(null),R=i.useRef(new Set),q=i.useCallback(()=>{S.current!==null&&(window.clearTimeout(S.current),S.current=null),O.current=null},[]),P=i.useCallback(()=>{if(!r)return;const n=Date.now(),l=O.current??n;O.current=l;const p=n-l>=Et?0:Ct;S.current!==null&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>{S.current=null,O.current=null,V()},p)},[r,V]);i.useEffect(()=>q,[q]),i.useEffect(()=>{if(ge(null),!H)return;let n=!1;return B(`/api/agents/${encodeURIComponent(H)}/session-catalog`).then(l=>{n||ge(l)}).catch(()=>{}),()=>{n=!0}},[H]);const Oe=vt({name:d?.name,agentName:o?.agentName,id:j,title:o?.title}),ye=d?xt(d)??Be(d.id)??d.id:j?Be(j)??j:null,u=i.useMemo(()=>E.filter(ft).sort((n,l)=>(l.startedAt??0)-(n.startedAt??0))[0]??null,[E]);i.useEffect(()=>{R.current=new Set(E.map(n=>n.invocationId))},[E]),i.useEffect(()=>{q(),R.current.clear()},[q,r]),rt(n=>{if(r){if(n.kind==="message.posted"){n.payload?.message?.conversationId===r&&P();return}if(n.kind==="conversation.upserted"){n.payload?.conversation?.id===r&&P();return}if(n.kind==="invocation.requested"){const l=n.payload?.invocation;if(l?.conversationId===r){R.current.add(l.id),P();return}!l?.conversationId&&j&&l?.targetAgentId===j&&(R.current.add(l.id),P());return}if(n.kind==="flight.updated"){const l=n.payload?.flight;if(!l)return;(u?.id===l.id||u?.invocationId===l.invocationId||R.current.has(l.invocationId)||E.some(p=>p.id===l.id||p.invocationId===l.invocationId))&&P()}}});const v=je?.activeSessionId??d?.harnessSessionId??fe??o?.harnessSessionId??null,I=d?.harnessSessionId??o?.harnessSessionId??null,k=d?.harnessLogPath??null,y=i.useMemo(()=>St({activeSessionId:v,agent:d,sessionMeta:o}),[v,d,o]),ne=JSON.stringify({sessionIds:y.sessionIds,paths:y.paths,projects:y.projects}),$=y.sessionIds.length>0||y.paths.length>0||y.projects.length>0,D=i.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null),N.current!==null&&(window.clearInterval(N.current),N.current=null),x.current=[]},[]),K=i.useCallback(()=>{D()},[D]),Ie=i.useCallback(()=>{if(N.current!==null||(g.current!==null&&(window.clearTimeout(g.current),g.current=null),x.current.length===0))return;const l=()=>{const f=x.current.slice(0,We);x.current=x.current.slice(We),f.length>0&&se(p=>X(p,f)),!(x.current.length>0)&&N.current!==null&&(window.clearInterval(N.current),N.current=null)};l(),x.current.length>0&&(N.current=window.setInterval(l,Lt))},[]),we=i.useCallback(n=>{N.current===null&&g.current===null&&(g.current=window.setTimeout(()=>{g.current=null,Ie()},n))},[Ie]);i.useEffect(()=>{Ne.current=w},[w]),i.useEffect(()=>D,[D]),i.useEffect(()=>{K(),te([]),se([])},[K,ne]),i.useEffect(()=>{if(!$)return;let n=!1;const l=new URLSearchParams({limit:"180",transcripts:"true"});return B(`/api/tail/recent?${l.toString()}`).then(f=>{if(n)return;const p=(f.events??[]).filter(_=>he(_,y));te(X([],p))}).catch(()=>{}),()=>{n=!0}},[$,ne]),lt(i.useCallback(n=>{$&&he(n,y)&&te(l=>X(l,[n]))},[$,ne])),i.useEffect(()=>{if(L.length===0){K(),se([]);return}const n=Ne.current,l=new Set([...n.map(p=>p.id),...x.current.map(p=>p.id)]),f=L.filter(p=>!l.has(p.id));f.length!==0&&(x.current=X(x.current,f),x.current.length>0&&we(n.length===0?Rt:Pt))},[we,K,L]);const ae=i.useMemo(()=>w.flatMap(Bt).slice(0,5),[w]);if(!r)return e.jsx(Mt,{apiOffline:c.status==="offline",onRetry:()=>{m()}});if(!He)return e.jsx("div",{className:"ctx-panel ctx-panel--conversation",children:e.jsx("div",{className:"ctx-panel-empty-state",children:e.jsx("div",{className:"ctx-panel-empty-hint",children:"Loading conversation…"})})});const qe=o?.kind?At[o.kind]??o.kind:"Conversation",J=o?.workspaceRoot??null,ie=ze(J),Q=$t(J),Se=o?.currentBranch??null,ce=d?.harness??o?.harness??null,Y=o?.lastMessageAt??G?.createdAt??null,Te=o?.messageCount??null,be=o?o.participantIds.filter(n=>n!=="operator").length+1:null,A=d?.state??null,De=ot(A),ke=G?.body?.trim()||o?.preview?.trim()||null,Ae=G?.actorName??null,Ce=ue(v),M=v??I,Ee=ue(M),Ke=ue(I),Le=!!(I&&I!==M),Re=[ce,d?.transport].filter(Boolean).join(" · "),Je=!!(v||I||k),T=!!(d?.terminalSurface?.backend==="tmux"||d?.transport==="tmux"&&d.harnessSessionId),C=!!(u||dt(A,d)),Qe=C?u?z(u.state):"In motion":"At rest",Ye=u?.summary?.trim()??(Y?`Last update ${W(Y)??"recently"}`:"No recent activity recorded"),re=[Se?`branch ${Se}`:null,ce,d?.transport].filter(Boolean),Ze=!!(ie||Q||re.length>0),Xe=C?"Live activity":T?"Terminal":"Activity",le=u?.summary?.trim()??(v&&!T?"Terminal session is live.":w.length>0&&!T?"Streaming matching Tail events.":null),Z=Tt(y,L),Ge=!!(d&&(u||v||L.length>0||T)),et=!T,tt=v?T?"Terminal session":"Trace session":u?"Session starting":"Session context",st=v?Ee??v:u?z(u.state):"Waiting for a session id",Pe=v?[ce,d?.transport,u?z(u.state):null].filter(Boolean).join(" · "):u?.summary?.trim()??le??null,nt=()=>{ee&&$e(a,ee,{returnTo:t})},at=()=>{$e(a,{view:"ops",mode:"tail",...Z?{tailQuery:Z}:{}},{returnTo:t})};return e.jsxs("div",{className:"ctx-panel ctx-panel--conversation",children:[e.jsxs("section",{className:"ctx-panel-section ctx-panel-conversation-summary",children:[e.jsx("div",{className:"ctx-panel-section-label",children:qe}),e.jsxs("div",{className:"ctx-panel-conversation-card",children:[e.jsx("div",{className:"ctx-panel-conversation-title",children:Oe}),ye&&e.jsxs("div",{className:"ctx-panel-conversation-handle",children:["@",ye]}),e.jsxs("div",{className:"ctx-panel-conversation-state",children:[e.jsx("span",{className:"ctx-panel-conversation-state-dot",style:{background:Me(A)}}),e.jsx("span",{children:_e(A)})]})]})]}),u&&e.jsxs("section",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Now"}),e.jsxs("div",{className:"ctx-panel-conversation-flight",children:[e.jsxs("div",{className:"ctx-panel-conversation-flight-row",children:[e.jsx("span",{className:"ctx-panel-conversation-flight-label",children:z(u.state)}),u.startedAt&&e.jsx("span",{className:"ctx-panel-conversation-flight-time",children:W(u.startedAt)})]}),u.summary&&e.jsx("div",{className:"ctx-panel-conversation-flight-summary",children:u.summary})]})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Workspace"}),Ze?e.jsxs("div",{className:"ctx-panel-workspace-card",children:[e.jsxs("div",{className:"ctx-panel-workspace-head",children:[e.jsx("div",{className:"ctx-panel-workspace-kicker",children:"Project"}),e.jsx("div",{className:"ctx-panel-workspace-title",title:J??ie??void 0,children:ie??"Unscoped workspace"})]}),Q&&e.jsx("div",{className:"ctx-panel-workspace-path",title:J??Q,children:Q}),re.length>0&&e.jsx("div",{className:"ctx-panel-workspace-strip",children:re.map(n=>e.jsx("span",{className:"ctx-panel-workspace-chip",children:n},n))})]}):e.jsx("div",{className:"ctx-panel-empty",children:"No workspace metadata yet"})]}),Je&&e.jsxs("section",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Session"}),e.jsxs("div",{className:"ctx-panel-session-card",children:[e.jsx("div",{className:"ctx-panel-session-head",children:e.jsxs("div",{className:"ctx-panel-session-primary",children:[Re&&e.jsx("div",{className:"ctx-panel-session-kind",children:Re}),M&&e.jsx("div",{className:"ctx-panel-session-id",title:M,children:Ee??M})]})}),(Le||k)&&e.jsxs("div",{className:"ctx-panel-session-meta",children:[Le&&I&&e.jsxs("div",{className:"ctx-panel-session-meta-item",children:[e.jsx("span",{children:"Harness session"}),e.jsx("strong",{title:I,children:Ke??I})]}),k&&e.jsxs("div",{className:"ctx-panel-session-meta-item",children:[e.jsx("span",{children:"Harness log"}),e.jsx("strong",{title:k,children:ze(k)??k})]})]})]})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Activity"}),e.jsxs("div",{className:`ctx-panel-activity-card${C?" ctx-panel-activity-card--active":""}`,children:[e.jsxs("div",{className:"ctx-panel-activity-head",children:[e.jsx("span",{className:"ctx-panel-activity-dot",style:{background:C?"var(--green)":Me(A)}}),e.jsxs("div",{className:"ctx-panel-activity-main",children:[e.jsx("div",{className:"ctx-panel-activity-title",children:Qe}),e.jsx("div",{className:"ctx-panel-activity-sub",title:Y?oe(Y):void 0,children:Ye})]})]}),u&&e.jsxs("div",{className:"ctx-panel-activity-ledger",children:[e.jsx("span",{className:"ctx-panel-activity-ledger-label",children:z(u.state)}),u.startedAt&&e.jsx("span",{className:"ctx-panel-activity-ledger-time",title:oe(u.startedAt),children:W(u.startedAt)})]}),e.jsxs("div",{className:"ctx-panel-activity-facts",children:[typeof Te=="number"&&e.jsx(pe,{label:"Messages",value:`${Te}`}),typeof be=="number"&&e.jsx(pe,{label:"People",value:`${be}`}),De&&e.jsx(pe,{label:"Agent",value:_e(A)})]})]})]}),ke&&e.jsxs("section",{className:"ctx-panel-section ctx-panel-conversation-preview",children:[e.jsx("div",{className:"ctx-panel-section-label",children:Ae?`Latest · ${Ae}`:"Latest"}),e.jsx("div",{className:"ctx-panel-conversation-preview-body",children:ke})]}),Ge&&d&&e.jsxs("section",{className:"ctx-panel-section ctx-panel-conversation-live-section",children:[e.jsxs("div",{className:"ctx-panel-section-label",children:[e.jsx("span",{children:Xe}),Ce&&e.jsx("span",{className:"ctx-panel-live-session",title:v??void 0,children:Ce})]}),e.jsxs("div",{className:`ctx-panel-live-card${C?" ctx-panel-live-card--active":""}`,children:[e.jsxs("div",{className:`ctx-panel-live-session-card${C?" ctx-panel-live-session-card--active":""}`,children:[e.jsxs("div",{className:"ctx-panel-live-session-copy",children:[e.jsx("span",{children:tt}),e.jsx("strong",{title:v??void 0,children:st}),Pe&&e.jsx("small",{children:Pe})]}),e.jsx("div",{className:"ctx-panel-live-session-pulse","aria-hidden":"true",children:e.jsx("span",{})})]}),e.jsx(ut,{agent:d,catalog:je,navigate:a,returnTo:t,variant:"compact",className:"ctx-panel-live-actions"}),le&&e.jsx("div",{className:"ctx-panel-live-summary",children:le}),T&&e.jsx(yt,{agentId:d.id,lines:24,columns:132,className:"ctx-panel-tmux-peek--conversation"}),ae.length>0&&e.jsxs("div",{className:"ctx-panel-live-files","aria-live":"polite",children:[e.jsxs("div",{className:"ctx-panel-live-files-label",children:[e.jsx("span",{children:"Files"}),e.jsx("strong",{children:ae.length})]}),e.jsx("ol",{className:"ctx-panel-live-file-list",children:ae.map(n=>e.jsxs("li",{className:`ctx-panel-live-file ctx-panel-live-file--${n.tone}`,title:`${n.path} · ${n.verb}`,children:[e.jsx("span",{className:"ctx-panel-live-file-mark",children:n.mark}),e.jsx("span",{className:"ctx-panel-live-file-path",children:Ft(n.path)}),e.jsx("span",{className:"ctx-panel-live-file-time",children:W(n.ts)})]},`${n.eventId}:${n.path}`))})]}),et&&e.jsx("div",{className:"ctx-panel-live-stream","aria-live":"polite",children:w.length>0?e.jsx("ol",{className:"ctx-panel-live-events",children:w.map(n=>e.jsxs("li",{className:"ctx-panel-live-event",children:[e.jsx("span",{className:"ctx-panel-live-event-kind",children:bt(n.kind)}),e.jsx("span",{className:"ctx-panel-live-event-summary",children:kt(n.summary)}),e.jsx("span",{className:"ctx-panel-live-event-time",title:oe(n.ts),children:W(n.ts)})]},n.id))}):e.jsx("div",{className:"ctx-panel-live-stream-empty",children:"Waiting for matching Tail events"})}),$&&e.jsxs("button",{type:"button",className:"ctx-panel-live-tail-button",onClick:at,title:Z?`Tail filter: ${Z}`:"Open Tail",children:[e.jsx(It,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Tail"})]})]})]}),ee&&e.jsx("section",{className:"ctx-panel-section ctx-panel-conversation-profile-section",children:e.jsxs("button",{type:"button",className:"ctx-panel-roster-button ctx-panel-conversation-profile-button",onClick:nt,children:[e.jsx("span",{className:"ctx-panel-roster-label",children:d?"Open agent profile":"Open session trace"}),e.jsx("span",{className:"ctx-panel-roster-count",children:e.jsx("span",{children:"→"})})]})})]})}function Mt({apiOffline:t,onRetry:s}){return e.jsx("div",{className:"ctx-panel ctx-panel--conversation",children:e.jsx("div",{className:"ctx-panel-empty-state",children:e.jsxs("div",{className:"ctx-panel-empty-card","data-tone":t?"error":"neutral",children:[e.jsx("div",{className:"ctx-panel-empty-card-title",children:t?"Context unavailable":"No conversation selected"}),e.jsx("div",{className:"ctx-panel-empty-card-detail",children:t?"Scout context will load after the server reconnects.":"Select a chat to inspect participants, sessions, and recent activity."}),t&&e.jsx("button",{type:"button",className:"ctx-panel-empty-card-action",onClick:s,children:"Retry"})]})})})}function pe({label:t,value:s}){return e.jsxs("div",{className:"ctx-panel-fact",children:[e.jsx("span",{className:"ctx-panel-fact-value",children:s}),e.jsx("span",{className:"ctx-panel-fact-label",children:t})]})}const _t=/(?:["'`])?((?:~|\/|\.{1,2}\/|[A-Za-z0-9_.-]+\/)[^\s"'`),;]+?\.(?:ts|tsx|js|jsx|mjs|cjs|css|scss|swift|md|json|jsonc|yml|yaml|toml|sql|py|rs|go|sh|html|m|mm))(?:["'`])?/gi;function Bt(t){const s=new Set,a=[],c=Wt(t.summary);for(const m of t.summary.matchAll(_t)){const h=m[1]?.trim();if(!h)continue;const r=h.toLowerCase();s.has(r)||(s.add(r),a.push({eventId:t.id,path:h,verb:c,mark:Ut(c),tone:zt(c),ts:t.ts}))}return a}function Wt(t){return/\b(created|create|wrote|write|edited|edit|modified|modify|updated|update|changed|change|patched|patch)\b/i.test(t)?"changed":/\b(read|opened|viewed|cat|sed)\b/i.test(t)?"read":"touched"}function zt(t){return t==="changed"?"changed":t==="read"?"read":"touched"}function Ut(t){return t==="changed"?"+":t==="read"?"r":"·"}function Ft(t){const s=t.replace(/[\\/]+$/g,""),a=s.split(/[\\/]/).filter(Boolean);return a.length<=2?s:`${a.at(-2)}/${a.at(-1)}`}export{Ms as ConversationInspector};
|
|
1
|
+
import{r as i,j as e}from"./index-NRbRrZw-.js";import{u as ct}from"./Provider-Cd-QZltN.js";import{o as $e}from"./openContent-C6XO6kr5.js";import{a as B}from"./api-DEHEgJ9m.js";import{u as rt}from"./sse-QSbhyq9A.js";import{u as lt}from"./tail-events-B7BrDaFi.js";import{n as ot,a as dt,s as Me,c as _e}from"./colors-BtO5_zlx.js";import{A as ut}from"./AgentLiveActions-BmXDRxER.js";import{i as mt}from"./message-visibility-kJM8XcSG.js";import{h as pt,j as ht,k as vt,m as xt,c as Be,l as ft}from"./conversation-model-CIzM7aXT.js";import{c as jt,e as gt,t as W,f as oe}from"./time-Dhsh_2EG.js";import{d as Nt}from"./router-Bx1tiwVe.js";import{T as yt}from"./TmuxPeek-eVfqPB4m.js";import{S as It}from"./scroll-text-uulNqrf7.js";import"./provider-Bq0ScH3v.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-CetjnYut.js";import"./createLucideIcon-Da0lq809.js";import"./TextDocumentSurface-B29xZNlI.js";import"./file-text-BGVkHS4_.js";import"./x-DuzAbpk5.js";import"./chevron-right-CV7sEVBS.js";import"./code-xml-CPzpZkhu.js";import"./arrow-left-B0CdJdAC.js";import"./arrow-right-YRBoTTyf.js";import"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-feLCB3Zm.js";import"./NewChatComposer-BPsg8shF.js";import"./text-B2UZi3l9.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Be0T8xv2.js";import"./index-CD2foMB8.js";import"./HarnessMark-CEzmPFHC.js";import"./NewChatOrigin-CCiPg_WR.js";import"./chevron-down-Jh540uf3.js";import"./search-HmdKXdtR.js";import"./chunk-HRAB3GC3-BYQZ1LOn.js";import"./index-BWHgHrtv.js";import"./terminal-takeover-BArLfNtd.js";import"./eye-B908WSFH.js";import"./terminal-DNZTCr6a.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";/* empty css */import"./refresh-cw-C4E58VJK.js";const wt=20;function de(t){if(!t)return null;const s=t.replace(/[\\/]+$/,"");return s?s.split(/[\\/]/).filter(Boolean).at(-1)??s:null}function ue(t){const s=t?.trim();return s?s.length>18?`${s.slice(0,8)}...${s.slice(-6)}`:s:null}function b(t){const s=new Set,a=[];for(const c of t){const m=c?.trim();if(!m)continue;const h=m.toLowerCase();s.has(h)||(s.add(h),a.push(m))}return a}function Ue(t,s){const a=t?.trim().replace(/[\\/]+$/,""),c=s.trim().replace(/[\\/]+$/,"");if(!a||!c)return!1;if(a===c)return!0;if(c.startsWith("~/")){const m=c.slice(1);if(a.endsWith(m)||a.includes(`${m}/`))return!0}if(a.startsWith("~/")){const m=a.slice(1);if(c.endsWith(m)||c.includes(`${m}/`))return!0}return a.startsWith(`${c}/`)||c.startsWith(`${a}/`)}function Fe(t,s){const a=t?.trim().toLowerCase(),c=s.trim().toLowerCase();return!a||!c?!1:a.includes(c)||c.includes(a)}function Ve(t,s){const a=t?.trim().toLowerCase(),c=s.trim().toLowerCase();return!a||!c?!1:a===c}function St(t){const{activeSessionId:s,agent:a,sessionMeta:c}=t,m=b([s,a?.harnessSessionId]),h=b([a?.cwd,a?.projectRoot,c?.workspaceRoot]),r=b([a?.project,de(a?.cwd),de(a?.projectRoot),de(c?.workspaceRoot)]).filter(U=>U.length>2),o=b([...m.slice(0,2),...r.slice(0,2)]).join("|");return{sessionIds:m,paths:h,projects:r,query:o}}function he(t,s){return!!(s.sessionIds.some(a=>Fe(t.sessionId,a))||s.paths.some(a=>Ue(t.cwd,a))||s.projects.some(a=>Ve(t.project,a)))}function Tt(t,s){const a=s.filter(r=>he(r,t)),c=b(a.filter(r=>t.sessionIds.some(o=>Fe(r.sessionId,o))).map(r=>r.sessionId));if(c[0])return c[0];const m=b(a.filter(r=>t.paths.some(o=>Ue(r.cwd,o))).map(r=>r.sessionId));if(m[0])return m[0];const h=b(a.filter(r=>t.projects.some(o=>Ve(r.project,o))).map(r=>r.sessionId));return h[0]?h[0]:t.paths[0]?t.paths[0]:t.sessionIds[0]?t.sessionIds[0]:t.projects[0]?t.projects[0]:t.query}function X(t,s){const a=new Map;for(const c of[...s,...t])a.set(c.id,c);return[...a.values()].sort((c,m)=>jt(c.ts,m.ts)).slice(0,wt)}function bt(t){return t==="tool-result"?"tool result":t}function kt(t){const s=t.replace(/\s+/g," ").trim();return s.length<=180?s:`${s.slice(0,177)}...`}const At={direct:"Conversation",channel:"Conversation",group_direct:"Conversation",thread:"Thread"},Ct=1800,Et=4800,We=2,Lt=120,Rt=650,Pt=1800;function me(t,s){try{return JSON.stringify(t)===JSON.stringify(s)?t:s}catch{return s}}function ze(t){if(!t)return null;const s=t.replace(/[\\/]+$/,"");return s?s.split(/[\\/]/).filter(Boolean).at(-1)??s:null}function $t(t){if(!t)return null;const s=t.replace(/[\\/]+$/,"");return s?s.replace(/^\/Users\/[^/]+(?=\/|$)/,"~"):null}function z(t){switch(t){case"queued":return"Queued";case"waking":return"Waking";case"waiting":return"Thinking";case"running":return"Working";default:return t.replace(/_/g," ")}}function Ms(){const{route:t,agents:s,navigate:a,apiConnection:c,reload:m}=ct(),h=Nt(t),r=t.view==="conversation"||t.view==="messages"?t.conversationId??null:null,[o,U]=i.useState(null),[E,ve]=i.useState([]),[G,xe]=i.useState(null),[He,F]=i.useState(!1),V=i.useCallback(async()=>{if(!r){U(null),ve([]),xe(null),F(!0);return}try{const[n,l,f]=await Promise.all([B(`/api/session/${encodeURIComponent(r)}`).catch(()=>null),B(`/api/flights?conversationId=${encodeURIComponent(r)}`).catch(()=>[]),B(`/api/messages?conversationId=${encodeURIComponent(r)}&limit=8`).catch(()=>[])]);U(p=>me(p,n)),ve(p=>me(p,l??[])),xe(p=>me(p,f?.filter(_=>!mt(_)).sort((_,it)=>gt(_.createdAt,it.createdAt)).at(-1)??null)),F(!0)}catch{F(!0)}},[r]);i.useEffect(()=>{F(!1),V()},[V]);const j=o?.agentId??null,d=i.useMemo(()=>j?s.find(n=>n.id===j)??null:null,[s,j]),H=d?.id??null,fe=pt(o),ee=ht({resolvedAgentId:H,sessionId:fe,machineId:h}),[je,ge]=i.useState(null),[L,te]=i.useState([]),[w,se]=i.useState([]),Ne=i.useRef([]),S=i.useRef(null),O=i.useRef(null),x=i.useRef([]),g=i.useRef(null),N=i.useRef(null),R=i.useRef(new Set),q=i.useCallback(()=>{S.current!==null&&(window.clearTimeout(S.current),S.current=null),O.current=null},[]),P=i.useCallback(()=>{if(!r)return;const n=Date.now(),l=O.current??n;O.current=l;const p=n-l>=Et?0:Ct;S.current!==null&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>{S.current=null,O.current=null,V()},p)},[r,V]);i.useEffect(()=>q,[q]),i.useEffect(()=>{if(ge(null),!H)return;let n=!1;return B(`/api/agents/${encodeURIComponent(H)}/session-catalog`).then(l=>{n||ge(l)}).catch(()=>{}),()=>{n=!0}},[H]);const Oe=vt({name:d?.name,agentName:o?.agentName,id:j,title:o?.title}),ye=d?xt(d)??Be(d.id)??d.id:j?Be(j)??j:null,u=i.useMemo(()=>E.filter(ft).sort((n,l)=>(l.startedAt??0)-(n.startedAt??0))[0]??null,[E]);i.useEffect(()=>{R.current=new Set(E.map(n=>n.invocationId))},[E]),i.useEffect(()=>{q(),R.current.clear()},[q,r]),rt(n=>{if(r){if(n.kind==="message.posted"){n.payload?.message?.conversationId===r&&P();return}if(n.kind==="conversation.upserted"){n.payload?.conversation?.id===r&&P();return}if(n.kind==="invocation.requested"){const l=n.payload?.invocation;if(l?.conversationId===r){R.current.add(l.id),P();return}!l?.conversationId&&j&&l?.targetAgentId===j&&(R.current.add(l.id),P());return}if(n.kind==="flight.updated"){const l=n.payload?.flight;if(!l)return;(u?.id===l.id||u?.invocationId===l.invocationId||R.current.has(l.invocationId)||E.some(p=>p.id===l.id||p.invocationId===l.invocationId))&&P()}}});const v=je?.activeSessionId??d?.harnessSessionId??fe??o?.harnessSessionId??null,I=d?.harnessSessionId??o?.harnessSessionId??null,k=d?.harnessLogPath??null,y=i.useMemo(()=>St({activeSessionId:v,agent:d,sessionMeta:o}),[v,d,o]),ne=JSON.stringify({sessionIds:y.sessionIds,paths:y.paths,projects:y.projects}),$=y.sessionIds.length>0||y.paths.length>0||y.projects.length>0,D=i.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null),N.current!==null&&(window.clearInterval(N.current),N.current=null),x.current=[]},[]),K=i.useCallback(()=>{D()},[D]),Ie=i.useCallback(()=>{if(N.current!==null||(g.current!==null&&(window.clearTimeout(g.current),g.current=null),x.current.length===0))return;const l=()=>{const f=x.current.slice(0,We);x.current=x.current.slice(We),f.length>0&&se(p=>X(p,f)),!(x.current.length>0)&&N.current!==null&&(window.clearInterval(N.current),N.current=null)};l(),x.current.length>0&&(N.current=window.setInterval(l,Lt))},[]),we=i.useCallback(n=>{N.current===null&&g.current===null&&(g.current=window.setTimeout(()=>{g.current=null,Ie()},n))},[Ie]);i.useEffect(()=>{Ne.current=w},[w]),i.useEffect(()=>D,[D]),i.useEffect(()=>{K(),te([]),se([])},[K,ne]),i.useEffect(()=>{if(!$)return;let n=!1;const l=new URLSearchParams({limit:"180",transcripts:"true"});return B(`/api/tail/recent?${l.toString()}`).then(f=>{if(n)return;const p=(f.events??[]).filter(_=>he(_,y));te(X([],p))}).catch(()=>{}),()=>{n=!0}},[$,ne]),lt(i.useCallback(n=>{$&&he(n,y)&&te(l=>X(l,[n]))},[$,ne])),i.useEffect(()=>{if(L.length===0){K(),se([]);return}const n=Ne.current,l=new Set([...n.map(p=>p.id),...x.current.map(p=>p.id)]),f=L.filter(p=>!l.has(p.id));f.length!==0&&(x.current=X(x.current,f),x.current.length>0&&we(n.length===0?Rt:Pt))},[we,K,L]);const ae=i.useMemo(()=>w.flatMap(Bt).slice(0,5),[w]);if(!r)return e.jsx(Mt,{apiOffline:c.status==="offline",onRetry:()=>{m()}});if(!He)return e.jsx("div",{className:"ctx-panel ctx-panel--conversation",children:e.jsx("div",{className:"ctx-panel-empty-state",children:e.jsx("div",{className:"ctx-panel-empty-hint",children:"Loading conversation…"})})});const qe=o?.kind?At[o.kind]??o.kind:"Conversation",J=o?.workspaceRoot??null,ie=ze(J),Q=$t(J),Se=o?.currentBranch??null,ce=d?.harness??o?.harness??null,Y=o?.lastMessageAt??G?.createdAt??null,Te=o?.messageCount??null,be=o?o.participantIds.filter(n=>n!=="operator").length+1:null,A=d?.state??null,De=ot(A),ke=G?.body?.trim()||o?.preview?.trim()||null,Ae=G?.actorName??null,Ce=ue(v),M=v??I,Ee=ue(M),Ke=ue(I),Le=!!(I&&I!==M),Re=[ce,d?.transport].filter(Boolean).join(" · "),Je=!!(v||I||k),T=!!(d?.terminalSurface?.backend==="tmux"||d?.transport==="tmux"&&d.harnessSessionId),C=!!(u||dt(A,d)),Qe=C?u?z(u.state):"In motion":"At rest",Ye=u?.summary?.trim()??(Y?`Last update ${W(Y)??"recently"}`:"No recent activity recorded"),re=[Se?`branch ${Se}`:null,ce,d?.transport].filter(Boolean),Ze=!!(ie||Q||re.length>0),Xe=C?"Live activity":T?"Terminal":"Activity",le=u?.summary?.trim()??(v&&!T?"Terminal session is live.":w.length>0&&!T?"Streaming matching Tail events.":null),Z=Tt(y,L),Ge=!!(d&&(u||v||L.length>0||T)),et=!T,tt=v?T?"Terminal session":"Trace session":u?"Session starting":"Session context",st=v?Ee??v:u?z(u.state):"Waiting for a session id",Pe=v?[ce,d?.transport,u?z(u.state):null].filter(Boolean).join(" · "):u?.summary?.trim()??le??null,nt=()=>{ee&&$e(a,ee,{returnTo:t})},at=()=>{$e(a,{view:"ops",mode:"tail",...Z?{tailQuery:Z}:{}},{returnTo:t})};return e.jsxs("div",{className:"ctx-panel ctx-panel--conversation",children:[e.jsxs("section",{className:"ctx-panel-section ctx-panel-conversation-summary",children:[e.jsx("div",{className:"ctx-panel-section-label",children:qe}),e.jsxs("div",{className:"ctx-panel-conversation-card",children:[e.jsx("div",{className:"ctx-panel-conversation-title",children:Oe}),ye&&e.jsxs("div",{className:"ctx-panel-conversation-handle",children:["@",ye]}),e.jsxs("div",{className:"ctx-panel-conversation-state",children:[e.jsx("span",{className:"ctx-panel-conversation-state-dot",style:{background:Me(A)}}),e.jsx("span",{children:_e(A)})]})]})]}),u&&e.jsxs("section",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Now"}),e.jsxs("div",{className:"ctx-panel-conversation-flight",children:[e.jsxs("div",{className:"ctx-panel-conversation-flight-row",children:[e.jsx("span",{className:"ctx-panel-conversation-flight-label",children:z(u.state)}),u.startedAt&&e.jsx("span",{className:"ctx-panel-conversation-flight-time",children:W(u.startedAt)})]}),u.summary&&e.jsx("div",{className:"ctx-panel-conversation-flight-summary",children:u.summary})]})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Workspace"}),Ze?e.jsxs("div",{className:"ctx-panel-workspace-card",children:[e.jsxs("div",{className:"ctx-panel-workspace-head",children:[e.jsx("div",{className:"ctx-panel-workspace-kicker",children:"Project"}),e.jsx("div",{className:"ctx-panel-workspace-title",title:J??ie??void 0,children:ie??"Unscoped workspace"})]}),Q&&e.jsx("div",{className:"ctx-panel-workspace-path",title:J??Q,children:Q}),re.length>0&&e.jsx("div",{className:"ctx-panel-workspace-strip",children:re.map(n=>e.jsx("span",{className:"ctx-panel-workspace-chip",children:n},n))})]}):e.jsx("div",{className:"ctx-panel-empty",children:"No workspace metadata yet"})]}),Je&&e.jsxs("section",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Session"}),e.jsxs("div",{className:"ctx-panel-session-card",children:[e.jsx("div",{className:"ctx-panel-session-head",children:e.jsxs("div",{className:"ctx-panel-session-primary",children:[Re&&e.jsx("div",{className:"ctx-panel-session-kind",children:Re}),M&&e.jsx("div",{className:"ctx-panel-session-id",title:M,children:Ee??M})]})}),(Le||k)&&e.jsxs("div",{className:"ctx-panel-session-meta",children:[Le&&I&&e.jsxs("div",{className:"ctx-panel-session-meta-item",children:[e.jsx("span",{children:"Harness session"}),e.jsx("strong",{title:I,children:Ke??I})]}),k&&e.jsxs("div",{className:"ctx-panel-session-meta-item",children:[e.jsx("span",{children:"Harness log"}),e.jsx("strong",{title:k,children:ze(k)??k})]})]})]})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Activity"}),e.jsxs("div",{className:`ctx-panel-activity-card${C?" ctx-panel-activity-card--active":""}`,children:[e.jsxs("div",{className:"ctx-panel-activity-head",children:[e.jsx("span",{className:"ctx-panel-activity-dot",style:{background:C?"var(--green)":Me(A)}}),e.jsxs("div",{className:"ctx-panel-activity-main",children:[e.jsx("div",{className:"ctx-panel-activity-title",children:Qe}),e.jsx("div",{className:"ctx-panel-activity-sub",title:Y?oe(Y):void 0,children:Ye})]})]}),u&&e.jsxs("div",{className:"ctx-panel-activity-ledger",children:[e.jsx("span",{className:"ctx-panel-activity-ledger-label",children:z(u.state)}),u.startedAt&&e.jsx("span",{className:"ctx-panel-activity-ledger-time",title:oe(u.startedAt),children:W(u.startedAt)})]}),e.jsxs("div",{className:"ctx-panel-activity-facts",children:[typeof Te=="number"&&e.jsx(pe,{label:"Messages",value:`${Te}`}),typeof be=="number"&&e.jsx(pe,{label:"People",value:`${be}`}),De&&e.jsx(pe,{label:"Agent",value:_e(A)})]})]})]}),ke&&e.jsxs("section",{className:"ctx-panel-section ctx-panel-conversation-preview",children:[e.jsx("div",{className:"ctx-panel-section-label",children:Ae?`Latest · ${Ae}`:"Latest"}),e.jsx("div",{className:"ctx-panel-conversation-preview-body",children:ke})]}),Ge&&d&&e.jsxs("section",{className:"ctx-panel-section ctx-panel-conversation-live-section",children:[e.jsxs("div",{className:"ctx-panel-section-label",children:[e.jsx("span",{children:Xe}),Ce&&e.jsx("span",{className:"ctx-panel-live-session",title:v??void 0,children:Ce})]}),e.jsxs("div",{className:`ctx-panel-live-card${C?" ctx-panel-live-card--active":""}`,children:[e.jsxs("div",{className:`ctx-panel-live-session-card${C?" ctx-panel-live-session-card--active":""}`,children:[e.jsxs("div",{className:"ctx-panel-live-session-copy",children:[e.jsx("span",{children:tt}),e.jsx("strong",{title:v??void 0,children:st}),Pe&&e.jsx("small",{children:Pe})]}),e.jsx("div",{className:"ctx-panel-live-session-pulse","aria-hidden":"true",children:e.jsx("span",{})})]}),e.jsx(ut,{agent:d,catalog:je,navigate:a,returnTo:t,variant:"compact",className:"ctx-panel-live-actions"}),le&&e.jsx("div",{className:"ctx-panel-live-summary",children:le}),T&&e.jsx(yt,{agentId:d.id,lines:24,columns:132,className:"ctx-panel-tmux-peek--conversation"}),ae.length>0&&e.jsxs("div",{className:"ctx-panel-live-files","aria-live":"polite",children:[e.jsxs("div",{className:"ctx-panel-live-files-label",children:[e.jsx("span",{children:"Files"}),e.jsx("strong",{children:ae.length})]}),e.jsx("ol",{className:"ctx-panel-live-file-list",children:ae.map(n=>e.jsxs("li",{className:`ctx-panel-live-file ctx-panel-live-file--${n.tone}`,title:`${n.path} · ${n.verb}`,children:[e.jsx("span",{className:"ctx-panel-live-file-mark",children:n.mark}),e.jsx("span",{className:"ctx-panel-live-file-path",children:Ft(n.path)}),e.jsx("span",{className:"ctx-panel-live-file-time",children:W(n.ts)})]},`${n.eventId}:${n.path}`))})]}),et&&e.jsx("div",{className:"ctx-panel-live-stream","aria-live":"polite",children:w.length>0?e.jsx("ol",{className:"ctx-panel-live-events",children:w.map(n=>e.jsxs("li",{className:"ctx-panel-live-event",children:[e.jsx("span",{className:"ctx-panel-live-event-kind",children:bt(n.kind)}),e.jsx("span",{className:"ctx-panel-live-event-summary",children:kt(n.summary)}),e.jsx("span",{className:"ctx-panel-live-event-time",title:oe(n.ts),children:W(n.ts)})]},n.id))}):e.jsx("div",{className:"ctx-panel-live-stream-empty",children:"Waiting for matching Tail events"})}),$&&e.jsxs("button",{type:"button",className:"ctx-panel-live-tail-button",onClick:at,title:Z?`Tail filter: ${Z}`:"Open Tail",children:[e.jsx(It,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Tail"})]})]})]}),ee&&e.jsx("section",{className:"ctx-panel-section ctx-panel-conversation-profile-section",children:e.jsxs("button",{type:"button",className:"ctx-panel-roster-button ctx-panel-conversation-profile-button",onClick:nt,children:[e.jsx("span",{className:"ctx-panel-roster-label",children:d?"Open agent profile":"Open session trace"}),e.jsx("span",{className:"ctx-panel-roster-count",children:e.jsx("span",{children:"→"})})]})})]})}function Mt({apiOffline:t,onRetry:s}){return e.jsx("div",{className:"ctx-panel ctx-panel--conversation",children:e.jsx("div",{className:"ctx-panel-empty-state",children:e.jsxs("div",{className:"ctx-panel-empty-card","data-tone":t?"error":"neutral",children:[e.jsx("div",{className:"ctx-panel-empty-card-title",children:t?"Context unavailable":"No conversation selected"}),e.jsx("div",{className:"ctx-panel-empty-card-detail",children:t?"Scout context will load after the server reconnects.":"Select a chat to inspect participants, sessions, and recent activity."}),t&&e.jsx("button",{type:"button",className:"ctx-panel-empty-card-action",onClick:s,children:"Retry"})]})})})}function pe({label:t,value:s}){return e.jsxs("div",{className:"ctx-panel-fact",children:[e.jsx("span",{className:"ctx-panel-fact-value",children:s}),e.jsx("span",{className:"ctx-panel-fact-label",children:t})]})}const _t=/(?:["'`])?((?:~|\/|\.{1,2}\/|[A-Za-z0-9_.-]+\/)[^\s"'`),;]+?\.(?:ts|tsx|js|jsx|mjs|cjs|css|scss|swift|md|json|jsonc|yml|yaml|toml|sql|py|rs|go|sh|html|m|mm))(?:["'`])?/gi;function Bt(t){const s=new Set,a=[],c=Wt(t.summary);for(const m of t.summary.matchAll(_t)){const h=m[1]?.trim();if(!h)continue;const r=h.toLowerCase();s.has(r)||(s.add(r),a.push({eventId:t.id,path:h,verb:c,mark:Ut(c),tone:zt(c),ts:t.ts}))}return a}function Wt(t){return/\b(created|create|wrote|write|edited|edit|modified|modify|updated|update|changed|change|patched|patch)\b/i.test(t)?"changed":/\b(read|opened|viewed|cat|sed)\b/i.test(t)?"read":"touched"}function zt(t){return t==="changed"?"changed":t==="read"?"read":"touched"}function Ut(t){return t==="changed"?"+":t==="read"?"r":"·"}function Ft(t){const s=t.replace(/[\\/]+$/g,""),a=s.split(/[\\/]/).filter(Boolean);return a.length<=2?s:`${a.at(-2)}/${a.at(-1)}`}export{Ms as ConversationInspector};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,j as e}from"./index-Bli6bTLU.js";import{u as j}from"./Provider-Ve8yXaWR.js";import{o as b}from"./openContent-C6XO6kr5.js";import{a as N}from"./api-DEHEgJ9m.js";import{u as w}from"./sse-CSozY6mp.js";import{t as g,b as p}from"./time-Dhsh_2EG.js";import{C as y}from"./chevron-down-Da5tV19_.js";import{C as I}from"./chevron-right-BMqtBds_.js";import{M as C}from"./message-square-DlY4EneU.js";import"./provider-CX9EWecp.js";import"./router-B0YclXYg.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.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"./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"./search-BbgsEMXa.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./index-BWHgHrtv.js";const M=5;function ve(){const{route:t,navigate:s}=j(),a=t.view==="work"?t.workId:null,[r,o]=u.useState(null),i=u.useCallback(async()=>{if(!a){o(null);return}try{o(await N(`/api/work/${encodeURIComponent(a)}`))}catch{o(null)}},[a]);if(u.useEffect(()=>{i()},[i]),w(()=>{a&&i()}),t.view!=="work")return null;if(!r)return e.jsx("div",{className:"flex h-full items-center justify-center px-4 text-center text-sm font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-ghost)]",children:"Loading work item…"});const d=O(r.state),m=T(r.attention),f=r.ownerName??r.ownerId??"Unassigned",l=r.nextMoveOwnerName??r.nextMoveOwnerId??null,h=l!==null&&(r.ownerId??null)!==(r.nextMoveOwnerId??null)&&l!==f,k=1+(h?1:0)+(r.priority?1:0)+2+(r.parentId?1:0)+(r.conversationId?1:0);return e.jsxs("div",{className:"flex flex-col h-full overflow-y-auto frame-scrollbar text-sm",children:[e.jsx("div",{className:"sticky top-0 z-10 border-b border-[var(--scout-chrome-border-soft)] bg-black/55 px-4 py-2 backdrop-blur",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${d.dot}`}),e.jsx("span",{className:`font-mono text-xs uppercase tracking-[0.15em] ${d.text}`,children:L(r.state)}),e.jsxs("span",{className:"min-w-0 flex-1 truncate text-xs text-[var(--scout-chrome-ink-faint)]",children:[e.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:f}),h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"px-1 text-[var(--scout-chrome-ink-ghost)]",children:"→"}),e.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:l})]})]}),m&&e.jsx("span",{className:"shrink-0 rounded border border-amber-400/30 bg-amber-400/10 px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-amber-300/90",children:m})]})}),e.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[e.jsxs(c,{label:"Case facts",children:[e.jsx(n,{label:"Phase",value:r.currentPhase}),e.jsx(n,{label:"Acceptance",value:r.acceptanceState.replace(/_/g," ")}),r.priority&&e.jsx(n,{label:"Priority",value:r.priority})]}),e.jsx(c,{label:"Timeline",children:r.timeline.length===0?e.jsx("div",{className:"text-xs text-[var(--scout-chrome-ink-faint)]",children:"No activity yet."}):e.jsx("div",{className:"flex flex-col gap-1.5",children:r.timeline.slice(0,M).map(x=>e.jsx(W,{item:x,onOpen:x.conversationId?()=>b(s,{view:"conversation",conversationId:x.conversationId},{returnTo:t}):void 0},x.id))})}),e.jsxs(c,{label:"Routing",collapsible:!0,defaultOpen:!1,count:k,children:[e.jsx(n,{label:"Owner",value:f}),h&&l&&e.jsx(n,{label:"Next move",value:l}),r.priority&&e.jsx(n,{label:"Priority",value:r.priority}),e.jsx(n,{label:"Children",value:`${r.activeChildWorkCount}`}),e.jsx(n,{label:"Flights",value:`${r.activeFlightCount}`}),r.lastMeaningfulAt&&e.jsx(n,{label:"Last update",value:g(r.lastMeaningfulAt)}),(r.conversationId||r.parentId)&&e.jsxs("div",{className:"mt-2 flex flex-col gap-1.5",children:[r.conversationId&&e.jsx(v,{label:"Open thread",onClick:()=>b(s,{view:"conversation",conversationId:r.conversationId},{returnTo:t})}),r.parentId&&r.parentTitle&&e.jsx(v,{label:r.parentTitle,eyebrow:"Parent",onClick:()=>b(s,{view:"work",workId:r.parentId},{returnTo:t})})]})]}),e.jsxs(c,{label:"Record",collapsible:!0,defaultOpen:!1,children:[e.jsx(n,{label:"Case ID",value:r.id}),e.jsx(n,{label:"Created",value:p(r.createdAt)}),e.jsx(n,{label:"Updated",value:p(r.updatedAt)}),e.jsx(n,{label:"Last activity",value:p(r.lastMeaningfulAt)})]}),r.lastMeaningfulSummary&&e.jsxs(c,{label:"Hudson context",collapsible:!0,defaultOpen:!1,children:[e.jsx("div",{className:"text-sm italic leading-relaxed text-[var(--scout-chrome-ink-soft)]",children:r.lastMeaningfulSummary}),e.jsxs("div",{className:"mt-2 flex gap-1.5",children:[e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Plan"}),e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Docs"}),e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Code"})]})]})]})]})}function L(t){switch(t){case"review":return"In review";case"waiting":return"Waiting";case"working":return"Working";case"done":return"Done";default:return t.replace(/_/g," ")}}function T(t){switch(t){case"badge":return"Noteworthy";case"interrupt":return"Blocked";default:return null}}function O(t){return/complete|done|finished/i.test(t)?{dot:"bg-emerald-400",text:"text-emerald-300/90"}:/fail|error/i.test(t)?{dot:"bg-red-400",text:"text-red-300/90"}:/block|wait|pause/i.test(t)?{dot:"bg-amber-400",text:"text-amber-300/90"}:/active|working|in[_-]?progress/i.test(t)?{dot:"bg-cyan-400",text:"text-cyan-300/90"}:{dot:"bg-[var(--scout-chrome-ink-faint)]",text:"text-[var(--scout-chrome-ink)]"}}function c({label:t,children:s,collapsible:a=!1,defaultOpen:r=!0,count:o}){const[i,d]=u.useState(r);return a?e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("button",{type:"button",onClick:()=>d(m=>!m),className:"flex items-center gap-1.5 text-left text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)] hover:text-[var(--scout-chrome-ink)]",children:[i?e.jsx(y,{"aria-hidden":"true",size:10,strokeWidth:2}):e.jsx(I,{"aria-hidden":"true",size:10,strokeWidth:2}),e.jsx("span",{children:t}),typeof o=="number"&&o>0&&e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1 py-0 font-mono text-3xs tracking-[0.1em] text-[var(--scout-chrome-ink-faint)]",children:o})]}),i&&e.jsx("div",{className:"mt-1.5",children:s})]}):e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"mb-1.5 text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)]",children:t}),s]})}function v({label:t,eyebrow:s,onClick:a}){return e.jsxs("button",{type:"button",onClick:a,className:"flex items-center justify-between gap-2 rounded border border-[var(--scout-chrome-border-soft)] bg-white/[0.025] px-2 py-1.5 text-left hover:border-cyan-400/25 hover:bg-cyan-400/10",children:[e.jsxs("span",{className:"min-w-0",children:[s&&e.jsx("span",{className:"block font-mono text-2xs uppercase tracking-[0.14em] text-[var(--scout-chrome-ink-faint)]",children:s}),e.jsx("span",{className:"block truncate font-mono text-xs text-[var(--scout-chrome-ink)]",children:t})]}),e.jsx(C,{"aria-hidden":"true",size:11,strokeWidth:1.8,className:"shrink-0 text-cyan-300/75"})]})}function W({item:t,onOpen:s}){const a=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:`mt-1 h-1.5 w-1.5 shrink-0 rounded-full ${A(t)}`}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-mono text-2xs text-[var(--scout-chrome-ink-faint)]",children:g(t.at)}),e.jsx("span",{className:"shrink-0 rounded border border-[var(--scout-chrome-border-soft)] px-1 py-0.5 font-mono text-3xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:_(t)})]}),e.jsx("span",{className:"mt-0.5 block truncate text-xs font-semibold text-[var(--scout-chrome-ink-strong)]",children:t.actorName??"system"}),t.title&&e.jsx("span",{className:"mt-0.5 block truncate text-xs leading-snug text-[var(--scout-chrome-ink)]",children:t.title}),t.summary&&e.jsx("span",{className:"mt-0.5 block text-xs leading-relaxed text-[var(--scout-chrome-ink-faint)]",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,overflow:"hidden"},children:t.summary})]})]}),r="flex gap-2 border-t border-[var(--scout-chrome-border-soft)] pt-1.5 first:border-t-0 first:pt-0",o=p(t.at);return s?e.jsx("button",{type:"button",onClick:s,title:o,className:`${r} text-left hover:text-cyan-300/90`,children:a}):e.jsx("div",{className:r,title:o,children:a})}function _(t){switch(t.kind){case"flight_started":return"flight started";case"flight_completed":return t.detailKind?`flight ${t.detailKind}`:"flight ended";case"message":return"message";default:return t.title??t.detailKind??"event"}}function A(t){return t.kind==="message"?"bg-cyan-400":t.kind==="flight_started"?"bg-lime-400":t.kind==="flight_completed"?t.detailKind?.includes("fail")?"bg-red-400":"bg-emerald-400":t.detailKind?.includes("interrupt")||t.detailKind?.includes("block")?"bg-amber-400":"bg-[var(--scout-chrome-ink-faint)]"}function n({label:t,value:s}){return e.jsxs("div",{className:"flex items-baseline justify-between py-0.5 gap-2",children:[e.jsx("span",{className:"shrink-0 text-xs font-mono uppercase tracking-wider text-[var(--scout-chrome-ink-faint)]",children:t}),e.jsx("span",{className:"truncate text-sm font-mono text-[var(--scout-chrome-ink)]",children:s})]})}export{ve as WorkInspector};
|
|
1
|
+
import{r as u,j as e}from"./index-NRbRrZw-.js";import{u as j}from"./Provider-Cd-QZltN.js";import{o as b}from"./openContent-C6XO6kr5.js";import{a as N}from"./api-DEHEgJ9m.js";import{u as w}from"./sse-QSbhyq9A.js";import{t as g,b as p}from"./time-Dhsh_2EG.js";import{C as y}from"./chevron-down-Jh540uf3.js";import{C as I}from"./chevron-right-CV7sEVBS.js";import{M as C}from"./message-square-DURSOrUr.js";import"./provider-Bq0ScH3v.js";import"./router-Bx1tiwVe.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-CetjnYut.js";import"./createLucideIcon-Da0lq809.js";import"./TextDocumentSurface-B29xZNlI.js";import"./file-text-BGVkHS4_.js";import"./x-DuzAbpk5.js";import"./code-xml-CPzpZkhu.js";import"./arrow-left-B0CdJdAC.js";import"./arrow-right-YRBoTTyf.js";import"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-feLCB3Zm.js";import"./NewChatComposer-BPsg8shF.js";import"./text-B2UZi3l9.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Be0T8xv2.js";import"./conversation-model-CIzM7aXT.js";import"./index-CD2foMB8.js";import"./HarnessMark-CEzmPFHC.js";import"./NewChatOrigin-CCiPg_WR.js";import"./search-HmdKXdtR.js";import"./chunk-HRAB3GC3-BYQZ1LOn.js";import"./index-BWHgHrtv.js";const M=5;function ve(){const{route:t,navigate:s}=j(),a=t.view==="work"?t.workId:null,[r,o]=u.useState(null),i=u.useCallback(async()=>{if(!a){o(null);return}try{o(await N(`/api/work/${encodeURIComponent(a)}`))}catch{o(null)}},[a]);if(u.useEffect(()=>{i()},[i]),w(()=>{a&&i()}),t.view!=="work")return null;if(!r)return e.jsx("div",{className:"flex h-full items-center justify-center px-4 text-center text-sm font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-ghost)]",children:"Loading work item…"});const d=O(r.state),m=T(r.attention),f=r.ownerName??r.ownerId??"Unassigned",l=r.nextMoveOwnerName??r.nextMoveOwnerId??null,h=l!==null&&(r.ownerId??null)!==(r.nextMoveOwnerId??null)&&l!==f,k=1+(h?1:0)+(r.priority?1:0)+2+(r.parentId?1:0)+(r.conversationId?1:0);return e.jsxs("div",{className:"flex flex-col h-full overflow-y-auto frame-scrollbar text-sm",children:[e.jsx("div",{className:"sticky top-0 z-10 border-b border-[var(--scout-chrome-border-soft)] bg-black/55 px-4 py-2 backdrop-blur",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${d.dot}`}),e.jsx("span",{className:`font-mono text-xs uppercase tracking-[0.15em] ${d.text}`,children:L(r.state)}),e.jsxs("span",{className:"min-w-0 flex-1 truncate text-xs text-[var(--scout-chrome-ink-faint)]",children:[e.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:f}),h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"px-1 text-[var(--scout-chrome-ink-ghost)]",children:"→"}),e.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:l})]})]}),m&&e.jsx("span",{className:"shrink-0 rounded border border-amber-400/30 bg-amber-400/10 px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-amber-300/90",children:m})]})}),e.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[e.jsxs(c,{label:"Case facts",children:[e.jsx(n,{label:"Phase",value:r.currentPhase}),e.jsx(n,{label:"Acceptance",value:r.acceptanceState.replace(/_/g," ")}),r.priority&&e.jsx(n,{label:"Priority",value:r.priority})]}),e.jsx(c,{label:"Timeline",children:r.timeline.length===0?e.jsx("div",{className:"text-xs text-[var(--scout-chrome-ink-faint)]",children:"No activity yet."}):e.jsx("div",{className:"flex flex-col gap-1.5",children:r.timeline.slice(0,M).map(x=>e.jsx(W,{item:x,onOpen:x.conversationId?()=>b(s,{view:"conversation",conversationId:x.conversationId},{returnTo:t}):void 0},x.id))})}),e.jsxs(c,{label:"Routing",collapsible:!0,defaultOpen:!1,count:k,children:[e.jsx(n,{label:"Owner",value:f}),h&&l&&e.jsx(n,{label:"Next move",value:l}),r.priority&&e.jsx(n,{label:"Priority",value:r.priority}),e.jsx(n,{label:"Children",value:`${r.activeChildWorkCount}`}),e.jsx(n,{label:"Flights",value:`${r.activeFlightCount}`}),r.lastMeaningfulAt&&e.jsx(n,{label:"Last update",value:g(r.lastMeaningfulAt)}),(r.conversationId||r.parentId)&&e.jsxs("div",{className:"mt-2 flex flex-col gap-1.5",children:[r.conversationId&&e.jsx(v,{label:"Open thread",onClick:()=>b(s,{view:"conversation",conversationId:r.conversationId},{returnTo:t})}),r.parentId&&r.parentTitle&&e.jsx(v,{label:r.parentTitle,eyebrow:"Parent",onClick:()=>b(s,{view:"work",workId:r.parentId},{returnTo:t})})]})]}),e.jsxs(c,{label:"Record",collapsible:!0,defaultOpen:!1,children:[e.jsx(n,{label:"Case ID",value:r.id}),e.jsx(n,{label:"Created",value:p(r.createdAt)}),e.jsx(n,{label:"Updated",value:p(r.updatedAt)}),e.jsx(n,{label:"Last activity",value:p(r.lastMeaningfulAt)})]}),r.lastMeaningfulSummary&&e.jsxs(c,{label:"Hudson context",collapsible:!0,defaultOpen:!1,children:[e.jsx("div",{className:"text-sm italic leading-relaxed text-[var(--scout-chrome-ink-soft)]",children:r.lastMeaningfulSummary}),e.jsxs("div",{className:"mt-2 flex gap-1.5",children:[e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Plan"}),e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Docs"}),e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Code"})]})]})]})]})}function L(t){switch(t){case"review":return"In review";case"waiting":return"Waiting";case"working":return"Working";case"done":return"Done";default:return t.replace(/_/g," ")}}function T(t){switch(t){case"badge":return"Noteworthy";case"interrupt":return"Blocked";default:return null}}function O(t){return/complete|done|finished/i.test(t)?{dot:"bg-emerald-400",text:"text-emerald-300/90"}:/fail|error/i.test(t)?{dot:"bg-red-400",text:"text-red-300/90"}:/block|wait|pause/i.test(t)?{dot:"bg-amber-400",text:"text-amber-300/90"}:/active|working|in[_-]?progress/i.test(t)?{dot:"bg-cyan-400",text:"text-cyan-300/90"}:{dot:"bg-[var(--scout-chrome-ink-faint)]",text:"text-[var(--scout-chrome-ink)]"}}function c({label:t,children:s,collapsible:a=!1,defaultOpen:r=!0,count:o}){const[i,d]=u.useState(r);return a?e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("button",{type:"button",onClick:()=>d(m=>!m),className:"flex items-center gap-1.5 text-left text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)] hover:text-[var(--scout-chrome-ink)]",children:[i?e.jsx(y,{"aria-hidden":"true",size:10,strokeWidth:2}):e.jsx(I,{"aria-hidden":"true",size:10,strokeWidth:2}),e.jsx("span",{children:t}),typeof o=="number"&&o>0&&e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1 py-0 font-mono text-3xs tracking-[0.1em] text-[var(--scout-chrome-ink-faint)]",children:o})]}),i&&e.jsx("div",{className:"mt-1.5",children:s})]}):e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"mb-1.5 text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)]",children:t}),s]})}function v({label:t,eyebrow:s,onClick:a}){return e.jsxs("button",{type:"button",onClick:a,className:"flex items-center justify-between gap-2 rounded border border-[var(--scout-chrome-border-soft)] bg-white/[0.025] px-2 py-1.5 text-left hover:border-cyan-400/25 hover:bg-cyan-400/10",children:[e.jsxs("span",{className:"min-w-0",children:[s&&e.jsx("span",{className:"block font-mono text-2xs uppercase tracking-[0.14em] text-[var(--scout-chrome-ink-faint)]",children:s}),e.jsx("span",{className:"block truncate font-mono text-xs text-[var(--scout-chrome-ink)]",children:t})]}),e.jsx(C,{"aria-hidden":"true",size:11,strokeWidth:1.8,className:"shrink-0 text-cyan-300/75"})]})}function W({item:t,onOpen:s}){const a=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:`mt-1 h-1.5 w-1.5 shrink-0 rounded-full ${A(t)}`}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-mono text-2xs text-[var(--scout-chrome-ink-faint)]",children:g(t.at)}),e.jsx("span",{className:"shrink-0 rounded border border-[var(--scout-chrome-border-soft)] px-1 py-0.5 font-mono text-3xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:_(t)})]}),e.jsx("span",{className:"mt-0.5 block truncate text-xs font-semibold text-[var(--scout-chrome-ink-strong)]",children:t.actorName??"system"}),t.title&&e.jsx("span",{className:"mt-0.5 block truncate text-xs leading-snug text-[var(--scout-chrome-ink)]",children:t.title}),t.summary&&e.jsx("span",{className:"mt-0.5 block text-xs leading-relaxed text-[var(--scout-chrome-ink-faint)]",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,overflow:"hidden"},children:t.summary})]})]}),r="flex gap-2 border-t border-[var(--scout-chrome-border-soft)] pt-1.5 first:border-t-0 first:pt-0",o=p(t.at);return s?e.jsx("button",{type:"button",onClick:s,title:o,className:`${r} text-left hover:text-cyan-300/90`,children:a}):e.jsx("div",{className:r,title:o,children:a})}function _(t){switch(t.kind){case"flight_started":return"flight started";case"flight_completed":return t.detailKind?`flight ${t.detailKind}`:"flight ended";case"message":return"message";default:return t.title??t.detailKind??"event"}}function A(t){return t.kind==="message"?"bg-cyan-400":t.kind==="flight_started"?"bg-lime-400":t.kind==="flight_completed"?t.detailKind?.includes("fail")?"bg-red-400":"bg-emerald-400":t.detailKind?.includes("interrupt")||t.detailKind?.includes("block")?"bg-amber-400":"bg-[var(--scout-chrome-ink-faint)]"}function n({label:t,value:s}){return e.jsxs("div",{className:"flex items-baseline justify-between py-0.5 gap-2",children:[e.jsx("span",{className:"shrink-0 text-xs font-mono uppercase tracking-wider text-[var(--scout-chrome-ink-faint)]",children:t}),e.jsx("span",{className:"truncate text-sm font-mono text-[var(--scout-chrome-ink)]",children:s})]})}export{ve as WorkInspector};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"./createLucideIcon-
|
|
1
|
+
import{c}from"./createLucideIcon-Da0lq809.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{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
|
+
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-NRbRrZw-.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-NRbRrZw-.js";import{Q as p,R as i,T as c,u as E,U as S}from"./router-Bx1tiwVe.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};
|