@openscout/scout 0.2.97 → 0.2.98
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 +0 -1
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/ActivityScreen-sfonf5SR.js +1 -0
- package/dist/client/assets/{AddProjectForm-r_1tVuWk.js → AddProjectForm-fXndbzXT.js} +1 -1
- package/dist/client/assets/{AgentAvatar-B7c0egdP.js → AgentAvatar-Dz79iTxB.js} +1 -1
- package/dist/client/assets/AgentConfigurationScreen-DDc3udYM.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-DHDS9Pgd.js +1 -0
- package/dist/client/assets/{AgentDetailCard-B_KLcgsP.js → AgentDetailCard-8viaEY8b.js} +1 -1
- package/dist/client/assets/AgentFloorView-DuyvyMMj.js +1 -0
- package/dist/client/assets/AgentInfoScreen-qntgg2q2.js +1 -0
- package/dist/client/assets/{AgentLaneCard-ajZvcfdW.js → AgentLaneCard-Cc9uyfBr.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-CTp39syR.js → AgentLaneChrome-Dv2lBFoH.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-DRc-TpMB.js → AgentLaneDetailSheet-CGqtqSHQ.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-VMNDo7kD.js → AgentLaneSummaryResize-Di4u6df2.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-BA6fRwkD.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-CFadSaia.js → AgentLanesPreflight-CCGBArIb.js} +1 -1
- package/dist/client/assets/AgentLanesView-96lHsoX7.js +2 -0
- package/dist/client/assets/{AgentLiveActions-CsQA3pu_.js → AgentLiveActions-DlSKL60c.js} +1 -1
- package/dist/client/assets/AgentMasterScreen-DHrMuQ6_.js +1 -0
- package/dist/client/assets/{AgentSessions-BePq5Lgc.js → AgentSessions-DV9v34aq.js} +2 -2
- package/dist/client/assets/AgentsConsole-DTpVhS67.js +1 -0
- package/dist/client/assets/AgentsScreen-hZ4o2I-e.js +1 -0
- package/dist/client/assets/AgentsSubnav-Ci7uWM7P.js +1 -0
- package/dist/client/assets/{AstronautSuit-Cjjcv6yQ.js → AstronautSuit-CwB4Dw07.js} +1 -1
- package/dist/client/assets/{AtopView-PxWQd-sX.js → AtopView-D7vyQDtE.js} +1 -1
- package/dist/client/assets/{BackToPicker-Cto0Ioz9.js → BackToPicker-BHicJyfc.js} +1 -1
- package/dist/client/assets/BriefingDetailScreen-B-wD_Bot.js +1 -0
- package/dist/client/assets/{BriefingsScreen-DNyFBrPn.js → BriefingsScreen-Cn4Mbam9.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-DbaCQlhw.js → BrokerMetadataPanel-BJSwU9XZ.js} +1 -1
- package/dist/client/assets/BrokerScreen-C8FQ5rlg.js +5 -0
- package/dist/client/assets/{CastPicker-CTBHjjGw.js → CastPicker-CkgTalIt.js} +1 -1
- package/dist/client/assets/{ChatCollapsedStrip-D4rc7wBQ.js → ChatCollapsedStrip-7Wrg8Ge0.js} +1 -1
- package/dist/client/assets/{CodeDiffPane-QvxCUzTi.js → CodeDiffPane-DfluIWmO.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-DplkpM7f.js → CodeProjectPicker-By_Wz9ex.js} +1 -1
- package/dist/client/assets/CodeScreen-cLC0tJ4S.js +1 -0
- package/dist/client/assets/ConversationComposer-BUIjWMBi.js +1 -0
- package/dist/client/assets/ConversationFeedRows-Bx0gFyG_.js +1 -0
- package/dist/client/assets/ConversationHeader-Bt2RBj93.js +1 -0
- package/dist/client/assets/{ConversationPanels-fMo6Uy1v.js → ConversationPanels-o6W-cOoU.js} +2 -2
- package/dist/client/assets/ConversationScreen-DIU7m_aC.js +2 -0
- package/dist/client/assets/{ConversationStatus-DI5GCiyW.js → ConversationStatus-CTYOywFh.js} +1 -1
- package/dist/client/assets/{CrewAvatar-CXJHLNVM.js → CrewAvatar-CZ_faQ_s.js} +1 -1
- package/dist/client/assets/CrewWorkspaces-DNX-QQ1h.js +1 -0
- package/dist/client/assets/{DataTable-DXIlOlVu.js → DataTable-C6aMSilS.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-CrELgl2e.js → DispatchAftermath-ZCEB75hh.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-DFFE85Tq.js → DocumentFocusViewer-D8iB6SMt.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-DgpewB3y.js → EmbeddableSurfacesLab-D3iZiS8o.js} +1 -1
- package/dist/client/assets/{EmptyState-D9X16fKq.js → EmptyState-CKPWFSjq.js} +1 -1
- package/dist/client/assets/{FileViewerPane-CY0RN78e.js → FileViewerPane-CxNbcTYf.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-BTe1YRPr.js +1 -0
- package/dist/client/assets/{FollowScreen-wZ-z67mX.js → FollowScreen-CkR-okdL.js} +1 -1
- package/dist/client/assets/{HarnessMark-DAaWPiT_.js → HarnessMark-DttReffF.js} +1 -1
- package/dist/client/assets/HarnessesScreen-COO_Q8VY.js +1 -0
- package/dist/client/assets/{HerdrSession-CYKRfBad.js → HerdrSession-DsuxCtfX.js} +1 -1
- package/dist/client/assets/{HomeHero-DYyd3cpz.js → HomeHero-DXJo2QSO.js} +1 -1
- package/dist/client/assets/{HostAdvisorView-NtM0bsg8.js → HostAdvisorView-DeJ-8RZV.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-CU6BCFcS.js → KnowledgeSearchInspector-W_zNIBRV.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-_rxJNUUh.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-Bo2Zl-1a.js → LaneToolHoverCard-t7-XJP-h.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-DNIECgEl.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-Cek_64zR.js → LaneTraceEventFocus-BB5DhFQm.js} +1 -1
- package/dist/client/assets/{MeshCanvas-TvsID4fe.js → MeshCanvas-DZv2ipsy.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-CxqeVVco.js → MeshCanvasMinimap-BXHRNb7l.js} +1 -1
- package/dist/client/assets/MeshScreen-DuNvpDC5.js +1 -0
- package/dist/client/assets/{MeshTopologyView-BjprutE8.js → MeshTopologyView-Dc0GSrKa.js} +2 -2
- package/dist/client/assets/MessagesScreen-dNNPFwAc.js +1 -0
- package/dist/client/assets/{MissionContextRail-Be0uXljQ.js → MissionContextRail-DnCWPzAM.js} +1 -1
- package/dist/client/assets/MissionControlView-DmaThhNR.js +1 -0
- package/dist/client/assets/MissionFocusOverlay-K21ssTxv.js +1 -0
- package/dist/client/assets/MissionLeftAgentRow-CbQm4BLv.js +1 -0
- package/dist/client/assets/{MissionLogPane-EsM_S3ro.js → MissionLogPane-BLvSSIdT.js} +1 -1
- package/dist/client/assets/{NewAgentModal-Cqiq1CE1.js → NewAgentModal-B7qxjZlW.js} +1 -1
- package/dist/client/assets/NewChatComposer-D2Ah4T-W.js +19 -0
- package/dist/client/assets/{NewChatOrigin-D7hwp6dm.js → NewChatOrigin-DCn5cWPZ.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-CGHI_hb5.js → ObserveEmbedScreen-DvKGsaLv.js} +2 -2
- package/dist/client/assets/{ObserveTextFlow-BcrGQet8.js → ObserveTextFlow-DCJ5EmD8.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-BhVsvwkh.js → ObservedTopologyPanel-CJVqIqQ2.js} +1 -1
- package/dist/client/assets/{OpenScoutAppShell-BtfvMkAp.js → OpenScoutAppShell-C9TOLB7u.js} +2 -2
- package/dist/client/assets/OpsAgentsView-vIoY-AW1.js +1 -0
- package/dist/client/assets/OpsScreen-CJBwshEp.js +1 -0
- package/dist/client/assets/OpsSubnav-CjDTnp64.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-Br1eTD7G.js +1 -0
- package/dist/client/assets/ProjectAgentProfileBar-CUzZ4Rpx.js +1 -0
- package/dist/client/assets/ProjectAgentProfileHero-mjxNcRvw.js +1 -0
- package/dist/client/assets/ProjectsInbox-Bq29DE_o.js +2 -0
- package/dist/client/assets/ProjectsRail-kMDA0yn4.js +1 -0
- package/dist/client/assets/ProjectsScreen-BDaJYhc0.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-B940p3vW.js +1 -0
- package/dist/client/assets/Provider-D0bB7q6y.js +1 -0
- package/dist/client/assets/{RailRow-ClMmtaIE.js → RailRow-B88JVr62.js} +1 -1
- package/dist/client/assets/RawSessionsTable-CzGhEdiZ.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-CyP1CWsX.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-CjZ5ew3y.js → RepoDiffEmbedScreen-mexrJPhW.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-CdTFfmbk.js → RepoDiffPageScreen-DbqX4L3q.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-BFperHQg.js → RepoDiffViewer-Bw5yMC4A.js} +1 -1
- package/dist/client/assets/{RepoDiffViewerLazy-BkBmbi1Z.js → RepoDiffViewerLazy-DzfoFhbl.js} +2 -2
- package/dist/client/assets/{ReposScreen-C8dT4bK0.js → ReposScreen-CzbO1Fuy.js} +2 -2
- package/dist/client/assets/{ScoutDeckSurface-BcJsm2Kq.js → ScoutDeckSurface-DQoZofzH.js} +1 -1
- package/dist/client/assets/{ScoutSurface-DmzEtrx8.js → ScoutSurface-NlhDsPzg.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-DU15Plja.js → ScoutbotFxLab-l2WAahCg.js} +1 -1
- package/dist/client/assets/{SecondaryNav-BrXMtvKE.js → SecondaryNav-Cs0_FQdj.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-Bt4flmAx.js → SessionEmbedScreen-CpduQ0O9.js} +1 -1
- package/dist/client/assets/{SessionObserve-BCehTlO8.js → SessionObserve-BVeTkcIl.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-Bb6U-dem.js → SessionObserveEvidence-BkOezTGV.js} +1 -1
- package/dist/client/assets/SessionRefScreen-DetLMkTT.js +1 -0
- package/dist/client/assets/SessionsScreen-B-McKw6d.js +1 -0
- package/dist/client/assets/{SettingsDrawer-BieUmb8g.js → SettingsDrawer-CPB32w0n.js} +3 -3
- package/dist/client/assets/SettingsScreen-BEzYFdjz.js +1 -0
- package/dist/client/assets/{ShikiPane-DPWsVNtn.js → ShikiPane-C0TuCATU.js} +1 -1
- package/dist/client/assets/{SlidePanel-BMRIR6bH.js → SlidePanel-CETQ5NTx.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-56DTXxSV.js → SpriteAvatar-DFO4Kb4Z.js} +1 -1
- package/dist/client/assets/{StatusPill-BcuYUgsD.js → StatusPill-BllrY-eg.js} +1 -1
- package/dist/client/assets/{TailView-BDy8c2VB.js → TailView-_gKWfaQM.js} +2 -2
- package/dist/client/assets/Terminal-DWyZTZdY.js +1 -0
- package/dist/client/assets/TerminalEmbedScreen-_SSzwhWa.js +1 -0
- package/dist/client/assets/{TerminalHeaderMount-Cy-uxkey.js → TerminalHeaderMount-CY7uIWBg.js} +1 -1
- package/dist/client/assets/{TextDocumentSurface-BeSwe3Yl.js → TextDocumentSurface-2X1Gw4eA.js} +1 -1
- package/dist/client/assets/{TmuxPeek-B4no_aGI.js → TmuxPeek-CqTJRhkI.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-Bd16scwz.js → VoicePermissionsPanel-C4vkU-sU.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-DIFQufak.js → WorkDetailScreen-DqGnuK0e.js} +3 -3
- package/dist/client/assets/{WorkFilesViewer-CT5XEFGf.js → WorkFilesViewer-D8-4vF5l.js} +1 -1
- package/dist/client/assets/{activity-CqZafWfx.js → activity-CzTJ-YMX.js} +1 -1
- package/dist/client/assets/{addon-fit-CM6F_JRD.js → addon-fit-Zx3A7pGS.js} +1 -1
- package/dist/client/assets/{addon-webgl-DRTiePFC.js → addon-webgl-DitJj-N0.js} +1 -1
- package/dist/client/assets/{agent-autocomplete-DXUBnlkN.js → agent-autocomplete-BlK8wY06.js} +1 -1
- package/dist/client/assets/{agent-essentials-vytdybaX.js → agent-essentials-K9B6kbTS.js} +1 -1
- package/dist/client/assets/{agent-lane-card-model-CNZMPkhc.js → agent-lane-card-model-CY3OE1Xu.js} +1 -1
- package/dist/client/assets/{agent-lanes-model-DXqjs0OK.js → agent-lanes-model-tc-1hE6q.js} +1 -1
- package/dist/client/assets/{agent-master-model-DAZL92oe.js → agent-master-model-DMcHeNq3.js} +1 -1
- package/dist/client/assets/agent-specialization-CtF_jI34.js +1 -0
- package/dist/client/assets/{arc.es-Bh84oHJ7.js → arc.es-BNXJqSw7.js} +1 -1
- package/dist/client/assets/{arrow-down-DvTsLokL.js → arrow-down-BAGkhHA6.js} +1 -1
- package/dist/client/assets/{arrow-left-DHfdXJVZ.js → arrow-left-eToA6GxC.js} +1 -1
- package/dist/client/assets/{arrow-right-BBsrogWf.js → arrow-right-DTX42clh.js} +1 -1
- package/dist/client/assets/{arrow-up-right-CY0Vw_67.js → arrow-up-right-B09GPwFl.js} +1 -1
- package/dist/client/assets/{bot-DzkOUFBb.js → bot-WxKXYtEX.js} +1 -1
- package/dist/client/assets/{check-DbIkldnK.js → check-Dz2SRHft.js} +1 -1
- package/dist/client/assets/{chevron-down-C475vltS.js → chevron-down-D120PY4g.js} +1 -1
- package/dist/client/assets/{chevron-right-CnZRSd-V.js → chevron-right-CowuvuE6.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-DLNT8aOo.js → chunk-HRAB3GC3-KjjrTLCU.js} +1 -1
- package/dist/client/assets/{chunk-JTPDIGGW-Ci5j4vzV.js → chunk-JTPDIGGW-COJ00z94.js} +3 -3
- package/dist/client/assets/{chunk-T65CQEWV-BtNvicWs.js → chunk-T65CQEWV-H2QEKfr1.js} +1 -1
- package/dist/client/assets/{chunk-YOZR3KYS-DN5EJulq.js → chunk-YOZR3KYS-CrCgXw9l.js} +1 -1
- package/dist/client/assets/{clock-DVvENUU5.js → clock-_9FDplIT.js} +1 -1
- package/dist/client/assets/{code-xml-CvKBY3KA.js → code-xml-CkkNdRmu.js} +1 -1
- package/dist/client/assets/{compass-BcRI_YXo.js → compass-BdpImt_W.js} +1 -1
- package/dist/client/assets/content-0RBfbCIJ.js +1 -0
- package/dist/client/assets/content-BTmnk2bl.js +1 -0
- package/dist/client/assets/content-Bk5DKhyP.js +1 -0
- package/dist/client/assets/{content-BNyAjpUl.js → content-Bw_8GE_S.js} +1 -1
- package/dist/client/assets/content-CI4gLEWi.js +1 -0
- package/dist/client/assets/content-CLCtp9Rb.js +1 -0
- package/dist/client/assets/content-C_FAGTNk.js +1 -0
- package/dist/client/assets/content-CnnzWOE3.js +1 -0
- package/dist/client/assets/content-DKlY98pO.js +1 -0
- package/dist/client/assets/content-Df7ndXTG.js +1 -0
- package/dist/client/assets/content-DkZDzzx3.js +1 -0
- package/dist/client/assets/content-DnGmb2L0.js +1 -0
- package/dist/client/assets/content-Ds-zs-Ss.js +1 -0
- package/dist/client/assets/content-JIWSyC0f.js +1 -0
- package/dist/client/assets/content-Q3TIYC8q.js +1 -0
- package/dist/client/assets/content-evaBfvxD.js +1 -0
- package/dist/client/assets/{context-budget-DX_fwUs3.js → context-budget-DqxWzalx.js} +1 -1
- package/dist/client/assets/{conversation-icons-CBMKBGHd.js → conversation-icons-DHGc9wbT.js} +1 -1
- package/dist/client/assets/conversation-model-C2KuZUXc.js +1 -0
- package/dist/client/assets/conversation-motion-features-BJnHs3Ul.js +1 -0
- package/dist/client/assets/{copy-Cj-owMb-.js → copy-BzdzWsQd.js} +1 -1
- package/dist/client/assets/{cpu-DuD3RFX5.js → cpu-CHFIGw87.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DthwWQIg.js → createLucideIcon-Dv8H8m7J.js} +1 -1
- package/dist/client/assets/discover-DutlV0ZU.js +2 -0
- package/dist/client/assets/embed-entry-CJG7WEVw.js +2 -0
- package/dist/client/assets/{external-link-C_nxk0MJ.js → external-link-BvX5PfLh.js} +1 -1
- package/dist/client/assets/{eye-FnaaPfja.js → eye-C9cGk5z6.js} +1 -1
- package/dist/client/assets/{file-code-corner-DDPq4Cur.js → file-code-corner-jlGFdr8d.js} +1 -1
- package/dist/client/assets/{file-text--hfhwZH1.js → file-text-BHro8MkG.js} +1 -1
- package/dist/client/assets/{gauge-BVEknshP.js → gauge-DSflSery.js} +1 -1
- package/dist/client/assets/{gestures-3gw5VgUS.js → gestures-YA5IIwp-.js} +1 -1
- package/dist/client/assets/{git-branch-DJyvr0k-.js → git-branch-Bc_eDIpG.js} +1 -1
- package/dist/client/assets/{home-moving-signal-BPqBoNSm.js → home-moving-signal-PHSqSBu_.js} +1 -1
- package/dist/client/assets/home-now-card-C_qsI6C6.js +1 -0
- package/dist/client/assets/{home-now-card-nano-G8kMB32m.js → home-now-card-nano-Jmy7eJ6H.js} +1 -1
- package/dist/client/assets/{hooks-BMsQzo9j.js → hooks-ME7rmhpE.js} +1 -1
- package/dist/client/assets/{index-BI9AljSD.js → index-C1VaWNuD.js} +2 -2
- package/dist/client/assets/index-C8UCRm2W.js +1 -0
- package/dist/client/assets/index-Cn0I2Hgi.js +1 -0
- package/dist/client/assets/index-Cx6Gbr6n.js +1 -0
- package/dist/client/assets/{inspector-panel-CFSArQ8Y.js → inspector-panel-CwrHjRaQ.js} +2 -2
- package/dist/client/assets/{keyboard-nav-e6yGeorb.js → keyboard-nav-B8sQ_8IF.js} +1 -1
- package/dist/client/assets/{lane-roster-store-Q7pcblY5.js → lane-roster-store-DN2jxXF-.js} +1 -1
- package/dist/client/assets/{layers-Dz2dKOnU.js → layers-CW2-qHsG.js} +1 -1
- package/dist/client/assets/{layout-grid-Bvs5fdB4.js → layout-grid-BoVnPOk-.js} +1 -1
- package/dist/client/assets/left-BRu9pnqx.js +2 -0
- package/dist/client/assets/left-BjS1dKNV.js +2 -0
- package/dist/client/assets/left-CL-TVLJ7.js +1 -0
- package/dist/client/assets/left-DLpsDi55.js +1 -0
- package/dist/client/assets/left-DPcM9o8Y.js +1 -0
- package/dist/client/assets/left-MmTJf1tK.js +1 -0
- package/dist/client/assets/left-P80i5V8L.js +1 -0
- package/dist/client/assets/left-advisor-CbXVzAqS.js +1 -0
- package/dist/client/assets/left-agents-7mJsiNyr.js +1 -0
- package/dist/client/assets/left-default-COK26l3H.js +1 -0
- package/dist/client/assets/left-lanes-Dbdm9Veu.js +1 -0
- package/dist/client/assets/left-mission-DqGR5jby.js +1 -0
- package/dist/client/assets/library-COnWzUWv.js +1 -0
- package/dist/client/assets/{loader-circle-B2W9DPG5.js → loader-circle-DmUG_YC7.js} +1 -1
- package/dist/client/assets/{local-agents-DKr-gIDC.js → local-agents-VP1-ZlPw.js} +1 -1
- package/dist/client/assets/{mentions-DuLQnEcn.js → mentions-BZ5SBMtc.js} +1 -1
- package/dist/client/assets/mesh-buckets-CLYS8Jx8.js +1 -0
- package/dist/client/assets/{mesh-ops-CRR-KnCG.js → mesh-ops-CKSWgax2.js} +1 -1
- package/dist/client/assets/{mesh-view-store-CiET-yN8.js → mesh-view-store-CBM1za_N.js} +1 -1
- package/dist/client/assets/{message-circle-B2DoYKDO.js → message-circle-joGFxfj1.js} +1 -1
- package/dist/client/assets/{message-markup-Cc_O-WdA.js → message-markup-DC0QFEZn.js} +1 -1
- package/dist/client/assets/{message-square-O-Hu9Mk2.js → message-square-BLiFqpe_.js} +1 -1
- package/dist/client/assets/{mission-control-store-DDAgWKUl.js → mission-control-store-CM8mQGg8.js} +1 -1
- package/dist/client/assets/model-CBkMvT1w.js +1 -0
- package/dist/client/assets/{observe-Da2mRAsc.js → observe-BLmy4quB.js} +1 -1
- package/dist/client/assets/{page-status-Crtgjbq3.js → page-status-BE0-J1xY.js} +1 -1
- package/dist/client/assets/{paperclip-BudMKSyr.js → paperclip-Br7wUDFl.js} +1 -1
- package/dist/client/assets/{persistent-state-xJz-qAFc.js → persistent-state-BubPQ7tT.js} +1 -1
- package/dist/client/assets/{plus-BJ1If8vj.js → plus-BWKhylds.js} +1 -1
- package/dist/client/assets/profile-BCvk8jOQ.js +1 -0
- package/dist/client/assets/projects-inbox-BIW7nv-H.css +1 -0
- package/dist/client/assets/projects-inbox-DFbgVlXL.js +1 -0
- package/dist/client/assets/{proxy-1BABCaDb.js → proxy-DVDRhSRR.js} +1 -1
- package/dist/client/assets/{radio-B5OpHrrK.js → radio-CxIXS1nU.js} +1 -1
- package/dist/client/assets/{refresh-cw-DmNAhaH0.js → refresh-cw-Bkh7Cvnd.js} +1 -1
- package/dist/client/assets/resolve-panes-DhD5qmQO.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-GqhZNRPY.js +1 -0
- package/dist/client/assets/right-B_08ilv6.js +1 -0
- package/dist/client/assets/right-Brm67HOL.js +1 -0
- package/dist/client/assets/right-BveAPKBW.js +1 -0
- package/dist/client/assets/right-CpTB_-Ya.js +1 -0
- package/dist/client/assets/right-CqC4Qdot.js +1 -0
- package/dist/client/assets/right-D91j9d5Y.js +1 -0
- package/dist/client/assets/{right-D8id_DWQ.js → right-DVUq5374.js} +1 -1
- package/dist/client/assets/right-DaLRhYl3.js +1 -0
- package/dist/client/assets/right-Dt1wOwA5.js +1 -0
- package/dist/client/assets/right-DtzqIZQF.js +1 -0
- package/dist/client/assets/{rocket-D3-TUJ2m.js → rocket-CnxqjX_K.js} +1 -1
- package/dist/client/assets/{router-DTtux5sP.js → router-kfcaYqZr.js} +1 -1
- package/dist/client/assets/runtime-picker-C20lTGhV.js +1 -0
- package/dist/client/assets/{scope-views-CPM0sBw_.js → scope-views-KPY85UUx.js} +1 -1
- package/dist/client/assets/{scout-voice-BZKsdquE.js → scout-voice-Cg1qfepC.js} +1 -1
- package/dist/client/assets/scoutbot-D7kGGyK_.js +3 -0
- package/dist/client/assets/{scoutbot-markdown-CQ7Y1McC.js → scoutbot-markdown-yb87JlSE.js} +1 -1
- package/dist/client/assets/{scroll-text-kPhYbh-M.js → scroll-text-DFcBYy5J.js} +1 -1
- package/dist/client/assets/{search-DmFM_9jm.js → search-FB2vVxCp.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-C9bQ9_IA.js → secondaryNavConfig-C0Srrmy8.js} +1 -1
- package/dist/client/assets/{selection-bridge-Dy2mtMyi.js → selection-bridge-qBGFCJv8.js} +1 -1
- package/dist/client/assets/{send-horizontal-qyjNgEaV.js → send-horizontal-CS7mxVhX.js} +1 -1
- package/dist/client/assets/{server-nWqndnxu.js → server-WY6gsbZz.js} +1 -1
- package/dist/client/assets/{session-catalog-BkmktBHI.js → session-catalog-CG4oL_yN.js} +1 -1
- package/dist/client/assets/{session-table-DKSF0mrS.js → session-table-uJh3v-ly.js} +1 -1
- package/dist/client/assets/{settings-C6h9y5XX.js → settings-DQEtqkM9.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-BhHKxsCO.js → sliders-horizontal-57e99_qO.js} +1 -1
- package/dist/client/assets/{sparkles-Cf8gin88.js → sparkles-D0vWLTyC.js} +1 -1
- package/dist/client/assets/{sse-DDHEHUgz.js → sse-B29iGBnw.js} +1 -1
- package/dist/client/assets/{system-surfaces-redesign-QVXNeGYw.css → system-surfaces-redesign-kuf3wuE_.css} +1 -1
- package/dist/client/assets/{tail-events-BdUrO0kb.js → tail-events-LK29oCKm.js} +1 -1
- package/dist/client/assets/{terminal-C3YRPfyz.js → terminal-UDy4lzV1.js} +1 -1
- package/dist/client/assets/{terminal-relay-BFhdIstF.js → terminal-relay-CXHMdain.js} +1 -1
- package/dist/client/assets/{terminal-screen-BLk4PAYt.css → terminal-screen-vMICbBJh.css} +1 -1
- package/dist/client/assets/{terminal-sessions-BQ6t92tJ.js → terminal-sessions-Bdt2W3Y4.js} +1 -1
- package/dist/client/assets/{terminal-takeover-B6H4llRR.js → terminal-takeover-BMeBjBB2.js} +1 -1
- package/dist/client/assets/{use-conversation-list-DO5J8T1H.js → use-conversation-list-UG-tMN67.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-BtgNnRgK.js → use-fleet-active-asks-CCGrll5q.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-N1HHhChY.js → use-mesh-ops-items-BjyeFJTz.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-8WuxLa5l.js → use-reduced-motion-CPoX8iV2.js} +1 -1
- package/dist/client/assets/{use-scout-dev-flags-B31qTy6m.js → use-scout-dev-flags-DTseRrFi.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-Bkv-Uz_V.js → useAgentHoverCard-BgTLNcF-.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-CoIoz7JU.js +1 -0
- package/dist/client/assets/useEmbedHeadline-DuUnwTB7.js +1 -0
- package/dist/client/assets/{usePierreRuntime-BfZHKAkI.js → usePierreRuntime-35AHf9RQ.js} +1 -1
- package/dist/client/assets/{wrench-DkxnZRlR.js → wrench-BfVeded5.js} +1 -1
- package/dist/client/assets/{x-DfRJbqrh.js → x-DgmmnPKt.js} +1 -1
- package/dist/client/assets/{xterm-CJw8Epxv.js → xterm-DnJJmrCA.js} +1 -1
- package/dist/client/assets/{zap-CIo8msJB.js → zap-Bcja1lHG.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/main.mjs +5116 -9854
- package/dist/node/main.mjs +18 -2
- package/dist/pairing-runtime-controller.mjs +23 -2
- package/dist/runtime/broker-daemon.mjs +29 -3
- package/dist/scout-control-plane-web.mjs +27 -3
- package/package.json +2 -5
- package/dist/client/assets/ActivityScreen-y-5DLleY.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-BD7Unt2P.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-BbcZc9Xk.js +0 -1
- package/dist/client/assets/AgentFloorView-DMFiHs21.js +0 -1
- package/dist/client/assets/AgentInfoScreen-DHGLRddI.js +0 -1
- package/dist/client/assets/AgentLanesEmbedScreen-C5k_dDS8.js +0 -1
- package/dist/client/assets/AgentLanesView-u5vpLwQf.js +0 -2
- package/dist/client/assets/AgentMasterScreen-C5WlWNmk.js +0 -1
- package/dist/client/assets/AgentsConsole-BuiZ_bDo.js +0 -1
- package/dist/client/assets/AgentsScreen-CRi-hG2k.js +0 -1
- package/dist/client/assets/AgentsSubnav-DUsya4WK.js +0 -1
- package/dist/client/assets/BriefingDetailScreen-C29smC5d.js +0 -1
- package/dist/client/assets/BrokerScreen-CS0s4Gm4.js +0 -5
- package/dist/client/assets/CodeScreen-CrR2JaVj.js +0 -1
- package/dist/client/assets/ConversationComposer-H8_hsYSc.js +0 -1
- package/dist/client/assets/ConversationFeedRows-hlEFlURs.js +0 -1
- package/dist/client/assets/ConversationHeader-B0ZBhE_E.js +0 -1
- package/dist/client/assets/ConversationScreen-CXAHQwQ3.js +0 -2
- package/dist/client/assets/CrewWorkspaces-Bz2Dcnt4.js +0 -1
- package/dist/client/assets/FlightObserveScreen-qyzHzxLa.js +0 -1
- package/dist/client/assets/HarnessesScreen-DbKkQM4o.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-DvbRRPQB.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-C3C8UjXv.js +0 -1
- package/dist/client/assets/MeshScreen-BJ-j9YXv.js +0 -1
- package/dist/client/assets/MessagesScreen-CyNIZ3-X.js +0 -1
- package/dist/client/assets/MissionControlView-Bj7cAbZd.js +0 -1
- package/dist/client/assets/MissionFocusOverlay-DvTw6ts5.js +0 -1
- package/dist/client/assets/MissionLeftAgentRow-B0QG7Gys.js +0 -1
- package/dist/client/assets/NewChatComposer-C_1op4dH.js +0 -19
- package/dist/client/assets/OpsAgentsView-DBYtmLnh.js +0 -1
- package/dist/client/assets/OpsScreen-CuYVgkC_.js +0 -1
- package/dist/client/assets/OpsSubnav-BEU4kKXm.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-BhXAZEkW.js +0 -1
- package/dist/client/assets/ProjectAgentProfileBar-uJw9Wdfk.js +0 -1
- package/dist/client/assets/ProjectAgentProfileHero-CIMS4Dy_.js +0 -1
- package/dist/client/assets/ProjectsInbox-JgU0lrY8.js +0 -2
- package/dist/client/assets/ProjectsRail-p99BRBOa.js +0 -1
- package/dist/client/assets/ProjectsScreen-BB45DU53.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-BHDTJWOz.js +0 -1
- package/dist/client/assets/Provider-Bu-C8Hxc.js +0 -1
- package/dist/client/assets/RawSessionsTable-BtKdQPiv.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-KPHJgO1l.js +0 -1
- package/dist/client/assets/SessionRefScreen-C8BiRVPx.js +0 -1
- package/dist/client/assets/SessionsScreen-BNvjUflN.js +0 -1
- package/dist/client/assets/SettingsScreen-3JvX1WFL.js +0 -1
- package/dist/client/assets/Terminal-BlUQY9_Z.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-DTjxktyr.js +0 -1
- package/dist/client/assets/agent-specialization-BtxLN4UR.js +0 -1
- package/dist/client/assets/agents-project-model-UYiamtrU.js +0 -1
- package/dist/client/assets/content--T3p6akp.js +0 -1
- package/dist/client/assets/content-4nFMLuzF.js +0 -1
- package/dist/client/assets/content-BJ4nHvcu.js +0 -1
- package/dist/client/assets/content-BmGp9wNl.js +0 -1
- package/dist/client/assets/content-CBWhwaRo.js +0 -1
- package/dist/client/assets/content-CQlykFbe.js +0 -1
- package/dist/client/assets/content-CevL0DgF.js +0 -1
- package/dist/client/assets/content-Ch8pf2bj.js +0 -1
- package/dist/client/assets/content-Cpvdcm_l.js +0 -1
- package/dist/client/assets/content-DfS3vgAu.js +0 -1
- package/dist/client/assets/content-DpQdNePJ.js +0 -1
- package/dist/client/assets/content-Dqpibejl.js +0 -1
- package/dist/client/assets/content-TV0nd6-r.js +0 -1
- package/dist/client/assets/content-odbb5H4U.js +0 -1
- package/dist/client/assets/content-uXHLPHe0.js +0 -1
- package/dist/client/assets/conversation-model-QsJVfSeG.js +0 -1
- package/dist/client/assets/conversation-motion-features-BFLHX2eg.js +0 -1
- package/dist/client/assets/discover-B3uQlh5L.js +0 -2
- package/dist/client/assets/embed-entry-DkRcHKTh.js +0 -2
- package/dist/client/assets/home-now-card-UspVW2-2.js +0 -1
- package/dist/client/assets/index-C-v0Z6ZS.js +0 -1
- package/dist/client/assets/index-D9DzUORB.js +0 -1
- package/dist/client/assets/index-DfsTyYDx.js +0 -1
- package/dist/client/assets/left-B4Ak-Ibt.js +0 -2
- package/dist/client/assets/left-BMb493FZ.js +0 -1
- package/dist/client/assets/left-BjFLvVOC.js +0 -1
- package/dist/client/assets/left-CsXQ8Q3G.js +0 -1
- package/dist/client/assets/left-FNH7faCI.js +0 -1
- package/dist/client/assets/left-POkqE8gI.js +0 -2
- package/dist/client/assets/left-UulOTcWh.js +0 -1
- package/dist/client/assets/left-advisor-CJkQS2d6.js +0 -1
- package/dist/client/assets/left-agents-CFMxyEjT.js +0 -1
- package/dist/client/assets/left-default-rnX5HANc.js +0 -1
- package/dist/client/assets/left-lanes-BpLXT_qH.js +0 -1
- package/dist/client/assets/left-mission-B0bhseWw.js +0 -1
- package/dist/client/assets/library-D1iXfda2.js +0 -1
- package/dist/client/assets/mesh-buckets-6y3ZIibI.js +0 -1
- package/dist/client/assets/mesh-roster-Bc7T4b7z.js +0 -1
- package/dist/client/assets/model-IGCUEsMy.js +0 -1
- package/dist/client/assets/profile-B3qDSbrH.js +0 -1
- package/dist/client/assets/projects-inbox-CLek3QaG.js +0 -1
- package/dist/client/assets/projects-inbox-DRBl2N85.css +0 -1
- package/dist/client/assets/resolve-panes-DXw-cHaj.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-CDdbRDEa.js +0 -1
- package/dist/client/assets/right-BgJ4mQLf.js +0 -1
- package/dist/client/assets/right-Bk6h7o-Z.js +0 -1
- package/dist/client/assets/right-BrICCmEt.js +0 -1
- package/dist/client/assets/right-C1QIbqFZ.js +0 -1
- package/dist/client/assets/right-CfliKiHY.js +0 -1
- package/dist/client/assets/right-CtOLXB9s.js +0 -1
- package/dist/client/assets/right-DJ34yMAi.js +0 -1
- package/dist/client/assets/right-DiFmtw6d.js +0 -1
- package/dist/client/assets/right-Lx79pxpG.js +0 -1
- package/dist/client/assets/scoutbot-BJIamJOH.js +0 -3
- package/dist/client/assets/text-Faa3ZStB.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-Bpkc8ayb.js +0 -1
- /package/dist/client/assets/{text-BYAFNLNq.css → runtime-picker-BYAFNLNq.css} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as r,r as o}from"./index-BI9AljSD.js";import{o as ht,w as aa,q as Jt,s as Fs,t as ra,u as oa,v as ia,x as Os,y as la,z as ca,A as da,B as ua}from"./NewChatComposer-C_1op4dH.js";import{a as B}from"./api-Co9aQ2Jw.js";import"./text-Faa3ZStB.js";import{u as ma,C as ha}from"./ConversationComposer-H8_hsYSc.js";import"./index-DfsTyYDx.js";import{u as pa,d as fa,a as ga}from"./Provider-Bu-C8Hxc.js";import{d as ya,b as ba,x as ne,y as Ps,z as wa,A as Ce,B as Sa,D as Ta,E as xa,F as va,c as qs,S as Ds,G as Ca,H as Ma,I as Na,J as ka,K as Aa,L as Ia,M as ja,e as Bs,N as Ra,O as Ea,n as La,p as $a,r as Gt,P as Fa,Q as Oa,R as Pa,T as qa,g as Da,U as Ba,V as Ua,W as Us,X as Ha,Y as Wa,Z as Qe,u as _a,_ as Ka,$ as Qa,a0 as Hs,a1 as za,a2 as Va,a3 as Ja,a4 as Ga,a5 as Ws,a6 as Ya,a7 as _s,a8 as Xa,a9 as Za,aa as er}from"./conversation-model-QsJVfSeG.js";import{u as tr}from"./sse-DDHEHUgz.js";import{n as Yt,t as pt,f as Ks}from"./time-Dhsh_2EG.js";import{M as sr}from"./message-markup-Cc_O-WdA.js";import{c as Qs,i as Xt,b as nr}from"./message-visibility-CGOmSSKs.js";import{d as ar}from"./operator-attention-RqieiSY8.js";import{b as rr}from"./router-DTtux5sP.js";import{f as Zt,a as or}from"./scoutbot-BJIamJOH.js";import{s as ir}from"./sessionRead-CvFz2RHv.js";import{o as ft}from"./openContent-C6XO6kr5.js";import{c as ze}from"./clipboard-e3fSpeo7.js";import{A as es}from"./AgentAvatar-B7c0egdP.js";import{d as lr}from"./types-B0PlfpKc.js";/* empty css */import{ConversationHeader as cr,ConversationIdentityRow as dr,AddParticipantForm as ur}from"./ConversationHeader-B0ZBhE_E.js";import{FanOutRow as mr,ThreadDayDivider as hr}from"./ConversationFeedRows-hlEFlURs.js";import{T as pr,t as zs,m as Vs,a as fr,b as gr,o as yr,d as br,s as wr,l as Sr,c as Tr,e as xr,W as vr,f as Cr,g as Mr}from"./ConversationPanels-fMo6Uy1v.js";import{u as Nr}from"./tail-events-BdUrO0kb.js";import{PinnedAskCard as kr,ConversationStatusStrip as Ar}from"./ConversationStatus-DI5GCiyW.js";import"./HarnessMark-DAaWPiT_.js";import"./colors-BtO5_zlx.js";import"./NewChatOrigin-D7hwp6dm.js";import"./keyboard-nav-e6yGeorb.js";import"./x-DfRJbqrh.js";import"./createLucideIcon-DthwWQIg.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./loader-circle-B2W9DPG5.js";import"./file-text--hfhwZH1.js";import"./perf-PX8Rx0EP.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./zap-CIo8msJB.js";import"./surface-activity-B1rgWB1i.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./index-BWHgHrtv.js";import"./mentions-DuLQnEcn.js";import"./AgentDetailCard-B_KLcgsP.js";import"./AgentLiveActions-CsQA3pu_.js";import"./terminal-takeover-B6H4llRR.js";import"./eye-FnaaPfja.js";import"./terminal-C3YRPfyz.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./SpriteAvatar-56DTXxSV.js";import"./CrewAvatar-CXJHLNVM.js";import"./BackToPicker-Cto0Ioz9.js";import"./AstronautSuit-Cjjcv6yQ.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-8WuxLa5l.js";import"./proxy-1BABCaDb.js";import"./activity-CqZafWfx.js";import"./message-circle-B2DoYKDO.js";import"./check-DbIkldnK.js";import"./sparkles-Cf8gin88.js";const Zs="scout:conversations:failure-dismissals:v1",Ir=64;let ns={};function en(){try{if(typeof localStorage<"u"){const n=JSON.parse(localStorage.getItem(Zs)??"null");Er(n)&&(ns=as(n))}}catch{}return as(ns)}function jr(n){ns=as(n);try{typeof localStorage<"u"&&localStorage.setItem(Zs,JSON.stringify(n))}catch{}}function Js(n){return new Set(en()[n]??[])}function Rr(n,c){const d=en(),f=(d[n]??[]).filter(k=>k!==c);f.push(c),d[n]=f.slice(-100);const y=Object.keys(d);for(const k of y.slice(0,Math.max(0,y.length-Ir)))delete d[k];return jr(d),new Set(d[n])}function as(n){return Object.fromEntries(Object.entries(n).map(([c,d])=>[c,[...d]]))}function Er(n){return!n||typeof n!="object"||Array.isArray(n)?!1:Object.values(n).every(c=>Array.isArray(c)&&c.every(d=>typeof d=="string"&&d.length>0))}const Lr=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)(?:$|[?#])/iu,$r=/\bhttps?:\/\/[^\s<>"')\]]+/giu;function Ve(n){if(typeof n!="string")return null;try{const c=new URL(n.trim());return c.protocol==="http:"||c.protocol==="https:"?c.toString():null}catch{return null}}function z(n,c){const d=n?.[c];return typeof d=="string"&&d.trim()?d.trim():null}function Fr(n){return n.mediaType.toLowerCase().startsWith("image/")}function Or(n){return Lr.test(n)}function Pr(n){try{const c=new URL(n),d=[c.pathname==="/"?"":c.pathname,c.search].join("").trim();return{host:c.hostname.replace(/^www\./iu,""),detail:d||c.hostname}}catch{return{host:n,detail:n}}}function qr(n){const c=new Set,d=[];for(const f of n.matchAll($r)){const y=f[0]?.replace(/[.,;:!?]+$/u,""),k=Ve(y);!k||c.has(k)||(c.add(k),d.push(k))}return d}const Dr=/^\/api\/blobs\/[^/]+$/u;function ts(n){try{const c=new URL(n);return Dr.test(c.pathname)?`${c.pathname}${c.search}`:n}catch{return n}}function gt(n){return Ve(n.url)??Ve(z(n.metadata,"url"))??Ve(z(n.metadata,"href"))}function Br(n){const c=n.metadata??null,d=z(c,"kind")??z(c,"type"),f=gt(n);if(!f||d!=="link_preview"&&d!=="link-preview"&&n.mediaType!=="text/x-uri")return null;const y=Pr(f);return{id:n.id,url:f,title:z(c,"title")??y.host,description:z(c,"description"),imageUrl:Ve(z(c,"imageUrl")??z(c,"image")),siteName:z(c,"siteName")??y.host}}function Ur({src:n,alt:c}){const[d,f]=o.useState(!1);return d?r.jsxs("a",{className:"s-message-embed s-message-embed--file",href:n,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:n,target:"_blank",rel:"noreferrer",children:r.jsx("img",{src:n,alt:c,loading:"lazy",decoding:"async",onError:()=>f(!0)})})}function Hr({preview:n}){return r.jsxs("a",{className:"s-message-embed s-message-embed--link",href:n.url,target:"_blank",rel:"noreferrer",children:[n.imageUrl&&r.jsx("span",{className:"s-message-embed-thumb",children:r.jsx("img",{src:n.imageUrl,alt:"",loading:"lazy",decoding:"async"})}),r.jsxs("span",{className:"s-message-embed-copy",children:[n.siteName&&r.jsx("span",{className:"s-message-embed-site",children:n.siteName}),r.jsx("span",{className:"s-message-embed-title",children:n.title}),n.description&&r.jsx("span",{className:"s-message-embed-description",children:n.description})]})]})}function Wr({message:n}){const c=n.attachments??[],d=new Set,f=[],y=[];for(const h of c){const $=gt(h);if($&&Fr(h)){d.add(h.id),f.push({id:h.id,src:ts($),alt:h.fileName??"Image attachment"});continue}const b=Br(h);b&&(d.add(h.id),y.push(b))}const k=new Set(y.map(h=>h.url)),G=new Set(c.map(gt).filter(h=>!!h));for(const h of qr(n.body))G.has(h)||k.has(h)||Or(h)&&f.push({id:h,src:ts(h),alt:"Embedded image"});const N=c.filter(h=>!d.has(h.id));return f.length===0&&y.length===0&&N.length===0?null:r.jsxs("div",{className:"s-message-embeds",children:[f.map(h=>r.jsx(Ur,{src:h.src,alt:h.alt},h.id)),y.slice(0,1).map(h=>r.jsx(Hr,{preview:h},h.id)),N.map(h=>{const $=gt(h),b=$?ts($):null,u=h.fileName??z(h.metadata,"title")??h.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:u}),r.jsx("span",{className:"s-message-embed-description",children:h.mediaType})]},h.id):r.jsxs("div",{className:"s-message-embed s-message-embed--file",children:[r.jsx("span",{className:"s-message-embed-title",children:u}),r.jsx("span",{className:"s-message-embed-description",children:h.mediaType})]},h.id)})]})}function _r(n){const{sessionIds:c,active:d}=n,f=c.join("|"),y=d&&c.length>0,[k,G]=o.useState([]);return o.useEffect(()=>{G([])},[f]),o.useEffect(()=>{if(!y)return;let N=!1;const h=new URLSearchParams({limit:String(pr*3),transcripts:"true"});return B(`/api/tail/recent?${h.toString()}`).then($=>{if(N)return;const b=($.events??[]).filter(u=>zs(u,c));b.length!==0&&G(u=>Vs(u,b))}).catch(()=>{}),()=>{N=!0}},[y,f]),Nr(N=>{y&&zs(N,c)&&G(h=>Vs(h,[N]))},y),o.useMemo(()=>y?fr(k):[],[y,k])}const Kr=3500;function Gs(n){const c=n?.trim().replace(/^#/,"");if(!c?.startsWith("msg-"))return null;const d=c.slice(4).trim();if(!d)return null;try{return decodeURIComponent(d)}catch{return d}}const Qr=64;function zr(n){const c=n?.clientMessageId;return typeof c=="string"&&c.trim()?c.trim():null}function Ys(n){const c=n.body.replace(/\s+/gu," ").trim();if(c)return c.length>180?`${c.slice(0,179).trimEnd()}…`:c;const d=n.attachments?.length??0;return d===1?"Attachment":d>1?`${d} attachments`:"Message"}function Xs(n,c){const d=n.toLocaleLowerCase().indexOf(c.toLocaleLowerCase());if(d<0)return n;const f=n.slice(0,d),y=n.slice(d+c.length);return!f&&y.startsWith(" ")?y.slice(1):f.endsWith(" ")&&y.startsWith(" ")?`${f}${y.slice(1)}`:`${f}${y}`}function Vr(n){return n instanceof TypeError||typeof DOMException<"u"&&n instanceof DOMException&&n.name==="AbortError"}function mi({conversationId:n,initialDraft:c,navigate:d,embedded:f,showBackNav:y=!0,treatment:k="standard"}){const{agents:G,route:N,openContextCapture:h}=pa(),$=rr(N),b=o.useMemo(()=>fa(G,$),[G,$]),[u,yt]=o.useState(null),rs=o.useRef(null);rs.current=u;const Je=o.useMemo(()=>ht(n),[n]),[tn,sn]=o.useState(()=>Je?{[n]:Je}:{}),T=tn[n]??Je??[],[nn,os]=o.useState(()=>Je!==null),Me=o.useRef(null),is=o.useMemo(()=>{const t=Me.current;return t===null?null:new Set(T.filter(e=>!t.has(e.id)).map(e=>e.id))},[T]),Ge=Me.current===null&&T.length>0;o.useEffect(()=>{if(T.length===0)return;const t=Me.current??new Set;for(const e of T)t.add(e.id);Me.current=t},[T]),o.useEffect(()=>{Me.current=null,os(ht(n)!==null)},[n]);const ls=!nn&&T.length===0,V=o.useCallback(t=>{sn(e=>{const s=e[n]??ht(n)??[],a=typeof t=="function"?t(s):t,i=aa(n,a);return{...e,[n]:i}})},[n]),an=Jt(n),[g,ge]=o.useState(an),[Ne,ke]=o.useState([]),[Ye,bt]=o.useState(null),[Xe,Ae]=o.useState(null),[Ze,rn]=o.useState(()=>typeof window>"u"?null:Gs(window.location.hash)),[cs,ae]=o.useState(null),[wt,ds]=o.useState(()=>Js(n)),[ye,St]=o.useState(!1),[on,Ie]=o.useState(!1),[Tt,et]=o.useState(0),je=o.useRef(null),Re=o.useRef(null),ln=o.useRef(null),Ee=o.useRef(!0),tt=o.useRef(!1),be=o.useRef(null),A=o.useRef(null),Le=o.useRef(new Set),$e=o.useRef(null),us=o.useRef(0),ms=o.useRef(null),Fe=o.useRef(null),Oe=o.useRef(new Set),Y=o.useRef(n);Y.current=n;const re=o.useRef(new Map),cn=Fs(n),st=o.useRef(!1);o.useLayoutEffect(()=>{const t=Re.current,e=je.current;!t||!e||(e.scrollTop=t.scrollTop+(e.scrollHeight-t.scrollHeight),Re.current=null,st.current=!0)}),o.useEffect(()=>{St(!1),Re.current=null,st.current=!1,Ee.current=!0,tt.current=!1,Ie(!1),et(0),Ut(new Set),re.current.clear(),ge(Jt(n)),ds(Js(n))},[n]);const nt=o.useCallback(async t=>{let s=typeof t.metadata?.flightId=="string"?t.metadata.flightId.trim():"";if(!s&&t.replyToMessageId)try{s=(await B(`/api/flights?conversationId=${encodeURIComponent(n)}&active=false`)).find(i=>i.messageId===t.replyToMessageId)?.id??""}catch{}await ar({...s?{flightId:s}:{},conversationId:n,messageId:t.replyToMessageId??t.id,itemUpdatedAt:Yt(t.createdAt)??Date.now()})},[n]),hs=o.useCallback(t=>{const e=t.replyToMessageId??t.id;ds(Rr(n,t.id)),Zt({type:"dismiss-conversation-failure",conversationId:n,messageId:e,reason:"The operator cleared this delivery issue"});const s=`${n}:${t.id}`;Oe.current.add(s),nt(t).catch(()=>{Oe.current.delete(s)})},[n,nt]);o.useEffect(()=>{for(const t of T){if(!wt.has(t.id)||!Qs(t))continue;const e=`${n}:${t.id}`;Oe.current.has(e)||(Oe.current.add(e),nt(t).catch(()=>{Oe.current.delete(e)}))}},[n,wt,T,nt]);const v=u?.agentId??null,M=u?.kind==="direct",xt=o.useMemo(()=>new Set([n,...u?.equivalentConversationIds??[]]),[n,u?.equivalentConversationIds]),K=o.useMemo(()=>v?b.find(t=>t.id===v)??null:null,[b,v]),ps=ya(u),dn=ba({resolvedAgentId:K?.id,sessionId:ps,machineId:$}),[vt,fs]=o.useState(null);o.useEffect(()=>{B("/api/fleet").then(t=>{fs(e=>ne(e,Ps(t.activeAsks,n,v)))}).catch(()=>{})},[n,v]);const U=o.useCallback(async(t={})=>{const e=t.messageMode??"none",s=t.includeMetadata??!0;ae(null);try{const a=s?await B(`/api/session/${encodeURIComponent(n)}`).catch(()=>null):rs.current;if(Y.current!==n)return;yt(x=>ne(x,a));const i=a?.agentId??null,l=a?.id&&a.id!==n?a.id:n;if(l!==n){d({view:"conversation",conversationId:l});return}const m=ht(l),R=ra(l),w=e==="initial"&&!R,p=e==="refresh"||e==="initial",S=Promise.all([B(`/api/flights?conversationId=${encodeURIComponent(l)}`).catch(()=>[]),B("/api/fleet?limit=24&activityLimit=160").catch(()=>wa())]),W=await(w?oa(l):p?ia(l,{refresh:!0}):Promise.resolve(m));if(Y.current!==n)return;const L=Ce(W??[]),fe=L.filter(x=>!Xt(x));W&&V(x=>ne(x,Sa(x,fe))),os(!0),ir(l);const E=L.at(-1);E&&Fe.current!==E.id&&(Fe.current=E.id,B(`/api/conversations/${encodeURIComponent(l)}/read-cursor`,{method:"POST",body:JSON.stringify({lastReadMessageId:E.id})}).catch(()=>{Fe.current===E.id&&(Fe.current=null)}));const[se,Q]=await S;if(Y.current!==n)return;const _=Ta(se),J=Jt(l),ve=_??J;Le.current=new Set([...se.map(x=>x.invocationId),...J?.invocationId?.startsWith("pending:")?[]:J?.invocationId?[J.invocationId]:[]]),_&&J?.id===_.id&&Os(l,_.id);const P=ve?.agentId??i??null,Vt=xa(Q.activity,ve,l,P),mt=va(Q.activeAsks,ve,l,P);ge(x=>ne(x,ve)),ke(x=>ne(x,Vt)),Ae(x=>ne(x,mt)),fs(x=>ne(x,Ps(Q.activeAsks,l,i)))}catch(a){if(Y.current!==n)return;ae(a instanceof Error?a.message:String(a))}},[n,d,V]);o.useEffect(()=>{U({messageMode:"initial"})},[U]),o.useEffect(()=>{Fe.current=null},[n]),o.useEffect(()=>{$e.current=g},[g]);const un=o.useCallback(async()=>{if(ye||!Fs(n))return;const t=je.current,e=t?{scrollHeight:t.scrollHeight,scrollTop:t.scrollTop}:null;St(!0),ae(null);try{const s=await la(n);if(Y.current!==n)return;e&&(Re.current=e),V(Ce(s).filter(a=>!Xt(a)))}catch(s){Y.current===n&&ae(s instanceof Error?s.message:String(s))}finally{Y.current===n&&St(!1)}},[n,ye,V]),[I,D]=o.useState(()=>c??""),[oe,ie]=o.useState(null),[H,at]=o.useState(!1),[C,mn]=o.useState("operator"),[le,Pe]=o.useState({open:!1,query:"",triggerStart:-1,index:0}),[ce,qe]=o.useState({open:!1,query:"",triggerStart:-1,index:0}),[F,X]=o.useState(null),[Ct,rt]=o.useState(!1),[Mt,ot]=o.useState(""),[hn,De]=o.useState(null),[pn,Nt]=o.useState(!1);o.useEffect(()=>{rt(!1),ot(""),De(null),Nt(!1)},[n]),o.useEffect(()=>{if(!c)return;const t=`${n}:${c}`;ms.current!==t&&(ms.current=t,D(c),requestAnimationFrame(()=>A.current?.focus()))},[n,c]);const Z=o.useMemo(()=>{const t=new Map;for(const e of u?.participants??[])t.set(e.actorId,e),e.agentId&&t.set(e.agentId,e);return t},[u]),kt=o.useMemo(()=>{const t=new Set,e=[];for(const s of u?.participantIds??[]){if(s==="operator")continue;const a=Z.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(/^@+/,"")??qs(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))},[Z,b,u]),fn=o.useMemo(()=>{if(!le.open)return[];const t=le.query.toLowerCase();return t?Ds.filter(e=>e.command.toLowerCase().startsWith("/"+t)||e.command.toLowerCase().includes(t)):Ds},[le.open,le.query]),gn=o.useMemo(()=>{if(!ce.open)return[];const t=ce.query.toLowerCase();return t?kt.filter(e=>e.handle.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)).slice(0,8):kt.slice(0,8)},[ce.open,ce.query,kt]),yn=o.useCallback(()=>{Pe(t=>t.open?{...t,open:!1}:t),qe(t=>t.open?{...t,open:!1}:t)},[]),bn=o.useCallback((t,e)=>{const s=Ca(t,e);Pe(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=Ma(t,e);qe(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)},[]),wn=o.useCallback(t=>{const e=A.current,s=le.triggerStart;if(s<0)return;const a=e?.selectionStart??I.length,i=I.slice(0,s),l=I.slice(a),m=t.insert,R=`${i}${m}${l}`;D(R),Pe(w=>({...w,open:!1})),requestAnimationFrame(()=>{const w=A.current;if(!w)return;const p=i.length+m.length;w.focus(),w.setSelectionRange(p,p)})},[I,le.triggerStart]),Sn=o.useCallback(t=>{const e=A.current,s=ce.triggerStart;if(s<0)return;const a=e?.selectionStart??I.length,i=I.slice(0,s),l=I.slice(a),m=l.length===0||!l.startsWith(" "),R=`@${t.handle}${m?" ":""}`,w=`${i}${R}${l}`;D(w),qe(p=>({...p,open:!1})),requestAnimationFrame(()=>{const p=A.current;if(!p)return;const S=i.length+R.length;p.focus(),p.setSelectionRange(S,S)})},[I,ce.triggerStart]);o.useEffect(()=>{const t=A.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"},[I]),o.useEffect(()=>{B("/api/user").then(t=>mn(t.name)).catch(()=>{})},[]);const it=o.useMemo(()=>Na(T,C),[T,C]);o.useEffect(()=>{F===null||it===null||it>=F&&X(null)},[F,it]);const Tn=o.useMemo(()=>ka(g),[g]),we=Date.now(),xn=Aa(g,it,we),At=Tn&&!Ia(g)&&!xn,gs=M&&(H||F!==null||At),ys=M&&ja({sending:H,awaitingResponse:F!==null,currentFlight:g}),O=Bs({name:K?.name,agentName:u?.agentName,id:v,title:u?.title}),j=o.useMemo(()=>M?Ra({agentName:O,agentState:K?.state??null,sending:H,currentFlight:g,showWorkingTurn:At,awaitingResponse:F!==null}):{label:"Open",detail:"",tone:"idle",showStrip:!1,showTyping:!1},[K?.state,O,F,g,we,M,H,At]),It=g?.startedAt??Xe?.startedAt??F,jt=Yt(It),bs=Ya(It,we),[,vn]=o.useState(0);o.useEffect(()=>{if(!j.showTyping||jt===null)return;const t=Math.max(0,Date.now()-jt),e=[Ws.sustained,Ws.long].find(a=>a>t);if(e===void 0)return;const s=window.setTimeout(()=>vn(a=>a+1),e-t+50);return()=>window.clearTimeout(s)},[jt,j.showTyping,bs]);const Cn="Live",Rt=o.useMemo(()=>Ea({currentFlight:g,presence:j,turnActivity:Ne,turnAsk:Xe,awaitingResponseSince:F,nowMs:we}),[F,g,we,j,Ne,Xe]),Mn="s-thread-msg-card s-thread-msg-working-card s-thread-msg-card--avatar-row",Nn="s-thread-msg-kind",kn="s-thread-turn-snapshot",An="s-thread-turn-snapshot-pulse",In="s-thread-presence-line",jn=["s-thread-presence-strip",`s-thread-presence-strip--${bs}`].filter(Boolean).join(" "),Et=u?La(u):O,ws=u?.id??n,Rn=u?.alias?.trim()||null,lt=$a(u?.workspaceRoot),En=j.tone,Lt=T.length===0&&M&&(j.showTyping||g!==null||Ne.length>0||Xe!==null||F!==null),Ss=o.useMemo(()=>u?u.participantIds.includes("operator"):M,[M,u]),Be=g?.agentId??v,Ue=Be?Gt(b,[Be]):null,He=Ue?.id??Be,We=g?.sessions.at(-1)?.sessionId??Ue?.harnessSessionId??void 0,Ts=g?.id?()=>{ft(d,{view:"sessions",flightId:g.id,...He?{agentId:He}:{},...We?{sessionId:We}:{},...$?{machineId:$}:{}},{returnTo:N})}:void 0,xs=g?.id??null;o.useEffect(()=>{if(!xs||!He){bt(null);return}let t=!1;const e=We?`?sessionId=${encodeURIComponent(We)}`:"",s=async()=>{try{const i=await B(`/api/agents/${encodeURIComponent(He)}/observe${e}`);if(t)return;bt(l=>ne(l,i))}catch{}};s();const a=window.setInterval(()=>{s()},Kr);return()=>{t=!0,window.clearInterval(a),bt(null)}},[xs,He,We]);const $t=o.useMemo(()=>gr({flight:g,agent:Ue??K,sessionMeta:u,observeSessionId:Ye?.sessionId}),[K,g,u,Ye?.sessionId,Ue]),vs=_r({sessionIds:$t,active:j.showTyping||Lt}),Ln=o.useMemo(()=>yr({observe:Ye,flight:g}),[g,Ye]),ee=vs.length>0?vs:Ln,Ft=o.useMemo(()=>ee.length>0?null:br({flight:g,hasSessionScope:$t.length>0,awaitingResponse:F!==null}),[F,g,$t.length,ee.length]),Ot=wr(ee),Pt=Sr(ee),Cs=ee.at(-1)??null,qt=Cs?pt(Cs.ts,we):null,de=o.useMemo(()=>Pt?{...Rt,latest:Pt,...Ot?{activityLabel:Ot}:{},...qt?{lastActivityLabel:qt}:{}}:Rt,[qt,Pt,Rt,Ot]),$n=`${O}: ${de.latest}`,Ms=Be&&Fa(Ue)?()=>{ft(d,{view:"terminal",agentId:Be,mode:"takeover"},{returnTo:N})}:void 0,Dt=M?()=>{f&&Zt({type:"focus-composer",reason:"Steer the active conversation"})||requestAnimationFrame(()=>{A.current?.focus({preventScroll:!0}),A.current?.scrollIntoView({block:"nearest"})})}:void 0,Fn=o.useMemo(()=>(u?u.participantIds.filter(e=>e!=="operator"):v?[v]:[]).map(e=>{const s=Gt(b,[e]),a=Z.get(e);return{id:e,name:a?.scopedAlias??s?.name??a?.displayName??qs(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}}),[v,Z,b,u]),On=o.useMemo(()=>({name:C,active:Ss}),[Ss,C]),ue=o.useMemo(()=>new Map(T.map(t=>[t.id,t])),[T]),Bt=o.useMemo(()=>b.find(t=>or(t)&&!!t.conversationId?.trim())?.conversationId?.trim()??null,[b]),_e=o.useMemo(()=>Oa(T),[T]),[Pn,Ut]=o.useState(()=>new Set),qn=o.useCallback(t=>{Ut(e=>{const s=new Set(e);return s.delete(t)||s.add(t),s})},[]),Ns=o.useMemo(()=>{const t=new Map;for(const e of _e)if(e.kind==="fanout")for(const s of e.messages)t.set(s.id,e.key);return t},[_e]),ct=o.useCallback(t=>{const e=Ns.get(t);e&&Ut(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)},[Ns]);o.useEffect(()=>{const t=()=>rn(Gs(window.location.hash));return window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t)},[]),o.useEffect(()=>{if(!Ze||!ue.has(Ze))return;const t=window.setTimeout(()=>ct(Ze),50);return()=>window.clearTimeout(t)},[Ze,ue,ct]),tr(o.useCallback(t=>{if(t.kind==="message.posted"){const e=t.payload?.message;if(!e||!xt.has(e.conversationId))return;const s=e.actorId==="operator",a=M&&!s&&e.class==="agent",i={id:e.id,conversationId:e.conversationId,actorId:e.actorId,actorName:a?O:Pa(e.actorId,b,C),body:e.body,createdAt:e.createdAt,class:s?"operator":e.class,attachments:e.attachments,metadata:e.metadata,replyToMessageId:e.replyToMessageId??e.n??null};if(Xt(i))return;if(V(l=>{const m=zr(e.metadata),R=m?re.current.get(m):void 0;if(l.some(w=>w.id===e.id))return m&&re.current.delete(m),l;if(s&&m){const w=qa(l,m,R);if(w!==-1){const p=[...l];return p[w]=i,re.current.delete(m),Ce(p)}}return Ce([...l,i])}),a){const l=Yt(e.createdAt)??Date.now();X(m=>m===null||l<m||Da($e.current)?m:null),ge(m=>Ba(m)?null:m)}return}if(t.kind==="invocation.requested"){const e=t.payload?.invocation;if(!e||e.targetAgentId!==v||!e.conversationId||!xt.has(e.conversationId))return;Le.current.add(e.id),ke([]),Ae(null),X(s=>s??Date.now());return}if(t.kind==="flight.updated"){const e=t.payload?.flight;if(!e||e.targetAgentId!==v||!(Le.current.has(e.invocationId)||$e.current?.id===e.id))return;if(Ua.has(e.state)){Os(n,e.id),ge(l=>l?.id===e.id?null:l),ke([]),Ae(null),X(null),U({messageMode:"refresh",includeMetadata:!1});return}Le.current.add(e.invocationId);const a=$e.current?.id===e.id,i=Us(e,n,v??"",$e.current);Ha(i)&&X(null),ge(i),a||(ke([]),Ae(null));return}t.kind!=="agent.endpoint.upserted"&&t.kind==="unknown"&&U({messageMode:"refresh"})},[v,O,n,xt,M,U,C,b])),o.useEffect(()=>{if(!gs)return;const t=setInterval(()=>{U({messageMode:"refresh",includeMetadata:!1})},5e3);return()=>clearInterval(t)},[gs,U]),o.useEffect(()=>{const t=()=>{if(document.visibilityState!=="visible")return;const e=Date.now();e-us.current<1e3||(us.current=e,U({messageMode:"refresh"}))};return window.addEventListener("focus",t),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",t)}},[U]);const Ht=o.useRef(null),ks=o.useRef(!1),Wt=o.useRef(!1),_t=o.useCallback(t=>{const e=je.current;e&&(tt.current=!0,be.current!==null&&clearTimeout(be.current),t==="instant"?e.scrollTop=e.scrollHeight:e.scrollTo({top:e.scrollHeight,behavior:"smooth"}),be.current=setTimeout(()=>{tt.current=!1,be.current=null},t==="smooth"?700:0))},[]);o.useEffect(()=>()=>{be.current!==null&&clearTimeout(be.current)},[]);const Dn=o.useCallback(()=>{const t=je.current;if(!t||tt.current)return;const s=t.scrollHeight-t.clientHeight-t.scrollTop<=Qr;Ee.current=s,s?(Ie(!1),et(0)):Ie(!0)},[]),Bn=o.useCallback(()=>{Ee.current=!0,Ie(!1),et(0),_t("smooth")},[_t]);o.useEffect(()=>{const t=T.at(-1)?.id??null,e=!!(t&&t!==Ht.current),s=Wa({newestMessageId:t,previousNewestMessageId:Ht.current,showTyping:j.showTyping,previousShowTyping:ks.current,historyRestorePending:st.current||Re.current!==null,initialScrollDone:Wt.current,nearBottom:Ee.current});s!=="none"?(_t(s),Wt.current=!0):e&&Wt.current&&!Ee.current&&(Ie(!0),et(a=>a+1)),st.current=!1,Ht.current=t,ks.current=j.showTyping});const[,Un]=o.useState(0);o.useEffect(()=>{const t=setInterval(()=>Un(e=>e+1),15e3);return()=>clearInterval(t)},[]);const me=ma(),[he,te]=o.useState([]),[As,dt]=o.useState("queue"),[Se,Te]=o.useState(null),xe=async(t,e)=>{const s=t.trim(),a=e?.attachments??[],i=e?.replyTarget??null;if(!s&&a.length===0||H)return"failed";const m=e?.forceAction??_s({isDm:M,hasOutstandingReply:ys}),R=Date.now(),w=da(),p={id:`optimistic-${w}`,conversationId:n,actorId:"operator",actorName:C,body:s,createdAt:R,class:"operator",...i?{replyToMessageId:i.messageId}:{},metadata:{clientMessageId:w,deliveryState:"sending"},...a.length>0?{attachments:a}:{}};at(!0),m!=="message"&&X(R),ae(null),re.current.set(w,p.id),V(S=>Ce([...S,p]));try{const S=await B(`/api/chats/${encodeURIComponent(n)}/messages`,{method:"POST",body:JSON.stringify({body:s,clientMessageId:w,...i?{replyToMessageId:i.messageId}:{},...a.length>0?{attachments:a}:{}})}),W=S.chatId?.trim()??S.conversationId?.trim();if(W&&W!==n)throw new Error(`Send returned a different Chat (${W}) instead of appending to ${n}.`);if(S.messageId?.trim()){const L=S.messageId.trim();V(fe=>Ce(fe.map(E=>E.id===p.id?{...E,id:L,metadata:{clientMessageId:w}}:E))),re.current.delete(w)}return S.flight?(Le.current.add(S.flight.invocationId),ge(Us(S.flight,n,v??"")),ke([]),Ae(null)):m!=="message"&&X(null),"sent"}catch(S){return Vr(S)?(V(W=>W.map(L=>L.id===p.id?{...L,metadata:{...L.metadata??{},deliveryState:"unknown"}}:L)),"unknown"):(V(W=>W.filter(L=>L.id!==p.id)),re.current.delete(w),X(null),ae(S instanceof Error?S.message:String(S)),"failed")}finally{at(!1)}},Hn=async t=>{const e=t.replyToMessageId?ue.get(t.replyToMessageId):null;if(!e||H)return;const s=[];for(const i of e.attachments??[]){if(!i.url){ae("This request includes an attachment that can’t be reused. Add it again, then retry."),requestAnimationFrame(()=>A.current?.focus());return}s.push({id:i.id,mediaType:i.mediaType,...i.fileName?{fileName:i.fileName}:{},url:i.url})}await xe(e.body,{forceAction:"invoke",attachments:s})!=="failed"&&hs(t)},Wn=(t,e,s)=>{if(!Bt)return;const a=t.replyToMessageId?ue.get(t.replyToMessageId)?.body.trim():"",i=a?`${a.slice(0,1200)}${a.length>1200?"…":""}`:"(The original request is no longer available in this transcript.)",l=[`Help me recover a failed request to ${e}.`,s,"","Original request:",i].join(`
|
|
2
|
-
`),m={view:"conversation",conversationId:Bt,composeDraft:l};f&&Zt({type:"navigate",route:m,reason:"Ask @scoutbot to help recover a failed conversation request"})||d(m)},_n=async()=>{const t=I.trim(),e=oe,s=me.files,a=Se?.attachments??[];if(!t&&s.length===0&&a.length===0)return null;let i=[];if(s.length>0){at(!0);try{i=await ua(s)}catch(l){return me.setError(l instanceof Error?l.message:String(l)),null}finally{at(!1)}}return D(""),ie(null),me.clear(),Te(null),{body:t,attachments:[...a,...i],replyTarget:e}},Kn=async()=>{const t=Za({isAgentBusy:pe,intent:As}),e=Se?.id??null,s=await _n();if(!s)return;if(t==="queue"){te(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&&te(l=>l.filter(m=>m.id!==e));const a=()=>{D(s.body),Te(s.attachments.length>0?{id:null,attachments:s.attachments}:null),ie(s.replyTarget),requestAnimationFrame(()=>A.current?.focus())};if(t==="steer"){dt("queue"),await Qt(),await xe(s.body,{forceAction:"steer",attachments:s.attachments,replyTarget:s.replyTarget})==="failed"&&a();return}await xe(s.body,{attachments:s.attachments,replyTarget:s.replyTarget})==="failed"&&a()},Qn=t=>{te(e=>e.filter(s=>s.id!==t)),Te(e=>e?.id===t?null:e)},zn=t=>{const e=he.find(s=>s.id===t);e&&(D(e.body),ie(e.replyTarget??null),Te({id:t,attachments:e.attachments}),requestAnimationFrame(()=>{const s=A.current;s&&(s.focus(),s.setSelectionRange(s.value.length,s.value.length))}))},Vn=()=>{Te(null),D(""),ie(null),me.clear()},Jn=async t=>{const e=he.find(a=>a.id===t);if(!e)return;te(a=>a.filter(i=>i.id!==t)),await Qt(),await xe(e.body,{forceAction:"steer",attachments:e.attachments,replyTarget:e.replyTarget??null})==="failed"&&te(a=>[e,...a])},ut=o.useCallback((t,e)=>{const s=e?.trim().replace(/^@+/,"")||null,a=s?`@${s}`:null,i=oe?.insertedMention?Xs(I,oe.insertedMention):I,l=!!(!M&&a&&!i.toLocaleLowerCase().includes(a.toLocaleLowerCase())),m=l&&a?i.trim()?`${i.trimEnd()} ${a} `:`${a} `:i;D(m),ie({messageId:t.id,actorLabel:s?`@${s}`:t.actorName,preview:Ys(t),insertedMention:l?a:null}),requestAnimationFrame(()=>A.current?.focus())},[I,M,oe?.insertedMention]),Gn=o.useCallback(()=>{const t=oe?.insertedMention;ie(null),t&&D(e=>Xs(e,t)),requestAnimationFrame(()=>A.current?.focus())},[oe]),Kt=o.useCallback(t=>{const e=new URL(window.location.href);N.view==="agents-v2"&&e.searchParams.set("tab","message"),e.hash=`msg-${t}`,ze(e.toString())},[N.view]),Is=o.useCallback((t,e,s)=>{const a=ca({conversationId:n,selectedMessageId:t.id,messages:T.map(i=>({id:i.id,actorLabel:i.id===t.id?e:Qe(i,C)?C:i.actorName,body:i.body,attachmentCount:i.attachments?.length??0}))});h({intent:"forward-message",forwardContext:a,forwardContextMode:"selected-message",...s?{projectPath:s}:{}})},[n,T,h,C]),Qt=async()=>{if(v)try{await B("/api/agents/"+encodeURIComponent(v)+"/interrupt",{method:"POST",body:JSON.stringify({})})}catch{}},pe=j.tone==="working"||j.tone==="pending",Yn=_s({isDm:M,hasOutstandingReply:ys}),Xn=M?`Message ${O} — type / to route or @ to mention an agent`:u?.kind==="channel"?`Comment in #${_a(u)} — mention @agent to request a reply`:`Comment in ${Et} — mention @agent to request a reply`,js=Se?.attachments??[],Zn=!I.trim()&&!me.hasFiles&&js.length===0&&pe,zt=o.useRef(!1);o.useEffect(()=>{const t=Se?.id??null,e=t?he.filter(a=>a.id!==t):he;if(!Ka({isAgentBusy:pe,sending:H,queued:e})||zt.current)return;const s=e[0];s&&(zt.current=!0,te(a=>a.filter(i=>i.id!==s.id)),xe(s.body,{attachments:s.attachments,replyTarget:s.replyTarget??null}).then(a=>{a==="failed"&&te(i=>[s,...i])}).finally(()=>{zt.current=!1}))},[pe,H,he,Se]),o.useEffect(()=>{pe||dt("queue")},[pe]),o.useEffect(()=>{te([]),Te(null),ie(null),dt("queue"),me.clear()},[n]);const ea=Qa(he),Rs=ga(),ta=o.useCallback((t,e)=>{const s=window.getSelection()?.toString().trim(),a=Qe(e,C),i=e.actorId?Z.get(e.actorId):null,l=a?null:Hs(e,b,v),m=(i?.scopedAlias?.trim()||l?.handle?.trim()||null)?.replace(/^@+/,"")??null,R=m?`@${m}`:e.actorName,w=(l?.id||i?.agentId||e.actorId||"").trim(),p=[];a||p.push({kind:"action",label:"Reply",onSelect:()=>ut(e,m)}),p.push({kind:"action",label:"Forward to new task…",onSelect:()=>Is(e,R,i?.workspaceRoot??l?.projectRoot??l?.cwd??void 0)}),p.push({kind:"separator"}),s&&p.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{ze(s)}}),p.push({kind:"action",label:"Copy Message",onSelect:()=>{ze(e.body)}}),p.push({kind:"action",label:"Copy Link",onSelect:()=>Kt(e.id)}),p.push({kind:"separator"}),!a&&w&&p.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{ze(w)}}),p.push({kind:"action",label:"Copy Message ID",onSelect:()=>{ze(e.id)}}),Rs(t,p)},[v,ut,Kt,Is,C,Z,b,Rs]),sa=async(t,e)=>{const s=`@${e.agentId} `,a=I.trim();if(a){D(""),await xe(`${s}${a}`,{forceAction:"invoke"});return}D(s),A.current?.focus()},Ke=o.useMemo(()=>{if(!u)return[];const t=new Set(u.participantIds);return b.filter(e=>!t.has(e.id)&&!e.retiredFromFleet).sort((e,s)=>e.name.localeCompare(s.name))},[u,b]);o.useEffect(()=>{Ct&&ot(t=>t&&Ke.some(e=>e.id===t)?t:Ke[0]?.id??"")},[Ct,Ke]);const Es=!!(u&&["direct","group_direct","channel"].includes(u.kind)&&Ke.length>0),na=o.useCallback(async()=>{if(!u)return;const t=Mt.trim();if(t){Nt(!0),De(null);try{const e=await B(`/api/conversations/${encodeURIComponent(u.id)}/members`,{method:"POST",body:JSON.stringify({actorId:t})});e.session?yt(e.session):yt(s=>s&&{...s,kind:e.kind,participantIds:e.participantIds}),rt(!1),ot(""),await U({messageMode:"none"})}catch(e){De(e instanceof Error?e.message:String(e))}finally{Nt(!1)}}},[Mt,U,u]);return r.jsx("div",{className:`s-thread-layout${f?" s-thread-layout--embedded":""}`,"data-thread-treatment":k==="standard"?void 0:k,children:r.jsxs("div",{className:"s-thread-center",children:[!f&&r.jsx(cr,{showBackNav:y,isDm:M,navigate:d,route:N,canonicalConversationId:ws,threadTitle:Et,agentId:K?.id??null,sessionId:ps,detailRoute:dn,participants:Fn,operator:On,canAddParticipants:Es,onToggleAddParticipant:()=>{De(null),rt(t=>!t)}}),!f&&u&&r.jsx(dr,{canonicalConversationId:ws,conversationAlias:Rn}),!f&&Ct&&Es&&r.jsx(ur,{agents:Ke,addParticipantId:Mt,setAddParticipantId:ot,addingParticipant:pn,addParticipantError:hn,onCancel:()=>{rt(!1),De(null)},onSubmit:()=>{na()}}),vt&&r.jsx(kr,{pinnedAsk:vt,onAnswer:()=>{const t=[...T].reverse().find(e=>e.actorId===vt.agentId)??[...T].reverse().find(e=>!Qe(e,C)&&e.class!=="status"&&e.class!=="system");t?ut(t,t.actorId?Z.get(t.actorId)?.scopedAlias??null:null):A.current?.focus()},onSteer:Dt}),r.jsx(Ar,{presence:j,agent:K}),cs&&r.jsx("p",{className:"s-thread-error",children:cs}),r.jsxs("div",{className:"s-thread-feed","data-conversation-id":n,ref:je,onScroll:Dn,children:[!ls&&T.length>0&&cn&&r.jsx("div",{className:"s-thread-history-control",children:r.jsxs("button",{type:"button",className:"s-thread-history-button",disabled:ye,"aria-busy":ye,onClick:()=>{un()},children:[ye&&r.jsx("span",{className:"s-thread-history-spinner","aria-hidden":"true"}),ye?"Loading earlier messages…":"Load earlier messages"]})}),ls?r.jsx(Tr,{}):T.length===0?Lt?r.jsx(xr,{agentName:O,title:j.label,detail:j.detail||de.latest,snapshot:de,events:Ne,steps:ee,phase:Ft,tone:En,workspaceName:lt,branch:u?.currentBranch,startedAt:It,onOpenTrace:Ts,onOpenTerminal:Ms,onSteer:Dt}):r.jsxs("div",{className:"s-thread-empty",children:[r.jsx("div",{className:"s-thread-empty-glyph","aria-hidden":"true",children:M?"@":"#"}),r.jsx("p",{children:Et}),r.jsx("p",{children:M?"No messages yet. Send a message to start working with this agent.":"No messages yet. Start the conversation below."}),(lt||u?.currentBranch)&&r.jsxs("div",{className:"s-thread-empty-chips",children:[lt&&r.jsx("span",{className:"s-thread-empty-chip",children:lt}),u?.currentBranch&&r.jsx("span",{className:"s-thread-empty-chip",children:u.currentBranch})]})]}):_e.map((t,e)=>{const s=za(t,e);if(t.kind==="fanout")return r.jsx(mr,{row:t,expanded:Pn.has(t.key),showDayDivider:s,onToggle:()=>qn(t.key)},t.key);const a=t.message,i=Qe(a,C),l=Va(a),m=l?"scout.dispatch":a.class,R=Xa(m),w=m==="status",p=Ks(a.createdAt),S=i?null:Hs(a,b,v),L=Z.get(a.actorId)?.scopedAlias?.trim()||null,fe=!i&&L?L:a.actorName,E=i?C.toLowerCase():L??S?.handle??null,se=Ja(a.body),Q=se?Ga({flightId:se.flightId,replyToMessageId:a.replyToMessageId,messagesById:ue,agents:b,operatorName:C}):null,_=!se&&a.replyToMessageId?ue.get(a.replyToMessageId)??null:null,J=_?Qe(_,C)?C:_.actorName:null,ve=se?se.body:a.body,P=Qs(a);if(P&&wt.has(a.id))return null;const Vt=typeof a.metadata?.targetAgentId=="string"?a.metadata.targetAgentId:null,mt=P?Gt(b,[Vt,P.target]):null,x=P?Bs({name:mt?.name,id:mt?.id,title:nr(P.target)}):null;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(hr,{at:a.createdAt}),P&&x?r.jsxs("article",{id:`msg-${a.id}`,className:["s-thread-msg","s-thread-failure-notice",(Ge||is?.has(a.id))&&"s-thread-msg--enter"].filter(Boolean).join(" "),style:Ge?{animationDelay:`${Math.max(0,7-(_e.length-1-e))*26}ms`}:void 0,"data-class":m,"aria-label":"Delivery issue",children:[r.jsx("span",{className:"s-thread-failure-notice-mark","aria-hidden":"true",children:"!"}),r.jsxs("div",{className:"s-thread-failure-notice-content",children:[r.jsxs("p",{children:[r.jsxs("strong",{children:[x," couldn’t reply."]})," ",r.jsx("span",{children:P.explanation})]}),P.technicalDetail&&r.jsxs("details",{className:"s-thread-failure-notice-details",children:[r.jsx("summary",{children:"Technical details"}),r.jsx("pre",{children:P.technicalDetail})]}),r.jsxs("div",{className:"s-thread-failure-notice-actions",children:[a.replyToMessageId&&ue.has(a.replyToMessageId)&&r.jsx("button",{className:"s-thread-failure-notice-action s-thread-failure-notice-action--primary",type:"button",disabled:H,onClick:()=>{Hn(a)},children:H?"Retrying…":"Retry"}),Bt&&r.jsx("button",{className:"s-thread-failure-notice-action",type:"button",onClick:()=>Wn(a,x,P.explanation),children:"Ask @scoutbot"}),r.jsx("button",{className:"s-thread-failure-notice-action s-thread-failure-notice-action--clear",type:"button",onClick:()=>hs(a),"aria-label":`Clear delivery issue for ${x}`,children:"Clear"})]})]}),r.jsx("span",{className:"s-thread-failure-notice-time",title:p,children:pt(a.createdAt)})]}):r.jsx("article",{id:`msg-${a.id}`,className:["s-thread-msg",i&&"s-thread-msg--you",w&&"s-thread-msg--tool",(Ge||is?.has(a.id))&&"s-thread-msg--enter"].filter(Boolean).join(" "),style:Ge?{animationDelay:`${Math.max(0,7-(_e.length-1-e))*26}ms`}:void 0,"data-class":m,onContextMenu:q=>ta(q,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 q=!i&&S?()=>ft(d,{view:"agents-v2",agentId:S.id},{returnTo:N}):null,Ls=i?C:fe??"?",$s=r.jsx(es,{agent:S??void 0,name:Ls,placement:"turn",size:28,className:"s-thread-msg-avatar",title:Ls});return q?r.jsx("button",{type:"button",className:"s-thread-msg-avatar--nav",onClick:q,"aria-label":`View profile for ${a.actorName??"agent"}`,title:`View profile for ${a.actorName??"agent"}`,children:$s}):$s})(),!i&&S?r.jsx("button",{type:"button",className:"s-thread-msg-actor s-thread-msg-actor--nav",onClick:()=>ft(d,{view:"agents-v2",agentId:S.id},{returnTo:N}),title:`View profile for ${a.actorName}`,children:fe}):r.jsx("span",{className:"s-thread-msg-actor",children:i?C:fe}),E&&r.jsxs("span",{className:"s-thread-msg-handle",children:["@",E]}),R&&r.jsx("span",{className:"s-thread-msg-kind",children:R})]}),r.jsx("span",{className:"s-thread-msg-time",title:p,children:pt(a.createdAt)}),r.jsxs("span",{className:"s-thread-msg-actions",children:[!i&&E&&r.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":`Reply to @${E}`,title:`Reply to @${E}`,onClick:()=>ut(a,E),children:r.jsx(ss,{})}),r.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":"Copy link to message",title:"Copy link to message",onClick:()=>Kt(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"})]})})]})]}),Q&&r.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open the originating request${Q.flightId?` · ${Q.flightId}`:""}`,onClick:()=>ct(Q.originatingMessageId),children:[r.jsx(ss,{}),r.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),r.jsx("span",{className:"s-thread-reply-ctx-title",children:Q.title}),r.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",Q.from]}),r.jsx("span",{className:"s-thread-reply-ctx-status",children:"· done"})]}),_&&J&&r.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open message from ${J}`,onClick:()=>ct(_.id),children:[r.jsx(ss,{}),r.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),r.jsx("span",{className:"s-thread-reply-ctx-title",children:Ys(_)}),r.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",J]})]}),r.jsx("div",{className:"s-thread-msg-body",title:p,children:r.jsx(sr,{text:ve})}),r.jsx(Wr,{message:a}),l&&l.candidates.length>0&&r.jsx("div",{className:"s-thread-dispatch",children:l.candidates.map(q=>r.jsxs("button",{type:"button",className:"s-thread-dispatch-tile",onClick:()=>{sa(l,q)},children:[r.jsxs("span",{className:"s-thread-dispatch-tile-id",children:["@",q.agentId]}),r.jsx("span",{className:"s-thread-dispatch-tile-state",children:q.endpointState}),r.jsx("span",{className:"s-thread-dispatch-tile-meta",children:[q.workspace,q.node,q.projectRoot].filter(Boolean).join(" · ")||q.displayName})]},q.agentId))})]})})})]},a.id)}),j.showTyping&&!Lt&&r.jsx("div",{className:"s-thread-feed-block",children:r.jsx("div",{className:"s-thread-msg","aria-live":"polite",children:r.jsxs("div",{className:Mn,children:[r.jsx(es,{agent:K??void 0,name:O,placement:"turn",size:28,className:"s-thread-msg-avatar s-thread-msg-avatar--working",title:O}),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:O}),r.jsx("span",{className:Nn,children:Cn})]}),r.jsx("span",{className:"s-thread-msg-time",title:g?.startedAt?Ks(g.startedAt):"now",children:g?.startedAt?pt(g.startedAt):"now"})]}),r.jsxs("div",{className:"s-thread-msg-working-body",children:[r.jsxs("div",{className:kn,children:[r.jsx("span",{className:An,"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:de.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:de.activityLabel})]}),r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Elapsed"}),r.jsx("dd",{children:de.elapsedLabel})]}),r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Last"}),r.jsx("dd",{children:de.lastActivityLabel})]})]}),ee.length>0||Ft?r.jsx(vr,{steps:ee,phase:Ft,limit:5,compact:!0}):r.jsx(Cr,{events:Ne,limit:4,compact:!0}),r.jsx(Mr,{onOpenTrace:Ts,onOpenTerminal:Ms,onSteer:Dt,compact:!0})]})]})]})})}),on&&Tt>0&&r.jsxs("button",{type:"button",className:"s-thread-new-messages",onClick:Bn,children:[r.jsx("span",{"aria-hidden":"true",children:"↓"})," ",Tt," new ",Tt===1?"message":"messages"," · jump to latest"]}),r.jsx("div",{ref:ln})]}),j.showTyping&&r.jsxs("div",{className:In,children:[r.jsx("div",{className:"s-thread-presence-line-avatars",children:r.jsx(es,{agent:K??void 0,name:O,placement:"turn",size:22,className:"s-thread-presence-line-avatar",title:O})}),r.jsx("span",{className:"s-thread-presence-line-label",children:$n}),r.jsx("div",{className:jn,"aria-hidden":"true"})]}),r.jsx(ha,{composeRef:A,draft:I,setDraft:D,composePlaceholder:Xn,slashState:le,setSlashState:Pe,filteredSlashCommands:fn,applySlashCommand:wn,mentionState:ce,setMentionState:qe,filteredMentions:gn,applyMention:Sn,updateTriggersFromDraft:bn,closeSuggestions:yn,replyTarget:oe,onCancelReply:Gn,isStopMode:Zn,sending:H,composeAction:Yn,onSend:()=>{Kn()},onInterrupt:()=>{Qt()},attachments:me,isAgentBusy:pe,busyIntent:As,onBusyIntentChange:dt,queued:he,queueNote:ea,onEditQueued:zn,editingQueuedId:Se?.id??null,editingAttachmentCount:js.length,onCancelEdit:Vn,onUnqueue:Qn,onSendQueuedNow:t=>{Jn(t)}})]})})}function ss(){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 hi=lr({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:er}});export{mi as ConversationScreen,hi as scoutSurface};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,r as w}from"./index-BI9AljSD.js";import{A as E}from"./AgentAvatar-B7c0egdP.js";import{H as Q}from"./HarnessMark-DAaWPiT_.js";import{t as F}from"./time-Dhsh_2EG.js";import{F as D,A as O}from"./AddProjectForm-r_1tVuWk.js";import{i as q,h as U}from"./mesh-roster-Bc7T4b7z.js";import{d as J}from"./Provider-Bu-C8Hxc.js";import{a as K}from"./agent-specialization-BtxLN4UR.js";import{o as G}from"./model-IGCUEsMy.js";import{s as W}from"./project-overview-helpers-BQTc_Ous.js";import{c as M}from"./createLucideIcon-DthwWQIg.js";import{S as V}from"./search-DmFM_9jm.js";import{S as X}from"./sliders-horizontal-BhHKxsCO.js";import{F as x,a as Y}from"./DocumentFocusViewer-DFFE85Tq.js";import{M as Z}from"./message-square-O-Hu9Mk2.js";const ee=[["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"}]],te=M("rows-3",ee);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"}]],ne=M("telescope",se);const re=[["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"}]],ie=M("users",re);function z(e){return e.needs?3:e.working?2:1}function $(e){return[...e].sort((n,s)=>z(s)-z(n)||s.lastActivityAt-n.lastActivityAt)}function S(e){return[...new Set(e.map(n=>n?.trim().toLowerCase()).filter(n=>!!n))].sort()}function _(e){const n=[...new Set(e.map(s=>s?.trim()).filter(s=>!!s))];return n.length===0?null:n.length===1?n[0]:`${n.length} branches`}function H(e){return e.needs>0?"needs":e.working>0||e.liveSessionCount>0?"working":"idle"}function oe(e){if(e.needs>0)return`${e.needs} ${e.needs===1?"item needs":"items need"} attention`;const n=Math.max(e.working,e.liveSessionCount);return n>0?`${n} active work ${n===1?"stream":"streams"}`:"No active work"}function ae(e,n){const s=$(n.filter(i=>i.projectSlug===e.slug)),r=S(s.map(i=>i.harness)),o={threadId:`project:${e.slug}`,projectSlug:e.slug,projectTitle:e.title,projectRoot:e.root,branch:_(e.branches.length>0?e.branches:s.map(i=>i.branch)),working:e.working>0||e.liveSessionCount>0,needs:e.needs>0,lastActivityAt:e.lastActivityAt,sessionCount:e.sessionCount,work:oe(e),conversationId:null};return{kind:"project",key:`project:${e.slug}`,agentId:null,name:e.title,headline:"Project agent",harnesses:r,model:null,effort:null,status:H(e),needs:o.needs,working:o.working,substrates:[o],primary:o,work:o.work,conversationId:null,lastActivityAt:e.lastActivityAt,sessionCount:e.sessionCount}}function ce(e){const n=$(e),s=n[0];return{threadId:s.id,projectSlug:s.projectSlug,projectTitle:s.projectTitle,projectRoot:s.projectRoot,branch:_(n.map(r=>r.branch)),working:n.some(r=>r.working),needs:n.some(r=>r.needs),lastActivityAt:Math.max(...n.map(r=>r.lastActivityAt)),sessionCount:n.reduce((r,o)=>r+o.sessionCount,0),work:s.work,conversationId:s.conversationId}}function le(e){const n=new Map;for(const s of e){const r=n.get(s.projectSlug)??[];r.push(s),n.set(s.projectSlug,r)}return[...n.values()].map(ce).sort((s,r)=>Number(r.needs)-Number(s.needs)||Number(r.working)-Number(s.working)||r.lastActivityAt-s.lastActivityAt)}function de(e,n){return n.some(s=>s.needs)?"needs":e.some(s=>(s.state??"").toLowerCase().includes("think"))?"thinking":n.some(s=>s.working)||e.some(s=>/work|running|in_turn/iu.test(s.state??""))?"working":"idle"}function b(e){const n=e?.trim().replace(/\/+$/u,"");return n?n.replace(/^\/(?:Users|home)\/[^/]+(?=\/)/u,"~"):null}function ue(e,n){return[n.root,...n.worktrees.map(r=>r.root)].map(b).filter(r=>!!r).some(r=>e===r||e.startsWith(`${r}/`))}function he(e,n,s){const r=new Set;for(const i of s)i.agentId===e.id&&r.add(i.projectSlug);const o=[e.projectRoot,e.cwd].map(b).filter(i=>!!i);for(const i of n){const a=[i.slug,i.title].map(l=>l.trim().toLowerCase());e.project&&a.includes(e.project.trim().toLowerCase())&&r.add(i.slug),e.workspaceQualifier&&a.includes(e.workspaceQualifier.trim().toLowerCase())&&r.add(i.slug),o.some(l=>ue(l,i))&&r.add(i.slug)}if(r.size===0){const i=b(e.projectRoot??e.cwd);i?r.add(`root:${i}`):e.project?.trim()?r.add(`project:${e.project.trim().toLowerCase()}`):e.workspaceQualifier?.trim()&&r.add(`workspace:${e.workspaceQualifier.trim().toLowerCase()}`)}return r}function pe(e,n,s){const r=new Set;for(const o of e)for(const i of he(o,n,s))r.add(i);return r.size>1?!0:e.some(o=>!U(o)&&!o.workspaceQualifier?.trim()&&!o.cwd?.trim())}function je(e,n,s){const r=e.filter(q),o=new Map;for(const i of r){const a=i.definitionId.trim()||i.id,l=o.get(a)??[];l.push(i),o.set(a,l)}return[...o.entries()].flatMap(([i,a])=>{if(!pe(a,n,s))return[];const h=[...a].sort((d,k)=>(k.updatedAt??0)-(d.updatedAt??0))[0],u=new Set(a.map(d=>d.id)),v=s.filter(d=>d.agentId&&u.has(d.agentId)),j=le(v),f=j[0]??null,p=S([...a.map(d=>d.harness),...v.map(d=>d.harness)]),y=S(a.map(d=>d.model)),A=S(a.map(d=>d.reasoningEffort)),m=de(a,j),C=Math.max(0,...a.map(d=>d.updatedAt??0),...j.map(d=>d.lastActivityAt)),g=K(h);return[{kind:"role",key:`role:${i}`,agentId:h.id,name:h.name,headline:g.headline,harnesses:p,model:y.length===1?y[0]:null,effort:A.length===1?A[0]:null,status:m,needs:m==="needs",working:m==="working"||m==="thinking",substrates:j,primary:f,work:f?.work??g.headline,conversationId:f?.conversationId??h.conversationId,lastActivityAt:C,sessionCount:j.reduce((d,k)=>d+k.sessionCount,0)}]})}function R(e){switch(e.status){case"needs":return 3;case"working":return 2;case"thinking":return 1;case"idle":return 0}}function B(e,n,s,r=null){const o=J(s,r);return[...e.map(a=>ae(a,n)),...je(o,e,n)].sort((a,l)=>R(l)-R(a)||l.lastActivityAt-a.lastActivityAt||a.name.localeCompare(l.name))}function we(e,n){switch(n){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 me(e,n){const s=H(e);switch(n){case"all":return!0;case"active":return s==="working";case"needs":return s==="needs";case"idle":return s==="idle"}}function fe(e,n){const s=n.trim().toLowerCase();return!s||e.name.toLowerCase().includes(s)||e.headline.toLowerCase().includes(s)||e.work.toLowerCase().includes(s)?!0:e.substrates.some(r=>r.projectTitle.toLowerCase().includes(s)||r.projectSlug.toLowerCase().includes(s)||(r.projectRoot?.toLowerCase().includes(s)??!1))}function ge(e,n){const s=n.trim().toLowerCase();return s?e.title.toLowerCase().includes(s)||e.slug.toLowerCase().includes(s)||(e.root?.toLowerCase().includes(s)??!1):!0}function ke(e){switch(e){case"needs":return"Needs attention";case"working":return"Working";case"thinking":return"Thinking";case"idle":return"Idle"}}const xe=[{id:"all",label:"All"},{id:"active",label:"Active"},{id:"needs",label:"Needs attention"},{id:"idle",label:"Idle"}];function ve(e,n){if(n){e({view:"conversation",conversationId:n});return}e({view:"messages"})}function L(e,n){e({view:"code",project:n})}function ye(e,n,s){e(G(n,s))}function P(e,n,s){e({view:"agents-v2",projectSlug:s,...n.machineId?{machineId:n.machineId}:{},...n.showEphemeral?{showEphemeral:!0}:{}})}function Ae({model:e,agents:n,route:s,navigate:r,nowMs:o}){const[i,a]=w.useState("projects"),[l,h]=w.useState("all"),[u,v]=w.useState(""),[j,f]=w.useState(!1),p=w.useMemo(()=>B(e.projects,e.threads,n,s.machineId??null),[n,e.projects,e.threads,s.machineId]),y=w.useMemo(()=>p.filter(c=>we(c,l)&&fe(c,u)),[p,u,l]),A=w.useMemo(()=>e.projects.filter(c=>me(c,l)&&ge(c,u)),[e.projects,u,l]),m=e.projects.filter(c=>c.working>0||c.liveSessionCount>0).length,C=e.projects.filter(c=>c.needs>0).length,g=p.filter(c=>c.status==="working"||c.status==="thinking").length,d=p.filter(c=>c.status==="needs").length,k=p.filter(c=>c.kind==="project").length,N=p.filter(c=>c.kind==="role").length;return t.jsxs("main",{className:"cw-root","aria-label":"Projects and agents",children:[t.jsxs("div",{className:"cw-toolbar",children:[t.jsxs("div",{className:"cw-modeToggle",role:"group","aria-label":"Directory view",children:[t.jsxs("button",{type:"button","data-active":i==="projects"||void 0,"aria-pressed":i==="projects",onClick:()=>a("projects"),title:"Browse tracked projects",children:[t.jsx(te,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Projects"]}),t.jsxs("button",{type:"button","data-active":i==="agents"||void 0,"aria-pressed":i==="agents",onClick:()=>a("agents"),title:"Browse durable agent identities",children:[t.jsx(ie,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Agents"]})]}),t.jsxs("label",{className:"cw-search",role:"search",children:[t.jsx(V,{size:13,strokeWidth:1.8,"aria-hidden":!0}),t.jsx("input",{type:"search",value:u,placeholder:i==="projects"?"Find project":"Find agent or project","aria-label":i==="projects"?"Find project":"Find agent or project",onChange:c=>v(c.currentTarget.value)})]}),t.jsxs("div",{className:"cw-filters","aria-label":"Status filter",children:[t.jsx(X,{size:12,strokeWidth:1.9,"aria-hidden":!0,className:"cw-filtersIcon"}),xe.map(c=>t.jsx("button",{type:"button","data-active":l===c.id||void 0,"aria-pressed":l===c.id,onClick:()=>h(c.id),children:c.label},c.id))]}),t.jsxs("button",{type:"button",className:"cw-addProject","aria-expanded":j,onClick:()=>f(c=>!c),children:[t.jsx(D,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Add project"]})]}),j?t.jsx(O,{onClose:()=>f(!1)}):null,t.jsx("div",{className:"cw-digest",children:i==="projects"?t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:[e.projects.length," projects"]}),t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{"data-tone":m>0?"live":void 0,children:[m," active"]}),C>0?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{"data-tone":"needs",children:[C," need you"]})]}):null]}):t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:[k," project agents"]}),N>0?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{children:[N," role ",N===1?"agent":"agents"]})]}):null,t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{"data-tone":g>0?"live":void 0,children:[g," active"]}),d>0?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{"data-tone":"needs",children:[d," need you"]})]}):null]})}),i==="projects"?t.jsx(Se,{projects:A,route:s,navigate:r,nowMs:o,allEmpty:e.projects.length===0}):t.jsx(be,{members:y,route:s,navigate:r,nowMs:o,allEmpty:p.length===0})]})}function Ce({project:e,threads:n,route:s,navigate:r,nowMs:o}){const i=B([e],n,[])[0];return t.jsx("main",{className:"cw-root cw-root--scoped","aria-label":`${e.title} agent`,children:t.jsx(I,{title:"Project agent",members:[i],route:s,navigate:r,nowMs:o})})}const T=5;function Se({projects:e,route:n,navigate:s,nowMs:r,allEmpty:o}){const[i,a]=w.useState(!1);if(e.length===0)return t.jsx("div",{className:"cw-empty",children:o?"No projects are tracked yet.":"No projects match these filters."});const l=i?e:e.slice(0,T),h=Math.max(0,e.length-T);return t.jsxs("div",{className:"cw-workspaceList",children:[l.map(u=>t.jsx(Ne,{project:u,route:n,navigate:s,nowMs:r},u.slug)),h>0?t.jsx("button",{type:"button",className:"cw-showMore",onClick:()=>a(u=>!u),children:i?"Show fewer projects":`Show ${h} more`}):null]})}function Ne({project:e,route:n,navigate:s,nowMs:r}){const o=e.working>0||e.liveSessionCount>0;return t.jsx("article",{className:"cw-workspace","data-state":e.needs>0?"needs":o?"live":void 0,children:t.jsxs("button",{type:"button",className:"cw-workspaceHead",onClick:()=>P(s,n,e.slug),children:[t.jsxs("span",{className:"cw-workspaceTitle",children:[t.jsx(x,{size:13,strokeWidth:1.7,"aria-hidden":!0}),"/",e.title]}),t.jsx("span",{className:"cw-workspaceRoot",title:e.root??void 0,children:e.root?W(e.root):"Discovered project"}),t.jsxs("span",{className:"cw-workspaceMeta",children:[e.needs>0?t.jsx("b",{"data-tone":"needs",children:"Needs you"}):null,o?t.jsx("b",{"data-tone":"live",children:"Active"}):null,t.jsxs("span",{children:[e.worktreeCount," ",e.worktreeCount===1?"worktree":"worktrees"]}),t.jsxs("span",{children:[e.sessionCount," ",e.sessionCount===1?"session":"sessions"]}),t.jsx("time",{children:e.lastActivityAt?F(e.lastActivityAt,r):"no activity"})]})]})})}function be({members:e,route:n,navigate:s,nowMs:r,allEmpty:o}){if(e.length===0)return t.jsx("div",{className:"cw-empty",children:o?"No durable agents are registered yet.":"No agents match these filters."});const i=e.filter(l=>l.kind==="role"),a=e.filter(l=>l.kind==="project");return t.jsxs("div",{className:"cw-agentDirectory",children:[i.length>0?t.jsx(I,{title:"Role agents",members:i,route:n,navigate:s,nowMs:r}):null,a.length>0?t.jsx(I,{title:"Project agents",members:a,route:n,navigate:s,nowMs:r}):null]})}function I({title:e,members:n,route:s,navigate:r,nowMs:o}){return t.jsxs("section",{className:"cw-agentSection","aria-label":e,children:[t.jsxs("div",{className:"cw-agentSectionHead",children:[t.jsx("h2",{children:e}),t.jsx("span",{children:n.length})]}),t.jsx("div",{className:"cw-grid",children:n.map(i=>t.jsx(Ie,{member:i,route:s,navigate:r,nowMs:o},i.key))})]})}function Ie({member:e,route:n,navigate:s,nowMs:r}){const o=e.primary;return t.jsxs("article",{className:"cw-card","data-status":e.status,"data-kind":e.kind,children:[t.jsxs("header",{className:"cw-cardHead",children:[t.jsx(E,{agent:{name:e.name,state:Me(e.status)},placement:"hero",size:46,presence:!0}),t.jsxs("div",{className:"cw-cardIdentity",children:[t.jsxs("div",{className:"cw-cardNameRow",children:[e.harnesses.length>0?t.jsx("span",{className:"cw-cardHarness","data-idle":e.status==="idle"||void 0,"aria-hidden":!0,children:e.harnesses.map(i=>t.jsx(Q,{harness:i,size:13},i))}):null,t.jsx("b",{title:e.name,children:e.name}),t.jsx("span",{className:"cw-statusPill","data-status":e.status,children:ke(e.status)})]}),t.jsx("div",{className:"cw-cardSubline",children:t.jsx("span",{className:"cw-headline",children:e.headline})})]})]}),e.kind==="project"&&o?t.jsxs("div",{className:"cw-projectContext",title:o.projectRoot??void 0,children:[t.jsx(x,{size:11,strokeWidth:1.8,"aria-hidden":!0}),t.jsx("span",{children:o.projectRoot?W(o.projectRoot):`/${o.projectTitle}`}),t.jsxs("em",{children:[e.sessionCount," ",e.sessionCount===1?"session":"sessions"]})]}):e.substrates.length>0?t.jsx("div",{className:"cw-substrates",children:e.substrates.map((i,a)=>t.jsx(Pe,{substrate:i,route:n,navigate:s,primary:a===0},i.threadId))}):null,t.jsxs("div",{className:"cw-work",children:[t.jsx("p",{title:e.work,children:e.work}),t.jsx("time",{children:e.lastActivityAt?F(e.lastActivityAt,r):"—"})]}),t.jsx("footer",{className:"cw-cardActions",children:e.kind==="project"&&o?t.jsxs(t.Fragment,{children:[t.jsxs("button",{type:"button",onClick:()=>P(s,n,o.projectSlug),children:[t.jsx(Y,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Open project"]}),t.jsxs("button",{type:"button",onClick:()=>L(s,o.projectSlug),children:[t.jsx(x,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Browse code"]})]}):t.jsxs(t.Fragment,{children:[e.conversationId?t.jsxs("button",{type:"button",onClick:()=>ve(s,e.conversationId),children:[t.jsx(Z,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Chat"]}):null,o?t.jsxs("button",{type:"button",onClick:()=>L(s,o.projectSlug),children:[t.jsx(x,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Browse code"]}):null,e.agentId?t.jsxs("button",{type:"button",onClick:()=>ye(s,n,e.agentId),children:[t.jsx(ne,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Inspect"]}):null]})})]})}function Me(e){switch(e){case"needs":return"needs_attention";case"working":return"in_turn";case"thinking":return"thinking";case"idle":return"idle"}}function Pe({substrate:e,route:n,navigate:s,primary:r=!1}){return t.jsxs("button",{type:"button",className:"cw-substrateChip","data-primary":r||void 0,"data-live":e.working||void 0,title:e.projectRoot??void 0,onClick:()=>P(s,n,e.projectSlug),children:[t.jsx(x,{size:11,strokeWidth:1.8,"aria-hidden":!0}),t.jsx("span",{children:e.projectTitle}),e.branch?t.jsxs("em",{children:["git: ",e.branch]}):null]})}const Ue=Object.freeze(Object.defineProperty({__proto__:null,CrewWorkspaces:Ae,ProjectAgentDirectory:Ce},Symbol.toStringTag,{value:"Module"}));export{Ae as C,Ce as P,ie as U,Ue as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as s}from"./index-BI9AljSD.js";import{a as k}from"./api-Co9aQ2Jw.js";import{u as R}from"./sse-DDHEHUgz.js";import{d as $,t as F}from"./time-Dhsh_2EG.js";import{SessionRefScreen as j}from"./SessionRefScreen-C8BiRVPx.js";/* empty css */import{c as E}from"./createLucideIcon-DthwWQIg.js";import{X as A}from"./x-DfRJbqrh.js";import"./perf-PX8Rx0EP.js";import"./index-BWHgHrtv.js";import"./tail-events-BdUrO0kb.js";import"./BackToPicker-Cto0Ioz9.js";import"./router-DTtux5sP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./ConversationScreen-CXAHQwQ3.js";import"./NewChatComposer-C_1op4dH.js";import"./text-Faa3ZStB.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./conversation-model-QsJVfSeG.js";import"./colors-BtO5_zlx.js";import"./index-DfsTyYDx.js";import"./HarnessMark-DAaWPiT_.js";import"./NewChatOrigin-D7hwp6dm.js";import"./keyboard-nav-e6yGeorb.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./file-text--hfhwZH1.js";import"./ConversationComposer-H8_hsYSc.js";import"./AgentAvatar-B7c0egdP.js";import"./Provider-Bu-C8Hxc.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./SpriteAvatar-56DTXxSV.js";import"./CrewAvatar-CXJHLNVM.js";import"./zap-CIo8msJB.js";import"./message-markup-Cc_O-WdA.js";import"./mentions-DuLQnEcn.js";import"./AgentDetailCard-B_KLcgsP.js";import"./AgentLiveActions-CsQA3pu_.js";import"./terminal-takeover-B6H4llRR.js";import"./openContent-C6XO6kr5.js";import"./eye-FnaaPfja.js";import"./terminal-C3YRPfyz.js";import"./message-visibility-CGOmSSKs.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-B0ZBhE_E.js";import"./AstronautSuit-Cjjcv6yQ.js";import"./ConversationFeedRows-hlEFlURs.js";import"./ConversationPanels-fMo6Uy1v.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-8WuxLa5l.js";import"./proxy-1BABCaDb.js";import"./activity-CqZafWfx.js";import"./message-circle-B2DoYKDO.js";import"./ConversationStatus-DI5GCiyW.js";import"./check-DbIkldnK.js";import"./sparkles-Cf8gin88.js";import"./SessionObserve-BCehTlO8.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-Bo2Zl-1a.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-BhVsvwkh.js";import"./ObserveTextFlow-BcrGQet8.js";import"./SessionObserveEvidence-Bb6U-dem.js";import"./wrench-DkxnZRlR.js";import"./external-link-C_nxk0MJ.js";import"./session-ref-lookup-state-SATH_jAP.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 ve({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{ve as FlightObserveScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m,j as e}from"./index-BI9AljSD.js";import{H as L,h as pe}from"./HarnessMark-DAaWPiT_.js";import{p as me,a as Z}from"./api-Co9aQ2Jw.js";import{b as fe}from"./router-DTtux5sP.js";import{n as S,t as J,f as O}from"./time-Dhsh_2EG.js";import{u as ge}from"./Provider-Bu-C8Hxc.js";import{u as xe}from"./useContentSecondaryNav-Bpkc8ayb.js";import{OpsSubnav as be}from"./OpsSubnav-BEU4kKXm.js";/* empty css */import{R as ve}from"./refresh-cw-DmNAhaH0.js";import{E as Y}from"./external-link-C_nxk0MJ.js";import{c as je}from"./createLucideIcon-DthwWQIg.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./sse-DDHEHUgz.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./file-text--hfhwZH1.js";import"./x-DfRJbqrh.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-e6yGeorb.js";import"./NewChatComposer-C_1op4dH.js";import"./text-Faa3ZStB.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./conversation-model-QsJVfSeG.js";import"./index-DfsTyYDx.js";import"./NewChatOrigin-D7hwp6dm.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./SecondaryNav-BrXMtvKE.js";import"./secondaryNavConfig-C9bQ9_IA.js";import"./message-square-O-Hu9Mk2.js";import"./compass-BcRI_YXo.js";import"./settings-C6h9y5XX.js";import"./terminal-C3YRPfyz.js";import"./git-branch-DJyvr0k-.js";import"./scroll-text-kPhYbh-M.js";/* empty css */const D=60*6e4,N=24*D,ke=["product_judgment","large_context_synthesis","adversarial_critique","evidence_inventory","implementation","code_review"],V={fable:j("Fable 5","claude","claude","claude-fable-5","max","Fable","Premium product taste, rapid design iterations, and premise-level critique.","Uses the premium shared Claude allowance; do not spend it on routine mechanical work."),sol:j("GPT-5.6 Sol","codex","codex","gpt-5.6-sol","xhigh",null,"Load-bearing coding, debugging, integration, and technically grounded judgment.","Highest Codex tier; reserve deep turns for work where failure is expensive."),grok:j("Grok 4.6","grok","grok","grok-4.6",null,"Grok","Independent assumption checking, deletion pressure, and adversarial critique.","Do not make it the sole implementation authority; verify conclusions against repository evidence."),kimi:j("Kimi Code","kimi","kimi",null,null,"Kimi","Dense repository and study synthesis through the native Kimi harness.","The harness owns the concrete model and quota telemetry can be stale; probe before large fan-out."),opus:j("Opus 5","claude","claude","claude-opus-5","high","Opus","Long-context synthesis, nuanced architecture, and coherent product reasoning.","Premium shared Claude quota; avoid routine scans and repetitive verification."),glm:j("GLM-5.2","opencode","opencode","opencode-go/glm-5.2",null,"OpenCode","Independent broad-context synthesis through OpenCode.","OpenCode quota is not visible in Scout; use a bounded canary before scaling."),terra:j("GPT-5.6 Terra","codex","codex","gpt-5.6-terra","high",null,"Balanced implementation, correctness review, and technical critique.","Prefer Sol for the hardest integration boundary when its additional spend is justified."),minimax:j("MiniMax M3","minimax","opencode","opencode-go/minimax-m3",null,"OpenCode","Cost-effective structured evidence collection and comparison.","Verify load-bearing conclusions with a stronger reviewer before acceptance."),luna:j("GPT-5.6 Luna","codex","codex","gpt-5.6-luna","medium",null,"Inexpensive source mapping, test enumeration, and mechanical audit work.","Keep it out of sole high-stakes product judgment and final acceptance."),haiku:j("Haiku 4.5","claude","claude","claude-haiku-4-5","low",null,"Fast narrow scans and classification inside the Claude harness.","Lighter reasoning and a smaller context window make broad synthesis a poor fit."),sonnet:j("Sonnet 4.6","claude","claude","claude-sonnet-4-6","high",null,"Strong generalist implementation with a large context window.","Shares Claude's provider allowance and can become a poor choice when that pool is guarded."),deepseek:j("DeepSeek V4 Pro","opencode","opencode","opencode-go/deepseek-v4-pro",null,"OpenCode","Code-centric review through an independent model lineage.","Quota is opaque and findings should not be the sole acceptance authority.")},ee={product_judgment:{label:"Product judgment",objective:"Strategic tradeoffs, UX prioritization, scope shaping, and high-level product decisions.",strategy:"Select models with high nuanced taste, product-level synthesis, and clear communication of architectural tradeoffs.",candidates:[b("fable",100,"Unmatched product taste, rapid design iteration synthesis, and high-fidelity UX direction."),b("sol",87,"Technically grounded product decisions with strong execution realism."),b("grok",82,"Unfiltered perspective on feature bloat and aggressive scope reduction.")]},large_context_synthesis:{label:"Large-context synthesis",objective:"Repository-wide investigations, deep architectural archaeology, and multi-file code synthesis.",strategy:"Select models with expansive effective context windows and high-density information compression.",candidates:[b("kimi",100,"Native long-context retrieval and dense codebase relationship synthesis."),b("opus",91,"Deep structural understanding across complex multi-package repositories."),b("glm",84,"Independent wide-window scanning and structural cross-referencing.")]},adversarial_critique:{label:"Adversarial critique",objective:"Challenging design assumptions, rapid design iteration critique, identifying UX/logic gaps, and applying deletion pressure.",strategy:"Select high-taste and contrarian model lineages that stress-test design iterations and probe corner cases without sycophantic approval.",candidates:[b("fable",100,"High-fidelity design critique, rapid UX/visual iteration stress-testing, and premise challenge."),b("grok",91,"Contrarian perspective, uncompromising edge-case discovery, and aggressive premise challenge."),b("terra",84,"Rigorous technical inspection of code correctness and runtime invariants.")]},evidence_inventory:{label:"Evidence inventory",objective:"Grep and AST inventory, reference tracing, log audit, and structured fact collection.",strategy:"Select fast, cost-effective models with high precision on structured evidence gathering.",candidates:[b("minimax",100,"Fast, cost-effective structured evidence indexing and pattern enumeration."),b("luna",95,"Low-latency source tracing, test inventory, and reference mapping."),b("haiku",87,"Rapid mechanical file scans and categorization.")]},implementation:{label:"Implementation",objective:"Code creation, refactoring, type checking, unit test writing, and bug fixing.",strategy:"Select code-generation champions with high instruction following and strong language typing skills.",candidates:[b("sol",100,"Deep technical accuracy, robust multi-file refactors, and complex logic execution."),b("terra",91,"Reliable structured implementation with strong type-system adherence."),b("sonnet",87,"Strong generalist coding with fast turn times and clear explanations.")]},code_review:{label:"Code review",objective:"Diff analysis, security audit, regression detection, and style conformity.",strategy:"Select models with high sensitivity to subtle bugs, invariant violations, and edge-case behaviors.",candidates:[b("terra",100,"Strict invariant checking, subtle logic flaw detection, and boundary test coverage."),b("opus",96,"High-level architectural consistency and API surface evolution review."),b("deepseek",87,"Independent second-opinion review focused on code-level edge cases.")]}};function $(s){return s.availability==="constrained"||s.availability==="guarded"||s.minimumRemainingPercent!==null&&s.minimumRemainingPercent<=20||s.pacing==="ahead"&&(s.minimumRemainingPercent??100)<=35}function se(s){return s.confidence==="fresh"&&s.minimumRemainingPercent!==null&&!$(s)}function ye(s){return $(s)?s.minimumRemainingPercent!==null&&s.minimumRemainingPercent<=15?`${s.providerLabel} is near capacity (${s.minimumRemainingPercent}% remaining). High risk of quota exhaustion.`:s.pacing==="ahead"?`${s.providerLabel} consumption rate exceeds window pace with limited buffer.`:`${s.providerLabel} quota availability is ${s.availability}. Failover recommended.`:null}function k(s){return[s.providerId,s.harness,s.model,s.effort,s.profile].join("|")}function Ne(s){return[s.profile?`profile ${s.profile}`:s.harness,s.model,s.effort].filter(Boolean).join(" / ")}function Re(s,n="<request>"){const a=s.profile?.trim().toLowerCase()??null,t=a!=="opencode"&&a!=="oc",i=s.profile&&t?["--profile",s.profile]:["--harness",s.harness,...s.model?["--model",s.model]:[]];return s.effort&&i.push("--effort",s.effort),i.push(n),i}function B(s,n="<request>"){return["scout","ask",...Re(s,n)].map(_e).join(" ")}function we(s,n={}){const a=ne(n.now)??Date.now(),t=n.bias??"balanced",i=Me(t),o=new Map(s.providers.map(h=>[h.id,qe(h,a)])),r=n.role?[n.role]:[...ke],c=r.map(h=>{const u=ee[h],d=u.candidates.map(f=>{const g=o.get(f.route.providerId)??ae(f.route.providerId);return{runtime:f,quota:g,score:f.fit+Ae(g,a)*i}}).sort((f,g)=>g.score-f.score||g.runtime.fit-f.runtime.fit),p=d[0],x=$(p.quota),v=d.slice(1);return x&&v.sort((f,g)=>{const q=K(f,p.runtime.route.providerId),T=K(g,p.runtime.route.providerId);return q-T||g.score-f.score||g.runtime.fit-f.runtime.fit}),{role:h,roleLabel:u.label,modelLabel:p.runtime.label,route:p.runtime.route,score:p.score,fit:p.runtime.fit,objective:u.objective,taskRationale:p.runtime.taskRationale,capability:p.runtime.capability,caution:p.runtime.caution,assertion:Le(p.quota),quotaRisk:x,quotaRiskMessage:ye(p.quota),quota:p.quota,alternatives:v.slice(0,2).map(({runtime:f,quota:g,score:q})=>({label:f.label,route:f.route,score:q,fit:f.fit,capability:f.capability,caution:f.caution,taskRationale:f.taskRationale,quotaRisk:$(g),quota:g}))}}),l=Se(r,o,a);return{generatedAt:s.generatedAt,generatedAtLocal:s.generatedAtLocal,evaluatedAt:a,assignments:c,models:l,bias:t}}function Se(s,n,a){const t=new Map;for(const i of s){const o=ee[i];for(const r of o.candidates){const c=k(r.route),l=t.get(c);l?l.roles.push({role:i,label:o.label}):t.set(c,{runtime:r,roles:[{role:i,label:o.label}]})}}return[...t.values()].map(({runtime:i,roles:o})=>{const r=n.get(i.route.providerId)??ae(i.route.providerId);return{modelLabel:i.label,route:i.route,roles:o,strengths:[i.capability],cautions:[i.caution],guidance:Ce(r,a),quotaRisk:$(r),quota:r}})}function qe(s,n){const a=s.windows.filter(h=>!/^video\b/iu.test(h.label)).map(h=>$e(h,n)),t=[...a].sort((h,u)=>h.percentRemaining-u.percentRemaining)[0]??null,i=a.filter(h=>h.paceRatio!==null).sort((h,u)=>u.paceRatio-h.paceRatio)[0]??null,o=a.map(h=>h.confidence),r=o.includes("stale")?"stale":o.includes("fresh")?"fresh":"unknown",c=[...a].filter(h=>h.resetAt!==null&&h.resetAt>n).sort((h,u)=>h.resetAt-u.resetAt)[0]??null,l=t?.percentRemaining??null;return{providerId:s.id,providerLabel:s.label,plan:s.plan,availability:Te(l),pacing:i?.status??"unknown",confidence:r,minimumRemainingPercent:l,bindingWindow:t?.label??null,nextResetAt:c?.resetAt??null,nextResetIn:c?.resetIn??"",windows:a}}function $e(s,n){const a=ne(s.windowMs)??Pe(s.label,s.resetAt),t=a!==null&&s.resetAt!==null?X(Ue(100-(s.resetAt-n)/a*100,0,100)):null,i=t!==null&&t>=1?De(s.usedPercent/t):null,o=i===null?null:X(i*100),r=Ie(s.usedPercent,t,i),c=a===null?N:Math.min(N,Math.max(D,a/4)),l=s.freshness.ageMs===null?"unknown":s.freshness.ageMs>c?"stale":"fresh";return{label:s.label,usedPercent:s.usedPercent,percentRemaining:s.percentRemaining,durationMs:a,elapsedPercent:t,paceRatio:i,projectedUsedPercent:o,status:r,resetAt:s.resetAt,resetIn:s.resetIn,freshness:s.freshness.label,confidence:l}}function j(s,n,a,t,i,o,r,c){return{label:s,route:{providerId:n,harness:a,model:t,effort:i,profile:o},capability:r,caution:c}}function b(s,n,a){return{...V[s],fit:n,taskRationale:a??V[s].capability}}function Ce(s,n){return $(s)?"conserve":s.confidence!=="fresh"?"probe_first":s.availability==="constrained"?"conserve":s.nextResetAt!==null&&s.nextResetAt>n&&s.nextResetAt-n<=N&&s.pacing!=="ahead"&&(s.minimumRemainingPercent??0)>=10?"use_now":s.availability==="guarded"?"conserve":s.pacing==="ahead"?"use_deliberately":s.availability==="abundant"&&s.pacing==="underused"?"use_now":"available"}function Me(s){switch(s){case"capability":return .25;case"quota":return 1.75;case"balanced":return 1}}function Ae(s,n){let a=0;switch(s.availability){case"abundant":a+=10;break;case"available":a+=5;break;case"guarded":a-=5;break;case"constrained":a-=30;break;case"unknown":a-=2;break}return s.pacing==="underused"&&(a+=5),s.pacing==="ahead"&&(a-=8),s.confidence==="stale"&&(a-=8),s.confidence==="unknown"&&(a-=3),s.pacing==="underused"&&s.nextResetAt!==null&&s.nextResetAt>n&&s.nextResetAt-n<=2*N&&(a+=3),a}function Le(s){if(s.minimumRemainingPercent===null)return`${te(s.providerId)} quota telemetry unavailable; use a bounded canary before scaling.`;const n=s.pacing==="on_track"?"usage tracks elapsed time":s.pacing==="underused"?"usage trails elapsed time":s.pacing==="ahead"?"usage exceeds elapsed time":"pace unknown",a=s.nextResetIn?` · next reset ${s.nextResetIn}`:"";return`${Oe(s.minimumRemainingPercent)} minimum remaining · ${n} · telemetry ${s.confidence}${a}.`}function ae(s){return{providerId:s,providerLabel:te(s),plan:null,availability:"unknown",pacing:"unknown",confidence:"unknown",minimumRemainingPercent:null,bindingWindow:null,nextResetAt:null,nextResetIn:"",windows:[]}}function Pe(s,n){const a=s.trim().toLowerCase(),t=a.match(/(?:^|\s)(\d+(?:\.\d+)?)([hd])$/u);if(t){const i=Number(t[1]);return t[2]==="h"?i*D:i*N}if(a==="weekly"||a==="week"||a==="7-day")return 7*N;if(a==="5-hour")return 5*D;if(a==="monthly"||a==="month"){if(n===null)return 30*N;const i=new Date(n),o=new Date(n);o.setUTCMonth(o.getUTCMonth()-1);const r=i.getTime()-o.getTime();return r>0?r:30*N}return null}function Ie(s,n,a){if(n===null||a===null)return"unknown";const t=s-n;return a>1.1&&t>3?"ahead":a<.7&&t<-10?"underused":"on_track"}function Te(s){return s===null?"unknown":s>=60?"abundant":s>=30?"available":s>=15?"guarded":"constrained"}function K(s,n){const a=se(s.quota),t=s.runtime.route.providerId!==n;return a&&t?0:a?1:t?2:3}function _e(s){return/^[A-Za-z0-9_./:@%+=,-]+$/u.test(s)?s:`'${s.replaceAll("'",`'"'"'`)}'`}function te(s){return s.split(/[-_\s]+/u).filter(Boolean).map(n=>`${n.charAt(0).toUpperCase()}${n.slice(1)}`).join(" ")||"Unknown"}function Oe(s){return`${Number.isInteger(s)?s.toFixed(0):s.toFixed(1)}%`}function ne(s){return typeof s=="number"&&Number.isFinite(s)?s:null}function X(s){return Math.round(s*10)/10}function De(s){return Math.round(s*100)/100}function Ue(s,n,a){return Math.min(a,Math.max(n,s))}const Ee=[["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"}]],Fe=je("clipboard-paste",Ee),Ge=3e4,M=[{value:"capability",label:"Capability"},{value:"balanced",label:"Balanced"},{value:"quota",label:"Quota"}],Be={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"},ie=[{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"}]}],He={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"}]},ze={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 Qe({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 n=(s??"").trim().toLowerCase();return n?n.includes("claude")?"claude":n.includes("codex")?"codex":n.includes("cursor")?"cursor":n.includes("kimi")||n.includes("moonshot")?"kimi":n.includes("minimax")?"minimax":n.includes("github")?"github":n.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown":"unknown"}function P(s){return Be[s]??pe(s)}function We(s){switch(s){case"weekly":return"7d";case"req/h":return"1h";default:return s||"quota"}}function I(s){return s.windows&&s.windows.length>0?s.windows:[{label:We(s.unitLabel),fill:s.fill,usedLabel:s.usedLabel,capLabel:s.capLabel,unitLabel:s.unitLabel,resetAt:s.resetAt}]}function Ve(s){return s.capLabel==="100%"&&s.usedLabel.endsWith("%")?s.usedLabel:`${s.usedLabel}/${s.capLabel}`}function re(s){return s>=.9?"err":s>=.75?"warn":"ok"}function Ke(s,n=30){const a=s??[];if(a.length<=n)return a;if(n<=1)return[a[a.length-1]];const t=(a.length-1)/(n-1);return Array.from({length:n},(i,o)=>a[Math.round(o*t)])}function H(s){const n=Math.floor((s-Date.now())/1e3),a=n<0,t=Math.abs(n);let i;if(t>=86400){const o=Math.floor(t/86400),r=Math.floor(t%86400/3600);i=r>0?`${o}d ${r}h`:`${o}d`}else if(t>=3600){const o=Math.floor(t/3600),r=Math.floor(t%3600/60);i=r>0?`${o}h ${r}m`:`${o}h`}else i=`${Math.max(1,Math.floor(t/60))}m`;return a?`stale ${i}`:i}function Xe(s){if(!s)return null;const n=S(s.capturedAt);if(n)return n;if(s.kind!=="quota")return null;const a=I(s).reduce((t,i)=>{const o=S(i.capturedAt);return Math.max(t??0,o??0)||t},null);return a||I(s).flatMap(t=>t.history??[]).reduce((t,i)=>{const o=S(i.capturedAt);return Math.max(t??0,o??0)||t},null)}function Ze({provider:s,onImported:n}){const[a,t]=m.useState(!1),[i,o]=m.useState(""),[r,c]=m.useState(!1),[l,h]=m.useState(null),u=`hs-${s}-dashboard-capture`,d=P(s);if(!a)return e.jsxs("button",{type:"button",className:"hs-dashboard-capture-trigger",onClick:()=>t(!0),children:[e.jsx(Fe,{size:12,"aria-hidden":"true"}),"Import dashboard"]});const p=async x=>{if(x.preventDefault(),!(!i.trim()||r)){c(!0),h(null);try{await Z("/api/service-budgets/dashboard-import",{method:"POST",body:JSON.stringify({provider:s,text:i})}),o(""),h("Usage snapshot imported."),await n()}catch(v){h(v instanceof Error?v.message:String(v))}finally{c(!1)}}};return e.jsxs("form",{className:"hs-dashboard-capture",onSubmit:x=>{p(x)},children:[e.jsxs("label",{htmlFor:u,children:[d," 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:u,value:i,onChange:x=>o(x.target.value),maxLength:128*1024,rows:5,placeholder:s==="cursor"?"Date (UTC),Type,Model,Tokens,Cost…":"Weekly SuperGrok… Limit · 12% used · Resets…","aria-describedby":l?`${u}-message`:void 0}),l?e.jsx("span",{id:`${u}-message`,className:"hs-dashboard-capture-message",role:"status",children:l}):null,e.jsxs("div",{className:"hs-dashboard-capture-actions",children:[e.jsx("button",{type:"button",onClick:()=>{t(!1),h(null)},disabled:r,children:"Cancel"}),e.jsx("button",{type:"submit",disabled:!i.trim()||r,children:r?"Importing…":"Use snapshot"})]})]})}function Je(s){const n=new Map(s.map(a=>[F(a.id),a]));return ie.map(({id:a})=>({id:a,label:P(a),gauge:n.get(a)??null}))}function Ye({points:s}){const n=Ke(s);return n.length===0?e.jsx("span",{className:"hs-history hs-history-empty",children:"live"}):e.jsx("span",{className:"hs-history","aria-label":`${n.length} budget samples`,children:n.map((a,t)=>{const i=Math.max(.06,Math.min(1,a.fill));return e.jsx("span",{className:`hs-history-bar hs-history-bar--${re(a.fill)}`,style:{height:`${Math.round(i*100)}%`},title:`${O(a.capturedAt)||"unknown"} ${a.usedLabel}`},`${a.capturedAt}:${t}`)})})}function es({gauge:s,window:n}){const a=Math.max(0,Math.min(100,Math.round(n.fill*100))),t=100-a,i=re(n.fill),o=Number.isFinite(n.resetAt)?new Date(n.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:[n.label," window"]}),e.jsxs("strong",{className:`hs-subscription-usage hs-subscription-usage--${i}`,children:[a,"% used"]})]}),e.jsxs("div",{className:"hs-subscription-remaining",children:[e.jsxs("strong",{children:[t,"%"]}),e.jsx("span",{children:"available"})]})]}),e.jsx("div",{className:"hs-subscription-meter",role:"progressbar","aria-label":`${s.label} ${n.label} usage`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,children:e.jsx("span",{className:`hs-subscription-meter-fill hs-subscription-meter-fill--${i}`,style:{width:`${a}%`}})}),e.jsxs("div",{className:"hs-subscription-window-meta",children:[e.jsxs("span",{children:[Ve(n)," ",n.unitLabel==="quota"?"quota":n.unitLabel]}),e.jsxs("span",{children:["resets in ",H(n.resetAt),o?e.jsx("time",{dateTime:o,title:O(n.resetAt)||void 0,children:` · ${O(n.resetAt)||""}`}):null]})]}),e.jsx(Ye,{points:n.history})]})}function ss(){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 as(s,n,a){const t=s.flatMap(i=>{if(i.kind!=="quota")return[];const o=I(i).map(r=>{const c=S(r.capturedAt??i.capturedAt),l=Math.round(Math.max(0,Math.min(1,r.fill))*1e3)/10;return{label:r.label,usedPercent:l,percentRemaining:Math.round((100-l)*10)/10,windowMs:r.windowMs??null,resetAt:S(r.resetAt),resetIn:Number.isFinite(r.resetAt)?H(r.resetAt):"",freshness:{ageMs:c?Math.max(0,a-c):null,label:c?J(c)||"now":"unknown"}}});return[{id:F(i.id),label:P(F(i.id)),plan:i.plan??null,windows:o}]});return{generatedAt:n,generatedAtLocal:O(n)||"now",providers:t}}function U(s){switch(s){case"underused":return"usage trails elapsed time";case"on_track":return"usage tracks elapsed time";case"ahead":return"usage exceeds elapsed time";default:return"pace unknown"}}function A(s){return Ne(s)}function z({text:s,label:n="Copy rule"}){const[a,t]=m.useState("idle");m.useEffect(()=>{if(a==="idle")return;const o=window.setTimeout(()=>t("idle"),1800);return()=>window.clearTimeout(o)},[a]);const i=m.useCallback(async()=>{if(typeof navigator>"u"||!navigator.clipboard){t("failed");return}try{await navigator.clipboard.writeText(s),t("copied")}catch{t("failed")}},[s]);return e.jsx("button",{type:"button",className:"hs-advisor-dispatch-copy",onClick:()=>{i()},"aria-live":"polite","aria-atomic":"true",children:a==="copied"?"Copied!":a==="failed"?"Copy failed":n})}function G(s,n){return!!(s.quotaRisk&&n&&!n.quotaRisk&&se(n.quota)&&n.route.providerId!==s.route.providerId)}function oe(s){return s.minimumRemainingPercent===null?"quota unknown":`${s.minimumRemainingPercent}% minimum remaining`}function ts(s){switch(s){case"use_now":return"Use now";case"available":return"Available";case"use_deliberately":return"Use deliberately";case"probe_first":return"Probe first";case"conserve":return"Conserve"}}function le({providerLabel:s,quota:n}){return n.windows.length===0?e.jsxs("div",{className:"hs-advisor-no-quota",children:[e.jsx("strong",{children:"No quota telemetry"}),e.jsx("span",{children:"Use one bounded ask as a canary before scaling this route."})]}):e.jsx("div",{className:"hs-advisor-windows",children:n.windows.map(a=>{const t=Math.max(0,Math.min(100,a.usedPercent)),i=a.elapsedPercent===null?null:Math.max(0,Math.min(100,a.elapsedPercent)),o=i===null?"elapsed time unavailable":`${i}% of the window elapsed`,r=a.projectedUsedPercent===null?"projection unavailable":`${a.projectedUsedPercent}% projected at reset`;return e.jsxs("div",{className:"hs-advisor-window",children:[e.jsxs("div",{className:"hs-advisor-window-head",children:[e.jsx("strong",{children:a.label}),e.jsxs("span",{children:[a.usedPercent,"% used"]}),e.jsx("span",{children:U(a.status)})]}),e.jsxs("div",{className:"hs-advisor-window-meter",role:"progressbar","aria-label":`${s} ${a.label} usage`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(t),"aria-valuetext":`${a.usedPercent}% used; ${o}; ${r}; ${U(a.status)}`,children:[e.jsx("span",{className:`hs-advisor-window-fill hs-advisor-window-fill--${a.status}`,style:{width:`${t}%`}}),i!==null?e.jsx("span",{className:"hs-advisor-window-now",style:{left:`${i}%`},title:`${i}% of the window has elapsed`,"aria-hidden":"true"}):null]}),e.jsxs("div",{className:"hs-advisor-window-meta",children:[e.jsxs("span",{children:[a.percentRemaining,"% available"]}),e.jsx("span",{children:r}),e.jsx("span",{children:a.resetIn?`resets in ${a.resetIn}`:"reset unknown"})]})]},a.label)})})}function ce({assignment:s,selected:n,onSelect:a}){return e.jsxs("button",{type:"button",className:"hs-advisor-role","data-selected":n?"true":void 0,onClick:a,"aria-pressed":n,children:[e.jsx("span",{className:"hs-advisor-role-mark",children:e.jsx(L,{harness:s.route.harness,size:25,title:null})}),e.jsxs("span",{className:"hs-advisor-role-copy",children:[e.jsx("strong",{children:s.roleLabel}),e.jsx("span",{children:s.modelLabel}),e.jsxs("small",{children:[s.route.profile?`profile ${s.route.profile}`:s.route.harness," · Fit $",s.fit]})]}),e.jsx("span",{className:`hs-advisor-role-tag ${s.quotaRisk?"hs-advisor-role-tag--risk":""}`,children:s.quotaRisk?`⚠️ ${s.quota.minimumRemainingPercent!==null?`${s.quota.minimumRemainingPercent}%`:"Risk"}`:s.fit>=100?"Primary":`Fit ${s.fit}`})]})}function ns({map:s}){const[n,a]=m.useState("implementation"),t=s.assignments.find(r=>r.role===n)??s.assignments[0];if(!t)return null;const i=B(t.route),o=t.alternatives.find(r=>G(t,r));return e.jsxs("div",{className:"hs-advisor-layout",children:[e.jsx("nav",{className:"hs-advisor-roles","aria-label":"Work roles",children:s.assignments.map(r=>e.jsx(ce,{assignment:r,selected:r.role===t.role,onSelect:()=>a(r.role)},r.role))}),e.jsxs("article",{className:"hs-advisor-detail","aria-live":"polite",children:[e.jsxs("header",{className:"hs-advisor-detail-head",children:[e.jsxs("div",{className:"hs-advisor-model",children:[e.jsx(L,{harness:t.route.harness,size:26,title:null}),e.jsxs("div",{children:[e.jsxs("span",{children:[t.roleLabel," · Role Routing"]}),e.jsx("h4",{children:t.modelLabel}),e.jsx("code",{children:A(t.route)})]})]}),e.jsx("span",{className:`hs-advisor-fit-badge ${t.quotaRisk?"hs-advisor-role-tag--risk":""}`,children:t.quotaRisk?"⚠️ Quota Risk · Failover Active":`Primary Route · Fit ${t.fit}`})]}),t.quotaRisk?e.jsxs("div",{className:"hs-advisor-quota-alert",role:"alert",children:[e.jsxs("div",{className:"hs-advisor-quota-alert-head",children:[e.jsx("span",{className:"hs-advisor-quota-alert-badge",children:"⚠️ Quota Risk"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Quota Exhaustion Imminent · Elevated to Primary Concern"}),e.jsx("p",{children:t.quotaRiskMessage??`${t.quota.providerLabel} quota is near capacity.`})]})]}),e.jsx("div",{className:"hs-advisor-quota-alert-action",children:o?e.jsxs("span",{children:["Failover to ",e.jsx("strong",{children:o.label})," to move work off the constrained provider."]}):e.jsx("span",{children:"No quota-safe cross-provider fallback is currently available; keep the task bounded or wait for reset."})})]}):null,e.jsxs("div",{className:"hs-advisor-task-hero",children:[e.jsxs("div",{className:"hs-advisor-task-hero-head",children:[e.jsx("h5",{children:"Task Objective"}),e.jsx("span",{children:"Cognitive Strategy"})]}),e.jsx("p",{children:t.objective}),e.jsxs("small",{children:[e.jsx("strong",{children:"Execution Rationale:"})," ",t.taskRationale]})]}),e.jsxs("div",{className:"hs-advisor-assessment",children:[e.jsxs("section",{children:[e.jsx("h5",{children:"Strengths for this task"}),e.jsx("p",{children:t.capability})]}),e.jsxs("section",{children:[e.jsx("h5",{children:"Watchouts & Guardrails"}),e.jsx("p",{children:t.caution})]})]}),e.jsxs("section",{className:"hs-advisor-dispatch",children:[e.jsx("h5",{children:"Dispatch rule"}),e.jsxs("div",{className:"hs-advisor-dispatch-snippet",children:[e.jsx("code",{children:i}),e.jsx(z,{text:i,label:"Copy rule"})]})]}),e.jsxs("section",{className:"hs-advisor-ladder",children:[e.jsx("h5",{children:"Failover ladder"}),e.jsxs("div",{className:"hs-advisor-ladder-nodes",children:[e.jsxs("div",{className:`hs-advisor-ladder-node ${t.quotaRisk?"hs-advisor-ladder-node--primary hs-advisor-ladder-node--risk":"hs-advisor-ladder-node--primary"}`,children:[e.jsx("span",{className:"hs-advisor-ladder-badge",children:t.quotaRisk?"⚠️ Primary (Quota Risk)":"Primary"}),e.jsxs("div",{className:"hs-advisor-ladder-body",children:[e.jsx("strong",{children:t.modelLabel}),e.jsx("code",{children:A(t.route)}),e.jsx("small",{children:t.quotaRisk?`Exhaustion risk (${t.quota.minimumRemainingPercent}% remaining) · ${t.taskRationale}`:`Initial execution target · ${t.taskRationale}`})]})]}),t.alternatives.map((r,c)=>{const l=G(t,r);return e.jsxs("div",{className:`hs-advisor-ladder-node ${l?"hs-advisor-ladder-node--fallback-rec":""}`,children:[e.jsx("span",{className:"hs-advisor-ladder-badge",children:l?"⭐️ Quota-safe fallback":c===0?"Secondary":"Tertiary"}),e.jsxs("div",{className:"hs-advisor-ladder-body",children:[e.jsx("strong",{children:r.label}),e.jsx("code",{children:A(r.route)}),e.jsx("small",{children:l?`Moves work off ${t.quota.providerLabel} · ${r.taskRationale}`:r.quotaRisk?`Also quota constrained; use only if operationally necessary · ${r.taskRationale}`:`Fallback if ${t.modelLabel} encounters rate limits or errors · ${r.taskRationale}`})]})]},k(r.route))})]})]}),e.jsxs("section",{className:"hs-advisor-quota-secondary",children:[e.jsxs("div",{className:"hs-advisor-quota-secondary-head",children:[e.jsxs("h5",{children:["Provider Telemetry ",t.quotaRisk?"(Active Constraint)":"(Secondary)"]}),e.jsxs("span",{children:[t.quota.providerLabel,t.quota.plan?` · ${t.quota.plan}`:""]})]}),e.jsxs("div",{className:"hs-advisor-quota-compact-bar",children:[e.jsxs("span",{children:["Allowance: ",e.jsx("strong",{children:oe(t.quota)})]}),e.jsxs("span",{children:["Pacing: ",e.jsx("strong",{children:U(t.quota.pacing)})]}),e.jsxs("span",{children:["Telemetry: ",e.jsx("strong",{children:t.quota.confidence})]}),t.quota.nextResetIn?e.jsxs("span",{children:["Next reset: ",e.jsx("strong",{children:t.quota.nextResetIn})]}):null]}),t.quotaRisk?e.jsx("div",{style:{marginTop:"var(--space-sm)"},children:e.jsx(le,{providerLabel:t.quota.providerLabel,quota:t.quota})}):null]})]})]})}function is({models:s}){const n=s.find(r=>r.modelLabel==="GPT-5.6 Sol")??s[0],[a,t]=m.useState(()=>n?k(n.route):""),i=s.find(r=>k(r.route)===a)??n;if(!i)return null;const o=B(i.route);return e.jsxs("div",{className:"hs-model-guide-layout",children:[e.jsx("nav",{className:"hs-model-guide-list","aria-label":"Model Fleet",children:s.map(r=>{const c=k(r.route);return e.jsxs("button",{type:"button",className:"hs-model-guide-item","data-selected":c===k(i.route)?"true":void 0,"aria-pressed":c===k(i.route),onClick:()=>t(c),children:[e.jsx("span",{className:"hs-model-guide-mark",children:e.jsx(L,{harness:r.route.harness,size:23,title:null})}),e.jsxs("span",{className:"hs-model-guide-item-copy",children:[e.jsx("strong",{children:r.modelLabel}),e.jsxs("span",{children:[r.quota.providerLabel," · ",r.route.profile?`profile ${r.route.profile}`:r.route.harness]})]}),e.jsx("span",{className:`hs-advisor-role-tag ${r.quotaRisk?"hs-advisor-role-tag--risk":""}`,children:r.quotaRisk?"⚠️ Conserve":ts(r.guidance)})]},c)})}),e.jsxs("article",{className:"hs-model-guide-detail","aria-live":"polite",children:[e.jsxs("header",{className:"hs-advisor-detail-head",children:[e.jsxs("div",{className:"hs-advisor-model",children:[e.jsx(L,{harness:i.route.harness,size:25,title:null}),e.jsxs("div",{children:[e.jsxs("span",{children:[i.quota.providerLabel,i.quota.plan?` · ${i.quota.plan}`:""]}),e.jsx("h4",{children:i.modelLabel}),e.jsx("code",{children:A(i.route)})]})]}),e.jsx("span",{className:`hs-advisor-fit-badge ${i.quotaRisk?"hs-advisor-role-tag--risk":""}`,children:i.quotaRisk?"⚠️ Quota Risk · Conserve":i.roles.length>0?`${i.roles.length} Assigned Roles`:"Model Fleet"})]}),i.quotaRisk?e.jsx("div",{className:"hs-advisor-quota-alert",role:"alert",children:e.jsxs("div",{className:"hs-advisor-quota-alert-head",children:[e.jsx("span",{className:"hs-advisor-quota-alert-badge",children:"⚠️ Quota Risk"}),e.jsxs("div",{children:[e.jsx("strong",{children:"High Quota Depletion · Conserve Model"}),e.jsxs("p",{children:[i.quota.providerLabel," allowance is near capacity (",i.quota.minimumRemainingPercent,"% remaining). Conserve this model for essential high-fit tasks."]})]})]})}):null,e.jsxs("div",{className:"hs-model-guide-roles",children:[e.jsx("strong",{children:"Assigned task roles"}),e.jsx("div",{className:"hs-model-guide-role-chips",children:i.roles.map(r=>e.jsx("span",{className:"hs-model-guide-role-chip",children:r.label},r.role))})]}),e.jsxs("div",{className:"hs-advisor-assessment",children:[e.jsxs("section",{children:[e.jsx("h5",{children:"Strengths & Cognitive Profile"}),e.jsx("p",{children:i.strengths.join(" ")})]}),e.jsxs("section",{children:[e.jsx("h5",{children:"Watchouts & Guardrails"}),e.jsx("p",{children:i.cautions.join(" ")})]})]}),e.jsxs("section",{className:"hs-advisor-dispatch",children:[e.jsx("h5",{children:"Direct dispatch"}),e.jsxs("div",{className:"hs-advisor-dispatch-snippet",children:[e.jsx("code",{children:o}),e.jsx(z,{text:o,label:"Copy command"})]})]}),e.jsxs("section",{className:"hs-advisor-quota-secondary",children:[e.jsxs("div",{className:"hs-advisor-quota-secondary-head",children:[e.jsxs("h5",{children:["Provider Telemetry ",i.quotaRisk?"(Active Constraint)":"(Secondary)"]}),e.jsxs("span",{children:[i.quota.providerLabel,i.quota.plan?` · ${i.quota.plan}`:""]})]}),e.jsxs("div",{className:"hs-advisor-quota-compact-bar",children:[e.jsxs("span",{children:["Allowance: ",e.jsx("strong",{children:oe(i.quota)})]}),e.jsxs("span",{children:["Pacing: ",e.jsx("strong",{children:U(i.quota.pacing)})]}),e.jsxs("span",{children:["Telemetry: ",e.jsx("strong",{children:i.quota.confidence})]}),i.quota.nextResetIn?e.jsxs("span",{children:["Next reset: ",e.jsx("strong",{children:i.quota.nextResetIn})]}):null]}),i.quotaRisk?e.jsx("div",{style:{marginTop:"var(--space-sm)"},children:e.jsx(le,{providerLabel:i.quota.providerLabel,quota:i.quota})}):null]})]})]})}function rs({assignments:s}){const[n,a]=m.useState("implementation"),[t,i]=m.useState({}),o=s.find(d=>d.role===n)??s[0];if(!o)return null;const r=[{label:o.modelLabel,route:o.route,capability:o.capability,taskRationale:o.taskRationale,quota:o.quota,quotaRisk:o.quotaRisk},...o.alternatives.map(d=>({label:d.label,route:d.route,capability:d.capability,taskRationale:d.taskRationale,quota:d.quota,quotaRisk:d.quotaRisk}))],c=t[o.role],l=c?c.flatMap(d=>{const p=r.find(x=>k(x.route)===d);return p?[p]:[]}):r,h=d=>{const p=l.map(x=>k(x.route));i(x=>({...x,[o.role]:[d,...p.filter(v=>v!==d)]}))},u=B(l[0].route);return e.jsxs("div",{className:"hs-cascade-layout",children:[e.jsx("nav",{className:"hs-advisor-roles","aria-label":"Cascade roles",children:s.map(d=>e.jsx(ce,{assignment:d,selected:d.role===o.role,onSelect:()=>a(d.role)},d.role))}),e.jsxs("article",{className:"hs-cascade-editor",children:[e.jsxs("header",{children:[e.jsxs("div",{children:[e.jsxs("span",{children:[o.roleLabel," · Failover Hierarchy"]}),e.jsx("h4",{children:"Task Escalation Sequence"}),e.jsx("p",{children:"Hierarchical fallback sequence when models encounter rate limits, timeouts, or task complexity thresholds."})]}),c?e.jsx("button",{type:"button",onClick:()=>i(d=>{const p={...d};return delete p[o.role],p}),children:"Reset suggested order"}):e.jsx("span",{children:"Default policy"})]}),e.jsx("ol",{className:"hs-cascade-workflow",children:l.map((d,p)=>{const x=k(d.route),v=p>0&&G(l[0],d),f=p===0?"Primary Route":p===1?"Secondary Fallback":"Tertiary Fallback",g=p===0?d.quotaRisk?`Initial target (⚠️ Quota Risk: ${d.quota.minimumRemainingPercent}% remaining) · ${d.taskRationale}`:`Initial execution target · ${d.taskRationale}`:p===1?v?`⭐️ Quota-safe route off ${l[0].quota.providerLabel} · ${d.taskRationale}`:`Triggered if primary encounters rate limits, errors, or complexity threshold · ${d.taskRationale}`:`Emergency baseline fallback · ${d.taskRationale}`;return e.jsxs("li",{className:"hs-cascade-node",children:[e.jsx("span",{className:"hs-cascade-node-index",children:p+1}),e.jsxs("div",{className:"hs-cascade-node-main",children:[e.jsx("span",{children:f}),e.jsx("strong",{children:d.label}),e.jsx("code",{children:A(d.route)}),e.jsx("p",{children:d.capability}),e.jsx("small",{children:g})]}),e.jsxs("div",{className:"hs-cascade-node-side",children:[e.jsx("em",{className:d.quotaRisk?"hs-advisor-tone--warn":"",children:d.quota.minimumRemainingPercent===null?"quota unknown":`${d.quota.minimumRemainingPercent}% quota remaining`}),p>0?e.jsx("button",{type:"button",onClick:()=>h(x),children:"Make primary"}):null]})]},`${o.role}:${x}`)})}),e.jsxs("section",{className:"hs-advisor-dispatch",children:[e.jsx("h5",{children:"Primary dispatch command"}),e.jsxs("div",{className:"hs-advisor-dispatch-snippet",children:[e.jsx("code",{children:u}),e.jsx(z,{text:u,label:"Copy primary command"})]})]})]})]})}function os({map:s,loading:n,bias:a,onBiasChange:t}){const[i,o]=m.useState("tasks"),r={tasks:"Task-first model routing: Map each role to the optimal cognitive profile and failover ladder.",models:"Model fleet inventory: Inspect cognitive strengths, guardrails, and assigned roles across all models.",cascades:"Failover & escalation rules: Review and customize the task escalation sequence for each role."};return e.jsxs("section",{className:"hs-advisor","aria-labelledby":"hs-orchestrator-map-title","aria-busy":n,children:[e.jsxs("div",{className:"hs-section-head hs-advisor-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-orchestrator-map-title",children:"Orchestrator map"}),e.jsx("p",{children:r[i]})]}),e.jsxs("div",{className:"hs-advisor-head-tools",children:[e.jsx("span",{className:"hs-section-meta",children:n?"refreshing inputs":"advisory · no dispatch"}),e.jsxs("label",{className:"hs-routing-bias",children:[e.jsx("span",{children:"Routing bias"}),e.jsx("input",{type:"range",min:0,max:M.length-1,step:1,value:M.findIndex(c=>c.value===a),"aria-valuetext":M.find(c=>c.value===a)?.label,onChange:c=>{const l=M[Number(c.target.value)];l&&t(l.value)}}),e.jsx("small",{"aria-hidden":"true",children:M.map(c=>e.jsx("i",{"data-active":c.value===a?"true":void 0,children:c.label},c.value))})]})]})]}),e.jsx("div",{className:"hs-routing-angles",role:"group","aria-label":"Orchestrator map angle",children:[["tasks","Task map"],["models","Model fleet"],["cascades","Cascades"]].map(([c,l])=>e.jsx("button",{type:"button","aria-pressed":i===c,onClick:()=>o(c),children:l},c))}),i==="tasks"?e.jsx(ns,{map:s}):null,i==="models"?e.jsx(is,{models:s.models}):null,i==="cascades"?e.jsx(rs,{assignments:s.assignments}):null]})}function ls({rows:s,loading:n,onImported:a}){const t=ie.map(l=>({provider:l,row:s.find(h=>h.id===l.id)??null})),i=t.filter(({row:l})=>l?.gauge).length,o=t.filter(({row:l})=>l?.gauge?.kind==="quota").length,r=t.filter(({row:l})=>l?.gauge?.kind==="quota"&&l.gauge.plan||l?.gauge?.kind==="status").length,c=t.flatMap(({row:l})=>l?.gauge?.kind==="quota"?I(l.gauge):[]).map(l=>l.resetAt).filter(l=>l>Date.now()).sort((l,h)=>l-h)[0];return e.jsxs("section",{className:"hs-subscriptions","aria-labelledby":"hs-subscriptions-title","aria-busy":n,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:n?"—":i})," detected"]}),e.jsxs("span",{children:[e.jsx("strong",{children:n?"—":o})," usage feeds"]}),e.jsxs("span",{children:[e.jsx("strong",{children:n?"—":r})," plans named"]}),e.jsxs("span",{children:[e.jsx("strong",{children:n?"—":c?H(c):"-"})," next reset"]})]})]}),e.jsx("div",{className:"hs-subscription-grid",children:t.map(({provider:l,row:h})=>{const u=h?.gauge??null,d=n&&!u,p=d?"loading":u?"connected":"missing",x=u?.kind==="quota"?u.plan:u?.kind==="status"?u.statusLabel:null,v=Xe(u),f=u?.kind==="quota"?"Usage connected":u?.kind==="status"?u.detailLabel||"Subscription detected":d?"Checking":"Not detected";return e.jsxs("article",{className:`hs-subscription-card hs-subscription-card--${p}`,children:[e.jsxs("header",{className:"hs-subscription-card-head",children:[e.jsxs("div",{className:"hs-subscription-provider",children:[e.jsx(L,{harness:l.id,size:18,title:null,className:"hs-subscription-mark"}),e.jsxs("div",{children:[e.jsx("h4",{children:P(l.id)}),e.jsx("span",{children:d?"Checking local plan…":x||"Plan not reported"})]})]}),e.jsx("span",{className:`hs-subscription-state hs-subscription-state--${p}`,children:f})]}),e.jsx("p",{className:"hs-subscription-description",children:l.description}),d?e.jsx(ss,{}):u?.kind==="quota"?e.jsx("div",{className:"hs-subscription-windows",children:I(u).map(g=>e.jsx(es,{gauge:u,window:g},`${l.id}:${g.label}`))}):u?.kind==="status"?e.jsxs("div",{className:"hs-subscription-status-detail",children:[e.jsx("strong",{children:u.statusLabel}),e.jsx("span",{children:u.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."})]}),l.id==="cursor"||l.id==="grok"&&u?.kind!=="quota"?e.jsx(Ze,{provider:l.id,onImported:a}):null,e.jsxs("footer",{className:"hs-subscription-footer",children:[e.jsxs("span",{children:[d?"checking local feed":v?`updated ${J(v)||"now"}`:u?"detected locally":"waiting for provider data",u?.source?` · ${u.source}`:""]}),e.jsx("nav",{"aria-label":`${P(l.id)} quick links`,children:l.links.map(g=>e.jsxs("a",{href:g.href,target:"_blank",rel:"noreferrer",children:[g.label,e.jsx(Y,{size:11,"aria-hidden":"true"})]},g.href))})]})]},l.id)})})]})}function cs({accounts:s,loading:n}){return s.length===0&&!n?null:e.jsxs("section",{className:"hs-cloud-accounts","aria-labelledby":"hs-cloud-accounts-title","aria-busy":n,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:n?"checking accounts":`${s.length} connected`})]}),e.jsxs("div",{className:"hs-cloud-grid",children:[n&&s.length===0?Array.from({length:3},(a,t)=>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"})]})]},t)):null,s.map(a=>{const t=ze[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(Qe,{provider:a.id}),e.jsxs("div",{children:[e.jsx("span",{className:"hs-cloud-category",children:t.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:t.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:He[a.id].map(i=>e.jsxs("a",{href:i.href,target:"_blank",rel:"noreferrer",children:[i.label,e.jsx(Y,{size:11,"aria-hidden":"true"})]},i.href))})]})]},a.id)})]})]})}function ra({navigate:s}){const{route:n}=ge(),a=fe(n),[t]=m.useState(()=>me("/api/service-budgets",Ge)),[i,o]=m.useState(t?.gauges??[]),[r,c]=m.useState(t?.cloudAccounts??[]),[l,h]=m.useState("budget"),[u,d]=m.useState(()=>S(t?.generatedAt)??Date.now()),[p,x]=m.useState("balanced"),[v,f]=m.useState(t===null),[g,q]=m.useState(!1),[T,Q]=m.useState(null),_=m.useRef(0),W=m.useRef(t!==null),R=m.useCallback(async(y=!1,C=!1)=>{const E=++_.current;C&&!W.current&&f(!0),q(!0),Q(null);try{const w=await Z(`/api/service-budgets${y?"?refresh=1":""}`);if(E!==_.current)return;W.current=!0,o(w.gauges??[]),d(S(w.generatedAt)??Date.now()),c(w.cloudAccounts??[])}catch(w){E===_.current&&Q(w instanceof Error?w.message:String(w))}finally{E===_.current&&(f(!1),q(!1))}},[]);m.useEffect(()=>{let y=!1,C;return R(!1,!0).then(()=>{y||(C=window.setTimeout(()=>{R(!0)},600))}),()=>{y=!0,C!==void 0&&window.clearTimeout(C)}},[R]),m.useEffect(()=>{const y=window.setInterval(()=>{R(!1)},3e4);return()=>window.clearInterval(y)},[R]);const de=m.useMemo(()=>Je(i),[i]),ue=m.useMemo(()=>{const y=Date.now();return we(as(i,u,y),{now:y,bias:p})},[u,p,i]),he=xe();return e.jsxs("div",{className:"s-ops",children:[he?e.jsx("div",{className:"s-ops-header",children:e.jsx(be,{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:l==="budget"?"See what you pay for, how much remains, and where to use it.":"Map each kind of work to a model and provider route using live quota posture."})]}),e.jsxs("div",{className:"hs-page-actions",children:[e.jsxs("div",{className:"hs-view-switch",role:"group","aria-label":"Provider view",children:[e.jsx("button",{type:"button","aria-pressed":l==="budget",onClick:()=>h("budget"),children:"Budget"}),e.jsx("button",{type:"button","aria-pressed":l==="routing",onClick:()=>h("routing"),children:"Routing"})]}),e.jsxs("button",{type:"button",className:"hs-refresh",disabled:g,onClick:()=>{R(!0)},children:[e.jsx(ve,{size:14,className:g?"hs-refresh-icon-spinning":"","aria-hidden":"true"}),e.jsx("span",{children:g?"Refreshing":"Refresh"})]})]})]}),T&&e.jsxs("div",{className:"hs-error",role:"status","aria-live":"polite",children:["refresh: ",T]}),l==="budget"?e.jsxs("div",{id:"hs-budget-view",className:"hs-provider-view",children:[e.jsx(ls,{rows:de,loading:v,onImported:()=>R(!1)}),e.jsx(cs,{accounts:r,loading:v})]}):e.jsx("div",{id:"hs-routing-view",className:"hs-provider-view",children:e.jsx(os,{map:ue,loading:v,bias:p,onBiasChange:x})})]})})]})}export{ra as HarnessesScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,j as e}from"./index-BI9AljSD.js";/* empty css */import{a as $}from"./api-Co9aQ2Jw.js";import{d as Le}from"./time-Dhsh_2EG.js";import{u as Ae}from"./Provider-Bu-C8Hxc.js";import{t as qe,v as de,x as Ie,y as Te,z as De,A as he,K as f,B as Fe,C as be,D as Re,E as He,G as Me,H as me,I as pe,J as We,L as $e,M as Oe,N as Pe,O as _e,P as ze}from"./router-DTtux5sP.js";import{S as Ue}from"./search-DmFM_9jm.js";import{X as Be}from"./x-DfRJbqrh.js";import{L as fe}from"./loader-circle-B2W9DPG5.js";import{c as Ge}from"./createLucideIcon-DthwWQIg.js";import{S as Je}from"./sparkles-Cf8gin88.js";import{C as Xe}from"./chevron-down-C475vltS.js";import{C as Qe}from"./clock-DVvENUU5.js";import"./perf-PX8Rx0EP.js";import"./sse-DDHEHUgz.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./file-text--hfhwZH1.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-e6yGeorb.js";import"./NewChatComposer-C_1op4dH.js";import"./text-Faa3ZStB.js";import"./voice-levels-Dcr3jglk.js";import"./conversation-model-QsJVfSeG.js";import"./index-DfsTyYDx.js";import"./HarnessMark-DAaWPiT_.js";import"./NewChatOrigin-D7hwp6dm.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";const Ve=[["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"}]],Ye=Ge("funnel",Ve),Ze=5*6e4;function xe(t){return qe(t).toString()}let Q={status:null,results:[],lastFilterKey:"",facets:null,indexedAt:null};function ke(){return Q}function T(t){Q={...Q,...t}}function g(t){return new Intl.NumberFormat("en-US").format(t||0)}function es({text:t,query:a}){return e.jsx(e.Fragment,{children:_e(t,a).map((o,c)=>o.match?e.jsx("mark",{children:o.text},c):e.jsx("span",{children:o.text},c))})}function ss(t,a){t.target===t.currentTarget&&(t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),a()))}async function ts(){return $("/api/knowledge/status")}async function ns(t){const a=new URLSearchParams;for(const o of t)a.append("key",o);return a.set("limit","200"),$(`/api/knowledge/search-primitives?${a.toString()}`)}async function X(t,a){const o=new URLSearchParams({q:t,limit:String(f.hitLimit)});if(a.sourceKinds.length>0)for(const h of a.sourceKinds)o.append("sourceKind",h);for(const h of a.harness)o.append("harness",h);for(const h of a.project)o.append("project",h);const c=Pe(a.timeWindow);return c!=null&&o.set("updatedAfterMs",String(c)),$(`/api/knowledge/search?${o.toString()}`)}async function je(t=!1){return $("/api/knowledge/sessions/index",{method:"POST",body:JSON.stringify({days:f.days,limit:f.sessionLimit,force:t})})}const as=Re;function D({active:t,onClick:a,count:o,label:c,ariaLabel:h}){return e.jsxs("button",{type:"button",className:`ks-chip${t?" ks-chip--active":""}`,onClick:a,"aria-pressed":t,"aria-label":h??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:g(o)}):null]})}function Se(t){return t&&t.split(/[\s_-]+/u).filter(a=>a.length>0).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function ye(t,a,o=6){return t?t.filter(c=>c.key===a&&c.value.length>0).sort((c,h)=>h.count-c.count||c.value.localeCompare(h.value)).slice(0,o):[]}function ge(t){return t.sourceKinds.length>0||t.harness.length>0||t.project.length>0||t.timeWindow!=="all"}function is(t){const a=[];return t.sourceKinds.length>0&&a.push(t.sourceKinds.map(o=>be[o]??o).join(" + ")),t.harness.length>0&&a.push(t.harness.map(Se).join(" + ")),t.project.length>0&&a.push(t.project.join(" + ")),t.timeWindow!=="all"&&a.push(ze(t.timeWindow)),a.length>0?`Filters: ${a.join(" · ")}`:""}function Us({navigate:t,mode:a,hitId:o,routeFilters:c}){const{selectedKnowledgeHit:h,inspectKnowledgeHit:b,clearKnowledgeHit:w}=Ae(),V=l.useMemo(()=>c||(typeof window>"u"?de():Ie(window.location.search)),[c]),[S]=l.useState(()=>ke()),[K,F]=l.useState(S.status),[Y,Ne]=l.useState(S.facets),[i,O]=l.useState(V),[v,Z]=l.useState(()=>S.lastFilterKey&&S.lastFilterKey===xe(V)?S.results:[]),[P,ee]=l.useState(!1),[L,R]=l.useState(!1),[_,N]=l.useState(null),[we,H]=l.useState(S.status!==null),[se,te]=l.useState(S.facets!==null),A=l.useRef(i);A.current=i;const x=(K?.chunks??0)>0,M=K?.activeJobs[0]??null,C=l.useMemo(()=>Te(v),[v]),ne=L||!!M,q=i.query.trim(),z=De(i);l.useEffect(()=>{c&&O(s=>he(s,c)?s:c)},[c]);const k=l.useMemo(()=>{const s=[];for(const n of C)s.push(...n.moments);return s},[C]),E=l.useCallback((s,n)=>{Z(n.hits),F(n.status),T({results:n.hits,status:n.status,lastFilterKey:xe(s)});const d=(o?n.hits.find(u=>u.id===o):void 0)??n.hits[0];d?b(d,s.query,s):w()},[o,b,w]),U=l.useCallback(async s=>{const n=s.query.trim();if(!n){Z([]),w();return}ee(!0);try{N(null),E(s,await X(n,s))}catch(r){N(r instanceof Error?r.message:String(r))}finally{ee(!1)}},[E,w]),ae=l.useCallback(async(s=!1)=>{R(!0);try{N(null);const n=await je(s);F(n.status),H(!0),T({status:n.status,indexedAt:Date.now()});const r=A.current;n.status.chunks>0&&r.query.trim()&&E(r,await X(r.query.trim(),r))}catch(n){N(n instanceof Error?n.message:String(n))}finally{R(!1)}},[E]);l.useEffect(()=>{let s=!1;return(async()=>{let n=null;try{const u=await ts();if(s)return;n=u,F(u),H(!0),T({status:u}),N(null)}catch{}if(s)return;const{indexedAt:r}=ke();if(!(r!==null&&Date.now()-r<Ze&&(n?.chunks??0)>0)){R(!0);try{N(null);const u=await je(!1);if(s)return;F(u.status),H(!0),T({status:u.status,indexedAt:Date.now()});const m=A.current;u.status.chunks>0&&m.query.trim()&&E(m,await X(m.query.trim(),m))}catch(u){s||(N(u instanceof Error?u.message:String(u)),H(!0))}finally{s||R(!1)}}})(),()=>{s=!0}},[E]),l.useEffect(()=>{if(!x||se)return;let s=!1;return(async()=>{try{const n=await ns(["harness","project","sourceKind"]);s||(Ne(n),te(!0),T({facets:n}))}catch{s||te(!0)}})(),()=>{s=!0}},[x,se]),l.useEffect(()=>{if(!x)return;const s=window.setTimeout(()=>{U(i)},f.debounceMs);return()=>window.clearTimeout(s)},[i,x,U]);const ve=s=>{if(s.preventDefault(),!x&&!L){ae(!1);return}U(i)},y=l.useCallback(s=>{O(n=>{const r={...n,...s};return he(n,r)?n:(t({view:"search",...a?{mode:a}:{},filters:r},{replace:!0}),r)})},[a,t]),I=l.useCallback(()=>{const s=de();O(s),t({view:"search",...a?{mode:a}:{},filters:s},{replace:!0})},[a,t]),Ce=l.useCallback(()=>{k[0]&&b(k[0],A.current.query)},[k,b]);l.useEffect(()=>{function s(n){const r=n.target,d=r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable);if(n.key==="/"&&!d){n.preventDefault();const u=document.querySelector(".ks-search-input");u?.focus(),u?.select()}else if(n.key==="Escape"&&!d)k.length>0?w():I();else if(!d&&(n.key==="j"||n.key==="k")){if(k.length===0)return;n.preventDefault();const u=h?k.findIndex(B=>B.id===h.id):-1,m=n.key==="j"?Math.min(k.length-1,u+1):Math.max(0,u-1),W=k[m];W&&b(W,A.current.query)}}return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[k,b,w,h,I]);const Ee=K?Le(K.generatedAt)||"just now":"—",Ke=ne?M?`Indexing ${g(M.progress.indexed??0)} of ${g(M.progress.discovered??0)}`:x?`Refreshing last ${f.days} days in the background`:`Building last ${f.days} days of sessions`:x?`${g(K?.chunks??0)} moments · last ${f.days} days · updated ${Ee}`:we?"No index yet":"Loading index",ie=ye(Y?.facets,"harness"),re=ye(Y?.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 ",f.days," days."]})]})}),e.jsxs("form",{className:"ks-search-form",onSubmit:ve,role:"search",children:[e.jsx(Ue,{size:17,strokeWidth:1.75,"aria-hidden":"true"}),e.jsx("input",{value:i.query,onChange:s=>y({query:s.target.value}),placeholder:"Search topics, files, decisions, agents…",className:"ks-search-input",spellCheck:!1,autoFocus:!0,"aria-label":"Search OpenScout knowledge"}),i.query?e.jsx("button",{type:"button",className:"ks-search-clear",onClick:()=>y({query:""}),"aria-label":"Clear search",children:e.jsx(Be,{size:14,"aria-hidden":"true"})}):e.jsx("span",{className:"ks-search-hint","aria-hidden":"true",children:"/"}),P?e.jsx(fe,{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(Ye,{size:12,"aria-hidden":"true"}),"Source"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Source kind filters",children:Fe.map(s=>e.jsx(D,{active:i.sourceKinds.includes(s),onClick:()=>y({sourceKinds:i.sourceKinds.includes(s)?i.sourceKinds.filter(n=>n!==s):[...i.sourceKinds,s]}),label:be[s]??s},s))})]}),ie.length>0?e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Je,{size:12,"aria-hidden":"true"}),"Agent"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Harness filters",children:ie.map(s=>e.jsx(D,{active:i.harness.includes(s.value),onClick:()=>y({harness:i.harness.includes(s.value)?i.harness.filter(n=>n!==s.value):[...i.harness,s.value]}),label:Se(s.value),count:s.count},`harness:${s.value}`))})]}):null,re.length>0?e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Xe,{size:12,"aria-hidden":"true"}),"Project"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Project filters",children:re.map(s=>e.jsx(D,{active:i.project.includes(s.value),onClick:()=>y({project:i.project.includes(s.value)?i.project.filter(n=>n!==s.value):[...i.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(Qe,{size:12,"aria-hidden":"true"}),"Time"]}),e.jsxs("div",{className:"ks-chip-row",role:"group","aria-label":"Time window filter",children:[e.jsx(D,{active:i.timeWindow==="all",onClick:()=>y({timeWindow:"all"}),label:"Any time"}),as.map(s=>e.jsx(D,{active:i.timeWindow===s.value,onClick:()=>y({timeWindow:s.value}),label:s.label},s.value))]}),ge(i)?e.jsx("button",{type:"button",className:"ks-clear-all",onClick:I,children:"Clear filters"}):null]})]}),_?e.jsx("section",{className:"ks-error",role:"alert",children:_}):null,!x&&!_?e.jsxs("div",{className:"ks-empty-state",children:[e.jsx("strong",{children:L?"Preparing your session index":"Preparing search"}),e.jsxs("span",{children:["First load builds the last ",f.days," days"," ","(up to ",g(f.sessionLimit)," sessions). You can keep this page open — results appear as soon as the index is ready."]})]}):null,x?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:P?"Searching…":q?`${g(C.length)} session${C.length===1?"":"s"}`:"Ready"}),q&&v.length>0?e.jsxs("span",{className:"ks-hit-list-meta",children:[g(v.length)," moment",v.length===1?"":"s",z?e.jsxs(e.Fragment,{children:[" · ",e.jsx("button",{type:"button",className:"ks-text-action",onClick:I,children:"Clear filters"})]}):null]}):null]}),q&&C.length===0&&!P?e.jsxs("div",{className:"ks-empty-hit",children:[e.jsxs("strong",{children:["No matches for “",q,"”"]}),e.jsxs("span",{children:["Try a project name, file path, or topic from recent work",z?", 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:()=>y({query:""}),children:"Clear query"}),z?e.jsx("button",{type:"button",className:"ks-text-action",onClick:I,children:"Clear all filters"}):null]})]}):null,q?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:Ce,disabled:v.length===0,children:"Pick the first result automatically"})]}),e.jsx("div",{className:"ks-hit-list-body",children:C.map((s,n)=>{const r=s.best,d=He(r),u=Me(r),m=me(pe(r)),W=()=>{m&&t({view:"sessions",sessionId:m})},B=s.moments.some(j=>h?.id===j.id);return e.jsxs("section",{className:`ks-session${B?" ks-session--selected":""}`,"aria-label":`Session ${n+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:m??d.session,children:["session ",d.session]}):null,e.jsxs("span",{className:"ks-session-count",children:[g(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:W,title:m?"Open session":void 0,children:u})]}),e.jsx("div",{className:"ks-session-moments",children:s.moments.map(j=>{const le=We(j,i.query),oe=h?.id===j.id,G=$e(j,i.query,200),ce=Oe(j),J=()=>b(j,i.query),ue=()=>{const p=me(pe(j))??m;if(!p){J();return}t({view:"sessions",sessionId:p})};return e.jsx("article",{className:`ks-hit${oe?" ks-hit--selected":""}`,role:"option","aria-selected":oe,tabIndex:0,onClick:J,onDoubleClick:ue,onKeyDown:p=>{if(p.key==="Enter"&&(p.metaKey||p.ctrlKey)){p.preventDefault(),ue();return}ss(p,J)},children:e.jsxs("div",{className:"ks-hit-body",children:[ce.length>0?e.jsx("div",{className:"ks-hit-details ks-hit-details--moment","aria-label":"Turn",children:ce.map(p=>e.jsx("span",{className:"ks-hit-details-strong",children:p},p))}):null,e.jsx("h3",{className:"ks-hit-title",children:le}),G&&G!==le?e.jsx("p",{className:"ks-hit-snippet",children:e.jsx(es,{text:G,query:i.query})}):null]})},j.id)})})]},s.collectionId)})})]}):null]}),e.jsxs("footer",{className:"ks-foot-status","aria-live":"polite",children:[e.jsxs("span",{className:"ks-foot-status-facts",children:[ne?e.jsx(fe,{size:12,className:"ks-spin","aria-hidden":"true"}):null,Ke,ge(i)?e.jsxs(e.Fragment,{children:[" · ",is(i)]}):null]}),e.jsx("button",{type:"button",className:"ks-text-action",onClick:()=>{ae(!0)},disabled:L,children:L?"Updating…":"Update index"})]})]})}export{Us as KnowledgeSearchScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as f,j as e}from"./index-BI9AljSD.js";import{S as L}from"./SlidePanel-BMRIR6bH.js";import{A as j}from"./AgentAvatar-B7c0egdP.js";import{H as S}from"./HarnessMark-DAaWPiT_.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-BCehTlO8.js";import{LaneTraceEventFocus as E}from"./LaneTraceEventFocus-Cek_64zR.js";import{b as T}from"./agent-lane-detail-ppJId6Jc.js";import{l as I,a as z}from"./agent-lanes-model-DXqjs0OK.js";import"./Provider-Bu-C8Hxc.js";import"./router-DTtux5sP.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./api-Co9aQ2Jw.js";import"./sse-DDHEHUgz.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./createLucideIcon-DthwWQIg.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./file-text--hfhwZH1.js";import"./x-DfRJbqrh.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-e6yGeorb.js";import"./NewChatComposer-C_1op4dH.js";import"./text-Faa3ZStB.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./conversation-model-QsJVfSeG.js";import"./index-DfsTyYDx.js";import"./NewChatOrigin-D7hwp6dm.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./SpriteAvatar-56DTXxSV.js";import"./CrewAvatar-CXJHLNVM.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-Bo2Zl-1a.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-DuLQnEcn.js";import"./AgentDetailCard-B_KLcgsP.js";import"./AgentLiveActions-CsQA3pu_.js";import"./terminal-takeover-B6H4llRR.js";import"./openContent-C6XO6kr5.js";import"./eye-FnaaPfja.js";import"./terminal-C3YRPfyz.js";import"./message-markup-Cc_O-WdA.js";import"./ObservedTopologyPanel-BhVsvwkh.js";import"./ObserveTextFlow-BcrGQet8.js";import"./use-reduced-motion-8WuxLa5l.js";import"./proxy-1BABCaDb.js";import"./SessionObserveEvidence-Bb6U-dem.js";import"./message-circle-B2DoYKDO.js";import"./wrench-DkxnZRlR.js";import"./external-link-C_nxk0MJ.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 m,j as e}from"./index-BI9AljSD.js";import{a as D}from"./api-Co9aQ2Jw.js";import{t as A}from"./time-Dhsh_2EG.js";import{n as _,b as z,s as F,c as H}from"./colors-BtO5_zlx.js";import{u as O,d as K}from"./Provider-Bu-C8Hxc.js";import{f as U}from"./mesh-roster-Bc7T4b7z.js";import{b as V}from"./router-DTtux5sP.js";import{MeshCanvas as Q}from"./MeshCanvas-TvsID4fe.js";import{u as J}from"./useAgentHoverCard-Bkv-Uz_V.js";import{u as W}from"./local-agents-DKr-gIDC.js";import{u as X,c as Y,s as Z,e as E,f as I,g as G,h as L}from"./mesh-view-store-CiET-yN8.js";import{u as ee}from"./useContentSecondaryNav-Bpkc8ayb.js";import{OpsSubnav as se}from"./OpsSubnav-BEU4kKXm.js";/* empty css *//* empty css */import"./perf-PX8Rx0EP.js";import"./sse-DDHEHUgz.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./createLucideIcon-DthwWQIg.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./file-text--hfhwZH1.js";import"./x-DfRJbqrh.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-e6yGeorb.js";import"./NewChatComposer-C_1op4dH.js";import"./text-Faa3ZStB.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./conversation-model-QsJVfSeG.js";import"./index-DfsTyYDx.js";import"./HarnessMark-DAaWPiT_.js";import"./NewChatOrigin-D7hwp6dm.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./chunk-T65CQEWV-BtNvicWs.js";import"./plus-BJ1If8vj.js";import"./mesh-buckets-6y3ZIibI.js";import"./AgentDetailCard-B_KLcgsP.js";import"./AgentLiveActions-CsQA3pu_.js";import"./terminal-takeover-B6H4llRR.js";import"./openContent-C6XO6kr5.js";import"./eye-FnaaPfja.js";import"./terminal-C3YRPfyz.js";import"./SecondaryNav-BrXMtvKE.js";import"./secondaryNavConfig-C9bQ9_IA.js";import"./message-square-O-Hu9Mk2.js";import"./compass-BcRI_YXo.js";import"./settings-C6h9y5XX.js";import"./git-branch-DJyvr0k-.js";import"./scroll-text-kPhYbh-M.js";/* empty css */function te(c){const p=new Map,f=new Map;for(const a of c){const o=a.project??"Unassigned",i=o.toLowerCase(),h=a.branch??"—";let r=p.get(i);r||(r=new Map,p.set(i,r));const u=r.get(h)??[];u.push(a),r.set(h,u);let s=f.get(i);s||(s=new Map,f.set(i,s)),s.set(o,(s.get(o)??0)+1)}const g=a=>{const o=f.get(a);if(!o)return a;let i=null,h=-1;for(const[r,u]of o)u>h&&(i=r,h=u);return i??a},j=[];for(const[a,o]of p){const i=g(a),h=[];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((d,x)=>(x.updatedAt??0)-(d.updatedAt??0)),v=t.reduce((d,x)=>Math.max(d,x.updatedAt??0),0);r=Math.max(r,v);for(const d of t)u[_(d.state)]+=1,s.push(d);h.push({branch:l,agents:t,latest:v})}h.sort((l,n)=>n.latest-l.latest),j.push({project:i,branches:h,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 ne({agents:c,emptyTitle:p="No agents registered",emptyBody:f="Agents connected to this broker will appear here.",selectMode:g="preview"}){const{navigate:j}=O(),a=m.useMemo(()=>te(c),[c]),[o,i]=m.useState(()=>new Set),h=m.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=J({agents:c,orderedIds:h,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:f})]});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 v=_(t.state),d=z(t.state),x=t.agentClass==="organic",y=r.getState(t.id),M=T(t.cwd)??T(t.projectRoot),k=t.harnessSessionId?t.harnessSessionId.slice(0,8):null,b=[];M&&b.push({kind:"cwd",text:M}),t.harness&&b.push({kind:"harness",text:t.harness}),t.model&&b.push({kind:"model",text:t.model}),k&&b.push({kind:"sess",text:`sess:${k}`});const $=r.bind(t.id);return e.jsxs("button",{type:"button",className:`mesh-tree-agent${x?" mesh-tree-agent--organic":""}${y.isActive?" mesh-tree-agent--active":""}${y.isPinned?" mesh-tree-agent--pinned":""}`,title:x?`${t.harness??t.name} · organic session`:void 0,...$,children:[e.jsx("span",{className:`mesh-tree-agent-dot mesh-tree-agent-dot--${d}`,style:{background:F(t.state)}}),e.jsx("span",{className:"mesh-tree-agent-name",children:t.handle??t.name}),x&&e.jsx("span",{className:"mesh-tree-agent-organic","aria-label":"organic session",children:"○"}),e.jsx("span",{className:"mesh-tree-agent-inline",children:b.map((C,R)=>e.jsxs("span",{className:`mesh-tree-agent-inline-part mesh-tree-agent-inline-part--${C.kind}`,children:[R>0&&e.jsx("span",{className:"mesh-tree-agent-inline-sep",children:"·"}),C.text]},C.kind))}),e.jsx("span",{className:`mesh-tree-agent-state mesh-tree-agent-state--${d}`,children:H(v)}),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:f,stateFilter:g,loading:j,refreshing:a,error:o,lastLoadedAt:i,hasMesh:h,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"})]})]}),h&&e.jsxs("div",{className:"mesh-hud-filters",children:[e.jsx("input",{type:"search",className:"mesh-hud-search",placeholder:"Filter agents…",value:f,onChange:u=>G(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&&h?`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 ds({navigate:c}){const[p,f]=m.useState(!0),[g,j]=m.useState(!1),[a,o]=m.useState(null),[i,h]=m.useState(null),{mode:r,density:u,query:s,stateFilter:l,meshSnapshot:n}=X(),{agents:t}=W(),{route:v}=O(),d=V(v),x=m.useMemo(()=>U(t),[t]),y=m.useMemo(()=>K(x,d,n?.localNode?.id),[x,d,n?.localNode?.id]),M=m.useRef(null),k=m.useRef(0);m.useEffect(()=>{M.current=n},[n]),m.useEffect(()=>{d&&Y(d,"node")},[d]);const b=m.useCallback(async(S="initial")=>{const N=++k.current;!(M.current!==null)&&S!=="background"?(f(!0),o(null)):j(!0);try{const w=await D("/api/mesh");if(N!==k.current)return;Z(w),o(null),h(Date.now())}catch(w){if(N!==k.current)return;o(w instanceof Error?w.message:String(w))}finally{N===k.current&&(f(!1),j(!1))}},[]);m.useEffect(()=>{b("initial")},[b]),m.useEffect(()=>{const S=setInterval(()=>{b("background")},1e4);return()=>clearInterval(S)},[b]);const $=m.useMemo(()=>{const S=s.trim().toLowerCase();return y.filter(N=>l!=="all"&&_(N.state)!==l?!1:S?`${N.name??""} ${N.handle??""} ${N.harness??""} ${N.project??""} ${N.branch??""}`.toLowerCase().includes(S):!0)},[s,y,l]),C={mode:r,density:u,query:s,stateFilter:l,loading:p,refreshing:g,error:a,lastLoadedAt:i,hasMesh:!!n,onRefresh:()=>{b("manual")}},R=r==="map"?e.jsxs("div",{className:"mesh-map-canvas",children:[n&&e.jsx(Q,{mesh:n,agents:$}),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:()=>{b("manual")},children:"Try again"})]}),e.jsx(P,{...C})]}):e.jsxs("div",{className:"mesh-tree-page",children:[e.jsx(P,{...C}),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:()=>{b("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(ne,{agents:$,emptyTitle:y.length===0?d?"No agents on this machine":"No agents registered":"No agents match your filter",emptyBody:y.length===0?"Agents connected to this broker will appear here.":"Try clearing the search or switching the state pill back to All."})]})]}),q=ee();return e.jsxs("div",{className:"s-ops",children:[q?e.jsx("div",{className:"s-ops-header",children:e.jsx(se,{activeRoute:v,navigate:c})}):null,e.jsx("div",{className:"s-ops-body",children:R})]})}export{ds as MeshScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as a}from"./index-BI9AljSD.js";import{i as w,a as C}from"./conversation-model-QsJVfSeG.js";import{u as S,m as M,e as b}from"./Provider-Bu-C8Hxc.js";import{u as A,f as E}from"./use-fleet-active-asks-BtgNnRgK.js";import{b as L}from"./router-DTtux5sP.js";import{l as B,i as R,s as D}from"./sessionRead-CvFz2RHv.js";import{u as F}from"./use-conversation-list-DO5J8T1H.js";import{AgentMasterScreen as O}from"./AgentMasterScreen-C5WlWNmk.js";import{ConversationScreen as P}from"./ConversationScreen-CXAHQwQ3.js";import{P as V}from"./plus-BJ1If8vj.js";import"./createLucideIcon-DthwWQIg.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./sse-DDHEHUgz.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./file-text--hfhwZH1.js";import"./x-DfRJbqrh.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-e6yGeorb.js";import"./NewChatComposer-C_1op4dH.js";import"./text-Faa3ZStB.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./index-DfsTyYDx.js";import"./HarnessMark-DAaWPiT_.js";import"./NewChatOrigin-D7hwp6dm.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./AgentAvatar-B7c0egdP.js";import"./SpriteAvatar-56DTXxSV.js";import"./CrewAvatar-CXJHLNVM.js";import"./agent-master-model-DAZL92oe.js";import"./message-visibility-CGOmSSKs.js";/* empty css */import"./arrow-up-right-CY0Vw_67.js";import"./ConversationComposer-H8_hsYSc.js";import"./zap-CIo8msJB.js";import"./message-markup-Cc_O-WdA.js";import"./mentions-DuLQnEcn.js";import"./AgentDetailCard-B_KLcgsP.js";import"./AgentLiveActions-CsQA3pu_.js";import"./terminal-takeover-B6H4llRR.js";import"./openContent-C6XO6kr5.js";import"./eye-FnaaPfja.js";import"./terminal-C3YRPfyz.js";import"./operator-attention-RqieiSY8.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-B0ZBhE_E.js";import"./BackToPicker-Cto0Ioz9.js";import"./AstronautSuit-Cjjcv6yQ.js";import"./ConversationFeedRows-hlEFlURs.js";import"./ConversationPanels-fMo6Uy1v.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-8WuxLa5l.js";import"./proxy-1BABCaDb.js";import"./activity-CqZafWfx.js";import"./message-circle-B2DoYKDO.js";import"./tail-events-BdUrO0kb.js";import"./ConversationStatus-DI5GCiyW.js";import"./check-DbIkldnK.js";import"./sparkles-Cf8gin88.js";function ds({conversationId:s,agentId:c,threadId:l,machineId:d,navigate:m}){return c?e.jsx(O,{agentId:c,threadId:l,machineId:d,navigate:m}):s?e.jsx(P,{conversationId:s,navigate:m,showBackNav:!1},s):e.jsx($,{})}function $(){const{onlineCount:s,apiConnection:c,reload:l,route:d,agents:m,openContextCapture:k,navigate:x}=S(),{sessions:v,loading:u,loadError:o}=F(),[f]=a.useState(()=>B()),h=A(),t=c.status==="offline",r=L(d),j=a.useRef(!1),N=a.useMemo(()=>{const p=M(m,r);return[...b(v,p,r)].sort((g,i)=>(i.lastMessageAt??0)-(g.lastMessageAt??0))},[v,m,r]),n=a.useMemo(()=>{const p=N.filter(i=>!w(i));return p.find(i=>E(h,i)?.status==="needs_attention"&&R(i.lastMessageAt,i.id,f))??p[0]},[N,h,f]);a.useEffect(()=>{j.current||u||o||t||n&&(j.current=!0,D(n.id),x({view:"messages",conversationId:n.id,...r?{machineId:r}:{}},{replace:!0}))},[n,u,o,t,r,x]);const y=!t&&!o&&(u||!!n);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(T,{}),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":y?"Opening your latest conversation":o?"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.":y?I(n):o||"Start a chat by choosing an agent and sending the first message."}),t||o?e.jsx("button",{type:"button",className:"s-conv-empty-action",onClick:()=>{l()},children:"Retry connection"}):y?null:e.jsxs("button",{type:"button",className:"s-conv-empty-new",onClick:()=>k(),children:[e.jsx(V,{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 I(s){return s?C(s):"Finding where you left off."}function T(){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{ds as MessagesScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as a}from"./index-BI9AljSD.js";/* empty css */import{a as K}from"./api-Co9aQ2Jw.js";import{u as Ae,f as Re,g as ge,t as U,h as b,e as ue}from"./mission-control-store-DDAgWKUl.js";import{u as be}from"./observe-Da2mRAsc.js";import{h as me}from"./NewChatComposer-C_1op4dH.js";import{i as Ee,c as je}from"./keyboard-nav-e6yGeorb.js";import{g as Me}from"./tail-display-DcliDVkW.js";import{u as Le}from"./tail-events-BdUrO0kb.js";import{u as Te}from"./Provider-Bu-C8Hxc.js";import{MissionContextRail as ke}from"./MissionContextRail-Be0uXljQ.js";import{FocusOverlay as Ne}from"./MissionFocusOverlay-DvTw6ts5.js";import{MissionLogPane as Ce}from"./MissionLogPane-EsM_S3ro.js";import{o as Fe}from"./agent-lanes-model-DXqjs0OK.js";import{A as Oe}from"./mission-control-model-C0fByIjm.js";import{b as Pe,s as _e,f as De,c as We,n as $e,d as Ke,m as Ve,W as qe}from"./mission-wall-CocIM1cF.js";import"./perf-PX8Rx0EP.js";import"./colors-BtO5_zlx.js";import"./surface-activity-B1rgWB1i.js";import"./text-Faa3ZStB.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./createLucideIcon-DthwWQIg.js";import"./conversation-model-QsJVfSeG.js";import"./time-Dhsh_2EG.js";import"./index-DfsTyYDx.js";import"./HarnessMark-DAaWPiT_.js";import"./NewChatOrigin-D7hwp6dm.js";import"./x-DfRJbqrh.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./file-text--hfhwZH1.js";import"./lane-edit-display-C_Aujldz.js";import"./index-BWHgHrtv.js";import"./router-DTtux5sP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./sse-DDHEHUgz.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./bash-format-BRV5C6Gv.js";import"./context-budget-DX_fwUs3.js";import"./page-status-Crtgjbq3.js";import"./agent-lane-detail-ppJId6Jc.js";import"./lane-observe-vfyACHi0.js";import"./agent-lane-preview-BhplDYGf.js";import"./lane-ask-display-B6iCAVcd.js";function He(t,o,r,c){if(o<=0)return-1;const d=o-1,x=Math.max(1,Math.floor(r));if(t<0||t>d)return c==="left"||c==="up"||c==="last"?d:0;switch(c){case"first":return 0;case"last":return d;case"left":return Math.max(0,t-1);case"right":return Math.min(d,t+1);case"up":{const v=t-x;return v>=0?v:t}case"down":{const v=t+x;return v<=d?v:d}}}function Be(t){switch(t){case"h":case"ArrowLeft":return"left";case"l":case"ArrowRight":return"right";case"k":case"ArrowUp":return"up";case"j":case"ArrowDown":return"down";case"g":case"Home":return"first";case"G":case"End":return"last";default:return null}}const $=4e3,Qe=250,ze=3e4,Ue=1500,Ge=1800;function Je(t,o){return t.map(r=>({id:r.id,name:r.name,handle:r.handle,state:r.state,project:r.project,branch:r.branch,harness:r.harness,model:r.model,sessionIds:o.get(r.id)??[]}))}function Ye(t){return{id:`native:${t.source}:${t.sessionId}`,definitionId:`native:${t.source}:${t.sessionId}`,name:`${t.source} · ${t.project}`,handle:t.sessionId.slice(0,8),agentClass:"native-session",harness:t.source,state:t.live?"working":"ready",projectRoot:t.cwd,cwd:t.cwd,updatedAt:t.lastActiveAt,createdAt:null,transport:"tail",selector:null,defaultSelector:null,nodeQualifier:null,workspaceQualifier:null,wakePolicy:null,capabilities:[],project:t.project,branch:t.attribution==="unattributed"?"native session":t.attribution,role:"native session",model:null,harnessSessionId:t.sessionId,terminalSurface:null,harnessLogPath:t.logPath,conversationId:null,homeNodeId:null,homeNodeName:null,ownerId:null,ownerName:null,ownerHandle:null,staleLocalRegistration:!1,retiredFromFleet:!1,replacedByAgentId:null}}function fe(t){return t.agentClass==="native-session"||t.id.startsWith("native:")}function de(t,o){if(t.agent){const r=o.find(c=>c.id===t.agent.id);if(r)return r}return Ye(t)}function Xe(t,o){const r=o.find(c=>c.sessionId?.trim()===t.sessionId);return r||{source:t.source,transcriptPath:t.logPath??"",sessionId:t.sessionId,cwd:t.cwd,project:t.project,harness:t.attribution,mtimeMs:t.lastActiveAt,size:0}}function Ze(t,o){const r=t.harnessSessionId?.trim();if(!r)throw new Error("This native session has no session id to continue.");const c=t.projectRoot?.trim()||t.cwd?.trim();if(!c)throw new Error("This native session has no project path to route from.");const d=t.harness?.trim(),x=t.model?.trim();return{target:{projectPath:c},execution:{session:"existing",targetSessionId:r,...d?{harness:d}:{},...x?{model:x}:{}},agent:{persistence:"one_time",...t.handle?.trim()?{handle:t.handle.trim()}:{}},seed:{instructions:o}}}async function et(t,o){if(fe(t)){await K("/api/sessions",{method:"POST",body:JSON.stringify(Ze(t,o))});return}const r=await me(t);await K("/api/send",{method:"POST",body:JSON.stringify({body:o,chatId:r,execution:{...t.harness?.trim()?{harness:t.harness.trim()}:{},...t.model?.trim()?{model:t.model.trim()}:{}}})})}function tt(t,o,r){return t.live?"active":t.lastActiveAt>0&&o-t.lastActiveAt<=r?"recent":"idle"}function rs({navigate:t,agents:o}){const r=Ae(),{openFilePreview:c}=Te(),{activityFilter:d,sourceFilter:x,activityWindowMs:v,groupMode:G,query:J,focusedId:F,revealRequest:A}=r,[Y,X]=n.useState([]),[O,pe]=n.useState(null),[y,he]=n.useState(()=>Date.now()),T=be(o),P=n.useRef([]);Le(e=>{P.current.push(e)}),n.useEffect(()=>{const e=setInterval(()=>{if(P.current.length===0)return;const s=P.current;P.current=[],X(i=>{const p=new Set(i.map(w=>w.id)),u=s.filter(w=>!w.id||!p.has(w.id));if(u.length===0)return i;const h=i.concat(u);return h.length>$?h.slice(h.length-$):h})},Qe);return()=>clearInterval(e)},[]),n.useEffect(()=>{const e=setInterval(()=>he(Date.now()),1e4);return()=>clearInterval(e)},[]),n.useEffect(()=>{let e=!1;return K(`/api/tail/recent?limit=${Ue}`).then(s=>{if(e)return;const i=s.events??[];X(p=>{const u=new Set(p.map(w=>w.id)),h=i.filter(w=>!u.has(w.id)).concat(p);return h.length>$?h.slice(h.length-$):h})}).catch(()=>{}),()=>{e=!0}},[]),n.useEffect(()=>{let e=!1;const s=async()=>{try{const p=await K("/api/tail/discover");e||pe(p)}catch{}};s();const i=setInterval(()=>{s()},ze);return()=>{e=!0,clearInterval(i)}},[]);const Z=n.useMemo(()=>{const e=new Map;for(const s of o){const i=T[s.id],p=[s.harnessSessionId,i?.sessionId,i?.data.metadata?.session?.externalSessionId].map(u=>u?.trim()).filter(u=>!!u);e.set(s.id,[...new Set(p)])}return e},[o,T]),R=n.useMemo(()=>Pe({events:Me(Y),transcripts:O?.transcripts??[],agents:Je(o,Z),now:y,liveWindowMs:Oe}),[o,O?.transcripts,y,Z,Y]),[g,V]=n.useState(null),I=n.useMemo(()=>{const e=_e(De(R,{sourceFilter:x,activityFilter:d,query:J,now:y,activeWindowMs:v}),G);if(!g)return e;const s=e.find(i=>i.id===g);return s?[s,...e.filter(i=>i.id!==g)]:e},[d,v,G,R,y,g,J,x]),ee=n.useRef(null),q=n.useRef({w:0,h:0}),te=n.useRef(0);te.current=I.length;const[m,ve]=n.useState(()=>We(0,{w:0,h:0})),H=n.useRef(m),_=n.useCallback((e,s)=>{const i=$e(H.current,e,s);i!==H.current&&(H.current=i,ve(i))},[]);n.useEffect(()=>{const e=ee.current;if(!e)return;const s=new ResizeObserver(([i])=>{q.current={w:i.contentRect.width,h:i.contentRect.height},_(te.current,q.current)});return s.observe(e),()=>s.disconnect()},[_]),n.useLayoutEffect(()=>{_(I.length,q.current)},[I.length,_]);const E=n.useMemo(()=>I.slice(0,m.shown),[I,m.shown]),se=n.useRef(1);se.current=Math.max(1,m.cols),n.useEffect(()=>{Re(I.map(e=>({id:e.id,name:e.agent?.name??Ve(e),handle:e.agent?.handle??Ke(e),harness:e.source,branch:e.agent?.branch??null,project:e.project,model:e.agent?.model??null,state:e.agent?.state??null,agentClass:e.agent?"agent":"native-session",updatedAt:e.lastActiveAt,source:e.agent||e.attribution==="scout-managed"?"scout":"native",activity:tt(e,y,v),lastActiveAt:e.lastActiveAt})))},[v,y,I]);const[we,ne]=n.useState(null),re=n.useRef(null),k=n.useRef(null);n.useEffect(()=>{A&&re.current!==A.serial&&(re.current=A.serial,V(A.id),ne(A.id),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>ne(null),Ge),ge(A.serial))},[A]),n.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]);const N=F?R.find(e=>e.id===F)??null:null,f=n.useMemo(()=>N?de(N,o):null,[o,N]),Ie=N?.agent?T[N.agent.id]?.data??null:null,[S,C]=n.useState(null),[j,D]=n.useState(!1),xe=S?E.findIndex(e=>e.id===S):-1,ie=n.useRef({index:-1,ids:[]});ie.current={index:xe,ids:E.map(e=>e.id)};const B=S?R.find(e=>e.id===S)??null:null,l=j?B:null;n.useEffect(()=>{j&&!B&&D(!1)},[B,j]);const Q=n.useRef(new Map),ye=n.useCallback((e,s)=>{s?Q.current.set(e,s):Q.current.delete(e)},[]);n.useEffect(()=>{S&&Q.current.get(S)?.focus({preventScroll:!0})},[S]);const oe=n.useMemo(()=>{if(!l)return null;const e=de(l,o),s=(l.agent?T[l.agent.id]?.data??null:null)??Fe(Xe(l,O?.transcripts??[]),l.lines,l.live,{now:y});return{id:l.id,agent:e,source:l.agent?"scout":"native",observe:s,lastActiveAt:l.lastActiveAt,current:l.live}},[o,O?.transcripts,y,T,l]),ae=n.useCallback(e=>{t({view:"ops",mode:"tail",tailQuery:e.sessionId})},[t]),z=n.useCallback(e=>{C(e),D(!0)},[]),le=n.useRef({focusedId:F,railOpen:j,pinnedId:g,selectedIds:r.selectedIds,visibleAgents:r.visibleAgents});le.current={focusedId:F,railOpen:j,pinnedId:g,selectedIds:r.selectedIds,visibleAgents:r.visibleAgents},n.useEffect(()=>{const e=s=>{if(Ee(s.target))return;const i=le.current;if(i.focusedId){s.key==="Escape"&&b(null);return}if(je())return;if(s.key==="Escape"){i.railOpen?D(!1):i.selectedIds.length>0?ue():i.pinnedId?V(null):C(null);return}if((s.metaKey||s.ctrlKey)&&s.key==="a"){if(i.visibleAgents.length===0)return;s.preventDefault();const W=i.visibleAgents.map(L=>L.id);if(W.every(L=>i.selectedIds.includes(L))){ue();return}for(const L of W)i.selectedIds.includes(L)||U(L);return}if(s.metaKey||s.ctrlKey||s.altKey)return;const{index:p,ids:u}=ie.current;if(u.length===0)return;const h=Be(s.key);if(h){s.preventDefault();const W=He(p,u.length,se.current,h);C(u[W]??null);return}const w=p<0?0:p,M=u[w];if(M){if(s.key==="Enter"||s.key==="i"){s.preventDefault(),z(M);return}if(s.key==="o"){s.preventDefault(),C(M),b(M);return}(s.key==="x"||s.key===" ")&&(s.preventDefault(),C(M),U(M))}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[z]);const Se=E.reduce((e,s)=>e+s.lines.length,0),ce=R.length-I.length;return a.jsxs("div",{className:"s-wall",children:[a.jsxs("div",{className:"s-wall-status",children:[a.jsx("span",{className:"s-wall-status-key",children:"logs"}),a.jsxs("span",{className:"s-wall-status-value",children:[m.shown,"/",I.length]}),a.jsx("span",{className:"s-wall-status-key",children:"grid"}),a.jsx("span",{className:"s-wall-status-value",children:m.cols>0?`${m.cols}×${m.rows}`:"—"}),a.jsx("span",{className:"s-wall-status-key",children:"lines"}),a.jsx("span",{className:"s-wall-status-value",children:Se}),m.hidden>0&&a.jsxs("span",{className:"s-wall-status-hidden",title:"Least recently active logs are withheld to keep panes readable",children:[m.hidden," withheld"]}),ce>0&&a.jsxs("span",{className:"s-wall-status-hidden",title:"Sessions discovery knows of that have produced no output to tail",children:[ce," quiet"]}),E.length>0&&a.jsxs("span",{className:"s-wall-status-keys",children:[a.jsx("kbd",{children:"hjkl"})," move · ",a.jsx("kbd",{children:"⏎"})," context · ",a.jsx("kbd",{children:"o"})," expand"]}),g&&a.jsx("button",{type:"button",className:"s-wall-status-pin",onClick:()=>V(null),children:"unpin"})]}),a.jsx("div",{ref:ee,className:`s-wall-grid${j?" s-wall-grid--railed":""}`,style:{gridTemplateColumns:`repeat(${Math.max(1,m.cols)}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${Math.max(1,m.rows)}, minmax(0, 1fr))`,gap:qe},children:E.length===0?a.jsxs("div",{className:"s-wall-empty",children:[a.jsx("div",{className:"s-wall-empty-title",children:R.length===0?"No logs on the wire":"No matching logs"}),a.jsx("div",{className:"s-wall-empty-sub",children:R.length===0?"Panes appear as sessions start writing to their transcripts.":"Widen the activity window or clear the filter."})]}):E.map(e=>a.jsx(Ce,{log:e,selected:r.selectedIds.includes(e.id),revealed:we===e.id,cursor:S===e.id,paneRef:s=>ye(e.id,s),onOpen:()=>z(e.id),onToggleSelected:()=>U(e.id),onOpenLog:()=>ae(e)},e.id))}),l&&oe&&a.jsx(ke,{log:l,lane:oe,onClose:()=>D(!1),onExpand:()=>b(l.id),onTail:()=>ae(l),onOpenLog:()=>t({view:"sessions",sessionId:l.sessionId}),onOpenFile:c}),f&&a.jsx(Ne,{agent:f,observe:Ie,onClose:()=>b(null),onSend:e=>et(f,e),onOpenConversation:()=>{if(b(null),fe(f)&&f.harnessSessionId){t({view:"sessions",sessionId:f.harnessSessionId});return}me(f).then(e=>t({view:"conversation",conversationId:e})).catch(()=>t({view:"agents-v2",agentId:f.id,tab:"message"}))},onTail:()=>{b(null),t({view:"ops",mode:"tail",tailQuery:f.harnessSessionId??f.handle??f.name})},onProfile:()=>{b(null),t({view:"agents-v2",agentId:f.id})}})]})}export{rs as MissionControlView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as f,j as e}from"./index-BI9AljSD.js";import{d as w,c as N,n as $}from"./colors-BtO5_zlx.js";import{u as C}from"./keyboard-nav-e6yGeorb.js";import{t as j}from"./time-Dhsh_2EG.js";import{M,f as S}from"./text-Faa3ZStB.js";import{s as v}from"./page-status-Crtgjbq3.js";import"./perf-PX8Rx0EP.js";import"./index-DfsTyYDx.js";import{K as k}from"./mission-control-model-C0fByIjm.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./createLucideIcon-DthwWQIg.js";function Q({agent:s,observe:a,onClose:l,onSend:o,onOpenConversation:r,onTail:d,onProfile:h}){const p=w(s.name),{ref:m,onKeyDown:u}=C(),[i,n]=f.useState("profile"),c=t=>{if(u(t),t.defaultPrevented)return;const y=t.target;y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement||(y?.isContentEditable??!1)||(t.key==="1"?(t.preventDefault(),n("profile")):t.key==="2"?(t.preventDefault(),n("activity")):t.key==="3"&&(t.preventDefault(),n("message")))};return e.jsx("div",{className:"s-mission-overlay",onClick:l,children:e.jsxs("div",{ref:m,role:"dialog","aria-modal":"true","aria-labelledby":"mission-overlay-title",onClick:t=>t.stopPropagation(),onKeyDown:c,tabIndex:-1,className:"s-mission-overlay-dialog",children:[e.jsxs("div",{className:"s-mission-overlay-header",children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"28px",background:p},children:s.name[0]?.toUpperCase()}),e.jsxs("div",{className:"s-mission-overlay-identity",children:[e.jsxs("div",{className:"s-mission-overlay-name",id:"mission-overlay-title",children:[s.name," ",e.jsx("span",{className:"s-mission-overlay-handle",children:s.handle?`@${s.handle}`:""})]}),e.jsxs("div",{className:"s-mission-overlay-meta",children:[s.project??"—"," · ",s.branch??"main"," · ",N(s.state)]})]}),e.jsx("button",{className:"s-mission-overlay-close",onClick:l,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"✕"})]}),e.jsxs("div",{className:"s-mission-overlay-tabs",role:"tablist",children:[e.jsxs("div",{className:"s-mission-overlay-tabs-group",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":i==="profile",className:`s-mission-overlay-tab${i==="profile"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("profile"),children:"Profile"}),e.jsx("button",{type:"button",role:"tab","aria-selected":i==="activity",className:`s-mission-overlay-tab${i==="activity"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("activity"),children:"Activity"}),e.jsx("button",{type:"button",role:"tab","aria-selected":i==="message",className:`s-mission-overlay-tab${i==="message"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("message"),children:"Message"})]}),e.jsxs("div",{className:"s-mission-overlay-tabs-action",children:[i==="profile"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:h,...v({label:`Open profile · ${s.handle??s.name}`,route:`/agents/${s.id}`}),children:"Open profile ↗"}),i==="activity"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:d,...v({label:`Tail · ${s.handle??s.name}`,route:`/ops/tail?q=${encodeURIComponent(s.handle??s.name)}`}),children:"Open in Tail ↗"}),i==="message"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:r,...v({label:`Open conversation with ${s.handle??s.name}`,...s.conversationId?{route:`/c/${s.conversationId}`}:{}}),children:"Open conversation ↗"})]})]}),e.jsxs("div",{className:"s-mission-overlay-body",children:[i==="profile"&&e.jsx(E,{agent:s}),i==="activity"&&e.jsx(D,{agent:s,observe:a,onOpenConversation:r,onMessage:()=>n("message")}),i==="message"&&e.jsx(O,{agent:s,onSend:o,onOpenConversation:r})]})]})})}function E({agent:s}){const a=[["MODEL",[s.harness,s.model].filter(Boolean).join("/")||"—"],["AT",[s.project,s.branch].filter(Boolean).join("/")||"—"],["CWD",s.cwd||s.projectRoot||"—"],["AGENT",s.agentClass||"—"],["ROLE",s.role||s.transport||"—"],["MACHINE",s.authorityNodeName??s.homeNodeName??s.authorityNodeId??s.homeNodeId??"—"],["OWNER",s.ownerHandle??s.ownerName??s.ownerId??"—"],["SPAWNED",s.createdAt?j(s.createdAt):"—"],["STATE",N(s.state)]];return e.jsx("div",{className:"s-focus-tab",children:e.jsx("dl",{className:"s-focus-spec",children:a.map(([l,o])=>e.jsxs("div",{className:"s-focus-spec-row",children:[e.jsx("dt",{className:"s-focus-spec-label",children:l}),e.jsx("dd",{className:"s-focus-spec-value",title:o,children:o})]},l))})})}const T={tool:"▸",think:"·",ask:"?",message:"✉",note:"•",system:"◇",boot:"↑"};function A(s,a){if(a){const o=Date.now()-(a+s*1e3);return o<6e4?`${Math.max(0,Math.round(o/1e3))}s`:o<36e5?`${Math.round(o/6e4)}m`:o<864e5?`${Math.round(o/36e5)}h`:`${Math.round(o/864e5)}d`}const l=Math.max(0,Math.round(s));return l<60?`${l}s`:l<3600?`${Math.round(l/60)}m`:`${Math.round(l/3600)}h`}function I(s){if(s.kind==="tool"){const a=s.tool??"tool";return s.arg?`${a} · ${s.arg}`:a}return s.kind==="ask"?s.text||"request received":s.text||s.detail||k[s.kind]||s.kind}function D({agent:s,observe:a,onOpenConversation:l,onMessage:o}){const r=a?.events??[],d=a?.metadata?.usage,h=typeof a?.metadata?.session?.sessionStart=="number"?(a?.metadata?.session).sessionStart:null,p=r.slice(-14).reverse(),m=d?.assistantMessages??r.filter(t=>t.kind==="message").length,u=r.filter(t=>t.kind==="tool").length,i=r.filter(t=>t.kind==="tool"&&(t.tool==="edit"||t.tool==="write")).length,n=a?.contextUsage&&a.contextUsage.length>0?Math.round(a.contextUsage[a.contextUsage.length-1]*100):null,c=n!==null?`${n}%`:d?.contextWindowTokens&&d?.contextInputTokens?`${Math.round(d.contextInputTokens/d.contextWindowTokens*100)}%`:"—";return e.jsxs("div",{className:"s-focus-tab s-focus-tab--activity-preview",children:[e.jsxs("dl",{className:"s-focus-stats",children:[e.jsx(b,{label:"Turns",value:m||"—"}),e.jsx(b,{label:"Tools",value:u||"—"}),e.jsx(b,{label:"Edits",value:i||"—"}),e.jsx(b,{label:"Context",value:c})]}),p.length===0?e.jsx(L,{agent:s,onOpenConversation:l,onMessage:o}):e.jsx("ul",{className:"s-focus-activity-list",children:p.map(t=>e.jsxs("li",{className:`s-focus-activity-row s-focus-activity-row--${t.kind}`,children:[e.jsx("span",{className:"s-focus-activity-time",children:A(t.t,h)}),e.jsx("span",{className:"s-focus-activity-glyph","aria-hidden":!0,children:T[t.kind]??"·"}),e.jsx("span",{className:"s-focus-activity-kind",children:k[t.kind]??t.kind}),e.jsx("span",{className:"s-focus-activity-text",children:I(t)})]},t.id))})]})}function L({agent:s,onOpenConversation:a,onMessage:l}){const o=S(s.role),r=[s.harness,s.model].filter(Boolean).join("/"),d=[s.project,s.branch].filter(Boolean).join("/"),h=$(s.state),p=N(h),m=s.createdAt?j(s.createdAt):null,u=s.updatedAt?j(s.updatedAt):null,i=s.homeNodeName??s.homeNodeId,n=s.ownerHandle??s.ownerName??s.ownerId,c=[];return o&&c.push({label:"Role",value:o}),r&&c.push({label:"Stack",value:r}),d&&c.push({label:"At",value:d}),i&&c.push({label:"Home",value:i}),n&&c.push({label:"Owner",value:n}),m&&c.push({label:"Spawned",value:m}),c.push({label:"State",value:p}),u&&c.push({label:"Last seen",value:u}),e.jsxs("div",{className:"s-focus-activity-empty s-focus-activity-empty--rich",children:[e.jsxs("div",{className:"s-focus-activity-empty-head",children:[e.jsx("span",{className:"s-focus-activity-empty-eyebrow",children:"No tool or turn events recorded"}),e.jsx("span",{className:"s-focus-activity-empty-title",children:s.handle??s.name})]}),e.jsx("dl",{className:"s-focus-activity-empty-facts",children:c.map(t=>e.jsxs("div",{className:"s-focus-activity-empty-fact",children:[e.jsx("dt",{children:t.label}),e.jsx("dd",{title:t.value,children:t.value})]},t.label))}),e.jsxs("div",{className:"s-focus-activity-empty-actions",children:[e.jsx("button",{type:"button",className:"s-focus-activity-empty-btn",onClick:a,...v({label:`Open conversation with ${s.handle??s.name}`,...s.conversationId?{route:`/c/${s.conversationId}`}:{}}),children:"Open conversation ↗"}),e.jsx("button",{type:"button",className:"s-focus-activity-empty-btn s-focus-activity-empty-btn--primary",onClick:l,...v({label:`Compose message · ${s.handle??s.name}`}),children:"Send a message"})]})]})}function b({label:s,value:a}){return e.jsxs("div",{className:"s-focus-stat",children:[e.jsx("dt",{className:"s-focus-stat-label",children:s}),e.jsx("dd",{className:"s-focus-stat-value",children:a})]})}function O({agent:s,onSend:a,onOpenConversation:l}){const[o,r]=f.useState(""),[d,h]=f.useState(!1),[p,m]=f.useState(!1),[u,i]=f.useState(null),n=f.useRef(null);f.useEffect(()=>{n.current?.focus()},[]);const c=async()=>{const y=o.trim();if(!(!y||d)){h(!0),i(null);try{await a(y),r(""),m(!0),setTimeout(()=>m(!1),1800)}catch(x){i(x instanceof Error?x.message:String(x))}finally{h(!1)}}},t=s.handle??s.name;return e.jsx("div",{className:"s-focus-tab",children:e.jsx("div",{className:"s-focus-compose",children:e.jsx(M,{density:"panel",value:o,onChange:r,onSend:()=>{c()},sending:d,placeholder:`Message @${t}…`,textareaRef:n,rows:4,"aria-label":`Message @${t}`,header:e.jsxs("div",{className:"s-focus-compose-label",children:["Message ",e.jsxs("span",{className:"s-focus-compose-target",children:["@",t]})]}),tools:e.jsx("div",{className:"s-focus-compose-hint",children:u?e.jsxs("span",{className:"s-focus-compose-error",children:["Send failed: ",u]}):p?e.jsxs("span",{className:"s-focus-compose-ok",children:["Sent ↗"," ",e.jsx("button",{type:"button",className:"s-focus-compose-link",onClick:l,children:"Open Chat"})]}):e.jsx("span",{children:"Send starts a Run, or steers the active Run when this agent is already working."})})})})})}export{Q as FocusOverlay};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BI9AljSD.js";import{c as j}from"./colors-BtO5_zlx.js";import{s as x}from"./page-status-Crtgjbq3.js";import{t as m}from"./time-Dhsh_2EG.js";import{R as b}from"./RailRow-ClMmtaIE.js";import"./AgentAvatar-B7c0egdP.js";import"./Provider-Bu-C8Hxc.js";import"./router-DTtux5sP.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./api-Co9aQ2Jw.js";import"./sse-DDHEHUgz.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./createLucideIcon-DthwWQIg.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./file-text--hfhwZH1.js";import"./x-DfRJbqrh.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-e6yGeorb.js";import"./NewChatComposer-C_1op4dH.js";import"./text-Faa3ZStB.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./conversation-model-QsJVfSeG.js";import"./index-DfsTyYDx.js";import"./HarnessMark-DAaWPiT_.js";import"./NewChatOrigin-D7hwp6dm.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./SpriteAvatar-56DTXxSV.js";import"./CrewAvatar-CXJHLNVM.js";function et({agent:t,state:r,isExpanded:e,isSelected:s,tabIndex:p,onToggle:a,onReveal:n,onOpen:c}){const l=x({label:`Focus ${t.handle??t.name}`,route:`/ops/control · ${t.id}`}),d=o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"rr-spec-list",children:[o.jsx(i,{label:"MODEL",value:[t.harness,t.model].filter(Boolean).join("/")||"—"}),o.jsx(i,{label:"AT",value:[t.project,t.branch].filter(Boolean).join("/")||"—"}),o.jsx(i,{label:"STATE",value:j(r)}),o.jsx(i,{label:"ACTIVITY",value:t.activity}),o.jsx(i,{label:"SOURCE",value:t.source})]}),o.jsxs("div",{className:"ml-detail-actions",children:[o.jsx("button",{type:"button",className:"ml-detail-btn",onClick:n,children:"Reveal on wall"}),o.jsx("button",{type:"button",className:"ml-detail-btn ml-detail-btn--primary",onClick:c,children:"Open ↗"})]})]});return o.jsx(b,{name:t.handle??t.name,meta:t.lastActiveAt?m(t.lastActiveAt):t.updatedAt?m(t.updatedAt):void 0,tone:r,caret:e?"open":"closed",selected:s,expanded:e,detail:d,tabIndex:p,onClick:u=>a(u),onPointerEnter:l.onPointerEnter,onPointerLeave:l.onPointerLeave})}function i({label:t,value:r}){return o.jsxs("div",{className:"rr-spec",children:[o.jsx("dt",{className:"rr-spec-label",children:t}),o.jsx("dd",{className:"rr-spec-value",title:r,children:r})]})}export{et as MissionLeftAgentRow};
|