@openscout/scout 0.2.79 → 0.2.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/ActivityScreen-BXm6nJ6L.js +1 -0
- package/dist/client/assets/{AddProjectForm-BoVtelSP.js → AddProjectForm-CtEiLQnm.js} +1 -1
- package/dist/client/assets/{AgentAvatar-CufDA4A-.js → AgentAvatar-CszU5eaU.js} +1 -1
- package/dist/client/assets/AgentConfigurationScreen-CfBXxrsD.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-4Z0aN8AR.js +1 -0
- package/dist/client/assets/{AgentDetailCard-DxxVkgT1.js → AgentDetailCard-sZuHl1de.js} +1 -1
- package/dist/client/assets/AgentFloorView-DMivAYHU.js +1 -0
- package/dist/client/assets/AgentInfoScreen-CPkLg1pK.js +1 -0
- package/dist/client/assets/{AgentLaneCard-DTUvE96I.js → AgentLaneCard-nB68f2CI.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-BfVygkgL.js → AgentLaneChrome-O9Yf0uR-.js} +1 -1
- package/dist/client/assets/AgentLaneDetailSheet-BfhpaEQ3.js +4 -0
- package/dist/client/assets/{AgentLaneSummaryResize-CMgzYvAA.js → AgentLaneSummaryResize-Ct3b0TQR.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-CjHMvy3v.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-KWfLcaNB.js → AgentLanesPreflight-DNGvZvjd.js} +1 -1
- package/dist/client/assets/{AgentLanesView-CxfbV8Kd.js → AgentLanesView-DqRK5-d2.js} +1 -1
- package/dist/client/assets/{AgentLiveActions-CZdAInEu.js → AgentLiveActions-DI4ooSHW.js} +1 -1
- package/dist/client/assets/{AgentSessions-Bkr0lyry.js → AgentSessions-BxWIPkWh.js} +1 -1
- package/dist/client/assets/{AgentsConsole-WtFVqaPJ.js → AgentsConsole-D6VHSCfZ.js} +1 -1
- package/dist/client/assets/AgentsScreen-zR6b2bUL.js +1 -0
- package/dist/client/assets/AgentsSubnav-q0xcZi6C.js +1 -0
- package/dist/client/assets/{AtopView-_OKDlZ1h.js → AtopView-VZkk40v0.js} +1 -1
- package/dist/client/assets/{BackToPicker-CkUmHuuo.js → BackToPicker-DZg_4nHL.js} +1 -1
- package/dist/client/assets/{BriefingDetailScreen-i54EtZKW.js → BriefingDetailScreen-BZU4qMwE.js} +1 -1
- package/dist/client/assets/{BriefingsScreen-CBrHojlQ.js → BriefingsScreen-Bfc3tqPp.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-opTLuZU6.js → BrokerMetadataPanel-CaFe6kdh.js} +1 -1
- package/dist/client/assets/BrokerScreen-Chh8sGen.js +5 -0
- package/dist/client/assets/{ChatCollapsedStrip-Dr2vmKXQ.js → ChatCollapsedStrip-Cov54p9V.js} +1 -1
- package/dist/client/assets/{CodeDiffPane-CLOGjwul.js → CodeDiffPane-C1ebFt-Y.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-DTV8hR6A.js → CodeProjectPicker-tsCly-f3.js} +1 -1
- package/dist/client/assets/CodeScreen-D0hpZNLP.js +1 -0
- package/dist/client/assets/{ContextMenu-BlBQhpax.js → ContextMenu-N-Z6X0Z1.js} +1 -1
- package/dist/client/assets/ConversationComposer-CiEF7dhd.js +1 -0
- package/dist/client/assets/ConversationFeedRows-5it6QNBV.js +1 -0
- package/dist/client/assets/ConversationHeader-BGgbITvr.js +1 -0
- package/dist/client/assets/ConversationPanels-vI9YuQJh.js +2 -0
- package/dist/client/assets/ConversationScreen-C-PrCRz1.js +1 -0
- package/dist/client/assets/ConversationScreen-yIKEsm-8.css +1 -0
- package/dist/client/assets/{ConversationStatus-DSgdVofa.js → ConversationStatus-COEj5loj.js} +1 -1
- package/dist/client/assets/{DataTable-0DwuXyvW.js → DataTable-BoofV-_4.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-BrreQifA.js → DispatchAftermath-OXYlMbT1.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-DU_9BHsD.js → DocumentFocusViewer-BCG2kOmd.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-DdaswbfI.js → EmbeddableSurfacesLab-C2SZvrHJ.js} +1 -1
- package/dist/client/assets/{EmptyState-CoL-QuUO.js → EmptyState-DypEjx0V.js} +1 -1
- package/dist/client/assets/{FileViewerPane-C9Ly01Ef.js → FileViewerPane-CXCq-oKj.js} +1 -1
- package/dist/client/assets/{FleetSearch-DlWTLl-v.js → FleetSearch-Dj7-CfNi.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-Yq5NtQQJ.js +1 -0
- package/dist/client/assets/FollowScreen-DRgYuAvp.js +1 -0
- package/dist/client/assets/HarnessMark-BE-YSyci.js +1 -0
- package/dist/client/assets/HarnessesScreen-L-emPcXd.js +1 -0
- package/dist/client/assets/HerdrSession-DKFCJMst.js +4 -0
- package/dist/client/assets/{HomeHero-Cfsow7qL.js → HomeHero-CAEg8Yg5.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-DKashKoH.js → KnowledgeSearchInspector-C2EZsQ5i.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-DvdOFh-b.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-BzehBmdi.js → LaneToolHoverCard-DrPXYZvQ.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-Dl7foF88.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-DYvHfs_3.js → LaneTraceEventFocus-X4-DDFEo.js} +1 -1
- package/dist/client/assets/{MeshCanvas-DIjlrMPU.js → MeshCanvas-rtCBD7s6.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-DEq-PkF0.js → MeshCanvasMinimap-CuvXOkc7.js} +1 -1
- package/dist/client/assets/MeshScreen-D5zzTn0o.js +1 -0
- package/dist/client/assets/{MeshTopologyView-BMHpH5BU.js → MeshTopologyView-CeTShs-U.js} +2 -2
- package/dist/client/assets/{MessageComposerSuggestions-zAUUcLOv.js → MessageComposerSuggestions-Cs9u-F_3.js} +1 -1
- package/dist/client/assets/MessagesScreen-BhOJ7_tj.js +1 -0
- package/dist/client/assets/MissionContextRail-0O-Zu1Tn.js +1 -0
- package/dist/client/assets/MissionControlView-D2JO9u-y.js +1 -0
- package/dist/client/assets/{MissionFocusOverlay-C7cPt6eU.js → MissionFocusOverlay-LnjmqBiW.js} +1 -1
- package/dist/client/assets/{MissionLeftAgentRow-CxlH3dON.js → MissionLeftAgentRow-nc1Jyq3D.js} +1 -1
- package/dist/client/assets/MissionLogPane-lZ9vUftY.js +1 -0
- package/dist/client/assets/{NewAgentModal-DprvD4EK.js → NewAgentModal-K1cvdmZr.js} +1 -1
- package/dist/client/assets/NewChatComposer-C5LT7MF7.css +1 -0
- package/dist/client/assets/NewChatComposer-DXDxV2Mh.js +19 -0
- package/dist/client/assets/{NewChatOrigin--pHWUb4V.js → NewChatOrigin-CnjoswTG.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-CfvrnOiZ.js → ObserveEmbedScreen-CRpzYf0Y.js} +1 -1
- package/dist/client/assets/{ObserveTextFlow-CBitljxi.js → ObserveTextFlow-DJxQc2H6.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-Dv6fbHzW.js → ObservedTopologyPanel-C1AQM0Mq.js} +1 -1
- package/dist/client/assets/OpenScoutAppShell-DrHYD_pd.js +87 -0
- package/dist/client/assets/OpsAgentsView-BnMX0vEY.js +1 -0
- package/dist/client/assets/OpsScreen-BeC0lieE.js +1 -0
- package/dist/client/assets/OpsSubnav-D5Bpowtk.js +1 -0
- package/dist/client/assets/{PlanView-DYtt8H37.js → PlanView-DDXdC19M.js} +1 -1
- package/dist/client/assets/ProjectAgentProfile-zE1cApxw.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-B3IvVbqS.js → ProjectAgentProfileBar-MODhG0P6.js} +1 -1
- package/dist/client/assets/{ProjectAgentProfileHero-D5E8yvDj.js → ProjectAgentProfileHero-C1ImgGDu.js} +1 -1
- package/dist/client/assets/ProjectsInbox-C3Jd6JTk.js +2 -0
- package/dist/client/assets/{ProjectsRail-DEDS-M1c.js → ProjectsRail-B1zrQLZe.js} +1 -1
- package/dist/client/assets/ProjectsScreen-PW_NH5VK.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-DaCEUWN1.js +1 -0
- package/dist/client/assets/Provider-DSsb2gLR.js +1 -0
- package/dist/client/assets/{RailRow-BTlVAnHS.js → RailRow-DerXOXQS.js} +1 -1
- package/dist/client/assets/RawSessionsTable-LWEvXJzj.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-XtxbCjOs.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-CtTdlQ2A.js → RepoDiffEmbedScreen-C9oLCcZX.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-BRvaVYoC.js → RepoDiffPageScreen-CGEMAv2Z.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-Bo0gREMj.js → RepoDiffViewer-CB8PSVey.js} +1 -1
- package/dist/client/assets/RepoDiffViewerLazy-DIxkiMto.js +2 -0
- package/dist/client/assets/{ReposScreen-BBkJf8xT.js → ReposScreen-BN1lVjOj.js} +1 -1
- package/dist/client/assets/{ScoutDeckSurface-Bi9ov9Bm.js → ScoutDeckSurface-BCpl0QCx.js} +1 -1
- package/dist/client/assets/{ScoutSurface-DEQg_7Io.js → ScoutSurface-BEnDlynn.js} +1 -1
- package/dist/client/assets/{ScoutbotBroadcastChip-DJXuyn73.js → ScoutbotBroadcastChip-z9R_pC_U.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-BgsuLDjo.js → ScoutbotFxLab-fAROyIfz.js} +1 -1
- package/dist/client/assets/{ScoutbotRealtimeVoiceCall-Bzyl0BCS.js → ScoutbotRealtimeVoiceCall-CDyFJX8m.js} +1 -1
- package/dist/client/assets/{SecondaryNav-Bks0CO2h.js → SecondaryNav-Hv5AJ3Fv.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-b0Zgmfx5.js → SessionEmbedScreen-CDRpQc3g.js} +1 -1
- package/dist/client/assets/{SessionObserve-Dlx5vDaV.js → SessionObserve-BmmJ8dEh.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-ChBD1d4c.js → SessionObserveEvidence-CEedIk2a.js} +1 -1
- package/dist/client/assets/SessionRefScreen-Dk-O4OVt.js +1 -0
- package/dist/client/assets/SessionsScreen-BJEjuo2X.js +1 -0
- package/dist/client/assets/{SettingsDrawer-C587L1i1.js → SettingsDrawer-DL-SVLdd.js} +1 -1
- package/dist/client/assets/SettingsScreen-DJ-BhBwR.js +1 -0
- package/dist/client/assets/{ShikiPane-I_OTW5NO.js → ShikiPane-B7O4if20.js} +1 -1
- package/dist/client/assets/{SlidePanel-FCqT1zO3.js → SlidePanel-B3gc5HnM.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-CQs-jC-v.js → SpriteAvatar-BpQDpOkq.js} +1 -1
- package/dist/client/assets/{StatusPill-CbABggnQ.js → StatusPill-B33sQinT.js} +1 -1
- package/dist/client/assets/{TailView-C_MXVSum.js → TailView-DL3YZkzE.js} +2 -2
- package/dist/client/assets/Terminal-Dp1FSGIS.js +1 -0
- package/dist/client/assets/TerminalEmbedScreen-DP9IM4xf.js +1 -0
- package/dist/client/assets/{TextDocumentSurface-C-9EtYqt.js → TextDocumentSurface-DRjctOIt.js} +1 -1
- package/dist/client/assets/{TmuxPeek-Dz1gJ2pU.js → TmuxPeek-DNC4uWky.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-MfICy9kk.js → VoicePermissionsPanel-WLN0V-Xv.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-Cs7kdllj.js → WorkDetailScreen-D2Yl0mYZ.js} +1 -1
- package/dist/client/assets/{WorkFilesViewer-CF-nhtZ4.js → WorkFilesViewer-BbVfcUN-.js} +1 -1
- package/dist/client/assets/{activity-WhBf3FXP.js → activity-BxwKkT8z.js} +1 -1
- package/dist/client/assets/{addon-fit-q-x_HytU.js → addon-fit-B9O2vJoh.js} +1 -1
- package/dist/client/assets/{addon-webgl-fhhvEA9h.js → addon-webgl-BhRZFDcn.js} +1 -1
- package/dist/client/assets/{agent-essentials-DyJiUGpZ.js → agent-essentials-SrzMYEXV.js} +1 -1
- package/dist/client/assets/agent-identity-BxCsXnDp.js +1 -0
- package/dist/client/assets/{agent-lane-card-model-BCIwPjEh.js → agent-lane-card-model-DSWdGu-v.js} +1 -1
- package/dist/client/assets/agent-lane-detail-BNNm6FNu.js +2 -0
- package/dist/client/assets/{agent-lane-preview-BtnfNyFR.js → agent-lane-preview-C33Dwpn7.js} +1 -1
- package/dist/client/assets/{agent-lanes-model-Bl6xfviL.js → agent-lanes-model-CPgQRenB.js} +2 -2
- package/dist/client/assets/{arc.es-DPJ0xRV6.js → arc.es-NlJw-19N.js} +1 -1
- package/dist/client/assets/{arrow-down-DsD-dYj-.js → arrow-down-D3-IbArq.js} +1 -1
- package/dist/client/assets/{arrow-left-WjQIN9J6.js → arrow-left-_vS7itsV.js} +1 -1
- package/dist/client/assets/{arrow-up-right-CtTDrZJr.js → arrow-up-right-CcrWONpD.js} +1 -1
- package/dist/client/assets/{bot-B_Uzf4_O.js → bot-BRINYlC6.js} +1 -1
- package/dist/client/assets/{check-BbgHJX8u.js → check-COxArFXG.js} +1 -1
- package/dist/client/assets/{chevron-down-BFai6ZfE.js → chevron-down-DRCbnzyY.js} +1 -1
- package/dist/client/assets/{chevron-right-CyUa1zXx.js → chevron-right-CNE6QAVr.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-CvwpNg-G.js → chunk-HRAB3GC3-CAeEKaf5.js} +1 -1
- package/dist/client/assets/chunk-JTPDIGGW-s6WbxdjC.js +46 -0
- package/dist/client/assets/{chunk-T65CQEWV-DI4NKdNq.js → chunk-T65CQEWV-CiZ_ICHW.js} +1 -1
- package/dist/client/assets/chunk-YOZR3KYS-DLOc92uD.js +2 -0
- package/dist/client/assets/{clock-DviOalxA.js → clock-CyfvRmj6.js} +1 -1
- package/dist/client/assets/{code-xml-05TD3uOC.js → code-xml--LjSM4Mv.js} +1 -1
- package/dist/client/assets/content-7ZeCPAEt.js +1 -0
- package/dist/client/assets/content-BHUcUCH5.js +1 -0
- package/dist/client/assets/content-BUhvLPkv.js +1 -0
- package/dist/client/assets/content-BomQ5YWo.js +1 -0
- package/dist/client/assets/content-C39ELNgC.js +1 -0
- package/dist/client/assets/content-C4RYKHut.js +1 -0
- package/dist/client/assets/content-CCiZfG4H.js +1 -0
- package/dist/client/assets/content-CDpDtVI-.js +1 -0
- package/dist/client/assets/content-CO-9CeFd.js +1 -0
- package/dist/client/assets/content-CuOLxp1x.js +1 -0
- package/dist/client/assets/content-CvtLIjXS.js +1 -0
- package/dist/client/assets/content-CzwTUb9n.js +1 -0
- package/dist/client/assets/content-DQXbo2RO.js +1 -0
- package/dist/client/assets/content-DRTQ9QQb.js +1 -0
- package/dist/client/assets/content-LCELs6zg.js +1 -0
- package/dist/client/assets/content-Uqt8AG-s.css +1 -0
- package/dist/client/assets/content-qsDjA4Au.js +1 -0
- package/dist/client/assets/{conversation-icons-DohQL6GI.js → conversation-icons-c-hXv7hY.js} +1 -1
- package/dist/client/assets/conversation-model-CHwHZNw-.js +1 -0
- package/dist/client/assets/conversation-motion-features-T8vF9zED.js +1 -0
- package/dist/client/assets/{copy-CwCAivnc.js → copy-4LfKIdQJ.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DlxlBfLC.js → createLucideIcon-ClCdc3F9.js} +1 -1
- package/dist/client/assets/discover-7Ks00w-M.js +2 -0
- package/dist/client/assets/embed-entry-n2ThmSSX.js +2 -0
- package/dist/client/assets/{external-link-CnjcXf32.js → external-link-CnaI1QFS.js} +1 -1
- package/dist/client/assets/{eye-So8tNNK6.js → eye-BFlhMzQL.js} +1 -1
- package/dist/client/assets/{file-text-i3xTDUjJ.js → file-text-DG-pufl1.js} +1 -1
- package/dist/client/assets/{gestures-CgvAMd6F.js → gestures-CxG3Dphs.js} +1 -1
- package/dist/client/assets/home-live-action-BkqGLVRY.js +1 -0
- package/dist/client/assets/home-moving-signal-aNJusIzL.js +1 -0
- package/dist/client/assets/home-now-card-BQK4EFHx.js +1 -0
- package/dist/client/assets/{home-now-card-nano-CkLHUQ4J.js → home-now-card-nano-CdtzqSIF.js} +1 -1
- package/dist/client/assets/hooks-Dst1TH7n.js +2 -0
- package/dist/client/assets/index-9as_JTUs.css +1 -0
- package/dist/client/assets/index-CU9dtwJk.js +1 -0
- package/dist/client/assets/{index-sUomXsrf.js → index-CzVeWScw.js} +2 -2
- package/dist/client/assets/index-Dewd56RX.js +1 -0
- package/dist/client/assets/index-_YQXKEhb.js +1 -0
- package/dist/client/assets/{inspector-panel-DhXd-YbT.js → inspector-panel-DgOM8nCo.js} +1 -1
- package/dist/client/assets/keyboard-nav-BJnFoFDP.js +1 -0
- package/dist/client/assets/{lane-observe-DrhKkQ3A.js → lane-observe-BA3g9aVd.js} +1 -1
- package/dist/client/assets/{lane-roster-store-NE15Oe6M.js → lane-roster-store-pR4ZaYQm.js} +1 -1
- package/dist/client/assets/left-BhzPp-_E.js +1 -0
- package/dist/client/assets/left-CN1MABD0.js +2 -0
- package/dist/client/assets/left-DDgbsio7.js +1 -0
- package/dist/client/assets/left-Dpf2R9uD.js +1 -0
- package/dist/client/assets/left-HwwbMVtl.js +2 -0
- package/dist/client/assets/left-YfH0daht.js +1 -0
- package/dist/client/assets/left-agents-CYUwAy2Z.js +1 -0
- package/dist/client/assets/left-default-vEGZALPv.js +1 -0
- package/dist/client/assets/left-lanes-bphF-vlX.js +1 -0
- package/dist/client/assets/left-mission-B54-c3hq.js +1 -0
- package/dist/client/assets/left-np5USKqG.js +1 -0
- package/dist/client/assets/left-plan-BNBuDoPQ.js +2 -0
- package/dist/client/assets/library-DbCVJG_O.js +1 -0
- package/dist/client/assets/{loader-circle-lWOOKezu.js → loader-circle-Byb9kSFx.js} +1 -1
- package/dist/client/assets/{local-agents-C7fDHLVC.js → local-agents-DBaUbP-_.js} +1 -1
- package/dist/client/assets/{mentions-CY_wPZc5.js → mentions-fbQJ2mBI.js} +1 -1
- package/dist/client/assets/{mesh-ops-Kn8pCtyJ.js → mesh-ops-Cnw3vwAu.js} +1 -1
- package/dist/client/assets/{mesh-view-store-D14ihwkF.js → mesh-view-store-Btlyc7rW.js} +1 -1
- package/dist/client/assets/{message-circle-C5UZ6fO7.js → message-circle-aGOfQWm2.js} +1 -1
- package/dist/client/assets/{message-markup-C8Nx04sP.js → message-markup-mGF07emJ.js} +1 -1
- package/dist/client/assets/{message-square-BD-4UUdc.js → message-square-CIXda-Y7.js} +1 -1
- package/dist/client/assets/mission-control-m3BTDQ9l.css +1 -0
- package/dist/client/assets/{mission-control-store-xQHVQdm8.js → mission-control-store-CcoNeQHG.js} +1 -1
- package/dist/client/assets/mission-wall-CocIM1cF.js +1 -0
- package/dist/client/assets/{observe-uJfIlIUV.js → observe-BNFzh-7B.js} +1 -1
- package/dist/client/assets/openAgent-Dbv5wfuL.js +1 -0
- package/dist/client/assets/{page-status-BymFEFai.js → page-status-DDvNdA8s.js} +1 -1
- package/dist/client/assets/{paperclip-DL9BXPp2.js → paperclip-DfpJkR4s.js} +1 -1
- package/dist/client/assets/{plus-C9lTjsgd.js → plus-CmFQp9Uj.js} +1 -1
- package/dist/client/assets/profile-s3KRbip1.js +1 -0
- package/dist/client/assets/{projects-inbox-DfVmGFFk.js → projects-inbox-Diddml6e.js} +1 -1
- package/dist/client/assets/{radio-DedMyP8J.js → radio-PauJIekM.js} +1 -1
- package/dist/client/assets/{refresh-cw-D8PFyhUa.js → refresh-cw-4oeFn1Jn.js} +1 -1
- package/dist/client/assets/resolve-panes-cp6eNewO.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-Dbo-5PWx.js +1 -0
- package/dist/client/assets/right-09W2JJFg.js +1 -0
- package/dist/client/assets/right-B-MKhiJ6.js +1 -0
- package/dist/client/assets/right-B91Zl8lQ.js +1 -0
- package/dist/client/assets/{right-C1sIsSHR.js → right-BcFnuse9.js} +1 -1
- package/dist/client/assets/right-BdtMzn35.js +1 -0
- package/dist/client/assets/right-BqmKXLtf.js +1 -0
- package/dist/client/assets/right-BzeB-Dpt.js +1 -0
- package/dist/client/assets/right-CkGOs-sq.js +1 -0
- package/dist/client/assets/right-CzGiNBzB.js +1 -0
- package/dist/client/assets/right-Dc7uqv7l.js +1 -0
- package/dist/client/assets/{rocket-CriBwkHM.js → rocket-C-AskjZH.js} +1 -1
- package/dist/client/assets/router-B-K15T7B.js +1 -0
- package/dist/client/assets/{runtime-picker-DOZpZOlt.js → runtime-picker-BCQD7d4K.js} +1 -1
- package/dist/client/assets/{scope-views-BF_RvGKU.js → scope-views-BhkbIFPY.js} +1 -1
- package/dist/client/assets/{scout-voice-BZ4KqADJ.js → scout-voice-S5_YZ2v8.js} +1 -1
- package/dist/client/assets/{scroll-text-BIYf6g6N.js → scroll-text-BV-BB7v-.js} +1 -1
- package/dist/client/assets/{search-DCT_EvPr.js → search-C3bSJluv.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-Drb7wPG4.js → secondaryNavConfig-Bg4Tc0gT.js} +1 -1
- package/dist/client/assets/{selection-bridge-CJOTyYQs.js → selection-bridge-B1dmkX3P.js} +1 -1
- package/dist/client/assets/{send-horizontal-DDwOgEs3.js → send-horizontal-CqogPmbY.js} +1 -1
- package/dist/client/assets/{server-CHZCp3cF.js → server-Brw5Y1Gh.js} +1 -1
- package/dist/client/assets/{session-catalog-XhGxCtP-.js → session-catalog-9FqXmjBw.js} +1 -1
- package/dist/client/assets/session-table-1xdSxSXq.js +1 -0
- package/dist/client/assets/{sliders-horizontal-B9Nj-Y4J.js → sliders-horizontal-CUiOH26y.js} +1 -1
- package/dist/client/assets/{sparkles-up7pVlX-.js → sparkles-BjCA3Evu.js} +1 -1
- package/dist/client/assets/{sse-CVoGDiKW.js → sse-QcU9bikk.js} +1 -1
- package/dist/client/assets/synthetic-agent-routing-aduMYO7P.js +1 -0
- package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +1 -0
- package/dist/client/assets/{tail-display-BdyoLvzY.js → tail-display-BRcJltQa.js} +2 -2
- package/dist/client/assets/{tail-events-CTipUIli.js → tail-events-C6K7bCWB.js} +1 -1
- package/dist/client/assets/{terminal-DXQISjZn.js → terminal-DrTkVXIj.js} +1 -1
- package/dist/client/assets/{terminal-relay-B5Sma7fK.js → terminal-relay-BkXjjSkq.js} +1 -1
- package/dist/client/assets/{terminal-screen-19jAI0Cw.css → terminal-screen-BqVnCwl0.css} +1 -1
- package/dist/client/assets/terminal-sessions-C3qU8tnY.js +1 -0
- package/dist/client/assets/{terminal-takeover-X97KCSJk.js → terminal-takeover-KvmTwABa.js} +1 -1
- package/dist/client/assets/{use-conversation-list-B1T6J_qE.js → use-conversation-list-C5sF6WBR.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-DLofGhhK.js → use-fleet-active-asks-BOMPW0nl.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-ByGZk8rU.js → use-mesh-ops-items-Co05vcTV.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-Cvk-HRKg.js → use-reduced-motion-Dla-G_Jz.js} +1 -1
- package/dist/client/assets/{use-scout-dev-flags-BHvg3G2c.js → use-scout-dev-flags-BOQF3fW2.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-D5e8Qg1z.js → useAgentHoverCard-FtCmY-b9.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-BX7Sq7vy.js +1 -0
- package/dist/client/assets/{usePierreRuntime-DIVunfX0.js → usePierreRuntime-Bo4lD7Ui.js} +1 -1
- package/dist/client/assets/{wrench-pEVd8JnN.js → wrench-CeCdjiPF.js} +1 -1
- package/dist/client/assets/{x-0XjXwGqq.js → x-D4X_y1j_.js} +1 -1
- package/dist/client/assets/{xterm-CRLlV1Xp.js → xterm-D2a5wrkJ.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/main.mjs +1404 -356
- package/dist/node/main.mjs +63 -15
- package/dist/openscout-terminal-relay.mjs +16 -4
- package/dist/pairing-runtime-controller.mjs +3028 -2946
- package/dist/runtime/broker-daemon.mjs +356 -134
- package/dist/scout-control-plane-web.mjs +5631 -5183
- package/dist/scout-web-server.mjs +5631 -5183
- package/package.json +1 -1
- package/dist/client/assets/ActivityScreen-DnqqRSlS.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-CJqoMA0J.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-FpEkb-tu.js +0 -1
- package/dist/client/assets/AgentFloorView-CycUn0Lv.js +0 -1
- package/dist/client/assets/AgentInfoScreen-CAQAxpAK.js +0 -1
- package/dist/client/assets/AgentLaneDetailSheet-CWs9wKWk.js +0 -5
- package/dist/client/assets/AgentLanesEmbedScreen-BUCW4nUj.js +0 -1
- package/dist/client/assets/AgentsScreen-BMXvuiA2.js +0 -1
- package/dist/client/assets/AgentsSubnav-BTNjPYoA.js +0 -1
- package/dist/client/assets/BrokerScreen-CObCQvoy.js +0 -5
- package/dist/client/assets/CodeScreen-BXqi72NK.js +0 -1
- package/dist/client/assets/ConversationComposer-BBNPa5S9.js +0 -1
- package/dist/client/assets/ConversationFeedRows-BuejHMCY.js +0 -1
- package/dist/client/assets/ConversationHeader-DXMT-YXv.js +0 -1
- package/dist/client/assets/ConversationPanels-DHCtilQF.js +0 -2
- package/dist/client/assets/ConversationScreen-DSxIt9pq.css +0 -1
- package/dist/client/assets/ConversationScreen-Dz2d_Z_F.js +0 -1
- package/dist/client/assets/FlightObserveScreen-C-9S0nA5.js +0 -1
- package/dist/client/assets/FollowScreen--Q04xSSE.js +0 -1
- package/dist/client/assets/HarnessMark-Dm_qm1Ku.js +0 -1
- package/dist/client/assets/HarnessesScreen-Y54viPX8.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-DsdDz8wY.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-CBf_aNZx.js +0 -1
- package/dist/client/assets/MeshScreen-TgDtz-1l.js +0 -1
- package/dist/client/assets/MessagesScreen-BTQL0UcE.js +0 -1
- package/dist/client/assets/MissionControlView-D59SPnAm.js +0 -1
- package/dist/client/assets/MissionLogPane-Ye3YlF9s.js +0 -1
- package/dist/client/assets/NewChatComposer-B5FnPyzS.js +0 -19
- package/dist/client/assets/NewChatComposer-W-t-L4oV.css +0 -1
- package/dist/client/assets/OpenScoutAppShell-BIp0WitK.js +0 -87
- package/dist/client/assets/OpsAgentsView-CoBfAigH.js +0 -1
- package/dist/client/assets/OpsScreen-Bbo0W64T.js +0 -1
- package/dist/client/assets/OpsSubnav-CoN8utF8.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-FiiIcB5R.js +0 -1
- package/dist/client/assets/ProjectsInbox-BWiXjGi7.js +0 -2
- package/dist/client/assets/ProjectsScreen-Cxk4CuYn.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-BF66ugT5.js +0 -1
- package/dist/client/assets/Provider-tFc3jqZ4.js +0 -1
- package/dist/client/assets/RawSessionsTable-BsGVgZB3.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-B0Bem5Rc.js +0 -1
- package/dist/client/assets/RepoDiffViewerLazy-C8UPk4oo.js +0 -2
- package/dist/client/assets/SessionRefScreen-D7TfPYPN.js +0 -1
- package/dist/client/assets/SessionsScreen-BlknOWAd.js +0 -1
- package/dist/client/assets/SettingsScreen-BIlYxv_a.js +0 -1
- package/dist/client/assets/Terminal-DwZyo8kA.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-Czp3tQyd.js +0 -1
- package/dist/client/assets/agent-chat-Bfjd9y6c.js +0 -1
- package/dist/client/assets/agent-identity-xQHedtLl.js +0 -1
- package/dist/client/assets/agent-lane-detail-Cw4QVAgH.js +0 -1
- package/dist/client/assets/chunk-YOZR3KYS-BW85tiCr.js +0 -47
- package/dist/client/assets/content-2u_eV3fX.js +0 -1
- package/dist/client/assets/content-5irOghrY.js +0 -1
- package/dist/client/assets/content-8Z_0CwtD.js +0 -1
- package/dist/client/assets/content-B38YRDBu.js +0 -1
- package/dist/client/assets/content-BE3uK0LB.js +0 -1
- package/dist/client/assets/content-BtIxSqVY.js +0 -1
- package/dist/client/assets/content-CFsPAihU.js +0 -1
- package/dist/client/assets/content-CHU0wwA3.css +0 -1
- package/dist/client/assets/content-CKj5g5tu.js +0 -1
- package/dist/client/assets/content-CLDWXf9Z.js +0 -1
- package/dist/client/assets/content-CRr73E0r.js +0 -1
- package/dist/client/assets/content-CVR75_Uj.js +0 -1
- package/dist/client/assets/content-Czdp7_JQ.js +0 -1
- package/dist/client/assets/content-D0_EJ6nP.js +0 -1
- package/dist/client/assets/content-DNmxpNhD.js +0 -1
- package/dist/client/assets/content-XpbI9uxd.js +0 -1
- package/dist/client/assets/content-cyxWdgKQ.js +0 -1
- package/dist/client/assets/conversation-model-C4yb6_FA.js +0 -1
- package/dist/client/assets/conversation-motion-features-CifSdJtm.js +0 -1
- package/dist/client/assets/discover-DoiAJo4Z.js +0 -2
- package/dist/client/assets/embed-entry-D1Or9S4d.js +0 -2
- package/dist/client/assets/home-live-action-B22u89j7.js +0 -1
- package/dist/client/assets/home-moving-signal-BdkERL6B.js +0 -1
- package/dist/client/assets/home-now-card-lLkv6nQs.js +0 -1
- package/dist/client/assets/hooks-BPLDD9yu.js +0 -2
- package/dist/client/assets/index-DGoLx89y.js +0 -1
- package/dist/client/assets/index-DITWsjFb.css +0 -1
- package/dist/client/assets/index-m6dFtY5f.js +0 -1
- package/dist/client/assets/index-pY8-Mz7y.js +0 -1
- package/dist/client/assets/keyboard-nav-BhZZ5HEq.js +0 -1
- package/dist/client/assets/left-B6eawimv.js +0 -1
- package/dist/client/assets/left-BL2uBHe0.js +0 -2
- package/dist/client/assets/left-BNJguPDG.js +0 -1
- package/dist/client/assets/left-BvCtvN0f.js +0 -1
- package/dist/client/assets/left-CfBb6bxM.js +0 -1
- package/dist/client/assets/left-DTrlBF0h.js +0 -2
- package/dist/client/assets/left-agents-DsOHgDCY.js +0 -1
- package/dist/client/assets/left-d4hlBBxY.js +0 -1
- package/dist/client/assets/left-default-BRCwoCJr.js +0 -1
- package/dist/client/assets/left-lanes-DNtoRzoV.js +0 -1
- package/dist/client/assets/left-mission-DsTu2X5Y.js +0 -1
- package/dist/client/assets/left-plan-CtySjsXC.js +0 -2
- package/dist/client/assets/library-CLpgWNJO.js +0 -1
- package/dist/client/assets/mission-control-D3ikEPND.css +0 -1
- package/dist/client/assets/openAgent-Bjt57GdM.js +0 -1
- package/dist/client/assets/profile-BqY5tesX.js +0 -1
- package/dist/client/assets/resolve-panes-1xeZMuaw.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-PLr32WHN.js +0 -1
- package/dist/client/assets/right-1x7HzabC.js +0 -1
- package/dist/client/assets/right-CFzPUzlF.js +0 -1
- package/dist/client/assets/right-CRKyeJDk.js +0 -1
- package/dist/client/assets/right-CagzkLWg.js +0 -1
- package/dist/client/assets/right-CsV149pN.js +0 -1
- package/dist/client/assets/right-DITNyG2s.js +0 -1
- package/dist/client/assets/right-E3nNcLE3.js +0 -1
- package/dist/client/assets/right-eUQvSjd7.js +0 -1
- package/dist/client/assets/right-ozp4nM44.js +0 -1
- package/dist/client/assets/router-Dja9_ygK.js +0 -1
- package/dist/client/assets/session-table-sAVe44a4.js +0 -1
- package/dist/client/assets/system-surfaces-redesign-CD26LFc0.css +0 -1
- package/dist/client/assets/terminal-sessions-D5CIR2OL.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-ZfBNi3d4.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as s}from"./index-sUomXsrf.js";import{a as J}from"./api-h5zurxmi.js";import{c as k}from"./clipboard-e3fSpeo7.js";import{u as Q}from"./sse-CVoGDiKW.js";import{d as V}from"./colors-BtO5_zlx.js";import{u as X,m as Z,d as ss}from"./Provider-tFc3jqZ4.js";import{b as es}from"./router-Dja9_ygK.js";import{r as O}from"./mentions-CY_wPZc5.js";import{t as I,b as B}from"./time-Dhsh_2EG.js";import{u as as}from"./ContextMenu-BlBQhpax.js";import{E as C}from"./EmptyState-CoL-QuUO.js";/* empty css */import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-DU_9BHsD.js";import"./createLucideIcon-DlxlBfLC.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./x-0XjXwGqq.js";import"./chevron-right-CyUa1zXx.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-lWOOKezu.js";import"./index-m6dFtY5f.js";import"./HarnessMark-Dm_qm1Ku.js";import"./conversation-model-C4yb6_FA.js";import"./NewChatOrigin--pHWUb4V.js";import"./agent-chat-Bfjd9y6c.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BFai6ZfE.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./terminal-sessions-D5CIR2OL.js";import"./AgentDetailCard-DxxVkgT1.js";import"./AgentLiveActions-CZdAInEu.js";import"./terminal-takeover-X97KCSJk.js";import"./openContent-C6XO6kr5.js";import"./eye-So8tNNK6.js";import"./terminal-DXQISjZn.js";const ts={"agent.registered":"registered","agent.online":"came online","agent.offline":"went offline","flight.started":"started task","flight.completed":"completed task","flight.updated":"updated task","message.sent":"sent message","message.received":"received message","collaboration.ask":"asked a question","collaboration.answer":"answered",ask_sent:"sent a request",ask_replied:"replied",ask_working:"working",flight_created:"started task",flight_updated:"updated task",message_sent:"sent",message_received:"received"},ns={presence:{label:"Presence",tone:"notice"},work:{label:"Execution",tone:"working"},message:{label:"Delivery",tone:"completed"},collaboration:{label:"Coordination",tone:"working"},system:{label:"System",tone:"notice"}};function q(a){return ts[a]??a.replace(/[._]/g," ")}function ls(a){return a.startsWith("agent.")||a.includes("registered")||a.includes("online")||a.includes("offline")?"presence":a.startsWith("flight")||a.startsWith("ask_")?"work":a.startsWith("message")?"message":a.startsWith("collaboration")?"collaboration":"system"}function is(a){return(a??"system").charAt(0).toUpperCase()}function u(a){return a.length<=14?a:`${a.slice(0,8)}...${a.slice(-4)}`}function rs(a){if(!a)return null;const p=a.split("/").filter(Boolean);return p[p.length-1]??a}function os(a){return`${a.actorName??"system"} ${q(a.kind)}`}function cs(a){return a.workspaceRoot?`Recorded from ${a.workspaceRoot}.`:a.conversationId?`Linked to thread ${u(a.conversationId)}.`:"No additional detail was captured for this event."}function le({navigate:a}){const{agents:p,route:z}=X(),[v,F]=n.useState([]),[x,w]=n.useState(null),[y,A]=n.useState(!0),[R,$]=n.useState(!1),[h,S]=n.useState(null),[N,P]=n.useState(null),L=n.useRef([]),b=n.useRef(0),f=n.useRef(null),U=as(),T=es(z),W=n.useMemo(()=>Z(p,T),[p,T]),l=n.useMemo(()=>ss(v,W),[v,W]);n.useEffect(()=>{L.current=v},[v]),n.useEffect(()=>{x&&!l.some(e=>e.id===x)&&w(null)},[x,l]);const m=n.useCallback(async(e="initial")=>{const i=++b.current;!(L.current.length>0)&&e!=="background"?(A(!0),S(null)):$(!0);try{const o=await J("/api/activity");if(i!==b.current)return;F(o),S(null),P(Date.now()),w(g=>o.some(E=>E.id===g)?g:null)}catch(o){if(i!==b.current)return;S(o instanceof Error?o.message:String(o))}finally{i===b.current&&(A(!1),$(!1))}},[]),K=n.useCallback(()=>{f.current||(f.current=setTimeout(()=>{f.current=null,m("background")},250))},[m]);n.useEffect(()=>(m("initial"),()=>{f.current&&clearTimeout(f.current)}),[m]),Q(K);const G=n.useMemo(()=>{const e=new Set(l.map(c=>c.actorName??"system")),i=new Set(l.map(c=>c.conversationId).filter(c=>!!c));return[{label:"Events",value:`${l.length}`,detail:l.length>0?`Latest ${I(l[0].ts)}`:"Waiting for records"},{label:"Actors",value:`${e.size}`,detail:e.size>0?"Distinct event owners":"No actors yet"},{label:"Threads",value:`${i.size}`,detail:i.size>0?"Conversation-linked records":"No linked threads"}]},[l]),Y=!y&&l.length===0&&!!h,H=!y&&l.length===0&&!h;return s.jsxs("div",{className:"sys-surface-page",children:[s.jsxs("div",{className:"sys-page-head",children:[s.jsxs("div",{className:"sys-page-title-group",children:[s.jsx("h2",{className:"sys-page-title",children:"Activity Log"}),s.jsx("p",{className:"sys-page-subtitle",children:"Broker events, task execution, and collaboration handoffs."})]}),s.jsxs("div",{className:"sys-page-actions",children:[s.jsx("div",{className:"sys-sync-note",children:y?"Loading audit ledger...":h&&l.length>0?`Showing last confirmed snapshot from ${N?I(N):"earlier"}`:N?`Updated ${I(N)}`:"Waiting for first snapshot"}),s.jsx("button",{type:"button",className:"s-btn",disabled:y||R,onClick:()=>{m("manual")},children:R?"Refreshing...":"Refresh"})]})]}),s.jsx("div",{className:"sys-stat-grid",children:G.map(e=>s.jsxs("div",{className:"sys-stat-card",children:[s.jsx("span",{className:"sys-stat-label",children:e.label}),s.jsx("strong",{className:"sys-stat-value",children:e.value}),s.jsx("span",{className:"sys-stat-detail",children:e.detail})]},e.label))}),h&&l.length>0&&s.jsxs("div",{className:"sys-banner sys-banner-warning",children:[s.jsx("strong",{children:"Refresh failed."}),s.jsx("span",{children:h})]}),y&&l.length===0&&s.jsx(C,{title:"Loading activity",body:"Pulling the latest records from the broker database."}),Y&&s.jsx(C,{className:"sys-state-card-error",title:"Activity is unavailable",body:h,action:s.jsx("button",{type:"button",className:"s-btn",onClick:()=>{m("manual")},children:"Try again"})}),H&&s.jsx(C,{title:"No activity yet",body:"Events appear here after agents register, send messages, or advance work."}),l.length>0&&s.jsx("div",{className:"sys-audit-list",children:l.map(e=>{const i=x===e.id,c=ls(e.kind),o=ns[c],g=rs(e.workspaceRoot),E=e.summary&&e.summary!==e.title?e.summary:cs(e),r=[];if(e.conversationId&&r.push({key:"thread",label:"Thread",title:`Open thread ${u(e.conversationId)}`,route:{view:"conversation",conversationId:e.conversationId}}),e.recordId&&r.push({key:"work",label:"Work",title:"Open work item",route:{view:"work",workId:e.recordId}}),e.agentId){const t=e.agentName??"Agent";r.push({key:"agent",label:t,title:`Open agent ${t}`,route:{view:"agents-v2",agentId:e.agentId}})}e.sessionId&&r.push({key:"session",label:"Session",title:"Open session",route:{view:"sessions",sessionId:e.sessionId}}),(e.flightId||e.invocationId)&&r.push({key:"follow",label:"Follow",title:"Follow live execution",route:{view:"follow",...e.flightId?{flightId:e.flightId}:{},...e.invocationId?{invocationId:e.invocationId}:{},...e.conversationId?{conversationId:e.conversationId}:{}}});const _=()=>w(i?null:e.id);return s.jsxs("article",{className:`sys-audit-entry${i?" sys-audit-entry-expanded":""}`,onContextMenu:t=>{const j=window.getSelection()?.toString().trim(),d=[];j&&(d.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{k(j)}}),d.push({kind:"separator"}));const M=e.title??e.summary??"";if(M&&d.push({kind:"action",label:"Copy Details",onSelect:()=>{k(M)}}),e.actorName&&d.push({kind:"action",label:"Copy Actor",onSelect:()=>{k(e.actorName)}}),d.push({kind:"action",label:"Copy Event ID",onSelect:()=>{k(e.id)}}),r.length>0){d.push({kind:"separator"});for(const D of r)d.push({kind:"action",label:`Open ${D.label}`,onSelect:()=>a(D.route)})}U(t,d)},children:[s.jsxs("div",{className:"sys-audit-toggle",role:"button",tabIndex:0,"aria-expanded":i,onClick:_,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),_())},children:[s.jsxs("div",{className:"sys-audit-stamp",children:[s.jsx("span",{className:"sys-audit-time",children:I(e.ts)}),s.jsx("span",{className:"sys-audit-date",children:B(e.ts)})]}),s.jsx("div",{className:`sys-audit-marker sys-audit-marker-${o.tone}`,children:s.jsx("span",{})}),s.jsxs("div",{className:"sys-audit-body",children:[s.jsxs("div",{className:"sys-audit-topline",children:[s.jsx("span",{className:"sys-audit-category",children:o.label}),s.jsx("span",{className:"sys-audit-kind",children:q(e.kind)})]}),s.jsx("h3",{className:"sys-audit-title",children:O(e.title??os(e))}),s.jsx("p",{className:"sys-audit-summary",children:O(E)}),s.jsxs("div",{className:"sys-audit-meta",children:[s.jsxs("span",{className:"sys-audit-meta-item",children:[s.jsx("span",{className:"sys-audit-avatar",style:{background:V(e.actorName??"system")},children:is(e.actorName)}),e.actorName??"system"]}),g&&s.jsxs("span",{className:"sys-audit-meta-item",children:["Workspace ",g]})]}),r.length>0&&s.jsxs("div",{className:"sys-audit-jumps",children:[s.jsx("span",{className:"sys-audit-jumps-label",children:"Open"}),r.map(t=>s.jsx("button",{type:"button",className:"sys-audit-jump",title:t.title,onClick:j=>{j.stopPropagation(),a(t.route)},children:t.label},t.key))]})]}),s.jsx("div",{className:"sys-audit-expand",children:i?"Close":"Details"})]}),i&&s.jsxs("div",{className:"sys-audit-details",children:[s.jsxs("div",{className:"sys-detail-grid",children:[s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Event"}),s.jsx("code",{className:"sys-detail-value",children:e.kind})]}),s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Recorded"}),s.jsx("span",{className:"sys-detail-value",children:B(e.ts)})]}),s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Actor"}),s.jsx("span",{className:"sys-detail-value",children:e.actorName??"system"})]}),e.agentName&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Agent"}),s.jsx("span",{className:"sys-detail-value",children:e.agentName})]}),s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Workspace"}),s.jsx("span",{className:"sys-detail-value",children:e.workspaceRoot??"Not attached"})]}),s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Thread"}),s.jsx("span",{className:"sys-detail-value",children:e.conversationId?u(e.conversationId):"Not attached"})]}),e.recordId&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Work"}),s.jsx("span",{className:"sys-detail-value",children:u(e.recordId)})]}),e.sessionId&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Session"}),s.jsx("span",{className:"sys-detail-value",children:u(e.sessionId)})]}),e.flightId&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Flight"}),s.jsx("span",{className:"sys-detail-value",children:u(e.flightId)})]}),e.invocationId&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Invocation"}),s.jsx("span",{className:"sys-detail-value",children:u(e.invocationId)})]}),s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Record id"}),s.jsx("code",{className:"sys-detail-value",children:e.id})]})]}),r.length>0&&s.jsx("div",{className:"sys-inline-actions",children:r.map(t=>s.jsxs("button",{type:"button",className:"s-btn s-btn-sm",onClick:()=>a(t.route),children:["Open ",t.label]},t.key))})]})]},e.id)})})]})}export{le as ActivityScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,j as s}from"./index-sUomXsrf.js";import{E as H}from"./EmptyState-CoL-QuUO.js";import{a as R}from"./api-h5zurxmi.js";import{e as L}from"./agent-chat-Bfjd9y6c.js";import{d as K}from"./time-Dhsh_2EG.js";import{u as I}from"./Provider-tFc3jqZ4.js";import{o as U}from"./openContent-C6XO6kr5.js";import{AgentsSubnav as q}from"./AgentsSubnav-BTNjPYoA.js";/* empty css */import{R as W}from"./refresh-cw-D8PFyhUa.js";import{S as V}from"./secondaryNavConfig-Drb7wPG4.js";import{c as E}from"./createLucideIcon-DlxlBfLC.js";import{B as O}from"./bot-B_Uzf4_O.js";import{W as Y}from"./wrench-pEVd8JnN.js";import{S as F}from"./server-CHZCp3cF.js";import"./router-Dja9_ygK.js";import"./terminal-sessions-D5CIR2OL.js";import"./sse-CVoGDiKW.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-BlBQhpax.js";import"./DocumentFocusViewer-DU_9BHsD.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./x-0XjXwGqq.js";import"./chevron-right-CyUa1zXx.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-lWOOKezu.js";import"./index-m6dFtY5f.js";import"./HarnessMark-Dm_qm1Ku.js";import"./conversation-model-C4yb6_FA.js";import"./NewChatOrigin--pHWUb4V.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BFai6ZfE.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./SecondaryNav-Bks0CO2h.js";import"./message-square-BD-4UUdc.js";import"./terminal-DXQISjZn.js";import"./scroll-text-BIYf6g6N.js";const J=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],G=E("cpu",J);const Q=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],B=E("key-round",Q);const X=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Z=E("save",X);function S(e){switch(e){case"ready":case"running":case"available":case"enabled":return"sys-chip-success";case"configured":case"installed":case"working":return"sys-chip-warning";case"missing":case"offline":case"not_ready":case"error":return"sys-chip-danger";default:return"sys-chip-neutral"}}function A(e){switch(e){case"available":case"ready":return"ready";case"offline":case"not_ready":return"not ready";default:return e}}function M(e){return e?e.replace(/^\/Users\/[^/]+/,"~"):"Not reported"}function ss(e){return e.length>0?e.join(", "):"No capabilities reported"}function es({runtime:e}){return s.jsxs("div",{className:"agent-config-row",children:[s.jsxs("div",{className:"agent-config-row-main",children:[s.jsx("span",{className:"agent-config-icon",children:s.jsx(G,{size:14})}),s.jsxs("div",{className:"agent-config-row-copy",children:[s.jsx("div",{className:"agent-config-row-title",children:e.label}),s.jsx("div",{className:"agent-config-row-detail",children:e.description}),s.jsx("div",{className:"agent-config-row-meta",children:e.detail})]})]}),s.jsxs("div",{className:"agent-config-row-side",children:[s.jsx("span",{className:`sys-chip ${S(e.state)}`,children:e.state}),s.jsx("span",{className:"agent-config-row-meta",children:e.binaryPath??e.loginCommand??e.source})]})]})}function as({provider:e}){return s.jsxs("div",{className:"agent-config-row",children:[s.jsxs("div",{className:"agent-config-row-main",children:[s.jsx("span",{className:"agent-config-icon",children:s.jsx(B,{size:14})}),s.jsxs("div",{className:"agent-config-row-copy",children:[s.jsx("div",{className:"agent-config-row-title",children:e.name}),s.jsx("div",{className:"agent-config-row-detail",children:e.protocol}),s.jsx("code",{className:"agent-config-code",children:e.baseUrl}),s.jsxs("div",{className:"agent-config-row-meta",children:["Keys: ",e.envKeys.join(", ")]}),s.jsx("div",{className:"agent-config-row-meta",children:e.note})]})]}),s.jsxs("div",{className:"agent-config-row-side",children:[s.jsx("span",{className:`sys-chip ${S(e.status)}`,children:e.status}),s.jsx("a",{className:"agent-config-link",href:e.docsUrl,target:"_blank",rel:"noreferrer",children:"Docs"})]})]})}function ns({agent:e,selected:l,navigate:p}){return s.jsxs("button",{type:"button",className:`agent-config-row agent-config-row-button${l?" agent-config-row-selected":""}`,onClick:()=>p({view:"agents-v2",agentId:e.id,tab:"config"}),children:[s.jsxs("div",{className:"agent-config-row-main",children:[s.jsx("span",{className:"agent-config-icon",children:s.jsx(O,{size:14})}),s.jsxs("div",{className:"agent-config-row-copy",children:[s.jsx("div",{className:"agent-config-row-title",children:e.name}),s.jsx("div",{className:"agent-config-row-detail",children:e.id}),s.jsxs("div",{className:"agent-config-row-meta",children:[e.harness??"unknown harness"," / ",e.transport??"unknown transport",e.model?` / ${e.model}`:""]})]})]}),s.jsxs("div",{className:"agent-config-row-side",children:[s.jsx("span",{className:`sys-chip ${S(e.status)}`,children:A(e.status)}),s.jsx("span",{className:"agent-config-row-meta",children:M(e.projectRoot??e.cwd)})]})]})}function D(e,l,p,n,o){l(e),p(e.model??""),n(e.runtime.cwd),o(e.runtime.harness)}function is({agent:e,navigate:l,onConfigSaved:p}){const{route:n}=I(),o=e?.id??null,[c,f]=t.useState(null),[u,v]=t.useState(!1),[y,g]=t.useState(null),[x,d]=t.useState(""),[w,m]=t.useState(""),[N,a]=t.useState(""),[b,h]=t.useState(!1),[j,$]=t.useState("idle"),[z,C]=t.useState(null),k=t.useRef(0),T=t.useCallback(async()=>{const i=++k.current;if(C(null),h(!1),!o){f(null),g(null),v(!1);return}v(!0),g(null);try{const r=await R(`/api/agents/${encodeURIComponent(o)}/config`);if(i!==k.current)return;D(r,f,d,m,a)}catch(r){if(i!==k.current)return;f(null),d(""),m(""),a(e?.harness??""),g(r instanceof Error?r.message:String(r))}finally{i===k.current&&v(!1)}},[e?.harness,o]);t.useEffect(()=>{T()},[T]);const P=t.useMemo(()=>{const i=["claude","codex","pi",c?.runtime.harness,e?.harness,N].filter(r=>!!r?.trim());return Array.from(new Set(i))},[e?.harness,c?.runtime.harness,N]),_=async i=>{if(i.preventDefault(),!(!o||!c||j==="saving")){$("saving"),C(null),g(null);try{const r=await R(`/api/agents/${encodeURIComponent(o)}/config`,{method:"POST",body:JSON.stringify({model:x.trim()||null,runtime:{cwd:w.trim()||c.runtime.cwd,harness:N.trim()||c.runtime.harness},restart:b})});D(r.config,f,d,m,a),h(!1),C(r.restarted?"Saved and restarted":"Saved"),p?.()}catch(r){g(r instanceof Error?r.message:String(r))}finally{$("idle")}}};return e?s.jsxs("div",{className:"sys-panel agent-config-detail-panel",children:[s.jsxs("div",{className:"sys-section-head",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"sys-section-title",children:e.name}),s.jsx("p",{className:"sys-section-subtitle",children:e.id})]}),s.jsxs("div",{className:"sys-page-actions",children:[s.jsx("button",{type:"button",className:"s-btn",onClick:()=>l({view:"agents-v2",agentId:e.id}),children:"Open Agent"}),s.jsx("button",{type:"button",className:"s-btn",onClick:()=>{L(e).then(i=>{U(l,{view:"conversation",conversationId:i},{returnTo:n})})},children:"Open Chat"})]})]}),s.jsxs("div",{className:"agent-config-detail-grid",children:[s.jsxs("div",{children:[s.jsx("span",{className:"agent-config-label",children:"Status"}),s.jsx("span",{className:`sys-chip ${S(e.status)}`,children:A(e.status)})]}),s.jsxs("div",{children:[s.jsx("span",{className:"agent-config-label",children:"Harness"}),s.jsx("strong",{className:"agent-config-selectable",children:e.harness??"Not reported"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"agent-config-label",children:"Transport"}),s.jsx("strong",{className:"agent-config-selectable",children:e.transport??"Not reported"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"agent-config-label",children:"Reported model"}),s.jsx("strong",{className:"agent-config-selectable",children:e.model??"Not reported"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"agent-config-label",children:"Configured model"}),s.jsx("strong",{className:"agent-config-selectable",children:u?"Loading...":c?c.model??"Harness default":"Not editable"})]}),s.jsxs("div",{className:"agent-config-detail-wide",children:[s.jsx("span",{className:"agent-config-label",children:"Project"}),s.jsx("code",{className:"agent-config-inline-code",title:e.projectRoot??void 0,children:M(e.projectRoot)})]}),s.jsxs("div",{className:"agent-config-detail-wide",children:[s.jsx("span",{className:"agent-config-label",children:"Working dir"}),s.jsx("code",{className:"agent-config-inline-code",title:e.cwd??c?.runtime.cwd??void 0,children:M(e.cwd??c?.runtime.cwd??null)})]}),s.jsxs("div",{className:"agent-config-detail-wide",children:[s.jsx("span",{className:"agent-config-label",children:"Capabilities"}),s.jsx("span",{className:"agent-config-selectable",children:ss(e.capabilities)})]})]}),u&&s.jsx("div",{className:"agent-config-edit agent-config-edit-empty",children:s.jsx("span",{className:"agent-config-save-note",children:"Loading editable launch config..."})}),!u&&c&&s.jsxs("form",{className:"agent-config-edit",onSubmit:_,children:[s.jsxs("div",{className:"agent-config-edit-grid",children:[s.jsxs("label",{className:"agent-config-field",children:[s.jsx("span",{children:"Model"}),s.jsx("input",{name:"model",value:x,placeholder:"Harness default",disabled:!c.editable||j==="saving",onChange:i=>d(i.currentTarget.value)})]}),s.jsxs("label",{className:"agent-config-field",children:[s.jsx("span",{children:"Harness"}),s.jsx("select",{name:"harness",value:N,disabled:!c.editable||j==="saving",onChange:i=>a(i.currentTarget.value),children:P.map(i=>s.jsx("option",{value:i,children:i},i))})]}),s.jsxs("label",{className:"agent-config-field agent-config-field-wide",children:[s.jsx("span",{children:"Working dir"}),s.jsx("input",{name:"cwd",value:w,disabled:!c.editable||j==="saving",onChange:i=>m(i.currentTarget.value)})]})]}),s.jsxs("div",{className:"agent-config-save-row",children:[s.jsxs("label",{className:"agent-config-check",children:[s.jsx("input",{type:"checkbox",checked:b,disabled:!c.editable||j==="saving",onChange:i=>h(i.currentTarget.checked)}),s.jsx("span",{children:"Restart after saving"})]}),s.jsxs("button",{type:"submit",className:"s-btn",disabled:!c.editable||j==="saving",children:[s.jsx(Z,{size:13}),j==="saving"?"Saving...":"Save config"]}),z&&s.jsx("span",{className:"agent-config-save-note",children:z}),y&&s.jsx("span",{className:"agent-config-save-error",children:y})]})]}),!u&&!c&&s.jsx("div",{className:"agent-config-edit agent-config-edit-empty",children:s.jsx("span",{className:"agent-config-save-error",children:y??"No editable local config found"})})]}):s.jsxs("div",{className:"sys-panel agent-config-detail-panel",children:[s.jsx("div",{className:"sys-section-head",children:s.jsxs("div",{children:[s.jsx("h3",{className:"sys-section-title",children:"Agent Details"}),s.jsx("p",{className:"sys-section-subtitle",children:"Select an agent to inspect runtime, model, and tool context."})]})}),s.jsxs("div",{className:"sys-list-empty",children:[s.jsx("h3",{children:"No agent selected"}),s.jsx("p",{children:"Choose an agent from the configuration roster."})]})]})}function ne({navigate:e,selectedAgentId:l}){const{route:p}=I(),[n,o]=t.useState(null),[c,f]=t.useState(!0),[u,v]=t.useState(!1),[y,g]=t.useState(null),x=t.useRef(0),d=t.useCallback(async(a="initial")=>{const b=++x.current;a==="initial"?f(!0):v(!0),g(null);try{const h=await R("/api/agent-config/snapshot");if(b!==x.current)return;o(h)}catch(h){if(b!==x.current)return;g(h instanceof Error?h.message:String(h))}finally{b===x.current&&(f(!1),v(!1))}},[]);t.useEffect(()=>{d()},[d]);const w=t.useMemo(()=>n?n.agents.find(a=>a.id===l)??n.agents[0]??null:null,[l,n]),m=n?.providers??[],N=n?[{label:"Runtimes",value:String(n.runtimes.length),detail:`${n.runtimes.filter(a=>a.state==="ready").length} ready`},{label:"BYOK",value:String(m.length),detail:`${m.filter(a=>a.status==="configured").length} configured`},{label:"Agents",value:String(n.agents.length),detail:`${n.agents.filter(a=>A(a.status)!=="not ready").length} ready`},{label:"Broker",value:n.broker.label,detail:n.broker.nodeId??"No node id"}]:[];return s.jsxs("div",{className:"s-secondary-nav-shell",children:[s.jsx("div",{className:"s-secondary-nav-bar",children:s.jsx(q,{activeRoute:p,navigate:e})}),s.jsx("div",{className:"s-secondary-nav-body s-secondary-nav-body--scroll",children:s.jsxs("div",{className:"sys-surface-page sys-surface-page-wide",children:[s.jsxs("div",{className:"sys-page-head",children:[s.jsxs("div",{className:"sys-page-title-group",children:[s.jsx("h2",{className:"sys-page-title",children:"Agent Configuration"}),s.jsx("p",{className:"sys-page-subtitle",children:"Runtimes, agents, project inventory, delivery bridges, and the missing tool/provider surfaces in one control plane."})]}),s.jsxs("div",{className:"sys-page-actions",children:[n&&s.jsxs("div",{className:"sys-sync-note",children:["Updated ",K(n.generatedAt)||"unknown"]}),s.jsxs("button",{type:"button",className:"s-btn",disabled:c||u,onClick:()=>{d("manual")},children:[s.jsx(W,{size:13}),u?"Refreshing...":"Refresh"]})]})]}),n&&s.jsx("div",{className:"sys-stat-grid",children:N.map(a=>s.jsxs("div",{className:"sys-stat-card",children:[s.jsx("span",{className:"sys-stat-label",children:a.label}),s.jsx("strong",{className:"sys-stat-value",children:a.value}),s.jsx("span",{className:"sys-stat-detail",children:a.detail})]},a.label))}),y&&s.jsxs("div",{className:"sys-banner sys-banner-warning",children:[s.jsx("strong",{children:"Configuration snapshot failed."}),s.jsx("span",{children:y})]}),c&&!n&&s.jsx(H,{title:"Loading configuration",body:"Reading Scout settings, runtime readiness, broker agents, and project inventory."}),n&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"agent-config-layout",children:[s.jsxs("div",{className:"sys-panel",children:[s.jsxs("div",{className:"sys-section-head",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"sys-section-title",children:"Runtimes"}),s.jsx("p",{className:"sys-section-subtitle",children:"Harness readiness replaces provider auth for the current local-first posture."})]}),s.jsx(V,{size:15})]}),s.jsx("div",{className:"agent-config-list",children:n.runtimes.map(a=>s.jsx(es,{runtime:a},a.id))})]}),s.jsxs("div",{className:"sys-panel",children:[s.jsxs("div",{className:"sys-section-head",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"sys-section-title",children:"BYOK Providers"}),s.jsx("p",{className:"sys-section-subtitle",children:"OpenAI-compatible vendors OpenScout can discover from local environment configuration."})]}),s.jsx(B,{size:15})]}),s.jsx("div",{className:"agent-config-list",children:m.map(a=>s.jsx(as,{provider:a},a.id))})]})]}),s.jsxs("div",{className:"agent-config-layout agent-config-layout-primary",children:[s.jsxs("div",{className:"sys-panel",children:[s.jsxs("div",{className:"sys-section-head",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"sys-section-title",children:"Agents"}),s.jsx("p",{className:"sys-section-subtitle",children:"Broker-visible endpoints with runtime, model, and source state."})]}),s.jsx(O,{size:15})]}),s.jsx("div",{className:"agent-config-list agent-config-list-scroll",children:n.agents.length===0?s.jsxs("div",{className:"sys-list-empty",children:[s.jsx("h3",{children:"No agents registered"}),s.jsx("p",{children:"Run setup or start a local agent to populate this roster."})]}):n.agents.map(a=>s.jsx(ns,{agent:a,selected:a.id===w?.id,navigate:e},a.id))})]}),s.jsx(is,{agent:w,navigate:e,onConfigSaved:()=>{d("manual")}})]}),s.jsxs("div",{className:"agent-config-layout",children:[s.jsxs("div",{className:"sys-panel",children:[s.jsxs("div",{className:"sys-section-head",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"sys-section-title",children:"Tools & Context"}),s.jsx("p",{className:"sys-section-subtitle",children:"The next model boundary to make first-class."})]}),s.jsx(Y,{size:15})]}),s.jsx("p",{className:"agent-config-copy",children:n.toolContext.note}),s.jsxs("div",{className:"agent-config-chip-row",children:[s.jsxs("span",{className:"sys-chip sys-chip-neutral",children:[n.toolContext.mcpServerCount," MCP servers"]}),s.jsx("span",{className:"sys-chip sys-chip-warning",children:"loadouts pending"})]})]}),s.jsxs("div",{className:"sys-panel",children:[s.jsxs("div",{className:"sys-section-head",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"sys-section-title",children:"Broker & Delivery"}),s.jsx("p",{className:"sys-section-subtitle",children:"Control-plane state and bridges that route attention back to you."})]}),s.jsx(F,{size:15})]}),s.jsxs("div",{className:"agent-config-detail-grid",children:[s.jsxs("div",{children:[s.jsx("span",{className:"agent-config-label",children:"Broker"}),s.jsx("span",{className:`sys-chip ${n.broker.healthy?"sys-chip-success":"sys-chip-danger"}`,children:n.broker.label})]}),s.jsxs("div",{children:[s.jsx("span",{className:"agent-config-label",children:"Messages"}),s.jsx("strong",{children:n.broker.messageCount})]}),n.integrations.map(a=>s.jsxs("div",{className:"agent-config-detail-wide",children:[s.jsx("span",{className:"agent-config-label",children:a.name}),s.jsx("span",{children:a.detail})]},a.id))]})]})]}),s.jsxs("div",{className:"sys-panel",children:[s.jsx("div",{className:"sys-section-head",children:s.jsxs("div",{children:[s.jsx("h3",{className:"sys-section-title",children:"Known Missing Pieces"}),s.jsx("p",{className:"sys-section-subtitle",children:"The configuration model is now visible; these are the next root-cause surfaces to build."})]})}),s.jsx("div",{className:"agent-config-gap-list",children:n.gaps.map(a=>s.jsx("span",{children:a},a))})]})]})]})})]})}export{ne as AgentConfigurationScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,j as e}from"./index-sUomXsrf.js";import{A as E}from"./AgentAvatar-CufDA4A-.js";import{a as F}from"./api-h5zurxmi.js";import{c as T}from"./colors-BtO5_zlx.js";import{t as D}from"./time-Dhsh_2EG.js";import{u as L}from"./Provider-tFc3jqZ4.js";import{f as M}from"./text-DsBWV_4k.js";import{p as O}from"./project-overview-helpers-BQTc_Ous.js";import{FileViewerPane as z}from"./FileViewerPane-C9Ly01Ef.js";/* empty css */import{C as I}from"./chevron-right-CyUa1zXx.js";import{C as $}from"./chevron-down-BFai6ZfE.js";import{F as B,a as G}from"./DocumentFocusViewer-DU_9BHsD.js";import{F as H}from"./file-text-i3xTDUjJ.js";import"./SpriteAvatar-CQs-jC-v.js";import"./agent-identity-xQHedtLl.js";import"./router-Dja9_ygK.js";import"./terminal-sessions-D5CIR2OL.js";import"./sse-CVoGDiKW.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-BlBQhpax.js";import"./TextDocumentSurface-C-9EtYqt.js";import"./createLucideIcon-DlxlBfLC.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-lWOOKezu.js";import"./index-m6dFtY5f.js";import"./HarnessMark-Dm_qm1Ku.js";import"./conversation-model-C4yb6_FA.js";import"./NewChatOrigin--pHWUb4V.js";import"./agent-chat-Bfjd9y6c.js";import"./model-Co0zkMIc.js";import"./x-0XjXwGqq.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";/* empty css */const U={general:"Generalist",builder:"Builder",reviewer:"Reviewer",researcher:"Researcher",operator:"Operator",bridge:"Bridge",system:"System",organic:"Organic",managed:"Managed"};function J(s){if(!s?.trim())return"Generalist";const n=s.trim().toLowerCase();return U[n]??s.replace(/_/g," ")}function V(s){return s?.trim()?M(s)?.trim()??null:null}function W(s,n){const f=s.agentClass?.trim()||"general",g=J(f),i=V(s.role),v=[...new Set(s.skills??[])].filter(Boolean),h=[...new Set([...s.capabilities??[],...n?.capabilities??[]])].filter(Boolean),m=f==="general"&&!i&&v.length===0;return{kind:g,kindRaw:f,role:i,isGeneralist:m,headline:i??g,skills:v,capabilities:h}}function _({payload:s,selectedSlug:n,selectedFile:f,filter:g,collapsed:i,onToggleFolder:v,onSelectFile:h}){const m=g.trim().toLowerCase(),j=s.folders.filter(o=>!m||o.slug.includes(m)?!0:o.files.some(c=>c.name.toLowerCase().includes(m)||c.relativePath.toLowerCase().includes(m)));return j.length===0?e.jsx("div",{className:"adef-treeEmpty",children:s.agentsRootExists?"No agent folders in .agents yet.":"No .agents directory on disk."}):e.jsx(e.Fragment,{children:j.map(o=>{const c=i.has(o.slug),C=o.slug===n;return e.jsxs("div",{className:"adef-folder","data-selected-agent":C||void 0,children:[e.jsxs("button",{type:"button",className:"adef-folderRow",onClick:()=>v(o.slug),children:[e.jsx("span",{className:"adef-folderChevron","aria-hidden":!0,children:c?e.jsx(I,{size:12}):e.jsx($,{size:12})}),e.jsx("span",{className:"adef-folderIcon","aria-hidden":!0,children:c?e.jsx(B,{size:13}):e.jsx(G,{size:13})}),e.jsx("span",{className:"adef-folderName",children:o.slug})]}),c?null:o.files.map(d=>{const x=f?.absolutePath===d.absolutePath;return e.jsxs("button",{type:"button",className:"adef-fileRow","data-selected":x||void 0,onClick:()=>h({slug:o.slug,name:d.name,relativePath:`.agents/${d.relativePath}`,absolutePath:d.absolutePath,excerpt:d.excerpt}),children:[e.jsx("span",{className:"adef-fileIcon","aria-hidden":!0,children:e.jsx(H,{size:12})}),e.jsx("span",{className:"adef-fileName",children:d.name})]},d.absolutePath)})]},o.slug)})})}function K({agent:s,config:n,onConfigSaved:f,sessionCatalog:g,navigate:i,homeView:v}){const h=W(s,n),m=s.handle?.replace(/^@+/,"")||s.name,j=g?.sessions.length??0,[o,c]=r.useState(""),[C,d]=r.useState(""),[x,S]=r.useState(""),[k,w]=r.useState(!1),[u,N]=r.useState("idle"),[y,P]=r.useState(null),[b,R]=r.useState(null);r.useEffect(()=>{if(!n){c(""),d(""),S(s.harness??"");return}c(n.model??""),d(n.runtime.cwd),S(n.runtime.harness),w(!1),P(null),R(null)},[s.harness,s.id,n]);const A=r.useMemo(()=>{const t=["claude","codex","pi",n?.runtime.harness,s.harness,x].filter(p=>!!p?.trim());return Array.from(new Set(t))},[s.harness,n?.runtime.harness,x]),a=async t=>{if(t.preventDefault(),!(!n||u==="saving")){N("saving"),P(null),R(null);try{const p=await F(`/api/agents/${encodeURIComponent(s.id)}/config`,{method:"POST",body:JSON.stringify({model:o.trim()||null,runtime:{cwd:C.trim()||n.runtime.cwd,harness:x.trim()||n.runtime.harness},restart:k})});f(p.config),w(!1),P(p.restarted?"Saved and restarted":"Saved")}catch(p){R(p instanceof Error?p.message:"Could not save config")}finally{N("idle")}}},l=()=>i({view:v,agentId:s.id,tab:"profile"});return e.jsxs("aside",{className:"adef-inspector",children:[e.jsxs("header",{className:"adef-inspectorHead",children:[e.jsx(E,{agent:s,size:36,tile:!0,presence:!1}),e.jsxs("div",{className:"adef-inspectorIdent",children:[e.jsxs("span",{className:"adef-inspectorHandle",children:["@",m]}),e.jsx("span",{className:"adef-inspectorSpec",children:h.headline})]})]}),e.jsxs("dl",{className:"adef-inspectorFacts",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"State"}),e.jsx("dd",{children:T(s.state,s)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Sessions"}),e.jsx("dd",{children:j})]})]}),n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"adef-inspectorSec",children:"Runtime"}),e.jsxs("form",{className:"adef-configEdit",onSubmit:a,children:[e.jsxs("label",{className:"adef-configField",children:[e.jsx("span",{children:"Model"}),e.jsx("input",{value:o,placeholder:"Harness default",disabled:!n.editable||u==="saving",onChange:t=>c(t.currentTarget.value)})]}),e.jsxs("label",{className:"adef-configField",children:[e.jsx("span",{children:"Harness"}),e.jsx("select",{value:x,disabled:!n.editable||u==="saving",onChange:t=>S(t.currentTarget.value),children:A.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("label",{className:"adef-configField adef-configField--wide",children:[e.jsx("span",{children:"Working dir"}),e.jsx("input",{value:C,disabled:!n.editable||u==="saving",onChange:t=>d(t.currentTarget.value)})]}),e.jsxs("div",{className:"adef-configSaveRow",children:[e.jsxs("label",{className:"adef-configCheck",children:[e.jsx("input",{type:"checkbox",checked:k,disabled:!n.editable||u==="saving",onChange:t=>w(t.currentTarget.checked)}),e.jsx("span",{children:"Restart"})]}),e.jsx("button",{type:"submit",className:"adef-inspectorAct","data-primary":!0,disabled:!n.editable||u==="saving",children:u==="saving"?"Saving…":"Save"})]}),y?e.jsx("p",{className:"adef-inspectorMeta",children:y}):null,b?e.jsx("p",{className:"adef-configError",children:b}):null]}),e.jsx("div",{className:"adef-inspectorSec",children:"Permissions"}),e.jsx("p",{className:"adef-inspectorMono",children:O(n.permissionProfile)}),e.jsx("div",{className:"adef-inspectorSec",children:"Tools"}),e.jsx("div",{className:"adef-inspectorChips",children:(h.capabilities.length>0?h.capabilities:["—"]).map(t=>e.jsx("span",{className:"adef-inspectorChip",children:t},t))})]}):e.jsx("p",{className:"adef-inspectorMeta",children:"No editable local config on disk."}),s.updatedAt?e.jsxs("p",{className:"adef-inspectorMeta",children:["Updated ",D(s.updatedAt)]}):null,e.jsx("div",{className:"adef-inspectorActs",children:e.jsx("button",{type:"button",className:"adef-inspectorAct","data-primary":!0,onClick:l,children:"Sessions"})})]})}function Be({agent:s,navigate:n,homeView:f="agents-v2"}){const{openFilePreview:g}=L(),[i,v]=r.useState(null),[h,m]=r.useState(null),[j,o]=r.useState(null),[c,C]=r.useState(null),[d,x]=r.useState("loading"),[S,k]=r.useState(""),[w,u]=r.useState(()=>new Set),[N,y]=r.useState(null),P=r.useCallback(async a=>{await F("/api/file/reveal",{method:"POST",body:JSON.stringify({path:a})}).catch(()=>{})},[]);r.useEffect(()=>{let a=!1;return x("loading"),(async()=>{const[l,t,p]=await Promise.allSettled([F(`/api/agents/${encodeURIComponent(s.id)}/definitions`),F(`/api/agents/${encodeURIComponent(s.id)}/config`).catch(()=>null),F(`/api/agents/${encodeURIComponent(s.id)}/session-catalog`).catch(()=>null)]);a||(l.status==="fulfilled"&&v(l.value),t.status==="fulfilled"&&m(t.value),p.status==="fulfilled"&&o(p.value),x("ready"))})(),()=>{a=!0}},[s.id]);const b=r.useMemo(()=>{if(!i)return null;const a=i.folders.find(t=>t.slug===i.selectedSlug)??i.folders[0]??null,l=a?.files.find(t=>t.name==="AGENT.md")??a?.files[0]??null;return!a||!l?null:{slug:a.slug,name:l.name,relativePath:`.agents/${l.relativePath}`,absolutePath:l.absolutePath,excerpt:l.excerpt}},[i]);r.useEffect(()=>{b&&(y(a=>a&&i?.folders.some(l=>l.files.some(t=>t.absolutePath===a.absolutePath))?a:b),i?.selectedSlug&&u(a=>{const l=new Set(a);return l.delete(i.selectedSlug),l}))},[b,i]);const R=i?.folders.reduce((a,l)=>a+l.files.length,0)??0,A=r.useCallback(a=>{u(l=>{const t=new Set(l);return t.has(a)?t.delete(a):t.add(a),t})},[]);return e.jsxs("div",{className:"adef-workspace",children:[e.jsxs("header",{className:"adef-head",children:[e.jsxs("div",{className:"adef-headCopy",children:[e.jsx("span",{className:"adef-headKind",children:"Config"}),e.jsxs("span",{className:"adef-headPath",title:i?.agentsRoot,children:[i?.agentsRootExists?".agents · explore & edit":"explore & edit",i?` · ${i.folders.length} agents · ${R} files`:""]})]}),e.jsx("input",{type:"search",className:"adef-filter",placeholder:"Filter agents & files…",value:S,onChange:a=>k(a.target.value)})]}),d==="loading"?e.jsx("div",{className:"adef-loading",children:"Loading agent config…"}):e.jsxs("div",{className:"adef-frame",children:[e.jsx("aside",{className:"adef-tree","aria-label":"Agent definition files",children:i?e.jsx(_,{payload:i,selectedSlug:i.selectedSlug,selectedFile:N,filter:S,collapsed:w,onToggleFolder:A,onSelectFile:y}):null}),e.jsx("section",{className:"adef-viewer","aria-label":"Definition file",children:N?e.jsx(z,{artifact:N,onOpen:g,onReveal:a=>{P(a)},onBrowse:i?a=>n({view:"code",root:i.projectRoot,file:a}):void 0}):e.jsx("div",{className:"av2-repoViewerState",children:i?.agentsRootExists?"Select a definition file — or create .agents/<handle>/AGENT.md":"Create .agents/<handle>/AGENT.md in the project root to define this expert on disk."})}),e.jsx(K,{agent:s,config:h,onConfigSaved:m,sessionCatalog:c,navigate:n,homeView:f})]})]})}export{Be as AgentDefinitionsWorkspace};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as e}from"./index-sUomXsrf.js";/* empty css */import{H as Me}from"./HarnessMark-Dm_qm1Ku.js";import{a as ue,S as fe}from"./SpriteAvatar-CQs-jC-v.js";import{n as Ze}from"./colors-BtO5_zlx.js";import{o as He,l as Ke}from"./lane-observe-DrhKkQ3A.js";import{t as We}from"./time-Dhsh_2EG.js";import{S as Be}from"./SessionObserve-Dlx5vDaV.js";import{l as X,i as Ge}from"./agent-lanes-model-Bl6xfviL.js";import{p as Ve,s as je,a as Ne}from"./lane-roster-store-NE15Oe6M.js";import"./agent-identity-xQHedtLl.js";import"./tail-display-BdyoLvzY.js";import"./lane-edit-display-C_Aujldz.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-BzehBmdi.js";import"./index-m6dFtY5f.js";import"./lane-ask-display-B6iCAVcd.js";import"./api-h5zurxmi.js";import"./mentions-CY_wPZc5.js";import"./Provider-tFc3jqZ4.js";import"./router-Dja9_ygK.js";import"./terminal-sessions-D5CIR2OL.js";import"./sse-CVoGDiKW.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-BlBQhpax.js";import"./DocumentFocusViewer-DU_9BHsD.js";import"./createLucideIcon-DlxlBfLC.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./x-0XjXwGqq.js";import"./chevron-right-CyUa1zXx.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-lWOOKezu.js";import"./conversation-model-C4yb6_FA.js";import"./NewChatOrigin--pHWUb4V.js";import"./agent-chat-Bfjd9y6c.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BFai6ZfE.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./AgentDetailCard-DxxVkgT1.js";import"./AgentLiveActions-CZdAInEu.js";import"./terminal-takeover-X97KCSJk.js";import"./openContent-C6XO6kr5.js";import"./eye-So8tNNK6.js";import"./terminal-DXQISjZn.js";import"./message-markup-C8Nx04sP.js";import"./ObservedTopologyPanel-Dv6fbHzW.js";import"./ObserveTextFlow-CBitljxi.js";import"./use-reduced-motion-Cvk-HRKg.js";import"./SessionObserveEvidence-ChBD1d4c.js";import"./message-circle-C5UZ6fO7.js";import"./wrench-pEVd8JnN.js";import"./external-link-CnjcXf32.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-sUomXsrf.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-C4yb6_FA.js";import{a as D}from"./api-h5zurxmi.js";import{u as Y}from"./sse-CVoGDiKW.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-tFc3jqZ4.js";import{o as te}from"./openContent-C6XO6kr5.js";import{B as E}from"./BackToPicker-CkUmHuuo.js";import{A as se}from"./AgentLiveActions-CZdAInEu.js";import{O as le}from"./ObservedTopologyPanel-Dv6fbHzW.js";import{a as re}from"./model-Co0zkMIc.js";import"./index-BWHgHrtv.js";import"./router-Dja9_ygK.js";import"./terminal-sessions-D5CIR2OL.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-BlBQhpax.js";import"./DocumentFocusViewer-DU_9BHsD.js";import"./createLucideIcon-DlxlBfLC.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./x-0XjXwGqq.js";import"./chevron-right-CyUa1zXx.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-lWOOKezu.js";import"./index-m6dFtY5f.js";import"./HarnessMark-Dm_qm1Ku.js";import"./NewChatOrigin--pHWUb4V.js";import"./agent-chat-Bfjd9y6c.js";import"./chevron-down-BFai6ZfE.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./terminal-takeover-X97KCSJk.js";import"./eye-So8tNNK6.js";import"./terminal-DXQISjZn.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,5 +0,0 @@
|
|
|
1
|
-
import{r as o,j as e}from"./index-sUomXsrf.js";import{S as ze}from"./SlidePanel-FCqT1zO3.js";import{a as de}from"./api-h5zurxmi.js";import{A as He}from"./AgentAvatar-CufDA4A-.js";import{H as qe}from"./HarnessMark-Dm_qm1Ku.js";import{t as re}from"./time-Dhsh_2EG.js";import{h as Je}from"./tail-display-BdyoLvzY.js";import{a as Ge}from"./colors-BtO5_zlx.js";import{c as V}from"./clipboard-e3fSpeo7.js";import{d as Ke,c as Ve}from"./context-budget-DX_fwUs3.js";import{P as Ue}from"./router-Dja9_ygK.js";import{u as Qe}from"./Provider-tFc3jqZ4.js";import{s as Xe,t as Ye,b as Ze}from"./bash-format-BRV5C6Gv.js";import{i as es}from"./keyboard-nav-BhZZ5HEq.js";import{o as te}from"./openContent-C6XO6kr5.js";import{b as ss,f as Se}from"./agent-lane-preview-BtnfNyFR.js";import{i as as}from"./terminal-sessions-D5CIR2OL.js";import{b as Le,a as ts,r as ns,d as ls}from"./agent-lane-detail-Cw4QVAgH.js";import{l as is,a as rs,s as cs}from"./agent-lanes-model-Bl6xfviL.js";import{E as he}from"./external-link-CnjcXf32.js";async function os(s){return de("/api/session-control/compact",{method:"POST",body:JSON.stringify(s)})}function $e(s){return as(s.id)}function ds(s){return Le(s).sessionId?.trim()||null}function Ie(s){const t=ds(s);if(!t)return null;const n=$e(s.agent)?void 0:s.agent.id;return{view:"sessions",sessionId:t,...n?{agentId:n}:{}}}function hs(s){return Ie(s)}function us(s){return $e(s.agent)?null:{view:"agents-v2",agentId:s.agent.id,tab:"profile"}}const ms={created:"+",modified:"~",read:"○"},ps={blocked:"blocked",completed:"done",in_progress:"active",pending:"todo",unknown:"step"},Te=["s-lane-sheet-vitals","s-lane-sheet-runtime","s-lane-sheet-files","s-lane-sheet-commands","s-lane-sheet-plans","s-lane-sheet-docs"];function ce(s){return!!(s&&Te.includes(s))}function fs(){if(typeof window>"u")return null;const s=window.location.hash.replace(/^#/,"");return ce(s)?s:null}function ne(s){return typeof s!="number"||!Number.isFinite(s)?"—":s.toLocaleString()}function xs(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(s>=1e5?0:1)}k`:`${s}`}function js(s){const t=s.lastIndexOf("/");return t<0?{dir:"",base:s}:{dir:s.slice(0,t+1),base:s.slice(t+1)}}const gs=new Set(["bash","shell","terminal","exec","run","command","exec_command","shell_command","local_shell","container_exec","container.exec"]);function vs(s){return s.replace(/\\(["\\/bfnrt])/g,(t,n)=>{switch(n){case"n":return`
|
|
2
|
-
`;case"t":return" ";case"r":return"\r";case"b":return"\b";case"f":return"\f";default:return n}})}function ye(s){const t=s.filter(r=>typeof r=="string");if(t.length===0)return"";const n=t[0].replace(/^.*\//,"");return(t.length>=3&&(n==="bash"||n==="sh"||n==="zsh"||n==="fish")&&/^-[a-z]*c$/.test(t[1])?t.slice(2):t).join(" ").trim()}function Ns(s){const t=s?.trim();if(!t)return"";if(t.startsWith("{"))try{const n=JSON.parse(t);for(const i of["command","cmd","script","input","code"]){const r=n[i];if(typeof r=="string"&&r.trim())return r.trim();if(Array.isArray(r)){const l=ye(r);if(l)return l}}}catch{const n=t.match(/"(?:command|cmd|script|input|code)"\s*:\s*"((?:[^"\\]|\\.)*)/);if(n&&n[1].trim())return vs(n[1]).trim()}else if(t.startsWith("["))try{const n=JSON.parse(t);if(Array.isArray(n)){const i=ye(n);if(i)return i}}catch{}return t}function bs(s){const t=s.result;if(t)for(const n of["status","exit","matches","result","summary"]){const i=t[n];if(i!=null&&`${i}`.trim())return`${i}`.trim().slice(0,24)}return null}function ws(s,t=12){if(!s)return[];const n=[];for(const i of s.events){if(i.kind!=="tool"||!gs.has((i.tool??"").trim().toLowerCase()))continue;const r=Ns(i.arg);!r||r==="started"||r==="completed"||r.startsWith("[")||n.push({id:i.id,command:r,outcome:bs(i)})}return n.slice(-t)}function ks(s,t){const n=new Map;for(const i of t?.events??[]){if(i.kind!=="tool"||!i.diff||!i.arg)continue;const r=i.arg.trim().split(/[\\/]/).filter(Boolean).pop();if(!r)continue;const l=n.get(r)??{add:0,del:0};l.add+=i.diff.add??0,l.del+=i.diff.del??0,n.set(r,l)}return s.map(i=>{const r=i.path.split(/[\\/]/).filter(Boolean).pop()??i.path,l=n.get(r);return{...i,add:l?.add??0,del:l?.del??0}})}function le(s,t=48){return s?s.length<=t?s:`…${s.slice(-(t-1))}`:"—"}async function ys(s){await de("/api/local-path/reveal",{method:"POST",body:JSON.stringify({path:s.path,...s.basePath?{basePath:s.basePath}:{},...s.agentId?{agentId:s.agentId}:{},...s.sessionId?{sessionId:s.sessionId}:{}})})}function oe(s,t){return s.startsWith("/")||s.startsWith("~/")?s:t?`${t.replace(/\/$/u,"")}/${s}`:s}function U({value:s,label:t}){const[n,i]=o.useState(!1),r=o.useRef(null);o.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const l=o.useCallback(h=>{h.preventDefault(),h.stopPropagation(),V(s).then(I=>{I&&(i(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>i(!1),1100))})},[s]);return e.jsx("button",{type:"button",className:`s-lane-sheet-copy${n?" s-lane-sheet-copy--done":""}`,onClick:l,title:n?"Copied":`Copy ${t}`,"aria-label":n?`Copied ${t}`:`Copy ${t}`,children:n?e.jsx("svg",{viewBox:"0 0 12 12",width:"11",height:"11","aria-hidden":"true",children:e.jsx("path",{d:"M2.5 6.2 4.8 8.5 9.5 3.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}):e.jsxs("svg",{viewBox:"0 0 12 12",width:"11",height:"11","aria-hidden":"true",children:[e.jsx("rect",{x:"3.4",y:"3.4",width:"5.8",height:"5.8",rx:"1.3",fill:"none",stroke:"currentColor",strokeWidth:"1"}),e.jsx("path",{d:"M2.4 7.2V2.8c0-.4.3-.7.7-.7h4",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})]})})}function Pe({path:s,basePath:t,agentId:n,sessionId:i,label:r}){return e.jsx("button",{type:"button",className:"s-lane-sheet-reveal",title:`Reveal ${r} in OS`,"aria-label":`Reveal ${r} in OS`,onClick:l=>{l.preventDefault(),l.stopPropagation(),ys({path:s,basePath:t,agentId:n,sessionId:i}).catch(h=>console.warn("Failed to reveal local path",h))},children:e.jsx(he,{size:11,strokeWidth:1.6})})}function K({id:s,label:t,count:n,actions:i}){return e.jsxs("div",{className:"s-lane-sheet-sechead",id:s,children:[e.jsx("span",{className:"s-lane-sheet-sechead-label",children:t}),n!=null&&n!==!1&&e.jsx("span",{className:"s-lane-sheet-sechead-count",children:n}),e.jsx("span",{className:"s-lane-sheet-sechead-rule","aria-hidden":"true"}),i&&e.jsx("span",{className:"s-lane-sheet-sechead-actions",children:i})]})}function C({children:s,onClick:t,primary:n=!1,disabled:i=!1}){return e.jsx("button",{type:"button",className:`s-lane-sheet-ghost${n?" s-lane-sheet-ghost--primary":""}`,onClick:t,disabled:i,children:s})}function y({label:s,value:t,title:n,copy:i,reveal:r}){return e.jsxs("div",{className:"s-lane-sheet-meta-row",children:[e.jsx("dt",{children:s}),e.jsxs("dd",{className:"s-lane-sheet-fact",children:[e.jsx("span",{className:"s-lane-sheet-fact-val",title:n??t,children:t}),r&&e.jsx(Pe,{...r,label:s}),i&&e.jsx(U,{value:i,label:s})]})]})}function ie({file:s,basePath:t,agentId:n,sessionId:i,onOpen:r}){const l=Se(s),h=s.path,I=oe(h,t),{dir:S,base:L}=js(h),A=s.add>0||s.del>0;return e.jsxs("div",{className:"s-lane-sheet-frow",title:h,children:[e.jsx("span",{className:`s-lane-sheet-fstate s-lane-sheet-fstate--${s.state}`,"aria-hidden":"true",children:ms[s.state]??"○"}),e.jsxs("span",{className:"s-lane-sheet-fpath",children:[S&&e.jsx("span",{className:"s-lane-sheet-fdir",children:S}),e.jsx("span",{className:"s-lane-sheet-fbase",children:L})]}),A&&e.jsxs("span",{className:"s-lane-sheet-fdiff",children:[s.add>0&&e.jsxs("span",{className:"s-lane-sheet-file-add",children:["+",s.add]}),s.del>0&&e.jsxs("span",{className:"s-lane-sheet-file-del",children:["−",s.del]})]}),e.jsxs("span",{className:"s-lane-sheet-frow-acts",children:[e.jsx("button",{type:"button",className:"s-lane-sheet-rowact",title:`Open ${l} in diff`,"aria-label":`Open ${l} in diff`,onClick:()=>r(I),children:e.jsx(he,{size:11,strokeWidth:1.6})}),e.jsx(Pe,{path:h,basePath:t,agentId:n,sessionId:i,label:l}),e.jsx(U,{value:h,label:"file path"})]})]})}function Cs({entry:s}){const{dir:t,rest:n}=Xe(Ye(s.command)),i=Ze(n||s.command);return e.jsxs("div",{className:"s-lane-sheet-crow",title:s.command,children:[e.jsx("span",{className:"s-lane-sheet-cmark","aria-hidden":"true",children:"❯"}),e.jsxs("span",{className:"s-lane-sheet-ctext",children:[t&&e.jsxs("span",{className:"s-lane-sheet-bash-dir",children:[t,"/"]}),i.map((r,l)=>e.jsxs("span",{className:`s-lane-sheet-bash-${r.tier}${r.known?" s-lane-sheet-bash-prog--known":""}${r.flag?" s-lane-sheet-bash-flag":""}`,children:[l>0?" ":"",r.text]},l))]}),s.outcome&&e.jsx("span",{className:"s-lane-sheet-cresult",children:s.outcome}),e.jsx("span",{className:"s-lane-sheet-crow-acts",children:e.jsx(U,{value:s.command,label:"command"})})]})}function Ce({label:s,hint:t,children:n}){const[i,r]=o.useState(!1);return e.jsxs("div",{className:`s-lane-sheet-disc${i?" s-lane-sheet-disc--open":""}`,children:[e.jsxs("button",{type:"button",className:"s-lane-sheet-disc-head","aria-expanded":i,onClick:()=>r(l=>!l),children:[e.jsx("span",{className:`s-lane-sheet-disc-caret${i?" s-lane-sheet-disc-caret--open":""}`,"aria-hidden":"true",children:"›"}),e.jsx("span",{className:"s-lane-sheet-disc-label",children:s}),t!=null&&t!==!1&&e.jsx("span",{className:"s-lane-sheet-disc-hint",children:t})]}),i&&e.jsx("div",{className:"s-lane-sheet-disc-body",children:n})]})}function Ss({plan:s,onOpen:t}){const[n,i]=o.useState(!1),r=s.steps.filter(h=>h.status==="completed").length,l=s.steps.find(h=>h.status==="in_progress");return e.jsxs("div",{className:`s-lane-sheet-plan${n?" s-lane-sheet-plan--open":""}`,children:[e.jsxs("button",{type:"button",className:"s-lane-sheet-plan-head","aria-expanded":n,onClick:()=>i(h=>!h),children:[e.jsx("span",{className:`s-lane-sheet-plan-caret${n?" s-lane-sheet-plan-caret--open":""}`,"aria-hidden":"true",children:"›"}),e.jsx("span",{className:"s-lane-sheet-plan-title",title:s.title,children:s.title}),e.jsxs("span",{className:"s-lane-sheet-plan-tally",children:[r,"/",s.steps.length]})]}),!n&&l&&e.jsxs("div",{className:"s-lane-sheet-plan-now",title:l.text,children:[e.jsx("span",{className:"s-lane-sheet-plan-now-mark","aria-hidden":"true",children:"▸"}),e.jsx("span",{className:"s-lane-sheet-plan-now-text",children:l.text})]}),n&&e.jsxs("div",{className:"s-lane-sheet-plan-steps",children:[s.steps.map(h=>e.jsxs("div",{className:`s-lane-sheet-pstep s-lane-sheet-pstep--${h.status}`,children:[e.jsx("span",{className:"s-lane-sheet-pstep-box","aria-hidden":"true",children:h.status==="completed"?"✓":h.status==="in_progress"?"▸":"○"}),e.jsx("span",{className:"s-lane-sheet-pstep-text",children:h.text})]},h.id)),e.jsx("div",{className:"s-lane-sheet-plan-foot",children:e.jsx(C,{onClick:t,children:"Open in Plans →"})})]})]})}function Ls({document:s,expanded:t,onToggle:n,onOpen:i}){const r=ls(s),l=s.steps.length>0;return e.jsxs("article",{className:"s-lane-sheet-doc",children:[e.jsxs("button",{type:"button",className:"s-lane-sheet-doc-head","aria-expanded":t,onClick:n,children:[e.jsx("span",{className:"s-lane-sheet-doc-title",children:s.title}),e.jsxs("span",{className:"s-lane-sheet-doc-meta",children:[l?`${s.steps.length} steps`:Se(s.path)," · ",re(s.updatedAt)]}),!t&&r&&e.jsx("span",{className:"s-lane-sheet-doc-excerpt",children:r})]}),t&&e.jsxs("div",{className:"s-lane-sheet-doc-body",children:[s.summary&&e.jsx("p",{className:"s-lane-sheet-doc-summary",children:s.summary}),l&&s.steps.length>0&&e.jsx("ol",{className:"s-lane-sheet-doc-steps",children:s.steps.map(h=>e.jsxs("li",{className:`s-lane-sheet-doc-step s-lane-sheet-doc-step--${h.status}`,children:[e.jsx("span",{className:"s-lane-sheet-doc-step-state",children:ps[h.status]}),e.jsx("span",{className:"s-lane-sheet-doc-step-text",children:h.text})]},h.id))}),(s.body||s.rawText)&&e.jsx("pre",{className:"s-lane-sheet-doc-pre",children:s.body||s.rawText}),e.jsx("button",{type:"button",className:"s-lane-sheet-doc-open",onClick:i,children:"Open in Plans"})]})]})}function $s({lane:s,navigate:t,returnRoute:n,onClose:i,navigationEnabled:r=!0}){const{agent:l,observe:h,source:I,lastActiveAt:S}=s,{openFilePreview:L}=Qe(),A=o.useMemo(()=>Ge(l.state??null,l),[l]),N=o.useMemo(()=>ss(h,l,{isLive:A}),[h,l,A]),[O,Q]=o.useState(!1),[D,ue]=o.useState([]),[F,me]=o.useState([]),[Ae,Oe]=o.useState(null),[R,De]=o.useState(!1),[Fe,pe]=o.useState(!1),[_,fe]=o.useState(!1),[xe,X]=o.useState(null),[f,Y]=o.useState("s-lane-sheet-vitals"),E=o.useRef(null),Z=o.useRef(null);o.useEffect(()=>()=>{E.current&&clearTimeout(E.current)},[]);const je=o.useCallback(a=>{typeof window>"u"||window.location.hash!==`#${a}`&&Ue({hash:a,replace:!1})},[]),W=o.useCallback(a=>{const u=Z.current,p=u?.querySelector(`#${a}`);if(!u||!p)return!1;const j=u.getBoundingClientRect().top,w=p.getBoundingClientRect().top;return u.scrollTop=Math.max(0,u.scrollTop+w-j),Y(a),!0},[]),T=o.useCallback((a,u)=>{a.preventDefault(),W(u)&&je(u)},[W,je]),z=is(l,I),Ee=rs(l,I),c=o.useMemo(()=>Le(s),[s]),d=s.facts,$=d?.turn?.phase?d.turn.phase==="started":A,m=o.useMemo(()=>{const a=d?.touchedFiles.length?d.touchedFiles:ts(h,1/0),u=ks(a,h),p=u.filter(g=>g.state==="created"),j=u.filter(g=>g.state==="modified"),w=u.filter(g=>g.state==="read"),M=[...p,...j];return{created:p,modified:j,read:w,changed:M,totalAdd:M.reduce((g,v)=>g+v.add,0),totalDel:M.reduce((g,v)=>g+v.del,0)}},[d,h]),H=m.changed.length+m.read.length,k=o.useMemo(()=>ws(h),[h]),ee=o.useMemo(()=>m.changed.map(a=>oe(a.path,c.cwd)).join(`
|
|
3
|
-
`),[m.changed,c.cwd]),ge=o.useMemo(()=>{const a=[`agent: ${z}`],u=l.harness??c.harness,p=d?.model??c.model;(u||p||d?.effort)&&a.push(`harness: ${[u,p,d?.effort].filter(Boolean).join(" · ")}`);const j=d?.branch??c.branch;return j&&a.push(`branch: ${j}`),c.cwd&&a.push(`cwd: ${c.cwd}`),c.sessionId&&a.push(`session: ${c.sessionId}`),l.harnessLogPath&&a.push(`transcript: ${l.harnessLogPath}`),d?.originator&&a.push(`origin: ${d.originator}`),a.join(`
|
|
4
|
-
`)},[l,d,z,c]),ve=o.useMemo(()=>k.map(a=>a.command).join(`
|
|
5
|
-
`),[k]),Be=o.useCallback(()=>{V(ge)},[ge]),Me=o.useCallback(()=>{V(ve)},[ve]),Re=o.useCallback(()=>{for(const a of m.changed)L(oe(a.path,c.cwd))},[m.changed,c.cwd,L]),_e=o.useCallback(()=>{ee&&V(ee).then(a=>{a&&(pe(!0),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>pe(!1),1100))})},[ee]),x=d?.usage??c.usage,Ne=o.useMemo(()=>x?[{label:"in",value:x.inputTokens},{label:"out",value:x.outputTokens},{label:"cache rd",value:x.cacheReadInputTokens},{label:"cache wr",value:x.cacheCreationInputTokens},{label:"total",value:x.totalTokens},{label:"reasoning",value:x.reasoningOutputTokens}].filter(a=>typeof a.value=="number"):[],[x]),b=o.useMemo(()=>Ke(x,{model:d?.model??c.model,adapterType:l.harness??c.harness}),[x,d?.model,c.model,l.harness,c.harness]),se=!!(d?.compaction?.eligible&&cs(l.harness??c.harness)&&c.sessionId),We=o.useCallback(async()=>{if(!(!se||_)){fe(!0),X(null);try{const a=await os({harness:l.harness??c.harness,sessionId:c.sessionId,transcriptPath:l.harnessLogPath,agentId:l.id});(!a.ok||!a.delivered)&&X(a.error??"Compaction was not delivered to the harness")}catch(a){X(a instanceof Error?a.message:"Compaction request failed")}finally{fe(!1)}}},[l.harness,l.harnessLogPath,l.id,se,_,c.harness,c.sessionId]),be=S?re(S):null,q=o.useMemo(()=>Ie(s),[s]),P=o.useMemo(()=>us(s),[s]),J=o.useMemo(()=>hs(s),[s]),B=o.useCallback(()=>{!r||!q||(te(t,q,{returnTo:n}),i())},[t,r,i,n,q]),ae=o.useCallback(()=>{if(r){if(P){te(t,P,{returnTo:n}),i();return}B()}},[t,r,i,B,P,n]),G=o.useCallback(()=>{!r||!J||(te(t,J,{returnTo:n}),i())},[t,r,i,n,J]);o.useEffect(()=>{const a=u=>{if(!es(u.target))switch(u.key.toLowerCase()){case"o":u.preventDefault(),B();break;case"t":u.preventDefault(),G();break;case"p":if(!P)return;u.preventDefault(),ae();break}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[ae,B,G,P]);const we=o.useCallback(a=>{r&&(t({view:"ops",mode:"plan",planDocumentId:a}),i())},[t,r,i]);return o.useEffect(()=>{let a=!1;return Q(!1),de("/api/plan-documents").then(u=>{if(a)return;const p=ns(u.documents,s);ue(p.plans),me(p.docs),Q(!0)}).catch(()=>{a||(ue([]),me([]),Q(!0))}),()=>{a=!0}},[s.id]),o.useEffect(()=>{const a=()=>{const u=fs();u&&window.requestAnimationFrame(()=>{W(u)})};return a(),window.addEventListener("hashchange",a),window.addEventListener("popstate",a),()=>{window.removeEventListener("hashchange",a),window.removeEventListener("popstate",a)}},[s.id,k.length,W]),o.useEffect(()=>{const a=Z.current;if(!a)return;let u=0;const p=()=>{u=0;const w=Te.map(v=>a.querySelector(`#${v}`)).filter(v=>!!v);if(w.length===0)return;if(a.scrollTop+a.clientHeight>=a.scrollHeight-2){const v=w[w.length-1].id;ce(v)&&Y(v);return}const M=a.getBoundingClientRect().top+18,g=w.reduce((v,ke)=>ke.getBoundingClientRect().top<=M?ke:v,w[0]);ce(g.id)&&Y(g.id)},j=()=>{u||(u=window.requestAnimationFrame(p))};return p(),a.addEventListener("scroll",j,{passive:!0}),window.addEventListener("resize",j),()=>{u&&window.cancelAnimationFrame(u),a.removeEventListener("scroll",j),window.removeEventListener("resize",j)}},[k.length,O,D.length,F.length]),e.jsxs(ze,{open:!0,onClose:i,side:"right",owner:"openscout.agent-lane",resizable:!0,defaultSize:720,minSize:420,maxSize:960,scrollLock:!0,ariaLabel:`${z} lane detail`,className:"s-lane-sheet",children:[e.jsxs("div",{className:"s-slide-header s-lane-sheet-header",children:[e.jsx(He,{agent:l,placement:"row",size:28,presence:!1,className:"s-agent-lane-avatar"}),e.jsxs("div",{className:"s-lane-sheet-header-copy",children:[e.jsx("div",{className:"s-lane-sheet-title",children:z}),e.jsxs("div",{className:"s-lane-sheet-sub",children:[Ee," · ",S?re(S):"idle"]})]}),e.jsx("span",{className:"s-slide-spacer"}),e.jsxs("div",{className:"s-lane-sheet-header-cta",children:[e.jsx(qe,{harness:l.harness??c.harness,size:18,className:`s-lane-sheet-hmark${$?" s-lane-sheet-hmark--working":""}`}),r?e.jsxs(e.Fragment,{children:[e.jsx(C,{primary:!0,onClick:B,disabled:!q,children:"Open session"}),P?e.jsx(C,{onClick:ae,children:"Agent profile"}):null,e.jsx(C,{onClick:G,disabled:!J,children:"Traces"})]}):null]}),e.jsx("button",{type:"button",className:"s-slide-close",onClick:i,"aria-label":"Close",children:"×"})]}),e.jsxs("nav",{className:"s-lane-sheet-anchors","aria-label":"Jump to section",children:[e.jsx("a",{href:"#s-lane-sheet-vitals",className:`s-lane-sheet-anchor${f==="s-lane-sheet-vitals"?" s-lane-sheet-anchor--active":""}`,"aria-current":f==="s-lane-sheet-vitals"?"location":void 0,onClick:a=>T(a,"s-lane-sheet-vitals"),children:"Vitals"}),e.jsx("a",{href:"#s-lane-sheet-runtime",className:`s-lane-sheet-anchor${f==="s-lane-sheet-runtime"?" s-lane-sheet-anchor--active":""}`,"aria-current":f==="s-lane-sheet-runtime"?"location":void 0,onClick:a=>T(a,"s-lane-sheet-runtime"),children:"Runtime"}),e.jsxs("a",{href:"#s-lane-sheet-files",className:`s-lane-sheet-anchor${f==="s-lane-sheet-files"?" s-lane-sheet-anchor--active":""}`,"aria-current":f==="s-lane-sheet-files"?"location":void 0,onClick:a=>T(a,"s-lane-sheet-files"),children:["Files",H>0&&e.jsx("span",{className:"s-lane-sheet-anchor-n",children:H})]}),k.length>0&&e.jsxs("a",{href:"#s-lane-sheet-commands",className:`s-lane-sheet-anchor${f==="s-lane-sheet-commands"?" s-lane-sheet-anchor--active":""}`,"aria-current":f==="s-lane-sheet-commands"?"location":void 0,onClick:a=>T(a,"s-lane-sheet-commands"),children:["Commands",e.jsx("span",{className:"s-lane-sheet-anchor-n",children:k.length})]}),e.jsx("a",{href:"#s-lane-sheet-plans",className:`s-lane-sheet-anchor${f==="s-lane-sheet-plans"?" s-lane-sheet-anchor--active":""}`,"aria-current":f==="s-lane-sheet-plans"?"location":void 0,onClick:a=>T(a,"s-lane-sheet-plans"),children:"Plans"}),e.jsx("a",{href:"#s-lane-sheet-docs",className:`s-lane-sheet-anchor${f==="s-lane-sheet-docs"?" s-lane-sheet-anchor--active":""}`,"aria-current":f==="s-lane-sheet-docs"?"location":void 0,onClick:a=>T(a,"s-lane-sheet-docs"),children:"Docs"}),$&&d?.turn&&e.jsxs("span",{className:"s-lane-sheet-anchorbar-turn",children:["turn ",d.turn.phase,d.turn.index?` · #${d.turn.index}`:""]})]}),e.jsxs("div",{ref:Z,className:`s-slide-body s-lane-sheet-body${$?" s-lane-sheet-body--working":" s-lane-sheet-body--idle"}`,children:[e.jsxs("section",{id:"s-lane-sheet-vitals",className:`s-lane-sheet-section s-lane-sheet-vitals${$?"":" s-lane-sheet-vitals--idle"}`,children:[N&&e.jsxs("div",{className:"s-lane-sheet-vitals-now",children:[e.jsxs("div",{className:"s-lane-sheet-vitals-now-top",children:[e.jsxs("span",{className:"s-lane-sheet-vitals-live","aria-hidden":"true",children:[e.jsx("span",{className:"s-lane-sheet-vitals-live-dot"}),e.jsx("span",{className:"s-lane-sheet-vitals-live-ring"})]}),e.jsx("span",{className:"s-lane-sheet-vitals-now-label",children:$?"executing now":"last action"}),$&&d?.turn&&e.jsxs("span",{className:"s-lane-sheet-vitals-now-turn",children:["turn ",d.turn.phase,d.turn.index?` · #${d.turn.index}`:""]})]}),e.jsxs("div",{className:"s-lane-sheet-vitals-well",children:[N.headlineFrom==="user"?e.jsx("span",{className:"s-lane-sheet-vitals-prompt","aria-hidden":"true",children:"←"}):N.headlineFrom==="agent"?e.jsx("span",{className:"s-lane-sheet-vitals-prompt","aria-hidden":"true",children:"→"}):e.jsx("span",{className:"s-lane-sheet-vitals-prompt s-lane-sheet-vitals-prompt--cmd","aria-hidden":"true",children:"❯"}),e.jsx("span",{className:"s-lane-sheet-vitals-cmd",title:N.headFull,children:N.headline}),$&&e.jsx("span",{className:"s-lane-sheet-vitals-caret","aria-hidden":"true"}),e.jsxs("span",{className:"s-lane-sheet-vitals-now-acts",children:[r&&e.jsx("button",{type:"button",className:"s-lane-sheet-reveal",title:"Open trace at this step","aria-label":"Open trace",onClick:G,children:e.jsx(he,{size:11,strokeWidth:1.6})}),N.headFull&&N.headFull!==N.headline&&e.jsx(U,{value:N.headFull,label:"current action"})]})]})]}),b&&e.jsxs("div",{className:`s-lane-sheet-vitals-gauge${b.overLimit?" s-lane-sheet-vitals-gauge--over":""}`,children:[e.jsxs("div",{className:"s-lane-sheet-vitals-gauge-top",children:[e.jsx("span",{className:"s-lane-sheet-vitals-gauge-label",children:"context"}),e.jsxs("span",{className:"s-lane-sheet-vitals-gauge-read",children:[e.jsx("b",{children:b.usedLabel}),e.jsxs("span",{className:"s-lane-sheet-vitals-gauge-of",children:[" / ",b.budgetLabel]}),e.jsx("span",{className:"s-lane-sheet-vitals-gauge-unit",children:" tokens"}),e.jsxs("span",{className:"s-lane-sheet-vitals-gauge-pct",children:[b.pct,"%",b.overLimit?" over":""]})]}),se&&e.jsx("button",{type:"button",className:"s-lane-sheet-vitals-compact",onClick:()=>{We()},disabled:_,title:"Force a context compaction on this live session",children:_?"Compacting…":"Compact context"})]}),e.jsxs("div",{className:"s-lane-sheet-vitals-gaugebar",role:"meter","aria-label":"context budget","aria-valuenow":b.pct,"aria-valuemin":0,"aria-valuemax":Math.max(100,b.pct),children:[e.jsx("span",{className:"s-lane-sheet-vitals-gaugebar-fill",style:{width:`${Ve(b)}%`},children:e.jsx("span",{className:"s-lane-sheet-vitals-gaugebar-edge","aria-hidden":"true"})}),[25,50,75].map(a=>e.jsx("span",{className:"s-lane-sheet-vitals-gaugebar-tick",style:{left:`${a}%`},"aria-hidden":"true"},a))]}),xe&&e.jsx("div",{className:"s-lane-sheet-vitals-compact-error",role:"status",children:xe}),d?.compaction?.lastCompactedSummary&&e.jsxs("div",{className:"s-lane-sheet-vitals-compact-note",children:["last compaction · ",d.compaction.lastCompactedSummary]})]}),e.jsxs("div",{className:"s-lane-sheet-vitals-cadence",children:[e.jsx("b",{children:ne(c.events)})," events · ",e.jsx("b",{children:ne(c.tools)})," tools",be?e.jsxs(e.Fragment,{children:[" · ",be]}):null]})]}),e.jsxs("section",{id:"s-lane-sheet-runtime",className:"s-lane-sheet-section",children:[e.jsxs(Ce,{label:"Runtime",hint:[l.harness??c.harness,d?.model??c.model].filter(Boolean).join(" · ")||void 0,children:[e.jsxs("dl",{className:"s-lane-sheet-meta",children:[e.jsx(y,{label:"Effort",value:d?.effort??"—"}),e.jsx(y,{label:"Branch",value:d?.branch??c.branch??"—",copy:d?.branch??c.branch??null}),e.jsx(y,{label:"Working dir",value:le(c.cwd),title:c.cwd??void 0,copy:c.cwd??null,reveal:c.cwd?{path:c.cwd,basePath:c.cwd,agentId:l.id,sessionId:c.sessionId}:void 0}),e.jsx(y,{label:"Session",value:le(c.sessionId,36),title:c.sessionId??void 0,copy:c.sessionId??null}),l.harnessLogPath&&e.jsx(y,{label:"Transcript",value:le(l.harnessLogPath,36),title:l.harnessLogPath,copy:l.harnessLogPath,reveal:{path:l.harnessLogPath,basePath:c.cwd,agentId:l.id,sessionId:c.sessionId}}),e.jsx(y,{label:"Origin",value:d?.originator??"—",copy:d?.originator??null}),e.jsx(y,{label:"Attribution",value:d?.attribution?Je(d.attribution):"—"}),d?.currentTask&&e.jsx(y,{label:"Task",value:d.currentTask,title:d.currentTask,copy:d.currentTask})]}),e.jsx("div",{className:"s-lane-sheet-disc-bar",children:e.jsx(C,{onClick:Be,children:"Copy diagnostics"})})]}),Ne.length>0&&e.jsx(Ce,{label:"Tokens",hint:typeof x?.totalTokens=="number"?xs(x.totalTokens):void 0,children:e.jsx("div",{className:"s-lane-sheet-dials",children:Ne.map(a=>e.jsxs("span",{className:"s-lane-sheet-dial",children:[e.jsx("span",{className:"s-lane-sheet-dial-value",children:ne(a.value)}),e.jsx("span",{className:"s-lane-sheet-dial-label",children:a.label})]},a.label))})})]}),e.jsxs("section",{id:"s-lane-sheet-files",className:"s-lane-sheet-section",children:[e.jsx(K,{label:"Files",count:H>0?`${m.changed.length} changed · ${m.read.length} read`:void 0,actions:m.changed.length>0?e.jsxs(e.Fragment,{children:[(m.totalAdd>0||m.totalDel>0)&&e.jsxs("span",{className:"s-lane-sheet-file-diff","aria-hidden":"true",children:[m.totalAdd>0&&e.jsxs("span",{className:"s-lane-sheet-file-add",children:["+",m.totalAdd]}),m.totalDel>0&&e.jsxs("span",{className:"s-lane-sheet-file-del",children:["−",m.totalDel]})]}),e.jsx(C,{onClick:_e,children:Fe?"Copied":"Copy changed"}),e.jsx(C,{onClick:Re,children:"Open all → diff"})]}):void 0}),H===0?e.jsx("div",{className:"s-lane-sheet-empty",children:"No files touched in this session yet."}):e.jsxs("div",{className:"s-lane-sheet-filegroups",children:[m.created.length>0&&e.jsxs("div",{className:"s-lane-sheet-filegroup",children:[e.jsxs("div",{className:"s-lane-sheet-fglabel",children:[e.jsx("span",{className:"s-lane-sheet-fgmark s-lane-sheet-fgmark--created","aria-hidden":"true"}),"new",e.jsx("span",{className:"s-lane-sheet-fgcount",children:m.created.length})]}),e.jsx("div",{className:"s-lane-sheet-files",children:m.created.map(a=>e.jsx(ie,{file:a,basePath:c.cwd,agentId:l.id,sessionId:c.sessionId,onOpen:L},a.path))})]}),m.modified.length>0&&e.jsxs("div",{className:"s-lane-sheet-filegroup",children:[e.jsxs("div",{className:"s-lane-sheet-fglabel",children:[e.jsx("span",{className:"s-lane-sheet-fgmark s-lane-sheet-fgmark--modified","aria-hidden":"true"}),"modified",e.jsx("span",{className:"s-lane-sheet-fgcount",children:m.modified.length})]}),e.jsx("div",{className:"s-lane-sheet-files",children:m.modified.map(a=>e.jsx(ie,{file:a,basePath:c.cwd,agentId:l.id,sessionId:c.sessionId,onOpen:L},a.path))})]}),m.read.length>0&&e.jsxs("div",{className:"s-lane-sheet-filegroup",children:[e.jsxs("button",{type:"button",className:"s-lane-sheet-fglabel s-lane-sheet-fglabel--btn","aria-expanded":R,onClick:()=>De(a=>!a),children:[e.jsx("span",{className:`s-lane-sheet-fgcaret${R?" s-lane-sheet-fgcaret--open":""}`,"aria-hidden":"true",children:"›"}),e.jsx("span",{className:"s-lane-sheet-fgmark s-lane-sheet-fgmark--read","aria-hidden":"true"}),"read",e.jsx("span",{className:"s-lane-sheet-fgcount",children:m.read.length}),!R&&e.jsx("span",{className:"s-lane-sheet-fghint",children:"collapsed"})]}),R&&e.jsx("div",{className:"s-lane-sheet-files",children:m.read.map(a=>e.jsx(ie,{file:a,basePath:c.cwd,agentId:l.id,sessionId:c.sessionId,onOpen:L},a.path))})]})]})]}),k.length>0&&e.jsxs("section",{id:"s-lane-sheet-commands",className:"s-lane-sheet-section",children:[e.jsx(K,{label:"Commands",count:"recent",actions:e.jsx(C,{onClick:Me,children:"Copy all"})}),e.jsx("div",{className:"s-lane-sheet-cmds",children:k.map(a=>e.jsx(Cs,{entry:a},a.id))})]}),e.jsxs("section",{id:"s-lane-sheet-plans",className:"s-lane-sheet-section",children:[e.jsx(K,{label:"Plans",count:O&&D.length>0?D.length:void 0}),O?D.length===0?e.jsx("div",{className:"s-lane-sheet-empty",children:"No plans matched this session yet."}):e.jsx("div",{className:"s-lane-sheet-plans",children:D.map(a=>e.jsx(Ss,{plan:a,onOpen:()=>we(a.id)},a.id))}):e.jsx("div",{className:"s-lane-sheet-empty",children:"Indexing plan documents…"})]}),e.jsxs("section",{id:"s-lane-sheet-docs",className:"s-lane-sheet-section",children:[e.jsx(K,{label:"Docs",count:O&&F.length>0?F.length:void 0}),O?F.length===0?e.jsx("div",{className:"s-lane-sheet-empty",children:"No related docs matched this session yet."}):e.jsx("div",{className:"s-lane-sheet-docs",children:F.map(a=>e.jsx(Ls,{document:a,expanded:Ae===a.id,onToggle:()=>Oe(u=>u===a.id?null:a.id),onOpen:()=>we(a.id)},a.id))}):e.jsx("div",{className:"s-lane-sheet-empty",children:"Indexing documents…"})]})]})]})}const Us=Object.freeze(Object.defineProperty({__proto__:null,AgentLaneDetailSheet:$s},Symbol.toStringTag,{value:"Module"}));export{$s as A,Us as a,$e as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,j as m}from"./index-sUomXsrf.js";import{u as a}from"./Provider-tFc3jqZ4.js";import{A as n}from"./AgentLanesView-CxfbV8Kd.js";import{i as c,j as l}from"./router-Dja9_ygK.js";import"./api-h5zurxmi.js";import"./sse-CVoGDiKW.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-BlBQhpax.js";import"./DocumentFocusViewer-DU_9BHsD.js";import"./createLucideIcon-DlxlBfLC.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./x-0XjXwGqq.js";import"./chevron-right-CyUa1zXx.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-lWOOKezu.js";import"./index-m6dFtY5f.js";import"./HarnessMark-Dm_qm1Ku.js";import"./conversation-model-C4yb6_FA.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin--pHWUb4V.js";import"./agent-chat-Bfjd9y6c.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BFai6ZfE.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";/* empty css */import"./tail-events-CTipUIli.js";import"./observe-uJfIlIUV.js";import"./terminal-sessions-D5CIR2OL.js";import"./types-B0PlfpKc.js";import"./AgentAvatar-CufDA4A-.js";import"./SpriteAvatar-CQs-jC-v.js";import"./agent-identity-xQHedtLl.js";import"./SessionObserve-Dlx5vDaV.js";import"./bash-format-BRV5C6Gv.js";import"./tail-display-BdyoLvzY.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-BzehBmdi.js";import"./lane-observe-DrhKkQ3A.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-CY_wPZc5.js";import"./AgentDetailCard-DxxVkgT1.js";import"./AgentLiveActions-CZdAInEu.js";import"./terminal-takeover-X97KCSJk.js";import"./openContent-C6XO6kr5.js";import"./eye-So8tNNK6.js";import"./terminal-DXQISjZn.js";import"./message-markup-C8Nx04sP.js";import"./ObservedTopologyPanel-Dv6fbHzW.js";import"./ObserveTextFlow-CBitljxi.js";import"./use-reduced-motion-Cvk-HRKg.js";import"./SessionObserveEvidence-ChBD1d4c.js";import"./message-circle-C5UZ6fO7.js";import"./wrench-pEVd8JnN.js";import"./external-link-CnjcXf32.js";import"./AgentFloorView-CycUn0Lv.js";/* empty css */import"./agent-lanes-model-Bl6xfviL.js";import"./context-budget-DX_fwUs3.js";import"./lane-roster-store-NE15Oe6M.js";import"./AgentLanesPreflight-KWfLcaNB.js";import"./AgentLaneChrome-BfVygkgL.js";import"./AgentLaneCard-DTUvE96I.js";/* empty css */import"./AgentLaneSummaryResize-CMgzYvAA.js";import"./clipboard-e3fSpeo7.js";import"./agent-lane-card-model-BCIwPjEh.js";import"./agent-lane-preview-BtnfNyFR.js";import"./AgentLaneDetailSheet-CWs9wKWk.js";import"./SlidePanel-FCqT1zO3.js";import"./agent-lane-detail-Cw4QVAgH.js";import"./LaneTraceDetailSheet-CBf_aNZx.js";import"./LaneTraceEventFocus-DYvHfs_3.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-sUomXsrf.js";import{p as v,a as b}from"./api-h5zurxmi.js";import{u as Q,e as Z}from"./Provider-tFc3jqZ4.js";import{P as ee,b as te}from"./router-Dja9_ygK.js";import{u as se}from"./sse-CVoGDiKW.js";import{o as oe,i as D}from"./surface-activity-B1rgWB1i.js";/* empty css */import{AgentsSubnav as ne}from"./AgentsSubnav-BTNjPYoA.js";import{AgentsLibrary as ie}from"./library-CLpgWNJO.js";import{r as re,d as ae}from"./model-Co0zkMIc.js";import{AgentDetailWithRail as de,AgentProfileBar as le}from"./profile-BqY5tesX.js";/* empty css *//* empty css *//* empty css */import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-BlBQhpax.js";import"./DocumentFocusViewer-DU_9BHsD.js";import"./createLucideIcon-DlxlBfLC.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./x-0XjXwGqq.js";import"./chevron-right-CyUa1zXx.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-lWOOKezu.js";import"./index-m6dFtY5f.js";import"./HarnessMark-Dm_qm1Ku.js";import"./conversation-model-C4yb6_FA.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin--pHWUb4V.js";import"./agent-chat-Bfjd9y6c.js";import"./chevron-down-BFai6ZfE.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./terminal-sessions-D5CIR2OL.js";import"./index-BWHgHrtv.js";import"./SecondaryNav-Bks0CO2h.js";import"./secondaryNavConfig-Drb7wPG4.js";import"./message-square-BD-4UUdc.js";import"./terminal-DXQISjZn.js";import"./scroll-text-BIYf6g6N.js";/* empty css */import"./SpriteAvatar-CQs-jC-v.js";import"./agent-identity-xQHedtLl.js";import"./AgentSessions-Bkr0lyry.js";import"./openContent-C6XO6kr5.js";import"./clipboard-e3fSpeo7.js";import"./text-DsBWV_4k.js";import"./agents-project-model-UYiamtrU.js";import"./AgentAvatar-CufDA4A-.js";import"./context-budget-DX_fwUs3.js";import"./session-catalog-XhGxCtP-.js";import"./terminal-relay-B5Sma7fK.js";import"./BackToPicker-CkUmHuuo.js";import"./ConversationScreen-Dz2d_Z_F.js";import"./ConversationComposer-BBNPa5S9.js";import"./message-markup-C8Nx04sP.js";import"./mentions-CY_wPZc5.js";import"./AgentDetailCard-DxxVkgT1.js";import"./AgentLiveActions-CZdAInEu.js";import"./terminal-takeover-X97KCSJk.js";import"./eye-So8tNNK6.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./types-B0PlfpKc.js";import"./ConversationHeader-DXMT-YXv.js";import"./ConversationFeedRows-BuejHMCY.js";import"./ConversationPanels-DHCtilQF.js";import"./use-reduced-motion-Cvk-HRKg.js";import"./activity-WhBf3FXP.js";import"./message-circle-C5UZ6fO7.js";import"./tail-display-BdyoLvzY.js";import"./lane-edit-display-C_Aujldz.js";import"./tail-events-CTipUIli.js";import"./ConversationStatus-DSgdVofa.js";import"./conversation-icons-DohQL6GI.js";import"./SessionObserve-Dlx5vDaV.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-BzehBmdi.js";import"./lane-observe-DrhKkQ3A.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-Dv6fbHzW.js";import"./ObserveTextFlow-CBitljxi.js";import"./SessionObserveEvidence-ChBD1d4c.js";import"./wrench-pEVd8JnN.js";import"./external-link-CnjcXf32.js";import"./AgentDefinitionsWorkspace-FpEkb-tu.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-C9Ly01Ef.js";/* empty css */import"./agent-essentials-DyJiUGpZ.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 js({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{js as AgentsScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./index-sUomXsrf.js";import{S as i}from"./SecondaryNav-Bks0CO2h.js";import{A as m}from"./secondaryNavConfig-Drb7wPG4.js";import"./createLucideIcon-DlxlBfLC.js";import"./message-square-BD-4UUdc.js";import"./file-text-i3xTDUjJ.js";import"./search-DCT_EvPr.js";import"./terminal-DXQISjZn.js";import"./code-xml-05TD3uOC.js";import"./scroll-text-BIYf6g6N.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,5 +0,0 @@
|
|
|
1
|
-
import{r as n,j as e}from"./index-sUomXsrf.js";import{r as xs}from"./index-m6dFtY5f.js";import{D as js}from"./runtime-picker-DOZpZOlt.js";import{E as Ee}from"./EmptyState-CoL-QuUO.js";import{u as ks,i as vs}from"./MessageComposerSuggestions-zAUUcLOv.js";import{r as ws,R as Ns,e as Ss,a as Cs}from"./NewChatComposer-B5FnPyzS.js";import{a as le}from"./api-h5zurxmi.js";import{c as Xe}from"./clipboard-e3fSpeo7.js";import{u as Is}from"./sse-CVoGDiKW.js";import{b as Pe}from"./status-tone-BM_zuRy1.js";import{t as Fe,b as Ze,n as X}from"./time-Dhsh_2EG.js";import{u as es,A as Rs}from"./Provider-tFc3jqZ4.js";import{o as $e}from"./openContent-C6XO6kr5.js";import{g as As,b as ce,h as ss,e as $s,i as Ds,d as Es,j as Fs,k as Ms,l as Ls,m as Ts}from"./broker-display-pp33bLsu.js";import{BrokerMetadataPanel as Ps}from"./BrokerMetadataPanel-opTLuZU6.js";import{DispatchAftermath as zs}from"./DispatchAftermath-BrreQifA.js";import{i as Bs,c as qs,n as Ue}from"./keyboard-nav-BhZZ5HEq.js";import{ShikiPane as Os}from"./ShikiPane-I_OTW5NO.js";import{d as _s}from"./types-B0PlfpKc.js";/* empty css */import{L as Se}from"./loader-circle-lWOOKezu.js";import{X as Me}from"./x-0XjXwGqq.js";import{E as De}from"./external-link-CnjcXf32.js";import{A as Ks}from"./arrow-down-DsD-dYj-.js";import{B as He}from"./bot-B_Uzf4_O.js";import{R as Je}from"./refresh-cw-D8PFyhUa.js";import{C as We}from"./chevron-down-BFai6ZfE.js";import{C as rs}from"./check-BbgHJX8u.js";import{C as as}from"./copy-CwCAivnc.js";import{M as ts}from"./message-square-BD-4UUdc.js";import{S as Us}from"./sparkles-up7pVlX-.js";import{P as Hs}from"./paperclip-DL9BXPp2.js";import{P as Js}from"./plus-C9lTjsgd.js";import{S as Ws}from"./send-horizontal-DDwOgEs3.js";import{c as ns}from"./createLucideIcon-DlxlBfLC.js";import{R as Qs}from"./radio-DedMyP8J.js";import{b as Vs,M as Ys}from"./DocumentFocusViewer-DU_9BHsD.js";const Gs=[["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"}]],Xs=ns("at-sign",Gs);const Zs=[["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"}]],er=ns("hash",Zs),sr=160;function Qe(s){const a=new URLSearchParams({limit:String(sr)});return s&&a.set("cursor",s),`/api/broker?${a.toString()}`}const Ve={index:-1,request:0};function rr(s,a){return{index:a,request:s.request+1}}function os(s,a){return a===s.index?s:{index:a,request:s.request}}function ar(s,a){return s.index<a?s:os(s,a>0?a-1:-1)}function tr(s,a){return s.request!==a}function nr({enabled:s,rowCount:a,onActivateRow:t,onClearSelection:i}){const[f,d]=n.useState(Ve),b=f.index,u=n.useRef(new Map),c=n.useRef(Ve.request),x=n.useCallback(y=>{d(m=>rr(m,typeof y=="function"?y(m.index):y))},[]),j=n.useCallback(y=>{d(m=>os(m,typeof y=="function"?y(m.index):y))},[]);n.useEffect(()=>{if(!tr(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=>ar(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")&&!(Bs(m.target)||qs())&&a!==0){if(m.key==="Escape"){i&&(m.preventDefault(),i(),j(-1));return}if(m.key==="ArrowDown"||m.key==="j"){m.preventDefault(),x(I=>Ue(I,a,1));return}if(m.key==="ArrowUp"||m.key==="k"){m.preventDefault(),x(I=>Ue(I,a,-1));return}if(m.key==="Home"||m.key==="g"&&!m.shiftKey){m.preventDefault(),x(0);return}if(m.key==="End"||m.key==="G"){m.preventDefault(),x(a-1);return}if(m.key==="Enter"||m.key===" "){const I=b<0?0:b;m.preventDefault(),x(I),t(I)}}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s,b,x,t,i,a,j]);const U=n.useCallback(y=>({tabIndex:b===y?0:-1,ref:m=>R(y,m),onFocus:()=>j(y)}),[b,R,j]);return{focusedIndex:b,setFocusedIndex:j,getRowFocusProps:U}}const ye=["all","delivered","failed"],or={all:"All",delivered:"Delivered",failed:"Failed"};function ir(s){switch(s){case"success":return"Success";case"failed_query":return"Query failure";case"failed_delivery":return"Delivery failure";default:return"Delivery attempt"}}function is(s){return s.messageId??s.deliveryId??s.invocationId??s.id}function ls(s){switch(Pe(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 Le(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 lr(s){const a=X(s)??0;return new Date(a).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Ye(s){const a=X(s);return a===null?"—":new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Re(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=Re(f,a,t+1);if(d!==void 0)return d}}function T(s,...a){const t=Re(s.metadata,a);return typeof t!="string"&&typeof t!="number"?null:String(t).trim()||null}function Ce(s,...a){const t=Re(s.metadata,a);return typeof t=="number"||typeof t=="string"?X(t):null}function cs(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 Ie(s,a){if(a==="to")return s.route==="channel"?"Channel":s.route==="broadcast"?"Broadcast":s.target?.toLowerCase().includes("operator")?"Operator":"Agent lane";const t=T(s,"class","actorClass")?.toLowerCase();return t==="operator"||t==="human"?"Operator":t==="agent"?"Agent":s.actorName?.toLowerCase().includes("operator")?"Operator":"Sender"}function cr(s){const a=Re(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=Ce(s,"sentAt","createdAt")??X(s.ts),i=Ce(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 Te({route:s}){switch(s){case"channel":return e.jsx(er,{size:12,"aria-hidden":"true"});case"broadcast":return e.jsx(Qs,{size:12,"aria-hidden":"true"});case"dm":return e.jsx(Xs,{size:12,"aria-hidden":"true"});default:return e.jsx(ts,{size:12,"aria-hidden":"true"})}}function dr(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 ur(s,a,t){const i=t?.authorityNodeName??t?.homeNodeName??t?.authorityNodeId??t?.homeNodeId??T(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":Ie(s,a)},{label:"Channel",value:cs(s.route)},{label:"Session",value:a==="to"?s.target:T(s,"sessionId","harnessSessionId")},{label:"Conversation",value:s.conversationId},{label:"Harness",value:T(s,"harness")},{label:"Model",value:T(s,"model")},{label:"Project",value:T(s,"project","projectName")},{label:"Branch",value:T(s,"branch")},{label:"Machine",value:i}]).filter(d=>!!d.value)}function Ge({attempt:s,agents:a,side:t}){const i=t==="from"?s.actorName:s.target,f=dr(a,i),d=f?.name??i??(t==="from"?"Unknown":"No target"),b=f?"Agent":t==="to"&&s.conversationId?"Session":Ie(s,t),u=ur(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"?Le(d):e.jsx(Te,{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"?Le(d):e.jsx(Te,{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(x=>e.jsxs("span",{className:"sys-broker-endpoint-card-field",children:[e.jsx("small",{children:x.label}),e.jsx("code",{title:x.value,children:x.value})]},x.label))})]})]})}function ge(s){const a=X(s)??0,t=new Date(a);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function hr(s,a=Date.now()){const t=X(s)??0,i=new Date(t),f=new Date(a),d=new Date(a);return d.setDate(d.getDate()-1),ge(s)===ge(f.getTime())?"Today":ge(s)===ge(d.getTime())?"Yesterday":i.toLocaleDateString(void 0,{month:"short",day:"numeric",year:i.getFullYear()===f.getFullYear()?void 0:"numeric"})}function fr(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 mr({navigate:s,embedded:a=!1,initialAttemptId:t}){const{route:i,agents:f,selectedBrokerAttempt:d,inspectBrokerAttempt:b,clearBrokerAttempt:u}=es(),[c,x]=n.useState(null),j=i.view==="broker"?i.filter??"all":"all",[R,U]=n.useState(!0),[y,m]=n.useState(!1),[I,oe]=n.useState(!1),[q,P]=n.useState(null),H=n.useRef(null),D=n.useRef(0),L=n.useRef(null),J=n.useCallback(async(o="initial")=>{const h=++D.current;!H.current&&o!=="background"?(U(!0),P(null)):m(!0);try{const k=await le(Qe());if(h!==D.current)return;H.current=k,x(k),P(null)}catch(k){if(h!==D.current)return;P(k instanceof Error?k.message:String(k))}finally{h===D.current&&(U(!1),m(!1))}},[]),ie=n.useCallback(async()=>{const o=H.current;if(!o||I)return;const h="attempts",k=o.ledger.cursors[h];if(!k||!o.ledger.hasMore[h])return;const w=++D.current;oe(!0),P(null);try{const C=await le(Qe(k));if(w!==D.current)return;const ue=H.current,M=ue?fr(ue,C,h):C;H.current=M,x(M)}catch(C){if(w!==D.current)return;P(C instanceof Error?C.message:String(C))}finally{w===D.current&&oe(!1)}},[I]),Z=n.useCallback(()=>{L.current||(L.current=setTimeout(()=>{L.current=null,J("background")},250))},[J]);n.useEffect(()=>(J("initial"),()=>{L.current&&clearTimeout(L.current)}),[J]),Is(o=>{(o.kind==="message.posted"||o.kind==="delivery.planned"||o.kind==="delivery.attempted"||o.kind==="delivery.state.changed"||o.kind==="scout.dispatched")&&Z()});const v=n.useMemo(()=>{if(!c)return[];const o=new Map(c.dialogue.map(h=>[h.id,h.body]));return As(c.attempts).map(h=>{const k=h.messageId?o.get(h.messageId):null;return k&&k!==h.detail?{...h,detail:k}:h})},[c]),E=n.useMemo(()=>{switch(j){case"delivered":return v.filter(o=>!ce(o));case"failed":return v.filter(ce);default:return v}},[j,v]),O=c?.ledger.hasMore.attempts??!1,ee=n.useMemo(()=>({all:v.length,delivered:v.filter(o=>!ce(o)).length,failed:v.filter(ce).length}),[v]),z=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]),W=z?`${z.id}\0${z.status}\0${z.ts}`:null,se=d?`${d.id}\0${d.status}\0${d.ts}`:null;n.useEffect(()=>{z&&W!==se&&b(z)},[se,b,z,W]);const[A,$]=n.useState(null),_=n.useRef(!1),S=n.useCallback(o=>{if(a){_.current=!0,$(o);return}b(o)},[a,b]),Q=n.useCallback(()=>{if(a){_.current=!0,$(null);return}u()},[u,a]),V=n.useCallback(o=>{const h=E[o];h&&(S(h),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}})))},[E,S]),{getRowFocusProps:re,setFocusedIndex:K}=nr({enabled:!!c&&E.length>0,rowCount:E.length,onActivateRow:V,onClearSelection:Q}),ae=A?.id??null,xe=A?`${A.id} ${A.status} ${A.ts}`:null;n.useEffect(()=>{if(!a||!ae)return;const o=v.find(h=>h.id===ae);o&&`${o.id} ${o.status} ${o.ts}`!==xe&&$(o)},[a,ae,xe,v]),n.useEffect(()=>{if(!a||!t||!c||_.current||A)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&&(_.current=!0,$(o))},[c,a,A,v,t]),n.useEffect(()=>{const o=i.view==="broker"?i.attemptId:void 0;if(!o)return;const h=E.findIndex(k=>k.id===o);h>=0&&K(h)},[E,j,i,K]);const je=n.useCallback(o=>{const k=(ye.indexOf(j)+o+ye.length)%ye.length,w=ye[k];s({view:"broker",...w==="all"?{}:{filter:w}})},[j,s]),F=a?A:null;return e.jsx("div",{className:`s-ops${a?" s-ops--embedded":""}${F?" 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(),je(1)):o.key==="ArrowLeft"&&(o.preventDefault(),je(-1))},children:ye.map(o=>e.jsxs("button",{type:"button",role:"tab","aria-selected":j===o,className:`sys-tab${j===o?" sys-tab-active":""}`,onClick:()=>s({view:"broker",...o==="all"?{}:{filter:o}}),children:[e.jsx("span",{children:or[o]}),e.jsx("span",{className:"sys-tab-count",children:ee[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 ${Fe(c.generatedAt)}${c.source?.latestMessageAt?` · latest message ${Fe(c.source.latestMessageAt)}`:""}`:"Waiting for dispatch data"}),e.jsx("button",{type:"button",className:"s-btn",disabled:R||y,onClick:()=>{J("manual")},children:y?"Refreshing...":"Refresh"})]})]}),q&&e.jsxs("div",{className:"sys-banner sys-banner-warning",children:[e.jsx("strong",{children:"Refresh failed."}),e.jsx("span",{children:q})]}),y&&c&&e.jsxs("div",{className:"sys-broker-source-note",role:"status","aria-live":"polite",children:[e.jsx(Se,{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(Ee,{title:"Loading dispatch",body:"Reading the dispatch database snapshot."}),!R&&!c&&!q&&e.jsx(Ee,{title:"No dispatch data",body:"No dispatch rows are available yet."}),c&&e.jsxs(e.Fragment,{children:[e.jsx(pr,{attempts:E,agents:f,selectedAttemptId:a?A?.id??null:d?.id??(i.view==="broker"?i.attemptId??null:null),onInspect:S,getRowFocusProps:re}),E.length>0&&O&&e.jsx("div",{className:"sys-ledger-footer",children:e.jsx("button",{type:"button",className:"s-btn",disabled:I,onClick:()=>{ie()},children:I?"Loading older...":"Load older"})})]})]}),F&&e.jsx("div",{className:"s-broker-embed-detail",children:e.jsx(ds,{attempt:F,navigate:s,onClose:Q})})]})})}function pr({attempts:s,agents:a,selectedAttemptId:t,onInspect:i,getRowFocusProps:f}){if(s.length===0)return e.jsx(Ee,{title:"No dispatch rows",body:"No dispatch rows are available yet."});const d=s.reduce((b,u,c)=>{const x=ge(u.ts),j=b[b.length-1];return j?.key===x?j.attempts.push({attempt:u,index:c}):b.push({key:x,label:hr(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 x=Pe(u.kind,u.status),j=ce(u),R=ss(u),U=$s(u.detail,Ds(u)),y=ls(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${j?" 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--${x}`,"aria-hidden":"true"}),e.jsx("span",{className:`sys-broker-state sys-broker-state--${x}`,children:y})]}),e.jsx("div",{className:"sys-broker-cell sys-broker-col--from",children:e.jsx(Ge,{attempt:u,agents:a,side:"from"})}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--to",children:[e.jsx(Rs,{className:"sys-broker-route-arrow",size:13,"aria-hidden":"true"}),e.jsx(Ge,{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}),j&&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:Ze(u.ts),children:Fe(u.ts)}),e.jsx("span",{className:"sys-broker-time-abs",children:lr(u.ts)})]})]},u.id)})})]},b.key))]})}function br(s){const a=is(s);return[{label:"Kind",value:ir(s.kind)},{label:"Time",value:Ze(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 de({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 x=await Xe(s);d.current&&clearTimeout(d.current),f(x?"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(rs,{size:14,"aria-hidden":"true"}):e.jsx(as,{size:14,"aria-hidden":"true"})})}function yr(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 gr({payload:s}){const a=n.useMemo(()=>yr(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(Os,{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(de,{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(Vs,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-resizer",children:b}),t&&xs.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(de,{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(Ys,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-dialog-body",children:b})]}),document.body)]})}function xr({attempt:s}){const a=Ts(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(Me,{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(de,{value:s.detail,subject:"failure detail"})]})}function ds({attempt:s,navigate:a,onClose:t}){const{route:i,agents:f,scoutbotAgentId:d}=es(),b=br(s),u=Es(s.metadata),c=ce(s),x=s.kind==="failed_query",j=ss(s),R=Pe(s.kind,s.status),U=Ce(s,"sentAt","createdAt")??X(s.ts),y=Ce(s,"deliveredAt","completedAt")??X(s.ts),m=is(s),[I,oe]=n.useState("idle"),[q,P]=n.useState("idle"),[H,D]=n.useState(null),[L,J]=n.useState(null),[ie,Z]=n.useState(""),[v,E]=n.useState(""),[O,ee]=n.useState("idle"),[z,W]=n.useState(null),[se,A]=n.useState(""),[$,_]=n.useState(""),[S,Q]=n.useState(""),[V,re]=n.useState(""),[K,ae]=n.useState("medium"),[xe,je]=n.useState(null),[F,o]=n.useState([]),[h,k]=n.useState(!1),[w,C]=n.useState("idle"),[ue,M]=n.useState(null),ke=T(s,"harness"),ve=T(s,"model"),we=T(s,"reasoningEffort","effort"),ze=n.useRef(null),Be=n.useRef(null),he=n.useMemo(()=>Fs(s),[s]),N=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]),fe=n.useMemo(()=>Ms(s,N)?.id??"",[s,N]),me=N.some(r=>r.id===d)?d:N[0]?.id??"",Ne=N[0]?.id??"",te=N.find(r=>r.id===me)??null,us=n.useMemo(()=>{const r=new Map;for(const l of N){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}))},[N]),qe=n.useRef({originalTargetAgentId:fe,firstRoutableAgentId:Ne,defaultForwardAgentId:me,defaultForwardAgent:te,effort:"medium"});qe.current={originalTargetAgentId:fe,firstRoutableAgentId:Ne,defaultForwardAgentId:me,defaultForwardAgent:te,effort:T(s,"reasoningEffort","effort")||"medium"};const pe=n.useRef(!1);n.useEffect(()=>{const r=qe.current;pe.current=!1,oe("idle"),P("idle"),D(null),J(null),Z(""),E(r.originalTargetAgentId||r.firstRoutableAgentId),ee("idle"),W(null),A(r.defaultForwardAgentId),_(r.defaultForwardAgent?.projectRoot?.trim()||r.defaultForwardAgent?.cwd?.trim()||""),Q(r.defaultForwardAgent?.harness?.trim()||""),re(r.defaultForwardAgent?.model?.trim()||""),ae(r.effort),o([]),k(!1),C("idle"),M(null)},[s.id]),n.useEffect(()=>{pe.current||(E(r=>r||fe||Ne),A(r=>r||me),_(r=>r||te?.projectRoot?.trim()||te?.cwd?.trim()||""),Q(r=>r||te?.harness?.trim()||""),re(r=>r||te?.model?.trim()||""))},[te,me,Ne,fe]),n.useEffect(()=>{const r=new URLSearchParams({scope:"global+project"});$&&r.set("projectRoot",$);let l=!1;return le(`/api/runner/options?${r.toString()}`).then(p=>{!l&&p.schemaVersion==="openscout.runtime-capabilities.v1"&&je(p)}).catch(()=>{}),()=>{l=!0}},[$]);const hs=n.useCallback(async()=>{const r=await Xe(he);oe(r?"copied":"failed"),window.setTimeout(()=>oe("idle"),1500)},[he]),fs=n.useCallback(r=>{k(!0),Z(r),window.requestAnimationFrame(()=>ze.current?.focus())},[]),ms=n.useCallback(async()=>{const r=N.find(l=>l.id===v);if(!(!r||O==="sending")){ee("sending"),W(null);try{const l=await le("/api/ask",{method:"POST",body:JSON.stringify({body:s.detail,targetAgentId:r.id,targetLabel:r.name,...ke||ve||we?{execution:{...ke?{harness:ke}:{},...ve?{model:ve}:{},...we?{reasoningEffort:we}:{},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;ee("sent"),W(`New dispatch sent to ${r.name}${p?` · ${p}`:""}`)}catch(l){ee("failed"),W(`Retry failed. ${l instanceof Error?l.message:String(l)}`)}}},[s,v,O,we,ke,ve,N]),Oe=n.useCallback(async()=>{const r=ie.trim(),l=N.find(p=>p.id===se);if(!(!r||!l||w==="sending")){C("sending"),M(F.length>0?`Uploading ${F.length} ${F.length===1?"attachment":"attachments"}…`:null);try{const p=F.length>0?await ks(F):[],g=await le("/api/ask",{method:"POST",body:JSON.stringify({body:`${r}
|
|
3
|
-
|
|
4
|
-
Attached dispatch context:
|
|
5
|
-
${he}`,targetAgentId:l.id,targetLabel:l.name,...p.length>0?{attachments:p}:{},execution:{...S?{harness:S}:{},...V?{model:V}:{},...K?{reasoningEffort:K}:{}},metadata:{source:"scout-dispatch-forward",originalDispatchId:s.id,...$?{targetProjectPath:$}:{},...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),Y=g.flightId??g.flight?.id;C("sent"),M(`Request sent to ${l.name}${Y?` · ${Y}`:""}`),Z(""),o([])}catch(p){C("failed"),M(`Request wasn't sent. ${p instanceof Error?p.message:String(p)}`)}}},[s,he,se,K,F,S,V,$,w,ie,N]),ps=n.useCallback(r=>{const l=r.filter(vs),p=r.length-l.length;l.length>0&&(o(g=>[...g,...l]),C("idle"),M(null)),p>0&&(C("failed"),M("Attach markdown, code, an image, or a video clip."))},[]),bs=c?["Get a second opinion","Propose a recovery plan","Draft a follow-up"]:["Summarize this dispatch","Draft a follow-up","What changed?"],B=N.find(r=>r.id===v)??null,ne=N.find(r=>r.id===se)??null,be=N.filter(r=>$?(r.projectRoot?.trim()||r.cwd?.trim())===$:!0),_e=xe??Ns,Ae=n.useMemo(()=>{const r=ws(_e),l=[V,ne?.harness===S?ne.model:null,...be.filter(g=>g.harness===S).map(g=>g.model)].map(g=>g?.trim()).filter(g=>!!g);let p=r.harnesses;return p.some(g=>g.value===S)||(p=[{value:S,label:S||"default",models:[]},...p]),p=p.map(g=>{if(g.value!==S)return g;const Y=g.models.some(G=>G.value==="")?g.models:[{value:"",label:"Default",note:"harness picks"},...g.models],gs=new Set(Y.map(G=>G.value)),Ke=l.filter(G=>!gs.has(G)).map(G=>({value:G,label:G,note:"observed"}));return Ke.length===0&&Y===g.models?g:{...g,models:[...Y,...Ke]}}),{...r,harnesses:p}},[_e,ne,S,V,be]);n.useEffect(()=>{const r=Ss(Ae,S);!r||r.some(l=>l.value===K)||ae(r.find(l=>l.value==="medium")?.value??r[0]?.value??"")},[Ae,S,K]);const ys=n.useCallback(async()=>{P("running"),D(null);try{const r=await le("/api/broker/dispatch-review",{method:"POST",body:JSON.stringify(Ls(s))});P("sent"),J(r.conversationId),D(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){P("failed"),D(`Couldn't start the report. ${r instanceof Error?r.message:String(r)}`)}},[s]);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:ls(s)}),e.jsx("code",{title:m,children:m}),e.jsx(de,{value:he,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(Me,{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:Le(s.actorName)}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["From · ",Ie(s,"from")]}),e.jsx("strong",{children:s.actorName??"Unknown sender"})]}),s.conversationId&&e.jsxs("button",{type:"button",className:"sys-broker-route-button",onClick:()=>$e(a,{view:"conversation",conversationId:s.conversationId},{returnTo:i}),children:[e.jsx(De,{size:11,"aria-hidden":"true"}),"Route"]})]}),e.jsx(Ks,{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(Te,{route:s.route})}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["To · ",Ie(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:()=>$e(a,{view:"conversation",conversationId:s.conversationId},{returnTo:i}),children:[e.jsx(De,{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:cs(s.route)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Latency"}),e.jsx("dd",{className:"sys-broker-delivery-accent",children:cr(s)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Sent"}),e.jsx("dd",{children:Ye(U)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:c?"Failed":"Delivered"}),e.jsx("dd",{children:Ye(y)})]})]}),e.jsxs("section",{className:"sys-broker-payload",children:[x?e.jsx(xr,{attempt:s}):e.jsx(gr,{payload:s.detail}),c&&!x&&j&&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:j})]})]}),e.jsx(zs,{attempt:s,targetAgentId:fe||null,navigate:a,returnTo:i}),c&&e.jsxs("section",{className:"sys-broker-report","aria-labelledby":"dispatch-report-title",children:[e.jsxs("div",{className:"sys-broker-action-head",children:[e.jsx("span",{className:"sys-broker-action-mark","aria-hidden":"true",children:e.jsx(He,{size:12})}),e.jsxs("div",{children:[e.jsx("span",{id:"dispatch-report-title",children:"Failure report"}),e.jsx("small",{children:"Codex will inspect this dispatch and report the likely cause, confidence, and recommended next step in a new conversation."})]})]}),e.jsxs("button",{type:"button",className:"sys-broker-report-button",disabled:q==="running"||q==="sent"&&!L,onClick:()=>{if(L){$e(a,{view:"conversation",conversationId:L},{returnTo:i});return}ys()},children:[q==="running"?e.jsx(Se,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):L?e.jsx(De,{size:13,"aria-hidden":"true"}):e.jsx(He,{size:13,"aria-hidden":"true"}),q==="running"?"Starting report…":L?"Open report conversation":"Start failure report"]}),H&&e.jsx("div",{className:`sys-broker-review-status sys-broker-review-status--${q}`,role:"status",children:H})]}),e.jsxs("section",{className:"sys-broker-redispatch","aria-labelledby":"dispatch-redispatch-title",children:[e.jsxs("div",{className:"sys-broker-action-head",children:[e.jsx("span",{className:"sys-broker-action-mark","aria-hidden":"true",children:e.jsx(Je,{size:12})}),e.jsxs("div",{children:[e.jsx("span",{id:"dispatch-redispatch-title",children:"Retry delivery"}),e.jsx("small",{children:"Send the original payload as a new dispatch. Use this after the destination is available again."})]})]}),e.jsxs("div",{className:"sys-broker-redispatch-controls",children:[e.jsxs("label",{children:[e.jsx("span",{children:"Destination"}),e.jsx("select",{value:v,disabled:O==="sending"||N.length===0,onChange:r=>{E(r.target.value),ee("idle"),W(null)},children:N.length===0?e.jsx("option",{value:"",children:"No agents available"}):e.jsxs(e.Fragment,{children:[!v&&e.jsx("option",{value:"",children:"Original destination unavailable"}),N.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:!B||O==="sending",onClick:()=>{ms()},children:[O==="sending"?e.jsx(Se,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(Je,{size:13,"aria-hidden":"true"}),O==="sending"?"Retrying…":"Retry dispatch"]})]}),B&&e.jsxs("div",{className:"sys-broker-action-target-meta",children:[B.harness&&e.jsx("span",{children:B.harness}),B.model&&e.jsx("span",{children:B.model}),(B.cwd??B.projectRoot)&&e.jsx("code",{children:B.cwd??B.projectRoot})]}),z&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${O}`,role:"status",children:z})]}),e.jsxs("details",{className:"sys-broker-technical",children:[e.jsxs("summary",{children:[e.jsx("span",{children:"Technical details"}),e.jsx(We,{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(de,{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(de,{value:u,subject:"metadata",className:"sys-broker-metadata-copy"})]}),e.jsx(Ps,{metadata:s.metadata,rawJson:u})]})]}),e.jsxs("button",{type:"button",className:"sys-broker-copy-context",onClick:()=>{hs()},children:[I==="copied"?e.jsx(rs,{size:12,"aria-hidden":"true"}):e.jsx(as,{size:12,"aria-hidden":"true"}),I==="copied"?"Context copied":I==="failed"?"Copy failed":"Copy dispatch context"]})]}),e.jsxs("section",{className:`sys-broker-forward${h?" sys-broker-forward--expanded":""}`,"aria-labelledby":"dispatch-forward-title",children:[e.jsxs("button",{type:"button",className:"sys-broker-forward-toggle","aria-expanded":h,"aria-controls":"dispatch-forward-content",onClick:()=>k(r=>!r),children:[e.jsxs("div",{className:"sys-broker-action-head",children:[e.jsx("span",{className:"sys-broker-action-mark","aria-hidden":"true",children:e.jsx(ts,{size:12})}),e.jsxs("div",{children:[e.jsx("span",{id:"dispatch-forward-title",children:"Ask another agent"}),e.jsx("small",{children:"Optional · forwards this dispatch context."})]})]}),e.jsx(We,{className:"sys-broker-forward-chevron",size:15,"aria-hidden":"true"})]}),h&&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:bs.map(r=>e.jsxs("button",{type:"button",onClick:()=>fs(r),children:[e.jsx(Us,{size:11,"aria-hidden":"true"}),r]},r))})}),e.jsxs("form",{className:"sys-broker-message-composer",onSubmit:r=>{r.preventDefault(),Oe()},children:[e.jsx("label",{htmlFor:"dispatch-message-input",children:"Request"}),e.jsx("textarea",{ref:ze,id:"dispatch-message-input",value:ie,rows:3,placeholder:`What should ${ne?.id===d?"Scout":ne?.name??"this agent"} investigate or do?`,disabled:w==="sending",onChange:r=>{Z(r.target.value),w!=="idle"&&(C("idle"),M(null))},onKeyDown:r=>{r.key==="Enter"&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),Oe())}}),F.length>0&&e.jsx("div",{className:"sys-broker-composer-attachments","aria-label":"Attachments",children:F.map((r,l)=>e.jsxs("span",{children:[e.jsx(Hs,{size:10,"aria-hidden":"true"}),e.jsx("span",{title:r.name,children:r.name}),e.jsx("button",{type:"button",onClick:()=>o(p=>p.filter((g,Y)=>Y!==l)),"aria-label":`Remove ${r.name}`,children:e.jsx(Me,{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:Be,type:"file",multiple:!0,hidden:!0,disabled:w==="sending",onChange:r=>{ps([...r.target.files??[]]),r.target.value=""}}),e.jsx("button",{type:"button",className:"sys-broker-composer-attach",disabled:w==="sending",onClick:()=>Be.current?.click(),"aria-label":"Attach files",title:"Attach files",children:e.jsx(Js,{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:$,disabled:w==="sending",onChange:r=>{const l=r.target.value,p=N.find(g=>!l||(g.projectRoot?.trim()||g.cwd?.trim())===l)??null;pe.current=!0,_(l),p&&(A(p.id),Q(p.harness?.trim()||""),re(p.model?.trim()||""))},children:[e.jsx("option",{value:"",children:"Any project"}),us.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:se,disabled:w==="sending"||be.length===0,onChange:r=>{const l=N.find(p=>p.id===r.target.value)??null;pe.current=!0,A(r.target.value),l&&(_(l.projectRoot?.trim()||l.cwd?.trim()||""),Q(l.harness?.trim()||""),re(l.model?.trim()||"")),C("idle"),M(null)},children:be.length===0?e.jsx("option",{value:"",children:"No agents"}):be.map(r=>e.jsx("option",{value:r.id,children:r.id===d?"Scout":r.name},r.id))})]}),e.jsx(Cs,{catalog:Ae,value:{harness:S,model:V,effort:K},onChange:r=>{pe.current=!0,Q(r.harness),re(r.model),ae(r.effort)},disabled:w==="sending"}),e.jsx(js,{className:"sys-broker-composer-mic",disabled:w==="sending",onAppend:r=>Z(l=>l.trim()?`${l.trimEnd()} ${r}`:r),onError:r=>{C("failed"),M(r)}})]}),e.jsx("button",{type:"submit",className:"sys-broker-composer-send",disabled:!ie.trim()||!ne||w==="sending","aria-label":`Ask ${ne?.name??"recipient"} about this dispatch`,children:w==="sending"?e.jsx(Se,{size:14,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(Ws,{size:14,"aria-hidden":"true"})})]})]}),ue&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${w}`,role:"status",children:ue})]})]})]})}const jr=_s({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}}}),ta=Object.freeze(Object.defineProperty({__proto__:null,BrokerAttemptInspector:ds,BrokerScreen:mr,scoutSurface:jr},Symbol.toStringTag,{value:"Module"}));export{ds as B,mr as a,Qe as b,ta as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,j as i}from"./index-sUomXsrf.js";import{a as te}from"./api-h5zurxmi.js";import{c as pe}from"./clipboard-e3fSpeo7.js";import{f as Ie}from"./scoutbot-BTIErYHo.js";import{g as Be,f as he}from"./api-BkjHJfgJ.js";import{d as Pe}from"./types-B0PlfpKc.js";import{r as We,C as _e}from"./CodeDiffPane-CLOGjwul.js";import{r as Ue,a as ze,w as Ae,b as Oe,f as me,C as He,s as Ke}from"./CodeProjectPicker-DTV8hR6A.js";import{ShikiPane as qe}from"./ShikiPane-I_OTW5NO.js";/* empty css */import{A as Ge}from"./arrow-left-WjQIN9J6.js";import{C as Ve}from"./chevron-right-CyUa1zXx.js";import{C as Xe}from"./check-BbgHJX8u.js";import{C as Je}from"./copy-CwCAivnc.js";import"./cache-Dr0why2k.js";import"./usePierreRuntime-DIVunfX0.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";/* empty css */import"./chevron-down-BFai6ZfE.js";import"./createLucideIcon-DlxlBfLC.js";import"./search-DCT_EvPr.js";const Qe=new Set(["node_modules",".git","dist",".next",".build","DerivedData","__pycache__",".venv","target"]);function ke(n){const l=n.lastIndexOf("/");return l>0?n.slice(0,l):"/"}function ne(n){const l=n.lastIndexOf("/");return l>=0?n.slice(l+1):n}function z(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function b(n){return n.toLowerCase().replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function Ye(n,l,m){const k=b(l),f=n.projects.find(d=>b(d.name)===k||b(ne(d.root))===k);if(!f)return null;const w=m?f.worktrees.find(d=>d.name===m||d.branch.name===m||b(d.name)===b(m)):f.worktrees[0];return{projectName:f.name,root:w?.path??f.root}}function ve(n,l){if(!l.startsWith(`${n}/`))return[];const m=l.slice(n.length+1).split("/"),k=[];let f=n;for(const w of m.slice(0,-1))f=`${f}/${w}`,k.push(f);return k}function Ze(n){switch(n){case"untracked":return"U";case"conflicted":return"C";case"staged":return"S";case"unstaged":return"M";case"staged+unstaged":return"SM";default:return n.charAt(0).toUpperCase()}}function je(n,l,m,k,f){const w=m.get(n);if(!w){f.push({path:`${n}#loading`,name:"Loading…",kind:"file",depth:l,loading:!0});return}for(const d of w)d.kind==="directory"&&Qe.has(d.name)||(f.push({path:d.path,name:d.name,kind:d.kind,depth:l}),d.kind==="directory"&&k.has(d.path)&&je(d.path,l+1,m,k,f))}function Ct({route:n,navigate:l,root:m,file:k,project:f,path:w,wt:d,line:we,endLine:Ce,returnConversationId:xe,embedded:A=!1}){const $=m??n?.root??null,M=k??n?.file??null,C=f??n?.project??null,O=w??n?.path??null,re=d??n?.wt??null,g=we??n?.line,x=Ce??n?.endLine,j=xe??n?.returnConversationId??null,[p,se]=s.useState(()=>Be()),[r,H]=s.useState(()=>$??(C?null:Ue())),[S,K]=s.useState(()=>new Map),[y,D]=s.useState(()=>new Set),[ie,q]=s.useState(null),[a,T]=s.useState(M),[c,I]=s.useState(null),[Se,G]=s.useState(!1),[oe,B]=s.useState(null),[ae,V]=s.useState("idle"),[R,X]=s.useState("source"),[h,J]=s.useState(()=>g&&g>0?{line:g,...x&&x>=g?{endLine:x}:{}}:null);s.useEffect(()=>{J(g&&g>0?{line:g,...x&&x>=g?{endLine:x}:{}}:null)},[x,g]),s.useEffect(()=>{if(p)return;let e=!1;return he("quick",!1,2e4).then(t=>{e||se(t)}).catch(()=>{}),()=>{e=!0}},[p]);const L=s.useCallback(async e=>{try{const t=await te(`/api/file/preview?path=${encodeURIComponent(e)}`);if(t.kind!=="directory")return;const o=t.entries.map(u=>({name:u.name,path:u.path,kind:u.kind}));K(u=>new Map(u).set(e,o))}catch(t){q(t instanceof Error?t.message:String(t))}},[]),N=s.useCallback((e,t)=>{if(!t)return;const o=ve(e,t);if(o.length!==0){D(u=>new Set([...u,...o]));for(const u of o)L(u)}},[L]);s.useEffect(()=>{if(!C||!p)return;const e=Ye(p,C,re);if(!e){q(`No project matching "${C}".`);return}const t=O?`${e.root}/${O}`:null;H(e.root),T(t),N(e.root,t)},[C,O,re,p,N]),s.useEffect(()=>{if(r||C||!p)return;const e=p.projects[0];e&&H(e.worktrees[0]?.path??e.root)},[r,C,p]);const ce=s.useRef(a);ce.current=a,s.useEffect(()=>{if(!r)return;q(null);const e=ze(r),t=ce.current,o=t?ve(r,t):[];e?(K(new Map(Object.entries(e.entries))),D(new Set([...e.expanded,...o])),!t&&e.selectedFile&&T(e.selectedFile)):(K(new Map),D(new Set(o)));const u=new Set([r,...e?.expanded??[],...o]);for(const ee of u)L(ee);he("quick",!1,2e4).then(se).catch(()=>{})},[r,L]),s.useEffect(()=>{!r||S.size===0||(Ae(r,{entries:S,expanded:y,selectedFile:a}),Oe(r))},[r,S,y,a]),s.useEffect(()=>{!$||!M||N($,M)},[$,M,N]);const Q=s.useRef(new Map),Y=s.useRef(new Set),be=3e4,P=s.useCallback(e=>{const t=Q.current.get(e);return t?Date.now()-t.at>be?(Q.current.delete(e),null):t.preview:null},[]),W=s.useCallback((e,t)=>{const o=Q.current;if(o.set(e,{at:Date.now(),preview:t}),o.size>80){const u=o.keys().next().value;u&&o.delete(u)}},[]),ye=s.useCallback(e=>{P(e)||Y.current.has(e)||(Y.current.add(e),te(`/api/file/preview?path=${encodeURIComponent(e)}`).then(t=>W(e,t)).catch(()=>{}).finally(()=>Y.current.delete(e)))},[P,W]);s.useEffect(()=>{if(V("idle"),!a){I(null),B(null);return}const e=P(a);if(e){I(e.kind==="file"?e:null),B(null),G(!1);return}let t=!1;return G(!0),B(null),te(`/api/file/preview?path=${encodeURIComponent(a)}`).then(o=>{t||(W(a,o),I(o.kind==="file"?o:null))}).catch(o=>{t||(I(null),B(o instanceof Error?o.message:String(o)))}).finally(()=>{t||G(!1)}),()=>{t=!0}},[a,P,W]);const Le=s.useMemo(()=>{if(!r)return[];const e=[];return je(r,0,S,y,e),e},[r,S,y]),le=s.useCallback((e,t)=>{const o=j?{returnConversationId:j}:{};if(p){for(const u of p.projects)for(const[ee,ue]of u.worktrees.entries())if(ue.path===e){const fe=t&&t.startsWith(`${e}/`)?t.slice(e.length+1):void 0;return{view:"code",project:b(u.name),...fe?{path:fe}:{},...ee>0?{wt:ue.name}:{},...o}}}return{view:"code",root:e,...t?{file:t}:{},...o}},[j,p]),Z=s.useCallback(()=>{if(!j)return;const e={view:"conversation",conversationId:j};Ie({type:"navigate",route:e})||l?.(e)},[l,j]);s.useEffect(()=>{if(!j)return;const e=t=>{if(!(!t.metaKey||t.key!=="[")){if(t.target instanceof HTMLElement){const o=t.target.tagName;if(o==="INPUT"||o==="TEXTAREA"||t.target.isContentEditable)return}t.preventDefault(),Z()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[j,Z]);const _=s.useCallback((e,t)=>{A||!l||l(le(e,t))},[A,l,le]),Ne=s.useCallback(e=>{D(t=>{const o=new Set(t);return o.has(e)?o.delete(e):o.add(e),o}),S.has(e)||L(e)},[S,L]),Ee=s.useCallback(e=>{J(null),T(e),r&&_(r,e)},[r,_]),v=s.useMemo(()=>{if(!p||!r)return null;for(const e of p.projects)for(const t of e.worktrees)if(t.path===r)return{project:e,worktree:t};return null},[p,r]),E=s.useMemo(()=>{const e=new Map;if(!r||!v)return e;for(const t of v.worktree.status.files)e.set(`${r}/${t.path}`,t.status);return e},[r,v]),Re=s.useMemo(()=>{const e=new Set;if(!r)return e;for(const t of E.keys()){let o=ke(t);for(;o.startsWith(r)&&(e.add(o),o!==r);)o=ke(o)}return e},[r,E]),U=!!(r&&a&&We(r,a));s.useEffect(()=>{U||X("source")},[U]);const Fe=a&&r&&a.startsWith(`${r}/`)?a.slice(r.length+1):c?.kind==="file"?c.title:a?ne(a):null,$e=s.useCallback(async()=>{if(!c||c.kind!=="file"||!c.previewable)return;await pe(c.content)&&(V("copied"),window.setTimeout(()=>V("idle"),1500))},[c]),[Me,de]=s.useState("idle"),F=s.useMemo(()=>{if(!r)return null;if(v){const e=a&&a.startsWith(`${r}/`)?a.slice(r.length+1):void 0,t=v.project.worktrees[0]?.path;return me({project:b(v.project.name),...e?{path:e}:{},...t&&t!==r?{wt:v.worktree.name}:{},...h?.line?{line:h.line}:{},...h?.endLine?{endLine:h.endLine}:{}})}return me({...a?{file:a}:{root:r},...h?.line?{line:h.line}:{},...h?.endLine?{endLine:h.endLine}:{}})},[r,a,v,h]),De=s.useCallback(async()=>{if(!F)return;await pe(F)&&(de("copied"),window.setTimeout(()=>de("idle"),1500))},[F]),Te=s.useCallback(e=>{J(e.line&&e.line>0?{line:e.line,...e.endLine&&e.endLine>=e.line?{endLine:e.endLine}:{}}:null),T(e.file??null),H(e.root),e.file&&N(e.root,e.file),_(e.root,e.file??null)},[N,_]);return i.jsxs("div",{className:"s-code-screen","data-embedded":A||void 0,children:[i.jsxs("div",{className:"s-code-head",children:[j?i.jsxs("button",{type:"button",className:"s-code-returnThread",onClick:Z,title:"Back to thread (⌘[)",children:[i.jsx(Ge,{size:13,strokeWidth:1.9,"aria-hidden":!0}),i.jsx("span",{children:"Back to thread"})]}):null,i.jsx(He,{snapshot:p,root:r,onSelect:Te}),v?.worktree.diff.branchShortstat?i.jsx("span",{className:"s-code-headStat",children:v.worktree.diff.branchShortstat}):null,r?i.jsx("span",{className:"s-code-headPath",title:r,children:Ke(r)}):null,F?i.jsx("button",{type:"button",className:"s-code-copyLink",title:F,onClick:()=>{De()},children:Me==="copied"?"Copied scout://":"Copy scout://"}):null]}),i.jsxs("div",{className:"s-code-body",children:[i.jsx("div",{className:"s-code-tree",role:"tree","aria-label":"Files",children:ie?i.jsx("div",{className:"s-code-treeNote",children:ie}):r?Le.map(e=>e.loading?i.jsx("div",{className:"s-code-node s-code-node--loading",style:{paddingLeft:10+e.depth*14},children:e.name},e.path):i.jsxs("button",{type:"button",role:"treeitem",className:"s-code-node","data-selected":e.path===a||void 0,"data-diff":e.kind==="file"?E.get(e.path):void 0,"aria-expanded":e.kind==="directory"?y.has(e.path):void 0,style:{paddingLeft:10+e.depth*14},onClick:()=>e.kind==="directory"?Ne(e.path):Ee(e.path),onMouseEnter:e.kind==="file"?()=>ye(e.path):void 0,children:[e.kind==="directory"?i.jsx(Ve,{size:11,strokeWidth:2,className:"s-code-nodeChevron","data-open":y.has(e.path)||void 0,"aria-hidden":!0}):i.jsx("span",{className:"s-code-nodeSpacer","aria-hidden":!0}),i.jsx("span",{className:"s-code-nodeName",children:e.name}),e.kind==="file"&&E.has(e.path)?i.jsx("span",{className:"s-code-nodeBadge","data-diff":E.get(e.path),children:Ze(E.get(e.path)??"")}):null,e.kind==="directory"&&Re.has(e.path)?i.jsx("span",{className:"s-code-nodeDot","aria-label":"Contains changes"}):null]},e.path)):i.jsx("div",{className:"s-code-treeNote",children:"No repo selected."})}),i.jsxs("div",{className:"s-code-main",children:[a?i.jsxs("div",{className:"s-code-fileHead",children:[i.jsx("span",{className:"s-code-filePath",children:Fe}),U?i.jsxs("div",{className:"s-code-fileMode",role:"tablist","aria-label":"File view",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":R==="source","data-selected":R==="source"||void 0,onClick:()=>X("source"),children:"Source"}),i.jsx("button",{type:"button",role:"tab","aria-selected":R==="changes","data-selected":R==="changes"||void 0,onClick:()=>X("changes"),children:"Changes"})]}):null,c?.kind==="file"?i.jsxs("span",{className:"s-code-fileMeta",children:[z(c.sizeBytes),c.previewable&&c.truncated?" · truncated":"",h?` · L${h.line}${h.endLine?`–${h.endLine}`:""}`:""]}):null,c?.kind==="file"&&c.previewable?i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"s-code-fileAction",onClick:()=>{$e()},title:"Copy file contents",children:[ae==="copied"?i.jsx(Xe,{size:12,"aria-hidden":!0}):i.jsx(Je,{size:12,"aria-hidden":!0}),ae==="copied"?"Copied":"Copy"]}),i.jsx("a",{className:"s-code-fileAction",href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"Raw"})]}):null]}):null,R==="changes"&&U&&r&&a?i.jsx(_e,{root:r,file:a},`${r}\0${a}`):Se?i.jsxs("div",{className:"s-code-empty",children:["Loading ",a?ne(a):"file","…"]}):oe?i.jsx("div",{className:"s-code-empty",children:oe}):c&&c.kind==="file"&&c.previewable?i.jsxs(i.Fragment,{children:[c.truncated?i.jsxs("div",{className:"s-code-fileNote",children:["Showing the first ",z(256*1024)," of ",z(c.sizeBytes)," ·"," ",i.jsx("a",{href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"open raw"})]}):null,i.jsx(qe,{code:c.content,path:c.path,focusLine:h?.line,endLine:h?.endLine})]}):c&&c.kind==="file"?i.jsxs("div",{className:"s-code-empty",children:[c.previewReason," · ",z(c.sizeBytes)," ·"," ",i.jsx("a",{href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"open raw"})]}):i.jsx("div",{className:"s-code-empty",children:"Pick a file to read."})]})]})]})}const xt=Pe({id:"code",label:"Code Browser",route:{view:"code"},webPath:"/code",screen:"CodeContent",embed:{path:"/embed/code",profile:"macos.code",rootClassName:"s-code-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:n=>({root:n.get("root")?.trim()||void 0,file:n.get("file")?.trim()||void 0,project:n.get("project")?.trim()||void 0,path:n.get("path")?.trim()||void 0,wt:n.get("wt")?.trim()||void 0,line:ge(n.get("line")),endLine:ge(n.get("endLine")),returnConversationId:n.get("fromConversation")?.trim()||void 0})}});function ge(n){if(!n)return;const l=Number.parseInt(n,10);return Number.isSafeInteger(l)&&l>0?l:void 0}export{Ct as CodeContent,xt as scoutSurface};
|