@openscout/scout 0.2.94 → 0.2.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +14 -0
- package/README.md +164 -342
- package/bin/scout +26 -10
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/{ActivityScreen--eANwuxa.js → ActivityScreen-BnoaUkVZ.js} +1 -1
- package/dist/client/assets/{AddProjectForm-CcD6qvV8.js → AddProjectForm-IqOtJfRs.js} +1 -1
- package/dist/client/assets/{AgentAvatar-CYhf6twS.js → AgentAvatar-6-KBVKUu.js} +1 -1
- package/dist/client/assets/{AgentConfigurationScreen-BTI24HQX.js → AgentConfigurationScreen-CuZJy07q.js} +1 -1
- package/dist/client/assets/{AgentDefinitionsWorkspace-srmN6-vj.js → AgentDefinitionsWorkspace-Iyl4BesU.js} +1 -1
- package/dist/client/assets/{AgentDetailCard-UqPNpcvB.js → AgentDetailCard-C9rn3Fj5.js} +1 -1
- package/dist/client/assets/{AgentFloorView-XXNgI5Cj.js → AgentFloorView-YT-Jjccf.js} +1 -1
- package/dist/client/assets/{AgentInfoScreen-CimdOnZ9.js → AgentInfoScreen-Dr99gQEZ.js} +1 -1
- package/dist/client/assets/{AgentLaneCard-Z-aOBR3W.js → AgentLaneCard-DI2iW9zO.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-CyhA1reW.js → AgentLaneChrome-D8bARHMx.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-BNzjMjIH.js → AgentLaneDetailSheet-52un7dKC.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-Box8-_rS.js → AgentLaneSummaryResize-CEBjmPTa.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-Dgcm7zd_.js +1 -0
- package/dist/client/assets/AgentLanesPreflight-q20mTjms.js +1 -0
- package/dist/client/assets/AgentLanesView-CetZZDyF.js +2 -0
- package/dist/client/assets/{AgentLiveActions-BwuzOE8h.js → AgentLiveActions-DrEJDJef.js} +1 -1
- package/dist/client/assets/AgentMasterScreen-DJPnstoD.js +1 -0
- package/dist/client/assets/{AgentSessions-CsZwoukw.js → AgentSessions-DCPCG4xb.js} +1 -1
- package/dist/client/assets/{AgentsConsole-KCao4XmX.js → AgentsConsole-CsYOoFJi.js} +1 -1
- package/dist/client/assets/{AgentsScreen-CtPAmwRX.js → AgentsScreen-k8LvBuU_.js} +1 -1
- package/dist/client/assets/AgentsSubnav-C4xpQhsv.js +1 -0
- package/dist/client/assets/{AstronautSuit-Ckx7lu7G.js → AstronautSuit-DbjQtfD_.js} +1 -1
- package/dist/client/assets/{AtopView-DYlpgEHf.js → AtopView-Daq_ob3z.js} +1 -1
- package/dist/client/assets/{BackToPicker-4JaeRvDm.js → BackToPicker-CXZjBRAe.js} +1 -1
- package/dist/client/assets/{BriefingDetailScreen-D6-xqrpo.js → BriefingDetailScreen-CUCXO-KH.js} +1 -1
- package/dist/client/assets/{BriefingsScreen-DKxSDEmk.js → BriefingsScreen-B5oMTGKv.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-BbREmsbK.js → BrokerMetadataPanel-BsiU8lTD.js} +1 -1
- package/dist/client/assets/{BrokerScreen-fbPIouMw.js → BrokerScreen-BPbOHhCS.js} +1 -1
- package/dist/client/assets/{CastPicker-BcA2vDDV.js → CastPicker-_5E5hNUe.js} +1 -1
- package/dist/client/assets/ChatCollapsedStrip-D-eXhzPf.js +1 -0
- package/dist/client/assets/{CodeDiffPane-Cn8Y9hAt.js → CodeDiffPane-n7W4iGUG.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-nPFktrco.js → CodeProjectPicker-CMsbSTDq.js} +1 -1
- package/dist/client/assets/{CodeScreen-BlAxtxE5.js → CodeScreen-CeuO3EhR.js} +1 -1
- package/dist/client/assets/{ConversationComposer-2HjbGPL9.js → ConversationComposer-CXPKx86g.js} +1 -1
- package/dist/client/assets/{ConversationFeedRows-C6wUqJrx.js → ConversationFeedRows-WrH-YI3L.js} +1 -1
- package/dist/client/assets/{ConversationHeader-C8vfXaTF.js → ConversationHeader-BQWzGzLK.js} +1 -1
- package/dist/client/assets/{ConversationPanels-CNCIbpqU.js → ConversationPanels-Dujvnmup.js} +2 -2
- package/dist/client/assets/ConversationScreen-CR9pWB65.js +2 -0
- package/dist/client/assets/{ConversationStatus-DZuyKsWN.js → ConversationStatus-DVzSb2Hv.js} +1 -1
- package/dist/client/assets/{CrewAvatar-CTIuxp4G.js → CrewAvatar-BwXjyg8N.js} +1 -1
- package/dist/client/assets/CrewWorkspaces-CkQDhyie.css +1 -0
- package/dist/client/assets/CrewWorkspaces-NKujRzwh.js +1 -0
- package/dist/client/assets/{DataTable-6IDhanr5.js → DataTable-Bp8tU9AK.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-DC1u9itO.js → DispatchAftermath-B-6rmXzL.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-DZVhS7as.js → DocumentFocusViewer-Do3wQ_3Z.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-BKUFJMCV.js → EmbeddableSurfacesLab-C1orRyP9.js} +1 -1
- package/dist/client/assets/{EmptyState-CeBl0iGd.js → EmptyState-CJzXj1l5.js} +1 -1
- package/dist/client/assets/{FileViewerPane-DQlpNt2S.js → FileViewerPane-Df6VzXjA.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-6mGnmWQA.js +1 -0
- package/dist/client/assets/{FollowScreen-BXHOp3gb.js → FollowScreen-DvnxYLVh.js} +1 -1
- package/dist/client/assets/{HarnessMark-D5CA5uSp.js → HarnessMark-B979GCSB.js} +1 -1
- package/dist/client/assets/{HarnessesScreen-DhFXq1qz.js → HarnessesScreen-CHTuv8p6.js} +1 -1
- package/dist/client/assets/{HerdrSession-BRhs5LIR.js → HerdrSession-B3McuYgi.js} +1 -1
- package/dist/client/assets/{HomeHero-DMABJuze.js → HomeHero-CdUVPjkG.js} +1 -1
- package/dist/client/assets/{HostAdvisorView-RAociATV.js → HostAdvisorView-Bok5Sk5c.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-CZPyVNSw.js → KnowledgeSearchInspector-B7XSoJsu.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchScreen-mGTKIg00.js → KnowledgeSearchScreen-D3o3IODW.js} +1 -1
- package/dist/client/assets/{LaneToolHoverCard-D_DMlBeT.js → LaneToolHoverCard-HByf2ndx.js} +1 -1
- package/dist/client/assets/{LaneTraceDetailSheet-BEHg3LmH.js → LaneTraceDetailSheet-BUgHz-sd.js} +1 -1
- package/dist/client/assets/{LaneTraceEventFocus-DVimcizS.js → LaneTraceEventFocus-DM-hoPxG.js} +1 -1
- package/dist/client/assets/{MeshCanvas-BOuZx4AM.js → MeshCanvas-DCLJRsBy.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-wL-1N94e.js → MeshCanvasMinimap-cEFS9eW7.js} +1 -1
- package/dist/client/assets/{MeshScreen-DMY9Bmh5.js → MeshScreen-BcxPkhm6.js} +1 -1
- package/dist/client/assets/{MeshTopologyView-DiDcX5f4.js → MeshTopologyView-CCRPd8PU.js} +2 -2
- package/dist/client/assets/MessagesScreen-Bb5l13MO.js +1 -0
- package/dist/client/assets/{MissionContextRail-DrNKXG5u.js → MissionContextRail-DF0_kiU7.js} +1 -1
- package/dist/client/assets/{MissionControlView-ByBlHVN8.js → MissionControlView-E3V7bENU.js} +1 -1
- package/dist/client/assets/{MissionFocusOverlay-D1i6R6Zt.js → MissionFocusOverlay-h15sQFvP.js} +1 -1
- package/dist/client/assets/{MissionLeftAgentRow-DN9NcCML.js → MissionLeftAgentRow-KPdk9rSa.js} +1 -1
- package/dist/client/assets/{MissionLogPane-DSeIv3Xo.js → MissionLogPane-BbdDKjUl.js} +1 -1
- package/dist/client/assets/{NewAgentModal-V7yK6J6j.js → NewAgentModal-DfHxad34.js} +1 -1
- package/dist/client/assets/NewChatComposer-_Stj0fZy.js +19 -0
- package/dist/client/assets/{NewChatOrigin-DdpzE4kz.js → NewChatOrigin-B1u7ki70.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-l_Q3ts2q.js → ObserveEmbedScreen-Co0xTii6.js} +1 -1
- package/dist/client/assets/{ObserveTextFlow-BSEtYTxU.js → ObserveTextFlow-ZQWwrK3i.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-CdGUXxGR.js → ObservedTopologyPanel-BJUhDSuQ.js} +1 -1
- package/dist/client/assets/{OpenScoutAppShell-DN8dOSK4.js → OpenScoutAppShell-CUd2yOLu.js} +25 -25
- package/dist/client/assets/{OpsAgentsView-ntGr4pz4.js → OpsAgentsView-DI5wu1si.js} +1 -1
- package/dist/client/assets/OpsScreen-D8fQafCl.js +1 -0
- package/dist/client/assets/OpsSubnav-1K4Jaf__.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-Bdjd_dAx.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-BQET-qrY.js → ProjectAgentProfileBar-k2QHHHsQ.js} +1 -1
- package/dist/client/assets/{ProjectAgentProfileHero-Ck8mThtx.js → ProjectAgentProfileHero-Bpxk1ui2.js} +1 -1
- package/dist/client/assets/ProjectsInbox-C_bMHLCc.js +2 -0
- package/dist/client/assets/ProjectsRail-J-aH_pxT.js +1 -0
- package/dist/client/assets/ProjectsScreen-cVUkGbPz.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-_ourdM-Q.js +1 -0
- package/dist/client/assets/{Provider-B2xuo3rf.js → Provider-CtXJeLrP.js} +1 -1
- package/dist/client/assets/{RailRow-B-GycCBx.js → RailRow-CEH2MFBw.js} +1 -1
- package/dist/client/assets/{RawSessionsTable-AQThi6sm.js → RawSessionsTable-CDyrom-F.js} +1 -1
- package/dist/client/assets/RealtimeVoiceScreen-DBl3DN1H.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-DXWoRF_c.js → RepoDiffEmbedScreen-kY2pHjIs.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-D_274ExO.js → RepoDiffPageScreen-C6LhoKrn.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-DbedmHDX.js → RepoDiffViewer-BhcIIQQg.js} +1 -1
- package/dist/client/assets/{RepoDiffViewerLazy-C0--fPtk.js → RepoDiffViewerLazy-Csy_j9LD.js} +2 -2
- package/dist/client/assets/{ReposScreen-D39_YG4H.js → ReposScreen-B_cB0zu7.js} +1 -1
- package/dist/client/assets/ScoutDeckSurface-CSy_fjcG.js +1 -0
- package/dist/client/assets/{ScoutSurface-UsRy0t-I.js → ScoutSurface-CQVcSrin.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-Fmdfboxs.js → ScoutbotFxLab-DqGiLYNy.js} +1 -1
- package/dist/client/assets/{SecondaryNav-o2RL9H8H.js → SecondaryNav-BR4VRdgh.js} +1 -1
- package/dist/client/assets/SessionEmbedScreen-BTlZ9gAg.js +1 -0
- package/dist/client/assets/{SessionObserve-Dsd0j05N.js → SessionObserve-dQDN23pP.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-DopQYDkD.js → SessionObserveEvidence-BRBGKAgd.js} +1 -1
- package/dist/client/assets/SessionRefScreen-COVQMbtE.js +1 -0
- package/dist/client/assets/SessionsScreen--5OJ3p3v.js +1 -0
- package/dist/client/assets/{SettingsDrawer-_AwuopMS.js → SettingsDrawer-RGVK_bmE.js} +1 -1
- package/dist/client/assets/{SettingsScreen-Cw4DDfJP.js → SettingsScreen-CCxzy5IU.js} +1 -1
- package/dist/client/assets/{ShikiPane-BfHc_3pM.js → ShikiPane-DYI9Hkge.js} +1 -1
- package/dist/client/assets/{SlidePanel-C-q7XwTa.js → SlidePanel-B9ugxWgA.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-Bs68ZENy.js → SpriteAvatar-z5hHesx9.js} +1 -1
- package/dist/client/assets/{StatusPill-ZZQwxB1a.js → StatusPill-BFvMjmZV.js} +1 -1
- package/dist/client/assets/{TailView-Q4FVMsUH.js → TailView-0uEIj2JH.js} +1 -1
- package/dist/client/assets/{Terminal-D7zqHwHV.js → Terminal-DouZeNxc.js} +1 -1
- package/dist/client/assets/{TerminalEmbedScreen-CXIJ7qv6.js → TerminalEmbedScreen-dMNUbzXr.js} +1 -1
- package/dist/client/assets/{TerminalHeaderMount-BnBLOPbb.js → TerminalHeaderMount-BL07cd0q.js} +1 -1
- package/dist/client/assets/{TextDocumentSurface-CKQP-cBT.js → TextDocumentSurface-BflAwXeZ.js} +1 -1
- package/dist/client/assets/{TmuxPeek-V9dGESfO.js → TmuxPeek-BTnjOQi0.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-k7sbLXx2.js → VoicePermissionsPanel-CgQ6GGS-.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-60p9litn.js → WorkDetailScreen-CaLG-zDs.js} +1 -1
- package/dist/client/assets/{WorkFilesViewer-BjJS7GyM.js → WorkFilesViewer-B9Sil_No.js} +1 -1
- package/dist/client/assets/{activity-Bj3Hnbj3.js → activity-DcrMApUY.js} +1 -1
- package/dist/client/assets/{addon-fit-BL-NTWRU.js → addon-fit-DMVrz5Sv.js} +1 -1
- package/dist/client/assets/{addon-webgl-CIMgmNjg.js → addon-webgl-BYvpZUyu.js} +1 -1
- package/dist/client/assets/{agent-autocomplete-DXlvdc4b.js → agent-autocomplete-B-5QTeas.js} +1 -1
- package/dist/client/assets/{agent-essentials-BOMHR0_U.js → agent-essentials-D7KRGYvF.js} +1 -1
- package/dist/client/assets/{agent-lane-card-model-CTLxf3R4.js → agent-lane-card-model-CNZMPkhc.js} +1 -1
- package/dist/client/assets/{agent-lanes-model-AfrjRNK5.js → agent-lanes-model-DXqjs0OK.js} +2 -2
- package/dist/client/assets/agent-master-I1W-5d-x.css +1 -0
- package/dist/client/assets/agent-master-model-DqjrVI2h.js +1 -0
- package/dist/client/assets/{agent-specialization-BIPIBW8u.js → agent-specialization-BujJVUTD.js} +1 -1
- package/dist/client/assets/{arc.es-IR5r6sj_.js → arc.es-NHqHWohb.js} +1 -1
- package/dist/client/assets/{arrow-down-BydciYFZ.js → arrow-down-CKtSUjmW.js} +1 -1
- package/dist/client/assets/{arrow-left-CghA0kTw.js → arrow-left-Czpf-AE4.js} +1 -1
- package/dist/client/assets/{arrow-right-iJFv3jNh.js → arrow-right-BuzMnLYP.js} +1 -1
- package/dist/client/assets/{arrow-up-right-CCfZXPqD.js → arrow-up-right-C6Wl-1uw.js} +1 -1
- package/dist/client/assets/{bot-B5sub1-i.js → bot-rd0awxD3.js} +1 -1
- package/dist/client/assets/{check-C18YQC90.js → check-ofKUE8yH.js} +1 -1
- package/dist/client/assets/{chevron-down-Mp9mu_yd.js → chevron-down-wciXnOQz.js} +1 -1
- package/dist/client/assets/{chevron-right-CzH-TaSF.js → chevron-right-D-HdlPg8.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-swV8PA2k.js → chunk-HRAB3GC3-Tyv9rzx7.js} +1 -1
- package/dist/client/assets/{chunk-JTPDIGGW-BKXqcLKw.js → chunk-JTPDIGGW-BC2Mandc.js} +3 -3
- package/dist/client/assets/{chunk-T65CQEWV-vYbNJ8E6.js → chunk-T65CQEWV-C1AWTYZZ.js} +1 -1
- package/dist/client/assets/{chunk-YOZR3KYS-U65yUmqt.js → chunk-YOZR3KYS-DwHPHa6f.js} +1 -1
- package/dist/client/assets/{clock-B4PTFi5m.js → clock-B88r8OrZ.js} +1 -1
- package/dist/client/assets/{code-xml-Jtxsp5d1.js → code-xml-D7pOQM9l.js} +1 -1
- package/dist/client/assets/{compass-0_54-vz3.js → compass-Dt1AMXz2.js} +1 -1
- package/dist/client/assets/content-9K38QchR.js +1 -0
- package/dist/client/assets/content-BRgnyXWh.js +1 -0
- package/dist/client/assets/{content-CHghn-rT.js → content-BWPNyXJ0.js} +1 -1
- package/dist/client/assets/content-BdkI07v3.js +1 -0
- package/dist/client/assets/content-C4oWa8SB.js +1 -0
- package/dist/client/assets/content-C9ijJxyl.js +1 -0
- package/dist/client/assets/content-CFZ4rghn.js +1 -0
- package/dist/client/assets/content-CIqu_Ci_.js +1 -0
- package/dist/client/assets/content-CnJF9DGO.js +1 -0
- package/dist/client/assets/content-CriW8Y8u.js +1 -0
- package/dist/client/assets/content-DDCyPPk_.js +1 -0
- package/dist/client/assets/content-DtcZeh5m.js +1 -0
- package/dist/client/assets/content-U9tsdtle.js +1 -0
- package/dist/client/assets/content-hFLK3CON.js +1 -0
- package/dist/client/assets/{content-DMbawvqU.js → content-nkx0swDe.js} +1 -1
- package/dist/client/assets/content-p00KQrtD.js +1 -0
- package/dist/client/assets/{conversation-icons-BV10B2Me.js → conversation-icons-tp9BX6X2.js} +1 -1
- package/dist/client/assets/{conversation-model-CwF6Y9gx.js → conversation-model-Dc02NsGp.js} +1 -1
- package/dist/client/assets/conversation-motion-features-D9-RmBSq.js +1 -0
- package/dist/client/assets/{copy-Dtpx4FOE.js → copy-CWWAJ75H.js} +1 -1
- package/dist/client/assets/{cpu-BjVis9mc.js → cpu-DrqejfkB.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DXpqZP7I.js → createLucideIcon-DezKXSG2.js} +1 -1
- package/dist/client/assets/{ctx-panel-D_HJ3nhb.css → ctx-panel-F05jXK4Q.css} +1 -1
- package/dist/client/assets/discover-C2CZO4Tk.js +2 -0
- package/dist/client/assets/embed-entry-BSMUykuG.js +2 -0
- package/dist/client/assets/{external-link-Ckiyzjwo.js → external-link-Dp_a2vRZ.js} +1 -1
- package/dist/client/assets/{eye-CpfyvdLq.js → eye-BRyD0jno.js} +1 -1
- package/dist/client/assets/{file-code-corner-7mo7EviR.js → file-code-corner-muIVH_xO.js} +1 -1
- package/dist/client/assets/{file-text-KijGBnME.js → file-text-CqJgwxmv.js} +1 -1
- package/dist/client/assets/{gauge-y-Xg8Mrv.js → gauge-hU--hKVP.js} +1 -1
- package/dist/client/assets/{gestures-Bq9XnSqY.js → gestures-DN4hEeqv.js} +1 -1
- package/dist/client/assets/{git-branch-BQ_x8KZL.js → git-branch-CK5v8F2v.js} +1 -1
- package/dist/client/assets/{home-moving-signal-DtRpiNa0.js → home-moving-signal-BjDtEJUP.js} +1 -1
- package/dist/client/assets/{home-now-card-DFb4GOgM.js → home-now-card-nF8OotI-.js} +1 -1
- package/dist/client/assets/{home-now-card-nano-D--m9jpq.js → home-now-card-nano-C-r_bBg5.js} +1 -1
- package/dist/client/assets/{hooks-9d1SoaQA.js → hooks-D46bABUP.js} +1 -1
- package/dist/client/assets/index-CPrU5q04.js +1 -0
- package/dist/client/assets/{index-CZ-05hKz.js → index-DvLtl7rV.js} +5 -5
- package/dist/client/assets/index-kL1WLbeS.js +1 -0
- package/dist/client/assets/index-zvhpRHao.js +1 -0
- package/dist/client/assets/{inspector-panel-C-EhEDYy.js → inspector-panel-Dkc7rLvY.js} +1 -1
- package/dist/client/assets/{keyboard-nav-DFhAJkW3.js → keyboard-nav-BLYDhL3Z.js} +1 -1
- package/dist/client/assets/{lane-roster-store-gUBsydNf.js → lane-roster-store-DOdI1O13.js} +1 -1
- package/dist/client/assets/{layers-CGou-LwV.js → layers-CSsg3JVP.js} +1 -1
- package/dist/client/assets/{layout-grid-BrZt31QH.js → layout-grid-DOChPJdZ.js} +1 -1
- package/dist/client/assets/left-B-SdEJSJ.js +1 -0
- package/dist/client/assets/{left-B_o51JV6.js → left-B3wSE6ql.js} +1 -1
- package/dist/client/assets/{left-CwHZCGO3.js → left-BNRFiRsb.js} +1 -1
- package/dist/client/assets/{left-DA0amyfu.js → left-BggzhgXN.js} +1 -1
- package/dist/client/assets/left-CARCvvxS.js +2 -0
- package/dist/client/assets/left-CpokZYHt.js +1 -0
- package/dist/client/assets/{left-CwLs0okF.js → left-YT7mIGuH.js} +1 -1
- package/dist/client/assets/{left-advisor-DU3s01gk.js → left-advisor-CCY0vkcO.js} +1 -1
- package/dist/client/assets/left-agents-trhO5sL8.js +1 -0
- package/dist/client/assets/{left-default-uvuvDmt0.js → left-default-CG33elBs.js} +1 -1
- package/dist/client/assets/{left-lanes-DnNLgec8.js → left-lanes-CitMgeTp.js} +1 -1
- package/dist/client/assets/{left-mission-DN3-NLPC.js → left-mission-Zl2m_5eU.js} +1 -1
- package/dist/client/assets/{library-DIo5NiGP.js → library-DkALuCh5.js} +1 -1
- package/dist/client/assets/{loader-circle-BiohlpM3.js → loader-circle-pM56HNhR.js} +1 -1
- package/dist/client/assets/{local-agents-wUIaBcEr.js → local-agents-C8xAhbO5.js} +1 -1
- package/dist/client/assets/{mentions-CcPFMbmZ.js → mentions-DG6OQrsc.js} +1 -1
- package/dist/client/assets/{mesh-buckets-ByyFXdKT.js → mesh-buckets-6y3ZIibI.js} +1 -1
- package/dist/client/assets/{mesh-ops-CvGyjK84.js → mesh-ops-BZ1h5RQs.js} +1 -1
- package/dist/client/assets/{mesh-roster-n2nDpEmA.js → mesh-roster-Bc7T4b7z.js} +1 -1
- package/dist/client/assets/{mesh-view-store-BpxGm71b.js → mesh-view-store-ChUOASK8.js} +1 -1
- package/dist/client/assets/{message-circle-B2ddzBrX.js → message-circle-mZCv8tvB.js} +1 -1
- package/dist/client/assets/{message-markup-RkfmDfME.js → message-markup-C2LQDm_k.js} +1 -1
- package/dist/client/assets/{message-square-D9YYWE0x.js → message-square-C7t_qtuj.js} +1 -1
- package/dist/client/assets/{message-visibility-DwxgcgYK.js → message-visibility-CGOmSSKs.js} +1 -1
- package/dist/client/assets/{mission-control-store-Bf4b54MV.js → mission-control-store-nDLdUZPA.js} +1 -1
- package/dist/client/assets/{observe-CJRIvOCn.js → observe-BpEm1INu.js} +1 -1
- package/dist/client/assets/{page-status-BptpTdQ-.js → page-status-E5jnk48p.js} +1 -1
- package/dist/client/assets/{paperclip-B1UNGl5d.js → paperclip-C64lkcbM.js} +1 -1
- package/dist/client/assets/{persistent-state-YI-WHSCF.js → persistent-state-EHXw8WNy.js} +1 -1
- package/dist/client/assets/{plus-CuU_X0-8.js → plus-Co-dqKul.js} +1 -1
- package/dist/client/assets/{profile-rY8jO38P.js → profile-APxDsN2P.js} +1 -1
- package/dist/client/assets/projects-inbox-Cg4X2lUQ.js +1 -0
- package/dist/client/assets/projects-inbox-DRBl2N85.css +1 -0
- package/dist/client/assets/{proxy-DnLpZIi9.js → proxy-BiW5suC7.js} +1 -1
- package/dist/client/assets/{radio-Dm1ItnA4.js → radio-BOxBQX-T.js} +1 -1
- package/dist/client/assets/{refresh-cw-BRn9Oxxl.js → refresh-cw-DMxGzDwn.js} +1 -1
- package/dist/client/assets/resolve-panes-DeVJbS9c.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-BQe5J6xF.js +1 -0
- package/dist/client/assets/{right-BJltPRnd.js → right-Bmfd3pjP.js} +1 -1
- package/dist/client/assets/{right-Beh3nCUB.js → right-BqI-nr9G.js} +1 -1
- package/dist/client/assets/{right-D3aTKf1F.js → right-BuCgE0fZ.js} +1 -1
- package/dist/client/assets/{right-Shpw_xDy.js → right-BwlW6E57.js} +1 -1
- package/dist/client/assets/{right-CPP7GyOm.js → right-C0ybUw0j.js} +1 -1
- package/dist/client/assets/{right-BbyYdzHn.js → right-CdkcrmeD.js} +1 -1
- package/dist/client/assets/{right-CJnB_Bg7.js → right-CimaAvQN.js} +1 -1
- package/dist/client/assets/{right-C1yumXNx.js → right-CkCCPbCX.js} +1 -1
- package/dist/client/assets/{right-DI1B79nR.js → right-D3eSiy41.js} +1 -1
- package/dist/client/assets/{right-DtsRNX5b.js → right-Dz_xD0Vj.js} +1 -1
- package/dist/client/assets/{rocket-DOwXHKWA.js → rocket-BQm5_CvR.js} +1 -1
- package/dist/client/assets/router-B9vQkNJL.js +1 -0
- package/dist/client/assets/{scope-views-A4_vP97W.js → scope-views-1IYJdl41.js} +1 -1
- package/dist/client/assets/{scout-voice-BhPzrc6P.js → scout-voice-BVUqGhth.js} +1 -1
- package/dist/client/assets/{scoutbot-markdown-jh7tzFB1.js → scoutbot-markdown-BQ_Ee2Ic.js} +1 -1
- package/dist/client/assets/{scroll-text-DO0GQzvN.js → scroll-text-Dze_dXtQ.js} +1 -1
- package/dist/client/assets/{search-D1tJSAWe.js → search-CDko0PKE.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-B9IF8wXl.js → secondaryNavConfig-BoQ_zYR9.js} +1 -1
- package/dist/client/assets/{selection-bridge-i2S9zpf8.js → selection-bridge-Din6yV3h.js} +1 -1
- package/dist/client/assets/{send-horizontal-CgLppsIC.js → send-horizontal-CSjIm6xg.js} +1 -1
- package/dist/client/assets/{server-Dymv5Emh.js → server-Bzj7lPIx.js} +1 -1
- package/dist/client/assets/{session-catalog-DNaOEzoQ.js → session-catalog-DsaZJXZt.js} +1 -1
- package/dist/client/assets/session-ref-lookup-state-SATH_jAP.js +1 -0
- package/dist/client/assets/{session-table-PTQVoTyc.js → session-table-BQfR7u6r.js} +1 -1
- package/dist/client/assets/{settings-2fC_G9nX.js → settings-Dyvpkb1D.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-BPSMHhbm.js → sliders-horizontal-C8njVwfg.js} +1 -1
- package/dist/client/assets/{sparkles-Dy8p5xN8.js → sparkles-CETYrxGA.js} +1 -1
- package/dist/client/assets/{sse-CiOSzE5n.js → sse-CD9MMUxl.js} +1 -1
- package/dist/client/assets/{tail-events-BMQmSx1n.js → tail-events-Ps8KpKah.js} +1 -1
- package/dist/client/assets/{terminal-yN9xN-h9.js → terminal-9GRS_Qdc.js} +1 -1
- package/dist/client/assets/{terminal-relay-9lhzEp2V.js → terminal-relay-GYMIvKs1.js} +1 -1
- package/dist/client/assets/{terminal-takeover-DANQfTcy.js → terminal-takeover-_Jyys4me.js} +1 -1
- package/dist/client/assets/{text-CnZ0e1-V.js → text-BP3oyl8-.js} +1 -1
- package/dist/client/assets/{text-rLpBg4_z.css → text-BYAFNLNq.css} +1 -1
- package/dist/client/assets/{use-conversation-list-D9BNLfnW.js → use-conversation-list-C9ABzjXI.js} +1 -1
- package/dist/client/assets/use-fleet-active-asks-DAspZQjE.js +1 -0
- package/dist/client/assets/{use-mesh-ops-items-BIvIHlqe.js → use-mesh-ops-items-Dh54ymEp.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-CKkhq9c5.js → use-reduced-motion-x8pJMVrG.js} +1 -1
- package/dist/client/assets/{use-scout-dev-flags-B2KCzPxn.js → use-scout-dev-flags-DhCbiDK3.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-CHBsxcbp.js → useAgentHoverCard-DoBwV0LX.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-pZe2Zfk1.js +1 -0
- package/dist/client/assets/{usePierreRuntime-DUuXH5yp.js → usePierreRuntime-ejq9dCWV.js} +1 -1
- package/dist/client/assets/{wrench-YcXMlsh2.js → wrench-DjkoAOQt.js} +1 -1
- package/dist/client/assets/{x-e3h2hDsp.js → x-CAbNespN.js} +1 -1
- package/dist/client/assets/{xterm-Byp1Hep_.js → xterm-Cf-ngcGP.js} +1 -1
- package/dist/client/assets/{zap-nMcjPoWB.js → zap-Cq8eWkcF.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/drizzle/0009_old_korg.sql +72 -0
- package/dist/drizzle/0010_sparkling_colonel_america.sql +2 -0
- package/dist/drizzle/0011_funny_onslaught.sql +4 -0
- package/dist/drizzle/0012_high_blazing_skull.sql +16 -0
- package/dist/drizzle/0013_perfect_juggernaut.sql +1 -0
- package/dist/drizzle/0014_legal_meggan.sql +6 -0
- package/dist/drizzle/0015_lame_marvel_boy.sql +12 -0
- package/dist/drizzle/0016_early_goliath.sql +6 -0
- package/dist/drizzle/meta/0009_snapshot.json +6262 -0
- package/dist/drizzle/meta/0010_snapshot.json +6286 -0
- package/dist/drizzle/meta/0011_snapshot.json +6337 -0
- package/dist/drizzle/meta/0012_snapshot.json +6458 -0
- package/dist/drizzle/meta/0013_snapshot.json +6465 -0
- package/dist/drizzle/meta/0014_snapshot.json +6503 -0
- package/dist/drizzle/meta/0015_snapshot.json +6596 -0
- package/dist/drizzle/meta/0016_snapshot.json +6611 -0
- package/dist/drizzle/meta/_journal.json +56 -0
- package/dist/main.mjs +1311 -363
- package/dist/node/main.mjs +314 -12
- package/dist/pairing-runtime-controller.mjs +608 -108
- package/dist/runtime/base-daemon.mjs +30 -3
- package/dist/runtime/broker-daemon.mjs +4771 -529
- package/dist/runtime/broker-process-manager.mjs +23 -2
- package/dist/runtime/mesh-discover.mjs +23 -2
- package/dist/scout-control-plane-web.mjs +1914 -478
- package/package.json +25 -6
- package/dist/client/assets/AgentLanesEmbedScreen-BmLnN4on.js +0 -1
- package/dist/client/assets/AgentLanesPreflight-5B6sXvRB.js +0 -1
- package/dist/client/assets/AgentLanesView-DHyzVBk6.js +0 -2
- package/dist/client/assets/AgentsSubnav-CDMjKeYC.js +0 -1
- package/dist/client/assets/ChatCollapsedStrip-Ycm0ecaX.js +0 -1
- package/dist/client/assets/ConversationScreen-BNULZAp2.js +0 -2
- package/dist/client/assets/CrewWorkspaces-CJhBKVoZ.css +0 -1
- package/dist/client/assets/CrewWorkspaces-CkPYIA46.js +0 -1
- package/dist/client/assets/FlightObserveScreen-CDWGSKZg.js +0 -1
- package/dist/client/assets/MessagesScreen-Eulveud3.js +0 -1
- package/dist/client/assets/NewChatComposer-hlWT-nbR.js +0 -19
- package/dist/client/assets/OpsScreen-Ppen_Lmj.js +0 -1
- package/dist/client/assets/OpsSubnav-GAKsoSor.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-BLlp2e6t.js +0 -1
- package/dist/client/assets/ProjectsInbox-Dlt8OQ8O.js +0 -2
- package/dist/client/assets/ProjectsRail-DCfNMmnW.js +0 -1
- package/dist/client/assets/ProjectsScreen-BP-hmI1m.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-CWpMjGIH.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-D7zZHK_t.js +0 -1
- package/dist/client/assets/ScoutDeckSurface-CKT3qdqY.js +0 -1
- package/dist/client/assets/SessionEmbedScreen-RD5XOx7R.js +0 -1
- package/dist/client/assets/SessionRefScreen-B_cTv47v.js +0 -1
- package/dist/client/assets/SessionsScreen-Bq0Z77On.js +0 -1
- package/dist/client/assets/archive-BjcGiAy8.js +0 -1
- package/dist/client/assets/content-6RvWTrtk.js +0 -1
- package/dist/client/assets/content-BCgwMUqz.js +0 -1
- package/dist/client/assets/content-Bf2VLhx0.js +0 -1
- package/dist/client/assets/content-BrU_38-m.js +0 -1
- package/dist/client/assets/content-BvvJN8rN.js +0 -1
- package/dist/client/assets/content-CAeEqYPw.js +0 -1
- package/dist/client/assets/content-CI_Z9DXk.js +0 -1
- package/dist/client/assets/content-CbyKONhW.js +0 -1
- package/dist/client/assets/content-Czogvp43.js +0 -1
- package/dist/client/assets/content-DFk0zNzX.js +0 -1
- package/dist/client/assets/content-DHe4DgkA.js +0 -1
- package/dist/client/assets/content-DTz7cKjo.js +0 -1
- package/dist/client/assets/content-E3kudY-W.js +0 -1
- package/dist/client/assets/content-LpO0aO_U.js +0 -1
- package/dist/client/assets/conversation-motion-features-BKkCRaWR.js +0 -1
- package/dist/client/assets/discover-CHbrEItO.js +0 -2
- package/dist/client/assets/embed-entry-vil28MyU.js +0 -2
- package/dist/client/assets/index-BVlMw8x_.js +0 -1
- package/dist/client/assets/index-Cn0GR-q1.js +0 -1
- package/dist/client/assets/index-DosI4AG9.js +0 -1
- package/dist/client/assets/left-BpgWnaah.js +0 -1
- package/dist/client/assets/left-Cx0kv6pe.js +0 -1
- package/dist/client/assets/left-agents-qL5PpUY-.js +0 -1
- package/dist/client/assets/left-z-6CkuBe.js +0 -2
- package/dist/client/assets/projects-inbox-BBs1hG13.css +0 -1
- package/dist/client/assets/projects-inbox-D-zAb9Gp.js +0 -1
- package/dist/client/assets/resolve-panes-DO6LkwhQ.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-CIF288wY.js +0 -1
- package/dist/client/assets/router-DJj2WbDg.js +0 -1
- package/dist/client/assets/use-fleet-active-asks-BeAdcl09.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-D0mUhxTF.js +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openscout/scout",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.96",
|
|
4
|
+
"description": "Local-first control plane for discovering, messaging, and coordinating AI agents across Claude Code, Codex, and more",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"openscout",
|
|
7
|
+
"ai-agents",
|
|
8
|
+
"coding-agents",
|
|
9
|
+
"agent-coordination",
|
|
10
|
+
"multi-agent",
|
|
11
|
+
"local-first",
|
|
12
|
+
"control-plane",
|
|
13
|
+
"agent-broker",
|
|
14
|
+
"developer-tools",
|
|
15
|
+
"cli",
|
|
16
|
+
"mcp",
|
|
17
|
+
"acp",
|
|
18
|
+
"claude-code",
|
|
19
|
+
"codex",
|
|
20
|
+
"cursor",
|
|
21
|
+
"bun"
|
|
22
|
+
],
|
|
5
23
|
"license": "Apache-2.0",
|
|
6
24
|
"type": "module",
|
|
7
25
|
"repository": {
|
|
@@ -12,18 +30,19 @@
|
|
|
12
30
|
"bugs": {
|
|
13
31
|
"url": "https://github.com/oscout/scout/issues"
|
|
14
32
|
},
|
|
15
|
-
"homepage": "https://
|
|
33
|
+
"homepage": "https://openscout.app",
|
|
16
34
|
"bin": {
|
|
17
35
|
"scout": "./bin/scout",
|
|
18
36
|
"openscout-runtime": "./bin/openscout-runtime.mjs"
|
|
19
37
|
},
|
|
20
38
|
"engines": {
|
|
21
|
-
"bun": ">=1.
|
|
39
|
+
"bun": ">=1.3"
|
|
22
40
|
},
|
|
23
41
|
"files": [
|
|
24
42
|
"bin",
|
|
25
43
|
"dist",
|
|
26
|
-
"README.md"
|
|
44
|
+
"README.md",
|
|
45
|
+
"NOTICE"
|
|
27
46
|
],
|
|
28
47
|
"dependencies": {
|
|
29
48
|
"@lydell/node-pty": "1.2.0-beta.12",
|
|
@@ -46,5 +65,5 @@
|
|
|
46
65
|
"publishConfig": {
|
|
47
66
|
"access": "public"
|
|
48
67
|
},
|
|
49
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "32b205d7fbc6d0be7768f208eabcecbd7fa371b6"
|
|
50
69
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,j as m}from"./index-CZ-05hKz.js";import{u as a}from"./Provider-B2xuo3rf.js";import{A as n}from"./AgentLanesView-DHyzVBk6.js";import{i as c,j as l}from"./router-DJj2WbDg.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./sse-CiOSzE5n.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DZVhS7as.js";import"./createLucideIcon-DXpqZP7I.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./file-text-KijGBnME.js";import"./x-e3h2hDsp.js";import"./chevron-right-CzH-TaSF.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./arrow-right-iJFv3jNh.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-DFhAJkW3.js";import"./NewChatComposer-hlWT-nbR.js";import"./text-CnZ0e1-V.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-BiohlpM3.js";import"./conversation-model-CwF6Y9gx.js";import"./time-Dhsh_2EG.js";import"./index-BVlMw8x_.js";import"./HarnessMark-D5CA5uSp.js";import"./NewChatOrigin-DdpzE4kz.js";import"./chevron-down-Mp9mu_yd.js";import"./search-D1tJSAWe.js";import"./chunk-HRAB3GC3-swV8PA2k.js";/* empty css */import"./tail-events-BMQmSx1n.js";import"./observe-CJRIvOCn.js";import"./terminal-sessions-BQ6t92tJ.js";import"./types-B0PlfpKc.js";import"./AgentAvatar-CYhf6twS.js";import"./SpriteAvatar-Bs68ZENy.js";import"./CrewAvatar-CTIuxp4G.js";import"./SessionObserve-Dsd0j05N.js";import"./bash-format-BRV5C6Gv.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-D_DMlBeT.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-CcPFMbmZ.js";import"./AgentDetailCard-UqPNpcvB.js";import"./AgentLiveActions-BwuzOE8h.js";import"./terminal-takeover-DANQfTcy.js";import"./openContent-C6XO6kr5.js";import"./eye-CpfyvdLq.js";import"./terminal-yN9xN-h9.js";import"./message-markup-RkfmDfME.js";import"./ObservedTopologyPanel-CdGUXxGR.js";import"./ObserveTextFlow-BSEtYTxU.js";import"./use-reduced-motion-CKkhq9c5.js";import"./proxy-DnLpZIi9.js";import"./SessionObserveEvidence-DopQYDkD.js";import"./message-circle-B2ddzBrX.js";import"./wrench-YcXMlsh2.js";import"./external-link-Ckiyzjwo.js";import"./AgentFloorView-XXNgI5Cj.js";/* empty css */import"./agent-lanes-model-AfrjRNK5.js";import"./context-budget-DX_fwUs3.js";import"./lane-roster-store-gUBsydNf.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./AgentLanesPreflight-5B6sXvRB.js";import"./AgentLaneChrome-CyhA1reW.js";import"./AgentLaneCard-Z-aOBR3W.js";/* empty css */import"./AgentLaneSummaryResize-Box8-_rS.js";import"./clipboard-e3fSpeo7.js";import"./agent-lane-card-model-CTLxf3R4.js";import"./agent-lane-preview-BhplDYGf.js";import"./agent-lane-detail-ppJId6Jc.js";import"./AgentLaneDetailSheet-BNzjMjIH.js";import"./SlidePanel-C-q7XwTa.js";import"./LaneTraceDetailSheet-BEHg3LmH.js";import"./LaneTraceEventFocus-DVimcizS.js";function p(r){return new URLSearchParams(window.location.search).get(r)?.trim()||null}function Hr(){const{agents:r,navigate:o}=a(),e=t.useMemo(()=>c(),[]),s=t.useMemo(()=>l(),[]),i=t.useMemo(()=>({harnessFilter:p("harness"),projectFilter:p("project")}),[]);return m.jsx("div",{className:"s-agent-lanes-embed","data-scout-theme":!0,children:m.jsx(n,{navigate:o,agents:r,embedded:!0,profileId:e,laneSize:s,harnessFilter:i.harnessFilter,projectFilter:i.projectFilter})})}export{Hr as AgentLanesEmbedScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,j as s}from"./index-CZ-05hKz.js";import{t as k}from"./time-Dhsh_2EG.js";const w=3,E=12;function A(e){const n=e?.trim();return n?n.slice(0,13):null}function x(e){const n=e.lastEventAt;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:e.mtimeMs}function D(e){return e.sessionId?.trim()||e.transcriptPath}function T(e){const n=e.max??E;if(e.discoveryPhase==="loading")return{cells:[],blindCells:Math.min(e.blindCells??w,n),identified:!1};const i=e.discovery?.transcripts??[],a=new Set,t=[];for(const l of i.filter(c=>{if(e.matchTranscript&&!e.matchTranscript(c))return!1;const r=e.now-x(c);return r>=0?r<=e.windowMs:!0}).sort((c,r)=>x(r)-x(c))){const c=D(l);if(!a.has(c)&&(a.add(c),t.push({key:c,source:l.source,sessionLabel:A(l.sessionId),project:l.project,cwd:l.cwd,lastActiveAt:x(l)}),t.length>=n))break}return{cells:t,blindCells:0,identified:!0}}function I(e){return e.sessionLabel?`${e.source}:${e.sessionLabel}`:e.source}const K=260,_=100;function S(e,n){const[i,a]=d.useState(e),[t,l]=d.useState(!1);return d.useEffect(()=>{if(e){a(!0),l(!1);return}if(!i)return;if(n<=0){a(!1),l(!1);return}l(!0);const c=setTimeout(()=>{a(!1),l(!1)},n);return()=>clearTimeout(c)},[e,n,i]),{visible:i,exiting:t}}function P(e,n){const i=d.useRef(Date.now()),[a,t]=d.useState({discoveryMs:null,recentMs:null,deckMs:null}),[l,c]=d.useState(0);return d.useEffect(()=>{t(r=>{const o=r.discoveryMs===null&&e.discovery!=="loading"?Date.now()-i.current:r.discoveryMs,m=r.recentMs===null&&e.recent!=="loading"?Date.now()-i.current:r.recentMs;return o===r.discoveryMs&&m===r.recentMs?r:{...r,discoveryMs:o,recentMs:m}})},[e.discovery,e.recent]),d.useEffect(()=>{n&&t(r=>r.deckMs===null?{...r,deckMs:Date.now()-i.current}:r)},[n]),d.useEffect(()=>{if(a.deckMs!==null)return;const r=()=>c(Date.now()-i.current);r();const o=setInterval(r,_);return()=>clearInterval(o)},[a.deckMs]),{...a,elapsedMs:l}}function N({seed:e,rows:n}){const i=d.useMemo(()=>{const a=[68,92,54,80,61,74];return Array.from({length:n},(t,l)=>a[(e+l)%a.length])},[n,e]);return s.jsx("div",{className:"s-lane-pre-bars","aria-hidden":"true",children:i.map((a,t)=>s.jsx("span",{className:"s-lane-pre-bar",style:{width:`${a}%`,animationDelay:`${e*110+t*90}ms`}},`${t}-${a}`))})}function R({cell:e,index:n,nowMs:i,style:a}){if(!e)return s.jsxs("div",{className:"s-lane-pre s-lane-pre--blind",style:a,"aria-hidden":"true",children:[s.jsxs("div",{className:"s-lane-pre-head",children:[s.jsx("span",{className:"s-lane-pre-ghost s-lane-pre-ghost--dot"}),s.jsx("span",{className:"s-lane-pre-ghost s-lane-pre-ghost--name"}),s.jsx("span",{className:"s-lane-pre-spacer"}),s.jsx("span",{className:"s-lane-pre-ghost s-lane-pre-ghost--meta"})]}),s.jsx(N,{seed:n,rows:6})]});const t=[e.project,e.cwd].find(l=>!!l)??"—";return s.jsxs("div",{className:"s-lane-pre",style:a,children:[s.jsxs("div",{className:"s-lane-pre-head",children:[s.jsx("span",{className:"s-lane-pre-dot","aria-hidden":"true"}),s.jsx("span",{className:"s-lane-pre-title",children:I(e)}),s.jsx("span",{className:"s-lane-pre-where",title:e.cwd??t,children:t}),s.jsx("span",{className:"s-lane-pre-spacer"}),s.jsx("span",{className:"s-lane-pre-age",children:k(e.lastActiveAt,i)})]}),s.jsx(N,{seed:n,rows:5})]})}function V({discovery:e,discoveryPhase:n,windowMs:i,nowMs:a,layout:t,gridColumns:l,laneWidthPx:c,matchTranscript:r}){const o=t==="grid",m=d.useMemo(()=>T({discovery:e,discoveryPhase:n,windowMs:i,now:a,matchTranscript:r}),[e,n,r,a,i]),h=m.identified?m.cells:Array.from({length:m.blindCells},()=>null);if(t==="none"||h.length===0)return s.jsx("div",{className:"s-agent-lanes-preflight-empty","aria-hidden":"true"});const p=h.map((f,b)=>s.jsx(R,{cell:f,index:b,nowMs:a,style:o?void 0:{width:`${c}px`,flex:"none"}},f?.key??`blind-${b}`));return o?s.jsx("div",{className:"s-agent-lanes-grid s-agent-lanes-grid--preflight","data-grid-columns":l,"aria-label":"Lane deck loading",children:p}):s.jsx("div",{className:"s-agent-lanes-body",children:s.jsx("section",{className:"s-agent-lanes-zone s-agent-lanes-zone--main",children:s.jsx("div",{className:"s-agent-lanes-scroll","aria-label":"Lane deck loading",children:p})})})}function v(e){return e==="ready"?"OK":e==="error"?"WARN":"RUN"}function j(e){return`s-lane-boot-step s-lane-boot-step--${e}`}function u(e,n){return`${e.toLocaleString()} ${n}${e===1?"":"s"}`}function g(e){return e===null?"":`${Math.round(e)}ms`}function G({loadState:e,sourceCount:n,processCount:i,eventCount:a,laneCount:t,horizonLabel:l,handedOff:c,exiting:r}){const o=P(e,c),m=e.discovery!=="loading"&&e.recent!=="loading",h=e.discovery==="ready"?`${u(n,"session source")} indexed`:e.discovery==="error"?"session source scan unavailable":"scanning local transcripts and harness processes",p=e.recent==="ready"?`${u(a,"recent event")} merged`:e.recent==="error"?"history replay unavailable; live signals remain enabled":`reading turns and tool output for the ${l} view`,f=t>0?`${u(t,"lane")} composed`:e.recent==="error"?`${u(a,"live signal")} in, no history`:a>0?`${u(a,"signal")} in, waiting on replay`:"waiting on first signals",b=e.discovery==="ready"?"done":e.discovery==="error"?"warn":"running",y=e.recent==="ready"?"done":e.recent==="error"?"warn":e.discovery==="loading"?"pending":"running",M=c?"done":e.recent==="loading"?"pending":"running",L=o.deckMs!==null?g(o.deckMs):o.elapsedMs<1e3?g(o.elapsedMs):`${(o.elapsedMs/1e3).toFixed(1)}s`,$=t>0;return s.jsxs("div",{className:["s-lane-boot",$?"s-lane-boot--bare":null,r?"s-lane-boot--exiting":null].filter(Boolean).join(" "),role:"status","aria-live":"polite","aria-busy":!m,children:[s.jsx("div",{className:"s-lane-boot-veil","aria-hidden":"true"}),s.jsxs("div",{className:"s-lane-boot-sheet",children:[s.jsxs("div",{className:"s-lane-boot-head",children:[s.jsx("span",{className:`s-lane-boot-dot${m?" s-lane-boot-dot--done":""}`,"aria-hidden":"true"}),s.jsx("span",{className:"s-lane-boot-lead",children:"Starting agent tail"}),s.jsxs("span",{className:"s-lane-boot-count",children:[n.toLocaleString()," sources"]}),s.jsxs("span",{className:"s-lane-boot-count",children:[i.toLocaleString()," live"]}),s.jsxs("span",{className:"s-lane-boot-count",children:[a.toLocaleString()," events"]}),t>0?s.jsxs("span",{className:"s-lane-boot-count",children:[t.toLocaleString()," lanes"]}):null,s.jsx("span",{className:"s-lane-boot-spacer"}),s.jsxs("span",{className:"s-lane-boot-meta",children:["lookback ",l]}),s.jsx("span",{className:"s-lane-boot-elapsed","aria-hidden":"true",children:L})]}),s.jsxs("div",{className:"s-lane-boot-log",children:[s.jsxs("div",{className:j(b),children:[s.jsx("span",{className:"s-lane-boot-state",children:v(e.discovery)}),s.jsx("strong",{className:"s-lane-boot-name",children:"discover sessions"}),s.jsx("code",{className:"s-lane-boot-detail",children:h}),s.jsx("span",{className:"s-lane-boot-timing",children:g(o.discoveryMs)})]}),s.jsxs("div",{className:j(y),children:[s.jsx("span",{className:"s-lane-boot-state",children:v(e.recent)}),s.jsx("strong",{className:"s-lane-boot-name",children:"replay recent tail"}),s.jsx("code",{className:"s-lane-boot-detail",children:p}),s.jsx("span",{className:"s-lane-boot-timing",children:g(o.recentMs)})]}),s.jsxs("div",{className:j(M),children:[s.jsx("span",{className:"s-lane-boot-state",children:c?"OK":"LIVE"}),s.jsx("strong",{className:"s-lane-boot-name",children:"assemble lanes"}),s.jsx("code",{className:"s-lane-boot-detail",children:f}),s.jsx("span",{className:"s-lane-boot-timing",children:g(o.deckMs)})]})]})]})]})}export{G as AgentLanesLoadingSheet,V as AgentLanesPreflightDeck,K as LANE_BOOT_EXIT_MS,S as useLaneBootVisibility};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r,j as o}from"./index-CZ-05hKz.js";/* empty css */import{a as an}from"./api-Co9aQ2Jw.js";import{u as $n}from"./tail-events-BMQmSx1n.js";import{i as he,o as Te}from"./surface-activity-B1rgWB1i.js";import{u as Fn}from"./observe-CJRIvOCn.js";import{f as Wn}from"./terminal-sessions-BQ6t92tJ.js";import{n as rn}from"./colors-BtO5_zlx.js";import{S as Hn}from"./Provider-B2xuo3rf.js";import{d as Bn}from"./types-B0PlfpKc.js";import{A as Gn}from"./AgentAvatar-CYhf6twS.js";import{h as Vn,S as Kn}from"./SessionObserve-Dsd0j05N.js";import{W as Un,X as on,Y as qn,Z as Yn,_ as Zn,$ as Ze,a0 as Xn,a1 as Jn,a2 as Qn,a3 as et,a4 as nt,a5 as Re,a6 as tt,a7 as st,a8 as at,a9 as ln,aa as rt,ab as ot,i as cn,j as dn}from"./router-DJj2WbDg.js";import{AgentFloorView as it}from"./AgentFloorView-XXNgI5Cj.js";import{useLaneBootVisibility as lt,AgentLanesPreflightDeck as ct,AgentLanesLoadingSheet as dt,LANE_BOOT_EXIT_MS as ut}from"./AgentLanesPreflight-5B6sXvRB.js";import{AgentLaneChrome as ft}from"./AgentLaneChrome-CyhA1reW.js";import{AgentLaneCard as mt}from"./AgentLaneCard-Z-aOBR3W.js";import{a as ht}from"./agent-lane-card-model-CTLxf3R4.js";import{c as gt}from"./agent-lane-detail-ppJId6Jc.js";import{i as pt,A as Lt}from"./AgentLaneDetailSheet-BNzjMjIH.js";import{LaneTraceDetailSheet as yt}from"./LaneTraceDetailSheet-BEHg3LmH.js";import{readStoredLaneSummaryHeight as bt,useLaneSummaryResize as vt,AgentLaneSummaryResizeHandle as St}from"./AgentLaneSummaryResize-Box8-_rS.js";import{A as pe,l as q,j as kt,k as un,m as xt,e as wt,g as Nt,n as Et,r as jt,d as fn,D as Ct,h as Rt,i as At}from"./agent-lanes-model-AfrjRNK5.js";import{i as It,c as Tt,n as Xe}from"./keyboard-nav-DFhAJkW3.js";import{p as Je}from"./lane-roster-store-gUBsydNf.js";function _e(e){return[e.source,e.sessionId,e.ts,e.kind,e.summary].join("\0")}function _t(e){const n=new Set,t=[];for(const s of e){const l=_e(s);n.has(l)||(n.add(l),t.push(s))}return t}function Pt(e,n){return e.length<=n?e:[...e].sort((t,s)=>t.ts-s.ts).slice(e.length-n)}function Dt(e,n,t){const s=_e(n);for(const i of e)if(_e(i)===s)return e;const l=[...e,n];return l.length>t?l.slice(l.length-t):l}function zt(e,n,t){return Pt(_t([...n,...e]),t)}function Mt(e){return e.discovery==="error"||e.recent==="error"?e.discoveryLoaded&&e.recentLoaded?"degraded":"blank":"none"}const Ot=500,$t=3e4;function Ft(){return{generatedAt:Date.now(),processes:[],transcripts:[],totals:{total:0,scoutManaged:0,hudsonManaged:0,unattributed:0,transcripts:0}}}async function Wt(e,n){const t=new URLSearchParams({limit:String(e)});return n&&t.set("transcripts","true"),(await an(`/api/tail/recent?${t.toString()}`)).events??[]}function Ht(e,n){const t=new URLSearchParams;e&&t.set("scope",e),typeof n=="number"&&Number.isFinite(n)&&n>0&&t.set("limit",String(Math.floor(n)));const s=t.toString();return s?`/api/tail/discover?${s}`:"/api/tail/discover"}function Bt(e){const n=e?.recentLimit??Ot,t=e?.enabled??!0,s=e?.discoveryIntervalMs??$t,l=e?.includeTranscriptReplay??!1,i=e?.hydrateOnDiscovery??l,f=e?.discoveryScope,y=e?.discoveryLimit,d=e?.pauseWhenHidden??!1,[u,m]=r.useState(null),[c,h]=r.useState([]),[L,k]=r.useState({discovery:"loading",recent:"loading",discoveryLoaded:!1,recentLoaded:!1}),x=r.useRef("loading"),R=r.useRef(null),g=r.useRef(0);$n(v=>{h(b=>Dt(b,v,n))},t);const j=r.useCallback((v=!1)=>{if(!t||d&&!he())return Promise.resolve();v&&(x.current="loading",k(_=>({..._,recent:"loading"})));const b=`${n}:${l?"replay":"live"}`,S=R.current;if(S?.key===b)return S.promise;const C=++g.current;let z;return z=Wt(n,l).then(_=>{h(M=>zt(M,_,n)),C===g.current&&(x.current="ready",k(M=>({...M,recent:"ready",recentLoaded:!0})))}).catch(()=>{C===g.current&&(x.current="error",k(_=>({..._,recent:"error"})))}).finally(()=>{R.current?.promise===z&&(R.current=null)}),R.current={key:b,promise:z},z},[t,l,d,n]),w=r.useCallback(async(v=!1)=>{if(t&&!(d&&!he())){v&&k(b=>({...b,discovery:"loading"}));try{const b=await an(Ht(f,y));m(b),k(C=>({...C,discovery:"ready",discoveryLoaded:!0}));const S=(b.transcripts?.length??0)>0||b.processes.length>0;(i&&S||x.current==="error")&&j()}catch{m(b=>b??Ft()),k(b=>({...b,discovery:"error"}))}}},[y,f,t,i,d,j]),T=r.useCallback(async()=>{await Promise.all([w(!0),j(!0)])},[w,j]);return r.useEffect(()=>{if(!t)return;let v=!1;const b=()=>{v||w()};b();const S=setInterval(b,s),C=d?Te(b):null;return()=>{v=!0,clearInterval(S),C?.()}},[s,t,d,w]),r.useEffect(()=>{if(!t)return;let v=!1,b=!1;const S=()=>{v||b||d&&!he()||(b=!0,j(!0))};S();const C=d?Te(S):null;return()=>{v=!0,C?.()}},[t,d,j]),{discovery:u,events:c,loadState:L,refreshDiscovery:w,retryInitialLoad:T}}function Gt({lanes:e,inspectedLaneId:n,onInspect:t,onHorizonChange:s,onTogglePin:l}){const[i,f]=r.useState(-1),y=r.useRef(new Map);r.useEffect(()=>{if(i<0)return;if(i>=e.length){f(e.length-1);return}const m=e[i];if(!m)return;const c=y.current.get(m.id);c?.scrollIntoView({block:"nearest",inline:"nearest"}),c?.focus()},[i,e]),r.useEffect(()=>{n||i>=e.length&&f(e.length>0?e.length-1:-1)},[i,n,e.length]);const d=r.useCallback((m,c)=>{c?y.current.set(m,c):y.current.delete(m)},[]);r.useEffect(()=>{const m=c=>{if(!document.querySelector(".s-agent-lanes")||It(c.target)||Tt()||n||e.length===0)return;const h=Number(c.key)-1;if(!c.metaKey&&!c.ctrlKey&&!c.altKey&&h>=0&&h<pe.length){c.preventDefault(),s(pe[h].key);return}if(c.key==="ArrowDown"||c.key==="j"){c.preventDefault(),f(L=>Xe(L,e.length,1));return}if(c.key==="ArrowUp"||c.key==="k"){c.preventDefault(),f(L=>Xe(L,e.length,-1));return}if(c.key==="Home"||c.key==="g"&&!c.shiftKey){c.preventDefault(),f(0);return}if(c.key==="End"||c.key==="G"){c.preventDefault(),f(e.length-1);return}if(c.key==="Enter"||c.key==="i"){const L=i<0?0:i,k=e[L];if(!k)return;c.preventDefault(),f(L),t(k);return}if(c.key.toLowerCase()==="p"&&l){const L=i<0?0:i,k=e[L];if(!k)return;c.preventDefault(),f(L),l(k)}};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[i,n,e,s,t,l]);const u=r.useCallback((m,c)=>({"data-cursor":i===m?!0:void 0,tabIndex:i===m?0:-1,ref:h=>d(c,h),onFocus:()=>f(m)}),[i,d]);return{focusedIndex:i,getLaneFocusProps:u}}function Vt(e){return e.trim().replace(/\/+$/u,"").split(/[\\/]/u).filter(Boolean).pop()?.trim()||null}function ge(e){return e.trim().toLowerCase().replace(/['"]/gu,"").replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function mn(e,n){if(!n)return!0;const t=ge(n);return e.some(s=>{const l=s?.trim();if(!l)return!1;const i=l.toLowerCase(),f=Vt(l);return i===n||ge(l)===t||!!(f&&(f.toLowerCase()===n||ge(f)===t))})}function Kt(e,n){const t=n?.trim().toLowerCase()||null,{agent:s,facts:l,source:i}=e;return mn([s.harness,s.definitionId,l?.attribution,i],t)}function Ut(e,n){const t=n?.trim().toLowerCase()||null,{agent:s,facts:l,source:i}=e;return mn([s.project,s.projectRoot,s.cwd,l?.cwd,q(s,i)],t)}function qt(e){return rn(e.agent.state??null,e.agent)==="needs_attention"?!0:Vn(e.observe?.events??[])}function Qe(e,n,t,s){return on(t?.width??e.laneWidths[n.id],s??e.defaultLaneWidth)}function Yt(e,n){switch(e.kind){case"session":return n.filter(t=>t.id===e.sessionId);case"harness":return n.filter(t=>Kt(t,e.harness));case"project":return n.filter(t=>Ut(t,e.projectPath));case"attention":return n.filter(t=>qt(t));default:return[]}}function en(e,n,t){n.has(t.lane.id)||(n.add(t.lane.id),e.push({key:t.slot?`${t.slot.id}:${t.lane.id}`:t.lane.id,lane:t.lane,widthPx:t.widthPx,zone:t.zone,position:t.position,slotId:t.slot?.id,laneDefId:t.laneDef?.id,isPinned:t.zone!=="main"}))}function Ae(e){return[...e].sort((n,t)=>{const s=qn(n.zone,t.zone);return s!==0?s:n.position!==t.position?n.position-t.position:n.lane.id.localeCompare(t.lane.id)})}function Zt(e){const{autoLanes:n,deck:t,defaultWidthTier:s}=e,l=new Set,i=[],f=[],y=[],d=new Map(t.laneDefs.map(h=>[h.id,h]));for(const h of Un(t.slots)){const L=d.get(h.laneDefId);if(!L)continue;const k=Yt(L,n),x=h.zone==="pinned_left"?i:h.zone==="pinned_right"?y:f;for(const R of k)en(x,l,{lane:R,zone:h.zone,position:h.position,widthPx:Qe(t,R,h,s),slot:h,laneDef:L})}if(t.showAutoLanes){let h=0;for(const L of n)l.has(L.id)||(en(f,l,{lane:L,zone:"main",position:h,widthPx:Qe(t,L,void 0,s)}),h+=1)}const u=Ae(i),m=Ae(f),c=Ae(y);return{pinnedLeft:u,main:m,pinnedRight:c,flat:[...u,...m,...c]}}function Xt(e){return e.slots.some(n=>n.laneDefId===Zn)}function me(e,n){const t=`harness:${ge(n)}`;return e.slots.some(s=>s.laneDefId===t)}function Jt(e,n){const t=Yn(n);return e.slots.some(s=>s.laneDefId===t)}function Qt(e,n,t){const[s,l]=r.useState(()=>Ze(e,n));r.useEffect(()=>{l(Ze(e,n))},[n,e]);const i=r.useCallback(g=>{Xn(g),l(g)},[]),f=r.useMemo(()=>Zt({autoLanes:t,deck:s,defaultWidthTier:n}),[t,s,n]),y=r.useCallback((g,j="pinned_left")=>{i(Jn(s,{laneId:g.id,title:q(g.agent,g.source),zone:j,width:s.laneWidths[g.id]}))},[s,i]),d=r.useCallback(g=>{i(Qn(s,g))},[s,i]),u=r.useCallback((g,j)=>{i(et(s,g,j))},[s,i]),m=r.useCallback(g=>{i(nt(s,g))},[s,i]),c=r.useCallback((g,j)=>{i(Re(s,{kind:"harness",title:j??`${g} sessions`,harness:g,zone:"pinned_left",width:s.defaultLaneWidth}))},[s,i]),h=r.useCallback((g,j)=>{const w=g.trim();if(!w)return;const T=j?.trim()||w.split(/[\\/]/u).filter(Boolean).pop()||w;i(Re(s,{kind:"project",title:T,projectPath:w,zone:"main",width:s.defaultLaneWidth}))},[s,i]),L=r.useCallback(()=>{i(Re(s,{kind:"attention",title:"Needs attention",zone:"pinned_left",width:"sm"}))},[s,i]),k=r.useCallback(()=>{i(tt(s))},[s,i]),x=r.useCallback(g=>st(s,g),[s]),R=r.useCallback(g=>at(s,g),[s]);return{deck:s,layout:f,pinLane:y,unpinLane:d,setLaneWidth:u,setDefaultLaneWidth:m,addHarnessLane:c,addAttentionLane:L,addProjectLane:h,clearPins:k,isPinned:x,pinnedZone:R}}function es(e){const[n,t]=r.useState(null),s=r.useRef({laneId:"",x:0,width:512}),l=r.useRef(512),i=r.useCallback((d,u,m)=>{u.preventDefault(),u.stopPropagation(),u.currentTarget.setPointerCapture(u.pointerId),s.current={laneId:d,x:u.clientX,width:m},l.current=m,t(d),document.body.classList.add("s-agent-lanes--resizing-width")},[]),f=r.useCallback(()=>{t(d=>{if(d){document.body.classList.remove("s-agent-lanes--resizing-width");const u=ln(l.current);e(s.current.laneId,u.tier??u.px)}return null})},[e]);r.useEffect(()=>{if(!n)return;const d=m=>{const c=m.clientX-s.current.x;l.current=Math.min(rt,Math.max(ot,s.current.width+c));const h=document.querySelector(`[data-lane-id="${s.current.laneId}"]`);h&&h.style.setProperty("--lane-width",`${l.current}px`)},u=()=>f();return window.addEventListener("pointermove",d),window.addEventListener("pointerup",u),window.addEventListener("pointercancel",u),()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",u)}},[f,n]);const y=r.useCallback((d,u)=>{e(d,u),document.querySelector(`[data-lane-id="${d}"]`)?.style.removeProperty("--lane-width")},[e]);return{beginResize:i,resetLaneWidth:y,resizingLaneId:n}}const nn=[{key:"lanes",label:"lanes"},{key:"grid",label:"grid"},{key:"floor",label:"floor"}],ns=[{key:"auto",label:"auto"},{key:"2",label:"2"},{key:"3",label:"3"},{key:"4",label:"4"}];function ts(e,n=!1){return e==="grid"?"grid":e==="floor"?n?"lanes":"floor":"lanes"}function ss(e){return e==="2"||e==="3"||e==="4"?e:"auto"}function as(e){return e?nn.filter(n=>n.key!=="floor"):nn}const hn="openscout:agent-lanes-horizon",gn="openscout:agent-lanes-layout",pn="openscout:agent-lanes-grid-columns",Ln="openscout:agent-lanes-technical-rollup",rs=`${Ln}:lane:`,os="openscout:agent-lanes-scroll",is=96,ls=3e4,cs=3e4,ds=3e4,us=3e4,fs=12e4,ms=["pinned-left","main","pinned-right"];function tn(){return!he()}function yn(e,n){return`${os}:${e}:${n}`}function hs(e,n){try{const t=sessionStorage.getItem(yn(e,n)),s=t?Number.parseFloat(t):0;return Number.isFinite(s)&&s>0?s:0}catch{return 0}}function gs(e,n,t){try{sessionStorage.setItem(yn(e,n),String(Math.max(0,Math.round(t))))}catch{}}function ps(){try{const e=sessionStorage.getItem(hn);if(e&&pe.some(n=>n.key===e))return e}catch{}return Ct}function Ls(e){try{const n=sessionStorage.getItem(gn);return ts(n,e)}catch{}return"lanes"}function ys(){try{return ss(sessionStorage.getItem(pn))}catch{return"auto"}}function bs(){try{const e=sessionStorage.getItem(Ln);if(e==="0")return!1;if(e==="1")return!0}catch{}return null}function bn(e){return`${rs}${encodeURIComponent(e)}`}function sn(e){try{const n=sessionStorage.getItem(bn(e));if(n==="0")return!1;if(n==="1")return!0}catch{}return bs()??!1}function vs(e,n){try{sessionStorage.setItem(bn(e),n?"1":"0")}catch{}}function Ss(e,n){const t=r.useRef(new Map),s=r.useRef({}),l=r.useCallback((d,u=t.current.get(d))=>{if(!u)return;const m=s.current[d]??hs(e,d);if(m<=0)return;const c=Math.max(0,u.scrollWidth-u.clientWidth),h=Math.min(m,c);Math.abs(u.scrollLeft-h)>1&&(u.scrollLeft=h)},[e]),i=r.useCallback(()=>{for(const d of ms)l(d)},[l]);r.useLayoutEffect(()=>{i();const d=window.requestAnimationFrame(i);return()=>window.cancelAnimationFrame(d)},[e,i,n]);const f=r.useCallback((d,u)=>{if(!u){t.current.delete(d);return}t.current.set(d,u),l(d,u)},[l]);return{handleLaneScroll:r.useCallback((d,u)=>{const m=u.currentTarget.scrollLeft;s.current[d]=m,gs(e,d,m)},[e]),setLaneScrollNode:f}}function ks({issue:e}){const n=e.agentNames?.length?e.agentNames.join(", "):e.agentIds?.join(", "),t=e.transcriptPaths?.join(" · "),s=[n,t].filter(Boolean).join(" · ");return o.jsxs("li",{className:"s-agent-lanes-issues-item",children:[o.jsx("span",{className:"s-agent-lanes-issues-kind",children:e.kind.replaceAll("_"," ")}),o.jsx("span",{className:"s-agent-lanes-issues-message",children:e.message}),s?o.jsx("span",{className:"s-agent-lanes-issues-detail",children:s}):null]})}function xs({loadState:e,onRetry:n}){const t=[e.discovery==="error"?"session discovery":"",e.recent==="error"?"recent history":""].filter(Boolean).join(" and "),s=e.recent==="error"?"Recent activity could not be loaded":"Session discovery could not be completed";return o.jsx("div",{className:"s-agent-lanes-empty s-agent-lanes-empty--degraded",role:"alert",children:o.jsxs("div",{className:"s-agent-lanes-empty-card",children:[o.jsxs("div",{className:"s-agent-lanes-empty-rail","aria-hidden":"true",children:[o.jsx("span",{}),o.jsx("span",{}),o.jsx("span",{})]}),o.jsxs("div",{className:"s-agent-lanes-empty-copy",children:[o.jsx("span",{className:"s-agent-lanes-empty-kicker",children:"Tail incomplete"}),o.jsx("h2",{children:s}),o.jsxs("p",{children:["Scout could not finish ",t||"the tail scan",", so this is not being treated as a quiet interval."]}),o.jsx("p",{className:"s-agent-lanes-empty-secondary",children:"Live events can still arrive while Scout retries."})]}),o.jsx("div",{className:"s-agent-lanes-empty-actions",children:o.jsx("button",{type:"button",onClick:n,children:"Retry tail scan"})})]})})}function ws({activeFilterLabel:e,horizon:n,horizonLabel:t,showAutoLanes:s,onHorizonChange:l,onAddAttentionLane:i,onAddCodexLane:f,sourceCount:y,eventCount:d,degraded:u=!1,onRetry:m}){const c=!!e,h=c?"No matching lanes":s?`No activity in the last ${t}`:"No pinned lanes",L=c?`${e} has no activity in the last ${t}.`:s?`Scout checked ${y.toLocaleString()} session source${y===1?"":"s"} and ${d.toLocaleString()} recent tail event${d===1?"":"s"}; nothing is active in this interval.`:"Automatic lanes are off, and this deck has no pinned sessions.",k=u?"The last tail refresh failed, so this reading is from the previous scan and may be behind.":s?"Scout will keep listening. New turns and tool output will appear here automatically.":"Pin a session lane or turn automatic lanes back on to populate the deck.",x=n==="5m"?"30m":n==="24h"?null:"24h";return o.jsx("div",{className:"s-agent-lanes-empty",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"s-agent-lanes-empty-card",children:[o.jsxs("div",{className:"s-agent-lanes-empty-rail","aria-hidden":"true",children:[o.jsx("span",{}),o.jsx("span",{}),o.jsx("span",{})]}),o.jsxs("div",{className:"s-agent-lanes-empty-copy",children:[o.jsx("span",{className:"s-agent-lanes-empty-kicker",children:u?"Tail refresh behind":c?"Filter checked":s?"Tail scanned":"Lane deck ready"}),o.jsx("h2",{children:h}),o.jsx("p",{children:L}),o.jsx("p",{className:"s-agent-lanes-empty-secondary",children:k})]}),o.jsxs("div",{className:"s-agent-lanes-empty-actions",children:[u&&m?o.jsx("button",{type:"button",onClick:m,children:"Retry tail scan"}):null,x?o.jsxs("button",{type:"button",onClick:()=>l(x),children:["Look back ",un(x)]}):null,o.jsx("button",{type:"button",onClick:i,children:"Show attention"}),o.jsx("button",{type:"button",onClick:f,children:"Pin Codex sessions"})]})]})})}function Ns({lane:e,widthPx:n,laneTitle:t,pinned:s,laneWidth:l,defaultWidth:i,isNew:f,nowMs:y,traceWindowMs:d,traceWindowLabel:u,summaryHeight:m,onSummaryResizeStart:c,onSummaryResizeReset:h,summaryResizing:L,onInspect:k,onTraceEventSelect:x,onTogglePin:R,onWidthChange:g,onWidthResizeStart:j,widthResizing:w,focusProps:T,operatorName:v,grid:b=!1}){const{agent:S,observe:C,source:z}=e,_=At(C),M=!!C,ee=_?" s-agent-lane--live":"",ne=f?" s-agent-lane--new":"",[H,te]=r.useState(!0),[B,G]=r.useState(()=>sn(e.id)),F=r.useRef(e.id);r.useEffect(()=>{if(F.current!==e.id){F.current=e.id,G(sn(e.id));return}vs(e.id,B)},[B,e.id]);const P=T?.ref,V=T?{"data-cursor":T["data-cursor"],tabIndex:T.tabIndex,onFocus:T.onFocus}:void 0,O=()=>o.jsx("section",{className:"s-agent-lane-trace","aria-label":`${q(S,z)} trace`,children:o.jsx("div",{className:"s-agent-lane-body",children:M?o.jsx(Kn,{data:C??void 0,agentId:e.source==="scout"?S.id:void 0,sessionId:S.harnessSessionId,showRail:!1,variant:"lane",nowMs:y,traceWindowMs:d,traceWindowLabel:u,laneCollapseTechnicalEvents:B,onLaneCollapseTechnicalEventsChange:G,laneOperatorName:v,onLaneEventSelect:Y=>x(e,Y)}):o.jsx("div",{className:"s-agent-lane-empty",children:"Waiting for trace activity…"})})}),se=r.useMemo(()=>ht(e,{isLive:_,nowMs:y}),[e,_,y]),ae=r.useMemo(O,[M,C,e.source,S.id,S.harnessSessionId,y,d,u,B,v,x,e]);return o.jsxs("article",{ref:P,"data-lane-id":e.id,className:`s-agent-lane${b?" s-agent-lane--grid":""}${ee}${ne}${s?" s-agent-lane--pinned":""}${T?.["data-cursor"]?" s-agent-lane--cursor":""}`,style:b?void 0:{"--lane-width":`${n}px`},...V,children:[o.jsx(ft,{title:t,width:l,defaultWidth:i,pinned:s,onTogglePin:R,onWidthChange:g,onResizeStart:j,resizing:w,statusLabel:fn(S,z),live:_,widthControls:!b}),o.jsx(mt,{model:se,avatar:o.jsx(Gn,{agent:S,placement:"row",size:44,presence:!1,tile:!1}),collapsed:H,cockpitHeight:H?void 0:m,onToggleCollapsed:()=>te(Y=>!Y),onOpen:()=>k(e)}),!H&&o.jsx(St,{onResizeStart:c,onReset:h,active:L}),ae]})}function Es({navigate:e,agents:n,data:t,embedded:s=!1,laneSize:l="lg",profileId:i,harnessFilter:f,projectFilter:y}){const d=r.useContext(Hn),u=t?.agents??n??d?.agents??[],m=t?.operatorName?.trim()||d?.onboarding?.operatorName?.trim()||void 0,c=i??cn(),h=l??dn(),[L,k]=r.useState(Date.now()),[x,R]=r.useState(ps),[g,j]=r.useState(()=>Ls(s)),[w,T]=r.useState(ys),v=!s&&g==="floor",b=g==="grid",S=v?"4h":x,[C,z]=r.useState(bt),[_,M]=r.useState([]),{beginResize:ee,resetSummaryHeight:ne,resizing:H}=vt(z),te=r.useCallback(a=>ee(a,C),[ee,C]),B=Rt(S),G=kt(S),F=Bt({enabled:!t,includeTranscriptReplay:!0,hydrateOnDiscovery:!0,discoveryIntervalMs:s?ls:5e3,recentLimit:B,discoveryLimit:s?is:void 0,pauseWhenHidden:!0}),P=t?.discovery??F.discovery,V=t?.tailEvents??F.events,O=t?.loadState??F.loadState,se=t?.retryInitialLoad??F.retryInitialLoad,ae=t?.terminalSessions??_,Y={view:"ops",mode:"lanes"},Z=un(S),Pe=s?cs:1e4,De=s?ds:1e4;r.useEffect(()=>{const a=setInterval(()=>{tn()||k(Date.now())},Pe);return()=>clearInterval(a)},[Pe]),r.useEffect(()=>{if(t)return;let a=!1;const p=async()=>{if(!tn())try{const je=await Wn({includeDiscovered:!1});a||M(je)}catch{a||M([])}};p();const E=setInterval(()=>{p()},De),I=Te(()=>{p()});return()=>{a=!0,clearInterval(E),I()}},[t,De]),r.useEffect(()=>{try{sessionStorage.setItem(hn,x)}catch{}},[x]),r.useEffect(()=>{try{sessionStorage.setItem(gn,g)}catch{}},[g]),r.useEffect(()=>{try{sessionStorage.setItem(pn,w)}catch{}},[w]);const vn=r.useRef(xt()),ze=r.useRef(""),[re,Me]=r.useState(()=>new Set),[be,Oe]=r.useState(null),Sn=r.useMemo(()=>u.filter(a=>wt(a,L,S)),[u,L,S]),kn=Fn(Sn,{enabled:!t,activeIntervalMs:s?us:void 0,idleIntervalMs:s?fs:void 0,pauseWhenHidden:!0}),$e=t?.observeCache??kn,xn=O.discovery==="loading"||O.recent==="loading",Fe=Mt(O),We=Fe==="blank",wn=Fe==="degraded",He=P?.totals.transcripts??P?.transcripts?.length??0,oe=lt(xn,We?0:ut);r.useEffect(()=>{if(re.size===0)return;const a=setTimeout(()=>Me(new Set),900);return()=>clearTimeout(a)},[re]);const{lanes:ie,issues:D,freshLaneIds:ve}=r.useMemo(()=>{const a=Nt({transcripts:P?.transcripts??[],tailEvents:V,processes:P?.processes??[],scoutAgents:u,terminalSessions:ae,observeCache:$e,now:L,workingOnly:!0,horizon:S}),p=Et(a.lanes,vn.current),E=[...jt(P),...a.issues];return{lanes:p.lanes,issues:E,freshLaneIds:p.newLaneIds}},[P,V,u,ae,$e,L,S]);r.useEffect(()=>{const a=D.map(p=>`${p.id}\0${p.message}`).join(`
|
|
2
|
-
`);a!==ze.current&&(ze.current=a,D.length!==0&&console.warn(`[agent-lanes] ${D.length} roster issue${D.length===1?"":"s"}`,D))},[D]),r.useEffect(()=>{ve.length!==0&&Me(a=>{const p=new Set(a);for(const E of ve)p.add(E);return p})},[ve.join("\0")]);const X=r.useMemo(()=>ie.find(a=>a.id===be)??null,[be,ie]),J=r.useMemo(()=>ie.filter(a=>Cs(a,{harnessFilter:f,projectFilter:y})),[ie,f,y]),Nn=r.useCallback(a=>Rs(a,{harnessFilter:f,projectFilter:y}),[f,y]),{deck:A,layout:N,pinLane:le,unpinLane:ce,setLaneWidth:Se,addHarnessLane:Q,addAttentionLane:Be,addProjectLane:En,clearPins:jn,isPinned:de}=Qt(c,h,J),{beginResize:Ge,resizingLaneId:Ve}=es(Se),ke=r.useMemo(()=>As({harnessFilter:f,projectFilter:y}),[f,y]),xe=r.useMemo(()=>X?gt(X):null,[X]),Cn=r.useMemo(()=>xe?Jt(A,xe):!1,[A,xe]),Rn=r.useMemo(()=>[N.pinnedLeft,N.main,N.pinnedRight].map(a=>a.map(p=>`${p.key}:${p.widthPx}`).join(",")).join("/"),[N.main,N.pinnedLeft,N.pinnedRight]),{handleLaneScroll:K,setLaneScrollNode:U}=Ss(c,Rn),An=r.useCallback(a=>{U("pinned-left",a)},[U]),In=r.useCallback(a=>{U("main",a)},[U]),Tn=r.useCallback(a=>{U("pinned-right",a)},[U]),_n=r.useCallback(a=>{K("pinned-left",a)},[K]),Pn=r.useCallback(a=>{K("main",a)},[K]),Dn=r.useCallback(a=>{K("pinned-right",a)},[K]),W=N.flat,we=N.pinnedLeft.length+N.pinnedRight.length;r.useEffect(()=>{if(v)return;const a=W.map(p=>{const{lane:E}=p;return{id:E.id,label:q(E.agent,E.source),statusLabel:fn(E.agent,E.source),tone:rn(E.agent.state,E.agent),agentId:pt(E.agent)?void 0:E.agent.id,updatedAt:E.lastActiveAt>0?E.lastActiveAt:void 0}});Je(a)},[W,v]),r.useEffect(()=>()=>Je(null),[]);const[Ke,Ne]=r.useState(null),Ee=r.useCallback(a=>{Oe(a.id)},[]),Ue=r.useCallback((a,p)=>{Ne({lane:a,event:p})},[]),zn=r.useCallback(a=>{const p=a.observe?.events.at(-1);p&&Ne({lane:a,event:p})},[]),Mn=r.useCallback(a=>{de(a.id)?ce(a.id):le(a)},[de,le,ce]),{getLaneFocusProps:qe}=Gt({lanes:W.map(a=>a.lane),inspectedLaneId:be,onInspect:Ee,onHorizonChange:R,onTogglePin:Mn}),[ue,$]=r.useState(!1),Ye=r.useRef(null);r.useEffect(()=>{if(!ue)return;const a=p=>{Ye.current?.contains(p.target)||$(!1)};return window.addEventListener("pointerdown",a),()=>window.removeEventListener("pointerdown",a)},[ue]);const fe=r.useCallback((a,p,E=!1)=>{const{lane:I}=a,je=q(I.agent,I.source),On=A.laneWidths[I.id]??ln(a.widthPx).tier??a.widthPx;return o.jsx(Ns,{lane:I,widthPx:a.widthPx,laneTitle:je,pinned:a.isPinned,laneWidth:On,defaultWidth:A.defaultLaneWidth,isNew:re.has(I.id),nowMs:L,traceWindowMs:G,traceWindowLabel:Z,summaryHeight:C,onSummaryResizeStart:te,onSummaryResizeReset:ne,summaryResizing:H,onInspect:Ee,onTraceEventSelect:Ue,onTogglePin:()=>{de(I.id)?ce(I.id):le(I)},onWidthChange:Ce=>Se(I.id,Ce),onWidthResizeStart:Ce=>Ge(I.id,Ce,a.widthPx),widthResizing:Ve===I.id,focusProps:qe(p,I.id),operatorName:m,grid:E},a.key)},[Ge,A.defaultLaneWidth,A.laneWidths,qe,te,Z,Ee,Ue,de,m,re,L,le,ne,Ve,Se,C,H,G,ce]);return o.jsxs("div",{className:`s-agent-lanes${s?" s-agent-lanes--embedded s-agent-lanes--low-motion":""}`,"data-lane-profile":c,"data-lane-layout":v?"floor":g,"data-lanes-deck-version":"1",children:[o.jsxs("div",{className:"s-agent-lanes-bar",children:[o.jsxs("div",{className:"s-agent-lanes-bar-leading",children:[o.jsx("div",{className:"s-agent-lanes-title",children:"Agent Lanes"}),o.jsxs("div",{className:"s-agent-lanes-meta","aria-label":"Lane deck status",children:[o.jsxs("span",{className:"s-agent-lanes-meta-stat",children:[v?J.length:W.length," live"]}),!v&&we>0?o.jsxs("span",{className:"s-agent-lanes-meta-stat",children:[we," pinned"]}):null,o.jsx("span",{className:"s-agent-lanes-meta-stat",children:v?"past 30m · lanes 4h":`trace ${Z}`}),ke?o.jsx("span",{className:"s-agent-lanes-meta-filter",children:ke}):null,o.jsxs("span",{className:"s-agent-lanes-meta-detail",children:["deck v1 · ",c]})]})]}),o.jsxs("div",{className:"s-agent-lanes-bar-controls",children:[o.jsx("div",{className:"s-agent-lanes-layouts",role:"group","aria-label":"Lane layout",children:as(s).map(a=>o.jsx("button",{type:"button",className:`s-agent-lanes-horizon${g===a.key?" s-agent-lanes-horizon--on":""}`,"aria-pressed":g===a.key,onClick:()=>j(a.key),children:a.label},a.key))}),b?o.jsx("div",{className:"s-agent-lanes-grid-density",role:"group","aria-label":"Grid columns",children:ns.map(a=>o.jsx("button",{type:"button",className:`s-agent-lanes-horizon${w===a.key?" s-agent-lanes-horizon--on":""}`,"aria-pressed":w===a.key,title:a.key==="auto"?"Fit columns to the available width":`${a.key} columns`,onClick:()=>T(a.key),children:a.label},a.key))}):null,o.jsxs("div",{className:"s-agent-lanes-deck-menu",ref:Ye,hidden:v,children:[o.jsx("button",{type:"button",className:"s-agent-lanes-deck-btn","aria-expanded":ue,onClick:()=>$(a=>!a),children:"+ Lane"}),ue?o.jsxs("div",{className:"s-agent-lanes-deck-popover",role:"menu",children:[o.jsx("button",{type:"button",role:"menuitem",className:"s-agent-lanes-deck-item",onClick:()=>{Be(),$(!1)},disabled:Xt(A),children:"Needs attention"}),o.jsx("button",{type:"button",role:"menuitem",className:"s-agent-lanes-deck-item",onClick:()=>{Q("codex","Codex sessions"),$(!1)},disabled:me(A,"codex"),children:"Codex sessions"}),o.jsx("button",{type:"button",role:"menuitem",className:"s-agent-lanes-deck-item",onClick:()=>{Q("claude","Claude sessions"),$(!1)},disabled:me(A,"claude"),children:"Claude sessions"}),o.jsx("button",{type:"button",role:"menuitem",className:"s-agent-lanes-deck-item",onClick:()=>{Q("grok","Grok sessions"),$(!1)},disabled:me(A,"grok"),children:"Grok sessions"}),o.jsx("button",{type:"button",role:"menuitem",className:"s-agent-lanes-deck-item",onClick:()=>{Q("kimi","Kimi sessions"),$(!1)},disabled:me(A,"kimi"),children:"Kimi sessions"}),o.jsx("button",{type:"button",role:"menuitem",className:"s-agent-lanes-deck-item s-agent-lanes-deck-item--danger",onClick:()=>{jn(),$(!1)},disabled:we===0,children:"Clear pinned lanes"})]}):null]}),v?null:o.jsx("div",{className:"s-agent-lanes-horizons",role:"group","aria-label":"Activity window",children:pe.map((a,p)=>o.jsx("button",{type:"button",className:`s-agent-lanes-horizon${x===a.key?" s-agent-lanes-horizon--on":""}`,"aria-pressed":x===a.key,title:`${a.label} window (${p+1})`,onClick:()=>R(a.key),children:a.label},a.key))})]})]}),t==null&&D.length>0?o.jsxs("div",{className:"s-agent-lanes-issues",role:"status","aria-live":"polite",children:[o.jsxs("div",{className:"s-agent-lanes-issues-head",children:[o.jsx("span",{className:"s-agent-lanes-issues-badge",children:"Roster issues"}),o.jsxs("span",{className:"s-agent-lanes-issues-meta",children:[D.length," fleet/transcript warning",D.length===1?"":"s"," — lanes follow tail, not agent registry"]})]}),o.jsx("ul",{className:"s-agent-lanes-issues-list",children:D.map(a=>o.jsx(ks,{issue:a},a.id))})]}):null,(v?J.length:W.length)===0?oe.visible?o.jsx(ct,{discovery:P,discoveryPhase:O.discovery,windowMs:G,nowMs:L,layout:v?"none":b?"grid":"scroll",gridColumns:w,laneWidthPx:on(A.defaultLaneWidth,A.defaultLaneWidth),matchTranscript:Nn}):We?o.jsx(xs,{loadState:O,onRetry:()=>{se()}}):o.jsx(ws,{activeFilterLabel:ke,horizon:x,horizonLabel:Z,showAutoLanes:A.showAutoLanes,onHorizonChange:R,onAddAttentionLane:Be,onAddCodexLane:()=>Q("codex","Codex sessions"),sourceCount:He,eventCount:V.length,degraded:wn,onRetry:()=>{se()}}):v?o.jsx(it,{lanes:J,now:L,onOpenTrace:zn,railLedger:!0,operatorName:m}):b?o.jsx("div",{className:"s-agent-lanes-grid","data-grid-columns":w,role:"listbox","aria-label":"Agent lane grid",children:W.map((a,p)=>fe(a,p,!0))}):o.jsxs("div",{className:"s-agent-lanes-body",children:[N.pinnedLeft.length>0?o.jsxs("section",{className:"s-agent-lanes-zone s-agent-lanes-zone--pinned-left","aria-label":"Pinned lanes",children:[o.jsx("div",{className:"s-agent-lanes-zone-label",children:"Pinned"}),o.jsx("div",{ref:An,className:"s-agent-lanes-scroll",role:"listbox","aria-label":"Pinned agent lanes",onScroll:_n,children:N.pinnedLeft.map((a,p)=>fe(a,p))})]}):null,N.main.length>0?o.jsxs("section",{className:"s-agent-lanes-zone s-agent-lanes-zone--main","aria-label":"Active lanes",children:[N.pinnedLeft.length>0?o.jsx("div",{className:"s-agent-lanes-zone-label",children:"Live"}):null,o.jsx("div",{ref:In,className:"s-agent-lanes-scroll",role:"listbox","aria-label":"Active agent lanes",onScroll:Pn,children:N.main.map((a,p)=>fe(a,N.pinnedLeft.length+p))})]}):null,N.pinnedRight.length>0?o.jsxs("section",{className:"s-agent-lanes-zone s-agent-lanes-zone--pinned-right","aria-label":"Pinned right lanes",children:[o.jsx("div",{className:"s-agent-lanes-zone-label",children:"Pinned"}),o.jsx("div",{ref:Tn,className:"s-agent-lanes-scroll",role:"listbox","aria-label":"Pinned right agent lanes",onScroll:Dn,children:N.pinnedRight.map((a,p)=>fe(a,N.pinnedLeft.length+N.main.length+p))})]}):null]}),oe.visible?o.jsx(dt,{loadState:O,sourceCount:He,processCount:P?.processes.length??0,eventCount:V.length,laneCount:v?J.length:W.length,horizonLabel:Z,handedOff:oe.exiting,exiting:oe.exiting}):null,X&&o.jsx(Lt,{lane:X,navigate:e,returnRoute:Y,navigationEnabled:t==null,onClose:()=>Oe(null),onPinProject:En,projectPinned:Cn}),Ke&&o.jsx(yt,{target:Ke,onClose:()=>Ne(null)})]})}function Le(e){const n=e?.trim().toLowerCase();return n||null}function Ie(e){return e.trim().toLowerCase().replace(/['"]/gu,"").replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function js(e){return e.trim().replace(/\/+$/u,"").split(/[\\/]/u).filter(Boolean).pop()?.trim()||null}function ye(e,n){if(!n)return!0;const t=Ie(n);return e.some(s=>{const l=s?.trim();if(!l)return!1;const i=l.toLowerCase(),f=js(l);return i===n||Ie(l)===t||!!(f&&(f.toLowerCase()===n||Ie(f)===t))})}function Cs(e,n){const t=Le(n.harnessFilter),s=Le(n.projectFilter),{agent:l,facts:i,source:f}=e;return ye([l.harness,l.definitionId,i?.attribution,f],t)&&ye([l.project,l.projectRoot,l.cwd,i?.cwd,q(l,f)],s)}function Rs(e,n){return ye([e.harness,e.source],Le(n.harnessFilter))&&ye([e.project,e.cwd],Le(n.projectFilter))}function As(e){return[e.harnessFilter?.trim()?`harness ${e.harnessFilter.trim()}`:"",e.projectFilter?.trim()?`project ${e.projectFilter.trim()}`:""].filter(Boolean).join(" · ")}const Is=Bn({id:"lanes",label:"Agent Lanes",route:{view:"ops",mode:"lanes"},webPath:"/ops/lanes",screen:"AgentLanesView",embed:{path:"/embed/agent-lanes",aliases:["/ops/lanes/embed","/embed/lanes","/embed/traces"],profile:"macos.lanes",rootClassName:"s-agent-lanes-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:e=>({profileId:cn(),laneSize:dn(),harnessFilter:e.get("harness")?.trim()||null,projectFilter:e.get("project")?.trim()||null})}}),sa=Object.freeze(Object.defineProperty({__proto__:null,AgentLanesView:Es,scoutSurface:Is},Symbol.toStringTag,{value:"Module"}));export{Es as A,sa as a,Zt as r,Bt as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./index-CZ-05hKz.js";import{S as i}from"./SecondaryNav-o2RL9H8H.js";import{A as m}from"./secondaryNavConfig-B9IF8wXl.js";import"./createLucideIcon-DXpqZP7I.js";import"./message-square-D9YYWE0x.js";import"./file-text-KijGBnME.js";import"./search-D1tJSAWe.js";import"./compass-0_54-vz3.js";import"./settings-2fC_G9nX.js";import"./terminal-yN9xN-h9.js";import"./git-branch-BQ_x8KZL.js";import"./code-xml-Jtxsp5d1.js";import"./scroll-text-DO0GQzvN.js";function j({activeRoute:r,navigate:o}){return t.jsx(i,{ariaLabel:"Agents sections",activeRoute:r,groups:m,navigate:o})}export{j as AgentsSubnav};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,r as j}from"./index-CZ-05hKz.js";import{i as $,d as B,e as w,a as W}from"./conversation-model-CwF6Y9gx.js";import{l as O,i as q,a as E,p as T}from"./conversation-prefs-DNre-Lcx.js";import{u as G,m as J,e as K}from"./Provider-B2xuo3rf.js";import{b as Q}from"./router-DJj2WbDg.js";import{l as D,i as C,s as X}from"./sessionRead-CvFz2RHv.js";import{u as Y}from"./use-conversation-list-D9BNLfnW.js";import{u as Z}from"./use-fleet-active-asks-BeAdcl09.js";import{i as ee}from"./colors-BtO5_zlx.js";import{A as se}from"./AgentAvatar-CYhf6twS.js";/* empty css */function te({children:n,count:t,tone:a="default",title:l,onClick:i}){const d=["collapsed-strip-label",a!=="default"&&`collapsed-strip-label--${a}`,t!=null&&"collapsed-strip-label--has-count",i&&"collapsed-strip-label--button"].filter(Boolean).join(" "),o=s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"collapsed-strip-label-mark","aria-hidden":!0}),i?s.jsx("span",{className:"collapsed-strip-label-expand","aria-hidden":!0,children:"›"}):null,s.jsx("span",{className:"collapsed-strip-label-text",children:n}),t!=null?s.jsx("span",{className:"collapsed-strip-label-count",children:t}):null]});return i?s.jsx("button",{type:"button",className:d,title:l??n,"aria-label":l??n,onClick:i,children:o}):s.jsx("div",{className:d,title:l??n,children:o})}function ae({label:n,emptyMark:t="·",showLabel:a=!0,labelTone:l="default",labelCount:i,onLabelClick:d,children:o}){const v=!o||Array.isArray(o)&&o.length===0,p=a?s.jsx(te,{tone:l,count:i,onClick:d,title:d?`Expand ${n}`:void 0,children:n}):null;return v?s.jsxs("div",{className:"collapsed-strip collapsed-strip--empty","aria-hidden":!0,children:[p,s.jsx("span",{className:"collapsed-strip-empty-mark",children:t})]}):s.jsxs("div",{className:"collapsed-strip",role:"list","aria-label":n,children:[p,o]})}function Ce(){return s.jsx("div",{className:"collapsed-strip-rule","aria-hidden":!0})}function ne({title:n,active:t,tone:a="default",ava:l,avaColor:i,glyph:d,avatarNode:o,dot:v,pinned:p,onClick:b}){const m=["collapsed-chip",a==="channel"&&"collapsed-chip--channel",a==="neutral"&&"collapsed-chip--neutral",a==="attention"&&"collapsed-chip--attention",a==="unread"&&"collapsed-chip--unread",t&&"collapsed-chip--active",p&&"collapsed-chip--pinned"].filter(Boolean).join(" ");return s.jsxs("button",{type:"button",role:"listitem",className:m,title:n,"aria-label":n,"aria-current":t?"page":void 0,onClick:b,children:[o?s.jsx("span",{className:"collapsed-chip-avatar-wrap",children:o}):l?s.jsx("span",{className:"collapsed-chip-ava",style:i?{"--ava-color":i}:void 0,children:l}):s.jsx("span",{className:`collapsed-chip-glyph${typeof d=="string"&&d.length>1?" collapsed-chip-glyph--long":""}`,children:d}),v?s.jsx("span",{className:["collapsed-chip-dot",v==="attention"&&"collapsed-chip-dot--attention",v==="live"&&"collapsed-chip-dot--live"].filter(Boolean).join(" "),"aria-hidden":!0}):null,p?s.jsx("span",{className:"collapsed-chip-pin","aria-hidden":!0}):null]})}function Ie(n){const t=n.trim(),a=t.split(/[\s/_-]+/).filter(Boolean);if(a.length>=2){const l=a[a.length-1];return/^\d+$/.test(l)&&a.length>=3?(a[a.length-2][0]??"?").toUpperCase():(l[0]??"?").toUpperCase()}return(t[0]??"?").toUpperCase()}const le=3,ie=3,oe=4,re=3;function y(n,t){return[...n].sort((a,l)=>{const i=C(a.lastMessageAt,a.id,t)?0:1,d=C(l.lastMessageAt,l.id,t)?0:1;return i!==d?i-d:(l.lastMessageAt??0)-(a.lastMessageAt??0)})}function ce({onExpand:n}){const{route:t,navigate:a,agents:l}=G(),{sessions:i}=Y(),d=Z(),[o,v]=j.useState(()=>O()),[p,b]=j.useState(()=>D()),m=Q(t),S=j.useMemo(()=>J(l,m),[l,m]),P=j.useMemo(()=>{const e=new Map;for(const f of l)e.set(f.id,f);return e},[l]),R=t.view==="messages"||t.view==="conversation"?t.conversationId:void 0;j.useEffect(()=>{v(O()),b(D())},[]);const r=j.useMemo(()=>{const e=K(i,S,m).filter(c=>!q(c.id,o)),f=e.filter(c=>E(c.id,o)).sort((c,x)=>T(x.id,o)-T(c.id,o)||(x.lastMessageAt??0)-(c.lastMessageAt??0)).slice(0,le),g=new Set(f.map(c=>c.id)),h=e.filter(c=>!g.has(c.id));return{pinned:f,channels:y(h.filter(w),p).slice(0,ie),dms:y(h.filter(B),p).slice(0,oe),observed:y(h.filter($),p).slice(0,re),totals:{channels:h.filter(w).length,dms:h.filter(B).length,observed:h.filter($).length,pinned:e.filter(c=>E(c.id,o)).length}}},[i,S,m,o,p]),U=e=>{b(X(e.id)),a({view:"messages",conversationId:e.id,...m?{machineId:m}:{}})},k=[...r.pinned,...r.channels,...r.dms,...r.observed],I=k.filter(e=>C(e.lastMessageAt,e.id,p)).length,M=(e,f=!1)=>{const g=W(e),h=w(e),c=C(e.lastMessageAt,e.id,p),x=h?void 0:pe(e,g),V=x??g,A=e.agentId?P.get(e.agentId):void 0,L=e.agentId?d.get(e.agentId):void 0,_=L?.status==="needs_attention",z=L?.status==="working",F=A?ee(A.state):!1,H=_?"attention":c?"unread":z||F?"live":null;return s.jsx(ne,{title:f?`${g} · pinned`:x?`${g} · ${x}`:g,active:e.id===R,tone:h?"channel":_?"attention":c?"unread":"default",avatarNode:h?void 0:s.jsx(se,{agent:A,name:V,size:28,tile:!0,presence:!1}),glyph:h?de(g):void 0,dot:H,pinned:f,onClick:()=>U(e)},e.id)},u=[];return r.pinned.length&&u.push(s.jsx(N,{mark:"Pin",count:r.totals.pinned,showMark:u.length>0,children:r.pinned.map(e=>M(e,!0))},"pin")),r.channels.length&&u.push(s.jsx(N,{mark:"#",count:r.totals.channels,showMark:u.length>0,children:r.channels.map(e=>M(e))},"ch")),r.dms.length&&u.push(s.jsx(N,{mark:"DM",count:r.totals.dms,showMark:u.length>0,children:r.dms.map(e=>M(e))},"dm")),r.observed.length&&u.push(s.jsx(N,{mark:"Obs",count:r.totals.observed,showMark:u.length>0,children:r.observed.map(e=>M(e))},"obs")),s.jsx(ae,{label:"Chat",emptyMark:"#",labelTone:I>0?"accent":"default",labelCount:I>0?I:k.length||void 0,onLabelClick:n,children:u})}function de(n){const a=n.replace(/^#+/,"").match(/[a-z0-9]/i)?.[0]?.toLowerCase()??"?";return s.jsxs("span",{className:"collapsed-chip-channel-badge",children:[s.jsx("span",{className:"collapsed-chip-channel-hash","aria-hidden":!0,children:"#"}),s.jsx("span",{className:"collapsed-chip-channel-text",children:a})]})}function pe(n,t){const a=t.toLowerCase();for(const l of n.participants??[]){const i=l.displayName||l.label;if(i&&i.toLowerCase()!==a)return i}}function N({mark:n,count:t,showMark:a=!0,children:l}){return s.jsxs("div",{className:"collapsed-strip-section",role:"group","aria-label":n,children:[a?s.jsxs("div",{className:"collapsed-strip-section-mark",title:t!=null?`${n} · ${t}`:n,children:[s.jsx("span",{className:"collapsed-strip-section-mark-text",children:n}),t!=null&&t>0?s.jsx("span",{className:"collapsed-strip-section-mark-count",children:t>99?"99+":t}):null]}):null,l]})}const Ae=Object.freeze(Object.defineProperty({__proto__:null,ChatCollapsedStrip:ce},Symbol.toStringTag,{value:"Module"}));export{ae as C,ce as a,ne as b,Ie as c,Ce as d,Ae as e};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as r,r as o}from"./index-CZ-05hKz.js";import{o as ht,w as aa,q as Jt,s as Os,t as ra,u as oa,v as ia,x as Ps,y as la,z as ca,A as da,B as ua}from"./NewChatComposer-hlWT-nbR.js";import{a as U}from"./api-Co9aQ2Jw.js";import"./text-CnZ0e1-V.js";import{u as ma,C as ha}from"./ConversationComposer-2HjbGPL9.js";import"./index-BVlMw8x_.js";import{u as pa,d as fa,a as ga}from"./Provider-B2xuo3rf.js";import{h as ya,j as ba,x as ne,y as qs,z as wa,A as ve,B as Sa,D as Ta,E as xa,F as va,c as Ds,S as Bs,G as Ca,H as Ma,I as ka,J as Na,K as Aa,L as Ia,M as ja,k as Us,N as Ra,O as Ea,q as La,s as $a,r as Gt,P as Fa,Q as Oa,R as Pa,T as qa,l as Da,U as Ba,V as Ua,W as Hs,X as Ha,Y as Wa,Z as _e,g as _a,_ as Ka,$ as Qa,a0 as Ws,a1 as Va,a2 as za,a3 as Ja,a4 as Ga,a5 as _s,a6 as Ya,a7 as Ks,a8 as Xa,a9 as Za,aa as er}from"./conversation-model-CwF6Y9gx.js";import{u as tr}from"./sse-CiOSzE5n.js";import{n as Yt,t as pt,f as Qs}from"./time-Dhsh_2EG.js";import{M as sr}from"./message-markup-RkfmDfME.js";import{a as Vs,i as Xt,b as nr}from"./message-visibility-DwxgcgYK.js";import{d as ar}from"./operator-attention-RqieiSY8.js";import{b as rr}from"./router-DJj2WbDg.js";import{f as Zt,a as or}from"./scoutbot-BJIamJOH.js";import{s as ir}from"./sessionRead-CvFz2RHv.js";import{o as ft}from"./openContent-C6XO6kr5.js";import{c as Ke}from"./clipboard-e3fSpeo7.js";import{A as es}from"./AgentAvatar-CYhf6twS.js";import{d as lr}from"./types-B0PlfpKc.js";/* empty css */import{ConversationHeader as cr,ConversationIdentityRow as dr,AddParticipantForm as ur}from"./ConversationHeader-C8vfXaTF.js";import{FanOutRow as mr,ThreadDayDivider as hr}from"./ConversationFeedRows-C6wUqJrx.js";import{T as pr,t as zs,m as Js,a as fr,b as gr,o as yr,d as br,s as wr,l as Sr,c as Tr,e as xr,W as vr,f as Cr,g as Mr}from"./ConversationPanels-CNCIbpqU.js";import{u as kr}from"./tail-events-BMQmSx1n.js";import{PinnedAskCard as Nr,ConversationStatusStrip as Ar}from"./ConversationStatus-DZuyKsWN.js";import"./HarnessMark-D5CA5uSp.js";import"./colors-BtO5_zlx.js";import"./NewChatOrigin-DdpzE4kz.js";import"./keyboard-nav-DFhAJkW3.js";import"./x-e3h2hDsp.js";import"./createLucideIcon-DXpqZP7I.js";import"./chevron-down-Mp9mu_yd.js";import"./search-D1tJSAWe.js";import"./loader-circle-BiohlpM3.js";import"./file-text-KijGBnME.js";import"./perf-PX8Rx0EP.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./zap-nMcjPoWB.js";import"./surface-activity-B1rgWB1i.js";import"./DocumentFocusViewer-DZVhS7as.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./chevron-right-CzH-TaSF.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./arrow-right-iJFv3jNh.js";import"./chunk-HRAB3GC3-swV8PA2k.js";import"./index-BWHgHrtv.js";import"./mentions-CcPFMbmZ.js";import"./AgentDetailCard-UqPNpcvB.js";import"./AgentLiveActions-BwuzOE8h.js";import"./terminal-takeover-DANQfTcy.js";import"./eye-CpfyvdLq.js";import"./terminal-yN9xN-h9.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./SpriteAvatar-Bs68ZENy.js";import"./CrewAvatar-CTIuxp4G.js";import"./BackToPicker-4JaeRvDm.js";import"./AstronautSuit-Ckx7lu7G.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CKkhq9c5.js";import"./proxy-DnLpZIi9.js";import"./activity-Bj3Hnbj3.js";import"./message-circle-B2ddzBrX.js";import"./check-C18YQC90.js";import"./sparkles-Dy8p5xN8.js";const en="scout:conversations:failure-dismissals:v1",Ir=64;let ns={};function tn(){try{if(typeof localStorage<"u"){const n=JSON.parse(localStorage.getItem(en)??"null");Er(n)&&(ns=as(n))}}catch{}return as(ns)}function jr(n){ns=as(n);try{typeof localStorage<"u"&&localStorage.setItem(en,JSON.stringify(n))}catch{}}function Gs(n){return new Set(tn()[n]??[])}function Rr(n,c){const d=tn(),f=(d[n]??[]).filter(N=>N!==c);f.push(c),d[n]=f.slice(-100);const y=Object.keys(d);for(const N of y.slice(0,Math.max(0,y.length-Ir)))delete d[N];return jr(d),new Set(d[n])}function as(n){return Object.fromEntries(Object.entries(n).map(([c,d])=>[c,[...d]]))}function Er(n){return!n||typeof n!="object"||Array.isArray(n)?!1:Object.values(n).every(c=>Array.isArray(c)&&c.every(d=>typeof d=="string"&&d.length>0))}const Lr=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)(?:$|[?#])/iu,$r=/\bhttps?:\/\/[^\s<>"')\]]+/giu;function Qe(n){if(typeof n!="string")return null;try{const c=new URL(n.trim());return c.protocol==="http:"||c.protocol==="https:"?c.toString():null}catch{return null}}function z(n,c){const d=n?.[c];return typeof d=="string"&&d.trim()?d.trim():null}function Fr(n){return n.mediaType.toLowerCase().startsWith("image/")}function Or(n){return Lr.test(n)}function Pr(n){try{const c=new URL(n),d=[c.pathname==="/"?"":c.pathname,c.search].join("").trim();return{host:c.hostname.replace(/^www\./iu,""),detail:d||c.hostname}}catch{return{host:n,detail:n}}}function qr(n){const c=new Set,d=[];for(const f of n.matchAll($r)){const y=f[0]?.replace(/[.,;:!?]+$/u,""),N=Qe(y);!N||c.has(N)||(c.add(N),d.push(N))}return d}const Dr=/^\/api\/blobs\/[^/]+$/u;function ts(n){try{const c=new URL(n);return Dr.test(c.pathname)?`${c.pathname}${c.search}`:n}catch{return n}}function gt(n){return Qe(n.url)??Qe(z(n.metadata,"url"))??Qe(z(n.metadata,"href"))}function Br(n){const c=n.metadata??null,d=z(c,"kind")??z(c,"type"),f=gt(n);if(!f||d!=="link_preview"&&d!=="link-preview"&&n.mediaType!=="text/x-uri")return null;const y=Pr(f);return{id:n.id,url:f,title:z(c,"title")??y.host,description:z(c,"description"),imageUrl:Qe(z(c,"imageUrl")??z(c,"image")),siteName:z(c,"siteName")??y.host}}function Ur({src:n,alt:c}){const[d,f]=o.useState(!1);return d?r.jsxs("a",{className:"s-message-embed s-message-embed--file",href:n,target:"_blank",rel:"noreferrer",children:[r.jsx("span",{className:"s-message-embed-title",children:c}),r.jsx("span",{className:"s-message-embed-description",children:"Preview unavailable"})]}):r.jsx("a",{className:"s-message-embed s-message-embed--image",href:n,target:"_blank",rel:"noreferrer",children:r.jsx("img",{src:n,alt:c,loading:"lazy",decoding:"async",onError:()=>f(!0)})})}function Hr({preview:n}){return r.jsxs("a",{className:"s-message-embed s-message-embed--link",href:n.url,target:"_blank",rel:"noreferrer",children:[n.imageUrl&&r.jsx("span",{className:"s-message-embed-thumb",children:r.jsx("img",{src:n.imageUrl,alt:"",loading:"lazy",decoding:"async"})}),r.jsxs("span",{className:"s-message-embed-copy",children:[n.siteName&&r.jsx("span",{className:"s-message-embed-site",children:n.siteName}),r.jsx("span",{className:"s-message-embed-title",children:n.title}),n.description&&r.jsx("span",{className:"s-message-embed-description",children:n.description})]})]})}function Wr({message:n}){const c=n.attachments??[],d=new Set,f=[],y=[];for(const h of c){const L=gt(h);if(L&&Fr(h)){d.add(h.id),f.push({id:h.id,src:ts(L),alt:h.fileName??"Image attachment"});continue}const b=Br(h);b&&(d.add(h.id),y.push(b))}const N=new Set(y.map(h=>h.url)),G=new Set(c.map(gt).filter(h=>!!h));for(const h of qr(n.body))G.has(h)||N.has(h)||Or(h)&&f.push({id:h,src:ts(h),alt:"Embedded image"});const k=c.filter(h=>!d.has(h.id));return f.length===0&&y.length===0&&k.length===0?null:r.jsxs("div",{className:"s-message-embeds",children:[f.map(h=>r.jsx(Ur,{src:h.src,alt:h.alt},h.id)),y.slice(0,1).map(h=>r.jsx(Hr,{preview:h},h.id)),k.map(h=>{const L=gt(h),b=L?ts(L):null,u=h.fileName??z(h.metadata,"title")??h.mediaType;return b?r.jsxs("a",{className:"s-message-embed s-message-embed--file",href:b,target:"_blank",rel:"noreferrer",children:[r.jsx("span",{className:"s-message-embed-title",children:u}),r.jsx("span",{className:"s-message-embed-description",children:h.mediaType})]},h.id):r.jsxs("div",{className:"s-message-embed s-message-embed--file",children:[r.jsx("span",{className:"s-message-embed-title",children:u}),r.jsx("span",{className:"s-message-embed-description",children:h.mediaType})]},h.id)})]})}function _r(n){const{sessionIds:c,active:d}=n,f=c.join("|"),y=d&&c.length>0,[N,G]=o.useState([]);return o.useEffect(()=>{G([])},[f]),o.useEffect(()=>{if(!y)return;let k=!1;const h=new URLSearchParams({limit:String(pr*3),transcripts:"true"});return U(`/api/tail/recent?${h.toString()}`).then(L=>{if(k)return;const b=(L.events??[]).filter(u=>zs(u,c));b.length!==0&&G(u=>Js(u,b))}).catch(()=>{}),()=>{k=!0}},[y,f]),kr(k=>{y&&zs(k,c)&&G(h=>Js(h,[k]))},y),o.useMemo(()=>y?fr(N):[],[y,N])}const Kr=3500;function Ys(n){const c=n?.trim().replace(/^#/,"");if(!c?.startsWith("msg-"))return null;const d=c.slice(4).trim();if(!d)return null;try{return decodeURIComponent(d)}catch{return d}}const Qr=64;function Vr(n){const c=n?.clientMessageId;return typeof c=="string"&&c.trim()?c.trim():null}function Xs(n){const c=n.body.replace(/\s+/gu," ").trim();if(c)return c.length>180?`${c.slice(0,179).trimEnd()}…`:c;const d=n.attachments?.length??0;return d===1?"Attachment":d>1?`${d} attachments`:"Message"}function Zs(n,c){const d=n.toLocaleLowerCase().indexOf(c.toLocaleLowerCase());if(d<0)return n;const f=n.slice(0,d),y=n.slice(d+c.length);return!f&&y.startsWith(" ")?y.slice(1):f.endsWith(" ")&&y.startsWith(" ")?`${f}${y.slice(1)}`:`${f}${y}`}function zr(n){return n instanceof TypeError||typeof DOMException<"u"&&n instanceof DOMException&&n.name==="AbortError"}function mi({conversationId:n,initialDraft:c,navigate:d,embedded:f,showBackNav:y=!0,treatment:N="standard"}){const{agents:G,route:k,openContextCapture:h}=pa(),L=rr(k),b=o.useMemo(()=>fa(G,L),[G,L]),[u,yt]=o.useState(null),rs=o.useRef(null);rs.current=u;const Ve=o.useMemo(()=>ht(n),[n]),[sn,nn]=o.useState(()=>Ve?{[n]:Ve}:{}),T=sn[n]??Ve??[],[an,os]=o.useState(()=>Ve!==null),Ce=o.useRef(null),is=o.useMemo(()=>{const e=Ce.current;return e===null?null:new Set(T.filter(t=>!e.has(t.id)).map(t=>t.id))},[T]),ze=Ce.current===null&&T.length>0;o.useEffect(()=>{if(T.length===0)return;const e=Ce.current??new Set;for(const t of T)e.add(t.id);Ce.current=e},[T]),o.useEffect(()=>{Ce.current=null,os(ht(n)!==null)},[n]);const ls=!an&&T.length===0,J=o.useCallback(e=>{nn(t=>{const s=t[n]??ht(n)??[],a=typeof e=="function"?e(s):e,i=aa(n,a);return{...t,[n]:i}})},[n]),rn=Jt(n),[g,ge]=o.useState(rn),[Me,ke]=o.useState([]),[Je,bt]=o.useState(null),[Ge,Ne]=o.useState(null),[Ye,on]=o.useState(()=>typeof window>"u"?null:Ys(window.location.hash)),[cs,ae]=o.useState(null),[wt,ds]=o.useState(()=>Gs(n)),[ye,St]=o.useState(!1),[ln,Ae]=o.useState(!1),[Tt,Xe]=o.useState(0),Ze=o.useRef(null),Ie=o.useRef(null),us=o.useRef(null),je=o.useRef(!0),et=o.useRef(!1),be=o.useRef(null),A=o.useRef(null),Re=o.useRef(new Set),Ee=o.useRef(null),ms=o.useRef(0),hs=o.useRef(null),Le=o.useRef(null),$e=o.useRef(new Set),re=o.useRef(n);re.current=n;const oe=o.useRef(new Map),cn=Os(n),tt=o.useRef(!1);o.useLayoutEffect(()=>{const e=Ie.current,t=Ze.current;!e||!t||(t.scrollTop=e.scrollTop+(t.scrollHeight-e.scrollHeight),Ie.current=null,tt.current=!0)}),o.useEffect(()=>{St(!1),Ie.current=null,tt.current=!1,je.current=!0,et.current=!1,Ae(!1),Xe(0),Ut(new Set),oe.current.clear(),ge(Jt(n)),ds(Gs(n))},[n]);const st=o.useCallback(async e=>{let s=typeof e.metadata?.flightId=="string"?e.metadata.flightId.trim():"";if(!s&&e.replyToMessageId)try{s=(await U(`/api/flights?conversationId=${encodeURIComponent(n)}&active=false`)).find(i=>i.messageId===e.replyToMessageId)?.id??""}catch{}await ar({...s?{flightId:s}:{},conversationId:n,messageId:e.replyToMessageId??e.id,itemUpdatedAt:Yt(e.createdAt)??Date.now()})},[n]),ps=o.useCallback(e=>{const t=e.replyToMessageId??e.id;ds(Rr(n,e.id)),Zt({type:"dismiss-conversation-failure",conversationId:n,messageId:t,reason:"The operator cleared this delivery issue"});const s=`${n}:${e.id}`;$e.current.add(s),st(e).catch(()=>{$e.current.delete(s)})},[n,st]);o.useEffect(()=>{for(const e of T){if(!wt.has(e.id)||!Vs(e))continue;const t=`${n}:${e.id}`;$e.current.has(t)||($e.current.add(t),st(e).catch(()=>{$e.current.delete(t)}))}},[n,wt,T,st]);const x=u?.agentId??null,M=u?.kind==="direct",xt=o.useMemo(()=>new Set([n,...u?.equivalentConversationIds??[]]),[n,u?.equivalentConversationIds]),V=o.useMemo(()=>x?b.find(e=>e.id===x)??null:null,[b,x]),fs=ya(u),dn=ba({resolvedAgentId:V?.id,sessionId:fs,machineId:L}),[vt,gs]=o.useState(null);o.useEffect(()=>{U("/api/fleet").then(e=>{gs(t=>ne(t,qs(e.activeAsks,n,x)))}).catch(()=>{})},[n,x]);const H=o.useCallback(async(e={})=>{const t=e.messageMode??"none",s=e.includeMetadata??!0;ae(null);try{const a=s?await U(`/api/session/${encodeURIComponent(n)}`).catch(()=>null):rs.current;if(re.current!==n)return;yt(C=>ne(C,a));const i=a?.agentId??null,l=a?.id&&a.id!==n?a.id:n;if(l!==n){d({view:"conversation",conversationId:l});return}const m=ht(l),R=ra(l),w=t==="initial"&&!R,p=t==="refresh"||t==="initial",[S,_,E]=await Promise.all([w?oa(l):p?ia(l,{refresh:!0}):Promise.resolve(m),U(`/api/flights?conversationId=${encodeURIComponent(l)}`),U("/api/fleet?limit=24&activityLimit=160").catch(()=>wa())]);if(re.current!==n)return;const te=ve(S??[]),q=te.filter(C=>!Xt(C));S&&J(C=>ne(C,Sa(C,q))),os(!0),ir(l);const K=te.at(-1);K&&Le.current!==K.id&&(Le.current=K.id,U(`/api/conversations/${encodeURIComponent(l)}/read-cursor`,{method:"POST",body:JSON.stringify({lastReadMessageId:K.id})}).catch(()=>{Le.current===K.id&&(Le.current=null)}));const Q=Ta(_),D=Jt(l),se=Q??D;Re.current=new Set([..._.map(C=>C.invocationId),...D?.invocationId?.startsWith("pending:")?[]:D?.invocationId?[D.invocationId]:[]]),Q&&D?.id===Q.id&&Ps(l,Q.id);const ut=se?.agentId??i??null,B=xa(E.activity,se,l,ut),zt=va(E.activeAsks,se,l,ut);ge(C=>ne(C,se)),ke(C=>ne(C,B)),Ne(C=>ne(C,zt)),gs(C=>ne(C,qs(E.activeAsks,l,i)))}catch(a){if(re.current!==n)return;ae(a instanceof Error?a.message:String(a))}},[n,d,J]);o.useEffect(()=>{H({messageMode:"initial"})},[H]),o.useEffect(()=>{Le.current=null},[n]),o.useEffect(()=>{Ee.current=g},[g]);const un=o.useCallback(async()=>{if(ye||!Os(n))return;const e=Ze.current,t=e?{scrollHeight:e.scrollHeight,scrollTop:e.scrollTop}:null;St(!0),ae(null);try{const s=await la(n);if(re.current!==n)return;t&&(Ie.current=t),J(ve(s).filter(a=>!Xt(a)))}catch(s){re.current===n&&ae(s instanceof Error?s.message:String(s))}finally{re.current===n&&St(!1)}},[n,ye,J]),[I,P]=o.useState(()=>c??""),[ie,le]=o.useState(null),[W,nt]=o.useState(!1),[v,mn]=o.useState("operator"),[ce,Fe]=o.useState({open:!1,query:"",triggerStart:-1,index:0}),[de,Oe]=o.useState({open:!1,query:"",triggerStart:-1,index:0}),[$,Y]=o.useState(null),[Ct,at]=o.useState(!1),[Mt,rt]=o.useState(""),[hn,Pe]=o.useState(null),[pn,kt]=o.useState(!1);o.useEffect(()=>{at(!1),rt(""),Pe(null),kt(!1)},[n]),o.useEffect(()=>{if(!c)return;const e=`${n}:${c}`;hs.current!==e&&(hs.current=e,P(c),requestAnimationFrame(()=>A.current?.focus()))},[n,c]);const X=o.useMemo(()=>{const e=new Map;for(const t of u?.participants??[])e.set(t.actorId,t),t.agentId&&e.set(t.agentId,t);return e},[u]),Nt=o.useMemo(()=>{const e=new Set,t=[];for(const s of u?.participantIds??[]){if(s==="operator")continue;const a=X.get(s),i=a?.scopedAlias?.trim().replace(/^@+/,"");if(!i)continue;const l=i.toLowerCase();e.has(l)||(e.add(l),t.push({id:s,label:a?.label??a?.displayName??i,name:a?.displayName??i,handle:i}))}for(const s of b){const a=s.handle?.trim().replace(/^@+/,"")??Ds(s.id)??s.id;if(!a)continue;const i=a.toLowerCase();e.has(i)||(e.add(i),t.push({id:s.id,label:a,name:s.name??a,handle:a}))}return t.sort((s,a)=>s.handle.localeCompare(a.handle))},[X,b,u]),fn=o.useMemo(()=>{if(!ce.open)return[];const e=ce.query.toLowerCase();return e?Bs.filter(t=>t.command.toLowerCase().startsWith("/"+e)||t.command.toLowerCase().includes(e)):Bs},[ce.open,ce.query]),gn=o.useMemo(()=>{if(!de.open)return[];const e=de.query.toLowerCase();return e?Nt.filter(t=>t.handle.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||t.label.toLowerCase().includes(e)).slice(0,8):Nt.slice(0,8)},[de.open,de.query,Nt]),yn=o.useCallback(()=>{Fe(e=>e.open?{...e,open:!1}:e),Oe(e=>e.open?{...e,open:!1}:e)},[]),bn=o.useCallback((e,t)=>{const s=Ca(e,t);Fe(s?i=>({open:!0,query:s.query,triggerStart:s.start,index:i.open&&i.triggerStart===s.start?i.index:0}):i=>i.open?{...i,open:!1}:i);const a=Ma(e,t);Oe(a?i=>({open:!0,query:a.query,triggerStart:a.start,index:i.open&&i.triggerStart===a.start?i.index:0}):i=>i.open?{...i,open:!1}:i)},[]),wn=o.useCallback(e=>{const t=A.current,s=ce.triggerStart;if(s<0)return;const a=t?.selectionStart??I.length,i=I.slice(0,s),l=I.slice(a),m=e.insert,R=`${i}${m}${l}`;P(R),Fe(w=>({...w,open:!1})),requestAnimationFrame(()=>{const w=A.current;if(!w)return;const p=i.length+m.length;w.focus(),w.setSelectionRange(p,p)})},[I,ce.triggerStart]),Sn=o.useCallback(e=>{const t=A.current,s=de.triggerStart;if(s<0)return;const a=t?.selectionStart??I.length,i=I.slice(0,s),l=I.slice(a),m=l.length===0||!l.startsWith(" "),R=`@${e.handle}${m?" ":""}`,w=`${i}${R}${l}`;P(w),Oe(p=>({...p,open:!1})),requestAnimationFrame(()=>{const p=A.current;if(!p)return;const S=i.length+R.length;p.focus(),p.setSelectionRange(S,S)})},[I,de.triggerStart]);o.useEffect(()=>{const e=A.current;if(!e)return;e.style.height="0px";const t=Math.min(Math.max(e.scrollHeight,40),160);e.style.height=`${t}px`,e.style.overflowY=e.scrollHeight>t?"auto":"hidden"},[I]),o.useEffect(()=>{U("/api/user").then(e=>mn(e.name)).catch(()=>{})},[]);const ot=o.useMemo(()=>ka(T,v),[T,v]);o.useEffect(()=>{$===null||ot===null||ot>=$&&Y(null)},[$,ot]);const Tn=o.useMemo(()=>Na(g),[g]),we=Date.now(),xn=Aa(g,ot,we),At=Tn&&!Ia(g)&&!xn,ys=M&&(W||$!==null||At),bs=M&&ja({sending:W,awaitingResponse:$!==null,currentFlight:g}),F=Us({name:V?.name,agentName:u?.agentName,id:x,title:u?.title}),j=o.useMemo(()=>M?Ra({agentName:F,agentState:V?.state??null,sending:W,currentFlight:g,showWorkingTurn:At,awaitingResponse:$!==null}):{label:"Open",detail:"",tone:"idle",showStrip:!1,showTyping:!1},[V?.state,F,$,g,we,M,W,At]),It=g?.startedAt??Ge?.startedAt??$,jt=Yt(It),ws=Ya(It,we),[,vn]=o.useState(0);o.useEffect(()=>{if(!j.showTyping||jt===null)return;const e=Math.max(0,Date.now()-jt),t=[_s.sustained,_s.long].find(a=>a>e);if(t===void 0)return;const s=window.setTimeout(()=>vn(a=>a+1),t-e+50);return()=>window.clearTimeout(s)},[jt,j.showTyping,ws]);const Cn="Live",Rt=o.useMemo(()=>Ea({currentFlight:g,presence:j,turnActivity:Me,turnAsk:Ge,awaitingResponseSince:$,nowMs:we}),[$,g,we,j,Me,Ge]),Mn="s-thread-msg-card s-thread-msg-working-card s-thread-msg-card--avatar-row",kn="s-thread-msg-kind",Nn="s-thread-turn-snapshot",An="s-thread-turn-snapshot-pulse",In="s-thread-presence-line",jn=["s-thread-presence-strip",`s-thread-presence-strip--${ws}`].filter(Boolean).join(" "),Et=u?La(u):F,Ss=u?.id??n,Rn=u?.alias?.trim()||null,it=$a(u?.workspaceRoot),En=j.tone,Lt=T.length===0&&M&&(j.showTyping||g!==null||Me.length>0||Ge!==null||$!==null),Ts=o.useMemo(()=>u?u.participantIds.includes("operator"):M,[M,u]),qe=g?.agentId??x,De=qe?Gt(b,[qe]):null,Be=De?.id??qe,Ue=g?.sessions.at(-1)?.sessionId??De?.harnessSessionId??void 0,xs=g?.id?()=>{ft(d,{view:"sessions",flightId:g.id,...Be?{agentId:Be}:{},...Ue?{sessionId:Ue}:{},...L?{machineId:L}:{}},{returnTo:k})}:void 0,vs=g?.id??null;o.useEffect(()=>{if(!vs||!Be){bt(null);return}let e=!1;const t=Ue?`?sessionId=${encodeURIComponent(Ue)}`:"",s=async()=>{try{const i=await U(`/api/agents/${encodeURIComponent(Be)}/observe${t}`);if(e)return;bt(l=>ne(l,i))}catch{}};s();const a=window.setInterval(()=>{s()},Kr);return()=>{e=!0,window.clearInterval(a),bt(null)}},[vs,Be,Ue]);const $t=o.useMemo(()=>gr({flight:g,agent:De??V,sessionMeta:u,observeSessionId:Je?.sessionId}),[V,g,u,Je?.sessionId,De]),Cs=_r({sessionIds:$t,active:j.showTyping||Lt}),Ln=o.useMemo(()=>yr({observe:Je,flight:g}),[g,Je]),Z=Cs.length>0?Cs:Ln,Ft=o.useMemo(()=>Z.length>0?null:br({flight:g,hasSessionScope:$t.length>0,awaitingResponse:$!==null}),[$,g,$t.length,Z.length]),Ot=wr(Z),Pt=Sr(Z),Ms=Z.at(-1)??null,qt=Ms?pt(Ms.ts,we):null,ue=o.useMemo(()=>Pt?{...Rt,latest:Pt,...Ot?{activityLabel:Ot}:{},...qt?{lastActivityLabel:qt}:{}}:Rt,[qt,Pt,Rt,Ot]),$n=`${F}: ${ue.latest}`,ks=qe&&Fa(De)?()=>{ft(d,{view:"terminal",agentId:qe,mode:"takeover"},{returnTo:k})}:void 0,Dt=M?()=>{f&&Zt({type:"focus-composer",reason:"Steer the active conversation"})||requestAnimationFrame(()=>{A.current?.focus({preventScroll:!0}),A.current?.scrollIntoView({block:"nearest"})})}:void 0,Fn=o.useMemo(()=>(u?u.participantIds.filter(t=>t!=="operator"):x?[x]:[]).map(t=>{const s=Gt(b,[t]),a=X.get(t);return{id:t,name:a?.scopedAlias??s?.name??a?.displayName??Ds(t)??t,title:a?.label??s?.id??t,agent:s,sessionId:a?.sessionId??null,harness:s?.harness??a?.harness??null,model:s?.model??null,reasoningEffort:s?.reasoningEffort??null}}),[x,X,b,u]),On=o.useMemo(()=>({name:v,active:Ts}),[Ts,v]),me=o.useMemo(()=>new Map(T.map(e=>[e.id,e])),[T]),Bt=o.useMemo(()=>b.find(e=>or(e)&&!!e.conversationId?.trim())?.conversationId?.trim()??null,[b]),He=o.useMemo(()=>Oa(T),[T]),[Pn,Ut]=o.useState(()=>new Set),qn=o.useCallback(e=>{Ut(t=>{const s=new Set(t);return s.delete(e)||s.add(e),s})},[]),Ns=o.useMemo(()=>{const e=new Map;for(const t of He)if(t.kind==="fanout")for(const s of t.messages)e.set(s.id,t.key);return e},[He]),lt=o.useCallback(e=>{const t=Ns.get(e);t&&Ut(l=>l.has(t)?l:new Set(l).add(t));const s=document.getElementById(`msg-${e}`);if(!s)return;const a=s.closest(".s-thread-fanout")??s,i=a===s?"s-thread-msg--flash":"s-thread-fanout--flash";a.scrollIntoView({behavior:"smooth",block:"center"}),a.classList.add(i),window.setTimeout(()=>a.classList.remove(i),1200)},[Ns]);o.useEffect(()=>{const e=()=>on(Ys(window.location.hash));return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),o.useEffect(()=>{if(!Ye||!me.has(Ye))return;const e=window.setTimeout(()=>lt(Ye),50);return()=>window.clearTimeout(e)},[Ye,me,lt]),tr(o.useCallback(e=>{if(e.kind==="message.posted"){const t=e.payload?.message;if(!t||!xt.has(t.conversationId))return;const s=t.actorId==="operator",a=M&&!s&&t.class==="agent",i={id:t.id,conversationId:t.conversationId,actorId:t.actorId,actorName:a?F:Pa(t.actorId,b,v),body:t.body,createdAt:t.createdAt,class:s?"operator":t.class,attachments:t.attachments,metadata:t.metadata,replyToMessageId:t.replyToMessageId??t.n??null};if(Xt(i))return;if(J(l=>{const m=Vr(t.metadata),R=m?oe.current.get(m):void 0;if(l.some(w=>w.id===t.id))return m&&oe.current.delete(m),l;if(s&&m){const w=qa(l,m,R);if(w!==-1){const p=[...l];return p[w]=i,oe.current.delete(m),ve(p)}}return ve([...l,i])}),a){const l=Yt(t.createdAt)??Date.now();Y(m=>m===null||l<m||Da(Ee.current)?m:null),ge(m=>Ba(m)?null:m)}return}if(e.kind==="invocation.requested"){const t=e.payload?.invocation;if(!t||t.targetAgentId!==x||!t.conversationId||!xt.has(t.conversationId))return;Re.current.add(t.id),ke([]),Ne(null),Y(s=>s??Date.now());return}if(e.kind==="flight.updated"){const t=e.payload?.flight;if(!t||t.targetAgentId!==x||!(Re.current.has(t.invocationId)||Ee.current?.id===t.id))return;if(Ua.has(t.state)){Ps(n,t.id),ge(l=>l?.id===t.id?null:l),ke([]),Ne(null),Y(null),H({messageMode:"refresh",includeMetadata:!1});return}Re.current.add(t.invocationId);const a=Ee.current?.id===t.id,i=Hs(t,n,x??"",Ee.current);Ha(i)&&Y(null),ge(i),a||(ke([]),Ne(null));return}e.kind!=="agent.endpoint.upserted"&&e.kind==="unknown"&&H({messageMode:"refresh"})},[x,F,n,xt,M,H,v,b])),o.useEffect(()=>{if(!ys)return;const e=setInterval(()=>{H({messageMode:"refresh",includeMetadata:!1})},5e3);return()=>clearInterval(e)},[ys,H]),o.useEffect(()=>{const e=()=>{if(document.visibilityState!=="visible")return;const t=Date.now();t-ms.current<1e3||(ms.current=t,H({messageMode:"refresh"}))};return window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}},[H]);const Ht=o.useRef(null),As=o.useRef(!1),Wt=o.useRef(!1),_t=o.useCallback(e=>{const t=us.current;t&&(et.current=!0,be.current!==null&&clearTimeout(be.current),t.scrollIntoView({behavior:e}),be.current=setTimeout(()=>{et.current=!1,be.current=null},e==="smooth"?700:0))},[]);o.useEffect(()=>()=>{be.current!==null&&clearTimeout(be.current)},[]);const Dn=o.useCallback(()=>{const e=Ze.current;if(!e||et.current)return;const s=e.scrollHeight-e.clientHeight-e.scrollTop<=Qr;je.current=s,s?(Ae(!1),Xe(0)):Ae(!0)},[]),Bn=o.useCallback(()=>{je.current=!0,Ae(!1),Xe(0),_t("smooth")},[_t]);o.useEffect(()=>{const e=T.at(-1)?.id??null,t=!!(e&&e!==Ht.current),s=Wa({newestMessageId:e,previousNewestMessageId:Ht.current,showTyping:j.showTyping,previousShowTyping:As.current,historyRestorePending:tt.current||Ie.current!==null,initialScrollDone:Wt.current,nearBottom:je.current});s!=="none"?(_t(s),Wt.current=!0):t&&Wt.current&&!je.current&&(Ae(!0),Xe(a=>a+1)),tt.current=!1,Ht.current=e,As.current=j.showTyping});const[,Un]=o.useState(0);o.useEffect(()=>{const e=setInterval(()=>Un(t=>t+1),15e3);return()=>clearInterval(e)},[]);const he=ma(),[pe,ee]=o.useState([]),[Is,ct]=o.useState("queue"),[Se,Te]=o.useState(null),xe=async(e,t)=>{const s=e.trim(),a=t?.attachments??[],i=t?.replyTarget??null;if(!s&&a.length===0||W)return"failed";const m=t?.forceAction??Ks({isDm:M,hasOutstandingReply:bs}),R=Date.now(),w=da(),p={id:`optimistic-${w}`,conversationId:n,actorId:"operator",actorName:v,body:s,createdAt:R,class:"operator",...i?{replyToMessageId:i.messageId}:{},metadata:{clientMessageId:w,deliveryState:"sending"},...a.length>0?{attachments:a}:{}};nt(!0),m!=="message"&&Y(R),ae(null),oe.current.set(w,p.id),J(S=>ve([...S,p]));try{const S=await U(`/api/chats/${encodeURIComponent(n)}/messages`,{method:"POST",body:JSON.stringify({body:s,clientMessageId:w,...i?{replyToMessageId:i.messageId}:{},...a.length>0?{attachments:a}:{}})}),_=S.chatId?.trim()??S.conversationId?.trim();if(_&&_!==n)throw new Error(`Send returned a different Chat (${_}) instead of appending to ${n}.`);if(S.messageId?.trim()){const E=S.messageId.trim();J(te=>ve(te.map(q=>q.id===p.id?{...q,id:E,metadata:{clientMessageId:w}}:q))),oe.current.delete(w)}return S.flight?(Re.current.add(S.flight.invocationId),ge(Hs(S.flight,n,x??"")),ke([]),Ne(null)):m!=="message"&&Y(null),"sent"}catch(S){return zr(S)?(J(_=>_.map(E=>E.id===p.id?{...E,metadata:{...E.metadata??{},deliveryState:"unknown"}}:E)),"unknown"):(J(_=>_.filter(E=>E.id!==p.id)),oe.current.delete(w),Y(null),ae(S instanceof Error?S.message:String(S)),"failed")}finally{nt(!1)}},Hn=async e=>{const t=e.replyToMessageId?me.get(e.replyToMessageId):null;if(!t||W)return;const s=[];for(const i of t.attachments??[]){if(!i.url){ae("This request includes an attachment that can’t be reused. Add it again, then retry."),requestAnimationFrame(()=>A.current?.focus());return}s.push({id:i.id,mediaType:i.mediaType,...i.fileName?{fileName:i.fileName}:{},url:i.url})}await xe(t.body,{forceAction:"invoke",attachments:s})!=="failed"&&ps(e)},Wn=(e,t,s)=>{if(!Bt)return;const a=e.replyToMessageId?me.get(e.replyToMessageId)?.body.trim():"",i=a?`${a.slice(0,1200)}${a.length>1200?"…":""}`:"(The original request is no longer available in this transcript.)",l=[`Help me recover a failed request to ${t}.`,s,"","Original request:",i].join(`
|
|
2
|
-
`),m={view:"conversation",conversationId:Bt,composeDraft:l};f&&Zt({type:"navigate",route:m,reason:"Ask @scoutbot to help recover a failed conversation request"})||d(m)},_n=async()=>{const e=I.trim(),t=ie,s=he.files,a=Se?.attachments??[];if(!e&&s.length===0&&a.length===0)return null;let i=[];if(s.length>0){nt(!0);try{i=await ua(s)}catch(l){return he.setError(l instanceof Error?l.message:String(l)),null}finally{nt(!1)}}return P(""),le(null),he.clear(),Te(null),{body:e,attachments:[...a,...i],replyTarget:t}},Kn=async()=>{const e=Za({isAgentBusy:fe,intent:Is}),t=Se?.id??null,s=await _n();if(!s)return;if(e==="queue"){ee(l=>t?l.map(m=>m.id===t?{...m,body:s.body,attachments:s.attachments,replyTarget:s.replyTarget}:m):[...l,{id:`queued-${Date.now()}-${l.length}`,body:s.body,attachments:s.attachments,replyTarget:s.replyTarget,queuedAt:Date.now()}]);return}t&&ee(l=>l.filter(m=>m.id!==t));const a=()=>{P(s.body),Te(s.attachments.length>0?{id:null,attachments:s.attachments}:null),le(s.replyTarget),requestAnimationFrame(()=>A.current?.focus())};if(e==="steer"){ct("queue"),await Qt(),await xe(s.body,{forceAction:"steer",attachments:s.attachments,replyTarget:s.replyTarget})==="failed"&&a();return}await xe(s.body,{attachments:s.attachments,replyTarget:s.replyTarget})==="failed"&&a()},Qn=e=>{ee(t=>t.filter(s=>s.id!==e)),Te(t=>t?.id===e?null:t)},Vn=e=>{const t=pe.find(s=>s.id===e);t&&(P(t.body),le(t.replyTarget??null),Te({id:e,attachments:t.attachments}),requestAnimationFrame(()=>{const s=A.current;s&&(s.focus(),s.setSelectionRange(s.value.length,s.value.length))}))},zn=()=>{Te(null),P(""),le(null),he.clear()},Jn=async e=>{const t=pe.find(a=>a.id===e);if(!t)return;ee(a=>a.filter(i=>i.id!==e)),await Qt(),await xe(t.body,{forceAction:"steer",attachments:t.attachments,replyTarget:t.replyTarget??null})==="failed"&&ee(a=>[t,...a])},dt=o.useCallback((e,t)=>{const s=t?.trim().replace(/^@+/,"")||null,a=s?`@${s}`:null,i=ie?.insertedMention?Zs(I,ie.insertedMention):I,l=!!(!M&&a&&!i.toLocaleLowerCase().includes(a.toLocaleLowerCase())),m=l&&a?i.trim()?`${i.trimEnd()} ${a} `:`${a} `:i;P(m),le({messageId:e.id,actorLabel:s?`@${s}`:e.actorName,preview:Xs(e),insertedMention:l?a:null}),requestAnimationFrame(()=>A.current?.focus())},[I,M,ie?.insertedMention]),Gn=o.useCallback(()=>{const e=ie?.insertedMention;le(null),e&&P(t=>Zs(t,e)),requestAnimationFrame(()=>A.current?.focus())},[ie]),Kt=o.useCallback(e=>{const t=new URL(window.location.href);k.view==="agents-v2"&&t.searchParams.set("tab","message"),t.hash=`msg-${e}`,Ke(t.toString())},[k.view]),js=o.useCallback((e,t,s)=>{const a=ca({conversationId:n,selectedMessageId:e.id,messages:T.map(i=>({id:i.id,actorLabel:i.id===e.id?t:_e(i,v)?v:i.actorName,body:i.body,attachmentCount:i.attachments?.length??0}))});h({intent:"forward-message",forwardContext:a,forwardContextMode:"selected-message",...s?{projectPath:s}:{}})},[n,T,h,v]),Qt=async()=>{if(x)try{await U("/api/agents/"+encodeURIComponent(x)+"/interrupt",{method:"POST",body:JSON.stringify({})})}catch{}},fe=j.tone==="working"||j.tone==="pending",Yn=Ks({isDm:M,hasOutstandingReply:bs}),Xn=M?`Message ${F} — type / to route or @ to mention an agent`:u?.kind==="channel"?`Comment in #${_a(u)} — mention @agent to request a reply`:`Comment in ${Et} — mention @agent to request a reply`,Rs=Se?.attachments??[],Zn=!I.trim()&&!he.hasFiles&&Rs.length===0&&fe,Vt=o.useRef(!1);o.useEffect(()=>{const e=Se?.id??null,t=e?pe.filter(a=>a.id!==e):pe;if(!Ka({isAgentBusy:fe,sending:W,queued:t})||Vt.current)return;const s=t[0];s&&(Vt.current=!0,ee(a=>a.filter(i=>i.id!==s.id)),xe(s.body,{attachments:s.attachments,replyTarget:s.replyTarget??null}).then(a=>{a==="failed"&&ee(i=>[s,...i])}).finally(()=>{Vt.current=!1}))},[fe,W,pe,Se]),o.useEffect(()=>{fe||ct("queue")},[fe]),o.useEffect(()=>{ee([]),Te(null),le(null),ct("queue"),he.clear()},[n]);const ea=Qa(pe),Es=ga(),ta=o.useCallback((e,t)=>{const s=window.getSelection()?.toString().trim(),a=_e(t,v),i=t.actorId?X.get(t.actorId):null,l=a?null:Ws(t,b,x),m=(i?.scopedAlias?.trim()||l?.handle?.trim()||null)?.replace(/^@+/,"")??null,R=m?`@${m}`:t.actorName,w=(l?.id||i?.agentId||t.actorId||"").trim(),p=[];a||p.push({kind:"action",label:"Reply",onSelect:()=>dt(t,m)}),p.push({kind:"action",label:"Forward to new task…",onSelect:()=>js(t,R,i?.workspaceRoot??l?.projectRoot??l?.cwd??void 0)}),p.push({kind:"separator"}),s&&p.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{Ke(s)}}),p.push({kind:"action",label:"Copy Message",onSelect:()=>{Ke(t.body)}}),p.push({kind:"action",label:"Copy Link",onSelect:()=>Kt(t.id)}),p.push({kind:"separator"}),!a&&w&&p.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{Ke(w)}}),p.push({kind:"action",label:"Copy Message ID",onSelect:()=>{Ke(t.id)}}),Es(e,p)},[x,dt,Kt,js,v,X,b,Es]),sa=async(e,t)=>{const s=`@${t.agentId} `,a=I.trim();if(a){P(""),await xe(`${s}${a}`,{forceAction:"invoke"});return}P(s),A.current?.focus()},We=o.useMemo(()=>{if(!u)return[];const e=new Set(u.participantIds);return b.filter(t=>!e.has(t.id)&&!t.retiredFromFleet).sort((t,s)=>t.name.localeCompare(s.name))},[u,b]);o.useEffect(()=>{Ct&&rt(e=>e&&We.some(t=>t.id===e)?e:We[0]?.id??"")},[Ct,We]);const Ls=!!(u&&["direct","group_direct","channel"].includes(u.kind)&&We.length>0),na=o.useCallback(async()=>{if(!u)return;const e=Mt.trim();if(e){kt(!0),Pe(null);try{const t=await U(`/api/conversations/${encodeURIComponent(u.id)}/members`,{method:"POST",body:JSON.stringify({actorId:e})});t.session?yt(t.session):yt(s=>s&&{...s,kind:t.kind,participantIds:t.participantIds}),at(!1),rt(""),await H({messageMode:"none"})}catch(t){Pe(t instanceof Error?t.message:String(t))}finally{kt(!1)}}},[Mt,H,u]);return r.jsx("div",{className:`s-thread-layout${f?" s-thread-layout--embedded":""}`,"data-thread-treatment":N==="standard"?void 0:N,children:r.jsxs("div",{className:"s-thread-center",children:[!f&&r.jsx(cr,{showBackNav:y,isDm:M,navigate:d,route:k,canonicalConversationId:Ss,threadTitle:Et,agentId:V?.id??null,sessionId:fs,detailRoute:dn,participants:Fn,operator:On,canAddParticipants:Ls,onToggleAddParticipant:()=>{Pe(null),at(e=>!e)}}),!f&&u&&r.jsx(dr,{canonicalConversationId:Ss,conversationAlias:Rn}),!f&&Ct&&Ls&&r.jsx(ur,{agents:We,addParticipantId:Mt,setAddParticipantId:rt,addingParticipant:pn,addParticipantError:hn,onCancel:()=>{at(!1),Pe(null)},onSubmit:()=>{na()}}),vt&&r.jsx(Nr,{pinnedAsk:vt,onAnswer:()=>{const e=[...T].reverse().find(t=>t.actorId===vt.agentId)??[...T].reverse().find(t=>!_e(t,v)&&t.class!=="status"&&t.class!=="system");e?dt(e,e.actorId?X.get(e.actorId)?.scopedAlias??null:null):A.current?.focus()},onSteer:Dt}),r.jsx(Ar,{presence:j,agent:V}),cs&&r.jsx("p",{className:"s-thread-error",children:cs}),r.jsxs("div",{className:"s-thread-feed",ref:Ze,onScroll:Dn,children:[!ls&&T.length>0&&cn&&r.jsx("div",{className:"s-thread-history-control",children:r.jsxs("button",{type:"button",className:"s-thread-history-button",disabled:ye,"aria-busy":ye,onClick:()=>{un()},children:[ye&&r.jsx("span",{className:"s-thread-history-spinner","aria-hidden":"true"}),ye?"Loading earlier messages…":"Load earlier messages"]})}),ls?r.jsx(Tr,{}):T.length===0?Lt?r.jsx(xr,{agentName:F,title:j.label,detail:j.detail||ue.latest,snapshot:ue,events:Me,steps:Z,phase:Ft,tone:En,workspaceName:it,branch:u?.currentBranch,startedAt:It,onOpenTrace:xs,onOpenTerminal:ks,onSteer:Dt}):r.jsxs("div",{className:"s-thread-empty",children:[r.jsx("div",{className:"s-thread-empty-glyph","aria-hidden":"true",children:M?"@":"#"}),r.jsx("p",{children:Et}),r.jsx("p",{children:M?"No messages yet. Send a message to start working with this agent.":"No messages yet. Start the conversation below."}),(it||u?.currentBranch)&&r.jsxs("div",{className:"s-thread-empty-chips",children:[it&&r.jsx("span",{className:"s-thread-empty-chip",children:it}),u?.currentBranch&&r.jsx("span",{className:"s-thread-empty-chip",children:u.currentBranch})]})]}):He.map((e,t)=>{const s=Va(e,t);if(e.kind==="fanout")return r.jsx(mr,{row:e,expanded:Pn.has(e.key),showDayDivider:s,onToggle:()=>qn(e.key)},e.key);const a=e.message,i=_e(a,v),l=za(a),m=l?"scout.dispatch":a.class,R=Xa(m),w=m==="status",p=Qs(a.createdAt),S=i?null:Ws(a,b,x),E=X.get(a.actorId)?.scopedAlias?.trim()||null,te=!i&&E?E:a.actorName,q=i?v.toLowerCase():E??S?.handle??null,K=Ja(a.body),Q=K?Ga({flightId:K.flightId,replyToMessageId:a.replyToMessageId,messagesById:me,agents:b,operatorName:v}):null,D=!K&&a.replyToMessageId?me.get(a.replyToMessageId)??null:null,se=D?_e(D,v)?v:D.actorName:null,ut=K?K.body:a.body,B=Vs(a);if(B&&wt.has(a.id))return null;const zt=typeof a.metadata?.targetAgentId=="string"?a.metadata.targetAgentId:null,C=B?Gt(b,[zt,B.target]):null,mt=B?Us({name:C?.name,id:C?.id,title:nr(B.target)}):null;return r.jsxs("div",{className:["s-thread-feed-block",i&&"s-thread-feed-block--you",s&&"s-thread-feed-block--full-width"].filter(Boolean).join(" "),children:[s&&r.jsx(hr,{at:a.createdAt}),B&&mt?r.jsxs("article",{id:`msg-${a.id}`,className:["s-thread-msg","s-thread-failure-notice",(ze||is?.has(a.id))&&"s-thread-msg--enter"].filter(Boolean).join(" "),style:ze?{animationDelay:`${Math.max(0,7-(He.length-1-t))*26}ms`}:void 0,"data-class":m,"aria-label":"Delivery issue",children:[r.jsx("span",{className:"s-thread-failure-notice-mark","aria-hidden":"true",children:"!"}),r.jsxs("div",{className:"s-thread-failure-notice-content",children:[r.jsxs("p",{children:[r.jsxs("strong",{children:[mt," couldn’t reply."]})," ",r.jsx("span",{children:B.explanation})]}),B.technicalDetail&&r.jsxs("details",{className:"s-thread-failure-notice-details",children:[r.jsx("summary",{children:"Technical details"}),r.jsx("pre",{children:B.technicalDetail})]}),r.jsxs("div",{className:"s-thread-failure-notice-actions",children:[a.replyToMessageId&&me.has(a.replyToMessageId)&&r.jsx("button",{className:"s-thread-failure-notice-action s-thread-failure-notice-action--primary",type:"button",disabled:W,onClick:()=>{Hn(a)},children:W?"Retrying…":"Retry"}),Bt&&r.jsx("button",{className:"s-thread-failure-notice-action",type:"button",onClick:()=>Wn(a,mt,B.explanation),children:"Ask @scoutbot"}),r.jsx("button",{className:"s-thread-failure-notice-action s-thread-failure-notice-action--clear",type:"button",onClick:()=>ps(a),"aria-label":`Clear delivery issue for ${mt}`,children:"Clear"})]})]}),r.jsx("span",{className:"s-thread-failure-notice-time",title:p,children:pt(a.createdAt)})]}):r.jsx("article",{id:`msg-${a.id}`,className:["s-thread-msg",i&&"s-thread-msg--you",w&&"s-thread-msg--tool",(ze||is?.has(a.id))&&"s-thread-msg--enter"].filter(Boolean).join(" "),style:ze?{animationDelay:`${Math.max(0,7-(He.length-1-t))*26}ms`}:void 0,"data-class":m,onContextMenu:O=>ta(O,a),children:r.jsx("div",{className:"s-thread-msg-card",children:r.jsxs("div",{className:"s-thread-msg-card-content",children:[r.jsxs("div",{className:"s-thread-msg-header",children:[r.jsxs("div",{className:"s-thread-msg-meta",children:[(()=>{const O=!i&&S?()=>ft(d,{view:"agents-v2",agentId:S.id},{returnTo:k}):null,$s=i?v:te??"?",Fs=r.jsx(es,{agent:S??void 0,name:$s,placement:"turn",size:28,className:"s-thread-msg-avatar",title:$s});return O?r.jsx("button",{type:"button",className:"s-thread-msg-avatar--nav",onClick:O,"aria-label":`View profile for ${a.actorName??"agent"}`,title:`View profile for ${a.actorName??"agent"}`,children:Fs}):Fs})(),!i&&S?r.jsx("button",{type:"button",className:"s-thread-msg-actor s-thread-msg-actor--nav",onClick:()=>ft(d,{view:"agents-v2",agentId:S.id},{returnTo:k}),title:`View profile for ${a.actorName}`,children:te}):r.jsx("span",{className:"s-thread-msg-actor",children:i?v:te}),q&&r.jsxs("span",{className:"s-thread-msg-handle",children:["@",q]}),R&&r.jsx("span",{className:"s-thread-msg-kind",children:R})]}),r.jsx("span",{className:"s-thread-msg-time",title:p,children:pt(a.createdAt)}),r.jsxs("span",{className:"s-thread-msg-actions",children:[!i&&q&&r.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":`Reply to @${q}`,title:`Reply to @${q}`,onClick:()=>dt(a,q),children:r.jsx(ss,{})}),r.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":"Copy link to message",title:"Copy link to message",onClick:()=>Kt(a.id),children:r.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M6.5 9.5a2.5 2.5 0 0 0 3.54 0l2.12-2.12a2.5 2.5 0 0 0-3.54-3.54l-.7.7"}),r.jsx("path",{d:"M9.5 6.5a2.5 2.5 0 0 0-3.54 0L3.84 8.62a2.5 2.5 0 0 0 3.54 3.54l.7-.7"})]})})]})]}),Q&&r.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open the originating request${Q.flightId?` · ${Q.flightId}`:""}`,onClick:()=>lt(Q.originatingMessageId),children:[r.jsx(ss,{}),r.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),r.jsx("span",{className:"s-thread-reply-ctx-title",children:Q.title}),r.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",Q.from]}),r.jsx("span",{className:"s-thread-reply-ctx-status",children:"· done"})]}),D&&se&&r.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open message from ${se}`,onClick:()=>lt(D.id),children:[r.jsx(ss,{}),r.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),r.jsx("span",{className:"s-thread-reply-ctx-title",children:Xs(D)}),r.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",se]})]}),r.jsx("div",{className:"s-thread-msg-body",title:p,children:r.jsx(sr,{text:ut})}),r.jsx(Wr,{message:a}),l&&l.candidates.length>0&&r.jsx("div",{className:"s-thread-dispatch",children:l.candidates.map(O=>r.jsxs("button",{type:"button",className:"s-thread-dispatch-tile",onClick:()=>{sa(l,O)},children:[r.jsxs("span",{className:"s-thread-dispatch-tile-id",children:["@",O.agentId]}),r.jsx("span",{className:"s-thread-dispatch-tile-state",children:O.endpointState}),r.jsx("span",{className:"s-thread-dispatch-tile-meta",children:[O.workspace,O.node,O.projectRoot].filter(Boolean).join(" · ")||O.displayName})]},O.agentId))})]})})})]},a.id)}),j.showTyping&&!Lt&&r.jsx("div",{className:"s-thread-feed-block",children:r.jsx("div",{className:"s-thread-msg","aria-live":"polite",children:r.jsxs("div",{className:Mn,children:[r.jsx(es,{agent:V??void 0,name:F,placement:"turn",size:28,className:"s-thread-msg-avatar s-thread-msg-avatar--working",title:F}),r.jsxs("div",{className:"s-thread-msg-card-content",children:[r.jsxs("div",{className:"s-thread-msg-header",children:[r.jsxs("div",{className:"s-thread-msg-meta",children:[r.jsx("span",{className:"s-thread-msg-actor",children:F}),r.jsx("span",{className:kn,children:Cn})]}),r.jsx("span",{className:"s-thread-msg-time",title:g?.startedAt?Qs(g.startedAt):"now",children:g?.startedAt?pt(g.startedAt):"now"})]}),r.jsxs("div",{className:"s-thread-msg-working-body",children:[r.jsxs("div",{className:Nn,children:[r.jsx("span",{className:An,"aria-hidden":"true"}),r.jsxs("div",{className:"s-thread-turn-snapshot-main",children:[r.jsx("span",{className:"s-thread-turn-snapshot-label",children:"Latest"}),r.jsx("span",{className:"s-thread-msg-working-copy",children:ue.latest})]})]}),r.jsxs("dl",{className:"s-thread-turn-snapshot-stats",children:[r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Activity"}),r.jsx("dd",{children:ue.activityLabel})]}),r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Elapsed"}),r.jsx("dd",{children:ue.elapsedLabel})]}),r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Last"}),r.jsx("dd",{children:ue.lastActivityLabel})]})]}),Z.length>0||Ft?r.jsx(vr,{steps:Z,phase:Ft,limit:5,compact:!0}):r.jsx(Cr,{events:Me,limit:4,compact:!0}),r.jsx(Mr,{onOpenTrace:xs,onOpenTerminal:ks,onSteer:Dt,compact:!0})]})]})]})})}),ln&&Tt>0&&r.jsxs("button",{type:"button",className:"s-thread-new-messages",onClick:Bn,children:[r.jsx("span",{"aria-hidden":"true",children:"↓"})," ",Tt," new ",Tt===1?"message":"messages"," · jump to latest"]}),r.jsx("div",{ref:us})]}),j.showTyping&&r.jsxs("div",{className:In,children:[r.jsx("div",{className:"s-thread-presence-line-avatars",children:r.jsx(es,{agent:V??void 0,name:F,placement:"turn",size:22,className:"s-thread-presence-line-avatar",title:F})}),r.jsx("span",{className:"s-thread-presence-line-label",children:$n}),r.jsx("div",{className:jn,"aria-hidden":"true"})]}),r.jsx(ha,{composeRef:A,draft:I,setDraft:P,composePlaceholder:Xn,slashState:ce,setSlashState:Fe,filteredSlashCommands:fn,applySlashCommand:wn,mentionState:de,setMentionState:Oe,filteredMentions:gn,applyMention:Sn,updateTriggersFromDraft:bn,closeSuggestions:yn,replyTarget:ie,onCancelReply:Gn,isStopMode:Zn,sending:W,composeAction:Yn,onSend:()=>{Kn()},onInterrupt:()=>{Qt()},attachments:he,isAgentBusy:fe,busyIntent:Is,onBusyIntentChange:ct,queued:pe,queueNote:ea,onEditQueued:Vn,editingQueuedId:Se?.id??null,editingAttachmentCount:Rs.length,onCancelEdit:zn,onUnqueue:Qn,onSendQueuedNow:e=>{Jn(e)}})]})})}function ss(){return r.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("polyline",{points:"9 14 4 9 9 4"}),r.jsx("path",{d:"M20 20v-7a4 4 0 0 0-4-4H4"})]})}const hi=lr({id:"thread",label:"Thread",route:{view:"conversation",conversationId:""},webPath:"/chat",screen:"ConversationScreen",embed:{path:"/embed/thread",profile:"macos.thread",rootClassName:"s-thread-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:er}});export{mi as ConversationScreen,hi as scoutSurface};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.cw-root{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:var(--space-lg);padding:var(--space-xl) var(--space-2xl) var(--space-6xl)}.cw-toolbar{flex:none;display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-sm)}.cw-modeToggle{display:flex;align-items:center;gap:2px;padding:2px;border:1px solid var(--pi-hairline);border-radius:9px;background:color-mix(in srgb,var(--hud-surface) 40%,transparent)}.cw-modeToggle button{display:flex;align-items:center;gap:6px;height:26px;padding:0 10px;border:none;border-radius:7px;background:transparent;color:var(--pi-dim);font-size:var(--text-xs);font-weight:600;cursor:pointer;transition:background .15s var(--pi-ease),color .15s var(--pi-ease)}.cw-modeToggle button:hover{color:var(--pi-muted)}.cw-modeToggle button[data-active]{background:color-mix(in srgb,var(--hud-ink) 10%,transparent);color:var(--pi-ink);box-shadow:inset 0 0 0 1px var(--pi-hairline-strong)}.cw-search{flex:1 1 220px;min-width:180px;max-width:360px;display:flex;align-items:center;gap:7px;height:30px;padding:0 10px;border:1px solid var(--pi-hairline);border-radius:8px;background:color-mix(in srgb,var(--hud-surface) 34%,transparent);color:var(--pi-dim)}.cw-search input{flex:1;min-width:0;border:none;background:transparent;color:var(--pi-ink);font-size:var(--text-sm);font-family:var(--pi-sans)}.cw-search input:focus{outline:none}.cw-search input::placeholder{color:var(--pi-dim)}.cw-filters{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.cw-filtersIcon{color:var(--pi-dim);margin-right:2px}.cw-filters button{height:26px;padding:0 10px;border:1px solid var(--pi-hairline);border-radius:999px;background:color-mix(in srgb,var(--hud-surface) 30%,transparent);color:var(--pi-dim);font-size:var(--text-2xs);font-weight:600;letter-spacing:.01em;cursor:pointer;transition:background .15s var(--pi-ease),color .15s var(--pi-ease),border-color .15s var(--pi-ease)}.cw-filters button:hover{color:var(--pi-muted);border-color:var(--pi-hairline-strong)}.cw-filters button[data-active]{background:color-mix(in srgb,var(--pi-accent) 16%,transparent);border-color:color-mix(in srgb,var(--pi-accent) 40%,var(--pi-hairline));color:var(--pi-ink)}.cw-harnessSelect{display:flex;align-items:center;height:26px;padding:0 8px;border:1px solid var(--pi-hairline);border-radius:999px;background:color-mix(in srgb,var(--hud-surface) 30%,transparent)}.cw-harnessSelect select{border:none;background:transparent;color:var(--pi-muted);font-size:var(--text-2xs);font-weight:600}.cw-harnessSelect select:focus{outline:none}.cw-addProject{margin-left:auto;display:flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:1px solid var(--pi-hairline);border-radius:8px;background:color-mix(in srgb,var(--hud-surface) 34%,transparent);color:var(--pi-muted);font-size:var(--text-xs);font-weight:600;cursor:pointer;transition:background .15s var(--pi-ease),color .15s var(--pi-ease)}.cw-addProject:hover{color:var(--pi-ink);border-color:var(--pi-hairline-strong)}.cw-digest{flex:none;display:flex;align-items:center;gap:6px;color:var(--pi-dim);font-size:var(--text-xs);font-family:var(--pi-mono)}.cw-digest span[data-tone=live]{color:color-mix(in srgb,var(--pi-accent) 78%,var(--pi-ink))}.cw-digest span[data-tone=needs]{color:color-mix(in srgb,#d9a441 82%,var(--pi-ink));font-weight:650}.cw-digestSep{opacity:.5}.cw-empty{padding:48px 12px;text-align:center;color:var(--pi-dim);font-size:var(--text-sm)}.cw-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:var(--space-lg)}.cw-card{display:flex;flex-direction:column;gap:var(--space-md);padding:var(--space-lg);border:1px solid var(--pi-hairline);border-radius:12px;background:linear-gradient(180deg,color-mix(in srgb,white 2.5%,transparent),transparent 40%),color-mix(in srgb,var(--hud-surface) 30%,transparent);transition:border-color .16s var(--pi-ease),transform .16s var(--pi-ease),background .16s var(--pi-ease)}.cw-card:hover{border-color:var(--pi-hairline-strong);transform:translateY(-1px)}.cw-card[data-status=needs]{border-color:color-mix(in srgb,#d9a441 45%,var(--pi-hairline))}.cw-card[data-status=working]{border-color:color-mix(in srgb,var(--pi-accent) 32%,var(--pi-hairline))}.cw-cardHead{display:flex;align-items:flex-start;gap:var(--space-md)}.cw-cardIdentity{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.cw-cardNameRow{display:flex;align-items:center;gap:8px;min-width:0}.cw-cardNameRow b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-ink);font-size:var(--text-md);font-weight:650}.cw-statusPill{flex:none;padding:2px 8px;border-radius:999px;font-size:var(--text-2xs);font-weight:650;letter-spacing:.01em;color:var(--pi-dim);background:color-mix(in srgb,var(--hud-ink) 8%,transparent);box-shadow:inset 0 0 0 1px var(--pi-hairline)}.cw-statusPill[data-status=needs]{color:color-mix(in srgb,#d9a441 88%,var(--pi-ink));background:color-mix(in srgb,#d9a441 14%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,#d9a441 40%,transparent)}.cw-statusPill[data-status=working]{color:color-mix(in srgb,var(--pi-accent) 84%,var(--pi-ink));background:color-mix(in srgb,var(--pi-accent) 12%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--pi-accent) 32%,transparent)}.cw-statusPill[data-status=thinking]{color:color-mix(in srgb,#6fb7c7 86%,var(--pi-ink));background:color-mix(in srgb,#6fb7c7 12%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,#6fb7c7 32%,transparent)}.cw-cardSubline{display:flex;align-items:center;gap:6px;min-width:0;color:var(--pi-muted);font-size:var(--text-xs)}.cw-headline{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-kernelPill{flex:none;overflow:hidden;max-width:150px;text-overflow:ellipsis;white-space:nowrap;padding:1px 7px;border-radius:999px;border:1px solid var(--pi-hairline);color:var(--pi-dim);font-family:var(--pi-mono);font-size:var(--text-2xs)}.cw-substrates{display:flex;flex-wrap:wrap;gap:6px}.cw-substrateChip{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border:1px solid var(--pi-hairline);border-radius:999px;background:color-mix(in srgb,var(--hud-surface) 26%,transparent);color:var(--pi-muted);font-size:var(--text-2xs);cursor:pointer;transition:border-color .15s var(--pi-ease),color .15s var(--pi-ease)}.cw-substrateChip:hover{border-color:var(--pi-hairline-strong);color:var(--pi-ink)}.cw-substrateChip[data-primary]{color:var(--pi-ink);background:color-mix(in srgb,var(--hud-ink) 6%,transparent)}.cw-substrateChip[data-live]{border-color:color-mix(in srgb,var(--pi-accent) 34%,var(--pi-hairline))}.cw-substrateChip em{font-style:normal;color:var(--pi-dim);font-family:var(--pi-mono)}.cw-work{display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-md);padding-top:var(--space-2xs);border-top:1px solid var(--pi-hairline)}.cw-work p{flex:1;min-width:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-ink);font-size:var(--text-sm)}.cw-work time{flex:none;color:var(--pi-dim);font-size:var(--text-2xs);font-family:var(--pi-mono)}.cw-cardActions{display:flex;gap:6px}.cw-cardActions button{flex:1;display:flex;align-items:center;justify-content:center;gap:5px;height:26px;border:1px solid var(--pi-hairline);border-radius:7px;background:transparent;color:var(--pi-muted);font-size:var(--text-2xs);font-weight:600;cursor:pointer;transition:background .15s var(--pi-ease),color .15s var(--pi-ease),border-color .15s var(--pi-ease)}.cw-cardActions button:hover{color:var(--pi-ink);border-color:var(--pi-hairline-strong);background:color-mix(in srgb,var(--hud-ink) 5%,transparent)}.cw-coordStrip{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.cw-runtimeBadge{display:inline-flex;align-items:center;gap:5px;padding:2px 7px;border:1px solid var(--pi-hairline);border-radius:6px;background:color-mix(in srgb,var(--hud-surface) 36%,transparent);color:var(--pi-muted);font-size:var(--text-2xs);font-family:var(--pi-mono)}.cw-runtimeBadge span{color:var(--pi-ink);font-weight:600}.cw-runtimeBadge i{font-style:normal;color:var(--pi-dim)}.cw-runtimeBadge em{font-style:normal;padding:0 4px;border-radius:3px;background:color-mix(in srgb,var(--hud-ink) 8%,transparent);color:var(--pi-dim);font-size:10px}.cw-workspaceList{display:flex;flex-direction:column;gap:var(--space-md)}.cw-workspace{border:1px solid var(--pi-hairline);border-radius:12px;background:color-mix(in srgb,var(--hud-surface) 24%,transparent);overflow:hidden}.cw-workspace[data-state=needs]{border-color:color-mix(in srgb,#d9a441 40%,var(--pi-hairline))}.cw-workspace[data-state=live]{border-color:color-mix(in srgb,var(--pi-accent) 28%,var(--pi-hairline))}.cw-workspaceHead{width:100%;display:flex;align-items:center;gap:var(--space-lg);padding:var(--space-md) var(--space-lg);border:none;background:transparent;color:inherit;text-align:left;cursor:pointer;transition:background .15s var(--pi-ease)}.cw-workspaceHead:hover{background:color-mix(in srgb,var(--hud-ink) 4%,transparent)}.cw-workspaceTitle{flex:none;display:flex;align-items:center;gap:6px;color:var(--pi-ink);font-size:var(--text-md);font-weight:650}.cw-workspaceRoot{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-dim);font-family:var(--pi-mono);font-size:var(--text-xs)}.cw-workspaceMeta{flex:none;display:flex;align-items:center;gap:10px;color:var(--pi-dim);font-size:var(--text-xs)}.cw-workspaceMeta b{font-weight:650;color:var(--pi-muted)}.cw-workspaceMeta b[data-tone=needs]{color:color-mix(in srgb,#d9a441 85%,var(--pi-ink))}.cw-workspaceMeta b[data-tone=live]{color:color-mix(in srgb,var(--pi-accent) 82%,var(--pi-ink))}.cw-workspaceMeta time{font-family:var(--pi-mono)}.cw-workspaceCrew{display:flex;flex-wrap:wrap;gap:6px;padding:0 var(--space-lg) var(--space-md)}.cw-workspaceCrewEmpty{padding:0 var(--space-lg) var(--space-md);color:var(--pi-dim);font-size:var(--text-xs)}.cw-crewChip{display:inline-flex;align-items:center;gap:6px;padding:3px 9px 3px 4px;border:1px solid var(--pi-hairline);border-radius:999px;background:color-mix(in srgb,var(--hud-surface) 30%,transparent);color:var(--pi-muted);font-size:var(--text-2xs);cursor:pointer;transition:border-color .15s var(--pi-ease),color .15s var(--pi-ease)}.cw-crewChip:hover{border-color:var(--pi-hairline-strong);color:var(--pi-ink)}.cw-crewChip[data-status=needs]{border-color:color-mix(in srgb,#d9a441 40%,var(--pi-hairline))}.cw-crewChip[data-status=working]{border-color:color-mix(in srgb,var(--pi-accent) 32%,var(--pi-hairline))}.cw-crewChipName{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-ink);font-weight:600}.cw-crewChip em{font-style:normal;color:var(--pi-dim);font-family:var(--pi-mono)}.cw-runtimeList{display:flex;flex-direction:column;gap:var(--space-md)}.cw-runtimeRow{border:1px solid var(--pi-hairline);border-radius:12px;background:color-mix(in srgb,var(--hud-surface) 24%,transparent);overflow:hidden;transition:border-color .15s var(--pi-ease)}.cw-runtimeRow[data-state=needs]{border-color:color-mix(in srgb,#d9a441 40%,var(--pi-hairline))}.cw-runtimeRow[data-state=live]{border-color:color-mix(in srgb,var(--pi-accent) 28%,var(--pi-hairline))}.cw-runtimeHead{display:flex;align-items:center;justify-content:space-between;gap:var(--space-lg);padding:var(--space-md) var(--space-lg);background:color-mix(in srgb,var(--hud-surface) 18%,transparent);border-bottom:1px solid var(--pi-hairline)}.cw-runtimeTitle{display:flex;align-items:center;gap:8px;color:var(--pi-ink);font-size:var(--text-md);font-weight:650}.cw-runtimeHarnessIcon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:6px;background:color-mix(in srgb,var(--hud-surface) 40%,transparent);border:1px solid var(--pi-hairline);color:var(--pi-ink)}.cw-runtimeHarnessSlug{font-family:var(--pi-mono);font-size:var(--text-xs);color:var(--pi-dim);font-weight:400;padding:1px 6px;border-radius:4px;background:color-mix(in srgb,var(--hud-ink) 6%,transparent)}.cw-runtimeMeta{flex:none;display:flex;align-items:center;gap:10px;color:var(--pi-dim);font-size:var(--text-xs)}.cw-runtimeMeta b{font-weight:650;color:var(--pi-muted)}.cw-runtimeMeta b[data-tone=needs]{color:color-mix(in srgb,#d9a441 85%,var(--pi-ink))}.cw-runtimeMeta b[data-tone=live]{color:color-mix(in srgb,var(--pi-accent) 82%,var(--pi-ink))}.cw-runtimeMeta time{font-family:var(--pi-mono)}.cw-runtimeCrew{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:var(--space-sm);padding:var(--space-md) var(--space-lg)}.cw-runtimeCrewEmpty{padding:var(--space-md) var(--space-lg);color:var(--pi-dim);font-size:var(--text-xs)}.cw-runtimeCrewChip{display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--pi-hairline);border-radius:9px;background:color-mix(in srgb,var(--hud-surface) 32%,transparent);color:var(--pi-muted);text-align:left;cursor:pointer;transition:border-color .15s var(--pi-ease),background .15s var(--pi-ease),transform .15s var(--pi-ease)}.cw-runtimeCrewChip:hover{border-color:var(--pi-hairline-strong);background:color-mix(in srgb,var(--hud-surface) 44%,transparent);color:var(--pi-ink);transform:translateY(-1px)}.cw-runtimeCrewChip[data-status=needs]{border-color:color-mix(in srgb,#d9a441 40%,var(--pi-hairline))}.cw-runtimeCrewChip[data-status=working]{border-color:color-mix(in srgb,var(--pi-accent) 32%,var(--pi-hairline))}.cw-runtimeCrewChipText{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-runtimeCrewChipTop{display:flex;align-items:center;justify-content:space-between;gap:6px}.cw-runtimeCrewChipName{font-size:var(--text-xs);font-weight:650;color:var(--pi-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-runtimeCrewChipStatus{font-size:10px;font-family:var(--pi-mono);color:var(--pi-dim)}.cw-runtimeCrewChipStatus[data-status=needs]{color:color-mix(in srgb,#d9a441 85%,var(--pi-ink))}.cw-runtimeCrewChipStatus[data-status=working]{color:color-mix(in srgb,var(--pi-accent) 80%,var(--pi-ink))}.cw-runtimeCrewChipSub{display:flex;align-items:center;gap:6px;font-size:11px}.cw-runtimeCrewChipProject{color:var(--pi-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-runtimeCrewChipModel{font-family:var(--pi-mono);font-size:10px;padding:0 4px;border-radius:3px;background:color-mix(in srgb,var(--hud-ink) 7%,transparent);color:var(--pi-dim)}@media(max-width:720px){.cw-toolbar{flex-direction:column;align-items:stretch}.cw-addProject{margin-left:0}.cw-grid{grid-template-columns:1fr}.cw-workspaceHead{flex-wrap:wrap}.cw-workspaceRoot{flex:1 1 100%;order:3}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G as q,C as O,r as p,j as s}from"./index-CZ-05hKz.js";import{A as C}from"./AgentAvatar-CYhf6twS.js";import{H as F}from"./HarnessMark-D5CA5uSp.js";import{t as N}from"./time-Dhsh_2EG.js";import{o as K}from"./model-IGCUEsMy.js";import{s as Q}from"./project-overview-helpers-BQTc_Ous.js";import{F as D,A as V}from"./AddProjectForm-CcD6qvV8.js";import{a as J}from"./agent-specialization-BIPIBW8u.js";import{c as b}from"./createLucideIcon-DXpqZP7I.js";import{C as X}from"./cpu-BjVis9mc.js";import{S as Y}from"./search-D1tJSAWe.js";import{S as Z}from"./sliders-horizontal-BPSMHhbm.js";import{M as ee}from"./message-square-D9YYWE0x.js";import{F as A}from"./DocumentFocusViewer-DZVhS7as.js";const se=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],te=b("rows-3",se);const ne=[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]],re=b("telescope",ne);const ae=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],ie=b("users",ae);function ce(e){return e.agentId?`agent:${e.agentId}`:`named:${e.harness}:${e.agentName.toLowerCase()}`}function le(e,a,r){return e?"needs":(r??"").toLowerCase().includes("think")?"thinking":a?"working":"idle"}function T(e){switch(e.status){case"needs":return 3;case"working":return 2;case"thinking":return 1;case"idle":return 0}}function oe(e,a){const r=new Map;for(const t of e){if(t.kind!=="agent")continue;const i=ce(t),o={threadId:t.id,projectSlug:t.projectSlug,projectTitle:t.projectTitle,projectRoot:t.projectRoot,branch:t.branch,working:t.working,needs:t.needs,lastActivityAt:t.lastActivityAt,sessionCount:t.sessionCount,work:t.work,conversationId:t.conversationId},l=r.get(i);if(l){l.substrates.push(o),l.needs=l.needs||t.needs,l.working=l.working||t.working,l.lastActivityAt=Math.max(l.lastActivityAt,t.lastActivityAt),l.sessionCount+=t.sessionCount;continue}const m=t.agentId?a.get(t.agentId)??null:null,d=q(t.agentName,!0)??"milo",h=m?J(m).headline:"Generalist";r.set(i,{key:i,agentId:t.agentId,name:t.agentName,harness:t.harness,model:m?.model??null,effort:m?.reasoningEffort??null,castSlug:d,kernel:O[d]?.kernel??null,headline:h,status:"idle",needs:t.needs,working:t.working,substrates:[o],primary:o,lastActivityAt:t.lastActivityAt,sessionCount:t.sessionCount,rawState:m?.state??null})}const n=[...r.values()].map(t=>{const i=[...t.substrates].sort((m,d)=>Number(d.working)-Number(m.working)||Number(d.needs)-Number(m.needs)||d.lastActivityAt-m.lastActivityAt),{rawState:o,...l}=t;return{...l,substrates:i,primary:i[0]??t.primary,status:le(t.needs,t.working,o)}});return n.sort((t,i)=>T(i)-T(t)||i.lastActivityAt-t.lastActivityAt||t.name.localeCompare(i.name)),n}function de(e,a){const r=new Map;for(const n of e)for(const t of n.substrates){const i=r.get(t.projectSlug)??[];i.push({member:n,substrate:t}),r.set(t.projectSlug,i)}return a.map(n=>{const t=(r.get(n.slug)??[]).sort((i,o)=>Number(o.substrate.working)-Number(i.substrate.working)||Number(o.substrate.needs)-Number(i.substrate.needs)||o.substrate.lastActivityAt-i.substrate.lastActivityAt);return{slug:n.slug,title:n.title,root:n.root,crew:t,needs:n.needs,working:n.working,agentCount:n.agentCount,sessionCount:n.sessionCount,lastActivityAt:n.lastActivityAt}}).sort((n,t)=>+(t.needs>0)-+(n.needs>0)||+(t.working>0)-+(n.working>0)||t.lastActivityAt-n.lastActivityAt||n.title.localeCompare(t.title))}function ue(e){const a=new Map;for(const r of e){const n=r.harness.toLowerCase(),t=a.get(n)??[];t.push({member:r,substrate:r.primary}),a.set(n,t)}return[...a.entries()].map(([r,n])=>{const t=n.sort((h,u)=>+(u.member.status==="needs")-+(h.member.status==="needs")||+(u.member.status==="working")-+(h.member.status==="working")||u.member.lastActivityAt-h.member.lastActivityAt||h.member.name.localeCompare(u.member.name)),i=t.filter(h=>h.member.status==="needs").length,o=t.filter(h=>h.member.status==="working"||h.member.status==="thinking").length,l=t.reduce((h,u)=>h+u.member.sessionCount,0),m=t.reduce((h,u)=>Math.max(h,u.member.lastActivityAt),0),d=r?r.charAt(0).toUpperCase()+r.slice(1):"Unknown";return{harness:r,title:d,crew:t,needs:i,working:o,agentCount:t.length,sessionCount:l,lastActivityAt:m}}).sort((r,n)=>+(n.needs>0)-+(r.needs>0)||+(n.working>0)-+(r.working>0)||n.lastActivityAt-r.lastActivityAt||r.title.localeCompare(n.title))}function k(e,a){switch(a){case"all":return!0;case"active":return e.status==="working"||e.status==="thinking";case"needs":return e.status==="needs";case"idle":return e.status==="idle"}}function y(e,a){return a==="all"||e.harness.toLowerCase()===a.toLowerCase()}function v(e,a){const r=a.trim().toLowerCase();return!r||e.name.toLowerCase().includes(r)||e.headline.toLowerCase().includes(r)||e.harness.toLowerCase().includes(r)||e.model?.toLowerCase().includes(r)||e.castSlug.toLowerCase().includes(r)?!0:e.substrates.some(n=>n.projectTitle.toLowerCase().includes(r)||n.work.toLowerCase().includes(r))}function he(e){return[...new Set(e.map(a=>a.harness.toLowerCase()))].sort()}function S(e){switch(e){case"needs":return"Needs attention";case"working":return"Working";case"thinking":return"Thinking";case"idle":return"Idle"}}const me=[{id:"all",label:"All"},{id:"active",label:"Active"},{id:"needs",label:"Needs attention"},{id:"idle",label:"Idle"}];function f(e){return e?e.charAt(0).toUpperCase()+e.slice(1):"Harness"}function pe(e,a){if(a?.conversationId){e({view:"conversation",conversationId:a.conversationId});return}e({view:"messages"})}function we(e,a){e({view:"code",project:a})}function M(e,a,r){r&&e(K(a,r))}function P(e,a,r){e({view:"agents-v2",projectSlug:r,...a.machineId?{machineId:a.machineId}:{},...a.showEphemeral?{showEphemeral:!0}:{}})}function je({model:e,agents:a,route:r,navigate:n,nowMs:t}){const[i,o]=p.useState("crew"),[l,m]=p.useState("all"),[d,h]=p.useState("all"),[u,_]=p.useState(""),[$,L]=p.useState(!1),W=p.useMemo(()=>new Map(a.map(c=>[c.id,c])),[a]),w=p.useMemo(()=>oe(e.threads,W),[e.threads,W]),x=p.useMemo(()=>de(w,e.projects),[w,e.projects]),g=p.useMemo(()=>ue(w),[w]),E=p.useMemo(()=>he(w),[w]),G=p.useMemo(()=>w.filter(c=>k(c,l)&&y(c,d)&&v(c,u)),[w,l,d,u]),U=p.useMemo(()=>x.map(c=>({...c,crew:c.crew.filter(j=>k(j.member,l)&&y(j.member,d)&&v(j.member,u))})).filter(c=>c.crew.length>0||l==="all"&&d==="all"&&!u.trim()),[x,l,d,u]),B=p.useMemo(()=>g.map(c=>({...c,crew:c.crew.filter(j=>k(j.member,l)&&y(j.member,d)&&v(j.member,u))})).filter(c=>c.crew.length>0||l==="all"&&d==="all"&&!u.trim()),[g,l,d,u]),z=w.filter(c=>c.status==="needs").length,R=w.filter(c=>c.status==="working"||c.status==="thinking").length;return s.jsxs("main",{className:"cw-root","aria-label":"Crew and workspaces",children:[s.jsxs("div",{className:"cw-toolbar",children:[s.jsxs("div",{className:"cw-modeToggle",role:"group","aria-label":"View mode",children:[s.jsxs("button",{type:"button","data-active":i==="crew"||void 0,onClick:()=>o("crew"),title:"Personas & Agent Crew matrix",children:[s.jsx(ie,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Crew (Personas)"]}),s.jsxs("button",{type:"button","data-active":i==="workspace"||void 0,onClick:()=>o("workspace"),title:"Group by repository workspace",children:[s.jsx(te,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Workspace lens"]}),s.jsxs("button",{type:"button","data-active":i==="runtime"||void 0,onClick:()=>o("runtime"),title:"Group by runtime engine and models",children:[s.jsx(X,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Runtime engines"]})]}),s.jsxs("label",{className:"cw-search",role:"search",children:[s.jsx(Y,{size:13,strokeWidth:1.8,"aria-hidden":!0}),s.jsx("input",{type:"search",value:u,placeholder:"Find persona, runtime, workspace, or task","aria-label":"Find persona, runtime, workspace, or task",onChange:c=>_(c.currentTarget.value)})]}),s.jsxs("div",{className:"cw-filters","aria-label":"Status filter",children:[s.jsx(Z,{size:12,strokeWidth:1.9,"aria-hidden":!0,className:"cw-filtersIcon"}),me.map(c=>s.jsx("button",{type:"button","data-active":l===c.id||void 0,onClick:()=>m(c.id),children:c.label},c.id))]}),s.jsxs("label",{className:"cw-harnessSelect",title:"Filter by runtime",children:[s.jsx("span",{className:"pi-srOnly",children:"Filter by runtime"}),s.jsxs("select",{value:d,onChange:c=>h(c.currentTarget.value),children:[s.jsx("option",{value:"all",children:"All runtimes"}),E.map(c=>s.jsx("option",{value:c,children:f(c)},c))]})]}),s.jsxs("button",{type:"button",className:"cw-addProject","aria-expanded":$,onClick:()=>L(c=>!c),children:[s.jsx(D,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Add project"]})]}),$?s.jsx(V,{onClose:()=>L(!1)}):null,s.jsxs("div",{className:"cw-digest",children:[s.jsxs("span",{children:[w.length," personas"]}),s.jsx("span",{className:"cw-digestSep",children:"·"}),s.jsxs("span",{"data-tone":R>0?"live":void 0,children:[R," moving"]}),z>0?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"cw-digestSep",children:"·"}),s.jsxs("span",{"data-tone":"needs",children:[z," needs you"]})]}):null,s.jsx("span",{className:"cw-digestSep",children:"·"}),s.jsxs("span",{children:[e.projects.length," workspaces"]}),s.jsx("span",{className:"cw-digestSep",children:"·"}),s.jsxs("span",{children:[g.length," runtimes"]})]}),i==="crew"?s.jsx(ge,{members:G,route:r,navigate:n,nowMs:t,allEmpty:w.length===0}):i==="workspace"?s.jsx(ke,{workspaces:U,route:r,navigate:n,nowMs:t,allEmpty:x.length===0}):s.jsx(fe,{runtimes:B,route:r,navigate:n,nowMs:t,allEmpty:g.length===0})]})}function ge({members:e,route:a,navigate:r,nowMs:n,allEmpty:t}){return e.length===0?s.jsx("div",{className:"cw-empty",children:t?"No crew members are registered yet.":"No crew members match these filters."}):s.jsx("div",{className:"cw-grid",children:e.map(i=>s.jsx(xe,{member:i,route:a,navigate:r,nowMs:n},i.key))})}function xe({member:e,route:a,navigate:r,nowMs:n}){const t=e.primary,i=e.substrates.filter(o=>o.threadId!==t.threadId);return s.jsxs("article",{className:"cw-card","data-status":e.status,children:[s.jsxs("header",{className:"cw-cardHead",children:[s.jsx(C,{agent:{name:e.name,harness:e.harness,state:I(e.status)},placement:"hero",size:46,presence:!0}),s.jsxs("div",{className:"cw-cardIdentity",children:[s.jsxs("div",{className:"cw-cardNameRow",children:[s.jsx("b",{title:e.name,children:e.name}),s.jsx("span",{className:"cw-statusPill","data-status":e.status,children:S(e.status)})]}),s.jsxs("div",{className:"cw-cardSubline",children:[s.jsx("span",{className:"cw-headline",children:e.headline}),e.kernel?s.jsx("span",{className:"cw-kernelPill",title:e.kernel,children:e.kernel}):null]})]})]}),s.jsx("div",{className:"cw-coordStrip",children:s.jsxs("div",{className:"cw-runtimeBadge",title:`Runtime: ${f(e.harness)}${e.model?` · ${e.model}`:""}${e.effort?` (${e.effort})`:""}`,children:[s.jsx(F,{harness:e.harness,size:11}),s.jsx("span",{children:f(e.harness)}),e.model?s.jsx("i",{children:e.model}):null,e.effort?s.jsx("em",{children:e.effort}):null]})}),s.jsxs("div",{className:"cw-substrates",children:[s.jsx(H,{substrate:t,route:a,navigate:r,primary:!0}),i.map(o=>s.jsx(H,{substrate:o,route:a,navigate:r},o.threadId))]}),s.jsxs("div",{className:"cw-work",children:[s.jsx("p",{title:t.work,children:t.work}),s.jsx("time",{children:t.lastActivityAt?N(t.lastActivityAt,n):"—"})]}),s.jsxs("footer",{className:"cw-cardActions",children:[s.jsxs("button",{type:"button",onClick:()=>pe(r,t),children:[s.jsx(ee,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Chat"]}),s.jsxs("button",{type:"button",onClick:()=>we(r,t.projectSlug),children:[s.jsx(A,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Browse code"]}),s.jsxs("button",{type:"button",onClick:()=>M(r,a,e.agentId),children:[s.jsx(re,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Inspect"]})]})]})}function I(e){switch(e){case"needs":return"needs_attention";case"working":return"in_turn";case"thinking":return"thinking";case"idle":return"idle"}}function H({substrate:e,route:a,navigate:r,primary:n=!1}){return s.jsxs("button",{type:"button",className:"cw-substrateChip","data-primary":n||void 0,"data-live":e.working||void 0,title:e.projectRoot??void 0,onClick:()=>P(r,a,e.projectSlug),children:[s.jsx(A,{size:11,strokeWidth:1.8,"aria-hidden":!0}),s.jsx("span",{children:e.projectTitle}),e.branch?s.jsxs("em",{children:["git: ",e.branch]}):null]})}function ke({workspaces:e,route:a,navigate:r,nowMs:n,allEmpty:t}){return e.length===0?s.jsx("div",{className:"cw-empty",children:t?"No projects are tracked yet.":"No workspaces match these filters."}):s.jsx("div",{className:"cw-workspaceList",children:e.map(i=>s.jsx(ye,{workspace:i,route:a,navigate:r,nowMs:n},i.slug))})}function ye({workspace:e,route:a,navigate:r,nowMs:n}){return s.jsxs("article",{className:"cw-workspace","data-state":e.needs>0?"needs":e.working>0?"live":void 0,children:[s.jsxs("button",{type:"button",className:"cw-workspaceHead",onClick:()=>P(r,a,e.slug),children:[s.jsxs("span",{className:"cw-workspaceTitle",children:[s.jsx(A,{size:13,strokeWidth:1.7,"aria-hidden":!0}),"/",e.title]}),s.jsx("span",{className:"cw-workspaceRoot",title:e.root??void 0,children:e.root?Q(e.root):"Discovered project"}),s.jsxs("span",{className:"cw-workspaceMeta",children:[e.needs>0?s.jsxs("b",{"data-tone":"needs",children:[e.needs," needs you"]}):null,e.working>0?s.jsxs("b",{"data-tone":"live",children:[e.working," moving"]}):null,s.jsxs("span",{children:[e.sessionCount," sessions"]}),s.jsx("time",{children:e.lastActivityAt?N(e.lastActivityAt,n):"no activity"})]})]}),e.crew.length>0?s.jsx("div",{className:"cw-workspaceCrew","aria-label":"Crew stationed here",children:e.crew.map(t=>s.jsx(ve,{station:t,route:a,navigate:r},`${e.slug}:${t.member.key}`))}):s.jsx("div",{className:"cw-workspaceCrewEmpty",children:"No crew stationed here."})]})}function ve({station:e,route:a,navigate:r}){const{member:n,substrate:t}=e;return s.jsxs("button",{type:"button",className:"cw-crewChip","data-status":n.status,onClick:()=>M(r,a,n.agentId),title:`${n.name} (${n.headline}) · ${t.work}`,children:[s.jsx(C,{agent:{name:n.name,harness:n.harness,state:I(n.status)},size:22,presence:!0}),s.jsx("span",{className:"cw-crewChipName",children:n.name}),s.jsx("span",{className:"cw-crewChipStatus","data-status":n.status,children:S(n.status)}),t.branch?s.jsxs("span",{className:"cw-crewChipBranch",children:["git: ",t.branch]}):null]})}function fe({runtimes:e,route:a,navigate:r,nowMs:n,allEmpty:t}){return e.length===0?s.jsx("div",{className:"cw-empty",children:t?"No runtime engines are active.":"No runtimes match these filters."}):s.jsx("div",{className:"cw-runtimeList",children:e.map(i=>s.jsx(Ce,{runtime:i,route:a,navigate:r,nowMs:n},i.harness))})}function Ce({runtime:e,route:a,navigate:r,nowMs:n}){return s.jsxs("article",{className:"cw-runtimeRow","data-state":e.needs>0?"needs":e.working>0?"live":void 0,children:[s.jsxs("header",{className:"cw-runtimeHead",children:[s.jsxs("div",{className:"cw-runtimeTitle",children:[s.jsx("span",{className:"cw-runtimeHarnessIcon",children:s.jsx(F,{harness:e.harness,size:15})}),s.jsxs("b",{children:[e.title," Engine"]}),s.jsx("span",{className:"cw-runtimeHarnessSlug",children:e.harness})]}),s.jsxs("div",{className:"cw-runtimeMeta",children:[e.needs>0?s.jsxs("b",{"data-tone":"needs",children:[e.needs," needs you"]}):null,e.working>0?s.jsxs("b",{"data-tone":"live",children:[e.working," moving"]}):null,s.jsxs("span",{children:[e.agentCount," ",e.agentCount===1?"persona":"personas"]}),s.jsx("span",{className:"cw-digestSep",children:"·"}),s.jsxs("span",{children:[e.sessionCount," sessions"]}),s.jsx("time",{children:e.lastActivityAt?N(e.lastActivityAt,n):"no activity"})]})]}),e.crew.length>0?s.jsx("div",{className:"cw-runtimeCrew","aria-label":`Crew running on ${e.title}`,children:e.crew.map(t=>s.jsx(Ne,{station:t,route:a,navigate:r},`${e.harness}:${t.member.key}`))}):s.jsx("div",{className:"cw-runtimeCrewEmpty",children:"No crew running on this harness."})]})}function Ne({station:e,route:a,navigate:r}){const{member:n,substrate:t}=e;return s.jsxs("button",{type:"button",className:"cw-runtimeCrewChip","data-status":n.status,onClick:()=>M(r,a,n.agentId),title:`${n.name} (${n.headline}) · ${t.projectTitle} · ${t.work}`,children:[s.jsx(C,{agent:{name:n.name,harness:n.harness,state:I(n.status)},size:24,presence:!0}),s.jsxs("div",{className:"cw-runtimeCrewChipText",children:[s.jsxs("div",{className:"cw-runtimeCrewChipTop",children:[s.jsx("span",{className:"cw-runtimeCrewChipName",children:n.name}),s.jsx("span",{className:"cw-runtimeCrewChipStatus","data-status":n.status,children:S(n.status)})]}),s.jsxs("div",{className:"cw-runtimeCrewChipSub",children:[s.jsx("span",{className:"cw-runtimeCrewChipProject",children:t.projectTitle}),n.model?s.jsx("span",{className:"cw-runtimeCrewChipModel",children:n.model}):null]})]})]})}const _e=Object.freeze(Object.defineProperty({__proto__:null,CrewWorkspaces:je},Symbol.toStringTag,{value:"Module"}));export{je as C,ie as U,_e as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as s}from"./index-CZ-05hKz.js";import{a as k}from"./api-Co9aQ2Jw.js";import{u as R}from"./sse-CiOSzE5n.js";import{d as $,t as F}from"./time-Dhsh_2EG.js";import{SessionRefScreen as j}from"./SessionRefScreen-B_cTv47v.js";/* empty css */import{c as E}from"./createLucideIcon-DXpqZP7I.js";import{X as A}from"./x-e3h2hDsp.js";import"./perf-PX8Rx0EP.js";import"./index-BWHgHrtv.js";import"./tail-events-BMQmSx1n.js";import"./BackToPicker-4JaeRvDm.js";import"./router-DJj2WbDg.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./ConversationScreen-BNULZAp2.js";import"./NewChatComposer-hlWT-nbR.js";import"./text-CnZ0e1-V.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-BiohlpM3.js";import"./conversation-model-CwF6Y9gx.js";import"./colors-BtO5_zlx.js";import"./index-BVlMw8x_.js";import"./HarnessMark-D5CA5uSp.js";import"./NewChatOrigin-DdpzE4kz.js";import"./keyboard-nav-DFhAJkW3.js";import"./chevron-down-Mp9mu_yd.js";import"./search-D1tJSAWe.js";import"./file-text-KijGBnME.js";import"./ConversationComposer-2HjbGPL9.js";import"./AgentAvatar-CYhf6twS.js";import"./Provider-B2xuo3rf.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DZVhS7as.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./chevron-right-CzH-TaSF.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./arrow-right-iJFv3jNh.js";import"./chunk-HRAB3GC3-swV8PA2k.js";import"./SpriteAvatar-Bs68ZENy.js";import"./CrewAvatar-CTIuxp4G.js";import"./zap-nMcjPoWB.js";import"./message-markup-RkfmDfME.js";import"./mentions-CcPFMbmZ.js";import"./AgentDetailCard-UqPNpcvB.js";import"./AgentLiveActions-BwuzOE8h.js";import"./terminal-takeover-DANQfTcy.js";import"./openContent-C6XO6kr5.js";import"./eye-CpfyvdLq.js";import"./terminal-yN9xN-h9.js";import"./message-visibility-DwxgcgYK.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-C8vfXaTF.js";import"./AstronautSuit-Ckx7lu7G.js";import"./ConversationFeedRows-C6wUqJrx.js";import"./ConversationPanels-CNCIbpqU.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CKkhq9c5.js";import"./proxy-DnLpZIi9.js";import"./activity-Bj3Hnbj3.js";import"./message-circle-B2ddzBrX.js";import"./ConversationStatus-DZuyKsWN.js";import"./check-C18YQC90.js";import"./sparkles-Dy8p5xN8.js";import"./SessionObserve-Dsd0j05N.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-D_DMlBeT.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CdGUXxGR.js";import"./ObserveTextFlow-BSEtYTxU.js";import"./SessionObserveEvidence-DopQYDkD.js";import"./wrench-YcXMlsh2.js";import"./external-link-Ckiyzjwo.js";/* empty css */const T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],L=E("columns-2",T);function S(t){const o=new Map;for(const r of t)o.delete(r.sessionId),o.set(r.sessionId,r);return[...o.values()]}function M(t,o){const r=S(t),p=o?.trim()||null;return r.find(n=>n.sessionId===p)?.sessionId??r.at(-1)?.sessionId??p}function O(t){return t.length<=34?t:`${t.slice(0,15)}…${t.slice(-14)}`}function q(t,o){return o===0?t.strategy||"dispatch":t.strategy?`switched via ${t.strategy}`:"session changed"}function y({label:t,sessions:o,value:r,onChange:p}){return s.jsxs("label",{className:"s-flight-observe-select-wrap",children:[s.jsx("span",{children:t}),s.jsx("select",{className:"s-flight-observe-select",value:r,onChange:n=>p(n.currentTarget.value),children:o.map(n=>s.jsxs("option",{value:n.sessionId,children:[n.harness?`${n.harness} · `:"",n.sessionId]},n.sessionId))})]})}function fe({route:t,navigate:o}){const[r,p]=c.useState(null),[n,I]=c.useState(!0),[h,N]=c.useState(null),u=c.useCallback(async()=>{try{const e=await k(`/api/flights?active=false&flightId=${encodeURIComponent(t.flightId)}`);p(e[0]??null),N(e.length===0?"This flight is not available on the connected broker.":null)}catch(e){N(e instanceof Error?e.message:String(e))}finally{I(!1)}},[t.flightId]);c.useEffect(()=>{I(!0),u()},[u]),R(()=>{u()});const v=r?.sessions??[],a=c.useMemo(()=>S(v),[v]),g=M(v,t.sessionId),i=a.find(e=>e.sessionId===g)??null,l=a.find(e=>e.sessionId===t.compareSessionId)??null,f=!!(i&&l&&i.sessionId!==l.sessionId),m=c.useCallback((e,d)=>{o({...t,sessionId:e,...d?{compareSessionId:d}:{compareSessionId:void 0}})},[o,t]),w=c.useCallback(()=>{if(!i||a.length<2)return;const e=[...a].reverse().find(d=>d.sessionId!==i.sessionId);e&&m(i.sessionId,e.sessionId)},[i,a,m]),C=c.useCallback(e=>{if(!f||!i||!l){m(e);return}m(e,e===l.sessionId?i.sessionId:l.sessionId)},[l,i,f,m]);return s.jsxs("div",{className:"s-flight-observe",children:[s.jsxs("header",{className:"s-flight-observe-header",children:[s.jsxs("div",{className:"s-flight-observe-heading",children:[s.jsx("div",{className:"s-flight-observe-eyebrow",children:"Flight observe"}),s.jsxs("div",{className:"s-flight-observe-title-row",children:[s.jsx("h2",{children:r?.agentName||r?.agentId||"Flight"}),s.jsx("span",{className:`s-flight-observe-state s-flight-observe-state--${r?.state??"loading"}`,children:r?.state??(n?"loading":"unknown")})]}),s.jsx("div",{className:"s-flight-observe-id",title:t.flightId,children:t.flightId}),r?.summary&&s.jsx("p",{children:r.summary})]}),s.jsxs("div",{className:"s-flight-observe-actions",children:[a.length>1&&!f&&s.jsxs("button",{type:"button",onClick:w,children:[s.jsx(L,{size:13})," Split view"]}),f&&i&&s.jsxs("button",{type:"button",onClick:()=>m(i.sessionId),children:[s.jsx(A,{size:13})," Close split"]})]})]}),v.length>0&&s.jsx("nav",{className:"s-flight-observe-trace","aria-label":"Flight session history",children:v.map((e,d)=>{const b=i?.sessionId===e.sessionId,x=l?.sessionId===e.sessionId;return s.jsxs("div",{className:"s-flight-observe-trace-step",children:[d>0&&s.jsx("span",{className:"s-flight-observe-trace-arrow","aria-hidden":"true",children:"→"}),s.jsxs("button",{type:"button",className:"s-flight-observe-session-chip","data-selected":b||x,"data-observe-role":b?"primary":x?"compare":"idle","aria-pressed":b||x,title:e.sessionId,onClick:()=>C(e.sessionId),children:[s.jsxs("span",{className:"s-flight-observe-session-chip-top",children:[s.jsx("span",{children:e.harness||e.transport||"session"}),s.jsx("time",{title:new Date(e.startedAt).toLocaleString(),children:$(e.startedAt)||F(e.startedAt)})]}),s.jsx("strong",{children:O(e.sessionId)}),s.jsx("small",{children:q(e,d)})]})]},`${e.sessionId}:${e.startedAt}:${d}`)})}),h&&!g&&s.jsx("div",{className:"s-flight-observe-message s-flight-observe-message--error",children:h}),h&&g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Flight record unavailable"}),s.jsx("span",{children:"Showing the concrete session captured by this link."})]}),!h&&n&&s.jsx("div",{className:"s-flight-observe-message",children:"Resolving the flight’s session trace…"}),!h&&!n&&a.length===0&&!g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Waiting for a session"}),s.jsx("span",{children:"The flight is stable here; its trace will appear as soon as a harness acknowledges dispatch."})]}),g&&!f&&s.jsx("main",{className:"s-flight-observe-single",children:s.jsx(j,{sessionRef:g,navigate:o})}),!h&&i&&l&&f&&s.jsxs("main",{className:"s-flight-observe-split",children:[s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Primary session",sessions:a,value:i.sessionId,onChange:e=>m(e,e===l.sessionId?i.sessionId:l.sessionId)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(j,{sessionRef:i.sessionId,navigate:o,showObserveRail:!1})})]}),s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Compare session",sessions:a.filter(e=>e.sessionId!==i.sessionId),value:l.sessionId,onChange:e=>m(i.sessionId,e)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(j,{sessionRef:l.sessionId,navigate:o,showObserveRail:!1})})]})]})]})}export{fe as FlightObserveScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as a}from"./index-CZ-05hKz.js";import{i as w,a as C}from"./conversation-model-CwF6Y9gx.js";import{u as b,m as M,e as S}from"./Provider-B2xuo3rf.js";import{b as A}from"./router-DJj2WbDg.js";import{l as I,i as B,s as E}from"./sessionRead-CvFz2RHv.js";import{u as L}from"./use-conversation-list-D9BNLfnW.js";import{u as R}from"./use-fleet-active-asks-BeAdcl09.js";import{ConversationScreen as D}from"./ConversationScreen-BNULZAp2.js";import{P as O}from"./plus-CuU_X0-8.js";import"./createLucideIcon-DXpqZP7I.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./sse-CiOSzE5n.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DZVhS7as.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./file-text-KijGBnME.js";import"./x-e3h2hDsp.js";import"./chevron-right-CzH-TaSF.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./arrow-right-iJFv3jNh.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-DFhAJkW3.js";import"./NewChatComposer-hlWT-nbR.js";import"./text-CnZ0e1-V.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-BiohlpM3.js";import"./index-BVlMw8x_.js";import"./HarnessMark-D5CA5uSp.js";import"./NewChatOrigin-DdpzE4kz.js";import"./chevron-down-Mp9mu_yd.js";import"./search-D1tJSAWe.js";import"./chunk-HRAB3GC3-swV8PA2k.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./ConversationComposer-2HjbGPL9.js";import"./AgentAvatar-CYhf6twS.js";import"./SpriteAvatar-Bs68ZENy.js";import"./CrewAvatar-CTIuxp4G.js";import"./zap-nMcjPoWB.js";import"./message-markup-RkfmDfME.js";import"./mentions-CcPFMbmZ.js";import"./AgentDetailCard-UqPNpcvB.js";import"./AgentLiveActions-BwuzOE8h.js";import"./terminal-takeover-DANQfTcy.js";import"./openContent-C6XO6kr5.js";import"./eye-CpfyvdLq.js";import"./terminal-yN9xN-h9.js";import"./message-visibility-DwxgcgYK.js";import"./operator-attention-RqieiSY8.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-C8vfXaTF.js";import"./BackToPicker-4JaeRvDm.js";import"./AstronautSuit-Ckx7lu7G.js";import"./ConversationFeedRows-C6wUqJrx.js";import"./ConversationPanels-CNCIbpqU.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CKkhq9c5.js";import"./proxy-DnLpZIi9.js";import"./activity-Bj3Hnbj3.js";import"./message-circle-B2ddzBrX.js";import"./tail-events-BMQmSx1n.js";import"./ConversationStatus-DZuyKsWN.js";import"./check-C18YQC90.js";import"./sparkles-Dy8p5xN8.js";function rt({conversationId:s,navigate:c}){return s?e.jsx(D,{conversationId:s,navigate:c,showBackNav:!1}):e.jsx(P,{})}function P(){const{onlineCount:s,apiConnection:c,reload:j,route:N,agents:d,openContextCapture:k,navigate:u}=b(),{sessions:y,loading:p,loadError:i}=L(),[x]=a.useState(()=>I()),v=R(),t=c.status==="offline",n=A(N),f=a.useRef(!1),h=a.useMemo(()=>{const m=M(d,n);return[...S(y,m,n)].sort((g,o)=>(o.lastMessageAt??0)-(g.lastMessageAt??0))},[y,d,n]),r=a.useMemo(()=>{const m=h.filter(o=>!w(o));return m.find(o=>o.agentId?v.get(o.agentId)?.status==="needs_attention"&&B(o.lastMessageAt,o.id,x):!1)??m[0]},[h,v,x]);a.useEffect(()=>{f.current||p||i||t||r&&(f.current=!0,E(r.id),u({view:"messages",conversationId:r.id,...n?{machineId:n}:{}},{replace:!0}))},[r,p,i,t,n,u]);const l=!t&&!i&&(p||!!r);return e.jsx("div",{className:`s-conv-empty${t?" s-conv-empty--offline":""}`,children:e.jsxs("div",{className:"s-conv-empty-inner",children:[e.jsx($,{}),e.jsx("div",{className:"s-conv-empty-eyebrow",children:t?"Connection":"Conversations"}),e.jsx("p",{className:"s-conv-empty-title",children:t?"Scout server offline":l?"Opening your latest conversation":i?"Chats unavailable":"Nothing open yet"}),e.jsx("p",{className:"s-conv-empty-detail",children:t?"Start or restart Scout services. Chats and context will appear when the server responds.":l?V(r):i||"Start a chat by choosing an agent and sending the first message."}),t||i?e.jsx("button",{type:"button",className:"s-conv-empty-action",onClick:()=>{j()},children:"Retry connection"}):l?null:e.jsxs("button",{type:"button",className:"s-conv-empty-new",onClick:()=>k(),children:[e.jsx(O,{size:16,"aria-hidden":"true"}),"New chat"]}),e.jsxs("div",{className:"s-conv-empty-ambient",children:[e.jsx("span",{className:"s-conv-empty-ambient-dot","aria-hidden":"true"}),t?"waiting for server":`${s} ${s===1?"agent":"agents"} active`]})]})})}function V(s){return s?C(s):"Finding where you left off."}function $(){return e.jsxs("svg",{className:"s-conv-empty-mesh",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"14",y1:"20",x2:"36",y2:"12"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"36",y1:"12",x2:"58",y2:"24"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"14",y1:"20",x2:"24",y2:"46"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"24",y1:"46",x2:"36",y2:"12"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"24",y1:"46",x2:"50",y2:"54"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"50",y1:"54",x2:"58",y2:"24"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"36",y1:"12",x2:"50",y2:"54"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"14",cy:"20",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"58",cy:"24",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"24",cy:"46",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"50",cy:"54",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node s-conv-empty-mesh-node--accent",cx:"36",cy:"12",r:"3.5"})]})}export{rt as MessagesScreen};
|