@openscout/scout 0.2.86 → 0.2.90
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 +10 -5
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +4 -4
- package/dist/client/assets/ActivityScreen-BUeb4ERK.js +1 -0
- package/dist/client/assets/{AddProjectForm-BNRpRPod.js → AddProjectForm-DtTfn4Zk.js} +1 -1
- package/dist/client/assets/AgentAvatar-CneOa70z.js +1 -0
- package/dist/client/assets/AgentConfigurationScreen-CkZ7EjZh.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-0Y3kqMtv.js +1 -0
- package/dist/client/assets/{AgentDetailCard-FelCxQrT.js → AgentDetailCard-Dtc02KUO.js} +1 -1
- package/dist/client/assets/AgentFloorView-B5raPB_U.js +1 -0
- package/dist/client/assets/AgentInfoScreen-DFG4ElZD.js +1 -0
- package/dist/client/assets/{AgentLaneCard-CRDG74C1.js → AgentLaneCard-BRAkw8YJ.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-CWFqUdch.js → AgentLaneChrome-T8QE5742.js} +1 -1
- package/dist/client/assets/AgentLaneDetailSheet-C8RYotnv.js +4 -0
- package/dist/client/assets/{AgentLaneSummaryResize-yTM4GQAJ.js → AgentLaneSummaryResize-FyYweLo_.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-Br7cmZVO.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-DJeDRTAN.js → AgentLanesPreflight-Cil3dNwu.js} +1 -1
- package/dist/client/assets/AgentLanesView-DPfO8MOo.js +2 -0
- package/dist/client/assets/{AgentLiveActions-Bn3zeZBN.js → AgentLiveActions-DwScaVRF.js} +1 -1
- package/dist/client/assets/AgentSessions-DKoWA0Lm.js +6 -0
- package/dist/client/assets/AgentsConsole-DoBIWGoq.js +1 -0
- package/dist/client/assets/AgentsScreen-JuUiSuwY.js +1 -0
- package/dist/client/assets/AgentsSubnav-BV0WAgzf.js +1 -0
- package/dist/client/assets/{AtopView-DymBCiXv.js → AtopView-ycxMrRwp.js} +1 -1
- package/dist/client/assets/BackToPicker-D6WgIDb-.js +1 -0
- package/dist/client/assets/BriefingDetailScreen-Zw-taW1s.js +6 -0
- package/dist/client/assets/{BriefingsScreen-CLvSOJjy.js → BriefingsScreen-BerYOoWS.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-DFAH-NO6.js → BrokerMetadataPanel-Cu93j-Ga.js} +1 -1
- package/dist/client/assets/BrokerScreen-CeN90URH.js +5 -0
- package/dist/client/assets/ChatCollapsedStrip-DdKyMSEM.js +1 -0
- package/dist/client/assets/{CodeDiffPane-C9HT1dCT.js → CodeDiffPane-BjCOBLze.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-5Y3GvXkM.js → CodeProjectPicker-NSGdCaK0.js} +1 -1
- package/dist/client/assets/{CodeScreen-DpN9kQvm.js → CodeScreen-CA9Sq6Dx.js} +1 -1
- package/dist/client/assets/ContextMenu-DnFcmfMR.js +1 -0
- package/dist/client/assets/ConversationComposer-CjRXFkvY.js +1 -0
- package/dist/client/assets/ConversationFeedRows-CgRTIpAv.js +1 -0
- package/dist/client/assets/ConversationHeader-CRmdtuL7.js +1 -0
- package/dist/client/assets/ConversationPanels-DCkcLIHk.js +2 -0
- package/dist/client/assets/ConversationScreen-Br0QQ3xo.js +1 -0
- package/dist/client/assets/ConversationScreen-yIKEsm-8.css +1 -0
- package/dist/client/assets/ConversationStatus-BJ1CMbAv.js +1 -0
- package/dist/client/assets/{DataTable-oJP339bX.js → DataTable-Dzqiaha4.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-CH02HAVw.js → DispatchAftermath-B0WMg_z3.js} +1 -1
- package/dist/client/assets/DocumentFocusViewer-CZVVIAD5.js +1 -0
- package/dist/client/assets/{EmbeddableSurfacesLab-84b9I3fy.js → EmbeddableSurfacesLab-C3a7hJWO.js} +1 -1
- package/dist/client/assets/{EmptyState-BnDda92b.js → EmptyState-CYNJZMrZ.js} +1 -1
- package/dist/client/assets/{FileViewerPane-Dg7_88pv.js → FileViewerPane-Fwt8_KmD.js} +1 -1
- package/dist/client/assets/FleetSearch-Dsi_l2KW.js +1 -0
- package/dist/client/assets/FleetSearch-EXOe8ulE.css +1 -0
- package/dist/client/assets/FlightObserveScreen-g_tiGmvz.js +1 -0
- package/dist/client/assets/{FollowScreen-DcFBqr6l.js → FollowScreen-Bb_rcrzi.js} +1 -1
- package/dist/client/assets/{HarnessMark-DGZ6o6Ct.js → HarnessMark-DrE57dUq.js} +1 -1
- package/dist/client/assets/HarnessesScreen-CAsCJ_tG.js +1 -0
- package/dist/client/assets/{HerdrSession-DV2hD6Yh.js → HerdrSession-1eVu9Owj.js} +1 -1
- package/dist/client/assets/HomeHero-DEl-WBsT.css +1 -0
- package/dist/client/assets/HomeHero-W445QrG1.js +1 -0
- package/dist/client/assets/{KnowledgeSearchInspector-DNQjeWZO.js → KnowledgeSearchInspector-CbPVg3fr.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-C1lN1xJk.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-197xYmRp.js → LaneToolHoverCard-BkBcDYm-.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-CzTd44rf.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-C9cmqxnK.js → LaneTraceEventFocus-BmMmPTyJ.js} +1 -1
- package/dist/client/assets/{MeshCanvas-C3_2p9B6.js → MeshCanvas-DwkjsiJ5.js} +2 -2
- package/dist/client/assets/{MeshCanvasMinimap-ZTjYWXTZ.js → MeshCanvasMinimap-vmCpU1sD.js} +1 -1
- package/dist/client/assets/MeshScreen-CkMepUpT.js +1 -0
- package/dist/client/assets/{MeshTopologyView-CBjHbAZw.js → MeshTopologyView-BD2xLE2C.js} +2 -2
- package/dist/client/assets/MessageComposerSuggestions-qbalTne_.js +1 -0
- package/dist/client/assets/MessagesScreen-C8UynyLC.js +1 -0
- package/dist/client/assets/{MissionContextRail-DXkrbcnZ.js → MissionContextRail-D5MEP2f4.js} +1 -1
- package/dist/client/assets/MissionControlView-K_I7eftL.js +1 -0
- package/dist/client/assets/MissionFocusOverlay-CWKLdUKG.js +1 -0
- package/dist/client/assets/MissionLeftAgentRow-ByGrNAcs.js +1 -0
- package/dist/client/assets/MissionLogPane-ZwHJ137T.js +1 -0
- package/dist/client/assets/{NewAgentModal-C18Ajovd.js → NewAgentModal-Do9aVvan.js} +1 -1
- package/dist/client/assets/NewChatComposer-DKlNX1UA.js +19 -0
- package/dist/client/assets/{NewChatOrigin-DpHS2Wmt.js → NewChatOrigin-DXPvX-hh.js} +1 -1
- package/dist/client/assets/ObserveEmbedScreen-Dghsq2on.js +2 -0
- package/dist/client/assets/ObserveTextFlow-DWNlmTVm.js +2 -0
- package/dist/client/assets/ObservedTopologyPanel-BlmGoxCE.js +2 -0
- package/dist/client/assets/OpenScoutAppShell-DDqQi-oe.js +87 -0
- package/dist/client/assets/OpsAgentsView-Bn_fGBdo.js +1 -0
- package/dist/client/assets/OpsScreen-DHnT-Q9R.js +1 -0
- package/dist/client/assets/OpsSubnav-CJRD7MjM.js +1 -0
- package/dist/client/assets/PlanView-B6gKo543.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-Be1VOkI4.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-IDEpKZvI.js → ProjectAgentProfileBar-C5QWwZCn.js} +1 -1
- package/dist/client/assets/ProjectAgentProfileHero-DC7Dd8VL.js +1 -0
- package/dist/client/assets/ProjectsInbox-DCLrDmj1.js +2 -0
- package/dist/client/assets/ProjectsRail-C4hiXYSb.js +1 -0
- package/dist/client/assets/ProjectsScreen-jruZRjgD.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-DYmL2dCY.js +1 -0
- package/dist/client/assets/Provider-p-xuaAoE.js +1 -0
- package/dist/client/assets/RailRow-Cf9LOiEj.css +1 -0
- package/dist/client/assets/RailRow-bRkkXIpR.js +1 -0
- package/dist/client/assets/RawSessionsTable-B7WKmXrk.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-BzP3BQq9.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-C97Euf4s.js → RepoDiffEmbedScreen-xjzjcJ_c.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-DUKLzkrW.js → RepoDiffPageScreen-DRzIY-dk.js} +1 -1
- package/dist/client/assets/RepoDiffViewer-CNDp01KM.js +7 -0
- package/dist/client/assets/RepoDiffViewerLazy-b6vjYxez.js +2 -0
- package/dist/client/assets/{ReposScreen-BR1LqTf1.js → ReposScreen-CpaLC_NU.js} +6 -6
- package/dist/client/assets/ScoutDeckSurface-DkpZ-0DH.js +1 -0
- package/dist/client/assets/{ScoutSurface-BMKW7hSu.js → ScoutSurface-BENBUt5-.js} +1 -1
- package/dist/client/assets/ScoutbotBroadcastChip-CGZyxS5H.js +2 -0
- package/dist/client/assets/{agent-autocomplete-C7xwIcwd.css → ScoutbotBroadcastChip-CxtYZWPZ.css} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-0O2iDRrF.js → ScoutbotFxLab-Bk2ZsfPp.js} +1 -1
- package/dist/client/assets/ScoutbotRealtimeVoiceCall-n63LdBZs.js +1 -0
- package/dist/client/assets/{SecondaryNav-cYTw2p39.js → SecondaryNav-B4IsujYh.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-mNjT0R6j.js → SessionEmbedScreen-CPfH-jqN.js} +1 -1
- package/dist/client/assets/{SessionObserve-zAlFbwFn.js → SessionObserve-B-SkP3tu.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-BVawzqoE.js → SessionObserveEvidence-CF5jnH3-.js} +1 -1
- package/dist/client/assets/SessionRefScreen-C-4jjmVG.js +1 -0
- package/dist/client/assets/SessionsScreen-HAjFvmIq.js +1 -0
- package/dist/client/assets/SettingsDrawer-DATxwZrn.js +3 -0
- package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +1 -0
- package/dist/client/assets/SettingsScreen-Bu53X7J_.js +1 -0
- package/dist/client/assets/{ShikiPane-DyEJdcvb.js → ShikiPane-DH8yYDks.js} +1 -1
- package/dist/client/assets/{SlidePanel-Dg8_styW.js → SlidePanel-RFXJpfUa.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-DMrSssNZ.js → SpriteAvatar-CEYdCzem.js} +1 -1
- package/dist/client/assets/{StatusPill-NFFnphtx.js → StatusPill-9uy70ttd.js} +1 -1
- package/dist/client/assets/{TailView-BfObcZu3.js → TailView-6bIrgdxN.js} +2 -2
- package/dist/client/assets/Terminal-BI6km7H4.js +1 -0
- package/dist/client/assets/TerminalEmbedScreen-D4JOWwtm.js +1 -0
- package/dist/client/assets/{TextDocumentSurface-C7fGlzY8.js → TextDocumentSurface-BcP9vvji.js} +1 -1
- package/dist/client/assets/{TmuxPeek-BSeKIjnX.js → TmuxPeek-IaWqCgyJ.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-BkIGTzgw.js → VoicePermissionsPanel-C80iZxgy.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-Cwe-KWK4.js → WorkDetailScreen-CweZ6fEd.js} +3 -3
- package/dist/client/assets/WorkFilesViewer-Dy_-06iI.js +1 -0
- package/dist/client/assets/{activity-D4W2XZY2.js → activity-DS0u0Itf.js} +1 -1
- package/dist/client/assets/{addon-fit-Celjj2yn.js → addon-fit-CN888B3D.js} +1 -1
- package/dist/client/assets/{addon-webgl-Cu4tJ21-.js → addon-webgl-CoAnanQS.js} +1 -1
- package/dist/client/assets/{agent-essentials-CngjUhQj.js → agent-essentials-CuK4G_zS.js} +1 -1
- package/dist/client/assets/agent-identity-BxCsXnDp.js +1 -0
- package/dist/client/assets/{agent-lane-card-model-CSugZCdy.js → agent-lane-card-model-q4cwzLX4.js} +1 -1
- package/dist/client/assets/{agent-lane-detail-D5EIlX7_.js → agent-lane-detail-BNNm6FNu.js} +1 -1
- package/dist/client/assets/{agent-lane-preview-BhplDYGf.js → agent-lane-preview-C33Dwpn7.js} +1 -1
- package/dist/client/assets/{agent-lanes-DlqcEf0l.css → agent-lanes-BDNktFBZ.css} +1 -1
- package/dist/client/assets/{agent-lanes-model-BKOs_32K.js → agent-lanes-model-VYQ5a68i.js} +2 -2
- package/dist/client/assets/{api-BHHEUSS3.js → api-BkjHJfgJ.js} +1 -1
- package/dist/client/assets/api-h5zurxmi.js +1 -0
- package/dist/client/assets/{arc.es-DNT50Y-_.js → arc.es-BET9ev6q.js} +1 -1
- package/dist/client/assets/arrow-down-DxxPnPwh.js +1 -0
- package/dist/client/assets/{arrow-left-i-h6JAgs.js → arrow-left-CXDkJuCg.js} +1 -1
- package/dist/client/assets/{arrow-up-right-RBC6k8nn.js → arrow-up-right-Bj8RjSqW.js} +1 -1
- package/dist/client/assets/{bot-r2IuAuJd.js → bot-BSGSicKC.js} +1 -1
- package/dist/client/assets/broker-display-pp33bLsu.js +2 -0
- package/dist/client/assets/{cache-BO2Bd_LV.js → cache-Dr0why2k.js} +1 -1
- package/dist/client/assets/{check-Bfs7hMb1.js → check-BfA0T8UD.js} +1 -1
- package/dist/client/assets/{chevron-down-Da5tV19_.js → chevron-down-BVg09D6U.js} +1 -1
- package/dist/client/assets/{chevron-right-BMqtBds_.js → chevron-right-CaEwYkxE.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-BUVYXXAp.js → chunk-HRAB3GC3-HhKwnZCi.js} +1 -1
- package/dist/client/assets/chunk-JTPDIGGW-DX2eTIQ_.js +46 -0
- package/dist/client/assets/chunk-T65CQEWV-D-bOfuCH.js +1 -0
- package/dist/client/assets/chunk-YOZR3KYS-oS9dlQCI.js +2 -0
- package/dist/client/assets/{clock-DaKLp6Xd.js → clock-C3TUL7D7.js} +1 -1
- package/dist/client/assets/{code-xml-ByQsfOI_.js → code-xml-Dbvjk9Kw.js} +1 -1
- package/dist/client/assets/collapsed-strip-Dz-of2SM.css +1 -0
- package/dist/client/assets/content-BQuEedeL.js +1 -0
- package/dist/client/assets/content-BUae-L_N.js +1 -0
- package/dist/client/assets/content-BfG98J1k.js +1 -0
- package/dist/client/assets/content-BkVTfkAC.js +1 -0
- package/dist/client/assets/content-BsNMos_d.js +1 -0
- package/dist/client/assets/content-C2TZOKSE.js +1 -0
- package/dist/client/assets/content-CCn98eSk.js +1 -0
- package/dist/client/assets/content-CJuH5cDP.js +1 -0
- package/dist/client/assets/content-CYnPp9yo.js +1 -0
- package/dist/client/assets/content-CcrUhm4P.js +1 -0
- package/dist/client/assets/content-CiOMtgQc.js +1 -0
- package/dist/client/assets/content-CxuVONeQ.js +1 -0
- package/dist/client/assets/content-Dmq9n1_L.js +1 -0
- package/dist/client/assets/content-DskHP2NI.js +1 -0
- package/dist/client/assets/content-DvvzL2HK.js +1 -0
- package/dist/client/assets/content-snCAUbwv.js +1 -0
- package/dist/client/assets/{conversation-icons-C4amK8Sa.js → conversation-icons-DmC_Ak3z.js} +1 -1
- package/dist/client/assets/conversation-model-CHwHZNw-.js +1 -0
- package/dist/client/assets/conversation-motion-features-DPiGTO21.js +1 -0
- package/dist/client/assets/{copy-De4s38o2.js → copy-C79v_7D-.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DLlxGjKt.js → createLucideIcon-DCq_3fQn.js} +1 -1
- package/dist/client/assets/ctx-panel-B4s49N9e.css +1 -0
- package/dist/client/assets/discover-IEnbrH8_.js +2 -0
- package/dist/client/assets/embed-entry-XUPb-AzL.js +2 -0
- package/dist/client/assets/{external-link-BGHC_naA.js → external-link-Dd8xaveL.js} +1 -1
- package/dist/client/assets/{eye-BeCSqJn1.js → eye-DkU59kfl.js} +1 -1
- package/dist/client/assets/{file-text-BVhkMWyC.js → file-text-BITQqGtF.js} +1 -1
- package/dist/client/assets/gestures-B5rLNRpi.js +1 -0
- package/dist/client/assets/home-moving-signal-Bs635mVw.js +1 -0
- package/dist/client/assets/home-moving-signal-CAa0V91u.css +1 -0
- package/dist/client/assets/home-now-card-VxlLjg1A.js +1 -0
- package/dist/client/assets/{home-now-card-nano-Djhy6ax0.js → home-now-card-nano-C06GMiwD.js} +1 -1
- package/dist/client/assets/hooks-BWiLxTw1.js +2 -0
- package/dist/client/assets/index-9as_JTUs.css +1 -0
- package/dist/client/assets/index-BTj2MguM.js +1 -0
- package/dist/client/assets/index-BZovGpDk.js +10 -0
- package/dist/client/assets/index-CvF09yvf.css +1 -0
- package/dist/client/assets/index-DiiEQwdc.js +1 -0
- package/dist/client/assets/index-vbaJ8sin.js +1 -0
- package/dist/client/assets/inspector-panel-C96HcyK5.js +2 -0
- package/dist/client/assets/{keyboard-nav-7iEtvu9P.js → keyboard-nav-CHo_xmjw.js} +1 -1
- package/dist/client/assets/{lane-observe-vfyACHi0.js → lane-observe-BA3g9aVd.js} +1 -1
- package/dist/client/assets/{lane-roster-store-pHT3TAVs.js → lane-roster-store-B6ybJlHJ.js} +1 -1
- package/dist/client/assets/left-Bk3XnxPD.css +1 -0
- package/dist/client/assets/left-BuJ0wJW1.js +2 -0
- package/dist/client/assets/left-C6Zj3cR4.js +1 -0
- package/dist/client/assets/left-CCoobxPS.css +1 -0
- package/dist/client/assets/left-COMAiMfB.js +2 -0
- package/dist/client/assets/left-Ce4WKYPK.js +1 -0
- package/dist/client/assets/left-DMJkmJOF.js +1 -0
- package/dist/client/assets/left-DrCbY6ja.js +1 -0
- package/dist/client/assets/left-agents-BuSyVNGE.js +1 -0
- package/dist/client/assets/left-default-DRHywOKX.js +1 -0
- package/dist/client/assets/left-l92tw5Kc.js +1 -0
- package/dist/client/assets/left-lanes-4-aUyyrV.js +1 -0
- package/dist/client/assets/left-mission-e849d_Td.js +1 -0
- package/dist/client/assets/left-plan-MchYwAB_.js +2 -0
- package/dist/client/assets/library-DygjpA6u.js +1 -0
- package/dist/client/assets/{loader-circle-DoT8gpw6.js → loader-circle-B-l2Wj3-.js} +1 -1
- package/dist/client/assets/{local-agents-BMadXuP1.js → local-agents-Wof5knTJ.js} +1 -1
- package/dist/client/assets/{mentions-Cd6XticV.js → mentions-BjXfeF7t.js} +1 -1
- package/dist/client/assets/{mesh-ops-C0zCLTR8.js → mesh-ops-C1gq8zKf.js} +1 -1
- package/dist/client/assets/{mesh-view-store-Cpqil_2D.js → mesh-view-store-B56D3f77.js} +1 -1
- package/dist/client/assets/{message-circle-44KSmbvQ.js → message-circle-BwVx5X0q.js} +1 -1
- package/dist/client/assets/{message-markup-DAnnGpWr.js → message-markup-DlVX-iuc.js} +1 -1
- package/dist/client/assets/{message-square-DlY4EneU.js → message-square-BnkG6tae.js} +1 -1
- package/dist/client/assets/mission-control-m3BTDQ9l.css +1 -0
- package/dist/client/assets/{mission-control-store-DtjtRs9Z.js → mission-control-store-CMgIVjLJ.js} +1 -1
- package/dist/client/assets/model-Co0zkMIc.js +1 -0
- package/dist/client/assets/{observe-DL5_8-Zj.js → observe-DVHAcIrv.js} +1 -1
- package/dist/client/assets/{operator-attention-BqoWAlhp.js → operator-attention-BwSPeheT.js} +1 -1
- package/dist/client/assets/{page-status-CW8co39E.js → page-status-Bg2hd27j.js} +1 -1
- package/dist/client/assets/paperclip-DblaLD_N.js +1 -0
- package/dist/client/assets/plan-view-D56fneVF.css +1 -0
- package/dist/client/assets/{plus-64n9qucr.js → plus-BAI0t5g9.js} +1 -1
- package/dist/client/assets/profile-3Q4sUtvJ.js +1 -0
- package/dist/client/assets/projects-inbox-Da2hYEn6.js +1 -0
- package/dist/client/assets/{radio-BjpQTKT0.js → radio-BGtkyCG9.js} +1 -1
- package/dist/client/assets/{refresh-cw-IgN2fZLM.js → refresh-cw-DtF8xPqX.js} +1 -1
- package/dist/client/assets/resolve-panes-D4tlKNCT.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-B27lj3Ci.js +1 -0
- package/dist/client/assets/right-B8qg3JdB.js +1 -0
- package/dist/client/assets/{right-B96CBzrV.js → right-BU_W1kSH.js} +1 -1
- package/dist/client/assets/right-BlR7h0US.js +1 -0
- package/dist/client/assets/right-BwgwTGGd.js +1 -0
- package/dist/client/assets/right-ByptvkVX.js +1 -0
- package/dist/client/assets/right-CUP-NIDG.js +1 -0
- package/dist/client/assets/right-Ch_jrNe2.js +1 -0
- package/dist/client/assets/right-Dd2DscRz.js +1 -0
- package/dist/client/assets/right-DmVHd8Xj.js +1 -0
- package/dist/client/assets/{right-DqiVyo8v.js → right-c4PAdFYZ.js} +1 -1
- package/dist/client/assets/{rocket-DnmN_YOD.js → rocket-BWh18pt_.js} +1 -1
- package/dist/client/assets/router-63XV_E7f.js +1 -0
- package/dist/client/assets/{text-BR9Bap0E.js → runtime-picker-BXKJbLot.js} +1 -1
- package/dist/client/assets/runtime-picker-vhm0gtLs.css +1 -0
- package/dist/client/assets/{scope-views-Z8aoAmtU.js → scope-views-Dm2_-NPi.js} +1 -1
- package/dist/client/assets/scout-voice-D8Q5sZOL.js +1 -0
- package/dist/client/assets/{scoutbot-D4vuKzOL.js → scoutbot-BTIErYHo.js} +2 -2
- package/dist/client/assets/{scroll-text-DRidbcse.js → scroll-text-DZb3mmYo.js} +1 -1
- package/dist/client/assets/{search-BbgsEMXa.js → search-1QMVOxF3.js} +1 -1
- package/dist/client/assets/secondaryNavConfig-c0cz3MkJ.js +1 -0
- package/dist/client/assets/{selection-bridge-CpzFGx3-.js → selection-bridge-O9C4kGfF.js} +1 -1
- package/dist/client/assets/{send-horizontal-BXo2uz3Z.js → send-horizontal-DbyEkGql.js} +1 -1
- package/dist/client/assets/{server-Dt3tpiBj.js → server-Bncn9S7r.js} +1 -1
- package/dist/client/assets/{session-catalog-CUQ8LUJY.js → session-catalog-DC6BlBBC.js} +1 -1
- package/dist/client/assets/{session-table-B4JOKevn.js → session-table-BUPq9Viy.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-7V8B3xsf.js → sliders-horizontal-CMe8Bay1.js} +1 -1
- package/dist/client/assets/{sparkles-ytTwpCbZ.js → sparkles-_7cTZsIH.js} +1 -1
- package/dist/client/assets/{sse-CSozY6mp.js → sse-Bb0EOcU9.js} +1 -1
- package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +1 -0
- package/dist/client/assets/{tail-display-DcliDVkW.js → tail-display-BRcJltQa.js} +1 -1
- package/dist/client/assets/{tail-events-CrN-Rmxj.js → tail-events-C12pfUax.js} +1 -1
- package/dist/client/assets/{terminal-relay-pSm7_An6.js → terminal-relay-BgfVJXIL.js} +1 -1
- package/dist/client/assets/{terminal-sessions-D4dHTRkt.js → terminal-sessions-AmSgHklm.js} +1 -1
- package/dist/client/assets/{terminal-takeover-CtA3wcXh.js → terminal-takeover--05EYhJm.js} +1 -1
- package/dist/client/assets/{terminal-BiNIXhna.js → terminal-xGf_F3y7.js} +1 -1
- package/dist/client/assets/text-DsBWV_4k.js +1 -0
- package/dist/client/assets/{use-conversation-list-C0bEXFeH.js → use-conversation-list-DWX02INv.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-CK4aw-3G.js → use-fleet-active-asks-Cnwa4hTK.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-QixBijmT.js → use-mesh-ops-items-BRFm37oY.js} +1 -1
- package/dist/client/assets/use-reduced-motion-C8cWvIZ3.js +1 -0
- package/dist/client/assets/use-scout-dev-flags-FkMreOOb.js +1 -0
- package/dist/client/assets/{useAgentHoverCard-6N8b7qsU.js → useAgentHoverCard-DvPZSJK3.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-CNlrhvvx.js +1 -0
- package/dist/client/assets/{usePierreRuntime-Bq6mXrgd.js → usePierreRuntime-C8WJ0X3F.js} +1 -1
- package/dist/client/assets/{wrench-CQvdf7KT.js → wrench-_tHBGTop.js} +1 -1
- package/dist/client/assets/{x-BJyPzFnn.js → x-CrGUKNRv.js} +1 -1
- package/dist/client/assets/{xterm-D6dE_wMr.js → xterm-Ks-VlLTq.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/main.mjs +38 -169
- package/dist/node/main.mjs +240 -272
- package/dist/pairing-runtime-controller.mjs +476 -394
- package/dist/runtime/base-daemon.mjs +121 -49
- package/dist/runtime/broker-daemon.mjs +60 -171
- package/dist/runtime/broker-process-manager.mjs +0 -6
- package/dist/runtime/mesh-discover.mjs +0 -6
- package/dist/scout-control-plane-web.mjs +477 -672
- package/dist/scout-web-server.mjs +477 -672
- package/package.json +7 -6
- package/dist/client/assets/ActivityScreen-C7AwUogt.js +0 -1
- package/dist/client/assets/AgentAvatar-B1xvQ7ej.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-BoBQpyz5.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-rw3vh8Lm.js +0 -1
- package/dist/client/assets/AgentFloorView-Crdw8Uo5.js +0 -1
- package/dist/client/assets/AgentInfoScreen-Cge7HHbV.js +0 -1
- package/dist/client/assets/AgentLaneDetailSheet-DCIIg3Zp.js +0 -4
- package/dist/client/assets/AgentLanesEmbedScreen-BJLwXSNp.js +0 -1
- package/dist/client/assets/AgentLanesView-CbY9qD0z.js +0 -2
- package/dist/client/assets/AgentSessions-czl5zT7A.js +0 -6
- package/dist/client/assets/AgentsConsole-CoT2crwq.js +0 -1
- package/dist/client/assets/AgentsScreen-BcPM-z1T.js +0 -1
- package/dist/client/assets/AgentsSubnav-3_vpn2bT.js +0 -1
- package/dist/client/assets/AstronautSuit-BADl7m8x.js +0 -1
- package/dist/client/assets/BackToPicker-CqYhOaLB.js +0 -1
- package/dist/client/assets/BriefingDetailScreen-DDfZ8ci1.js +0 -1
- package/dist/client/assets/BrokerScreen-Bkvu92jk.js +0 -5
- package/dist/client/assets/Canvas-KyTsDJlB.js +0 -1
- package/dist/client/assets/ChatCollapsedStrip-Bjjqa30K.js +0 -1
- package/dist/client/assets/ConversationComposer-Ce7Byw48.js +0 -1
- package/dist/client/assets/ConversationFeedRows-DygDfQn_.js +0 -1
- package/dist/client/assets/ConversationHeader-C3sg0ULI.js +0 -1
- package/dist/client/assets/ConversationPanels-Dg4Y2GgX.js +0 -6
- package/dist/client/assets/ConversationScreen-BP5tdz2k.css +0 -1
- package/dist/client/assets/ConversationScreen-CjWWmuuh.js +0 -1
- package/dist/client/assets/ConversationStatus-BhVIYQza.js +0 -1
- package/dist/client/assets/CrewWorkspaces-B6YIyw1z.css +0 -1
- package/dist/client/assets/CrewWorkspaces-CDU-wy1Y.js +0 -1
- package/dist/client/assets/DocumentFocusViewer-DmtFisY9.js +0 -1
- package/dist/client/assets/FlightObserveScreen-DL3Xhl0h.js +0 -1
- package/dist/client/assets/HarnessesScreen-DTDL-XaA.js +0 -1
- package/dist/client/assets/HomeHero-7JwycwFY.css +0 -1
- package/dist/client/assets/HomeHero-CENwVZ45.js +0 -1
- package/dist/client/assets/HostAdvisorView-PgiZUkd_.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-Bj80IgR0.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-BztwvOv9.js +0 -1
- package/dist/client/assets/MeshScreen-lJKaOyGB.js +0 -1
- package/dist/client/assets/MessagesScreen-D6MVLvdg.js +0 -1
- package/dist/client/assets/MissionControlView-BCH-Zsp4.js +0 -1
- package/dist/client/assets/MissionFocusOverlay-DbAliOSF.js +0 -1
- package/dist/client/assets/MissionLeftAgentRow-Bx6Pg8_O.js +0 -1
- package/dist/client/assets/MissionLogPane-D06c29Y8.js +0 -1
- package/dist/client/assets/NewChatComposer-Bgqes0UQ.js +0 -19
- package/dist/client/assets/ObserveEmbedScreen-Cmhwai4X.js +0 -2
- package/dist/client/assets/ObserveTextFlow-C1f5oize.js +0 -2
- package/dist/client/assets/ObservedTopologyPanel-D85P6RAk.js +0 -2
- package/dist/client/assets/OpenScoutAppShell-IDI4fuUE.js +0 -88
- package/dist/client/assets/OpsAgentsView-yt0JavoB.js +0 -1
- package/dist/client/assets/OpsScreen-C3yNQqJE.js +0 -1
- package/dist/client/assets/OpsSubnav-BijKI3yG.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-DnIeC16r.js +0 -1
- package/dist/client/assets/ProjectAgentProfileHero-Bh_aISs-.js +0 -1
- package/dist/client/assets/ProjectsInbox-B8Srlklk.js +0 -2
- package/dist/client/assets/ProjectsRail-DqAbdvCf.js +0 -1
- package/dist/client/assets/ProjectsScreen-DKHQ2iEv.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-DpkjYLL2.js +0 -1
- package/dist/client/assets/Provider-Ve8yXaWR.js +0 -1
- package/dist/client/assets/RailRow-B0sRaJc6.css +0 -1
- package/dist/client/assets/RailRow-C4GNGR80.js +0 -1
- package/dist/client/assets/RawSessionsTable-Co3vzwsf.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-DMd1CBAf.js +0 -9
- package/dist/client/assets/RepoDiffViewer-CovKjSgb.js +0 -7
- package/dist/client/assets/RepoDiffViewerLazy-zIiEmh-e.js +0 -2
- package/dist/client/assets/ScoutDeckSurface-BGsVicc2.js +0 -1
- package/dist/client/assets/SessionRefScreen-BmKhf29o.js +0 -1
- package/dist/client/assets/SessionsScreen-CsSqjIY2.js +0 -1
- package/dist/client/assets/SettingsDrawer-Dsj-On_x.css +0 -1
- package/dist/client/assets/SettingsDrawer-DwYQTGi8.js +0 -3
- package/dist/client/assets/SettingsScreen-Btaku7YM.js +0 -1
- package/dist/client/assets/Terminal-Dr-M9U4u.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-BmyZkonh.js +0 -1
- package/dist/client/assets/TerminalRelay-lJ2KdMCW.js +0 -46
- package/dist/client/assets/WorkFilesViewer-BBtKRBPv.js +0 -1
- package/dist/client/assets/agent-autocomplete-Dv-_9dAw.js +0 -2
- package/dist/client/assets/agent-identity-DzHGhLdJ.js +0 -1
- package/dist/client/assets/agent-specialization-CNrsRbKA.js +0 -1
- package/dist/client/assets/api-DEHEgJ9m.js +0 -1
- package/dist/client/assets/archive-DH49QqFG.js +0 -1
- package/dist/client/assets/arrow-right-B0Yi01Zr.js +0 -1
- package/dist/client/assets/broker-display-Q75fupqG.js +0 -2
- package/dist/client/assets/collapsed-strip-raJWthAH.css +0 -1
- package/dist/client/assets/compass-BepM5iWH.js +0 -1
- package/dist/client/assets/content-5hnDC9WE.js +0 -1
- package/dist/client/assets/content-BRFZ-a6m.js +0 -1
- package/dist/client/assets/content-BYykncDo.js +0 -1
- package/dist/client/assets/content-Be6yyWbJ.js +0 -1
- package/dist/client/assets/content-Bgl_X3ao.js +0 -1
- package/dist/client/assets/content-BopJW1Zx.js +0 -1
- package/dist/client/assets/content-Bv2sfg0w.js +0 -1
- package/dist/client/assets/content-CMBiIZTg.js +0 -1
- package/dist/client/assets/content-CPVqvf5o.js +0 -1
- package/dist/client/assets/content-CbwyFqdI.js +0 -1
- package/dist/client/assets/content-ClQjAWYi.js +0 -1
- package/dist/client/assets/content-Cv2tSAbv.js +0 -1
- package/dist/client/assets/content-DFFe3-Ot.js +0 -1
- package/dist/client/assets/content-DY5hwBmm.js +0 -1
- package/dist/client/assets/content-_IXoxGno.js +0 -1
- package/dist/client/assets/content-j_tewJdE.js +0 -1
- package/dist/client/assets/conversation-model-CigSPlKA.js +0 -1
- package/dist/client/assets/conversation-motion-features-_95aZx_1.js +0 -1
- package/dist/client/assets/cpu-Bc268H9Q.js +0 -1
- package/dist/client/assets/credentials-qwds23lv.js +0 -1
- package/dist/client/assets/ctx-panel-D_HJ3nhb.css +0 -1
- package/dist/client/assets/discover-DOlk1hG7.js +0 -2
- package/dist/client/assets/embed-entry-BqDJfa87.js +0 -2
- package/dist/client/assets/file-code-corner-CX53Cd9y.js +0 -1
- package/dist/client/assets/gauge-CPcEPmNt.js +0 -1
- package/dist/client/assets/gestures-BXIGYk_p.js +0 -1
- package/dist/client/assets/git-branch-q8Ayc8py.js +0 -1
- package/dist/client/assets/home-moving-signal-DMguaRWR.css +0 -1
- package/dist/client/assets/home-moving-signal-Dm2Z2x0p.js +0 -1
- package/dist/client/assets/home-now-card-xU5LGP7q.js +0 -1
- package/dist/client/assets/hooks-CdKx1CxP.js +0 -2
- package/dist/client/assets/host-advisor-B2Fqs5Dd.css +0 -1
- package/dist/client/assets/index-Bli6bTLU.js +0 -10
- package/dist/client/assets/index-D7UEHxaY.js +0 -1
- package/dist/client/assets/index-DFdlQs_c.js +0 -1
- package/dist/client/assets/index-DhfOMK0D.js +0 -1
- package/dist/client/assets/index-DzlEgstl.css +0 -1
- package/dist/client/assets/index-wLwc74Pu.css +0 -1
- package/dist/client/assets/inspector-panel-B8pigRsg.js +0 -2
- package/dist/client/assets/layers-BiZA-Clc.js +0 -1
- package/dist/client/assets/layout-grid-DMpv9CZM.js +0 -1
- package/dist/client/assets/left-BayK4ocL.js +0 -1
- package/dist/client/assets/left-BhZhSrS2.js +0 -1
- package/dist/client/assets/left-BhgU6NOA.js +0 -1
- package/dist/client/assets/left-CY_FGnN7.js +0 -1
- package/dist/client/assets/left-Cq8mjamr.js +0 -1
- package/dist/client/assets/left-DH44V4I_.css +0 -1
- package/dist/client/assets/left-Dnqla0b5.js +0 -2
- package/dist/client/assets/left-Dy403II2.js +0 -2
- package/dist/client/assets/left-R2OOE7VG.css +0 -1
- package/dist/client/assets/left-advisor-oOAtJ9YE.js +0 -1
- package/dist/client/assets/left-agents-TIKe8vW8.js +0 -1
- package/dist/client/assets/left-default-owH0Lwxo.js +0 -1
- package/dist/client/assets/left-lanes-BE_co2lP.js +0 -1
- package/dist/client/assets/left-mission-C_nWUtfA.js +0 -1
- package/dist/client/assets/library-BSVrjn_m.js +0 -1
- package/dist/client/assets/mission-control-CnU7dNt1.css +0 -1
- package/dist/client/assets/persistent-state-DYjP8lqN.js +0 -1
- package/dist/client/assets/profile-BkmuseW7.js +0 -1
- package/dist/client/assets/projects-inbox-C0umZMSY.js +0 -1
- package/dist/client/assets/provider-CX9EWecp.js +0 -1
- package/dist/client/assets/proxy-C35W-YHZ.js +0 -1
- package/dist/client/assets/resolve-panes-CCqRkQdM.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-JkxY8qsV.js +0 -1
- package/dist/client/assets/right-B3PQUHd5.js +0 -1
- package/dist/client/assets/right-BPirlFC8.js +0 -1
- package/dist/client/assets/right-BUP2Ro_M.js +0 -1
- package/dist/client/assets/right-BVWYPIFX.js +0 -1
- package/dist/client/assets/right-BoAJxwA3.js +0 -1
- package/dist/client/assets/right-C2aOC2li.js +0 -1
- package/dist/client/assets/right-CtPJjgOV.js +0 -1
- package/dist/client/assets/right-SfSu0zHC.js +0 -1
- package/dist/client/assets/router-B0YclXYg.js +0 -1
- package/dist/client/assets/scout-voice-DvG_3stJ.js +0 -1
- package/dist/client/assets/scoutbot-markdown-BJJyaPu2.js +0 -6
- package/dist/client/assets/secondaryNavConfig-DyC_P9Wx.js +0 -1
- package/dist/client/assets/settings-BzWCF3NF.js +0 -1
- package/dist/client/assets/system-surfaces-redesign-QVXNeGYw.css +0 -1
- package/dist/client/assets/text-rLpBg4_z.css +0 -1
- package/dist/client/assets/use-reduced-motion-BLn59zLn.js +0 -1
- package/dist/client/assets/use-scout-dev-flags-JKb1EhFh.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-D-hVKzM9.js +0 -1
- package/dist/client/assets/usePersistentState-DOEahRlt.js +0 -1
- package/dist/client/assets/zap-rw7uwZht.js +0 -1
- /package/dist/client/assets/{DocumentFocusViewer-BSC_JwVE.css → document-focus-viewer-BSC_JwVE.css} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,r as n}from"./index-Bli6bTLU.js";import{k as it,w as qn,l as Bt,m as bs,o as Dn,q as Bn,s as Un,t as xs,u as Hn,v as Wn,x as _n,y as Qn}from"./NewChatComposer-Bgqes0UQ.js";import{a as _}from"./api-DEHEgJ9m.js";import"./text-BR9Bap0E.js";import{u as Kn,C as Vn}from"./ConversationComposer-Ce7Byw48.js";import"./index-DFdlQs_c.js";import{u as zn,d as Gn,a as Jn}from"./Provider-Ve8yXaWR.js";import{h as Yn,j as Xn,v as te,y as Ts,z as Zn,A as be,B as ea,D as ta,E as sa,F as na,c as vs,S as ks,G as aa,H as ra,I as oa,J as ia,K as la,L as ca,M as da,k as ua,N as ma,O as ha,q as pa,s as ga,r as Cs,P as fa,Q as ya,R as wa,T as Sa,l as ba,U as xa,V as Ta,W as Ms,X as va,Y as ka,Z as lt,g as Ca,_ as Ma,$ as Na,a0 as Ns,a1 as Ia,a2 as Aa,a3 as ja,a4 as Ra,a5 as Is,a6 as Ea,a7 as As,a8 as La,a9 as Pa,aa as $a}from"./conversation-model-CigSPlKA.js";import{u as Fa}from"./sse-CSozY6mp.js";import{t as Ut,n as js,f as Rs}from"./time-Dhsh_2EG.js";import{M as Oa}from"./message-markup-DAnnGpWr.js";import{i as Ht}from"./message-visibility-kJM8XcSG.js";import{d as qa}from"./router-B0YclXYg.js";import{f as Da}from"./scoutbot-D4vuKzOL.js";import{s as Ba}from"./sessionRead-CvFz2RHv.js";import{o as ct}from"./openContent-C6XO6kr5.js";import{c as Be}from"./clipboard-e3fSpeo7.js";import{A as Wt}from"./AgentAvatar-B1xvQ7ej.js";import{d as Ua}from"./types-B0PlfpKc.js";/* empty css */import{ConversationHeader as Ha,ConversationIdentityRow as Wa,AddParticipantForm as _a}from"./ConversationHeader-C3sg0ULI.js";import{FanOutRow as Qa,ThreadDayDivider as Ka}from"./ConversationFeedRows-DygDfQn_.js";import{T as Va,t as Es,m as Ls,a as za,b as Ga,o as Ja,d as Ya,s as Xa,l as Za,c as er,e as tr,W as sr,f as nr,g as ar}from"./ConversationPanels-Dg4Y2GgX.js";import{u as rr}from"./tail-events-CrN-Rmxj.js";import{PinnedAskCard as or,ConversationStatusStrip as ir}from"./ConversationStatus-BhVIYQza.js";import"./HarnessMark-DGZ6o6Ct.js";import"./colors-BtO5_zlx.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./keyboard-nav-7iEtvu9P.js";import"./x-BJyPzFnn.js";import"./createLucideIcon-DLlxGjKt.js";import"./chevron-down-Da5tV19_.js";import"./search-BbgsEMXa.js";import"./loader-circle-DoT8gpw6.js";import"./file-text-BVhkMWyC.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./zap-rw7uwZht.js";import"./provider-CX9EWecp.js";import"./surface-activity-B1rgWB1i.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./index-BWHgHrtv.js";import"./mentions-Cd6XticV.js";import"./AgentDetailCard-FelCxQrT.js";import"./AgentLiveActions-Bn3zeZBN.js";import"./terminal-takeover-CtA3wcXh.js";import"./eye-BeCSqJn1.js";import"./terminal-BiNIXhna.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./SpriteAvatar-DMrSssNZ.js";import"./agent-identity-DzHGhLdJ.js";import"./BackToPicker-CqYhOaLB.js";import"./AstronautSuit-BADl7m8x.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-BLn59zLn.js";import"./proxy-C35W-YHZ.js";import"./activity-D4W2XZY2.js";import"./message-circle-44KSmbvQ.js";import"./check-Bfs7hMb1.js";import"./sparkles-ytTwpCbZ.js";const lr=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)(?:$|[?#])/iu,cr=/\bhttps?:\/\/[^\s<>"')\]]+/giu;function Ue(o){if(typeof o!="string")return null;try{const c=new URL(o.trim());return c.protocol==="http:"||c.protocol==="https:"?c.toString():null}catch{return null}}function K(o,c){const h=o?.[c];return typeof h=="string"&&h.trim()?h.trim():null}function dr(o){return o.mediaType.toLowerCase().startsWith("image/")}function ur(o){return lr.test(o)}function mr(o){try{const c=new URL(o),h=[c.pathname==="/"?"":c.pathname,c.search].join("").trim();return{host:c.hostname.replace(/^www\./iu,""),detail:h||c.hostname}}catch{return{host:o,detail:o}}}function hr(o){const c=new Set,h=[];for(const w of o.matchAll(cr)){const S=w[0]?.replace(/[.,;:!?]+$/u,""),F=Ue(S);!F||c.has(F)||(c.add(F),h.push(F))}return h}const pr=/^\/api\/blobs\/[^/]+$/u;function _t(o){try{const c=new URL(o);return pr.test(c.pathname)?`${c.pathname}${c.search}`:o}catch{return o}}function dt(o){return Ue(o.url)??Ue(K(o.metadata,"url"))??Ue(K(o.metadata,"href"))}function gr(o){const c=o.metadata??null,h=K(c,"kind")??K(c,"type"),w=dt(o);if(!w||h!=="link_preview"&&h!=="link-preview"&&o.mediaType!=="text/x-uri")return null;const S=mr(w);return{id:o.id,url:w,title:K(c,"title")??S.host,description:K(c,"description"),imageUrl:Ue(K(c,"imageUrl")??K(c,"image")),siteName:K(c,"siteName")??S.host}}function fr({src:o,alt:c}){const[h,w]=n.useState(!1);return h?r.jsxs("a",{className:"s-message-embed s-message-embed--file",href:o,target:"_blank",rel:"noreferrer",children:[r.jsx("span",{className:"s-message-embed-title",children:c}),r.jsx("span",{className:"s-message-embed-description",children:"Preview unavailable"})]}):r.jsx("a",{className:"s-message-embed s-message-embed--image",href:o,target:"_blank",rel:"noreferrer",children:r.jsx("img",{src:o,alt:c,loading:"lazy",decoding:"async",onError:()=>w(!0)})})}function yr({preview:o}){return r.jsxs("a",{className:"s-message-embed s-message-embed--link",href:o.url,target:"_blank",rel:"noreferrer",children:[o.imageUrl&&r.jsx("span",{className:"s-message-embed-thumb",children:r.jsx("img",{src:o.imageUrl,alt:"",loading:"lazy",decoding:"async"})}),r.jsxs("span",{className:"s-message-embed-copy",children:[o.siteName&&r.jsx("span",{className:"s-message-embed-site",children:o.siteName}),r.jsx("span",{className:"s-message-embed-title",children:o.title}),o.description&&r.jsx("span",{className:"s-message-embed-description",children:o.description})]})]})}function wr({message:o}){const c=o.attachments??[],h=new Set,w=[],S=[];for(const u of c){const L=dt(u);if(L&&dr(u)){h.add(u.id),w.push({id:u.id,src:_t(L),alt:u.fileName??"Image attachment"});continue}const b=gr(u);b&&(h.add(u.id),S.push(b))}const F=new Set(S.map(u=>u.url)),z=new Set(c.map(dt).filter(u=>!!u));for(const u of hr(o.body))z.has(u)||F.has(u)||ur(u)&&w.push({id:u,src:_t(u),alt:"Embedded image"});const M=c.filter(u=>!h.has(u.id));return w.length===0&&S.length===0&&M.length===0?null:r.jsxs("div",{className:"s-message-embeds",children:[w.map(u=>r.jsx(fr,{src:u.src,alt:u.alt},u.id)),S.slice(0,1).map(u=>r.jsx(yr,{preview:u},u.id)),M.map(u=>{const L=dt(u),b=L?_t(L):null,d=u.fileName??K(u.metadata,"title")??u.mediaType;return b?r.jsxs("a",{className:"s-message-embed s-message-embed--file",href:b,target:"_blank",rel:"noreferrer",children:[r.jsx("span",{className:"s-message-embed-title",children:d}),r.jsx("span",{className:"s-message-embed-description",children:u.mediaType})]},u.id):r.jsxs("div",{className:"s-message-embed s-message-embed--file",children:[r.jsx("span",{className:"s-message-embed-title",children:d}),r.jsx("span",{className:"s-message-embed-description",children:u.mediaType})]},u.id)})]})}function Sr(o){const{sessionIds:c,active:h}=o,w=c.join("|"),S=h&&c.length>0,[F,z]=n.useState([]);return n.useEffect(()=>{z([])},[w]),n.useEffect(()=>{if(!S)return;let M=!1;const u=new URLSearchParams({limit:String(Va*3),transcripts:"true"});return _(`/api/tail/recent?${u.toString()}`).then(L=>{if(M)return;const b=(L.events??[]).filter(d=>Es(d,c));b.length!==0&&z(d=>Ls(d,b))}).catch(()=>{}),()=>{M=!0}},[S,w]),rr(M=>{S&&Es(M,c)&&z(u=>Ls(u,[M]))},S),n.useMemo(()=>S?za(F):[],[S,F])}const br=3500;function Ps(o){const c=o?.trim().replace(/^#/,"");if(!c?.startsWith("msg-"))return null;const h=c.slice(4).trim();if(!h)return null;try{return decodeURIComponent(h)}catch{return h}}const xr=64;function Tr(o){const c=o?.clientMessageId;return typeof c=="string"&&c.trim()?c.trim():null}function $s(o){const c=o.body.replace(/\s+/gu," ").trim();if(c)return c.length>180?`${c.slice(0,179).trimEnd()}…`:c;const h=o.attachments?.length??0;return h===1?"Attachment":h>1?`${h} attachments`:"Message"}function Fs(o,c){const h=o.toLocaleLowerCase().indexOf(c.toLocaleLowerCase());if(h<0)return o;const w=o.slice(0,h),S=o.slice(h+c.length);return!w&&S.startsWith(" ")?S.slice(1):w.endsWith(" ")&&S.startsWith(" ")?`${w}${S.slice(1)}`:`${w}${S}`}function vr(o){return o instanceof TypeError||typeof DOMException<"u"&&o instanceof DOMException&&o.name==="AbortError"}function Bo({conversationId:o,initialDraft:c,navigate:h,embedded:w,showBackNav:S=!0,treatment:F="standard"}){const{agents:z,route:M,openContextCapture:u}=zn(),L=qa(M),b=n.useMemo(()=>Gn(z,L),[z,L]),[d,ut]=n.useState(null),Kt=n.useRef(null);Kt.current=d;const He=n.useMemo(()=>it(o),[o]),[Os,qs]=n.useState(()=>He?{[o]:He}:{}),T=Os[o]??He??[],[Ds,Vt]=n.useState(()=>He!==null),xe=n.useRef(null),Bs=n.useMemo(()=>{const t=xe.current;return t===null?null:new Set(T.filter(e=>!t.has(e.id)).map(e=>e.id))},[T]),zt=xe.current===null&&T.length>0;n.useEffect(()=>{if(T.length===0)return;const t=xe.current??new Set;for(const e of T)t.add(e.id);xe.current=t},[T]),n.useEffect(()=>{xe.current=null,Vt(it(o)!==null)},[o]);const Gt=!Ds&&T.length===0,V=n.useCallback(t=>{qs(e=>{const s=e[o]??it(o)??[],a=typeof t=="function"?t(s):t,i=qn(o,a);return{...e,[o]:i}})},[o]),Us=Bt(o),[g,he]=n.useState(Us),[Te,ve]=n.useState([]),[We,mt]=n.useState(null),[_e,ke]=n.useState(null),[Qe,Hs]=n.useState(()=>typeof window>"u"?null:Ps(window.location.hash)),[Jt,pe]=n.useState(null),[ge,ht]=n.useState(!1),[Ws,Ce]=n.useState(!1),[pt,Ke]=n.useState(0),Ve=n.useRef(null),Me=n.useRef(null),Yt=n.useRef(null),Ne=n.useRef(!0),ze=n.useRef(!1),fe=n.useRef(null),R=n.useRef(null),Ie=n.useRef(new Set),Ae=n.useRef(null),Xt=n.useRef(0),Zt=n.useRef(null),je=n.useRef(null),se=n.useRef(o);se.current=o;const ne=n.useRef(new Map),_s=bs(o),Ge=n.useRef(!1);n.useLayoutEffect(()=>{const t=Me.current,e=Ve.current;!t||!e||(e.scrollTop=t.scrollTop+(e.scrollHeight-t.scrollHeight),Me.current=null,Ge.current=!0)}),n.useEffect(()=>{ht(!1),Me.current=null,Ge.current=!1,Ne.current=!0,ze.current=!1,Ce(!1),Ke(0),Et(new Set),ne.current.clear(),he(Bt(o))},[o]);const x=d?.agentId??null,C=d?.kind==="direct",gt=n.useMemo(()=>new Set([o,...d?.equivalentConversationIds??[]]),[o,d?.equivalentConversationIds]),Q=n.useMemo(()=>x?b.find(t=>t.id===x)??null:null,[b,x]),es=Yn(d),Qs=Xn({resolvedAgentId:Q?.id,sessionId:es,machineId:L}),[ts,ss]=n.useState(null);n.useEffect(()=>{_("/api/fleet").then(t=>{ss(e=>te(e,Ts(t.activeAsks,o,x)))}).catch(()=>{})},[o,x]);const B=n.useCallback(async(t={})=>{const e=t.messageMode??"none",s=t.includeMetadata??!0;pe(null);try{const a=s?await _(`/api/session/${encodeURIComponent(o)}`).catch(()=>null):Kt.current;if(se.current!==o)return;ut(k=>te(k,a));const i=a?.agentId??null,l=a?.id&&a.id!==o?a.id:o;if(l!==o){h({view:"conversation",conversationId:l});return}const m=it(l),A=Dn(l),f=e==="initial"&&!A,p=e==="refresh"||e==="initial",[y,U,j]=await Promise.all([f?Bn(l):p?Un(l,{refresh:!0}):Promise.resolve(m),_(`/api/flights?conversationId=${encodeURIComponent(l)}`),_("/api/fleet?limit=24&activityLimit=160").catch(()=>Zn())]);if(se.current!==o)return;const Z=be(y??[]),q=Z.filter(k=>!Ht(k));y&&V(k=>te(k,ea(k,q))),Vt(!0),Ba(l);const H=Z.at(-1);H&&je.current!==H.id&&(je.current=H.id,_(`/api/conversations/${encodeURIComponent(l)}/read-cursor`,{method:"POST",body:JSON.stringify({lastReadMessageId:H.id})}).catch(()=>{je.current===H.id&&(je.current=null)}));const W=ta(U),D=Bt(l),ee=W??D;Ie.current=new Set([...U.map(k=>k.invocationId),...D?.invocationId?.startsWith("pending:")?[]:D?.invocationId?[D.invocationId]:[]]),W&&D?.id===W.id&&xs(l,W.id);const rt=ee?.agentId??i??null,E=sa(j.activity,ee,l,rt),ot=na(j.activeAsks,ee,l,rt);he(k=>te(k,ee)),ve(k=>te(k,E)),ke(k=>te(k,ot)),ss(k=>te(k,Ts(j.activeAsks,l,i)))}catch(a){if(se.current!==o)return;pe(a instanceof Error?a.message:String(a))}},[o,h,V]);n.useEffect(()=>{B({messageMode:"initial"})},[B]),n.useEffect(()=>{je.current=null},[o]),n.useEffect(()=>{Ae.current=g},[g]);const Ks=n.useCallback(async()=>{if(ge||!bs(o))return;const t=Ve.current,e=t?{scrollHeight:t.scrollHeight,scrollTop:t.scrollTop}:null;ht(!0),pe(null);try{const s=await Hn(o);if(se.current!==o)return;e&&(Me.current=e),V(be(s).filter(a=>!Ht(a)))}catch(s){se.current===o&&pe(s instanceof Error?s.message:String(s))}finally{se.current===o&&ht(!1)}},[o,ge,V]),[N,O]=n.useState(()=>c??""),[ae,re]=n.useState(null),[G,Je]=n.useState(!1),[v,Vs]=n.useState("operator"),[oe,Re]=n.useState({open:!1,query:"",triggerStart:-1,index:0}),[ie,Ee]=n.useState({open:!1,query:"",triggerStart:-1,index:0}),[P,J]=n.useState(null),[ft,Ye]=n.useState(!1),[yt,Xe]=n.useState(""),[zs,Le]=n.useState(null),[Gs,wt]=n.useState(!1);n.useEffect(()=>{Ye(!1),Xe(""),Le(null),wt(!1)},[o]),n.useEffect(()=>{if(!c)return;const t=`${o}:${c}`;Zt.current!==t&&(Zt.current=t,O(c),requestAnimationFrame(()=>R.current?.focus()))},[o,c]);const le=n.useMemo(()=>{const t=new Map;for(const e of d?.participants??[])t.set(e.actorId,e),e.agentId&&t.set(e.agentId,e);return t},[d]),St=n.useMemo(()=>{const t=new Set,e=[];for(const s of d?.participantIds??[]){if(s==="operator")continue;const a=le.get(s),i=a?.scopedAlias?.trim().replace(/^@+/,"");if(!i)continue;const l=i.toLowerCase();t.has(l)||(t.add(l),e.push({id:s,label:a?.label??a?.displayName??i,name:a?.displayName??i,handle:i}))}for(const s of b){const a=s.handle?.trim().replace(/^@+/,"")??vs(s.id)??s.id;if(!a)continue;const i=a.toLowerCase();t.has(i)||(t.add(i),e.push({id:s.id,label:a,name:s.name??a,handle:a}))}return e.sort((s,a)=>s.handle.localeCompare(a.handle))},[le,b,d]),Js=n.useMemo(()=>{if(!oe.open)return[];const t=oe.query.toLowerCase();return t?ks.filter(e=>e.command.toLowerCase().startsWith("/"+t)||e.command.toLowerCase().includes(t)):ks},[oe.open,oe.query]),Ys=n.useMemo(()=>{if(!ie.open)return[];const t=ie.query.toLowerCase();return t?St.filter(e=>e.handle.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)).slice(0,8):St.slice(0,8)},[ie.open,ie.query,St]),Xs=n.useCallback(()=>{Re(t=>t.open?{...t,open:!1}:t),Ee(t=>t.open?{...t,open:!1}:t)},[]),Zs=n.useCallback((t,e)=>{const s=aa(t,e);Re(s?i=>({open:!0,query:s.query,triggerStart:s.start,index:i.open&&i.triggerStart===s.start?i.index:0}):i=>i.open?{...i,open:!1}:i);const a=ra(t,e);Ee(a?i=>({open:!0,query:a.query,triggerStart:a.start,index:i.open&&i.triggerStart===a.start?i.index:0}):i=>i.open?{...i,open:!1}:i)},[]),en=n.useCallback(t=>{const e=R.current,s=oe.triggerStart;if(s<0)return;const a=e?.selectionStart??N.length,i=N.slice(0,s),l=N.slice(a),m=t.insert,A=`${i}${m}${l}`;O(A),Re(f=>({...f,open:!1})),requestAnimationFrame(()=>{const f=R.current;if(!f)return;const p=i.length+m.length;f.focus(),f.setSelectionRange(p,p)})},[N,oe.triggerStart]),tn=n.useCallback(t=>{const e=R.current,s=ie.triggerStart;if(s<0)return;const a=e?.selectionStart??N.length,i=N.slice(0,s),l=N.slice(a),m=l.length===0||!l.startsWith(" "),A=`@${t.handle}${m?" ":""}`,f=`${i}${A}${l}`;O(f),Ee(p=>({...p,open:!1})),requestAnimationFrame(()=>{const p=R.current;if(!p)return;const y=i.length+A.length;p.focus(),p.setSelectionRange(y,y)})},[N,ie.triggerStart]);n.useEffect(()=>{const t=R.current;if(!t)return;t.style.height="0px";const e=Math.min(Math.max(t.scrollHeight,40),160);t.style.height=`${e}px`,t.style.overflowY=t.scrollHeight>e?"auto":"hidden"},[N]),n.useEffect(()=>{_("/api/user").then(t=>Vs(t.name)).catch(()=>{})},[]);const Ze=n.useMemo(()=>oa(T,v),[T,v]);n.useEffect(()=>{P===null||Ze===null||Ze>=P&&J(null)},[P,Ze]);const sn=n.useMemo(()=>ia(g),[g]),ye=Date.now(),nn=la(g,Ze,ye),bt=sn&&!ca(g)&&!nn,ns=C&&(G||P!==null||bt),as=C&&da({sending:G,awaitingResponse:P!==null,currentFlight:g}),$=ua({name:Q?.name,agentName:d?.agentName,id:x,title:d?.title}),I=n.useMemo(()=>C?ma({agentName:$,agentState:Q?.state??null,sending:G,currentFlight:g,showWorkingTurn:bt,awaitingResponse:P!==null}):{label:"Open",detail:"",tone:"idle",showStrip:!1,showTyping:!1},[Q?.state,$,P,g,ye,C,G,bt]),xt=g?.startedAt??_e?.startedAt??P,Tt=js(xt),rs=Ea(xt,ye),[,an]=n.useState(0);n.useEffect(()=>{if(!I.showTyping||Tt===null)return;const t=Math.max(0,Date.now()-Tt),e=[Is.sustained,Is.long].find(a=>a>t);if(e===void 0)return;const s=window.setTimeout(()=>an(a=>a+1),e-t+50);return()=>window.clearTimeout(s)},[Tt,I.showTyping,rs]);const rn="Live",vt=n.useMemo(()=>ha({currentFlight:g,presence:I,turnActivity:Te,turnAsk:_e,awaitingResponseSince:P,nowMs:ye}),[P,g,ye,I,Te,_e]),on="s-thread-msg-card s-thread-msg-working-card s-thread-msg-card--avatar-row",ln="s-thread-msg-kind",cn="s-thread-turn-snapshot",dn="s-thread-turn-snapshot-pulse",un="s-thread-presence-line",mn=["s-thread-presence-strip",`s-thread-presence-strip--${rs}`].filter(Boolean).join(" "),kt=d?pa(d):$,os=d?.id??o,hn=d?.alias?.trim()||null,et=ga(d?.workspaceRoot),pn=I.tone,Ct=T.length===0&&C&&(I.showTyping||g!==null||Te.length>0||_e!==null||P!==null),is=n.useMemo(()=>d?d.participantIds.includes("operator"):C,[C,d]),Pe=g?.agentId??x,$e=Pe?Cs(b,[Pe]):null,Fe=$e?.id??Pe,Oe=g?.sessions.at(-1)?.sessionId??$e?.harnessSessionId??void 0,ls=g?.id?()=>{ct(h,{view:"sessions",flightId:g.id,...Fe?{agentId:Fe}:{},...Oe?{sessionId:Oe}:{},...L?{machineId:L}:{}},{returnTo:M})}:void 0,cs=g?.id??null;n.useEffect(()=>{if(!cs||!Fe){mt(null);return}let t=!1;const e=Oe?`?sessionId=${encodeURIComponent(Oe)}`:"",s=async()=>{try{const i=await _(`/api/agents/${encodeURIComponent(Fe)}/observe${e}`);if(t)return;mt(l=>te(l,i))}catch{}};s();const a=window.setInterval(()=>{s()},br);return()=>{t=!0,window.clearInterval(a),mt(null)}},[cs,Fe,Oe]);const Mt=n.useMemo(()=>Ga({flight:g,agent:$e??Q,sessionMeta:d,observeSessionId:We?.sessionId}),[Q,g,d,We?.sessionId,$e]),ds=Sr({sessionIds:Mt,active:I.showTyping||Ct}),gn=n.useMemo(()=>Ja({observe:We,flight:g}),[g,We]),Y=ds.length>0?ds:gn,Nt=n.useMemo(()=>Y.length>0?null:Ya({flight:g,hasSessionScope:Mt.length>0,awaitingResponse:P!==null}),[P,g,Mt.length,Y.length]),It=Xa(Y),At=Za(Y),us=Y.at(-1)??null,jt=us?Ut(us.ts,ye):null,ce=n.useMemo(()=>At?{...vt,latest:At,...It?{activityLabel:It}:{},...jt?{lastActivityLabel:jt}:{}}:vt,[jt,At,vt,It]),fn=`${$}: ${ce.latest}`,ms=Pe&&fa($e)?()=>{ct(h,{view:"terminal",agentId:Pe,mode:"takeover"},{returnTo:M})}:void 0,Rt=C?()=>{w&&Da({type:"focus-composer",reason:"Steer the active conversation"})||requestAnimationFrame(()=>{R.current?.focus({preventScroll:!0}),R.current?.scrollIntoView({block:"nearest"})})}:void 0,yn=n.useMemo(()=>(d?d.participantIds.filter(e=>e!=="operator"):x?[x]:[]).map(e=>{const s=Cs(b,[e]),a=le.get(e);return{id:e,name:a?.scopedAlias??s?.name??a?.displayName??vs(e)??e,title:a?.label??s?.id??e,agent:s,sessionId:a?.sessionId??null,harness:s?.harness??a?.harness??null,model:s?.model??null,reasoningEffort:s?.reasoningEffort??null}}),[x,le,b,d]),wn=n.useMemo(()=>({name:v,active:is}),[is,v]),tt=n.useMemo(()=>new Map(T.map(t=>[t.id,t])),[T]),st=n.useMemo(()=>ya(T),[T]),[Sn,Et]=n.useState(()=>new Set),bn=n.useCallback(t=>{Et(e=>{const s=new Set(e);return s.delete(t)||s.add(t),s})},[]),hs=n.useMemo(()=>{const t=new Map;for(const e of st)if(e.kind==="fanout")for(const s of e.messages)t.set(s.id,e.key);return t},[st]),nt=n.useCallback(t=>{const e=hs.get(t);e&&Et(l=>l.has(e)?l:new Set(l).add(e));const s=document.getElementById(`msg-${t}`);if(!s)return;const a=s.closest(".s-thread-fanout")??s,i=a===s?"s-thread-msg--flash":"s-thread-fanout--flash";a.scrollIntoView({behavior:"smooth",block:"center"}),a.classList.add(i),window.setTimeout(()=>a.classList.remove(i),1200)},[hs]);n.useEffect(()=>{const t=()=>Hs(Ps(window.location.hash));return window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t)},[]),n.useEffect(()=>{if(!Qe||!tt.has(Qe))return;const t=window.setTimeout(()=>nt(Qe),50);return()=>window.clearTimeout(t)},[Qe,tt,nt]),Fa(n.useCallback(t=>{if(t.kind==="message.posted"){const e=t.payload?.message;if(!e||!gt.has(e.conversationId))return;const s=e.actorId==="operator",a=C&&!s&&e.class==="agent",i={id:e.id,conversationId:e.conversationId,actorId:e.actorId,actorName:a?$:wa(e.actorId,b,v),body:e.body,createdAt:e.createdAt,class:s?"operator":e.class,attachments:e.attachments,metadata:e.metadata,replyToMessageId:e.replyToMessageId??e.n??null};if(Ht(i))return;if(V(l=>{const m=Tr(e.metadata),A=m?ne.current.get(m):void 0;if(l.some(f=>f.id===e.id))return m&&ne.current.delete(m),l;if(s&&m){const f=Sa(l,m,A);if(f!==-1){const p=[...l];return p[f]=i,ne.current.delete(m),be(p)}}return be([...l,i])}),a){const l=js(e.createdAt)??Date.now();J(m=>m===null||l<m||ba(Ae.current)?m:null),he(m=>xa(m)?null:m)}return}if(t.kind==="invocation.requested"){const e=t.payload?.invocation;if(!e||e.targetAgentId!==x||!e.conversationId||!gt.has(e.conversationId))return;Ie.current.add(e.id),ve([]),ke(null),J(s=>s??Date.now());return}if(t.kind==="flight.updated"){const e=t.payload?.flight;if(!e||e.targetAgentId!==x||!(Ie.current.has(e.invocationId)||Ae.current?.id===e.id))return;if(Ta.has(e.state)){xs(o,e.id),he(l=>l?.id===e.id?null:l),ve([]),ke(null),J(null),B({messageMode:"refresh",includeMetadata:!1});return}Ie.current.add(e.invocationId);const a=Ae.current?.id===e.id,i=Ms(e,o,x??"",Ae.current);va(i)&&J(null),he(i),a||(ve([]),ke(null));return}t.kind!=="agent.endpoint.upserted"&&t.kind==="unknown"&&B({messageMode:"refresh"})},[x,$,o,gt,C,B,v,b])),n.useEffect(()=>{if(!ns)return;const t=setInterval(()=>{B({messageMode:"refresh",includeMetadata:!1})},5e3);return()=>clearInterval(t)},[ns,B]),n.useEffect(()=>{const t=()=>{if(document.visibilityState!=="visible")return;const e=Date.now();e-Xt.current<1e3||(Xt.current=e,B({messageMode:"refresh"}))};return window.addEventListener("focus",t),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",t)}},[B]);const Lt=n.useRef(null),ps=n.useRef(!1),Pt=n.useRef(!1),$t=n.useCallback(t=>{const e=Yt.current;e&&(ze.current=!0,fe.current!==null&&clearTimeout(fe.current),e.scrollIntoView({behavior:t}),fe.current=setTimeout(()=>{ze.current=!1,fe.current=null},t==="smooth"?700:0))},[]);n.useEffect(()=>()=>{fe.current!==null&&clearTimeout(fe.current)},[]);const xn=n.useCallback(()=>{const t=Ve.current;if(!t||ze.current)return;const s=t.scrollHeight-t.clientHeight-t.scrollTop<=xr;Ne.current=s,s?(Ce(!1),Ke(0)):Ce(!0)},[]),Tn=n.useCallback(()=>{Ne.current=!0,Ce(!1),Ke(0),$t("smooth")},[$t]);n.useEffect(()=>{const t=T.at(-1)?.id??null,e=!!(t&&t!==Lt.current),s=ka({newestMessageId:t,previousNewestMessageId:Lt.current,showTyping:I.showTyping,previousShowTyping:ps.current,historyRestorePending:Ge.current||Me.current!==null,initialScrollDone:Pt.current,nearBottom:Ne.current});s!=="none"?($t(s),Pt.current=!0):e&&Pt.current&&!Ne.current&&(Ce(!0),Ke(a=>a+1)),Ge.current=!1,Lt.current=t,ps.current=I.showTyping});const[,vn]=n.useState(0);n.useEffect(()=>{const t=setInterval(()=>vn(e=>e+1),15e3);return()=>clearInterval(t)},[]);const de=Kn(),[ue,X]=n.useState([]),[gs,at]=n.useState("queue"),[we,Se]=n.useState(null),qe=async(t,e)=>{const s=t.trim(),a=e?.attachments??[],i=e?.replyTarget??null;if(!s&&a.length===0||G)return"failed";const m=e?.forceAction??As({isDm:C,hasOutstandingReply:as}),A=Date.now(),f=_n(),p={id:`optimistic-${f}`,conversationId:o,actorId:"operator",actorName:v,body:s,createdAt:A,class:"operator",...i?{replyToMessageId:i.messageId}:{},metadata:{clientMessageId:f,deliveryState:"sending"},...a.length>0?{attachments:a}:{}};Je(!0),m!=="message"&&J(A),pe(null),ne.current.set(f,p.id),V(y=>be([...y,p]));try{const y=await _(`/api/chats/${encodeURIComponent(o)}/messages`,{method:"POST",body:JSON.stringify({body:s,clientMessageId:f,...i?{replyToMessageId:i.messageId}:{},...a.length>0?{attachments:a}:{}})}),U=y.chatId?.trim()??y.conversationId?.trim();if(U&&U!==o)throw new Error(`Send returned a different Chat (${U}) instead of appending to ${o}.`);if(y.messageId?.trim()){const j=y.messageId.trim();V(Z=>be(Z.map(q=>q.id===p.id?{...q,id:j,metadata:{clientMessageId:f}}:q))),ne.current.delete(f)}return y.flight?(Ie.current.add(y.flight.invocationId),he(Ms(y.flight,o,x??"")),ve([]),ke(null)):m!=="message"&&J(null),"sent"}catch(y){return vr(y)?(V(U=>U.map(j=>j.id===p.id?{...j,metadata:{...j.metadata??{},deliveryState:"unknown"}}:j)),"unknown"):(V(U=>U.filter(j=>j.id!==p.id)),ne.current.delete(f),J(null),pe(y instanceof Error?y.message:String(y)),"failed")}finally{Je(!1)}},kn=async()=>{const t=N.trim(),e=ae,s=de.files,a=we?.attachments??[];if(!t&&s.length===0&&a.length===0)return null;let i=[];if(s.length>0){Je(!0);try{i=await Qn(s)}catch(l){return de.setError(l instanceof Error?l.message:String(l)),null}finally{Je(!1)}}return O(""),re(null),de.clear(),Se(null),{body:t,attachments:[...a,...i],replyTarget:e}},Cn=async()=>{const t=Pa({isAgentBusy:me,intent:gs}),e=we?.id??null,s=await kn();if(!s)return;if(t==="queue"){X(l=>e?l.map(m=>m.id===e?{...m,body:s.body,attachments:s.attachments,replyTarget:s.replyTarget}:m):[...l,{id:`queued-${Date.now()}-${l.length}`,body:s.body,attachments:s.attachments,replyTarget:s.replyTarget,queuedAt:Date.now()}]);return}e&&X(l=>l.filter(m=>m.id!==e));const a=()=>{O(s.body),Se(s.attachments.length>0?{id:null,attachments:s.attachments}:null),re(s.replyTarget),requestAnimationFrame(()=>R.current?.focus())};if(t==="steer"){at("queue"),await qt(),await qe(s.body,{forceAction:"steer",attachments:s.attachments,replyTarget:s.replyTarget})==="failed"&&a();return}await qe(s.body,{attachments:s.attachments,replyTarget:s.replyTarget})==="failed"&&a()},Mn=t=>{X(e=>e.filter(s=>s.id!==t)),Se(e=>e?.id===t?null:e)},Nn=t=>{const e=ue.find(s=>s.id===t);e&&(O(e.body),re(e.replyTarget??null),Se({id:t,attachments:e.attachments}),requestAnimationFrame(()=>{const s=R.current;s&&(s.focus(),s.setSelectionRange(s.value.length,s.value.length))}))},In=()=>{Se(null),O(""),re(null),de.clear()},An=async t=>{const e=ue.find(a=>a.id===t);if(!e)return;X(a=>a.filter(i=>i.id!==t)),await qt(),await qe(e.body,{forceAction:"steer",attachments:e.attachments,replyTarget:e.replyTarget??null})==="failed"&&X(a=>[e,...a])},Ft=n.useCallback((t,e)=>{const s=e?.trim().replace(/^@+/,"")||null,a=s?`@${s}`:null,i=ae?.insertedMention?Fs(N,ae.insertedMention):N,l=!!(!C&&a&&!i.toLocaleLowerCase().includes(a.toLocaleLowerCase())),m=l&&a?i.trim()?`${i.trimEnd()} ${a} `:`${a} `:i;O(m),re({messageId:t.id,actorLabel:s?`@${s}`:t.actorName,preview:$s(t),insertedMention:l?a:null}),requestAnimationFrame(()=>R.current?.focus())},[N,C,ae?.insertedMention]),jn=n.useCallback(()=>{const t=ae?.insertedMention;re(null),t&&O(e=>Fs(e,t)),requestAnimationFrame(()=>R.current?.focus())},[ae]),Ot=n.useCallback(t=>{const e=new URL(window.location.href);M.view==="agents-v2"&&e.searchParams.set("tab","message"),e.hash=`msg-${t}`,Be(e.toString())},[M.view]),fs=n.useCallback((t,e,s)=>{const a=Wn({conversationId:o,selectedMessageId:t.id,messages:T.map(i=>({id:i.id,actorLabel:i.id===t.id?e:lt(i,v)?v:i.actorName,body:i.body,attachmentCount:i.attachments?.length??0}))});u({intent:"forward-message",forwardContext:a,forwardContextMode:"selected-message",...s?{projectPath:s}:{}})},[o,T,u,v]),qt=async()=>{if(x)try{await _("/api/agents/"+encodeURIComponent(x)+"/interrupt",{method:"POST",body:JSON.stringify({})})}catch{}},me=I.tone==="working"||I.tone==="pending",Rn=As({isDm:C,hasOutstandingReply:as}),En=C?`Message ${$} — type / to route or @ to mention an agent`:d?.kind==="channel"?`Comment in #${Ca(d)} — mention @agent to request a reply`:`Comment in ${kt} — mention @agent to request a reply`,ys=we?.attachments??[],Ln=!N.trim()&&!de.hasFiles&&ys.length===0&&me,Dt=n.useRef(!1);n.useEffect(()=>{const t=we?.id??null,e=t?ue.filter(a=>a.id!==t):ue;if(!Ma({isAgentBusy:me,sending:G,queued:e})||Dt.current)return;const s=e[0];s&&(Dt.current=!0,X(a=>a.filter(i=>i.id!==s.id)),qe(s.body,{attachments:s.attachments,replyTarget:s.replyTarget??null}).then(a=>{a==="failed"&&X(i=>[s,...i])}).finally(()=>{Dt.current=!1}))},[me,G,ue,we]),n.useEffect(()=>{me||at("queue")},[me]),n.useEffect(()=>{X([]),Se(null),re(null),at("queue"),de.clear()},[o]);const Pn=Na(ue),ws=Jn(),$n=n.useCallback((t,e)=>{const s=window.getSelection()?.toString().trim(),a=lt(e,v),i=e.actorId?le.get(e.actorId):null,l=a?null:Ns(e,b,x),m=(i?.scopedAlias?.trim()||l?.handle?.trim()||null)?.replace(/^@+/,"")??null,A=m?`@${m}`:e.actorName,f=(l?.id||i?.agentId||e.actorId||"").trim(),p=[];a||p.push({kind:"action",label:"Reply",onSelect:()=>Ft(e,m)}),p.push({kind:"action",label:"Forward to new task…",onSelect:()=>fs(e,A,i?.workspaceRoot??l?.projectRoot??l?.cwd??void 0)}),p.push({kind:"separator"}),s&&p.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{Be(s)}}),p.push({kind:"action",label:"Copy Message",onSelect:()=>{Be(e.body)}}),p.push({kind:"action",label:"Copy Link",onSelect:()=>Ot(e.id)}),p.push({kind:"separator"}),!a&&f&&p.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{Be(f)}}),p.push({kind:"action",label:"Copy Message ID",onSelect:()=>{Be(e.id)}}),ws(t,p)},[x,Ft,Ot,fs,v,le,b,ws]),Fn=async(t,e)=>{const s=`@${e.agentId} `,a=N.trim();if(a){O(""),await qe(`${s}${a}`,{forceAction:"invoke"});return}O(s),R.current?.focus()},De=n.useMemo(()=>{if(!d)return[];const t=new Set(d.participantIds);return b.filter(e=>!t.has(e.id)&&!e.retiredFromFleet).sort((e,s)=>e.name.localeCompare(s.name))},[d,b]);n.useEffect(()=>{ft&&Xe(t=>t&&De.some(e=>e.id===t)?t:De[0]?.id??"")},[ft,De]);const Ss=!!(d&&["direct","group_direct","channel"].includes(d.kind)&&De.length>0),On=n.useCallback(async()=>{if(!d)return;const t=yt.trim();if(t){wt(!0),Le(null);try{const e=await _(`/api/conversations/${encodeURIComponent(d.id)}/members`,{method:"POST",body:JSON.stringify({actorId:t})});e.session?ut(e.session):ut(s=>s&&{...s,kind:e.kind,participantIds:e.participantIds}),Ye(!1),Xe(""),await B({messageMode:"none"})}catch(e){Le(e instanceof Error?e.message:String(e))}finally{wt(!1)}}},[yt,B,d]);return r.jsx("div",{className:`s-thread-layout${w?" s-thread-layout--embedded":""}`,"data-thread-treatment":F==="standard"?void 0:F,children:r.jsxs("div",{className:"s-thread-center",children:[!w&&r.jsx(Ha,{showBackNav:S,isDm:C,navigate:h,route:M,canonicalConversationId:os,threadTitle:kt,agentId:Q?.id??null,sessionId:es,detailRoute:Qs,participants:yn,operator:wn,canAddParticipants:Ss,onToggleAddParticipant:()=>{Le(null),Ye(t=>!t)}}),!w&&d&&r.jsx(Wa,{canonicalConversationId:os,conversationAlias:hn}),!w&&ft&&Ss&&r.jsx(_a,{agents:De,addParticipantId:yt,setAddParticipantId:Xe,addingParticipant:Gs,addParticipantError:zs,onCancel:()=>{Ye(!1),Le(null)},onSubmit:()=>{On()}}),ts&&r.jsx(or,{pinnedAsk:ts,onAnswer:()=>{R.current?.focus()},onSteer:Rt}),r.jsx(ir,{presence:I,agent:Q}),Jt&&r.jsx("p",{className:"s-thread-error",children:Jt}),r.jsxs("div",{className:"s-thread-feed",ref:Ve,onScroll:xn,children:[!Gt&&T.length>0&&_s&&r.jsx("div",{className:"s-thread-history-control",children:r.jsxs("button",{type:"button",className:"s-thread-history-button",disabled:ge,"aria-busy":ge,onClick:()=>{Ks()},children:[ge&&r.jsx("span",{className:"s-thread-history-spinner","aria-hidden":"true"}),ge?"Loading earlier messages…":"Load earlier messages"]})}),Gt?r.jsx(er,{}):T.length===0?Ct?r.jsx(tr,{agentName:$,title:I.label,detail:I.detail||ce.latest,snapshot:ce,events:Te,steps:Y,phase:Nt,tone:pn,workspaceName:et,branch:d?.currentBranch,startedAt:xt,onOpenTrace:ls,onOpenTerminal:ms,onSteer:Rt}):r.jsxs("div",{className:"s-thread-empty",children:[r.jsx("div",{className:"s-thread-empty-glyph","aria-hidden":"true",children:C?"@":"#"}),r.jsx("p",{children:kt}),r.jsx("p",{children:C?"No messages yet. Send a message to start working with this agent.":"No messages yet. Start the conversation below."}),(et||d?.currentBranch)&&r.jsxs("div",{className:"s-thread-empty-chips",children:[et&&r.jsx("span",{className:"s-thread-empty-chip",children:et}),d?.currentBranch&&r.jsx("span",{className:"s-thread-empty-chip",children:d.currentBranch})]})]}):st.map((t,e)=>{const s=Ia(t,e);if(t.kind==="fanout")return r.jsx(Qa,{row:t,expanded:Sn.has(t.key),showDayDivider:s,onToggle:()=>bn(t.key)},t.key);const a=t.message,i=lt(a,v),l=Aa(a),m=l?"scout.dispatch":a.class,A=La(m),f=m==="status",p=Rs(a.createdAt),y=i?null:Ns(a,b,x),j=le.get(a.actorId)?.scopedAlias?.trim()||null,Z=!i&&j?j:a.actorName,q=i?v.toLowerCase():j??y?.handle??null,H=ja(a.body),W=H?Ra({flightId:H.flightId,replyToMessageId:a.replyToMessageId,messagesById:tt,agents:b,operatorName:v}):null,D=!H&&a.replyToMessageId?tt.get(a.replyToMessageId)??null:null,ee=D?lt(D,v)?v:D.actorName:null,rt=H?H.body:a.body;return r.jsxs("div",{className:["s-thread-feed-block",i&&"s-thread-feed-block--you",s&&"s-thread-feed-block--full-width"].filter(Boolean).join(" "),children:[s&&r.jsx(Ka,{at:a.createdAt}),r.jsx("article",{id:`msg-${a.id}`,className:["s-thread-msg",i&&"s-thread-msg--you",f&&"s-thread-msg--tool",(zt||Bs?.has(a.id))&&"s-thread-msg--enter"].filter(Boolean).join(" "),style:zt?{animationDelay:`${Math.max(0,7-(st.length-1-e))*26}ms`}:void 0,"data-class":m,onContextMenu:E=>$n(E,a),children:r.jsx("div",{className:"s-thread-msg-card",children:r.jsxs("div",{className:"s-thread-msg-card-content",children:[r.jsxs("div",{className:"s-thread-msg-header",children:[r.jsxs("div",{className:"s-thread-msg-meta",children:[(()=>{const E=!i&&y?()=>ct(h,{view:"agents-v2",agentId:y.id},{returnTo:M}):null,ot=i?v:Z??"?",k=r.jsx(Wt,{agent:y??void 0,name:ot,placement:"turn",size:28,className:"s-thread-msg-avatar",title:ot});return E?r.jsx("button",{type:"button",className:"s-thread-msg-avatar--nav",onClick:E,"aria-label":`View profile for ${a.actorName??"agent"}`,title:`View profile for ${a.actorName??"agent"}`,children:k}):k})(),!i&&y?r.jsx("button",{type:"button",className:"s-thread-msg-actor s-thread-msg-actor--nav",onClick:()=>ct(h,{view:"agents-v2",agentId:y.id},{returnTo:M}),title:`View profile for ${a.actorName}`,children:Z}):r.jsx("span",{className:"s-thread-msg-actor",children:i?v:Z}),q&&r.jsxs("span",{className:"s-thread-msg-handle",children:["@",q]}),A&&r.jsx("span",{className:"s-thread-msg-kind",children:A})]}),r.jsx("span",{className:"s-thread-msg-time",title:p,children:Ut(a.createdAt)}),r.jsxs("span",{className:"s-thread-msg-actions",children:[!i&&q&&r.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":`Reply to @${q}`,title:`Reply to @${q}`,onClick:()=>Ft(a,q),children:r.jsx(Qt,{})}),r.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":"Copy link to message",title:"Copy link to message",onClick:()=>Ot(a.id),children:r.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M6.5 9.5a2.5 2.5 0 0 0 3.54 0l2.12-2.12a2.5 2.5 0 0 0-3.54-3.54l-.7.7"}),r.jsx("path",{d:"M9.5 6.5a2.5 2.5 0 0 0-3.54 0L3.84 8.62a2.5 2.5 0 0 0 3.54 3.54l.7-.7"})]})})]})]}),W&&r.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open the originating request${W.flightId?` · ${W.flightId}`:""}`,onClick:()=>nt(W.originatingMessageId),children:[r.jsx(Qt,{}),r.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),r.jsx("span",{className:"s-thread-reply-ctx-title",children:W.title}),r.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",W.from]}),r.jsx("span",{className:"s-thread-reply-ctx-status",children:"· done"})]}),D&&ee&&r.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open message from ${ee}`,onClick:()=>nt(D.id),children:[r.jsx(Qt,{}),r.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),r.jsx("span",{className:"s-thread-reply-ctx-title",children:$s(D)}),r.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",ee]})]}),r.jsx("div",{className:"s-thread-msg-body",title:p,children:r.jsx(Oa,{text:rt})}),r.jsx(wr,{message:a}),l&&l.candidates.length>0&&r.jsx("div",{className:"s-thread-dispatch",children:l.candidates.map(E=>r.jsxs("button",{type:"button",className:"s-thread-dispatch-tile",onClick:()=>{Fn(l,E)},children:[r.jsxs("span",{className:"s-thread-dispatch-tile-id",children:["@",E.agentId]}),r.jsx("span",{className:"s-thread-dispatch-tile-state",children:E.endpointState}),r.jsx("span",{className:"s-thread-dispatch-tile-meta",children:[E.workspace,E.node,E.projectRoot].filter(Boolean).join(" · ")||E.displayName})]},E.agentId))})]})})})]},a.id)}),I.showTyping&&!Ct&&r.jsx("div",{className:"s-thread-feed-block",children:r.jsx("div",{className:"s-thread-msg","aria-live":"polite",children:r.jsxs("div",{className:on,children:[r.jsx(Wt,{agent:Q??void 0,name:$,placement:"turn",size:28,className:"s-thread-msg-avatar s-thread-msg-avatar--working",title:$}),r.jsxs("div",{className:"s-thread-msg-card-content",children:[r.jsxs("div",{className:"s-thread-msg-header",children:[r.jsxs("div",{className:"s-thread-msg-meta",children:[r.jsx("span",{className:"s-thread-msg-actor",children:$}),r.jsx("span",{className:ln,children:rn})]}),r.jsx("span",{className:"s-thread-msg-time",title:g?.startedAt?Rs(g.startedAt):"now",children:g?.startedAt?Ut(g.startedAt):"now"})]}),r.jsxs("div",{className:"s-thread-msg-working-body",children:[r.jsxs("div",{className:cn,children:[r.jsx("span",{className:dn,"aria-hidden":"true"}),r.jsxs("div",{className:"s-thread-turn-snapshot-main",children:[r.jsx("span",{className:"s-thread-turn-snapshot-label",children:"Latest"}),r.jsx("span",{className:"s-thread-msg-working-copy",children:ce.latest})]})]}),r.jsxs("dl",{className:"s-thread-turn-snapshot-stats",children:[r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Activity"}),r.jsx("dd",{children:ce.activityLabel})]}),r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Elapsed"}),r.jsx("dd",{children:ce.elapsedLabel})]}),r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Last"}),r.jsx("dd",{children:ce.lastActivityLabel})]})]}),Y.length>0||Nt?r.jsx(sr,{steps:Y,phase:Nt,limit:5,compact:!0}):r.jsx(nr,{events:Te,limit:4,compact:!0}),r.jsx(ar,{onOpenTrace:ls,onOpenTerminal:ms,onSteer:Rt,compact:!0})]})]})]})})}),Ws&&pt>0&&r.jsxs("button",{type:"button",className:"s-thread-new-messages",onClick:Tn,children:[r.jsx("span",{"aria-hidden":"true",children:"↓"})," ",pt," new ",pt===1?"message":"messages"," · jump to latest"]}),r.jsx("div",{ref:Yt})]}),I.showTyping&&r.jsxs("div",{className:un,children:[r.jsx("div",{className:"s-thread-presence-line-avatars",children:r.jsx(Wt,{agent:Q??void 0,name:$,placement:"turn",size:22,className:"s-thread-presence-line-avatar",title:$})}),r.jsx("span",{className:"s-thread-presence-line-label",children:fn}),r.jsx("div",{className:mn,"aria-hidden":"true"})]}),r.jsx(Vn,{composeRef:R,draft:N,setDraft:O,composePlaceholder:En,slashState:oe,setSlashState:Re,filteredSlashCommands:Js,applySlashCommand:en,mentionState:ie,setMentionState:Ee,filteredMentions:Ys,applyMention:tn,updateTriggersFromDraft:Zs,closeSuggestions:Xs,replyTarget:ae,onCancelReply:jn,isStopMode:Ln,sending:G,composeAction:Rn,onSend:()=>{Cn()},onInterrupt:()=>{qt()},attachments:de,isAgentBusy:me,busyIntent:gs,onBusyIntentChange:at,queued:ue,queueNote:Pn,onEditQueued:Nn,editingQueuedId:we?.id??null,editingAttachmentCount:ys.length,onCancelEdit:In,onUnqueue:Mn,onSendQueuedNow:t=>{An(t)}})]})})}function Qt(){return r.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("polyline",{points:"9 14 4 9 9 4"}),r.jsx("path",{d:"M20 20v-7a4 4 0 0 0-4-4H4"})]})}const Uo=Ua({id:"thread",label:"Thread",route:{view:"conversation",conversationId:""},webPath:"/chat",screen:"ConversationScreen",embed:{path:"/embed/thread",profile:"macos.thread",rootClassName:"s-thread-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:$a}});export{Bo as ConversationScreen,Uo as scoutSurface};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m,j as s}from"./index-Bli6bTLU.js";import{c as b,C as N,u as k}from"./conversation-model-CigSPlKA.js";import{C as x}from"./check-Bfs7hMb1.js";import{S as g}from"./sparkles-ytTwpCbZ.js";import{X as j}from"./x-BJyPzFnn.js";import{c as f}from"./createLucideIcon-DLlxGjKt.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";const v=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],y=f("shield-alert",v);function Y({pinnedAsk:a,onAnswer:r,onApprove:n,onReject:t,onSteer:i,enableKeyboard:l=!0}){const d=/\b(?:approve|approval|permission|allow|proceed|confirm|gate)\b/i.test(a.task||""),c=a.agentName??b(a.agentId)??a.agentId,p=m.useCallback(()=>{n?n():r()},[n,r]),h=m.useCallback(()=>{i?i():r()},[i,r]);return m.useEffect(()=>{if(!l)return;const u=e=>{const o=document.activeElement;o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLElement&&o.isContentEditable||e.metaKey||e.ctrlKey||e.altKey||(e.key==="y"||e.key==="Y"?(e.preventDefault(),p()):e.key==="s"||e.key==="S"?(e.preventDefault(),h()):(e.key==="n"||e.key==="N")&&t&&(e.preventDefault(),t()))};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[l,p,h,t]),s.jsxs("div",{className:`s-thread-pinned-ask surface-card ${d?"s-thread-pinned-ask--approval":"s-thread-pinned-ask--question"}`,role:"alert","aria-live":"assertive",children:[s.jsxs("div",{className:"s-thread-pinned-ask-header",children:[s.jsx("div",{className:"s-thread-pinned-ask-beacon","aria-hidden":"true",children:s.jsx("span",{className:"dot dot--sm dot--warning dot--pulse dot--glow"})}),s.jsxs("div",{className:"s-thread-pinned-ask-kicker",children:[s.jsx("span",{className:"label-sm s-thread-pinned-ask-eyebrow",children:"Operator Attention Required"}),s.jsx("span",{className:"chip chip--sm chip--mono chip--warning",children:d?"Approval Gate":"Question"})]}),s.jsxs("div",{className:"s-thread-pinned-ask-routing",children:[s.jsxs("span",{className:"s-thread-pinned-ask-agent-name chip chip--sm chip--mono chip--neutral",children:["@",c]}),s.jsx("span",{className:"s-thread-pinned-ask-routing-arrow","aria-hidden":"true",children:"→"}),s.jsx("span",{className:"chip chip--sm chip--mono chip--working",children:"You"})]})]}),s.jsxs("div",{className:"s-thread-pinned-ask-body",children:[s.jsx("p",{className:"s-thread-pinned-ask-text",children:a.task}),a.summary&&a.summary!==a.task&&s.jsx("p",{className:"s-thread-pinned-ask-summary text-muted",children:a.summary})]}),s.jsxs("div",{className:"s-thread-pinned-ask-actions",children:[s.jsxs("button",{type:"button",className:"btn btn--primary s-thread-pinned-ask-btn",onClick:p,title:d?"Approve this gate [Y]":"Answer this question [Y]",children:[s.jsx("kbd",{className:"s-kbd",children:"[Y]"}),d?s.jsx(x,{size:13,strokeWidth:2.2}):s.jsx(N,{size:13}),s.jsx("span",{children:d?"Approve":"Answer"})]}),s.jsxs("button",{type:"button",className:"btn btn--accent s-thread-pinned-ask-btn",onClick:h,title:"Provide guidance or steer [S]",children:[s.jsx("kbd",{className:"s-kbd",children:"[S]"}),s.jsx(g,{size:13,strokeWidth:1.9}),s.jsx("span",{children:"Steer"})]}),t&&s.jsxs("button",{type:"button",className:"btn btn--danger s-thread-pinned-ask-btn",onClick:t,title:"Reject or decline [N]",children:[s.jsx("kbd",{className:"s-kbd",children:"[N]"}),s.jsx(j,{size:13,strokeWidth:2.2}),s.jsx("span",{children:"Reject"})]})]}),s.jsx("div",{className:"s-thread-pinned-ask-strip","aria-hidden":"true"})]})}function A({title:a,description:r,diff:n,command:t,risk:i="medium",onApprove:l,onReject:d,onSteer:c}){return s.jsxs("div",{className:"s-thread-approval-gate surface-card",role:"alert",children:[s.jsxs("div",{className:"s-thread-approval-gate-head",children:[s.jsxs("div",{className:"s-thread-approval-gate-title-wrap",children:[s.jsx(y,{size:16,className:"text-amber","aria-hidden":"true"}),s.jsx("span",{className:"label-sm text-amber",children:"Execution Approval Gate"}),i&&s.jsxs("span",{className:`chip chip--sm chip--mono ${i==="high"?"chip--danger":i==="medium"?"chip--warning":"chip--info"}`,children:[i.toUpperCase()," RISK"]})]}),s.jsx("h3",{className:"s-thread-approval-gate-title",children:a}),r&&s.jsx("p",{className:"s-thread-approval-gate-desc",children:r})]}),t&&s.jsxs("div",{className:"s-thread-approval-gate-command surface-card surface-card--inset",children:[s.jsx("span",{className:"label-xs text-muted",children:"Command"}),s.jsx("code",{className:"s-thread-approval-gate-code",children:t})]}),n&&s.jsxs("div",{className:"s-thread-approval-gate-diff surface-card surface-card--inset",children:[s.jsx("span",{className:"label-xs text-muted",children:"Diff Preview"}),s.jsx("pre",{className:"s-thread-approval-gate-diff-pre",children:s.jsx("code",{children:n})})]}),s.jsxs("div",{className:"s-thread-approval-gate-actions",children:[s.jsxs("button",{type:"button",className:"btn btn--primary",onClick:l,children:[s.jsx("kbd",{className:"s-kbd",children:"[Y]"}),s.jsx(x,{size:13}),s.jsx("span",{children:"Approve Action"})]}),s.jsxs("button",{type:"button",className:"btn btn--danger",onClick:d,children:[s.jsx("kbd",{className:"s-kbd",children:"[N]"}),s.jsx(j,{size:13}),s.jsx("span",{children:"Reject"})]}),c&&s.jsxs("button",{type:"button",className:"btn btn--ghost",onClick:c,children:[s.jsx("kbd",{className:"s-kbd",children:"[S]"}),s.jsx("span",{children:"Steer…"})]})]})]})}function K({presence:a,agent:r}){if(!a.showStrip)return null;const n=a.tone==="working",t=a.tone==="pending";return s.jsxs("div",{className:`s-thread-status s-thread-status--${a.tone}`,"aria-live":"polite",children:[s.jsx("span",{className:"s-thread-status-dot-wrap","aria-hidden":"true",children:s.jsx("span",{className:`dot dot--sm ${n?"dot--working dot--pulse dot--glow":t?"dot--warning dot--pulse dot--glow":"dot--neutral"}`,style:{color:k(a,r?.state??null)}})}),s.jsxs("div",{className:"s-thread-status-copy",children:[s.jsx("span",{className:"s-thread-status-label label-xs",children:a.label}),s.jsx("span",{className:"s-thread-status-detail",children:a.detail})]})]})}export{A as ApprovalGateCard,K as ConversationStatusStrip,Y as PinnedAskCard};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.cw-root{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:var(--space-lg);padding:var(--space-xl) var(--space-2xl) var(--space-6xl)}.cw-toolbar{flex:none;display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-sm)}.cw-modeToggle{display:flex;align-items:center;gap:2px;padding:2px;border:1px solid var(--pi-hairline);border-radius:9px;background:color-mix(in srgb,var(--hud-surface) 40%,transparent)}.cw-modeToggle button{display:flex;align-items:center;gap:6px;height:26px;padding:0 10px;border:none;border-radius:7px;background:transparent;color:var(--pi-dim);font-size:var(--text-xs);font-weight:600;cursor:pointer;transition:background .15s var(--pi-ease),color .15s var(--pi-ease)}.cw-modeToggle button:hover{color:var(--pi-muted)}.cw-modeToggle button[data-active]{background:color-mix(in srgb,var(--hud-ink) 10%,transparent);color:var(--pi-ink);box-shadow:inset 0 0 0 1px var(--pi-hairline-strong)}.cw-search{flex:1 1 220px;min-width:180px;max-width:360px;display:flex;align-items:center;gap:7px;height:30px;padding:0 10px;border:1px solid var(--pi-hairline);border-radius:8px;background:color-mix(in srgb,var(--hud-surface) 34%,transparent);color:var(--pi-dim)}.cw-search input{flex:1;min-width:0;border:none;background:transparent;color:var(--pi-ink);font-size:var(--text-sm);font-family:var(--pi-sans)}.cw-search input:focus{outline:none}.cw-search input::placeholder{color:var(--pi-dim)}.cw-filters{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.cw-filtersIcon{color:var(--pi-dim);margin-right:2px}.cw-filters button{height:26px;padding:0 10px;border:1px solid var(--pi-hairline);border-radius:999px;background:color-mix(in srgb,var(--hud-surface) 30%,transparent);color:var(--pi-dim);font-size:var(--text-2xs);font-weight:600;letter-spacing:.01em;cursor:pointer;transition:background .15s var(--pi-ease),color .15s var(--pi-ease),border-color .15s var(--pi-ease)}.cw-filters button:hover{color:var(--pi-muted);border-color:var(--pi-hairline-strong)}.cw-filters button[data-active]{background:color-mix(in srgb,var(--pi-accent) 16%,transparent);border-color:color-mix(in srgb,var(--pi-accent) 40%,var(--pi-hairline));color:var(--pi-ink)}.cw-harnessSelect{display:flex;align-items:center;height:26px;padding:0 8px;border:1px solid var(--pi-hairline);border-radius:999px;background:color-mix(in srgb,var(--hud-surface) 30%,transparent)}.cw-harnessSelect select{border:none;background:transparent;color:var(--pi-muted);font-size:var(--text-2xs);font-weight:600}.cw-harnessSelect select:focus{outline:none}.cw-addProject{margin-left:auto;display:flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:1px solid var(--pi-hairline);border-radius:8px;background:color-mix(in srgb,var(--hud-surface) 34%,transparent);color:var(--pi-muted);font-size:var(--text-xs);font-weight:600;cursor:pointer;transition:background .15s var(--pi-ease),color .15s var(--pi-ease)}.cw-addProject:hover{color:var(--pi-ink);border-color:var(--pi-hairline-strong)}.cw-digest{flex:none;display:flex;align-items:center;gap:6px;color:var(--pi-dim);font-size:var(--text-xs);font-family:var(--pi-mono)}.cw-digest span[data-tone=live]{color:color-mix(in srgb,var(--pi-accent) 78%,var(--pi-ink))}.cw-digest span[data-tone=needs]{color:color-mix(in srgb,#d9a441 82%,var(--pi-ink));font-weight:650}.cw-digestSep{opacity:.5}.cw-empty{padding:48px 12px;text-align:center;color:var(--pi-dim);font-size:var(--text-sm)}.cw-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:var(--space-lg)}.cw-card{display:flex;flex-direction:column;gap:var(--space-md);padding:var(--space-lg);border:1px solid var(--pi-hairline);border-radius:12px;background:linear-gradient(180deg,color-mix(in srgb,white 2.5%,transparent),transparent 40%),color-mix(in srgb,var(--hud-surface) 30%,transparent);transition:border-color .16s var(--pi-ease),transform .16s var(--pi-ease),background .16s var(--pi-ease)}.cw-card:hover{border-color:var(--pi-hairline-strong);transform:translateY(-1px)}.cw-card[data-status=needs]{border-color:color-mix(in srgb,#d9a441 45%,var(--pi-hairline))}.cw-card[data-status=working]{border-color:color-mix(in srgb,var(--pi-accent) 32%,var(--pi-hairline))}.cw-cardHead{display:flex;align-items:flex-start;gap:var(--space-md)}.cw-cardIdentity{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.cw-cardNameRow{display:flex;align-items:center;gap:8px;min-width:0}.cw-cardNameRow b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-ink);font-size:var(--text-md);font-weight:650}.cw-statusPill{flex:none;padding:2px 8px;border-radius:999px;font-size:var(--text-2xs);font-weight:650;letter-spacing:.01em;color:var(--pi-dim);background:color-mix(in srgb,var(--hud-ink) 8%,transparent);box-shadow:inset 0 0 0 1px var(--pi-hairline)}.cw-statusPill[data-status=needs]{color:color-mix(in srgb,#d9a441 88%,var(--pi-ink));background:color-mix(in srgb,#d9a441 14%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,#d9a441 40%,transparent)}.cw-statusPill[data-status=working]{color:color-mix(in srgb,var(--pi-accent) 84%,var(--pi-ink));background:color-mix(in srgb,var(--pi-accent) 12%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--pi-accent) 32%,transparent)}.cw-statusPill[data-status=thinking]{color:color-mix(in srgb,#6fb7c7 86%,var(--pi-ink));background:color-mix(in srgb,#6fb7c7 12%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,#6fb7c7 32%,transparent)}.cw-cardSubline{display:flex;align-items:center;gap:6px;min-width:0;color:var(--pi-muted);font-size:var(--text-xs)}.cw-headline{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-substrates{display:flex;flex-wrap:wrap;gap:6px}.cw-substrateChip{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border:1px solid var(--pi-hairline);border-radius:999px;background:color-mix(in srgb,var(--hud-surface) 26%,transparent);color:var(--pi-muted);font-size:var(--text-2xs);cursor:pointer;transition:border-color .15s var(--pi-ease),color .15s var(--pi-ease)}.cw-substrateChip:hover{border-color:var(--pi-hairline-strong);color:var(--pi-ink)}.cw-substrateChip[data-primary]{color:var(--pi-ink);background:color-mix(in srgb,var(--hud-ink) 6%,transparent)}.cw-substrateChip[data-live]{border-color:color-mix(in srgb,var(--pi-accent) 34%,var(--pi-hairline))}.cw-substrateChip em{font-style:normal;color:var(--pi-dim);font-family:var(--pi-mono)}.cw-work{display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-md);padding-top:var(--space-2xs);border-top:1px solid var(--pi-hairline)}.cw-work p{flex:1;min-width:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-ink);font-size:var(--text-sm)}.cw-work time{flex:none;color:var(--pi-dim);font-size:var(--text-2xs);font-family:var(--pi-mono)}.cw-cardActions{display:flex;gap:6px}.cw-cardActions button{flex:1;display:flex;align-items:center;justify-content:center;gap:5px;height:26px;border:1px solid var(--pi-hairline);border-radius:7px;background:transparent;color:var(--pi-muted);font-size:var(--text-2xs);font-weight:600;cursor:pointer;transition:background .15s var(--pi-ease),color .15s var(--pi-ease),border-color .15s var(--pi-ease)}.cw-cardActions button:hover{color:var(--pi-ink);border-color:var(--pi-hairline-strong);background:color-mix(in srgb,var(--hud-ink) 5%,transparent)}.cw-coordStrip{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.cw-runtimeBadge{display:inline-flex;align-items:center;gap:5px;padding:2px 7px;border:1px solid var(--pi-hairline);border-radius:6px;background:color-mix(in srgb,var(--hud-surface) 36%,transparent);color:var(--pi-muted);font-size:var(--text-2xs);font-family:var(--pi-mono)}.cw-runtimeBadge span{color:var(--pi-ink);font-weight:600}.cw-runtimeBadge i{font-style:normal;color:var(--pi-dim)}.cw-runtimeBadge em{font-style:normal;padding:0 4px;border-radius:3px;background:color-mix(in srgb,var(--hud-ink) 8%,transparent);color:var(--pi-dim);font-size:10px}.cw-workspaceList{display:flex;flex-direction:column;gap:var(--space-md)}.cw-workspace{border:1px solid var(--pi-hairline);border-radius:12px;background:color-mix(in srgb,var(--hud-surface) 24%,transparent);overflow:hidden}.cw-workspace[data-state=needs]{border-color:color-mix(in srgb,#d9a441 40%,var(--pi-hairline))}.cw-workspace[data-state=live]{border-color:color-mix(in srgb,var(--pi-accent) 28%,var(--pi-hairline))}.cw-workspaceHead{width:100%;display:flex;align-items:center;gap:var(--space-lg);padding:var(--space-md) var(--space-lg);border:none;background:transparent;color:inherit;text-align:left;cursor:pointer;transition:background .15s var(--pi-ease)}.cw-workspaceHead:hover{background:color-mix(in srgb,var(--hud-ink) 4%,transparent)}.cw-workspaceTitle{flex:none;display:flex;align-items:center;gap:6px;color:var(--pi-ink);font-size:var(--text-md);font-weight:650}.cw-workspaceRoot{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-dim);font-family:var(--pi-mono);font-size:var(--text-xs)}.cw-workspaceMeta{flex:none;display:flex;align-items:center;gap:10px;color:var(--pi-dim);font-size:var(--text-xs)}.cw-workspaceMeta b{font-weight:650;color:var(--pi-muted)}.cw-workspaceMeta b[data-tone=needs]{color:color-mix(in srgb,#d9a441 85%,var(--pi-ink))}.cw-workspaceMeta b[data-tone=live]{color:color-mix(in srgb,var(--pi-accent) 82%,var(--pi-ink))}.cw-workspaceMeta time{font-family:var(--pi-mono)}.cw-workspaceCrew{display:flex;flex-wrap:wrap;gap:6px;padding:0 var(--space-lg) var(--space-md)}.cw-workspaceCrewEmpty{padding:0 var(--space-lg) var(--space-md);color:var(--pi-dim);font-size:var(--text-xs)}.cw-crewChip{display:inline-flex;align-items:center;gap:6px;padding:3px 9px 3px 4px;border:1px solid var(--pi-hairline);border-radius:999px;background:color-mix(in srgb,var(--hud-surface) 30%,transparent);color:var(--pi-muted);font-size:var(--text-2xs);cursor:pointer;transition:border-color .15s var(--pi-ease),color .15s var(--pi-ease)}.cw-crewChip:hover{border-color:var(--pi-hairline-strong);color:var(--pi-ink)}.cw-crewChip[data-status=needs]{border-color:color-mix(in srgb,#d9a441 40%,var(--pi-hairline))}.cw-crewChip[data-status=working]{border-color:color-mix(in srgb,var(--pi-accent) 32%,var(--pi-hairline))}.cw-crewChipName{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-ink);font-weight:600}.cw-crewChip em{font-style:normal;color:var(--pi-dim);font-family:var(--pi-mono)}.cw-runtimeList{display:flex;flex-direction:column;gap:var(--space-md)}.cw-runtimeRow{border:1px solid var(--pi-hairline);border-radius:12px;background:color-mix(in srgb,var(--hud-surface) 24%,transparent);overflow:hidden;transition:border-color .15s var(--pi-ease)}.cw-runtimeRow[data-state=needs]{border-color:color-mix(in srgb,#d9a441 40%,var(--pi-hairline))}.cw-runtimeRow[data-state=live]{border-color:color-mix(in srgb,var(--pi-accent) 28%,var(--pi-hairline))}.cw-runtimeHead{display:flex;align-items:center;justify-content:space-between;gap:var(--space-lg);padding:var(--space-md) var(--space-lg);background:color-mix(in srgb,var(--hud-surface) 18%,transparent);border-bottom:1px solid var(--pi-hairline)}.cw-runtimeTitle{display:flex;align-items:center;gap:8px;color:var(--pi-ink);font-size:var(--text-md);font-weight:650}.cw-runtimeHarnessIcon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:6px;background:color-mix(in srgb,var(--hud-surface) 40%,transparent);border:1px solid var(--pi-hairline);color:var(--pi-ink)}.cw-runtimeHarnessSlug{font-family:var(--pi-mono);font-size:var(--text-xs);color:var(--pi-dim);font-weight:400;padding:1px 6px;border-radius:4px;background:color-mix(in srgb,var(--hud-ink) 6%,transparent)}.cw-runtimeMeta{flex:none;display:flex;align-items:center;gap:10px;color:var(--pi-dim);font-size:var(--text-xs)}.cw-runtimeMeta b{font-weight:650;color:var(--pi-muted)}.cw-runtimeMeta b[data-tone=needs]{color:color-mix(in srgb,#d9a441 85%,var(--pi-ink))}.cw-runtimeMeta b[data-tone=live]{color:color-mix(in srgb,var(--pi-accent) 82%,var(--pi-ink))}.cw-runtimeMeta time{font-family:var(--pi-mono)}.cw-runtimeCrew{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:var(--space-sm);padding:var(--space-md) var(--space-lg)}.cw-runtimeCrewEmpty{padding:var(--space-md) var(--space-lg);color:var(--pi-dim);font-size:var(--text-xs)}.cw-runtimeCrewChip{display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--pi-hairline);border-radius:9px;background:color-mix(in srgb,var(--hud-surface) 32%,transparent);color:var(--pi-muted);text-align:left;cursor:pointer;transition:border-color .15s var(--pi-ease),background .15s var(--pi-ease),transform .15s var(--pi-ease)}.cw-runtimeCrewChip:hover{border-color:var(--pi-hairline-strong);background:color-mix(in srgb,var(--hud-surface) 44%,transparent);color:var(--pi-ink);transform:translateY(-1px)}.cw-runtimeCrewChip[data-status=needs]{border-color:color-mix(in srgb,#d9a441 40%,var(--pi-hairline))}.cw-runtimeCrewChip[data-status=working]{border-color:color-mix(in srgb,var(--pi-accent) 32%,var(--pi-hairline))}.cw-runtimeCrewChipText{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-runtimeCrewChipTop{display:flex;align-items:center;justify-content:space-between;gap:6px}.cw-runtimeCrewChipName{font-size:var(--text-xs);font-weight:650;color:var(--pi-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-runtimeCrewChipStatus{font-size:10px;font-family:var(--pi-mono);color:var(--pi-dim)}.cw-runtimeCrewChipStatus[data-status=needs]{color:color-mix(in srgb,#d9a441 85%,var(--pi-ink))}.cw-runtimeCrewChipStatus[data-status=working]{color:color-mix(in srgb,var(--pi-accent) 80%,var(--pi-ink))}.cw-runtimeCrewChipSub{display:flex;align-items:center;gap:6px;font-size:11px}.cw-runtimeCrewChipProject{color:var(--pi-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-runtimeCrewChipModel{font-family:var(--pi-mono);font-size:10px;padding:0 4px;border-radius:3px;background:color-mix(in srgb,var(--hud-ink) 7%,transparent);color:var(--pi-dim)}@media(max-width:720px){.cw-toolbar{flex-direction:column;align-items:stretch}.cw-addProject{margin-left:0}.cw-grid{grid-template-columns:1fr}.cw-workspaceHead{flex-wrap:wrap}.cw-workspaceRoot{flex:1 1 100%;order:3}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as p,j as s}from"./index-Bli6bTLU.js";import{A as C}from"./AgentAvatar-B1xvQ7ej.js";import{H as F}from"./HarnessMark-DGZ6o6Ct.js";import{t as N}from"./time-Dhsh_2EG.js";import{o as q}from"./model-IGCUEsMy.js";import{s as O}from"./project-overview-helpers-BQTc_Ous.js";import{F as K,A as Q}from"./AddProjectForm-BNRpRPod.js";import{a as D}from"./agent-specialization-CNrsRbKA.js";import{c as b}from"./createLucideIcon-DLlxGjKt.js";import{C as V}from"./cpu-Bc268H9Q.js";import{S as J}from"./search-BbgsEMXa.js";import{S as X}from"./sliders-horizontal-7V8B3xsf.js";import{M as Y}from"./message-square-DlY4EneU.js";import{F as A}from"./DocumentFocusViewer-DmtFisY9.js";const Z=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],ee=b("rows-3",Z);const se=[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]],te=b("telescope",se);const ne=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],re=b("users",ne);function ae(e){return e.agentId?`agent:${e.agentId}`:`named:${e.harness}:${e.agentName.toLowerCase()}`}function ie(e,a,r){return e?"needs":(r??"").toLowerCase().includes("think")?"thinking":a?"working":"idle"}function R(e){switch(e.status){case"needs":return 3;case"working":return 2;case"thinking":return 1;case"idle":return 0}}function ce(e,a){const r=new Map;for(const t of e){if(t.kind!=="agent")continue;const i=ae(t),l={threadId:t.id,projectSlug:t.projectSlug,projectTitle:t.projectTitle,projectRoot:t.projectRoot,branch:t.branch,working:t.working,needs:t.needs,lastActivityAt:t.lastActivityAt,sessionCount:t.sessionCount,work:t.work,conversationId:t.conversationId},o=r.get(i);if(o){o.substrates.push(l),o.needs=o.needs||t.needs,o.working=o.working||t.working,o.lastActivityAt=Math.max(o.lastActivityAt,t.lastActivityAt),o.sessionCount+=t.sessionCount;continue}const m=t.agentId?a.get(t.agentId)??null:null,u=m?D(m).headline:"Generalist";r.set(i,{key:i,agentId:t.agentId,name:t.agentName,harness:t.harness,model:m?.model??null,effort:m?.reasoningEffort??null,headline:u,status:"idle",needs:t.needs,working:t.working,substrates:[l],primary:l,lastActivityAt:t.lastActivityAt,sessionCount:t.sessionCount,rawState:m?.state??null})}const n=[...r.values()].map(t=>{const i=[...t.substrates].sort((m,u)=>Number(u.working)-Number(m.working)||Number(u.needs)-Number(m.needs)||u.lastActivityAt-m.lastActivityAt),{rawState:l,...o}=t;return{...o,substrates:i,primary:i[0]??t.primary,status:ie(t.needs,t.working,l)}});return n.sort((t,i)=>R(i)-R(t)||i.lastActivityAt-t.lastActivityAt||t.name.localeCompare(i.name)),n}function oe(e,a){const r=new Map;for(const n of e)for(const t of n.substrates){const i=r.get(t.projectSlug)??[];i.push({member:n,substrate:t}),r.set(t.projectSlug,i)}return a.map(n=>{const t=(r.get(n.slug)??[]).sort((i,l)=>Number(l.substrate.working)-Number(i.substrate.working)||Number(l.substrate.needs)-Number(i.substrate.needs)||l.substrate.lastActivityAt-i.substrate.lastActivityAt);return{slug:n.slug,title:n.title,root:n.root,crew:t,needs:n.needs,working:n.working,agentCount:n.agentCount,sessionCount:n.sessionCount,lastActivityAt:n.lastActivityAt}}).sort((n,t)=>+(t.needs>0)-+(n.needs>0)||+(t.working>0)-+(n.working>0)||t.lastActivityAt-n.lastActivityAt||n.title.localeCompare(t.title))}function le(e){const a=new Map;for(const r of e){const n=r.harness.toLowerCase(),t=a.get(n)??[];t.push({member:r,substrate:r.primary}),a.set(n,t)}return[...a.entries()].map(([r,n])=>{const t=n.sort((h,d)=>+(d.member.status==="needs")-+(h.member.status==="needs")||+(d.member.status==="working")-+(h.member.status==="working")||d.member.lastActivityAt-h.member.lastActivityAt||h.member.name.localeCompare(d.member.name)),i=t.filter(h=>h.member.status==="needs").length,l=t.filter(h=>h.member.status==="working"||h.member.status==="thinking").length,o=t.reduce((h,d)=>h+d.member.sessionCount,0),m=t.reduce((h,d)=>Math.max(h,d.member.lastActivityAt),0),u=r?r.charAt(0).toUpperCase()+r.slice(1):"Unknown";return{harness:r,title:u,crew:t,needs:i,working:l,agentCount:t.length,sessionCount:o,lastActivityAt:m}}).sort((r,n)=>+(n.needs>0)-+(r.needs>0)||+(n.working>0)-+(r.working>0)||n.lastActivityAt-r.lastActivityAt||r.title.localeCompare(n.title))}function k(e,a){switch(a){case"all":return!0;case"active":return e.status==="working"||e.status==="thinking";case"needs":return e.status==="needs";case"idle":return e.status==="idle"}}function y(e,a){return a==="all"||e.harness.toLowerCase()===a.toLowerCase()}function v(e,a){const r=a.trim().toLowerCase();return!r||e.name.toLowerCase().includes(r)||e.headline.toLowerCase().includes(r)||e.harness.toLowerCase().includes(r)||e.model?.toLowerCase().includes(r)?!0:e.substrates.some(n=>n.projectTitle.toLowerCase().includes(r)||n.work.toLowerCase().includes(r))}function de(e){return[...new Set(e.map(a=>a.harness.toLowerCase()))].sort()}function S(e){switch(e){case"needs":return"Needs attention";case"working":return"Working";case"thinking":return"Thinking";case"idle":return"Idle"}}const ue=[{id:"all",label:"All"},{id:"active",label:"Active"},{id:"needs",label:"Needs attention"},{id:"idle",label:"Idle"}];function f(e){return e?e.charAt(0).toUpperCase()+e.slice(1):"Harness"}function he(e,a){if(a?.conversationId){e({view:"conversation",conversationId:a.conversationId});return}e({view:"messages"})}function me(e,a){e({view:"code",project:a})}function M(e,a,r){r&&e(q(a,r))}function P(e,a,r){e({view:"agents-v2",projectSlug:r,...a.machineId?{machineId:a.machineId}:{},...a.showEphemeral?{showEphemeral:!0}:{}})}function pe({model:e,agents:a,route:r,navigate:n,nowMs:t}){const[i,l]=p.useState("crew"),[o,m]=p.useState("all"),[u,h]=p.useState("all"),[d,_]=p.useState(""),[$,z]=p.useState(!1),L=p.useMemo(()=>new Map(a.map(c=>[c.id,c])),[a]),w=p.useMemo(()=>ce(e.threads,L),[e.threads,L]),x=p.useMemo(()=>oe(w,e.projects),[w,e.projects]),g=p.useMemo(()=>le(w),[w]),E=p.useMemo(()=>de(w),[w]),G=p.useMemo(()=>w.filter(c=>k(c,o)&&y(c,u)&&v(c,d)),[w,o,u,d]),U=p.useMemo(()=>x.map(c=>({...c,crew:c.crew.filter(j=>k(j.member,o)&&y(j.member,u)&&v(j.member,d))})).filter(c=>c.crew.length>0||o==="all"&&u==="all"&&!d.trim()),[x,o,u,d]),B=p.useMemo(()=>g.map(c=>({...c,crew:c.crew.filter(j=>k(j.member,o)&&y(j.member,u)&&v(j.member,d))})).filter(c=>c.crew.length>0||o==="all"&&u==="all"&&!d.trim()),[g,o,u,d]),W=w.filter(c=>c.status==="needs").length,T=w.filter(c=>c.status==="working"||c.status==="thinking").length;return s.jsxs("main",{className:"cw-root","aria-label":"Crew and workspaces",children:[s.jsxs("div",{className:"cw-toolbar",children:[s.jsxs("div",{className:"cw-modeToggle",role:"group","aria-label":"View mode",children:[s.jsxs("button",{type:"button","data-active":i==="crew"||void 0,onClick:()=>l("crew"),title:"Personas & Agent Crew matrix",children:[s.jsx(re,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Crew (Personas)"]}),s.jsxs("button",{type:"button","data-active":i==="workspace"||void 0,onClick:()=>l("workspace"),title:"Group by repository workspace",children:[s.jsx(ee,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Workspace lens"]}),s.jsxs("button",{type:"button","data-active":i==="runtime"||void 0,onClick:()=>l("runtime"),title:"Group by runtime engine and models",children:[s.jsx(V,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Runtime engines"]})]}),s.jsxs("label",{className:"cw-search",role:"search",children:[s.jsx(J,{size:13,strokeWidth:1.8,"aria-hidden":!0}),s.jsx("input",{type:"search",value:d,placeholder:"Find persona, runtime, workspace, or task","aria-label":"Find persona, runtime, workspace, or task",onChange:c=>_(c.currentTarget.value)})]}),s.jsxs("div",{className:"cw-filters","aria-label":"Status filter",children:[s.jsx(X,{size:12,strokeWidth:1.9,"aria-hidden":!0,className:"cw-filtersIcon"}),ue.map(c=>s.jsx("button",{type:"button","data-active":o===c.id||void 0,onClick:()=>m(c.id),children:c.label},c.id))]}),s.jsxs("label",{className:"cw-harnessSelect",title:"Filter by runtime",children:[s.jsx("span",{className:"pi-srOnly",children:"Filter by runtime"}),s.jsxs("select",{value:u,onChange:c=>h(c.currentTarget.value),children:[s.jsx("option",{value:"all",children:"All runtimes"}),E.map(c=>s.jsx("option",{value:c,children:f(c)},c))]})]}),s.jsxs("button",{type:"button",className:"cw-addProject","aria-expanded":$,onClick:()=>z(c=>!c),children:[s.jsx(K,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Add project"]})]}),$?s.jsx(Q,{onClose:()=>z(!1)}):null,s.jsxs("div",{className:"cw-digest",children:[s.jsxs("span",{children:[w.length," personas"]}),s.jsx("span",{className:"cw-digestSep",children:"·"}),s.jsxs("span",{"data-tone":T>0?"live":void 0,children:[T," moving"]}),W>0?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"cw-digestSep",children:"·"}),s.jsxs("span",{"data-tone":"needs",children:[W," needs you"]})]}):null,s.jsx("span",{className:"cw-digestSep",children:"·"}),s.jsxs("span",{children:[e.projects.length," workspaces"]}),s.jsx("span",{className:"cw-digestSep",children:"·"}),s.jsxs("span",{children:[g.length," runtimes"]})]}),i==="crew"?s.jsx(we,{members:G,route:r,navigate:n,nowMs:t,allEmpty:w.length===0}):i==="workspace"?s.jsx(ge,{workspaces:U,route:r,navigate:n,nowMs:t,allEmpty:x.length===0}):s.jsx(ye,{runtimes:B,route:r,navigate:n,nowMs:t,allEmpty:g.length===0})]})}function we({members:e,route:a,navigate:r,nowMs:n,allEmpty:t}){return e.length===0?s.jsx("div",{className:"cw-empty",children:t?"No crew members are registered yet.":"No crew members match these filters."}):s.jsx("div",{className:"cw-grid",children:e.map(i=>s.jsx(je,{member:i,route:a,navigate:r,nowMs:n},i.key))})}function je({member:e,route:a,navigate:r,nowMs:n}){const t=e.primary,i=e.substrates.filter(l=>l.threadId!==t.threadId);return s.jsxs("article",{className:"cw-card","data-status":e.status,children:[s.jsxs("header",{className:"cw-cardHead",children:[s.jsx(C,{agent:{name:e.name,harness:e.harness,state:I(e.status)},placement:"hero",size:46,presence:!0}),s.jsxs("div",{className:"cw-cardIdentity",children:[s.jsxs("div",{className:"cw-cardNameRow",children:[s.jsx("b",{title:e.name,children:e.name}),s.jsx("span",{className:"cw-statusPill","data-status":e.status,children:S(e.status)})]}),s.jsx("div",{className:"cw-cardSubline",children:s.jsx("span",{className:"cw-headline",children:e.headline})})]})]}),s.jsx("div",{className:"cw-coordStrip",children:s.jsxs("div",{className:"cw-runtimeBadge",title:`Runtime: ${f(e.harness)}${e.model?` · ${e.model}`:""}${e.effort?` (${e.effort})`:""}`,children:[s.jsx(F,{harness:e.harness,size:11}),s.jsx("span",{children:f(e.harness)}),e.model?s.jsx("i",{children:e.model}):null,e.effort?s.jsx("em",{children:e.effort}):null]})}),s.jsxs("div",{className:"cw-substrates",children:[s.jsx(H,{substrate:t,route:a,navigate:r,primary:!0}),i.map(l=>s.jsx(H,{substrate:l,route:a,navigate:r},l.threadId))]}),s.jsxs("div",{className:"cw-work",children:[s.jsx("p",{title:t.work,children:t.work}),s.jsx("time",{children:t.lastActivityAt?N(t.lastActivityAt,n):"—"})]}),s.jsxs("footer",{className:"cw-cardActions",children:[s.jsxs("button",{type:"button",onClick:()=>he(r,t),children:[s.jsx(Y,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Chat"]}),s.jsxs("button",{type:"button",onClick:()=>me(r,t.projectSlug),children:[s.jsx(A,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Browse code"]}),s.jsxs("button",{type:"button",onClick:()=>M(r,a,e.agentId),children:[s.jsx(te,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Inspect"]})]})]})}function I(e){switch(e){case"needs":return"needs_attention";case"working":return"in_turn";case"thinking":return"thinking";case"idle":return"idle"}}function H({substrate:e,route:a,navigate:r,primary:n=!1}){return s.jsxs("button",{type:"button",className:"cw-substrateChip","data-primary":n||void 0,"data-live":e.working||void 0,title:e.projectRoot??void 0,onClick:()=>P(r,a,e.projectSlug),children:[s.jsx(A,{size:11,strokeWidth:1.8,"aria-hidden":!0}),s.jsx("span",{children:e.projectTitle}),e.branch?s.jsxs("em",{children:["git: ",e.branch]}):null]})}function ge({workspaces:e,route:a,navigate:r,nowMs:n,allEmpty:t}){return e.length===0?s.jsx("div",{className:"cw-empty",children:t?"No projects are tracked yet.":"No workspaces match these filters."}):s.jsx("div",{className:"cw-workspaceList",children:e.map(i=>s.jsx(xe,{workspace:i,route:a,navigate:r,nowMs:n},i.slug))})}function xe({workspace:e,route:a,navigate:r,nowMs:n}){return s.jsxs("article",{className:"cw-workspace","data-state":e.needs>0?"needs":e.working>0?"live":void 0,children:[s.jsxs("button",{type:"button",className:"cw-workspaceHead",onClick:()=>P(r,a,e.slug),children:[s.jsxs("span",{className:"cw-workspaceTitle",children:[s.jsx(A,{size:13,strokeWidth:1.7,"aria-hidden":!0}),"/",e.title]}),s.jsx("span",{className:"cw-workspaceRoot",title:e.root??void 0,children:e.root?O(e.root):"Discovered project"}),s.jsxs("span",{className:"cw-workspaceMeta",children:[e.needs>0?s.jsxs("b",{"data-tone":"needs",children:[e.needs," needs you"]}):null,e.working>0?s.jsxs("b",{"data-tone":"live",children:[e.working," moving"]}):null,s.jsxs("span",{children:[e.sessionCount," sessions"]}),s.jsx("time",{children:e.lastActivityAt?N(e.lastActivityAt,n):"no activity"})]})]}),e.crew.length>0?s.jsx("div",{className:"cw-workspaceCrew","aria-label":"Crew stationed here",children:e.crew.map(t=>s.jsx(ke,{station:t,route:a,navigate:r},`${e.slug}:${t.member.key}`))}):s.jsx("div",{className:"cw-workspaceCrewEmpty",children:"No crew stationed here."})]})}function ke({station:e,route:a,navigate:r}){const{member:n,substrate:t}=e;return s.jsxs("button",{type:"button",className:"cw-crewChip","data-status":n.status,onClick:()=>M(r,a,n.agentId),title:`${n.name} (${n.headline}) · ${t.work}`,children:[s.jsx(C,{agent:{name:n.name,harness:n.harness,state:I(n.status)},size:22,presence:!0}),s.jsx("span",{className:"cw-crewChipName",children:n.name}),s.jsx("span",{className:"cw-crewChipStatus","data-status":n.status,children:S(n.status)}),t.branch?s.jsxs("span",{className:"cw-crewChipBranch",children:["git: ",t.branch]}):null]})}function ye({runtimes:e,route:a,navigate:r,nowMs:n,allEmpty:t}){return e.length===0?s.jsx("div",{className:"cw-empty",children:t?"No runtime engines are active.":"No runtimes match these filters."}):s.jsx("div",{className:"cw-runtimeList",children:e.map(i=>s.jsx(ve,{runtime:i,route:a,navigate:r,nowMs:n},i.harness))})}function ve({runtime:e,route:a,navigate:r,nowMs:n}){return s.jsxs("article",{className:"cw-runtimeRow","data-state":e.needs>0?"needs":e.working>0?"live":void 0,children:[s.jsxs("header",{className:"cw-runtimeHead",children:[s.jsxs("div",{className:"cw-runtimeTitle",children:[s.jsx("span",{className:"cw-runtimeHarnessIcon",children:s.jsx(F,{harness:e.harness,size:15})}),s.jsxs("b",{children:[e.title," Engine"]}),s.jsx("span",{className:"cw-runtimeHarnessSlug",children:e.harness})]}),s.jsxs("div",{className:"cw-runtimeMeta",children:[e.needs>0?s.jsxs("b",{"data-tone":"needs",children:[e.needs," needs you"]}):null,e.working>0?s.jsxs("b",{"data-tone":"live",children:[e.working," moving"]}):null,s.jsxs("span",{children:[e.agentCount," ",e.agentCount===1?"persona":"personas"]}),s.jsx("span",{className:"cw-digestSep",children:"·"}),s.jsxs("span",{children:[e.sessionCount," sessions"]}),s.jsx("time",{children:e.lastActivityAt?N(e.lastActivityAt,n):"no activity"})]})]}),e.crew.length>0?s.jsx("div",{className:"cw-runtimeCrew","aria-label":`Crew running on ${e.title}`,children:e.crew.map(t=>s.jsx(fe,{station:t,route:a,navigate:r},`${e.harness}:${t.member.key}`))}):s.jsx("div",{className:"cw-runtimeCrewEmpty",children:"No crew running on this harness."})]})}function fe({station:e,route:a,navigate:r}){const{member:n,substrate:t}=e;return s.jsxs("button",{type:"button",className:"cw-runtimeCrewChip","data-status":n.status,onClick:()=>M(r,a,n.agentId),title:`${n.name} (${n.headline}) · ${t.projectTitle} · ${t.work}`,children:[s.jsx(C,{agent:{name:n.name,harness:n.harness,state:I(n.status)},size:24,presence:!0}),s.jsxs("div",{className:"cw-runtimeCrewChipText",children:[s.jsxs("div",{className:"cw-runtimeCrewChipTop",children:[s.jsx("span",{className:"cw-runtimeCrewChipName",children:n.name}),s.jsx("span",{className:"cw-runtimeCrewChipStatus","data-status":n.status,children:S(n.status)})]}),s.jsxs("div",{className:"cw-runtimeCrewChipSub",children:[s.jsx("span",{className:"cw-runtimeCrewChipProject",children:t.projectTitle}),n.model?s.jsx("span",{className:"cw-runtimeCrewChipModel",children:n.model}):null]})]})]})}const Fe=Object.freeze(Object.defineProperty({__proto__:null,CrewWorkspaces:pe},Symbol.toStringTag,{value:"Module"}));export{pe as C,re as U,Fe as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as u}from"./createLucideIcon-DLlxGjKt.js";import{r,j as e}from"./index-Bli6bTLU.js";import{T as H}from"./TextDocumentSurface-C7fGlzY8.js";import{F as A}from"./file-text-BVhkMWyC.js";import{X as R}from"./x-BJyPzFnn.js";const S=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Z=u("folder-open",S);const W=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],G=u("folder",W);const B=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],T=u("maximize-2",B);const V=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],C=u("minimize-2",V);function J({open:a=!0,focusable:M=!0,kind:F,document:t,title:z,eyebrow:v,subtitle:w,meta:x=[],mode:$,actions:L=[],state:j,error:c,notice:p,body:d,onClose:o}){const[i,m]=r.useState(!1),[g,y]=r.useState({}),b=r.useRef(null);if(r.useEffect(()=>{a||m(!1)},[a]),r.useEffect(()=>{if(!a)return;let s=null;const l=b.current?.closest(".frame-scrollbar, .s-content")??null,N=()=>{if(!l){y({});return}const n=l.getBoundingClientRect();y({"--doc-focus-layer-top":`${Math.max(0,n.top)}px`,"--doc-focus-layer-right":`${Math.max(0,window.innerWidth-n.right)}px`,"--doc-focus-layer-bottom":`${Math.max(0,window.innerHeight-n.bottom)}px`,"--doc-focus-layer-left":`${Math.max(0,n.left)}px`})},h=()=>{s!==null&&cancelAnimationFrame(s),s=requestAnimationFrame(N)};N();const E=l?new ResizeObserver(h):null;return l&&E?.observe(l),window.addEventListener("resize",h),()=>{s!==null&&cancelAnimationFrame(s),E?.disconnect(),window.removeEventListener("resize",h)}},[a]),r.useEffect(()=>{if(!a)return;const s=f=>{f.key==="Escape"&&(f.preventDefault(),i?m(!1):o?.())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[i,o,a]),!a)return null;const k=z??t?.title??"Document",D=$??(t?.kind==="markdown"?"preview":"read"),_=M&&!!(t||d);return e.jsxs("div",{ref:b,className:`s-doc-focus-layer${i?" s-doc-focus-layer-focused":""}`,style:g,children:[o&&e.jsx("button",{type:"button",className:"s-doc-focus-scrim","aria-label":"Dismiss document viewer",tabIndex:-1,onClick:o}),e.jsxs("section",{className:`s-doc-focus-viewer s-doc-focus-viewer-${F}${i?" s-doc-focus-viewer-focused":""}`,"aria-label":k,role:"dialog","aria-modal":"true",children:[e.jsxs("div",{className:"s-doc-focus-viewer-head",children:[e.jsxs("div",{className:"s-doc-focus-viewer-title-wrap",children:[e.jsx("div",{className:"s-doc-focus-viewer-icon","aria-hidden":"true",children:e.jsx(A,{size:15,strokeWidth:1.8})}),e.jsxs("div",{className:"s-doc-focus-viewer-title-main",children:[v&&e.jsx("div",{className:"s-doc-focus-viewer-eyebrow",children:v}),e.jsx("h3",{className:"s-doc-focus-viewer-title",children:k}),w&&e.jsx("div",{className:"s-doc-focus-viewer-subtitle",children:w})]})]}),e.jsxs("div",{className:"s-doc-focus-viewer-actions",children:[x.length>0&&e.jsx("div",{className:"s-doc-focus-viewer-meta","aria-label":"Document metadata",children:x.map(s=>e.jsx("span",{children:s},s))}),L.map(s=>e.jsxs("button",{type:"button",className:`s-doc-focus-viewer-action${s.hideLabel?" s-doc-focus-viewer-action-icon":""}`,onClick:s.onClick,title:s.title??s.label,disabled:s.disabled,"aria-label":s.hideLabel?s.label:void 0,children:[s.icon,!s.hideLabel&&e.jsx("span",{children:s.label})]},s.label)),_&&e.jsx("button",{type:"button",className:"s-doc-focus-viewer-close",onClick:()=>m(s=>!s),"aria-label":i?"Exit focus mode":"Enter focus mode",title:i?"Exit focus mode":"Focus",children:i?e.jsx(C,{"aria-hidden":"true",size:14,strokeWidth:1.8}):e.jsx(T,{"aria-hidden":"true",size:14,strokeWidth:1.8})}),o&&e.jsx("button",{type:"button",className:"s-doc-focus-viewer-close",onClick:o,"aria-label":"Close document viewer",title:"Close",children:e.jsx(R,{"aria-hidden":"true",size:14,strokeWidth:1.8})})]})]}),j&&!c&&!t&&!d&&e.jsx("div",{className:"s-doc-focus-viewer-state",children:j}),c&&e.jsx("div",{className:"s-doc-focus-viewer-state s-doc-focus-viewer-error",children:c}),!c&&d&&e.jsx("div",{className:"s-doc-focus-viewer-body",children:d}),!c&&!d&&t&&e.jsx(H,{document:t,mode:D,showHeader:!1,className:"s-doc-focus-document"}),!c&&p&&e.jsx("div",{className:"s-doc-focus-viewer-notice",children:p})]})]})}export{J as D,G as F,T as M,Z as a,C as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as s}from"./index-Bli6bTLU.js";import{a as k}from"./api-DEHEgJ9m.js";import{u as R}from"./sse-CSozY6mp.js";import{d as $,t as F}from"./time-Dhsh_2EG.js";import{SessionRefScreen as j}from"./SessionRefScreen-BmKhf29o.js";/* empty css */import{c as E}from"./createLucideIcon-DLlxGjKt.js";import{X as A}from"./x-BJyPzFnn.js";import"./index-BWHgHrtv.js";import"./tail-events-CrN-Rmxj.js";import"./BackToPicker-CqYhOaLB.js";import"./router-B0YclXYg.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./ConversationScreen-CjWWmuuh.js";import"./NewChatComposer-Bgqes0UQ.js";import"./text-BR9Bap0E.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DoT8gpw6.js";import"./conversation-model-CigSPlKA.js";import"./colors-BtO5_zlx.js";import"./index-DFdlQs_c.js";import"./HarnessMark-DGZ6o6Ct.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./keyboard-nav-7iEtvu9P.js";import"./chevron-down-Da5tV19_.js";import"./search-BbgsEMXa.js";import"./file-text-BVhkMWyC.js";import"./ConversationComposer-Ce7Byw48.js";import"./AgentAvatar-B1xvQ7ej.js";import"./Provider-Ve8yXaWR.js";import"./provider-CX9EWecp.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./SpriteAvatar-DMrSssNZ.js";import"./agent-identity-DzHGhLdJ.js";import"./zap-rw7uwZht.js";import"./message-markup-DAnnGpWr.js";import"./mentions-Cd6XticV.js";import"./AgentDetailCard-FelCxQrT.js";import"./AgentLiveActions-Bn3zeZBN.js";import"./terminal-takeover-CtA3wcXh.js";import"./openContent-C6XO6kr5.js";import"./eye-BeCSqJn1.js";import"./terminal-BiNIXhna.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-C3sg0ULI.js";import"./AstronautSuit-BADl7m8x.js";import"./ConversationFeedRows-DygDfQn_.js";import"./ConversationPanels-Dg4Y2GgX.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-BLn59zLn.js";import"./proxy-C35W-YHZ.js";import"./activity-D4W2XZY2.js";import"./message-circle-44KSmbvQ.js";import"./ConversationStatus-BhVIYQza.js";import"./check-Bfs7hMb1.js";import"./sparkles-ytTwpCbZ.js";import"./SessionObserve-zAlFbwFn.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-197xYmRp.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-D85P6RAk.js";import"./ObserveTextFlow-C1f5oize.js";import"./SessionObserveEvidence-BVawzqoE.js";import"./wrench-CQvdf7KT.js";import"./external-link-BGHC_naA.js";/* empty css */const T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],L=E("columns-2",T);function S(t){const o=new Map;for(const r of t)o.delete(r.sessionId),o.set(r.sessionId,r);return[...o.values()]}function M(t,o){const r=S(t),p=o?.trim()||null;return r.find(n=>n.sessionId===p)?.sessionId??r.at(-1)?.sessionId??p}function O(t){return t.length<=34?t:`${t.slice(0,15)}…${t.slice(-14)}`}function q(t,o){return o===0?t.strategy||"dispatch":t.strategy?`switched via ${t.strategy}`:"session changed"}function y({label:t,sessions:o,value:r,onChange:p}){return s.jsxs("label",{className:"s-flight-observe-select-wrap",children:[s.jsx("span",{children:t}),s.jsx("select",{className:"s-flight-observe-select",value:r,onChange:n=>p(n.currentTarget.value),children:o.map(n=>s.jsxs("option",{value:n.sessionId,children:[n.harness?`${n.harness} · `:"",n.sessionId]},n.sessionId))})]})}function ge({route:t,navigate:o}){const[r,p]=c.useState(null),[n,I]=c.useState(!0),[h,N]=c.useState(null),u=c.useCallback(async()=>{try{const e=await k(`/api/flights?active=false&flightId=${encodeURIComponent(t.flightId)}`);p(e[0]??null),N(e.length===0?"This flight is not available on the connected broker.":null)}catch(e){N(e instanceof Error?e.message:String(e))}finally{I(!1)}},[t.flightId]);c.useEffect(()=>{I(!0),u()},[u]),R(()=>{u()});const v=r?.sessions??[],a=c.useMemo(()=>S(v),[v]),g=M(v,t.sessionId),i=a.find(e=>e.sessionId===g)??null,l=a.find(e=>e.sessionId===t.compareSessionId)??null,f=!!(i&&l&&i.sessionId!==l.sessionId),m=c.useCallback((e,d)=>{o({...t,sessionId:e,...d?{compareSessionId:d}:{compareSessionId:void 0}})},[o,t]),w=c.useCallback(()=>{if(!i||a.length<2)return;const e=[...a].reverse().find(d=>d.sessionId!==i.sessionId);e&&m(i.sessionId,e.sessionId)},[i,a,m]),C=c.useCallback(e=>{if(!f||!i||!l){m(e);return}m(e,e===l.sessionId?i.sessionId:l.sessionId)},[l,i,f,m]);return s.jsxs("div",{className:"s-flight-observe",children:[s.jsxs("header",{className:"s-flight-observe-header",children:[s.jsxs("div",{className:"s-flight-observe-heading",children:[s.jsx("div",{className:"s-flight-observe-eyebrow",children:"Flight observe"}),s.jsxs("div",{className:"s-flight-observe-title-row",children:[s.jsx("h2",{children:r?.agentName||r?.agentId||"Flight"}),s.jsx("span",{className:`s-flight-observe-state s-flight-observe-state--${r?.state??"loading"}`,children:r?.state??(n?"loading":"unknown")})]}),s.jsx("div",{className:"s-flight-observe-id",title:t.flightId,children:t.flightId}),r?.summary&&s.jsx("p",{children:r.summary})]}),s.jsxs("div",{className:"s-flight-observe-actions",children:[a.length>1&&!f&&s.jsxs("button",{type:"button",onClick:w,children:[s.jsx(L,{size:13})," Split view"]}),f&&i&&s.jsxs("button",{type:"button",onClick:()=>m(i.sessionId),children:[s.jsx(A,{size:13})," Close split"]})]})]}),v.length>0&&s.jsx("nav",{className:"s-flight-observe-trace","aria-label":"Flight session history",children:v.map((e,d)=>{const b=i?.sessionId===e.sessionId,x=l?.sessionId===e.sessionId;return s.jsxs("div",{className:"s-flight-observe-trace-step",children:[d>0&&s.jsx("span",{className:"s-flight-observe-trace-arrow","aria-hidden":"true",children:"→"}),s.jsxs("button",{type:"button",className:"s-flight-observe-session-chip","data-selected":b||x,"data-observe-role":b?"primary":x?"compare":"idle","aria-pressed":b||x,title:e.sessionId,onClick:()=>C(e.sessionId),children:[s.jsxs("span",{className:"s-flight-observe-session-chip-top",children:[s.jsx("span",{children:e.harness||e.transport||"session"}),s.jsx("time",{title:new Date(e.startedAt).toLocaleString(),children:$(e.startedAt)||F(e.startedAt)})]}),s.jsx("strong",{children:O(e.sessionId)}),s.jsx("small",{children:q(e,d)})]})]},`${e.sessionId}:${e.startedAt}:${d}`)})}),h&&!g&&s.jsx("div",{className:"s-flight-observe-message s-flight-observe-message--error",children:h}),h&&g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Flight record unavailable"}),s.jsx("span",{children:"Showing the concrete session captured by this link."})]}),!h&&n&&s.jsx("div",{className:"s-flight-observe-message",children:"Resolving the flight’s session trace…"}),!h&&!n&&a.length===0&&!g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Waiting for a session"}),s.jsx("span",{children:"The flight is stable here; its trace will appear as soon as a harness acknowledges dispatch."})]}),g&&!f&&s.jsx("main",{className:"s-flight-observe-single",children:s.jsx(j,{sessionRef:g,navigate:o})}),!h&&i&&l&&f&&s.jsxs("main",{className:"s-flight-observe-split",children:[s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Primary session",sessions:a,value:i.sessionId,onChange:e=>m(e,e===l.sessionId?i.sessionId:l.sessionId)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(j,{sessionRef:i.sessionId,navigate:o,showObserveRail:!1})})]}),s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Compare session",sessions:a.filter(e=>e.sessionId!==i.sessionId),value:l.sessionId,onChange:e=>m(i.sessionId,e)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(j,{sessionRef:l.sessionId,navigate:o,showObserveRail:!1})})]})]})]})}export{ge as FlightObserveScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as u,j as e}from"./index-Bli6bTLU.js";import{H as R,h as q}from"./HarnessMark-DGZ6o6Ct.js";import{a as M}from"./api-DEHEgJ9m.js";import{d as D}from"./router-B0YclXYg.js";import{t as O,n as S,f as L}from"./time-Dhsh_2EG.js";import{u as P}from"./Provider-Ve8yXaWR.js";import{u as T}from"./useContentSecondaryNav-D-hVKzM9.js";import{OpsSubnav as E}from"./OpsSubnav-BijKI3yG.js";/* empty css */import{R as U}from"./refresh-cw-IgN2fZLM.js";import{E as $}from"./external-link-BGHC_naA.js";import{c as H}from"./createLucideIcon-DLlxGjKt.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./provider-CX9EWecp.js";import"./sse-CSozY6mp.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./file-text-BVhkMWyC.js";import"./x-BJyPzFnn.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-7iEtvu9P.js";import"./NewChatComposer-Bgqes0UQ.js";import"./text-BR9Bap0E.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DoT8gpw6.js";import"./conversation-model-CigSPlKA.js";import"./index-DFdlQs_c.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./chevron-down-Da5tV19_.js";import"./search-BbgsEMXa.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./SecondaryNav-cYTw2p39.js";import"./secondaryNavConfig-DyC_P9Wx.js";import"./message-square-DlY4EneU.js";import"./compass-BepM5iWH.js";import"./settings-BzWCF3NF.js";import"./terminal-BiNIXhna.js";import"./git-branch-q8Ayc8py.js";import"./scroll-text-DRidbcse.js";/* empty css */const _=[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],z=H("clipboard-paste",_),B={codex:"Codex",claude:"Claude",kimi:"Kimi",minimax:"MiniMax",cursor:"Cursor",native:"Native",worker:"Worker",bridge:"Bridge",http:"HTTP",pi:"Pi",flue:"Flue",github:"GitHub",unknown:"Unknown"},C=[{id:"claude",description:"Anthropic plan windows captured from Claude Code.",links:[{label:"Usage",href:"https://claude.ai/settings/usage"},{label:"Manage plan",href:"https://claude.ai/settings/billing"}]},{id:"codex",description:"OpenAI plan windows reported by local Codex sessions.",links:[{label:"Usage",href:"https://chatgpt.com/codex/settings/usage"},{label:"Open Codex",href:"https://chatgpt.com/codex"}]},{id:"kimi",description:"Kimi Code subscription windows and membership level.",links:[{label:"Kimi Code",href:"https://www.kimi.com/code"},{label:"Docs",href:"https://www.kimi.com/code/docs/en/"}]},{id:"grok",description:"SuperGrok quota reported by local Grok, with dashboard capture and local activity as fallbacks.",links:[{label:"Open Grok",href:"https://grok.com/"},{label:"Billing",href:"https://grok.com/?_s=billing"},{label:"Help",href:"https://docs.x.ai/grok/faq"}]},{id:"minimax",description:"MiniMax Token Plan 5-hour and weekly allowance.",links:[{label:"Usage",href:"https://platform.minimax.io/console/plan"},{label:"Docs",href:"https://platform.minimax.io/docs/token-plan/intro"}]},{id:"cursor",description:"Cursor membership detected locally, plus usage totals from an exported dashboard capture.",links:[{label:"Usage",href:"https://cursor.com/dashboard/usage"},{label:"Manage plan",href:"https://cursor.com/dashboard/billing"}]}],G={cloudflare:[{label:"Dashboard",href:"https://dash.cloudflare.com/"},{label:"Billing",href:"https://dash.cloudflare.com/?to=/:account/billing"}],vercel:[{label:"Dashboard",href:"https://vercel.com/dashboard"},{label:"Billing",href:"https://vercel.com/account/billing"}],exe:[{label:"VMs",href:"https://exe.dev/"},{label:"Billing",href:"https://exe.dev/user/billing"},{label:"Docs",href:"https://exe.dev/docs/what-is-exe"}]},V={exe:{category:"Agent compute",description:"Persistent VMs for remote Scout agents and isolated workloads."},cloudflare:{category:"Edge platform",description:"Workers, networking, and edge infrastructure available for deployment."},vercel:{category:"App hosting",description:"Projects, preview environments, and production deployments."}};function W({provider:s}){return e.jsx("span",{className:`hs-cloud-mark hs-cloud-mark--${s}`,"aria-hidden":"true",children:s==="exe"?e.jsx("img",{src:"https://exe.dev/apple-touch-icon.png",alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer"}):e.jsx("svg",{viewBox:"0 0 24 24",focusable:"false",children:s==="cloudflare"?e.jsx("path",{d:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268Zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727"}):e.jsx("path",{d:"m12 1.608 12 20.784H0Z"})})})}function F(s){const t=(s??"").trim().toLowerCase();return t?t.includes("claude")?"claude":t.includes("codex")?"codex":t.includes("cursor")?"cursor":t.includes("kimi")||t.includes("moonshot")?"kimi":t.includes("minimax")?"minimax":t.includes("github")?"github":t.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown":"unknown"}function N(s){return B[s]??q(s)}function K(s){switch(s){case"weekly":return"7d";case"req/h":return"1h";default:return s||"quota"}}function v(s){return s.windows&&s.windows.length>0?s.windows:[{label:K(s.unitLabel),fill:s.fill,usedLabel:s.usedLabel,capLabel:s.capLabel,unitLabel:s.unitLabel,resetAt:s.resetAt}]}function Q(s){return s.capLabel==="100%"&&s.usedLabel.endsWith("%")?s.usedLabel:`${s.usedLabel}/${s.capLabel}`}function A(s){return s>=.9?"err":s>=.75?"warn":"ok"}function Z(s,t=30){const a=s??[];if(a.length<=t)return a;if(t<=1)return[a[a.length-1]];const r=(a.length-1)/(t-1);return Array.from({length:t},(n,o)=>a[Math.round(o*r)])}function I(s){const t=Math.floor((s-Date.now())/1e3),a=t<0,r=Math.abs(t);let n;if(r>=86400){const o=Math.floor(r/86400),c=Math.floor(r%86400/3600);n=c>0?`${o}d ${c}h`:`${o}d`}else if(r>=3600){const o=Math.floor(r/3600),c=Math.floor(r%3600/60);n=c>0?`${o}h ${c}m`:`${o}h`}else n=`${Math.max(1,Math.floor(r/60))}m`;return a?`stale ${n}`:n}function J(s){if(!s)return null;const t=S(s.capturedAt);if(t)return t;if(s.kind!=="quota")return null;const a=v(s).reduce((r,n)=>{const o=S(n.capturedAt);return Math.max(r??0,o??0)||r},null);return a||v(s).flatMap(r=>r.history??[]).reduce((r,n)=>{const o=S(n.capturedAt);return Math.max(r??0,o??0)||r},null)}function X({provider:s,onImported:t}){const[a,r]=u.useState(!1),[n,o]=u.useState(""),[c,b]=u.useState(!1),[i,d]=u.useState(null),l=`hs-${s}-dashboard-capture`,m=N(s);if(!a)return e.jsxs("button",{type:"button",className:"hs-dashboard-capture-trigger",onClick:()=>r(!0),children:[e.jsx(z,{size:12,"aria-hidden":"true"}),"Import dashboard"]});const x=async p=>{if(p.preventDefault(),!(!n.trim()||c)){b(!0),d(null);try{await M("/api/service-budgets/dashboard-import",{method:"POST",body:JSON.stringify({provider:s,text:n})}),o(""),d("Usage snapshot imported."),await t()}catch(h){d(h instanceof Error?h.message:String(h))}finally{b(!1)}}};return e.jsxs("form",{className:"hs-dashboard-capture",onSubmit:p=>{x(p)},children:[e.jsxs("label",{htmlFor:l,children:[m," usage snapshot"]}),e.jsxs("p",{children:[s==="cursor"?"Paste the exported Usage CSV or copied usage table.":"Copy the signed-in Usage panel and paste it here."," ","Scout keeps only normalized totals, not this text."]}),e.jsx("textarea",{id:l,value:n,onChange:p=>o(p.target.value),maxLength:128*1024,rows:5,placeholder:s==="cursor"?"Date (UTC),Type,Model,Tokens,Cost…":"Weekly SuperGrok… Limit · 12% used · Resets…","aria-describedby":i?`${l}-message`:void 0}),i?e.jsx("span",{id:`${l}-message`,className:"hs-dashboard-capture-message",role:"status",children:i}):null,e.jsxs("div",{className:"hs-dashboard-capture-actions",children:[e.jsx("button",{type:"button",onClick:()=>{r(!1),d(null)},disabled:c,children:"Cancel"}),e.jsx("button",{type:"submit",disabled:!n.trim()||c,children:c?"Importing…":"Use snapshot"})]})]})}function Y(s){const t=new Map(s.map(a=>[F(a.id),a]));return C.map(({id:a})=>({id:a,label:N(a),gauge:t.get(a)??null}))}function ee({points:s}){const t=Z(s);return t.length===0?e.jsx("span",{className:"hs-history hs-history-empty",children:"live"}):e.jsx("span",{className:"hs-history","aria-label":`${t.length} budget samples`,children:t.map((a,r)=>{const n=Math.max(.06,Math.min(1,a.fill));return e.jsx("span",{className:`hs-history-bar hs-history-bar--${A(a.fill)}`,style:{height:`${Math.round(n*100)}%`},title:`${L(a.capturedAt)||"unknown"} ${a.usedLabel}`},`${a.capturedAt}:${r}`)})})}function se({gauge:s,window:t}){const a=Math.max(0,Math.min(100,Math.round(t.fill*100))),r=100-a,n=A(t.fill),o=Number.isFinite(t.resetAt)?new Date(t.resetAt).toISOString():void 0;return e.jsxs("div",{className:"hs-subscription-window",children:[e.jsxs("div",{className:"hs-subscription-window-head",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"hs-subscription-window-label",children:[t.label," window"]}),e.jsxs("strong",{className:`hs-subscription-usage hs-subscription-usage--${n}`,children:[a,"% used"]})]}),e.jsxs("div",{className:"hs-subscription-remaining",children:[e.jsxs("strong",{children:[r,"%"]}),e.jsx("span",{children:"available"})]})]}),e.jsx("div",{className:"hs-subscription-meter",role:"progressbar","aria-label":`${s.label} ${t.label} usage`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,children:e.jsx("span",{className:`hs-subscription-meter-fill hs-subscription-meter-fill--${n}`,style:{width:`${a}%`}})}),e.jsxs("div",{className:"hs-subscription-window-meta",children:[e.jsxs("span",{children:[Q(t)," ",t.unitLabel==="quota"?"quota":t.unitLabel]}),e.jsxs("span",{children:["resets in ",I(t.resetAt),o?e.jsx("time",{dateTime:o,title:L(t.resetAt)||void 0,children:` · ${L(t.resetAt)||""}`}):null]})]}),e.jsx(ee,{points:t.history})]})}function te(){return e.jsxs("div",{className:"hs-subscription-loading","aria-hidden":"true",children:[e.jsx("span",{className:"hs-loading-line hs-loading-line--label"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--value"}),e.jsx("span",{className:"hs-loading-meter"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--meta"}),e.jsx("span",{className:"hs-loading-history"})]})}function ae({rows:s,loading:t,onImported:a}){const r=C.map(i=>({provider:i,row:s.find(d=>d.id===i.id)??null})),n=r.filter(({row:i})=>i?.gauge).length,o=r.filter(({row:i})=>i?.gauge?.kind==="quota").length,c=r.filter(({row:i})=>i?.gauge?.kind==="quota"&&i.gauge.plan||i?.gauge?.kind==="status").length,b=r.flatMap(({row:i})=>i?.gauge?.kind==="quota"?v(i.gauge):[]).map(i=>i.resetAt).filter(i=>i>Date.now()).sort((i,d)=>i-d)[0];return e.jsxs("section",{className:"hs-subscriptions","aria-labelledby":"hs-subscriptions-title","aria-busy":t,children:[e.jsxs("div",{className:"hs-section-head hs-subscriptions-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-subscriptions-title",children:"Subscriptions"}),e.jsx("p",{children:"Plans, remaining allowance, reset windows, and the fastest path to each provider dashboard."})]}),e.jsxs("div",{className:"hs-subscription-summary","aria-label":"Subscription feed summary",children:[e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":n})," detected"]}),e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":o})," usage feeds"]}),e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":c})," plans named"]}),e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":b?I(b):"-"})," next reset"]})]})]}),e.jsx("div",{className:"hs-subscription-grid",children:r.map(({provider:i,row:d})=>{const l=d?.gauge??null,m=t&&!l,x=m?"loading":l?"connected":"missing",p=l?.kind==="quota"?l.plan:l?.kind==="status"?l.statusLabel:null,h=J(l),y=l?.kind==="quota"?"Usage connected":l?.kind==="status"?l.detailLabel||"Subscription detected":m?"Checking":"Not detected";return e.jsxs("article",{className:`hs-subscription-card hs-subscription-card--${x}`,children:[e.jsxs("header",{className:"hs-subscription-card-head",children:[e.jsxs("div",{className:"hs-subscription-provider",children:[e.jsx(R,{harness:i.id,size:18,title:null,className:"hs-subscription-mark"}),e.jsxs("div",{children:[e.jsx("h4",{children:N(i.id)}),e.jsx("span",{children:m?"Checking local plan…":p||"Plan not reported"})]})]}),e.jsx("span",{className:`hs-subscription-state hs-subscription-state--${x}`,children:y})]}),e.jsx("p",{className:"hs-subscription-description",children:i.description}),m?e.jsx(te,{}):l?.kind==="quota"?e.jsx("div",{className:"hs-subscription-windows",children:v(l).map(f=>e.jsx(se,{gauge:l,window:f},`${i.id}:${f.label}`))}):l?.kind==="status"?e.jsxs("div",{className:"hs-subscription-status-detail",children:[e.jsx("strong",{children:l.statusLabel}),e.jsx("span",{children:l.detailLabel||"Subscription detected locally. Open the provider dashboard for live usage."})]}):e.jsxs("div",{className:"hs-subscription-missing",children:[e.jsx("strong",{children:"No local subscription feed yet"}),e.jsx("span",{children:"Open the provider locally, then refresh Scout."})]}),i.id==="cursor"||i.id==="grok"&&l?.kind!=="quota"?e.jsx(X,{provider:i.id,onImported:a}):null,e.jsxs("footer",{className:"hs-subscription-footer",children:[e.jsxs("span",{children:[m?"checking local feed":h?`updated ${O(h)||"now"}`:l?"detected locally":"waiting for provider data",l?.source?` · ${l.source}`:""]}),e.jsx("nav",{"aria-label":`${N(i.id)} quick links`,children:i.links.map(f=>e.jsxs("a",{href:f.href,target:"_blank",rel:"noreferrer",children:[f.label,e.jsx($,{size:11,"aria-hidden":"true"})]},f.href))})]})]},i.id)})})]})}function re({accounts:s,loading:t}){return s.length===0&&!t?null:e.jsxs("section",{className:"hs-cloud-accounts","aria-labelledby":"hs-cloud-accounts-title","aria-busy":t,children:[e.jsxs("div",{className:"hs-section-head hs-cloud-accounts-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-cloud-accounts-title",children:"Cloud accounts"}),e.jsx("p",{children:"Infrastructure available to Scout for deployment and agent compute."})]}),e.jsx("span",{className:"hs-section-meta",children:t?"checking accounts":`${s.length} connected`})]}),e.jsxs("div",{className:"hs-cloud-grid",children:[t&&s.length===0?Array.from({length:3},(a,r)=>e.jsxs("article",{className:"hs-cloud-card hs-cloud-card--loading","aria-hidden":"true",children:[e.jsxs("header",{className:"hs-cloud-card-head",children:[e.jsx("span",{className:"hs-loading-mark"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-title"})]}),e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-copy"}),e.jsxs("footer",{className:"hs-cloud-card-footer",children:[e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-meta"}),e.jsx("span",{className:"hs-loading-actions"})]})]},r)):null,s.map(a=>{const r=V[a.id];return e.jsxs("article",{className:"hs-cloud-card",children:[e.jsxs("header",{className:"hs-cloud-card-head",children:[e.jsxs("div",{className:"hs-cloud-identity",children:[e.jsx(W,{provider:a.id}),e.jsxs("div",{children:[e.jsx("span",{className:"hs-cloud-category",children:r.category}),e.jsx("h4",{children:a.label})]})]}),e.jsx("span",{className:"hs-subscription-state hs-subscription-state--connected",children:a.statusLabel})]}),e.jsx("p",{className:"hs-cloud-description",children:r.description}),e.jsxs("footer",{className:"hs-cloud-card-footer",children:[e.jsxs("span",{className:"hs-cloud-connection",children:[e.jsx("span",{className:"hs-cloud-dot","aria-hidden":"true"}),a.detailLabel]}),e.jsx("nav",{"aria-label":`${a.label} quick links`,children:G[a.id].map(n=>e.jsxs("a",{href:n.href,target:"_blank",rel:"noreferrer",children:[n.label,e.jsx($,{size:11,"aria-hidden":"true"})]},n.href))})]})]},a.id)})]})]})}function ss({navigate:s}){const{route:t}=P(),a=D(t),[r,n]=u.useState([]),[o,c]=u.useState([]),[b,i]=u.useState(!0),[d,l]=u.useState(!1),[m,x]=u.useState(null),p=u.useRef(0),h=u.useCallback(async(g=!1,k=!1)=>{const w=++p.current;k&&i(!0),l(!0),x(null);try{const j=await M(`/api/service-budgets${g?"?refresh=1":""}`);if(w!==p.current)return;n(j.gauges??[]),c(j.cloudAccounts??[])}catch(j){w===p.current&&x(j instanceof Error?j.message:String(j))}finally{w===p.current&&(i(!1),l(!1))}},[]);u.useEffect(()=>{let g=!1,k;return h(!1,!0).then(()=>{g||(k=window.setTimeout(()=>{h(!0)},600))}),()=>{g=!0,k!==void 0&&window.clearTimeout(k)}},[h]),u.useEffect(()=>{const g=window.setInterval(()=>{h(!1)},3e4);return()=>window.clearInterval(g)},[h]);const y=u.useMemo(()=>Y(r),[r]),f=T();return e.jsxs("div",{className:"s-ops",children:[f?e.jsx("div",{className:"s-ops-header",children:e.jsx(E,{activeRoute:{view:"harnesses",...a?{machineId:a}:{}},navigate:s})}):null,e.jsx("div",{className:"s-ops-body hs-body",children:e.jsxs("div",{className:"hs-page",children:[e.jsxs("header",{className:"hs-page-head",children:[e.jsxs("div",{className:"hs-title-group",children:[e.jsx("span",{className:"hs-kicker",children:"ops / provider central"}),e.jsx("h2",{children:"Agent Providers"}),e.jsx("p",{children:"See what you pay for, how much remains, and where to use it."})]}),e.jsxs("button",{type:"button",className:"hs-refresh",disabled:d,onClick:()=>{h(!0)},children:[e.jsx(U,{size:14,className:d?"hs-refresh-icon-spinning":"","aria-hidden":"true"}),e.jsx("span",{children:d?"Refreshing":"Refresh"})]})]}),m&&e.jsxs("div",{className:"hs-error",role:"status","aria-live":"polite",children:["refresh: ",m]}),e.jsx(ae,{rows:y,loading:b,onImported:()=>h(!1)}),e.jsx(re,{accounts:o,loading:b})]})})]})}export{ss as HarnessesScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.hd{display:flex;flex-direction:column;gap:var(--space-md);margin-bottom:var(--space-xl)}.hd-vitals-band{display:flex;align-items:center;justify-content:space-between;gap:var(--space-md);flex-wrap:wrap;padding:var(--space-xs) var(--space-md);border-radius:var(--radius-lg);background:color-mix(in srgb,var(--surface) 60%,var(--bg));border:1px solid color-mix(in srgb,var(--border) 70%,transparent)}.hd-vitals-left{display:flex;align-items:center;gap:var(--space-sm);flex-wrap:wrap}.hd-vitals-title{color:var(--ink);letter-spacing:var(--tracking-lg)}.hd-vitals-callsign{font-weight:500}.hd-vitals-right{display:flex;align-items:center;gap:var(--space-xs);margin-left:auto}.hd-meta{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--dim);font-variant-numeric:tabular-nums}.hd-meta--err{color:var(--red)}.hd-refresh-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border-radius:var(--radius-sm);border:1px solid color-mix(in srgb,var(--border) 70%,transparent);background:color-mix(in srgb,var(--ink) 3%,transparent);color:var(--dim);cursor:pointer;transition:background var(--motion-duration-fast) ease,color var(--motion-duration-fast) ease,border-color var(--motion-duration-fast) ease}.hd-refresh-btn:hover:not(:disabled){background:color-mix(in srgb,var(--ink) 8%,transparent);color:var(--ink);border-color:var(--border)}.hd-refresh-btn:disabled{opacity:.5;cursor:default}.hd-spin{animation:hd-spin .8s linear infinite}@keyframes hd-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.hd-telemetry-grid{display:grid;gap:var(--space-md)}.hd-telemetry-grid--split{grid-template-columns:minmax(0,1.45fr) minmax(0,1fr)}.hd-telemetry-grid--single{grid-template-columns:minmax(0,1fr)}.hd-card{border:1px solid var(--border);border-radius:var(--radius-xl);background:color-mix(in srgb,var(--surface) 80%,var(--bg));overflow:hidden;display:flex;flex-direction:column}.hd-card-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-md);padding:var(--space-sm) var(--space-lg);border-bottom:1px solid color-mix(in srgb,var(--border) 70%,transparent);background:color-mix(in srgb,var(--bg) 30%,var(--surface))}.hd-card-head-left,.hd-card-head-right{display:flex;align-items:center;gap:var(--space-sm)}.hd-card-title{color:var(--ink);letter-spacing:var(--tracking-lg)}.hd-card-sub{color:var(--dim)}.hd-heartrate-icon{color:var(--accent)}.hd-gauge-set{display:flex;flex-direction:column;padding:var(--space-2xs) 0}.hd-gauge-table-head{display:grid;grid-template-columns:88px minmax(100px,1.1fr) minmax(68px,.7fr) minmax(100px,1.1fr) minmax(90px,1fr);gap:var(--space-xs) var(--space-sm);padding:var(--space-xs) var(--space-lg);color:var(--dim);letter-spacing:var(--tracking-md);border-bottom:1px solid color-mix(in srgb,var(--border) 40%,transparent)}.hd-gauge-wrap{display:block;border-bottom:1px solid color-mix(in srgb,var(--border) 45%,transparent)}.hd-gauge-wrap:last-child{border-bottom:none}.hd-gauge{display:grid;grid-template-columns:88px minmax(100px,1.1fr) minmax(68px,.7fr) minmax(100px,1.1fr) minmax(90px,1fr);gap:var(--space-xs) var(--space-sm);align-items:center;width:100%;padding:7px var(--space-lg);border:0;background:transparent;color:inherit;font:inherit;text-align:left;transition:background var(--motion-duration-hover) ease}.hd-gauge--interactive{cursor:pointer}.hd-gauge--interactive:hover{background:color-mix(in srgb,var(--ink) 4%,transparent)}.hd-gauge-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-xs);min-width:0}.hd-gauge-label{font-family:var(--font-mono);font-size:var(--text-xs);font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hd-gauge-pct{font-family:var(--font-mono);font-size:var(--text-2xs);font-weight:600;font-variant-numeric:tabular-nums}.hd-gauge-pct--ok{color:var(--accent)}.hd-gauge-pct--warn{color:var(--amber)}.hd-gauge-pct--err{color:var(--red)}.hd-gauge-cell{min-width:0;display:flex;align-items:center;font-family:var(--font-mono);font-size:var(--text-xs)}.hd-gauge-cell--empty{color:var(--dim)}.hd-gauge-cell--usage{display:flex;align-items:center;gap:var(--space-xs)}.hd-gauge-window-name{color:var(--dim);min-width:18px}.hd-gauge-bar{flex:1 1 auto;height:5px;border-radius:var(--radius-xs);background:color-mix(in srgb,var(--ink) 12%,transparent);overflow:hidden;position:relative;min-width:32px}.hd-gauge-bar-fill{position:absolute;inset:0 auto 0 0;height:100%;border-radius:var(--radius-xs);transition:width .2s ease}.hd-gauge-bar-fill--ok{background:var(--accent)}.hd-gauge-bar-fill--warn{background:var(--amber)}.hd-gauge-bar-fill--err{background:var(--red)}.hd-gauge-window-used{font-size:var(--text-2xs);color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}.hd-gauge-reset{color:var(--dim);font-size:var(--text-2xs);font-variant-numeric:tabular-nums;white-space:nowrap}.hd-gauge-reset--imminent{color:var(--amber)}.hd-gauge-reset--featured{display:flex;flex-direction:column;line-height:1.15;gap:1px}.hd-gauge-reset--featured strong{font-weight:600;color:var(--ink);font-size:var(--text-xs)}.hd-gauge-reset--featured time,.hd-gauge-reset--featured span{font-size:10px;color:var(--dim)}.hd-gauge-reset--imminent strong{color:var(--amber)}.hd-gauge-reset--due strong{color:var(--accent)}.hd-gauge-reset--stale strong{color:var(--red)}.hd-gauge-toggle{background:transparent;border:0;padding:0;font-family:var(--font-mono);font-size:var(--text-2xs);color:var(--dim);cursor:pointer;letter-spacing:var(--tracking-md);text-transform:uppercase}.hd-gauge-toggle:hover{color:var(--ink)}.hd-heartrate-plot-body{padding:var(--space-sm) var(--space-lg) var(--space-md);display:flex;flex-direction:column;justify-content:flex-end}.hd-heartrate-svg-wrap{width:100%;overflow:hidden}@media(max-width:900px){.hd-telemetry-grid--split{grid-template-columns:1fr}}@media(max-width:680px){.hd-gauge-table-head,.hd-gauge{grid-template-columns:80px 1fr auto}.hd-gauge-table-head span:nth-child(2),.hd-gauge-table-head span:nth-child(3),.hd-gauge>.hd-gauge-cell:nth-child(2),.hd-gauge>.hd-gauge-cell:nth-child(3){display:none}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v,j as t}from"./index-Bli6bTLU.js";import{R as H}from"./refresh-cw-IgN2fZLM.js";import{A as _}from"./activity-D4W2XZY2.js";import"./createLucideIcon-DLlxGjKt.js";const q=3,I=2;function W(e){return e>=.9?"err":e>=.75?"warn":"ok"}const O=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function A(e,a){const s=e-a.getTime(),c=new Date(e).toDateString()===a.toDateString(),r=new Date(e),n=String(r.getHours()).padStart(2,"0"),l=String(r.getMinutes()).padStart(2,"0"),i=s>0&&s<6*3600*1e3;return c?{label:`${n}:${l}`,imminent:i}:{label:`${O[r.getDay()]} ${n}:${l}`,imminent:i}}function G(e,a){const s=Math.floor((e-a.getTime())/1e3),c=s<0,r=Math.abs(s);let n;if(r>=86400){const l=Math.floor(r/86400),i=Math.floor(r%86400/3600);n=i>0?`${l}d ${i}h`:`${l}d`}else if(r>=3600){const l=Math.floor(r/3600),i=Math.floor(r%3600/60);n=i>0?`${l}h ${i}m`:`${l}h`}else n=`${Math.max(1,Math.floor(r/60))}m`;return c?`stale ${n}`:n}function w(e){return e.windows&&e.windows.length>0?e.windows:[{label:z(e.unitLabel),fill:e.fill,usedLabel:e.usedLabel,capLabel:e.capLabel,unitLabel:e.unitLabel,resetAt:e.resetAt}]}function z(e){switch(e){case"weekly":return"7d";case"req/h":return"1h";default:return e||"quota"}}function E(e,a){return w(e).map(s=>{const c=A(s.resetAt,a),r=G(s.resetAt,a);return`${s.label}: ${s.usedLabel} / ${s.capLabel} ${s.unitLabel} · resets ${c.label} (in ${r})`}).join(" · ")}function S(e){const a=e.trim().match(/^(\d+(?:\.\d+)?)([mhd])$/i);if(!a)return null;const s=Number(a[1]);if(!Number.isFinite(s))return null;switch(a[2]?.toLowerCase()){case"m":return s;case"h":return s*60;case"d":return s*24*60;default:return null}}function Q(e){const a=[...e].sort((r,n)=>(S(r.label)??Number.MAX_SAFE_INTEGER)-(S(n.label)??Number.MAX_SAFE_INTEGER)),s=a.find(r=>(S(r.label)??0)>=1440)??(a.length>1?a[a.length-1]:null);return{shortWindow:a.find(r=>r!==s)??null,longWindow:s}}function V(e){return e.capLabel==="100%"&&e.usedLabel.endsWith("%")?e.usedLabel:`${e.usedLabel}/${e.capLabel}`}function N(){return t.jsx("span",{className:"hd-gauge-cell hd-gauge-cell--empty",children:"—"})}function T({window:e}){if(!e)return t.jsx(N,{});const a=Math.round(e.fill*100),s=W(e.fill);return t.jsxs("span",{className:"hd-gauge-cell hd-gauge-cell--usage",children:[t.jsx("span",{className:"hd-gauge-window-name label-xs",children:e.label}),t.jsx("span",{className:"hd-gauge-bar","aria-hidden":"true",children:t.jsx("span",{className:`hd-gauge-bar-fill hd-gauge-bar-fill--${s}`,style:{width:`${a}%`}})}),t.jsx("span",{className:"hd-gauge-window-used",children:V(e)})]})}function R({window:e,now:a,featured:s=!1}){if(!e)return t.jsx(N,{});if(s){const n=P(e.resetAt,a);return t.jsxs("span",{className:`hd-gauge-cell hd-gauge-reset hd-gauge-reset--featured hd-gauge-reset--${n.tone}`,"aria-live":"off","aria-label":n.ariaLabel,children:[t.jsx("strong",{children:n.primary}),n.dateTime?t.jsx("time",{dateTime:n.dateTime,children:n.secondary}):t.jsx("span",{children:n.secondary})]})}const c=A(e.resetAt,a),r=G(e.resetAt,a);return t.jsxs("span",{className:`hd-gauge-cell hd-gauge-reset${c.imminent?" hd-gauge-reset--imminent":""}`,children:["↻ ",r]})}function P(e,a){if(!Number.isFinite(e))return{primary:"—",secondary:"unknown",ariaLabel:"Weekly reset time unknown",tone:"stale"};const s=e-a.getTime(),c=new Date(e);if(!Number.isFinite(c.getTime()))return{primary:"—",secondary:"unknown",ariaLabel:"Weekly reset time unknown",tone:"stale"};const r=c.toISOString();if(s<=0){const u=Math.abs(s);if(u<=9e4)return{primary:"reset due",secondary:"refreshing…",ariaLabel:"Weekly reset due; refreshing usage",tone:"due",dateTime:r};const x=Math.floor(u/6e4),$=x>=60?`+${Math.floor(x/60)}h ${x%60}m`:`+${Math.max(1,x)}m`;return{primary:u<=360*6e4?"reset due":"stale",secondary:$,ariaLabel:`Weekly reset data ${$} overdue`,tone:u<=360*6e4?"due":"stale",dateTime:r}}const n=Math.floor(s/1e3),l=Math.floor(n/86400),i=Math.floor(n%86400/3600),o=Math.floor(n%3600/60),d=n%60,h=[i,o,d].map(u=>String(u).padStart(2,"0")).join(":"),b=l>0?`${l}d ${h}`:h,m=c.toDateString()===a.toDateString(),f=c.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),g=m?`today ${f}`:`${c.toLocaleDateString([],{weekday:"short"})} ${f}`,p=l>0?`${l} ${l===1?"day":"days"} ${i} hours`:`${i} hours ${o} minutes`;return{primary:b,secondary:g,ariaLabel:`Weekly quota resets in ${p}; ${g}`,tone:s<360*6e4?"imminent":"normal",dateTime:r}}function B(e){if(e.length===0)return"";if(e.length===1)return`M ${e[0].x} ${e[0].y}`;const a=[`M ${e[0].x} ${e[0].y}`];for(let s=0;s<e.length-1;s++){const c=e[s-1]??e[s],r=e[s],n=e[s+1],l=e[s+2]??n,i=r.x+(n.x-c.x)/6,o=r.y+(n.y-c.y)/6,d=n.x-(l.x-r.x)/6,h=n.y-(l.y-r.y)/6;a.push(`C ${i} ${o}, ${d} ${h}, ${n.x} ${n.y}`)}return a.join(" ")}function U(e){const a=v.useRef(null),[s,c]=v.useState(e);return v.useLayoutEffect(()=>{const r=a.current;if(!r)return;const n=i=>{const o=Math.round(i);o>0&&c(d=>d===o?d:o)};n(r.getBoundingClientRect().width);const l=new ResizeObserver(i=>{n(i[0]?.contentRect.width??0)});return l.observe(r),()=>l.disconnect()},[]),[a,s]}function X({buckets:e}){const[a,s]=U(372),c=72,r=8,n=54,l=67,i=e.length,o=i<2||e.every(p=>p.count===0),d=Math.max(1,s-4),h={viewBox:`0 0 ${s} ${c}`,style:{width:"100%",height:c,display:"block"}};if(o)return t.jsx("div",{ref:a,className:"hd-heartrate-svg-wrap",children:t.jsx("svg",{...h,children:t.jsx("line",{x1:"0",y1:n,x2:s,y2:n,stroke:"var(--border)"})})});const b=d/(i-1),m=e.map((p,u)=>({x:u*b,y:n-Math.max(0,Math.min(1,p.value))*(n-r)})),f=B(m),g=`${f} L ${d} ${n} L 0 ${n} Z`;return t.jsx("div",{ref:a,className:"hd-heartrate-svg-wrap",children:t.jsxs("svg",{...h,children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"hrdFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:"var(--accent)",stopOpacity:"0.28"}),t.jsx("stop",{offset:"100%",stopColor:"var(--accent)",stopOpacity:"0.0"})]})}),t.jsx("line",{x1:"0",y1:r,x2:s,y2:r,stroke:"var(--border)",opacity:"0.25"}),t.jsx("line",{x1:"0",y1:(r+n)/2,x2:s,y2:(r+n)/2,stroke:"var(--border)",opacity:"0.25"}),t.jsx("line",{x1:"0",y1:n,x2:s,y2:n,stroke:"var(--border)"}),t.jsx("path",{d:g,fill:"url(#hrdFill)"}),t.jsx("path",{d:f,fill:"none",stroke:"var(--accent)",strokeWidth:"1.75",strokeLinecap:"round"}),t.jsx("circle",{cx:m[i-1].x,cy:m[i-1].y,r:"3",fill:"var(--accent)"}),t.jsx("circle",{cx:m[i-1].x,cy:m[i-1].y,r:"6",fill:"var(--accent)",opacity:"0.25"}),t.jsx("text",{x:"0",y:l,fill:"var(--dim)",fontSize:"9",fontFamily:"var(--font-mono)",children:"7d"}),t.jsx("text",{x:s/2,y:l,textAnchor:"middle",fill:"var(--dim)",fontSize:"9",fontFamily:"var(--font-mono)",children:"3d"}),t.jsx("text",{x:s,y:l,textAnchor:"end",fill:"var(--dim)",fontSize:"9",fontFamily:"var(--font-mono)",children:"now"})]})})}function K({gauge:e,now:a,onClick:s}){const c=s?"button":"span",r=s?{type:"button",onClick:s}:{};if(e.kind==="status")return t.jsxs(c,{className:`hd-gauge hd-gauge--status hd-gauge--${e.tone}${s?" hd-gauge--interactive":""}`,"aria-label":`${e.label} subscription usage`,...r,children:[t.jsxs("span",{className:"hd-gauge-head",children:[t.jsx("span",{className:"hd-gauge-label",children:e.label}),t.jsx("span",{className:`hd-gauge-dot hd-gauge-dot--${e.tone}`,"aria-hidden":"true"})]}),t.jsx(N,{}),t.jsx(N,{}),t.jsxs("span",{className:"hd-gauge-cell hd-gauge-cell--usage hd-gauge-cell--status",children:[t.jsx("span",{className:"hd-gauge-window-name label-xs",children:e.windowLabel??"usage"}),t.jsx("span",{className:"hd-gauge-status",children:e.statusLabel})]}),t.jsx("span",{className:"hd-gauge-cell hd-gauge-reset",children:e.detailLabel??"quota n/a"})]});const n=w(e),{shortWindow:l,longWindow:i}=Q(n),o=W(Math.max(...n.map(h=>h.fill))),d=Math.round(Math.max(...n.map(h=>h.fill))*100);return t.jsxs(c,{className:`hd-gauge hd-gauge--${o}${s?" hd-gauge--interactive":""}`,title:E(e,a),"aria-label":`${e.label} subscription usage. ${E(e,a)}`,...r,children:[t.jsxs("span",{className:"hd-gauge-head",children:[t.jsx("span",{className:"hd-gauge-label",children:e.label}),t.jsxs("span",{className:`hd-gauge-pct hd-gauge-pct--${o}`,children:[d,"%"]})]}),t.jsx(T,{window:l}),t.jsx(R,{window:l,now:a}),t.jsx(T,{window:i}),t.jsx(R,{window:i,now:a,featured:!0})]})}function Y(e){const a=e.trim().match(/^(\d+(?:\.\d+)?)([kKmM])?$/u);if(!a)return 0;const s=Number(a[1]);if(!Number.isFinite(s))return 0;switch(a[2]?.toLowerCase()){case"m":return s*1e6;case"k":return s*1e3;default:return s}}function Z(e){return e.kind==="quota"?Math.max(e.fill,...w(e).map(a=>a.fill)):Y(e.statusLabel)>0?.01:0}function J(e){return e.kind==="quota"}function ee(e){return C(e).slice(0,I)}function C(e){return e.map((a,s)=>({gauge:a,index:s,score:Z(a)})).sort((a,s)=>s.score-a.score||a.index-s.index).map(({gauge:a})=>a)}function re(e){const{now:a,operatorName:s,syncLabel:c,error:r,loading:n,refreshing:l,onRefresh:i,navigate:o,heartrate:d,heartrateWindow:h,heartrateBucketLabel:b,heartrateVisibleEventThreshold:m=q,serviceGauges:f}=e,[g,p]=v.useState(!1),u=r?"err":"ok",x=f.filter(J),$=C(x),k=ee(x),y=g?$:k,F=x.length>k.length,L=d.reduce((j,D)=>j+D.count,0),M=L>=m;return t.jsxs("section",{className:"hd","aria-label":"Fleet Cockpit and Service Cluster",children:[t.jsxs("div",{className:"hd-vitals-band",children:[t.jsxs("div",{className:"hd-vitals-left",children:[t.jsx("span",{className:"label-sm hd-vitals-title",children:"Fleet Cockpit"}),s&&t.jsx("span",{className:"chip chip--neutral chip--mono chip--sm hd-vitals-callsign",children:s})]}),t.jsxs("div",{className:"hd-vitals-right",children:[r&&t.jsx("span",{className:"dot dot--warning","aria-hidden":"true"}),t.jsx("span",{className:`hd-meta hd-meta--${u}`,children:c}),t.jsx("button",{type:"button",className:"hd-refresh-btn",disabled:n||l,onClick:i,title:"Refresh status (r)","aria-label":l?"Refreshing status":"Refresh status",children:t.jsx(H,{size:11,className:l?"hd-spin":"","aria-hidden":"true"})})]})]}),(y.length>0||M)&&t.jsxs("div",{className:`hd-telemetry-grid ${M&&y.length>0?"hd-telemetry-grid--split":"hd-telemetry-grid--single"}`,children:[y.length>0&&t.jsxs("div",{className:"hd-card hd-card--quotas",children:[t.jsxs("div",{className:"hd-card-head",children:[t.jsxs("div",{className:"hd-card-head-left",children:[t.jsx("span",{className:"label-xs hd-card-title",children:"Subscriptions & Quotas"}),t.jsxs("span",{className:"chip chip--neutral chip--mono chip--sm",children:[y.length," Active"]})]}),F&&t.jsxs("button",{type:"button",className:"hd-gauge-toggle","aria-expanded":g,onClick:()=>p(j=>!j),children:["[",g?"Top 2":`All ${x.length}`,"]"]})]}),t.jsxs("div",{className:"hd-gauge-set",children:[t.jsxs("div",{className:"hd-gauge-table-head label-xs","aria-hidden":"true",children:[t.jsx("span",{children:"Service"}),t.jsx("span",{children:"Short Window"}),t.jsx("span",{children:"Resets"}),t.jsx("span",{children:"Long Window"}),t.jsx("span",{children:"Reset Countdown"})]}),y.map(j=>t.jsx("span",{className:"hd-gauge-wrap",children:t.jsx(K,{gauge:j,now:a,onClick:()=>o({view:"harnesses"})})},j.id))]})]}),M&&t.jsxs("div",{className:"hd-card hd-card--heartrate",children:[t.jsxs("div",{className:"hd-card-head",children:[t.jsxs("div",{className:"hd-card-head-left",children:[t.jsx(_,{size:12,className:"hd-heartrate-icon","aria-hidden":"true"}),t.jsx("span",{className:"label-xs hd-card-title",children:"Fleet Velocity"})]}),t.jsxs("div",{className:"hd-card-head-right",children:[t.jsxs("span",{className:"label-xs hd-card-sub",children:[h," ",b?`· ${b}`:""]}),t.jsxs("span",{className:"chip chip--working chip--mono chip--sm",children:[L," ",L===1?"Event":"Events"]})]})]}),t.jsx("div",{className:"hd-heartrate-plot-body",children:t.jsx(X,{buckets:d})})]})]})]})}export{re as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as s}from"./index-Bli6bTLU.js";/* empty css */import{H as ds}from"./HarnessMark-DGZ6o6Ct.js";import{a as b}from"./api-DEHEgJ9m.js";import{u as hs}from"./sse-CSozY6mp.js";import{t as C}from"./time-Dhsh_2EG.js";import{C as ms}from"./compass-BepM5iWH.js";import{F as us}from"./file-text-BVhkMWyC.js";import{L as ps}from"./layout-grid-DMpv9CZM.js";import{R as xs}from"./refresh-cw-IgN2fZLM.js";import{A as H}from"./arrow-up-right-RBC6k8nn.js";import{C as Ns}from"./cpu-Bc268H9Q.js";import{G as fs,D as js}from"./gauge-CPcEPmNt.js";import{c as gs}from"./createLucideIcon-DLlxGjKt.js";import"./index-BWHgHrtv.js";const bs=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],ks=gs("folder-git-2",bs),vs=.8,ws=20,F="░",T="·",Ss=["▏","▎","▍","▌","▋","▊","▉"];function ys(a,r=ws){const o=Number.isFinite(a)?Math.min(1,Math.max(0,a)):0,d=Math.round(o*100);if(o<=0)return{filled:"",rest:T.repeat(r),cells:r,percent:0};const i=o*r;let h=Math.floor(i),m=Math.round((i-h)*8);return m===8&&(h+=1,m=0),h>=r?{filled:F.repeat(r),rest:"",cells:r,percent:d}:m===0?h===0?{filled:"▏",rest:T.repeat(r-1),cells:r,percent:d}:{filled:F.repeat(h),rest:T.repeat(r-h),cells:r,percent:d}:{filled:F.repeat(h)+Ss[m-1],rest:T.repeat(r-h-1),cells:r,percent:d}}function S(a){return a.kind==="status"||typeof a.fill!="number"||!Number.isFinite(a.fill)?null:Math.min(1,Math.max(0,a.fill))}function _(a){const r=S(a);return r!==null&&r>=vs}function J(a){return S(a)===0}function $s(a){if(a===null)return{verdict:"Reading",figures:"provider budgets still arriving",showGauges:!1,near:[],unused:0,configured:0,peakPercent:null};if(a.length===0)return{verdict:"All clear",figures:"no provider budgets reported",showGauges:!1,near:[],unused:0,configured:0,peakPercent:null};const r=[...a].filter(_).sort((v,D)=>(S(D)??0)-(S(v)??0)),o=a.filter(J).length,d=a.map(S).filter(v=>v!==null),i=d.length>0?Math.round(Math.max(...d)*100):null,h=a.length-o;let m;r.length>0?m=`${r.length} near ceiling`:h===0?m="Unused":m=`Peak ${i??0}%`;const f=[r.length>0?r.map(v=>`${v.label} ${Math.round((S(v)??0)*100)}%`).join(" · "):null,`${a.length} configured`,o>0&&h>0?`${o} unused`:null].filter(Boolean).join(" · ");return{verdict:m,figures:f,showGauges:!0,near:r,unused:o,configured:a.length,peakPercent:i}}function Es(a,r){if(!a)return r||"process";if(a.includes("--append-system-prompt")){const o=a.match(/session-[a-zA-Z0-9_-]+/);return o?`${r||"harness"} (relay ${o[0]})`:`${r||"harness"} (prompted relay)`}return a.length>70?`${a.slice(0,67)}...`:a}function I(a){if(!a)return"workspace";const r=a.replace(/\/+$/,"").split("/");return r[r.length-1]||a}function Rs(a){if(!a)return;const[r,o]=a.includes("-")?a.split("-"):["0",a],d=o.split(":").map(f=>Number.parseInt(f,10));if(d.length<2||d.some(f=>!Number.isFinite(f)))return;const[i,h,m]=d.length===3?d:[0,d[0],d[1]];return((Number.parseInt(r,10)||0)*24+i)*3600+h*60+m}function Z(a){if(a<60)return`${Math.round(a)}s`;const r=Math.floor(a/60);if(r<60)return`${r}m`;const o=Math.floor(r/60),d=r%60;return o<24?d?`${o}h${String(d).padStart(2,"0")}m`:`${o}h`:`${Math.floor(o/24)}d${o%24}h`}function As(a){const r=a.split("/").filter(Boolean);return r[r.length-1]||a}const X={stalled_relay:"relay",idle_process:"process",uncommitted_branch:"branch",unresumed_session:"session"};function Ps({gauge:a}){const r=S(a),o=_(a),d=J(a),i=ys(r??0),h=r!==null,m=o?"warn":d||!h?"unused":"ok",f=d?"UNUSED":a.resetAt?`RESET ${C(a.resetAt)}`:a.statusLabel||a.usedLabel||"";return s.jsxs("div",{className:`s-host-rack-row ${o?"s-host-rack-row--warn":""} ${d||!h?"s-host-rack-row--unused":""}`,children:[s.jsx("span",{className:"s-host-rack-name font-mono",children:a.label}),s.jsxs("span",{className:`s-host-gauge s-host-gauge--${m}`,role:"meter","aria-label":h?`${a.label} ${i.percent} percent`:`${a.label} ${a.statusLabel||"no quota"}`,"aria-valuemin":h?0:void 0,"aria-valuemax":h?100:void 0,"aria-valuenow":h?i.percent:void 0,children:[s.jsx("span",{className:"s-host-gauge-chrome","aria-hidden":"true",children:"["}),s.jsx("span",{className:"s-host-gauge-fill","aria-hidden":"true",children:i.filled}),s.jsx("span",{className:"s-host-gauge-rest","aria-hidden":"true",children:i.rest}),s.jsx("span",{className:"s-host-gauge-chrome","aria-hidden":"true",children:"]"})]}),s.jsx("span",{className:`s-host-rack-right font-mono ${o?"s-host-rack-age--warn":""} ${d||!h?"s-host-rack-dim":""}`,children:h?`${i.percent}%`:"—"}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono s-host-rack-truncate",children:f})]})}function Js({navigate:a,agents:r}){const[o,d]=c.useState(null),[i,h]=c.useState(null),[m,f]=c.useState(null),[v,D]=c.useState(null),[z,ss]=c.useState(null),[L,es]=c.useState(null),[O,ts]=c.useState([]),[Ms,as]=c.useState(null),[V,ns]=c.useState([]),[Ts,rs]=c.useState([]),[Is,K]=c.useState(!0),[E,W]=c.useState(!1),[Cs,os]=c.useState(Date.now()),[G,Y]=c.useState("inquiry"),[ls,Ds]=c.useState(!1),[Ls,Os]=c.useState({"q-attention":!0,"q-dropped":!0,"q-quotas":!0,"q-posture":!0}),R=c.useCallback(async(e=!1)=>{e?W(!0):K(!0);try{const[t,n,l,k,P,p,N,M,B,q]=await Promise.allSettled([b("/.host-info"),b("/api/build"),b("/api/service-budgets"),b("/api/tail/discover"),b("/api/knowledge/status"),b("/api/pairing-state"),b("/api/terminal-sessions"),b("/api/fleet"),b("/api/sessions"),b("/api/activity")]);t.status==="fulfilled"&&d(t.value),n.status==="fulfilled"&&h(n.value),l.status==="fulfilled"?f(l.value?.gauges??[]):l.status==="rejected"&&f([]),k.status==="fulfilled"&&D(k.value),P.status==="fulfilled"&&ss(P.value),p.status==="fulfilled"&&es(p.value),N.status==="fulfilled"&&N.value?.sessions&&ts(N.value.sessions),M.status==="fulfilled"&&as(M.value),B.status==="fulfilled"&&Array.isArray(B.value)&&ns(B.value),q.status==="fulfilled"&&Array.isArray(q.value)&&rs(q.value),os(Date.now())}finally{K(!1),W(!1)}},[]);c.useEffect(()=>{R()},[R]),hs(()=>{R(!0)});const x=v?.processes??[],is=ls?x:x.slice(0,5);c.useMemo(()=>{const e={};for(const t of r){const n=t.harness||"other";e[n]||(e[n]={total:0,active:0}),e[n].total+=1,t.state==="working"&&(e[n].active+=1)}for(const t of x){const n=t.harness||"other";e[n]||(e[n]={total:0,active:0}),e[n].total=Math.max(e[n].total,1),e[n].active=Math.max(e[n].active,1)}return e},[r,x]);const $=c.useMemo(()=>{const e=new Map;for(const t of r){const n=t.projectRoot||t.cwd||"unknown";e.has(n)||e.set(n,{root:n,name:I(n),agents:[],branches:new Set,processes:[]});const l=e.get(n);l.agents.push(t),t.branch&&l.branches.add(t.branch)}for(const t of x)if(t.cwd)for(const[n,l]of e.entries())(t.cwd.startsWith(n)||n.startsWith(t.cwd))&&l.processes.push(t);return Array.from(e.values())},[r,x]),w=c.useMemo(()=>{const e=$.reduce((p,N)=>p+Math.max(1,N.agents.length+N.processes.length*3),0),t=$.map(p=>{const N=Math.max(1,p.agents.length+p.processes.length*3),M=e>0?Math.round(N/e*100):0;return{...p,weight:N,percent:M,primaryBranch:Array.from(p.branches)[0]||p.name==="openscout"&&i?.gitBranch||"main"}}).sort((p,N)=>N.weight-p.weight),n=t.slice(0,5),l=t[0],k=t.slice(5),P=k.reduce((p,N)=>p+N.percent,0);return{ranked:t,topProjects:n,topProject:l,otherProjects:k,otherPercent:P,totalProjects:t.length}},[$,i]),j=c.useMemo(()=>{const e=[];for(const t of x)if(t.command&&t.command.includes("--append-system-prompt")){const n=t.command.match(/session-[a-zA-Z0-9_-]+/),l=n?n[0]:`PID ${t.pid}`;e.push({id:`relay-${t.pid}`,kind:"stalled_relay",title:l,subtitle:`Launched in ${I(t.cwd)} · PID ${t.pid} · Runtime ${t.etime||"active"}`,ageLabel:t.etime||"active",ageSeconds:Rs(t.etime),projectRoot:t.cwd||void 0,harness:t.harness,pid:t.pid,severity:"warn",actionLabel:"Tail Process",actionRoute:{view:"ops",mode:"mission"}})}i?.gitBranch&&i.gitBranch!=="main"&&e.push({id:"branch-divergence",kind:"uncommitted_branch",title:i.gitBranch,subtitle:`Local worktree is ahead with uncommitted edits on ${i.runtime?.platform||"darwin"}`,ageLabel:"Unmerged",projectRoot:"/Users/art/dev/openscout",severity:"neutral",actionLabel:"Inspect Repos",actionRoute:{view:"repos"}});for(const t of V.slice(0,4))t.lastMessageAt&&Date.now()-t.lastMessageAt>3600*1e3&&e.push({id:`session-${t.id}`,kind:"unresumed_session",title:t.title||t.id,subtitle:`Last turn recorded ${C(t.lastMessageAt)} · ${t.messageCount} messages · ${I(t.workspaceRoot)}`,ageLabel:C(t.lastMessageAt),ageSeconds:(Date.now()-t.lastMessageAt)/1e3,conversationId:t.id,projectRoot:t.workspaceRoot||void 0,harness:t.harness||void 0,severity:"info",actionLabel:"Open Chat",actionRoute:{view:"conversation",conversationId:t.id}});return e},[x,i,V]),g=c.useMemo(()=>m?.length?[...m].sort((e,t)=>(t.fill??0)-(e.fill??0))[0]:null,[m]),u=c.useMemo(()=>{const e=w.ranked;if(e.length===0)return null;const t=e[0].percent,n=w.otherProjects;return{verdict:t>=50?"Concentrated":t>=25?"Weighted":"Scattered",topPercent:t,tailPercent:w.otherPercent,tailCount:n.length,tailAgents:n.reduce((l,k)=>l+k.agents.length,0),tailProcesses:n.reduce((l,k)=>l+k.processes.length,0),aboveTen:e.filter(l=>l.percent>=10).length}},[w]),y=c.useMemo(()=>{const e=j.reduce((n,l)=>(n[l.kind]=(n[l.kind]??0)+1,n),{}),t=j.map(n=>n.ageSeconds).filter(n=>typeof n=="number").sort((n,l)=>l-n)[0];return{verdict:j.length===0?"Nothing unattended":`${j.length} unattended`,byKind:e,oldestLabel:t?Z(t):null}},[j]),U=c.useMemo(()=>$s(m),[m]),A=c.useMemo(()=>{const e=O.length,t=z?.indexedSessions??0,n=L?.trustedPeerCount??0,l=o?.brokerUrl||(o?.ports?.broker?`127.0.0.1:${o.ports.broker}`:null);return[{key:"broker",label:"broker",detail:l?[l,o?.brokerSocketPath?As(o.brokerSocketPath):null].filter(Boolean).join(" · "):"endpoint not reported",state:l?"UP":"UNKNOWN",tone:l?"ok":"unknown"},{key:"pty",label:"pty relay",detail:e>0?`${e} socket${e===1?"":"s"}`:"0 sockets · latency unmeasured",state:e>0?"ACTIVE":"IDLE",tone:e>0?"ok":"idle"},{key:"knowledge",label:"knowledge",detail:t>0?`${t.toLocaleString()} transcript${t===1?"":"s"} indexed`:"0 transcripts indexed",state:t>0?"INDEXED":"EMPTY",tone:t>0?"ok":"warn",action:t>0?void 0:{label:"Index",route:{view:"search"}}},{key:"mesh",label:"mesh",detail:n>0?`${n} trusted peer${n===1?"":"s"} · scope ${o?.advertiseScope||"mesh"}`:`no trusted peers · scope ${o?.advertiseScope||"mesh"}`,state:n>0?"PAIRED":"UNPAIRED",tone:n>0?"ok":"idle"}]},[o,O,z,L]),Q=c.useMemo(()=>{const e=A.reduce((n,l)=>(n[l.tone]=(n[l.tone]??0)+1,n),{}),t=A.filter(n=>n.tone==="warn");return{verdict:t.length>0?`${t.length} ${t.length===1?"needs":"need"} attention`:"All nominal",figures:[e.ok?`${e.ok} up`:null,e.idle?`${e.idle} idle`:null,e.warn?`${e.warn} empty`:null,e.unknown?`${e.unknown} unknown`:null].filter(Boolean).join(" · ")}},[A]);o?.nodeName||o?.hostName;const cs=i?.runtime?`${i.runtime.platform} ${i.runtime.arch} · ${i.runtime.engine} ${i.runtime.engineVersion}`:"Darwin arm64";return s.jsxs("div",{className:"s-host-view",children:[s.jsxs("header",{className:"s-host-header",children:[s.jsxs("div",{className:"s-host-header-left",children:[s.jsxs("div",{className:"s-host-header-status-line",children:[s.jsx("span",{className:"dot dot--sm dot--working dot--pulse","aria-hidden":"true"}),s.jsxs("span",{className:"label-xs s-host-mono-dim",children:["NODE: ",o?.nodeId||"local"]}),s.jsx("span",{className:"s-host-header-divider",children:"/"}),s.jsx("span",{className:"label-xs s-host-mono-dim",children:cs}),i?.gitHash&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"s-host-header-divider",children:"/"}),s.jsxs("span",{className:"label-xs s-host-mono-dim",children:["git:",i.gitHash.slice(0,7)]})]})]}),s.jsxs("h1",{className:"s-host-title",children:[s.jsx(ms,{size:22,className:"s-host-title-icon"}),s.jsx("span",{children:"Host Advisor"})]})]}),s.jsxs("div",{className:"s-host-header-right",children:[s.jsxs("div",{className:"s-host-mode-toggle",role:"group","aria-label":"Advisor Format",children:[s.jsxs("button",{type:"button",className:`s-host-mode-btn ${G==="inquiry"?"s-host-mode-btn--active":""}`,onClick:()=>Y("inquiry"),title:"Formatted Executive Inquiries & Operator Answers",children:[s.jsx(us,{size:12}),s.jsx("span",{children:"Inquiries"})]}),s.jsxs("button",{type:"button",className:`s-host-mode-btn ${G==="matrix"?"s-host-mode-btn--active":""}`,onClick:()=>Y("matrix"),title:"Compact Infrastructure Matrix",children:[s.jsx(ps,{size:12}),s.jsx("span",{children:"Matrix"})]})]}),s.jsxs("button",{type:"button",className:`btn btn--sm ${E?"btn--accent":""}`,disabled:E,onClick:()=>{R(!0)},children:[s.jsx(xs,{size:12,className:E?"s-spin":""}),s.jsx("span",{children:E?"Scanning...":"Refresh"})]})]})]}),s.jsxs("section",{className:"s-host-readouts","aria-label":"Host Readouts",children:[s.jsxs("div",{className:"s-host-readout",children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"AGENTS"}),s.jsx("span",{className:"s-host-readout-figure",children:r.length}),s.jsxs("span",{className:"label-xs s-host-readout-qual",children:[x.length," PROCESS",x.length===1?"":"ES"]})]}),s.jsxs("div",{className:"s-host-readout",children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"ROOTS"}),s.jsx("span",{className:"s-host-readout-figure",children:$.length}),s.jsx("span",{className:"label-xs s-host-readout-qual",children:u?`TOP SHARE ${u.topPercent}%`:"NONE ACTIVE"})]}),s.jsxs("div",{className:`s-host-readout ${g&&_(g)?"s-host-readout--warn":""}`,children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"PEAK BUDGET"}),s.jsx("span",{className:"s-host-readout-figure",children:g?`${Math.round((g.fill??0)*100)}%`:"—"}),s.jsx("span",{className:"label-xs s-host-readout-qual",children:g?`${g.label}${g.resetAt?` · RESET ${C(g.resetAt)}`:""}`:"NO PROVIDERS CONFIGURED"})]}),s.jsxs("div",{className:`s-host-readout ${j.length>0?"s-host-readout--flag":""}`,children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"UNATTENDED"}),s.jsx("span",{className:"s-host-readout-figure",children:j.length}),s.jsx("span",{className:"label-xs s-host-readout-qual",children:y.oldestLabel?`OLDEST ${y.oldestLabel}`:"NONE OPEN"})]}),s.jsxs("div",{className:"s-host-readout",children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"MESH PEERS"}),s.jsx("span",{className:"s-host-readout-figure",children:L?.trustedPeerCount??0}),s.jsxs("span",{className:"label-xs s-host-readout-qual",children:["SCOPE ",(o?.advertiseScope||"mesh").toUpperCase()]})]})]}),G==="inquiry"?s.jsxs("div",{className:"s-host-readings","aria-label":"Host Readings",children:[s.jsxs("article",{className:"s-host-reading",children:[s.jsxs("div",{className:"s-host-reading-head",children:[s.jsx("span",{className:"label-xs s-host-reading-num",children:"01 // ATTENTION"}),s.jsx("span",{className:"s-host-reading-verdict",children:u?.verdict??"No active roots"}),s.jsx("span",{className:"s-host-reading-figures",children:u?s.jsxs(s.Fragment,{children:["top ",u.topPercent,"%",s.jsx("span",{className:"s-host-sep",children:"·"}),"tail ",u.tailPercent,"%",s.jsx("span",{className:"s-host-sep",children:"·"}),u.aboveTen," root",u.aboveTen===1?"":"s"," above 10%"]}):s.jsx(s.Fragment,{children:"no agents or processes bound to a workspace"})}),s.jsxs("button",{type:"button",className:"btn btn--sm",onClick:()=>a({view:"repos"}),children:[s.jsx("span",{children:"Repos"}),s.jsx(H,{size:10})]})]}),w.ranked.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"s-host-share-bar",children:[w.topProjects.map((e,t)=>s.jsx("div",{className:`s-host-share-seg s-host-share-seg--${Math.min(t,4)}`,style:{width:`${e.percent}%`},title:`${e.name} ${e.percent}%`,children:s.jsxs("span",{className:"s-host-share-seg-label font-mono text-2xs",children:[e.name," ",e.percent,"%"]})},e.root)),u&&u.tailCount>0&&s.jsx("div",{className:"s-host-share-seg s-host-share-seg--tail",style:{flex:1},children:s.jsxs("span",{className:"s-host-share-seg-label font-mono text-2xs",children:[u.tailCount," OTHER ROOTS — ",u.tailPercent,"%"]})})]}),s.jsxs("div",{className:"s-host-rack s-host-rack--roots",children:[s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--head",children:[s.jsx("span",{className:"label-xs",children:"ROOT"}),s.jsx("span",{className:"label-xs",children:"SHARE"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"PCT"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"AGENTS"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"PROCS"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"BRANCH"})]}),w.topProjects.map(e=>s.jsxs("div",{className:"s-host-rack-row",children:[s.jsx("span",{className:"s-host-rack-name font-mono",children:e.name}),s.jsx("span",{className:"s-host-rack-track",children:s.jsx("span",{className:"s-host-rack-fill",style:{width:`${u&&u.topPercent>0?Math.round(e.percent/u.topPercent*100):0}%`}})}),s.jsxs("span",{className:"s-host-rack-right font-mono",children:[e.percent,"%"]}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:e.agents.length}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:e.processes.length}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono s-host-rack-truncate",children:e.primaryBranch})]},e.root)),u&&u.tailCount>0&&s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--tail",children:[s.jsxs("span",{className:"s-host-rack-name font-mono",children:["tail — ",u.tailCount," roots"]}),s.jsx("span",{className:"s-host-rack-track s-host-rack-track--hatch"}),s.jsxs("span",{className:"s-host-rack-right font-mono",children:[u.tailPercent,"%"]}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:u.tailAgents}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:u.tailProcesses}),s.jsxs("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:["each below ",w.topProjects.at(-1)?.percent??0,"%"]})]})]})]})]}),s.jsxs("article",{className:"s-host-reading",children:[s.jsxs("div",{className:"s-host-reading-head",children:[s.jsx("span",{className:"label-xs s-host-reading-num",children:"02 // UNATTENDED"}),s.jsx("span",{className:"s-host-reading-verdict",children:y.verdict}),s.jsx("span",{className:"s-host-reading-figures",children:j.length>0?s.jsxs(s.Fragment,{children:[y.oldestLabel&&s.jsxs(s.Fragment,{children:["oldest ",y.oldestLabel,s.jsx("span",{className:"s-host-sep",children:"·"})]}),Object.entries(y.byKind).map(([e,t])=>`${t} ${X[e]??e}`).join(" · "),s.jsx("span",{className:"s-host-sep",children:"·"}),"of ",x.length," processes"]}):s.jsx(s.Fragment,{children:"no idle relays, diverged branches or stale conversations"})})]}),j.length>0&&s.jsxs("div",{className:"s-host-rack s-host-rack--unattended",children:[s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--head",children:[s.jsx("span",{className:"label-xs"}),s.jsx("span",{className:"label-xs",children:"SIGNAL"}),s.jsx("span",{className:"label-xs",children:"ROOT"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"REF"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"AGE"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"ACTION"})]}),j.map(e=>s.jsxs("div",{className:"s-host-rack-row",children:[s.jsx("span",{className:`dot dot--sm ${e.severity==="warn"?"dot--warning":"dot--neutral"}`,"aria-hidden":"true"}),s.jsx("span",{className:"s-host-rack-name font-mono s-host-rack-truncate",children:e.title}),s.jsx("span",{className:"s-host-rack-dim font-mono s-host-rack-truncate",children:e.projectRoot?I(e.projectRoot):"—"}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:e.pid?`pid ${e.pid}`:X[e.kind]??e.kind}),s.jsx("span",{className:`s-host-rack-right font-mono s-host-rack-age ${e.severity==="warn"?"s-host-rack-age--warn":""}`,children:e.ageSeconds?Z(e.ageSeconds):e.ageLabel}),s.jsx("span",{className:"s-host-rack-right s-host-rack-actions",children:e.actionRoute&&s.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>e.actionRoute&&a(e.actionRoute),children:e.actionLabel})})]},e.id))]})]}),s.jsxs("article",{className:"s-host-reading",children:[s.jsxs("div",{className:"s-host-reading-head",children:[s.jsx("span",{className:"label-xs s-host-reading-num",children:"03 // BUDGETS"}),s.jsx("span",{className:"s-host-reading-verdict",children:U.verdict}),s.jsx("span",{className:"s-host-reading-figures",children:U.figures}),s.jsxs("button",{type:"button",className:"btn btn--sm",onClick:()=>a({view:"harnesses"}),children:[s.jsx("span",{children:"Providers"}),s.jsx(H,{size:10})]})]}),U.showGauges&&m&&s.jsxs("div",{className:"s-host-rack s-host-rack--budgets",children:[s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--head",children:[s.jsx("span",{className:"label-xs",children:"PROVIDER"}),s.jsx("span",{className:"label-xs",children:"GAUGE"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"PCT"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"NOTE"})]}),m.map(e=>s.jsx(Ps,{gauge:e},e.id))]})]}),s.jsxs("article",{className:"s-host-reading",children:[s.jsxs("div",{className:"s-host-reading-head",children:[s.jsx("span",{className:"label-xs s-host-reading-num",children:"04 // SUBSYSTEMS"}),s.jsx("span",{className:"s-host-reading-verdict",children:Q.verdict}),s.jsx("span",{className:"s-host-reading-figures",children:Q.figures})]}),s.jsxs("div",{className:"s-host-rack s-host-rack--subsystems",children:[s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--head",children:[s.jsx("span",{className:"label-xs"}),s.jsx("span",{className:"label-xs",children:"SUBSYSTEM"}),s.jsx("span",{className:"label-xs",children:"DETAIL"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"STATE"})]}),A.map(e=>s.jsxs("div",{className:"s-host-rack-row",children:[s.jsx("span",{className:`dot dot--sm s-host-dot--${e.tone}`,"aria-hidden":"true"}),s.jsx("span",{className:"s-host-rack-name font-mono",children:e.label}),s.jsx("span",{className:"s-host-rack-dim font-mono s-host-rack-truncate",children:e.detail}),s.jsxs("span",{className:"s-host-rack-right s-host-rack-actions",children:[e.action&&s.jsx("button",{type:"button",className:"btn btn--sm s-host-btn-accent",onClick:()=>e.action&&a(e.action.route),children:e.action.label}),s.jsx("span",{className:`chip chip--sm chip--mono s-host-state s-host-state--${e.tone}`,children:e.state})]})]},e.key))]})]})]}):s.jsxs("div",{className:"s-host-matrix-container",children:[s.jsxs("section",{className:"s-host-telemetry-grid","aria-label":"Host Telemetry Overview",children:[s.jsxs("div",{className:"s-host-stat-box",children:[s.jsxs("div",{className:"s-host-stat-head",children:[s.jsx("span",{className:"label-xs s-host-stat-label",children:"REGISTERED AGENTS"}),s.jsx(Ns,{size:13,className:"s-host-stat-icon"})]}),s.jsxs("div",{className:"s-host-stat-body",children:[s.jsx("span",{className:"s-host-stat-big",children:r.length}),s.jsxs("span",{className:"s-host-stat-kicker",children:[x.length," background processes"]})]})]}),s.jsxs("div",{className:"s-host-stat-box",children:[s.jsxs("div",{className:"s-host-stat-head",children:[s.jsx("span",{className:"label-xs s-host-stat-label",children:"SERVICE QUOTA RADAR"}),s.jsx(fs,{size:13,className:"s-host-stat-icon"})]}),s.jsxs("div",{className:"s-host-stat-body",children:[s.jsx("span",{className:"s-host-stat-big",children:g?`${Math.round((g.fill??0)*100)}%`:"Nominal"}),s.jsx("span",{className:"s-host-stat-kicker",children:"peak token consumption"})]})]}),s.jsxs("div",{className:"s-host-stat-box",children:[s.jsxs("div",{className:"s-host-stat-head",children:[s.jsx("span",{className:"label-xs s-host-stat-label",children:"WORKSPACES & REPOS"}),s.jsx(ks,{size:13,className:"s-host-stat-icon"})]}),s.jsxs("div",{className:"s-host-stat-body",children:[s.jsx("span",{className:"s-host-stat-big",children:$.length}),s.jsx("span",{className:"s-host-stat-kicker",children:"registered project roots"})]})]}),s.jsxs("div",{className:"s-host-stat-box",children:[s.jsxs("div",{className:"s-host-stat-head",children:[s.jsx("span",{className:"label-xs s-host-stat-label",children:"SUBSYSTEM RELAYS"}),s.jsx(js,{size:13,className:"s-host-stat-icon"})]}),s.jsxs("div",{className:"s-host-stat-body",children:[s.jsx("span",{className:"s-host-stat-big",children:O.length}),s.jsx("span",{className:"s-host-stat-kicker",children:"live terminal relays"})]})]})]}),s.jsxs("section",{className:"s-host-block","aria-label":"Active Processes",children:[s.jsx("div",{className:"s-host-block-head",children:s.jsxs("span",{className:"label-xs",children:["ACTIVE HARNESS PROCESSES (",x.length,")"]})}),s.jsx("div",{className:"s-host-table-box",children:s.jsx("div",{className:"s-host-table",children:is.map(e=>s.jsxs("div",{className:"s-host-table-row",children:[s.jsxs("div",{className:"s-host-table-cell-main",children:[s.jsx("span",{className:"dot dot--sm dot--working dot--pulse","aria-hidden":"true"}),s.jsx(ds,{harness:e.harness,size:13}),s.jsx("span",{className:"font-semibold text-xs font-mono",children:Es(e.command,e.harness)}),s.jsxs("span",{className:"chip chip--sm chip--ghost chip--mono",children:["PID ",e.pid]}),e.etime&&s.jsx("span",{className:"chip chip--sm chip--ghost chip--mono",children:e.etime})]}),s.jsx("div",{className:"s-host-table-cell-action",children:s.jsxs("button",{type:"button",className:"btn btn--sm",onClick:()=>a({view:"ops",mode:"mission"}),children:[s.jsx("span",{children:"Tail"}),s.jsx(H,{size:10})]})})]},e.pid))})})]})]})]})}export{Js as HostAdvisorView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,j as e}from"./index-Bli6bTLU.js";/* empty css */import{a as F}from"./api-DEHEgJ9m.js";import{d as we}from"./time-Dhsh_2EG.js";import{u as ve}from"./Provider-Ve8yXaWR.js";import{o as le,p as Ce,q as Ee,t as Ke,v as oe,K as m,S as qe,x as fe,y as Le,z as Ae,A as Ie,B as ce,C as ue,D as Te,E as He,F as Re,G as $e,H as De,I as Fe}from"./router-B0YclXYg.js";import{S as Me}from"./search-BbgsEMXa.js";import{X as We}from"./x-BJyPzFnn.js";import{L as de}from"./loader-circle-DoT8gpw6.js";import{c as Oe}from"./createLucideIcon-DLlxGjKt.js";import{S as Pe}from"./sparkles-ytTwpCbZ.js";import{C as Ue}from"./chevron-down-Da5tV19_.js";import{C as ze}from"./clock-DaKLp6Xd.js";import"./provider-CX9EWecp.js";import"./sse-CSozY6mp.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./file-text-BVhkMWyC.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-7iEtvu9P.js";import"./NewChatComposer-Bgqes0UQ.js";import"./text-BR9Bap0E.js";import"./voice-levels-Dcr3jglk.js";import"./conversation-model-CigSPlKA.js";import"./index-DFdlQs_c.js";import"./HarnessMark-DGZ6o6Ct.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";const _e=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Be=Oe("funnel",_e);function y(i){return new Intl.NumberFormat("en-US").format(i||0)}function Ge({text:i,query:a}){return e.jsx(e.Fragment,{children:De(i,a).map((o,c)=>o.match?e.jsx("mark",{children:o.text},c):e.jsx("span",{children:o.text},c))})}function Je(i,a){i.target===i.currentTarget&&(i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),a()))}async function Xe(){return F("/api/knowledge/status")}async function Qe(i){const a=new URLSearchParams;for(const o of i)a.append("key",o);return a.set("limit","200"),F(`/api/knowledge/search-primitives?${a.toString()}`)}async function G(i,a){const o=new URLSearchParams({q:i,limit:String(m.hitLimit)});if(a.sourceKinds.length>0)for(const u of a.sourceKinds)o.append("sourceKind",u);for(const u of a.harness)o.append("harness",u);for(const u of a.project)o.append("project",u);const c=$e(a.timeWindow);return c!=null&&o.set("updatedAfterMs",String(c)),F(`/api/knowledge/search?${o.toString()}`)}async function he(i=!1){return F("/api/knowledge/sessions/index",{method:"POST",body:JSON.stringify({days:m.days,limit:m.sessionLimit,force:i})})}const Ve=Le;function I({active:i,onClick:a,count:o,label:c,ariaLabel:u}){return e.jsxs("button",{type:"button",className:`ks-chip${i?" ks-chip--active":""}`,onClick:a,"aria-pressed":i,"aria-label":u??c,children:[e.jsx("span",{className:"ks-chip-label",children:c}),typeof o=="number"?e.jsx("span",{className:"ks-chip-count","aria-hidden":"true",children:y(o)}):null]})}function xe(i){return i&&i.split(/[\s_-]+/u).filter(a=>a.length>0).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function me(i,a,o=6){return i?i.filter(c=>c.key===a&&c.value.length>0).sort((c,u)=>u.count-c.count||c.value.localeCompare(u.value)).slice(0,o):[]}function pe(i){return i.sourceKinds.length>0||i.harness.length>0||i.project.length>0||i.timeWindow!=="all"}function Ye(i){const a=[];return i.sourceKinds.length>0&&a.push(i.sourceKinds.map(o=>fe[o]??o).join(" + ")),i.harness.length>0&&a.push(i.harness.map(xe).join(" + ")),i.project.length>0&&a.push(i.project.join(" + ")),i.timeWindow!=="all"&&a.push(Fe(i.timeWindow)),a.length>0?`Filters: ${a.join(" · ")}`:""}function Fs({navigate:i,mode:a,hitId:o,routeFilters:c}){const{selectedKnowledgeHit:u,inspectKnowledgeHit:g,clearKnowledgeHit:S}=ve(),ke=l.useMemo(()=>c||(typeof window>"u"?le():Ce(window.location.search)),[c]),[E,T]=l.useState(null),[J,je]=l.useState(null),[n,M]=l.useState(ke),[w,X]=l.useState([]),[W,Q]=l.useState(!1),[K,H]=l.useState(!1),[O,b]=l.useState(null),[ye,R]=l.useState(!1),[V,Y]=l.useState(!1),q=l.useRef(n);q.current=n;const p=(E?.chunks??0)>0,$=E?.activeJobs[0]??null,v=l.useMemo(()=>Ee(w),[w]),Z=K||!!$,L=n.query.trim(),P=Ke(n);l.useEffect(()=>{c&&M(s=>oe(s,c)?s:c)},[c]);const f=l.useMemo(()=>{const s=[];for(const t of v)s.push(...t.moments);return s},[v]),C=l.useCallback((s,t)=>{X(t.hits),T(t.status);const d=(o?t.hits.find(x=>x.id===o):void 0)??t.hits[0];d?g(d,s.query,s):S()},[o,g,S]),U=l.useCallback(async s=>{const t=s.query.trim();if(!t){X([]),S();return}Q(!0);try{b(null),C(s,await G(t,s))}catch(r){b(r instanceof Error?r.message:String(r))}finally{Q(!1)}},[C,S]),ee=l.useCallback(async(s=!1)=>{H(!0);try{b(null);const t=await he(s);T(t.status),R(!0);const r=q.current;t.status.chunks>0&&r.query.trim()&&C(r,await G(r.query.trim(),r))}catch(t){b(t instanceof Error?t.message:String(t))}finally{H(!1)}},[C]);l.useEffect(()=>{let s=!1;return(async()=>{try{const t=await Xe();if(s)return;T(t),R(!0),b(null)}catch{}if(!s){H(!0);try{b(null);const t=await he(!1);if(s)return;T(t.status),R(!0);const r=q.current;t.status.chunks>0&&r.query.trim()&&C(r,await G(r.query.trim(),r))}catch(t){s||(b(t instanceof Error?t.message:String(t)),R(!0))}finally{s||H(!1)}}})(),()=>{s=!0}},[C]),l.useEffect(()=>{if(!p||V)return;let s=!1;return(async()=>{try{const t=await Qe(["harness","project","sourceKind"]);s||(je(t),Y(!0))}catch{s||Y(!0)}})(),()=>{s=!0}},[p,V]),l.useEffect(()=>{if(!p)return;const s=window.setTimeout(()=>{U(n)},m.debounceMs);return()=>window.clearTimeout(s)},[n,p,U]);const ge=s=>{if(s.preventDefault(),!p&&!K){ee(!1);return}U(n)},j=l.useCallback(s=>{M(t=>{const r={...t,...s};return oe(t,r)?t:(i({view:"search",...a?{mode:a}:{},filters:r},{replace:!0}),r)})},[a,i]),A=l.useCallback(()=>{const s=le();M(s),i({view:"search",...a?{mode:a}:{},filters:s},{replace:!0})},[a,i]),be=l.useCallback(()=>{f[0]&&g(f[0],q.current.query)},[f,g]);l.useEffect(()=>{function s(t){const r=t.target,d=r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable);if(t.key==="/"&&!d){t.preventDefault();const x=document.querySelector(".ks-search-input");x?.focus(),x?.select()}else if(t.key==="Escape"&&!d)f.length>0?S():A();else if(!d&&(t.key==="j"||t.key==="k")){if(f.length===0)return;t.preventDefault();const x=u?f.findIndex(z=>z.id===u.id):-1,N=t.key==="j"?Math.min(f.length-1,x+1):Math.max(0,x-1),D=f[N];D&&g(D,q.current.query)}}return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[f,g,S,u,A]);const Ne=E?we(E.generatedAt)||"just now":"—",Se=Z?$?`Indexing ${y($.progress.indexed??0)} of ${y($.progress.discovered??0)}`:p?`Refreshing last ${m.days} days in the background`:`Building last ${m.days} days of sessions`:p?`${y(E?.chunks??0)} moments · last ${m.days} days · updated ${Ne}`:ye?"No index yet":"Loading index",se=me(J?.facets,"harness"),te=me(J?.facets,"project");return e.jsxs("main",{className:"ks-page",children:[e.jsxs("div",{className:"ks-shell",children:[e.jsx("header",{className:"ks-header",children:e.jsxs("div",{className:"ks-header-titles",children:[e.jsx("span",{className:"ks-eyebrow",children:"Search"}),e.jsx("h1",{children:"Find anything you ran, opened, or decided"}),e.jsxs("p",{children:["Search across sessions, skills, MCP tools, codebase, and context packs from the last ",m.days," days."]})]})}),e.jsxs("form",{className:"ks-search-form",onSubmit:ge,role:"search",children:[e.jsx(Me,{size:17,strokeWidth:1.75,"aria-hidden":"true"}),e.jsx("input",{value:n.query,onChange:s=>j({query:s.target.value}),placeholder:"Search topics, files, decisions, agents…",className:"ks-search-input",spellCheck:!1,autoFocus:!0,"aria-label":"Search OpenScout knowledge"}),n.query?e.jsx("button",{type:"button",className:"ks-search-clear",onClick:()=>j({query:""}),"aria-label":"Clear search",children:e.jsx(We,{size:14,"aria-hidden":"true"})}):e.jsx("span",{className:"ks-search-hint","aria-hidden":"true",children:"/"}),W?e.jsx(de,{size:15,className:"ks-spin","aria-hidden":"true"}):null]}),e.jsxs("section",{className:"ks-filterbar","aria-label":"Search filters",children:[e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Be,{size:12,"aria-hidden":"true"}),"Source"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Source kind filters",children:qe.map(s=>e.jsx(I,{active:n.sourceKinds.includes(s),onClick:()=>j({sourceKinds:n.sourceKinds.includes(s)?n.sourceKinds.filter(t=>t!==s):[...n.sourceKinds,s]}),label:fe[s]??s},s))})]}),se.length>0?e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Pe,{size:12,"aria-hidden":"true"}),"Agent"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Harness filters",children:se.map(s=>e.jsx(I,{active:n.harness.includes(s.value),onClick:()=>j({harness:n.harness.includes(s.value)?n.harness.filter(t=>t!==s.value):[...n.harness,s.value]}),label:xe(s.value),count:s.count},`harness:${s.value}`))})]}):null,te.length>0?e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Ue,{size:12,"aria-hidden":"true"}),"Project"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Project filters",children:te.map(s=>e.jsx(I,{active:n.project.includes(s.value),onClick:()=>j({project:n.project.includes(s.value)?n.project.filter(t=>t!==s.value):[...n.project,s.value]}),label:s.value,count:s.count},`project:${s.value}`))})]}):null,e.jsxs("div",{className:"ks-filterbar-row ks-filterbar-row--inline",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(ze,{size:12,"aria-hidden":"true"}),"Time"]}),e.jsxs("div",{className:"ks-chip-row",role:"group","aria-label":"Time window filter",children:[e.jsx(I,{active:n.timeWindow==="all",onClick:()=>j({timeWindow:"all"}),label:"Any time"}),Ve.map(s=>e.jsx(I,{active:n.timeWindow===s.value,onClick:()=>j({timeWindow:s.value}),label:s.label},s.value))]}),pe(n)?e.jsx("button",{type:"button",className:"ks-clear-all",onClick:A,children:"Clear filters"}):null]})]}),O?e.jsx("section",{className:"ks-error",role:"alert",children:O}):null,!p&&!O?e.jsxs("div",{className:"ks-empty-state",children:[e.jsx("strong",{children:K?"Preparing your session index":"Preparing search"}),e.jsxs("span",{children:["First load builds the last ",m.days," days"," ","(up to ",y(m.sessionLimit)," sessions). You can keep this page open — results appear as soon as the index is ready."]})]}):null,p?e.jsxs("div",{className:"ks-hit-list",role:"listbox","aria-label":"Search results",children:[e.jsxs("div",{className:"ks-hit-list-head","aria-live":"polite",children:[e.jsx("span",{children:W?"Searching…":L?`${y(v.length)} session${v.length===1?"":"s"}`:"Ready"}),L&&w.length>0?e.jsxs("span",{className:"ks-hit-list-meta",children:[y(w.length)," moment",w.length===1?"":"s",P?e.jsxs(e.Fragment,{children:[" · ",e.jsx("button",{type:"button",className:"ks-text-action",onClick:A,children:"Clear filters"})]}):null]}):null]}),L&&v.length===0&&!W?e.jsxs("div",{className:"ks-empty-hit",children:[e.jsxs("strong",{children:["No matches for “",L,"”"]}),e.jsxs("span",{children:["Try a project name, file path, or topic from recent work",P?", or clear one of the filters above.":"."]}),e.jsxs("div",{className:"ks-empty-hit-actions",children:[e.jsx("button",{type:"button",className:"ks-text-action",onClick:()=>j({query:""}),children:"Clear query"}),P?e.jsx("button",{type:"button",className:"ks-text-action",onClick:A,children:"Clear all filters"}):null]})]}):null,L?null:e.jsxs("div",{className:"ks-empty-hit ks-empty-hit--quiet",children:[e.jsx("strong",{children:"Start with a query"}),e.jsxs("span",{children:["Type a topic, file path, agent, or session hint. Use"," ",e.jsx("kbd",{children:"/"})," to focus this field, ",e.jsx("kbd",{children:"j"}),"/",e.jsx("kbd",{children:"k"})," to walk results, ",e.jsx("kbd",{children:"↵"})," to select, ",e.jsx("kbd",{children:"⌘↵"})," to open the session."]}),e.jsx("button",{type:"button",className:"ks-text-action",onClick:be,disabled:w.length===0,children:"Pick the first result automatically"})]}),e.jsx("div",{className:"ks-hit-list-body",children:v.map((s,t)=>{const r=s.best,d=Ae(r),x=Ie(r),N=ce(ue(r)),D=()=>{N&&i({view:"sessions",sessionId:N})},z=s.moments.some(k=>u?.id===k.id);return e.jsxs("section",{className:`ks-session${z?" ks-session--selected":""}`,"aria-label":`Session ${t+1}`,children:[e.jsxs("header",{className:"ks-session-head",children:[e.jsxs("div",{className:"ks-session-topline",children:[e.jsxs("div",{className:"ks-session-meta",children:[d.agent?e.jsx("span",{className:"ks-hit-chip",children:d.agent}):null,d.project?e.jsx("span",{children:d.project}):null,d.session?e.jsxs("span",{className:"ks-hit-session",title:N??d.session,children:["session ",d.session]}):null,e.jsxs("span",{className:"ks-session-count",children:[y(s.moments.length)," match",s.moments.length===1?"":"es"]})]}),d.when?e.jsx("time",{className:"ks-hit-when",children:d.when}):null]}),e.jsx("button",{type:"button",className:"ks-session-goal",onClick:D,title:N?"Open session":void 0,children:x})]}),e.jsx("div",{className:"ks-session-moments",children:s.moments.map(k=>{const ie=Te(k,n.query),ae=u?.id===k.id,_=He(k,n.query,200),ne=Re(k),B=()=>g(k,n.query),re=()=>{const h=ce(ue(k))??N;if(!h){B();return}i({view:"sessions",sessionId:h})};return e.jsx("article",{className:`ks-hit${ae?" ks-hit--selected":""}`,role:"option","aria-selected":ae,tabIndex:0,onClick:B,onDoubleClick:re,onKeyDown:h=>{if(h.key==="Enter"&&(h.metaKey||h.ctrlKey)){h.preventDefault(),re();return}Je(h,B)},children:e.jsxs("div",{className:"ks-hit-body",children:[ne.length>0?e.jsx("div",{className:"ks-hit-details ks-hit-details--moment","aria-label":"Turn",children:ne.map(h=>e.jsx("span",{className:"ks-hit-details-strong",children:h},h))}):null,e.jsx("h3",{className:"ks-hit-title",children:ie}),_&&_!==ie?e.jsx("p",{className:"ks-hit-snippet",children:e.jsx(Ge,{text:_,query:n.query})}):null]})},k.id)})})]},s.collectionId)})})]}):null]}),e.jsxs("footer",{className:"ks-foot-status","aria-live":"polite",children:[e.jsxs("span",{className:"ks-foot-status-facts",children:[Z?e.jsx(de,{size:12,className:"ks-spin","aria-hidden":"true"}):null,Se,pe(n)?e.jsxs(e.Fragment,{children:[" · ",Ye(n)]}):null]}),e.jsx("button",{type:"button",className:"ks-text-action",onClick:()=>{ee(!0)},disabled:K,children:K?"Updating…":"Update index"})]})]})}export{Fs as KnowledgeSearchScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as f,j as e}from"./index-Bli6bTLU.js";import{S as L}from"./SlidePanel-Dg8_styW.js";import{A as j}from"./AgentAvatar-B1xvQ7ej.js";import{H as S}from"./HarnessMark-DGZ6o6Ct.js";import{t as N}from"./time-Dhsh_2EG.js";import{o as g,f as k,b as y}from"./lane-observe-vfyACHi0.js";import{S as A}from"./SessionObserve-zAlFbwFn.js";import{LaneTraceEventFocus as E}from"./LaneTraceEventFocus-C9cmqxnK.js";import{b as T}from"./agent-lane-detail-D5EIlX7_.js";import{l as I,a as z}from"./agent-lanes-model-BKOs_32K.js";import"./Provider-Ve8yXaWR.js";import"./provider-CX9EWecp.js";import"./router-B0YclXYg.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./api-DEHEgJ9m.js";import"./sse-CSozY6mp.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./createLucideIcon-DLlxGjKt.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./file-text-BVhkMWyC.js";import"./x-BJyPzFnn.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-7iEtvu9P.js";import"./NewChatComposer-Bgqes0UQ.js";import"./text-BR9Bap0E.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DoT8gpw6.js";import"./conversation-model-CigSPlKA.js";import"./index-DFdlQs_c.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./chevron-down-Da5tV19_.js";import"./search-BbgsEMXa.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./SpriteAvatar-DMrSssNZ.js";import"./agent-identity-DzHGhLdJ.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-197xYmRp.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-Cd6XticV.js";import"./AgentDetailCard-FelCxQrT.js";import"./AgentLiveActions-Bn3zeZBN.js";import"./terminal-takeover-CtA3wcXh.js";import"./openContent-C6XO6kr5.js";import"./eye-BeCSqJn1.js";import"./terminal-BiNIXhna.js";import"./message-markup-DAnnGpWr.js";import"./ObservedTopologyPanel-D85P6RAk.js";import"./ObserveTextFlow-C1f5oize.js";import"./use-reduced-motion-BLn59zLn.js";import"./proxy-C35W-YHZ.js";import"./SessionObserveEvidence-BVawzqoE.js";import"./message-circle-44KSmbvQ.js";import"./wrench-CQvdf7KT.js";import"./external-link-BGHC_naA.js";import"./context-budget-DX_fwUs3.js";const M={think:"Thought",tool:"Tool",ask:"Request",message:"Message",note:"Note",system:"System",boot:"Boot"};function Ve({target:d,onClose:n}){const{lane:i,event:t}=d,{agent:s,observe:l,source:r,lastActiveAt:a}=i,p=f.useMemo(()=>T(i),[i]),c=I(s,r),v=z(s,r),h=M[t.kind]??t.kind,u=l?.metadata?.session?.sessionStart,o=g(t,u),b=o!=null?k(o,a):void 0,x=o!=null?y(o):void 0,m=t.kind==="tool"||t.kind==="ask"?t:void 0;return e.jsxs(L,{open:!0,onClose:n,side:"right",owner:"openscout.lane-trace",layer:"elevated",resizable:!0,defaultSize:980,minSize:560,maxSize:1280,scrollLock:!0,ariaLabel:`${c} session trace`,className:"s-lane-trace-sheet",children:[e.jsxs("div",{className:"s-slide-header s-lane-trace-sheet-header",children:[e.jsx(j,{agent:s,placement:"row",size:28,presence:!1,className:"s-agent-lane-avatar"}),e.jsxs("div",{className:"s-lane-trace-sheet-header-copy",children:[e.jsx("div",{className:"s-lane-trace-sheet-title",children:c}),e.jsxs("div",{className:"s-lane-trace-sheet-sub",children:[v," · ",h,a?` · ${N(a)}`:""]})]}),e.jsx("span",{className:"s-slide-spacer"}),e.jsx(S,{harness:s.harness??p.harness,size:18,className:"s-lane-trace-sheet-hmark"}),e.jsx("button",{type:"button",className:"s-slide-close",onClick:n,"aria-label":"Close",children:"×"})]}),e.jsx("div",{className:"s-slide-body s-lane-trace-sheet-body",children:e.jsx(A,{data:l??void 0,agentId:r==="scout"?s.id:void 0,sessionId:s.harnessSessionId??p.sessionId,showRail:!0,variant:"default",initialCursorT:t.t,focusEventId:t.id,inlineFocusEventId:m?.id,inlineFocusContent:m?e.jsx(E,{event:m,wallLabel:b,wallTitle:x,variant:"inline"}):void 0})})]})}export{Ve as LaneTraceDetailSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,j as e}from"./index-Bli6bTLU.js";import{a as B}from"./api-DEHEgJ9m.js";import{t as A}from"./time-Dhsh_2EG.js";import{n as _,b as D,s as z,c as F}from"./colors-BtO5_zlx.js";import{u as O,d as H}from"./Provider-Ve8yXaWR.js";import{d as K}from"./router-B0YclXYg.js";import{MeshCanvas as U}from"./MeshCanvas-C3_2p9B6.js";import{u as V}from"./useAgentHoverCard-6N8b7qsU.js";import{u as Q}from"./local-agents-BMadXuP1.js";import{u as J,a as W,s as X,e as E,f as I,g as Y,h as L}from"./mesh-view-store-Cpqil_2D.js";import{u as Z}from"./useContentSecondaryNav-D-hVKzM9.js";import{OpsSubnav as G}from"./OpsSubnav-BijKI3yG.js";/* empty css *//* empty css */import"./provider-CX9EWecp.js";import"./sse-CSozY6mp.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./createLucideIcon-DLlxGjKt.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./file-text-BVhkMWyC.js";import"./x-BJyPzFnn.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-7iEtvu9P.js";import"./NewChatComposer-Bgqes0UQ.js";import"./text-BR9Bap0E.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DoT8gpw6.js";import"./conversation-model-CigSPlKA.js";import"./index-DFdlQs_c.js";import"./HarnessMark-DGZ6o6Ct.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./chevron-down-Da5tV19_.js";import"./search-BbgsEMXa.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./Canvas-KyTsDJlB.js";import"./mesh-buckets-CfAukILK.js";import"./AgentDetailCard-FelCxQrT.js";import"./AgentLiveActions-Bn3zeZBN.js";import"./terminal-takeover-CtA3wcXh.js";import"./openContent-C6XO6kr5.js";import"./eye-BeCSqJn1.js";import"./terminal-BiNIXhna.js";import"./SecondaryNav-cYTw2p39.js";import"./secondaryNavConfig-DyC_P9Wx.js";import"./message-square-DlY4EneU.js";import"./compass-BepM5iWH.js";import"./settings-BzWCF3NF.js";import"./git-branch-q8Ayc8py.js";import"./scroll-text-DRidbcse.js";/* empty css */function ee(c){const p=new Map,x=new Map;for(const a of c){const o=a.project??"Unassigned",i=o.toLowerCase(),m=a.branch??"—";let r=p.get(i);r||(r=new Map,p.set(i,r));const u=r.get(m)??[];u.push(a),r.set(m,u);let s=x.get(i);s||(s=new Map,x.set(i,s)),s.set(o,(s.get(o)??0)+1)}const g=a=>{const o=x.get(a);if(!o)return a;let i=null,m=-1;for(const[r,u]of o)u>m&&(i=r,m=u);return i??a},j=[];for(const[a,o]of p){const i=g(a),m=[];let r=0;const u={in_turn:0,in_flight:0,needs_attention:0,callable:0,blocked:0},s=[];for(const[l,n]of o){const t=[...n].sort((h,b)=>(b.updatedAt??0)-(h.updatedAt??0)),y=t.reduce((h,b)=>Math.max(h,b.updatedAt??0),0);r=Math.max(r,y);for(const h of t)u[_(h.state)]+=1,s.push(h);m.push({branch:l,agents:t,latest:y})}m.sort((l,n)=>n.latest-l.latest),j.push({project:i,branches:m,agents:s,latest:r,counts:u})}return j.sort((a,o)=>o.latest-a.latest),j}function T(c){return c?c.replace(/^\/Users\/[^/]+/,"~"):null}function se({agents:c,emptyTitle:p="No agents registered",emptyBody:x="Agents connected to this broker will appear here.",selectMode:g="preview"}){const{navigate:j}=O(),a=d.useMemo(()=>ee(c),[c]),[o,i]=d.useState(()=>new Set),m=d.useMemo(()=>{const s=[];for(const l of a)if(!o.has(l.project))for(const n of l.branches)for(const t of n.agents)s.push(t.id);return s},[a,o]),r=V({agents:c,orderedIds:m,navigate:j,selectMode:g});if(c.length===0)return e.jsxs("div",{className:"sys-list-empty",children:[e.jsx("h3",{children:p}),e.jsx("p",{children:x})]});const u=s=>{i(l=>{const n=new Set(l);return n.has(s)?n.delete(s):n.add(s),n})};return e.jsxs("div",{className:"mesh-tree",ref:r.containerRef,children:[a.map(s=>{const l=o.has(s.project);return e.jsxs("div",{className:`mesh-tree-group${l?" mesh-tree-group--collapsed":""}`,children:[e.jsxs("button",{type:"button",className:"mesh-tree-project",onClick:()=>u(s.project),"aria-expanded":!l,children:[e.jsx("span",{className:`mesh-tree-caret${l?"":" mesh-tree-caret--open"}`,"aria-hidden":!0,children:"›"}),e.jsx("span",{className:"mesh-tree-project-name",children:s.project}),e.jsx("span",{className:"mesh-tree-project-count",children:s.agents.length}),e.jsxs("span",{className:"mesh-tree-counts",children:[s.counts.in_turn+s.counts.in_flight+s.counts.needs_attention>0&&e.jsxs("span",{className:"mesh-tree-count mesh-tree-count--working",children:[e.jsx("span",{className:"mesh-tree-count-dot"}),s.counts.in_turn+s.counts.in_flight+s.counts.needs_attention]}),s.counts.callable>0&&e.jsxs("span",{className:"mesh-tree-count mesh-tree-count--available",children:[e.jsx("span",{className:"mesh-tree-count-dot"}),s.counts.callable]}),s.counts.blocked>0&&e.jsxs("span",{className:"mesh-tree-count mesh-tree-count--offline",children:[e.jsx("span",{className:"mesh-tree-count-dot"}),s.counts.blocked]})]}),e.jsx("span",{className:"mesh-tree-project-time",children:s.latest?A(s.latest):""})]}),!l&&e.jsx("div",{className:"mesh-tree-branches",children:s.branches.map(n=>e.jsxs("div",{className:"mesh-tree-branch",children:[e.jsxs("div",{className:"mesh-tree-branch-head",children:[e.jsx("span",{className:"mesh-tree-branch-elbow","aria-hidden":!0,children:"└"}),e.jsx("span",{className:"mesh-tree-branch-name",children:n.branch})]}),e.jsx("div",{className:"mesh-tree-agents",children:n.agents.map(t=>{const y=_(t.state),h=D(t.state),b=t.agentClass==="organic",S=r.getState(t.id),k=T(t.cwd)??T(t.projectRoot),f=t.harnessSessionId?t.harnessSessionId.slice(0,8):null,v=[];k&&v.push({kind:"cwd",text:k}),t.harness&&v.push({kind:"harness",text:t.harness}),t.model&&v.push({kind:"model",text:t.model}),f&&v.push({kind:"sess",text:`sess:${f}`});const $=r.bind(t.id);return e.jsxs("button",{type:"button",className:`mesh-tree-agent${b?" mesh-tree-agent--organic":""}${S.isActive?" mesh-tree-agent--active":""}${S.isPinned?" mesh-tree-agent--pinned":""}`,title:b?`${t.harness??t.name} · organic session`:void 0,...$,children:[e.jsx("span",{className:`mesh-tree-agent-dot mesh-tree-agent-dot--${h}`,style:{background:z(t.state)}}),e.jsx("span",{className:"mesh-tree-agent-name",children:t.handle??t.name}),b&&e.jsx("span",{className:"mesh-tree-agent-organic","aria-label":"organic session",children:"○"}),e.jsx("span",{className:"mesh-tree-agent-inline",children:v.map((w,R)=>e.jsxs("span",{className:`mesh-tree-agent-inline-part mesh-tree-agent-inline-part--${w.kind}`,children:[R>0&&e.jsx("span",{className:"mesh-tree-agent-inline-sep",children:"·"}),w.text]},w.kind))}),e.jsx("span",{className:`mesh-tree-agent-state mesh-tree-agent-state--${h}`,children:F(y)}),e.jsx("span",{className:"mesh-tree-agent-time",children:t.updatedAt?A(t.updatedAt):""})]},t.id)})})]},n.branch))})]},s.project)}),r.card]})}function P({mode:c,density:p,query:x,stateFilter:g,loading:j,refreshing:a,error:o,lastLoadedAt:i,hasMesh:m,onRefresh:r}){return e.jsxs("div",{className:`mesh-hud mesh-hud--${c}`,children:[e.jsxs("div",{className:"mesh-hud-left",children:[e.jsxs("div",{className:"mesh-mode-toggle",children:[e.jsx("button",{type:"button",className:`mesh-mode-btn${c==="map"?" mesh-mode-btn--active":""}`,onClick:()=>E("map"),children:"Map"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${c==="tree"?" mesh-mode-btn--active":""}`,onClick:()=>E("tree"),children:"Tree"})]}),e.jsxs("div",{className:"mesh-mode-toggle mesh-density-toggle",role:"group","aria-label":"Density","aria-hidden":c!=="map","data-mode-only":"map",children:[e.jsx("button",{type:"button",className:`mesh-mode-btn${p==="compact"?" mesh-mode-btn--active":""}`,onClick:()=>I("compact"),disabled:c!=="map",title:"Compact — dots",children:"Compact"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${p==="comfortable"?" mesh-mode-btn--active":""}`,onClick:()=>I("comfortable"),disabled:c!=="map",title:"Comfortable — chips",children:"Comfortable"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${p==="spacious"?" mesh-mode-btn--active":""}`,onClick:()=>I("spacious"),disabled:c!=="map",title:"Spacious — cards",children:"Spacious"})]})]}),m&&e.jsxs("div",{className:"mesh-hud-filters",children:[e.jsx("input",{type:"search",className:"mesh-hud-search",placeholder:"Filter agents…",value:x,onChange:u=>Y(u.target.value),spellCheck:!1,autoCorrect:"off",autoCapitalize:"off"}),e.jsxs("div",{className:"mesh-mode-toggle",role:"group","aria-label":"State",children:[e.jsx("button",{type:"button",className:`mesh-mode-btn${g==="all"?" mesh-mode-btn--active":""}`,onClick:()=>L("all"),children:"All"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${g==="in_turn"?" mesh-mode-btn--active":""}`,onClick:()=>L("in_turn"),children:"In turn"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${g==="callable"?" mesh-mode-btn--active":""}`,onClick:()=>L("callable"),children:"Callable"})]})]}),e.jsxs("div",{className:"mesh-hud-right",children:[e.jsx("span",{className:"mesh-hud-sync",children:j?"Loading…":o&&m?`Last sync old — ${i?A(i):"unknown"}`:i?A(i):"—"}),e.jsx("button",{type:"button",className:"s-btn",disabled:j||a,onClick:r,children:a?"Refreshing…":"Refresh"})]})]})}function is({navigate:c}){const[p,x]=d.useState(!0),[g,j]=d.useState(!1),[a,o]=d.useState(null),[i,m]=d.useState(null),{mode:r,density:u,query:s,stateFilter:l,meshSnapshot:n}=J(),{agents:t}=Q(),{route:y}=O(),h=K(y),b=d.useMemo(()=>H(t,h,n?.localNode?.id),[t,h,n?.localNode?.id]),S=d.useRef(null),k=d.useRef(0);d.useEffect(()=>{S.current=n},[n]),d.useEffect(()=>{h&&W(h,"node")},[h]);const f=d.useCallback(async(C="initial")=>{const N=++k.current;!(S.current!==null)&&C!=="background"?(x(!0),o(null)):j(!0);try{const M=await B("/api/mesh");if(N!==k.current)return;X(M),o(null),m(Date.now())}catch(M){if(N!==k.current)return;o(M instanceof Error?M.message:String(M))}finally{N===k.current&&(x(!1),j(!1))}},[]);d.useEffect(()=>{f("initial")},[f]),d.useEffect(()=>{const C=setInterval(()=>{f("background")},1e4);return()=>clearInterval(C)},[f]);const v=d.useMemo(()=>{const C=s.trim().toLowerCase();return b.filter(N=>l!=="all"&&_(N.state)!==l?!1:C?`${N.name??""} ${N.handle??""} ${N.harness??""} ${N.project??""} ${N.branch??""}`.toLowerCase().includes(C):!0)},[s,b,l]),$={mode:r,density:u,query:s,stateFilter:l,loading:p,refreshing:g,error:a,lastLoadedAt:i,hasMesh:!!n,onRefresh:()=>{f("manual")}},w=r==="map"?e.jsxs("div",{className:"mesh-map-canvas",children:[n&&e.jsx(U,{mesh:n,agents:v}),p&&!n&&e.jsx("div",{className:"mesh-canvas-center",children:e.jsx("p",{className:"mesh-canvas-center-label",children:"Loading mesh…"})}),!p&&!n&&a&&e.jsxs("div",{className:"mesh-canvas-center",children:[e.jsx("p",{className:"mesh-canvas-center-label",children:a}),e.jsx("button",{type:"button",className:"s-btn",onClick:()=>{f("manual")},children:"Try again"})]}),e.jsx(P,{...$})]}):e.jsxs("div",{className:"mesh-tree-page",children:[e.jsx(P,{...$}),p&&!n&&e.jsxs("div",{className:"sys-panel sys-state-card mesh-tree-state",children:[e.jsx("h3",{className:"sys-state-title",children:"Loading mesh status"}),e.jsx("p",{className:"sys-state-body",children:"Inspecting broker reachability and peer discovery inputs."})]}),!p&&!n&&a&&e.jsxs("div",{className:"sys-panel sys-state-card sys-state-card-error mesh-tree-state",children:[e.jsx("h3",{className:"sys-state-title",children:"Mesh status is unavailable"}),e.jsx("p",{className:"sys-state-body",children:a}),e.jsx("div",{className:"sys-inline-actions",children:e.jsx("button",{type:"button",className:"s-btn",onClick:()=>{f("manual")},children:"Try again"})})]}),n&&e.jsxs("section",{className:"mesh-tree-panel",children:[e.jsxs("div",{className:"mesh-tree-hint","aria-hidden":!0,children:[e.jsx("kbd",{children:"↑"}),e.jsx("kbd",{children:"↓"}),e.jsx("span",{children:"navigate"}),e.jsx("span",{className:"mesh-tree-hint-sep",children:"·"}),e.jsx("kbd",{children:"enter"}),e.jsx("span",{children:"pin"}),e.jsx("span",{className:"mesh-tree-hint-sep",children:"·"}),e.jsx("kbd",{children:"o"}),e.jsx("span",{children:"open"}),e.jsx("span",{className:"mesh-tree-hint-sep",children:"·"}),e.jsx("kbd",{children:"esc"}),e.jsx("span",{children:"clear"})]}),e.jsx(se,{agents:v,emptyTitle:b.length===0?h?"No agents on this machine":"No agents registered":"No agents match your filter",emptyBody:b.length===0?"Agents connected to this broker will appear here.":"Try clearing the search or switching the state pill back to All."})]})]}),R=Z();return e.jsxs("div",{className:"s-ops",children:[R?e.jsx("div",{className:"s-ops-header",children:e.jsx(G,{activeRoute:y,navigate:c})}):null,e.jsx("div",{className:"s-ops-body",children:w})]})}export{is as MeshScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as a}from"./index-Bli6bTLU.js";import{i as w,a as C}from"./conversation-model-CigSPlKA.js";import{u as M,m as S,e as b}from"./Provider-Ve8yXaWR.js";import{d as A}from"./router-B0YclXYg.js";import{l as I,i as B,s as E}from"./sessionRead-CvFz2RHv.js";import{u as L}from"./use-conversation-list-C0bEXFeH.js";import{u as R}from"./use-fleet-active-asks-CK4aw-3G.js";import{ConversationScreen as D}from"./ConversationScreen-CjWWmuuh.js";import{P as O}from"./plus-64n9qucr.js";import"./createLucideIcon-DLlxGjKt.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./provider-CX9EWecp.js";import"./api-DEHEgJ9m.js";import"./sse-CSozY6mp.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./file-text-BVhkMWyC.js";import"./x-BJyPzFnn.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-7iEtvu9P.js";import"./NewChatComposer-Bgqes0UQ.js";import"./text-BR9Bap0E.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DoT8gpw6.js";import"./index-DFdlQs_c.js";import"./HarnessMark-DGZ6o6Ct.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./chevron-down-Da5tV19_.js";import"./search-BbgsEMXa.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./ConversationComposer-Ce7Byw48.js";import"./AgentAvatar-B1xvQ7ej.js";import"./SpriteAvatar-DMrSssNZ.js";import"./agent-identity-DzHGhLdJ.js";import"./zap-rw7uwZht.js";import"./message-markup-DAnnGpWr.js";import"./mentions-Cd6XticV.js";import"./AgentDetailCard-FelCxQrT.js";import"./AgentLiveActions-Bn3zeZBN.js";import"./terminal-takeover-CtA3wcXh.js";import"./openContent-C6XO6kr5.js";import"./eye-BeCSqJn1.js";import"./terminal-BiNIXhna.js";import"./message-visibility-kJM8XcSG.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-C3sg0ULI.js";import"./BackToPicker-CqYhOaLB.js";import"./AstronautSuit-BADl7m8x.js";import"./ConversationFeedRows-DygDfQn_.js";import"./ConversationPanels-Dg4Y2GgX.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-BLn59zLn.js";import"./proxy-C35W-YHZ.js";import"./activity-D4W2XZY2.js";import"./message-circle-44KSmbvQ.js";import"./tail-events-CrN-Rmxj.js";import"./ConversationStatus-BhVIYQza.js";import"./check-Bfs7hMb1.js";import"./sparkles-ytTwpCbZ.js";function it({conversationId:s,navigate:c}){return s?e.jsx(D,{conversationId:s,navigate:c,showBackNav:!1}):e.jsx(P,{})}function P(){const{onlineCount:s,apiConnection:c,reload:j,route:N,agents:d,openContextCapture:k,navigate:u}=M(),{sessions:y,loading:p,loadError:n}=L(),[x]=a.useState(()=>I()),v=R(),t=c.status==="offline",i=A(N),f=a.useRef(!1),h=a.useMemo(()=>{const m=S(d,i);return[...b(y,m,i)].sort((g,o)=>(o.lastMessageAt??0)-(g.lastMessageAt??0))},[y,d,i]),r=a.useMemo(()=>{const m=h.filter(o=>!w(o));return m.find(o=>o.agentId?v.get(o.agentId)?.status==="needs_attention"&&B(o.lastMessageAt,o.id,x):!1)??m[0]},[h,v,x]);a.useEffect(()=>{f.current||p||n||t||r&&(f.current=!0,E(r.id),u({view:"messages",conversationId:r.id,...i?{machineId:i}:{}},{replace:!0}))},[r,p,n,t,i,u]);const l=!t&&!n&&(p||!!r);return e.jsx("div",{className:`s-conv-empty${t?" s-conv-empty--offline":""}`,children:e.jsxs("div",{className:"s-conv-empty-inner",children:[e.jsx($,{}),e.jsx("div",{className:"s-conv-empty-eyebrow",children:t?"Connection":"Conversations"}),e.jsx("p",{className:"s-conv-empty-title",children:t?"Scout server offline":l?"Opening your latest conversation":n?"Chats unavailable":"Nothing open yet"}),e.jsx("p",{className:"s-conv-empty-detail",children:t?"Start or restart Scout services. Chats and context will appear when the server responds.":l?V(r):n||"Start a chat by choosing an agent and sending the first message."}),t||n?e.jsx("button",{type:"button",className:"s-conv-empty-action",onClick:()=>{j()},children:"Retry connection"}):l?null:e.jsxs("button",{type:"button",className:"s-conv-empty-new",onClick:()=>k(),children:[e.jsx(O,{size:16,"aria-hidden":"true"}),"New chat"]}),e.jsxs("div",{className:"s-conv-empty-ambient",children:[e.jsx("span",{className:"s-conv-empty-ambient-dot","aria-hidden":"true"}),t?"waiting for server":`${s} ${s===1?"agent":"agents"} active`]})]})})}function V(s){return s?C(s):"Finding where you left off."}function $(){return e.jsxs("svg",{className:"s-conv-empty-mesh",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"14",y1:"20",x2:"36",y2:"12"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"36",y1:"12",x2:"58",y2:"24"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"14",y1:"20",x2:"24",y2:"46"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"24",y1:"46",x2:"36",y2:"12"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"24",y1:"46",x2:"50",y2:"54"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"50",y1:"54",x2:"58",y2:"24"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"36",y1:"12",x2:"50",y2:"54"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"14",cy:"20",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"58",cy:"24",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"24",cy:"46",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"50",cy:"54",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node s-conv-empty-mesh-node--accent",cx:"36",cy:"12",r:"3.5"})]})}export{it as MessagesScreen};
|