@openscout/scout 0.2.80 → 0.2.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +4 -4
- package/dist/client/assets/ActivityScreen-aewI4Ul1.js +1 -0
- package/dist/client/assets/{AddProjectForm-CtEiLQnm.js → AddProjectForm-Czb5uwou.js} +1 -1
- package/dist/client/assets/{AgentAvatar-CszU5eaU.js → AgentAvatar-DMov24_o.js} +1 -1
- package/dist/client/assets/AgentConfigurationScreen-BjG6ECjl.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-D4MbSMXp.js +1 -0
- package/dist/client/assets/{AgentDetailCard-sZuHl1de.js → AgentDetailCard-Biq8b2gv.js} +1 -1
- package/dist/client/assets/AgentFloorView-h9KDJdw0.js +1 -0
- package/dist/client/assets/AgentInfoScreen-SjhK_SBh.js +1 -0
- package/dist/client/assets/{AgentLaneCard-nB68f2CI.js → AgentLaneCard-C4DMQR-c.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-O9Yf0uR-.js → AgentLaneChrome-D1xNNf7A.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-BfhpaEQ3.js → AgentLaneDetailSheet-DnAKe4e3.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-Ct3b0TQR.js → AgentLaneSummaryResize-C9loK-st.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-BNOYF16R.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-DNGvZvjd.js → AgentLanesPreflight-M7iDXdP2.js} +1 -1
- package/dist/client/assets/{AgentLanesView-DqRK5-d2.js → AgentLanesView-Ct-Gz5WD.js} +1 -1
- package/dist/client/assets/{AgentLiveActions-DI4ooSHW.js → AgentLiveActions-0iy8QZ1T.js} +1 -1
- package/dist/client/assets/{AgentSessions-BxWIPkWh.js → AgentSessions-CDfSfNiE.js} +2 -2
- package/dist/client/assets/{AgentsConsole-D6VHSCfZ.js → AgentsConsole-BVxhBqRa.js} +1 -1
- package/dist/client/assets/AgentsScreen-Bww6HgFs.js +1 -0
- package/dist/client/assets/AgentsSubnav-CiIuzxnZ.js +1 -0
- package/dist/client/assets/{AtopView-VZkk40v0.js → AtopView-h_aFoNkP.js} +1 -1
- package/dist/client/assets/BackToPicker-BXp5E2ck.js +1 -0
- package/dist/client/assets/{BriefingDetailScreen-BZU4qMwE.js → BriefingDetailScreen-C83o2YfN.js} +1 -1
- package/dist/client/assets/{BriefingsScreen-Bfc3tqPp.js → BriefingsScreen-BTsvr5fv.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-CaFe6kdh.js → BrokerMetadataPanel-jg7odHQp.js} +1 -1
- package/dist/client/assets/BrokerScreen-DplF8d_X.js +5 -0
- package/dist/client/assets/Canvas-BePL08RR.js +1 -0
- package/dist/client/assets/{ChatCollapsedStrip-Cov54p9V.js → ChatCollapsedStrip-BRljIymi.js} +1 -1
- package/dist/client/assets/{CodeDiffPane-C1ebFt-Y.js → CodeDiffPane-86odpBSt.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-tsCly-f3.js → CodeProjectPicker-8svr_S_A.js} +1 -1
- package/dist/client/assets/{CodeScreen-D0hpZNLP.js → CodeScreen-CJ2RgB32.js} +1 -1
- package/dist/client/assets/{ContextMenu-N-Z6X0Z1.js → ContextMenu-CxkmFQcN.js} +1 -1
- package/dist/client/assets/{ConversationComposer-CiEF7dhd.js → ConversationComposer-CWohCCmn.js} +1 -1
- package/dist/client/assets/ConversationFeedRows-IWh0JSIL.js +1 -0
- package/dist/client/assets/{ConversationHeader-BGgbITvr.js → ConversationHeader-BxTzXl8e.js} +1 -1
- package/dist/client/assets/ConversationPanels-D9UCwNkS.js +2 -0
- package/dist/client/assets/ConversationScreen-oZSitVtX.js +1 -0
- package/dist/client/assets/{ConversationStatus-COEj5loj.js → ConversationStatus-B6pAbo2w.js} +1 -1
- package/dist/client/assets/{DataTable-BoofV-_4.js → DataTable-CGw5CECG.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-OXYlMbT1.js → DispatchAftermath-DowTb7uO.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-BCG2kOmd.js → DocumentFocusViewer-DRKjNG9s.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-C2SZvrHJ.js → EmbeddableSurfacesLab-CxfJXS2g.js} +1 -1
- package/dist/client/assets/{EmptyState-DypEjx0V.js → EmptyState-BUvllvA6.js} +1 -1
- package/dist/client/assets/{FileViewerPane-CXCq-oKj.js → FileViewerPane-BM4AD_bo.js} +1 -1
- package/dist/client/assets/{FleetSearch-Dj7-CfNi.js → FleetSearch-CYeWn85V.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-DYJJ3Z2B.js +1 -0
- package/dist/client/assets/{FollowScreen-DRgYuAvp.js → FollowScreen-DG0osbUp.js} +1 -1
- package/dist/client/assets/{HarnessMark-BE-YSyci.js → HarnessMark-MztYnrGK.js} +1 -1
- package/dist/client/assets/HarnessesScreen-BWqirBjK.js +1 -0
- package/dist/client/assets/{HerdrSession-DKFCJMst.js → HerdrSession-6sFln7WX.js} +1 -1
- package/dist/client/assets/{HomeHero-CAEg8Yg5.js → HomeHero-BPBArHXa.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-C2EZsQ5i.js → KnowledgeSearchInspector-BOIhFWd2.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-BP8tD-Bh.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-DrPXYZvQ.js → LaneToolHoverCard-CcEiQC6B.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-B4i1Ut4R.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-X4-DDFEo.js → LaneTraceEventFocus-Bl9L0EYb.js} +1 -1
- package/dist/client/assets/{MeshCanvas-rtCBD7s6.js → MeshCanvas-ZjIuMiRo.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-CuvXOkc7.js → MeshCanvasMinimap-C-LQtiX6.js} +1 -1
- package/dist/client/assets/MeshScreen-Bs3soujg.js +1 -0
- package/dist/client/assets/{MeshTopologyView-CeTShs-U.js → MeshTopologyView-C0LUyT3K.js} +2 -2
- package/dist/client/assets/{MessageComposerSuggestions-Cs9u-F_3.js → MessageComposerSuggestions-Dfc3PH2y.js} +1 -1
- package/dist/client/assets/MessagesScreen-TgSL5KMc.js +1 -0
- package/dist/client/assets/{MissionContextRail-0O-Zu1Tn.js → MissionContextRail-CjGAEGu8.js} +1 -1
- package/dist/client/assets/MissionControlView-D629w2A8.js +1 -0
- package/dist/client/assets/{MissionFocusOverlay-LnjmqBiW.js → MissionFocusOverlay-Bubrr8Gc.js} +1 -1
- package/dist/client/assets/{MissionLeftAgentRow-nc1Jyq3D.js → MissionLeftAgentRow-DokImu4Y.js} +1 -1
- package/dist/client/assets/{MissionLogPane-lZ9vUftY.js → MissionLogPane-Cs0LuIkn.js} +1 -1
- package/dist/client/assets/{NewAgentModal-K1cvdmZr.js → NewAgentModal-D5e0YUAo.js} +1 -1
- package/dist/client/assets/{NewChatComposer-DXDxV2Mh.js → NewChatComposer-S08F6_La.js} +1 -1
- package/dist/client/assets/{NewChatOrigin-CnjoswTG.js → NewChatOrigin-BEz6jyqf.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-CRpzYf0Y.js → ObserveEmbedScreen-CHx2sEAA.js} +2 -2
- package/dist/client/assets/ObserveTextFlow-_ApDwRCO.js +2 -0
- package/dist/client/assets/{ObservedTopologyPanel-C1AQM0Mq.js → ObservedTopologyPanel-ByW7Ar7p.js} +1 -1
- package/dist/client/assets/OpenScoutAppShell-DTmnbG-h.js +88 -0
- package/dist/client/assets/OpsAgentsView-DiFuHcJs.js +1 -0
- package/dist/client/assets/OpsScreen-CCR3U_9P.js +1 -0
- package/dist/client/assets/OpsSubnav-CZs_OL2N.js +1 -0
- package/dist/client/assets/{PlanView-DDXdC19M.js → PlanView-C54eAzig.js} +1 -1
- package/dist/client/assets/ProjectAgentProfile-BEfYOaxc.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-MODhG0P6.js → ProjectAgentProfileBar-B1VpwzGD.js} +1 -1
- package/dist/client/assets/{ProjectAgentProfileHero-C1ImgGDu.js → ProjectAgentProfileHero-B4f_AoCr.js} +1 -1
- package/dist/client/assets/ProjectsInbox-DoPZ17FC.js +2 -0
- package/dist/client/assets/{ProjectsRail-B1zrQLZe.js → ProjectsRail-CWOkZjsY.js} +1 -1
- package/dist/client/assets/ProjectsScreen-Dse0Q6p6.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-DMnfyPLE.js +1 -0
- package/dist/client/assets/Provider-DKZWuzSR.js +1 -0
- package/dist/client/assets/{RailRow-DerXOXQS.js → RailRow-DIGd3MMM.js} +1 -1
- package/dist/client/assets/RawSessionsTable-Zkl4YDvz.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-B_PMJxY_.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-C9oLCcZX.js → RepoDiffEmbedScreen-VLg4caej.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-CGEMAv2Z.js → RepoDiffPageScreen-BelnvgnP.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-CB8PSVey.js → RepoDiffViewer-VrUJw33u.js} +1 -1
- package/dist/client/assets/RepoDiffViewerLazy-BPg_JkYW.js +2 -0
- package/dist/client/assets/{ReposScreen-BN1lVjOj.js → ReposScreen-IINK-CFn.js} +2 -2
- package/dist/client/assets/ScoutDeckSurface-MbwGp6Ab.js +1 -0
- package/dist/client/assets/{ScoutSurface-BEnDlynn.js → ScoutSurface-x_QbcRyk.js} +1 -1
- package/dist/client/assets/ScoutbotBroadcastChip-DAKQKB25.js +2 -0
- package/dist/client/assets/{ScoutbotFxLab-fAROyIfz.js → ScoutbotFxLab-7t9JVvZg.js} +1 -1
- package/dist/client/assets/{ScoutbotRealtimeVoiceCall-CDyFJX8m.js → ScoutbotRealtimeVoiceCall-Br4bYVAx.js} +1 -1
- package/dist/client/assets/{SecondaryNav-Hv5AJ3Fv.js → SecondaryNav-Dj30epYF.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-CDRpQc3g.js → SessionEmbedScreen-s2mJ5Fg9.js} +1 -1
- package/dist/client/assets/{SessionObserve-BmmJ8dEh.js → SessionObserve-DaUrJCMq.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-CEedIk2a.js → SessionObserveEvidence-ClUW8jpV.js} +1 -1
- package/dist/client/assets/SessionRefScreen-DLZNFZFK.js +1 -0
- package/dist/client/assets/SessionsScreen-D-hN1n4k.js +1 -0
- package/dist/client/assets/{SettingsDrawer-DL-SVLdd.js → SettingsDrawer-BFsnww-k.js} +3 -3
- package/dist/client/assets/SettingsScreen-Bc3Xtv5V.js +1 -0
- package/dist/client/assets/{ShikiPane-B7O4if20.js → ShikiPane-Dkwyx--r.js} +1 -1
- package/dist/client/assets/{SlidePanel-B3gc5HnM.js → SlidePanel-CuTeirnk.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-BpQDpOkq.js → SpriteAvatar-DQ3PTb8L.js} +1 -1
- package/dist/client/assets/{StatusPill-B33sQinT.js → StatusPill-BJ1ierIR.js} +1 -1
- package/dist/client/assets/{TailView-DL3YZkzE.js → TailView-CufWcrvf.js} +2 -2
- package/dist/client/assets/Terminal-D_OmdFmr.js +1 -0
- package/dist/client/assets/TerminalEmbedScreen-D21ytNXW.js +1 -0
- package/dist/client/assets/TerminalRelay-rvUzI9Ek.js +46 -0
- package/dist/client/assets/{TextDocumentSurface-DRjctOIt.js → TextDocumentSurface-Bc-kHPgG.js} +1 -1
- package/dist/client/assets/{TmuxPeek-DNC4uWky.js → TmuxPeek-DLyDkq_D.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-WLN0V-Xv.js → VoicePermissionsPanel-CD903y9K.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-D2Yl0mYZ.js → WorkDetailScreen-D51oI0dH.js} +2 -2
- package/dist/client/assets/{WorkFilesViewer-BbVfcUN-.js → WorkFilesViewer-BDMNbxE4.js} +1 -1
- package/dist/client/assets/{activity-BxwKkT8z.js → activity-BvGruxWG.js} +1 -1
- package/dist/client/assets/{addon-fit-B9O2vJoh.js → addon-fit-Cfq4Ayjd.js} +1 -1
- package/dist/client/assets/{addon-webgl-BhRZFDcn.js → addon-webgl-B8sIf9-s.js} +1 -1
- package/dist/client/assets/{agent-essentials-SrzMYEXV.js → agent-essentials-yb4wIJlX.js} +1 -1
- package/dist/client/assets/{agent-lane-card-model-DSWdGu-v.js → agent-lane-card-model-q4cwzLX4.js} +1 -1
- package/dist/client/assets/{agent-lanes-model-CPgQRenB.js → agent-lanes-model-VYQ5a68i.js} +1 -1
- package/dist/client/assets/{arc.es-NlJw-19N.js → arc.es-BBTfhvLE.js} +1 -1
- package/dist/client/assets/{arrow-left-_vS7itsV.js → arrow-left-BOht-YQu.js} +1 -1
- package/dist/client/assets/{arrow-up-right-CcrWONpD.js → arrow-up-right-hoR8_oUz.js} +1 -1
- package/dist/client/assets/{bot-BRINYlC6.js → bot-BUK7dOPS.js} +1 -1
- package/dist/client/assets/{check-COxArFXG.js → check--esHw52j.js} +1 -1
- package/dist/client/assets/{chevron-down-DRCbnzyY.js → chevron-down-NAhBUkFd.js} +1 -1
- package/dist/client/assets/{chevron-right-CNE6QAVr.js → chevron-right-C10o7t_X.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-CAeEKaf5.js → chunk-HRAB3GC3-DF8R9rPv.js} +1 -1
- package/dist/client/assets/{clock-CyfvRmj6.js → clock-of01sAB6.js} +1 -1
- package/dist/client/assets/{code-xml--LjSM4Mv.js → code-xml-CLn3TDWF.js} +1 -1
- package/dist/client/assets/content-B-SUUhXj.js +1 -0
- package/dist/client/assets/content-BRY2vo1_.js +1 -0
- package/dist/client/assets/content-BTm0mVyD.js +1 -0
- package/dist/client/assets/content-BTqvyb5E.js +1 -0
- package/dist/client/assets/content-BjDaXmSD.js +1 -0
- package/dist/client/assets/content-BrR6deGh.js +1 -0
- package/dist/client/assets/content-C5yvBEMy.js +1 -0
- package/dist/client/assets/content-Cgj5AWqT.js +1 -0
- package/dist/client/assets/content-CkhG__-v.js +1 -0
- package/dist/client/assets/content-CudIBsiP.js +1 -0
- package/dist/client/assets/content-DBb7ppd5.js +1 -0
- package/dist/client/assets/content-DEw_kGyK.js +1 -0
- package/dist/client/assets/content-DIy0DCzK.js +1 -0
- package/dist/client/assets/content-THl9hRAo.js +1 -0
- package/dist/client/assets/content-vi9FbmV9.js +1 -0
- package/dist/client/assets/content-wcgPMGVf.js +1 -0
- package/dist/client/assets/{conversation-icons-c-hXv7hY.js → conversation-icons-ClBJi21l.js} +1 -1
- package/dist/client/assets/conversation-motion-features-zU0k3Agz.js +1 -0
- package/dist/client/assets/{copy-4LfKIdQJ.js → copy-Dty8ZYsM.js} +1 -1
- package/dist/client/assets/{createLucideIcon-ClCdc3F9.js → createLucideIcon-Bt67PWH-.js} +1 -1
- package/dist/client/assets/discover-NDAqNvKt.js +2 -0
- package/dist/client/assets/embed-entry-BVR09F6e.js +2 -0
- package/dist/client/assets/{external-link-CnaI1QFS.js → external-link-Dem738OJ.js} +1 -1
- package/dist/client/assets/{eye-BFlhMzQL.js → eye-B3lBIwJZ.js} +1 -1
- package/dist/client/assets/{file-text-DG-pufl1.js → file-text-iF0hyVyU.js} +1 -1
- package/dist/client/assets/{home-moving-signal-aNJusIzL.js → home-moving-signal-C8dTXieA.js} +1 -1
- package/dist/client/assets/{home-now-card-BQK4EFHx.js → home-now-card-BgvVcE83.js} +1 -1
- package/dist/client/assets/{home-now-card-nano-CdtzqSIF.js → home-now-card-nano-hZl9klbP.js} +1 -1
- package/dist/client/assets/hooks-DBIezYS2.js +2 -0
- package/dist/client/assets/index-BMwKgdz_.js +1 -0
- package/dist/client/assets/index-Bu-fckyR.css +1 -0
- package/dist/client/assets/index-BxoufAPA.js +1 -0
- package/dist/client/assets/index-Cj7NnSxI.js +1 -0
- package/dist/client/assets/{index-CzVeWScw.js → index-o4FKpU7Z.js} +2 -2
- package/dist/client/assets/{inspector-panel-DgOM8nCo.js → inspector-panel-Dy2cVTCi.js} +2 -2
- package/dist/client/assets/{keyboard-nav-BJnFoFDP.js → keyboard-nav-Chf51dns.js} +1 -1
- package/dist/client/assets/{lane-roster-store-pR4ZaYQm.js → lane-roster-store-BiIVlYmG.js} +1 -1
- package/dist/client/assets/left-BC7p5QbT.js +1 -0
- package/dist/client/assets/left-BCSGqccQ.js +1 -0
- package/dist/client/assets/left-BSyj8PuJ.js +2 -0
- package/dist/client/assets/left-DDnxNUxd.js +1 -0
- package/dist/client/assets/left-DLoDKxT5.js +2 -0
- package/dist/client/assets/left-O-TBH7JB.js +1 -0
- package/dist/client/assets/left-agents-Dk9Y89lb.js +1 -0
- package/dist/client/assets/left-default-B3JBRQNJ.js +1 -0
- package/dist/client/assets/left-lanes-30Oe_3RM.js +1 -0
- package/dist/client/assets/left-mission-DEl4-7xu.js +1 -0
- package/dist/client/assets/left-plan-B4qdm4Gn.js +2 -0
- package/dist/client/assets/left-rvUOB14X.js +1 -0
- package/dist/client/assets/library-DDKSLFJ_.js +1 -0
- package/dist/client/assets/{loader-circle-Byb9kSFx.js → loader-circle-4LDsy4Ke.js} +1 -1
- package/dist/client/assets/{local-agents-DBaUbP-_.js → local-agents-DIi2EacM.js} +1 -1
- package/dist/client/assets/{mentions-fbQJ2mBI.js → mentions-CvDaviLJ.js} +1 -1
- package/dist/client/assets/{mesh-ops-Cnw3vwAu.js → mesh-ops-JZwGuAPn.js} +1 -1
- package/dist/client/assets/{mesh-view-store-Btlyc7rW.js → mesh-view-store-Du7VqIT_.js} +1 -1
- package/dist/client/assets/{message-circle-aGOfQWm2.js → message-circle-BM3XgevU.js} +1 -1
- package/dist/client/assets/{message-markup-mGF07emJ.js → message-markup-BcY1lShv.js} +1 -1
- package/dist/client/assets/{message-square-CIXda-Y7.js → message-square-ER1_q2pe.js} +1 -1
- package/dist/client/assets/{mission-control-store-CcoNeQHG.js → mission-control-store-C6w5iVfg.js} +1 -1
- package/dist/client/assets/{observe-BNFzh-7B.js → observe-3-jn4SXb.js} +1 -1
- package/dist/client/assets/{page-status-DDvNdA8s.js → page-status-0LPfBC8S.js} +1 -1
- package/dist/client/assets/{plus-CmFQp9Uj.js → plus-C-2gTcPK.js} +1 -1
- package/dist/client/assets/profile-DW80Gn5k.js +1 -0
- package/dist/client/assets/{projects-inbox-Diddml6e.js → projects-inbox-DCeD3FfV.js} +1 -1
- package/dist/client/assets/provider-BvAxRQfE.js +1 -0
- package/dist/client/assets/{radio-PauJIekM.js → radio-v7UAMZGh.js} +1 -1
- package/dist/client/assets/{refresh-cw-4oeFn1Jn.js → refresh-cw-B5To7b6B.js} +1 -1
- package/dist/client/assets/resolve-panes-BDi9Qx4R.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-HE-5eZYa.js +1 -0
- package/dist/client/assets/right-BDf_yTv6.js +1 -0
- package/dist/client/assets/{right-BcFnuse9.js → right-BvoGOUKH.js} +1 -1
- package/dist/client/assets/right-C-bgjYg-.js +1 -0
- package/dist/client/assets/right-C3JdEfYQ.js +1 -0
- package/dist/client/assets/right-CYIs2tEe.js +1 -0
- package/dist/client/assets/right-CyRCv6Up.js +1 -0
- package/dist/client/assets/right-DBYGtoRv.js +1 -0
- package/dist/client/assets/right-o3LHMiKa.js +1 -0
- package/dist/client/assets/right-oPrcx9MX.js +1 -0
- package/dist/client/assets/right-sSvBUK-j.js +1 -0
- package/dist/client/assets/{rocket-C-AskjZH.js → rocket-BQQQv2L5.js} +1 -1
- package/dist/client/assets/router-C65cZYPn.js +1 -0
- package/dist/client/assets/{runtime-picker-BCQD7d4K.js → runtime-picker-eDEvx2Mz.js} +1 -1
- package/dist/client/assets/{scope-views-BhkbIFPY.js → scope-views-BOOmgmwx.js} +1 -1
- package/dist/client/assets/{scout-voice-S5_YZ2v8.js → scout-voice-B7kXlkcl.js} +1 -1
- package/dist/client/assets/{scroll-text-BV-BB7v-.js → scroll-text-BuneRiAD.js} +1 -1
- package/dist/client/assets/{search-C3bSJluv.js → search-7_n7CxWl.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-Bg4Tc0gT.js → secondaryNavConfig-CSFDCQAf.js} +1 -1
- package/dist/client/assets/{selection-bridge-B1dmkX3P.js → selection-bridge-SlGsgHw2.js} +1 -1
- package/dist/client/assets/{send-horizontal-CqogPmbY.js → send-horizontal-DP16OOIW.js} +1 -1
- package/dist/client/assets/{server-Brw5Y1Gh.js → server-pYOMFjrT.js} +1 -1
- package/dist/client/assets/{session-catalog-9FqXmjBw.js → session-catalog-_QfQ7fhZ.js} +1 -1
- package/dist/client/assets/{session-table-1xdSxSXq.js → session-table-CYN8e4s3.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-CUiOH26y.js → sliders-horizontal-D2Z8gz6J.js} +1 -1
- package/dist/client/assets/{sparkles-BjCA3Evu.js → sparkles-Bth2iK7t.js} +1 -1
- package/dist/client/assets/{sse-QcU9bikk.js → sse-CL6gctHY.js} +1 -1
- package/dist/client/assets/{tail-events-C6K7bCWB.js → tail-events-NLIWLq27.js} +1 -1
- package/dist/client/assets/{terminal-DrTkVXIj.js → terminal-By1Lw2i2.js} +1 -1
- package/dist/client/assets/{terminal-relay-BkXjjSkq.js → terminal-relay-CjkI5aUy.js} +1 -1
- package/dist/client/assets/{terminal-sessions-C3qU8tnY.js → terminal-sessions-AmSgHklm.js} +1 -1
- package/dist/client/assets/{terminal-takeover-KvmTwABa.js → terminal-takeover-7AvNpnkC.js} +1 -1
- package/dist/client/assets/{use-conversation-list-C5sF6WBR.js → use-conversation-list-BCzY032j.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-BOMPW0nl.js → use-fleet-active-asks-CJ6-oj5k.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-Co05vcTV.js → use-mesh-ops-items-D5L-CKe_.js} +1 -1
- package/dist/client/assets/use-reduced-motion-CqXpVXv-.js +1 -0
- package/dist/client/assets/use-scout-dev-flags-BohC8seq.js +1 -0
- package/dist/client/assets/{useAgentHoverCard-FtCmY-b9.js → useAgentHoverCard-RsLUYyeh.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-DOr5yHbT.js +1 -0
- package/dist/client/assets/usePersistentState-D3M4m2Ou.js +1 -0
- package/dist/client/assets/{usePierreRuntime-Bo4lD7Ui.js → usePierreRuntime-B4hbNWTz.js} +1 -1
- package/dist/client/assets/{wrench-CeCdjiPF.js → wrench-M4G7WtYB.js} +1 -1
- package/dist/client/assets/{x-D4X_y1j_.js → x-ynOfVadO.js} +1 -1
- package/dist/client/assets/{xterm-D2a5wrkJ.js → xterm-DZHyijPp.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/main.mjs +41 -26
- package/dist/node/main.mjs +19 -5
- package/dist/pairing-runtime-controller.mjs +2 -2
- package/dist/runtime/broker-daemon.mjs +2 -2
- package/dist/scout-control-plane-web.mjs +21 -7
- package/dist/scout-web-server.mjs +21 -7
- package/package.json +4 -4
- package/dist/client/assets/ActivityScreen-BXm6nJ6L.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-CfBXxrsD.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-4Z0aN8AR.js +0 -1
- package/dist/client/assets/AgentFloorView-DMivAYHU.js +0 -1
- package/dist/client/assets/AgentInfoScreen-CPkLg1pK.js +0 -1
- package/dist/client/assets/AgentLanesEmbedScreen-CjHMvy3v.js +0 -1
- package/dist/client/assets/AgentsScreen-zR6b2bUL.js +0 -1
- package/dist/client/assets/AgentsSubnav-q0xcZi6C.js +0 -1
- package/dist/client/assets/BackToPicker-DZg_4nHL.js +0 -1
- package/dist/client/assets/BrokerScreen-Chh8sGen.js +0 -5
- package/dist/client/assets/ConversationFeedRows-5it6QNBV.js +0 -1
- package/dist/client/assets/ConversationPanels-vI9YuQJh.js +0 -2
- package/dist/client/assets/ConversationScreen-C-PrCRz1.js +0 -1
- package/dist/client/assets/FlightObserveScreen-Yq5NtQQJ.js +0 -1
- package/dist/client/assets/HarnessesScreen-L-emPcXd.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-DvdOFh-b.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-Dl7foF88.js +0 -1
- package/dist/client/assets/MeshScreen-D5zzTn0o.js +0 -1
- package/dist/client/assets/MessagesScreen-BhOJ7_tj.js +0 -1
- package/dist/client/assets/MissionControlView-D2JO9u-y.js +0 -1
- package/dist/client/assets/ObserveTextFlow-DJxQc2H6.js +0 -2
- package/dist/client/assets/OpenScoutAppShell-DrHYD_pd.js +0 -87
- package/dist/client/assets/OpsAgentsView-BnMX0vEY.js +0 -1
- package/dist/client/assets/OpsScreen-BeC0lieE.js +0 -1
- package/dist/client/assets/OpsSubnav-D5Bpowtk.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-zE1cApxw.js +0 -1
- package/dist/client/assets/ProjectsInbox-C3Jd6JTk.js +0 -2
- package/dist/client/assets/ProjectsScreen-PW_NH5VK.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-DaCEUWN1.js +0 -1
- package/dist/client/assets/Provider-DSsb2gLR.js +0 -1
- package/dist/client/assets/RawSessionsTable-LWEvXJzj.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-XtxbCjOs.js +0 -1
- package/dist/client/assets/RepoDiffViewerLazy-DIxkiMto.js +0 -2
- package/dist/client/assets/ScoutDeckSurface-BCpl0QCx.js +0 -1
- package/dist/client/assets/ScoutbotBroadcastChip-z9R_pC_U.js +0 -2
- package/dist/client/assets/SessionRefScreen-Dk-O4OVt.js +0 -1
- package/dist/client/assets/SessionsScreen-BJEjuo2X.js +0 -1
- package/dist/client/assets/SettingsScreen-DJ-BhBwR.js +0 -1
- package/dist/client/assets/Terminal-Dp1FSGIS.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-DP9IM4xf.js +0 -1
- package/dist/client/assets/arrow-down-D3-IbArq.js +0 -1
- package/dist/client/assets/chunk-JTPDIGGW-s6WbxdjC.js +0 -46
- package/dist/client/assets/chunk-T65CQEWV-CiZ_ICHW.js +0 -1
- package/dist/client/assets/chunk-YOZR3KYS-DLOc92uD.js +0 -2
- package/dist/client/assets/content-7ZeCPAEt.js +0 -1
- package/dist/client/assets/content-BHUcUCH5.js +0 -1
- package/dist/client/assets/content-BUhvLPkv.js +0 -1
- package/dist/client/assets/content-BomQ5YWo.js +0 -1
- package/dist/client/assets/content-C39ELNgC.js +0 -1
- package/dist/client/assets/content-C4RYKHut.js +0 -1
- package/dist/client/assets/content-CCiZfG4H.js +0 -1
- package/dist/client/assets/content-CDpDtVI-.js +0 -1
- package/dist/client/assets/content-CO-9CeFd.js +0 -1
- package/dist/client/assets/content-CuOLxp1x.js +0 -1
- package/dist/client/assets/content-CvtLIjXS.js +0 -1
- package/dist/client/assets/content-CzwTUb9n.js +0 -1
- package/dist/client/assets/content-DQXbo2RO.js +0 -1
- package/dist/client/assets/content-DRTQ9QQb.js +0 -1
- package/dist/client/assets/content-LCELs6zg.js +0 -1
- package/dist/client/assets/content-qsDjA4Au.js +0 -1
- package/dist/client/assets/conversation-motion-features-T8vF9zED.js +0 -1
- package/dist/client/assets/discover-7Ks00w-M.js +0 -2
- package/dist/client/assets/embed-entry-n2ThmSSX.js +0 -2
- package/dist/client/assets/gestures-CxG3Dphs.js +0 -1
- package/dist/client/assets/hooks-Dst1TH7n.js +0 -2
- package/dist/client/assets/index-9as_JTUs.css +0 -1
- package/dist/client/assets/index-CU9dtwJk.js +0 -1
- package/dist/client/assets/index-Dewd56RX.js +0 -1
- package/dist/client/assets/index-_YQXKEhb.js +0 -1
- package/dist/client/assets/left-BhzPp-_E.js +0 -1
- package/dist/client/assets/left-CN1MABD0.js +0 -2
- package/dist/client/assets/left-DDgbsio7.js +0 -1
- package/dist/client/assets/left-Dpf2R9uD.js +0 -1
- package/dist/client/assets/left-HwwbMVtl.js +0 -2
- package/dist/client/assets/left-YfH0daht.js +0 -1
- package/dist/client/assets/left-agents-CYUwAy2Z.js +0 -1
- package/dist/client/assets/left-default-vEGZALPv.js +0 -1
- package/dist/client/assets/left-lanes-bphF-vlX.js +0 -1
- package/dist/client/assets/left-mission-B54-c3hq.js +0 -1
- package/dist/client/assets/left-np5USKqG.js +0 -1
- package/dist/client/assets/left-plan-BNBuDoPQ.js +0 -2
- package/dist/client/assets/library-DbCVJG_O.js +0 -1
- package/dist/client/assets/paperclip-DfpJkR4s.js +0 -1
- package/dist/client/assets/profile-s3KRbip1.js +0 -1
- package/dist/client/assets/resolve-panes-cp6eNewO.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-Dbo-5PWx.js +0 -1
- package/dist/client/assets/right-09W2JJFg.js +0 -1
- package/dist/client/assets/right-B-MKhiJ6.js +0 -1
- package/dist/client/assets/right-B91Zl8lQ.js +0 -1
- package/dist/client/assets/right-BdtMzn35.js +0 -1
- package/dist/client/assets/right-BqmKXLtf.js +0 -1
- package/dist/client/assets/right-BzeB-Dpt.js +0 -1
- package/dist/client/assets/right-CkGOs-sq.js +0 -1
- package/dist/client/assets/right-CzGiNBzB.js +0 -1
- package/dist/client/assets/right-Dc7uqv7l.js +0 -1
- package/dist/client/assets/router-B-K15T7B.js +0 -1
- package/dist/client/assets/use-reduced-motion-Dla-G_Jz.js +0 -1
- package/dist/client/assets/use-scout-dev-flags-BOQF3fW2.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-BX7Sq7vy.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as p,j as e}from"./index-
|
|
2
|
-
`)??"";return e.jsx("div",{className:"ctx-panel ctx-panel--ops-inspector ctx-panel--tail-inspector",children:e.jsxs("section",{className:"ctx-panel-section ctx-panel-tail-detail",children:[e.jsxs("div",{className:"ctx-panel-section-label ctx-panel-tail-detail-label",children:[e.jsx("span",{children:r}),t&&e.jsx("button",{type:"button",className:"ctx-panel-tail-icon-button",onClick:oe,"aria-label":"Clear Tail detail",title:"Clear",children:e.jsx(V,{size:13,strokeWidth:2,"aria-hidden":"true"})})]}),t?e.jsxs("div",{className:"ctx-panel-tail-card",children:[e.jsxs("div",{className:"ctx-panel-tail-card-head",children:[e.jsx("div",{className:"ctx-panel-tail-card-title",children:t.title}),e.jsx("div",{className:"ctx-panel-tail-card-meta",children:t.meta})]}),t.metadata&&t.metadata.length>0&&e.jsxs("div",{className:"ctx-panel-tail-copy-scope",children:[e.jsx("dl",{className:"ctx-panel-tail-metadata",children:t.metadata.map(c=>e.jsxs("div",{className:"ctx-panel-tail-metadata-row",children:[e.jsx("dt",{children:c.label}),e.jsx("dd",{title:c.value,children:c.value})]},c.label))}),x&&e.jsx(B,{label:"Copy metadata",value:x})]}),t.action&&e.jsx("div",{className:"ctx-panel-tail-actions",children:e.jsx("button",{type:"button",className:"ctx-panel-tail-action-button",onClick:()=>a(t.action.route),children:t.action.label})}),e.jsxs("div",{className:"ctx-panel-tail-copy-scope ctx-panel-tail-copy-scope--message",children:[e.jsx("div",{className:"ctx-panel-tail-message",children:t.body}),o&&e.jsx(B,{label:"Copy message",value:o})]})]}):e.jsxs("div",{className:"ctx-panel-tail-empty-card",children:[e.jsx("span",{children:"Tail"}),e.jsx("strong",{children:"No log selected"})]})]})})}function B({label:t,value:s}){const[a,r]=p.useState(!1),o=p.useRef(null);p.useEffect(()=>()=>{o.current!=null&&window.clearTimeout(o.current)},[]);const x=p.useCallback(async()=>{await G(s)&&(r(!0),o.current!=null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>r(!1),1200))},[s]);return e.jsxs("button",{type:"button",className:`ctx-panel-tail-hover-copy${a?" ctx-panel-tail-hover-copy--copied":""}`,onClick:()=>{x()},title:t,children:[a?e.jsx(Y,{size:13,strokeWidth:2,"aria-hidden":"true"}):e.jsx(Z,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:a?"Copied":t})]})}function pe({navigate:t,returnRoute:s}){const[a,r]=p.useState(null),[o,x]=p.useState(null),[c,d]=p.useState([]),[u,f]=p.useState([]),[l,b]=p.useState([]),[S,y]=p.useState(!1),i=s.view==="ops"&&s.mode==="plan"?s.planDocumentId:void 0,N=p.useCallback(async()=>{const[n,g,O,P,E,M]=await Promise.allSettled([v("/api/plan-documents"),v("/api/fleet"),v("/api/work?limit=250"),v("/api/work?active=false&limit=250"),v("/api/runs?active=false&limit=500"),v("/api/conversations?limit=250")]);n.status==="fulfilled"&&r(n.value),g.status==="fulfilled"&&x(g.value),(O.status==="fulfilled"||P.status==="fulfilled")&&d(ce([O,P])),E.status==="fulfilled"&&f(E.value),M.status==="fulfilled"&&b(M.value),y(!0)},[]);p.useEffect(()=>{y(!1),N()},[N]),D(n=>{(n.kind==="message.posted"||n.kind==="flight.updated"||n.kind==="collaboration.event.appended")&&N()});const R=a?.documents??[],h=p.useMemo(()=>R.find(n=>n.id===i)??R[0]??null,[R,i]),m=p.useMemo(()=>ie(h,{fleet:o,runs:u,sessions:l,workItems:c}),[o,u,h,l,c]),L=m.attention.length+m.workItems.length+m.asks.length+m.runs.length+m.sessions.length;return h?e.jsxs("div",{className:"ctx-panel ctx-panel--ops-inspector ctx-panel--plan-inspector",children:[e.jsxs("section",{className:"ctx-panel-section ctx-panel-plan-summary",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Plan Context"}),e.jsxs("div",{className:"ctx-panel-plan-card",children:[e.jsx("span",{children:"Current"}),e.jsx("strong",{children:h.title}),e.jsxs("small",{children:[h.path," · ",j(h.updatedAt)]}),h.summary&&e.jsx("p",{children:h.summary})]})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsxs("div",{className:"ctx-panel-section-label",children:["Steps",e.jsx("span",{className:"ctx-panel-count",children:h.steps.length})]}),h.steps.length===0?e.jsx("div",{className:"ctx-panel-empty",children:"No checklist steps parsed"}):e.jsx("div",{className:"ctx-panel-plan-step-list",children:h.steps.map(n=>e.jsxs("div",{className:`ctx-panel-plan-step ctx-panel-plan-step--${n.status}`,children:[e.jsx("span",{className:"ctx-panel-plan-step-marker",children:se[n.status]}),e.jsx("span",{className:"ctx-panel-plan-step-text",children:n.text}),e.jsx("span",{className:"ctx-panel-plan-step-state",children:ee[n.status]})]},n.id))})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsxs("div",{className:"ctx-panel-section-label",children:["Around This Plan",e.jsx("span",{className:"ctx-panel-count",children:L})]}),L===0?e.jsx("div",{className:"ctx-panel-empty",children:"No nearby activity matched yet"}):null]}),e.jsx(w,{title:"Sessions",count:m.sessions.length,children:m.sessions.map(n=>e.jsx("button",{type:"button",className:"ctx-panel-item ctx-panel-plan-context-item",onClick:()=>C(t,{view:"conversation",conversationId:n.id},{returnTo:s}),children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:n.title||n.agentName||n.id}),e.jsxs("span",{className:"ctx-panel-sub",children:[n.kind," · ",n.agentName??n.harness??"session"," · ",n.messageCount," msg"]}),e.jsx("span",{className:"ctx-panel-preview",children:n.preview?.trim()||n.workspaceRoot||n.id})]})},n.id))}),e.jsx(w,{title:"Work Items",count:m.workItems.length,children:m.workItems.map(n=>e.jsx("button",{type:"button",className:"ctx-panel-item ctx-panel-plan-context-item",onClick:()=>C(t,{view:"work",workId:n.id},{returnTo:s}),children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:n.title}),e.jsxs("span",{className:"ctx-panel-sub",children:[n.currentPhase||n.state," · ",j(n.lastMeaningfulAt||n.updatedAt)]}),(n.summary||n.lastMeaningfulSummary)&&e.jsx("span",{className:"ctx-panel-preview",children:n.summary??n.lastMeaningfulSummary})]})},n.id))}),e.jsx(w,{title:"Runs",count:m.runs.length,children:m.runs.map(n=>e.jsx("button",{type:"button",className:"ctx-panel-item ctx-panel-plan-context-item",onClick:()=>t(me(n)),children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:ae(W(n)??n.agentName??n.id,120)}),e.jsxs("span",{className:"ctx-panel-sub",children:[n.agentName??n.agentId," · ",n.state," · ",j(n.updatedAt)]}),T(n)&&e.jsx("span",{className:"ctx-panel-preview",children:T(n)})]})},n.id))}),e.jsx(w,{title:"Requests",count:m.asks.length,children:m.asks.map(n=>e.jsx("button",{type:"button",className:"ctx-panel-item ctx-panel-plan-context-item",onClick:()=>t(de(n)),children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:n.task}),e.jsxs("span",{className:"ctx-panel-sub",children:[n.agentName??n.agentId," · ",n.statusLabel," · ",j(n.updatedAt)]}),n.summary&&e.jsx("span",{className:"ctx-panel-preview",children:n.summary})]})},n.invocationId))}),e.jsx(w,{title:"Attention",count:m.attention.length,children:m.attention.map(n=>{const g=xe(n);return e.jsx("button",{type:"button",className:"ctx-panel-item ctx-panel-item--attention ctx-panel-plan-context-item",onClick:()=>g&&t(g),disabled:!g,children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:n.title}),e.jsxs("span",{className:"ctx-panel-sub",children:[n.kind," · ",j(n.updatedAt)]}),n.summary&&e.jsx("span",{className:"ctx-panel-preview",children:n.summary})]})},n.recordId)})})]}):e.jsx("div",{className:"ctx-panel ctx-panel--ops-inspector ctx-panel--plan-inspector",children:e.jsxs("section",{className:"ctx-panel-section ctx-panel-ops-summary",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Plan Context"}),e.jsx("div",{className:"ctx-panel-empty",children:S?"No plan document selected":"Indexing plan documents"})]})})}function w({title:t,count:s,children:a}){return e.jsxs("section",{className:"ctx-panel-section",children:[e.jsxs("div",{className:"ctx-panel-section-label",children:[t,e.jsx("span",{className:"ctx-panel-count",children:s})]}),s===0?e.jsx("div",{className:"ctx-panel-empty",children:"None matched"}):e.jsx("div",{className:"ctx-panel-list",children:a})]})}function de(t){return J(t)}function me(t){return t.conversationId?{view:"conversation",conversationId:t.conversationId}:t.workId?{view:"work",workId:t.workId}:{view:"agents-v2",agentId:t.agentId}}function xe(t){return U(t)}function k({label:t,value:s,tone:a}){return e.jsxs("div",{className:`ctx-panel-stat${a?` ctx-panel-stat--${a}`:""}`,children:[e.jsx("span",{children:t}),e.jsx("strong",{children:s})]})}function F(t){if(!t||typeof t!="object")return null;const s=t;if(s.focus!=="flow"&&s.focus!=="item"||typeof s.title!="string"||typeof s.meta!="string"||typeof s.body!="string")return null;const a=Array.isArray(s.metadata)?s.metadata.filter(o=>o!=null&&typeof o=="object"&&typeof o.label=="string"&&typeof o.value=="string"):void 0,r=Array.isArray(s.copy)?s.copy.filter(o=>o!=null&&typeof o=="object"&&typeof o.label=="string"&&typeof o.value=="string"):void 0;return{source:s.source==="tail"?"tail":"generic",focus:s.focus,title:s.title,meta:s.meta,body:s.body,metadata:a,copy:r,action:s.action&&typeof s.action=="object"?s.action:null}}function ue({item:t,navigate:s}){const{route:a}=_();return e.jsx("button",{type:"button",className:"ctx-panel-item ctx-panel-item--attention",onClick:()=>{t.conversationId?C(s,{view:"conversation",conversationId:t.conversationId},{returnTo:a}):s({view:"ops",mode:"mission"})},children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:t.title}),e.jsxs("span",{className:"ctx-panel-sub",children:[t.agentName??t.agentId??"operator"," · ",j(t.updatedAt)]})]})})}function he({ask:t,navigate:s}){const{route:a}=_();return e.jsx("button",{type:"button",className:"ctx-panel-item",onClick:()=>{t.conversationId?C(s,{view:"conversation",conversationId:t.conversationId},{returnTo:a}):s({view:"ops",mode:"mission"})},children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:t.task}),e.jsxs("span",{className:"ctx-panel-sub",children:[t.agentName??t.agentId," · ",t.statusLabel]})]})})}export{it as OpsRight};
|
|
1
|
+
import{r as p,j as e}from"./index-o4FKpU7Z.js";import{u as _}from"./Provider-DKZWuzSR.js";import{o as q}from"./openAgent-Dbv5wfuL.js";import{o as C}from"./openContent-C6XO6kr5.js";import{a as H,i as K,b as Q,c as X}from"./colors-BtO5_zlx.js";import{a as v}from"./api-h5zurxmi.js";import{c as G}from"./clipboard-e3fSpeo7.js";import{r as J,a as U}from"./operator-attention-BwSPeheT.js";import{u as D}from"./sse-CL6gctHY.js";import{t as j}from"./time-Dhsh_2EG.js";import{X as V}from"./x-ynOfVadO.js";import{C as Y}from"./check--esHw52j.js";import{C as Z}from"./copy-Dty8ZYsM.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./index-BWHgHrtv.js";const ee={blocked:"blocked",completed:"done",in_progress:"active",pending:"todo",unknown:"step"},te={mission:"Control",plan:"Plans",issues:"Alerts",tail:"Tail",atop:"Runtime",agents:"Agents",lanes:"Lanes"},se={blocked:"!",completed:"x",in_progress:">",pending:" ",unknown:"-"};function ne(t,s){return t&&typeof t=="object"&&!Array.isArray(t)?t[s]:void 0}function A(t,s){const a=ne(t,s);return typeof a=="string"&&a.trim()?a.trim():null}function W(t){return A(t.input,"task")??A(t.input,"action")}function T(t){return A(t.output,"summary")??A(t.output,"text")}function z(t){const s=t.replace(/\\/g,"/").replace(/\/+$/g,""),a=s.lastIndexOf("/");return a>=0?s.slice(a+1):s}function ae(t,s=180){const a=t.replace(/\s+/g," ").trim();return a.length<=s?a:`${a.slice(0,Math.max(0,s-1)).trimEnd()}...`}function $(t){return t.toLowerCase().replace(/[^a-z0-9_/-]+/g," ").split(/\s+/).map(s=>s.trim()).filter(s=>s.length>=4).filter(s=>!["plan","plans","todo","work","task","docs","markdown"].includes(s)).slice(0,8)}function I(t,s){const a=s.filter(Boolean).join(" ").toLowerCase();if(!a)return 0;const r=t.path.toLowerCase(),o=z(r).toLowerCase(),x=t.title.toLowerCase();let c=0;r&&a.includes(r)&&(c+=8),o&&a.includes(o)&&(c+=6),x.length>8&&a.includes(x)&&(c+=6);for(const d of t.tags)d.length>=3&&a.includes(d.toLowerCase())&&(c+=2);for(const d of $(t.title))a.includes(d)&&(c+=1);for(const d of t.steps.slice(0,8))for(const u of $(d.text).slice(0,3))a.includes(u)&&(c+=1);return c}function le(t,s){let a=I(t,[s.id,s.title,s.preview,s.agentName,s.harness,s.harnessSessionId,s.harnessLogPath,s.currentBranch,s.workspaceRoot,s.participantIds.join(" ")]);return t.agentId&&s.agentId===t.agentId&&(a+=4),t.agentName&&s.agentName&&t.agentName===s.agentName&&(a+=2),t.workspaceName&&s.workspaceRoot&&z(s.workspaceRoot).toLowerCase()===t.workspaceName.toLowerCase()&&(a+=3),a}function ce(t){const s=new Map;for(const a of t)if(a.status==="fulfilled")for(const r of a.value)s.set(r.id,r);return[...s.values()]}function ie(t,s){if(!t)return{asks:[],runs:[],sessions:[],workItems:[],attention:[]};const a=6,r=[...s.fleet?.activeAsks??[],...s.fleet?.recentCompleted??[]].filter(l=>I(t,[l.task,l.summary,l.agentName,l.collaborationRecordId])>=a).slice(0,8),o=s.runs.filter(l=>I(t,[W(l),T(l),l.agentName,l.workId,l.collaborationRecordId])>=a).slice(0,8),x=s.workItems.filter(l=>I(t,[l.title,l.summary,l.lastMeaningfulSummary,l.parentTitle,l.ownerName,l.nextMoveOwnerName])>=a).slice(0,8),c=(s.fleet?.needsAttention??[]).filter(l=>I(t,[l.title,l.summary,l.agentName])>=a).slice(0,6),d=new Set,u=new Set;for(const l of r)l.conversationId&&d.add(l.conversationId);for(const l of o){l.conversationId&&d.add(l.conversationId);for(const b of l.traceSessionIds??[])u.add(b)}for(const l of x)l.conversationId&&d.add(l.conversationId);for(const l of c)l.conversationId&&d.add(l.conversationId);const f=s.sessions.filter(l=>d.has(l.id)||(l.harnessSessionId?u.has(l.harnessSessionId):!1)||le(t,l)>=a).slice(0,8);return{asks:r,runs:o,sessions:f,workItems:x,attention:c}}function ot({mode:t,agents:s,navigate:a,returnRoute:r}){const[o,x]=p.useState(null),[c,d]=p.useState(()=>typeof window>"u"?null:F(window.scoutOpsDetailSnapshot)),u=p.useCallback(async()=>{const i=await v("/api/fleet").catch(()=>null);x(i)},[]);if(p.useEffect(()=>{u()},[u]),p.useEffect(()=>{const i=N=>{d(F(N.detail))};return window.addEventListener("scout:ops-detail",i),()=>window.removeEventListener("scout:ops-detail",i)},[]),D(i=>{(i.kind==="message.posted"||i.kind==="flight.updated"||i.kind==="collaboration.event.appended")&&u()}),t==="plan")return e.jsx(pe,{navigate:a,returnRoute:r});if(t==="tail"||t==="issues")return e.jsx(re,{detail:c?.source==="tail"?c:null,mode:t,navigate:a});const f=(o?.activeAsks??[]).filter(i=>i.status!=="needs_attention"),l=o?.needsAttention??[];if(t==="lanes")return null;const b=s.filter(i=>H(i.state)),S=s.filter(i=>K(i.state)),y=[...s].sort((i,N)=>(N.updatedAt??0)-(i.updatedAt??0)).slice(0,7);return e.jsxs("div",{className:"ctx-panel ctx-panel--ops-inspector",children:[c&&e.jsxs("section",{className:"ctx-panel-section ctx-panel-selected-detail",children:[e.jsx("div",{className:"ctx-panel-section-label",children:c.focus==="flow"?"Message":"Selection"}),e.jsxs("div",{className:"ctx-panel-selected-card",children:[e.jsx("div",{className:"ctx-panel-selected-title",children:c.title}),e.jsx("div",{className:"ctx-panel-selected-meta",children:c.meta}),e.jsx("div",{className:"ctx-panel-selected-body",children:c.body}),c.action&&e.jsx("button",{type:"button",className:"ctx-panel-selected-action",onClick:()=>a(c.action.route),children:c.action.label})]})]}),e.jsxs("section",{className:"ctx-panel-section ctx-panel-ops-summary",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Ops Context"}),e.jsxs("div",{className:"ctx-panel-ops-mode-card",children:[e.jsx("span",{children:"Current"}),e.jsx("strong",{children:te[t]}),e.jsx("small",{children:o?`${j(o.generatedAt)} refresh`:"loading"})]}),e.jsxs("div",{className:"ctx-panel-stat-grid",children:[e.jsx(k,{label:"Needs",value:l.length,tone:l.length>0?"warn":"ok"}),e.jsx(k,{label:"Active",value:f.length}),e.jsx(k,{label:"Online",value:`${S.length}/${s.length}`}),e.jsx(k,{label:"Working",value:b.length})]})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsxs("div",{className:"ctx-panel-section-label",children:["Queue",l.length>0&&e.jsx("span",{className:"ctx-panel-count",children:l.length})]}),l.length===0?e.jsx("div",{className:"ctx-panel-empty",children:"No operator cues"}):e.jsx("div",{className:"ctx-panel-list",children:l.slice(0,5).map(i=>e.jsx(ue,{item:i,navigate:a},i.recordId))})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsxs("div",{className:"ctx-panel-section-label",children:["Runs",f.length>0&&e.jsx("span",{className:"ctx-panel-count",children:f.length})]}),f.length===0?e.jsx("div",{className:"ctx-panel-empty",children:"No active requests"}):e.jsx("div",{className:"ctx-panel-list",children:f.slice(0,5).map(i=>e.jsx(he,{ask:i,navigate:a},i.invocationId))})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsxs("div",{className:"ctx-panel-section-label",children:["Recent activity",y.length>0&&e.jsx("span",{className:"ctx-panel-count",children:y.length})]}),e.jsx("div",{className:"ctx-panel-pulse-list",children:y.map(i=>e.jsxs("button",{type:"button",className:"ctx-panel-pulse-row",onClick:()=>q(a,i,{returnTo:r}),children:[e.jsx("span",{className:`ctx-panel-pulse-dot ctx-panel-pulse-dot--${Q(i.state)}`}),e.jsx("span",{children:i.name}),e.jsxs("small",{children:[X(i.state)," · ",i.updatedAt?j(i.updatedAt):"unknown"]})]},i.id))})]})]})}function oe(){if(typeof window>"u")return;const t=window;t.scoutOpsDetailSnapshot=null,window.dispatchEvent(new CustomEvent("scout:ops-detail",{detail:null}))}function re({detail:t,mode:s,navigate:a}){const r=s==="issues"?"Alert detail":"Tail detail",o=t?.copy?.find(c=>c.label==="Copy message")?.value??t?.body??"",x=t?.copy?.find(c=>c.label==="Copy metadata")?.value??t?.metadata?.map(c=>`${c.label}: ${c.value}`).join(`
|
|
2
|
+
`)??"";return e.jsx("div",{className:"ctx-panel ctx-panel--ops-inspector ctx-panel--tail-inspector",children:e.jsxs("section",{className:"ctx-panel-section ctx-panel-tail-detail",children:[e.jsxs("div",{className:"ctx-panel-section-label ctx-panel-tail-detail-label",children:[e.jsx("span",{children:r}),t&&e.jsx("button",{type:"button",className:"ctx-panel-tail-icon-button",onClick:oe,"aria-label":"Clear Tail detail",title:"Clear",children:e.jsx(V,{size:13,strokeWidth:2,"aria-hidden":"true"})})]}),t?e.jsxs("div",{className:"ctx-panel-tail-card",children:[e.jsxs("div",{className:"ctx-panel-tail-card-head",children:[e.jsx("div",{className:"ctx-panel-tail-card-title",children:t.title}),e.jsx("div",{className:"ctx-panel-tail-card-meta",children:t.meta})]}),t.metadata&&t.metadata.length>0&&e.jsxs("div",{className:"ctx-panel-tail-copy-scope",children:[e.jsx("dl",{className:"ctx-panel-tail-metadata",children:t.metadata.map(c=>e.jsxs("div",{className:"ctx-panel-tail-metadata-row",children:[e.jsx("dt",{children:c.label}),e.jsx("dd",{title:c.value,children:c.value})]},c.label))}),x&&e.jsx(B,{label:"Copy metadata",value:x})]}),t.action&&e.jsx("div",{className:"ctx-panel-tail-actions",children:e.jsx("button",{type:"button",className:"ctx-panel-tail-action-button",onClick:()=>a(t.action.route),children:t.action.label})}),e.jsxs("div",{className:"ctx-panel-tail-copy-scope ctx-panel-tail-copy-scope--message",children:[e.jsx("div",{className:"ctx-panel-tail-message",children:t.body}),o&&e.jsx(B,{label:"Copy message",value:o})]})]}):e.jsxs("div",{className:"ctx-panel-tail-empty-card",children:[e.jsx("span",{children:"Tail"}),e.jsx("strong",{children:"No log selected"})]})]})})}function B({label:t,value:s}){const[a,r]=p.useState(!1),o=p.useRef(null);p.useEffect(()=>()=>{o.current!=null&&window.clearTimeout(o.current)},[]);const x=p.useCallback(async()=>{await G(s)&&(r(!0),o.current!=null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>r(!1),1200))},[s]);return e.jsxs("button",{type:"button",className:`ctx-panel-tail-hover-copy${a?" ctx-panel-tail-hover-copy--copied":""}`,onClick:()=>{x()},title:t,children:[a?e.jsx(Y,{size:13,strokeWidth:2,"aria-hidden":"true"}):e.jsx(Z,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:a?"Copied":t})]})}function pe({navigate:t,returnRoute:s}){const[a,r]=p.useState(null),[o,x]=p.useState(null),[c,d]=p.useState([]),[u,f]=p.useState([]),[l,b]=p.useState([]),[S,y]=p.useState(!1),i=s.view==="ops"&&s.mode==="plan"?s.planDocumentId:void 0,N=p.useCallback(async()=>{const[n,g,O,P,E,M]=await Promise.allSettled([v("/api/plan-documents"),v("/api/fleet"),v("/api/work?limit=250"),v("/api/work?active=false&limit=250"),v("/api/runs?active=false&limit=500"),v("/api/conversations?limit=250")]);n.status==="fulfilled"&&r(n.value),g.status==="fulfilled"&&x(g.value),(O.status==="fulfilled"||P.status==="fulfilled")&&d(ce([O,P])),E.status==="fulfilled"&&f(E.value),M.status==="fulfilled"&&b(M.value),y(!0)},[]);p.useEffect(()=>{y(!1),N()},[N]),D(n=>{(n.kind==="message.posted"||n.kind==="flight.updated"||n.kind==="collaboration.event.appended")&&N()});const R=a?.documents??[],h=p.useMemo(()=>R.find(n=>n.id===i)??R[0]??null,[R,i]),m=p.useMemo(()=>ie(h,{fleet:o,runs:u,sessions:l,workItems:c}),[o,u,h,l,c]),L=m.attention.length+m.workItems.length+m.asks.length+m.runs.length+m.sessions.length;return h?e.jsxs("div",{className:"ctx-panel ctx-panel--ops-inspector ctx-panel--plan-inspector",children:[e.jsxs("section",{className:"ctx-panel-section ctx-panel-plan-summary",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Plan Context"}),e.jsxs("div",{className:"ctx-panel-plan-card",children:[e.jsx("span",{children:"Current"}),e.jsx("strong",{children:h.title}),e.jsxs("small",{children:[h.path," · ",j(h.updatedAt)]}),h.summary&&e.jsx("p",{children:h.summary})]})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsxs("div",{className:"ctx-panel-section-label",children:["Steps",e.jsx("span",{className:"ctx-panel-count",children:h.steps.length})]}),h.steps.length===0?e.jsx("div",{className:"ctx-panel-empty",children:"No checklist steps parsed"}):e.jsx("div",{className:"ctx-panel-plan-step-list",children:h.steps.map(n=>e.jsxs("div",{className:`ctx-panel-plan-step ctx-panel-plan-step--${n.status}`,children:[e.jsx("span",{className:"ctx-panel-plan-step-marker",children:se[n.status]}),e.jsx("span",{className:"ctx-panel-plan-step-text",children:n.text}),e.jsx("span",{className:"ctx-panel-plan-step-state",children:ee[n.status]})]},n.id))})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsxs("div",{className:"ctx-panel-section-label",children:["Around This Plan",e.jsx("span",{className:"ctx-panel-count",children:L})]}),L===0?e.jsx("div",{className:"ctx-panel-empty",children:"No nearby activity matched yet"}):null]}),e.jsx(w,{title:"Sessions",count:m.sessions.length,children:m.sessions.map(n=>e.jsx("button",{type:"button",className:"ctx-panel-item ctx-panel-plan-context-item",onClick:()=>C(t,{view:"conversation",conversationId:n.id},{returnTo:s}),children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:n.title||n.agentName||n.id}),e.jsxs("span",{className:"ctx-panel-sub",children:[n.kind," · ",n.agentName??n.harness??"session"," · ",n.messageCount," msg"]}),e.jsx("span",{className:"ctx-panel-preview",children:n.preview?.trim()||n.workspaceRoot||n.id})]})},n.id))}),e.jsx(w,{title:"Work Items",count:m.workItems.length,children:m.workItems.map(n=>e.jsx("button",{type:"button",className:"ctx-panel-item ctx-panel-plan-context-item",onClick:()=>C(t,{view:"work",workId:n.id},{returnTo:s}),children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:n.title}),e.jsxs("span",{className:"ctx-panel-sub",children:[n.currentPhase||n.state," · ",j(n.lastMeaningfulAt||n.updatedAt)]}),(n.summary||n.lastMeaningfulSummary)&&e.jsx("span",{className:"ctx-panel-preview",children:n.summary??n.lastMeaningfulSummary})]})},n.id))}),e.jsx(w,{title:"Runs",count:m.runs.length,children:m.runs.map(n=>e.jsx("button",{type:"button",className:"ctx-panel-item ctx-panel-plan-context-item",onClick:()=>t(me(n)),children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:ae(W(n)??n.agentName??n.id,120)}),e.jsxs("span",{className:"ctx-panel-sub",children:[n.agentName??n.agentId," · ",n.state," · ",j(n.updatedAt)]}),T(n)&&e.jsx("span",{className:"ctx-panel-preview",children:T(n)})]})},n.id))}),e.jsx(w,{title:"Requests",count:m.asks.length,children:m.asks.map(n=>e.jsx("button",{type:"button",className:"ctx-panel-item ctx-panel-plan-context-item",onClick:()=>t(de(n)),children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:n.task}),e.jsxs("span",{className:"ctx-panel-sub",children:[n.agentName??n.agentId," · ",n.statusLabel," · ",j(n.updatedAt)]}),n.summary&&e.jsx("span",{className:"ctx-panel-preview",children:n.summary})]})},n.invocationId))}),e.jsx(w,{title:"Attention",count:m.attention.length,children:m.attention.map(n=>{const g=xe(n);return e.jsx("button",{type:"button",className:"ctx-panel-item ctx-panel-item--attention ctx-panel-plan-context-item",onClick:()=>g&&t(g),disabled:!g,children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:n.title}),e.jsxs("span",{className:"ctx-panel-sub",children:[n.kind," · ",j(n.updatedAt)]}),n.summary&&e.jsx("span",{className:"ctx-panel-preview",children:n.summary})]})},n.recordId)})})]}):e.jsx("div",{className:"ctx-panel ctx-panel--ops-inspector ctx-panel--plan-inspector",children:e.jsxs("section",{className:"ctx-panel-section ctx-panel-ops-summary",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Plan Context"}),e.jsx("div",{className:"ctx-panel-empty",children:S?"No plan document selected":"Indexing plan documents"})]})})}function w({title:t,count:s,children:a}){return e.jsxs("section",{className:"ctx-panel-section",children:[e.jsxs("div",{className:"ctx-panel-section-label",children:[t,e.jsx("span",{className:"ctx-panel-count",children:s})]}),s===0?e.jsx("div",{className:"ctx-panel-empty",children:"None matched"}):e.jsx("div",{className:"ctx-panel-list",children:a})]})}function de(t){return J(t)}function me(t){return t.conversationId?{view:"conversation",conversationId:t.conversationId}:t.workId?{view:"work",workId:t.workId}:{view:"agents-v2",agentId:t.agentId}}function xe(t){return U(t)}function k({label:t,value:s,tone:a}){return e.jsxs("div",{className:`ctx-panel-stat${a?` ctx-panel-stat--${a}`:""}`,children:[e.jsx("span",{children:t}),e.jsx("strong",{children:s})]})}function F(t){if(!t||typeof t!="object")return null;const s=t;if(s.focus!=="flow"&&s.focus!=="item"||typeof s.title!="string"||typeof s.meta!="string"||typeof s.body!="string")return null;const a=Array.isArray(s.metadata)?s.metadata.filter(o=>o!=null&&typeof o=="object"&&typeof o.label=="string"&&typeof o.value=="string"):void 0,r=Array.isArray(s.copy)?s.copy.filter(o=>o!=null&&typeof o=="object"&&typeof o.label=="string"&&typeof o.value=="string"):void 0;return{source:s.source==="tail"?"tail":"generic",focus:s.focus,title:s.title,meta:s.meta,body:s.body,metadata:a,copy:r,action:s.action&&typeof s.action=="object"?s.action:null}}function ue({item:t,navigate:s}){const{route:a}=_();return e.jsx("button",{type:"button",className:"ctx-panel-item ctx-panel-item--attention",onClick:()=>{t.conversationId?C(s,{view:"conversation",conversationId:t.conversationId},{returnTo:a}):s({view:"ops",mode:"mission"})},children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:t.title}),e.jsxs("span",{className:"ctx-panel-sub",children:[t.agentName??t.agentId??"operator"," · ",j(t.updatedAt)]})]})})}function he({ask:t,navigate:s}){const{route:a}=_();return e.jsx("button",{type:"button",className:"ctx-panel-item",onClick:()=>{t.conversationId?C(s,{view:"conversation",conversationId:t.conversationId},{returnTo:a}):s({view:"ops",mode:"mission"})},children:e.jsxs("div",{className:"ctx-panel-body",children:[e.jsx("span",{className:"ctx-panel-name",children:t.task}),e.jsxs("span",{className:"ctx-panel-sub",children:[t.agentName??t.agentId," · ",t.statusLabel]})]})})}export{ot as OpsRight};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l}from"./index-
|
|
1
|
+
import{r as l}from"./index-o4FKpU7Z.js";const d=["input","textarea","select","[contenteditable='']","[contenteditable='true']","[contenteditable='plaintext-only']","[role='combobox']","[role='searchbox']","[role='spinbutton']","[role='textbox']"].join(","),y=[".xterm",".xterm-helper-textarea","[data-scout-terminal-input='true']"].join(",");function m(t){const e=t;if(!e)return!1;const n=typeof e.tagName=="string"?e.tagName.toLowerCase():"";return n==="input"||n==="textarea"||n==="select"||e.isContentEditable===!0||typeof e.closest=="function"&&e.closest(d)?!0:typeof e.parentElement?.closest=="function"&&!!e.parentElement.closest(d)}function x(t){const e=t;return e?typeof e.closest=="function"&&e.closest(y)?!0:typeof e.parentElement?.closest=="function"&&!!e.parentElement.closest(y):!1}function k(t){return(t.metaKey||t.ctrlKey)&&t.shiftKey&&!t.altKey&&t.key.toLowerCase()==="b"}function h(){return!!(document.querySelector(".kb-help-backdrop")||document.querySelector("[data-command-palette-open='true']")||document.querySelector("[role='dialog'][aria-modal='true']"))}function g(t,e,n){return e<=0?-1:t<0?n>0?0:e-1:Math.max(0,Math.min(e-1,t+n))}const f=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(", ");function w(t=!0){const e=l.useRef(null),n=l.useRef(null);l.useEffect(()=>{if(!t)return;n.current=document.activeElement;const o=e.current;return o?((o.querySelector(f)??o).focus(),()=>{n.current?.focus?.()}):void 0},[t]);const r=l.useCallback(o=>{if(!t||o.key!=="Tab")return;const s=e.current;if(!s)return;const c=Array.from(s.querySelectorAll(f));if(c.length===0){o.preventDefault(),s.focus();return}const u=c[0],a=c[c.length-1],i=document.activeElement;o.shiftKey?(i===u||!s.contains(i))&&(o.preventDefault(),a.focus()):i===a&&(o.preventDefault(),u.focus())},[t]);return{ref:e,onKeyDown:r}}function p(t){return Array.from(t.querySelectorAll([":scope > button:not([disabled])",":scope > [role='button']:not([aria-disabled='true'])",":scope > * > button[data-list-primary]:not([disabled])"].join(", ")))}function b(t,e){t.forEach((n,r)=>{n.tabIndex=r===e?0:-1}),t[e]?.focus()}function S(){return l.useCallback(t=>{const e=t.key==="ArrowDown"||t.key==="j",n=t.key==="ArrowUp"||t.key==="k",r=t.key==="Home"||t.key==="g"&&!t.shiftKey&&!t.metaKey&&!t.ctrlKey,o=t.key==="End"||t.key==="G";if(!e&&!n&&!r&&!o)return;const s=p(t.currentTarget);if(s.length===0)return;const c=document.activeElement,u=s.findIndex(i=>i===c);let a;e?a=u<0?0:Math.min(s.length-1,u+1):n?a=u<0?s.length-1:Math.max(0,u-1):r?a=0:a=s.length-1,t.preventDefault(),b(s,a)},[])}function T(t,e,n){return t||!e&&n?0:-1}function v(){l.useEffect(()=>{const t=e=>{if(e.key!=="["&&e.key!=="]"||m(e.target))return;const n=e.target,r=["left","center","right"],o=e.key==="]"?1:-1,s=r.findIndex(u=>{const a=document.querySelector(`[data-pane="${u}"]`);return a?a.contains(n):!1}),c=s<0?o>0?-1:r.length:s;for(let u=c+o;u>=0&&u<r.length;u+=o){const a=document.querySelector(`[data-pane="${r[u]}"]`);if(!a)continue;const i=a.querySelector(f);if(i){e.preventDefault(),i.focus();return}}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[])}function L(t){l.useEffect(()=>{const e=n=>{if(n.key!=="/"||m(n.target))return;const r=t();r&&(n.preventDefault(),r.focus(),r.select())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t])}function A(t){return e=>{if(e.key!=="ArrowDown")return;const n=t();if(!n)return;const r=p(n);if(r.length===0)return;const o=r.findIndex(c=>c.tabIndex===0),s=o>=0?o:0;e.preventDefault(),b(r,s)}}export{S as a,L as b,h as c,v as d,k as e,x as f,m as i,A as m,g as n,T as r,w as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c}from"./index-
|
|
1
|
+
import{r as c}from"./index-o4FKpU7Z.js";let s=null;const o=new Set;function d(e,t){return e===t?!0:!e||!t?!1:e.live===t.live&&e.harness===t.harness&&e.actionGlyph===t.actionGlyph&&e.actionLabel===t.actionLabel&&e.actionMeta===t.actionMeta&&e.countsLabel===t.countsLabel&&e.strip.length===t.strip.length&&e.strip.every((n,r)=>n===t.strip[r])}function L(e,t){return e.id===t.id&&e.label===t.label&&e.statusLabel===t.statusLabel&&e.tone===t.tone&&e.agentId===t.agentId&&e.updatedAt===t.updatedAt&&d(e.floor,t.floor)}function p(e,t){return e===t?!0:e===null||t===null||e.length!==t.length?!1:e.every((n,r)=>L(n,t[r]))}function E(e){if(!p(s,e)){s=e;for(const t of o)t()}}function g(e){return o.add(e),()=>{o.delete(e)}}function i(){return s}function I(){return c.useSyncExternalStore(g,i,i)}let u=null;const l=new Set;function y(e){if(u!==e){u=e;for(const t of l)t()}}function h(e){return l.add(e),()=>{l.delete(e)}}function a(){return u}function F(){return c.useSyncExternalStore(h,a,a)}let f=null;function v(e){f=e}function R(){return f}export{y as a,F as b,R as g,E as p,v as s,I as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as N,j as e}from"./index-o4FKpU7Z.js";import{a as I}from"./api-h5zurxmi.js";import{d as L,e as j,s as R}from"./router-C65cZYPn.js";import{u as $,r as y,s as b,i as C}from"./mesh-ops-JZwGuAPn.js";import{u as E,s as T}from"./mesh-view-store-Du7VqIT_.js";import{u as A}from"./Provider-DKZWuzSR.js";import{R as h}from"./RailRow-DIGd3MMM.js";import{u as U}from"./use-mesh-ops-items-D5L-CKe_.js";/* empty css */import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./provider-BvAxRQfE.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";function S(s){return s.hostName?.split(".")[0]??s.name??s.id.slice(0,12)}function yt(){const{route:s,navigate:u}=A(),l=L(s),{items:i,unattributedOnly:m,lab:M,refreshToken:g}=$(),{meshSnapshot:r}=E();U(l);const[w]=N.useState(()=>y());N.useEffect(()=>{let t=!1;return I("/api/mesh").then(o=>{t||T(o)}).catch(()=>{}),()=>{t=!0}},[g]);const c=t=>{b(!1),u(t?R(s,t):j(s))},O=()=>{u(j(s)),b(!0)},p=r?.localNode??null,d=r?Object.values(r.nodes).filter(t=>t.id!==p?.id):[],a=t=>M.lastLook?t.filter(o=>C(o,w)).length:0,x=i.filter(t=>t.hostNodeId===null),f=t=>{const o=i.filter(k=>k.hostNodeId===t.id),n=a(o),v=l===t.id;return e.jsx(h,{name:S(t),meta:o.length>0?`${n>0?`${n}·`:""}${o.length}`:"—",tone:n>0?"needs_attention":"neutral",active:v,unread:n>0,onClick:()=>c(v?null:t.id),title:`Scope the list to ${S(t)}`},t.id)};return e.jsxs("div",{className:"ctx-panel mesh-ops-rail",children:[e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Mesh"}),e.jsx(h,{name:"everywhere",meta:`${a(i)>0?`${a(i)}·`:""}${i.length}`,tone:a(i)>0?"needs_attention":"neutral",active:l===null&&!m,onClick:()=>c(null),title:"Show items across all hosts"})]}),p&&e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"This host"}),f(p)]}),d.length>0&&e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Peers"}),d.map(t=>f(t))]}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"No venue"}),e.jsx(h,{name:"unattributed",meta:x.length>0?String(x.length):"—",tone:"neutral",active:m,onClick:()=>m?c(null):O(),title:"Items with no venue host"})]}),!r&&e.jsx("div",{className:"ctx-panel-empty",children:"Loading mesh…"})]})}export{yt as MeshOpsLeft};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as m,j as t}from"./index-o4FKpU7Z.js";import{u as re,L as W}from"./usePersistentState-D3M4m2Ou.js";import{a as le,f as oe,b as ce,c as me,d as de,s as ue}from"./terminal-sessions-AmSgHklm.js";import{a as ve,b as pe,r as G,m as he}from"./keyboard-nav-Chf51dns.js";import{u as be}from"./Provider-DKZWuzSR.js";import{c as fe}from"./colors-BtO5_zlx.js";import{r as P,c as xe}from"./terminal-relay-CjkI5aUy.js";import{t as ye,a as H,s as je,b as y,P as ge}from"./session-table-CYN8e4s3.js";/* empty css */import{R as ke}from"./refresh-cw-B5To7b6B.js";import{A as Ne}from"./activity-BvGruxWG.js";import{C as we}from"./clock-of01sAB6.js";import{F as Se}from"./DocumentFocusViewer-DRKjNG9s.js";import{c as Ae}from"./createLucideIcon-Bt67PWH-.js";import{C as Ie}from"./chevron-right-C10o7t_X.js";import{E as U}from"./eye-B3lBIwJZ.js";import{T as Ee}from"./terminal-By1Lw2i2.js";import"./api-h5zurxmi.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./TextDocumentSurface-Bc-kHPgG.js";import"./file-text-iF0hyVyU.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-ynOfVadO.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";/* empty css */const Te=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Ce=Ae("layers",Te),Re=[{id:"fleet",label:"Fleet",title:"Group by fleet: herdr, tmux, background"},{id:"places",label:"Places",title:"Group by project"},{id:"time",label:"Time",title:"Group by last activity"},{id:"attention",label:"Attention",title:"Group by attention state: attached, live, detached, exited"}],Me=[{id:"herdr",label:"Herdr"},{id:"tmux-named",label:"Tmux"},{id:"tmux-auto",label:"Tmux · auto"},{id:"external",label:"Background"}],Le=900*1e3,$e=1440*60*1e3,_e=10080*60*1e3,V=[{key:"now",label:"Now",maxAgeMs:Le},{key:"today",label:"Today",maxAgeMs:$e},{key:"week",label:"This week",maxAgeMs:_e},{key:"older",label:"Older",maxAgeMs:null},{key:"unknown",label:"Unknown",maxAgeMs:null}],Oe=[{key:"attached",label:"Attached",rank:3},{key:"live",label:"Live",rank:2},{key:"detached",label:"Detached",rank:1},{key:"exited",label:"Exited",rank:0}];function Fe(a){return Me.map(n=>({key:n.id,label:n.label,items:a.filter(l=>le(l)===n.id)})).filter(n=>n.items.length>0)}function Ke(a){const n=new Map;for(const i of a){const o=n.get(i.project);o?o.push(i):n.set(i.project,[i])}const l=new Set(["backend-only","unscoped"]),r=[...n.entries()].map(([i,o])=>({key:`project:${i}`,label:i,items:o,latestActivity:Math.max(...o.map(d=>H(d)??0)),isCatchAll:l.has(i)}));return r.sort((i,o)=>i.isCatchAll!==o.isCatchAll?i.isCatchAll?1:-1:i.latestActivity!==o.latestActivity?o.latestActivity-i.latestActivity:i.label.localeCompare(o.label,void 0,{numeric:!0,sensitivity:"base"})),r.map(({key:i,label:o,items:d})=>({key:i,label:o,items:d}))}function Be(a,n){const l=r=>{const i=H(r);if(i===null)return"unknown";const o=Math.max(0,n-i);for(const d of V)if(d.maxAgeMs!==null&&o<d.maxAgeMs)return d.key;return"older"};return V.map(r=>({key:r.key,label:r.label,items:a.filter(i=>l(i)===r.key)})).filter(r=>r.items.length>0)}function De(a){return Oe.map(n=>({key:n.key,label:n.label,items:a.filter(l=>ye(l)===n.rank)})).filter(n=>n.items.length>0)}function ze(a,n,l=Date.now()){switch(n){case"fleet":return Fe(a);case"places":return Ke(a);case"time":return Be(a,l);case"attention":return De(a)}}const We=8e3,Ge=[{id:"recent",label:"Recent"},{id:"name",label:"A–Z"}],Pe={fleet:Ce,places:Se,time:we,attention:Ne};function Gt(){const{route:a,navigate:n,agents:l}=be(),[r,i]=m.useState({state:"loading",sessions:[]}),[o,d]=m.useState(""),[f,Q]=m.useState("recent"),[A,Y]=re("terminal-nav-mode","fleet"),[Z,J]=m.useState(!1),[X,M]=m.useState(null),[L,$]=m.useState(null),_=m.useRef(null),O=m.useRef(null),ee=ve(),te=he(()=>O.current);pe(m.useCallback(()=>_.current,[]));const x=m.useCallback((e={})=>{e.silent||i(s=>({state:"loading",sessions:s.sessions})),oe({includeDiscovered:!0}).then(s=>{i({state:"ready",sessions:s})}).catch(s=>{e.silent||i(c=>({state:"failed",sessions:c.sessions,error:s instanceof Error?s.message:String(s)}))})},[]);m.useEffect(()=>{x()},[x]),m.useEffect(()=>{const e=()=>{document.visibilityState==="visible"&&x({silent:!0})},s=window.setInterval(e,We);return window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),()=>{window.clearInterval(s),window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}},[x]);const k=m.useMemo(()=>ce(r.sessions),[r.sessions]),p=m.useMemo(()=>je(me(k),f==="recent"?{column:"activity",direction:"desc"}:{column:"name",direction:"asc"}),[f,k]),j=m.useMemo(()=>Ue(l,f).filter(e=>{const s=P(e);return s?!k.some(c=>c.surface.backend===s.backend&&c.surface.sessionName===s.sessionName&&(s.paneId==null||c.surface.paneId===s.paneId)):!0}),[l,k,f]),u=o.trim().toLowerCase(),g=u?p.filter(e=>e.searchable.includes(u)):p,N=g.filter(e=>y(e)==="current"),ae=ze(N,A),w=g.filter(e=>y(e)==="inactive"),h=g.filter(e=>y(e)==="review"),F=u?w.length+h.length:p.filter(e=>y(e)!=="current").length,K=u?h.length:p.filter(e=>y(e)==="review").length,S=Z||!!u,v=u?j.filter(e=>qe(e).includes(u)):j,ne=a.view==="terminal"?a.terminalSurfaceKey??null:null,B=a.view==="terminal"?a.terminalSessionId??null:null,I=e=>de(e.key,ne)&&(!B||e.session.id===B),E=a.view==="terminal"&&a.agentId?`agent:${a.agentId}`:null,D=!!(N.some(I)||S&&[...w,...h].some(I)||E!=null&&v.some(e=>`agent:${e.id}`===E)),z=N[0]?.id??(S?w[0]?.id??h[0]?.id:void 0)??(v[0]?`agent:${v[0].id}`:void 0),se=r.state==="loading"?"Syncing":u?`${g.length+v.length}/${p.length+j.length}`:`${p.length+j.length} targets`,T=(e,s)=>({view:"terminal",terminalSessionId:e.session.id,terminalSurfaceKey:ue(e.surface),...s?{mode:s}:{}}),C=(e,s="takeover")=>({view:"terminal",agentId:e.id,mode:s}),ie=async e=>{if(e.surface.backend==="tmux"&&window.confirm(`Release inactive terminal ${e.surface.sessionName}? The tmux surface will stop, but any associated Scout agent remains available and can be started again.`)){M(e.id),$(null);try{await xe({backend:"tmux",sessionName:e.surface.sessionName,paneId:e.surface.paneId??null,socketDir:e.surface.socketDir??null},"release"),x({silent:!0})}catch(s){$(s instanceof Error?s.message:String(s))}finally{M(null)}}},R=e=>{const s=I(e),c=y(e),b=X===e.id;return t.jsxs("div",{className:`terminal-nav-row${s?" terminal-nav-row--active":""}${c==="review"?" terminal-nav-row--review":""}`,title:e.surface.sessionName,children:[t.jsxs("button",{type:"button","data-list-primary":!0,className:"terminal-nav-row-select",tabIndex:G(s,D,e.id===z),onClick:()=>n(T(e)),children:[t.jsx(Ee,{className:"terminal-nav-row-icon",size:14,strokeWidth:1.7}),t.jsxs("span",{className:"terminal-nav-row-main",children:[t.jsx("span",{className:"terminal-nav-row-title",children:t.jsx("span",{children:e.title})}),t.jsx("span",{className:"terminal-nav-row-detail",children:e.detail||e.session.sourceSessionId})]}),t.jsxs("span",{className:"terminal-nav-badges",children:[t.jsx("span",{className:"terminal-nav-badge terminal-nav-badge--backend",children:e.surface.backend}),t.jsx("span",{className:`terminal-nav-badge${c==="review"?" terminal-nav-badge--review":""}`,children:c==="current"?e.condition:c})]})]}),t.jsxs("div",{className:"terminal-nav-row-actions",children:[t.jsxs("button",{type:"button",className:`terminal-nav-action${a.view==="terminal"&&s&&a.mode==="takeover"?" terminal-nav-action--selected":""}`,onClick:()=>n(T(e,"takeover")),title:"Enter this terminal","aria-label":"Enter this terminal",children:[t.jsx(W,{size:12,strokeWidth:1.8}),t.jsx("span",{children:"Enter"})]}),t.jsxs("button",{type:"button",className:`terminal-nav-action${a.view==="terminal"&&s&&a.mode==="observe"?" terminal-nav-action--selected":""}`,onClick:()=>n(T(e,"observe")),title:"Observe this terminal read-only","aria-label":"Observe this terminal read-only",children:[t.jsx(U,{size:12,strokeWidth:1.8}),t.jsx("span",{children:"Observe"})]}),c==="review"&&e.surface.backend==="tmux"&&t.jsxs("button",{type:"button",className:"terminal-nav-action terminal-nav-action--release",onClick:()=>{ie(e)},disabled:b,title:"Release this inactive tmux surface; keep the agent","aria-label":"Release this inactive tmux surface; keep the agent",children:[t.jsx(ge,{size:12,strokeWidth:1.8}),t.jsx("span",{children:b?"Releasing":"Release"})]})]})]},e.id)};return t.jsxs("div",{className:"ctx-panel terminal-nav",children:[t.jsxs("div",{className:"terminal-nav-head",children:[t.jsxs("div",{children:[t.jsx("div",{className:"terminal-nav-title",children:"Terminals"}),t.jsx("div",{className:"terminal-nav-summary",children:se})]}),t.jsx("button",{type:"button",className:"terminal-nav-refresh",onClick:()=>x(),disabled:r.state==="loading",title:"Refresh terminals","aria-label":"Refresh terminals",children:t.jsx(ke,{size:14,strokeWidth:1.8})})]}),t.jsx("div",{className:"terminal-nav-modes",role:"group","aria-label":"Group terminals",children:Re.map(e=>{const s=Pe[e.id];return t.jsx("button",{type:"button",title:e.title,"aria-label":e.title,"aria-pressed":A===e.id,className:`terminal-nav-mode${A===e.id?" terminal-nav-mode--active":""}`,onClick:()=>Y(e.id),children:t.jsx(s,{size:13,strokeWidth:1.8})},e.id)})}),t.jsxs("div",{className:"ctx-panel-toolbar terminal-nav-toolbar",children:[t.jsx("input",{ref:_,type:"text",className:"ctx-panel-search-input",placeholder:"Search… (/)",value:o,onChange:e=>d(e.target.value),onKeyDown:te}),t.jsx("div",{className:"ctx-panel-sort",role:"group","aria-label":"Sort terminals",children:Ge.map(e=>t.jsx("button",{type:"button",title:e.id==="recent"?"Sort by most recent":"Sort alphabetically","aria-pressed":f===e.id,className:`ctx-panel-sort-option${f===e.id?" ctx-panel-sort-option--active":""}`,onClick:()=>Q(e.id),children:e.label},e.id))})]}),r.state==="failed"&&t.jsx("div",{className:"terminal-nav-error",children:r.error}),L&&t.jsx("div",{className:"terminal-nav-error",children:L}),t.jsx("div",{ref:O,className:"terminal-nav-list",onKeyDown:ee,children:g.length===0&&v.length===0&&r.state!=="loading"?t.jsx("div",{className:"ctx-panel-empty",children:p.length+j.length===0?"No terminal targets":"No matches"}):t.jsxs(t.Fragment,{children:[ae.map(e=>e.items.length===0?null:t.jsxs("div",{className:"terminal-nav-section",children:[t.jsxs("div",{className:"terminal-nav-section-title",children:[t.jsx("span",{children:e.label}),t.jsx("span",{children:e.items.length})]}),e.items.map(R)]},e.key)),N.length===0&&r.state!=="loading"&&t.jsx("div",{className:"terminal-nav-empty",children:"No sessions"}),F>0&&t.jsxs("div",{className:"terminal-nav-section terminal-nav-section--inactive",children:[t.jsxs("button",{type:"button",className:"terminal-nav-inactive-toggle","aria-expanded":S,onClick:()=>J(e=>!e),children:[t.jsx(Ie,{size:13,strokeWidth:1.8}),t.jsx("span",{children:"Inactive"}),t.jsx("span",{children:F}),K>0&&t.jsxs("span",{className:"terminal-nav-review-count",children:[K," review"]})]}),S&&t.jsxs(t.Fragment,{children:[w.map(R),h.length>0&&t.jsxs("div",{className:"terminal-nav-section-title terminal-nav-section-title--review",children:[t.jsx("span",{children:"Review after 30 days"}),t.jsx("span",{children:h.length})]}),h.map(R)]})]}),t.jsxs("div",{className:"terminal-nav-section",children:[t.jsxs("div",{className:"terminal-nav-section-title",children:[t.jsx("span",{children:"Available agents"}),t.jsx("span",{children:v.length})]}),v.map(e=>{const s=`agent:${e.id}`,c=s===E,b=P(e);return t.jsxs("div",{className:`terminal-nav-row terminal-nav-row--agent${c?" terminal-nav-row--active":""}`,title:e.name,children:[t.jsxs("button",{type:"button","data-list-primary":!0,className:"terminal-nav-row-select",tabIndex:G(c,D,s===z),onClick:()=>n(C(e)),children:[t.jsx("span",{className:`terminal-nav-agent-dot${b?" terminal-nav-agent-dot--bound":""}`,"aria-hidden":!0}),t.jsxs("span",{className:"terminal-nav-row-main",children:[t.jsx("span",{className:"terminal-nav-row-title",children:t.jsx("span",{children:e.name})}),t.jsx("span",{className:"terminal-nav-row-detail",children:Ve(e)})]}),t.jsxs("span",{className:"terminal-nav-badges",children:[t.jsx("span",{className:"terminal-nav-badge terminal-nav-badge--backend",children:b?.backend??e.harness??"agent"}),t.jsx("span",{className:"terminal-nav-badge",children:b?"bound":fe(e.state)})]})]}),t.jsxs("div",{className:"terminal-nav-row-actions",children:[t.jsxs("button",{type:"button",className:`terminal-nav-action${a.view==="terminal"&&c&&a.mode==="takeover"?" terminal-nav-action--selected":""}`,onClick:()=>n(C(e,"takeover")),title:"Enter this agent terminal","aria-label":"Enter this agent terminal",children:[t.jsx(W,{size:12,strokeWidth:1.8}),t.jsx("span",{children:"Enter"})]}),b&&t.jsxs("button",{type:"button",className:`terminal-nav-action${a.view==="terminal"&&c&&a.mode==="observe"?" terminal-nav-action--selected":""}`,onClick:()=>n(C(e,"observe")),title:"Observe this agent terminal read-only","aria-label":"Observe this agent terminal read-only",children:[t.jsx(U,{size:12,strokeWidth:1.8}),t.jsx("span",{children:"Observe"})]})]})]},e.id)}),v.length===0&&t.jsx("div",{className:"terminal-nav-empty",children:"No agents"})]})]})})]})}function Ue(a,n){return[...a].filter(l=>!l.retiredFromFleet&&!l.staleLocalRegistration).sort((l,r)=>{const i=l.name.localeCompare(r.name,void 0,{numeric:!0,sensitivity:"base"});return n==="name"?i||l.id.localeCompare(r.id):(r.updatedAt??0)-(l.updatedAt??0)||i||l.id.localeCompare(r.id)})}function Ve(a){const n=a.project??q(a.cwd)??q(a.projectRoot)??a.definitionId;return[a.handle?`@${a.handle}`:null,a.harness,n,a.branch].filter(Boolean).join(" · ")}function qe(a){return[a.name,a.handle,a.harness,a.state,a.project,a.branch,a.cwd,a.projectRoot,a.definitionId].filter(Boolean).join(" ").toLowerCase()}function q(a){const n=a?.trim().replace(/\/+$/u,"");return n?n.split("/").pop()||n:null}export{Gt as TerminalLeft};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as h,j as i}from"./index-o4FKpU7Z.js";/* empty css */import{u as Ot,m as Gt,g as _t,i as Dt}from"./Provider-DKZWuzSR.js";import{a as Vt,b as Ft,m as Kt,r as qt}from"./keyboard-nav-Chf51dns.js";import{n as ct,g as wt}from"./colors-BtO5_zlx.js";import{j as Ht,a as N,k as jt,l as lt,i as Mt,n as Qt}from"./conversation-model-CHwHZNw-.js";import{l as Wt,i as $,a as M,p as yt,t as Yt,b as zt}from"./conversation-prefs-DNre-Lcx.js";import{i as Jt,l as Xt,s as Zt}from"./sessionRead-CvFz2RHv.js";import{u as te}from"./ContextMenu-CxkmFQcN.js";import{t as at}from"./time-Dhsh_2EG.js";import{u as ee}from"./use-conversation-list-BCzY032j.js";import{u as ne}from"./use-fleet-active-asks-CJ6-oj5k.js";import{d as oe}from"./router-C65cZYPn.js";import{R as Nt}from"./RailRow-DIGd3MMM.js";import"./provider-BvAxRQfE.js";import"./api-h5zurxmi.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";function Y(t){const n=t.split("/").filter(Boolean);return n[n.length-1]??t}function $t(t){const n=t.replace(/\/+$/,"").split("/");return n[n.length-1]??t}function se(t,n){const o=Y(n).toLowerCase(),r=t.filter(p=>!!p.projectRoot),c=r.filter(p=>$t(p.projectRoot).toLowerCase()===o),d=c.length>0?c:r,s=ie(d);return s?{label:(c.length>0?d.find(p=>p.projectRoot===s):[...d].sort((p,w)=>w.lastActivityAt-p.lastActivityAt)[0])?.project??Y(n),canonicalRoot:s}:{label:Y(n),canonicalRoot:null}}function ie(t){const n=new Map;for(const d of t){const s=n.get(d.projectRoot)??{count:0,latest:0};s.count+=1,s.latest=Math.max(s.latest,d.lastActivityAt),n.set(d.projectRoot,s)}let o=null,r=-1,c=-1;for(const[d,s]of n)(s.count>r||s.count===r&&s.latest>c)&&(o=d,r=s.count,c=s.latest);return o}function Ct(t,n,o,r){const c=new Map;for(const s of t){const f=Ht(s),p=s.agentId?n.get(s.agentId):void 0,w=p?.repoKey??null,u=p?.project??null,C=(s.agentName??N(s)).trim(),m=f?`channel:${s.id}`:w?`repo:${w.toLowerCase()}`:u?`project:${u.toLowerCase()}`:C?`name:${C.toLowerCase()}`:`dm:${s.id}`,y=f?N(s):w?Y(w):u??C??N(s);let j=c.get(m);if(j||(j={key:m,label:y,isChannel:f,conversations:[],bestState:"blocked",latestUpdate:0,unreadCount:0,canonicalRoot:null},c.set(m,j)),j.conversations.push(s),j.latestUpdate=Math.max(j.latestUpdate,s.lastMessageAt??0),Jt(s.lastMessageAt,s.id,o)&&(j.unreadCount+=1),!f&&p){const g=ct(p.state);wt(g)<wt(j.bestState)&&(j.bestState=g)}}for(const s of c.values()){if(s.key.startsWith("repo:")){const f=s.conversations.map(w=>{const u=w.agentId?n.get(w.agentId):void 0;return{project:u?.project??null,projectRoot:u?.projectRoot??null,lastActivityAt:w.lastMessageAt??0}}),p=se(f,s.key.slice(5));s.label=p.label,s.canonicalRoot=p.canonicalRoot}s.conversations.sort((f,p)=>(p.lastMessageAt??0)-(f.lastMessageAt??0))}const d=Array.from(c.values());return d.sort((s,f)=>f.latestUpdate-s.latestUpdate),d}const ae=12;function ln(){const{route:t,navigate:n,agents:o,apiConnection:r}=Ot(),{sessions:c,loading:d,loadError:s,reload:f}=ee(),[p,w]=h.useState(()=>Xt()),[u,C]=h.useState(()=>Wt()),[m,y]=h.useState(""),[j,g]=h.useState(()=>new Set),[b,l]=h.useState(!1),[R,L]=h.useState(!1),[q,J]=h.useState(!1),k=ne(),H=oe(t),O=h.useMemo(()=>Gt(o,H),[o,H]),I=h.useMemo(()=>{const e=new Map,a=O?o.filter(v=>O.has(v.id)):o;for(const v of a)e.set(v.id,v);return e},[o,O]),T=t.view==="messages"||t.view==="conversation"||t.view==="agent-info"||t.view==="agents-v2"?t.conversationId:void 0;h.useEffect(()=>{L(!1)},[m]);const G=h.useMemo(()=>_t(c,O,H),[c,O,H]),X=h.useMemo(()=>m?G.filter(e=>kt(e,m)):G,[G,m]),_=h.useMemo(()=>{const e=a=>(a.agentId?k.get(a.agentId)?.updatedAt:void 0)??0;return G.filter(a=>$(a.id,u)||!jt(a)?!1:(a.agentId?k.get(a.agentId):void 0)?.status==="needs_attention").sort((a,v)=>e(v)-e(a))},[G,u,k]),D=h.useMemo(()=>m?_.filter(e=>kt(e,m)):_,[_,m]),x=h.useMemo(()=>{const e=X.filter(A=>!$(A.id,u)),a=W(X.filter(A=>$(A.id,u))),v=e.filter(A=>M(A.id,u)).sort((A,xt)=>yt(xt.id,u)-yt(A.id,u)||(xt.lastMessageAt??0)-(A.lastMessageAt??0)),K=e.filter(A=>!M(A.id,u)),it=K.filter(lt),bt=K.filter(jt),Et=K.filter(Mt);return{pinned:v,channels:W(it),agents:Ct(W(bt),I,p),observed:Ct(W(Et),I,p),archived:a}},[X,I,p,u]),dt=te(),V=h.useCallback(e=>{C(a=>Yt(e,a))},[]),F=h.useCallback(e=>{C(a=>zt(e,a))},[]),S=h.useCallback(e=>{w(Zt(e.id)),n({view:"messages",conversationId:e.id})},[n]),P=h.useCallback((e,a)=>{const v=M(a.id,u),K=$(a.id,u),it=N(a);dt(e,[{kind:"action",label:"Open",onSelect:()=>S(a)},{kind:"separator"},{kind:"action",label:v?"Unpin":"Pin to top",onSelect:()=>V(a.id)},{kind:"action",label:K?"Unarchive":"Archive",onSelect:()=>F(a.id)},{kind:"separator"},{kind:"action",label:"Copy name",onSelect:()=>{navigator.clipboard?.writeText(it).catch(()=>{})}}])},[u,S,V,F,dt]),ut=e=>{g(a=>{const v=new Set(a);return v.has(e)?v.delete(e):v.add(e),v})},Tt=r.status==="offline"||Dt(s),pt=h.useRef(null),mt=h.useRef(null),Pt=Vt(),Ut=Kt(()=>pt.current);Ft(h.useCallback(()=>mt.current,[]));const Z=x.pinned.length,tt=x.channels.length,et=x.agents.reduce((e,a)=>e+a.conversations.length,0),nt=x.observed.reduce((e,a)=>e+a.conversations.length,0),Q=x.archived.length,ht=Z+tt+et+nt+Q,Bt=b||!!m,ot=h.useMemo(()=>{const e=[];for(const a of D)e.push({rowId:`ny-${a.id}`,id:a.id});for(const a of x.pinned)e.push({rowId:`pin-${a.id}`,id:a.id});for(const a of x.agents)for(const v of a.conversations)e.push({rowId:v.id,id:v.id});for(const a of x.channels)e.push({rowId:a.id,id:a.id});for(const a of x.observed)for(const v of a.conversations)e.push({rowId:v.id,id:v.id});for(const a of x.archived)e.push({rowId:`arch-${a.id}`,id:a.id});return e},[D,x]),U=h.useMemo(()=>({activeId:T,activeRowId:T?ot.find(e=>e.id===T)?.rowId:void 0,firstRowId:ot[0]?.rowId}),[T,ot]),vt=R||m?x.observed:x.observed.slice(0,ae),ft=Math.max(0,x.observed.length-vt.length),gt=e=>!!(m||j.has(e.key)||T&&e.conversations.some(a=>a.id===T)),st=e=>i.jsx(rt,{pinned:M(e.id,u),archived:$(e.id,u),onTogglePin:()=>V(e.id),onToggleArchive:()=>F(e.id)});return i.jsxs("div",{className:"ctx-panel",children:[i.jsxs("div",{className:"ctx-panel-toolbar",children:[i.jsx("input",{ref:mt,type:"text",className:"ctx-panel-search-input",placeholder:"Filter… (/)",value:m,onChange:e=>y(e.target.value),onKeyDown:Ut}),_.length>0&&i.jsx("span",{className:"ctx-panel-rail-stat",title:"Asks waiting on your reply",children:ce(_.length)})]}),i.jsx("div",{ref:pt,className:["ctx-panel-list","ctx-panel-list--scroll",ht===0&&"ctx-panel-list--empty"].filter(Boolean).join(" "),onKeyDown:Pt,children:ht===0?i.jsx(re,{query:m,loading:d,error:s,apiOffline:Tt,onRetry:()=>{f(!0)}}):i.jsxs(i.Fragment,{children:[D.length>0&&i.jsx(B,{label:"Needs you",count:D.length,hint:"Asks waiting on your reply",children:D.map(e=>i.jsx(E,{rowId:`ny-${e.id}`,session:e,nav:U,agentById:I,asksByAgent:k,onSelect:S,onContextMenu:P},`ny-${e.id}`))}),Z>0&&i.jsx(B,{label:"Pinned",count:Z,hint:"Pinned conversations",children:x.pinned.map(e=>i.jsx(E,{rowId:`pin-${e.id}`,session:e,nav:U,agentById:I,asksByAgent:k,pinned:!0,actions:st(e),onSelect:S,onContextMenu:P},`pin-${e.id}`))}),et>0&&i.jsx(B,{label:"Agents",count:et,children:x.agents.map(e=>i.jsx(At,{group:e,isOpen:gt(e),nav:U,agentById:I,asksByAgent:k,prefs:u,onToggle:()=>ut(e.key),onSelect:S,onTogglePin:V,onToggleArchive:F,onContextMenu:P},e.key))}),tt>0&&i.jsx(B,{label:"Channels",count:tt,children:x.channels.map(e=>i.jsx(E,{rowId:e.id,session:e,nav:U,agentById:I,asksByAgent:k,actions:st(e),onSelect:S,onContextMenu:P},e.id))}),nt>0&&i.jsxs(B,{label:"Observed",count:nt,hint:"Agent conversations you’re not in",open:Bt,onToggle:()=>l(e=>!e),children:[vt.map(e=>i.jsx(At,{group:e,isOpen:gt(e),nav:U,agentById:I,asksByAgent:k,prefs:u,observed:!0,onToggle:()=>ut(e.key),onSelect:S,onTogglePin:V,onToggleArchive:F,onContextMenu:P},e.key)),ft>0?i.jsxs("button",{type:"button",className:"ctx-panel-more",onClick:()=>L(!0),children:["+ ",ft," more observed"]}):null]}),Q>0&&i.jsxs(B,{label:"Archived",count:Q,hint:"Hidden from the main rail",children:[i.jsx("button",{type:"button",className:"ctx-panel-more",onClick:()=>J(e=>!e),children:q?"▾ hide archived":`› show ${Q} archived`}),q?x.archived.map(e=>i.jsx(E,{rowId:`arch-${e.id}`,session:e,nav:U,agentById:I,asksByAgent:k,actions:st(e),onSelect:S,onContextMenu:P},`arch-${e.id}`)):null]})]})})]})}function B({label:t,count:n,hint:o,open:r,onToggle:c,children:d}){return c?i.jsxs("section",{className:"ctx-panel-rail-section","aria-label":t,children:[i.jsxs("button",{type:"button",className:"ctx-panel-section-label ctx-panel-section-toggle",title:o,"aria-expanded":!!r,onClick:c,children:[i.jsxs("span",{className:"ctx-panel-section-toggle-label",children:[i.jsx("span",{className:"ctx-panel-section-chevron","aria-hidden":!0,children:r?"▾":"▸"}),t]}),i.jsx("span",{className:"ctx-panel-count",children:n})]}),r?i.jsx("div",{className:"ctx-panel-rail-section-body",children:d}):null]}):i.jsxs("section",{className:"ctx-panel-rail-section","aria-label":t,children:[i.jsxs("div",{className:"ctx-panel-section-label",title:o,children:[i.jsx("span",{children:t}),i.jsx("span",{className:"ctx-panel-count",children:n})]}),i.jsx("div",{className:"ctx-panel-rail-section-body",children:d})]})}function rt({pinned:t,archived:n,onTogglePin:o,onToggleArchive:r}){return i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:["rr-row-action",t&&"rr-row-action--on"].filter(Boolean).join(" "),title:t?"Unpin":"Pin to top","aria-label":t?"Unpin":"Pin",onClick:c=>{c.stopPropagation(),o()},children:t?"Unpin":"Pin"}),i.jsx("button",{type:"button",className:["rr-row-action",n&&"rr-row-action--on"].filter(Boolean).join(" "),title:n?"Unarchive":"Archive","aria-label":n?"Unarchive":"Archive",onClick:c=>{c.stopPropagation(),r()},children:n?"Restore":"Archive"})]})}function E({session:t,rowId:n,nav:o,agentById:r,asksByAgent:c,pinned:d,depth:s,actions:f,worktreeLabel:p,onSelect:w,onContextMenu:u}){const C=t.id===o.activeId,m=N(t),y=lt(t),j=Mt(t),g=t.agentId?r.get(t.agentId):void 0,b=t.agentId?c.get(t.agentId):void 0,l=!y&&!j&&b?.status==="needs_attention",R=Rt(t,g),L=y?`${t.participantIds.length} members`:R.toLowerCase()===m.toLowerCase()?void 0:R,q=!y&&b?ue(t,g,b):L;return i.jsx(Nt,{depth:s,name:s===1?It(t,g,b):m,sub:s===1?Rt(t,g):q,meta:b?at(b.updatedAt):t.lastMessageAt?at(t.lastMessageAt):void 0,tone:y?"channel":b?de(g,b):g?ct(g.state):"dm",avatarName:s===1?g?.name??It(t,g,b):m,avatarKind:y?"channel":"user",active:C,unread:l,pinned:d,activityLabel:b?Lt(b):void 0,activityTone:b?le(b):void 0,worktreeLabel:p??void 0,title:s===1?pe(t,g,b):void 0,actions:f,tabIndex:qt(n===o.activeRowId,o.activeRowId!==void 0,n===o.firstRowId),onClick:()=>w(t),onContextMenu:u?J=>u(J,t):void 0})}function At({group:t,isOpen:n,nav:o,agentById:r,asksByAgent:c,prefs:d,observed:s,onToggle:f,onSelect:p,onTogglePin:w,onToggleArchive:u,onContextMenu:C}){if(t.conversations.length===1){const l=t.conversations[0];return i.jsx(E,{rowId:l.id,session:l,nav:o,agentById:r,asksByAgent:c,pinned:M(l.id,d),actions:i.jsx(rt,{pinned:M(l.id,d),archived:$(l.id,d),onTogglePin:()=>w(l.id),onToggleArchive:()=>u(l.id)}),onSelect:p,onContextMenu:C})}const m=t.conversations.map(l=>l.agentId?c.get(l.agentId):void 0).filter(l=>!!l),y=m.length,j=m.filter(l=>l.status==="working").length,g=m.filter(l=>l.status==="needs_attention").length,b=t.conversations.some(l=>l.id===o.activeId);return i.jsxs("div",{children:[i.jsx(Nt,{name:t.label,meta:y>0?`${y} active · ${St(t)}`:St(t),tone:j>0?"in_turn":t.bestState,caret:n?"open":"closed",active:b&&!n,unread:!s&&g>0&&!n,activityLabel:y>0?`${y} active`:void 0,activityTone:g>0?"attention":j>0?"working":"pending",onClick:f}),n&&t.conversations.map(l=>{const R=l.agentId?r.get(l.agentId):void 0,L=t.canonicalRoot&&R?.projectRoot&&R.projectRoot!==t.canonicalRoot?$t(R.projectRoot):null;return i.jsx(E,{rowId:l.id,session:l,depth:1,nav:o,agentById:r,asksByAgent:c,pinned:M(l.id,d),worktreeLabel:L,actions:i.jsx(rt,{pinned:M(l.id,d),archived:$(l.id,d),onTogglePin:()=>w(l.id),onToggleArchive:()=>u(l.id)}),onSelect:p,onContextMenu:C},l.id)})]},t.key)}function re({query:t,loading:n,error:o,apiOffline:r,onRetry:c}){const d=t.trim().length>0,s=n?"Loading conversations":r?"Scout server offline":o?"Couldn't load conversations":d?"No matching conversations":"No conversations yet",f=n?"Checking the broker for your conversations, channels, and observed threads.":r?"Start or restart Scout services, then retry.":o||(d?"Try a shorter filter.":"Your conversations, channels, and observed agent threads will show here.");return i.jsxs("div",{className:"ctx-panel-empty-card","data-tone":r||o?"error":"neutral",children:[i.jsx("div",{className:"ctx-panel-empty-card-title",children:s}),i.jsx("div",{className:"ctx-panel-empty-card-detail",children:f}),(r||o)&&i.jsx("button",{type:"button",className:"ctx-panel-empty-card-action",onClick:c,children:"Retry"})]})}function kt(t,n){const o=n.toLowerCase();return N(t).toLowerCase().includes(o)||t.id.toLowerCase().includes(o)||(t.preview??"").toLowerCase().includes(o)||(t.agentName??"").toLowerCase().includes(o)}function ce(t){return t===1?"1 needs a reply":`${t} need a reply`}function Lt(t){return t.status==="queued"?"Starting":t.status==="working"?"Working":t.status==="needs_attention"?"Needs you":t.statusLabel||t.status}function le(t){return t.status==="queued"?"pending":t.status==="needs_attention"?"attention":"working"}function de(t,n){return n.status==="working"?"in_turn":t?ct(t.state):"dm"}function ue(t,n,o){const r=Lt(o),c=z(o.task)??z(o.summary)??z(t.preview)??t.currentBranch??n?.branch??"";return c?`${r} · ${c}`:r}function W(t){return[...t].sort((n,o)=>(o.lastMessageAt??0)-(n.lastMessageAt??0))}function It(t,n,o){const r=o?.task??z(t.preview)??t.currentBranch??n?.branch??"",c=n?.name??t.agentName??N(t);return r?`${c} · ${r}`:c}function pe(t,n,o){const r=[];return o&&r.push(`task: ${o.task}`),t.preview&&r.push(`preview: ${t.preview}`),(t.currentBranch??n?.branch)&&r.push(`branch: ${t.currentBranch??n?.branch}`),n?.harness&&r.push(`harness: ${n.harness}`),r.length>0?r.join(`
|
|
2
|
+
`):void 0}function Rt(t,n){if(lt(t))return Qt(t);const o=n?.handle?.trim().replace(/^@+/,"");return o||(t.agentId?t.agentId.split(".")[0]??t.agentId:N(t))}function z(t){if(!t)return null;const n=t.replace(/\s+/g," ").trim();return n?n.length>60?`${n.slice(0,57)}…`:n:null}function St(t){const n=t.latestUpdate?at(t.latestUpdate):"",o=`${t.conversations.length}`;return n?`${o} · ${n}`:o}export{ln as ChatLeft};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as A}from"./index-o4FKpU7Z.js";import{u as q,g as z,i as P,j as G,k as I,l as H,a as w,r as T}from"./mesh-view-store-Du7VqIT_.js";import{u as Q}from"./Provider-DKZWuzSR.js";import{n as b,a as V}from"./colors-BtO5_zlx.js";import{b as D}from"./mesh-buckets-CfAukILK.js";import{u as J}from"./use-fleet-active-asks-CJ6-oj5k.js";import{R as h}from"./RailRow-DIGd3MMM.js";import{F as U}from"./FleetSearch-CYeWn85V.js";import{o as W}from"./openAgent-Dbv5wfuL.js";/* empty css */import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";import"./openContent-C6XO6kr5.js";const X=["needs_attention","in_turn","in_flight","callable","blocked"],Y={in_turn:"in turn",in_flight:"in flight",needs_attention:"needs attention",callable:"callable",blocked:"blocked"},Z={in_turn:"working",in_flight:"working",needs_attention:"working",callable:"available",blocked:"offline"};function ee({active:a,onToggle:p}){return e.jsx("div",{className:"fleet-pills",role:"group","aria-label":"State filters",children:X.map(o=>{const l=a.has(o);return e.jsx("button",{type:"button",className:`fleet-pill fleet-pill--${Z[o]}${l?" fleet-pill--on":""}`,onClick:()=>p(o),"aria-pressed":l,children:Y[o]},o)})})}const _=10;function te(a){return b(a.state)}function C(a){return a.updatedAt??a.createdAt??0}function Ze(){const{agents:a,navigate:p}=Q(),{meshSnapshot:o,selectedId:l,selectedType:S,query:d,agentStateFilters:u,hiddenMachineIds:g,treeFullMachineIds:F}=q(),L=J(),m=A.useMemo(()=>o?D(a,o):[],[a,o]),y=A.useMemo(()=>{const n=d.trim().toLowerCase();return m.filter(s=>!g.has(s.machineId)).map(s=>{const t=s.agents.filter(r=>u.has(te(r))?n?`${r.name??""} ${r.project??""} ${r.branch??""} ${r.harness??""}`.toLowerCase().includes(n):!0:!1);return{...s,agents:t}})},[m,d,u,g]),f=A.useMemo(()=>{const n=new Map([["this",[]],["peer",[]],["tailnet",[]]]);for(const s of y){const t=s.reachability==="this"?"this":s.reachability==="peer"?"peer":"tailnet";n.get(t)?.push(s)}return n},[y]);if(!o)return e.jsx("div",{className:"ctx-panel ctx-panel--empty",children:e.jsx("div",{className:"ctx-panel-empty-state",children:e.jsx("div",{className:"ctx-panel-empty-hint",children:"Loading mesh…"})})});const $=n=>{const s=m.map(t=>t.machineId);H(n,s),w(n,"node"),T(n)},v=g.size,x=m.length,E=n=>{w(n.id,"agent");const s=n.authorityNodeId??n.homeNodeId;s&&T(s),W(p,n,{returnTo:{view:"mesh"}})},j=(n,s)=>s.length===0?null:e.jsxs("section",{className:"mesh-nav-group",children:[e.jsx("div",{className:"mesh-nav-group-label",children:n}),s.map(t=>{const r=F.has(t.machineId),c=[...t.agents].sort((i,k)=>C(k)-C(i)),M=r?c:c.slice(0,_),N=c.length-M.length,B=l===t.machineId&&S==="node",R=t.agents.filter(i=>V(i.state)).length,K=t.agents.length>0?`${R}/${t.agents.length}`:t.online?"—":"not ready";return e.jsxs("div",{className:"mesh-nav-machine",children:[e.jsx(h,{name:t.machineLabel,meta:K,tone:"neutral",active:B,onClick:()=>$(t.machineId),title:`Focus ${t.machineLabel} on the map`}),M.map(i=>{const k=l===i.id&&S==="agent",O=L.has(i.id);return e.jsx(h,{name:i.name,tone:b(i.state),depth:1,active:k,unread:O,onClick:()=>E(i),title:i.name},i.id)}),!r&&N>0&&e.jsx(h,{name:`see ${N} more`,depth:1,tone:"neutral",onClick:()=>I(t.machineId),title:"Show all agents on this machine"}),r&&c.length>_&&e.jsx(h,{name:"see less",depth:1,tone:"neutral",onClick:()=>I(t.machineId),title:"Show recent agents only"})]},t.machineId)})]},n);return e.jsxs("div",{className:"ctx-panel mesh-nav",children:[e.jsxs("div",{className:"mesh-nav-head",children:[e.jsx(U,{value:d,onChange:z,placeholder:"Find machines or agents…"}),e.jsx(ee,{active:u,onToggle:P}),v>0&&v<x&&e.jsxs("button",{type:"button",className:"mesh-nav-focus-chip",onClick:G,title:"Show all machines",children:[e.jsxs("span",{className:"mesh-nav-focus-chip-label",children:["focused · ",x-v,"/",x]}),e.jsx("span",{className:"mesh-nav-focus-chip-clear","aria-hidden":!0,children:"×"})]})]}),e.jsxs("div",{className:"mesh-nav-tree",children:[j("this host",f.get("this")??[]),j("peers",f.get("peer")??[]),j("tailnet",f.get("tailnet")??[])]})]})}export{Ze as MeshLeft};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r,j as e}from"./index-o4FKpU7Z.js";/* empty css */import{n as k}from"./colors-BtO5_zlx.js";import{p as C,a as L}from"./api-h5zurxmi.js";import{u as F,m as $,e as D,h as H}from"./Provider-DKZWuzSR.js";import{d as O}from"./router-C65cZYPn.js";import{d as B,a as G}from"./operator-attention-BwSPeheT.js";import{u as K}from"./sse-CL6gctHY.js";import{t as f}from"./time-Dhsh_2EG.js";import{o as P}from"./openAgent-Dbv5wfuL.js";import{R as v}from"./RailRow-DIGd3MMM.js";import"./provider-BvAxRQfE.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./index-BWHgHrtv.js";import"./openContent-C6XO6kr5.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";const U=new Set(["message.posted","flight.updated","collaboration.event.appended","agent.updated"]),V=4,z=4,Q=3,N="/api/fleet",X=3e4;function Yt({prepend:t}){const{agents:o,agentsLoaded:a,navigate:c,route:n}=F(),[i]=r.useState(()=>C(N,X)),[l,E]=r.useState(i),[A,T]=r.useState(i!==null),[j,b]=r.useState(()=>new Set),p=O(n),I=r.useMemo(()=>$(o,p),[o,p]),m=r.useMemo(()=>D(o,p),[o,p]),u=r.useMemo(()=>H(l,I),[l,I]),d=r.useCallback(async()=>{try{E(await L(N))}catch{}finally{T(!0)}},[]);r.useEffect(()=>{d()},[d]),K(s=>{U.has(s.kind)&&d()});const w=r.useMemo(()=>Z(m).slice(0,V),[m]),R=r.useMemo(()=>(u?.activity??[]).slice(0,z),[u]),_=r.useMemo(()=>(u?.needsAttention??[]).filter(s=>!j.has(s.recordId)).slice(0,Q),[u,j]),M=r.useCallback(async s=>{b(h=>new Set(h).add(s.recordId));try{await B({recordKind:s.kind,recordId:s.recordId,itemUpdatedAt:s.updatedAt})}catch{b(h=>{const S=new Set(h);return S.delete(s.recordId),S});return}d()},[d]);return e.jsxs("div",{className:"ctx-panel base-rail",children:[t?e.jsx("div",{className:"base-rail-prepend",children:t}):null,e.jsx(Y,{agents:w,totalCount:m.length,loading:!a,onSelect:s=>P(c,s,{returnTo:n}),onSeeAll:()=>c({view:"agents-v2"})}),e.jsx(J,{items:R,loading:!A,onSelect:s=>c(tt(s)),onSeeAll:()=>c({view:"activity"})}),e.jsx(W,{items:_,loading:!A,onSelect:s=>c(G(s)),onDismiss:s=>{M(s)}})]})}function Y({agents:t,totalCount:o,loading:a,onSelect:c,onSeeAll:n}){return e.jsxs("section",{className:"ctx-panel-section base-rail-section",children:[e.jsx(g,{title:"Recent agents",onSeeAll:o>0?n:void 0}),a?e.jsx(x,{}):t.length===0?e.jsx("div",{className:"ctx-panel-empty",children:"No agents yet"}):t.map(i=>e.jsx(v,{name:i.name||i.id,meta:i.updatedAt?f(i.updatedAt):void 0,tone:k(i.state),title:q(i),onClick:()=>c(i)},i.id))]})}function q(t){const o=[];return t.project&&o.push(`project: ${t.project}`),t.branch&&o.push(`branch: ${t.branch}`),t.harness&&o.push(`harness: ${t.harness}`),o.join(`
|
|
2
|
+
`)}function J({items:t,loading:o,onSelect:a,onSeeAll:c}){return e.jsxs("section",{className:"ctx-panel-section base-rail-section",children:[e.jsx(g,{title:"Recent activity",meta:(t.length>0,void 0),onSeeAll:t.length>0?c:void 0}),o?e.jsx(x,{}):t.length===0?e.jsx("div",{className:"ctx-panel-empty",children:"Quiet so far"}):t.map(n=>{const i=n.actorName??n.agentName??n.agentId??"system",l=n.title??n.summary??y(n.kind);return e.jsx(v,{name:l,meta:n.ts?f(n.ts):void 0,tone:"neutral",title:`${i} · ${y(n.kind)}`,onClick:()=>a(n)},n.id)})]})}function W({items:t,loading:o,onSelect:a,onDismiss:c}){return!o&&t.length===0?null:e.jsxs("section",{className:"ctx-panel-section base-rail-section",children:[e.jsx(g,{title:"Needs attention",meta:t.length>0?`${t.length}`:void 0}),o?e.jsx(x,{rows:2}):t.map(n=>{const i=n.agentName??n.agentId??"operator";return e.jsx(v,{name:n.title,meta:f(n.updatedAt),tone:"in_turn",unread:!0,title:`${i} · ${n.kind}`,onClick:()=>a(n),actions:e.jsx("button",{type:"button",className:"rr-row-action",title:"Dismiss — stop asking until this changes","aria-label":"Dismiss",onClick:l=>{l.stopPropagation(),c(n)},children:"Dismiss"})},n.recordId)})]})}function x({rows:t=3}){return e.jsx("div",{className:"base-rail-loading",role:"status","aria-label":"Loading",children:Array.from({length:t},(o,a)=>e.jsx("span",{"aria-hidden":"true"},a))})}function g({title:t,meta:o,onSeeAll:a}){return e.jsxs("div",{className:"ctx-panel-section-label base-rail-section-label",children:[e.jsx("span",{children:t}),e.jsxs("span",{className:"base-rail-section-trailing",children:[o?e.jsx("span",{className:"ctx-panel-count",children:o}):null,a?e.jsx("button",{type:"button",className:"base-rail-see-all",onClick:a,children:"all"}):null]})]})}function Z(t){return[...t].sort((o,a)=>(a.updatedAt??0)-(o.updatedAt??0))}function y(t){switch(t){case"message":return"Message";case"invocation":return"Invocation";case"flight":return"Flight update";case"collaboration":return"Collaboration";default:return t.replace(/_/g," ")}}function tt(t){return t.conversationId?{view:"conversation",conversationId:t.conversationId}:t.agentId?{view:"agents-v2",agentId:t.agentId}:{view:"activity"}}export{Yt as HomeLeft};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,j as t}from"./index-o4FKpU7Z.js";/* empty css */import"./NewChatComposer-S08F6_La.js";import{u as k,e as w}from"./Provider-DKZWuzSR.js";import{A as S}from"./AgentAvatar-DMov24_o.js";import{a as g}from"./api-h5zurxmi.js";import{d as y}from"./router-C65cZYPn.js";import{u as M}from"./sse-CL6gctHY.js";import{o as A,i as j}from"./surface-activity-B1rgWB1i.js";import{d as N,c as b,e as I,f as C,g as B,h as P}from"./model-Co0zkMIc.js";import"./runtime-picker-eDEvx2Mz.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./createLucideIcon-Bt67PWH-.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-BEz6jyqf.js";import"./keyboard-nav-Chf51dns.js";import"./x-ynOfVadO.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./file-text-iF0hyVyU.js";import"./provider-BvAxRQfE.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./index-BWHgHrtv.js";import"./text-DsBWV_4k.js";function W(){const{agents:n,route:d}=k(),m=y(d),l=r.useMemo(()=>w(n,m),[n,m]),[u,h]=r.useState([]),[v,s]=r.useState(null),[a,p]=r.useState(null),c=r.useCallback(async()=>{const[e,i,o]=await Promise.allSettled([g("/api/conversations"),g("/api/fleet"),g("/api/tail/discover")]);e.status==="fulfilled"&&h(e.value),i.status==="fulfilled"&&s(i.value),o.status==="fulfilled"&&p(o.value)},[]);r.useEffect(()=>{c()},[c]),r.useEffect(()=>{const e=()=>{j()&&c()},i=window.setInterval(e,1e4),o=A(e);return()=>{window.clearInterval(i),o()}},[c]),M(()=>{j()&&c()});const x=r.useMemo(()=>{const e=new Map;for(const i of v?.activeAsks??[]){const o=e.get(i.agentId)??[];o.push(i),e.set(i.agentId,o)}return e},[v?.activeAsks]);return{projects:r.useMemo(()=>{const{sessionByAgentId:e}=N(u),i=l.map(f=>b(f,e.get(f.id)??null,x.get(f.id)??[])),o=I(a,Date.now());return C(i,u,o)},[l,u,x,a])}}function bt(){const{route:n,navigate:d,openContextCapture:m}=k(),{projects:l}=W(),u=n.view==="agents-v2"?n.projectSlug:void 0,h=n.view==="agents-v2"?n.agentId:void 0,v=u??l[0]?.slice.slug;return t.jsxs("div",{className:"ctx-panel s-agents-rail",children:[t.jsx("div",{className:"s-agents-recent s-rail-projects",children:l.length===0?t.jsx("div",{className:"ctx-panel-empty",children:"No projects yet"}):l.map(s=>{const a=B(s),p=P(s),c=s.slice.slug===v&&!h;return t.jsxs("button",{type:"button",className:"s-rail-proj","data-selected":c||void 0,"data-live":a>0||void 0,"data-needs":p||void 0,title:s.slice.root??void 0,onClick:()=>d({view:"agents-v2",projectSlug:s.slice.slug}),children:[t.jsx(S,{name:s.slice.title,size:22,tile:!0,presence:!1}),t.jsxs("span",{className:"s-rail-proj-name","data-idle":a===0||void 0,children:[t.jsx("span",{"aria-hidden":!0,style:{opacity:.4},children:"/"}),s.slice.title]}),a>0?t.jsx("span",{className:"s-rail-proj-count","data-needs":p||void 0,title:p?"needs you":void 0,children:a}):null]},s.slice.key)})}),t.jsxs("div",{className:"s-agents-foot s-rail-foot-icons",children:[t.jsx("button",{type:"button",className:"s-rail-icon",title:"Search","aria-label":"Search",onClick:()=>d({view:"search"}),children:t.jsx(E,{})}),t.jsx("button",{type:"button",className:"s-rail-icon",title:"New chat (⌘⌥N)","aria-label":"New chat",onClick:()=>m(),children:t.jsx(L,{})}),t.jsx("button",{type:"button",className:"s-rail-icon s-rail-icon--end",title:"Settings","aria-label":"Settings",onClick:()=>d({view:"settings"}),children:t.jsx(D,{})})]})]})}function E(){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[t.jsx("circle",{cx:"7",cy:"7",r:"4.25",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M10.5 10.5 14 14",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function L(){return t.jsx("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:t.jsx("path",{d:"M8 3v10M3 8h10",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function D(){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[t.jsx("circle",{cx:"8",cy:"8",r:"2.25",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M8 1.5v1.6M8 12.9v1.6M14.5 8h-1.6M3.1 8H1.5M12.6 3.4l-1.1 1.1M4.5 11.5l-1.1 1.1M12.6 12.6l-1.1-1.1M4.5 4.5 3.4 3.4",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}export{bt as AgentsLeft};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,j as o}from"./index-o4FKpU7Z.js";/* empty css */import{a as j}from"./api-h5zurxmi.js";import{u as v}from"./sse-CL6gctHY.js";import{u as N}from"./Provider-DKZWuzSR.js";import{u as g}from"./use-fleet-active-asks-CJ6-oj5k.js";import{i as w}from"./colors-BtO5_zlx.js";import{R as a}from"./RailRow-DIGd3MMM.js";import"./index-BWHgHrtv.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";const $=new Set(["message.posted","conversation.upserted","agent.updated"]);function k(e){const n=x(e.cwd),m=x(e.projectRoot);return e.authorityNodeName??e.homeNodeName??e.authorityNodeId??e.homeNodeId??e.transport??n??m??"local"}function b(e){return e.project??e.role??e.agentClass??"Unassigned"}function x(e){if(!e)return null;const n=e.split("/").filter(Boolean);return n[n.length-1]??null}function jt(){const{agents:e,navigate:n}=N(),[m,f]=r.useState([]),p=g(),c=r.useCallback(async()=>{const t=await j("/api/conversations").catch(()=>[]);f(t)},[]);r.useEffect(()=>{c()},[c]),v(t=>{$.has(t.kind)&&c()});const h=r.useMemo(()=>e.filter(t=>w(t.state)).length,[e]),l=r.useMemo(()=>{let t=0;for(const s of p.values())(s.status==="failed"||s.status==="needs_attention")&&(t+=1);return t},[p]),u=r.useMemo(()=>{const t=new Map;for(const s of e){const i=b(s);t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((s,i)=>i[1]-s[1]).slice(0,8)},[e]),d=r.useMemo(()=>{const t=new Map;for(const s of e){const i=k(s);t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((s,i)=>i[1]-s[1]).slice(0,8)},[e]);return o.jsxs("div",{className:"ctx-panel",children:[o.jsxs("section",{className:"ctx-panel-section",children:[o.jsx("div",{className:"ctx-panel-section-label",children:"Agents"}),o.jsx(a,{name:"Overview",meta:`${e.length}`,tone:"neutral",onClick:()=>n({view:"inbox"})}),o.jsx(a,{name:"Agents",meta:`${h}`,tone:"callable",active:!0,onClick:()=>n({view:"ops",mode:"agents"})}),o.jsx(a,{name:"Sessions",meta:`${m.length}`,tone:"neutral",onClick:()=>n({view:"sessions"})}),o.jsx(a,{name:"Alerts",meta:`${l}`,tone:l>0?"in_turn":"neutral",unread:l>0,onClick:()=>n({view:"activity"})})]}),o.jsxs("section",{className:"ctx-panel-section",children:[o.jsx("div",{className:"ctx-panel-section-label",children:"Projects"}),u.length===0?o.jsx("div",{className:"ctx-panel-empty",children:"No projects"}):u.map(([t,s])=>o.jsx(a,{name:t,meta:`${s}`,tone:"neutral",title:`${s} agent${s===1?"":"s"} on ${t}`},t))]}),o.jsxs("section",{className:"ctx-panel-section",children:[o.jsx("div",{className:"ctx-panel-section-label",children:"Machines"}),d.length===0?o.jsx("div",{className:"ctx-panel-empty",children:"No machines"}):d.map(([t,s])=>o.jsx(a,{name:t,meta:`${s}`,tone:"neutral",title:`${s} agent${s===1?"":"s"} on ${t}`},t))]})]})}export{jt as OpsAgentsLeft};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,j as o}from"./index-o4FKpU7Z.js";/* empty css */import{a as h}from"./api-h5zurxmi.js";import{n as f}from"./colors-BtO5_zlx.js";import{a as g,r as j}from"./operator-attention-BwSPeheT.js";import{u as N}from"./sse-CL6gctHY.js";import{t as c}from"./time-Dhsh_2EG.js";import{u as A}from"./Provider-DKZWuzSR.js";import{o as l}from"./openContent-C6XO6kr5.js";import{R as m}from"./RailRow-DIGd3MMM.js";import"./index-BWHgHrtv.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";const w=[{name:"Control",route:{view:"ops",mode:"mission"},active:e=>e.view==="ops"&&(e.mode===void 0||e.mode==="mission")},{name:"Dispatch",route:{view:"broker"},active:e=>e.view==="broker"},{name:"Mesh",route:{view:"mesh"},active:e=>e.view==="mesh"},{name:"Tail",route:{view:"ops",mode:"tail"},active:e=>e.view==="ops"&&e.mode==="tail"},{name:"Runtime",route:{view:"ops",mode:"atop"},active:e=>e.view==="ops"&&e.mode==="atop"}];function ht(){const{navigate:e,route:n}=A(),[p,d]=r.useState(null),s=r.useCallback(async()=>{const t=await h("/api/fleet").catch(()=>null);d(t)},[]);r.useEffect(()=>{s()},[s]),N(t=>{(t.kind==="message.posted"||t.kind==="flight.updated"||t.kind==="collaboration.event.appended")&&s()});const i=p?.needsAttention??[],a=(p?.activeAsks??[]).filter(t=>t.status!=="needs_attention"),u=t=>{l(e,g(t),{returnTo:n})},v=t=>{l(e,j(t),{returnTo:n})};return o.jsxs("div",{className:"ctx-panel ctx-panel--ops",children:[o.jsxs("section",{className:"ctx-panel-section",children:[o.jsx("div",{className:"ctx-panel-section-label",children:"Surfaces"}),w.map(t=>o.jsx(m,{name:t.name,tone:"neutral",active:t.active(n),onClick:()=>e(t.route)},t.name))]}),o.jsxs("section",{className:"ctx-panel-section",children:[o.jsxs("div",{className:"ctx-panel-section-label",children:["Needs you",i.length>0&&o.jsx("span",{className:"ctx-panel-count",children:i.length})]}),i.length===0?o.jsx("div",{className:"ctx-panel-empty",children:"All clear"}):i.slice(0,4).map(t=>{const x=t.agentName??t.agentId??"operator";return o.jsx(m,{name:t.title,meta:c(t.updatedAt),tone:"in_turn",unread:!0,title:`${x} · ${t.kind}`,onClick:()=>u(t)},t.recordId)})]}),o.jsxs("section",{className:"ctx-panel-section",children:[o.jsxs("div",{className:"ctx-panel-section-label",children:["Active",a.length>0&&o.jsx("span",{className:"ctx-panel-count",children:a.length})]}),a.length===0?o.jsx("div",{className:"ctx-panel-empty",children:"No active requests"}):a.slice(0,10).map(t=>o.jsx(m,{name:t.task,meta:c(t.updatedAt),tone:f(t.agentState),title:`${t.agentName??t.agentId} · ${t.statusLabel}`,onClick:()=>v(t)},t.invocationId))]})]})}export{ht as OpsDefaultLeft};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as f,j as t}from"./index-o4FKpU7Z.js";/* empty css */import{t as x}from"./time-Dhsh_2EG.js";import{u as b}from"./Provider-DKZWuzSR.js";import{R as g}from"./RailRow-DIGd3MMM.js";import{S as v}from"./SpriteAvatar-DQ3PTb8L.js";import{n as L}from"./colors-BtO5_zlx.js";import{b as h,c as j,l as p,d as N}from"./agent-lanes-model-VYQ5a68i.js";import{u as _,b as A,g as n}from"./lane-roster-store-BiIVlYmG.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./AgentAvatar-DMov24_o.js";import"./agent-identity-BxCsXnDp.js";import"./context-budget-DX_fwUs3.js";import"./lane-observe-BA3g9aVd.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";function c(s,e,i){const a=`[data-lane-id="${s.replace(/["\\]/g,"\\$&")}"]`,r=typeof document<"u"?document.querySelector(a):null;if(r){r.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),r.focus();return}e&&i({view:"agents-v2",agentId:e,tab:"profile"})}function R(s){return s.filter(e=>!h(e)&&j(e)).sort((e,i)=>{const a=(i.updatedAt??0)-(e.updatedAt??0);return a!==0?a:p(e,"scout").localeCompare(p(i,"scout"))}).map(e=>({id:e.id,label:p(e,"scout"),statusLabel:N(e,"scout"),tone:L(e.state,e),agentId:e.id,updatedAt:e.updatedAt??void 0}))}function Ao(){const{agents:s,navigate:e}=b(),i=_(),a=A(),r=f.useMemo(()=>R(s),[s]),l=i??r,d=l.some(o=>o.floor);return t.jsx("div",{className:"ctx-panel ctx-panel--ops",children:t.jsxs("section",{className:"ctx-panel-section",children:[t.jsxs("div",{className:"ctx-panel-section-label",children:[d?"Fleet":"Lanes",l.length>0&&t.jsx("span",{className:"ctx-panel-count",children:l.length})]}),l.length===0?t.jsx("div",{className:"ctx-panel-empty",children:"No active lanes"}):l.map(o=>o.floor?t.jsxs("button",{type:"button",className:`agent-floor__ledger-row is-rail${a===o.id?" is-focus":""}`,onClick:()=>{const m=n();m?m.onSelect(o.id):c(o.id,o.agentId,e)},onPointerEnter:()=>n()?.onHover(o.id),onPointerLeave:()=>n()?.onHover(null),children:[t.jsxs("span",{className:"agent-floor__ledger-id",children:[t.jsx(v,{name:o.label,size:16,tile:!0}),t.jsx("span",{className:"agent-floor__ledger-name",children:o.label}),t.jsx("span",{className:`agent-floor__card-dot${o.floor.live?" is-live":""}`})]}),t.jsx("span",{className:"agent-floor__ledger-strip",children:o.floor.strip.slice(-6).map((m,u)=>t.jsx("span",{className:`agent-floor__ledger-cell is-${m}`},u))})]},o.id):t.jsx(g,{name:o.label,sub:o.statusLabel||void 0,meta:o.updatedAt?x(o.updatedAt):void 0,tone:o.tone,title:o.statusLabel,onClick:()=>c(o.id,o.agentId,e)},o.id))]})})}export{Ao as OpsLanesLeft};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as c,j as i}from"./index-o4FKpU7Z.js";/* empty css */import{n as S}from"./colors-BtO5_zlx.js";import{u as M,s as A,a as h,b as I,M as C,c as k,d as w,e as F,r as R,t as E}from"./mission-control-store-C6w5iVfg.js";import{u as K}from"./Provider-DKZWuzSR.js";import{a as T,b as q,r as B,m as D}from"./keyboard-nav-Chf51dns.js";import{MissionLeftAgentRow as L}from"./MissionLeftAgentRow-DokImu4Y.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./page-status-0LPfBC8S.js";import"./RailRow-DIGd3MMM.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";function Ke(){const{navigate:r}=K(),s=M(),o=s.visibleAgents,m=c.useRef(null),p=c.useRef(null),v=T(),x=D(()=>m.current);q(c.useCallback(()=>p.current,[]));const[d,y]=c.useState(null),u=s.activityFilter==="active",a=s.selectedIds.length,j=e=>{y(t=>t===e?null:e)},N=()=>{if(a===0)return;const t=o.filter(l=>s.selectedIds.includes(l.id)).map(l=>l.handle??l.name).filter(Boolean).join("|");t&&r({view:"ops",mode:"tail",tailQuery:t})};return i.jsxs("div",{className:"ctx-panel ml-panel",children:[i.jsxs("div",{className:"ml-section",children:[i.jsx("div",{className:"ml-section-label",children:"Source"}),i.jsx("div",{className:"ml-chips ml-chips--primary",children:["all","scout","native"].map(e=>i.jsx("button",{type:"button",className:["ml-chip",s.sourceFilter===e&&"ml-chip--active"].filter(Boolean).join(" "),onClick:()=>A(e),children:e==="all"?"All":e==="scout"?"Scout":"Native"},e))})]}),i.jsx("div",{className:"ctx-panel-search",children:i.jsx("input",{ref:p,type:"text",className:"ctx-panel-search-input",placeholder:"Filter agents… (press /)",value:s.query,onChange:e=>h(e.target.value),onKeyDown:e=>{x(e),e.key==="Escape"&&s.query&&h("")}})}),i.jsx("div",{className:"ml-section ml-section--secondary",children:i.jsxs("div",{className:"ml-chips ml-chips--secondary",children:[["active","live","all"].map(e=>i.jsx("button",{type:"button",className:["ml-chip ml-chip--ghost",s.activityFilter===e&&"ml-chip--ghost-active"].filter(Boolean).join(" "),onClick:()=>I(e),children:e==="active"?"Active":e==="live"?"Live":"Any"},e)),u&&i.jsx("span",{className:"ml-divider","aria-hidden":!0}),u&&C.map(e=>i.jsx("button",{type:"button",className:["ml-chip ml-chip--ghost",s.activityWindowMs===e.value&&"ml-chip--ghost-active"].filter(Boolean).join(" "),onClick:()=>k(e.value),children:e.label},e.value))]})}),i.jsxs("div",{className:"ml-section ml-section--grouping",children:[i.jsx("div",{className:"ml-section-label",children:"Order by"}),i.jsx("div",{className:"ml-chips ml-chips--grouping",children:[["activity","Activity"],["workspace","Project"],["harness","Harness"],["state","Status"],["source","Source"]].map(([e,t])=>i.jsx("button",{type:"button",className:["ml-chip","ml-chip--group",s.groupMode===e&&"ml-chip--group-active"].filter(Boolean).join(" "),"aria-pressed":s.groupMode===e,onClick:()=>w(e),children:t},e))})]}),a>0?i.jsxs("div",{className:"ml-selection",children:[i.jsxs("span",{className:"ml-selection-label",children:[a," selected"]}),i.jsxs("div",{className:"ml-selection-actions",children:[i.jsx("button",{type:"button",className:"ml-selection-btn ml-selection-btn--primary",onClick:N,children:"Tail ↗"}),i.jsx("button",{type:"button",className:"ml-selection-btn",onClick:F,children:"Clear"})]})]}):i.jsxs("div",{className:"ml-count",children:[o.length," visible",i.jsx("span",{className:"ml-count-hint",children:"⌘-click · ⌘A all"})]}),i.jsx("div",{ref:m,className:"ctx-panel-list ctx-panel-list--scroll",onKeyDown:v,children:o.length===0?i.jsx("div",{className:"ctx-panel-empty",children:s.query?"No match":"Nothing visible"}):o.map((e,t)=>{const l=e.id===d,b=o.some(n=>n.id===d),g=s.selectedIds.includes(e.id),f=S(e.state);return i.jsx(L,{agent:e,state:f,isExpanded:l,isSelected:g,tabIndex:B(l,b,t===0),onToggle:n=>{n.metaKey||n.ctrlKey||n.shiftKey?E(e.id):j(e.id)},onReveal:()=>R(e.id),onOpen:()=>r({view:"agents-v2",agentId:e.id})},e.id)})})]})}export{Ke as OpsMissionLeft};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as a,j as s}from"./index-o4FKpU7Z.js";/* empty css */import{a as k}from"./api-h5zurxmi.js";import{u as y}from"./sse-CL6gctHY.js";import{t as S}from"./time-Dhsh_2EG.js";import{u as w}from"./Provider-DKZWuzSR.js";import{F as C}from"./FleetSearch-CYeWn85V.js";import"./index-BWHgHrtv.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";const u={all:"All",claude:"Claude",codex:"Codex",openscout:"OpenScout",workspace:"Workspace",unknown:"Other"},L={active:"Active",archived:"Archived",blocked:"Blocked",completed:"Complete",draft:"Draft",unknown:"Unknown"};function b(e){const o=e.replace(/\\/g,"/").replace(/\/+$/g,""),r=o.lastIndexOf("/");return r>=0?o.slice(r+1):o}function A(e){return e.steps.length===0?"No steps":`${e.steps.filter(r=>r.status==="completed").length}/${e.steps.length} steps`}function E(e){return[e.title,e.summary,e.source,e.documentKind,e.status,e.path,e.workspaceName,e.agentName,e.tags.join(" "),e.steps.map(o=>o.text).join(" ")].filter(Boolean).join(" ").toLowerCase()}function jt(){const{route:e,navigate:o}=w(),[r,f]=a.useState(null),[i,m]=a.useState(""),[l,h]=a.useState("all"),[x,v]=a.useState(!0),p=a.useCallback(async()=>{const t=await k("/api/plan-documents").catch(()=>null);f(t),v(!1)},[]);a.useEffect(()=>{p()},[p]),y(t=>{(t.kind==="message.posted"||t.kind==="flight.updated"||t.kind==="collaboration.event.appended")&&p()});const n=r?.documents??[],j=e.view==="ops"&&e.mode==="plan"?e.planDocumentId:void 0,c=i.trim().toLowerCase(),g=a.useMemo(()=>{const t={all:n.length,claude:0,codex:0,openscout:0,workspace:0,unknown:0};for(const N of n)t[N.source]+=1;return t},[n]),d=a.useMemo(()=>n.filter(t=>l==="all"||t.source===l).filter(t=>!c||E(t).includes(c)),[n,c,l]);return s.jsxs("div",{className:"s-plan-left-nav",children:[s.jsx("div",{className:"s-left-roster-search",children:s.jsx(C,{value:i,onChange:m,placeholder:"Search plan documents...",onKeyDown:t=>{t.key==="Escape"&&(i?m(""):t.target.blur())}})}),s.jsx("div",{className:"s-plan-left-source-grid",children:["all","claude","codex","openscout","workspace"].map(t=>s.jsxs("button",{type:"button",className:`s-plan-left-source${l===t?" s-plan-left-source--active":""}`,onClick:()=>h(t),children:[s.jsx("span",{children:u[t]}),s.jsx("strong",{children:g[t]})]},t))}),s.jsx("div",{className:"s-plan-left-list",children:x&&n.length===0?s.jsx("div",{className:"s-left-roster-empty",children:"Indexing plan documents..."}):d.length===0?s.jsx("div",{className:"s-left-roster-empty",children:n.length===0?"No plan documents found":"No plans match"}):d.map(t=>s.jsxs("button",{type:"button",className:`s-plan-left-document${t.id===j?" s-plan-left-document--active":""}`,onClick:()=>o({view:"ops",mode:"plan",planDocumentId:t.id}),title:`${t.path}
|
|
2
|
+
${t.summary??""}`,children:[s.jsxs("div",{className:"s-plan-left-document-top",children:[s.jsx("span",{className:`s-plan-left-status s-plan-left-status--${t.status}`,children:L[t.status]}),s.jsx("span",{children:u[t.source]}),s.jsx("time",{children:S(t.updatedAt)})]}),s.jsx("div",{className:"s-plan-left-document-title",children:t.title}),t.summary&&s.jsx("div",{className:"s-plan-left-document-summary",children:t.summary}),s.jsxs("div",{className:"s-plan-left-document-foot",children:[s.jsx("span",{children:A(t)}),s.jsx("span",{children:b(t.path)})]})]},t.id))})]})}export{jt as OpsPlanLeft};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./index-o4FKpU7Z.js";import{u as o}from"./Provider-DKZWuzSR.js";import{OpsAgentsLeft as m}from"./left-agents-Dk9Y89lb.js";import{OpsDefaultLeft as p}from"./left-default-B3JBRQNJ.js";import{OpsLanesLeft as i}from"./left-lanes-30Oe_3RM.js";import{OpsMissionLeft as s}from"./left-mission-DEl4-7xu.js";import{OpsPlanLeft as e}from"./left-plan-B4qdm4Gn.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";/* empty css */import"./use-fleet-active-asks-CJ6-oj5k.js";import"./RailRow-DIGd3MMM.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";import"./operator-attention-BwSPeheT.js";import"./openContent-C6XO6kr5.js";import"./agent-lanes-model-VYQ5a68i.js";import"./context-budget-DX_fwUs3.js";import"./lane-observe-BA3g9aVd.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-roster-store-BiIVlYmG.js";import"./mission-control-store-C6w5iVfg.js";import"./MissionLeftAgentRow-DokImu4Y.js";import"./page-status-0LPfBC8S.js";import"./FleetSearch-CYeWn85V.js";function Ot(){const{route:r}=o();if(r.view!=="ops")return null;switch(r.mode){case"mission":return t.jsx(s,{});case"agents":return t.jsx(m,{});case"plan":return t.jsx(e,{});case"lanes":return t.jsx(i,{});default:return t.jsx(p,{})}}export{Ot as OpsLeft};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l,j as e}from"./index-o4FKpU7Z.js";/* empty css */import{t as O}from"./time-Dhsh_2EG.js";import{u as H}from"./Provider-DKZWuzSR.js";import{S as $}from"./SpriteAvatar-DQ3PTb8L.js";import{H as R}from"./HarnessMark-MztYnrGK.js";import{AgentSessions as G}from"./AgentSessions-CDfSfNiE.js";import{a as T}from"./api-h5zurxmi.js";import{u as J}from"./ContextMenu-CxkmFQcN.js";import{g as q,p as V,b as _}from"./agents-project-model-UYiamtrU.js";import{c as Q,e as X,f as Y,g as Z}from"./model-Co0zkMIc.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./agent-identity-BxCsXnDp.js";import"./openContent-C6XO6kr5.js";import"./clipboard-e3fSpeo7.js";import"./text-DsBWV_4k.js";const ee=30*6e4,D=a=>a==="pi"?"grok":a,K=a=>a?a.replace(/^claude-/,"").replace(/-\d{8}$/,""):null;function Ye({agents:a,fleet:d,sessionByAgentId:c,sessions:A,discovery:k,loading:C,navigate:x,selectedAgentId:S}){const{route:N,reload:p,openContextCapture:u}=H(),m=N.view==="agents-v2"?N.projectSlug:void 0,f=l.useMemo(()=>{const n=new Map;for(const b of d?.activeAsks??[]){const i=n.get(b.agentId)??[];i.push(b),n.set(b.agentId,i)}return n},[d?.activeAsks]),v=l.useMemo(()=>a.map(n=>Q(n,c.get(n.id)??null,f.get(n.id)??[])),[f,a,c]),g=l.useMemo(()=>X(k,Date.now()),[k]),h=l.useMemo(()=>Y(v,A,g),[v,A,g]),w=l.useMemo(()=>h.find(n=>n.slice.slug===m)??h[0]??null,[h,m]),r=w?.slice.slug,M={selectAgent:n=>x({view:"agents-v2",agentId:n.agent.id,...r?{projectSlug:r}:{}}),openAgentPage:n=>x({view:"agents-v2",agentId:n.agent.id,tab:"profile"}),startSession:n=>u({intent:"new-task",projectPath:n.agent.projectRoot??n.agent.cwd??void 0}),openSession:n=>x(n),configureAgent:n=>x({view:"agents-v2",agentId:n.agent.id,tab:"config"}),restartAgent:n=>{T(`/api/agents/${encodeURIComponent(n.agent.id)}/config`,{method:"POST",body:JSON.stringify({restart:!0})}).catch(()=>{})},stopAgent:n=>{T(`/api/agents/${encodeURIComponent(n.agent.id)}/interrupt`,{method:"POST",body:JSON.stringify({})}).catch(()=>{})},archiveAgent:n=>{T(`/api/agents/${encodeURIComponent(n.agent.id)}/archive`,{method:"POST",body:JSON.stringify({archived:!0})}).then(()=>p()).catch(()=>{})}};return!w&&C?e.jsx("div",{className:"s-aproj","aria-busy":"true",children:e.jsx("div",{className:"ap-loading",role:"status","aria-label":"Loading agents",children:Array.from({length:7},(n,b)=>e.jsx("span",{"aria-hidden":"true"},b))})}):w?e.jsx("div",{className:"s-aproj",children:e.jsx(te,{project:w,selectedAgentId:S,gestures:M,sessions:A})}):e.jsx("div",{className:"s-aproj",children:e.jsx("div",{className:"ap-empty",children:"No agents discovered yet — they appear here as harnesses register and work."})})}function se(){return e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.2",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"m10.5 10.5 3 3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function ae({tone:a}){return a==="idle"?null:e.jsx("span",{className:"ap-dot","data-tone":a,"aria-hidden":!0})}function ne({g:a,gestures:d,sessions:c,selected:A,cursor:k,rowRef:C}){const x=J(),S=Date.now()-a.lastActivityAt<ee,N=a.needs?"needs":S?"live":"idle",p=a.nodes[0];if(!p)return null;const u=p.row.agent.handle?.trim()||a.name,m=a.branches.length>0?a.branches:["main"],f=m.length>1,v=f?`${m.length} branches`:m[0],g=[...new Set(a.nodes.map(r=>r.row.agent.model).filter(r=>!!r))],h=g.length>1,w=[{kind:"action",label:"Configure…",onSelect:()=>d.configureAgent(p.row)},{kind:"action",label:"Restart",onSelect:()=>d.restartAgent(p.row)},{kind:"separator"},{kind:"action",label:"Stop",onSelect:()=>d.stopAgent(p.row)},{kind:"action",label:"Archive",onSelect:()=>d.archiveAgent(p.row)}];return e.jsxs("div",{ref:C,tabIndex:-1,className:"ap-row","data-tone":N,"data-selected":A||void 0,"data-cursor":k||void 0,children:[e.jsxs("div",{className:"ap-rowMain",onClick:()=>d.selectAgent(p.row),children:[e.jsxs("div",{className:"ap-rowBody",children:[e.jsxs("div",{className:"ap-rowTop",children:[e.jsx(ae,{tone:N}),e.jsxs("span",{className:"ap-rowName","data-idle":N==="idle"||void 0,children:[e.jsx("span",{className:"ap-sigil","aria-hidden":!0,children:"@"}),u]}),e.jsx("span",{className:"ap-rowMark","aria-hidden":!0,children:e.jsx(R,{harness:D(a.harness),size:11})}),a.needs?e.jsx("span",{className:"ap-needsWord",children:"needs you"}):N==="live"?e.jsx("span",{className:"ap-rowState",children:"working"}):null]}),e.jsxs("div",{className:"ap-rowMeta",children:[e.jsx("span",{className:"ap-rowBranch","data-dim":!0,title:f?m.join(" · "):void 0,children:v}),h?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ap-rowDivider","aria-hidden":!0}),e.jsxs("span",{className:"ap-rowDim",title:g.join(" · "),children:[g.length," models"]})]}):null,a.sessionCount?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ap-rowDivider","aria-hidden":!0}),e.jsxs("span",{className:"ap-rowDim",children:[a.sessionCount," session",a.sessionCount===1?"":"s"]})]}):null]})]}),e.jsxs("div",{className:"ap-rowTailWrap",children:[e.jsxs("div",{className:"ap-rowTail",children:[e.jsxs("div",{className:"ap-tailMeta","aria-hidden":N==="needs"||void 0,children:[e.jsx("span",{className:"ap-rowAgo",children:a.lastActivityAt?O(a.lastActivityAt):"—"}),!h&&K(a.model)?e.jsx("span",{className:"ap-rowModel",children:K(a.model)}):null]}),e.jsxs("div",{className:"ap-rowActions",children:[e.jsx("button",{type:"button",className:"ap-act ap-actPrimary",onClick:r=>{r.stopPropagation(),d.openAgentPage(p.row)},children:"Open ↗"}),e.jsx("button",{type:"button",className:"ap-act",onClick:r=>{r.stopPropagation(),d.startSession(p.row)},children:"+ Session"})]})]}),e.jsx("button",{type:"button",className:"ap-rowMore","aria-label":"Agent actions",title:"Configure · restart · stop",onClick:r=>{r.stopPropagation(),x(r,w)},children:"⋯"})]})]}),e.jsx(G,{agentIds:a.nodes.map(r=>r.row.agent.id),sessions:c})]})}function te({project:a,selectedAgentId:d,gestures:c,sessions:A}){const[k,C]=l.useState(""),[x,S]=l.useState(null),[N,p]=l.useState(!1),[u,m]=l.useState(-1),f=l.useRef(null),v=l.useRef(new Map),g=l.useMemo(()=>q(a),[a]),{primary:h,ephemeral:w}=l.useMemo(()=>V(g),[g]),r=l.useMemo(()=>_(a),[a]),M=l.useMemo(()=>[...new Set(h.map(s=>D(s.harness)))],[h]),n=k.trim().toLowerCase(),b=s=>(!x||D(s.harness)===x)&&(!n||s.name.toLowerCase().includes(n)||s.branches.some(t=>t.toLowerCase().includes(n))||s.harness.includes(n)),i=h.filter(b),I=w.filter(b),E=!!(n||x),o=i.find(s=>s.needs)??i[0],U=i.some(s=>s.needs),B=h.length<=1;Z(a);const W=g.reduce((s,t)=>s+t.sessionCount,0),z=s=>!!(d&&s.nodes.some(t=>t.row.agent.id===d));return l.useEffect(()=>{function s(t){const y=document.activeElement,L=!!y&&(y.tagName==="INPUT"||y.tagName==="TEXTAREA"||y.isContentEditable);if(t.key.toLowerCase()==="k"&&(t.metaKey||t.ctrlKey)||t.key==="/"&&!L){t.preventDefault(),f.current?.focus(),f.current?.select();return}if(t.key==="Escape"){L&&y?.blur();return}if(L)return;const F=i.length;if(F){if(t.key==="ArrowDown"||t.key==="j")t.preventDefault(),m(j=>j<0?0:Math.min(F-1,j+1));else if(t.key==="ArrowUp"||t.key==="k")t.preventDefault(),m(j=>j<0?0:Math.max(0,j-1));else if(t.key==="Enter"&&(t.metaKey||t.ctrlKey)){const j=i.find(P=>P.needs)??i[0];j&&(t.preventDefault(),m(i.indexOf(j)),c.selectAgent(j.nodes[0].row))}else if(t.key==="Enter"){const j=u<0?0:u,P=i[j];P&&(t.preventDefault(),m(j),c.selectAgent(P.nodes[0].row))}}}return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[i,u,c]),l.useEffect(()=>{if(!(u<0)){if(u>=i.length){m(i.length-1);return}v.current.get(i[u]?.name??"")?.scrollIntoView({block:"nearest"})}},[u,i]),e.jsx("div",{className:"ap-view",children:e.jsxs("div",{className:"ap-content",children:[e.jsxs("header",{className:"ap-head",children:[e.jsx($,{name:a.slice.title,size:56,tile:!0}),e.jsxs("div",{className:"ap-headIdent",children:[e.jsx("div",{className:"ap-headTop",children:e.jsxs("h1",{className:"ap-headName",children:[e.jsx("span",{className:"ap-sigil","aria-hidden":!0,children:"/"}),a.slice.title]})}),a.slice.root?e.jsx("span",{className:"ap-headRoot",children:a.slice.root}):null]}),e.jsx("div",{className:"ap-headActions",children:e.jsx("button",{type:"button",className:"ap-headCta",disabled:!o,onClick:()=>o&&c.startSession(o.nodes[0].row),children:"+ New agent"})})]}),e.jsxs("div",{className:"ap-digest",children:[e.jsxs("span",{className:"ap-stat",children:[e.jsx("span",{className:"ap-statNum",children:h.length}),e.jsx("span",{className:"ap-statLbl",children:h.length===1?"agent":"agents"})]}),e.jsxs("span",{className:"ap-stat",children:[e.jsx("span",{className:"ap-statNum",children:W}),e.jsx("span",{className:"ap-statLbl",children:W===1?"session":"sessions"})]}),r.length>0?e.jsxs("span",{className:"ap-stat",children:[e.jsx("span",{className:"ap-statNum",children:r.length}),e.jsx("span",{className:"ap-statLbl",children:"in flight"})]}):null,e.jsx("span",{className:"ap-statMarks",children:M.map(s=>e.jsx("span",{title:s,"aria-hidden":!0,children:e.jsx(R,{harness:s,size:12})},s))})]}),o&&!E&&!B?e.jsxs("div",{className:"ap-resume","data-tone":o.needs?"needs":"live","aria-live":"polite",children:[e.jsx("span",{className:"ap-dot","data-tone":o.needs?"needs":"live","aria-hidden":!0}),e.jsx("span",{className:"ap-resumeLbl",children:o.needs?"Waiting on you":"Most recent"}),e.jsxs("span",{className:"ap-resumeWho",children:[e.jsx("span",{className:"ap-sigil","aria-hidden":!0,children:"@"}),o.nodes[0].row.agent.handle?.trim()||o.name]}),e.jsxs("span",{className:"ap-resumeMeta",children:[o.branches[0]??"main"," · ",o.lastActivityAt?O(o.lastActivityAt):"—"]}),e.jsxs("span",{className:"ap-resumeActions",children:[e.jsx("button",{type:"button",className:"ap-linkAccent",onClick:()=>c.selectAgent(o.nodes[0].row),children:o.needs?"Continue":"Resume"}),e.jsx("button",{type:"button",className:"ap-link",onClick:()=>c.openAgentPage(o.nodes[0].row),children:"Open ↗"})]})]}):null,B?null:e.jsxs("div",{className:"ap-find",children:[e.jsx("span",{className:"ap-findIco","aria-hidden":!0,children:e.jsx(se,{})}),e.jsx("input",{ref:f,className:"ap-findInput",placeholder:"Find an agent, branch, or harness… (⌘K)",value:k,onChange:s=>C(s.target.value)}),e.jsx("div",{className:"ap-findFilters",children:M.map(s=>e.jsxs("button",{type:"button",className:"ap-filter","data-on":x===s||void 0,onClick:()=>S(t=>t===s?null:s),children:[e.jsx(R,{harness:s,size:11}),s.charAt(0).toUpperCase()+s.slice(1)]},s))})]}),e.jsxs("div",{className:"ap-main",children:[e.jsxs("div",{className:"ap-sectionHead",children:[e.jsx("span",{className:"ap-sectionTitle",children:"Agents"}),e.jsxs("span",{className:"ap-sectionMeta",children:[i.length," shown",E?" · filtered":""]}),e.jsxs("span",{className:"ap-kbdHint","aria-hidden":!0,children:["↑↓ move · ↵ open",U?" · ⌘↵ needs":""]})]}),e.jsxs("div",{className:"ap-roster",children:[i.map((s,t)=>e.jsx(ne,{g:s,gestures:c,sessions:A,selected:z(s),cursor:u===t,rowRef:y=>{y?v.current.set(s.name,y):v.current.delete(s.name)}},s.name)),i.length===0?e.jsx("div",{className:"ap-empty",children:E?"No agents match.":I.length?"No primary agents — workflow & clone agents are in the fold below.":"No agents in this project yet."}):null]}),I.length?e.jsxs("div",{className:"ap-ephBlock",children:[e.jsxs("button",{type:"button",className:"ap-ephToggle",onClick:()=>p(s=>!s),children:[e.jsx("span",{className:"ap-ephCount",children:I.length})," ephemeral · workflow & clone agents",e.jsx("span",{className:"ap-ephCaret",children:N?"▴":"▾"})]}),N?e.jsx("div",{className:"ap-ephList",children:I.map(s=>e.jsxs("button",{type:"button",className:"ap-ephRow",onClick:()=>c.openAgentPage(s.nodes[0].row),children:[e.jsx("span",{className:"ap-ephMark","aria-hidden":!0,children:e.jsx(R,{harness:D(s.harness),size:10})}),e.jsx("span",{className:"ap-ephName",children:s.name}),e.jsx("span",{className:"ap-ephBranch",children:s.branches[0]??"main"}),e.jsx("span",{className:"ap-ephAgo",children:s.lastActivityAt?O(s.lastActivityAt):"—"})]},s.name))}):null]}):null,e.jsx("button",{type:"button",className:"ap-newAgent",disabled:!o,onClick:()=>o&&c.startSession(o.nodes[0].row),children:"+ New agent on this project"})]})]})})}export{Ye as AgentsLibrary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"./createLucideIcon-
|
|
1
|
+
import{c}from"./createLucideIcon-Bt67PWH-.js";const e=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],a=c("loader-circle",e);export{a as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r}from"./index-
|
|
1
|
+
import{r}from"./index-o4FKpU7Z.js";import{a as d}from"./api-h5zurxmi.js";import{u as f}from"./Provider-DKZWuzSR.js";function p(e){if(!e)return null;const s=e.split("/").filter(Boolean);return s[s.length-1]??null}function m(e,s){if(!e)return[];const l=new Set;for(const t of s)t.cwd&&l.add(t.cwd),t.projectRoot&&l.add(t.projectRoot);const o=new Map;for(const t of e.transcripts){if(!t.cwd)continue;const n=o.get(t.cwd),a=t.lastEventAt??t.mtimeMs,c=n?.lastEventAt??n?.mtimeMs??0;(!n||a>c)&&o.set(t.cwd,t)}const i=[];for(const t of e.processes){if(t.harness==="scout-managed"||t.cwd&&l.has(t.cwd))continue;const n=t.cwd?o.get(t.cwd):void 0,a=n?.project??p(t.cwd)??null,c=n?.lastEventAt??n?.mtimeMs??e.generatedAt,u=n?.sessionId??null;i.push({id:`harness:${t.source}:${t.pid}`,definitionId:`harness:${t.source}:${t.pid}`,name:t.source,handle:null,agentClass:"organic",harness:t.source,state:"working",projectRoot:t.cwd,cwd:t.cwd,updatedAt:c,createdAt:null,transport:null,selector:null,defaultSelector:null,nodeQualifier:null,workspaceQualifier:null,wakePolicy:null,capabilities:[],project:a,branch:null,role:null,model:null,harnessSessionId:u,terminalSurface:null,harnessLogPath:n?.transcriptPath??null,conversationId:u??`harness:${t.pid}`,homeNodeId:null,homeNodeName:null,ownerId:null,ownerName:null,ownerHandle:null,staleLocalRegistration:!1,retiredFromFleet:!1,replacedByAgentId:null})}return i}function A(){const{agents:e}=f(),[s,l]=r.useState(null);r.useEffect(()=>{let t=!1;const n=async()=>{const c=await d("/api/tail/discover").catch(()=>null);t||l(c)};n();const a=setInterval(()=>{n()},1e4);return()=>{t=!0,clearInterval(a)}},[]);const o=r.useMemo(()=>m(s,e),[s,e]);return{agents:r.useMemo(()=>[...e,...o],[e,o]),scoutAgents:e,organicAgents:o,discovery:s}}export{A as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l,r as d}from"./index-CzVeWScw.js";import{n as y,e as F,f as V,d as K}from"./colors-BtO5_zlx.js";import{r as T}from"./index-Dewd56RX.js";import{a as Z}from"./api-h5zurxmi.js";import{u as N}from"./Provider-DSsb2gLR.js";import{A as U}from"./AgentDetailCard-sZuHl1de.js";const X={workspace:"workspace",worktree:"workspace",branch:"workspace",profile:"profile",persona:"profile",harness:"harness",runtime:"harness",model:"model",node:"node",host:"node"};function G(e){return e.trim().replace(/^@+/,"").replace(/[.,!?;)\]]+$/,"")}function m(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const Y="scout";function B(e){return X[m(e)]??null}function D(e){const n=m(e.definitionId),t=e.workspaceQualifier?m(e.workspaceQualifier):void 0,r=e.profile?m(e.profile):void 0,o=e.harness?m(e.harness):void 0,i=e.model?m(e.model):void 0,s=e.nodeQualifier?m(e.nodeQualifier):void 0;return n?{definitionId:n,...t?{workspaceQualifier:t}:{},...r?{profile:r}:{},...o?{harness:o}:{},...i?{model:i}:{},...s?{nodeQualifier:s}:{}}:null}function O(e){const n=e.split(".").filter(Boolean),t=n.shift();if(!t)return null;const r={definitionId:t},o=[];for(const i of n){if(i.includes(":")){const[s,c=""]=i.split(":",2),a=B(s),u=m(c);if(!a||!u)return null;a==="workspace"?r.workspaceQualifier=u:a==="profile"?r.profile=u:a==="harness"?r.harness=u:a==="model"?r.model=u:a==="node"&&(r.nodeQualifier=u);continue}o.push(i)}if(o.length===1){const i=m(o[0]);if(!i)return null;r.workspaceQualifier=i}else if(o.length===2){const i=m(o[0]),s=m(o[1]);if(!i||!s)return null;r.workspaceQualifier||(r.workspaceQualifier=i),r.nodeQualifier||(r.nodeQualifier=s)}else if(o.length>2)return null;return M(r,{raw:e})}function J(e){const n=e.indexOf("#"),t=e.indexOf("?");if(n===-1&&t===-1||e.indexOf("#",n+1)!==-1||e.indexOf("?",t+1)!==-1||n!==-1&&t!==-1&&t<n)return null;const r=Math.min(...[n,t].filter(a=>a>=0)),o=e.slice(0,r);if(!o)return null;const i=O(o);if(!i)return null;const s=n>=0?e.slice(n+1,t>=0?t:e.length):"",c=t>=0?e.slice(t+1):"";return n>=0&&!s||t>=0&&!c||s.includes("#")||s.includes("?")||c.includes("#")||c.includes("?")||i.harness&&s||i.model&&c?null:M({definitionId:i.definitionId,nodeQualifier:i.nodeQualifier,workspaceQualifier:i.workspaceQualifier,profile:i.profile,harness:s||i.harness,model:c||i.model},{raw:e})}function q(e){const n=G(e);return!n||n.includes("@")?null:n.includes("#")||n.includes("?")?J(n):O(n)}function L(e,n={}){const t=D(e);if(!t)return n.includeSigil===!1?"":"@";const o=[`${n.includeSigil===!1?"":"@"}${t.definitionId}`];return t.workspaceQualifier&&o.push(t.workspaceQualifier),t.profile&&o.push(`profile:${t.profile}`),t.harness&&o.push(`harness:${t.harness}`),t.model&&o.push(`model:${t.model}`),t.nodeQualifier&&o.push(`node:${t.nodeQualifier}`),o.join(".")}function M(e,n={}){const t=D(e);return t?{raw:n.raw??L(t,{includeSigil:!1}),label:L(t),definitionId:t.definitionId,...t.nodeQualifier?{nodeQualifier:t.nodeQualifier}:{},...t.workspaceQualifier?{workspaceQualifier:t.workspaceQualifier}:{},...t.profile?{profile:t.profile}:{},...t.harness?{harness:t.harness}:{},...t.model?{model:t.model}:{}}:null}function ee(e){return ne(e).parsed}function ne(e){const n=Array.from(e.matchAll(/(^|[\s([{'"`])@([a-z0-9][a-z0-9._/:-]*(?:#[a-z0-9][a-z0-9._/:-]*)?(?:\?[a-z0-9][a-z0-9._/:-]*)?)(?=$|[\s)\]}",.!?:;'"`])/gi)),t=new Map,r=[];for(const o of n){const i=o[2]??"",s=q(i);if(!s){i&&r.push(`@${i}`);continue}t.set(s.label,s)}return{parsed:Array.from(t.values()),unparsed:Array.from(new Set(r))}}const te=280,re=120,E=320,j=8,Q=new Map,ie=1e4;function p(e){const n=e?.trim().replace(/^@+/,"").toLowerCase();return n&&n.length>0?n:null}function W(e){const n=new Set,t=r=>{const o=p(r);o&&n.add(o)};return t(e.id),t(e.handle),t(e.name),t(e.selector),t(e.defaultSelector),t(e.definitionId),e.definitionId&&e.workspaceQualifier&&t(`${e.definitionId}.${e.workspaceQualifier}`),e.definitionId&&e.workspaceQualifier&&e.nodeQualifier&&(t(`${e.definitionId}.${e.workspaceQualifier}.${e.nodeQualifier}`),t(`${e.definitionId}.${e.workspaceQualifier}.node:${e.nodeQualifier}`)),e.definitionId&&e.nodeQualifier&&t(`${e.definitionId}.node:${e.nodeQualifier}`),n}function oe(e,n){const t=p(n.label),r=p(n.raw),o=W(e);return t&&o.has(t)||r&&o.has(r)?!0:n.definitionId&&p(e.definitionId)!==p(n.definitionId)||n.workspaceQualifier&&p(e.workspaceQualifier)!==p(n.workspaceQualifier)||n.nodeQualifier&&p(e.nodeQualifier)!==p(n.nodeQualifier)||n.harness&&p(e.harness)!==p(n.harness)||n.model&&p(e.model)!==p(n.model)?!1:!!n.definitionId}function _(e,n){const t=p(n.label),r=p(n.raw),o=W(e),i=t&&o.has(t)||r&&o.has(r)?1e3:0,s=[n.workspaceQualifier,n.nodeQualifier,n.harness,n.model,n.profile].filter(Boolean).length*100;y(e.state);const c=F(e.state,e)?30:V(e.state,e)?20:0;return i+s+c+Math.min(e.updatedAt??0,9999999999)/1e9}function se(e){const n=p(e.raw);return n&&n.split(".").length>=3?n:null}function H(e,n){const t=n.filter(r=>oe(r,e)).sort((r,o)=>_(o,e)-_(r,e));return t[0]?t[0]:null}async function le(e,n){const t=H(e,n),r=t?.id??se(e),o=r??e.label,i=Q.get(o);if(i&&Date.now()-i.fetchedAt<ie)return i.agent;if(!r)return Q.set(o,{agent:t,fetchedAt:Date.now()}),t;try{const s=await Z(`/api/agents/${encodeURIComponent(r)}`);return Q.set(o,{agent:s,fetchedAt:Date.now()}),s}catch{return Q.set(o,{agent:t,fetchedAt:Date.now()}),t}}function C(e){const n=window.innerWidth,t=window.innerHeight,r=Math.max(j,Math.min(n-E-j,e.left+e.width/2-E/2)),o=e.top-j;return o>200||e.bottom>t-200?{top:o,left:r,placement:"above"}:{top:e.bottom+j,left:r,placement:"below"}}function ae(e){let n=e;for(;n;){if(n instanceof HTMLElement&&n.dataset.scoutTheme)return n;n=n.parentElement??null}return document.body}function ce({identity:e,agent:n,triggerEl:t,onRequestClose:r}){const{agents:o,navigate:i}=N(),[s,c]=d.useState(()=>n??H(e,o)),[a,u]=d.useState(!n),[f,w]=d.useState(()=>C(t.getBoundingClientRect())),x=d.useRef(null),g=ae(t);d.useEffect(()=>{if(n){c(n),u(!1);return}let h=!1;return u(!0),le(e,o).then(I=>{h||(c(I),u(!1))}),()=>{h=!0}},[e,o,n]),d.useEffect(()=>{const h=()=>{w(C(t.getBoundingClientRect()))};return window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}},[t]),d.useEffect(()=>{const h=I=>{I.key==="Escape"&&r()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[r]);const k=d.useCallback(()=>{s&&(i({view:"agents-v2",agentId:s.id}),r())},[s,i,r]),b=f.placement==="above"?"bottom center":"top center",A=f.placement==="above"?"translateY(-100%)":"",$={position:"fixed",top:f.top,left:f.left,width:E,transform:A,transformOrigin:b};return s?T.createPortal(l.jsx("div",{onMouseEnter:()=>{},onMouseLeave:r,children:l.jsx(U,{ref:x,agent:s,pinned:!0,onOpen:k,onClose:r,onAction:r,style:$,className:"agent-card--mention"})}),g):T.createPortal(l.jsx("div",{ref:x,className:"agent-card agent-card--pinned agent-card--mention",role:"dialog","aria-label":`${e.label} snapshot`,style:$,onMouseEnter:()=>{},onMouseLeave:r,children:l.jsx("div",{style:{fontSize:"12px",color:"var(--dim)",padding:"4px 2px"},children:a?"loading…":l.jsxs(l.Fragment,{children:["No agent registered as ",l.jsx("code",{children:e.label}),"."]})})}),g)}function ue(e){return M({definitionId:e.definitionId,workspaceQualifier:e.workspaceQualifier??void 0,nodeQualifier:e.nodeQualifier??void 0,harness:e.harness??void 0,model:e.model??void 0})}function fe(e){const{agent:n,identity:t}=e,[r,o]=d.useState(!1),[i,s]=d.useState(!1),c=d.useRef(null),a=d.useRef(null),u=d.useRef(null),f=d.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null)},[]),w=d.useCallback(()=>{r||(f(),a.current=window.setTimeout(()=>o(!0),te))},[r,f]),x=d.useCallback(()=>{i||(f(),u.current=window.setTimeout(()=>o(!1),re))},[i,f]),g=d.useCallback(()=>{f(),o(!1),s(!1)},[f]);d.useEffect(()=>()=>f(),[f]);const k=d.useMemo(()=>t??(n?ue(n):null),[t,n]),b=!!k,A=d.useCallback(v=>{if(v.preventDefault(),v.stopPropagation(),r&&i){g();return}f(),s(!0),o(!0)},[r,i,g,f]),$=d.useCallback(v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),s(!0),o(!0))},[]),h=b?{ref:c,onMouseEnter:w,onMouseLeave:x,onFocus:w,onBlur:x,onClick:A,onKeyDown:$,"data-hover-open":r?"true":void 0,"aria-haspopup":"dialog","aria-expanded":r}:{ref:c},I=r&&c.current&&k?l.jsx(ce,{identity:k,agent:n??null,triggerEl:c.current,onRequestClose:()=>{i?g():x()}}):null;return{triggerProps:h,popover:I,open:r,pinned:i}}function de({identity:e,color:n}){const{triggerProps:t,popover:r}=fe({identity:e});return l.jsxs(l.Fragment,{children:[l.jsx("span",{...t,className:"s-mention",role:"button",tabIndex:0,style:{"--mention-color":n},children:e.label}),r]})}const pe=["ts","tsx","js","jsx","mjs","cjs","md","mdx","txt","log","json","jsonc","yaml","yml","toml","css","scss","html","htm","sh","py","rb","go","rs","swift","kt","java","c","cpp","h","png","jpg","jpeg","gif","svg","webp","avif","env","conf","ini","gitignore","sql","xml"],he=pe.join("|"),S=new RegExp(`\\.(?:${he})(?:$|[?#])`,"i"),me=/^(?:\/Users\/|\/home\/|\/Volumes\/|\/var\/|\/etc\/|\/opt\/|\/tmp\/|\/private\/|\/mnt\/|\/Applications\/|\/usr\/|\/Library\/)/u,we=/(?:^|[\s(\[`'"])((?:~\/|\.\/|\.\.\/|\/)[A-Za-z0-9._/\-]+|[A-Za-z0-9._\-]+(?:\/[A-Za-z0-9._\-]+)+)/g;function xe(e){return e.startsWith("~/")||e.startsWith("./")||e.startsWith("../")?!0:e.startsWith("/")&&me.test(e)||S.test(e)}function P(e){const n=[],t=new RegExp(we.source,"g");let r;for(;(r=t.exec(e))!==null;){const o=r[1];if(!o)continue;const i=o.replace(/[.,;:!?]+$/u,"");if(!i||!xe(i))continue;const s=r[0].lastIndexOf(o);if(s<0)continue;const c=r.index+s;n.push({start:c,end:c+i.length,path:i})}return n}function ge(e){return/\.(png|jpe?g|gif|svg|webp|avif)(?:$|[?#])/iu.test(e)}function ve(e){return e.endsWith("/")?!0:!(e.split("/").pop()??"").includes(".")&&!e.startsWith("./")&&!e.startsWith("../")}function ke({kind:e}){return e==="dir"?l.jsx("svg",{className:"s-path-token-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:l.jsx("path",{d:"M2 5a1 1 0 0 1 1-1h3.5l1.5 1.5h5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1Z"})}):e==="image"?l.jsxs("svg",{className:"s-path-token-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),l.jsx("circle",{cx:"6",cy:"7",r:"1"}),l.jsx("path",{d:"m3 12 3.5-3 2.5 2 3-2.5L14 11"})]}):l.jsxs("svg",{className:"s-path-token-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M4 2h5l3 3v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1Z"}),l.jsx("path",{d:"M9 2v3h3"})]})}function R({path:e}){const{openFilePreview:n}=N(),t=ge(e)?"image":ve(e)?"dir":"file";return l.jsxs("button",{type:"button",className:"s-path-token",onClick:r=>{r.preventDefault(),r.stopPropagation(),n(e)},title:`Open ${e}`,children:[l.jsx(ke,{kind:t}),e]})}function Ie(e,n){if(n.length===0)return[{kind:"text",value:e}];const t=new Map;for(const s of n)t.set(s.label.toLowerCase(),s);const r=[];let o=e;const i=/@([a-z0-9][a-z0-9._/:-]*)/i;for(;o.length>0;){const s=i.exec(o);if(!s||s.index===void 0){r.push({kind:"text",value:o});break}s.index>0&&r.push({kind:"text",value:o.slice(0,s.index)});const c=s[0],a=c.toLowerCase(),u=t.get(a);u?r.push({kind:"mention",identity:u}):r.push({kind:"text",value:c}),o=o.slice(s.index+c.length)}return r}function $e(e,n){const t=[],r=/`([^`\n]+)`|\*\*(.+?)\*\*|\*([^*\s][^*]*?)\*|\[([^\]\n]+)\]\(([^)\s]+)\)|(https?:\/\/[^\s<>"')\]]+)/g;let o=0,i,s=0;const c=a=>{if(!a)return;const u=P(a);if(u.length===0){t.push(l.jsx("span",{children:a},`${n}-${s++}`));return}let f=0;for(const w of u)w.start>f&&t.push(l.jsx("span",{children:a.slice(f,w.start)},`${n}-${s++}`)),t.push(l.jsx(R,{path:w.path},`${n}-${s++}`)),f=w.end;f<a.length&&t.push(l.jsx("span",{children:a.slice(f)},`${n}-${s++}`))};for(;(i=r.exec(e))!==null;){if(i.index>o&&c(e.slice(o,i.index)),i[1]!==void 0){const a=i[1],u=P(` ${a}`);u.length===1&&u[0].path===a?t.push(l.jsx(R,{path:a},`${n}-${s++}`)):t.push(l.jsx("code",{className:"s-inline-code",children:a},`${n}-${s++}`))}else if(i[2]!==void 0)t.push(l.jsx("strong",{children:i[2]},`${n}-${s++}`));else if(i[3]!==void 0)t.push(l.jsx("em",{children:i[3]},`${n}-${s++}`));else if(i[4]!==void 0&&i[5]!==void 0&&z(i[5]))t.push(l.jsx("a",{className:"s-inline-link",href:i[5],target:"_blank",rel:"noreferrer",children:i[4]},`${n}-${s++}`));else if(i[6]!==void 0&&z(i[6])){const a=i[6].replace(/[.,;:!?]+$/u,""),u=i[6].slice(a.length);t.push(l.jsx("a",{className:"s-inline-link",href:a,target:"_blank",rel:"noreferrer",children:a},`${n}-${s++}`)),u&&t.push(l.jsx("span",{children:u},`${n}-${s++}`))}else t.push(l.jsx("span",{children:i[0]},`${n}-${s++}`));o=i.index+i[0].length}return o<e.length&&c(e.slice(o)),t.length>0?t:[l.jsx("span",{children:e},n)]}function z(e){return/^(?:https?:\/\/|mailto:|\/|#)/iu.test(e)}function Te(e){if(!e)return e??"";const n=ee(e);return Ie(e,n).flatMap((r,o)=>{if(r.kind==="text")return $e(r.value,o*100);const{identity:i}=r,c=i.definitionId===Y?"var(--accent)":K(i.definitionId);return l.jsx(de,{identity:i,color:c},o)})}export{Te as r};
|
|
1
|
+
import{j as l,r as d}from"./index-o4FKpU7Z.js";import{n as y,e as F,f as V,d as K}from"./colors-BtO5_zlx.js";import{r as T}from"./index-BMwKgdz_.js";import{a as Z}from"./api-h5zurxmi.js";import{u as N}from"./Provider-DKZWuzSR.js";import{A as U}from"./AgentDetailCard-Biq8b2gv.js";const X={workspace:"workspace",worktree:"workspace",branch:"workspace",profile:"profile",persona:"profile",harness:"harness",runtime:"harness",model:"model",node:"node",host:"node"};function G(e){return e.trim().replace(/^@+/,"").replace(/[.,!?;)\]]+$/,"")}function m(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const Y="scout";function B(e){return X[m(e)]??null}function D(e){const n=m(e.definitionId),t=e.workspaceQualifier?m(e.workspaceQualifier):void 0,r=e.profile?m(e.profile):void 0,o=e.harness?m(e.harness):void 0,i=e.model?m(e.model):void 0,s=e.nodeQualifier?m(e.nodeQualifier):void 0;return n?{definitionId:n,...t?{workspaceQualifier:t}:{},...r?{profile:r}:{},...o?{harness:o}:{},...i?{model:i}:{},...s?{nodeQualifier:s}:{}}:null}function O(e){const n=e.split(".").filter(Boolean),t=n.shift();if(!t)return null;const r={definitionId:t},o=[];for(const i of n){if(i.includes(":")){const[s,c=""]=i.split(":",2),a=B(s),u=m(c);if(!a||!u)return null;a==="workspace"?r.workspaceQualifier=u:a==="profile"?r.profile=u:a==="harness"?r.harness=u:a==="model"?r.model=u:a==="node"&&(r.nodeQualifier=u);continue}o.push(i)}if(o.length===1){const i=m(o[0]);if(!i)return null;r.workspaceQualifier=i}else if(o.length===2){const i=m(o[0]),s=m(o[1]);if(!i||!s)return null;r.workspaceQualifier||(r.workspaceQualifier=i),r.nodeQualifier||(r.nodeQualifier=s)}else if(o.length>2)return null;return M(r,{raw:e})}function J(e){const n=e.indexOf("#"),t=e.indexOf("?");if(n===-1&&t===-1||e.indexOf("#",n+1)!==-1||e.indexOf("?",t+1)!==-1||n!==-1&&t!==-1&&t<n)return null;const r=Math.min(...[n,t].filter(a=>a>=0)),o=e.slice(0,r);if(!o)return null;const i=O(o);if(!i)return null;const s=n>=0?e.slice(n+1,t>=0?t:e.length):"",c=t>=0?e.slice(t+1):"";return n>=0&&!s||t>=0&&!c||s.includes("#")||s.includes("?")||c.includes("#")||c.includes("?")||i.harness&&s||i.model&&c?null:M({definitionId:i.definitionId,nodeQualifier:i.nodeQualifier,workspaceQualifier:i.workspaceQualifier,profile:i.profile,harness:s||i.harness,model:c||i.model},{raw:e})}function q(e){const n=G(e);return!n||n.includes("@")?null:n.includes("#")||n.includes("?")?J(n):O(n)}function L(e,n={}){const t=D(e);if(!t)return n.includeSigil===!1?"":"@";const o=[`${n.includeSigil===!1?"":"@"}${t.definitionId}`];return t.workspaceQualifier&&o.push(t.workspaceQualifier),t.profile&&o.push(`profile:${t.profile}`),t.harness&&o.push(`harness:${t.harness}`),t.model&&o.push(`model:${t.model}`),t.nodeQualifier&&o.push(`node:${t.nodeQualifier}`),o.join(".")}function M(e,n={}){const t=D(e);return t?{raw:n.raw??L(t,{includeSigil:!1}),label:L(t),definitionId:t.definitionId,...t.nodeQualifier?{nodeQualifier:t.nodeQualifier}:{},...t.workspaceQualifier?{workspaceQualifier:t.workspaceQualifier}:{},...t.profile?{profile:t.profile}:{},...t.harness?{harness:t.harness}:{},...t.model?{model:t.model}:{}}:null}function ee(e){return ne(e).parsed}function ne(e){const n=Array.from(e.matchAll(/(^|[\s([{'"`])@([a-z0-9][a-z0-9._/:-]*(?:#[a-z0-9][a-z0-9._/:-]*)?(?:\?[a-z0-9][a-z0-9._/:-]*)?)(?=$|[\s)\]}",.!?:;'"`])/gi)),t=new Map,r=[];for(const o of n){const i=o[2]??"",s=q(i);if(!s){i&&r.push(`@${i}`);continue}t.set(s.label,s)}return{parsed:Array.from(t.values()),unparsed:Array.from(new Set(r))}}const te=280,re=120,E=320,j=8,Q=new Map,ie=1e4;function p(e){const n=e?.trim().replace(/^@+/,"").toLowerCase();return n&&n.length>0?n:null}function W(e){const n=new Set,t=r=>{const o=p(r);o&&n.add(o)};return t(e.id),t(e.handle),t(e.name),t(e.selector),t(e.defaultSelector),t(e.definitionId),e.definitionId&&e.workspaceQualifier&&t(`${e.definitionId}.${e.workspaceQualifier}`),e.definitionId&&e.workspaceQualifier&&e.nodeQualifier&&(t(`${e.definitionId}.${e.workspaceQualifier}.${e.nodeQualifier}`),t(`${e.definitionId}.${e.workspaceQualifier}.node:${e.nodeQualifier}`)),e.definitionId&&e.nodeQualifier&&t(`${e.definitionId}.node:${e.nodeQualifier}`),n}function oe(e,n){const t=p(n.label),r=p(n.raw),o=W(e);return t&&o.has(t)||r&&o.has(r)?!0:n.definitionId&&p(e.definitionId)!==p(n.definitionId)||n.workspaceQualifier&&p(e.workspaceQualifier)!==p(n.workspaceQualifier)||n.nodeQualifier&&p(e.nodeQualifier)!==p(n.nodeQualifier)||n.harness&&p(e.harness)!==p(n.harness)||n.model&&p(e.model)!==p(n.model)?!1:!!n.definitionId}function _(e,n){const t=p(n.label),r=p(n.raw),o=W(e),i=t&&o.has(t)||r&&o.has(r)?1e3:0,s=[n.workspaceQualifier,n.nodeQualifier,n.harness,n.model,n.profile].filter(Boolean).length*100;y(e.state);const c=F(e.state,e)?30:V(e.state,e)?20:0;return i+s+c+Math.min(e.updatedAt??0,9999999999)/1e9}function se(e){const n=p(e.raw);return n&&n.split(".").length>=3?n:null}function H(e,n){const t=n.filter(r=>oe(r,e)).sort((r,o)=>_(o,e)-_(r,e));return t[0]?t[0]:null}async function le(e,n){const t=H(e,n),r=t?.id??se(e),o=r??e.label,i=Q.get(o);if(i&&Date.now()-i.fetchedAt<ie)return i.agent;if(!r)return Q.set(o,{agent:t,fetchedAt:Date.now()}),t;try{const s=await Z(`/api/agents/${encodeURIComponent(r)}`);return Q.set(o,{agent:s,fetchedAt:Date.now()}),s}catch{return Q.set(o,{agent:t,fetchedAt:Date.now()}),t}}function C(e){const n=window.innerWidth,t=window.innerHeight,r=Math.max(j,Math.min(n-E-j,e.left+e.width/2-E/2)),o=e.top-j;return o>200||e.bottom>t-200?{top:o,left:r,placement:"above"}:{top:e.bottom+j,left:r,placement:"below"}}function ae(e){let n=e;for(;n;){if(n instanceof HTMLElement&&n.dataset.scoutTheme)return n;n=n.parentElement??null}return document.body}function ce({identity:e,agent:n,triggerEl:t,onRequestClose:r}){const{agents:o,navigate:i}=N(),[s,c]=d.useState(()=>n??H(e,o)),[a,u]=d.useState(!n),[f,w]=d.useState(()=>C(t.getBoundingClientRect())),x=d.useRef(null),g=ae(t);d.useEffect(()=>{if(n){c(n),u(!1);return}let h=!1;return u(!0),le(e,o).then(I=>{h||(c(I),u(!1))}),()=>{h=!0}},[e,o,n]),d.useEffect(()=>{const h=()=>{w(C(t.getBoundingClientRect()))};return window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}},[t]),d.useEffect(()=>{const h=I=>{I.key==="Escape"&&r()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[r]);const k=d.useCallback(()=>{s&&(i({view:"agents-v2",agentId:s.id}),r())},[s,i,r]),b=f.placement==="above"?"bottom center":"top center",A=f.placement==="above"?"translateY(-100%)":"",$={position:"fixed",top:f.top,left:f.left,width:E,transform:A,transformOrigin:b};return s?T.createPortal(l.jsx("div",{onMouseEnter:()=>{},onMouseLeave:r,children:l.jsx(U,{ref:x,agent:s,pinned:!0,onOpen:k,onClose:r,onAction:r,style:$,className:"agent-card--mention"})}),g):T.createPortal(l.jsx("div",{ref:x,className:"agent-card agent-card--pinned agent-card--mention",role:"dialog","aria-label":`${e.label} snapshot`,style:$,onMouseEnter:()=>{},onMouseLeave:r,children:l.jsx("div",{style:{fontSize:"12px",color:"var(--dim)",padding:"4px 2px"},children:a?"loading…":l.jsxs(l.Fragment,{children:["No agent registered as ",l.jsx("code",{children:e.label}),"."]})})}),g)}function ue(e){return M({definitionId:e.definitionId,workspaceQualifier:e.workspaceQualifier??void 0,nodeQualifier:e.nodeQualifier??void 0,harness:e.harness??void 0,model:e.model??void 0})}function fe(e){const{agent:n,identity:t}=e,[r,o]=d.useState(!1),[i,s]=d.useState(!1),c=d.useRef(null),a=d.useRef(null),u=d.useRef(null),f=d.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null)},[]),w=d.useCallback(()=>{r||(f(),a.current=window.setTimeout(()=>o(!0),te))},[r,f]),x=d.useCallback(()=>{i||(f(),u.current=window.setTimeout(()=>o(!1),re))},[i,f]),g=d.useCallback(()=>{f(),o(!1),s(!1)},[f]);d.useEffect(()=>()=>f(),[f]);const k=d.useMemo(()=>t??(n?ue(n):null),[t,n]),b=!!k,A=d.useCallback(v=>{if(v.preventDefault(),v.stopPropagation(),r&&i){g();return}f(),s(!0),o(!0)},[r,i,g,f]),$=d.useCallback(v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),s(!0),o(!0))},[]),h=b?{ref:c,onMouseEnter:w,onMouseLeave:x,onFocus:w,onBlur:x,onClick:A,onKeyDown:$,"data-hover-open":r?"true":void 0,"aria-haspopup":"dialog","aria-expanded":r}:{ref:c},I=r&&c.current&&k?l.jsx(ce,{identity:k,agent:n??null,triggerEl:c.current,onRequestClose:()=>{i?g():x()}}):null;return{triggerProps:h,popover:I,open:r,pinned:i}}function de({identity:e,color:n}){const{triggerProps:t,popover:r}=fe({identity:e});return l.jsxs(l.Fragment,{children:[l.jsx("span",{...t,className:"s-mention",role:"button",tabIndex:0,style:{"--mention-color":n},children:e.label}),r]})}const pe=["ts","tsx","js","jsx","mjs","cjs","md","mdx","txt","log","json","jsonc","yaml","yml","toml","css","scss","html","htm","sh","py","rb","go","rs","swift","kt","java","c","cpp","h","png","jpg","jpeg","gif","svg","webp","avif","env","conf","ini","gitignore","sql","xml"],he=pe.join("|"),S=new RegExp(`\\.(?:${he})(?:$|[?#])`,"i"),me=/^(?:\/Users\/|\/home\/|\/Volumes\/|\/var\/|\/etc\/|\/opt\/|\/tmp\/|\/private\/|\/mnt\/|\/Applications\/|\/usr\/|\/Library\/)/u,we=/(?:^|[\s(\[`'"])((?:~\/|\.\/|\.\.\/|\/)[A-Za-z0-9._/\-]+|[A-Za-z0-9._\-]+(?:\/[A-Za-z0-9._\-]+)+)/g;function xe(e){return e.startsWith("~/")||e.startsWith("./")||e.startsWith("../")?!0:e.startsWith("/")&&me.test(e)||S.test(e)}function P(e){const n=[],t=new RegExp(we.source,"g");let r;for(;(r=t.exec(e))!==null;){const o=r[1];if(!o)continue;const i=o.replace(/[.,;:!?]+$/u,"");if(!i||!xe(i))continue;const s=r[0].lastIndexOf(o);if(s<0)continue;const c=r.index+s;n.push({start:c,end:c+i.length,path:i})}return n}function ge(e){return/\.(png|jpe?g|gif|svg|webp|avif)(?:$|[?#])/iu.test(e)}function ve(e){return e.endsWith("/")?!0:!(e.split("/").pop()??"").includes(".")&&!e.startsWith("./")&&!e.startsWith("../")}function ke({kind:e}){return e==="dir"?l.jsx("svg",{className:"s-path-token-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:l.jsx("path",{d:"M2 5a1 1 0 0 1 1-1h3.5l1.5 1.5h5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1Z"})}):e==="image"?l.jsxs("svg",{className:"s-path-token-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),l.jsx("circle",{cx:"6",cy:"7",r:"1"}),l.jsx("path",{d:"m3 12 3.5-3 2.5 2 3-2.5L14 11"})]}):l.jsxs("svg",{className:"s-path-token-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M4 2h5l3 3v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1Z"}),l.jsx("path",{d:"M9 2v3h3"})]})}function R({path:e}){const{openFilePreview:n}=N(),t=ge(e)?"image":ve(e)?"dir":"file";return l.jsxs("button",{type:"button",className:"s-path-token",onClick:r=>{r.preventDefault(),r.stopPropagation(),n(e)},title:`Open ${e}`,children:[l.jsx(ke,{kind:t}),e]})}function Ie(e,n){if(n.length===0)return[{kind:"text",value:e}];const t=new Map;for(const s of n)t.set(s.label.toLowerCase(),s);const r=[];let o=e;const i=/@([a-z0-9][a-z0-9._/:-]*)/i;for(;o.length>0;){const s=i.exec(o);if(!s||s.index===void 0){r.push({kind:"text",value:o});break}s.index>0&&r.push({kind:"text",value:o.slice(0,s.index)});const c=s[0],a=c.toLowerCase(),u=t.get(a);u?r.push({kind:"mention",identity:u}):r.push({kind:"text",value:c}),o=o.slice(s.index+c.length)}return r}function $e(e,n){const t=[],r=/`([^`\n]+)`|\*\*(.+?)\*\*|\*([^*\s][^*]*?)\*|\[([^\]\n]+)\]\(([^)\s]+)\)|(https?:\/\/[^\s<>"')\]]+)/g;let o=0,i,s=0;const c=a=>{if(!a)return;const u=P(a);if(u.length===0){t.push(l.jsx("span",{children:a},`${n}-${s++}`));return}let f=0;for(const w of u)w.start>f&&t.push(l.jsx("span",{children:a.slice(f,w.start)},`${n}-${s++}`)),t.push(l.jsx(R,{path:w.path},`${n}-${s++}`)),f=w.end;f<a.length&&t.push(l.jsx("span",{children:a.slice(f)},`${n}-${s++}`))};for(;(i=r.exec(e))!==null;){if(i.index>o&&c(e.slice(o,i.index)),i[1]!==void 0){const a=i[1],u=P(` ${a}`);u.length===1&&u[0].path===a?t.push(l.jsx(R,{path:a},`${n}-${s++}`)):t.push(l.jsx("code",{className:"s-inline-code",children:a},`${n}-${s++}`))}else if(i[2]!==void 0)t.push(l.jsx("strong",{children:i[2]},`${n}-${s++}`));else if(i[3]!==void 0)t.push(l.jsx("em",{children:i[3]},`${n}-${s++}`));else if(i[4]!==void 0&&i[5]!==void 0&&z(i[5]))t.push(l.jsx("a",{className:"s-inline-link",href:i[5],target:"_blank",rel:"noreferrer",children:i[4]},`${n}-${s++}`));else if(i[6]!==void 0&&z(i[6])){const a=i[6].replace(/[.,;:!?]+$/u,""),u=i[6].slice(a.length);t.push(l.jsx("a",{className:"s-inline-link",href:a,target:"_blank",rel:"noreferrer",children:a},`${n}-${s++}`)),u&&t.push(l.jsx("span",{children:u},`${n}-${s++}`))}else t.push(l.jsx("span",{children:i[0]},`${n}-${s++}`));o=i.index+i[0].length}return o<e.length&&c(e.slice(o)),t.length>0?t:[l.jsx("span",{children:e},n)]}function z(e){return/^(?:https?:\/\/|mailto:|\/|#)/iu.test(e)}function Te(e){if(!e)return e??"";const n=ee(e);return Ie(e,n).flatMap((r,o)=>{if(r.kind==="text")return $e(r.value,o*100);const{identity:i}=r,c=i.definitionId===Y?"var(--accent)":K(i.definitionId);return l.jsx(de,{identity:i,color:c},o)})}export{Te as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p}from"./index-
|
|
1
|
+
import{r as p}from"./index-o4FKpU7Z.js";const M={active:"active",moving:"moving",done:"done",archive:"archive"},b=["active","moving","done","archive"],h=300*1e3,O=1800*1e3,S=1440*60*1e3;function L(t,n=Date.now()){const o=n-u(t);return o<=h?"active":o<=O?"moving":o<=S?"done":"archive"}const i="openscout.meshOps.lastLookAt";function y(){if(typeof window>"u")return 0;try{const t=window.localStorage.getItem(i);return t?Number(t)||0:Date.now()}catch{return Date.now()}}function A(){if(!(typeof window>"u"))try{window.localStorage.setItem(i,String(Date.now()))}catch{}}function E(t,n){return u(t)>n}function v(t){if(t.labels.length>0)return t.labels[0];if(t.projectRoot){const n=t.projectRoot.split("/").filter(Boolean);return n[n.length-1]??t.projectRoot}return"unlabeled"}function u(t){return t.lastMeaningfulAt??t.updatedAt}const l="openscout.mesh-ops.lab.",r={lastLook:!0,routeStrip:!0,compact:!1,relays:!1,simulateHosts:!1};function m(){if(typeof window>"u")return r;const t=n=>{try{const o=window.localStorage.getItem(`${l}${n}`);return o===null?r[n]:o==="1"}catch{return r[n]}};return{lastLook:t("lastLook"),routeStrip:t("routeStrip"),compact:t("compact"),relays:t("relays"),simulateHosts:t("simulateHosts")}}function _(t,n){if(!(typeof window>"u"))try{window.localStorage.setItem(`${l}${t}`,n?"1":"0")}catch{}}let e={status:"idle",error:null,generatedAt:null,items:[],hosts:[],machineId:null,selectedItemId:null,groupBy:"family",attnFilter:null,unattributedOnly:!1,lab:m(),refreshToken:0};const a=new Set;function s(){for(const t of a)t()}function D(t){e={...e,status:"loading",error:null,machineId:t},s()}function R(t,n,o,c=[]){const f=e.selectedItemId!==null&&!n.some(d=>d.id===e.selectedItemId);e={...e,status:"ready",error:null,items:n,hosts:c,generatedAt:o,machineId:t,selectedItemId:f?null:e.selectedItemId},s()}function F(t,n){e={...e,status:"error",error:n,machineId:t},s()}function T(t){e.selectedItemId!==t&&(e={...e,selectedItemId:t},s())}function H(t){e.groupBy!==t&&(e={...e,groupBy:t},s())}function N(t){e.attnFilter!==t&&(e={...e,attnFilter:t},s())}function B(t){e.unattributedOnly!==t&&(e={...e,unattributedOnly:t},s())}function G(t){const n={...e.lab,[t]:!e.lab[t]};_(t,n[t]),e={...e,lab:n},s()}function P(){e={...e,refreshToken:e.refreshToken+1},s()}function g(t){return a.add(t),()=>{a.delete(t)}}function I(){return e}function W(){return p.useSyncExternalStore(g,I)}function k(){return e}export{b as M,T as a,A as b,u as c,M as d,N as e,v as f,H as g,G as h,E as i,P as j,D as k,R as l,k as m,F as n,y as r,B as s,L as t,W as u};
|