@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 +0,0 @@
|
|
|
1
|
-
import{r as i,j as e}from"./index-CzVeWScw.js";/* empty css */import{H as Me}from"./HarnessMark-BE-YSyci.js";import{a as ue,S as fe}from"./SpriteAvatar-BpQDpOkq.js";import{n as Ze}from"./colors-BtO5_zlx.js";import{o as He,l as Ke}from"./lane-observe-BA3g9aVd.js";import{t as We}from"./time-Dhsh_2EG.js";import{S as Be}from"./SessionObserve-BmmJ8dEh.js";import{l as X,i as Ge}from"./agent-lanes-model-CPgQRenB.js";import{p as Ve,s as je,a as Ne}from"./lane-roster-store-pR4ZaYQm.js";import"./agent-identity-BxCsXnDp.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-DrPXYZvQ.js";import"./index-Dewd56RX.js";import"./lane-ask-display-B6iCAVcd.js";import"./api-h5zurxmi.js";import"./mentions-fbQJ2mBI.js";import"./Provider-DSsb2gLR.js";import"./router-B-K15T7B.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-C3qU8tnY.js";import"./sse-QcU9bikk.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-N-Z6X0Z1.js";import"./DocumentFocusViewer-BCG2kOmd.js";import"./createLucideIcon-ClCdc3F9.js";import"./TextDocumentSurface-DRjctOIt.js";/* empty css */import"./file-text-DG-pufl1.js";import"./x-D4X_y1j_.js";import"./chevron-right-CNE6QAVr.js";import"./code-xml--LjSM4Mv.js";import"./arrow-left-_vS7itsV.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BJnFoFDP.js";import"./MessageComposerSuggestions-Cs9u-F_3.js";import"./NewChatComposer-DXDxV2Mh.js";import"./runtime-picker-BCQD7d4K.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Byb9kSFx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-CnjoswTG.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-DRCbnzyY.js";import"./search-C3bSJluv.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";import"./AgentDetailCard-sZuHl1de.js";import"./AgentLiveActions-DI4ooSHW.js";import"./terminal-takeover-KvmTwABa.js";import"./openContent-C6XO6kr5.js";import"./eye-BFlhMzQL.js";import"./terminal-DrTkVXIj.js";import"./message-markup-mGF07emJ.js";import"./ObservedTopologyPanel-C1AQM0Mq.js";import"./ObserveTextFlow-DJxQc2H6.js";import"./use-reduced-motion-Dla-G_Jz.js";import"./SessionObserveEvidence-CEedIk2a.js";import"./message-circle-aGOfQWm2.js";import"./wrench-CeCdjiPF.js";import"./external-link-CnaI1QFS.js";import"./context-budget-DX_fwUs3.js";const z=5*6e4,qe=6,Z=qe+1,be=8,Ue=30*6e4,ye=.65,Ae=1.45,ke=.1,ve=360,Se=260;function pe(t){return Math.round(Math.min(Ae,Math.max(ye,t))*100)/100}function se(t,o){return Math.round(Math.min(o,Math.max(-o,t)))}const I=164,ne=56,$e=14,Le=12,C=66,me=7,P=96,ce=12,D=88,M=150,Je=48,Qe=24,et=480,tt=38,Oe="openscout:agent-floor-orient",Ee="openscout:agent-floor-lane-order";function st(){try{const t=localStorage.getItem(Oe);if(t==="past-left"||t==="past-right")return t}catch{}return"past-left"}function nt(){try{const t=JSON.parse(sessionStorage.getItem(Ee)??"[]");return Array.isArray(t)?t.filter(o=>typeof o=="string"):[]}catch{return[]}}function ae(t){return new Date(t).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}const at=/^(edit|multi_?edit|write|apply_?patch|patch_apply|str_?replace|notebook_?edit|create_file)/i;function ot(t){return t.kind==="tool"?t.diff||t.tool&&at.test(t.tool.trim())?"edit":"tool":t.kind==="message"||t.kind==="ask"?"msg":null}function lt(t,o){const a=t.observe?.metadata?.session?.sessionStart,l={tool:0,edit:0,msg:0},c=Array.from({length:Z},()=>({blocks:[],counts:{tool:0,edit:0,msg:0},tools:new Map,total:0})),u=[];let b=0,g=null;for(const m of t.observe?.events??[]){const r=ot(m);if(!r)continue;const d=He(m,a),w=d===null||d>=o?0:Math.floor((o-d)/z)+1;if(w>=Z)continue;const _=c[w];_.blocks.push(r),_.counts[r]+=1,_.total+=1,l[r]+=1,b+=1;const x=r==="msg"?null:m.tool?.trim()||"tool";x&&_.tools.set(x,(_.tools.get(x)??0)+1),u.push({kind:r,label:r==="msg"?Ke(m.text,44,1):m.text.trim()||x||"tool",at:d}),g={at:d,label:r==="msg"?"message":m.tool?.trim()||"tool"}}return{lane:t,live:Ge(t.observe)&&b>0,slots:c.map(m=>({blocks:m.blocks.slice(-8),counts:m.counts,tools:[...m.tools.entries()].sort((r,d)=>d[1]-r[1]),total:m.total})),counts:l,strip:u.slice(-10).map(m=>m.kind),lastLabel:g?.label??null,lastAt:g?.at??(t.lastActiveAt||null)}}function oe(t){const o=(a,l,c)=>`${a} ${a===1?l:c}`;return[o(t.tool,"tool","tools"),o(t.edit,"edit","edits"),o(t.msg,"msg","msgs")].join(" · ")}function rt(t){return/^(working|active|running|in_turn|in_flight)/i.test(t.lane.agent.state??"")?"quiet":"idle"}function F(t){return t.tool+t.edit+t.msg}function we(t){if(F(t)===0)return"quiet";const a=[["tool-led",t.tool],["edit-heavy",t.edit],["conversation-led",t.msg]].sort((l,c)=>c[1]-l[1]);return a[0][1]===a[1][1]?"balanced":a[0][0]}function it(t){const o=new Map;for(const l of t.slots)for(const[c,u]of l.tools)o.set(c,(o.get(c)??0)+u);const[a]=[...o.entries()].sort((l,c)=>c[1]-l[1]);return a?{value:a[0],detail:`${a[1]} call${a[1]===1?"":"s"} · 30m`}:{value:"no tool pattern",detail:"messages and edits only"}}function ct(t){const o=t.slots[0]?.total??0,a=t.slots[1]?.total??0;return o===0&&a===0?{value:"quiet",detail:"no work in the last 10m"}:o===0?{value:"paused",detail:`${a} in the prior 5m`}:a===0?{value:"new burst",detail:`${o} in the current 5m`}:o>=a+3?{value:"building",detail:`${o} now · ${a} prior`}:a>=o+3?{value:"easing",detail:`${o} now · ${a} prior`}:{value:"steady",detail:`${o} now · ${a} prior`}}function L({label:t,value:o,detail:a,mix:l}){const c=l?Math.max(1,F(l)):1;return e.jsxs("span",{className:"agent-floor__dock-insight",children:[e.jsx("span",{className:"agent-floor__dock-insight-label",children:t}),e.jsx("span",{className:"agent-floor__dock-insight-value",children:o}),e.jsx("span",{className:"agent-floor__dock-insight-detail",children:a}),l?e.jsx("span",{className:"agent-floor__dock-mix",style:{"--mix-tool":`${l.tool/c*100}%`,"--mix-edit":`${(l.tool+l.edit)/c*100}%`},"aria-hidden":"true"}):null]})}function Ce(t,o){const a=t.lastAt?We(t.lastAt,o):null;return t.live?{glyph:"▸",label:t.lastLabel??"working",meta:a??"now"}:{glyph:"⏸",label:rt(t),meta:a?`· ${a}`:""}}function Fe({series:t,now:o}){const a=Ce(t,o);return t.live?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"agent-floor__card-run",children:a.glyph}),e.jsx("span",{className:"agent-floor__card-tool",children:a.label}),e.jsx("span",{className:"agent-floor__card-ago",children:a.meta})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"agent-floor__card-pause",children:a.glyph}),e.jsxs("span",{className:"agent-floor__card-idle",children:[a.label,a.meta?` ${a.meta}`:""]})]})}function de({kind:t,z:o,size:a=ne,faceH:l=Le,pad:c,live:u}){return e.jsxs("span",{className:`agent-floor__block is-${t}${c?" is-pedestal":""}${u?" is-live":""}`,style:{"--z":`${o}px`,"--bs":`${a}px`,"--bh":`${l}px`},"aria-hidden":"true",children:[e.jsx("span",{className:"agent-floor__face is-left"}),e.jsx("span",{className:"agent-floor__face is-right"}),e.jsx("span",{className:"agent-floor__face is-top"})]})}function dt({slot:t}){const o=Math.max(1,t.total),a=t.counts.tool/o*100,l=t.counts.edit/o*100;return e.jsxs("span",{className:"agent-floor__block agent-floor__slab",style:{"--z":"0px","--bs":`${C}px`,"--bh":`${me}px`,"--mix-a":`${a.toFixed(1)}%`,"--mix-b":`${(a+l).toFixed(1)}%`},"aria-hidden":"true",children:[e.jsx("span",{className:"agent-floor__face is-left"}),e.jsx("span",{className:"agent-floor__face is-right"}),e.jsx("span",{className:"agent-floor__face is-top"})]})}function pt({slot:t,slotIndex:o,periodStart:a}){const l=o===0?`${ae(a)} — now`:`${ae(a-o*z)} – ${ae(a-(o-1)*z)}`;return e.jsxs("span",{className:"agent-floor__peek",children:[e.jsx("span",{className:"agent-floor__peek-range",children:l}),e.jsxs("span",{className:"agent-floor__peek-cols",children:[e.jsxs("span",{className:"agent-floor__peek-col",children:[t.tools.slice(0,3).map(([c,u])=>e.jsxs("span",{className:"agent-floor__peek-tool",children:[c,u>1?` ×${u}`:""]},c)),t.tools.length===0?e.jsx("span",{className:"agent-floor__peek-tool is-empty",children:"no tools"}):null]}),e.jsxs("span",{className:"agent-floor__peek-col is-right",children:[e.jsxs("span",{children:[t.counts.edit," edit",t.counts.edit===1?"":"s"]}),e.jsxs("span",{children:[t.counts.msg," msg",t.counts.msg===1?"":"s"]})]})]})]})}function mt({series:t,index:o,planeW:a,flip:l,periodStart:c,now:u,focused:b,pinned:g,dimmed:m,peekSlot:r,onFocus:d,onPeek:w,onSelect:_}){const{lane:x,live:j,slots:S}=t,O=x.agent,$=X(O,x.source),R=ue(O),H=l?(M-P)/2:a-M+(M-P)/2,Y=(I-P)/2,K=(I-C)/2,le=k=>{const N=(D-C)/2;return l?M+k*D+N:a-M-(k+1)*D+N},W=ce+tt+o%2*14;return e.jsxs("button",{type:"button",className:`agent-floor__lane${j?" is-live":""}${o%2===1?" is-alt":""}${b?" is-focus":""}${g?" is-pinned":""}${m?" is-dim":""}`,style:{left:0,top:o*I,width:a,height:I},onClick:()=>_(x),onMouseEnter:()=>d(x.id),onMouseLeave:()=>{d(null),w(x.id,null)},"aria-label":g?`${$} — open timeline`:`${$} — pin details`,children:[e.jsx("span",{className:"agent-floor__lane-strip","aria-hidden":"true"}),S.map((k,N)=>{if(k.total===0)return null;const B=b&&r===N,T=me+2+k.blocks.length*$e;return e.jsxs("span",{className:`agent-floor__stack${N===0?" is-now":" is-minted"}${B?" is-peeking":""}`,style:{left:le(N),top:K},onMouseEnter:()=>w(x.id,N),children:[e.jsx(dt,{slot:k}),e.jsx("span",{className:"agent-floor__stack-blocks",style:{left:(C-ne)/2,top:(C-ne)/2},children:k.blocks.map((re,y)=>e.jsx(de,{kind:re,z:me+2+y*$e},y))}),B?e.jsx("span",{className:"agent-floor__bb agent-floor__peek-anchor",style:{left:C/2,top:C/2,"--z":`${T+46}px`},children:e.jsx(pt,{slot:k,slotIndex:N,periodStart:c})}):null]},N)}),e.jsxs("span",{className:"agent-floor__pad",style:{left:H,top:Y},"aria-hidden":"true",children:[e.jsx("span",{className:"agent-floor__ground"}),e.jsx(de,{kind:"pad",z:0,size:P,faceH:ce,pad:!0}),j?e.jsx(de,{kind:"head",z:ce+2,size:ne,faceH:Le,live:!0}):null]}),e.jsx("span",{className:"agent-floor__bb agent-floor__flag-anchor",style:{left:H+P/2,top:Y+P/2,"--z":`${W}px`},children:e.jsxs("span",{className:`agent-floor__flag${b?" is-focus":""}${g?" is-pinned":""}`,children:[e.jsx(fe,{name:O.name,size:15,tile:!0,hue:R.hue,tone:R.tone}),e.jsx("span",{className:"agent-floor__flag-name",children:$}),e.jsx("span",{className:"agent-floor__flag-action",children:e.jsx(Fe,{series:t,now:u})}),e.jsx("span",{className:`agent-floor__card-dot${j?" is-live":""}`})]})})]})}function ut({focus:t,pinned:o,ledger:a,liveCount:l,now:c}){if(!t){const d=a.reduce((j,S)=>(j.tool+=S.counts.tool,j.edit+=S.counts.edit,j.msg+=S.counts.msg,j),{tool:0,edit:0,msg:0}),w=a.filter(j=>F(j.counts)>0).length,_=[...a].sort((j,S)=>F(S.counts)-F(j.counts))[0]??null,x=_?F(_.counts):0;return e.jsxs("div",{className:"agent-floor__dock is-resting",children:[e.jsx("span",{className:"agent-floor__dock-id agent-floor__dock-fleet",children:e.jsxs("span",{className:"agent-floor__dock-id-copy",children:[e.jsx("span",{className:"agent-floor__dock-title",children:"fleet at a glance"}),e.jsxs("span",{children:[a.length," lane",a.length===1?"":"s"," · ",l," live"]})]})}),e.jsxs("span",{className:"agent-floor__dock-insights",children:[e.jsx(L,{label:"coverage",value:`${w}/${a.length} lanes`,detail:"showed work · 30m"}),e.jsx(L,{label:"hottest lane",value:_?X(_.lane.agent,_.lane.source):"none yet",detail:_?`${x} classified events`:"waiting for activity"}),e.jsx(L,{label:"throughput",value:`${F(d)} events`,detail:"classified · 30m"}),e.jsx(L,{label:"activity mix",value:we(d),detail:oe(d),mix:d})]})]})}const u=t.lane.agent,b=ue(u),g=ct(t),m=it(t),r=t.slots.filter(d=>d.total>0).length;return e.jsxs("div",{className:`agent-floor__dock${o?" is-pinned":""}`,children:[e.jsxs("span",{className:"agent-floor__dock-id",children:[e.jsx(fe,{name:u.name,size:30,tile:!0,hue:b.hue,tone:b.tone}),e.jsxs("span",{className:"agent-floor__dock-id-copy",children:[e.jsxs("span",{className:"agent-floor__dock-name",children:[X(u,t.lane.source),e.jsx(Me,{harness:u.harness,size:12,className:"agent-floor__card-mark"}),e.jsx("span",{className:`agent-floor__card-dot${t.live?" is-live":""}`}),o?e.jsx("span",{className:"agent-floor__dock-lock",children:"locked"}):null]}),e.jsx("span",{className:"agent-floor__dock-action",children:e.jsx(Fe,{series:t,now:c})})]})]}),e.jsxs("span",{className:"agent-floor__dock-insights",children:[e.jsx(L,{label:"momentum",value:g.value,detail:g.detail}),e.jsx(L,{label:"cadence",value:`${r}/${t.slots.length} windows`,detail:"active five-minute bands"}),e.jsx(L,{label:"signature",value:m.value,detail:m.detail}),e.jsx(L,{label:"activity mix",value:we(t.counts),detail:oe(t.counts),mix:t.counts})]})]})}function ft({series:t,now:o,concise:a,onConciseChange:l,onClose:c,onOpenFull:u,operatorName:b}){const{agent:g,observe:m,source:r}=t.lane,d=X(g,r);return e.jsxs("aside",{className:"agent-floor__trace-panel","aria-label":`${d} selected lane trace`,children:[e.jsx("button",{type:"button",className:"agent-floor__trace-close",onClick:c,"aria-label":"Close selected lane trace",children:"×"}),e.jsx("div",{className:"agent-floor__trace-body",children:m?e.jsx(Be,{data:m,agentId:r==="scout"?g.id:void 0,sessionId:g.harnessSessionId,showRail:!1,variant:"lane",nowMs:o,traceWindowMs:Ue,traceWindowLabel:"30m",laneCollapseTechnicalEvents:a,onLaneCollapseTechnicalEventsChange:l,laneOperatorName:b,onLaneEventSelect:u}):e.jsx("div",{className:"agent-floor__trace-empty",children:"Waiting for trace activity…"})})]})}function gt({zoom:t,fit:o,onZoomChange:a,onReset:l}){const c=Math.round(t*100);return e.jsxs("div",{className:"agent-floor__zoom",role:"group","aria-label":"Floor zoom",children:[e.jsx("button",{type:"button","aria-label":"Zoom out",disabled:t<=ye,onClick:()=>a(pe(t-ke)),children:"−"}),e.jsx("button",{type:"button",className:"agent-floor__zoom-reset","aria-label":"Reset floor zoom to fit",title:"Reset zoom and position to automatic fit",onClick:l,children:o?"fit":`${c}%`}),e.jsx("button",{type:"button","aria-label":"Zoom in",disabled:t>=Ae,onClick:()=>a(pe(t+ke)),children:"+"})]})}function Ls({lanes:t,now:o,onOpenTrace:a,railLedger:l=!1,operatorName:c}){const[u,b]=i.useState(st),[g,m]=i.useState(null),[r,d]=i.useState(null),[w,_]=i.useState(null),[x,j]=i.useState(!1),[S,O]=i.useState(1),[$,R]=i.useState({x:0,y:0}),[H,Y]=i.useState(!1),[K,le]=i.useState(nt),W=i.useRef(null),k=i.useRef(null),[N,B]=i.useState(null),T=u==="past-right";i.useEffect(()=>{const s=W.current;if(!s)return;const n=new ResizeObserver(p=>{const h=p[0]?.contentRect;h&&B(f=>f&&Math.abs(f.w-h.width)<2&&Math.abs(f.h-h.height)<2?f:{w:h.width,h:h.height})});return n.observe(s),()=>n.disconnect()},[]);const re=i.useCallback(()=>{b(s=>{const n=s==="past-left"?"past-right":"past-left";try{localStorage.setItem(Oe,n)}catch{}return n})},[]),y=i.useCallback(s=>{m(s),s===null&&_(null)},[]),Re=i.useCallback((s,n)=>{_(n===null?null:{laneId:s,slot:n})},[]),G=i.useCallback(s=>{r===s.id?a(s):d(s.id)},[r,a]),Te=i.useCallback(()=>{O(1),R({x:0,y:0})},[]),Pe=i.useCallback(s=>{if(!(s.target instanceof Element?s.target:null)?.closest(".agent-floor__trace-panel, .agent-floor__zoom")){if(s.preventDefault(),s.metaKey||s.ctrlKey){O(p=>pe(p-s.deltaY*.002));return}R(p=>({x:se(p.x-s.deltaX,ve),y:se(p.y-s.deltaY,Se)}))}},[]),Ie=i.useCallback(s=>{const n=s.target instanceof Element?s.target:null;s.button!==0||n?.closest("button, .agent-floor__trace-panel")||(k.current={pointerId:s.pointerId,startX:s.clientX,startY:s.clientY,panX:$.x,panY:$.y},s.currentTarget.setPointerCapture(s.pointerId),Y(!0))},[$]),ze=i.useCallback(s=>{const n=k.current;!n||n.pointerId!==s.pointerId||R({x:se(n.panX+s.clientX-n.startX,ve),y:se(n.panY+s.clientY-n.startY,Se)})},[]),ge=i.useCallback(s=>{k.current?.pointerId===s.pointerId&&(k.current=null,s.currentTarget.hasPointerCapture(s.pointerId)&&s.currentTarget.releasePointerCapture(s.pointerId),Y(!1))},[]);i.useEffect(()=>{if(r===null)return;const s=n=>{n.key==="Escape"&&d(null)};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[r]);const V=Math.floor(o/z)*z,q=i.useMemo(()=>{const s=new Map(t.map(f=>[f.id,f])),n=K.flatMap(f=>{const te=s.get(f);return te?[te]:[]}),p=new Set(n.map(f=>f.id)),h=t.filter(f=>!p.has(f.id)).sort((f,te)=>te.lastActiveAt-f.lastActiveAt);return n.concat(h)},[t,K]);i.useEffect(()=>{const s=q.map(n=>n.id);le(n=>n.length===s.length&&n.every((p,h)=>p===s[h])?n:s);try{sessionStorage.setItem(Ee,JSON.stringify(s))}catch{}},[q]);const{series:U,hidden:J,planeW:E,planeD:Q,lanesStartY:_e}=i.useMemo(()=>{const s=q.map(f=>lt(f,V)),n=s.slice(0,be),p=n.length*I,h=Math.max(et,p+Qe*2);return{series:n,hidden:s.slice(be),planeW:Je+Z*D+M,planeD:h,lanesStartY:(h-p)/2}},[q,V]),v=i.useMemo(()=>U.concat(J),[U,J]),ie=v.filter(s=>s.live).length,A=g??r,De=A===null?null:v.find(s=>s.lane.id===A)??null,ee=r===null?null:v.find(s=>s.lane.id===r)??null;i.useEffect(()=>{r!==null&&!v.some(s=>s.lane.id===r)&&d(null)},[v,r]),i.useEffect(()=>{j(!1)},[r]),i.useEffect(()=>{if(!l)return;const s=v.map(n=>{const p=Ce(n,o);return{id:n.lane.id,label:X(n.lane.agent,n.lane.source),statusLabel:n.lane.agent.harness?.trim()||"lane",tone:Ze(n.lane.agent.state,n.lane.agent),updatedAt:n.lane.lastActiveAt>0?n.lane.lastActiveAt:void 0,floor:{live:n.live,harness:n.lane.agent.harness,actionGlyph:p.glyph,actionLabel:p.label,actionMeta:p.meta,strip:n.strip,countsLabel:oe(n.counts)}}});Ve(s)},[l,v,o]),i.useEffect(()=>{if(l)return je({onHover:y,onSelect:s=>{const n=v.find(p=>p.lane.id===s);n&&G(n.lane)}}),()=>je(null)},[l,v,y,G]),i.useEffect(()=>{if(l)return Ne(A),()=>Ne(null)},[l,A]);const he=s=>T?M+s*D:E-M-s*D,xe=_e+U.length*I+26,Xe=i.useMemo(()=>{if(!N)return 1;const s=E+Q,n=.708*s+60,p=.386*s+250,h=Math.min(N.w/n,N.h/p);return Math.round(Math.min(1.6,Math.max(.7,h))*100)/100},[N,E,Q]),Ye=Math.round(Xe*S*100)/100;return e.jsxs("div",{className:`agent-floor${l?" is-rail-ledger":""}`,"data-live-count":ie,"data-floor-orient":u,children:[e.jsxs("div",{className:"agent-floor__body",children:[l?null:e.jsxs("aside",{className:"agent-floor__ledger","aria-label":"Fleet ledger",children:[e.jsxs("header",{className:"agent-floor__ledger-head",children:[e.jsx("span",{className:"agent-floor__ledger-title",children:"fleet"}),e.jsxs("span",{className:"agent-floor__ledger-meta",children:[v.length," lane",v.length===1?"":"s"," · ",ie," live"]}),e.jsx("span",{className:"agent-floor__ledger-trace",children:"trace 30m"})]}),e.jsx("div",{className:"agent-floor__ledger-rows",children:v.map(s=>{const n=s.lane.agent,p=ue(n);return e.jsxs("button",{type:"button",className:`agent-floor__ledger-row${A===s.lane.id?" is-focus":""}`,onClick:()=>G(s.lane),onMouseEnter:()=>y(s.lane.id),onMouseLeave:()=>y(null),children:[e.jsxs("span",{className:"agent-floor__ledger-id",children:[e.jsx(fe,{name:n.name,size:18,tile:!0,hue:p.hue,tone:p.tone}),e.jsx("span",{className:"agent-floor__ledger-name",children:X(n,s.lane.source)}),e.jsx(Me,{harness:n.harness,size:11,className:"agent-floor__card-mark"}),e.jsx("span",{className:`agent-floor__card-dot${s.live?" is-live":""}`})]}),e.jsxs("span",{className:"agent-floor__ledger-tally",children:[e.jsx("span",{className:"agent-floor__ledger-strip",children:s.strip.map((h,f)=>e.jsx("span",{className:`agent-floor__ledger-cell is-${h}`},f))}),e.jsx("span",{className:"agent-floor__ledger-counts",children:oe(s.counts)})]})]},s.lane.id)})}),e.jsx("footer",{className:"agent-floor__ledger-foot",children:"rows and flags are linked — hover to unroll, click to pin"})]}),e.jsxs("div",{className:`agent-floor__viewport${ee?" is-inspecting":""}${H?" is-dragging":""}`,ref:W,onWheel:Pe,onPointerDown:Ie,onPointerMove:ze,onPointerUp:ge,onPointerCancel:ge,children:[e.jsx(gt,{zoom:S,fit:S===1&&$.x===0&&$.y===0,onZoomChange:O,onReset:Te}),e.jsx("div",{className:"agent-floor__stage",style:{transform:`translate3d(${$.x}px, ${$.y}px, 0) scale(${Ye}) rotateX(57deg) rotateZ(45deg)`},children:e.jsxs("div",{className:"agent-floor__field",style:{width:E,height:Q,left:-E/2,top:-Q/2},children:[e.jsx("div",{className:"agent-floor__plane"}),Array.from({length:Z+1},(s,n)=>e.jsx("div",{className:`agent-floor__seam${n===0?" is-front":""}`,style:{left:he(n)}},n)),Array.from({length:Z+1},(s,n)=>e.jsx("div",{className:`agent-floor__bb agent-floor__tick${n===0?" is-now":""}`,style:{left:he(n),top:xe},children:n===0?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"agent-floor__tick-pulse"}),e.jsx("span",{children:"now"})]}):ae(V-(n-1)*z)},n)),e.jsx("div",{className:"agent-floor__lanes",style:{left:0,top:_e},"data-focus":A!==null||void 0,children:U.map((s,n)=>e.jsx(mt,{series:s,index:n,planeW:E,flip:T,periodStart:V,now:o,focused:A===s.lane.id,pinned:r===s.lane.id,dimmed:r===null&&g!==null&&g!==s.lane.id,peekSlot:w?.laneId===s.lane.id?w.slot:null,onFocus:y,onPeek:Re,onSelect:G},s.lane.id))}),J.length>0?e.jsxs("div",{className:"agent-floor__bb agent-floor__chip",style:{left:T?M/2:E-M/2,top:xe+30},children:["+",J.length," more in the ledger"]}):null]})}),ee?e.jsx(ft,{series:ee,now:o,concise:x,onConciseChange:j,onClose:()=>d(null),onOpenFull:()=>a(ee.lane),operatorName:c}):null]})]}),e.jsx(ut,{focus:De,pinned:r!==null&&A===r,ledger:v,liveCount:ie,now:o}),e.jsxs("footer",{className:"agent-floor__legend",children:[e.jsxs("span",{className:"agent-floor__legend-item",children:[e.jsx("span",{className:"agent-floor__legend-swatch is-tool"}),"tool call"]}),e.jsxs("span",{className:"agent-floor__legend-item",children:[e.jsx("span",{className:"agent-floor__legend-swatch is-edit"}),"file edit"]}),e.jsxs("span",{className:"agent-floor__legend-item",children:[e.jsx("span",{className:"agent-floor__legend-swatch is-msg"}),"message"]}),e.jsxs("span",{className:"agent-floor__legend-item",children:[e.jsx("span",{className:"agent-floor__legend-pulse"}),"live — pad glows"]}),e.jsxs("button",{type:"button",className:"agent-floor__legend-flip",onClick:re,title:"Flip which side history accumulates on",children:["past ",T?"→":"←"]}),e.jsx("span",{className:"agent-floor__legend-note",children:"Towers mint every 5 min · details land in the dock · click to pin, click again for the timeline"})]})]})}export{Ls as AgentFloorView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m,j as a}from"./index-CzVeWScw.js";/* empty css */import{c as q,d as K,s as V,b as G}from"./colors-BtO5_zlx.js";import{m as J,c as X}from"./conversation-model-CHwHZNw-.js";import{a as D}from"./api-h5zurxmi.js";import{u as Y}from"./sse-QcU9bikk.js";import{b as Z,t as ee}from"./time-Dhsh_2EG.js";import{f as h}from"./text-DsBWV_4k.js";import{u as ae}from"./Provider-DSsb2gLR.js";import{o as te}from"./openContent-C6XO6kr5.js";import{B as E}from"./BackToPicker-DZg_4nHL.js";import{A as se}from"./AgentLiveActions-DI4ooSHW.js";import{O as le}from"./ObservedTopologyPanel-C1AQM0Mq.js";import{a as re}from"./model-Co0zkMIc.js";import"./index-BWHgHrtv.js";import"./router-B-K15T7B.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-C3qU8tnY.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-N-Z6X0Z1.js";import"./DocumentFocusViewer-BCG2kOmd.js";import"./createLucideIcon-ClCdc3F9.js";import"./TextDocumentSurface-DRjctOIt.js";/* empty css */import"./file-text-DG-pufl1.js";import"./x-D4X_y1j_.js";import"./chevron-right-CNE6QAVr.js";import"./code-xml--LjSM4Mv.js";import"./arrow-left-_vS7itsV.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BJnFoFDP.js";import"./MessageComposerSuggestions-Cs9u-F_3.js";import"./NewChatComposer-DXDxV2Mh.js";import"./runtime-picker-BCQD7d4K.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Byb9kSFx.js";import"./index-Dewd56RX.js";import"./HarnessMark-BE-YSyci.js";import"./NewChatOrigin-CnjoswTG.js";import"./chevron-down-DRCbnzyY.js";import"./search-C3bSJluv.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";import"./terminal-takeover-KvmTwABa.js";import"./eye-BFlhMzQL.js";import"./terminal-DrTkVXIj.js";function k({values:t}){return a.jsx("span",{className:"s-agent-token-list",children:t.map(s=>a.jsx("span",{className:"s-agent-token",children:s},s))})}function r({value:t}){return a.jsx("span",{className:"s-agent-code-value",children:t})}function w({label:t,value:s}){return s?.trim()?a.jsxs("span",{className:"s-agent-profile-chip",children:[a.jsx("span",{className:"s-agent-profile-chip-label",children:t}),a.jsx("span",{className:"s-agent-profile-chip-value",children:s})]}):null}function $(t){return(t??"").toLowerCase().replace(/[^a-z0-9]+/g,"")}function oe(t){return t.trim().replace(/^@+/,"").replace(/^(project|agent|session)[-_.:\s]+/iu,"").split(/[-_\s·]+/u).filter(Boolean).map(s=>s.slice(0,1).toUpperCase()+s.slice(1)).join(" ")}function ie(t,s,i,c){let l=t.trim().replace(/^@+/,"");const f=[s,i,c,c?h(c):null].filter(d=>!!d?.trim());for(const d of f){const p=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");l=l.replace(new RegExp(`^${p}[-_.:\\s·]+`,"iu"),"")}return l}function ne(t,s,i,c){const l=s?.participants?.find(u=>u.agentId===t.id||u.actorId===t.id),f=$(t.harness),d=$(i),p=[l?.scopedAlias,s?.alias,t.handle,l?.displayName,s?.agentName,t.name];for(const u of p){if(!u?.trim())continue;const j=ie(u,i,c,t.harness),v=oe(j),n=$(v);if(!(!n||n===d||n===f))return v}return null}function ce(t){const s=t?.trim();return s?s.toLowerCase()==="a2a"?"A2A":h(s)??s:null}function ue({name:t,url:s}){return s?a.jsx("a",{href:s,target:"_blank",rel:"noreferrer",children:t}):a.jsx(a.Fragment,{children:t})}function x({title:t,subtitle:s,items:i,variant:c}){return i.length===0?null:a.jsxs("section",{className:`s-agent-profile-card${c?` s-agent-profile-card-${c}`:""}`,children:[a.jsx("div",{className:"s-agent-profile-card-header",children:a.jsxs("div",{children:[a.jsx("div",{className:"s-agent-profile-card-title",children:t}),s&&a.jsx("div",{className:"s-agent-profile-card-subtitle",children:s})]})}),a.jsx("div",{className:"s-agent-meta-card-body",children:i.map(l=>a.jsxs("div",{className:"s-agent-meta-row",children:[a.jsx("span",{className:"s-agent-meta-label",children:l.label}),a.jsx("span",{className:"s-agent-meta-value",children:l.value})]},l.label))})]})}function la({conversationId:t,navigate:s}){const{agents:i,route:c}=ae(),[l,f]=m.useState(null),[d,p]=m.useState(null),[u,j]=m.useState(null),v=m.useCallback(async()=>{j(null);try{const o=await D(`/api/session/${encodeURIComponent(t)}`).catch(()=>null);f(o)}catch(o){j(o instanceof Error?o.message:String(o)),f(null)}},[t]);m.useEffect(()=>{v()},[v]),Y(()=>{v()});const n=l?.agentId??null;m.useEffect(()=>{if(!n||i.some(P=>P.id===n)){p(null);return}let o=!1;return D(`/api/agents/${encodeURIComponent(n)}`).then(P=>{o||p(P)}).catch(()=>{o||p(null)}),()=>{o=!0}},[i,n]);const e=m.useMemo(()=>n?i.find(o=>o.id===n)??(d?.id===n?d:null):null,[d,i,n]);if(!e)return a.jsxs("div",{children:[a.jsx(E,{slot:"agent-info",fallback:{view:"conversation",conversationId:t},navigate:s}),u&&a.jsx("p",{className:"s-error",children:u}),a.jsx("div",{className:"s-empty",children:a.jsx("p",{children:"Agent not found"})})]});const H=J(e),A=e.handle?`@${e.handle.replace(/^@+/,"")}`:null,I=e.selector??e.defaultSelector??A,S=q(e.state),L=e.authorityNodeName?`${e.authorityNodeName} (${e.authorityNodeId??"unknown"})`:e.authorityNodeId,R=e.homeNodeName?`${e.homeNodeName} (${e.homeNodeId??"unknown"})`:e.homeNodeId,C=e.skills??[],b=ce(e.protocol),N=!!(e.providerName||b||C.length>0),T=re(e),g=T.title,y=ne(e,l,g,T.slug),F=y?`${g} · ${y}`:g,B=l?.participants?.find(o=>o.agentId===e.id||o.actorId===e.id),M=e.model&&e.harness&&e.model.startsWith(`${e.harness}-`)?e.model.slice(e.harness.length+1):e.model,U=[h(e.harness??"")??e.harness,M].filter(o=>!!o).join(" · "),W=[{label:"Project",value:g},{label:"Alias",value:y??"Default project participant"},...I?[{label:"Primary selector",value:a.jsx(r,{value:I})}]:[],...B?.scopedAlias?[{label:"Scoped alias",value:a.jsx(r,{value:B.scopedAlias})}]:[],...A?[{label:"Handle",value:a.jsx(r,{value:A})}]:[],...e.defaultSelector&&e.defaultSelector!==e.selector?[{label:"Default selector",value:a.jsx(r,{value:e.defaultSelector})}]:[],{label:"Definition",value:a.jsx(r,{value:e.definitionId})}],z=[{label:"Routable agent ID",value:a.jsx(r,{value:e.id})},...e.providerName?[{label:"Provider",value:a.jsx(ue,{name:e.providerName,url:e.providerUrl})}]:[],...b?[{label:"Protocol",value:b}]:[],...C.length>0?[{label:"Skills",value:a.jsx(k,{values:C})}]:[],...N?[]:[{label:"Class",value:h(e.agentClass)??"—"}],...!N&&e.role?[{label:"Role",value:h(e.role)??e.role}]:[],...e.authorityProfile?[{label:"Authority profile",value:a.jsx(r,{value:e.authorityProfile.roleId})}]:[],...e.workspaceQualifier?[{label:"Workspace qualifier",value:a.jsx(r,{value:e.workspaceQualifier})}]:[],...e.nodeQualifier?[{label:"Node qualifier",value:a.jsx(r,{value:e.nodeQualifier})}]:[],...e.staleLocalRegistration?[{label:"Registration",value:e.replacedByAgentId?`Superseded by ${e.replacedByAgentId}`:"Historical registration"}]:[],...e.retiredFromFleet?[{label:"Fleet state",value:"Retired"}]:[]],O=[...e.projectRoot?[{label:"Project path",value:a.jsx(r,{value:e.projectRoot})}]:[],...e.cwd?[{label:"Working dir",value:a.jsx(r,{value:e.cwd})}]:[],...e.branch?[{label:"Branch",value:e.branch}]:[],...L?[{label:"Authority node",value:a.jsx(r,{value:L})}]:[],...R?[{label:"Home node",value:a.jsx(r,{value:R})}]:[],...e.ownerId?[{label:"Owner",value:e.ownerName?`${e.ownerName} (${e.ownerId})`:e.ownerId}]:[],...e.conversationId?[{label:"Direct conversation",value:a.jsx(r,{value:e.conversationId})}]:[]],Q=[...!N&&e.harness?[{label:"Harness",value:e.harness}]:[],...e.model?[{label:"Model",value:e.model}]:[],...!N&&e.transport?[{label:"Transport",value:h(e.transport)??e.transport}]:[],...e.wakePolicy?[{label:"Wake policy",value:h(e.wakePolicy)??e.wakePolicy}]:[],...e.harnessSessionId?[{label:b?`${b} session`:"Harness session",value:a.jsx(r,{value:e.harnessSessionId})}]:[],...e.harnessLogPath?[{label:"Harness log",value:a.jsx(r,{value:e.harnessLogPath})}]:[],...e.capabilities.length>0?[{label:"Capabilities",value:a.jsx(k,{values:e.capabilities})}]:[],...e.authorityProfile?.readTools.length?[{label:"Broker reads",value:a.jsx(k,{values:e.authorityProfile.readTools})}]:[],...e.authorityProfile?.writeTools.length?[{label:"Broker writes",value:a.jsx(k,{values:e.authorityProfile.writeTools})}]:[],...e.authorityProfile?[{label:"Machine access",value:`shell ${e.authorityProfile.shell?"allowed":"blocked"} · code writes ${e.authorityProfile.codebaseWrites?"allowed":"blocked"}`}]:[],...e.runtimePolicy?.sandbox?[{label:"Sandbox",value:e.runtimePolicy.sandbox}]:[]],_=[{label:"Conversation ID",value:a.jsx(r,{value:t})},...l?.alias?[{label:"Conversation alias",value:a.jsx(r,{value:l.alias})}]:[],...l?.naturalKey?[{label:"Natural key",value:a.jsx(r,{value:l.naturalKey})}]:[],...l?.workspaceRoot?[{label:"Workspace",value:a.jsx(r,{value:l.workspaceRoot})}]:[],...l?.currentBranch?[{label:"Session branch",value:l.currentBranch}]:[],...l?.messageCount!=null?[{label:"Messages",value:String(l.messageCount)}]:[],...l?.lastMessageAt?[{label:"Last message",value:Z(l.lastMessageAt)}]:[]];return a.jsxs("div",{className:"s-agent-profile-page",children:[a.jsxs("div",{className:"s-agent-profile-page-topbar",children:[a.jsx(E,{slot:"agent-info",fallback:{view:"conversation",conversationId:t},navigate:s}),a.jsx("button",{type:"button",className:"s-btn",onClick:()=>s({view:"agents-v2",agentId:e.id}),children:"Open in Agents"})]}),u&&a.jsx("p",{className:"s-error",children:u}),a.jsxs("section",{className:"s-agent-profile-hero",children:[a.jsx("div",{className:"s-agent-profile-hero-main",children:a.jsxs("div",{className:"s-agent-profile-hero-title-row",children:[a.jsx("div",{className:"s-avatar s-agent-profile-hero-avatar",style:{background:K(e.name)},children:e.name[0].toUpperCase()}),a.jsxs("div",{className:"s-agent-profile-hero-copy",children:[a.jsxs("div",{className:"s-agent-casefile-title-meta",children:[a.jsx("span",{className:"s-agent-casefile-record",children:I??H??X(e.id)??e.id}),S&&a.jsxs("span",{className:`s-agent-state-chip s-agent-state-chip-${G(e.state)}`,children:[a.jsx("span",{className:"s-dot",style:{background:V(e.state)}}),S]}),e.staleLocalRegistration&&a.jsx("span",{className:"s-agent-state-chip s-agent-state-chip-offline",children:"Superseded registration"})]}),a.jsx("h1",{className:"s-agent-profile-hero-title",children:F}),a.jsxs("div",{className:"s-agent-profile-hero-tags",children:[a.jsx(w,{label:"Project",value:g}),a.jsx(w,{label:"Alias",value:y??"Default"}),a.jsx(w,{label:"Runtime",value:U||null}),a.jsx(w,{label:"Host",value:e.homeNodeName?.replace(/\.local$/i,"")??null})]}),a.jsxs("p",{className:"s-agent-profile-hero-context",children:[l?.title?`Conversation: ${l.title}.`:"Attached to this conversation.",e.updatedAt?` Updated ${ee(e.updatedAt)}.`:""]})]})]})}),a.jsxs("div",{className:"s-agent-profile-hero-actions",children:[a.jsx(se,{agent:e,navigate:s,returnTo:c}),a.jsx("button",{type:"button",className:"s-btn s-btn-primary",onClick:()=>te(s,{view:"conversation",conversationId:t},{returnTo:c}),children:"Open conversation"})]})]}),a.jsxs("div",{className:"s-agent-profile-grid",children:[a.jsx(x,{title:"Stable alias",subtitle:"Repeatable project identity used to route future work.",items:W,variant:"primary"}),a.jsx(x,{title:"Current conversation",subtitle:"Unique DM/context attached to this page.",items:_}),a.jsx(x,{title:"Runtime instance",subtitle:"Concrete harness state for the current attachment.",items:Q}),a.jsx(x,{title:"Location",subtitle:"Where this alias resolves right now.",items:O}),a.jsx(x,{title:"Diagnostics",subtitle:"Broker and provider fields for debugging.",items:z,variant:"secondary"})]}),a.jsx(le,{title:"Observed harness families",size:"compact",maxAgents:8,maxTasks:4,showEmpty:!0})]})}export{la as AgentInfoScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,j as m}from"./index-CzVeWScw.js";import{u as a}from"./Provider-DSsb2gLR.js";import{A as n}from"./AgentLanesView-DqRK5-d2.js";import{i as c,j as l}from"./router-B-K15T7B.js";import"./api-h5zurxmi.js";import"./sse-QcU9bikk.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-N-Z6X0Z1.js";import"./DocumentFocusViewer-BCG2kOmd.js";import"./createLucideIcon-ClCdc3F9.js";import"./TextDocumentSurface-DRjctOIt.js";/* empty css */import"./file-text-DG-pufl1.js";import"./x-D4X_y1j_.js";import"./chevron-right-CNE6QAVr.js";import"./code-xml--LjSM4Mv.js";import"./arrow-left-_vS7itsV.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BJnFoFDP.js";import"./MessageComposerSuggestions-Cs9u-F_3.js";import"./NewChatComposer-DXDxV2Mh.js";import"./runtime-picker-BCQD7d4K.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Byb9kSFx.js";import"./index-Dewd56RX.js";import"./HarnessMark-BE-YSyci.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-CnjoswTG.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-DRCbnzyY.js";import"./search-C3bSJluv.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";/* empty css */import"./tail-events-C6K7bCWB.js";import"./observe-BNFzh-7B.js";import"./terminal-sessions-C3qU8tnY.js";import"./types-B0PlfpKc.js";import"./AgentAvatar-CszU5eaU.js";import"./SpriteAvatar-BpQDpOkq.js";import"./agent-identity-BxCsXnDp.js";import"./SessionObserve-BmmJ8dEh.js";import"./bash-format-BRV5C6Gv.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-DrPXYZvQ.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-fbQJ2mBI.js";import"./AgentDetailCard-sZuHl1de.js";import"./AgentLiveActions-DI4ooSHW.js";import"./terminal-takeover-KvmTwABa.js";import"./openContent-C6XO6kr5.js";import"./eye-BFlhMzQL.js";import"./terminal-DrTkVXIj.js";import"./message-markup-mGF07emJ.js";import"./ObservedTopologyPanel-C1AQM0Mq.js";import"./ObserveTextFlow-DJxQc2H6.js";import"./use-reduced-motion-Dla-G_Jz.js";import"./SessionObserveEvidence-CEedIk2a.js";import"./message-circle-aGOfQWm2.js";import"./wrench-CeCdjiPF.js";import"./external-link-CnaI1QFS.js";import"./AgentFloorView-DMivAYHU.js";/* empty css */import"./agent-lanes-model-CPgQRenB.js";import"./context-budget-DX_fwUs3.js";import"./lane-roster-store-pR4ZaYQm.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./AgentLanesPreflight-DNGvZvjd.js";import"./AgentLaneChrome-O9Yf0uR-.js";import"./AgentLaneCard-nB68f2CI.js";/* empty css */import"./AgentLaneSummaryResize-Ct3b0TQR.js";import"./clipboard-e3fSpeo7.js";import"./agent-lane-card-model-DSWdGu-v.js";import"./agent-lane-preview-C33Dwpn7.js";import"./AgentLaneDetailSheet-BfhpaEQ3.js";import"./SlidePanel-B3gc5HnM.js";import"./agent-lane-detail-BNNm6FNu.js";import"./LaneTraceDetailSheet-Dl7foF88.js";import"./LaneTraceEventFocus-X4-DDFEo.js";function p(r){return new URLSearchParams(window.location.search).get(r)?.trim()||null}function Kr(){const{agents:r,navigate:o}=a(),e=t.useMemo(()=>c(),[]),s=t.useMemo(()=>l(),[]),i=t.useMemo(()=>({harnessFilter:p("harness"),projectFilter:p("project")}),[]);return m.jsx("div",{className:"s-agent-lanes-embed","data-scout-theme":!0,children:m.jsx(n,{navigate:o,agents:r,embedded:!0,profileId:e,laneSize:s,harnessFilter:i.harnessFilter,projectFilter:i.projectFilter})})}export{Kr as AgentLanesEmbedScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as d}from"./index-CzVeWScw.js";import{p as v,a as b}from"./api-h5zurxmi.js";import{u as Q,e as Z}from"./Provider-DSsb2gLR.js";import{P as ee,b as te}from"./router-B-K15T7B.js";import{u as se}from"./sse-QcU9bikk.js";import{o as oe,i as D}from"./surface-activity-B1rgWB1i.js";/* empty css */import{AgentsSubnav as ne}from"./AgentsSubnav-q0xcZi6C.js";import{AgentsLibrary as ie}from"./library-DbCVJG_O.js";import{r as re,d as ae}from"./model-Co0zkMIc.js";import{AgentDetailWithRail as de,AgentProfileBar as le}from"./profile-s3KRbip1.js";/* empty css *//* empty css *//* empty css */import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-N-Z6X0Z1.js";import"./DocumentFocusViewer-BCG2kOmd.js";import"./createLucideIcon-ClCdc3F9.js";import"./TextDocumentSurface-DRjctOIt.js";/* empty css */import"./file-text-DG-pufl1.js";import"./x-D4X_y1j_.js";import"./chevron-right-CNE6QAVr.js";import"./code-xml--LjSM4Mv.js";import"./arrow-left-_vS7itsV.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BJnFoFDP.js";import"./MessageComposerSuggestions-Cs9u-F_3.js";import"./NewChatComposer-DXDxV2Mh.js";import"./runtime-picker-BCQD7d4K.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Byb9kSFx.js";import"./index-Dewd56RX.js";import"./HarnessMark-BE-YSyci.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-CnjoswTG.js";import"./chevron-down-DRCbnzyY.js";import"./search-C3bSJluv.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-C3qU8tnY.js";import"./index-BWHgHrtv.js";import"./SecondaryNav-Hv5AJ3Fv.js";import"./secondaryNavConfig-Bg4Tc0gT.js";import"./message-square-CIXda-Y7.js";import"./terminal-DrTkVXIj.js";import"./scroll-text-BV-BB7v-.js";/* empty css */import"./SpriteAvatar-BpQDpOkq.js";import"./agent-identity-BxCsXnDp.js";import"./AgentSessions-BxWIPkWh.js";import"./openContent-C6XO6kr5.js";import"./clipboard-e3fSpeo7.js";import"./text-DsBWV_4k.js";import"./agents-project-model-UYiamtrU.js";import"./AgentAvatar-CszU5eaU.js";import"./context-budget-DX_fwUs3.js";import"./session-catalog-9FqXmjBw.js";import"./terminal-relay-BkXjjSkq.js";import"./BackToPicker-DZg_4nHL.js";import"./ConversationScreen-C-PrCRz1.js";import"./ConversationComposer-CiEF7dhd.js";import"./message-markup-mGF07emJ.js";import"./mentions-fbQJ2mBI.js";import"./AgentDetailCard-sZuHl1de.js";import"./AgentLiveActions-DI4ooSHW.js";import"./terminal-takeover-KvmTwABa.js";import"./eye-BFlhMzQL.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./types-B0PlfpKc.js";import"./ConversationHeader-BGgbITvr.js";import"./ConversationFeedRows-5it6QNBV.js";import"./ConversationPanels-vI9YuQJh.js";import"./use-reduced-motion-Dla-G_Jz.js";import"./activity-BxwKkT8z.js";import"./message-circle-aGOfQWm2.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./tail-events-C6K7bCWB.js";import"./ConversationStatus-COEj5loj.js";import"./SessionObserve-BmmJ8dEh.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-DrPXYZvQ.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-C1AQM0Mq.js";import"./ObserveTextFlow-DJxQc2H6.js";import"./SessionObserveEvidence-CEedIk2a.js";import"./wrench-CeCdjiPF.js";import"./external-link-CnaI1QFS.js";import"./AgentDefinitionsWorkspace-4Z0aN8AR.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-CXCq-oKj.js";/* empty css */import"./agent-essentials-SrzMYEXV.js";const K=new Set(["0","false","off","no","clear","none"]),ce=new Set(["1","true","on","yes"]),ue=new Set(["localhost","127.0.0.1","::1"]);function me(t){return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t}function L(t){const o=t?.trim().toLowerCase();return o==="before"||o==="after"?o:null}function z(t){if(!t)return null;const o=t.trim().toLowerCase();return ce.has(o)?!0:K.has(o)?!1:null}function M(t,o,i=[]){const r=z(t);if(r!==null)return r;if(!t)return null;const l=o.toLowerCase(),a=new Set([l,l.replace(/-/g,""),...i.map(n=>n.trim().toLowerCase()).filter(Boolean)]),s=t.split(",").map(n=>n.trim().toLowerCase()).filter(Boolean);return s.some(n=>K.has(n))?!1:s.some(n=>a.has(n))?!0:null}function pe({studyId:t,aliases:o,href:i,storedEnabled:r,storedMode:l,dev:a,defaultMode:s="after"}){const n=i?new URL(i,"http://localhost"):null,p=M(n?.searchParams.get("studio"),t,o)??M(n?.searchParams.get(`studio.${t}`),t,o)??M(n?.searchParams.get("studioInjection"),t,o),c=n?ue.has(me(n.hostname)):!1;if(!a&&!c)return{enabled:!1,mode:s};const m=p??z(r)??!1,g=L(n?.searchParams.get("studioMode"))??L(n?.searchParams.get(`studioMode.${t}`))??L(l)??s;return{enabled:m,mode:g}}const he="openscout.studio.inject.",fe="openscout.studio.mode.";function O(t){return`${he}${t}`}function T(t){return`${fe}${t}`}function $(t){if(typeof window>"u")return null;try{return window.localStorage.getItem(t)}catch{return null}}function I(t,o){if(!(typeof window>"u"))try{window.localStorage.setItem(t,o)}catch{}}function ge(){return import.meta.env?.DEV===!0}function je(t){return t==="before"?"after":"before"}function xe(t){typeof window>"u"||ee({searchPatch:{studio:null,[`studio.${t}`]:null,studioInjection:null,studioMode:null,[`studioMode.${t}`]:null},replace:!0})}function ve(t,o=[]){const[i,r]=d.useState(()=>pe({studyId:t,aliases:o,href:typeof window>"u"?void 0:window.location.href,storedEnabled:$(O(t)),storedMode:$(T(t)),dev:ge()})),[l,a]=d.useState(!1);d.useEffect(()=>{if(!i.enabled){a(!1);return}const c=j=>{j.altKey&&a(!0)},m=j=>{j.altKey||a(!1)},g=()=>a(!1);return window.addEventListener("keydown",c),window.addEventListener("keyup",m),window.addEventListener("blur",g),()=>{window.removeEventListener("keydown",c),window.removeEventListener("keyup",m),window.removeEventListener("blur",g)}},[i.enabled]);const s=d.useCallback(c=>{I(O(t),c?"1":"0"),r(m=>({...m,enabled:c}))},[t]),n=d.useCallback(c=>{I(T(t),c),r(m=>({...m,mode:c}))},[t]),p=l?je(i.mode):i.mode;return d.useMemo(()=>({...i,renderedMode:p,peeking:p!==i.mode,setEnabled:s,setMode:n}),[p,s,n,i])}function Se({studyId:t,aliases:o,anchor:i,title:r,children:l,renderStudy:a}){const s=ve(t,o);return s.enabled?e.jsxs("div",{className:"s-studio-injection","data-studio-anchor":i,children:[e.jsxs("div",{className:"s-studio-injection-bar",children:[e.jsxs("div",{className:"s-studio-injection-label",children:[e.jsx("span",{className:"s-studio-injection-kicker",children:"Studio injection"}),e.jsx("span",{className:"s-studio-injection-title",children:r}),e.jsx("span",{className:"s-studio-injection-anchor",children:i})]}),e.jsxs("div",{className:"s-studio-injection-controls",role:"group","aria-label":`${r} mode`,children:[e.jsx("button",{type:"button",className:"s-studio-injection-mode","data-active":s.mode==="before","aria-pressed":s.mode==="before",onClick:()=>s.setMode("before"),children:"Before"}),e.jsx("button",{type:"button",className:"s-studio-injection-mode","data-active":s.mode==="after","aria-pressed":s.mode==="after",onClick:()=>s.setMode("after"),children:"After"})]}),e.jsx("span",{className:"s-studio-injection-state",children:s.peeking?`Option: ${s.renderedMode}`:s.renderedMode}),e.jsx("button",{type:"button",className:"s-studio-injection-close",onClick:()=>{xe(t),s.setEnabled(!1)},children:"Close"})]}),e.jsx("div",{className:"s-studio-injection-body","data-studio-mode":s.renderedMode,children:s.renderedMode==="before"?l:a()})]}):e.jsx(e.Fragment,{children:l})}const N=[{id:"openscout",title:"openscout",root:"~/dev/openscout",signal:"Studio mode injection for agent directory",sessions:9,agents:[{id:"hudson",name:"Hudson",handle:"@hudson",state:"working",role:"web design system",branch:"feat/studio-mode",task:"Refactoring the agent directory into insertion points",last:"18s"},{id:"scout",name:"Scout",handle:"@scout",state:"attention",role:"operator assistant",branch:"main",task:"Needs placement decision",last:"1m"},{id:"quill",name:"Quill",handle:"@quill",state:"ready",role:"docs",branch:"docs/agent-view",task:"Ready to write the study summary",last:"7m"}]},{id:"hudson",title:"hudson",root:"~/dev/hudson",signal:"Slot contracts and chrome primitives",sessions:4,agents:[{id:"atlas",name:"Atlas",handle:"@atlas",state:"working",role:"framework",branch:"slots/studio-anchor",task:"Mapping chrome slots to page anchors",last:"3m"},{id:"mira",name:"Mira",handle:"@mira",state:"ready",role:"qa",branch:"main",task:"Idle",last:"12m"}]},{id:"lattices",title:"lattices",root:"~/dev/lattices",signal:"macOS web view parity pass",sessions:2,agents:[{id:"north",name:"North",handle:"@north",state:"offline",role:"native",branch:"main",task:"No active session",last:"1h"}]}],we={working:"working",ready:"ready",attention:"attention",offline:"offline"};function ye({children:t}){return e.jsx(Se,{studyId:"agent-directory",aliases:["agents","agent","agent-directory-before-after"],anchor:"agents.directory",title:"Agent Directory",renderStudy:()=>e.jsx(be,{}),children:t})}function be(){const t=N.flatMap(s=>s.agents),o=t.filter(s=>s.state==="working"),i=t.filter(s=>s.state==="ready"),r=t.filter(s=>s.state==="attention"),l=N.reduce((s,n)=>s+n.sessions,0),a=o[0]??t[0];return e.jsxs("section",{className:"s-agent-studio-study","aria-label":"Agent directory injected study",children:[e.jsxs("div",{className:"s-agent-studio-banner",children:[e.jsx("span",{children:"After study"}),e.jsx("strong",{children:"Injected static view inside the live Agents route"}),e.jsx("em",{children:"Fixture data · insertion-point prototype · no backend writes"})]}),e.jsxs("header",{className:"s-agent-studio-head","data-studio-anchor":"agent.directory.header",children:[e.jsxs("div",{className:"s-agent-studio-title-block",children:[e.jsx("span",{className:"s-agent-studio-kicker",children:"Studio / agents.directory / after"}),e.jsx("h1",{className:"s-agent-studio-title",children:"Project command center"}),e.jsxs("span",{className:"s-agent-studio-subtitle",children:[t.length," agents across ",N.length," projects"]})]}),e.jsxs("div",{className:"s-agent-studio-metrics","aria-label":"Agent study summary",children:[e.jsx(A,{label:"working",value:o.length,tone:"working"}),e.jsx(A,{label:"ready",value:i.length}),e.jsx(A,{label:"attention",value:r.length,tone:"attention"}),e.jsx(A,{label:"sessions",value:l})]})]}),e.jsxs("div",{className:"s-agent-studio-layout",children:[e.jsxs("div",{className:"s-agent-studio-main",children:[e.jsxs("section",{className:"s-agent-studio-pressure","data-studio-anchor":"agent.active-strip",children:[e.jsxs("div",{className:"s-agent-studio-section-head",children:[e.jsx("span",{children:"Pressure queue"}),e.jsx("strong",{children:o.length+r.length})]}),e.jsx("div",{className:"s-agent-studio-pressure-list",children:[...o,...r].map(s=>e.jsxs("article",{className:`s-agent-studio-pressure-card s-agent-studio-pressure-card--${s.state}`,children:[e.jsx("span",{className:"s-agent-studio-dot","data-state":s.state}),e.jsxs("div",{className:"s-agent-studio-pressure-copy",children:[e.jsx("strong",{children:s.name}),e.jsx("span",{children:s.task})]}),e.jsx("time",{children:s.last})]},s.id))})]}),e.jsx("section",{className:"s-agent-studio-projects","data-studio-anchor":"agent.project-board",children:N.map(s=>e.jsxs("article",{className:"s-agent-studio-project",children:[e.jsxs("div",{className:"s-agent-studio-project-main",children:[e.jsxs("div",{children:[e.jsx("span",{className:"s-agent-studio-project-root",children:s.root}),e.jsx("h2",{children:s.title})]}),e.jsxs("span",{className:"s-agent-studio-project-sessions",children:[s.sessions," sessions"]})]}),e.jsx("p",{children:s.signal}),e.jsx("div",{className:"s-agent-studio-agent-row",children:s.agents.map(n=>e.jsxs("span",{className:`s-agent-studio-agent-pill s-agent-studio-agent-pill--${n.state}`,children:[e.jsx("span",{className:"s-agent-studio-dot","data-state":n.state}),n.name]},n.id))})]},s.id))})]}),e.jsxs("aside",{className:"s-agent-studio-detail","data-studio-anchor":"agent.detail-preview",children:[e.jsx("span",{className:"s-agent-studio-kicker",children:"Pinned agent"}),e.jsx("h2",{children:a.name}),e.jsx("span",{className:`s-agent-studio-state s-agent-studio-state--${a.state}`,children:we[a.state]}),e.jsxs("dl",{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Handle"}),e.jsx("dd",{children:a.handle})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Role"}),e.jsx("dd",{children:a.role})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Branch"}),e.jsx("dd",{children:a.branch})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Current task"}),e.jsx("dd",{children:a.task})]})]})]})]})]})}function A({label:t,value:o,tone:i}){return e.jsxs("div",{className:`s-agent-studio-metric${i?` s-agent-studio-metric--${i}`:""}`,children:[e.jsx("strong",{children:o}),e.jsx("span",{children:t})]})}const P="/api/conversations",H="/api/fleet",F="/api/tail/discover",U="/api/topology/snapshot?force=1",S=3e4;function gs({navigate:t,selectedAgentId:o,conversationId:i,tab:r,activeRoute:l}){const{agents:a,agentsLoaded:s,route:n}=Q(),[p,c]=d.useState(()=>v(P,S)??[]),[m,g]=d.useState(()=>v(H,S)),[j,G]=d.useState(()=>v(F,S)),[q,W]=d.useState(()=>v(U,S)),[X,Y]=d.useState(()=>v(P,S)===null),R=te(n),k=d.useMemo(()=>Z(a,R),[a,R]),x=d.useCallback(async()=>{const[h,f,y,C]=await Promise.allSettled([b(P),b(H),b(F),b(U)]);h.status==="fulfilled"&&c(h.value),f.status==="fulfilled"&&g(f.value),y.status==="fulfilled"&&G(y.value),C.status==="fulfilled"&&W(C.value),Y(!1)},[]);d.useEffect(()=>{x()},[x]),d.useEffect(()=>{const h=()=>{D()&&x()},f=window.setInterval(h,1e4),y=oe(h);return()=>{window.clearInterval(f),y()}},[x]),se(()=>{D()&&x()});const u=re(k,o),_=!!(o&&u&&u.id!==o),w=n.view==="agents-v2"?n.projectSlug:void 0,E=!!(w&&!r),{conversationByAgentId:B,sessionByAgentId:J}=ae(p);if(d.useEffect(()=>{!o||!u||!_||t({view:"agents-v2",agentId:u.id,...E&&w?{projectSlug:w}:{},...i?{conversationId:i}:{},...r?{tab:r}:{}})},[i,r,E,t,w,u,o,_]),u&&!E){const h=i??B.get(u.id)??u.conversationId??null,f=r??(i?"message":"profile");return e.jsx(V,{activeRoute:l??n,navigate:t,bar:e.jsx(le,{agent:u,conversationId:h,activeTab:f,navigate:t}),children:e.jsx(de,{agent:u,allAgents:k,conversationId:h,navigate:t,activeTab:f})})}return e.jsx(V,{activeRoute:l??n,navigate:t,children:e.jsx(ye,{children:e.jsx(ie,{agents:k,fleet:m,sessionByAgentId:J,conversationByAgentId:B,sessions:p,discovery:j,topologySnapshot:q,loading:!s||X,navigate:t,selectedAgentId:u?.id??o})})})}function V({activeRoute:t,children:o,navigate:i,bar:r}){return e.jsxs("div",{className:"s-secondary-nav-shell",children:[e.jsx("div",{className:"s-secondary-nav-bar",children:r??e.jsx(ne,{activeRoute:t,navigate:i})}),e.jsx("div",{className:"s-secondary-nav-body",children:o})]})}export{gs as AgentsScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./index-CzVeWScw.js";import{S as i}from"./SecondaryNav-Hv5AJ3Fv.js";import{A as m}from"./secondaryNavConfig-Bg4Tc0gT.js";import"./createLucideIcon-ClCdc3F9.js";import"./message-square-CIXda-Y7.js";import"./file-text-DG-pufl1.js";import"./search-C3bSJluv.js";import"./terminal-DrTkVXIj.js";import"./code-xml--LjSM4Mv.js";import"./scroll-text-BV-BB7v-.js";function N({activeRoute:r,navigate:o}){return t.jsx(i,{ariaLabel:"Agents sections",activeRoute:r,groups:m,navigate:o})}export{N as AgentsSubnav};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as k,j as s}from"./index-CzVeWScw.js";import{k as d,l as B,m}from"./router-B-K15T7B.js";function p(t){switch(t.view){case"mesh":return"Back to mesh";case"ops":return"Back to ops";case"agents-v2":return t.agentId?"Registry":"All agents";case"messages":return"Back to conversations";case"conversation":return"Back to conversation";case"inbox":return"Back to inbox";case"sessions":return"Back to sessions";case"terminal":return"Terminal Control";case"work":return"Back to work";case"broker":return"Back to broker";case"activity":return"Back to activity";default:return"Back"}}function w({slot:t,fallback:n,navigate:c,className:r,label:i}){const e=d(),o=k.useMemo(()=>B(e.state),[e.state]),a=o??n,u=i??p(a),l=m(e.state)&&!!o;return s.jsxs("button",{type:"button",className:`s-back-pill${r?` ${r}`:""}`,onClick:()=>{if(l&&typeof window<"u"&&window.history.length>1){window.history.back();return}c(a)},children:[s.jsx("span",{"aria-hidden":!0,className:"s-back-pill-glyph",children:"←"}),s.jsx("span",{children:u})]})}export{w as B};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{r as n,j as e}from"./index-CzVeWScw.js";import{r as cs}from"./index-Dewd56RX.js";import{D as ds}from"./runtime-picker-BCQD7d4K.js";import{E as Re}from"./EmptyState-DypEjx0V.js";import{u as us,i as hs}from"./MessageComposerSuggestions-Cs9u-F_3.js";import{r as fs,R as ms,a as ps,b as bs}from"./NewChatComposer-DXDxV2Mh.js";import{a as ne}from"./api-h5zurxmi.js";import{c as ys}from"./clipboard-e3fSpeo7.js";import{u as gs}from"./sse-QcU9bikk.js";import{b as Ee}from"./status-tone-BM_zuRy1.js";import{t as Ie,b as We,n as V}from"./time-Dhsh_2EG.js";import{u as Qe,A as xs}from"./Provider-DSsb2gLR.js";import{o as qe}from"./openContent-C6XO6kr5.js";import{g as js,b as oe,h as Ve,e as ks,i as vs,d as ws,j as Ns,k as Ss,l as As,m as Rs}from"./broker-display-pp33bLsu.js";import{BrokerMetadataPanel as Is}from"./BrokerMetadataPanel-CaFe6kdh.js";import{DispatchAftermath as Cs}from"./DispatchAftermath-OXYlMbT1.js";import{i as $s,c as Ds,n as Oe}from"./keyboard-nav-BJnFoFDP.js";import{ShikiPane as Es}from"./ShikiPane-B7O4if20.js";import{d as Fs}from"./types-B0PlfpKc.js";/* empty css */import{L as ke}from"./loader-circle-Byb9kSFx.js";import{R as Ms}from"./refresh-cw-4oeFn1Jn.js";import{X as Ce}from"./x-D4X_y1j_.js";import{A as Ls}from"./arrow-down-D3-IbArq.js";import{E as _e}from"./external-link-CnaI1QFS.js";import{C as Ts}from"./chevron-down-DRCbnzyY.js";import{S as Ps}from"./sparkles-BjCA3Evu.js";import{P as Bs}from"./paperclip-DfpJkR4s.js";import{P as zs}from"./plus-CmFQp9Uj.js";import{S as qs}from"./send-horizontal-CqogPmbY.js";import{C as Os}from"./check-COxArFXG.js";import{C as _s}from"./copy-4LfKIdQJ.js";import{M as Ks}from"./message-square-CIXda-Y7.js";import{c as Ye}from"./createLucideIcon-ClCdc3F9.js";import{R as Us}from"./radio-PauJIekM.js";import{b as Hs,M as Js}from"./DocumentFocusViewer-BCG2kOmd.js";import{B as Ws}from"./bot-BRINYlC6.js";const Qs=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Vs=Ye("at-sign",Qs);const Ys=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Gs=Ye("hash",Ys),Xs=160;function Ke(s){const a=new URLSearchParams({limit:String(Xs)});return s&&a.set("cursor",s),`/api/broker?${a.toString()}`}const Ue={index:-1,request:0};function Zs(s,a){return{index:a,request:s.request+1}}function Ge(s,a){return a===s.index?s:{index:a,request:s.request}}function er(s,a){return s.index<a?s:Ge(s,a>0?a-1:-1)}function sr(s,a){return s.request!==a}function rr({enabled:s,rowCount:a,onActivateRow:t,onClearSelection:i}){const[f,d]=n.useState(Ue),b=f.index,u=n.useRef(new Map),c=n.useRef(Ue.request),j=n.useCallback(y=>{d(m=>Zs(m,typeof y=="function"?y(m.index):y))},[]),k=n.useCallback(y=>{d(m=>Ge(m,typeof y=="function"?y(m.index):y))},[]);n.useEffect(()=>{if(!sr(f,c.current)||(c.current=f.request,f.index<0))return;const y=u.current.get(f.index);y?.scrollIntoView({block:"nearest"}),y?.focus()},[f]),n.useEffect(()=>{d(y=>er(y,a))},[a]);const R=n.useCallback((y,m)=>{m?u.current.set(y,m):u.current.delete(y)},[]);n.useEffect(()=>{if(!s)return;const y=m=>{if(document.querySelector(".sys-broker-page")&&!($s(m.target)||Ds())&&a!==0){if(m.key==="Escape"){i&&(m.preventDefault(),i(),k(-1));return}if(m.key==="ArrowDown"||m.key==="j"){m.preventDefault(),j(S=>Oe(S,a,1));return}if(m.key==="ArrowUp"||m.key==="k"){m.preventDefault(),j(S=>Oe(S,a,-1));return}if(m.key==="Home"||m.key==="g"&&!m.shiftKey){m.preventDefault(),j(0);return}if(m.key==="End"||m.key==="G"){m.preventDefault(),j(a-1);return}if(m.key==="Enter"||m.key===" "){const S=b<0?0:b;m.preventDefault(),j(S),t(S)}}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s,b,j,t,i,a,k]);const U=n.useCallback(y=>({tabIndex:b===y?0:-1,ref:m=>R(y,m),onFocus:()=>k(y)}),[b,R,k]);return{focusedIndex:b,setFocusedIndex:k,getRowFocusProps:U}}const be=["all","delivered","failed"],ar={all:"All",delivered:"Delivered",failed:"Failed"};function tr(s){switch(s){case"success":return"Success";case"failed_query":return"Query failure";case"failed_delivery":return"Delivery failure";default:return"Delivery attempt"}}function Xe(s){return s.messageId??s.deliveryId??s.invocationId??s.id}function Ze(s){switch(Ee(s.kind,s.status)){case"success":return"Delivered";case"danger":return"Failed";case"working":return"Pending";case"warning":return"Held";default:return s.status?s.status.charAt(0).toUpperCase()+s.status.slice(1):"Queued"}}function $e(s){if(!s)return"··";const a=s.trim().split(/\s+/).filter(Boolean);if(a.length===0)return"··";const t=a[a.length-1];return/^\d+$/.test(t)?t.slice(-2):a.length>=2?(a[0][0]+a[1][0]).toUpperCase():s.trim().slice(0,2).toUpperCase()}function nr(s){const a=V(s)??0;return new Date(a).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function He(s){const a=V(s);return a===null?"—":new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Ne(s,a,t=0){if(!s||typeof s!="object"||Array.isArray(s)||t>3)return;const i=s;for(const f of a)if(i[f]!==void 0&&i[f]!==null)return i[f];for(const f of Object.values(i)){const d=Ne(f,a,t+1);if(d!==void 0)return d}}function B(s,...a){const t=Ne(s.metadata,a);return typeof t!="string"&&typeof t!="number"?null:String(t).trim()||null}function ve(s,...a){const t=Ne(s.metadata,a);return typeof t=="number"||typeof t=="string"?V(t):null}function es(s){switch(s){case"dm":return"Direct · agent";case"channel":return"Channel";case"broadcast":return"Broadcast";case null:return"No route";default:return s.replaceAll("_"," ")}}function we(s,a){if(a==="to")return s.route==="channel"?"Channel":s.route==="broadcast"?"Broadcast":s.target?.toLowerCase().includes("operator")?"Operator":"Agent lane";const t=B(s,"class","actorClass")?.toLowerCase();return t==="operator"||t==="human"?"Operator":t==="agent"?"Agent":s.actorName?.toLowerCase().includes("operator")?"Operator":"Sender"}function or(s){const a=Ne(s.metadata,["latencyMs","durationMs"]);if(typeof a=="number"&&Number.isFinite(a)&&a>=0)return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(a<1e4?1:0)}s`;const t=ve(s,"sentAt","createdAt")??V(s.ts),i=ve(s,"deliveredAt","completedAt");if(t===null||i===null||i<t)return"—";const f=i-t;return f<1e3?`${f}ms`:`${(f/1e3).toFixed(f<1e4?1:0)}s`}function De({route:s}){switch(s){case"channel":return e.jsx(Gs,{size:12,"aria-hidden":"true"});case"broadcast":return e.jsx(Us,{size:12,"aria-hidden":"true"});case"dm":return e.jsx(Vs,{size:12,"aria-hidden":"true"});default:return e.jsx(Ks,{size:12,"aria-hidden":"true"})}}function ir(s,a){if(!a)return null;const t=a.trim().replace(/^@/,"").toLowerCase();return s.find(i=>[i.id,i.name,i.handle,i.selector,i.defaultSelector,i.conversationId,i.harnessSessionId].some(f=>f?.trim().replace(/^@/,"").toLowerCase()===t))??null}function lr(s,a,t){const i=t?.authorityNodeName??t?.homeNodeName??t?.authorityNodeId??t?.homeNodeId??B(s,"machine","machineName","nodeName");return(t?[{label:"Status",value:t.state},{label:"Handle",value:t.handle?`@${t.handle.replace(/^@/,"")}`:null},{label:"Project",value:t.project},{label:"Branch",value:t.branch},{label:"Runtime",value:[t.harness,t.model,t.reasoningEffort].filter(Boolean).join(" · ")||null},{label:"Machine",value:i},{label:"Working dir",value:t.cwd??t.projectRoot},{label:"Session",value:t.harnessSessionId},{label:"Conversation",value:t.conversationId??s.conversationId}]:[{label:"Kind",value:a==="to"&&s.conversationId?"Session route":we(s,a)},{label:"Channel",value:es(s.route)},{label:"Session",value:a==="to"?s.target:B(s,"sessionId","harnessSessionId")},{label:"Conversation",value:s.conversationId},{label:"Harness",value:B(s,"harness")},{label:"Model",value:B(s,"model")},{label:"Project",value:B(s,"project","projectName")},{label:"Branch",value:B(s,"branch")},{label:"Machine",value:i}]).filter(d=>!!d.value)}function Je({attempt:s,agents:a,side:t}){const i=t==="from"?s.actorName:s.target,f=ir(a,i),d=f?.name??i??(t==="from"?"Unknown":"No target"),b=f?"Agent":t==="to"&&s.conversationId?"Session":we(s,t),u=lr(s,t,f),c=`dispatch-endpoint-${s.id}-${t}`;return e.jsxs("span",{className:`sys-broker-endpoint sys-broker-endpoint--${t}`,tabIndex:0,"aria-describedby":c,children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:f||t==="from"?$e(d):e.jsx(De,{route:s.route})}),e.jsx("span",{className:"sys-broker-endpoint-name",title:d,children:d}),e.jsxs("span",{className:"sys-broker-endpoint-card",id:c,role:"tooltip",children:[e.jsxs("span",{className:"sys-broker-endpoint-card-head",children:[e.jsx("span",{className:"sys-broker-avatar","aria-hidden":"true",children:f||t==="from"?$e(d):e.jsx(De,{route:s.route})}),e.jsxs("span",{children:[e.jsx("strong",{children:d}),e.jsx("small",{children:b})]})]}),e.jsx("span",{className:"sys-broker-endpoint-card-body",children:u.map(j=>e.jsxs("span",{className:"sys-broker-endpoint-card-field",children:[e.jsx("small",{children:j.label}),e.jsx("code",{title:j.value,children:j.value})]},j.label))})]})]})}function ye(s){const a=V(s)??0,t=new Date(a);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function cr(s,a=Date.now()){const t=V(s)??0,i=new Date(t),f=new Date(a),d=new Date(a);return d.setDate(d.getDate()-1),ye(s)===ye(f.getTime())?"Today":ye(s)===ye(d.getTime())?"Yesterday":i.toLocaleDateString(void 0,{month:"short",day:"numeric",year:i.getFullYear()===f.getFullYear()?void 0:"numeric"})}function dr(s,a,t){return{...a,source:s.source,attempts:[...s.attempts,...a.attempts],failedQueries:s.failedQueries,failedDeliveries:s.failedDeliveries,dialogue:s.dialogue,ledger:{...a.ledger,cursors:{...s.ledger.cursors,[t]:a.ledger.cursors[t]},hasMore:{...s.ledger.hasMore,[t]:a.ledger.hasMore[t]}}}}function ur({navigate:s,embedded:a=!1,initialAttemptId:t}){const{route:i,agents:f,selectedBrokerAttempt:d,inspectBrokerAttempt:b,clearBrokerAttempt:u}=Qe(),[c,j]=n.useState(null),k=i.view==="broker"?i.filter??"all":"all",[R,U]=n.useState(!0),[y,m]=n.useState(!1),[S,Y]=n.useState(!1),[te,z]=n.useState(null),E=n.useRef(null),F=n.useRef(0),q=n.useRef(null),M=n.useCallback(async(o="initial")=>{const h=++F.current;!E.current&&o!=="background"?(U(!0),z(null)):m(!0);try{const x=await ne(Ke());if(h!==F.current)return;E.current=x,j(x),z(null)}catch(x){if(h!==F.current)return;z(x instanceof Error?x.message:String(x))}finally{h===F.current&&(U(!1),m(!1))}},[]),G=n.useCallback(async()=>{const o=E.current;if(!o||S)return;const h="attempts",x=o.ledger.cursors[h];if(!x||!o.ledger.hasMore[h])return;const T=++F.current;Y(!0),z(null);try{const P=await ne(Ke(x));if(T!==F.current)return;const se=E.current,ue=se?dr(se,P,h):P;E.current=ue,j(ue)}catch(P){if(T!==F.current)return;z(P instanceof Error?P.message:String(P))}finally{T===F.current&&Y(!1)}},[S]),le=n.useCallback(()=>{q.current||(q.current=setTimeout(()=>{q.current=null,M("background")},250))},[M]);n.useEffect(()=>(M("initial"),()=>{q.current&&clearTimeout(q.current)}),[M]),gs(o=>{(o.kind==="message.posted"||o.kind==="delivery.planned"||o.kind==="delivery.attempted"||o.kind==="delivery.state.changed"||o.kind==="scout.dispatched")&&le()});const v=n.useMemo(()=>{if(!c)return[];const o=new Map(c.dialogue.map(h=>[h.id,h.body]));return js(c.attempts).map(h=>{const x=h.messageId?o.get(h.messageId):null;return x&&x!==h.detail?{...h,detail:x}:h})},[c]),I=n.useMemo(()=>{switch(k){case"delivered":return v.filter(o=>!oe(o));case"failed":return v.filter(oe);default:return v}},[k,v]),ge=c?.ledger.hasMore.attempts??!1,X=n.useMemo(()=>({all:v.length,delivered:v.filter(o=>!oe(o)).length,failed:v.filter(oe).length}),[v]),$=n.useMemo(()=>{const o=i.view==="broker"?i.attemptId:void 0;return!c||!o?null:v.find(h=>h.id===o)??c.attempts.find(h=>h.id===o)??c.failedQueries.find(h=>h.id===o)??c.failedDeliveries.find(h=>h.id===o)??null},[c,v,i]),Z=$?`${$.id}\0${$.status}\0${$.ts}`:null,D=d?`${d.id}\0${d.status}\0${d.ts}`:null;n.useEffect(()=>{$&&Z!==D&&b($)},[D,b,$,Z]);const[C,N]=n.useState(null),O=n.useRef(!1),_=n.useCallback(o=>{if(a){O.current=!0,N(o);return}b(o)},[a,b]),H=n.useCallback(()=>{if(a){O.current=!0,N(null);return}u()},[u,a]),J=n.useCallback(o=>{const h=I[o];h&&(_(h),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}})))},[I,_]),{getRowFocusProps:ce,setFocusedIndex:xe}=rr({enabled:!!c&&I.length>0,rowCount:I.length,onActivateRow:J,onClearSelection:H}),de=C?.id??null,L=C?`${C.id} ${C.status} ${C.ts}`:null;n.useEffect(()=>{if(!a||!de)return;const o=v.find(h=>h.id===de);o&&`${o.id} ${o.status} ${o.ts}`!==L&&N(o)},[a,de,L,v]),n.useEffect(()=>{if(!a||!t||!c||O.current||C)return;const o=v.find(h=>h.id===t)??c.attempts.find(h=>h.id===t)??c.failedQueries.find(h=>h.id===t)??c.failedDeliveries.find(h=>h.id===t);o&&(O.current=!0,N(o))},[c,a,C,v,t]),n.useEffect(()=>{const o=i.view==="broker"?i.attemptId:void 0;if(!o)return;const h=I.findIndex(x=>x.id===o);h>=0&&xe(h)},[I,k,i,xe]);const ee=n.useCallback(o=>{const x=(be.indexOf(k)+o+be.length)%be.length,T=be[x];s({view:"broker",...T==="all"?{}:{filter:T}})},[k,s]),A=a?C:null;return e.jsx("div",{className:`s-ops${a?" s-ops--embedded":""}${A?" s-ops--split":""}`,children:e.jsxs("div",{className:"s-ops-body",children:[e.jsxs("div",{className:"sys-surface-page sys-surface-page-wide sys-surface-page-fluid sys-broker-page",children:[e.jsxs("div",{className:"sys-ledger-toolbar","aria-label":"Dispatch controls",children:[c?e.jsx("div",{className:"sys-tab-row sys-tab-row--toolbar",role:"tablist","aria-label":"Dispatch message filters",onKeyDown:o=>{o.key==="ArrowRight"?(o.preventDefault(),ee(1)):o.key==="ArrowLeft"&&(o.preventDefault(),ee(-1))},children:be.map(o=>e.jsxs("button",{type:"button",role:"tab","aria-selected":k===o,className:`sys-tab${k===o?" sys-tab-active":""}`,onClick:()=>s({view:"broker",...o==="all"?{}:{filter:o}}),children:[e.jsx("span",{children:ar[o]}),e.jsx("span",{className:"sys-tab-count",children:X[o]})]},o))}):e.jsx("div",{className:"sys-ledger-kicker",children:"Dispatch ledger"}),e.jsxs("div",{className:"sys-page-actions sys-ledger-actions",children:[e.jsx("div",{className:"sys-sync-note",children:R?"Loading dispatch ledger...":c?`Updated ${Ie(c.generatedAt)}${c.source?.latestMessageAt?` · latest message ${Ie(c.source.latestMessageAt)}`:""}`:"Waiting for dispatch data"}),e.jsx("button",{type:"button",className:"s-btn",disabled:R||y,onClick:()=>{M("manual")},children:y?"Refreshing...":"Refresh"})]})]}),te&&e.jsxs("div",{className:"sys-banner sys-banner-warning",children:[e.jsx("strong",{children:"Refresh failed."}),e.jsx("span",{children:te})]}),y&&c&&e.jsxs("div",{className:"sys-broker-source-note",role:"status","aria-live":"polite",children:[e.jsx(ke,{className:"sys-broker-source-spinner",size:12,"aria-hidden":"true"}),e.jsx("strong",{children:"Updating dispatches…"})]}),!y&&c?.source?.mode==="sqlite_projection"&&c.source.status==="degraded"&&c.source.detail&&e.jsxs("div",{className:"sys-broker-source-note sys-broker-source-note--warning",role:"status","aria-label":c.source.detail,title:c.source.detail,children:[e.jsx("span",{className:"sys-broker-source-dot","aria-hidden":"true"}),e.jsx("strong",{children:"Dispatch may be out of date"}),e.jsx("span",{children:"Live broker unavailable; showing saved dispatch history."})]}),R&&!c&&e.jsx(Re,{title:"Loading dispatch",body:"Reading the dispatch database snapshot."}),!R&&!c&&!te&&e.jsx(Re,{title:"No dispatch data",body:"No dispatch rows are available yet."}),c&&e.jsxs(e.Fragment,{children:[e.jsx(hr,{attempts:I,agents:f,selectedAttemptId:a?C?.id??null:d?.id??(i.view==="broker"?i.attemptId??null:null),onInspect:_,getRowFocusProps:ce}),I.length>0&&ge&&e.jsx("div",{className:"sys-ledger-footer",children:e.jsx("button",{type:"button",className:"s-btn",disabled:S,onClick:()=>{G()},children:S?"Loading older...":"Load older"})})]})]}),A&&e.jsx("div",{className:"s-broker-embed-detail",children:e.jsx(ss,{attempt:A,navigate:s,onClose:H})})]})})}function hr({attempts:s,agents:a,selectedAttemptId:t,onInspect:i,getRowFocusProps:f}){if(s.length===0)return e.jsx(Re,{title:"No dispatch rows",body:"No dispatch rows are available yet."});const d=s.reduce((b,u,c)=>{const j=ye(u.ts),k=b[b.length-1];return k?.key===j?k.attempts.push({attempt:u,index:c}):b.push({key:j,label:cr(u.ts),attempts:[{attempt:u,index:c}]}),b},[]);return e.jsxs("div",{className:"sys-broker-wire","aria-label":"Dispatch ledger",children:[e.jsxs("div",{className:"sys-broker-wire-head","aria-hidden":"true",children:[e.jsx("span",{className:"sys-broker-col sys-broker-col--status",children:"Status"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--from",children:"From"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--to",children:"To"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--msg",children:"Message"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--time",children:"Time"})]}),d.map(b=>e.jsxs("section",{className:"sys-broker-day","aria-labelledby":`dispatch-day-${b.key}`,children:[e.jsxs("header",{className:"sys-broker-day-head",children:[e.jsx("h2",{id:`dispatch-day-${b.key}`,children:b.label}),e.jsxs("span",{children:[b.attempts.length," ",b.attempts.length===1?"dispatch":"dispatches"]})]}),e.jsx("div",{className:"sys-broker-wire-body",role:"list",children:b.attempts.map(({attempt:u,index:c})=>{const j=Ee(u.kind,u.status),k=oe(u),R=Ve(u),U=ks(u.detail,vs(u)),y=Ze(u),m=()=>{i(u),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}}))};return e.jsxs("div",{role:"listitem",className:`sys-broker-wire-row${k?" sys-broker-wire-row--failure":""}${t===u.id?" sys-broker-wire-row--selected":""}`,"aria-label":`Inspect ${u.detail}`,onClick:m,...f(c),children:[e.jsxs("div",{className:"sys-broker-cell sys-broker-col--status",children:[e.jsx("span",{className:`sys-broker-dot sys-broker-dot--${j}`,"aria-hidden":"true"}),e.jsx("span",{className:`sys-broker-state sys-broker-state--${j}`,children:y})]}),e.jsx("div",{className:"sys-broker-cell sys-broker-col--from",children:e.jsx(Je,{attempt:u,agents:a,side:"from"})}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--to",children:[e.jsx(xs,{className:"sys-broker-route-arrow",size:13,"aria-hidden":"true"}),e.jsx(Je,{attempt:u,agents:a,side:"to"})]}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--msg",children:[e.jsx("span",{className:"sys-broker-msg",title:u.detail,children:U}),k&&R&&e.jsx("span",{className:"sys-broker-msg-error",title:R,children:R})]}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--time",children:[e.jsx("time",{className:"sys-broker-time-rel",title:We(u.ts),children:Ie(u.ts)}),e.jsx("span",{className:"sys-broker-time-abs",children:nr(u.ts)})]})]},u.id)})})]},b.key))]})}function fr(s){const a=Xe(s);return[{label:"Kind",value:tr(s.kind)},{label:"Time",value:We(s.ts)},{label:"Actor",value:s.actorName},{label:"Target",value:s.target},{label:"Route",value:s.route},{label:"Conversation",value:s.conversationId},{label:"Reference",value:a},{label:"Message",value:s.messageId===a?null:s.messageId},{label:"Delivery",value:s.deliveryId===a?null:s.deliveryId},{label:"Invocation",value:s.invocationId===a?null:s.invocationId}].filter(t=>!!t.value)}function ie({value:s,subject:a,className:t}){const[i,f]=n.useState("idle"),d=n.useRef(null);n.useEffect(()=>{f("idle")},[s]),n.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const b=n.useCallback(async()=>{const j=await ys(s);d.current&&clearTimeout(d.current),f(j?"copied":"failed"),d.current=setTimeout(()=>{f("idle"),d.current=null},1500)},[s]),u=i==="copied",c=i==="failed";return e.jsx("button",{type:"button",className:`sys-copy-btn${t?` ${t}`:""}${u?" sys-copy-btn--copied":""}${c?" sys-copy-btn--failed":""}`,onClick:()=>{b()},title:u?`Copied ${a}`:c?"Copy failed":`Copy ${a}`,"aria-label":u?`Copied ${a}`:c?`Copy ${a} failed`:`Copy ${a}`,children:u?e.jsx(Os,{size:14,"aria-hidden":"true"}):e.jsx(_s,{size:14,"aria-hidden":"true"})})}function mr(s){const a=s.trim();if(a.startsWith("{")||a.startsWith("["))try{return{code:JSON.stringify(JSON.parse(a),null,2),path:"payload.json",language:"JSON"}}catch{}return{code:s,path:"payload.md",language:"Text · Markdown"}}function pr({payload:s}){const a=n.useMemo(()=>mr(s),[s]),[t,i]=n.useState(!1),f=n.useRef(null),d=a.code.split(`
|
|
2
|
-
`).length;n.useEffect(()=>{const u=f.current;!u||!t||u.open||u.showModal()},[t]),n.useEffect(()=>{i(!1)},[s]);const b=e.jsx("div",{className:"sys-broker-payload-code","data-language":a.path==="payload.json"?"json":"markdown",role:"region","aria-label":`Dispatch payload, ${a.language}`,tabIndex:0,children:e.jsx(Es,{code:a.code,path:a.path})});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sys-broker-payload-head",children:[e.jsx("span",{className:"sys-detail-label",children:"Payload"}),e.jsxs("span",{className:"sys-broker-payload-meta",children:[a.language," · ",d," ",d===1?"line":"lines"]}),e.jsx(ie,{value:s,subject:"payload"}),e.jsx("button",{type:"button",className:"sys-copy-btn sys-broker-payload-expand",onClick:()=>i(!0),title:"Expand payload","aria-label":"Expand payload",children:e.jsx(Hs,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-resizer",children:b}),t&&cs.createPortal(e.jsxs("dialog",{ref:f,className:"sys-broker-payload-dialog","aria-label":"Expanded dispatch payload",onCancel:u=>{u.preventDefault(),i(!1)},onClose:()=>i(!1),children:[e.jsxs("header",{className:"sys-broker-payload-dialog-head",children:[e.jsxs("div",{children:[e.jsx("span",{className:"sys-detail-label",children:"Dispatch payload"}),e.jsxs("span",{className:"sys-broker-payload-meta",children:[a.language," · ",d," ",d===1?"line":"lines"]})]}),e.jsx(ie,{value:s,subject:"payload"}),e.jsx("button",{type:"button",className:"sys-copy-btn",onClick:()=>i(!1),title:"Return payload to inspector","aria-label":"Return payload to inspector",children:e.jsx(Js,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-dialog-body",children:b})]}),document.body)]})}function br({attempt:s}){const a=Rs(s);return e.jsxs("div",{className:"sys-broker-route-failure",role:"status",children:[e.jsx("span",{className:"sys-broker-route-failure-mark","aria-hidden":"true",children:e.jsx(Ce,{size:14})}),e.jsxs("div",{children:[e.jsx("span",{className:"sys-detail-label",children:"Routing stopped"}),e.jsx("strong",{children:a}),e.jsx("p",{children:s.detail})]}),e.jsx(ie,{value:s.detail,subject:"failure detail"})]})}function ss({attempt:s,navigate:a,onClose:t}){const{route:i,agents:f,scoutbotAgentId:d}=Qe(),b=fr(s),u=ws(s.metadata),c=oe(s),j=s.kind==="failed_query",k=Ve(s),R=Ee(s.kind,s.status),U=ve(s,"sentAt","createdAt")??V(s.ts),y=ve(s,"deliveredAt","completedAt")??V(s.ts),m=Xe(s),[S,Y]=n.useState("idle"),[te,z]=n.useState(null),[E,F]=n.useState(null),[q,M]=n.useState(""),[G,le]=n.useState(""),[v,I]=n.useState("idle"),[ge,X]=n.useState(null),[$,Z]=n.useState(""),[D,C]=n.useState(""),[N,O]=n.useState(""),[_,H]=n.useState(""),[J,ce]=n.useState("medium"),[xe,de]=n.useState(null),[L,ee]=n.useState([]),[A,o]=n.useState("idle"),[h,x]=n.useState(null),T=B(s,"harness"),P=B(s,"model"),se=B(s,"reasoningEffort","effort"),ue=n.useRef(null),Fe=n.useRef(null),Se=n.useMemo(()=>Ns(s),[s]),w=n.useMemo(()=>f.filter(r=>!r.retiredFromFleet&&!r.staleLocalRegistration).slice().sort((r,l)=>r.id===d?-1:l.id===d?1:(l.updatedAt??0)-(r.updatedAt??0)||r.name.localeCompare(l.name)),[f,d]),he=n.useMemo(()=>Ss(s,w)?.id??"",[s,w]),fe=w.some(r=>r.id===d)?d:w[0]?.id??"",je=w[0]?.id??"",re=w.find(r=>r.id===fe)??null,rs=n.useMemo(()=>{const r=new Map;for(const l of w){const p=l.projectRoot?.trim()||l.cwd?.trim();if(!p)continue;const g=p.split("/").filter(Boolean).at(-1)??p;r.set(p,l.project?.trim()||g)}return[...r.entries()].map(([l,p])=>({path:l,label:p}))},[w]),Me=n.useRef({originalTargetAgentId:he,firstRoutableAgentId:je,defaultForwardAgentId:fe,defaultForwardAgent:re,effort:"medium"});Me.current={originalTargetAgentId:he,firstRoutableAgentId:je,defaultForwardAgentId:fe,defaultForwardAgent:re,effort:B(s,"reasoningEffort","effort")||"medium"};const me=n.useRef(!1);n.useEffect(()=>{const r=Me.current;me.current=!1,Y("idle"),z(null),F(null),M(""),le(r.originalTargetAgentId||r.firstRoutableAgentId),I("idle"),X(null),Z(r.defaultForwardAgentId),C(r.defaultForwardAgent?.projectRoot?.trim()||r.defaultForwardAgent?.cwd?.trim()||""),O(r.defaultForwardAgent?.harness?.trim()||""),H(r.defaultForwardAgent?.model?.trim()||""),ce(r.effort),ee([]),o("idle"),x(null)},[s.id]),n.useEffect(()=>{me.current||(le(r=>r||he||je),Z(r=>r||fe),C(r=>r||re?.projectRoot?.trim()||re?.cwd?.trim()||""),O(r=>r||re?.harness?.trim()||""),H(r=>r||re?.model?.trim()||""))},[re,fe,je,he]),n.useEffect(()=>{const r=new URLSearchParams({scope:"global+project"});D&&r.set("projectRoot",D);let l=!1;return ne(`/api/runner/options?${r.toString()}`).then(p=>{!l&&p.schemaVersion==="openscout.runtime-capabilities.v1"&&de(p)}).catch(()=>{}),()=>{l=!0}},[D]);const as=n.useCallback(r=>{M(r),window.requestAnimationFrame(()=>ue.current?.focus())},[]),ts=n.useCallback(async()=>{const r=w.find(l=>l.id===G);if(!(!r||v==="sending")){I("sending"),X(null);try{const l=await ne("/api/ask",{method:"POST",body:JSON.stringify({body:s.detail,targetAgentId:r.id,targetLabel:r.name,...T||P||se?{execution:{...T?{harness:T}:{},...P?{model:P}:{},...se?{reasoningEffort:se}:{},session:"new"}}:{},metadata:{source:"scout-dispatch-redispatch",originalDispatchId:s.id,...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),p=l.flightId??l.flight?.id;I("sent"),X(`New dispatch sent to ${r.name}${p?` · ${p}`:""}`)}catch(l){I("failed"),X(`Retry failed. ${l instanceof Error?l.message:String(l)}`)}}},[s,G,v,se,T,P,w]),Le=n.useCallback(async()=>{const r=q.trim(),l=w.find(p=>p.id===$);if(!(!r||!l||A==="sending")){o("sending"),x(L.length>0?`Uploading ${L.length} ${L.length===1?"attachment":"attachments"}…`:null);try{const p=L.length>0?await us(L):[],g=await ne("/api/ask",{method:"POST",body:JSON.stringify({body:`${r}
|
|
3
|
-
|
|
4
|
-
Attached dispatch context:
|
|
5
|
-
${Se}`,targetAgentId:l.id,targetLabel:l.name,...p.length>0?{attachments:p}:{},execution:{...N?{harness:N}:{},..._?{model:_}:{},...J?{reasoningEffort:J}:{}},metadata:{source:"scout-dispatch-forward",originalDispatchId:s.id,...D?{targetProjectPath:D}:{},...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),W=g.flightId??g.flight?.id;o("sent"),x(`Request sent to ${l.name}${W?` · ${W}`:""}`),M(""),ee([])}catch(p){o("failed"),x(`Request wasn't sent. ${p instanceof Error?p.message:String(p)}`)}}},[s,Se,$,J,L,N,_,D,A,q,w]),ns=n.useCallback(r=>{const l=r.filter(hs),p=r.length-l.length;l.length>0&&(ee(g=>[...g,...l]),o("idle"),x(null)),p>0&&(o("failed"),x("Attach markdown, code, an image, or a video clip."))},[]),os=c?["Get a second opinion","Propose a recovery plan","Draft a follow-up"]:["Summarize this dispatch","Draft a follow-up","What changed?"],K=w.find(r=>r.id===G)??null,ae=w.find(r=>r.id===$)??null,pe=w.filter(r=>D?(r.projectRoot?.trim()||r.cwd?.trim())===D:!0),Te=xe??ms,Ae=n.useMemo(()=>{const r=fs(Te),l=[_,ae?.harness===N?ae.model:null,...pe.filter(g=>g.harness===N).map(g=>g.model)].map(g=>g?.trim()).filter(g=>!!g);let p=r.harnesses;return p.some(g=>g.value===N)||(p=[{value:N,label:N||"default",models:[]},...p]),p=p.map(g=>{if(g.value!==N)return g;const W=g.models.some(Q=>Q.value==="")?g.models:[{value:"",label:"Default",note:"harness picks"},...g.models],ls=new Set(W.map(Q=>Q.value)),ze=l.filter(Q=>!ls.has(Q)).map(Q=>({value:Q,label:Q,note:"observed"}));return ze.length===0&&W===g.models?g:{...g,models:[...W,...ze]}}),{...r,harnesses:p}},[Te,ae,N,_,pe]);n.useEffect(()=>{const r=ps(Ae,N);!r||r.some(l=>l.value===J)||ce(r.find(l=>l.value==="medium")?.value??r[0]?.value??"")},[Ae,N,J]);const is=n.useCallback(async()=>{Y("running"),z(null);try{const r=await ne("/api/broker/dispatch-review",{method:"POST",body:JSON.stringify(As(s))});Y("sent"),F(r.conversationId),z(r.conversationId?`Report started${r.targetLabel?` with ${r.targetLabel}`:""}. Open the conversation to follow it.`:`Report started${r.targetLabel?` with ${r.targetLabel}`:""}${r.flightId?` · ${r.flightId}`:""}.`)}catch(r){Y("failed"),z(`Couldn't start the report. ${r instanceof Error?r.message:String(r)}`)}},[s]),Pe=c?e.jsxs("div",{className:"sys-broker-action-row",children:[e.jsxs("div",{className:"sys-broker-action-line",children:[e.jsx("span",{className:"sys-broker-action-label",id:"dispatch-report-title",children:"Failure report"}),e.jsxs("button",{type:"button",className:"sys-broker-report-button",disabled:S==="running"||S==="sent"&&!E,onClick:()=>{if(E){qe(a,{view:"conversation",conversationId:E},{returnTo:i});return}is()},children:[S==="running"?e.jsx(ke,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):E?e.jsx(_e,{size:13,"aria-hidden":"true"}):e.jsx(Ws,{size:13,"aria-hidden":"true"}),S==="running"?"Starting report…":E?"Open report conversation":"Start failure report"]})]}),te&&e.jsx("div",{className:`sys-broker-review-status sys-broker-review-status--${S}`,role:"status",children:te})]}):null,Be=e.jsxs("div",{className:"sys-broker-action-row",children:[e.jsxs("div",{className:"sys-broker-action-line",children:[e.jsx("span",{className:"sys-broker-action-label",id:"dispatch-redispatch-title",children:"Retry"}),e.jsxs("div",{className:"sys-broker-redispatch-controls",children:[e.jsx("select",{"aria-label":"Retry destination",value:G,disabled:v==="sending"||w.length===0,onChange:r=>{le(r.target.value),I("idle"),X(null)},children:w.length===0?e.jsx("option",{value:"",children:"No agents available"}):e.jsxs(e.Fragment,{children:[!G&&e.jsx("option",{value:"",children:"Original destination unavailable"}),w.map(r=>e.jsxs("option",{value:r.id,children:[r.id===d?"Scout":r.name,r.project?` · ${r.project}`:""]},r.id))]})}),e.jsxs("button",{type:"button",className:"sys-broker-redispatch-send",disabled:!K||v==="sending",onClick:()=>{ts()},children:[v==="sending"?e.jsx(ke,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(Ms,{size:13,"aria-hidden":"true"}),v==="sending"?"Retrying…":"Retry dispatch"]})]})]}),K&&e.jsxs("div",{className:"sys-broker-action-target-meta",children:[K.harness&&e.jsx("span",{children:K.harness}),K.model&&e.jsx("span",{children:K.model}),(K.cwd??K.projectRoot)&&e.jsx("code",{children:K.cwd??K.projectRoot})]}),ge&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${v}`,role:"status",children:ge})]});return e.jsxs("aside",{className:"sys-panel sys-broker-inspector","aria-label":"Dispatch route inspector",children:[e.jsx("header",{className:"sys-broker-inspector-head",children:e.jsxs("div",{className:"sys-broker-inspector-status",children:[e.jsx("span",{className:`sys-broker-dot sys-broker-dot--${R}`,"aria-hidden":"true"}),e.jsx("strong",{className:`sys-broker-state sys-broker-state--${R}`,children:Ze(s)}),e.jsx("code",{title:m,children:m}),e.jsx(ie,{value:Se,subject:"dispatch context",className:"sys-broker-inspector-copy"}),e.jsx("button",{type:"button",className:"sys-copy-btn sys-broker-inspector-close",onClick:t,title:"Close inspector","aria-label":"Close inspector",children:e.jsx(Ce,{size:14,"aria-hidden":"true"})})]})}),e.jsxs("div",{className:"sys-broker-inspector-body",children:[e.jsxs("section",{className:"sys-broker-route-stack","aria-label":"Dispatch route",children:[e.jsxs("div",{className:"sys-broker-route-party",children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-route-avatar","aria-hidden":"true",children:$e(s.actorName)}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["From · ",we(s,"from")]}),e.jsx("strong",{children:s.actorName??"Unknown sender"})]})]}),e.jsx(Ls,{className:"sys-broker-route-down",size:17,"aria-hidden":"true"}),e.jsxs("div",{className:"sys-broker-route-party",children:[e.jsx("span",{className:"sys-broker-route-target-icon","aria-hidden":"true",children:e.jsx(De,{route:s.route})}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["To · ",we(s,"to")]}),e.jsx("code",{title:s.target??"No target",children:s.target??"No target"})]}),s.conversationId&&e.jsxs("button",{type:"button",className:"sys-broker-route-button",onClick:()=>qe(a,{view:"conversation",conversationId:s.conversationId},{returnTo:i}),children:[e.jsx(_e,{size:11,"aria-hidden":"true"}),"Route"]})]})]}),e.jsxs("dl",{className:"sys-broker-delivery-grid",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Channel"}),e.jsx("dd",{children:es(s.route)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Latency"}),e.jsx("dd",{className:"sys-broker-delivery-accent",children:or(s)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Sent"}),e.jsx("dd",{children:He(U)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:c?"Failed":"Delivered"}),e.jsx("dd",{children:He(y)})]})]}),e.jsxs("section",{className:"sys-broker-payload",children:[j?e.jsx(br,{attempt:s}):e.jsx(pr,{payload:s.detail}),c&&!j&&k&&e.jsxs("div",{className:"sys-broker-inspector-error",role:"status",children:[e.jsx("span",{className:"sys-broker-inspector-error-label",children:"Error"}),e.jsx("p",{children:k})]})]}),e.jsx(Cs,{attempt:s,targetAgentId:he||null,navigate:a,returnTo:i}),e.jsx("section",{className:"sys-broker-actions","aria-label":"Dispatch actions",children:j?e.jsxs(e.Fragment,{children:[Pe,Be]}):e.jsxs(e.Fragment,{children:[Be,Pe]})}),e.jsxs("details",{className:"sys-broker-technical",children:[e.jsxs("summary",{children:[e.jsx("span",{children:"Technical details"}),e.jsx(Ts,{size:13,"aria-hidden":"true"})]}),e.jsx("div",{className:"sys-broker-inspector-rows",children:b.map(r=>e.jsxs("div",{className:"sys-broker-inspector-row",children:[e.jsx("span",{className:"sys-detail-label",children:r.label}),e.jsx("code",{className:"sys-detail-value",children:r.value}),e.jsx(ie,{value:r.value,subject:r.label.toLowerCase()})]},r.label))}),e.jsxs("div",{className:"sys-broker-metadata",children:[e.jsxs("div",{className:"sys-broker-metadata-head",children:[e.jsx("span",{className:"sys-detail-label",children:"Metadata"}),e.jsx(ie,{value:u,subject:"metadata",className:"sys-broker-metadata-copy"})]}),e.jsx(Is,{metadata:s.metadata,rawJson:u})]})]})]}),e.jsxs("section",{className:"sys-broker-forward","aria-labelledby":"dispatch-forward-title",children:[e.jsx("div",{className:"sys-broker-forward-head",children:e.jsx("span",{id:"dispatch-forward-title",className:"sys-broker-action-label",children:"Follow up"})}),e.jsxs("div",{id:"dispatch-forward-content",children:[e.jsx("div",{className:"sys-broker-forward-intro",children:e.jsx("div",{className:"sys-broker-ask-prompts","aria-label":"Suggested requests",children:os.map(r=>e.jsxs("button",{type:"button",onClick:()=>as(r),children:[e.jsx(Ps,{size:11,"aria-hidden":"true"}),r]},r))})}),e.jsxs("form",{className:"sys-broker-message-composer",onSubmit:r=>{r.preventDefault(),Le()},children:[e.jsx("label",{htmlFor:"dispatch-message-input",children:"Request"}),e.jsx("textarea",{ref:ue,id:"dispatch-message-input",value:q,rows:3,placeholder:`What should ${ae?.id===d?"Scout":ae?.name??"this agent"} investigate or do?`,disabled:A==="sending",onChange:r=>{M(r.target.value),A!=="idle"&&(o("idle"),x(null))},onKeyDown:r=>{r.key==="Enter"&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),Le())}}),L.length>0&&e.jsx("div",{className:"sys-broker-composer-attachments","aria-label":"Attachments",children:L.map((r,l)=>e.jsxs("span",{children:[e.jsx(Bs,{size:10,"aria-hidden":"true"}),e.jsx("span",{title:r.name,children:r.name}),e.jsx("button",{type:"button",onClick:()=>ee(p=>p.filter((g,W)=>W!==l)),"aria-label":`Remove ${r.name}`,children:e.jsx(Ce,{size:10,"aria-hidden":"true"})})]},`${r.name}:${r.size}:${l}`))}),e.jsxs("footer",{children:[e.jsxs("div",{className:"sys-broker-composer-left",children:[e.jsx("input",{ref:Fe,type:"file",multiple:!0,hidden:!0,disabled:A==="sending",onChange:r=>{ns([...r.target.files??[]]),r.target.value=""}}),e.jsx("button",{type:"button",className:"sys-broker-composer-attach",disabled:A==="sending",onClick:()=>Fe.current?.click(),"aria-label":"Attach files",title:"Attach files",children:e.jsx(zs,{size:16,"aria-hidden":"true"})}),e.jsx("span",{className:"sys-broker-message-attachment",title:m,children:"Dispatch context included"})]}),e.jsxs("div",{className:"sys-broker-composer-targets",children:[e.jsx("span",{className:"sys-broker-composer-route-label",children:"Send to"}),e.jsxs("label",{title:"Project target",children:[e.jsx("span",{children:"Project"}),e.jsxs("select",{"aria-label":"Project target",value:D,disabled:A==="sending",onChange:r=>{const l=r.target.value,p=w.find(g=>!l||(g.projectRoot?.trim()||g.cwd?.trim())===l)??null;me.current=!0,C(l),p&&(Z(p.id),O(p.harness?.trim()||""),H(p.model?.trim()||""))},children:[e.jsx("option",{value:"",children:"Any project"}),rs.map(r=>e.jsx("option",{value:r.path,children:r.label},r.path))]})]}),e.jsxs("label",{title:"Agent target",children:[e.jsx("span",{children:"Agent"}),e.jsx("select",{"aria-label":"Agent target",value:$,disabled:A==="sending"||pe.length===0,onChange:r=>{const l=w.find(p=>p.id===r.target.value)??null;me.current=!0,Z(r.target.value),l&&(C(l.projectRoot?.trim()||l.cwd?.trim()||""),O(l.harness?.trim()||""),H(l.model?.trim()||"")),o("idle"),x(null)},children:pe.length===0?e.jsx("option",{value:"",children:"No agents"}):pe.map(r=>e.jsx("option",{value:r.id,children:r.id===d?"Scout":r.name},r.id))})]}),e.jsx(bs,{catalog:Ae,value:{harness:N,model:_,effort:J},onChange:r=>{me.current=!0,O(r.harness),H(r.model),ce(r.effort)},disabled:A==="sending"}),e.jsx(ds,{className:"sys-broker-composer-mic",disabled:A==="sending",onAppend:r=>M(l=>l.trim()?`${l.trimEnd()} ${r}`:r),onError:r=>{o("failed"),x(r)}})]}),e.jsx("button",{type:"submit",className:"sys-broker-composer-send",disabled:!q.trim()||!ae||A==="sending","aria-label":`Ask ${ae?.name??"recipient"} about this dispatch`,children:A==="sending"?e.jsx(ke,{size:14,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(qs,{size:14,"aria-hidden":"true"})})]})]}),h&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${A}`,role:"status",children:h})]})]})]})}const yr=Fs({id:"dispatch",label:"Dispatch",route:{view:"broker"},webPath:"/dispatch",screen:"BrokerScreen",embed:{path:"/embed/dispatch",profile:"macos.dispatch",rootClassName:"s-broker-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},ownsInternalRoutes:!0,resolveEmbedProps:s=>{const a=s.get("attempt")?.trim();return a?{initialAttemptId:a}:{}},hosts:{macos:!0}}}),sa=Object.freeze(Object.defineProperty({__proto__:null,BrokerAttemptInspector:ss,BrokerScreen:ur,scoutSurface:yr},Symbol.toStringTag,{value:"Module"}));export{ss as B,ur as a,Ke as b,sa as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./index-CzVeWScw.js";import{M as p}from"./message-markup-mGF07emJ.js";import{f as d}from"./conversation-model-CHwHZNw-.js";import{t as n}from"./time-Dhsh_2EG.js";import"./mentions-fbQJ2mBI.js";import"./colors-BtO5_zlx.js";import"./index-Dewd56RX.js";import"./api-h5zurxmi.js";import"./Provider-DSsb2gLR.js";import"./router-B-K15T7B.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-C3qU8tnY.js";import"./sse-QcU9bikk.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-N-Z6X0Z1.js";import"./DocumentFocusViewer-BCG2kOmd.js";import"./createLucideIcon-ClCdc3F9.js";import"./TextDocumentSurface-DRjctOIt.js";/* empty css */import"./file-text-DG-pufl1.js";import"./x-D4X_y1j_.js";import"./chevron-right-CNE6QAVr.js";import"./code-xml--LjSM4Mv.js";import"./arrow-left-_vS7itsV.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BJnFoFDP.js";import"./MessageComposerSuggestions-Cs9u-F_3.js";import"./NewChatComposer-DXDxV2Mh.js";import"./runtime-picker-BCQD7d4K.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Byb9kSFx.js";import"./HarnessMark-BE-YSyci.js";import"./NewChatOrigin-CnjoswTG.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-DRCbnzyY.js";import"./search-C3bSJluv.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";import"./AgentDetailCard-sZuHl1de.js";import"./AgentLiveActions-DI4ooSHW.js";import"./terminal-takeover-KvmTwABa.js";import"./openContent-C6XO6kr5.js";import"./eye-BFlhMzQL.js";import"./terminal-DrTkVXIj.js";function l({at:a}){const i=d(a);return t.jsxs("div",{className:"s-thread-day-divider","aria-label":i,children:[t.jsx("span",{className:"s-thread-day-line","aria-hidden":"true"}),t.jsx("span",{className:"s-thread-day-label",children:i}),t.jsx("span",{className:"s-thread-day-line","aria-hidden":"true"})]})}function st({row:a,expanded:i,showDayDivider:e,onToggle:s}){const m=`${a.recipients.length} recipients`;return t.jsxs("div",{className:["s-thread-feed-block","s-thread-fanout",e&&"s-thread-feed-block--full-width"].filter(Boolean).join(" "),children:[e&&t.jsx(l,{at:a.createdAt}),a.messages.map(r=>t.jsx("span",{id:`msg-${r.id}`,className:"s-thread-fanout-anchor","aria-hidden":"true"},r.id)),t.jsxs("button",{type:"button",className:"s-thread-fanout-summary","aria-expanded":i,onClick:s,title:a.recipients.join(", "),children:[t.jsx("span",{className:"s-thread-fanout-caret","aria-hidden":"true",children:i?"▾":"▸"}),t.jsx("span",{className:"s-thread-fanout-label",children:m}),t.jsx("span",{className:"s-thread-fanout-time",children:n(a.createdAt)})]}),i&&t.jsxs("div",{className:"s-thread-fanout-detail",children:[t.jsx("ul",{className:"s-thread-fanout-recipients",children:a.messages.map((r,o)=>t.jsx("li",{className:"s-thread-fanout-recipient",children:a.recipients[o]},r.id))}),t.jsx("div",{className:"s-thread-fanout-body",children:t.jsx(p,{text:a.messages[0].body})})]})]})}export{st as FanOutRow,l as ThreadDayDivider};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/conversation-motion-features-T8vF9zED.js","assets/gestures-CxG3Dphs.js","assets/index-CzVeWScw.js","assets/index-9as_JTUs.css","assets/use-reduced-motion-Dla-G_Jz.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as e,_ as M,r as x}from"./index-CzVeWScw.js";import{b as L,t as _,g as S,r as R,d as $,m as w,c as E,e as I,p as P}from"./conversation-model-CHwHZNw-.js";import{n as W,d as b,f as B,s as z}from"./colors-BtO5_zlx.js";import{i as y}from"./sessionRead-CvFz2RHv.js";import{t as j,f as k}from"./time-Dhsh_2EG.js";import{u as U}from"./Provider-DSsb2gLR.js";import{o as f}from"./openContent-C6XO6kr5.js";import{u as D,L as F,m as p}from"./use-reduced-motion-Dla-G_Jz.js";import{A as O}from"./activity-BxwKkT8z.js";import{T as H}from"./terminal-DrTkVXIj.js";import{M as K}from"./message-circle-aGOfQWm2.js";import"./router-B-K15T7B.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-C3qU8tnY.js";import"./api-h5zurxmi.js";import"./sse-QcU9bikk.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-N-Z6X0Z1.js";import"./DocumentFocusViewer-BCG2kOmd.js";import"./createLucideIcon-ClCdc3F9.js";import"./TextDocumentSurface-DRjctOIt.js";/* empty css */import"./file-text-DG-pufl1.js";import"./x-D4X_y1j_.js";import"./chevron-right-CNE6QAVr.js";import"./code-xml--LjSM4Mv.js";import"./arrow-left-_vS7itsV.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BJnFoFDP.js";import"./MessageComposerSuggestions-Cs9u-F_3.js";import"./NewChatComposer-DXDxV2Mh.js";import"./runtime-picker-BCQD7d4K.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Byb9kSFx.js";import"./index-Dewd56RX.js";import"./HarnessMark-BE-YSyci.js";import"./NewChatOrigin-CnjoswTG.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-DRCbnzyY.js";import"./search-C3bSJluv.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";const G=[{head:"30%",body:"88%",short:"62%"},{head:"22%",body:"76%",short:"48%"},{head:"34%",body:"82%",short:"68%"}],J=()=>M(()=>import("./conversation-motion-features-T8vF9zED.js"),__vite__mapDeps([0,1,2,3,4])).then(a=>a.default);function Y({onOpenTrace:a,onOpenTerminal:i,onSteer:d,compact:r=!1}){return!a&&!i&&!d?null:e.jsxs("nav",{className:`s-thread-working-actions${r?" s-thread-working-actions--compact":""}`,"aria-label":"Working turn actions",children:[a&&e.jsxs("button",{type:"button",className:"s-thread-working-action s-thread-working-action--primary",onClick:a,title:"Watch this run's live trace",children:[e.jsx(O,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Live trace"})]}),i&&e.jsxs("button",{type:"button",className:"s-thread-working-action",onClick:i,title:"Jump into this agent's terminal",children:[e.jsx(H,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Terminal"})]}),d&&e.jsxs("button",{type:"button",className:"s-thread-working-action",onClick:d,title:"Write an interrupting message to steer this turn",children:[e.jsx(K,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Steer…"})]})]})}const q={think:"Thinking",tool:"Tool",ask:"Prompt",message:"Says",note:"Note",system:"System",boot:"Boot"};function N({steps:a,phase:i,limit:d=5,compact:r=!1}){const l=a.slice(-d),o=a.length-l.length;return l.length===0?i?e.jsxs("div",{className:"s-thread-steps-phase",children:[e.jsx("span",{children:i.label}),e.jsx("strong",{children:i.detail})]}):null:e.jsxs("div",{className:`s-thread-steps${r?" s-thread-steps--compact":""}`,children:[o>0&&e.jsxs("div",{className:"s-thread-steps-elided",children:[o," earlier step",o===1?"":"s"]}),e.jsx("ol",{"aria-label":"Live steps in this turn",children:l.map(s=>e.jsxs("li",{"data-kind":s.kind,children:[e.jsx("span",{className:"s-thread-step-mark","aria-hidden":"true"}),e.jsx("span",{className:"s-thread-step-kind",children:q[s.kind]}),e.jsxs("span",{className:"s-thread-step-body",children:[s.tool?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-thread-step-tool",children:s.tool}),s.arg&&e.jsx("span",{className:"s-thread-step-arg",children:s.arg})]}):e.jsx("span",{className:"s-thread-step-text",children:s.text}),s.repeatCount>1&&e.jsxs("span",{className:"s-thread-step-repeat",children:["×",s.repeatCount]}),s.outcome&&e.jsx("span",{className:"s-thread-step-outcome",children:s.outcome})]}),e.jsx("time",{title:k(s.ts),children:j(s.ts)})]},s.id))})]})}function Q({events:a,limit:i=3,compact:d=!1}){const r=a.slice(0,i);return r.length===0?null:e.jsx("ol",{className:`s-thread-motion-events${d?" s-thread-motion-events--compact":""}`,"aria-label":"Latest run activity",children:r.map(l=>e.jsxs("li",{children:[e.jsx("span",{className:"s-thread-motion-event-kind",children:L(l.kind)}),e.jsx("span",{className:"s-thread-motion-event-summary",children:_(l)??"Activity recorded"}),e.jsx("time",{title:k(l.ts),children:j(l.ts)})]},l.id))})}function He(){const a=D();return e.jsx(F,{features:J,strict:!0,children:e.jsxs(p.section,{className:"s-thread-skeleton","aria-busy":"true","aria-live":"polite",initial:a?!1:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:[.2,.7,.3,1]},children:[e.jsxs("div",{className:"s-thread-skeleton-intro",role:"status",children:[e.jsxs("div",{className:"s-thread-loader-mark","aria-hidden":"true",children:[e.jsx(p.span,{className:"s-thread-loader-orbit",animate:a?void 0:{rotate:360},transition:{duration:3.2,ease:"linear",repeat:1/0},children:e.jsx("span",{})}),e.jsx(p.span,{className:"s-thread-loader-core",animate:a?void 0:{scale:[.88,1,.88],opacity:[.58,1,.58]},transition:{duration:1.8,ease:"easeInOut",repeat:1/0}})]}),e.jsxs("span",{className:"s-thread-skeleton-copy",children:[e.jsx("strong",{children:"Composer ready"}),e.jsx("span",{children:"Gathering the conversation…"})]})]}),e.jsx("div",{className:"s-thread-skeleton-turns","aria-hidden":"true",children:G.map((i,d)=>e.jsxs(p.div,{className:"s-thread-skeleton-turn",initial:a?!1:{opacity:0,y:7},animate:{opacity:1,y:0},transition:{delay:a?0:.05+d*.055,duration:.24,ease:[.2,.7,.3,1]},children:[e.jsx("span",{className:"s-thread-skeleton-avatar"}),e.jsxs("div",{className:"s-thread-skeleton-lines",children:[e.jsx("span",{className:"s-thread-skeleton-line s-thread-skeleton-line--head",style:{width:i.head}}),e.jsx("span",{className:"s-thread-skeleton-line",style:{width:i.body}}),e.jsx("span",{className:"s-thread-skeleton-line s-thread-skeleton-line--short",style:{width:i.short}})]})]},`${i.head}-${i.body}`))})]})})}function Ke({sessions:a,activeConversationId:i,needsYouIds:d,lastViewed:r,navigate:l}){const o=a.filter(n=>d.has(n.id)||n.agentId&&d.has(n.agentId)),s=x.useMemo(()=>S(a),[a]);return e.jsx("aside",{className:"s-thread-rail",children:e.jsxs("div",{className:"s-thread-rail-scroll",children:[o.length>0&&e.jsxs("div",{className:"s-thread-rail-section s-thread-rail-section--needs-you",children:[e.jsx("div",{className:"s-thread-rail-section-label",children:"Needs you"}),o.map(n=>e.jsx(g,{session:n,active:n.id===i,unread:y(n.lastMessageAt,n.id,r),needsYou:!0,navigate:l},`needs-${n.id}`))]}),s.map(n=>e.jsxs("div",{className:"s-thread-rail-section",children:[e.jsx("div",{className:"s-thread-rail-section-label",children:n.workspace}),n.sessions.map(c=>e.jsx(g,{session:c,active:c.id===i,unread:y(c.lastMessageAt,c.id,r),needsYou:!1,navigate:l},c.id))]},n.workspace))]})})}function Ge({sessionMeta:a,agents:i,flights:d,conversationId:r,navigate:l,route:o}){const s=x.useMemo(()=>a?a.participantIds.filter(t=>t!=="operator").map(t=>R(i,[t])).filter(t=>t!==null):[],[a,i]),n={id:"operator",name:"You",handle:"operator",activity:null,state:"ready",agent:null},c=x.useMemo(()=>s.map(t=>({id:t.id,name:t.name,handle:w(t)??E(t.id)??t.id,activity:$(t,d,r),state:W(t.state),agent:t})),[s,d,r]),h=[n,...c];return e.jsxs("aside",{className:"s-thread-sidebar",children:[e.jsxs("div",{className:"s-thread-sidebar-section",children:[e.jsx("div",{className:"s-thread-sidebar-label",children:"In this conversation"}),h.map(t=>{const m=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"28px",background:b(t.name)},children:t.name[0]?.toUpperCase()??"?"}),e.jsxs("div",{className:"s-thread-sidebar-participant-info",children:[e.jsx("span",{className:"s-thread-sidebar-participant-name",children:t.name}),e.jsxs("span",{className:"s-thread-sidebar-participant-handle",children:["@",t.handle]})]}),e.jsx("div",{className:"s-thread-sidebar-participant-activity",children:t.activity?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-thread-sidebar-activity-dot s-thread-sidebar-activity-dot--pulse",style:{background:"var(--green)"}}),e.jsx("span",{className:"s-thread-sidebar-activity-label",children:t.activity})]}):B(t.state)||t.id==="operator"?e.jsx("span",{className:"s-thread-sidebar-activity-dot",style:{background:z(t.state)}}):e.jsx("span",{className:"s-thread-sidebar-activity-dot",style:{background:"var(--dim)"}})})]});return t.agent?e.jsx("button",{type:"button",className:"s-thread-sidebar-participant s-thread-sidebar-participant--clickable",onClick:()=>f(l,{view:"agents-v2",agentId:t.agent.id},{returnTo:o}),title:`Open ${t.name} profile`,children:m},t.id):e.jsx("div",{className:"s-thread-sidebar-participant",children:m},t.id)})]}),c.length>0&&e.jsxs("div",{className:"s-thread-sidebar-section",children:[e.jsx("div",{className:"s-thread-sidebar-label",children:"Conversation mesh"}),e.jsx(V,{participants:c})]})]})}function Je({agentName:a,title:i,detail:d,snapshot:r,events:l,steps:o,phase:s,tone:n,workspaceName:c,branch:h,startedAt:t,onOpenTrace:m,onOpenTerminal:A,onSteer:C}){const T=t?j(t):"now";return e.jsxs("section",{className:`s-thread-motion-panel s-thread-motion-panel--${n}`,"aria-live":"polite",children:[e.jsxs("div",{className:"s-thread-motion-head",children:[e.jsx("div",{className:"s-thread-motion-beacon","aria-hidden":"true",children:e.jsx("span",{})}),e.jsxs("div",{className:"s-thread-motion-title-block",children:[e.jsx("div",{className:"s-thread-motion-kicker",children:"Currently working"}),e.jsx("h2",{children:i}),e.jsx("p",{children:d})]})]}),e.jsx("div",{className:"s-thread-motion-meter","aria-hidden":"true",children:X.map((u,v)=>e.jsx("span",{style:{"--bar-height":`${u}%`,"--bar-delay":`${v*74}ms`}},`${u}-${v}`))}),e.jsxs("dl",{className:"s-thread-motion-stats",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Session"}),e.jsx("dd",{children:T})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Activity"}),e.jsx("dd",{children:r.activityLabel})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Last"}),e.jsx("dd",{children:r.lastActivityLabel})]})]}),e.jsxs("div",{className:"s-thread-motion-latest",children:[e.jsx("span",{children:a}),e.jsx("strong",{children:r.latest})]}),o.length>0?e.jsx(N,{steps:o,phase:null,limit:6}):l.length>0?e.jsx(Q,{events:l,limit:4}):s?e.jsx(N,{steps:o,phase:s,limit:6}):e.jsxs("div",{className:"s-thread-motion-waiting",children:[e.jsx("span",{children:"Session created"}),e.jsx("strong",{children:"waiting for the first trace event"})]}),(c||h)&&e.jsxs("div",{className:"s-thread-motion-chips",children:[c&&e.jsx("span",{children:c}),h&&e.jsx("span",{children:h})]}),e.jsx(Y,{onOpenTrace:m,onOpenTerminal:A,onSteer:C})]})}function g({session:a,active:i,unread:d,needsYou:r,navigate:l}){const{route:o}=U(),s=I(a),n=(a.agentName??s)[0]?.toUpperCase()??"?",c=a.kind==="direct",h=P(a.workspaceRoot)??a.kind;return e.jsxs("button",{type:"button",className:["s-thread-rail-item",i&&"s-thread-rail-item--active",r&&"s-thread-rail-item--needs-you"].filter(Boolean).join(" "),onClick:()=>f(l,{view:"conversation",conversationId:a.id},{returnTo:o}),children:[c?e.jsx("div",{className:"s-thread-rail-avatar",style:{background:b(a.agentName??s)},children:n}):e.jsx("div",{className:"s-thread-rail-avatar s-thread-rail-avatar--channel",children:"#"}),e.jsxs("div",{className:"s-thread-rail-body",children:[e.jsx("span",{className:"s-thread-rail-name",children:s}),e.jsx("span",{className:"s-thread-rail-sub",children:h})]}),e.jsxs("div",{className:"s-thread-rail-trailing",children:[d&&!r&&e.jsx("span",{className:"s-thread-rail-presence-dot",style:{background:"var(--accent)"}}),r&&e.jsx("span",{className:"s-thread-rail-badge s-thread-rail-badge--amber",children:"!"})]})]})}function V({participants:a}){const o=a.map((s,n)=>{const c=2*Math.PI*n/a.length-Math.PI/2;return{...s,x:130+55*Math.cos(c),y:80+55*Math.sin(c)}});return e.jsx("div",{className:"s-thread-mini-mesh",children:e.jsxs("svg",{viewBox:"0 0 260 160","aria-label":"Conversation participant mesh",children:[o.map(s=>e.jsx("line",{x1:130,y1:80,x2:s.x,y2:s.y,className:"s-thread-mini-mesh-edge"},`edge-${s.id}`)),e.jsx("circle",{cx:130,cy:80,r:16,className:"s-thread-mini-mesh-node s-thread-mini-mesh-node--center"}),e.jsx("text",{x:130,y:80,className:"s-thread-mini-mesh-label s-thread-mini-mesh-label--center",children:"OP"}),o.map(s=>e.jsxs("g",{children:[e.jsx("circle",{cx:s.x,cy:s.y,r:16,className:"s-thread-mini-mesh-node",style:s.state==="in_turn"||s.state==="in_flight"?{stroke:"var(--green)"}:void 0}),e.jsx("text",{x:s.x,y:s.y,className:"s-thread-mini-mesh-label",children:s.name.slice(0,3).toUpperCase()})]},`node-${s.id}`))]})})}const X=[42,76,54,88,34,66,92,48,72,38,84,58];export{Ke as ChannelRail,Ge as PresenceSidebar,He as ThreadLoadingSkeleton,Je as ThreadMotionPanel,Y as WorkingTurnActions,Q as WorkingTurnActivityPreview,N as WorkingTurnSteps};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o,r as a}from"./index-CzVeWScw.js";import{c as it,w as Qn,p as Ht,d as Ms,h as Vn,l as zn,f as Gn,s as Ns,g as Jn,i as Xn,j as Yn}from"./NewChatComposer-DXDxV2Mh.js";import{a as K}from"./api-h5zurxmi.js";import{u as Zn}from"./MessageComposerSuggestions-Cs9u-F_3.js";import"./runtime-picker-BCQD7d4K.js";import{u as ea,C as ta}from"./ConversationComposer-CiEF7dhd.js";import"./index-Dewd56RX.js";import{u as sa,e as na}from"./Provider-DSsb2gLR.js";import{o as aa,q as ra,x as te,y as Is,z as oa,A as be,B as ia,C as la,D as ca,E as da,c as As,S as js,F as ua,G as ma,H as ha,I as pa,J as fa,K as ga,L as ya,s as wa,M as Sa,N as ba,e as Ta,p as xa,r as Rs,O as va,P as ka,Q as Ca,R as Ma,u as Na,T as Ia,U as Aa,V as Es,W as ja,X as Ra,Y as lt,n as Ea,Z as La,_ as $a,$ as Ls,a0 as Pa,a1 as Fa,a2 as Oa,a3 as qa,a4 as $s,a5 as Da,a6 as Ps,a7 as Ba,a8 as Ha,a9 as Ua}from"./conversation-model-CHwHZNw-.js";import{u as _a}from"./sse-QcU9bikk.js";import{n as Vt,t as Ut,f as Fs}from"./time-Dhsh_2EG.js";import{M as Wa}from"./message-markup-mGF07emJ.js";import{i as _t}from"./message-visibility-kJM8XcSG.js";import{b as Ka}from"./router-B-K15T7B.js";import{f as Qa}from"./scoutbot-BTIErYHo.js";import{s as Va}from"./sessionRead-CvFz2RHv.js";import{o as ct}from"./openContent-C6XO6kr5.js";import{u as za}from"./ContextMenu-N-Z6X0Z1.js";import{c as Be}from"./clipboard-e3fSpeo7.js";import{A as Wt}from"./AgentAvatar-CszU5eaU.js";import{d as Ga}from"./types-B0PlfpKc.js";/* empty css */import{ConversationHeader as Ja,ConversationIdentityRow as Xa,AddParticipantForm as Ya}from"./ConversationHeader-BGgbITvr.js";import{FanOutRow as Za,ThreadDayDivider as er}from"./ConversationFeedRows-5it6QNBV.js";import{ThreadLoadingSkeleton as tr,ThreadMotionPanel as sr,WorkingTurnSteps as nr,WorkingTurnActivityPreview as ar,WorkingTurnActions as rr}from"./ConversationPanels-vI9YuQJh.js";import{g as or,c as ir,d as lr,e as cr,f as dr}from"./tail-display-BRcJltQa.js";import{u as ur}from"./tail-events-C6K7bCWB.js";import{PinnedAskCard as mr,ConversationStatusStrip as hr}from"./ConversationStatus-COEj5loj.js";import"./HarnessMark-BE-YSyci.js";import"./colors-BtO5_zlx.js";import"./NewChatOrigin-CnjoswTG.js";import"./keyboard-nav-BJnFoFDP.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-D4X_y1j_.js";import"./createLucideIcon-ClCdc3F9.js";import"./chevron-down-DRCbnzyY.js";import"./search-C3bSJluv.js";import"./loader-circle-Byb9kSFx.js";import"./file-text-DG-pufl1.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./surface-activity-B1rgWB1i.js";import"./DocumentFocusViewer-BCG2kOmd.js";import"./TextDocumentSurface-DRjctOIt.js";/* empty css */import"./chevron-right-CNE6QAVr.js";import"./code-xml--LjSM4Mv.js";import"./arrow-left-_vS7itsV.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";import"./index-BWHgHrtv.js";import"./mentions-fbQJ2mBI.js";import"./AgentDetailCard-sZuHl1de.js";import"./AgentLiveActions-DI4ooSHW.js";import"./terminal-takeover-KvmTwABa.js";import"./eye-BFlhMzQL.js";import"./terminal-DrTkVXIj.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-C3qU8tnY.js";import"./SpriteAvatar-BpQDpOkq.js";import"./agent-identity-BxCsXnDp.js";import"./BackToPicker-DZg_4nHL.js";import"./use-reduced-motion-Dla-G_Jz.js";import"./activity-BxwKkT8z.js";import"./message-circle-aGOfQWm2.js";import"./lane-edit-display-C_Aujldz.js";const pr=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)(?:$|[?#])/iu,fr=/\bhttps?:\/\/[^\s<>"')\]]+/giu;function He(s){if(typeof s!="string")return null;try{const i=new URL(s.trim());return i.protocol==="http:"||i.protocol==="https:"?i.toString():null}catch{return null}}function V(s,i){const d=s?.[i];return typeof d=="string"&&d.trim()?d.trim():null}function gr(s){return s.mediaType.toLowerCase().startsWith("image/")}function yr(s){return pr.test(s)}function wr(s){try{const i=new URL(s),d=[i.pathname==="/"?"":i.pathname,i.search].join("").trim();return{host:i.hostname.replace(/^www\./iu,""),detail:d||i.hostname}}catch{return{host:s,detail:s}}}function Sr(s){const i=new Set,d=[];for(const h of s.matchAll(fr)){const u=h[0]?.replace(/[.,;:!?]+$/u,""),v=He(u);!v||i.has(v)||(i.add(v),d.push(v))}return d}const br=/^\/api\/blobs\/[^/]+$/u;function Kt(s){try{const i=new URL(s);return br.test(i.pathname)?`${i.pathname}${i.search}`:s}catch{return s}}function ut(s){return He(s.url)??He(V(s.metadata,"url"))??He(V(s.metadata,"href"))}function Tr(s){const i=s.metadata??null,d=V(i,"kind")??V(i,"type"),h=ut(s);if(!h||d!=="link_preview"&&d!=="link-preview"&&s.mediaType!=="text/x-uri")return null;const u=wr(h);return{id:s.id,url:h,title:V(i,"title")??u.host,description:V(i,"description"),imageUrl:He(V(i,"imageUrl")??V(i,"image")),siteName:V(i,"siteName")??u.host}}function xr({src:s,alt:i}){const[d,h]=a.useState(!1);return d?o.jsxs("a",{className:"s-message-embed s-message-embed--file",href:s,target:"_blank",rel:"noreferrer",children:[o.jsx("span",{className:"s-message-embed-title",children:i}),o.jsx("span",{className:"s-message-embed-description",children:"Preview unavailable"})]}):o.jsx("a",{className:"s-message-embed s-message-embed--image",href:s,target:"_blank",rel:"noreferrer",children:o.jsx("img",{src:s,alt:i,loading:"lazy",decoding:"async",onError:()=>h(!0)})})}function vr({preview:s}){return o.jsxs("a",{className:"s-message-embed s-message-embed--link",href:s.url,target:"_blank",rel:"noreferrer",children:[s.imageUrl&&o.jsx("span",{className:"s-message-embed-thumb",children:o.jsx("img",{src:s.imageUrl,alt:"",loading:"lazy",decoding:"async"})}),o.jsxs("span",{className:"s-message-embed-copy",children:[s.siteName&&o.jsx("span",{className:"s-message-embed-site",children:s.siteName}),o.jsx("span",{className:"s-message-embed-title",children:s.title}),s.description&&o.jsx("span",{className:"s-message-embed-description",children:s.description})]})]})}function kr({message:s}){const i=s.attachments??[],d=new Set,h=[],u=[];for(const m of i){const I=ut(m);if(I&&gr(m)){d.add(m.id),h.push({id:m.id,src:Kt(I),alt:m.fileName??"Image attachment"});continue}const T=Tr(m);T&&(d.add(m.id),u.push(T))}const v=new Set(u.map(m=>m.url)),O=new Set(i.map(ut).filter(m=>!!m));for(const m of Sr(s.body))O.has(m)||v.has(m)||yr(m)&&h.push({id:m,src:Kt(m),alt:"Embedded image"});const f=i.filter(m=>!d.has(m.id));return h.length===0&&u.length===0&&f.length===0?null:o.jsxs("div",{className:"s-message-embeds",children:[h.map(m=>o.jsx(xr,{src:m.src,alt:m.alt},m.id)),u.slice(0,1).map(m=>o.jsx(vr,{preview:m},m.id)),f.map(m=>{const I=ut(m),T=I?Kt(I):null,p=m.fileName??V(m.metadata,"title")??m.mediaType;return T?o.jsxs("a",{className:"s-message-embed s-message-embed--file",href:T,target:"_blank",rel:"noreferrer",children:[o.jsx("span",{className:"s-message-embed-title",children:p}),o.jsx("span",{className:"s-message-embed-description",children:m.mediaType})]},m.id):o.jsxs("div",{className:"s-message-embed s-message-embed--file",children:[o.jsx("span",{className:"s-message-embed-title",children:p}),o.jsx("span",{className:"s-message-embed-description",children:m.mediaType})]},m.id)})]})}const zt=60;function dt(s,i,d){const h=d?.trim();if(!h)return;const u=h.toLowerCase();i.has(u)||(i.add(u),s.push(h))}function Cr(s){const i=[],d=new Set;dt(i,d,s.observeSessionId);for(const h of s.flight?.sessions??[])dt(i,d,h.sessionId);return dt(i,d,s.agent?.harnessSessionId),dt(i,d,s.sessionMeta?.harnessSessionId),i}function Os(s,i){const d=s.sessionId?.trim().toLowerCase();return d?i.some(h=>{const u=h.trim().toLowerCase();return u?d.includes(u)||u.includes(d):!1}):!1}function _s(s,i){return s.ts!==i.ts?s.ts-i.ts:s.id.localeCompare(i.id)}function qs(s,i){const d=new Map;for(const h of[...s,...i])d.set(h.id,h);return[...d.values()].sort(_s).slice(-zt)}function Mr(s){const i=or(s).sort(_s),d=ir(i.map(u=>({event:u,meta:lr(u)}))),h=[];for(const u of d){if(u.event.kind==="other")continue;if(u.event.kind==="tool-result"){const m=h.at(-1);m?.kind==="tool"&&(m.outcome=u.meta.result?.outcome??m.outcome??"done",m.ts=u.event.ts);continue}const v=Nr(u.event),O=Ir(u.event,cr(u.event,u.meta),v);if(!O&&v!=="think")continue;const f={id:u.event.id,ts:u.event.ts,kind:v,text:O,repeatCount:u.repeatCount};u.meta.tool&&(f.tool=u.meta.tool),u.meta.arg&&(f.arg=mt(u.meta.arg)),u.meta.result?.outcome&&(f.outcome=u.meta.result.outcome),h.push(f)}return h}const Ds=160;function mt(s){const i=s.replace(/\s+/gu," ").trim();return i.length>Ds?`${i.slice(0,Ds-1)}…`:i}const Ws=/^\[thinking\]\s*$/iu;function Nr(s){return Ws.test(s.summary.trim())?"think":dr(s)}function Ir(s,i,d){return d==="think"&&Ws.test(s.summary.trim())?"":mt(i)}const Ar=15e3;function jr(s){const i=s?.outcome;return typeof i=="string"&&i.trim()?i.trim():void 0}function Rr(s){const{observe:i,flight:d}=s;if(!i||!d)return[];const h=i.data.events.filter(f=>f.kind!=="boot"&&f.kind!=="system");if(h.length===0)return[];const u=Vt(d.startedAt),v=u!==null?h.filter(f=>typeof f.at=="number"&&f.at>=u-Ar):[];return(v.length>0?v:i.data.live?h:[]).slice(-zt).map(f=>{const m={id:`observe:${i.sessionId??"session"}:${f.id}`,ts:f.at??f.t,kind:f.kind,text:mt(f.text||f.tool||"step"),repeatCount:1};f.tool&&(m.tool=f.tool),f.arg&&(m.arg=mt(f.arg));const I=jr(f.result);return I&&(m.outcome=I),f.diff&&(m.outcome=`+${f.diff.add} −${f.diff.del}`),m})}function Er(s){const i=s.at(-1);return i?i.tool?i.arg?`${i.tool} · ${i.arg}`:i.tool:i.kind==="think"?i.text||"Thinking":i.text||null:null}function Lr(s){if(s.length===0)return null;const i=s.filter(u=>u.kind==="tool").length,d=s.filter(u=>u.kind==="think").length,h=[];return i>0&&h.push(`${i} tool${i===1?"":"s"}`),d>0&&h.push(`${d} thinking`),h.length===0?`${s.length} step${s.length===1?"":"s"}`:h.join(" · ")}function $r(s){const i=s.flight?.state;return i==="queued"?{label:"Queued",detail:"waiting for the session to come online"}:i==="waking"?{label:"Waking",detail:"starting the session"}:i==="running"||i==="waiting"?s.hasSessionScope?{label:"Session live",detail:"waiting for the first trace line"}:{label:"Session live",detail:"no trace stream for this session yet"}:s.awaitingResponse?{label:"Sent",detail:"waiting for the agent to pick this up"}:null}function Pr(s){const{sessionIds:i,active:d}=s,h=i.join("|"),u=d&&i.length>0,[v,O]=a.useState([]);return a.useEffect(()=>{O([])},[h]),a.useEffect(()=>{if(!u)return;let f=!1;const m=new URLSearchParams({limit:String(zt*3),transcripts:"true"});return K(`/api/tail/recent?${m.toString()}`).then(I=>{if(f)return;const T=(I.events??[]).filter(p=>Os(p,i));T.length!==0&&O(p=>qs(p,T))}).catch(()=>{}),()=>{f=!0}},[u,h]),ur(f=>{u&&Os(f,i)&&O(m=>qs(m,[f]))},u),a.useMemo(()=>u?Mr(v):[],[u,v])}const Fr=3500;function Bs(s){const i=s?.trim().replace(/^#/,"");if(!i?.startsWith("msg-"))return null;const d=i.slice(4).trim();if(!d)return null;try{return decodeURIComponent(d)}catch{return d}}const Or=64;function qr(s){const i=s?.clientMessageId;return typeof i=="string"&&i.trim()?i.trim():null}function Hs(s){const i=s.body.replace(/\s+/gu," ").trim();if(i)return i.length>180?`${i.slice(0,179).trimEnd()}…`:i;const d=s.attachments?.length??0;return d===1?"Attachment":d>1?`${d} attachments`:"Message"}function Us(s,i){const d=s.toLocaleLowerCase().indexOf(i.toLocaleLowerCase());if(d<0)return s;const h=s.slice(0,d),u=s.slice(d+i.length);return!h&&u.startsWith(" ")?u.slice(1):h.endsWith(" ")&&u.startsWith(" ")?`${h}${u.slice(1)}`:`${h}${u}`}function Dr(s){return s instanceof TypeError||typeof DOMException<"u"&&s instanceof DOMException&&s.name==="AbortError"}function ei({conversationId:s,initialDraft:i,navigate:d,embedded:h,showBackNav:u=!0,treatment:v="standard"}){const{agents:O,route:f,openContextCapture:m}=sa(),I=Ka(f),T=a.useMemo(()=>na(O,I),[O,I]),[p,ht]=a.useState(null),Gt=a.useRef(null);Gt.current=p;const Ue=a.useMemo(()=>it(s),[s]),[Ks,Qs]=a.useState(()=>Ue?{[s]:Ue}:{}),k=Ks[s]??Ue??[],[Vs,Jt]=a.useState(()=>Ue!==null),Te=a.useRef(null),zs=a.useMemo(()=>{const t=Te.current;return t===null?null:new Set(k.filter(e=>!t.has(e.id)).map(e=>e.id))},[k]),Xt=Te.current===null&&k.length>0;a.useEffect(()=>{if(k.length===0)return;const t=Te.current??new Set;for(const e of k)t.add(e.id);Te.current=t},[k]),a.useEffect(()=>{Te.current=null,Jt(it(s)!==null)},[s]);const Yt=!Vs&&k.length===0,z=a.useCallback(t=>{Qs(e=>{const n=e[s]??it(s)??[],r=typeof t=="function"?t(n):t,l=Qn(s,r);return{...e,[s]:l}})},[s]),Gs=Ht(s),[w,he]=a.useState(Gs),[xe,ve]=a.useState([]),[_e,pt]=a.useState(null),[We,ke]=a.useState(null),[Ke,Js]=a.useState(()=>typeof window>"u"?null:Bs(window.location.hash)),[Zt,pe]=a.useState(null),[fe,ft]=a.useState(!1),[Xs,Ce]=a.useState(!1),[gt,Qe]=a.useState(0),Ve=a.useRef(null),Me=a.useRef(null),es=a.useRef(null),Ne=a.useRef(!0),ze=a.useRef(!1),ge=a.useRef(null),L=a.useRef(null),Ie=a.useRef(new Set),Ae=a.useRef(null),ts=a.useRef(0),ss=a.useRef(null),je=a.useRef(null),se=a.useRef(s);se.current=s;const ne=a.useRef(new Map),Ys=Ms(s),Ge=a.useRef(!1);a.useLayoutEffect(()=>{const t=Me.current,e=Ve.current;!t||!e||(e.scrollTop=t.scrollTop+(e.scrollHeight-t.scrollHeight),Me.current=null,Ge.current=!0)}),a.useEffect(()=>{ft(!1),Me.current=null,Ge.current=!1,Ne.current=!0,ze.current=!1,Ce(!1),Qe(0),Lt(new Set),ne.current.clear(),he(Ht(s))},[s]);const x=p?.agentId??null,N=p?.kind==="direct",yt=a.useMemo(()=>new Set([s,...p?.equivalentConversationIds??[]]),[s,p?.equivalentConversationIds]),Q=a.useMemo(()=>x?T.find(t=>t.id===x)??null:null,[T,x]),ns=aa(p),Zs=ra({resolvedAgentId:Q?.id,sessionId:ns,machineId:I}),[as,rs]=a.useState(null);a.useEffect(()=>{K("/api/fleet").then(t=>{rs(e=>te(e,Is(t.activeAsks,s,x)))}).catch(()=>{})},[s,x]);const H=a.useCallback(async(t={})=>{const e=t.messageMode??"none",n=t.includeMetadata??!0;pe(null);try{const r=n?await K(`/api/session/${encodeURIComponent(s)}`).catch(()=>null):Gt.current;if(se.current!==s)return;ht(M=>te(M,r));const l=r?.agentId??null,c=r?.id&&r.id!==s?r.id:s;if(c!==s){d({view:"conversation",conversationId:c});return}const g=it(c),R=Vn(c),S=e==="initial"&&!R,y=e==="refresh"||e==="initial",[b,U,E]=await Promise.all([S?zn(c):y?Gn(c,{refresh:!0}):Promise.resolve(g),K(`/api/flights?conversationId=${encodeURIComponent(c)}`),K("/api/fleet?limit=24&activityLimit=160").catch(()=>oa())]);if(se.current!==s)return;const Z=be(b??[]),D=Z.filter(M=>!_t(M));b&&z(M=>te(M,ia(M,D))),Jt(!0),Va(c);const _=Z.at(-1);_&&je.current!==_.id&&(je.current=_.id,K(`/api/conversations/${encodeURIComponent(c)}/read-cursor`,{method:"POST",body:JSON.stringify({lastReadMessageId:_.id})}).catch(()=>{je.current===_.id&&(je.current=null)}));const W=la(U),B=Ht(c),ee=W??B;Ie.current=new Set([...U.map(M=>M.invocationId),...B?.invocationId?.startsWith("pending:")?[]:B?.invocationId?[B.invocationId]:[]]),W&&B?.id===W.id&&Ns(c,W.id);const rt=ee?.agentId??l??null,$=ca(E.activity,ee,c,rt),ot=da(E.activeAsks,ee,c,rt);he(M=>te(M,ee)),ve(M=>te(M,$)),ke(M=>te(M,ot)),rs(M=>te(M,Is(E.activeAsks,c,l)))}catch(r){if(se.current!==s)return;pe(r instanceof Error?r.message:String(r))}},[s,d,z]);a.useEffect(()=>{H({messageMode:"initial"})},[H]),a.useEffect(()=>{je.current=null},[s]),a.useEffect(()=>{Ae.current=w},[w]);const en=a.useCallback(async()=>{if(fe||!Ms(s))return;const t=Ve.current,e=t?{scrollHeight:t.scrollHeight,scrollTop:t.scrollTop}:null;ft(!0),pe(null);try{const n=await Jn(s);if(se.current!==s)return;e&&(Me.current=e),z(be(n).filter(r=>!_t(r)))}catch(n){se.current===s&&pe(n instanceof Error?n.message:String(n))}finally{se.current===s&&ft(!1)}},[s,fe,z]),[A,q]=a.useState(()=>i??""),[ae,re]=a.useState(null),[G,Je]=a.useState(!1),[C,tn]=a.useState("operator"),[oe,Re]=a.useState({open:!1,query:"",triggerStart:-1,index:0}),[ie,Ee]=a.useState({open:!1,query:"",triggerStart:-1,index:0}),[P,J]=a.useState(null),[wt,Xe]=a.useState(!1),[St,Ye]=a.useState(""),[sn,Le]=a.useState(null),[nn,bt]=a.useState(!1);a.useEffect(()=>{Xe(!1),Ye(""),Le(null),bt(!1)},[s]),a.useEffect(()=>{if(!i)return;const t=`${s}:${i}`;ss.current!==t&&(ss.current=t,q(i),requestAnimationFrame(()=>L.current?.focus()))},[s,i]);const le=a.useMemo(()=>{const t=new Map;for(const e of p?.participants??[])t.set(e.actorId,e),e.agentId&&t.set(e.agentId,e);return t},[p]),Tt=a.useMemo(()=>{const t=new Set,e=[];for(const n of p?.participantIds??[]){if(n==="operator")continue;const r=le.get(n),l=r?.scopedAlias?.trim().replace(/^@+/,"");if(!l)continue;const c=l.toLowerCase();t.has(c)||(t.add(c),e.push({id:n,label:r?.label??r?.displayName??l,name:r?.displayName??l,handle:l}))}for(const n of T){const r=n.handle?.trim().replace(/^@+/,"")??As(n.id)??n.id;if(!r)continue;const l=r.toLowerCase();t.has(l)||(t.add(l),e.push({id:n.id,label:r,name:n.name??r,handle:r}))}return e.sort((n,r)=>n.handle.localeCompare(r.handle))},[le,T,p]),an=a.useMemo(()=>{if(!oe.open)return[];const t=oe.query.toLowerCase();return t?js.filter(e=>e.command.toLowerCase().startsWith("/"+t)||e.command.toLowerCase().includes(t)):js},[oe.open,oe.query]),rn=a.useMemo(()=>{if(!ie.open)return[];const t=ie.query.toLowerCase();return t?Tt.filter(e=>e.handle.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)).slice(0,8):Tt.slice(0,8)},[ie.open,ie.query,Tt]),on=a.useCallback(()=>{Re(t=>t.open?{...t,open:!1}:t),Ee(t=>t.open?{...t,open:!1}:t)},[]),ln=a.useCallback((t,e)=>{const n=ua(t,e);Re(n?l=>({open:!0,query:n.query,triggerStart:n.start,index:l.open&&l.triggerStart===n.start?l.index:0}):l=>l.open?{...l,open:!1}:l);const r=ma(t,e);Ee(r?l=>({open:!0,query:r.query,triggerStart:r.start,index:l.open&&l.triggerStart===r.start?l.index:0}):l=>l.open?{...l,open:!1}:l)},[]),cn=a.useCallback(t=>{const e=L.current,n=oe.triggerStart;if(n<0)return;const r=e?.selectionStart??A.length,l=A.slice(0,n),c=A.slice(r),g=t.insert,R=`${l}${g}${c}`;q(R),Re(S=>({...S,open:!1})),requestAnimationFrame(()=>{const S=L.current;if(!S)return;const y=l.length+g.length;S.focus(),S.setSelectionRange(y,y)})},[A,oe.triggerStart]),dn=a.useCallback(t=>{const e=L.current,n=ie.triggerStart;if(n<0)return;const r=e?.selectionStart??A.length,l=A.slice(0,n),c=A.slice(r),g=c.length===0||!c.startsWith(" "),R=`@${t.handle}${g?" ":""}`,S=`${l}${R}${c}`;q(S),Ee(y=>({...y,open:!1})),requestAnimationFrame(()=>{const y=L.current;if(!y)return;const b=l.length+R.length;y.focus(),y.setSelectionRange(b,b)})},[A,ie.triggerStart]);a.useEffect(()=>{const t=L.current;if(!t)return;t.style.height="0px";const e=Math.min(Math.max(t.scrollHeight,40),160);t.style.height=`${e}px`,t.style.overflowY=t.scrollHeight>e?"auto":"hidden"},[A]),a.useEffect(()=>{K("/api/user").then(t=>tn(t.name)).catch(()=>{})},[]);const Ze=a.useMemo(()=>ha(k,C),[k,C]);a.useEffect(()=>{P===null||Ze===null||Ze>=P&&J(null)},[P,Ze]);const un=a.useMemo(()=>pa(w),[w]),ye=Date.now(),mn=fa(w,Ze,ye),xt=un&&!ga(w)&&!mn,os=N&&(G||P!==null||xt),is=N&&ya({sending:G,awaitingResponse:P!==null,currentFlight:w}),F=wa({name:Q?.name,agentName:p?.agentName,id:x,title:p?.title}),j=a.useMemo(()=>N?Sa({agentName:F,agentState:Q?.state??null,sending:G,currentFlight:w,showWorkingTurn:xt,awaitingResponse:P!==null}):{label:"Open",detail:"",tone:"idle",showStrip:!1,showTyping:!1},[Q?.state,F,P,w,ye,N,G,xt]),vt=w?.startedAt??We?.startedAt??P,kt=Vt(vt),ls=Da(vt,ye),[,hn]=a.useState(0);a.useEffect(()=>{if(!j.showTyping||kt===null)return;const t=Math.max(0,Date.now()-kt),e=[$s.sustained,$s.long].find(r=>r>t);if(e===void 0)return;const n=window.setTimeout(()=>hn(r=>r+1),e-t+50);return()=>window.clearTimeout(n)},[kt,j.showTyping,ls]);const pn="Live",Ct=a.useMemo(()=>ba({currentFlight:w,presence:j,turnActivity:xe,turnAsk:We,awaitingResponseSince:P,nowMs:ye}),[P,w,ye,j,xe,We]),fn="s-thread-msg-card s-thread-msg-working-card s-thread-msg-card--avatar-row",gn="s-thread-msg-kind",yn="s-thread-turn-snapshot",wn="s-thread-turn-snapshot-pulse",Sn="s-thread-presence-line",bn=["s-thread-presence-strip",`s-thread-presence-strip--${ls}`].filter(Boolean).join(" "),Mt=p?Ta(p):F,cs=p?.id??s,Tn=p?.alias?.trim()||null,et=xa(p?.workspaceRoot),xn=j.tone,Nt=k.length===0&&N&&(j.showTyping||w!==null||xe.length>0||We!==null||P!==null),ds=a.useMemo(()=>p?p.participantIds.includes("operator"):N,[N,p]),$e=w?.agentId??x,Pe=$e?Rs(T,[$e]):null,Fe=Pe?.id??$e,Oe=w?.sessions.at(-1)?.sessionId??Pe?.harnessSessionId??void 0,us=w?.id?()=>{ct(d,{view:"sessions",flightId:w.id,...Fe?{agentId:Fe}:{},...Oe?{sessionId:Oe}:{},...I?{machineId:I}:{}},{returnTo:f})}:void 0,ms=w?.id??null;a.useEffect(()=>{if(!ms||!Fe){pt(null);return}let t=!1;const e=Oe?`?sessionId=${encodeURIComponent(Oe)}`:"",n=async()=>{try{const l=await K(`/api/agents/${encodeURIComponent(Fe)}/observe${e}`);if(t)return;pt(c=>te(c,l))}catch{}};n();const r=window.setInterval(()=>{n()},Fr);return()=>{t=!0,window.clearInterval(r),pt(null)}},[ms,Fe,Oe]);const It=a.useMemo(()=>Cr({flight:w,agent:Pe??Q,sessionMeta:p,observeSessionId:_e?.sessionId}),[Q,w,p,_e?.sessionId,Pe]),hs=Pr({sessionIds:It,active:j.showTyping||Nt}),vn=a.useMemo(()=>Rr({observe:_e,flight:w}),[w,_e]),X=hs.length>0?hs:vn,At=a.useMemo(()=>X.length>0?null:$r({flight:w,hasSessionScope:It.length>0,awaitingResponse:P!==null}),[P,w,It.length,X.length]),jt=Lr(X),Rt=Er(X),ps=X.at(-1)??null,Et=ps?Ut(ps.ts,ye):null,ce=a.useMemo(()=>Rt?{...Ct,latest:Rt,...jt?{activityLabel:jt}:{},...Et?{lastActivityLabel:Et}:{}}:Ct,[Et,Rt,Ct,jt]),kn=`${F}: ${ce.latest}`,fs=$e&&va(Pe)?()=>{ct(d,{view:"terminal",agentId:$e,mode:"takeover"},{returnTo:f})}:void 0,gs=N?()=>{h&&Qa({type:"focus-composer",reason:"Steer the active conversation"})||requestAnimationFrame(()=>{L.current?.focus({preventScroll:!0}),L.current?.scrollIntoView({block:"nearest"})})}:void 0,ys=a.useMemo(()=>(p?p.participantIds.filter(e=>e!=="operator"):x?[x]:[]).map(e=>{const n=Rs(T,[e]),r=le.get(e);return{id:e,name:r?.scopedAlias??n?.name??r?.displayName??As(e)??e,title:r?.label??n?.id??e,agent:n,sessionId:r?.sessionId??null,harness:n?.harness??r?.harness??null,model:n?.model??null,reasoningEffort:n?.reasoningEffort??null}}),[x,le,T,p]),ws=ys.slice(0,4),Cn=Math.max(ys.length-ws.length,0),Mn=a.useMemo(()=>({name:C,active:ds}),[ds,C]),tt=a.useMemo(()=>new Map(k.map(t=>[t.id,t])),[k]),st=a.useMemo(()=>ka(k),[k]),[Nn,Lt]=a.useState(()=>new Set),In=a.useCallback(t=>{Lt(e=>{const n=new Set(e);return n.delete(t)||n.add(t),n})},[]),Ss=a.useMemo(()=>{const t=new Map;for(const e of st)if(e.kind==="fanout")for(const n of e.messages)t.set(n.id,e.key);return t},[st]),nt=a.useCallback(t=>{const e=Ss.get(t);e&&Lt(c=>c.has(e)?c:new Set(c).add(e));const n=document.getElementById(`msg-${t}`);if(!n)return;const r=n.closest(".s-thread-fanout")??n,l=r===n?"s-thread-msg--flash":"s-thread-fanout--flash";r.scrollIntoView({behavior:"smooth",block:"center"}),r.classList.add(l),window.setTimeout(()=>r.classList.remove(l),1200)},[Ss]);a.useEffect(()=>{const t=()=>Js(Bs(window.location.hash));return window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t)},[]),a.useEffect(()=>{if(!Ke||!tt.has(Ke))return;const t=window.setTimeout(()=>nt(Ke),50);return()=>window.clearTimeout(t)},[Ke,tt,nt]),_a(a.useCallback(t=>{if(t.kind==="message.posted"){const e=t.payload?.message;if(!e||!yt.has(e.conversationId))return;const n=e.actorId==="operator",r=N&&!n&&e.class==="agent",l={id:e.id,conversationId:e.conversationId,actorId:e.actorId,actorName:r?F:Ca(e.actorId,T,C),body:e.body,createdAt:e.createdAt,class:n?"operator":e.class,attachments:e.attachments,metadata:e.metadata,replyToMessageId:e.replyToMessageId??e.n??null};if(_t(l))return;if(z(c=>{const g=qr(e.metadata),R=g?ne.current.get(g):void 0;if(c.some(S=>S.id===e.id))return g&&ne.current.delete(g),c;if(n&&g){const S=Ma(c,g,R);if(S!==-1){const y=[...c];return y[S]=l,ne.current.delete(g),be(y)}}return be([...c,l])}),r){const c=Vt(e.createdAt)??Date.now();J(g=>g===null||c<g||Na(Ae.current)?g:null),he(g=>Ia(g)?null:g)}return}if(t.kind==="invocation.requested"){const e=t.payload?.invocation;if(!e||e.targetAgentId!==x||!e.conversationId||!yt.has(e.conversationId))return;Ie.current.add(e.id),ve([]),ke(null),J(n=>n??Date.now());return}if(t.kind==="flight.updated"){const e=t.payload?.flight;if(!e||e.targetAgentId!==x||!(Ie.current.has(e.invocationId)||Ae.current?.id===e.id))return;if(Aa.has(e.state)){Ns(s,e.id),he(c=>c?.id===e.id?null:c),ve([]),ke(null),J(null),H({messageMode:"refresh",includeMetadata:!1});return}Ie.current.add(e.invocationId);const r=Ae.current?.id===e.id,l=Es(e,s,x??"",Ae.current);ja(l)&&J(null),he(l),r||(ve([]),ke(null));return}t.kind!=="agent.endpoint.upserted"&&t.kind==="unknown"&&H({messageMode:"refresh"})},[x,F,s,yt,N,H,C,T])),a.useEffect(()=>{if(!os)return;const t=setInterval(()=>{H({messageMode:"refresh",includeMetadata:!1})},5e3);return()=>clearInterval(t)},[os,H]),a.useEffect(()=>{const t=()=>{if(document.visibilityState!=="visible")return;const e=Date.now();e-ts.current<1e3||(ts.current=e,H({messageMode:"refresh"}))};return window.addEventListener("focus",t),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",t)}},[H]);const $t=a.useRef(null),bs=a.useRef(!1),Pt=a.useRef(!1),Ft=a.useCallback(t=>{const e=es.current;e&&(ze.current=!0,ge.current!==null&&clearTimeout(ge.current),e.scrollIntoView({behavior:t}),ge.current=setTimeout(()=>{ze.current=!1,ge.current=null},t==="smooth"?700:0))},[]);a.useEffect(()=>()=>{ge.current!==null&&clearTimeout(ge.current)},[]);const An=a.useCallback(()=>{const t=Ve.current;if(!t||ze.current)return;const n=t.scrollHeight-t.clientHeight-t.scrollTop<=Or;Ne.current=n,n?(Ce(!1),Qe(0)):Ce(!0)},[]),jn=a.useCallback(()=>{Ne.current=!0,Ce(!1),Qe(0),Ft("smooth")},[Ft]);a.useEffect(()=>{const t=k.at(-1)?.id??null,e=!!(t&&t!==$t.current),n=Ra({newestMessageId:t,previousNewestMessageId:$t.current,showTyping:j.showTyping,previousShowTyping:bs.current,historyRestorePending:Ge.current||Me.current!==null,initialScrollDone:Pt.current,nearBottom:Ne.current});n!=="none"?(Ft(n),Pt.current=!0):e&&Pt.current&&!Ne.current&&(Ce(!0),Qe(r=>r+1)),Ge.current=!1,$t.current=t,bs.current=j.showTyping});const[,Rn]=a.useState(0);a.useEffect(()=>{const t=setInterval(()=>Rn(e=>e+1),15e3);return()=>clearInterval(t)},[]);const de=ea(),[ue,Y]=a.useState([]),[Ts,at]=a.useState("queue"),[we,Se]=a.useState(null),qe=async(t,e)=>{const n=t.trim(),r=e?.attachments??[],l=e?.replyTarget??null;if(!n&&r.length===0||G)return"failed";const g=e?.forceAction??Ps({isDm:N,hasOutstandingReply:is}),R=Date.now(),S=Yn(),y={id:`optimistic-${S}`,conversationId:s,actorId:"operator",actorName:C,body:n,createdAt:R,class:"operator",...l?{replyToMessageId:l.messageId}:{},metadata:{clientMessageId:S,deliveryState:"sending"},...r.length>0?{attachments:r}:{}};Je(!0),g!=="message"&&J(R),pe(null),ne.current.set(S,y.id),z(b=>be([...b,y]));try{const b=await K(`/api/chats/${encodeURIComponent(s)}/messages`,{method:"POST",body:JSON.stringify({body:n,clientMessageId:S,...l?{replyToMessageId:l.messageId}:{},...r.length>0?{attachments:r}:{}})}),U=b.chatId?.trim()??b.conversationId?.trim();if(U&&U!==s)throw new Error(`Send returned a different Chat (${U}) instead of appending to ${s}.`);if(b.messageId?.trim()){const E=b.messageId.trim();z(Z=>be(Z.map(D=>D.id===y.id?{...D,id:E,metadata:{clientMessageId:S}}:D))),ne.current.delete(S)}return b.flight?(Ie.current.add(b.flight.invocationId),he(Es(b.flight,s,x??"")),ve([]),ke(null)):g!=="message"&&J(null),"sent"}catch(b){return Dr(b)?(z(U=>U.map(E=>E.id===y.id?{...E,metadata:{...E.metadata??{},deliveryState:"unknown"}}:E)),"unknown"):(z(U=>U.filter(E=>E.id!==y.id)),ne.current.delete(S),J(null),pe(b instanceof Error?b.message:String(b)),"failed")}finally{Je(!1)}},En=async()=>{const t=A.trim(),e=ae,n=de.files,r=we?.attachments??[];if(!t&&n.length===0&&r.length===0)return null;let l=[];if(n.length>0){Je(!0);try{l=await Zn(n)}catch(c){return de.setError(c instanceof Error?c.message:String(c)),null}finally{Je(!1)}}return q(""),re(null),de.clear(),Se(null),{body:t,attachments:[...r,...l],replyTarget:e}},Ln=async()=>{const t=Ha({isAgentBusy:me,intent:Ts}),e=we?.id??null,n=await En();if(!n)return;if(t==="queue"){Y(c=>e?c.map(g=>g.id===e?{...g,body:n.body,attachments:n.attachments,replyTarget:n.replyTarget}:g):[...c,{id:`queued-${Date.now()}-${c.length}`,body:n.body,attachments:n.attachments,replyTarget:n.replyTarget,queuedAt:Date.now()}]);return}e&&Y(c=>c.filter(g=>g.id!==e));const r=()=>{q(n.body),Se(n.attachments.length>0?{id:null,attachments:n.attachments}:null),re(n.replyTarget),requestAnimationFrame(()=>L.current?.focus())};if(t==="steer"){at("queue"),await Dt(),await qe(n.body,{forceAction:"steer",attachments:n.attachments,replyTarget:n.replyTarget})==="failed"&&r();return}await qe(n.body,{attachments:n.attachments,replyTarget:n.replyTarget})==="failed"&&r()},$n=t=>{Y(e=>e.filter(n=>n.id!==t)),Se(e=>e?.id===t?null:e)},Pn=t=>{const e=ue.find(n=>n.id===t);e&&(q(e.body),re(e.replyTarget??null),Se({id:t,attachments:e.attachments}),requestAnimationFrame(()=>{const n=L.current;n&&(n.focus(),n.setSelectionRange(n.value.length,n.value.length))}))},Fn=()=>{Se(null),q(""),re(null),de.clear()},On=async t=>{const e=ue.find(r=>r.id===t);if(!e)return;Y(r=>r.filter(l=>l.id!==t)),await Dt(),await qe(e.body,{forceAction:"steer",attachments:e.attachments,replyTarget:e.replyTarget??null})==="failed"&&Y(r=>[e,...r])},Ot=a.useCallback((t,e)=>{const n=e?.trim().replace(/^@+/,"")||null,r=n?`@${n}`:null,l=ae?.insertedMention?Us(A,ae.insertedMention):A,c=!!(!N&&r&&!l.toLocaleLowerCase().includes(r.toLocaleLowerCase())),g=c&&r?l.trim()?`${l.trimEnd()} ${r} `:`${r} `:l;q(g),re({messageId:t.id,actorLabel:n?`@${n}`:t.actorName,preview:Hs(t),insertedMention:c?r:null}),requestAnimationFrame(()=>L.current?.focus())},[A,N,ae?.insertedMention]),qn=a.useCallback(()=>{const t=ae?.insertedMention;re(null),t&&q(e=>Us(e,t)),requestAnimationFrame(()=>L.current?.focus())},[ae]),qt=a.useCallback(t=>{const e=new URL(window.location.href);f.view==="agents-v2"&&e.searchParams.set("tab","message"),e.hash=`msg-${t}`,Be(e.toString())},[f.view]),xs=a.useCallback((t,e,n)=>{const r=Xn({conversationId:s,selectedMessageId:t.id,messages:k.map(l=>({id:l.id,actorLabel:l.id===t.id?e:lt(l,C)?C:l.actorName,body:l.body,attachmentCount:l.attachments?.length??0}))});m({intent:"forward-message",forwardContext:r,forwardContextMode:"selected-message",...n?{projectPath:n}:{}})},[s,k,m,C]),Dt=async()=>{if(x)try{await K("/api/agents/"+encodeURIComponent(x)+"/interrupt",{method:"POST",body:JSON.stringify({})})}catch{}},me=j.tone==="working"||j.tone==="pending",Dn=Ps({isDm:N,hasOutstandingReply:is}),Bn=N?`Message ${F} — type / to route or @ to mention an agent`:p?.kind==="channel"?`Comment in #${Ea(p)} — mention @agent to request a reply`:`Comment in ${Mt} — mention @agent to request a reply`,vs=we?.attachments??[],Hn=!A.trim()&&!de.hasFiles&&vs.length===0&&me,Bt=a.useRef(!1);a.useEffect(()=>{const t=we?.id??null,e=t?ue.filter(r=>r.id!==t):ue;if(!La({isAgentBusy:me,sending:G,queued:e})||Bt.current)return;const n=e[0];n&&(Bt.current=!0,Y(r=>r.filter(l=>l.id!==n.id)),qe(n.body,{attachments:n.attachments,replyTarget:n.replyTarget??null}).then(r=>{r==="failed"&&Y(l=>[n,...l])}).finally(()=>{Bt.current=!1}))},[me,G,ue,we]),a.useEffect(()=>{me||at("queue")},[me]),a.useEffect(()=>{Y([]),Se(null),re(null),at("queue"),de.clear()},[s]);const Un=$a(ue),ks=za(),_n=a.useCallback((t,e)=>{const n=window.getSelection()?.toString().trim(),r=lt(e,C),l=e.actorId?le.get(e.actorId):null,c=r?null:Ls(e,T,x),g=(l?.scopedAlias?.trim()||c?.handle?.trim()||null)?.replace(/^@+/,"")??null,R=g?`@${g}`:e.actorName,S=(c?.id||l?.agentId||e.actorId||"").trim(),y=[];r||y.push({kind:"action",label:"Reply",onSelect:()=>Ot(e,g)}),y.push({kind:"action",label:"Forward to new task…",onSelect:()=>xs(e,R,l?.workspaceRoot??c?.projectRoot??c?.cwd??void 0)}),y.push({kind:"separator"}),n&&y.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{Be(n)}}),y.push({kind:"action",label:"Copy Message",onSelect:()=>{Be(e.body)}}),y.push({kind:"action",label:"Copy Link",onSelect:()=>qt(e.id)}),y.push({kind:"separator"}),!r&&S&&y.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{Be(S)}}),y.push({kind:"action",label:"Copy Message ID",onSelect:()=>{Be(e.id)}}),ks(t,y)},[x,Ot,qt,xs,C,le,T,ks]),Wn=async(t,e)=>{const n=`@${e.agentId} `,r=A.trim();if(r){q(""),await qe(`${n}${r}`,{forceAction:"invoke"});return}q(n),L.current?.focus()},De=a.useMemo(()=>{if(!p)return[];const t=new Set(p.participantIds);return T.filter(e=>!t.has(e.id)&&!e.retiredFromFleet).sort((e,n)=>e.name.localeCompare(n.name))},[p,T]);a.useEffect(()=>{wt&&Ye(t=>t&&De.some(e=>e.id===t)?t:De[0]?.id??"")},[wt,De]);const Cs=!!(p&&["direct","group_direct","channel"].includes(p.kind)&&De.length>0),Kn=a.useCallback(async()=>{if(!p)return;const t=St.trim();if(t){bt(!0),Le(null);try{const e=await K(`/api/conversations/${encodeURIComponent(p.id)}/members`,{method:"POST",body:JSON.stringify({actorId:t})});e.session?ht(e.session):ht(n=>n&&{...n,kind:e.kind,participantIds:e.participantIds}),Xe(!1),Ye(""),await H({messageMode:"none"})}catch(e){Le(e instanceof Error?e.message:String(e))}finally{bt(!1)}}},[St,H,p]);return o.jsx("div",{className:`s-thread-layout${h?" s-thread-layout--embedded":""}`,"data-thread-treatment":v==="standard"?void 0:v,children:o.jsxs("div",{className:"s-thread-center",children:[!h&&o.jsx(Ja,{showBackNav:u,isDm:N,navigate:d,route:f,canonicalConversationId:cs,threadTitle:Mt,agentId:Q?.id??null,sessionId:ns,detailRoute:Zs,visibleParticipants:ws,hiddenParticipantCount:Cn,operator:Mn,canAddParticipants:Cs,onToggleAddParticipant:()=>{Le(null),Xe(t=>!t)}}),!h&&p&&o.jsx(Xa,{canonicalConversationId:cs,conversationAlias:Tn}),!h&&wt&&Cs&&o.jsx(Ya,{agents:De,addParticipantId:St,setAddParticipantId:Ye,addingParticipant:nn,addParticipantError:sn,onCancel:()=>{Xe(!1),Le(null)},onSubmit:()=>{Kn()}}),as&&o.jsx(mr,{pinnedAsk:as,onAnswer:()=>{L.current?.focus()}}),o.jsx(hr,{presence:j,agent:Q}),Zt&&o.jsx("p",{className:"s-thread-error",children:Zt}),o.jsxs("div",{className:"s-thread-feed",ref:Ve,onScroll:An,children:[!Yt&&k.length>0&&Ys&&o.jsx("div",{className:"s-thread-history-control",children:o.jsxs("button",{type:"button",className:"s-thread-history-button",disabled:fe,"aria-busy":fe,onClick:()=>{en()},children:[fe&&o.jsx("span",{className:"s-thread-history-spinner","aria-hidden":"true"}),fe?"Loading earlier messages…":"Load earlier messages"]})}),Yt?o.jsx(tr,{}):k.length===0?Nt?o.jsx(sr,{agentName:F,title:j.label,detail:j.detail||ce.latest,snapshot:ce,events:xe,steps:X,phase:At,tone:xn,workspaceName:et,branch:p?.currentBranch,startedAt:vt,onOpenTrace:us,onOpenTerminal:fs,onSteer:gs}):o.jsxs("div",{className:"s-thread-empty",children:[o.jsx("div",{className:"s-thread-empty-glyph","aria-hidden":"true",children:N?"@":"#"}),o.jsx("p",{children:Mt}),o.jsx("p",{children:N?"No messages yet. Send a message to start working with this agent.":"No messages yet. Start the conversation below."}),(et||p?.currentBranch)&&o.jsxs("div",{className:"s-thread-empty-chips",children:[et&&o.jsx("span",{className:"s-thread-empty-chip",children:et}),p?.currentBranch&&o.jsx("span",{className:"s-thread-empty-chip",children:p.currentBranch})]})]}):st.map((t,e)=>{const n=Pa(t,e);if(t.kind==="fanout")return o.jsx(Za,{row:t,expanded:Nn.has(t.key),showDayDivider:n,onToggle:()=>In(t.key)},t.key);const r=t.message,l=lt(r,C),c=Fa(r),g=c?"scout.dispatch":r.class,R=Ba(g),S=g==="status",y=Fs(r.createdAt),b=l?null:Ls(r,T,x),E=le.get(r.actorId)?.scopedAlias?.trim()||null,Z=!l&&E?E:r.actorName,D=l?C.toLowerCase():E??b?.handle??null,_=Oa(r.body),W=_?qa({flightId:_.flightId,replyToMessageId:r.replyToMessageId,messagesById:tt,agents:T,operatorName:C}):null,B=!_&&r.replyToMessageId?tt.get(r.replyToMessageId)??null:null,ee=B?lt(B,C)?C:B.actorName:null,rt=_?_.body:r.body;return o.jsxs("div",{className:["s-thread-feed-block",l&&"s-thread-feed-block--you",n&&"s-thread-feed-block--full-width"].filter(Boolean).join(" "),children:[n&&o.jsx(er,{at:r.createdAt}),o.jsx("article",{id:`msg-${r.id}`,className:["s-thread-msg",l&&"s-thread-msg--you",S&&"s-thread-msg--tool",(Xt||zs?.has(r.id))&&"s-thread-msg--enter"].filter(Boolean).join(" "),style:Xt?{animationDelay:`${Math.max(0,7-(st.length-1-e))*26}ms`}:void 0,"data-class":g,onContextMenu:$=>_n($,r),children:o.jsx("div",{className:"s-thread-msg-card",children:o.jsxs("div",{className:"s-thread-msg-card-content",children:[o.jsxs("div",{className:"s-thread-msg-header",children:[o.jsxs("div",{className:"s-thread-msg-meta",children:[(()=>{const $=!l&&b?()=>ct(d,{view:"agents-v2",agentId:b.id},{returnTo:f}):null,ot=l?C:Z??"?",M=o.jsx(Wt,{agent:b??void 0,name:ot,placement:"turn",className:"s-thread-msg-avatar",title:ot});return $?o.jsx("button",{type:"button",className:"s-thread-msg-avatar--nav",onClick:$,"aria-label":`View profile for ${r.actorName??"agent"}`,title:`View profile for ${r.actorName??"agent"}`,children:M}):M})(),!l&&b?o.jsx("button",{type:"button",className:"s-thread-msg-actor s-thread-msg-actor--nav",onClick:()=>ct(d,{view:"agents-v2",agentId:b.id},{returnTo:f}),title:`View profile for ${r.actorName}`,children:Z}):o.jsx("span",{className:"s-thread-msg-actor",children:l?C:Z}),D&&o.jsxs("span",{className:"s-thread-msg-handle",children:["@",D]}),R&&o.jsx("span",{className:"s-thread-msg-kind",children:R})]}),o.jsx("span",{className:"s-thread-msg-time",title:y,children:Ut(r.createdAt)}),o.jsxs("span",{className:"s-thread-msg-actions",children:[!l&&D&&o.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":`Reply to @${D}`,title:`Reply to @${D}`,onClick:()=>Ot(r,D),children:o.jsx(Qt,{})}),o.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":"Copy link to message",title:"Copy link to message",onClick:()=>qt(r.id),children:o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M6.5 9.5a2.5 2.5 0 0 0 3.54 0l2.12-2.12a2.5 2.5 0 0 0-3.54-3.54l-.7.7"}),o.jsx("path",{d:"M9.5 6.5a2.5 2.5 0 0 0-3.54 0L3.84 8.62a2.5 2.5 0 0 0 3.54 3.54l.7-.7"})]})})]})]}),W&&o.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open the originating request${W.flightId?` · ${W.flightId}`:""}`,onClick:()=>nt(W.originatingMessageId),children:[o.jsx(Qt,{}),o.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),o.jsx("span",{className:"s-thread-reply-ctx-title",children:W.title}),o.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",W.from]}),o.jsx("span",{className:"s-thread-reply-ctx-status",children:"· done"})]}),B&&ee&&o.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open message from ${ee}`,onClick:()=>nt(B.id),children:[o.jsx(Qt,{}),o.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),o.jsx("span",{className:"s-thread-reply-ctx-title",children:Hs(B)}),o.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",ee]})]}),o.jsx("div",{className:"s-thread-msg-body",title:y,children:o.jsx(Wa,{text:rt})}),o.jsx(kr,{message:r}),c&&c.candidates.length>0&&o.jsx("div",{className:"s-thread-dispatch",children:c.candidates.map($=>o.jsxs("button",{type:"button",className:"s-thread-dispatch-tile",onClick:()=>{Wn(c,$)},children:[o.jsxs("span",{className:"s-thread-dispatch-tile-id",children:["@",$.agentId]}),o.jsx("span",{className:"s-thread-dispatch-tile-state",children:$.endpointState}),o.jsx("span",{className:"s-thread-dispatch-tile-meta",children:[$.workspace,$.node,$.projectRoot].filter(Boolean).join(" · ")||$.displayName})]},$.agentId))})]})})})]},r.id)}),j.showTyping&&!Nt&&o.jsx("div",{className:"s-thread-feed-block",children:o.jsx("div",{className:"s-thread-msg","aria-live":"polite",children:o.jsxs("div",{className:fn,children:[o.jsx(Wt,{agent:Q??void 0,name:F,placement:"turn",className:"s-thread-msg-avatar s-thread-msg-avatar--working",title:F}),o.jsxs("div",{className:"s-thread-msg-card-content",children:[o.jsxs("div",{className:"s-thread-msg-header",children:[o.jsxs("div",{className:"s-thread-msg-meta",children:[o.jsx("span",{className:"s-thread-msg-actor",children:F}),o.jsx("span",{className:gn,children:pn})]}),o.jsx("span",{className:"s-thread-msg-time",title:w?.startedAt?Fs(w.startedAt):"now",children:w?.startedAt?Ut(w.startedAt):"now"})]}),o.jsxs("div",{className:"s-thread-msg-working-body",children:[o.jsxs("div",{className:yn,children:[o.jsx("span",{className:wn,"aria-hidden":"true"}),o.jsxs("div",{className:"s-thread-turn-snapshot-main",children:[o.jsx("span",{className:"s-thread-turn-snapshot-label",children:"Latest"}),o.jsx("span",{className:"s-thread-msg-working-copy",children:ce.latest})]})]}),o.jsxs("dl",{className:"s-thread-turn-snapshot-stats",children:[o.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[o.jsx("dt",{children:"Activity"}),o.jsx("dd",{children:ce.activityLabel})]}),o.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[o.jsx("dt",{children:"Elapsed"}),o.jsx("dd",{children:ce.elapsedLabel})]}),o.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[o.jsx("dt",{children:"Last"}),o.jsx("dd",{children:ce.lastActivityLabel})]})]}),X.length>0||At?o.jsx(nr,{steps:X,phase:At,limit:5,compact:!0}):o.jsx(ar,{events:xe,limit:4,compact:!0}),o.jsx(rr,{onOpenTrace:us,onOpenTerminal:fs,onSteer:gs,compact:!0})]})]})]})})}),Xs&>>0&&o.jsxs("button",{type:"button",className:"s-thread-new-messages",onClick:jn,children:[o.jsx("span",{"aria-hidden":"true",children:"↓"})," ",gt," new ",gt===1?"message":"messages"," · jump to latest"]}),o.jsx("div",{ref:es})]}),j.showTyping&&o.jsxs("div",{className:Sn,children:[o.jsx("div",{className:"s-thread-presence-line-avatars",children:o.jsx(Wt,{agent:Q??void 0,name:F,placement:"turn",className:"s-thread-presence-line-avatar",title:F})}),o.jsx("span",{className:"s-thread-presence-line-label",children:kn}),o.jsx("div",{className:bn,"aria-hidden":"true"})]}),o.jsx(ta,{composeRef:L,draft:A,setDraft:q,composePlaceholder:Bn,slashState:oe,setSlashState:Re,filteredSlashCommands:an,applySlashCommand:cn,mentionState:ie,setMentionState:Ee,filteredMentions:rn,applyMention:dn,updateTriggersFromDraft:ln,closeSuggestions:on,replyTarget:ae,onCancelReply:qn,isStopMode:Hn,sending:G,composeAction:Dn,onSend:()=>{Ln()},onInterrupt:()=>{Dt()},attachments:de,isAgentBusy:me,busyIntent:Ts,onBusyIntentChange:at,queued:ue,queueNote:Un,onEditQueued:Pn,editingQueuedId:we?.id??null,editingAttachmentCount:vs.length,onCancelEdit:Fn,onUnqueue:$n,onSendQueuedNow:t=>{On(t)}})]})})}function Qt(){return o.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("polyline",{points:"9 14 4 9 9 4"}),o.jsx("path",{d:"M20 20v-7a4 4 0 0 0-4-4H4"})]})}const ti=Ga({id:"thread",label:"Thread",route:{view:"conversation",conversationId:""},webPath:"/chat",screen:"ConversationScreen",embed:{path:"/embed/thread",profile:"macos.thread",rootClassName:"s-thread-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:Ua}});export{ei as ConversationScreen,ti as scoutSurface};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as s}from"./index-CzVeWScw.js";import{a as k}from"./api-h5zurxmi.js";import{u as R}from"./sse-QcU9bikk.js";import{d as $,t as F}from"./time-Dhsh_2EG.js";import{SessionRefScreen as j}from"./SessionRefScreen-Dk-O4OVt.js";/* empty css */import{c as E}from"./createLucideIcon-ClCdc3F9.js";import{X as A}from"./x-D4X_y1j_.js";import"./index-BWHgHrtv.js";import"./tail-events-C6K7bCWB.js";import"./BackToPicker-DZg_4nHL.js";import"./router-B-K15T7B.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-C3qU8tnY.js";import"./ConversationScreen-C-PrCRz1.js";import"./NewChatComposer-DXDxV2Mh.js";import"./runtime-picker-BCQD7d4K.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Byb9kSFx.js";import"./MessageComposerSuggestions-Cs9u-F_3.js";import"./index-Dewd56RX.js";import"./HarnessMark-BE-YSyci.js";import"./conversation-model-CHwHZNw-.js";import"./colors-BtO5_zlx.js";import"./NewChatOrigin-CnjoswTG.js";import"./keyboard-nav-BJnFoFDP.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-DRCbnzyY.js";import"./search-C3bSJluv.js";import"./file-text-DG-pufl1.js";import"./ConversationComposer-CiEF7dhd.js";import"./Provider-DSsb2gLR.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-N-Z6X0Z1.js";import"./DocumentFocusViewer-BCG2kOmd.js";import"./TextDocumentSurface-DRjctOIt.js";/* empty css */import"./chevron-right-CNE6QAVr.js";import"./code-xml--LjSM4Mv.js";import"./arrow-left-_vS7itsV.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";import"./message-markup-mGF07emJ.js";import"./mentions-fbQJ2mBI.js";import"./AgentDetailCard-sZuHl1de.js";import"./AgentLiveActions-DI4ooSHW.js";import"./terminal-takeover-KvmTwABa.js";import"./openContent-C6XO6kr5.js";import"./eye-BFlhMzQL.js";import"./terminal-DrTkVXIj.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./AgentAvatar-CszU5eaU.js";import"./SpriteAvatar-BpQDpOkq.js";import"./agent-identity-BxCsXnDp.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-BGgbITvr.js";import"./ConversationFeedRows-5it6QNBV.js";import"./ConversationPanels-vI9YuQJh.js";import"./use-reduced-motion-Dla-G_Jz.js";import"./activity-BxwKkT8z.js";import"./message-circle-aGOfQWm2.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./ConversationStatus-COEj5loj.js";import"./SessionObserve-BmmJ8dEh.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-DrPXYZvQ.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-C1AQM0Mq.js";import"./ObserveTextFlow-DJxQc2H6.js";import"./SessionObserveEvidence-CEedIk2a.js";import"./wrench-CeCdjiPF.js";import"./external-link-CnaI1QFS.js";/* empty css */const T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],L=E("columns-2",T);function S(t){const o=new Map;for(const r of t)o.delete(r.sessionId),o.set(r.sessionId,r);return[...o.values()]}function M(t,o){const r=S(t),p=o?.trim()||null;return r.find(n=>n.sessionId===p)?.sessionId??r.at(-1)?.sessionId??p}function O(t){return t.length<=34?t:`${t.slice(0,15)}…${t.slice(-14)}`}function q(t,o){return o===0?t.strategy||"dispatch":t.strategy?`switched via ${t.strategy}`:"session changed"}function y({label:t,sessions:o,value:r,onChange:p}){return s.jsxs("label",{className:"s-flight-observe-select-wrap",children:[s.jsx("span",{children:t}),s.jsx("select",{className:"s-flight-observe-select",value:r,onChange:n=>p(n.currentTarget.value),children:o.map(n=>s.jsxs("option",{value:n.sessionId,children:[n.harness?`${n.harness} · `:"",n.sessionId]},n.sessionId))})]})}function pe({route:t,navigate:o}){const[r,p]=c.useState(null),[n,I]=c.useState(!0),[h,N]=c.useState(null),u=c.useCallback(async()=>{try{const e=await k(`/api/flights?active=false&flightId=${encodeURIComponent(t.flightId)}`);p(e[0]??null),N(e.length===0?"This flight is not available on the connected broker.":null)}catch(e){N(e instanceof Error?e.message:String(e))}finally{I(!1)}},[t.flightId]);c.useEffect(()=>{I(!0),u()},[u]),R(()=>{u()});const v=r?.sessions??[],a=c.useMemo(()=>S(v),[v]),g=M(v,t.sessionId),i=a.find(e=>e.sessionId===g)??null,l=a.find(e=>e.sessionId===t.compareSessionId)??null,f=!!(i&&l&&i.sessionId!==l.sessionId),m=c.useCallback((e,d)=>{o({...t,sessionId:e,...d?{compareSessionId:d}:{compareSessionId:void 0}})},[o,t]),w=c.useCallback(()=>{if(!i||a.length<2)return;const e=[...a].reverse().find(d=>d.sessionId!==i.sessionId);e&&m(i.sessionId,e.sessionId)},[i,a,m]),C=c.useCallback(e=>{if(!f||!i||!l){m(e);return}m(e,e===l.sessionId?i.sessionId:l.sessionId)},[l,i,f,m]);return s.jsxs("div",{className:"s-flight-observe",children:[s.jsxs("header",{className:"s-flight-observe-header",children:[s.jsxs("div",{className:"s-flight-observe-heading",children:[s.jsx("div",{className:"s-flight-observe-eyebrow",children:"Flight observe"}),s.jsxs("div",{className:"s-flight-observe-title-row",children:[s.jsx("h2",{children:r?.agentName||r?.agentId||"Flight"}),s.jsx("span",{className:`s-flight-observe-state s-flight-observe-state--${r?.state??"loading"}`,children:r?.state??(n?"loading":"unknown")})]}),s.jsx("div",{className:"s-flight-observe-id",title:t.flightId,children:t.flightId}),r?.summary&&s.jsx("p",{children:r.summary})]}),s.jsxs("div",{className:"s-flight-observe-actions",children:[a.length>1&&!f&&s.jsxs("button",{type:"button",onClick:w,children:[s.jsx(L,{size:13})," Split view"]}),f&&i&&s.jsxs("button",{type:"button",onClick:()=>m(i.sessionId),children:[s.jsx(A,{size:13})," Close split"]})]})]}),v.length>0&&s.jsx("nav",{className:"s-flight-observe-trace","aria-label":"Flight session history",children:v.map((e,d)=>{const b=i?.sessionId===e.sessionId,x=l?.sessionId===e.sessionId;return s.jsxs("div",{className:"s-flight-observe-trace-step",children:[d>0&&s.jsx("span",{className:"s-flight-observe-trace-arrow","aria-hidden":"true",children:"→"}),s.jsxs("button",{type:"button",className:"s-flight-observe-session-chip","data-selected":b||x,"data-observe-role":b?"primary":x?"compare":"idle","aria-pressed":b||x,title:e.sessionId,onClick:()=>C(e.sessionId),children:[s.jsxs("span",{className:"s-flight-observe-session-chip-top",children:[s.jsx("span",{children:e.harness||e.transport||"session"}),s.jsx("time",{title:new Date(e.startedAt).toLocaleString(),children:$(e.startedAt)||F(e.startedAt)})]}),s.jsx("strong",{children:O(e.sessionId)}),s.jsx("small",{children:q(e,d)})]})]},`${e.sessionId}:${e.startedAt}:${d}`)})}),h&&!g&&s.jsx("div",{className:"s-flight-observe-message s-flight-observe-message--error",children:h}),h&&g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Flight record unavailable"}),s.jsx("span",{children:"Showing the concrete session captured by this link."})]}),!h&&n&&s.jsx("div",{className:"s-flight-observe-message",children:"Resolving the flight’s session trace…"}),!h&&!n&&a.length===0&&!g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Waiting for a session"}),s.jsx("span",{children:"The flight is stable here; its trace will appear as soon as a harness acknowledges dispatch."})]}),g&&!f&&s.jsx("main",{className:"s-flight-observe-single",children:s.jsx(j,{sessionRef:g,navigate:o})}),!h&&i&&l&&f&&s.jsxs("main",{className:"s-flight-observe-split",children:[s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Primary session",sessions:a,value:i.sessionId,onChange:e=>m(e,e===l.sessionId?i.sessionId:l.sessionId)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(j,{sessionRef:i.sessionId,navigate:o,showObserveRail:!1})})]}),s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Compare session",sessions:a.filter(e=>e.sessionId!==i.sessionId),value:l.sessionId,onChange:e=>m(i.sessionId,e)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(j,{sessionRef:l.sessionId,navigate:o,showObserveRail:!1})})]})]})]})}export{pe as FlightObserveScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as u,j as e}from"./index-CzVeWScw.js";import{H as R,h as q}from"./HarnessMark-BE-YSyci.js";import{a as M}from"./api-h5zurxmi.js";import{b as D}from"./router-B-K15T7B.js";import{t as O,n as S,f as L}from"./time-Dhsh_2EG.js";import{u as P}from"./Provider-DSsb2gLR.js";import{u as T}from"./useContentSecondaryNav-BX7Sq7vy.js";import{OpsSubnav as E}from"./OpsSubnav-D5Bpowtk.js";/* empty css */import{R as U}from"./refresh-cw-4oeFn1Jn.js";import{E as $}from"./external-link-CnaI1QFS.js";import{c as H}from"./createLucideIcon-ClCdc3F9.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-C3qU8tnY.js";import"./sse-QcU9bikk.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-N-Z6X0Z1.js";import"./DocumentFocusViewer-BCG2kOmd.js";import"./TextDocumentSurface-DRjctOIt.js";/* empty css */import"./file-text-DG-pufl1.js";import"./x-D4X_y1j_.js";import"./chevron-right-CNE6QAVr.js";import"./code-xml--LjSM4Mv.js";import"./arrow-left-_vS7itsV.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BJnFoFDP.js";import"./MessageComposerSuggestions-Cs9u-F_3.js";import"./NewChatComposer-DXDxV2Mh.js";import"./runtime-picker-BCQD7d4K.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Byb9kSFx.js";import"./index-Dewd56RX.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-CnjoswTG.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-DRCbnzyY.js";import"./search-C3bSJluv.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";import"./SecondaryNav-Hv5AJ3Fv.js";import"./secondaryNavConfig-Bg4Tc0gT.js";import"./message-square-CIXda-Y7.js";import"./terminal-DrTkVXIj.js";import"./scroll-text-BV-BB7v-.js";/* empty css */const _=[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],z=H("clipboard-paste",_),B={codex:"Codex",claude:"Claude",kimi:"Kimi",minimax:"MiniMax",cursor:"Cursor",native:"Native",worker:"Worker",bridge:"Bridge",http:"HTTP",pi:"Pi",flue:"Flue",github:"GitHub",unknown:"Unknown"},C=[{id:"claude",description:"Anthropic plan windows captured from Claude Code.",links:[{label:"Usage",href:"https://claude.ai/settings/usage"},{label:"Manage plan",href:"https://claude.ai/settings/billing"}]},{id:"codex",description:"OpenAI plan windows reported by local Codex sessions.",links:[{label:"Usage",href:"https://chatgpt.com/codex/settings/usage"},{label:"Open Codex",href:"https://chatgpt.com/codex"}]},{id:"kimi",description:"Kimi Code subscription windows and membership level.",links:[{label:"Kimi Code",href:"https://www.kimi.com/code"},{label:"Docs",href:"https://www.kimi.com/code/docs/en/"}]},{id:"grok",description:"SuperGrok quota reported by local Grok, with dashboard capture and local activity as fallbacks.",links:[{label:"Open Grok",href:"https://grok.com/"},{label:"Billing",href:"https://grok.com/?_s=billing"},{label:"Help",href:"https://docs.x.ai/grok/faq"}]},{id:"minimax",description:"MiniMax Token Plan 5-hour and weekly allowance.",links:[{label:"Usage",href:"https://platform.minimax.io/console/plan"},{label:"Docs",href:"https://platform.minimax.io/docs/token-plan/intro"}]},{id:"cursor",description:"Cursor membership detected locally, plus usage totals from an exported dashboard capture.",links:[{label:"Usage",href:"https://cursor.com/dashboard/usage"},{label:"Manage plan",href:"https://cursor.com/dashboard/billing"}]}],G={cloudflare:[{label:"Dashboard",href:"https://dash.cloudflare.com/"},{label:"Billing",href:"https://dash.cloudflare.com/?to=/:account/billing"}],vercel:[{label:"Dashboard",href:"https://vercel.com/dashboard"},{label:"Billing",href:"https://vercel.com/account/billing"}],exe:[{label:"VMs",href:"https://exe.dev/"},{label:"Billing",href:"https://exe.dev/user/billing"},{label:"Docs",href:"https://exe.dev/docs/what-is-exe"}]},V={exe:{category:"Agent compute",description:"Persistent VMs for remote Scout agents and isolated workloads."},cloudflare:{category:"Edge platform",description:"Workers, networking, and edge infrastructure available for deployment."},vercel:{category:"App hosting",description:"Projects, preview environments, and production deployments."}};function W({provider:s}){return e.jsx("span",{className:`hs-cloud-mark hs-cloud-mark--${s}`,"aria-hidden":"true",children:s==="exe"?e.jsx("img",{src:"https://exe.dev/apple-touch-icon.png",alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer"}):e.jsx("svg",{viewBox:"0 0 24 24",focusable:"false",children:s==="cloudflare"?e.jsx("path",{d:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268Zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727"}):e.jsx("path",{d:"m12 1.608 12 20.784H0Z"})})})}function F(s){const t=(s??"").trim().toLowerCase();return t?t.includes("claude")?"claude":t.includes("codex")?"codex":t.includes("cursor")?"cursor":t.includes("kimi")||t.includes("moonshot")?"kimi":t.includes("minimax")?"minimax":t.includes("github")?"github":t.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown":"unknown"}function N(s){return B[s]??q(s)}function K(s){switch(s){case"weekly":return"7d";case"req/h":return"1h";default:return s||"quota"}}function v(s){return s.windows&&s.windows.length>0?s.windows:[{label:K(s.unitLabel),fill:s.fill,usedLabel:s.usedLabel,capLabel:s.capLabel,unitLabel:s.unitLabel,resetAt:s.resetAt}]}function Q(s){return s.capLabel==="100%"&&s.usedLabel.endsWith("%")?s.usedLabel:`${s.usedLabel}/${s.capLabel}`}function A(s){return s>=.9?"err":s>=.75?"warn":"ok"}function Z(s,t=30){const a=s??[];if(a.length<=t)return a;if(t<=1)return[a[a.length-1]];const r=(a.length-1)/(t-1);return Array.from({length:t},(n,o)=>a[Math.round(o*r)])}function I(s){const t=Math.floor((s-Date.now())/1e3),a=t<0,r=Math.abs(t);let n;if(r>=86400){const o=Math.floor(r/86400),c=Math.floor(r%86400/3600);n=c>0?`${o}d ${c}h`:`${o}d`}else if(r>=3600){const o=Math.floor(r/3600),c=Math.floor(r%3600/60);n=c>0?`${o}h ${c}m`:`${o}h`}else n=`${Math.max(1,Math.floor(r/60))}m`;return a?`stale ${n}`:n}function J(s){if(!s)return null;const t=S(s.capturedAt);if(t)return t;if(s.kind!=="quota")return null;const a=v(s).reduce((r,n)=>{const o=S(n.capturedAt);return Math.max(r??0,o??0)||r},null);return a||v(s).flatMap(r=>r.history??[]).reduce((r,n)=>{const o=S(n.capturedAt);return Math.max(r??0,o??0)||r},null)}function X({provider:s,onImported:t}){const[a,r]=u.useState(!1),[n,o]=u.useState(""),[c,b]=u.useState(!1),[i,d]=u.useState(null),l=`hs-${s}-dashboard-capture`,m=N(s);if(!a)return e.jsxs("button",{type:"button",className:"hs-dashboard-capture-trigger",onClick:()=>r(!0),children:[e.jsx(z,{size:12,"aria-hidden":"true"}),"Import dashboard"]});const x=async p=>{if(p.preventDefault(),!(!n.trim()||c)){b(!0),d(null);try{await M("/api/service-budgets/dashboard-import",{method:"POST",body:JSON.stringify({provider:s,text:n})}),o(""),d("Usage snapshot imported."),await t()}catch(h){d(h instanceof Error?h.message:String(h))}finally{b(!1)}}};return e.jsxs("form",{className:"hs-dashboard-capture",onSubmit:p=>{x(p)},children:[e.jsxs("label",{htmlFor:l,children:[m," usage snapshot"]}),e.jsxs("p",{children:[s==="cursor"?"Paste the exported Usage CSV or copied usage table.":"Copy the signed-in Usage panel and paste it here."," ","Scout keeps only normalized totals, not this text."]}),e.jsx("textarea",{id:l,value:n,onChange:p=>o(p.target.value),maxLength:128*1024,rows:5,placeholder:s==="cursor"?"Date (UTC),Type,Model,Tokens,Cost…":"Weekly SuperGrok… Limit · 12% used · Resets…","aria-describedby":i?`${l}-message`:void 0}),i?e.jsx("span",{id:`${l}-message`,className:"hs-dashboard-capture-message",role:"status",children:i}):null,e.jsxs("div",{className:"hs-dashboard-capture-actions",children:[e.jsx("button",{type:"button",onClick:()=>{r(!1),d(null)},disabled:c,children:"Cancel"}),e.jsx("button",{type:"submit",disabled:!n.trim()||c,children:c?"Importing…":"Use snapshot"})]})]})}function Y(s){const t=new Map(s.map(a=>[F(a.id),a]));return C.map(({id:a})=>({id:a,label:N(a),gauge:t.get(a)??null}))}function ee({points:s}){const t=Z(s);return t.length===0?e.jsx("span",{className:"hs-history hs-history-empty",children:"live"}):e.jsx("span",{className:"hs-history","aria-label":`${t.length} budget samples`,children:t.map((a,r)=>{const n=Math.max(.06,Math.min(1,a.fill));return e.jsx("span",{className:`hs-history-bar hs-history-bar--${A(a.fill)}`,style:{height:`${Math.round(n*100)}%`},title:`${L(a.capturedAt)||"unknown"} ${a.usedLabel}`},`${a.capturedAt}:${r}`)})})}function se({gauge:s,window:t}){const a=Math.max(0,Math.min(100,Math.round(t.fill*100))),r=100-a,n=A(t.fill),o=Number.isFinite(t.resetAt)?new Date(t.resetAt).toISOString():void 0;return e.jsxs("div",{className:"hs-subscription-window",children:[e.jsxs("div",{className:"hs-subscription-window-head",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"hs-subscription-window-label",children:[t.label," window"]}),e.jsxs("strong",{className:`hs-subscription-usage hs-subscription-usage--${n}`,children:[a,"% used"]})]}),e.jsxs("div",{className:"hs-subscription-remaining",children:[e.jsxs("strong",{children:[r,"%"]}),e.jsx("span",{children:"available"})]})]}),e.jsx("div",{className:"hs-subscription-meter",role:"progressbar","aria-label":`${s.label} ${t.label} usage`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,children:e.jsx("span",{className:`hs-subscription-meter-fill hs-subscription-meter-fill--${n}`,style:{width:`${a}%`}})}),e.jsxs("div",{className:"hs-subscription-window-meta",children:[e.jsxs("span",{children:[Q(t)," ",t.unitLabel==="quota"?"quota":t.unitLabel]}),e.jsxs("span",{children:["resets in ",I(t.resetAt),o?e.jsx("time",{dateTime:o,title:L(t.resetAt)||void 0,children:` · ${L(t.resetAt)||""}`}):null]})]}),e.jsx(ee,{points:t.history})]})}function te(){return e.jsxs("div",{className:"hs-subscription-loading","aria-hidden":"true",children:[e.jsx("span",{className:"hs-loading-line hs-loading-line--label"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--value"}),e.jsx("span",{className:"hs-loading-meter"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--meta"}),e.jsx("span",{className:"hs-loading-history"})]})}function ae({rows:s,loading:t,onImported:a}){const r=C.map(i=>({provider:i,row:s.find(d=>d.id===i.id)??null})),n=r.filter(({row:i})=>i?.gauge).length,o=r.filter(({row:i})=>i?.gauge?.kind==="quota").length,c=r.filter(({row:i})=>i?.gauge?.kind==="quota"&&i.gauge.plan||i?.gauge?.kind==="status").length,b=r.flatMap(({row:i})=>i?.gauge?.kind==="quota"?v(i.gauge):[]).map(i=>i.resetAt).filter(i=>i>Date.now()).sort((i,d)=>i-d)[0];return e.jsxs("section",{className:"hs-subscriptions","aria-labelledby":"hs-subscriptions-title","aria-busy":t,children:[e.jsxs("div",{className:"hs-section-head hs-subscriptions-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-subscriptions-title",children:"Subscriptions"}),e.jsx("p",{children:"Plans, remaining allowance, reset windows, and the fastest path to each provider dashboard."})]}),e.jsxs("div",{className:"hs-subscription-summary","aria-label":"Subscription feed summary",children:[e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":n})," detected"]}),e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":o})," usage feeds"]}),e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":c})," plans named"]}),e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":b?I(b):"-"})," next reset"]})]})]}),e.jsx("div",{className:"hs-subscription-grid",children:r.map(({provider:i,row:d})=>{const l=d?.gauge??null,m=t&&!l,x=m?"loading":l?"connected":"missing",p=l?.kind==="quota"?l.plan:l?.kind==="status"?l.statusLabel:null,h=J(l),y=l?.kind==="quota"?"Usage connected":l?.kind==="status"?l.detailLabel||"Subscription detected":m?"Checking":"Not detected";return e.jsxs("article",{className:`hs-subscription-card hs-subscription-card--${x}`,children:[e.jsxs("header",{className:"hs-subscription-card-head",children:[e.jsxs("div",{className:"hs-subscription-provider",children:[e.jsx(R,{harness:i.id,size:18,title:null,className:"hs-subscription-mark"}),e.jsxs("div",{children:[e.jsx("h4",{children:N(i.id)}),e.jsx("span",{children:m?"Checking local plan…":p||"Plan not reported"})]})]}),e.jsx("span",{className:`hs-subscription-state hs-subscription-state--${x}`,children:y})]}),e.jsx("p",{className:"hs-subscription-description",children:i.description}),m?e.jsx(te,{}):l?.kind==="quota"?e.jsx("div",{className:"hs-subscription-windows",children:v(l).map(f=>e.jsx(se,{gauge:l,window:f},`${i.id}:${f.label}`))}):l?.kind==="status"?e.jsxs("div",{className:"hs-subscription-status-detail",children:[e.jsx("strong",{children:l.statusLabel}),e.jsx("span",{children:l.detailLabel||"Subscription detected locally. Open the provider dashboard for live usage."})]}):e.jsxs("div",{className:"hs-subscription-missing",children:[e.jsx("strong",{children:"No local subscription feed yet"}),e.jsx("span",{children:"Open the provider locally, then refresh Scout."})]}),i.id==="cursor"||i.id==="grok"&&l?.kind!=="quota"?e.jsx(X,{provider:i.id,onImported:a}):null,e.jsxs("footer",{className:"hs-subscription-footer",children:[e.jsxs("span",{children:[m?"checking local feed":h?`updated ${O(h)||"now"}`:l?"detected locally":"waiting for provider data",l?.source?` · ${l.source}`:""]}),e.jsx("nav",{"aria-label":`${N(i.id)} quick links`,children:i.links.map(f=>e.jsxs("a",{href:f.href,target:"_blank",rel:"noreferrer",children:[f.label,e.jsx($,{size:11,"aria-hidden":"true"})]},f.href))})]})]},i.id)})})]})}function re({accounts:s,loading:t}){return s.length===0&&!t?null:e.jsxs("section",{className:"hs-cloud-accounts","aria-labelledby":"hs-cloud-accounts-title","aria-busy":t,children:[e.jsxs("div",{className:"hs-section-head hs-cloud-accounts-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-cloud-accounts-title",children:"Cloud accounts"}),e.jsx("p",{children:"Infrastructure available to Scout for deployment and agent compute."})]}),e.jsx("span",{className:"hs-section-meta",children:t?"checking accounts":`${s.length} connected`})]}),e.jsxs("div",{className:"hs-cloud-grid",children:[t&&s.length===0?Array.from({length:3},(a,r)=>e.jsxs("article",{className:"hs-cloud-card hs-cloud-card--loading","aria-hidden":"true",children:[e.jsxs("header",{className:"hs-cloud-card-head",children:[e.jsx("span",{className:"hs-loading-mark"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-title"})]}),e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-copy"}),e.jsxs("footer",{className:"hs-cloud-card-footer",children:[e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-meta"}),e.jsx("span",{className:"hs-loading-actions"})]})]},r)):null,s.map(a=>{const r=V[a.id];return e.jsxs("article",{className:"hs-cloud-card",children:[e.jsxs("header",{className:"hs-cloud-card-head",children:[e.jsxs("div",{className:"hs-cloud-identity",children:[e.jsx(W,{provider:a.id}),e.jsxs("div",{children:[e.jsx("span",{className:"hs-cloud-category",children:r.category}),e.jsx("h4",{children:a.label})]})]}),e.jsx("span",{className:"hs-subscription-state hs-subscription-state--connected",children:a.statusLabel})]}),e.jsx("p",{className:"hs-cloud-description",children:r.description}),e.jsxs("footer",{className:"hs-cloud-card-footer",children:[e.jsxs("span",{className:"hs-cloud-connection",children:[e.jsx("span",{className:"hs-cloud-dot","aria-hidden":"true"}),a.detailLabel]}),e.jsx("nav",{"aria-label":`${a.label} quick links`,children:G[a.id].map(n=>e.jsxs("a",{href:n.href,target:"_blank",rel:"noreferrer",children:[n.label,e.jsx($,{size:11,"aria-hidden":"true"})]},n.href))})]})]},a.id)})]})]})}function ss({navigate:s}){const{route:t}=P(),a=D(t),[r,n]=u.useState([]),[o,c]=u.useState([]),[b,i]=u.useState(!0),[d,l]=u.useState(!1),[m,x]=u.useState(null),p=u.useRef(0),h=u.useCallback(async(g=!1,k=!1)=>{const w=++p.current;k&&i(!0),l(!0),x(null);try{const j=await M(`/api/service-budgets${g?"?refresh=1":""}`);if(w!==p.current)return;n(j.gauges??[]),c(j.cloudAccounts??[])}catch(j){w===p.current&&x(j instanceof Error?j.message:String(j))}finally{w===p.current&&(i(!1),l(!1))}},[]);u.useEffect(()=>{let g=!1,k;return h(!1,!0).then(()=>{g||(k=window.setTimeout(()=>{h(!0)},600))}),()=>{g=!0,k!==void 0&&window.clearTimeout(k)}},[h]),u.useEffect(()=>{const g=window.setInterval(()=>{h(!1)},3e4);return()=>window.clearInterval(g)},[h]);const y=u.useMemo(()=>Y(r),[r]),f=T();return e.jsxs("div",{className:"s-ops",children:[f?e.jsx("div",{className:"s-ops-header",children:e.jsx(E,{activeRoute:{view:"harnesses",...a?{machineId:a}:{}},navigate:s})}):null,e.jsx("div",{className:"s-ops-body hs-body",children:e.jsxs("div",{className:"hs-page",children:[e.jsxs("header",{className:"hs-page-head",children:[e.jsxs("div",{className:"hs-title-group",children:[e.jsx("span",{className:"hs-kicker",children:"ops / provider central"}),e.jsx("h2",{children:"Agent Providers"}),e.jsx("p",{children:"See what you pay for, how much remains, and where to use it."})]}),e.jsxs("button",{type:"button",className:"hs-refresh",disabled:d,onClick:()=>{h(!0)},children:[e.jsx(U,{size:14,className:d?"hs-refresh-icon-spinning":"","aria-hidden":"true"}),e.jsx("span",{children:d?"Refreshing":"Refresh"})]})]}),m&&e.jsxs("div",{className:"hs-error",role:"status","aria-live":"polite",children:["refresh: ",m]}),e.jsx(ae,{rows:y,loading:b,onImported:()=>h(!1)}),e.jsx(re,{accounts:o,loading:b})]})})]})}export{ss as HarnessesScreen};
|