@openscout/scout 0.2.90 → 0.2.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/{ActivityScreen-BUeb4ERK.js → ActivityScreen-DkUP7V7M.js} +1 -1
- package/dist/client/assets/{AddProjectForm-DtTfn4Zk.js → AddProjectForm-CpyytDf2.js} +1 -1
- package/dist/client/assets/{AgentAvatar-CneOa70z.js → AgentAvatar-D8ZtMluU.js} +1 -1
- package/dist/client/assets/{AgentConfigurationScreen-CkZ7EjZh.js → AgentConfigurationScreen-BlGI6fuM.js} +1 -1
- package/dist/client/assets/{AgentDefinitionsWorkspace-0Y3kqMtv.js → AgentDefinitionsWorkspace-CfaDVCVt.js} +1 -1
- package/dist/client/assets/{AgentDetailCard-Dtc02KUO.js → AgentDetailCard-BTiOmh-a.js} +1 -1
- package/dist/client/assets/{AgentFloorView-B5raPB_U.js → AgentFloorView-DjNLILLt.js} +1 -1
- package/dist/client/assets/{AgentInfoScreen-DFG4ElZD.js → AgentInfoScreen-DG5dlHb_.js} +1 -1
- package/dist/client/assets/{AgentLaneCard-BRAkw8YJ.js → AgentLaneCard-lfRNb7JD.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-T8QE5742.js → AgentLaneChrome-Dlwrbq3g.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-C8RYotnv.js → AgentLaneDetailSheet-BzYzBfcW.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-FyYweLo_.js → AgentLaneSummaryResize-6SOEWUnr.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-Crxx1srt.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-Cil3dNwu.js → AgentLanesPreflight-C3uOiOzd.js} +1 -1
- package/dist/client/assets/{AgentLanesView-DPfO8MOo.js → AgentLanesView-ChNlmY-F.js} +1 -1
- package/dist/client/assets/{AgentLiveActions-DwScaVRF.js → AgentLiveActions-BJ5dIfL3.js} +1 -1
- package/dist/client/assets/{AgentSessions-DKoWA0Lm.js → AgentSessions-DpY0htZV.js} +1 -1
- package/dist/client/assets/{AgentsConsole-DoBIWGoq.js → AgentsConsole-CHyXrjhm.js} +1 -1
- package/dist/client/assets/{AgentsScreen-JuUiSuwY.js → AgentsScreen-BhCjX2lD.js} +1 -1
- package/dist/client/assets/AgentsSubnav-az_VDkri.js +1 -0
- package/dist/client/assets/{AtopView-ycxMrRwp.js → AtopView-BjjPM8OX.js} +1 -1
- package/dist/client/assets/{BackToPicker-D6WgIDb-.js → BackToPicker-D1LV6Cqp.js} +1 -1
- package/dist/client/assets/{BriefingDetailScreen-Zw-taW1s.js → BriefingDetailScreen-B7qJ90Np.js} +1 -1
- package/dist/client/assets/{BriefingsScreen-BerYOoWS.js → BriefingsScreen-CW6N829d.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-Cu93j-Ga.js → BrokerMetadataPanel-BhjECqOK.js} +1 -1
- package/dist/client/assets/{BrokerScreen-CeN90URH.js → BrokerScreen-X3z50712.js} +1 -1
- package/dist/client/assets/{ChatCollapsedStrip-DdKyMSEM.js → ChatCollapsedStrip-DNR9osDy.js} +1 -1
- package/dist/client/assets/{CodeDiffPane-BjCOBLze.js → CodeDiffPane-Bx_2VAzv.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-NSGdCaK0.js → CodeProjectPicker-C1yOJKvs.js} +1 -1
- package/dist/client/assets/{CodeScreen-CA9Sq6Dx.js → CodeScreen-CIKK1LcZ.js} +1 -1
- package/dist/client/assets/{ContextMenu-DnFcmfMR.js → ContextMenu-CHIuVKz7.js} +1 -1
- package/dist/client/assets/{ConversationComposer-CjRXFkvY.js → ConversationComposer-Bf7Ga_49.js} +1 -1
- package/dist/client/assets/{ConversationFeedRows-CgRTIpAv.js → ConversationFeedRows-Cm1Lgo43.js} +1 -1
- package/dist/client/assets/{ConversationHeader-CRmdtuL7.js → ConversationHeader-B_GXrKR0.js} +1 -1
- package/dist/client/assets/{ConversationPanels-DCkcLIHk.js → ConversationPanels-BTBbEvrP.js} +2 -2
- package/dist/client/assets/{ConversationScreen-Br0QQ3xo.js → ConversationScreen-B3l2m3JI.js} +1 -1
- package/dist/client/assets/{ConversationStatus-BJ1CMbAv.js → ConversationStatus-BqhUHD85.js} +1 -1
- package/dist/client/assets/{DataTable-Dzqiaha4.js → DataTable-CJbbgBdA.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-B0WMg_z3.js → DispatchAftermath-BDA9CrOd.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-CZVVIAD5.js → DocumentFocusViewer-B9vodVmG.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-C3a7hJWO.js → EmbeddableSurfacesLab-BdsYRDky.js} +1 -1
- package/dist/client/assets/{EmptyState-CYNJZMrZ.js → EmptyState-BRY5jTpz.js} +1 -1
- package/dist/client/assets/{FileViewerPane-Fwt8_KmD.js → FileViewerPane-9Bveqm9c.js} +1 -1
- package/dist/client/assets/{FleetSearch-Dsi_l2KW.js → FleetSearch-Bj9SCl2f.js} +1 -1
- package/dist/client/assets/{FlightObserveScreen-g_tiGmvz.js → FlightObserveScreen-BVMdsiCC.js} +1 -1
- package/dist/client/assets/{FollowScreen-Bb_rcrzi.js → FollowScreen-BifwHWOV.js} +1 -1
- package/dist/client/assets/{HarnessMark-DrE57dUq.js → HarnessMark-BPAphNjx.js} +1 -1
- package/dist/client/assets/{HarnessesScreen-CAsCJ_tG.js → HarnessesScreen-fMnbnrD4.js} +1 -1
- package/dist/client/assets/{HerdrSession-1eVu9Owj.js → HerdrSession-BujfGzrP.js} +1 -1
- package/dist/client/assets/{HomeHero-W445QrG1.js → HomeHero-BgM6S39l.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-CbPVg3fr.js → KnowledgeSearchInspector-B4ZY24xE.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchScreen-C1lN1xJk.js → KnowledgeSearchScreen-Ch_WENUC.js} +1 -1
- package/dist/client/assets/{LaneToolHoverCard-BkBcDYm-.js → LaneToolHoverCard-B7KdvQvf.js} +1 -1
- package/dist/client/assets/{LaneTraceDetailSheet-CzTd44rf.js → LaneTraceDetailSheet-H3AnN-vN.js} +1 -1
- package/dist/client/assets/{LaneTraceEventFocus-BmMmPTyJ.js → LaneTraceEventFocus-mkMw2wJU.js} +1 -1
- package/dist/client/assets/{MeshCanvas-DwkjsiJ5.js → MeshCanvas-CpKcWxKy.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-vmCpU1sD.js → MeshCanvasMinimap-C9IoGHbe.js} +1 -1
- package/dist/client/assets/{MeshScreen-CkMepUpT.js → MeshScreen-48QkJSDI.js} +1 -1
- package/dist/client/assets/{MeshTopologyView-BD2xLE2C.js → MeshTopologyView-DFzr0IZM.js} +2 -2
- package/dist/client/assets/{MessageComposerSuggestions-qbalTne_.js → MessageComposerSuggestions-FdVHnT_q.js} +1 -1
- package/dist/client/assets/{MessagesScreen-C8UynyLC.js → MessagesScreen-BMOOfbWX.js} +1 -1
- package/dist/client/assets/{MissionContextRail-D5MEP2f4.js → MissionContextRail-Y8QxUZGE.js} +1 -1
- package/dist/client/assets/{MissionControlView-K_I7eftL.js → MissionControlView-BpsHKu1F.js} +1 -1
- package/dist/client/assets/{MissionFocusOverlay-CWKLdUKG.js → MissionFocusOverlay-BPnAEA3F.js} +1 -1
- package/dist/client/assets/{MissionLeftAgentRow-ByGrNAcs.js → MissionLeftAgentRow-iOZ6ds9L.js} +1 -1
- package/dist/client/assets/{MissionLogPane-ZwHJ137T.js → MissionLogPane-B0csI89E.js} +1 -1
- package/dist/client/assets/{NewAgentModal-Do9aVvan.js → NewAgentModal-DBHJR9Qm.js} +1 -1
- package/dist/client/assets/{NewChatComposer-DKlNX1UA.js → NewChatComposer-Hd7pI5Ac.js} +1 -1
- package/dist/client/assets/{NewChatOrigin-DXPvX-hh.js → NewChatOrigin-DmuJ32wa.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-Dghsq2on.js → ObserveEmbedScreen-DyArn7Id.js} +1 -1
- package/dist/client/assets/{ObserveTextFlow-DWNlmTVm.js → ObserveTextFlow-CkMrtT8s.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-BlmGoxCE.js → ObservedTopologyPanel-CaSZZP05.js} +1 -1
- package/dist/client/assets/{OpenScoutAppShell-DDqQi-oe.js → OpenScoutAppShell-BtlKkiuF.js} +1 -1
- package/dist/client/assets/{OpsAgentsView-Bn_fGBdo.js → OpsAgentsView-CnqrwbC2.js} +1 -1
- package/dist/client/assets/OpsScreen-DOlmlVkP.js +1 -0
- package/dist/client/assets/OpsSubnav-Dj3ShAKv.js +1 -0
- package/dist/client/assets/{PlanView-B6gKo543.js → PlanView-BLGdWDx6.js} +1 -1
- package/dist/client/assets/ProjectAgentProfile-Dv1sVnQl.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-C5QWwZCn.js → ProjectAgentProfileBar-BLVg5EeA.js} +1 -1
- package/dist/client/assets/{ProjectAgentProfileHero-DC7Dd8VL.js → ProjectAgentProfileHero-0-GDhsPT.js} +1 -1
- package/dist/client/assets/{ProjectsInbox-DCLrDmj1.js → ProjectsInbox-B3DpAI5b.js} +1 -1
- package/dist/client/assets/{ProjectsRail-C4hiXYSb.js → ProjectsRail-BDl7U9Jq.js} +1 -1
- package/dist/client/assets/ProjectsScreen-Dl2FcGrR.js +1 -0
- package/dist/client/assets/{ProjectsThreadAside-DYmL2dCY.js → ProjectsThreadAside-BcGC5mHE.js} +1 -1
- package/dist/client/assets/{Provider-p-xuaAoE.js → Provider-cJCdHAxu.js} +1 -1
- package/dist/client/assets/{RailRow-bRkkXIpR.js → RailRow-CLcVmywd.js} +1 -1
- package/dist/client/assets/{RawSessionsTable-B7WKmXrk.js → RawSessionsTable-DBto4Ts-.js} +1 -1
- package/dist/client/assets/{RealtimeVoiceScreen-BzP3BQq9.js → RealtimeVoiceScreen-DXEU5v3g.js} +1 -1
- package/dist/client/assets/{RepoDiffEmbedScreen-xjzjcJ_c.js → RepoDiffEmbedScreen-BCDXFE3D.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-DRzIY-dk.js → RepoDiffPageScreen-m62FiWXC.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-CNDp01KM.js → RepoDiffViewer-PaNeZMhJ.js} +1 -1
- package/dist/client/assets/RepoDiffViewerLazy-CWE5GxMP.js +2 -0
- package/dist/client/assets/{ReposScreen-CpaLC_NU.js → ReposScreen-Cksv1cAD.js} +1 -1
- package/dist/client/assets/{ScoutDeckSurface-DkpZ-0DH.js → ScoutDeckSurface-BCjPl7C4.js} +1 -1
- package/dist/client/assets/{ScoutSurface-BENBUt5-.js → ScoutSurface-CkgT7A-c.js} +1 -1
- package/dist/client/assets/{ScoutbotBroadcastChip-CGZyxS5H.js → ScoutbotBroadcastChip-DkiRCHuK.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-Bk2ZsfPp.js → ScoutbotFxLab-D-kV5j4T.js} +1 -1
- package/dist/client/assets/{ScoutbotRealtimeVoiceCall-n63LdBZs.js → ScoutbotRealtimeVoiceCall-1ixiEn1L.js} +1 -1
- package/dist/client/assets/{SecondaryNav-B4IsujYh.js → SecondaryNav-_wyKjwNf.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-CPfH-jqN.js → SessionEmbedScreen-CJZmIBV7.js} +1 -1
- package/dist/client/assets/{SessionObserve-B-SkP3tu.js → SessionObserve-yYA8Gy5s.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-CF5jnH3-.js → SessionObserveEvidence-cHdjYOJe.js} +1 -1
- package/dist/client/assets/{SessionRefScreen-C-4jjmVG.js → SessionRefScreen-OkTY7Szg.js} +1 -1
- package/dist/client/assets/SessionsScreen-B-GFjxIA.js +1 -0
- package/dist/client/assets/{SettingsDrawer-DATxwZrn.js → SettingsDrawer-Co11RFX0.js} +1 -1
- package/dist/client/assets/{SettingsScreen-Bu53X7J_.js → SettingsScreen-Cn09nq5_.js} +1 -1
- package/dist/client/assets/{ShikiPane-DH8yYDks.js → ShikiPane-dBS9hD-z.js} +1 -1
- package/dist/client/assets/{SlidePanel-RFXJpfUa.js → SlidePanel-CH-3-8_2.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-CEYdCzem.js → SpriteAvatar-DS6Tmyua.js} +1 -1
- package/dist/client/assets/{StatusPill-9uy70ttd.js → StatusPill-C8m9ZymF.js} +1 -1
- package/dist/client/assets/{TailView-6bIrgdxN.js → TailView-B0BSopPs.js} +1 -1
- package/dist/client/assets/{Terminal-BI6km7H4.js → Terminal-U8gjIdm3.js} +1 -1
- package/dist/client/assets/{TerminalEmbedScreen-D4JOWwtm.js → TerminalEmbedScreen-CTmdE7us.js} +1 -1
- package/dist/client/assets/{TextDocumentSurface-BcP9vvji.js → TextDocumentSurface-BWJCGBZf.js} +1 -1
- package/dist/client/assets/{TmuxPeek-IaWqCgyJ.js → TmuxPeek-B4QdHbGm.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-C80iZxgy.js → VoicePermissionsPanel-Dd4ITJy_.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-CweZ6fEd.js → WorkDetailScreen-mJs0mb99.js} +1 -1
- package/dist/client/assets/{WorkFilesViewer-Dy_-06iI.js → WorkFilesViewer-ODzLXKxj.js} +1 -1
- package/dist/client/assets/{activity-DS0u0Itf.js → activity-CC8JzJNH.js} +1 -1
- package/dist/client/assets/{addon-fit-CN888B3D.js → addon-fit-CaZ-uLrg.js} +1 -1
- package/dist/client/assets/{addon-webgl-CoAnanQS.js → addon-webgl-B8utL3bM.js} +1 -1
- package/dist/client/assets/{agent-essentials-CuK4G_zS.js → agent-essentials-B3wcxg_v.js} +1 -1
- package/dist/client/assets/{arc.es-BET9ev6q.js → arc.es-uFv9UrHn.js} +1 -1
- package/dist/client/assets/{arrow-down-DxxPnPwh.js → arrow-down-w1HPzDSE.js} +1 -1
- package/dist/client/assets/{arrow-left-CXDkJuCg.js → arrow-left-B-3GJ7ct.js} +1 -1
- package/dist/client/assets/{arrow-up-right-Bj8RjSqW.js → arrow-up-right-G6bJXxhK.js} +1 -1
- package/dist/client/assets/{bot-BSGSicKC.js → bot-DzCOGKi6.js} +1 -1
- package/dist/client/assets/{check-BfA0T8UD.js → check-BX8nRgop.js} +1 -1
- package/dist/client/assets/{chevron-down-BVg09D6U.js → chevron-down-B3VVRJcV.js} +1 -1
- package/dist/client/assets/{chevron-right-CaEwYkxE.js → chevron-right-BYMV1511.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-HhKwnZCi.js → chunk-HRAB3GC3-dRd2eQMJ.js} +1 -1
- package/dist/client/assets/{chunk-JTPDIGGW-DX2eTIQ_.js → chunk-JTPDIGGW-BjX67kHU.js} +3 -3
- package/dist/client/assets/{chunk-T65CQEWV-D-bOfuCH.js → chunk-T65CQEWV-kP6nJjkU.js} +1 -1
- package/dist/client/assets/{chunk-YOZR3KYS-oS9dlQCI.js → chunk-YOZR3KYS-C13bZPVd.js} +1 -1
- package/dist/client/assets/{clock-C3TUL7D7.js → clock-B9ukVaVn.js} +1 -1
- package/dist/client/assets/{code-xml-Dbvjk9Kw.js → code-xml-BFc3TMSm.js} +1 -1
- package/dist/client/assets/{content-CiOMtgQc.js → content-B8gahuBy.js} +1 -1
- package/dist/client/assets/content-BIqX06OQ.js +1 -0
- package/dist/client/assets/content-BKDZ6Fxe.js +1 -0
- package/dist/client/assets/content-C15Ya-iu.js +1 -0
- package/dist/client/assets/content-CDE9tJDF.js +1 -0
- package/dist/client/assets/content-CSAfI-PX.js +1 -0
- package/dist/client/assets/content-CTF9D60D.js +1 -0
- package/dist/client/assets/{content-CJuH5cDP.js → content-CbAGkYQO.js} +1 -1
- package/dist/client/assets/content-CtqLJOVp.js +1 -0
- package/dist/client/assets/content-Dvs1KRfo.js +1 -0
- package/dist/client/assets/content-DyJdVZjI.js +1 -0
- package/dist/client/assets/{content-C2TZOKSE.js → content-Ji7ATaf7.js} +1 -1
- package/dist/client/assets/content-eqZXKWcP.js +1 -0
- package/dist/client/assets/content-iyyQKwvA.js +1 -0
- package/dist/client/assets/content-pDE7Fpb9.js +1 -0
- package/dist/client/assets/content-pPSd2dua.js +1 -0
- package/dist/client/assets/{conversation-icons-DmC_Ak3z.js → conversation-icons-gpsv650H.js} +1 -1
- package/dist/client/assets/conversation-motion-features-DXtKlmuM.js +1 -0
- package/dist/client/assets/{copy-C79v_7D-.js → copy-BFmOcWof.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DCq_3fQn.js → createLucideIcon-CFBn0Sdk.js} +1 -1
- package/dist/client/assets/{discover-IEnbrH8_.js → discover-DKf0aTr_.js} +2 -2
- package/dist/client/assets/embed-entry-RlQUTtc4.js +2 -0
- package/dist/client/assets/{external-link-Dd8xaveL.js → external-link-B1TI5yIt.js} +1 -1
- package/dist/client/assets/{eye-DkU59kfl.js → eye-1J4yOUoG.js} +1 -1
- package/dist/client/assets/{file-text-BITQqGtF.js → file-text-DcYSrI4v.js} +1 -1
- package/dist/client/assets/{gestures-B5rLNRpi.js → gestures-CcEOV6Sr.js} +1 -1
- package/dist/client/assets/{home-moving-signal-Bs635mVw.js → home-moving-signal-Bh2FugbH.js} +1 -1
- package/dist/client/assets/{home-now-card-VxlLjg1A.js → home-now-card-ByRH5fFx.js} +1 -1
- package/dist/client/assets/{home-now-card-nano-C06GMiwD.js → home-now-card-nano-y1EhBvVL.js} +1 -1
- package/dist/client/assets/{hooks-BWiLxTw1.js → hooks-DUZwL3Aq.js} +1 -1
- package/dist/client/assets/index-BBznYVWk.css +1 -0
- package/dist/client/assets/{index-BTj2MguM.js → index-BTuq-8Iv.js} +1 -1
- package/dist/client/assets/index-CmwGCxUk.js +1 -0
- package/dist/client/assets/{index-BZovGpDk.js → index-DmFAhGPj.js} +2 -2
- package/dist/client/assets/{index-vbaJ8sin.js → index-Dtaswdsh.js} +1 -1
- package/dist/client/assets/{inspector-panel-C96HcyK5.js → inspector-panel-DzgS5_Mv.js} +1 -1
- package/dist/client/assets/{keyboard-nav-CHo_xmjw.js → keyboard-nav-h1IdakpD.js} +1 -1
- package/dist/client/assets/{lane-roster-store-B6ybJlHJ.js → lane-roster-store-71vFgAem.js} +1 -1
- package/dist/client/assets/{left-DMJkmJOF.js → left-8NITBvFX.js} +1 -1
- package/dist/client/assets/{left-COMAiMfB.js → left-B2HEqrTM.js} +1 -1
- package/dist/client/assets/{left-C6Zj3cR4.js → left-CTYUvXbe.js} +1 -1
- package/dist/client/assets/{left-BuJ0wJW1.js → left-CwDRT50z.js} +1 -1
- package/dist/client/assets/{left-l92tw5Kc.js → left-CxlDLJlw.js} +1 -1
- package/dist/client/assets/{left-Ce4WKYPK.js → left-XFXxNd4g.js} +1 -1
- package/dist/client/assets/{left-agents-BuSyVNGE.js → left-agents-Ck4Xn-R8.js} +1 -1
- package/dist/client/assets/{left-default-DRHywOKX.js → left-default-BeOyS0bR.js} +1 -1
- package/dist/client/assets/{left-lanes-4-aUyyrV.js → left-lanes-DZp3jJMo.js} +1 -1
- package/dist/client/assets/{left-mission-e849d_Td.js → left-mission-CuKFQ5xL.js} +1 -1
- package/dist/client/assets/left-p1hkO6P0.js +1 -0
- package/dist/client/assets/{left-plan-MchYwAB_.js → left-plan-3rrFENhp.js} +1 -1
- package/dist/client/assets/{library-DygjpA6u.js → library-E--gKzEZ.js} +1 -1
- package/dist/client/assets/{loader-circle-B-l2Wj3-.js → loader-circle-d6PKL_KD.js} +1 -1
- package/dist/client/assets/{local-agents-Wof5knTJ.js → local-agents-B5pq17tZ.js} +1 -1
- package/dist/client/assets/{mentions-BjXfeF7t.js → mentions-agCGDgyA.js} +1 -1
- package/dist/client/assets/{mesh-ops-C1gq8zKf.js → mesh-ops-5pZCYptW.js} +1 -1
- package/dist/client/assets/{mesh-view-store-B56D3f77.js → mesh-view-store-KJzABIkN.js} +1 -1
- package/dist/client/assets/{message-circle-BwVx5X0q.js → message-circle-CJO-pi7b.js} +1 -1
- package/dist/client/assets/{message-markup-DlVX-iuc.js → message-markup-CyRDLdOn.js} +1 -1
- package/dist/client/assets/{message-square-BnkG6tae.js → message-square-D1hMsMj_.js} +1 -1
- package/dist/client/assets/{mission-control-store-CMgIVjLJ.js → mission-control-store-Ce6dOvnZ.js} +1 -1
- package/dist/client/assets/{observe-DVHAcIrv.js → observe-BSWVM8YA.js} +1 -1
- package/dist/client/assets/{page-status-Bg2hd27j.js → page-status-D2FQLJOX.js} +1 -1
- package/dist/client/assets/{paperclip-DblaLD_N.js → paperclip-iZmDMOS5.js} +1 -1
- package/dist/client/assets/{plus-BAI0t5g9.js → plus-gZ0T0eBI.js} +1 -1
- package/dist/client/assets/{profile-3Q4sUtvJ.js → profile-Dxj3VVOM.js} +1 -1
- package/dist/client/assets/{projects-inbox-Da2hYEn6.js → projects-inbox-Dzt_GQDv.js} +1 -1
- package/dist/client/assets/{radio-BGtkyCG9.js → radio-RMLfV4EO.js} +1 -1
- package/dist/client/assets/{refresh-cw-DtF8xPqX.js → refresh-cw-C4x1x6b_.js} +1 -1
- package/dist/client/assets/resolve-panes-C9gF0w4e.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-DxbY5RCH.js +1 -0
- package/dist/client/assets/{right-Dd2DscRz.js → right-5L7Tn0zG.js} +1 -1
- package/dist/client/assets/{right-BU_W1kSH.js → right-CYtkMmRu.js} +1 -1
- package/dist/client/assets/{right-CUP-NIDG.js → right-CreoQzPP.js} +1 -1
- package/dist/client/assets/{right-c4PAdFYZ.js → right-D-k9Z1Fe.js} +1 -1
- package/dist/client/assets/{right-ByptvkVX.js → right-D9xFfy2b.js} +1 -1
- package/dist/client/assets/{right-BlR7h0US.js → right-DI7zHADe.js} +1 -1
- package/dist/client/assets/{right-BwgwTGGd.js → right-DUbJ3WVc.js} +1 -1
- package/dist/client/assets/{right-DmVHd8Xj.js → right-DiybhsiK.js} +1 -1
- package/dist/client/assets/{right-Ch_jrNe2.js → right-Jh_1Q88s.js} +1 -1
- package/dist/client/assets/{right-B8qg3JdB.js → right-udr1qTJG.js} +1 -1
- package/dist/client/assets/{rocket-BWh18pt_.js → rocket-CMM-IdLy.js} +1 -1
- package/dist/client/assets/{router-63XV_E7f.js → router-Cn_s9IGH.js} +1 -1
- package/dist/client/assets/{runtime-picker-BXKJbLot.js → runtime-picker--IW3cRry.js} +1 -1
- package/dist/client/assets/{scope-views-Dm2_-NPi.js → scope-views-BIfMTXU4.js} +1 -1
- package/dist/client/assets/{scout-voice-D8Q5sZOL.js → scout-voice-CwbOz6EN.js} +1 -1
- package/dist/client/assets/{scroll-text-DZb3mmYo.js → scroll-text-DPPYrqB9.js} +1 -1
- package/dist/client/assets/{search-1QMVOxF3.js → search-DAyagUtF.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-c0cz3MkJ.js → secondaryNavConfig-Dw3gS1jR.js} +1 -1
- package/dist/client/assets/{selection-bridge-O9C4kGfF.js → selection-bridge-BXw09aRF.js} +1 -1
- package/dist/client/assets/{send-horizontal-DbyEkGql.js → send-horizontal-IcG46D2M.js} +1 -1
- package/dist/client/assets/{server-Bncn9S7r.js → server-BySujhDV.js} +1 -1
- package/dist/client/assets/{session-catalog-DC6BlBBC.js → session-catalog-ClS9xf6i.js} +1 -1
- package/dist/client/assets/{session-table-BUPq9Viy.js → session-table-BdpHs1GN.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-CMe8Bay1.js → sliders-horizontal-R5pWUUcH.js} +1 -1
- package/dist/client/assets/{sparkles-_7cTZsIH.js → sparkles-DJOBD_8l.js} +1 -1
- package/dist/client/assets/{sse-Bb0EOcU9.js → sse-CxXt4tqI.js} +1 -1
- package/dist/client/assets/{tail-events-C12pfUax.js → tail-events-BdvqZHLr.js} +1 -1
- package/dist/client/assets/{terminal-xGf_F3y7.js → terminal-DJPUp_Qn.js} +1 -1
- package/dist/client/assets/{terminal-relay-BgfVJXIL.js → terminal-relay-TffuSPGs.js} +1 -1
- package/dist/client/assets/{terminal-takeover--05EYhJm.js → terminal-takeover-BOFPRPjR.js} +1 -1
- package/dist/client/assets/{use-conversation-list-DWX02INv.js → use-conversation-list-C-dPcjQe.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-Cnwa4hTK.js → use-fleet-active-asks-BHzeBZSW.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-BRFm37oY.js → use-mesh-ops-items-KmaauBr_.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-C8cWvIZ3.js → use-reduced-motion-CYqhYqHO.js} +1 -1
- package/dist/client/assets/{use-scout-dev-flags-FkMreOOb.js → use-scout-dev-flags-BJbw87PK.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-DvPZSJK3.js → useAgentHoverCard-C6o0tlat.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-DjHBrgnS.js +1 -0
- package/dist/client/assets/{usePierreRuntime-C8WJ0X3F.js → usePierreRuntime-Cm7-qdm0.js} +1 -1
- package/dist/client/assets/{wrench-_tHBGTop.js → wrench-CvRjjByE.js} +1 -1
- package/dist/client/assets/{x-CrGUKNRv.js → x-C8ayPBtj.js} +1 -1
- package/dist/client/assets/{xterm-Ks-VlLTq.js → xterm-B0ci4Q9a.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/main.mjs +348 -254
- package/dist/scout-web-server.mjs +2 -96660
- package/package.json +3 -3
- package/dist/client/assets/AgentLanesEmbedScreen-Br7cmZVO.js +0 -1
- package/dist/client/assets/AgentsSubnav-BV0WAgzf.js +0 -1
- package/dist/client/assets/OpsScreen-DHnT-Q9R.js +0 -1
- package/dist/client/assets/OpsSubnav-CJRD7MjM.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-Be1VOkI4.js +0 -1
- package/dist/client/assets/ProjectsScreen-jruZRjgD.js +0 -1
- package/dist/client/assets/RepoDiffViewerLazy-b6vjYxez.js +0 -2
- package/dist/client/assets/SessionsScreen-HAjFvmIq.js +0 -1
- package/dist/client/assets/content-BQuEedeL.js +0 -1
- package/dist/client/assets/content-BUae-L_N.js +0 -1
- package/dist/client/assets/content-BfG98J1k.js +0 -1
- package/dist/client/assets/content-BkVTfkAC.js +0 -1
- package/dist/client/assets/content-BsNMos_d.js +0 -1
- package/dist/client/assets/content-CCn98eSk.js +0 -1
- package/dist/client/assets/content-CYnPp9yo.js +0 -1
- package/dist/client/assets/content-CcrUhm4P.js +0 -1
- package/dist/client/assets/content-CxuVONeQ.js +0 -1
- package/dist/client/assets/content-Dmq9n1_L.js +0 -1
- package/dist/client/assets/content-DskHP2NI.js +0 -1
- package/dist/client/assets/content-DvvzL2HK.js +0 -1
- package/dist/client/assets/content-snCAUbwv.js +0 -1
- package/dist/client/assets/conversation-motion-features-DPiGTO21.js +0 -1
- package/dist/client/assets/embed-entry-XUPb-AzL.js +0 -2
- package/dist/client/assets/index-9as_JTUs.css +0 -1
- package/dist/client/assets/index-DiiEQwdc.js +0 -1
- package/dist/client/assets/left-DrCbY6ja.js +0 -1
- package/dist/client/assets/resolve-panes-D4tlKNCT.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-B27lj3Ci.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-CNlrhvvx.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as d}from"./index-BZovGpDk.js";import{p as v,a as b}from"./api-h5zurxmi.js";import{u as Q,e as Z}from"./Provider-p-xuaAoE.js";import{P as ee,b as te}from"./router-63XV_E7f.js";import{u as se}from"./sse-Bb0EOcU9.js";import{o as oe,i as D}from"./surface-activity-B1rgWB1i.js";/* empty css */import{AgentsSubnav as ne}from"./AgentsSubnav-BV0WAgzf.js";import{AgentsLibrary as ie}from"./library-DygjpA6u.js";import{r as re,d as ae}from"./model-Co0zkMIc.js";import{AgentDetailWithRail as de,AgentProfileBar as le}from"./profile-3Q4sUtvJ.js";/* empty css *//* empty css *//* empty css */import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./index-BWHgHrtv.js";import"./SecondaryNav-B4IsujYh.js";import"./secondaryNavConfig-c0cz3MkJ.js";import"./message-square-BnkG6tae.js";import"./terminal-xGf_F3y7.js";import"./scroll-text-DZb3mmYo.js";/* empty css */import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";import"./AgentSessions-DKoWA0Lm.js";import"./openContent-C6XO6kr5.js";import"./clipboard-e3fSpeo7.js";import"./text-DsBWV_4k.js";import"./agents-project-model-UYiamtrU.js";import"./AgentAvatar-CneOa70z.js";import"./context-budget-DX_fwUs3.js";import"./session-catalog-DC6BlBBC.js";import"./terminal-relay-BgfVJXIL.js";import"./BackToPicker-D6WgIDb-.js";import"./ConversationScreen-Br0QQ3xo.js";import"./ConversationComposer-CjRXFkvY.js";import"./message-markup-DlVX-iuc.js";import"./mentions-BjXfeF7t.js";import"./AgentDetailCard-Dtc02KUO.js";import"./AgentLiveActions-DwScaVRF.js";import"./terminal-takeover--05EYhJm.js";import"./eye-DkU59kfl.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./types-B0PlfpKc.js";import"./ConversationHeader-CRmdtuL7.js";import"./ConversationFeedRows-CgRTIpAv.js";import"./ConversationPanels-DCkcLIHk.js";import"./use-reduced-motion-C8cWvIZ3.js";import"./activity-DS0u0Itf.js";import"./message-circle-BwVx5X0q.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./tail-events-C12pfUax.js";import"./ConversationStatus-BJ1CMbAv.js";import"./SessionObserve-B-SkP3tu.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-BkBcDYm-.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-BlmGoxCE.js";import"./ObserveTextFlow-DWNlmTVm.js";import"./SessionObserveEvidence-CF5jnH3-.js";import"./wrench-_tHBGTop.js";import"./external-link-Dd8xaveL.js";import"./AgentDefinitionsWorkspace-0Y3kqMtv.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-Fwt8_KmD.js";/* empty css */import"./agent-essentials-CuK4G_zS.js";const K=new Set(["0","false","off","no","clear","none"]),ce=new Set(["1","true","on","yes"]),ue=new Set(["localhost","127.0.0.1","::1"]);function me(t){return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t}function L(t){const o=t?.trim().toLowerCase();return o==="before"||o==="after"?o:null}function z(t){if(!t)return null;const o=t.trim().toLowerCase();return ce.has(o)?!0:K.has(o)?!1:null}function M(t,o,i=[]){const r=z(t);if(r!==null)return r;if(!t)return null;const l=o.toLowerCase(),a=new Set([l,l.replace(/-/g,""),...i.map(n=>n.trim().toLowerCase()).filter(Boolean)]),s=t.split(",").map(n=>n.trim().toLowerCase()).filter(Boolean);return s.some(n=>K.has(n))?!1:s.some(n=>a.has(n))?!0:null}function pe({studyId:t,aliases:o,href:i,storedEnabled:r,storedMode:l,dev:a,defaultMode:s="after"}){const n=i?new URL(i,"http://localhost"):null,p=M(n?.searchParams.get("studio"),t,o)??M(n?.searchParams.get(`studio.${t}`),t,o)??M(n?.searchParams.get("studioInjection"),t,o),c=n?ue.has(me(n.hostname)):!1;if(!a&&!c)return{enabled:!1,mode:s};const m=p??z(r)??!1,g=L(n?.searchParams.get("studioMode"))??L(n?.searchParams.get(`studioMode.${t}`))??L(l)??s;return{enabled:m,mode:g}}const he="openscout.studio.inject.",fe="openscout.studio.mode.";function O(t){return`${he}${t}`}function T(t){return`${fe}${t}`}function $(t){if(typeof window>"u")return null;try{return window.localStorage.getItem(t)}catch{return null}}function I(t,o){if(!(typeof window>"u"))try{window.localStorage.setItem(t,o)}catch{}}function ge(){return import.meta.env?.DEV===!0}function je(t){return t==="before"?"after":"before"}function xe(t){typeof window>"u"||ee({searchPatch:{studio:null,[`studio.${t}`]:null,studioInjection:null,studioMode:null,[`studioMode.${t}`]:null},replace:!0})}function ve(t,o=[]){const[i,r]=d.useState(()=>pe({studyId:t,aliases:o,href:typeof window>"u"?void 0:window.location.href,storedEnabled:$(O(t)),storedMode:$(T(t)),dev:ge()})),[l,a]=d.useState(!1);d.useEffect(()=>{if(!i.enabled){a(!1);return}const c=j=>{j.altKey&&a(!0)},m=j=>{j.altKey||a(!1)},g=()=>a(!1);return window.addEventListener("keydown",c),window.addEventListener("keyup",m),window.addEventListener("blur",g),()=>{window.removeEventListener("keydown",c),window.removeEventListener("keyup",m),window.removeEventListener("blur",g)}},[i.enabled]);const s=d.useCallback(c=>{I(O(t),c?"1":"0"),r(m=>({...m,enabled:c}))},[t]),n=d.useCallback(c=>{I(T(t),c),r(m=>({...m,mode:c}))},[t]),p=l?je(i.mode):i.mode;return d.useMemo(()=>({...i,renderedMode:p,peeking:p!==i.mode,setEnabled:s,setMode:n}),[p,s,n,i])}function Se({studyId:t,aliases:o,anchor:i,title:r,children:l,renderStudy:a}){const s=ve(t,o);return s.enabled?e.jsxs("div",{className:"s-studio-injection","data-studio-anchor":i,children:[e.jsxs("div",{className:"s-studio-injection-bar",children:[e.jsxs("div",{className:"s-studio-injection-label",children:[e.jsx("span",{className:"s-studio-injection-kicker",children:"Studio injection"}),e.jsx("span",{className:"s-studio-injection-title",children:r}),e.jsx("span",{className:"s-studio-injection-anchor",children:i})]}),e.jsxs("div",{className:"s-studio-injection-controls",role:"group","aria-label":`${r} mode`,children:[e.jsx("button",{type:"button",className:"s-studio-injection-mode","data-active":s.mode==="before","aria-pressed":s.mode==="before",onClick:()=>s.setMode("before"),children:"Before"}),e.jsx("button",{type:"button",className:"s-studio-injection-mode","data-active":s.mode==="after","aria-pressed":s.mode==="after",onClick:()=>s.setMode("after"),children:"After"})]}),e.jsx("span",{className:"s-studio-injection-state",children:s.peeking?`Option: ${s.renderedMode}`:s.renderedMode}),e.jsx("button",{type:"button",className:"s-studio-injection-close",onClick:()=>{xe(t),s.setEnabled(!1)},children:"Close"})]}),e.jsx("div",{className:"s-studio-injection-body","data-studio-mode":s.renderedMode,children:s.renderedMode==="before"?l:a()})]}):e.jsx(e.Fragment,{children:l})}const N=[{id:"openscout",title:"openscout",root:"~/dev/openscout",signal:"Studio mode injection for agent directory",sessions:9,agents:[{id:"hudson",name:"Hudson",handle:"@hudson",state:"working",role:"web design system",branch:"feat/studio-mode",task:"Refactoring the agent directory into insertion points",last:"18s"},{id:"scout",name:"Scout",handle:"@scout",state:"attention",role:"operator assistant",branch:"main",task:"Needs placement decision",last:"1m"},{id:"quill",name:"Quill",handle:"@quill",state:"ready",role:"docs",branch:"docs/agent-view",task:"Ready to write the study summary",last:"7m"}]},{id:"hudson",title:"hudson",root:"~/dev/hudson",signal:"Slot contracts and chrome primitives",sessions:4,agents:[{id:"atlas",name:"Atlas",handle:"@atlas",state:"working",role:"framework",branch:"slots/studio-anchor",task:"Mapping chrome slots to page anchors",last:"3m"},{id:"mira",name:"Mira",handle:"@mira",state:"ready",role:"qa",branch:"main",task:"Idle",last:"12m"}]},{id:"lattices",title:"lattices",root:"~/dev/lattices",signal:"macOS web view parity pass",sessions:2,agents:[{id:"north",name:"North",handle:"@north",state:"offline",role:"native",branch:"main",task:"No active session",last:"1h"}]}],we={working:"working",ready:"ready",attention:"attention",offline:"offline"};function ye({children:t}){return e.jsx(Se,{studyId:"agent-directory",aliases:["agents","agent","agent-directory-before-after"],anchor:"agents.directory",title:"Agent Directory",renderStudy:()=>e.jsx(be,{}),children:t})}function be(){const t=N.flatMap(s=>s.agents),o=t.filter(s=>s.state==="working"),i=t.filter(s=>s.state==="ready"),r=t.filter(s=>s.state==="attention"),l=N.reduce((s,n)=>s+n.sessions,0),a=o[0]??t[0];return e.jsxs("section",{className:"s-agent-studio-study","aria-label":"Agent directory injected study",children:[e.jsxs("div",{className:"s-agent-studio-banner",children:[e.jsx("span",{children:"After study"}),e.jsx("strong",{children:"Injected static view inside the live Agents route"}),e.jsx("em",{children:"Fixture data · insertion-point prototype · no backend writes"})]}),e.jsxs("header",{className:"s-agent-studio-head","data-studio-anchor":"agent.directory.header",children:[e.jsxs("div",{className:"s-agent-studio-title-block",children:[e.jsx("span",{className:"s-agent-studio-kicker",children:"Studio / agents.directory / after"}),e.jsx("h1",{className:"s-agent-studio-title",children:"Project command center"}),e.jsxs("span",{className:"s-agent-studio-subtitle",children:[t.length," agents across ",N.length," projects"]})]}),e.jsxs("div",{className:"s-agent-studio-metrics","aria-label":"Agent study summary",children:[e.jsx(A,{label:"working",value:o.length,tone:"working"}),e.jsx(A,{label:"ready",value:i.length}),e.jsx(A,{label:"attention",value:r.length,tone:"attention"}),e.jsx(A,{label:"sessions",value:l})]})]}),e.jsxs("div",{className:"s-agent-studio-layout",children:[e.jsxs("div",{className:"s-agent-studio-main",children:[e.jsxs("section",{className:"s-agent-studio-pressure","data-studio-anchor":"agent.active-strip",children:[e.jsxs("div",{className:"s-agent-studio-section-head",children:[e.jsx("span",{children:"Pressure queue"}),e.jsx("strong",{children:o.length+r.length})]}),e.jsx("div",{className:"s-agent-studio-pressure-list",children:[...o,...r].map(s=>e.jsxs("article",{className:`s-agent-studio-pressure-card s-agent-studio-pressure-card--${s.state}`,children:[e.jsx("span",{className:"s-agent-studio-dot","data-state":s.state}),e.jsxs("div",{className:"s-agent-studio-pressure-copy",children:[e.jsx("strong",{children:s.name}),e.jsx("span",{children:s.task})]}),e.jsx("time",{children:s.last})]},s.id))})]}),e.jsx("section",{className:"s-agent-studio-projects","data-studio-anchor":"agent.project-board",children:N.map(s=>e.jsxs("article",{className:"s-agent-studio-project",children:[e.jsxs("div",{className:"s-agent-studio-project-main",children:[e.jsxs("div",{children:[e.jsx("span",{className:"s-agent-studio-project-root",children:s.root}),e.jsx("h2",{children:s.title})]}),e.jsxs("span",{className:"s-agent-studio-project-sessions",children:[s.sessions," sessions"]})]}),e.jsx("p",{children:s.signal}),e.jsx("div",{className:"s-agent-studio-agent-row",children:s.agents.map(n=>e.jsxs("span",{className:`s-agent-studio-agent-pill s-agent-studio-agent-pill--${n.state}`,children:[e.jsx("span",{className:"s-agent-studio-dot","data-state":n.state}),n.name]},n.id))})]},s.id))})]}),e.jsxs("aside",{className:"s-agent-studio-detail","data-studio-anchor":"agent.detail-preview",children:[e.jsx("span",{className:"s-agent-studio-kicker",children:"Pinned agent"}),e.jsx("h2",{children:a.name}),e.jsx("span",{className:`s-agent-studio-state s-agent-studio-state--${a.state}`,children:we[a.state]}),e.jsxs("dl",{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Handle"}),e.jsx("dd",{children:a.handle})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Role"}),e.jsx("dd",{children:a.role})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Branch"}),e.jsx("dd",{children:a.branch})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Current task"}),e.jsx("dd",{children:a.task})]})]})]})]})]})}function A({label:t,value:o,tone:i}){return e.jsxs("div",{className:`s-agent-studio-metric${i?` s-agent-studio-metric--${i}`:""}`,children:[e.jsx("strong",{children:o}),e.jsx("span",{children:t})]})}const P="/api/conversations",H="/api/fleet",F="/api/tail/discover",U="/api/topology/snapshot?force=1",S=3e4;function gs({navigate:t,selectedAgentId:o,conversationId:i,tab:r,activeRoute:l}){const{agents:a,agentsLoaded:s,route:n}=Q(),[p,c]=d.useState(()=>v(P,S)??[]),[m,g]=d.useState(()=>v(H,S)),[j,G]=d.useState(()=>v(F,S)),[q,W]=d.useState(()=>v(U,S)),[X,Y]=d.useState(()=>v(P,S)===null),R=te(n),k=d.useMemo(()=>Z(a,R),[a,R]),x=d.useCallback(async()=>{const[h,f,y,C]=await Promise.allSettled([b(P),b(H),b(F),b(U)]);h.status==="fulfilled"&&c(h.value),f.status==="fulfilled"&&g(f.value),y.status==="fulfilled"&&G(y.value),C.status==="fulfilled"&&W(C.value),Y(!1)},[]);d.useEffect(()=>{x()},[x]),d.useEffect(()=>{const h=()=>{D()&&x()},f=window.setInterval(h,1e4),y=oe(h);return()=>{window.clearInterval(f),y()}},[x]),se(()=>{D()&&x()});const u=re(k,o),_=!!(o&&u&&u.id!==o),w=n.view==="agents-v2"?n.projectSlug:void 0,E=!!(w&&!r),{conversationByAgentId:B,sessionByAgentId:J}=ae(p);if(d.useEffect(()=>{!o||!u||!_||t({view:"agents-v2",agentId:u.id,...E&&w?{projectSlug:w}:{},...i?{conversationId:i}:{},...r?{tab:r}:{}})},[i,r,E,t,w,u,o,_]),u&&!E){const h=i??B.get(u.id)??u.conversationId??null,f=r??(i?"message":"profile");return e.jsx(V,{activeRoute:l??n,navigate:t,bar:e.jsx(le,{agent:u,conversationId:h,activeTab:f,navigate:t}),children:e.jsx(de,{agent:u,allAgents:k,conversationId:h,navigate:t,activeTab:f})})}return e.jsx(V,{activeRoute:l??n,navigate:t,children:e.jsx(ye,{children:e.jsx(ie,{agents:k,fleet:m,sessionByAgentId:J,conversationByAgentId:B,sessions:p,discovery:j,topologySnapshot:q,loading:!s||X,navigate:t,selectedAgentId:u?.id??o})})})}function V({activeRoute:t,children:o,navigate:i,bar:r}){return e.jsxs("div",{className:"s-secondary-nav-shell",children:[e.jsx("div",{className:"s-secondary-nav-bar",children:r??e.jsx(ne,{activeRoute:t,navigate:i})}),e.jsx("div",{className:"s-secondary-nav-body",children:o})]})}export{gs as AgentsScreen};
|
|
1
|
+
import{j as e,r as d}from"./index-DmFAhGPj.js";import{p as v,a as b}from"./api-h5zurxmi.js";import{u as Q,e as Z}from"./Provider-cJCdHAxu.js";import{P as ee,b as te}from"./router-Cn_s9IGH.js";import{u as se}from"./sse-CxXt4tqI.js";import{o as oe,i as D}from"./surface-activity-B1rgWB1i.js";/* empty css */import{AgentsSubnav as ne}from"./AgentsSubnav-az_VDkri.js";import{AgentsLibrary as ie}from"./library-E--gKzEZ.js";import{r as re,d as ae}from"./model-Co0zkMIc.js";import{AgentDetailWithRail as de,AgentProfileBar as le}from"./profile-Dxj3VVOM.js";/* empty css *//* empty css *//* empty css */import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DmuJ32wa.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./index-BWHgHrtv.js";import"./SecondaryNav-_wyKjwNf.js";import"./secondaryNavConfig-Dw3gS1jR.js";import"./message-square-D1hMsMj_.js";import"./terminal-DJPUp_Qn.js";import"./scroll-text-DPPYrqB9.js";/* empty css */import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";import"./AgentSessions-DpY0htZV.js";import"./openContent-C6XO6kr5.js";import"./clipboard-e3fSpeo7.js";import"./text-DsBWV_4k.js";import"./agents-project-model-UYiamtrU.js";import"./AgentAvatar-D8ZtMluU.js";import"./context-budget-DX_fwUs3.js";import"./session-catalog-ClS9xf6i.js";import"./terminal-relay-TffuSPGs.js";import"./BackToPicker-D1LV6Cqp.js";import"./ConversationScreen-B3l2m3JI.js";import"./ConversationComposer-Bf7Ga_49.js";import"./message-markup-CyRDLdOn.js";import"./mentions-agCGDgyA.js";import"./AgentDetailCard-BTiOmh-a.js";import"./AgentLiveActions-BJ5dIfL3.js";import"./terminal-takeover-BOFPRPjR.js";import"./eye-1J4yOUoG.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./types-B0PlfpKc.js";import"./ConversationHeader-B_GXrKR0.js";import"./ConversationFeedRows-Cm1Lgo43.js";import"./ConversationPanels-BTBbEvrP.js";import"./use-reduced-motion-CYqhYqHO.js";import"./activity-CC8JzJNH.js";import"./message-circle-CJO-pi7b.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./tail-events-BdvqZHLr.js";import"./ConversationStatus-BqhUHD85.js";import"./SessionObserve-yYA8Gy5s.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-B7KdvQvf.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CaSZZP05.js";import"./ObserveTextFlow-CkMrtT8s.js";import"./SessionObserveEvidence-cHdjYOJe.js";import"./wrench-CvRjjByE.js";import"./external-link-B1TI5yIt.js";import"./AgentDefinitionsWorkspace-CfaDVCVt.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-9Bveqm9c.js";/* empty css */import"./agent-essentials-B3wcxg_v.js";const K=new Set(["0","false","off","no","clear","none"]),ce=new Set(["1","true","on","yes"]),ue=new Set(["localhost","127.0.0.1","::1"]);function me(t){return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t}function L(t){const o=t?.trim().toLowerCase();return o==="before"||o==="after"?o:null}function z(t){if(!t)return null;const o=t.trim().toLowerCase();return ce.has(o)?!0:K.has(o)?!1:null}function M(t,o,i=[]){const r=z(t);if(r!==null)return r;if(!t)return null;const l=o.toLowerCase(),a=new Set([l,l.replace(/-/g,""),...i.map(n=>n.trim().toLowerCase()).filter(Boolean)]),s=t.split(",").map(n=>n.trim().toLowerCase()).filter(Boolean);return s.some(n=>K.has(n))?!1:s.some(n=>a.has(n))?!0:null}function pe({studyId:t,aliases:o,href:i,storedEnabled:r,storedMode:l,dev:a,defaultMode:s="after"}){const n=i?new URL(i,"http://localhost"):null,p=M(n?.searchParams.get("studio"),t,o)??M(n?.searchParams.get(`studio.${t}`),t,o)??M(n?.searchParams.get("studioInjection"),t,o),c=n?ue.has(me(n.hostname)):!1;if(!a&&!c)return{enabled:!1,mode:s};const m=p??z(r)??!1,g=L(n?.searchParams.get("studioMode"))??L(n?.searchParams.get(`studioMode.${t}`))??L(l)??s;return{enabled:m,mode:g}}const he="openscout.studio.inject.",fe="openscout.studio.mode.";function O(t){return`${he}${t}`}function T(t){return`${fe}${t}`}function $(t){if(typeof window>"u")return null;try{return window.localStorage.getItem(t)}catch{return null}}function I(t,o){if(!(typeof window>"u"))try{window.localStorage.setItem(t,o)}catch{}}function ge(){return import.meta.env?.DEV===!0}function je(t){return t==="before"?"after":"before"}function xe(t){typeof window>"u"||ee({searchPatch:{studio:null,[`studio.${t}`]:null,studioInjection:null,studioMode:null,[`studioMode.${t}`]:null},replace:!0})}function ve(t,o=[]){const[i,r]=d.useState(()=>pe({studyId:t,aliases:o,href:typeof window>"u"?void 0:window.location.href,storedEnabled:$(O(t)),storedMode:$(T(t)),dev:ge()})),[l,a]=d.useState(!1);d.useEffect(()=>{if(!i.enabled){a(!1);return}const c=j=>{j.altKey&&a(!0)},m=j=>{j.altKey||a(!1)},g=()=>a(!1);return window.addEventListener("keydown",c),window.addEventListener("keyup",m),window.addEventListener("blur",g),()=>{window.removeEventListener("keydown",c),window.removeEventListener("keyup",m),window.removeEventListener("blur",g)}},[i.enabled]);const s=d.useCallback(c=>{I(O(t),c?"1":"0"),r(m=>({...m,enabled:c}))},[t]),n=d.useCallback(c=>{I(T(t),c),r(m=>({...m,mode:c}))},[t]),p=l?je(i.mode):i.mode;return d.useMemo(()=>({...i,renderedMode:p,peeking:p!==i.mode,setEnabled:s,setMode:n}),[p,s,n,i])}function Se({studyId:t,aliases:o,anchor:i,title:r,children:l,renderStudy:a}){const s=ve(t,o);return s.enabled?e.jsxs("div",{className:"s-studio-injection","data-studio-anchor":i,children:[e.jsxs("div",{className:"s-studio-injection-bar",children:[e.jsxs("div",{className:"s-studio-injection-label",children:[e.jsx("span",{className:"s-studio-injection-kicker",children:"Studio injection"}),e.jsx("span",{className:"s-studio-injection-title",children:r}),e.jsx("span",{className:"s-studio-injection-anchor",children:i})]}),e.jsxs("div",{className:"s-studio-injection-controls",role:"group","aria-label":`${r} mode`,children:[e.jsx("button",{type:"button",className:"s-studio-injection-mode","data-active":s.mode==="before","aria-pressed":s.mode==="before",onClick:()=>s.setMode("before"),children:"Before"}),e.jsx("button",{type:"button",className:"s-studio-injection-mode","data-active":s.mode==="after","aria-pressed":s.mode==="after",onClick:()=>s.setMode("after"),children:"After"})]}),e.jsx("span",{className:"s-studio-injection-state",children:s.peeking?`Option: ${s.renderedMode}`:s.renderedMode}),e.jsx("button",{type:"button",className:"s-studio-injection-close",onClick:()=>{xe(t),s.setEnabled(!1)},children:"Close"})]}),e.jsx("div",{className:"s-studio-injection-body","data-studio-mode":s.renderedMode,children:s.renderedMode==="before"?l:a()})]}):e.jsx(e.Fragment,{children:l})}const N=[{id:"openscout",title:"openscout",root:"~/dev/openscout",signal:"Studio mode injection for agent directory",sessions:9,agents:[{id:"hudson",name:"Hudson",handle:"@hudson",state:"working",role:"web design system",branch:"feat/studio-mode",task:"Refactoring the agent directory into insertion points",last:"18s"},{id:"scout",name:"Scout",handle:"@scout",state:"attention",role:"operator assistant",branch:"main",task:"Needs placement decision",last:"1m"},{id:"quill",name:"Quill",handle:"@quill",state:"ready",role:"docs",branch:"docs/agent-view",task:"Ready to write the study summary",last:"7m"}]},{id:"hudson",title:"hudson",root:"~/dev/hudson",signal:"Slot contracts and chrome primitives",sessions:4,agents:[{id:"atlas",name:"Atlas",handle:"@atlas",state:"working",role:"framework",branch:"slots/studio-anchor",task:"Mapping chrome slots to page anchors",last:"3m"},{id:"mira",name:"Mira",handle:"@mira",state:"ready",role:"qa",branch:"main",task:"Idle",last:"12m"}]},{id:"lattices",title:"lattices",root:"~/dev/lattices",signal:"macOS web view parity pass",sessions:2,agents:[{id:"north",name:"North",handle:"@north",state:"offline",role:"native",branch:"main",task:"No active session",last:"1h"}]}],we={working:"working",ready:"ready",attention:"attention",offline:"offline"};function ye({children:t}){return e.jsx(Se,{studyId:"agent-directory",aliases:["agents","agent","agent-directory-before-after"],anchor:"agents.directory",title:"Agent Directory",renderStudy:()=>e.jsx(be,{}),children:t})}function be(){const t=N.flatMap(s=>s.agents),o=t.filter(s=>s.state==="working"),i=t.filter(s=>s.state==="ready"),r=t.filter(s=>s.state==="attention"),l=N.reduce((s,n)=>s+n.sessions,0),a=o[0]??t[0];return e.jsxs("section",{className:"s-agent-studio-study","aria-label":"Agent directory injected study",children:[e.jsxs("div",{className:"s-agent-studio-banner",children:[e.jsx("span",{children:"After study"}),e.jsx("strong",{children:"Injected static view inside the live Agents route"}),e.jsx("em",{children:"Fixture data · insertion-point prototype · no backend writes"})]}),e.jsxs("header",{className:"s-agent-studio-head","data-studio-anchor":"agent.directory.header",children:[e.jsxs("div",{className:"s-agent-studio-title-block",children:[e.jsx("span",{className:"s-agent-studio-kicker",children:"Studio / agents.directory / after"}),e.jsx("h1",{className:"s-agent-studio-title",children:"Project command center"}),e.jsxs("span",{className:"s-agent-studio-subtitle",children:[t.length," agents across ",N.length," projects"]})]}),e.jsxs("div",{className:"s-agent-studio-metrics","aria-label":"Agent study summary",children:[e.jsx(A,{label:"working",value:o.length,tone:"working"}),e.jsx(A,{label:"ready",value:i.length}),e.jsx(A,{label:"attention",value:r.length,tone:"attention"}),e.jsx(A,{label:"sessions",value:l})]})]}),e.jsxs("div",{className:"s-agent-studio-layout",children:[e.jsxs("div",{className:"s-agent-studio-main",children:[e.jsxs("section",{className:"s-agent-studio-pressure","data-studio-anchor":"agent.active-strip",children:[e.jsxs("div",{className:"s-agent-studio-section-head",children:[e.jsx("span",{children:"Pressure queue"}),e.jsx("strong",{children:o.length+r.length})]}),e.jsx("div",{className:"s-agent-studio-pressure-list",children:[...o,...r].map(s=>e.jsxs("article",{className:`s-agent-studio-pressure-card s-agent-studio-pressure-card--${s.state}`,children:[e.jsx("span",{className:"s-agent-studio-dot","data-state":s.state}),e.jsxs("div",{className:"s-agent-studio-pressure-copy",children:[e.jsx("strong",{children:s.name}),e.jsx("span",{children:s.task})]}),e.jsx("time",{children:s.last})]},s.id))})]}),e.jsx("section",{className:"s-agent-studio-projects","data-studio-anchor":"agent.project-board",children:N.map(s=>e.jsxs("article",{className:"s-agent-studio-project",children:[e.jsxs("div",{className:"s-agent-studio-project-main",children:[e.jsxs("div",{children:[e.jsx("span",{className:"s-agent-studio-project-root",children:s.root}),e.jsx("h2",{children:s.title})]}),e.jsxs("span",{className:"s-agent-studio-project-sessions",children:[s.sessions," sessions"]})]}),e.jsx("p",{children:s.signal}),e.jsx("div",{className:"s-agent-studio-agent-row",children:s.agents.map(n=>e.jsxs("span",{className:`s-agent-studio-agent-pill s-agent-studio-agent-pill--${n.state}`,children:[e.jsx("span",{className:"s-agent-studio-dot","data-state":n.state}),n.name]},n.id))})]},s.id))})]}),e.jsxs("aside",{className:"s-agent-studio-detail","data-studio-anchor":"agent.detail-preview",children:[e.jsx("span",{className:"s-agent-studio-kicker",children:"Pinned agent"}),e.jsx("h2",{children:a.name}),e.jsx("span",{className:`s-agent-studio-state s-agent-studio-state--${a.state}`,children:we[a.state]}),e.jsxs("dl",{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Handle"}),e.jsx("dd",{children:a.handle})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Role"}),e.jsx("dd",{children:a.role})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Branch"}),e.jsx("dd",{children:a.branch})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Current task"}),e.jsx("dd",{children:a.task})]})]})]})]})]})}function A({label:t,value:o,tone:i}){return e.jsxs("div",{className:`s-agent-studio-metric${i?` s-agent-studio-metric--${i}`:""}`,children:[e.jsx("strong",{children:o}),e.jsx("span",{children:t})]})}const P="/api/conversations",H="/api/fleet",F="/api/tail/discover",U="/api/topology/snapshot?force=1",S=3e4;function gs({navigate:t,selectedAgentId:o,conversationId:i,tab:r,activeRoute:l}){const{agents:a,agentsLoaded:s,route:n}=Q(),[p,c]=d.useState(()=>v(P,S)??[]),[m,g]=d.useState(()=>v(H,S)),[j,G]=d.useState(()=>v(F,S)),[q,W]=d.useState(()=>v(U,S)),[X,Y]=d.useState(()=>v(P,S)===null),R=te(n),k=d.useMemo(()=>Z(a,R),[a,R]),x=d.useCallback(async()=>{const[h,f,y,C]=await Promise.allSettled([b(P),b(H),b(F),b(U)]);h.status==="fulfilled"&&c(h.value),f.status==="fulfilled"&&g(f.value),y.status==="fulfilled"&&G(y.value),C.status==="fulfilled"&&W(C.value),Y(!1)},[]);d.useEffect(()=>{x()},[x]),d.useEffect(()=>{const h=()=>{D()&&x()},f=window.setInterval(h,1e4),y=oe(h);return()=>{window.clearInterval(f),y()}},[x]),se(()=>{D()&&x()});const u=re(k,o),_=!!(o&&u&&u.id!==o),w=n.view==="agents-v2"?n.projectSlug:void 0,E=!!(w&&!r),{conversationByAgentId:B,sessionByAgentId:J}=ae(p);if(d.useEffect(()=>{!o||!u||!_||t({view:"agents-v2",agentId:u.id,...E&&w?{projectSlug:w}:{},...i?{conversationId:i}:{},...r?{tab:r}:{}})},[i,r,E,t,w,u,o,_]),u&&!E){const h=i??B.get(u.id)??u.conversationId??null,f=r??(i?"message":"profile");return e.jsx(V,{activeRoute:l??n,navigate:t,bar:e.jsx(le,{agent:u,conversationId:h,activeTab:f,navigate:t}),children:e.jsx(de,{agent:u,allAgents:k,conversationId:h,navigate:t,activeTab:f})})}return e.jsx(V,{activeRoute:l??n,navigate:t,children:e.jsx(ye,{children:e.jsx(ie,{agents:k,fleet:m,sessionByAgentId:J,conversationByAgentId:B,sessions:p,discovery:j,topologySnapshot:q,loading:!s||X,navigate:t,selectedAgentId:u?.id??o})})})}function V({activeRoute:t,children:o,navigate:i,bar:r}){return e.jsxs("div",{className:"s-secondary-nav-shell",children:[e.jsx("div",{className:"s-secondary-nav-bar",children:r??e.jsx(ne,{activeRoute:t,navigate:i})}),e.jsx("div",{className:"s-secondary-nav-body",children:o})]})}export{gs as AgentsScreen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./index-DmFAhGPj.js";import{S as i}from"./SecondaryNav-_wyKjwNf.js";import{A as m}from"./secondaryNavConfig-Dw3gS1jR.js";import"./createLucideIcon-CFBn0Sdk.js";import"./message-square-D1hMsMj_.js";import"./file-text-DcYSrI4v.js";import"./search-DAyagUtF.js";import"./terminal-DJPUp_Qn.js";import"./code-xml-BFc3TMSm.js";import"./scroll-text-DPPYrqB9.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 +1 @@
|
|
|
1
|
-
import{r as d,j as e}from"./index-BZovGpDk.js";/* empty css */import{D as ys}from"./DataTable-Dzqiaha4.js";import{H,h as F}from"./HarnessMark-DrE57dUq.js";import{O as vs}from"./ObservedTopologyPanel-BlmGoxCE.js";import{a as es}from"./api-h5zurxmi.js";import{o as ts,i as U}from"./surface-activity-B1rgWB1i.js";import{a as Ns,d as gs}from"./time-Dhsh_2EG.js";import{u as Is}from"./tail-events-C12pfUax.js";/* empty css */import"./index-BWHgHrtv.js";const ns=4e3,bs=500,Cs=5e3,Es=5e3,Ss=6e4,q={"scout-managed":"scout","hudson-managed":"hudson",unattributed:"native"},X={tool:"working",run:"active",idle:"idle"};function G(s){const n=s.split(/\s+/)[0]??"",l=n.lastIndexOf("/");return l>=0?n.slice(l+1):n}function ws(s,n=60){const l=s.split(/\s+/);if(l.length===0)return s;l[0]=G(l[0]);const c=l.join(" ");return c.length<=n?c:c.slice(0,n-1)+"…"}function Ms(s){for(const n of s){const l=G(n.command);if(l&&!(l==="sh"||l==="zsh"||l==="bash"||l==="login"))return l}return s[0]?.command?G(s[0].command):"—"}function As(s){const n=s.match(/^(?:(\d+)-)?(?:(\d+):)?(\d+):(\d+)$/);if(!n){const u=s.match(/^(\d+)$/);return u?Number.parseInt(u[1],10):0}const[,l,c,m,p]=n;let f=Number.parseInt(p,10)+Number.parseInt(m,10)*60;return c&&(f+=Number.parseInt(c,10)*3600),l&&(f+=Number.parseInt(l,10)*86400),f}function rs(s){if(s<60)return`${s}s`;if(s<3600)return`${Math.floor(s/60)}m${String(s%60).padStart(2,"0")}`;if(s<86400){const c=Math.floor(s/3600),m=Math.floor(s%3600/60);return`${c}h${String(m).padStart(2,"0")}`}const n=Math.floor(s/86400),l=Math.floor(s%86400/3600);return`${n}d${String(l).padStart(2,"0")}h`}function is(s,n){return Ns(s,n)||"—"}function $s(s){return gs(s)||"—"}function Q(s){return s?s.slice(0,8):"—"}function cs(s){return s?.trim().toLowerCase()||"unknown"}function Rs(s){return cs(s).replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Z(s){return`s-atop-chip s-atop-chip--harness s-atop-chip--harness-${Rs(s)}`}const Ts=/permission-mode/i;function as(s){return s.kind!=="system"?!1:Ts.test(s.summary)}function J(s){return s.kind==="assistant"}function Ws(s,n,l){if(!s)return[];const c=new Map,m=new Map;for(const t of n){let r=c.get(t.pid);if(r||(r={firstEventAt:t.ts,lastEventAt:t.ts,lastKind:t.kind,lastSummary:t.summary,reqCount:0,toolCount:0,permCount:0,eventCount:0,sessionId:t.sessionId||null,model:null,tokIn:null,tokOut:null,cacheReadIn:null,cacheWriteIn:null},c.set(t.pid,r)),t.ts<r.firstEventAt&&(r.firstEventAt=t.ts),t.ts>=r.lastEventAt&&(r.lastEventAt=t.ts,r.lastKind=t.kind,r.lastSummary=t.summary),r.eventCount++,t.kind==="tool"&&r.toolCount++,J(t)&&r.reqCount++,as(t)&&r.permCount++,t.sessionId&&!r.sessionId&&(r.sessionId=t.sessionId),t.sessionId){let a=m.get(t.sessionId);a||(a={firstEventAt:t.ts,lastEventAt:t.ts,lastKind:t.kind,lastSummary:t.summary,reqCount:0,toolCount:0,permCount:0,eventCount:0,sessionId:t.sessionId,model:null,tokIn:null,tokOut:null,cacheReadIn:null,cacheWriteIn:null},m.set(t.sessionId,a)),t.ts<a.firstEventAt&&(a.firstEventAt=t.ts),t.ts>=a.lastEventAt&&(a.lastEventAt=t.ts,a.lastKind=t.kind,a.lastSummary=t.summary),a.eventCount++,t.kind==="tool"&&a.toolCount++,J(t)&&a.reqCount++,as(t)&&a.permCount++}}const p=new Map;for(const t of s.processes){if(!t.cwd)continue;const r=Y(t.source,t.cwd),a=p.get(r);(!a||t.pid<a.pid)&&p.set(r,t)}const f=new Map,u=new Map;for(const t of s.transcripts??[]){const r=Y(t.source,t.cwd),a=os(t),j=u.get(r)??Number.NEGATIVE_INFINITY,N=f.get(r)??"";(t.mtimeMs>j||t.mtimeMs===j&&a>N)&&(u.set(r,t.mtimeMs),f.set(r,a))}const h=new Set,I=(t,r,a,j)=>{r&&h.add(r.pid);let N="idle";const w=Math.max(a?.lastEventAt??0,j?.mtimeMs??0);a&&l-a.lastEventAt<Es&&(N=a.lastKind==="tool"?"tool":"run"),N==="idle"&&l-w<6e4&&(N="run");const L=r?As(r.etime):0,D=a?.firstEventAt??null,V=a&&a.firstEventAt<a.lastEventAt?Math.min(Math.max(0,Math.round((a.lastEventAt-a.firstEventAt)/1e3)),L||Number.POSITIVE_INFINITY):0,_=r?.pid??Os(t),R=j?.cwd??r?.cwd??"";return{key:t,pid:_,ppid:r?.ppid??0,sessionId:j?.sessionId??a?.sessionId??null,transcriptPath:j?.transcriptPath??null,harness:cs(j?.source??r?.source),attribution:r?.harness??j?.harness??"unattributed",project:j?.project?.trim()||(R?Ps(R):"(unknown)"),cwd:R,command:r?.command??`${j?.source??"unknown"} transcript`,parentLabel:r?Ms(r.parentChain??[]):"transcript",procRuntimeSec:L,procEtime:r?.etime??"0",sessionStartAt:D,sessionRuntimeSec:V,status:N,lastEventAt:w||null,lastEventKind:a?.lastKind??null,lastSummary:a?.lastSummary??null,reqCount:a?.reqCount??0,toolCount:a?.toolCount??0,permCount:a?.permCount??0,eventCount:a?.eventCount??0,model:a?.model??null,tokIn:a?.tokIn??null,tokOut:a?.tokOut??null,cacheReadIn:a?.cacheReadIn??null,cacheWriteIn:a?.cacheWriteIn??null}},k=(s.transcripts??[]).map(t=>{const r=os(t),a=Y(t.source,t.cwd),j=f.get(a)===r?p.get(a)??null:null,N=t.sessionId?m.get(t.sessionId):void 0;return I(r,j,N,t)}),y=s.processes.filter(t=>!h.has(t.pid)).map(t=>I(Ls(t),t,c.get(t.pid),null));return[...k,...y]}function $(s){if(s.cacheReadIn==null||s.tokIn==null)return null;const n=s.cacheReadIn+s.tokIn;return n===0?null:s.cacheReadIn/n}function S(s){return s==null?"—":s===0?"0":s>=1e6?(s/1e6).toFixed(s>=1e7?0:1)+"M":s>=1e3?(s/1e3).toFixed(s>=1e4?0:1)+"k":String(s)}function us(s){return s==null?"—":`${Math.round(s*100)}%`}function Ps(s){if(!s)return"";const n=s.lastIndexOf("/");return n>=0?s.slice(n+1):s}function os(s){return`session:${s.source}:${s.sessionId??s.transcriptPath}`}function Ls(s){return`process:${s.source}:${s.pid}`}function Os(s){let n=2166136261;for(let l=0;l<s.length;l+=1)n^=s.charCodeAt(l),n=Math.imul(n,16777619);return-((n>>>0)%9e5+1e3)}function Y(s,n){return`${s}\0${n??""}`}function Ks(s,n,l){const c=l-Ss;let m=0;for(const u of n)J(u)&&u.ts>=c&&m++;const p={total:s.length,running:0,tooling:0,idle:0,harnesses:[],reqsPerMin:m},f=new Map;for(const u of s)u.status==="tool"?(p.tooling++,p.running++):u.status==="run"?p.running++:p.idle++,f.set(u.harness,(f.get(u.harness)??0)+1);return p.harnesses=[...f.entries()].map(([u,h])=>({harness:u,count:h})).sort((u,h)=>h.count-u.count||u.harness.localeCompare(h.harness)),p}const P={tool:0,run:1,idle:2};function A(s){return s??-1}function qs(s,n,l,c){switch(l){case"status":return(P[s.status]-P[n.status])*c;case"agent":{const m=s.harness.localeCompare(n.harness);return m!==0?m*c:(s.sessionId??"").localeCompare(n.sessionId??"")*c}case"project":return s.project.localeCompare(n.project)*c;case"reqs":return(s.reqCount-n.reqCount)*c;case"tokIn":return(A(s.tokIn)-A(n.tokIn))*c;case"tokOut":return(A(s.tokOut)-A(n.tokOut))*c;case"cache":return(A($(s))-A($(n)))*c;case"tools":return(s.toolCount-n.toolCount)*c;case"perms":return(s.permCount-n.permCount)*c;case"last":{const m=s.lastEventAt??0,p=n.lastEventAt??0;return(m-p)*c}case"runtime":return(s.sessionRuntimeSec-n.sessionRuntimeSec)*c}}function ls({values:s,color:n}){if(s.length<2)return e.jsx("svg",{className:"s-atop-spark",width:88,height:18,viewBox:"0 0 88 18"});const m=Math.max(1,...s),p=88/(s.length-1),f=s.map((u,h)=>`${(h*p).toFixed(1)},${(18-u/m*18).toFixed(1)}`).join(" ");return e.jsx("svg",{className:"s-atop-spark",width:88,height:18,viewBox:"0 0 88 18",children:e.jsx("polyline",{fill:"none",stroke:n,strokeWidth:"1.25",points:f})})}function ne(){const[s,n]=d.useState([]),[l,c]=d.useState(null),[m,p]=d.useState(()=>Date.now()),[f,u]=d.useState(""),[h,I]=d.useState(()=>new Set),[k,y]=d.useState(()=>new Set),[t,r]=d.useState({key:"status",dir:1}),[a,j]=d.useState(null),N=d.useRef([]),w=d.useRef([]),[L,D]=d.useState([]),[V,_]=d.useState([]),R=d.useCallback(o=>{n(i=>i.length>=ns?[...i.slice(i.length-ns+1),o]:[...i,o])},[]);Is(R),d.useEffect(()=>{let o=!1,i=!1;const x=async()=>{if(!(i||!U()))try{const O=await es(`/api/tail/recent?limit=${bs}`);o||(i=!0,n(O.events??[]))}catch{}};x();const E=ts(()=>{x()});return()=>{o=!0,E()}},[]);const T=d.useCallback(async()=>{if(U())try{const o=await es("/api/tail/discover");c(o)}catch{}},[]);d.useEffect(()=>{T();const o=setInterval(()=>{T()},Cs),i=ts(()=>{T()});return()=>{clearInterval(o),i()}},[T]),d.useEffect(()=>{const o=setInterval(()=>{U()&&p(Date.now())},1e3);return()=>clearInterval(o)},[]);const v=d.useMemo(()=>Ws(l,s,m),[l,s,m]),M=d.useMemo(()=>Ks(v,s,m),[v,s,m]);d.useEffect(()=>{N.current=[...N.current,M.running].slice(-24),w.current=[...w.current,M.tooling].slice(-24),D(N.current),_(w.current)},[M.running,M.tooling]);const ds=d.useMemo(()=>{const o=new Set;return v.forEach(i=>o.add(i.harness)),[...o]},[v]),ms=d.useMemo(()=>{const o=new Set;return v.forEach(i=>o.add(i.status)),[...o]},[v]),z=d.useMemo(()=>{const o=f.trim().toLowerCase();return v.filter(i=>{if(h.size>0&&!h.has(i.harness)||k.size>0&&!k.has(i.status))return!1;if(!o)return!0;const x=q[i.attribution];return`${i.pid} ${i.project} ${i.command} ${i.harness} ${i.attribution} ${x} ${i.sessionId??""} ${i.transcriptPath??""} ${i.lastSummary??""}`.toLowerCase().includes(o)})},[v,f,h,k]),B=d.useMemo(()=>t.key==="status"?void 0:(o,i)=>P[o.status]-P[i.status],[t.key]),C=d.useMemo(()=>z.map((o,i)=>({row:o,index:i})).sort((o,i)=>{const x=qs(o.row,i.row,t.key,t.dir);if(x!==0)return x;const E=B?.(o.row,i.row)??0;return E!==0?E:o.index-i.index}).map(o=>o.row),[z,t,B]);d.useEffect(()=>{a!=null&&(v.some(o=>o.key===a)||j(null))},[v,a]),d.useEffect(()=>{const o=i=>{const x=i.target,E=x instanceof HTMLInputElement||x instanceof HTMLTextAreaElement||(x?.isContentEditable??!1);if(i.key==="Escape"&&a!=null){i.preventDefault(),j(null);return}if(E)return;const O=i.key==="j"||i.key==="ArrowDown",js=i.key==="k"||i.key==="ArrowUp";if(O||js){if(C.length===0)return;i.preventDefault();const K=C.findIndex(ks=>ks.key===a),ss=O?C[Math.min(C.length-1,K<0?0:K+1)]:C[Math.max(0,K<0?0:K-1)];ss&&j(ss.key);return}if(i.key==="Enter"&&a!=null){i.preventDefault();return}};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[C,a]);const ps=o=>{I(i=>{const x=new Set(i);return x.has(o)?x.delete(o):x.add(o),x})},hs=o=>{y(i=>{const x=new Set(i);return x.has(o)?x.delete(o):x.add(o),x})},g=d.useMemo(()=>a!=null?v.find(o=>o.key===a)??null:null,[v,a]),fs=d.useMemo(()=>g?l?.processes.find(o=>o.pid===g.pid)??null:null,[l,g]),xs=d.useMemo(()=>g?s.filter(o=>g.sessionId?o.sessionId===g.sessionId:o.pid===g.pid).slice(-40):[],[s,g]);return e.jsxs("div",{className:"s-atop",children:[e.jsx(Hs,{summary:M,runHistory:L,toolHistory:V}),e.jsx(vs,{title:"Harness families",size:"compact",maxAgents:6,maxTasks:3,showEmpty:!0}),e.jsx(Fs,{search:f,onSearch:u,harnessOptions:ds,harnessFilter:h,onToggleHarness:ps,statusOptions:ms,statusFilter:k,onToggleStatus:hs,summary:M}),e.jsx(ys,{rows:z,columns:Ds,rowId:o=>o.key,storageKey:"openscout.atop.cols",sort:t,onSortChange:r,secondarySort:B,onRowClick:o=>j(o.key),rowClassName:o=>a===o.key?"s-atop-row--selected":void 0,empty:{title:"no agents match",body:"adjust filters or start a session to populate"},density:"compact",className:"s-atop-data-table",ariaLabel:"Agent activity inventory"}),e.jsx(_s,{shown:C.length,total:v.length,hasSelection:a!=null}),g&&e.jsx(zs,{row:g,process:fs,events:xs,now:m,onClose:()=>j(null)})]})}function Hs({summary:s,runHistory:n,toolHistory:l}){return e.jsxs("div",{className:"s-atop-summary",children:[e.jsxs("div",{className:"s-atop-summary-cell s-atop-summary-cell--primary",children:[e.jsxs("div",{className:"s-atop-summary-num",children:[e.jsx("strong",{children:s.running}),e.jsxs("span",{className:"s-atop-summary-of",children:["/ ",s.total]})]}),e.jsx("span",{className:"s-atop-summary-lbl",children:"active"}),e.jsx(ls,{values:n,color:"var(--green)"})]}),e.jsxs("div",{className:"s-atop-summary-cell",children:[e.jsx("div",{className:"s-atop-summary-num",children:e.jsx("strong",{children:s.tooling})}),e.jsx("span",{className:"s-atop-summary-lbl",children:"working"}),e.jsx(ls,{values:l,color:"var(--accent)"})]}),e.jsxs("div",{className:"s-atop-summary-cell",children:[e.jsx("div",{className:"s-atop-summary-num",children:e.jsx("strong",{children:s.idle})}),e.jsx("span",{className:"s-atop-summary-lbl",children:"idle"})]}),e.jsxs("div",{className:"s-atop-summary-cell s-atop-summary-cell--breakdown",children:[e.jsx("span",{className:"s-atop-summary-lbl",children:"harness"}),e.jsx("div",{className:"s-atop-summary-row",children:s.harnesses.length>0?s.harnesses.slice(0,4).map(c=>e.jsxs("span",{className:Z(c.harness),children:[e.jsx(H,{harness:c.harness,size:11,title:null}),F(c.harness)," ",c.count]},c.harness)):e.jsx("span",{className:"s-atop-chip s-atop-chip--mute",children:"none"})})]}),e.jsx("div",{className:"s-atop-summary-spacer"}),e.jsxs("div",{className:"s-atop-summary-cell s-atop-summary-cell--rate",children:[e.jsxs("div",{className:"s-atop-summary-num",children:[e.jsx("strong",{children:s.reqsPerMin}),e.jsx("span",{className:"s-atop-summary-of",children:"/ min"})]}),e.jsx("span",{className:"s-atop-summary-lbl",children:"requests"})]})]})}function Fs({search:s,onSearch:n,harnessOptions:l,harnessFilter:c,onToggleHarness:m,statusOptions:p,statusFilter:f,onToggleStatus:u,summary:h}){const I=t=>h.harnesses.find(r=>r.harness===t)?.count??0,k=t=>t==="tool"?h.tooling:t==="run"?h.running-h.tooling:h.idle,y=d.useRef(null);return d.useEffect(()=>{const t=r=>{if(r.key!=="/")return;const a=r.target;a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||(a?.isContentEditable??!1)||(r.preventDefault(),y.current?.focus())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]),e.jsxs("div",{className:"s-atop-fbar",children:[e.jsxs("div",{className:"s-atop-search",children:[e.jsx("span",{className:"s-atop-search-prompt",children:"▸"}),e.jsx("input",{ref:y,className:"s-atop-search-input",value:s,onChange:t=>n(t.target.value),placeholder:"filter by pid · project · command · summary",spellCheck:!1}),e.jsx("span",{className:"s-atop-search-kbd",children:"/"})]}),l.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-atop-fbar-label",children:"harness"}),l.map(t=>{const r=c.has(t);return e.jsxs("button",{className:`s-atop-pill s-atop-pill--harness${r?" s-atop-pill--on":""}`,onClick:()=>m(t),children:[e.jsx(H,{harness:t,size:11,title:null}),F(t),e.jsx("span",{className:"s-atop-pill-ct",children:I(t)})]},t)})]}),p.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-atop-fbar-label",children:"status"}),["tool","run","idle"].filter(t=>p.includes(t)).map(t=>{const r=f.has(t);return e.jsxs("button",{className:`s-atop-pill s-atop-pill--status-${t}${r?" s-atop-pill--on":""}`,onClick:()=>u(t),children:[X[t],e.jsx("span",{className:"s-atop-pill-ct",children:k(t)})]},t)})]}),e.jsx("div",{className:"s-atop-fbar-spacer"})]})}const Ds=[{key:"status",label:"Status",cls:"s-atop-col-status",kind:"text",defaultWidth:96,minWidth:70,sortValue:s=>P[s.status],render:s=>e.jsxs("span",{className:`s-atop-status s-atop-status--${s.status}`,children:[e.jsx("span",{className:"s-atop-status-dot"}),X[s.status]]})},{key:"agent",label:"Agent",cls:"s-atop-col-agent",kind:"text",tip:"Harness · short session id",defaultWidth:168,minWidth:110,sortValue:s=>`${s.harness}\0${s.sessionId??""}`,render:s=>e.jsxs("div",{className:"s-atop-agent-cell",children:[e.jsxs("span",{className:Z(s.harness),title:`origin: ${q[s.attribution]}`,children:[e.jsx(H,{harness:s.harness,size:11,title:null}),F(s.harness)]}),e.jsx("span",{className:"s-atop-agent-id",title:s.sessionId??`pid ${s.pid}`,children:Q(s.sessionId)})]})},{key:"project",label:"Project",cls:"s-atop-col-project",kind:"text",defaultWidth:200,minWidth:96,maxWidth:480,sortValue:s=>s.project,render:s=>e.jsx("span",{title:s.cwd,children:s.project})},{key:"reqs",label:"Reqs",cls:"s-atop-col-num",kind:"number",tip:"Model invocations (assistant turns) for this session",defaultWidth:64,minWidth:56,sortValue:s=>s.reqCount,render:s=>e.jsx(W,{value:s.reqCount||null})},{key:"tokIn",label:"Tok ↓",cls:"s-atop-col-num",kind:"number",tip:"Input tokens — populated when backend emits usage",defaultWidth:64,minWidth:56,sortValue:s=>s.tokIn,render:s=>e.jsx(W,{value:s.tokIn})},{key:"tokOut",label:"Tok ↑",cls:"s-atop-col-num",kind:"number",tip:"Output tokens — populated when backend emits usage",defaultWidth:64,minWidth:56,sortValue:s=>s.tokOut,render:s=>e.jsx(W,{value:s.tokOut})},{key:"cache",label:"Cache",cls:"s-atop-col-num",kind:"number",tip:"Cache hit rate — populated when backend emits usage",defaultWidth:64,minWidth:56,sortValue:s=>$(s),render:s=>e.jsx(Vs,{value:$(s)})},{key:"tools",label:"Tools",cls:"s-atop-col-num",kind:"number",defaultWidth:64,minWidth:56,sortValue:s=>s.toolCount,render:s=>e.jsx(W,{value:s.toolCount||null})},{key:"perms",label:"Perms",cls:"s-atop-col-num",kind:"number",tip:"Permission requests — heuristic count of permission-mode events",defaultWidth:64,minWidth:56,sortValue:s=>s.permCount,render:s=>e.jsx(W,{value:s.permCount||null,accent:s.permCount>0?"amber":void 0})},{key:"last",label:"Last",cls:"s-atop-col-last",kind:"time",defaultWidth:86,minWidth:64,sortValue:s=>s.lastEventAt,render:s=>is(s.lastEventAt,Date.now())},{key:"runtime",label:"Runtime",cls:"s-atop-col-runtime",kind:"number",tip:"Session duration (active period in current buffer)",defaultWidth:80,minWidth:64,sortValue:s=>s.sessionRuntimeSec,render:s=>rs(s.sessionRuntimeSec)}];function W({value:s,accent:n}){const l=s==null?"s-atop-col-num s-atop-col-num--dim":`s-atop-col-num${n?` s-atop-col-num--${n}`:""}`;return e.jsx("span",{className:l,children:S(s)})}function Vs({value:s}){const n=s==null?"s-atop-col-num s-atop-col-num--dim":"s-atop-col-num";return e.jsx("span",{className:n,children:us(s)})}function _s({shown:s,total:n,hasSelection:l}){return e.jsxs("div",{className:"s-atop-keys",children:[e.jsxs("span",{className:"s-atop-keys-count",children:[e.jsx("strong",{children:s})," / ",n," agents"]}),e.jsx("span",{className:"s-atop-keys-spacer"}),e.jsxs("span",{children:[e.jsx("kbd",{children:"/"})," filter"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"j"}),"/",e.jsx("kbd",{children:"k"})," select"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"click"})," drill in"]}),l&&e.jsxs("span",{children:[e.jsx("kbd",{children:"esc"})," close"]})]})}function zs({row:s,process:n,events:l,now:c,onClose:m}){const p=d.useMemo(()=>{const u={};for(const k of l){if(k.kind!=="tool")continue;const y=k.summary.match(/^([a-z_][a-z0-9_]*)/i),t=y?y[1]:"(tool)";u[t]=(u[t]??0)+1}const h=Object.entries(u).sort((k,y)=>y[1]-k[1]).slice(0,6),I=Math.max(1,...h.map(k=>k[1]));return h.map(([k,y])=>({name:k,count:y,frac:y/I}))},[l]),f=l.slice(-40).reverse();return e.jsxs("aside",{className:"s-atop-drawer","aria-label":`Agent ${s.key}`,children:[e.jsxs("header",{className:"s-atop-drawer-head",children:[e.jsxs("div",{className:"s-atop-drawer-head-meta",children:[e.jsxs("span",{className:`s-atop-status s-atop-status--${s.status}`,children:[e.jsx("span",{className:"s-atop-status-dot"}),X[s.status]]}),e.jsx("span",{className:"s-atop-drawer-pid",children:s.pid>0?`pid ${s.pid}`:"transcript"}),e.jsxs("span",{className:Z(s.harness),title:`origin: ${q[s.attribution]}`,children:[e.jsx(H,{harness:s.harness,size:11,title:null}),F(s.harness)]}),e.jsxs("span",{className:"s-atop-drawer-session",children:["session ",Q(s.sessionId)]})]}),e.jsx("h2",{className:"s-atop-drawer-title",children:s.project}),e.jsxs("p",{className:"s-atop-drawer-sub",children:["session ",Q(s.sessionId)," · runtime ",rs(s.sessionRuntimeSec)," · last activity ",is(s.lastEventAt,c)]}),e.jsx("button",{className:"s-atop-drawer-close",onClick:m,"aria-label":"Close (Esc)",children:"✕"})]}),e.jsxs("div",{className:"s-atop-drawer-body",children:[e.jsxs("section",{children:[e.jsx("h3",{className:"s-atop-drawer-h3",children:"Activity"}),e.jsxs("div",{className:"s-atop-metrics",children:[e.jsx(b,{label:"Requests",value:S(s.reqCount||null)}),e.jsx(b,{label:"Tools",value:S(s.toolCount||null)}),e.jsx(b,{label:"Permissions",value:S(s.permCount||null),accent:s.permCount>0?"amber":void 0}),e.jsx(b,{label:"Tok in",value:S(s.tokIn),dim:s.tokIn==null}),e.jsx(b,{label:"Tok out",value:S(s.tokOut),dim:s.tokOut==null}),e.jsx(b,{label:"Cache hit",value:us($(s)),dim:$(s)==null}),e.jsx(b,{label:"Model",value:s.model??"—",dim:s.model==null}),e.jsx(b,{label:"Events",value:S(s.eventCount||null)})]})]}),p.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"s-atop-drawer-h3",children:"Tool calls"}),e.jsx("ul",{className:"s-atop-histo",children:p.map(u=>e.jsxs("li",{children:[e.jsx("span",{className:"s-atop-histo-name",children:u.name}),e.jsx("span",{className:"s-atop-histo-bar",children:e.jsx("span",{className:"s-atop-histo-fill",style:{width:`${(u.frac*100).toFixed(1)}%`}})}),e.jsx("span",{className:"s-atop-histo-count",children:u.count})]},u.name))})]}),e.jsxs("section",{children:[e.jsxs("h3",{className:"s-atop-drawer-h3",children:["Recent activity",e.jsxs("span",{className:"s-atop-drawer-h3-aside",children:[l.length," buffered"]})]}),f.length===0?e.jsx("div",{className:"s-atop-peek-empty",children:"no events buffered for this agent yet"}):e.jsx("ol",{className:"s-atop-peek",children:f.map(u=>e.jsxs("li",{className:`s-atop-peek-row s-atop-peek-row--${u.kind}`,children:[e.jsx("span",{className:"s-atop-peek-time",children:$s(u.ts)}),e.jsx("span",{className:"s-atop-peek-kind",children:u.kind}),e.jsx("span",{className:"s-atop-peek-text",children:u.summary})]},u.id))})]}),e.jsxs("section",{className:"s-atop-drawer-section--secondary",children:[e.jsx("h3",{className:"s-atop-drawer-h3",children:"Process"}),e.jsx("code",{className:"s-atop-codeblock",children:s.command}),e.jsxs("dl",{className:"s-atop-kvs",children:[e.jsx("dt",{children:"PID"}),e.jsx("dd",{children:s.pid>0?s.pid:"transcript-only"}),e.jsx("dt",{children:"Parent"}),e.jsxs("dd",{children:[s.parentLabel," (ppid ",s.ppid,")"]}),e.jsx("dt",{children:"Process etime"}),e.jsx("dd",{children:s.procEtime}),s.transcriptPath&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Transcript"}),e.jsx("dd",{children:s.transcriptPath})]}),e.jsx("dt",{children:"Origin"}),e.jsx("dd",{children:q[s.attribution]}),e.jsx("dt",{children:"CWD"}),e.jsx("dd",{children:s.cwd||"(none)"})]}),n?.parentChain&&n.parentChain.length>0&&e.jsx("ol",{className:"s-atop-chain",children:n.parentChain.map(u=>e.jsxs("li",{children:[e.jsx("span",{className:"s-atop-chain-pid",children:u.pid}),e.jsx("span",{className:"s-atop-chain-cmd",children:ws(u.command,80)})]},u.pid))})]})]})]})}function b({label:s,value:n,dim:l,accent:c}){const m=`s-atop-metric${l?" s-atop-metric--dim":""}${c?` s-atop-metric--${c}`:""}`;return e.jsxs("div",{className:m,children:[e.jsx("span",{className:"s-atop-metric-lbl",children:s}),e.jsx("span",{className:"s-atop-metric-val",children:n})]})}export{ne as AtopView};
|
|
1
|
+
import{r as d,j as e}from"./index-DmFAhGPj.js";/* empty css */import{D as ys}from"./DataTable-CJbbgBdA.js";import{H,h as F}from"./HarnessMark-BPAphNjx.js";import{O as vs}from"./ObservedTopologyPanel-CaSZZP05.js";import{a as es}from"./api-h5zurxmi.js";import{o as ts,i as U}from"./surface-activity-B1rgWB1i.js";import{a as Ns,d as gs}from"./time-Dhsh_2EG.js";import{u as Is}from"./tail-events-BdvqZHLr.js";/* empty css */import"./index-BWHgHrtv.js";const ns=4e3,bs=500,Cs=5e3,Es=5e3,Ss=6e4,q={"scout-managed":"scout","hudson-managed":"hudson",unattributed:"native"},X={tool:"working",run:"active",idle:"idle"};function G(s){const n=s.split(/\s+/)[0]??"",l=n.lastIndexOf("/");return l>=0?n.slice(l+1):n}function ws(s,n=60){const l=s.split(/\s+/);if(l.length===0)return s;l[0]=G(l[0]);const c=l.join(" ");return c.length<=n?c:c.slice(0,n-1)+"…"}function Ms(s){for(const n of s){const l=G(n.command);if(l&&!(l==="sh"||l==="zsh"||l==="bash"||l==="login"))return l}return s[0]?.command?G(s[0].command):"—"}function As(s){const n=s.match(/^(?:(\d+)-)?(?:(\d+):)?(\d+):(\d+)$/);if(!n){const u=s.match(/^(\d+)$/);return u?Number.parseInt(u[1],10):0}const[,l,c,m,p]=n;let f=Number.parseInt(p,10)+Number.parseInt(m,10)*60;return c&&(f+=Number.parseInt(c,10)*3600),l&&(f+=Number.parseInt(l,10)*86400),f}function rs(s){if(s<60)return`${s}s`;if(s<3600)return`${Math.floor(s/60)}m${String(s%60).padStart(2,"0")}`;if(s<86400){const c=Math.floor(s/3600),m=Math.floor(s%3600/60);return`${c}h${String(m).padStart(2,"0")}`}const n=Math.floor(s/86400),l=Math.floor(s%86400/3600);return`${n}d${String(l).padStart(2,"0")}h`}function is(s,n){return Ns(s,n)||"—"}function $s(s){return gs(s)||"—"}function Q(s){return s?s.slice(0,8):"—"}function cs(s){return s?.trim().toLowerCase()||"unknown"}function Rs(s){return cs(s).replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Z(s){return`s-atop-chip s-atop-chip--harness s-atop-chip--harness-${Rs(s)}`}const Ts=/permission-mode/i;function as(s){return s.kind!=="system"?!1:Ts.test(s.summary)}function J(s){return s.kind==="assistant"}function Ws(s,n,l){if(!s)return[];const c=new Map,m=new Map;for(const t of n){let r=c.get(t.pid);if(r||(r={firstEventAt:t.ts,lastEventAt:t.ts,lastKind:t.kind,lastSummary:t.summary,reqCount:0,toolCount:0,permCount:0,eventCount:0,sessionId:t.sessionId||null,model:null,tokIn:null,tokOut:null,cacheReadIn:null,cacheWriteIn:null},c.set(t.pid,r)),t.ts<r.firstEventAt&&(r.firstEventAt=t.ts),t.ts>=r.lastEventAt&&(r.lastEventAt=t.ts,r.lastKind=t.kind,r.lastSummary=t.summary),r.eventCount++,t.kind==="tool"&&r.toolCount++,J(t)&&r.reqCount++,as(t)&&r.permCount++,t.sessionId&&!r.sessionId&&(r.sessionId=t.sessionId),t.sessionId){let a=m.get(t.sessionId);a||(a={firstEventAt:t.ts,lastEventAt:t.ts,lastKind:t.kind,lastSummary:t.summary,reqCount:0,toolCount:0,permCount:0,eventCount:0,sessionId:t.sessionId,model:null,tokIn:null,tokOut:null,cacheReadIn:null,cacheWriteIn:null},m.set(t.sessionId,a)),t.ts<a.firstEventAt&&(a.firstEventAt=t.ts),t.ts>=a.lastEventAt&&(a.lastEventAt=t.ts,a.lastKind=t.kind,a.lastSummary=t.summary),a.eventCount++,t.kind==="tool"&&a.toolCount++,J(t)&&a.reqCount++,as(t)&&a.permCount++}}const p=new Map;for(const t of s.processes){if(!t.cwd)continue;const r=Y(t.source,t.cwd),a=p.get(r);(!a||t.pid<a.pid)&&p.set(r,t)}const f=new Map,u=new Map;for(const t of s.transcripts??[]){const r=Y(t.source,t.cwd),a=os(t),j=u.get(r)??Number.NEGATIVE_INFINITY,N=f.get(r)??"";(t.mtimeMs>j||t.mtimeMs===j&&a>N)&&(u.set(r,t.mtimeMs),f.set(r,a))}const h=new Set,I=(t,r,a,j)=>{r&&h.add(r.pid);let N="idle";const w=Math.max(a?.lastEventAt??0,j?.mtimeMs??0);a&&l-a.lastEventAt<Es&&(N=a.lastKind==="tool"?"tool":"run"),N==="idle"&&l-w<6e4&&(N="run");const L=r?As(r.etime):0,D=a?.firstEventAt??null,V=a&&a.firstEventAt<a.lastEventAt?Math.min(Math.max(0,Math.round((a.lastEventAt-a.firstEventAt)/1e3)),L||Number.POSITIVE_INFINITY):0,_=r?.pid??Os(t),R=j?.cwd??r?.cwd??"";return{key:t,pid:_,ppid:r?.ppid??0,sessionId:j?.sessionId??a?.sessionId??null,transcriptPath:j?.transcriptPath??null,harness:cs(j?.source??r?.source),attribution:r?.harness??j?.harness??"unattributed",project:j?.project?.trim()||(R?Ps(R):"(unknown)"),cwd:R,command:r?.command??`${j?.source??"unknown"} transcript`,parentLabel:r?Ms(r.parentChain??[]):"transcript",procRuntimeSec:L,procEtime:r?.etime??"0",sessionStartAt:D,sessionRuntimeSec:V,status:N,lastEventAt:w||null,lastEventKind:a?.lastKind??null,lastSummary:a?.lastSummary??null,reqCount:a?.reqCount??0,toolCount:a?.toolCount??0,permCount:a?.permCount??0,eventCount:a?.eventCount??0,model:a?.model??null,tokIn:a?.tokIn??null,tokOut:a?.tokOut??null,cacheReadIn:a?.cacheReadIn??null,cacheWriteIn:a?.cacheWriteIn??null}},k=(s.transcripts??[]).map(t=>{const r=os(t),a=Y(t.source,t.cwd),j=f.get(a)===r?p.get(a)??null:null,N=t.sessionId?m.get(t.sessionId):void 0;return I(r,j,N,t)}),y=s.processes.filter(t=>!h.has(t.pid)).map(t=>I(Ls(t),t,c.get(t.pid),null));return[...k,...y]}function $(s){if(s.cacheReadIn==null||s.tokIn==null)return null;const n=s.cacheReadIn+s.tokIn;return n===0?null:s.cacheReadIn/n}function S(s){return s==null?"—":s===0?"0":s>=1e6?(s/1e6).toFixed(s>=1e7?0:1)+"M":s>=1e3?(s/1e3).toFixed(s>=1e4?0:1)+"k":String(s)}function us(s){return s==null?"—":`${Math.round(s*100)}%`}function Ps(s){if(!s)return"";const n=s.lastIndexOf("/");return n>=0?s.slice(n+1):s}function os(s){return`session:${s.source}:${s.sessionId??s.transcriptPath}`}function Ls(s){return`process:${s.source}:${s.pid}`}function Os(s){let n=2166136261;for(let l=0;l<s.length;l+=1)n^=s.charCodeAt(l),n=Math.imul(n,16777619);return-((n>>>0)%9e5+1e3)}function Y(s,n){return`${s}\0${n??""}`}function Ks(s,n,l){const c=l-Ss;let m=0;for(const u of n)J(u)&&u.ts>=c&&m++;const p={total:s.length,running:0,tooling:0,idle:0,harnesses:[],reqsPerMin:m},f=new Map;for(const u of s)u.status==="tool"?(p.tooling++,p.running++):u.status==="run"?p.running++:p.idle++,f.set(u.harness,(f.get(u.harness)??0)+1);return p.harnesses=[...f.entries()].map(([u,h])=>({harness:u,count:h})).sort((u,h)=>h.count-u.count||u.harness.localeCompare(h.harness)),p}const P={tool:0,run:1,idle:2};function A(s){return s??-1}function qs(s,n,l,c){switch(l){case"status":return(P[s.status]-P[n.status])*c;case"agent":{const m=s.harness.localeCompare(n.harness);return m!==0?m*c:(s.sessionId??"").localeCompare(n.sessionId??"")*c}case"project":return s.project.localeCompare(n.project)*c;case"reqs":return(s.reqCount-n.reqCount)*c;case"tokIn":return(A(s.tokIn)-A(n.tokIn))*c;case"tokOut":return(A(s.tokOut)-A(n.tokOut))*c;case"cache":return(A($(s))-A($(n)))*c;case"tools":return(s.toolCount-n.toolCount)*c;case"perms":return(s.permCount-n.permCount)*c;case"last":{const m=s.lastEventAt??0,p=n.lastEventAt??0;return(m-p)*c}case"runtime":return(s.sessionRuntimeSec-n.sessionRuntimeSec)*c}}function ls({values:s,color:n}){if(s.length<2)return e.jsx("svg",{className:"s-atop-spark",width:88,height:18,viewBox:"0 0 88 18"});const m=Math.max(1,...s),p=88/(s.length-1),f=s.map((u,h)=>`${(h*p).toFixed(1)},${(18-u/m*18).toFixed(1)}`).join(" ");return e.jsx("svg",{className:"s-atop-spark",width:88,height:18,viewBox:"0 0 88 18",children:e.jsx("polyline",{fill:"none",stroke:n,strokeWidth:"1.25",points:f})})}function ne(){const[s,n]=d.useState([]),[l,c]=d.useState(null),[m,p]=d.useState(()=>Date.now()),[f,u]=d.useState(""),[h,I]=d.useState(()=>new Set),[k,y]=d.useState(()=>new Set),[t,r]=d.useState({key:"status",dir:1}),[a,j]=d.useState(null),N=d.useRef([]),w=d.useRef([]),[L,D]=d.useState([]),[V,_]=d.useState([]),R=d.useCallback(o=>{n(i=>i.length>=ns?[...i.slice(i.length-ns+1),o]:[...i,o])},[]);Is(R),d.useEffect(()=>{let o=!1,i=!1;const x=async()=>{if(!(i||!U()))try{const O=await es(`/api/tail/recent?limit=${bs}`);o||(i=!0,n(O.events??[]))}catch{}};x();const E=ts(()=>{x()});return()=>{o=!0,E()}},[]);const T=d.useCallback(async()=>{if(U())try{const o=await es("/api/tail/discover");c(o)}catch{}},[]);d.useEffect(()=>{T();const o=setInterval(()=>{T()},Cs),i=ts(()=>{T()});return()=>{clearInterval(o),i()}},[T]),d.useEffect(()=>{const o=setInterval(()=>{U()&&p(Date.now())},1e3);return()=>clearInterval(o)},[]);const v=d.useMemo(()=>Ws(l,s,m),[l,s,m]),M=d.useMemo(()=>Ks(v,s,m),[v,s,m]);d.useEffect(()=>{N.current=[...N.current,M.running].slice(-24),w.current=[...w.current,M.tooling].slice(-24),D(N.current),_(w.current)},[M.running,M.tooling]);const ds=d.useMemo(()=>{const o=new Set;return v.forEach(i=>o.add(i.harness)),[...o]},[v]),ms=d.useMemo(()=>{const o=new Set;return v.forEach(i=>o.add(i.status)),[...o]},[v]),z=d.useMemo(()=>{const o=f.trim().toLowerCase();return v.filter(i=>{if(h.size>0&&!h.has(i.harness)||k.size>0&&!k.has(i.status))return!1;if(!o)return!0;const x=q[i.attribution];return`${i.pid} ${i.project} ${i.command} ${i.harness} ${i.attribution} ${x} ${i.sessionId??""} ${i.transcriptPath??""} ${i.lastSummary??""}`.toLowerCase().includes(o)})},[v,f,h,k]),B=d.useMemo(()=>t.key==="status"?void 0:(o,i)=>P[o.status]-P[i.status],[t.key]),C=d.useMemo(()=>z.map((o,i)=>({row:o,index:i})).sort((o,i)=>{const x=qs(o.row,i.row,t.key,t.dir);if(x!==0)return x;const E=B?.(o.row,i.row)??0;return E!==0?E:o.index-i.index}).map(o=>o.row),[z,t,B]);d.useEffect(()=>{a!=null&&(v.some(o=>o.key===a)||j(null))},[v,a]),d.useEffect(()=>{const o=i=>{const x=i.target,E=x instanceof HTMLInputElement||x instanceof HTMLTextAreaElement||(x?.isContentEditable??!1);if(i.key==="Escape"&&a!=null){i.preventDefault(),j(null);return}if(E)return;const O=i.key==="j"||i.key==="ArrowDown",js=i.key==="k"||i.key==="ArrowUp";if(O||js){if(C.length===0)return;i.preventDefault();const K=C.findIndex(ks=>ks.key===a),ss=O?C[Math.min(C.length-1,K<0?0:K+1)]:C[Math.max(0,K<0?0:K-1)];ss&&j(ss.key);return}if(i.key==="Enter"&&a!=null){i.preventDefault();return}};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[C,a]);const ps=o=>{I(i=>{const x=new Set(i);return x.has(o)?x.delete(o):x.add(o),x})},hs=o=>{y(i=>{const x=new Set(i);return x.has(o)?x.delete(o):x.add(o),x})},g=d.useMemo(()=>a!=null?v.find(o=>o.key===a)??null:null,[v,a]),fs=d.useMemo(()=>g?l?.processes.find(o=>o.pid===g.pid)??null:null,[l,g]),xs=d.useMemo(()=>g?s.filter(o=>g.sessionId?o.sessionId===g.sessionId:o.pid===g.pid).slice(-40):[],[s,g]);return e.jsxs("div",{className:"s-atop",children:[e.jsx(Hs,{summary:M,runHistory:L,toolHistory:V}),e.jsx(vs,{title:"Harness families",size:"compact",maxAgents:6,maxTasks:3,showEmpty:!0}),e.jsx(Fs,{search:f,onSearch:u,harnessOptions:ds,harnessFilter:h,onToggleHarness:ps,statusOptions:ms,statusFilter:k,onToggleStatus:hs,summary:M}),e.jsx(ys,{rows:z,columns:Ds,rowId:o=>o.key,storageKey:"openscout.atop.cols",sort:t,onSortChange:r,secondarySort:B,onRowClick:o=>j(o.key),rowClassName:o=>a===o.key?"s-atop-row--selected":void 0,empty:{title:"no agents match",body:"adjust filters or start a session to populate"},density:"compact",className:"s-atop-data-table",ariaLabel:"Agent activity inventory"}),e.jsx(_s,{shown:C.length,total:v.length,hasSelection:a!=null}),g&&e.jsx(zs,{row:g,process:fs,events:xs,now:m,onClose:()=>j(null)})]})}function Hs({summary:s,runHistory:n,toolHistory:l}){return e.jsxs("div",{className:"s-atop-summary",children:[e.jsxs("div",{className:"s-atop-summary-cell s-atop-summary-cell--primary",children:[e.jsxs("div",{className:"s-atop-summary-num",children:[e.jsx("strong",{children:s.running}),e.jsxs("span",{className:"s-atop-summary-of",children:["/ ",s.total]})]}),e.jsx("span",{className:"s-atop-summary-lbl",children:"active"}),e.jsx(ls,{values:n,color:"var(--green)"})]}),e.jsxs("div",{className:"s-atop-summary-cell",children:[e.jsx("div",{className:"s-atop-summary-num",children:e.jsx("strong",{children:s.tooling})}),e.jsx("span",{className:"s-atop-summary-lbl",children:"working"}),e.jsx(ls,{values:l,color:"var(--accent)"})]}),e.jsxs("div",{className:"s-atop-summary-cell",children:[e.jsx("div",{className:"s-atop-summary-num",children:e.jsx("strong",{children:s.idle})}),e.jsx("span",{className:"s-atop-summary-lbl",children:"idle"})]}),e.jsxs("div",{className:"s-atop-summary-cell s-atop-summary-cell--breakdown",children:[e.jsx("span",{className:"s-atop-summary-lbl",children:"harness"}),e.jsx("div",{className:"s-atop-summary-row",children:s.harnesses.length>0?s.harnesses.slice(0,4).map(c=>e.jsxs("span",{className:Z(c.harness),children:[e.jsx(H,{harness:c.harness,size:11,title:null}),F(c.harness)," ",c.count]},c.harness)):e.jsx("span",{className:"s-atop-chip s-atop-chip--mute",children:"none"})})]}),e.jsx("div",{className:"s-atop-summary-spacer"}),e.jsxs("div",{className:"s-atop-summary-cell s-atop-summary-cell--rate",children:[e.jsxs("div",{className:"s-atop-summary-num",children:[e.jsx("strong",{children:s.reqsPerMin}),e.jsx("span",{className:"s-atop-summary-of",children:"/ min"})]}),e.jsx("span",{className:"s-atop-summary-lbl",children:"requests"})]})]})}function Fs({search:s,onSearch:n,harnessOptions:l,harnessFilter:c,onToggleHarness:m,statusOptions:p,statusFilter:f,onToggleStatus:u,summary:h}){const I=t=>h.harnesses.find(r=>r.harness===t)?.count??0,k=t=>t==="tool"?h.tooling:t==="run"?h.running-h.tooling:h.idle,y=d.useRef(null);return d.useEffect(()=>{const t=r=>{if(r.key!=="/")return;const a=r.target;a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||(a?.isContentEditable??!1)||(r.preventDefault(),y.current?.focus())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]),e.jsxs("div",{className:"s-atop-fbar",children:[e.jsxs("div",{className:"s-atop-search",children:[e.jsx("span",{className:"s-atop-search-prompt",children:"▸"}),e.jsx("input",{ref:y,className:"s-atop-search-input",value:s,onChange:t=>n(t.target.value),placeholder:"filter by pid · project · command · summary",spellCheck:!1}),e.jsx("span",{className:"s-atop-search-kbd",children:"/"})]}),l.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-atop-fbar-label",children:"harness"}),l.map(t=>{const r=c.has(t);return e.jsxs("button",{className:`s-atop-pill s-atop-pill--harness${r?" s-atop-pill--on":""}`,onClick:()=>m(t),children:[e.jsx(H,{harness:t,size:11,title:null}),F(t),e.jsx("span",{className:"s-atop-pill-ct",children:I(t)})]},t)})]}),p.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-atop-fbar-label",children:"status"}),["tool","run","idle"].filter(t=>p.includes(t)).map(t=>{const r=f.has(t);return e.jsxs("button",{className:`s-atop-pill s-atop-pill--status-${t}${r?" s-atop-pill--on":""}`,onClick:()=>u(t),children:[X[t],e.jsx("span",{className:"s-atop-pill-ct",children:k(t)})]},t)})]}),e.jsx("div",{className:"s-atop-fbar-spacer"})]})}const Ds=[{key:"status",label:"Status",cls:"s-atop-col-status",kind:"text",defaultWidth:96,minWidth:70,sortValue:s=>P[s.status],render:s=>e.jsxs("span",{className:`s-atop-status s-atop-status--${s.status}`,children:[e.jsx("span",{className:"s-atop-status-dot"}),X[s.status]]})},{key:"agent",label:"Agent",cls:"s-atop-col-agent",kind:"text",tip:"Harness · short session id",defaultWidth:168,minWidth:110,sortValue:s=>`${s.harness}\0${s.sessionId??""}`,render:s=>e.jsxs("div",{className:"s-atop-agent-cell",children:[e.jsxs("span",{className:Z(s.harness),title:`origin: ${q[s.attribution]}`,children:[e.jsx(H,{harness:s.harness,size:11,title:null}),F(s.harness)]}),e.jsx("span",{className:"s-atop-agent-id",title:s.sessionId??`pid ${s.pid}`,children:Q(s.sessionId)})]})},{key:"project",label:"Project",cls:"s-atop-col-project",kind:"text",defaultWidth:200,minWidth:96,maxWidth:480,sortValue:s=>s.project,render:s=>e.jsx("span",{title:s.cwd,children:s.project})},{key:"reqs",label:"Reqs",cls:"s-atop-col-num",kind:"number",tip:"Model invocations (assistant turns) for this session",defaultWidth:64,minWidth:56,sortValue:s=>s.reqCount,render:s=>e.jsx(W,{value:s.reqCount||null})},{key:"tokIn",label:"Tok ↓",cls:"s-atop-col-num",kind:"number",tip:"Input tokens — populated when backend emits usage",defaultWidth:64,minWidth:56,sortValue:s=>s.tokIn,render:s=>e.jsx(W,{value:s.tokIn})},{key:"tokOut",label:"Tok ↑",cls:"s-atop-col-num",kind:"number",tip:"Output tokens — populated when backend emits usage",defaultWidth:64,minWidth:56,sortValue:s=>s.tokOut,render:s=>e.jsx(W,{value:s.tokOut})},{key:"cache",label:"Cache",cls:"s-atop-col-num",kind:"number",tip:"Cache hit rate — populated when backend emits usage",defaultWidth:64,minWidth:56,sortValue:s=>$(s),render:s=>e.jsx(Vs,{value:$(s)})},{key:"tools",label:"Tools",cls:"s-atop-col-num",kind:"number",defaultWidth:64,minWidth:56,sortValue:s=>s.toolCount,render:s=>e.jsx(W,{value:s.toolCount||null})},{key:"perms",label:"Perms",cls:"s-atop-col-num",kind:"number",tip:"Permission requests — heuristic count of permission-mode events",defaultWidth:64,minWidth:56,sortValue:s=>s.permCount,render:s=>e.jsx(W,{value:s.permCount||null,accent:s.permCount>0?"amber":void 0})},{key:"last",label:"Last",cls:"s-atop-col-last",kind:"time",defaultWidth:86,minWidth:64,sortValue:s=>s.lastEventAt,render:s=>is(s.lastEventAt,Date.now())},{key:"runtime",label:"Runtime",cls:"s-atop-col-runtime",kind:"number",tip:"Session duration (active period in current buffer)",defaultWidth:80,minWidth:64,sortValue:s=>s.sessionRuntimeSec,render:s=>rs(s.sessionRuntimeSec)}];function W({value:s,accent:n}){const l=s==null?"s-atop-col-num s-atop-col-num--dim":`s-atop-col-num${n?` s-atop-col-num--${n}`:""}`;return e.jsx("span",{className:l,children:S(s)})}function Vs({value:s}){const n=s==null?"s-atop-col-num s-atop-col-num--dim":"s-atop-col-num";return e.jsx("span",{className:n,children:us(s)})}function _s({shown:s,total:n,hasSelection:l}){return e.jsxs("div",{className:"s-atop-keys",children:[e.jsxs("span",{className:"s-atop-keys-count",children:[e.jsx("strong",{children:s})," / ",n," agents"]}),e.jsx("span",{className:"s-atop-keys-spacer"}),e.jsxs("span",{children:[e.jsx("kbd",{children:"/"})," filter"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"j"}),"/",e.jsx("kbd",{children:"k"})," select"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"click"})," drill in"]}),l&&e.jsxs("span",{children:[e.jsx("kbd",{children:"esc"})," close"]})]})}function zs({row:s,process:n,events:l,now:c,onClose:m}){const p=d.useMemo(()=>{const u={};for(const k of l){if(k.kind!=="tool")continue;const y=k.summary.match(/^([a-z_][a-z0-9_]*)/i),t=y?y[1]:"(tool)";u[t]=(u[t]??0)+1}const h=Object.entries(u).sort((k,y)=>y[1]-k[1]).slice(0,6),I=Math.max(1,...h.map(k=>k[1]));return h.map(([k,y])=>({name:k,count:y,frac:y/I}))},[l]),f=l.slice(-40).reverse();return e.jsxs("aside",{className:"s-atop-drawer","aria-label":`Agent ${s.key}`,children:[e.jsxs("header",{className:"s-atop-drawer-head",children:[e.jsxs("div",{className:"s-atop-drawer-head-meta",children:[e.jsxs("span",{className:`s-atop-status s-atop-status--${s.status}`,children:[e.jsx("span",{className:"s-atop-status-dot"}),X[s.status]]}),e.jsx("span",{className:"s-atop-drawer-pid",children:s.pid>0?`pid ${s.pid}`:"transcript"}),e.jsxs("span",{className:Z(s.harness),title:`origin: ${q[s.attribution]}`,children:[e.jsx(H,{harness:s.harness,size:11,title:null}),F(s.harness)]}),e.jsxs("span",{className:"s-atop-drawer-session",children:["session ",Q(s.sessionId)]})]}),e.jsx("h2",{className:"s-atop-drawer-title",children:s.project}),e.jsxs("p",{className:"s-atop-drawer-sub",children:["session ",Q(s.sessionId)," · runtime ",rs(s.sessionRuntimeSec)," · last activity ",is(s.lastEventAt,c)]}),e.jsx("button",{className:"s-atop-drawer-close",onClick:m,"aria-label":"Close (Esc)",children:"✕"})]}),e.jsxs("div",{className:"s-atop-drawer-body",children:[e.jsxs("section",{children:[e.jsx("h3",{className:"s-atop-drawer-h3",children:"Activity"}),e.jsxs("div",{className:"s-atop-metrics",children:[e.jsx(b,{label:"Requests",value:S(s.reqCount||null)}),e.jsx(b,{label:"Tools",value:S(s.toolCount||null)}),e.jsx(b,{label:"Permissions",value:S(s.permCount||null),accent:s.permCount>0?"amber":void 0}),e.jsx(b,{label:"Tok in",value:S(s.tokIn),dim:s.tokIn==null}),e.jsx(b,{label:"Tok out",value:S(s.tokOut),dim:s.tokOut==null}),e.jsx(b,{label:"Cache hit",value:us($(s)),dim:$(s)==null}),e.jsx(b,{label:"Model",value:s.model??"—",dim:s.model==null}),e.jsx(b,{label:"Events",value:S(s.eventCount||null)})]})]}),p.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"s-atop-drawer-h3",children:"Tool calls"}),e.jsx("ul",{className:"s-atop-histo",children:p.map(u=>e.jsxs("li",{children:[e.jsx("span",{className:"s-atop-histo-name",children:u.name}),e.jsx("span",{className:"s-atop-histo-bar",children:e.jsx("span",{className:"s-atop-histo-fill",style:{width:`${(u.frac*100).toFixed(1)}%`}})}),e.jsx("span",{className:"s-atop-histo-count",children:u.count})]},u.name))})]}),e.jsxs("section",{children:[e.jsxs("h3",{className:"s-atop-drawer-h3",children:["Recent activity",e.jsxs("span",{className:"s-atop-drawer-h3-aside",children:[l.length," buffered"]})]}),f.length===0?e.jsx("div",{className:"s-atop-peek-empty",children:"no events buffered for this agent yet"}):e.jsx("ol",{className:"s-atop-peek",children:f.map(u=>e.jsxs("li",{className:`s-atop-peek-row s-atop-peek-row--${u.kind}`,children:[e.jsx("span",{className:"s-atop-peek-time",children:$s(u.ts)}),e.jsx("span",{className:"s-atop-peek-kind",children:u.kind}),e.jsx("span",{className:"s-atop-peek-text",children:u.summary})]},u.id))})]}),e.jsxs("section",{className:"s-atop-drawer-section--secondary",children:[e.jsx("h3",{className:"s-atop-drawer-h3",children:"Process"}),e.jsx("code",{className:"s-atop-codeblock",children:s.command}),e.jsxs("dl",{className:"s-atop-kvs",children:[e.jsx("dt",{children:"PID"}),e.jsx("dd",{children:s.pid>0?s.pid:"transcript-only"}),e.jsx("dt",{children:"Parent"}),e.jsxs("dd",{children:[s.parentLabel," (ppid ",s.ppid,")"]}),e.jsx("dt",{children:"Process etime"}),e.jsx("dd",{children:s.procEtime}),s.transcriptPath&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Transcript"}),e.jsx("dd",{children:s.transcriptPath})]}),e.jsx("dt",{children:"Origin"}),e.jsx("dd",{children:q[s.attribution]}),e.jsx("dt",{children:"CWD"}),e.jsx("dd",{children:s.cwd||"(none)"})]}),n?.parentChain&&n.parentChain.length>0&&e.jsx("ol",{className:"s-atop-chain",children:n.parentChain.map(u=>e.jsxs("li",{children:[e.jsx("span",{className:"s-atop-chain-pid",children:u.pid}),e.jsx("span",{className:"s-atop-chain-cmd",children:ws(u.command,80)})]},u.pid))})]})]})]})}function b({label:s,value:n,dim:l,accent:c}){const m=`s-atop-metric${l?" s-atop-metric--dim":""}${c?` s-atop-metric--${c}`:""}`;return e.jsxs("div",{className:m,children:[e.jsx("span",{className:"s-atop-metric-lbl",children:s}),e.jsx("span",{className:"s-atop-metric-val",children:n})]})}export{ne as AtopView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as k,j as s}from"./index-
|
|
1
|
+
import{r as k,j as s}from"./index-DmFAhGPj.js";import{k as d,l as B,m}from"./router-Cn_s9IGH.js";function p(t){switch(t.view){case"mesh":return"Back to mesh";case"ops":return"Back to ops";case"agents-v2":return t.agentId?"Registry":"All agents";case"messages":return"Back to conversations";case"conversation":return"Back to conversation";case"inbox":return"Back to inbox";case"sessions":return"Back to sessions";case"terminal":return"Terminal Control";case"work":return"Back to work";case"broker":return"Back to broker";case"activity":return"Back to activity";default:return"Back"}}function w({slot:t,fallback:n,navigate:c,className:r,label:i}){const e=d(),o=k.useMemo(()=>B(e.state),[e.state]),a=o??n,u=i??p(a),l=m(e.state)&&!!o;return s.jsxs("button",{type:"button",className:`s-back-pill${r?` ${r}`:""}`,onClick:()=>{if(l&&typeof window<"u"&&window.history.length>1){window.history.back();return}c(a)},children:[s.jsx("span",{"aria-hidden":!0,className:"s-back-pill-glyph",children:"←"}),s.jsx("span",{children:u})]})}export{w as B};
|
package/dist/client/assets/{BriefingDetailScreen-Zw-taW1s.js → BriefingDetailScreen-B7qJ90Np.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as c}from"./index-
|
|
1
|
+
import{j as e,r as c}from"./index-DmFAhGPj.js";import{E as g}from"./EmptyState-BRY5jTpz.js";import{a as b}from"./api-h5zurxmi.js";import{u as j}from"./Provider-cJCdHAxu.js";import{E as y}from"./external-link-B1TI5yIt.js";import{b as N,t as k}from"./time-Dhsh_2EG.js";/* empty css *//* empty css */const f=new RegExp("(?:^|(?<=[\\s(`'\"<>]))(?:~\\/|\\/(?:Users|home|opt|var|etc|tmp|private)\\/)[^\\s)`'\"<>]+\\.[A-Za-z0-9]{1,8}\\b","g");function v(s){const r=s.replace(/\r\n?/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),n=[];let t=0;for(;t<r.length;){const i=r[t];if(i.trim()===""){t+=1;continue}if(i.startsWith("```")){const o=[];for(t+=1;t<r.length&&!r[t].startsWith("```");)o.push(r[t]),t+=1;t<r.length&&(t+=1),n.push({kind:"code",body:o.join(`
|
|
4
4
|
`)});continue}const a=i.match(/^(#{1,3})\s+(.*\S)\s*$/);if(a){const o=a[1].length;n.push({kind:"heading",level:o,tokens:p(a[2])}),t+=1;continue}if(h(i)){const o=[];for(;t<r.length&&h(r[t]);)o.push(p(w(r[t]))),t+=1;n.push({kind:"list",items:o});continue}const l=[];for(;t<r.length&&r[t].trim()!==""&&!r[t].startsWith("```")&&!h(r[t])&&!/^#{1,3}\s+\S/.test(r[t]);)l.push(p(r[t])),t+=1;n.push({kind:"paragraph",lines:l})}return n}const x=/^\s*[-*]\s+/;function h(s){return x.test(s)}function w(s){return s.replace(x,"")}function p(s){const r=[];let n=0,t="";const i=()=>{t&&(r.push({kind:"text",body:t}),t="")};for(;n<s.length;){const a=s[n];if(a==="`"){const l=s.indexOf("`",n+1);if(l!==-1&&l>n+1){i(),r.push({kind:"code",body:s.slice(n+1,l)}),n=l+1;continue}}else if(a==="*"&&s[n+1]==="*"){const l=s.indexOf("**",n+2);if(l!==-1&&l>n+2){i(),r.push({kind:"bold",body:s.slice(n+2,l)}),n=l+2;continue}}else if(a==="*"||a==="_"){const l=C(s,n+1,a);if(l!==-1){i(),r.push({kind:"italic",body:s.slice(n+1,l)}),n=l+1;continue}}t+=a,n+=1}return i(),S(r)}function S(s){const r=[];for(const n of s){if(n.kind!=="text"){r.push(n);continue}const t=$(n.body);t.length===1&&t[0].kind==="text"?r.push(n):r.push(...t)}return r}function $(s){if(!s)return[];const r=[];let n=0;f.lastIndex=0;let t;for(;(t=f.exec(s))!==null;){const i=t.index,a=i+t[0].length;i>n&&r.push({kind:"text",body:s.slice(n,i)}),r.push({kind:"file-path",body:t[0]}),n=a}return n===0?[{kind:"text",body:s}]:(n<s.length&&r.push({kind:"text",body:s.slice(n)}),r)}function C(s,r,n){if(s[r]===void 0||/\s/.test(s[r]))return-1;for(let t=r;t<s.length;t+=1){const i=s[t];if(i===n){const a=s[t-1];if(a&&!/\s/.test(a)&&s[t+1]!==n)return t}if(i===`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as e}from"./index-
|
|
1
|
+
import{r as i,j as e}from"./index-DmFAhGPj.js";import{E as c}from"./EmptyState-BRY5jTpz.js";import{a as h}from"./api-h5zurxmi.js";import{t as m}from"./time-Dhsh_2EG.js";/* empty css *//* empty css */const g={"fleet-home":"fleet",tour:"tour"};function N({navigate:d}){const[r,f]=i.useState(null),[n,t]=i.useState(null),[l,o]=i.useState(!1),a=i.useCallback(async()=>{o(!0);try{const s=await h("/api/briefings?limit=50");f(s.briefings),t(null)}catch(s){t(s instanceof Error?s.message:"Failed to load briefings")}finally{o(!1)}},[]);return i.useEffect(()=>{a()},[a]),e.jsxs("div",{className:"sys-surface-page sys-surface-page-wide",children:[e.jsxs("div",{className:"sys-page-head",children:[e.jsxs("div",{className:"sys-page-title-group",children:[e.jsx("h2",{className:"sys-page-title",children:"Briefings"}),e.jsx("p",{className:"sys-page-subtitle",children:"Scoutbot's archived fleet briefs — what it told you, when, and what it saw. Rolling 100."})]}),e.jsx("div",{className:"sys-page-actions",children:e.jsx("button",{type:"button",className:"s-btn",disabled:l,onClick:()=>{a()},children:l?"Refreshing...":"Refresh"})})]}),n?e.jsx(c,{title:"Couldn't load briefings",body:n}):r===null?e.jsx("div",{className:"briefings-placeholder",children:"Loading briefings..."}):r.length===0?e.jsx(c,{title:"No briefings yet",body:"Scoutbot writes here when it generates a fleet brief — either on Home or via tour. Briefs land in this archive automatically."}):e.jsx("ul",{className:"briefings-list",children:r.map(s=>e.jsx("li",{children:e.jsxs("button",{type:"button",className:"briefing-row",onClick:()=>d({view:"briefings",briefingId:s.id}),children:[e.jsxs("div",{className:"briefing-row-head",children:[e.jsx("span",{className:`briefing-kind briefing-kind-${s.kind}`,children:g[s.kind]}),e.jsx("span",{className:"briefing-row-title",children:s.title}),e.jsx("span",{className:"briefing-row-time",children:m(s.preparedAt)})]}),e.jsx("div",{className:"briefing-row-summary",children:s.summary}),e.jsxs("div",{className:"briefing-row-meta",children:[e.jsxs("span",{children:[s.observationCount," observations"]}),s.recommendation?e.jsxs("span",{children:["· ",s.recommendation]}):null]})]})},s.id))})]})}export{N as BriefingsScreen};
|
package/dist/client/assets/{BrokerMetadataPanel-Cu93j-Ga.js → BrokerMetadataPanel-BhjECqOK.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as m,j as s}from"./index-
|
|
1
|
+
import{r as m,j as s}from"./index-DmFAhGPj.js";import{a as y,c as p,d as b,f as x}from"./broker-display-pp33bLsu.js";import{C as u}from"./chevron-down-B3VVRJcV.js";import{C as j}from"./chevron-right-BYMV1511.js";import"./status-tone-BM_zuRy1.js";import"./createLucideIcon-CFBn0Sdk.js";function i({label:e,value:a}){return s.jsxs("div",{className:"sys-broker-metadata-row",children:[s.jsx("span",{className:"sys-broker-metadata-key",children:e}),s.jsx("code",{className:"sys-broker-metadata-value",children:a})]})}function h({label:e,value:a,depth:t=0,defaultOpen:d=!0}){const[n,l]=m.useState(d&&t<2);if(a==null)return s.jsx(i,{label:e,value:"—"});if(Array.isArray(a))return a.length===0?s.jsx(i,{label:e,value:"[]"}):a.every(r=>typeof r!="object"||r===null)?s.jsx(i,{label:e,value:a.map(r=>x(r)).join(", ")}):s.jsxs("div",{className:"sys-broker-metadata-group",style:{marginLeft:t*12},children:[s.jsxs("button",{type:"button",className:"sys-broker-metadata-group-toggle",onClick:()=>l(r=>!r),"aria-expanded":n,children:[n?s.jsx(u,{size:12,"aria-hidden":"true"}):s.jsx(j,{size:12,"aria-hidden":"true"}),s.jsx("span",{className:"sys-broker-metadata-group-label",children:e}),s.jsxs("span",{className:"sys-broker-metadata-count",children:[a.length," items"]})]}),n&&s.jsx("div",{className:"sys-broker-metadata-children",children:a.map((r,c)=>s.jsx(h,{label:`[${c}]`,value:r,depth:t+1,defaultOpen:t<1},`${e}-${c}`))})]});if(typeof a=="object"){const o=Object.entries(a);return o.length===0?s.jsx(i,{label:e,value:"{}"}):s.jsxs("div",{className:"sys-broker-metadata-group",style:{marginLeft:t*12},children:[s.jsxs("button",{type:"button",className:"sys-broker-metadata-group-toggle",onClick:()=>l(r=>!r),"aria-expanded":n,children:[n?s.jsx(u,{size:12,"aria-hidden":"true"}):s.jsx(j,{size:12,"aria-hidden":"true"}),s.jsx("span",{className:"sys-broker-metadata-group-label",children:e}),s.jsxs("span",{className:"sys-broker-metadata-count",children:[o.length," fields"]})]}),n&&s.jsx("div",{className:"sys-broker-metadata-children",children:o.map(([r,c])=>s.jsx(h,{label:r,value:c,depth:t+1,defaultOpen:t<1},`${e}-${r}`))})]})}return s.jsx(i,{label:e,value:x(a)})}function k({entries:e}){return e.length===0?null:s.jsx("div",{className:"sys-broker-inspector-rows",children:e.map(a=>s.jsxs("div",{className:"sys-broker-inspector-row",children:[s.jsx("span",{className:"sys-detail-label",children:a.key}),s.jsx("code",{className:"sys-detail-value",children:a.value})]},a.key))})}function S({metadata:e,rawJson:a}){const t=m.useMemo(()=>y(e),[e]),d=m.useMemo(()=>p(e),[e]),[n,l]=m.useState(!1);return!e||Object.keys(e).length===0?s.jsx("div",{className:"sys-broker-metadata-empty",children:"No metadata payload attached to this dispatch row."}):s.jsxs("div",{className:"sys-broker-metadata-panel",children:[t.length>0&&s.jsxs("section",{className:"sys-broker-metadata-section",children:[s.jsx("div",{className:"sys-broker-metadata-section-head",children:s.jsx("span",{className:"sys-detail-label",children:"Summary"})}),s.jsx(k,{entries:t})]}),d!==null&&s.jsxs("section",{className:"sys-broker-metadata-section",children:[s.jsx("div",{className:"sys-broker-metadata-section-head",children:s.jsx("span",{className:"sys-detail-label",children:"Payload"})}),s.jsx("div",{className:"sys-broker-metadata-tree",children:s.jsx(h,{label:"payload",value:d,defaultOpen:!0})})]}),s.jsxs("section",{className:"sys-broker-metadata-section",children:[s.jsxs("button",{type:"button",className:"sys-broker-metadata-raw-toggle",onClick:()=>l(o=>!o),"aria-expanded":n,children:[n?s.jsx(u,{size:12,"aria-hidden":"true"}):s.jsx(j,{size:12,"aria-hidden":"true"}),"Raw JSON"]}),n&&s.jsx("pre",{className:"sys-broker-metadata-raw",children:a||b(e)})]})]})}export{S as BrokerMetadataPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as n,j as e}from"./index-BZovGpDk.js";import{r as cs}from"./index-DiiEQwdc.js";import{D as ds}from"./runtime-picker-BXKJbLot.js";import{E as Re}from"./EmptyState-CYNJZMrZ.js";import{u as us,i as hs}from"./MessageComposerSuggestions-qbalTne_.js";import{r as fs,R as ms,a as ps,b as bs}from"./NewChatComposer-DKlNX1UA.js";import{a as ne}from"./api-h5zurxmi.js";import{c as ys}from"./clipboard-e3fSpeo7.js";import{u as gs}from"./sse-Bb0EOcU9.js";import{b as Ee}from"./status-tone-BM_zuRy1.js";import{t as Ie,b as We,n as V}from"./time-Dhsh_2EG.js";import{u as Qe,A as xs}from"./Provider-p-xuaAoE.js";import{o as qe}from"./openContent-C6XO6kr5.js";import{g as js,b as oe,h as Ve,e as ks,i as vs,d as ws,j as Ns,k as Ss,l as As,m as Rs}from"./broker-display-pp33bLsu.js";import{BrokerMetadataPanel as Is}from"./BrokerMetadataPanel-Cu93j-Ga.js";import{DispatchAftermath as Cs}from"./DispatchAftermath-B0WMg_z3.js";import{i as $s,c as Ds,n as Oe}from"./keyboard-nav-CHo_xmjw.js";import{ShikiPane as Es}from"./ShikiPane-DH8yYDks.js";import{d as Fs}from"./types-B0PlfpKc.js";/* empty css */import{L as ke}from"./loader-circle-B-l2Wj3-.js";import{R as Ms}from"./refresh-cw-DtF8xPqX.js";import{X as Ce}from"./x-CrGUKNRv.js";import{A as Ls}from"./arrow-down-DxxPnPwh.js";import{E as _e}from"./external-link-Dd8xaveL.js";import{C as Ts}from"./chevron-down-BVg09D6U.js";import{S as Ps}from"./sparkles-_7cTZsIH.js";import{P as Bs}from"./paperclip-DblaLD_N.js";import{P as zs}from"./plus-BAI0t5g9.js";import{S as qs}from"./send-horizontal-DbyEkGql.js";import{C as Os}from"./check-BfA0T8UD.js";import{C as _s}from"./copy-C79v_7D-.js";import{M as Ks}from"./message-square-BnkG6tae.js";import{c as Ye}from"./createLucideIcon-DCq_3fQn.js";import{R as Us}from"./radio-BGtkyCG9.js";import{b as Hs,M as Js}from"./DocumentFocusViewer-CZVVIAD5.js";import{B as Ws}from"./bot-BSGSicKC.js";const Qs=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Vs=Ye("at-sign",Qs);const Ys=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Gs=Ye("hash",Ys),Xs=160;function Ke(s){const a=new URLSearchParams({limit:String(Xs)});return s&&a.set("cursor",s),`/api/broker?${a.toString()}`}const Ue={index:-1,request:0};function Zs(s,a){return{index:a,request:s.request+1}}function Ge(s,a){return a===s.index?s:{index:a,request:s.request}}function er(s,a){return s.index<a?s:Ge(s,a>0?a-1:-1)}function sr(s,a){return s.request!==a}function rr({enabled:s,rowCount:a,onActivateRow:t,onClearSelection:i}){const[f,d]=n.useState(Ue),b=f.index,u=n.useRef(new Map),c=n.useRef(Ue.request),j=n.useCallback(y=>{d(m=>Zs(m,typeof y=="function"?y(m.index):y))},[]),k=n.useCallback(y=>{d(m=>Ge(m,typeof y=="function"?y(m.index):y))},[]);n.useEffect(()=>{if(!sr(f,c.current)||(c.current=f.request,f.index<0))return;const y=u.current.get(f.index);y?.scrollIntoView({block:"nearest"}),y?.focus()},[f]),n.useEffect(()=>{d(y=>er(y,a))},[a]);const R=n.useCallback((y,m)=>{m?u.current.set(y,m):u.current.delete(y)},[]);n.useEffect(()=>{if(!s)return;const y=m=>{if(document.querySelector(".sys-broker-page")&&!($s(m.target)||Ds())&&a!==0){if(m.key==="Escape"){i&&(m.preventDefault(),i(),k(-1));return}if(m.key==="ArrowDown"||m.key==="j"){m.preventDefault(),j(S=>Oe(S,a,1));return}if(m.key==="ArrowUp"||m.key==="k"){m.preventDefault(),j(S=>Oe(S,a,-1));return}if(m.key==="Home"||m.key==="g"&&!m.shiftKey){m.preventDefault(),j(0);return}if(m.key==="End"||m.key==="G"){m.preventDefault(),j(a-1);return}if(m.key==="Enter"||m.key===" "){const S=b<0?0:b;m.preventDefault(),j(S),t(S)}}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s,b,j,t,i,a,k]);const U=n.useCallback(y=>({tabIndex:b===y?0:-1,ref:m=>R(y,m),onFocus:()=>k(y)}),[b,R,k]);return{focusedIndex:b,setFocusedIndex:k,getRowFocusProps:U}}const be=["all","delivered","failed"],ar={all:"All",delivered:"Delivered",failed:"Failed"};function tr(s){switch(s){case"success":return"Success";case"failed_query":return"Query failure";case"failed_delivery":return"Delivery failure";default:return"Delivery attempt"}}function Xe(s){return s.messageId??s.deliveryId??s.invocationId??s.id}function Ze(s){switch(Ee(s.kind,s.status)){case"success":return"Delivered";case"danger":return"Failed";case"working":return"Pending";case"warning":return"Held";default:return s.status?s.status.charAt(0).toUpperCase()+s.status.slice(1):"Queued"}}function $e(s){if(!s)return"··";const a=s.trim().split(/\s+/).filter(Boolean);if(a.length===0)return"··";const t=a[a.length-1];return/^\d+$/.test(t)?t.slice(-2):a.length>=2?(a[0][0]+a[1][0]).toUpperCase():s.trim().slice(0,2).toUpperCase()}function nr(s){const a=V(s)??0;return new Date(a).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function He(s){const a=V(s);return a===null?"—":new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Ne(s,a,t=0){if(!s||typeof s!="object"||Array.isArray(s)||t>3)return;const i=s;for(const f of a)if(i[f]!==void 0&&i[f]!==null)return i[f];for(const f of Object.values(i)){const d=Ne(f,a,t+1);if(d!==void 0)return d}}function B(s,...a){const t=Ne(s.metadata,a);return typeof t!="string"&&typeof t!="number"?null:String(t).trim()||null}function ve(s,...a){const t=Ne(s.metadata,a);return typeof t=="number"||typeof t=="string"?V(t):null}function es(s){switch(s){case"dm":return"Direct · agent";case"channel":return"Channel";case"broadcast":return"Broadcast";case null:return"No route";default:return s.replaceAll("_"," ")}}function we(s,a){if(a==="to")return s.route==="channel"?"Channel":s.route==="broadcast"?"Broadcast":s.target?.toLowerCase().includes("operator")?"Operator":"Agent lane";const t=B(s,"class","actorClass")?.toLowerCase();return t==="operator"||t==="human"?"Operator":t==="agent"?"Agent":s.actorName?.toLowerCase().includes("operator")?"Operator":"Sender"}function or(s){const a=Ne(s.metadata,["latencyMs","durationMs"]);if(typeof a=="number"&&Number.isFinite(a)&&a>=0)return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(a<1e4?1:0)}s`;const t=ve(s,"sentAt","createdAt")??V(s.ts),i=ve(s,"deliveredAt","completedAt");if(t===null||i===null||i<t)return"—";const f=i-t;return f<1e3?`${f}ms`:`${(f/1e3).toFixed(f<1e4?1:0)}s`}function De({route:s}){switch(s){case"channel":return e.jsx(Gs,{size:12,"aria-hidden":"true"});case"broadcast":return e.jsx(Us,{size:12,"aria-hidden":"true"});case"dm":return e.jsx(Vs,{size:12,"aria-hidden":"true"});default:return e.jsx(Ks,{size:12,"aria-hidden":"true"})}}function ir(s,a){if(!a)return null;const t=a.trim().replace(/^@/,"").toLowerCase();return s.find(i=>[i.id,i.name,i.handle,i.selector,i.defaultSelector,i.conversationId,i.harnessSessionId].some(f=>f?.trim().replace(/^@/,"").toLowerCase()===t))??null}function lr(s,a,t){const i=t?.authorityNodeName??t?.homeNodeName??t?.authorityNodeId??t?.homeNodeId??B(s,"machine","machineName","nodeName");return(t?[{label:"Status",value:t.state},{label:"Handle",value:t.handle?`@${t.handle.replace(/^@/,"")}`:null},{label:"Project",value:t.project},{label:"Branch",value:t.branch},{label:"Runtime",value:[t.harness,t.model,t.reasoningEffort].filter(Boolean).join(" · ")||null},{label:"Machine",value:i},{label:"Working dir",value:t.cwd??t.projectRoot},{label:"Session",value:t.harnessSessionId},{label:"Conversation",value:t.conversationId??s.conversationId}]:[{label:"Kind",value:a==="to"&&s.conversationId?"Session route":we(s,a)},{label:"Channel",value:es(s.route)},{label:"Session",value:a==="to"?s.target:B(s,"sessionId","harnessSessionId")},{label:"Conversation",value:s.conversationId},{label:"Harness",value:B(s,"harness")},{label:"Model",value:B(s,"model")},{label:"Project",value:B(s,"project","projectName")},{label:"Branch",value:B(s,"branch")},{label:"Machine",value:i}]).filter(d=>!!d.value)}function Je({attempt:s,agents:a,side:t}){const i=t==="from"?s.actorName:s.target,f=ir(a,i),d=f?.name??i??(t==="from"?"Unknown":"No target"),b=f?"Agent":t==="to"&&s.conversationId?"Session":we(s,t),u=lr(s,t,f),c=`dispatch-endpoint-${s.id}-${t}`;return e.jsxs("span",{className:`sys-broker-endpoint sys-broker-endpoint--${t}`,tabIndex:0,"aria-describedby":c,children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:f||t==="from"?$e(d):e.jsx(De,{route:s.route})}),e.jsx("span",{className:"sys-broker-endpoint-name",title:d,children:d}),e.jsxs("span",{className:"sys-broker-endpoint-card",id:c,role:"tooltip",children:[e.jsxs("span",{className:"sys-broker-endpoint-card-head",children:[e.jsx("span",{className:"sys-broker-avatar","aria-hidden":"true",children:f||t==="from"?$e(d):e.jsx(De,{route:s.route})}),e.jsxs("span",{children:[e.jsx("strong",{children:d}),e.jsx("small",{children:b})]})]}),e.jsx("span",{className:"sys-broker-endpoint-card-body",children:u.map(j=>e.jsxs("span",{className:"sys-broker-endpoint-card-field",children:[e.jsx("small",{children:j.label}),e.jsx("code",{title:j.value,children:j.value})]},j.label))})]})]})}function ye(s){const a=V(s)??0,t=new Date(a);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function cr(s,a=Date.now()){const t=V(s)??0,i=new Date(t),f=new Date(a),d=new Date(a);return d.setDate(d.getDate()-1),ye(s)===ye(f.getTime())?"Today":ye(s)===ye(d.getTime())?"Yesterday":i.toLocaleDateString(void 0,{month:"short",day:"numeric",year:i.getFullYear()===f.getFullYear()?void 0:"numeric"})}function dr(s,a,t){return{...a,source:s.source,attempts:[...s.attempts,...a.attempts],failedQueries:s.failedQueries,failedDeliveries:s.failedDeliveries,dialogue:s.dialogue,ledger:{...a.ledger,cursors:{...s.ledger.cursors,[t]:a.ledger.cursors[t]},hasMore:{...s.ledger.hasMore,[t]:a.ledger.hasMore[t]}}}}function ur({navigate:s,embedded:a=!1,initialAttemptId:t}){const{route:i,agents:f,selectedBrokerAttempt:d,inspectBrokerAttempt:b,clearBrokerAttempt:u}=Qe(),[c,j]=n.useState(null),k=i.view==="broker"?i.filter??"all":"all",[R,U]=n.useState(!0),[y,m]=n.useState(!1),[S,Y]=n.useState(!1),[te,z]=n.useState(null),E=n.useRef(null),F=n.useRef(0),q=n.useRef(null),M=n.useCallback(async(o="initial")=>{const h=++F.current;!E.current&&o!=="background"?(U(!0),z(null)):m(!0);try{const x=await ne(Ke());if(h!==F.current)return;E.current=x,j(x),z(null)}catch(x){if(h!==F.current)return;z(x instanceof Error?x.message:String(x))}finally{h===F.current&&(U(!1),m(!1))}},[]),G=n.useCallback(async()=>{const o=E.current;if(!o||S)return;const h="attempts",x=o.ledger.cursors[h];if(!x||!o.ledger.hasMore[h])return;const T=++F.current;Y(!0),z(null);try{const P=await ne(Ke(x));if(T!==F.current)return;const se=E.current,ue=se?dr(se,P,h):P;E.current=ue,j(ue)}catch(P){if(T!==F.current)return;z(P instanceof Error?P.message:String(P))}finally{T===F.current&&Y(!1)}},[S]),le=n.useCallback(()=>{q.current||(q.current=setTimeout(()=>{q.current=null,M("background")},250))},[M]);n.useEffect(()=>(M("initial"),()=>{q.current&&clearTimeout(q.current)}),[M]),gs(o=>{(o.kind==="message.posted"||o.kind==="delivery.planned"||o.kind==="delivery.attempted"||o.kind==="delivery.state.changed"||o.kind==="scout.dispatched")&&le()});const v=n.useMemo(()=>{if(!c)return[];const o=new Map(c.dialogue.map(h=>[h.id,h.body]));return js(c.attempts).map(h=>{const x=h.messageId?o.get(h.messageId):null;return x&&x!==h.detail?{...h,detail:x}:h})},[c]),I=n.useMemo(()=>{switch(k){case"delivered":return v.filter(o=>!oe(o));case"failed":return v.filter(oe);default:return v}},[k,v]),ge=c?.ledger.hasMore.attempts??!1,X=n.useMemo(()=>({all:v.length,delivered:v.filter(o=>!oe(o)).length,failed:v.filter(oe).length}),[v]),$=n.useMemo(()=>{const o=i.view==="broker"?i.attemptId:void 0;return!c||!o?null:v.find(h=>h.id===o)??c.attempts.find(h=>h.id===o)??c.failedQueries.find(h=>h.id===o)??c.failedDeliveries.find(h=>h.id===o)??null},[c,v,i]),Z=$?`${$.id}\0${$.status}\0${$.ts}`:null,D=d?`${d.id}\0${d.status}\0${d.ts}`:null;n.useEffect(()=>{$&&Z!==D&&b($)},[D,b,$,Z]);const[C,N]=n.useState(null),O=n.useRef(!1),_=n.useCallback(o=>{if(a){O.current=!0,N(o);return}b(o)},[a,b]),H=n.useCallback(()=>{if(a){O.current=!0,N(null);return}u()},[u,a]),J=n.useCallback(o=>{const h=I[o];h&&(_(h),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}})))},[I,_]),{getRowFocusProps:ce,setFocusedIndex:xe}=rr({enabled:!!c&&I.length>0,rowCount:I.length,onActivateRow:J,onClearSelection:H}),de=C?.id??null,L=C?`${C.id} ${C.status} ${C.ts}`:null;n.useEffect(()=>{if(!a||!de)return;const o=v.find(h=>h.id===de);o&&`${o.id} ${o.status} ${o.ts}`!==L&&N(o)},[a,de,L,v]),n.useEffect(()=>{if(!a||!t||!c||O.current||C)return;const o=v.find(h=>h.id===t)??c.attempts.find(h=>h.id===t)??c.failedQueries.find(h=>h.id===t)??c.failedDeliveries.find(h=>h.id===t);o&&(O.current=!0,N(o))},[c,a,C,v,t]),n.useEffect(()=>{const o=i.view==="broker"?i.attemptId:void 0;if(!o)return;const h=I.findIndex(x=>x.id===o);h>=0&&xe(h)},[I,k,i,xe]);const ee=n.useCallback(o=>{const x=(be.indexOf(k)+o+be.length)%be.length,T=be[x];s({view:"broker",...T==="all"?{}:{filter:T}})},[k,s]),A=a?C:null;return e.jsx("div",{className:`s-ops${a?" s-ops--embedded":""}${A?" s-ops--split":""}`,children:e.jsxs("div",{className:"s-ops-body",children:[e.jsxs("div",{className:"sys-surface-page sys-surface-page-wide sys-surface-page-fluid sys-broker-page",children:[e.jsxs("div",{className:"sys-ledger-toolbar","aria-label":"Dispatch controls",children:[c?e.jsx("div",{className:"sys-tab-row sys-tab-row--toolbar",role:"tablist","aria-label":"Dispatch message filters",onKeyDown:o=>{o.key==="ArrowRight"?(o.preventDefault(),ee(1)):o.key==="ArrowLeft"&&(o.preventDefault(),ee(-1))},children:be.map(o=>e.jsxs("button",{type:"button",role:"tab","aria-selected":k===o,className:`sys-tab${k===o?" sys-tab-active":""}`,onClick:()=>s({view:"broker",...o==="all"?{}:{filter:o}}),children:[e.jsx("span",{children:ar[o]}),e.jsx("span",{className:"sys-tab-count",children:X[o]})]},o))}):e.jsx("div",{className:"sys-ledger-kicker",children:"Dispatch ledger"}),e.jsxs("div",{className:"sys-page-actions sys-ledger-actions",children:[e.jsx("div",{className:"sys-sync-note",children:R?"Loading dispatch ledger...":c?`Updated ${Ie(c.generatedAt)}${c.source?.latestMessageAt?` · latest message ${Ie(c.source.latestMessageAt)}`:""}`:"Waiting for dispatch data"}),e.jsx("button",{type:"button",className:"s-btn",disabled:R||y,onClick:()=>{M("manual")},children:y?"Refreshing...":"Refresh"})]})]}),te&&e.jsxs("div",{className:"sys-banner sys-banner-warning",children:[e.jsx("strong",{children:"Refresh failed."}),e.jsx("span",{children:te})]}),y&&c&&e.jsxs("div",{className:"sys-broker-source-note",role:"status","aria-live":"polite",children:[e.jsx(ke,{className:"sys-broker-source-spinner",size:12,"aria-hidden":"true"}),e.jsx("strong",{children:"Updating dispatches…"})]}),!y&&c?.source?.mode==="sqlite_projection"&&c.source.status==="degraded"&&c.source.detail&&e.jsxs("div",{className:"sys-broker-source-note sys-broker-source-note--warning",role:"status","aria-label":c.source.detail,title:c.source.detail,children:[e.jsx("span",{className:"sys-broker-source-dot","aria-hidden":"true"}),e.jsx("strong",{children:"Dispatch may be out of date"}),e.jsx("span",{children:"Live broker unavailable; showing saved dispatch history."})]}),R&&!c&&e.jsx(Re,{title:"Loading dispatch",body:"Reading the dispatch database snapshot."}),!R&&!c&&!te&&e.jsx(Re,{title:"No dispatch data",body:"No dispatch rows are available yet."}),c&&e.jsxs(e.Fragment,{children:[e.jsx(hr,{attempts:I,agents:f,selectedAttemptId:a?C?.id??null:d?.id??(i.view==="broker"?i.attemptId??null:null),onInspect:_,getRowFocusProps:ce}),I.length>0&&ge&&e.jsx("div",{className:"sys-ledger-footer",children:e.jsx("button",{type:"button",className:"s-btn",disabled:S,onClick:()=>{G()},children:S?"Loading older...":"Load older"})})]})]}),A&&e.jsx("div",{className:"s-broker-embed-detail",children:e.jsx(ss,{attempt:A,navigate:s,onClose:H})})]})})}function hr({attempts:s,agents:a,selectedAttemptId:t,onInspect:i,getRowFocusProps:f}){if(s.length===0)return e.jsx(Re,{title:"No dispatch rows",body:"No dispatch rows are available yet."});const d=s.reduce((b,u,c)=>{const j=ye(u.ts),k=b[b.length-1];return k?.key===j?k.attempts.push({attempt:u,index:c}):b.push({key:j,label:cr(u.ts),attempts:[{attempt:u,index:c}]}),b},[]);return e.jsxs("div",{className:"sys-broker-wire","aria-label":"Dispatch ledger",children:[e.jsxs("div",{className:"sys-broker-wire-head","aria-hidden":"true",children:[e.jsx("span",{className:"sys-broker-col sys-broker-col--status",children:"Status"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--from",children:"From"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--to",children:"To"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--msg",children:"Message"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--time",children:"Time"})]}),d.map(b=>e.jsxs("section",{className:"sys-broker-day","aria-labelledby":`dispatch-day-${b.key}`,children:[e.jsxs("header",{className:"sys-broker-day-head",children:[e.jsx("h2",{id:`dispatch-day-${b.key}`,children:b.label}),e.jsxs("span",{children:[b.attempts.length," ",b.attempts.length===1?"dispatch":"dispatches"]})]}),e.jsx("div",{className:"sys-broker-wire-body",role:"list",children:b.attempts.map(({attempt:u,index:c})=>{const j=Ee(u.kind,u.status),k=oe(u),R=Ve(u),U=ks(u.detail,vs(u)),y=Ze(u),m=()=>{i(u),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}}))};return e.jsxs("div",{role:"listitem",className:`sys-broker-wire-row${k?" sys-broker-wire-row--failure":""}${t===u.id?" sys-broker-wire-row--selected":""}`,"aria-label":`Inspect ${u.detail}`,onClick:m,...f(c),children:[e.jsxs("div",{className:"sys-broker-cell sys-broker-col--status",children:[e.jsx("span",{className:`sys-broker-dot sys-broker-dot--${j}`,"aria-hidden":"true"}),e.jsx("span",{className:`sys-broker-state sys-broker-state--${j}`,children:y})]}),e.jsx("div",{className:"sys-broker-cell sys-broker-col--from",children:e.jsx(Je,{attempt:u,agents:a,side:"from"})}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--to",children:[e.jsx(xs,{className:"sys-broker-route-arrow",size:13,"aria-hidden":"true"}),e.jsx(Je,{attempt:u,agents:a,side:"to"})]}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--msg",children:[e.jsx("span",{className:"sys-broker-msg",title:u.detail,children:U}),k&&R&&e.jsx("span",{className:"sys-broker-msg-error",title:R,children:R})]}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--time",children:[e.jsx("time",{className:"sys-broker-time-rel",title:We(u.ts),children:Ie(u.ts)}),e.jsx("span",{className:"sys-broker-time-abs",children:nr(u.ts)})]})]},u.id)})})]},b.key))]})}function fr(s){const a=Xe(s);return[{label:"Kind",value:tr(s.kind)},{label:"Time",value:We(s.ts)},{label:"Actor",value:s.actorName},{label:"Target",value:s.target},{label:"Route",value:s.route},{label:"Conversation",value:s.conversationId},{label:"Reference",value:a},{label:"Message",value:s.messageId===a?null:s.messageId},{label:"Delivery",value:s.deliveryId===a?null:s.deliveryId},{label:"Invocation",value:s.invocationId===a?null:s.invocationId}].filter(t=>!!t.value)}function ie({value:s,subject:a,className:t}){const[i,f]=n.useState("idle"),d=n.useRef(null);n.useEffect(()=>{f("idle")},[s]),n.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const b=n.useCallback(async()=>{const j=await ys(s);d.current&&clearTimeout(d.current),f(j?"copied":"failed"),d.current=setTimeout(()=>{f("idle"),d.current=null},1500)},[s]),u=i==="copied",c=i==="failed";return e.jsx("button",{type:"button",className:`sys-copy-btn${t?` ${t}`:""}${u?" sys-copy-btn--copied":""}${c?" sys-copy-btn--failed":""}`,onClick:()=>{b()},title:u?`Copied ${a}`:c?"Copy failed":`Copy ${a}`,"aria-label":u?`Copied ${a}`:c?`Copy ${a} failed`:`Copy ${a}`,children:u?e.jsx(Os,{size:14,"aria-hidden":"true"}):e.jsx(_s,{size:14,"aria-hidden":"true"})})}function mr(s){const a=s.trim();if(a.startsWith("{")||a.startsWith("["))try{return{code:JSON.stringify(JSON.parse(a),null,2),path:"payload.json",language:"JSON"}}catch{}return{code:s,path:"payload.md",language:"Text · Markdown"}}function pr({payload:s}){const a=n.useMemo(()=>mr(s),[s]),[t,i]=n.useState(!1),f=n.useRef(null),d=a.code.split(`
|
|
1
|
+
import{r as n,j as e}from"./index-DmFAhGPj.js";import{r as cs}from"./index-CmwGCxUk.js";import{D as ds}from"./runtime-picker--IW3cRry.js";import{E as Re}from"./EmptyState-BRY5jTpz.js";import{u as us,i as hs}from"./MessageComposerSuggestions-FdVHnT_q.js";import{r as fs,R as ms,a as ps,b as bs}from"./NewChatComposer-Hd7pI5Ac.js";import{a as ne}from"./api-h5zurxmi.js";import{c as ys}from"./clipboard-e3fSpeo7.js";import{u as gs}from"./sse-CxXt4tqI.js";import{b as Ee}from"./status-tone-BM_zuRy1.js";import{t as Ie,b as We,n as V}from"./time-Dhsh_2EG.js";import{u as Qe,A as xs}from"./Provider-cJCdHAxu.js";import{o as qe}from"./openContent-C6XO6kr5.js";import{g as js,b as oe,h as Ve,e as ks,i as vs,d as ws,j as Ns,k as Ss,l as As,m as Rs}from"./broker-display-pp33bLsu.js";import{BrokerMetadataPanel as Is}from"./BrokerMetadataPanel-BhjECqOK.js";import{DispatchAftermath as Cs}from"./DispatchAftermath-BDA9CrOd.js";import{i as $s,c as Ds,n as Oe}from"./keyboard-nav-h1IdakpD.js";import{ShikiPane as Es}from"./ShikiPane-dBS9hD-z.js";import{d as Fs}from"./types-B0PlfpKc.js";/* empty css */import{L as ke}from"./loader-circle-d6PKL_KD.js";import{R as Ms}from"./refresh-cw-C4x1x6b_.js";import{X as Ce}from"./x-C8ayPBtj.js";import{A as Ls}from"./arrow-down-w1HPzDSE.js";import{E as _e}from"./external-link-B1TI5yIt.js";import{C as Ts}from"./chevron-down-B3VVRJcV.js";import{S as Ps}from"./sparkles-DJOBD_8l.js";import{P as Bs}from"./paperclip-iZmDMOS5.js";import{P as zs}from"./plus-gZ0T0eBI.js";import{S as qs}from"./send-horizontal-IcG46D2M.js";import{C as Os}from"./check-BX8nRgop.js";import{C as _s}from"./copy-BFmOcWof.js";import{M as Ks}from"./message-square-D1hMsMj_.js";import{c as Ye}from"./createLucideIcon-CFBn0Sdk.js";import{R as Us}from"./radio-RMLfV4EO.js";import{b as Hs,M as Js}from"./DocumentFocusViewer-B9vodVmG.js";import{B as Ws}from"./bot-DzCOGKi6.js";const Qs=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Vs=Ye("at-sign",Qs);const Ys=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Gs=Ye("hash",Ys),Xs=160;function Ke(s){const a=new URLSearchParams({limit:String(Xs)});return s&&a.set("cursor",s),`/api/broker?${a.toString()}`}const Ue={index:-1,request:0};function Zs(s,a){return{index:a,request:s.request+1}}function Ge(s,a){return a===s.index?s:{index:a,request:s.request}}function er(s,a){return s.index<a?s:Ge(s,a>0?a-1:-1)}function sr(s,a){return s.request!==a}function rr({enabled:s,rowCount:a,onActivateRow:t,onClearSelection:i}){const[f,d]=n.useState(Ue),b=f.index,u=n.useRef(new Map),c=n.useRef(Ue.request),j=n.useCallback(y=>{d(m=>Zs(m,typeof y=="function"?y(m.index):y))},[]),k=n.useCallback(y=>{d(m=>Ge(m,typeof y=="function"?y(m.index):y))},[]);n.useEffect(()=>{if(!sr(f,c.current)||(c.current=f.request,f.index<0))return;const y=u.current.get(f.index);y?.scrollIntoView({block:"nearest"}),y?.focus()},[f]),n.useEffect(()=>{d(y=>er(y,a))},[a]);const R=n.useCallback((y,m)=>{m?u.current.set(y,m):u.current.delete(y)},[]);n.useEffect(()=>{if(!s)return;const y=m=>{if(document.querySelector(".sys-broker-page")&&!($s(m.target)||Ds())&&a!==0){if(m.key==="Escape"){i&&(m.preventDefault(),i(),k(-1));return}if(m.key==="ArrowDown"||m.key==="j"){m.preventDefault(),j(S=>Oe(S,a,1));return}if(m.key==="ArrowUp"||m.key==="k"){m.preventDefault(),j(S=>Oe(S,a,-1));return}if(m.key==="Home"||m.key==="g"&&!m.shiftKey){m.preventDefault(),j(0);return}if(m.key==="End"||m.key==="G"){m.preventDefault(),j(a-1);return}if(m.key==="Enter"||m.key===" "){const S=b<0?0:b;m.preventDefault(),j(S),t(S)}}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s,b,j,t,i,a,k]);const U=n.useCallback(y=>({tabIndex:b===y?0:-1,ref:m=>R(y,m),onFocus:()=>k(y)}),[b,R,k]);return{focusedIndex:b,setFocusedIndex:k,getRowFocusProps:U}}const be=["all","delivered","failed"],ar={all:"All",delivered:"Delivered",failed:"Failed"};function tr(s){switch(s){case"success":return"Success";case"failed_query":return"Query failure";case"failed_delivery":return"Delivery failure";default:return"Delivery attempt"}}function Xe(s){return s.messageId??s.deliveryId??s.invocationId??s.id}function Ze(s){switch(Ee(s.kind,s.status)){case"success":return"Delivered";case"danger":return"Failed";case"working":return"Pending";case"warning":return"Held";default:return s.status?s.status.charAt(0).toUpperCase()+s.status.slice(1):"Queued"}}function $e(s){if(!s)return"··";const a=s.trim().split(/\s+/).filter(Boolean);if(a.length===0)return"··";const t=a[a.length-1];return/^\d+$/.test(t)?t.slice(-2):a.length>=2?(a[0][0]+a[1][0]).toUpperCase():s.trim().slice(0,2).toUpperCase()}function nr(s){const a=V(s)??0;return new Date(a).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function He(s){const a=V(s);return a===null?"—":new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Ne(s,a,t=0){if(!s||typeof s!="object"||Array.isArray(s)||t>3)return;const i=s;for(const f of a)if(i[f]!==void 0&&i[f]!==null)return i[f];for(const f of Object.values(i)){const d=Ne(f,a,t+1);if(d!==void 0)return d}}function B(s,...a){const t=Ne(s.metadata,a);return typeof t!="string"&&typeof t!="number"?null:String(t).trim()||null}function ve(s,...a){const t=Ne(s.metadata,a);return typeof t=="number"||typeof t=="string"?V(t):null}function es(s){switch(s){case"dm":return"Direct · agent";case"channel":return"Channel";case"broadcast":return"Broadcast";case null:return"No route";default:return s.replaceAll("_"," ")}}function we(s,a){if(a==="to")return s.route==="channel"?"Channel":s.route==="broadcast"?"Broadcast":s.target?.toLowerCase().includes("operator")?"Operator":"Agent lane";const t=B(s,"class","actorClass")?.toLowerCase();return t==="operator"||t==="human"?"Operator":t==="agent"?"Agent":s.actorName?.toLowerCase().includes("operator")?"Operator":"Sender"}function or(s){const a=Ne(s.metadata,["latencyMs","durationMs"]);if(typeof a=="number"&&Number.isFinite(a)&&a>=0)return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(a<1e4?1:0)}s`;const t=ve(s,"sentAt","createdAt")??V(s.ts),i=ve(s,"deliveredAt","completedAt");if(t===null||i===null||i<t)return"—";const f=i-t;return f<1e3?`${f}ms`:`${(f/1e3).toFixed(f<1e4?1:0)}s`}function De({route:s}){switch(s){case"channel":return e.jsx(Gs,{size:12,"aria-hidden":"true"});case"broadcast":return e.jsx(Us,{size:12,"aria-hidden":"true"});case"dm":return e.jsx(Vs,{size:12,"aria-hidden":"true"});default:return e.jsx(Ks,{size:12,"aria-hidden":"true"})}}function ir(s,a){if(!a)return null;const t=a.trim().replace(/^@/,"").toLowerCase();return s.find(i=>[i.id,i.name,i.handle,i.selector,i.defaultSelector,i.conversationId,i.harnessSessionId].some(f=>f?.trim().replace(/^@/,"").toLowerCase()===t))??null}function lr(s,a,t){const i=t?.authorityNodeName??t?.homeNodeName??t?.authorityNodeId??t?.homeNodeId??B(s,"machine","machineName","nodeName");return(t?[{label:"Status",value:t.state},{label:"Handle",value:t.handle?`@${t.handle.replace(/^@/,"")}`:null},{label:"Project",value:t.project},{label:"Branch",value:t.branch},{label:"Runtime",value:[t.harness,t.model,t.reasoningEffort].filter(Boolean).join(" · ")||null},{label:"Machine",value:i},{label:"Working dir",value:t.cwd??t.projectRoot},{label:"Session",value:t.harnessSessionId},{label:"Conversation",value:t.conversationId??s.conversationId}]:[{label:"Kind",value:a==="to"&&s.conversationId?"Session route":we(s,a)},{label:"Channel",value:es(s.route)},{label:"Session",value:a==="to"?s.target:B(s,"sessionId","harnessSessionId")},{label:"Conversation",value:s.conversationId},{label:"Harness",value:B(s,"harness")},{label:"Model",value:B(s,"model")},{label:"Project",value:B(s,"project","projectName")},{label:"Branch",value:B(s,"branch")},{label:"Machine",value:i}]).filter(d=>!!d.value)}function Je({attempt:s,agents:a,side:t}){const i=t==="from"?s.actorName:s.target,f=ir(a,i),d=f?.name??i??(t==="from"?"Unknown":"No target"),b=f?"Agent":t==="to"&&s.conversationId?"Session":we(s,t),u=lr(s,t,f),c=`dispatch-endpoint-${s.id}-${t}`;return e.jsxs("span",{className:`sys-broker-endpoint sys-broker-endpoint--${t}`,tabIndex:0,"aria-describedby":c,children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:f||t==="from"?$e(d):e.jsx(De,{route:s.route})}),e.jsx("span",{className:"sys-broker-endpoint-name",title:d,children:d}),e.jsxs("span",{className:"sys-broker-endpoint-card",id:c,role:"tooltip",children:[e.jsxs("span",{className:"sys-broker-endpoint-card-head",children:[e.jsx("span",{className:"sys-broker-avatar","aria-hidden":"true",children:f||t==="from"?$e(d):e.jsx(De,{route:s.route})}),e.jsxs("span",{children:[e.jsx("strong",{children:d}),e.jsx("small",{children:b})]})]}),e.jsx("span",{className:"sys-broker-endpoint-card-body",children:u.map(j=>e.jsxs("span",{className:"sys-broker-endpoint-card-field",children:[e.jsx("small",{children:j.label}),e.jsx("code",{title:j.value,children:j.value})]},j.label))})]})]})}function ye(s){const a=V(s)??0,t=new Date(a);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function cr(s,a=Date.now()){const t=V(s)??0,i=new Date(t),f=new Date(a),d=new Date(a);return d.setDate(d.getDate()-1),ye(s)===ye(f.getTime())?"Today":ye(s)===ye(d.getTime())?"Yesterday":i.toLocaleDateString(void 0,{month:"short",day:"numeric",year:i.getFullYear()===f.getFullYear()?void 0:"numeric"})}function dr(s,a,t){return{...a,source:s.source,attempts:[...s.attempts,...a.attempts],failedQueries:s.failedQueries,failedDeliveries:s.failedDeliveries,dialogue:s.dialogue,ledger:{...a.ledger,cursors:{...s.ledger.cursors,[t]:a.ledger.cursors[t]},hasMore:{...s.ledger.hasMore,[t]:a.ledger.hasMore[t]}}}}function ur({navigate:s,embedded:a=!1,initialAttemptId:t}){const{route:i,agents:f,selectedBrokerAttempt:d,inspectBrokerAttempt:b,clearBrokerAttempt:u}=Qe(),[c,j]=n.useState(null),k=i.view==="broker"?i.filter??"all":"all",[R,U]=n.useState(!0),[y,m]=n.useState(!1),[S,Y]=n.useState(!1),[te,z]=n.useState(null),E=n.useRef(null),F=n.useRef(0),q=n.useRef(null),M=n.useCallback(async(o="initial")=>{const h=++F.current;!E.current&&o!=="background"?(U(!0),z(null)):m(!0);try{const x=await ne(Ke());if(h!==F.current)return;E.current=x,j(x),z(null)}catch(x){if(h!==F.current)return;z(x instanceof Error?x.message:String(x))}finally{h===F.current&&(U(!1),m(!1))}},[]),G=n.useCallback(async()=>{const o=E.current;if(!o||S)return;const h="attempts",x=o.ledger.cursors[h];if(!x||!o.ledger.hasMore[h])return;const T=++F.current;Y(!0),z(null);try{const P=await ne(Ke(x));if(T!==F.current)return;const se=E.current,ue=se?dr(se,P,h):P;E.current=ue,j(ue)}catch(P){if(T!==F.current)return;z(P instanceof Error?P.message:String(P))}finally{T===F.current&&Y(!1)}},[S]),le=n.useCallback(()=>{q.current||(q.current=setTimeout(()=>{q.current=null,M("background")},250))},[M]);n.useEffect(()=>(M("initial"),()=>{q.current&&clearTimeout(q.current)}),[M]),gs(o=>{(o.kind==="message.posted"||o.kind==="delivery.planned"||o.kind==="delivery.attempted"||o.kind==="delivery.state.changed"||o.kind==="scout.dispatched")&&le()});const v=n.useMemo(()=>{if(!c)return[];const o=new Map(c.dialogue.map(h=>[h.id,h.body]));return js(c.attempts).map(h=>{const x=h.messageId?o.get(h.messageId):null;return x&&x!==h.detail?{...h,detail:x}:h})},[c]),I=n.useMemo(()=>{switch(k){case"delivered":return v.filter(o=>!oe(o));case"failed":return v.filter(oe);default:return v}},[k,v]),ge=c?.ledger.hasMore.attempts??!1,X=n.useMemo(()=>({all:v.length,delivered:v.filter(o=>!oe(o)).length,failed:v.filter(oe).length}),[v]),$=n.useMemo(()=>{const o=i.view==="broker"?i.attemptId:void 0;return!c||!o?null:v.find(h=>h.id===o)??c.attempts.find(h=>h.id===o)??c.failedQueries.find(h=>h.id===o)??c.failedDeliveries.find(h=>h.id===o)??null},[c,v,i]),Z=$?`${$.id}\0${$.status}\0${$.ts}`:null,D=d?`${d.id}\0${d.status}\0${d.ts}`:null;n.useEffect(()=>{$&&Z!==D&&b($)},[D,b,$,Z]);const[C,N]=n.useState(null),O=n.useRef(!1),_=n.useCallback(o=>{if(a){O.current=!0,N(o);return}b(o)},[a,b]),H=n.useCallback(()=>{if(a){O.current=!0,N(null);return}u()},[u,a]),J=n.useCallback(o=>{const h=I[o];h&&(_(h),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}})))},[I,_]),{getRowFocusProps:ce,setFocusedIndex:xe}=rr({enabled:!!c&&I.length>0,rowCount:I.length,onActivateRow:J,onClearSelection:H}),de=C?.id??null,L=C?`${C.id} ${C.status} ${C.ts}`:null;n.useEffect(()=>{if(!a||!de)return;const o=v.find(h=>h.id===de);o&&`${o.id} ${o.status} ${o.ts}`!==L&&N(o)},[a,de,L,v]),n.useEffect(()=>{if(!a||!t||!c||O.current||C)return;const o=v.find(h=>h.id===t)??c.attempts.find(h=>h.id===t)??c.failedQueries.find(h=>h.id===t)??c.failedDeliveries.find(h=>h.id===t);o&&(O.current=!0,N(o))},[c,a,C,v,t]),n.useEffect(()=>{const o=i.view==="broker"?i.attemptId:void 0;if(!o)return;const h=I.findIndex(x=>x.id===o);h>=0&&xe(h)},[I,k,i,xe]);const ee=n.useCallback(o=>{const x=(be.indexOf(k)+o+be.length)%be.length,T=be[x];s({view:"broker",...T==="all"?{}:{filter:T}})},[k,s]),A=a?C:null;return e.jsx("div",{className:`s-ops${a?" s-ops--embedded":""}${A?" s-ops--split":""}`,children:e.jsxs("div",{className:"s-ops-body",children:[e.jsxs("div",{className:"sys-surface-page sys-surface-page-wide sys-surface-page-fluid sys-broker-page",children:[e.jsxs("div",{className:"sys-ledger-toolbar","aria-label":"Dispatch controls",children:[c?e.jsx("div",{className:"sys-tab-row sys-tab-row--toolbar",role:"tablist","aria-label":"Dispatch message filters",onKeyDown:o=>{o.key==="ArrowRight"?(o.preventDefault(),ee(1)):o.key==="ArrowLeft"&&(o.preventDefault(),ee(-1))},children:be.map(o=>e.jsxs("button",{type:"button",role:"tab","aria-selected":k===o,className:`sys-tab${k===o?" sys-tab-active":""}`,onClick:()=>s({view:"broker",...o==="all"?{}:{filter:o}}),children:[e.jsx("span",{children:ar[o]}),e.jsx("span",{className:"sys-tab-count",children:X[o]})]},o))}):e.jsx("div",{className:"sys-ledger-kicker",children:"Dispatch ledger"}),e.jsxs("div",{className:"sys-page-actions sys-ledger-actions",children:[e.jsx("div",{className:"sys-sync-note",children:R?"Loading dispatch ledger...":c?`Updated ${Ie(c.generatedAt)}${c.source?.latestMessageAt?` · latest message ${Ie(c.source.latestMessageAt)}`:""}`:"Waiting for dispatch data"}),e.jsx("button",{type:"button",className:"s-btn",disabled:R||y,onClick:()=>{M("manual")},children:y?"Refreshing...":"Refresh"})]})]}),te&&e.jsxs("div",{className:"sys-banner sys-banner-warning",children:[e.jsx("strong",{children:"Refresh failed."}),e.jsx("span",{children:te})]}),y&&c&&e.jsxs("div",{className:"sys-broker-source-note",role:"status","aria-live":"polite",children:[e.jsx(ke,{className:"sys-broker-source-spinner",size:12,"aria-hidden":"true"}),e.jsx("strong",{children:"Updating dispatches…"})]}),!y&&c?.source?.mode==="sqlite_projection"&&c.source.status==="degraded"&&c.source.detail&&e.jsxs("div",{className:"sys-broker-source-note sys-broker-source-note--warning",role:"status","aria-label":c.source.detail,title:c.source.detail,children:[e.jsx("span",{className:"sys-broker-source-dot","aria-hidden":"true"}),e.jsx("strong",{children:"Dispatch may be out of date"}),e.jsx("span",{children:"Live broker unavailable; showing saved dispatch history."})]}),R&&!c&&e.jsx(Re,{title:"Loading dispatch",body:"Reading the dispatch database snapshot."}),!R&&!c&&!te&&e.jsx(Re,{title:"No dispatch data",body:"No dispatch rows are available yet."}),c&&e.jsxs(e.Fragment,{children:[e.jsx(hr,{attempts:I,agents:f,selectedAttemptId:a?C?.id??null:d?.id??(i.view==="broker"?i.attemptId??null:null),onInspect:_,getRowFocusProps:ce}),I.length>0&&ge&&e.jsx("div",{className:"sys-ledger-footer",children:e.jsx("button",{type:"button",className:"s-btn",disabled:S,onClick:()=>{G()},children:S?"Loading older...":"Load older"})})]})]}),A&&e.jsx("div",{className:"s-broker-embed-detail",children:e.jsx(ss,{attempt:A,navigate:s,onClose:H})})]})})}function hr({attempts:s,agents:a,selectedAttemptId:t,onInspect:i,getRowFocusProps:f}){if(s.length===0)return e.jsx(Re,{title:"No dispatch rows",body:"No dispatch rows are available yet."});const d=s.reduce((b,u,c)=>{const j=ye(u.ts),k=b[b.length-1];return k?.key===j?k.attempts.push({attempt:u,index:c}):b.push({key:j,label:cr(u.ts),attempts:[{attempt:u,index:c}]}),b},[]);return e.jsxs("div",{className:"sys-broker-wire","aria-label":"Dispatch ledger",children:[e.jsxs("div",{className:"sys-broker-wire-head","aria-hidden":"true",children:[e.jsx("span",{className:"sys-broker-col sys-broker-col--status",children:"Status"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--from",children:"From"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--to",children:"To"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--msg",children:"Message"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--time",children:"Time"})]}),d.map(b=>e.jsxs("section",{className:"sys-broker-day","aria-labelledby":`dispatch-day-${b.key}`,children:[e.jsxs("header",{className:"sys-broker-day-head",children:[e.jsx("h2",{id:`dispatch-day-${b.key}`,children:b.label}),e.jsxs("span",{children:[b.attempts.length," ",b.attempts.length===1?"dispatch":"dispatches"]})]}),e.jsx("div",{className:"sys-broker-wire-body",role:"list",children:b.attempts.map(({attempt:u,index:c})=>{const j=Ee(u.kind,u.status),k=oe(u),R=Ve(u),U=ks(u.detail,vs(u)),y=Ze(u),m=()=>{i(u),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}}))};return e.jsxs("div",{role:"listitem",className:`sys-broker-wire-row${k?" sys-broker-wire-row--failure":""}${t===u.id?" sys-broker-wire-row--selected":""}`,"aria-label":`Inspect ${u.detail}`,onClick:m,...f(c),children:[e.jsxs("div",{className:"sys-broker-cell sys-broker-col--status",children:[e.jsx("span",{className:`sys-broker-dot sys-broker-dot--${j}`,"aria-hidden":"true"}),e.jsx("span",{className:`sys-broker-state sys-broker-state--${j}`,children:y})]}),e.jsx("div",{className:"sys-broker-cell sys-broker-col--from",children:e.jsx(Je,{attempt:u,agents:a,side:"from"})}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--to",children:[e.jsx(xs,{className:"sys-broker-route-arrow",size:13,"aria-hidden":"true"}),e.jsx(Je,{attempt:u,agents:a,side:"to"})]}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--msg",children:[e.jsx("span",{className:"sys-broker-msg",title:u.detail,children:U}),k&&R&&e.jsx("span",{className:"sys-broker-msg-error",title:R,children:R})]}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--time",children:[e.jsx("time",{className:"sys-broker-time-rel",title:We(u.ts),children:Ie(u.ts)}),e.jsx("span",{className:"sys-broker-time-abs",children:nr(u.ts)})]})]},u.id)})})]},b.key))]})}function fr(s){const a=Xe(s);return[{label:"Kind",value:tr(s.kind)},{label:"Time",value:We(s.ts)},{label:"Actor",value:s.actorName},{label:"Target",value:s.target},{label:"Route",value:s.route},{label:"Conversation",value:s.conversationId},{label:"Reference",value:a},{label:"Message",value:s.messageId===a?null:s.messageId},{label:"Delivery",value:s.deliveryId===a?null:s.deliveryId},{label:"Invocation",value:s.invocationId===a?null:s.invocationId}].filter(t=>!!t.value)}function ie({value:s,subject:a,className:t}){const[i,f]=n.useState("idle"),d=n.useRef(null);n.useEffect(()=>{f("idle")},[s]),n.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const b=n.useCallback(async()=>{const j=await ys(s);d.current&&clearTimeout(d.current),f(j?"copied":"failed"),d.current=setTimeout(()=>{f("idle"),d.current=null},1500)},[s]),u=i==="copied",c=i==="failed";return e.jsx("button",{type:"button",className:`sys-copy-btn${t?` ${t}`:""}${u?" sys-copy-btn--copied":""}${c?" sys-copy-btn--failed":""}`,onClick:()=>{b()},title:u?`Copied ${a}`:c?"Copy failed":`Copy ${a}`,"aria-label":u?`Copied ${a}`:c?`Copy ${a} failed`:`Copy ${a}`,children:u?e.jsx(Os,{size:14,"aria-hidden":"true"}):e.jsx(_s,{size:14,"aria-hidden":"true"})})}function mr(s){const a=s.trim();if(a.startsWith("{")||a.startsWith("["))try{return{code:JSON.stringify(JSON.parse(a),null,2),path:"payload.json",language:"JSON"}}catch{}return{code:s,path:"payload.md",language:"Text · Markdown"}}function pr({payload:s}){const a=n.useMemo(()=>mr(s),[s]),[t,i]=n.useState(!1),f=n.useRef(null),d=a.code.split(`
|
|
2
2
|
`).length;n.useEffect(()=>{const u=f.current;!u||!t||u.open||u.showModal()},[t]),n.useEffect(()=>{i(!1)},[s]);const b=e.jsx("div",{className:"sys-broker-payload-code","data-language":a.path==="payload.json"?"json":"markdown",role:"region","aria-label":`Dispatch payload, ${a.language}`,tabIndex:0,children:e.jsx(Es,{code:a.code,path:a.path})});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sys-broker-payload-head",children:[e.jsx("span",{className:"sys-detail-label",children:"Payload"}),e.jsxs("span",{className:"sys-broker-payload-meta",children:[a.language," · ",d," ",d===1?"line":"lines"]}),e.jsx(ie,{value:s,subject:"payload"}),e.jsx("button",{type:"button",className:"sys-copy-btn sys-broker-payload-expand",onClick:()=>i(!0),title:"Expand payload","aria-label":"Expand payload",children:e.jsx(Hs,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-resizer",children:b}),t&&cs.createPortal(e.jsxs("dialog",{ref:f,className:"sys-broker-payload-dialog","aria-label":"Expanded dispatch payload",onCancel:u=>{u.preventDefault(),i(!1)},onClose:()=>i(!1),children:[e.jsxs("header",{className:"sys-broker-payload-dialog-head",children:[e.jsxs("div",{children:[e.jsx("span",{className:"sys-detail-label",children:"Dispatch payload"}),e.jsxs("span",{className:"sys-broker-payload-meta",children:[a.language," · ",d," ",d===1?"line":"lines"]})]}),e.jsx(ie,{value:s,subject:"payload"}),e.jsx("button",{type:"button",className:"sys-copy-btn",onClick:()=>i(!1),title:"Return payload to inspector","aria-label":"Return payload to inspector",children:e.jsx(Js,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-dialog-body",children:b})]}),document.body)]})}function br({attempt:s}){const a=Rs(s);return e.jsxs("div",{className:"sys-broker-route-failure",role:"status",children:[e.jsx("span",{className:"sys-broker-route-failure-mark","aria-hidden":"true",children:e.jsx(Ce,{size:14})}),e.jsxs("div",{children:[e.jsx("span",{className:"sys-detail-label",children:"Routing stopped"}),e.jsx("strong",{children:a}),e.jsx("p",{children:s.detail})]}),e.jsx(ie,{value:s.detail,subject:"failure detail"})]})}function ss({attempt:s,navigate:a,onClose:t}){const{route:i,agents:f,scoutbotAgentId:d}=Qe(),b=fr(s),u=ws(s.metadata),c=oe(s),j=s.kind==="failed_query",k=Ve(s),R=Ee(s.kind,s.status),U=ve(s,"sentAt","createdAt")??V(s.ts),y=ve(s,"deliveredAt","completedAt")??V(s.ts),m=Xe(s),[S,Y]=n.useState("idle"),[te,z]=n.useState(null),[E,F]=n.useState(null),[q,M]=n.useState(""),[G,le]=n.useState(""),[v,I]=n.useState("idle"),[ge,X]=n.useState(null),[$,Z]=n.useState(""),[D,C]=n.useState(""),[N,O]=n.useState(""),[_,H]=n.useState(""),[J,ce]=n.useState("medium"),[xe,de]=n.useState(null),[L,ee]=n.useState([]),[A,o]=n.useState("idle"),[h,x]=n.useState(null),T=B(s,"harness"),P=B(s,"model"),se=B(s,"reasoningEffort","effort"),ue=n.useRef(null),Fe=n.useRef(null),Se=n.useMemo(()=>Ns(s),[s]),w=n.useMemo(()=>f.filter(r=>!r.retiredFromFleet&&!r.staleLocalRegistration).slice().sort((r,l)=>r.id===d?-1:l.id===d?1:(l.updatedAt??0)-(r.updatedAt??0)||r.name.localeCompare(l.name)),[f,d]),he=n.useMemo(()=>Ss(s,w)?.id??"",[s,w]),fe=w.some(r=>r.id===d)?d:w[0]?.id??"",je=w[0]?.id??"",re=w.find(r=>r.id===fe)??null,rs=n.useMemo(()=>{const r=new Map;for(const l of w){const p=l.projectRoot?.trim()||l.cwd?.trim();if(!p)continue;const g=p.split("/").filter(Boolean).at(-1)??p;r.set(p,l.project?.trim()||g)}return[...r.entries()].map(([l,p])=>({path:l,label:p}))},[w]),Me=n.useRef({originalTargetAgentId:he,firstRoutableAgentId:je,defaultForwardAgentId:fe,defaultForwardAgent:re,effort:"medium"});Me.current={originalTargetAgentId:he,firstRoutableAgentId:je,defaultForwardAgentId:fe,defaultForwardAgent:re,effort:B(s,"reasoningEffort","effort")||"medium"};const me=n.useRef(!1);n.useEffect(()=>{const r=Me.current;me.current=!1,Y("idle"),z(null),F(null),M(""),le(r.originalTargetAgentId||r.firstRoutableAgentId),I("idle"),X(null),Z(r.defaultForwardAgentId),C(r.defaultForwardAgent?.projectRoot?.trim()||r.defaultForwardAgent?.cwd?.trim()||""),O(r.defaultForwardAgent?.harness?.trim()||""),H(r.defaultForwardAgent?.model?.trim()||""),ce(r.effort),ee([]),o("idle"),x(null)},[s.id]),n.useEffect(()=>{me.current||(le(r=>r||he||je),Z(r=>r||fe),C(r=>r||re?.projectRoot?.trim()||re?.cwd?.trim()||""),O(r=>r||re?.harness?.trim()||""),H(r=>r||re?.model?.trim()||""))},[re,fe,je,he]),n.useEffect(()=>{const r=new URLSearchParams({scope:"global+project"});D&&r.set("projectRoot",D);let l=!1;return ne(`/api/runner/options?${r.toString()}`).then(p=>{!l&&p.schemaVersion==="openscout.runtime-capabilities.v1"&&de(p)}).catch(()=>{}),()=>{l=!0}},[D]);const as=n.useCallback(r=>{M(r),window.requestAnimationFrame(()=>ue.current?.focus())},[]),ts=n.useCallback(async()=>{const r=w.find(l=>l.id===G);if(!(!r||v==="sending")){I("sending"),X(null);try{const l=await ne("/api/ask",{method:"POST",body:JSON.stringify({body:s.detail,targetAgentId:r.id,targetLabel:r.name,...T||P||se?{execution:{...T?{harness:T}:{},...P?{model:P}:{},...se?{reasoningEffort:se}:{},session:"new"}}:{},metadata:{source:"scout-dispatch-redispatch",originalDispatchId:s.id,...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),p=l.flightId??l.flight?.id;I("sent"),X(`New dispatch sent to ${r.name}${p?` · ${p}`:""}`)}catch(l){I("failed"),X(`Retry failed. ${l instanceof Error?l.message:String(l)}`)}}},[s,G,v,se,T,P,w]),Le=n.useCallback(async()=>{const r=q.trim(),l=w.find(p=>p.id===$);if(!(!r||!l||A==="sending")){o("sending"),x(L.length>0?`Uploading ${L.length} ${L.length===1?"attachment":"attachments"}…`:null);try{const p=L.length>0?await us(L):[],g=await ne("/api/ask",{method:"POST",body:JSON.stringify({body:`${r}
|
|
3
3
|
|
|
4
4
|
Attached dispatch context:
|
package/dist/client/assets/{ChatCollapsedStrip-DdKyMSEM.js → ChatCollapsedStrip-DNR9osDy.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,r as g}from"./index-
|
|
1
|
+
import{j as t,r as g}from"./index-DmFAhGPj.js";import{i as A,k,l as N,a as D}from"./conversation-model-CHwHZNw-.js";import{l as L,i as E,a as _,p as w}from"./conversation-prefs-DNre-Lcx.js";import{u as O,m as P,g as R}from"./Provider-cJCdHAxu.js";import{b as U}from"./router-Cn_s9IGH.js";import{l as T,i as C,s as V}from"./sessionRead-CvFz2RHv.js";import{u as z}from"./use-conversation-list-C-dPcjQe.js";import{d as H}from"./colors-BtO5_zlx.js";/* empty css */function q({children:a,count:l,tone:s="default",title:n}){return t.jsxs("div",{className:["collapsed-strip-label",s!=="default"&&`collapsed-strip-label--${s}`,l!=null&&"collapsed-strip-label--has-count"].filter(Boolean).join(" "),title:n??a,children:[t.jsx("span",{className:"collapsed-strip-label-mark","aria-hidden":!0}),t.jsx("span",{className:"collapsed-strip-label-text",children:a}),l!=null?t.jsx("span",{className:"collapsed-strip-label-count",children:l}):null]})}function F({label:a,emptyMark:l="·",showLabel:s=!0,labelTone:n="default",labelCount:r,children:d}){const c=!d||Array.isArray(d)&&d.length===0,u=s?t.jsx(q,{tone:n,count:r,children:a}):null;return c?t.jsxs("div",{className:"collapsed-strip collapsed-strip--empty","aria-hidden":!0,children:[u,t.jsx("span",{className:"collapsed-strip-empty-mark",children:l})]}):t.jsxs("div",{className:"collapsed-strip",role:"list","aria-label":a,children:[u,d]})}function G(){return t.jsx("div",{className:"collapsed-strip-rule","aria-hidden":!0})}function J({title:a,active:l,tone:s="default",ava:n,avaColor:r,glyph:d,dot:c,pinned:u,onClick:h}){const j=["collapsed-chip",s==="channel"&&"collapsed-chip--channel",s==="neutral"&&"collapsed-chip--neutral",s==="attention"&&"collapsed-chip--attention",s==="unread"&&"collapsed-chip--unread",l&&"collapsed-chip--active",u&&"collapsed-chip--pinned"].filter(Boolean).join(" ");return t.jsxs("button",{type:"button",role:"listitem",className:j,title:a,"aria-label":a,"aria-current":l?"page":void 0,onClick:h,children:[n?t.jsx("span",{className:"collapsed-chip-ava",style:r?{background:r}:void 0,children:n}):t.jsx("span",{className:"collapsed-chip-glyph",children:d}),c?t.jsx("span",{className:["collapsed-chip-dot",c==="attention"&&"collapsed-chip-dot--attention",c==="live"&&"collapsed-chip-dot--live"].filter(Boolean).join(" "),"aria-hidden":!0}):null,u?t.jsx("span",{className:"collapsed-chip-pin","aria-hidden":!0}):null]})}function K(a){const l=a.trim(),s=l.split(/[\s/_-]+/).filter(Boolean);if(s.length>=2){const n=s[s.length-1];return/^\d+$/.test(n)&&s.length>=3?(s[s.length-2][0]??"?").toUpperCase():(n[0]??"?").toUpperCase()}return(l[0]??"?").toUpperCase()}const Q=3,W=3,X=4,Y=3;function I(a,l){return[...a].sort((s,n)=>{const r=C(s.lastMessageAt,s.id,l)?0:1,d=C(n.lastMessageAt,n.id,l)?0:1;return r!==d?r-d:(n.lastMessageAt??0)-(s.lastMessageAt??0)})}function Z(){const{route:a,navigate:l,agents:s}=O(),{sessions:n}=z(),[r,d]=g.useState(()=>L()),[c,u]=g.useState(()=>T()),h=U(a),j=g.useMemo(()=>P(s,h),[s,h]),$=a.view==="messages"||a.view==="conversation"?a.conversationId:void 0;g.useEffect(()=>{d(L()),u(T())},[]);const i=g.useMemo(()=>{const e=R(n,j,h).filter(o=>!E(o.id,r)),m=e.filter(o=>_(o.id,r)).sort((o,y)=>w(y.id,r)-w(o.id,r)||(y.lastMessageAt??0)-(o.lastMessageAt??0)).slice(0,Q),f=new Set(m.map(o=>o.id)),p=e.filter(o=>!f.has(o.id));return{pinned:m,channels:I(p.filter(N),c).slice(0,W),dms:I(p.filter(k),c).slice(0,X),observed:I(p.filter(A),c).slice(0,Y),totals:{channels:p.filter(N).length,dms:p.filter(k).length,observed:p.filter(A).length,pinned:e.filter(o=>_(o.id,r)).length}}},[n,j,h,r,c]),B=e=>{u(V(e.id)),l({view:"messages",conversationId:e.id,...h?{machineId:h}:{}})},S=[...i.pinned,...i.channels,...i.dms,...i.observed],M=S.filter(e=>C(e.lastMessageAt,e.id,c)).length,x=(e,m=!1)=>{const f=D(e),p=N(e),o=C(e.lastMessageAt,e.id,c);return t.jsx(J,{title:m?`${f} · pinned`:f,active:e.id===$,tone:p?"channel":o?"unread":"default",ava:p?void 0:K(e.agentName??f),avaColor:p?void 0:H(e.agentName??f),glyph:p?"#":void 0,dot:o?"unread":null,pinned:m,onClick:()=>B(e)},e.id)},v=[];return i.pinned.length&&v.push(t.jsx(b,{mark:"Pin",count:i.totals.pinned,children:i.pinned.map(e=>x(e,!0))},"pin")),i.channels.length&&v.push(t.jsx(b,{mark:"#",count:i.totals.channels,children:i.channels.map(e=>x(e))},"ch")),i.dms.length&&v.push(t.jsx(b,{mark:"DM",count:i.totals.dms,children:i.dms.map(e=>x(e))},"dm")),i.observed.length&&v.push(t.jsx(b,{mark:"Obs",count:i.totals.observed,children:i.observed.map(e=>x(e))},"obs")),t.jsx(F,{label:"Chat",emptyMark:"#",labelTone:M>0?"accent":"default",labelCount:M>0?M:S.length||void 0,children:v.flatMap((e,m)=>m===0?[e]:[t.jsx(G,{},`rule-${m}`),e])})}function b({mark:a,count:l,children:s}){return t.jsxs("div",{className:"collapsed-strip-section",role:"group","aria-label":a,children:[t.jsxs("div",{className:"collapsed-strip-section-mark",title:l!=null?`${a} · ${l}`:a,children:[t.jsx("span",{className:"collapsed-strip-section-mark-text",children:a}),l!=null&&l>0?t.jsx("span",{className:"collapsed-strip-section-mark-count",children:l>99?"99+":l}):null]}),s]})}const ce=Object.freeze(Object.defineProperty({__proto__:null,ChatCollapsedStrip:Z},Symbol.toStringTag,{value:"Module"}));export{F as C,Z as a,J as b,K as c,G as d,ce as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as a}from"./index-
|
|
1
|
+
import{r as o,j as a}from"./index-DmFAhGPj.js";import{f as k}from"./cache-Dr0why2k.js";import{u as F,f as I,l as N,L as _,D}from"./usePierreRuntime-Cm7-qdm0.js";/* empty css */const R=["unstaged","staged","branch"];function L(n){if(!n.startsWith("/"))return null;const t=[];for(const e of n.split("/"))if(!(!e||e==="."))if(e===".."){if(t.length===0)return null;t.pop()}else t.push(e);return t}function A(n,t){const e=L(n),s=L(t);return!e||!s||s.length<=e.length||e.some((c,u)=>s[u]!==c)?null:s.slice(e.length).join("/")}function y(n,t){return n.files.findIndex(e=>e.newPath===t||e.oldPath===t)}function K(n,t){return n.find(e=>y(e,t)>=0)?.kind??null}const M=()=>{},T=()=>{};function O({root:n,file:t}){const e=o.useMemo(()=>A(n,t),[t,n]),[s,c]=o.useState(null),[u,d]=o.useState("loading"),[P,m]=o.useState(null),[S,h]=o.useState(null),{pierre:j,pierrePhase:v,pierreError:C,pierreTheme:b,retryPierre:E}=F(s);o.useEffect(()=>{let r=!1;if(c(null),d("loading"),m(null),h(null),!e){d("ready");return}return k(n,R,{files:[e],tier:"patch"}).then(i=>{r||(c(i.snapshot),h(K(i.snapshot.layers,e)),d("ready"))},i=>{r||(m(i instanceof Error?i.message:String(i)),d("error"))}),()=>{r=!0}},[e,n]);const f=o.useMemo(()=>e?s?.layers.filter(r=>y(r,e)>=0)??[]:[],[e,s]),l=f.find(r=>r.kind===S)??f[0]??null,p=l&&e?y(l,e):-1,g=l&&p>=0?I(l.files[p],p):null;return u==="loading"?a.jsx("div",{className:"s-code-empty",children:"Loading file changes…"}):u==="error"?a.jsx("div",{className:"s-code-empty",children:P??"Couldn’t load this file’s changes."}):!s||!l||!g?a.jsx("div",{className:"s-code-empty",children:"No tracked patch is available. The file is clean, or it is untracked and has no Git baseline yet."}):a.jsxs("div",{className:"s-code-diff",children:[f.length>1?a.jsx("div",{className:"s-code-diffLayers",role:"tablist","aria-label":"Change layer",children:f.map(r=>{const i=N(r),x=r.kind===l.kind;return a.jsxs("button",{type:"button",role:"tab","aria-selected":x,className:"s-code-diffLayer","data-selected":x||void 0,onClick:()=>h(r.kind),children:[_[r.kind],a.jsxs("span",{children:["+",i.add," −",i.del]})]},r.kind)})}):null,a.jsx(D,{layer:l,patchLayer:l,patchPhase:"ready",patchError:null,selectedFileKey:g,renderKey:s.render.renderKey,theme:b,layout:"split",pierre:j,pierrePhase:v,pierreError:C,onRetryPierre:E,onIncludeLineContext:M,onIncludeSelectionContext:T,contextActions:!1})]})}const G=Object.freeze(Object.defineProperty({__proto__:null,CodeDiffPane:O},Symbol.toStringTag,{value:"Module"}));export{O as C,G as a,A as r};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as h,j as i}from"./index-
|
|
1
|
+
import{r as h,j as i}from"./index-DmFAhGPj.js";import{C as ne}from"./chevron-down-B3VVRJcV.js";import{S as oe}from"./search-DAyagUtF.js";const se=new Set(["hud","tail","terminal","services","pair","osn-auth","notification","code","file"]);function L(e){const t=e?.trim();return t||void 0}function q(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isSafeInteger(t)&&t>0?t:void 0}function ce(e){return e.split("/").filter(t=>t.length>0).map(encodeURIComponent).join("/")}function R(e){return e.map(t=>{try{return decodeURIComponent(t)}catch{return t}}).join("/")}function ie(e){const t=q(e.get("line")),n=q(e.get("endLine")),r=t&&n&&n>=t?n:void 0;return{...L(e.get("wt"))?{wt:L(e.get("wt"))}:{},...t?{line:t}:{},...r?{endLine:r}:{}}}function G(e){const t=e.trim();if(!t)return null;if(t.startsWith("/")||t.startsWith("~/")){const u=t.replace(/^~/,""),d=t.startsWith("~")?t:u;return{root:d,file:d}}if(!/^scout:/i.test(t))return null;let n;try{n=new URL(t)}catch{return null}if(n.protocol.toLowerCase()!=="scout:")return null;const r=(n.hostname||n.host||"").toLowerCase(),c=n.pathname.split("/").filter(u=>u.length>0),s=ie(n.searchParams);if(!r||r==="file"){const u=c;if(u.length===0)return null;const d=`/${R(u)}`,m=L(n.searchParams.get("root")),j=L(n.searchParams.get("file"));return{root:m??d,file:j??d,...s}}if(r==="code"){if(c.length===0){const m=L(n.searchParams.get("root")),j=L(n.searchParams.get("file")),b=L(n.searchParams.get("project")),y=L(n.searchParams.get("path"));return!m&&!j&&!b?{...s}:{...m?{root:m}:{},...j?{file:j}:{},...b?{project:b}:{},...y?{path:y}:{},...s}}const u=R([c[0]]),d=c.length>1?R(c.slice(1)):void 0;return{project:u,...d?{path:d}:{},...s}}if(se.has(r))return null;const a=decodeURIComponent(r),l=c.length>0?R(c):void 0;return{project:a,...l?{path:l}:{},...s}}function ae(e){const t=new URLSearchParams;e.wt&&t.set("wt",e.wt),e.line&&e.line>0&&t.set("line",String(e.line)),e.line&&e.endLine&&e.endLine>=e.line&&t.set("endLine",String(e.endLine));const n=t.toString(),r=n?`?${n}`:"";if(e.project)return`scout://${e.path?`${encodeURIComponent(e.project)}/${ce(e.path)}`:encodeURIComponent(e.project)}${r}`;const c=e.file??e.root;return c?`scout://${c.startsWith("/")?c:`/${c}`}${r}`:`scout://code${r}`}function le(e,t){const n=e.trim();if(!n)return null;let r=null;for(const c of t)(n===c||n.startsWith(`${c}/`))&&(!r||c.length>r.length)&&(r=c);return r?{root:r,file:n===r?null:n}:null}function ue(e){const t=e.trim();return t?!!(t.startsWith("/")||t.startsWith("~/")||/^scout:/i.test(t)):!1}function B(e){return e.toLowerCase().replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function de(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function fe(e){return e.branch.detached?"detached":e.branch.name??"no branch"}function pe(e){return e.status.clean?"":`${e.status.changedFiles} changed`}function he(e){const t=[];for(const n of e)for(const[r,c]of n.worktrees.entries())t.push({root:c.path,projectId:n.id,projectName:n.name,projectSlug:B(n.name)||B(de(n.name)),worktreeName:c.name,branchLabel:fe(c),dirtyLabel:pe(c),isPrimary:r===0,changedFiles:c.status.changedFiles});return t}function v(e){return e.toLocaleLowerCase().replace(/[\s/_-]+/g," ").trim()}function me(e,t,n=0){const r=v(t);if(!r)return n;const c=r.split(" ").filter(Boolean),s=v(e.projectName),a=v(e.root),l=v(e.branchLabel),u=v(e.worktreeName),d=`${s} ${a} ${l} ${u} ${e.projectSlug}`;if(!c.every(j=>d.includes(j)))return-1;let m=n/100;return s===r||e.projectSlug===r.replace(/\s+/g,"-")?m+=120:s.startsWith(r)||e.projectSlug.startsWith(r.replace(/\s+/g,"-"))?m+=80:s.includes(r)&&(m+=48),(l.startsWith(r)||l.includes(r))&&(m+=34),u.includes(r)&&(m+=24),a.includes(r)&&(m+=20),m+=c.reduce((j,b)=>j+(s.startsWith(b)?12:0),0),m}function ge(e,t,n,r=12){const c=new Map(n.map((a,l)=>[a,n.length-l])),s=e.map(a=>({option:a,score:me(a,t,c.get(a.root)??0)})).filter(a=>a.score>=0);return t.trim()?s.sort((a,l)=>l.score-a.score||a.option.projectName.localeCompare(l.option.projectName)):s.sort((a,l)=>{const u=c.get(a.option.root)??-1,d=c.get(l.option.root)??-1;return u!==d?d-u:a.option.projectName.localeCompare(l.option.projectName)||a.option.branchLabel.localeCompare(l.option.branchLabel)}),s.slice(0,r).map(a=>a.option)}function Y(e){return e.isPrimary?e.projectName:`${e.projectName} · ${e.branchLabel}`}function D(e){return e.dirtyLabel?`${e.branchLabel} · ${e.dirtyLabel}`:e.branchLabel}function O(e){const t=typeof window<"u"?window.__OPEN_SCOUT_HOME:void 0;if(t&&e.startsWith(`${t}/`))return`~/${e.slice(t.length+1)}`;if(e.startsWith("/Users/")){const n=e.slice(7),r=n.indexOf("/");if(r>0)return`~${n.slice(r)}`}if(e.startsWith("/home/")){const n=e.slice(6),r=n.indexOf("/");if(r>0)return`~${n.slice(r)}`}return e}const Q="openscout.code.tree:",_="openscout.code.lastRoot",V="openscout.code.recentRoots",je=8;function Ce(e){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(Q+e);if(!t)return null;const n=JSON.parse(t);return!n||typeof n.entries!="object"||!Array.isArray(n.expanded)?null:n}catch{return null}}function Re(e,t){if(typeof window>"u")return;const n={};for(const r of[e,...t.expanded]){const c=t.entries.get(r);c&&(n[r]=c)}try{window.localStorage.setItem(Q+e,JSON.stringify({entries:n,expanded:[...t.expanded],selectedFile:t.selectedFile,savedAt:Date.now()}))}catch{}}function Oe(){if(typeof window>"u")return null;try{return window.localStorage.getItem(_)}catch{return null}}function M(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(V);if(!e){const n=window.localStorage.getItem(_);return n?[n]:[]}const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"&&n.length>0):[]}catch{return[]}}function Pe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(_,e);const t=M().filter(r=>r!==e),n=[e,...t].slice(0,je);window.localStorage.setItem(V,JSON.stringify(n))}catch{}}const we=6,be=12;function k(e){return e.toLowerCase().replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function W(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function X(e,t,n){const r=G(e);if(!r)return null;if(r.root||r.file){const c=t.map(u=>u.root),s=xe(r.file??r.root,c),a=le(s,c);if(a)return{root:a.root,file:a.file,line:r.line,endLine:r.endLine};const l=W(s).includes(".");return{root:l?Le(s):s,file:l?s:null,line:r.line,endLine:r.endLine}}if(r.project){const c=ke(n,r.project,r.wt??null,t);if(!c)return null;const s=r.path?`${c.root}/${r.path}`:null;return{root:c.root,file:s,project:r.project,path:r.path,wt:r.wt,line:r.line,endLine:r.endLine}}return null}function xe(e,t){if(!e.startsWith("~/")&&e!=="~")return e;for(const n of t){const r=n.match(/^(\/Users\/[^/]+)/)??n.match(/^(\/home\/[^/]+)/);if(r)return`${r[1]}${e.slice(1)}`}return e}function Le(e){const t=e.lastIndexOf("/");return t>0?e.slice(0,t):e}function ke(e,t,n,r){if(e){const a=k(t),l=e.projects.find(u=>k(u.name)===a||k(W(u.root))===a);if(l)return{root:(n?l.worktrees.find(d=>d.name===n||d.branch.name===n||k(d.name)===k(n)):l.worktrees[0])?.path??l.root}}const c=k(t),s=r.find(a=>a.projectSlug===c);return s?{root:s.root}:null}function ye(e){if(e.project)return ae({project:e.project,path:e.path,wt:e.wt,line:e.line,endLine:e.endLine});const t=e.file??e.root;return t?O(t):"Deep link"}function Ne({snapshot:e,root:t,onSelect:n}){const[r,c]=h.useState(!1),[s,a]=h.useState(""),[l,u]=h.useState(0),[d,m]=h.useState(()=>M()),j=h.useRef(null),b=h.useRef(null),y=h.useRef(null),N=h.useId().replaceAll(":",""),P=`code-project-results-${N}`,x=h.useMemo(()=>he(e?.projects??[]),[e]),I=h.useMemo(()=>{const o=new Map;for(const f of x)o.set(f.root,f);return o},[x]),C=t?I.get(t)??null:null;h.useEffect(()=>{m(M())},[t,r]);const U=h.useMemo(()=>{const o=[];for(const f of d){const $=I.get(f);if($&&o.push($),o.length>=we)break}return o},[d,I]),w=ue(s),A=w?G(s):null,p=w?X(s,x,e):null,g=h.useMemo(()=>w?[]:ge(x,s,d,be),[x,s,d,w]),Z=(p?1:0)+g.length,S=h.useMemo(()=>{if(!s.trim()||w)return"";const o=g.find(f=>f.projectName.toLocaleLowerCase().startsWith(s.toLocaleLowerCase()));return o&&o.projectName.length>s.length?o.projectName:""},[s,g,w]);h.useEffect(()=>u(0),[s,r]),h.useEffect(()=>{if(!r)return;const o=window.setTimeout(()=>b.current?.focus(),20);return()=>window.clearTimeout(o)},[r]),h.useEffect(()=>{if(!r)return;function o(f){j.current?.contains(f.target)||(c(!1),a(""))}return document.addEventListener("pointerdown",o),()=>document.removeEventListener("pointerdown",o)},[r]);const E=()=>{a(""),c(!1),window.setTimeout(()=>y.current?.focus(),0)},T=o=>{n({root:o}),E()},F=()=>{p&&(n(p),E())},ee=o=>{if(o.key==="ArrowDown")o.preventDefault(),u(f=>Math.min(f+1,Math.max(Z-1,0)));else if(o.key==="ArrowUp")o.preventDefault(),u(f=>Math.max(f-1,0));else if(o.key==="Enter"){if(o.preventDefault(),p&&(l===0||g.length===0)){F();return}const f=p?l-1:l;g[f]&&T(g[f].root)}else o.key==="ArrowRight"&&S&&o.currentTarget.selectionStart===s.length?(o.preventDefault(),a(S)):o.key==="Escape"&&(o.preventDefault(),E())},te=C?Y(C):t?O(t):"Pick a project…",z=C?D(C):null,H=!!p&&l===0,re=p&&l===0?`${N}-deeplink`:g[p?l-1:l]?`${N}-opt-${g[p?l-1:l].root}`:void 0;return i.jsxs("div",{className:"s-code-picker",ref:j,children:[i.jsxs("button",{ref:y,type:"button",className:"s-code-pickerTrigger","aria-haspopup":"listbox","aria-expanded":r,"aria-controls":r?P:void 0,"aria-label":"Project or worktree",onClick:()=>c(o=>!o),children:[i.jsx("span",{className:"s-code-pickerTriggerName",children:te}),z?i.jsx("span",{className:"s-code-pickerTriggerDetail",children:z}):null,i.jsx(ne,{size:13,"aria-hidden":!0,className:"s-code-pickerChevron","data-open":r||void 0})]}),r?i.jsxs("div",{className:"s-code-pickerPanel",role:"dialog","aria-label":"Choose a project",children:[U.length>0&&!w?i.jsx("div",{className:"s-code-pickerRecents","aria-label":"Recent projects",children:U.map(o=>i.jsx("button",{type:"button",className:"s-code-pickerChip","data-active":o.root===t||void 0,title:`${o.projectName} · ${D(o)}
|
|
2
2
|
${o.root}`,onClick:()=>T(o.root),children:Y(o)},o.root))}):null,i.jsxs("div",{className:"s-code-pickerSearch",children:[i.jsx(oe,{size:13,"aria-hidden":!0,className:"s-code-pickerSearchIcon"}),i.jsxs("div",{className:"s-code-pickerInputStack",children:[S?i.jsxs("div",{className:"s-code-pickerGhost","aria-hidden":!0,children:[i.jsx("span",{children:s}),S.slice(s.length)]}):null,i.jsx("input",{ref:b,className:"s-code-pickerInput",type:"search",role:"combobox",value:s,onChange:o=>a(o.currentTarget.value),onKeyDown:ee,placeholder:"Project, scout:// path, or branch…","aria-label":"Find a project","aria-autocomplete":"both","aria-expanded":"true","aria-controls":P,"aria-activedescendant":re,autoComplete:"off",spellCheck:!1})]}),S?i.jsx("kbd",{className:"s-code-pickerHint",children:"→"}):null]}),i.jsxs("div",{className:"s-code-pickerHeading",children:[i.jsx("span",{children:w?p?"Deep link":"Unrecognized link":s.trim()?g.length?"Matches":"No matches":"All projects"}),i.jsx("span",{children:w?p?"open with ↵":"no match":s.trim()?`${g.length} shown`:x.length?`${Math.min(g.length,x.length)} of ${x.length}`:e?"No repos yet":"Loading…"})]}),i.jsxs("div",{id:P,className:"s-code-pickerResults",role:"listbox","aria-label":"Projects",children:[p?i.jsxs("button",{id:`${N}-deeplink`,type:"button",role:"option","aria-selected":H,tabIndex:-1,className:"s-code-pickerOption s-code-pickerOption--deep","data-active":H||void 0,onMouseEnter:()=>u(0),onClick:F,children:[i.jsx("span",{className:"s-code-pickerOptionMain",children:i.jsx("strong",{children:"Open deep link"})}),i.jsx("span",{className:"s-code-pickerOptionPath",title:s.trim(),children:A?ye(A):s.trim()}),i.jsxs("span",{className:"s-code-pickerOptionMeta",children:[O(p.root),p.file?` · ${W(p.file)}`:""]})]}):null,g.map((o,f)=>{const $=p?f+1:f,J=$===l,K=o.root===t;return i.jsxs("button",{id:`${N}-opt-${o.root}`,type:"button",role:"option","aria-selected":J,"aria-current":K||void 0,tabIndex:-1,className:"s-code-pickerOption","data-active":J||void 0,"data-selected":K||void 0,onMouseEnter:()=>u($),onClick:()=>T(o.root),children:[i.jsxs("span",{className:"s-code-pickerOptionMain",children:[i.jsx("strong",{children:o.projectName}),o.isPrimary?null:i.jsx("span",{className:"s-code-pickerWorktree",children:"worktree"})]}),i.jsx("span",{className:"s-code-pickerOptionPath",title:o.root,children:O(o.root)}),i.jsx("span",{className:"s-code-pickerOptionMeta",children:D(o)})]},o.root)})]}),g.length===0&&s.trim()&&!p?i.jsx("div",{className:"s-code-pickerEmpty",role:"status",children:w?"Could not resolve that scout:// link. Try a project slug or absolute path.":`No project matches “${s}”. Try a folder name, branch, path, or scout:// link.`}):null,i.jsxs("div",{className:"s-code-pickerGuide",children:[i.jsxs("span",{children:[i.jsx("kbd",{children:"↑"}),i.jsx("kbd",{children:"↓"})," move"]}),i.jsxs("span",{children:[i.jsx("kbd",{children:"↵"})," open"]}),i.jsxs("span",{children:[i.jsx("kbd",{children:"esc"})," close"]})]})]}):null]})}const Ie=Object.freeze(Object.defineProperty({__proto__:null,CodeProjectPicker:Ne,resolvePickerDeepLink:X},Symbol.toStringTag,{value:"Module"}));export{Ne as C,Ce as a,Pe as b,Ie as c,ae as f,Oe as r,O as s,Re as w};
|