@openscout/scout 0.2.98 → 0.2.105
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/NOTICE +7 -0
- package/README.md +37 -0
- package/bin/scout.mjs +6 -0
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +4 -4
- package/dist/chat.mjs +285 -0
- package/dist/client/assets/ActivityScreen-CcDdQTBK.js +1 -0
- package/dist/client/assets/{AddProjectForm-fXndbzXT.js → AddProjectForm-CHNJ4NnS.js} +1 -1
- package/dist/client/assets/AdventureEvidence-B4mEvXeD.js +5 -0
- package/dist/client/assets/AdventureReader-ZsBDQITY.js +4 -0
- package/dist/client/assets/AdventureScenery-DSxDlqG1.js +1 -0
- package/dist/client/assets/AgentAdventures-BxrYq_2v.js +1 -0
- package/dist/client/assets/AgentAvatar-NZOqcsB2.js +1 -0
- package/dist/client/assets/AgentConfigurationScreen-BhD1PEAM.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-BqS6MXqF.js +1 -0
- package/dist/client/assets/AgentDetailCard-MIEBKw_S.js +1 -0
- package/dist/client/assets/AgentFloorView-A0dDRlRV.js +1 -0
- package/dist/client/assets/AgentFloorWorld-BTqwmK5G.js +1 -0
- package/dist/client/assets/AgentInfoScreen-DuaN0sgE.js +1 -0
- package/dist/client/assets/{AgentLaneCard-Cc9uyfBr.js → AgentLaneCard-C4rKLLdT.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-Dv2lBFoH.js → AgentLaneChrome-fGC-ZrJS.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-CGqtqSHQ.js → AgentLaneDetailSheet-BTF4_th9.js} +2 -2
- package/dist/client/assets/{AgentLaneSummaryResize-Di4u6df2.js → AgentLaneSummaryResize-DgSeA_vS.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-CeNiaZ9_.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-CCGBArIb.js → AgentLanesPreflight-CcS23wij.js} +1 -1
- package/dist/client/assets/AgentLanesView-WZhEDBFE.js +2 -0
- package/dist/client/assets/AgentLiveActions-6Kfr1uOT.js +1 -0
- package/dist/client/assets/AgentMasterScreen-DUDUTAnU.js +1 -0
- package/dist/client/assets/AgentSessions-CO1WGa8Z.js +6 -0
- package/dist/client/assets/AgentsConsole-BQOWkj35.js +1 -0
- package/dist/client/assets/AgentsScreen-BMNAj1PH.js +1 -0
- package/dist/client/assets/AgentsSubnav-CeHhuzyM.js +1 -0
- package/dist/client/assets/{AstronautSuit-CwB4Dw07.js → AstronautSuit-D67fIBdR.js} +1 -1
- package/dist/client/assets/AtopView-Ck30FbzG.js +1 -0
- package/dist/client/assets/BackToPicker-CkBhGRlD.js +1 -0
- package/dist/client/assets/BriefingDetailScreen-yZG8_m4h.js +1 -0
- package/dist/client/assets/BriefingsScreen-DTxYMr3a.js +1 -0
- package/dist/client/assets/{BrokerMetadataPanel-BJSwU9XZ.js → BrokerMetadataPanel-crirZCdo.js} +1 -1
- package/dist/client/assets/BrokerScreen-CT37VQiL.js +8 -0
- package/dist/client/assets/Canvas-CRP0KjKb.js +1 -0
- package/dist/client/assets/{CastPicker-CkgTalIt.js → CastPicker-ZPomvOf-.js} +1 -1
- package/dist/client/assets/ChannelComposer-BVItWlEz.js +1 -0
- package/dist/client/assets/ChannelSidebar-B-2spawY.js +1 -0
- package/dist/client/assets/CharacterFamilyPreview-BniL8sEL.css +1 -0
- package/dist/client/assets/CharacterFamilyPreview-ckVkecDO.js +1 -0
- package/dist/client/assets/ChatAvatar-DKBsbOqk.js +1 -0
- package/dist/client/assets/ChatBits-CLJ71hTY.js +1 -0
- package/dist/client/assets/ChatCollapsedStrip-Co0NmqOO.js +1 -0
- package/dist/client/assets/ChatRightPanel-pKQtkAgl.js +1 -0
- package/dist/client/assets/ChatSpaceSurface-NrLwdPkE.js +1 -0
- package/dist/client/assets/ChatSpaceTheme-BPMgPdVK.css +1 -0
- package/dist/client/assets/ChatSpaceTheme-D37Jk7bl.js +1 -0
- package/dist/client/assets/{CodeDiffPane-DfluIWmO.js → CodeDiffPane-D-iv28LJ.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-By_Wz9ex.js → CodeProjectPicker-CZ3gDdiT.js} +1 -1
- package/dist/client/assets/CodeScreen-CSC-zbP9.js +1 -0
- package/dist/client/assets/CommsCanvas-BR2YS76H.css +1 -0
- package/dist/client/assets/CommsCanvas-DdNAwjGW.js +1 -0
- package/dist/client/assets/CommsDeck-mGWY7Ivi.js +1 -0
- package/dist/client/assets/CommsFlowGraph-vQucylxF.css +1 -0
- package/dist/client/assets/CommsFlowGraph-voDD9M5R.js +1 -0
- package/dist/client/assets/CommsFlowMap-C33sgD48.js +1 -0
- package/dist/client/assets/CommsSelection-BL8aYD7z.js +1 -0
- package/dist/client/assets/{ConversationComposer-BUIjWMBi.js → ConversationComposer-DNcn5U6D.js} +1 -1
- package/dist/client/assets/ConversationFeedRows-RnYSa7Io.js +1 -0
- package/dist/client/assets/ConversationHeader-Y9TEJxP_.js +1 -0
- package/dist/client/assets/ConversationPanels-6pprBpmq.js +6 -0
- package/dist/client/assets/ConversationScreen-Brfas2y0.css +1 -0
- package/dist/client/assets/ConversationScreen-tpj4cqWs.js +2 -0
- package/dist/client/assets/ConversationStatus-Cv-7hErW.js +1 -0
- package/dist/client/assets/{CrewAvatar-CZ_faQ_s.js → CrewAvatar-zgzC3cbU.js} +1 -1
- package/dist/client/assets/CrewSprite-Dp9KBBGY.js +1 -0
- package/dist/client/assets/CrewSprite-DsQJdu3Z.css +1 -0
- package/dist/client/assets/CrewWorkspaces-DDuYMByu.css +1 -0
- package/dist/client/assets/CrewWorkspaces-K2jcyLec.js +1 -0
- package/dist/client/assets/{DataTable-C6aMSilS.js → DataTable-av71ehJV.js} +1 -1
- package/dist/client/assets/DispatchAftermath-CcYGUB10.js +1 -0
- package/dist/client/assets/DocumentFocusViewer-DlMiEALb.js +1 -0
- package/dist/client/assets/{EmbeddableSurfacesLab-D3iZiS8o.js → EmbeddableSurfacesLab-CTkO_tQR.js} +1 -1
- package/dist/client/assets/{EmptyState-CKPWFSjq.js → EmptyState-CYUwYyAW.js} +1 -1
- package/dist/client/assets/{FileViewerPane-CxNbcTYf.js → FileViewerPane-Cxhixtks.js} +2 -2
- package/dist/client/assets/FlightObserveScreen-CvzhzuWc.js +1 -0
- package/dist/client/assets/FloorContextSheet-Vj_wVZq1.js +1 -0
- package/dist/client/assets/FloorExchangePanel-B3TFhjLk.css +1 -0
- package/dist/client/assets/FloorExchangePanel-CjHSDXad.js +1 -0
- package/dist/client/assets/FloorMessagePasses-BG4ebnX5.js +1 -0
- package/dist/client/assets/FloorMessagePasses-nxwwiUom.css +1 -0
- package/dist/client/assets/FloorReplay-BoYaGY9t.js +1 -0
- package/dist/client/assets/FloorResourcesSheet-_Iy5UqgY.js +1 -0
- package/dist/client/assets/FloorSavedWork-jbtRs-YE.js +1 -0
- package/dist/client/assets/FloorTacticalHUD-BhyOqlL5.js +1 -0
- package/dist/client/assets/FollowScreen-CupyOgt4.js +1 -0
- package/dist/client/assets/HarnessMark-DSvM_H7H.js +1 -0
- package/dist/client/assets/HarnessesScreen-DyjqbZ4k.js +1 -0
- package/dist/client/assets/{HerdrSession-DsuxCtfX.js → HerdrSession-Dcm3vf9U.js} +3 -3
- package/dist/client/assets/{HomeHero-DXJo2QSO.js → HomeHero-pIZtE1cC.js} +1 -1
- package/dist/client/assets/HostAdvisorView-Dv5meXo2.js +1 -0
- package/dist/client/assets/InviteLandingScreen-xZQ2na1z.js +1 -0
- package/dist/client/assets/InviteSheet--5Zjct25.js +1 -0
- package/dist/client/assets/JumpPalette-BmiSOEmp.js +1 -0
- package/dist/client/assets/KnowledgeSearchInspector-B8yiM524.js +1 -0
- package/dist/client/assets/KnowledgeSearchScreen-BPqAjHnH.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-t7-XJP-h.js → LaneToolHoverCard-D2cnTeUd.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-jl4XQmEx.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-BB5DhFQm.js → LaneTraceEventFocus-BLhVHwff.js} +1 -1
- package/dist/client/assets/MeshCanvas-BR25OBTJ.js +3 -0
- package/dist/client/assets/MeshCanvasMinimap-ClVolr4-.js +1 -0
- package/dist/client/assets/MeshScreen-BW1dMFWF.js +1 -0
- package/dist/client/assets/{MeshTopologyView-Dc0GSrKa.js → MeshTopologyView-BT3ke2D1.js} +2 -2
- package/dist/client/assets/MessagesScreen-CtNMfIvC.js +1 -0
- package/dist/client/assets/MissionContextRail-CafjuseK.js +1 -0
- package/dist/client/assets/MissionControlView-BjPOViGY.js +1 -0
- package/dist/client/assets/MissionFocusOverlay-nhy3hkxQ.js +1 -0
- package/dist/client/assets/MissionLeftAgentRow-Dms0DBjO.js +1 -0
- package/dist/client/assets/MissionLogPane-DiUf3vWW.js +1 -0
- package/dist/client/assets/NativeAreaScreen-BQSTo8As.js +1 -0
- package/dist/client/assets/NativeAreaScreen-Brix6xDB.js +1 -0
- package/dist/client/assets/NativeAreaScreen-D7HyQNlM.js +1 -0
- package/dist/client/assets/NewAgentModal-BQ2wQ5gp.js +1 -0
- package/dist/client/assets/NewChatComposer-BEXS8vV6.js +19 -0
- package/dist/client/assets/{NewChatOrigin-DCn5cWPZ.js → NewChatOrigin-C8ROO4ps.js} +1 -1
- package/dist/client/assets/NodeDetailPanel-BNTqYC7m.js +1 -0
- package/dist/client/assets/NodeMenu-CcOeFRCB.js +1 -0
- package/dist/client/assets/ObserveEmbedScreen-Dh30EjAQ.js +2 -0
- package/dist/client/assets/{ObserveTextFlow-DCJ5EmD8.js → ObserveTextFlow-CC5mnngm.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-CJVqIqQ2.js → ObservedTopologyPanel-DF6tRZL_.js} +1 -1
- package/dist/client/assets/OpenScoutAppShell-D9pgw36i.js +31 -0
- package/dist/client/assets/OpsAgentsView-D3rM0udq.js +1 -0
- package/dist/client/assets/OpsScreen-DySeNQ1V.js +1 -0
- package/dist/client/assets/OpsSubnav-C9E0r3GZ.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-FUav75j2.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-CUzZ4Rpx.js → ProjectAgentProfileBar-C8z22pJ2.js} +1 -1
- package/dist/client/assets/ProjectAgentProfileHero-BLK0EwMg.js +1 -0
- package/dist/client/assets/ProjectsInbox-DfCXReZK.js +2 -0
- package/dist/client/assets/ProjectsRail-CELVubfJ.js +1 -0
- package/dist/client/assets/ProjectsScreen-DMw4TLKy.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-D1Sh4fnX.js +1 -0
- package/dist/client/assets/Provider-CNZluAZb.js +5 -0
- package/dist/client/assets/{RailRow-B0sRaJc6.css → RailRow-B25zKEub.css} +1 -1
- package/dist/client/assets/RailRow-DUPqXMZh.js +1 -0
- package/dist/client/assets/RailToggle-BwmY70B8.js +1 -0
- package/dist/client/assets/RawSessionsTable-6OVJq0JZ.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-D41TYY0x.js +9 -0
- package/dist/client/assets/RenderedWorkerSprite-C8fxndAh.js +1 -0
- package/dist/client/assets/RenderedWorkerSprite-qnTfkd_4.css +1 -0
- package/dist/client/assets/ReplayClock-DUVJjrIu.js +1 -0
- package/dist/client/assets/ReplayLog-Bek1Vc4W.js +1 -0
- package/dist/client/assets/ReplayOutpost-DlRg3172.js +1 -0
- package/dist/client/assets/ReplayOutpost-Y1DvZgeu.css +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-mexrJPhW.js → RepoDiffEmbedScreen-CVUMnt6A.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-DbqX4L3q.js → RepoDiffPageScreen-D9-s5PyB.js} +1 -1
- package/dist/client/assets/RepoDiffViewer-D7FN-oyY.js +7 -0
- package/dist/client/assets/RepoDiffViewerLazy-BpMR7tlx.js +2 -0
- package/dist/client/assets/{ReposScreen-CzbO1Fuy.js → ReposScreen-BQ7HO1om.js} +2 -2
- package/dist/client/assets/RiggedWorkerCharacter-BpYECnyK.css +1 -0
- package/dist/client/assets/RiggedWorkerCharacter-CJMWlvV-.js +1 -0
- package/dist/client/assets/SageModelStudio-768dRQr4.css +1 -0
- package/dist/client/assets/SageModelStudio-B526NSnw.js +4108 -0
- package/dist/client/assets/ScoutDeckSurface-ChkvGyEW.js +1 -0
- package/dist/client/assets/{ScoutSurface-NlhDsPzg.js → ScoutSurface-6g1f5chk.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-l2WAahCg.js → ScoutbotFxLab-BuwBdnPf.js} +1 -1
- package/dist/client/assets/{SecondaryNav-Cs0_FQdj.js → SecondaryNav-Bs-_VwTC.js} +1 -1
- package/dist/client/assets/SessionEmbedScreen-C2wf35-P.js +1 -0
- package/dist/client/assets/SessionObserve-B64YsYhy.js +12 -0
- package/dist/client/assets/{SessionObserve-CLrHfAKZ.css → SessionObserve-CDdJ7fAE.css} +1 -1
- package/dist/client/assets/SessionObserveEvidence-CS1aQBpQ.js +1 -0
- package/dist/client/assets/SessionRefScreen-DURV0MpF.js +1 -0
- package/dist/client/assets/SessionsScreen-D71ZR-8t.js +1 -0
- package/dist/client/assets/SettingsDrawer-Nz98oBVl.js +3 -0
- package/dist/client/assets/SettingsScreen-CYBHal6y.js +1 -0
- package/dist/client/assets/SharedFloorCharacter-Bi5_md4R.css +1 -0
- package/dist/client/assets/SharedFloorCharacter-V04kD5T9.js +1 -0
- package/dist/client/assets/SharedWorkFloor-BCmdeb3Q.css +1 -0
- package/dist/client/assets/SharedWorkFloor-C0xxW4SN.js +2 -0
- package/dist/client/assets/{ShikiPane-C0TuCATU.js → ShikiPane-XwFI-pCp.js} +1 -1
- package/dist/client/assets/{SlidePanel-CETQ5NTx.js → SlidePanel-BMpkXai_.js} +1 -1
- package/dist/client/assets/SpaceSwitcher-BfeIf-ad.js +1 -0
- package/dist/client/assets/SpriteAvatar-aHeF4ZQZ.js +1 -0
- package/dist/client/assets/SproutActionSprite-DI5N3gOj.js +1 -0
- package/dist/client/assets/{StatusPill-BllrY-eg.js → StatusPill-Dw4LP7wu.js} +1 -1
- package/dist/client/assets/{TailView-_gKWfaQM.js → TailView-BofjmUMJ.js} +2 -2
- package/dist/client/assets/Terminal-jIqnIZZ6.js +4 -0
- package/dist/client/assets/TerminalEmbedScreen-3XsjuySR.js +1 -0
- package/dist/client/assets/TerminalHeaderMount-CwbQhXcI.js +1 -0
- package/dist/client/assets/TerminalRelay--qOBwnbR.js +46 -0
- package/dist/client/assets/{TextDocumentSurface-2X1Gw4eA.js → TextDocumentSurface-BK6Qy41F.js} +1 -1
- package/dist/client/assets/{TmuxPeek-CqTJRhkI.js → TmuxPeek-DpUT9Tpc.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-C4vkU-sU.js → VoicePermissionsPanel-D35fOnQj.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-DqGnuK0e.js → WorkDetailScreen-Bcf_yHhU.js} +4 -4
- package/dist/client/assets/WorkFilesViewer-t8AEyx3Q.js +1 -0
- package/dist/client/assets/WorkRunView-CxwAZ2QQ.css +1 -0
- package/dist/client/assets/WorkRunView-_mhG_FR2.js +1 -0
- package/dist/client/assets/WorldActorTalk-CKerDikx.js +1 -0
- package/dist/client/assets/WorldCharacter-BRrj3MQN.js +1 -0
- package/dist/client/assets/WorldMinimap-DOptgrc4.js +1 -0
- package/dist/client/assets/WorldSky-D-RJzSa6.js +1 -0
- package/dist/client/assets/{activity-CzTJ-YMX.js → activity-BJqFrZyB.js} +1 -1
- package/dist/client/assets/{addon-fit-Zx3A7pGS.js → addon-fit-CHohcvS3.js} +1 -1
- package/dist/client/assets/{addon-webgl-DitJj-N0.js → addon-webgl-CaRy2x2b.js} +1 -1
- package/dist/client/assets/adventure-evidence-DgQbBmfa.css +1 -0
- package/dist/client/assets/adventure-habitats-v1-CVMbdB_Z.png +0 -0
- package/dist/client/assets/adventure-habitats-v1-M1lcpTJh.js +1 -0
- package/dist/client/assets/adventure-playback-DTfkhIc0.js +3 -0
- package/dist/client/assets/adventure-reader-DM5UDDm9.css +1 -0
- package/dist/client/assets/agent-adventures-DZtWpj6k.css +1 -0
- package/dist/client/assets/agent-autocomplete-_u9o5EZu.js +2 -0
- package/dist/client/assets/{agent-essentials-K9B6kbTS.js → agent-essentials-bKWYOZaH.js} +1 -1
- package/dist/client/assets/{agent-floor-CuJr1iK1.css → agent-floor-Dmr9hZHL.css} +1 -1
- package/dist/client/assets/agent-floor-actor-DW8zLht0.js +1 -0
- package/dist/client/assets/agent-floor-world-Bnd1AtwK.css +1 -0
- package/dist/client/assets/agent-floor-world-layout-hfMjuoui.js +1 -0
- package/dist/client/assets/agent-lane-card-model-CeqQGp-8.js +1 -0
- package/dist/client/assets/{agent-lane-detail-ppJId6Jc.js → agent-lane-detail-Ti3trpfH.js} +1 -1
- package/dist/client/assets/{agent-lane-preview-BhplDYGf.js → agent-lane-preview-Dpa3DuOn.js} +1 -1
- package/dist/client/assets/{agent-lanes-DlqcEf0l.css → agent-lanes-DmgipV9D.css} +1 -1
- package/dist/client/assets/agent-lanes-model-DMAdqCmK.js +4 -0
- package/dist/client/assets/agent-master-THmq-1k8.css +1 -0
- package/dist/client/assets/agent-master-model-C-KdOFDK.js +1 -0
- package/dist/client/assets/{agent-specialization-CtF_jI34.js → agent-specialization-BplZUa_0.js} +1 -1
- package/dist/client/assets/agent-state-DDhnFEEP.js +1 -0
- package/dist/client/assets/{api-HFH8wFyb.js → api-BQYTwoz6.js} +1 -1
- package/dist/client/assets/api-DSqpVKC7.js +1 -0
- package/dist/client/assets/{arc.es-BNXJqSw7.js → arc.es-CubLvQ4W.js} +1 -1
- package/dist/client/assets/{arrow-left-eToA6GxC.js → arrow-left-DFfKAq0d.js} +1 -1
- package/dist/client/assets/{arrow-right-DTX42clh.js → arrow-right-DmAWnyAH.js} +1 -1
- package/dist/client/assets/{arrow-up-right-B09GPwFl.js → arrow-up-right-B0aLKiyF.js} +1 -1
- package/dist/client/assets/at-sign-DM7xeppo.js +1 -0
- package/dist/client/assets/book-open-BL9qvhEI.js +1 -0
- package/dist/client/assets/{bot-WxKXYtEX.js → bot-BhAVbcCA.js} +1 -1
- package/dist/client/assets/broker-display-BkBzyvbR.js +2 -0
- package/dist/client/assets/{cache-CeWH_KzJ.js → cache-DGBo3vIf.js} +1 -1
- package/dist/client/assets/chat-api-BPVC0asu.js +1 -0
- package/dist/client/assets/chat-space-model-B6Jg2CY4.js +4 -0
- package/dist/client/assets/{check-Dz2SRHft.js → check-g7D7-c1J.js} +1 -1
- package/dist/client/assets/{chevron-down-D120PY4g.js → chevron-down-CDzRQQGl.js} +1 -1
- package/dist/client/assets/{chevron-right-CowuvuE6.js → chevron-right-DKGTLiqc.js} +1 -1
- package/dist/client/assets/chevron-up-DX7R6KY2.js +1 -0
- package/dist/client/assets/{chunk-HRAB3GC3-KjjrTLCU.js → chunk-HRAB3GC3-Dvk_QpRq.js} +1 -1
- package/dist/client/assets/{clock-_9FDplIT.js → clock-CQb4FeMf.js} +1 -1
- package/dist/client/assets/{code-xml-CkkNdRmu.js → code-xml-Cmadr3pQ.js} +1 -1
- package/dist/client/assets/coffee-ljG1_krY.js +1 -0
- package/dist/client/assets/colors-CFlbwC25.js +1 -0
- package/dist/client/assets/comms-deck-C8nVeMBh.css +1 -0
- package/dist/client/assets/comms-deck-CBhsXnY-.js +2 -0
- package/dist/client/assets/comms-gesture-_aGFo6g3.js +2 -0
- package/dist/client/assets/{compass-BdpImt_W.js → compass-CvzkzkIh.js} +1 -1
- package/dist/client/assets/content-0AXa0klu.js +1 -0
- package/dist/client/assets/content-BEyJ19Lx.js +1 -0
- package/dist/client/assets/content-BN5weWKW.js +1 -0
- package/dist/client/assets/content-BNokkm7C.js +1 -0
- package/dist/client/assets/content-BV4PUM9q.js +1 -0
- package/dist/client/assets/content-BxUPlcx5.js +1 -0
- package/dist/client/assets/content-CIC5sku8.js +1 -0
- package/dist/client/assets/content-CKJ9zb7Z.js +1 -0
- package/dist/client/assets/content-CdkTyxqk.js +1 -0
- package/dist/client/assets/content-CnhhSCZq.js +1 -0
- package/dist/client/assets/content-D1Ze_FG9.js +1 -0
- package/dist/client/assets/content-DY3F9Vfr.js +1 -0
- package/dist/client/assets/content-DrKBYpcb.js +1 -0
- package/dist/client/assets/content-LSStQYj5.js +1 -0
- package/dist/client/assets/content-YvU-D0hF.js +1 -0
- package/dist/client/assets/content-oKQMyVnH.js +1 -0
- package/dist/client/assets/{context-budget-DqxWzalx.js → context-budget-8qFKqM-j.js} +1 -1
- package/dist/client/assets/{conversation-icons-DHGc9wbT.js → conversation-icons-CIRaxmid.js} +1 -1
- package/dist/client/assets/conversation-model-m8HhzroS.js +1 -0
- package/dist/client/assets/conversation-motion-features-D9PxLoDt.js +1 -0
- package/dist/client/assets/conversations-Cbg9h_Af.js +1 -0
- package/dist/client/assets/{copy-BzdzWsQd.js → copy-BGOC1tJB.js} +1 -1
- package/dist/client/assets/{cpu-CHFIGw87.js → cpu-Q6nrHFTN.js} +1 -1
- package/dist/client/assets/{createLucideIcon-Dv8H8m7J.js → createLucideIcon-ChvMq-zl.js} +1 -1
- package/dist/client/assets/{credentials-BTce3VP1.js → credentials-OeoF-VKJ.js} +1 -1
- package/dist/client/assets/discover-DlwbftpC.js +2 -0
- package/dist/client/assets/embed-entry-c0lwtjBG.js +2 -0
- package/dist/client/assets/embed-navigation-DayfkQau.js +1 -0
- package/dist/client/assets/{external-link-BvX5PfLh.js → external-link-BVccgH0n.js} +1 -1
- package/dist/client/assets/{eye-C9cGk5z6.js → eye-CsGfEVR6.js} +1 -1
- package/dist/client/assets/{file-code-corner-jlGFdr8d.js → file-code-corner-Be6da5l3.js} +1 -1
- package/dist/client/assets/{file-text-BHro8MkG.js → file-text-DP6txVW-.js} +1 -1
- package/dist/client/assets/flag-DAFE2wZ5.js +1 -0
- package/dist/client/assets/floor-character-name-CqJPOlXb.js +1 -0
- package/dist/client/assets/floor-context-model-rWKqaKmV.js +1 -0
- package/dist/client/assets/floor-context-sheet-BFnkFiY3.css +1 -0
- package/dist/client/assets/floor-memory-YMM8AlLY.js +1 -0
- package/dist/client/assets/floor-message-passes-CO3Ix_wR.js +1 -0
- package/dist/client/assets/floor-preview-text-HrORUJ7D.js +1 -0
- package/dist/client/assets/floor-replay-CccYqE-f.css +1 -0
- package/dist/client/assets/floor-tactical-hud-HL5Vja5Y.css +1 -0
- package/dist/client/assets/folder-B_S7gBVr.js +1 -0
- package/dist/client/assets/{gauge-DSflSery.js → gauge-DQCGlE3o.js} +1 -1
- package/dist/client/assets/{gestures-YA5IIwp-.js → gestures-CofqY4Km.js} +1 -1
- package/dist/client/assets/{git-branch-Bc_eDIpG.js → git-branch-DcUCsWdJ.js} +1 -1
- package/dist/client/assets/go-shortcuts-KQy-ZOpV.js +1 -0
- package/dist/client/assets/home-moving-signal-BIHUGNfI.js +1 -0
- package/dist/client/assets/home-now-card-CaLgZze2.js +1 -0
- package/dist/client/assets/{home-now-card-nano-Jmy7eJ6H.js → home-now-card-nano-CvU8B61b.js} +1 -1
- package/dist/client/assets/{hooks-D6NI15f6.css → hooks-D787lBmm.css} +1 -1
- package/dist/client/assets/hooks-DaUOREpP.js +2 -0
- package/dist/client/assets/index-CGbs0SBm.css +1 -0
- package/dist/client/assets/index-CbqBwfIW.js +1 -0
- package/dist/client/assets/index-CyPMl7Up.js +1 -0
- package/dist/client/assets/index-DReVb7jZ.js +10 -0
- package/dist/client/assets/index-PQpJveGO.js +1 -0
- package/dist/client/assets/index-kkXUq-zf.js +1 -0
- package/dist/client/assets/{inspector-panel-CwrHjRaQ.js → inspector-panel-CLU7wjnT.js} +2 -2
- package/dist/client/assets/{keyboard-nav-B8sQ_8IF.js → keyboard-nav-CJXPaHXj.js} +1 -1
- package/dist/client/assets/knowledge-search-BNdQweGz.css +1 -0
- package/dist/client/assets/lane-ask-display-BTVSakyo.js +18 -0
- package/dist/client/assets/{lane-edit-display-C_Aujldz.js → lane-edit-display-BjdT9oZl.js} +1 -1
- package/dist/client/assets/{lane-observe-vfyACHi0.js → lane-observe-CteDwdD-.js} +3 -3
- package/dist/client/assets/lane-roster-store-Ch9t6lb0.js +1 -0
- package/dist/client/assets/{lane-tool-detail-0WhMf4Vj.js → lane-tool-detail-Czggx8oM.js} +1 -1
- package/dist/client/assets/{layers-CW2-qHsG.js → layers-BOwyWodP.js} +1 -1
- package/dist/client/assets/{layout-grid-BoVnPOk-.js → layout-grid-B36Qsh0y.js} +1 -1
- package/dist/client/assets/left-0vBrvrBG.js +2 -0
- package/dist/client/assets/{left-DH44V4I_.css → left-BV9yMiTL.css} +1 -1
- package/dist/client/assets/left-C6SyaqlJ.js +1 -0
- package/dist/client/assets/left-CTuXysZR.js +2 -0
- package/dist/client/assets/left-Cc6s4DT2.js +1 -0
- package/dist/client/assets/left-DF5caiyh.js +1 -0
- package/dist/client/assets/left-DgT4tWCx.js +1 -0
- package/dist/client/assets/left-R0wppTTr.js +1 -0
- package/dist/client/assets/left-advisor-C-kt8V28.js +1 -0
- package/dist/client/assets/left-agents-thnBO156.js +1 -0
- package/dist/client/assets/left-default-CT42fnpF.js +1 -0
- package/dist/client/assets/left-lanes-CSmZgciK.js +1 -0
- package/dist/client/assets/left-mission-C86x6i9h.js +1 -0
- package/dist/client/assets/left-mission-DENnfshd.css +1 -0
- package/dist/client/assets/library-DdhYL_9v.js +1 -0
- package/dist/client/assets/{loader-circle-DmUG_YC7.js → loader-circle-DNUsuPWz.js} +1 -1
- package/dist/client/assets/{local-agents-VP1-ZlPw.js → local-agents-I40PawYA.js} +1 -1
- package/dist/client/assets/machine-children-CdhNzDF0.js +1 -0
- package/dist/client/assets/machine-scope-DJt9RZ2w.js +1 -0
- package/dist/client/assets/mentions-Ck_Vjnyp.js +1 -0
- package/dist/client/assets/{mesh-ops-CKSWgax2.js → mesh-ops-DSlvHp-D.js} +1 -1
- package/dist/client/assets/{mesh-screen-D1Yvo8fU.css → mesh-screen-DjA4mOaN.css} +1 -1
- package/dist/client/assets/mesh-view-store-C1-mdP3P.js +1 -0
- package/dist/client/assets/{message-circle-joGFxfj1.js → message-circle-cI5_A5mj.js} +1 -1
- package/dist/client/assets/{message-markup-DC0QFEZn.js → message-markup-6Tgo4qFJ.js} +1 -1
- package/dist/client/assets/{message-square-BLiFqpe_.js → message-square-CJW4WRlo.js} +1 -1
- package/dist/client/assets/{message-visibility-CGOmSSKs.js → message-visibility-DwxgcgYK.js} +1 -1
- package/dist/client/assets/mission-control-CsX3Yc58.css +1 -0
- package/dist/client/assets/mission-control-model-C30vU1Fe.js +1 -0
- package/dist/client/assets/mission-control-store-p_cboAm4.js +1 -0
- package/dist/client/assets/{mission-wall-CocIM1cF.js → mission-wall-DOuGOxQy.js} +1 -1
- package/dist/client/assets/monitor-C7_cHlkC.js +1 -0
- package/dist/client/assets/nav-destinations-CU_euC-Q.js +1 -0
- package/dist/client/assets/observe-CtS0l3zu.js +1 -0
- package/dist/client/assets/{operator-attention-RqieiSY8.js → operator-attention-DBaRg5ep.js} +1 -1
- package/dist/client/assets/ops-screen-CxYM0VOW.css +1 -0
- package/dist/client/assets/page-status-DwFR4wSw.js +1 -0
- package/dist/client/assets/panel-right-qP17MwMl.js +1 -0
- package/dist/client/assets/pause-B_hliKuR.js +1 -0
- package/dist/client/assets/{persistent-state-BubPQ7tT.js → persistent-state-BUsTTZFE.js} +1 -1
- package/dist/client/assets/pin-Oi4qHR6M.js +1 -0
- package/dist/client/assets/pip-idle-v1-Tt-CZsRG.png +0 -0
- package/dist/client/assets/pip-thinking-v1-BoHWSEye.png +0 -0
- package/dist/client/assets/pip-waiting-v1-DkuvJ-dN.png +0 -0
- package/dist/client/assets/pip-working-v1-wWQLRS1z.png +0 -0
- package/dist/client/assets/play-CVeRmqLH.js +1 -0
- package/dist/client/assets/{plus-BWKhylds.js → plus-D5NLH_fM.js} +1 -1
- package/dist/client/assets/profile-BegEUmB7.js +1 -0
- package/dist/client/assets/projects-inbox-CKPLZN8s.css +1 -0
- package/dist/client/assets/{projects-inbox-DFbgVlXL.js → projects-inbox-CfwxCTdN.js} +1 -1
- package/dist/client/assets/provider-DwmCoSlc.js +1 -0
- package/dist/client/assets/{proxy-DVDRhSRR.js → proxy-DgzP27W8.js} +1 -1
- package/dist/client/assets/{radio-CxIXS1nU.js → radio-Cas2qg1D.js} +1 -1
- package/dist/client/assets/{refresh-cw-Bkh7Cvnd.js → refresh-cw-IcD2lPoT.js} +1 -1
- package/dist/client/assets/resolve-panes-pfZTezKo.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-D5ksvrb_.js +1 -0
- package/dist/client/assets/right-BDaCJ0CF.js +1 -0
- package/dist/client/assets/right-BP6lXRFS.js +1 -0
- package/dist/client/assets/right-Cb1VCrdj.js +1 -0
- package/dist/client/assets/right-CeFaxfBo.js +1 -0
- package/dist/client/assets/right-Ck2SrYCj.js +1 -0
- package/dist/client/assets/right-D-uv5YfF.js +1 -0
- package/dist/client/assets/right-DJMSICky.js +1 -0
- package/dist/client/assets/right-Dnljs8ah.js +1 -0
- package/dist/client/assets/right-SdCSF8PP.js +1 -0
- package/dist/client/assets/{right-DVUq5374.js → right-cjPTwPXS.js} +2 -2
- package/dist/client/assets/{rocket-CnxqjX_K.js → rocket-DAqYvu8I.js} +1 -1
- package/dist/client/assets/router-C-MF5-mb.js +1 -0
- package/dist/client/assets/{runtime-picker-BYAFNLNq.css → runtime-picker-C3JwrDKP.css} +1 -1
- package/dist/client/assets/runtime-picker-C_AVYF63.js +1 -0
- package/dist/client/assets/{scope-views-KPY85UUx.js → scope-views-Dl3ml9OZ.js} +1 -1
- package/dist/client/assets/scout-voice-CqAyfblr.js +1 -0
- package/dist/client/assets/{scoutbot-D7kGGyK_.js → scoutbot-Bk3nyrkj.js} +2 -2
- package/dist/client/assets/{scoutbot-markdown-yb87JlSE.js → scoutbot-markdown-DwvGQOWo.js} +1 -1
- package/dist/client/assets/{scroll-text-DFcBYy5J.js → scroll-text-B0tKI9Sg.js} +1 -1
- package/dist/client/assets/{search-FB2vVxCp.js → search-UsM-9-_W.js} +1 -1
- package/dist/client/assets/secondaryNavConfig-D15P1Y9k.css +1 -0
- package/dist/client/assets/secondaryNavConfig-DzNHk6IH.js +1 -0
- package/dist/client/assets/{selection-bridge-qBGFCJv8.js → selection-bridge-OTS2iFkt.js} +1 -1
- package/dist/client/assets/{send-horizontal-CS7mxVhX.js → send-horizontal-BlQsRK6C.js} +1 -1
- package/dist/client/assets/send-to-agent-session-C1mgqdow.js +1 -0
- package/dist/client/assets/{server-WY6gsbZz.js → server-DBlPW0Mp.js} +1 -1
- package/dist/client/assets/{session-catalog-CG4oL_yN.js → session-catalog-CnpZMB7C.js} +1 -1
- package/dist/client/assets/{session-table-uJh3v-ly.js → session-table-CGkfG5Yd.js} +1 -1
- package/dist/client/assets/sessions-view-Bge4XZ4I.js +1 -0
- package/dist/client/assets/{settings-DQEtqkM9.js → settings-C69Zjrpq.js} +1 -1
- package/dist/client/assets/shared-work-artifacts-DfNl9KTo.js +1 -0
- package/dist/client/assets/{sliders-horizontal-57e99_qO.js → sliders-horizontal-6bzeod7c.js} +1 -1
- package/dist/client/assets/solar-system-scope-2k-stars-points-1FwHnkj0.png +0 -0
- package/dist/client/assets/{sparkles-D0vWLTyC.js → sparkles-Cc5lPZRv.js} +1 -1
- package/dist/client/assets/sprout-action-sprite-DZ8C0fTl.css +1 -0
- package/dist/client/assets/sprout-actions-proof-v1-BzUdc812.png +0 -0
- package/dist/client/assets/{sse-B29iGBnw.js → sse-A8AyLH0g.js} +1 -1
- package/dist/client/assets/system-surfaces-redesign-DKFg4GB5.css +1 -0
- package/dist/client/assets/{tail-display-DcliDVkW.js → tail-display-DHSNmvor.js} +2 -2
- package/dist/client/assets/{tail-events-LK29oCKm.js → tail-events-C4WdhVeK.js} +1 -1
- package/dist/client/assets/{terminal-UDy4lzV1.js → terminal-DMZjX1es.js} +1 -1
- package/dist/client/assets/{terminal-relay-CXHMdain.js → terminal-relay-mO89dX-Y.js} +1 -1
- package/dist/client/assets/terminal-screen-Bpb2SZrn.css +1 -0
- package/dist/client/assets/{terminal-sessions-Bdt2W3Y4.js → terminal-sessions-3RfJpen8.js} +1 -1
- package/dist/client/assets/{terminal-takeover-BMeBjBB2.js → terminal-takeover-CZZsnPzj.js} +1 -1
- package/dist/client/assets/use-beside-D3cJpA5p.js +1 -0
- package/dist/client/assets/use-conversation-list-D5EnpVba.js +1 -0
- package/dist/client/assets/{use-fleet-active-asks-CCGrll5q.js → use-fleet-active-asks-D_QOmjg5.js} +1 -1
- package/dist/client/assets/use-mesh-node-state-3V3ADQ-G.js +1 -0
- package/dist/client/assets/{use-mesh-ops-items-BjyeFJTz.js → use-mesh-ops-items-DI9GKWlF.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-CPoX8iV2.js → use-reduced-motion-CiaZHMnk.js} +1 -1
- package/dist/client/assets/use-scout-dev-flags-CkdAHlDR.js +1 -0
- package/dist/client/assets/{useAgentHoverCard-BgTLNcF-.js → useAgentHoverCard-A3QGXqIy.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-DrL_nkCZ.js +1 -0
- package/dist/client/assets/{useEmbedHeadline-DuUnwTB7.js → useEmbedHeadline-atkQVfGw.js} +1 -1
- package/dist/client/assets/usePersistentState-Y8XwSTg-.js +1 -0
- package/dist/client/assets/{usePierreRuntime-35AHf9RQ.js → usePierreRuntime-DTvcwISe.js} +1 -1
- package/dist/client/assets/users-RLK3P5U4.js +1 -0
- package/dist/client/assets/worker-rendered-v1-DmGVMlVi.png +0 -0
- package/dist/client/assets/worker-thinking-v1-ujakpzrK.png +0 -0
- package/dist/client/assets/worker-waiting-v1-DbTSsfJJ.png +0 -0
- package/dist/client/assets/worker-working-v1-BROAvJ_z.png +0 -0
- package/dist/client/assets/world-outposts-v1-DOt0i98W.png +0 -0
- package/dist/client/assets/{wrench-BfVeded5.js → wrench-B4maQJai.js} +1 -1
- package/dist/client/assets/{x-DgmmnPKt.js → x-rlMdRqJF.js} +1 -1
- package/dist/client/assets/{xterm-DnJJmrCA.js → xterm-B1zHHOLQ.js} +1 -1
- package/dist/client/assets/{zap-Bcja1lHG.js → zap-B4X0OrEw.js} +1 -1
- package/dist/client/characters/sage/sage.glb +0 -0
- package/dist/client/crew/brik-bust.webp +0 -0
- package/dist/client/crew/brik-chip-id.webp +0 -0
- package/dist/client/crew/fenn-bust.webp +0 -0
- package/dist/client/crew/fenn-chip-id.webp +0 -0
- package/dist/client/crew/lulu-bust.webp +0 -0
- package/dist/client/crew/milo-bust.webp +0 -0
- package/dist/client/crew/milo-chip-id.webp +0 -0
- package/dist/client/crew/nori-bust.webp +0 -0
- package/dist/client/crew/pip-bust.webp +0 -0
- package/dist/client/crew/pip-chip-id.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/blink-half.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/blink-shut.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/look-left.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/look-right.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/look-up.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/rest.webp +0 -0
- package/dist/client/crew/sheets/sprout/blink-half.webp +0 -0
- package/dist/client/crew/sheets/sprout/blink-shut.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-left.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-right.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-up.webp +0 -0
- package/dist/client/crew/sprout-bust.webp +0 -0
- package/dist/client/crew/sprout-chip-id.webp +0 -0
- package/dist/client/crew/tuck-bust.webp +0 -0
- package/dist/client/crew/tuck-chip-id.webp +0 -0
- package/dist/client/crew/vex-bust.webp +0 -0
- package/dist/client/crew/vex-chip-id.webp +0 -0
- package/dist/client/crew/wrench-bust.webp +0 -0
- package/dist/client/crew/wrench-chip-id.webp +0 -0
- package/dist/client/index.html +15 -3
- package/dist/drizzle/0017_wise_silver_sable.sql +26 -0
- package/dist/drizzle/0018_message_epoch_order.sql +1 -0
- package/dist/drizzle/0019_session_actor_targets.sql +227 -0
- package/dist/drizzle/README.md +19 -0
- package/dist/drizzle/meta/0017_snapshot.json +6785 -0
- package/dist/drizzle/meta/0018_snapshot.json +6804 -0
- package/dist/drizzle/meta/0019_snapshot.json +6804 -0
- package/dist/drizzle/meta/_journal.json +21 -0
- package/dist/highlights-eq9cgrbb.scm +604 -0
- package/dist/highlights-ghv9g403.scm +205 -0
- package/dist/highlights-hk7bwhj4.scm +284 -0
- package/dist/highlights-r812a2qc.scm +150 -0
- package/dist/highlights-x6tmsnaa.scm +115 -0
- package/dist/injections-73j83es3.scm +27 -0
- package/dist/main.mjs +32163 -29049
- package/dist/node/main.mjs +7189 -6285
- package/dist/openscout-terminal-relay.mjs +391 -9
- package/dist/pairing-runtime-controller.mjs +36724 -35406
- package/dist/runtime/base-daemon.mjs +14204 -63
- package/dist/runtime/broker-daemon.mjs +23498 -3137
- package/dist/runtime/broker-process-manager.mjs +19 -5
- package/dist/runtime/mesh-discover.mjs +18 -5
- package/dist/scout-control-plane-web.mjs +58517 -36972
- package/dist/statusline.mjs +1021 -35
- package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/dist/update-helper.mjs +32235 -0
- package/package.json +2 -2
- package/dist/client/assets/ActivityScreen-sfonf5SR.js +0 -1
- package/dist/client/assets/AgentAvatar-Dz79iTxB.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-DDc3udYM.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-DHDS9Pgd.js +0 -1
- package/dist/client/assets/AgentDetailCard-8viaEY8b.js +0 -1
- package/dist/client/assets/AgentFloorView-DuyvyMMj.js +0 -1
- package/dist/client/assets/AgentInfoScreen-qntgg2q2.js +0 -1
- package/dist/client/assets/AgentLanesEmbedScreen-BA6fRwkD.js +0 -1
- package/dist/client/assets/AgentLanesView-96lHsoX7.js +0 -2
- package/dist/client/assets/AgentLiveActions-DlSKL60c.js +0 -1
- package/dist/client/assets/AgentMasterScreen-DHrMuQ6_.js +0 -1
- package/dist/client/assets/AgentSessions-DV9v34aq.js +0 -6
- package/dist/client/assets/AgentsConsole-DTpVhS67.js +0 -1
- package/dist/client/assets/AgentsScreen-hZ4o2I-e.js +0 -1
- package/dist/client/assets/AgentsSubnav-Ci7uWM7P.js +0 -1
- package/dist/client/assets/AtopView-D7vyQDtE.js +0 -1
- package/dist/client/assets/BackToPicker-BHicJyfc.js +0 -1
- package/dist/client/assets/BriefingDetailScreen-B-wD_Bot.js +0 -1
- package/dist/client/assets/BriefingsScreen-Cn4Mbam9.js +0 -1
- package/dist/client/assets/BrokerScreen-C8FQ5rlg.js +0 -5
- package/dist/client/assets/ChatCollapsedStrip-7Wrg8Ge0.js +0 -1
- package/dist/client/assets/CodeScreen-cLC0tJ4S.js +0 -1
- package/dist/client/assets/ConversationFeedRows-Bx0gFyG_.js +0 -1
- package/dist/client/assets/ConversationHeader-Bt2RBj93.js +0 -1
- package/dist/client/assets/ConversationPanels-o6W-cOoU.js +0 -6
- package/dist/client/assets/ConversationScreen-CkWnKXt6.css +0 -1
- package/dist/client/assets/ConversationScreen-DIU7m_aC.js +0 -2
- package/dist/client/assets/ConversationStatus-CTYOywFh.js +0 -1
- package/dist/client/assets/CrewWorkspaces-DNX-QQ1h.js +0 -1
- package/dist/client/assets/CrewWorkspaces-Diq11KDq.css +0 -1
- package/dist/client/assets/DispatchAftermath-ZCEB75hh.js +0 -1
- package/dist/client/assets/DocumentFocusViewer-D8iB6SMt.js +0 -1
- package/dist/client/assets/FlightObserveScreen-BTe1YRPr.js +0 -1
- package/dist/client/assets/FollowScreen-CkR-okdL.js +0 -1
- package/dist/client/assets/HarnessMark-DttReffF.js +0 -1
- package/dist/client/assets/HarnessesScreen-COO_Q8VY.js +0 -1
- package/dist/client/assets/HostAdvisorView-DeJ-8RZV.js +0 -1
- package/dist/client/assets/KnowledgeSearchInspector-W_zNIBRV.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-_rxJNUUh.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-DNIECgEl.js +0 -1
- package/dist/client/assets/MeshCanvas-DZv2ipsy.js +0 -3
- package/dist/client/assets/MeshCanvasMinimap-BXHRNb7l.js +0 -1
- package/dist/client/assets/MeshScreen-DuNvpDC5.js +0 -1
- package/dist/client/assets/MessagesScreen-dNNPFwAc.js +0 -1
- package/dist/client/assets/MissionContextRail-DnCWPzAM.js +0 -1
- package/dist/client/assets/MissionControlView-DmaThhNR.js +0 -1
- package/dist/client/assets/MissionFocusOverlay-K21ssTxv.js +0 -1
- package/dist/client/assets/MissionLeftAgentRow-CbQm4BLv.js +0 -1
- package/dist/client/assets/MissionLogPane-BLvSSIdT.js +0 -1
- package/dist/client/assets/NewAgentModal-B7qxjZlW.js +0 -1
- package/dist/client/assets/NewChatComposer-D2Ah4T-W.js +0 -19
- package/dist/client/assets/ObserveEmbedScreen-DvKGsaLv.js +0 -2
- package/dist/client/assets/OpenScoutAppShell-C9TOLB7u.js +0 -79
- package/dist/client/assets/OpsAgentsView-vIoY-AW1.js +0 -1
- package/dist/client/assets/OpsScreen-CJBwshEp.js +0 -1
- package/dist/client/assets/OpsSubnav-CjDTnp64.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-Br1eTD7G.js +0 -1
- package/dist/client/assets/ProjectAgentProfileHero-mjxNcRvw.js +0 -1
- package/dist/client/assets/ProjectsInbox-Bq29DE_o.js +0 -2
- package/dist/client/assets/ProjectsRail-kMDA0yn4.js +0 -1
- package/dist/client/assets/ProjectsScreen-BDaJYhc0.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-B940p3vW.js +0 -1
- package/dist/client/assets/Provider-D0bB7q6y.js +0 -1
- package/dist/client/assets/RailRow-B88JVr62.js +0 -1
- package/dist/client/assets/RawSessionsTable-CzGhEdiZ.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-CyP1CWsX.js +0 -1
- package/dist/client/assets/RepoDiffViewer-Bw5yMC4A.js +0 -7
- package/dist/client/assets/RepoDiffViewerLazy-DzfoFhbl.js +0 -2
- package/dist/client/assets/ScoutDeckSurface-DQoZofzH.js +0 -1
- package/dist/client/assets/SessionEmbedScreen-CpduQ0O9.js +0 -1
- package/dist/client/assets/SessionObserve-BVeTkcIl.js +0 -12
- package/dist/client/assets/SessionObserveEvidence-BkOezTGV.js +0 -1
- package/dist/client/assets/SessionRefScreen-DetLMkTT.js +0 -1
- package/dist/client/assets/SessionsScreen-B-McKw6d.js +0 -1
- package/dist/client/assets/SettingsDrawer-CPB32w0n.js +0 -3
- package/dist/client/assets/SettingsScreen-BEzYFdjz.js +0 -1
- package/dist/client/assets/SpriteAvatar-DFO4Kb4Z.js +0 -1
- package/dist/client/assets/Terminal-DWyZTZdY.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-_SSzwhWa.js +0 -1
- package/dist/client/assets/TerminalHeaderMount-CY7uIWBg.js +0 -1
- package/dist/client/assets/WorkFilesViewer-D8-4vF5l.js +0 -1
- package/dist/client/assets/agent-autocomplete-BlK8wY06.js +0 -10
- package/dist/client/assets/agent-lane-card-model-CY3OE1Xu.js +0 -1
- package/dist/client/assets/agent-lanes-model-tc-1hE6q.js +0 -2
- package/dist/client/assets/agent-master-I1W-5d-x.css +0 -1
- package/dist/client/assets/agent-master-model-DMcHeNq3.js +0 -1
- package/dist/client/assets/api-Co9aQ2Jw.js +0 -1
- package/dist/client/assets/arrow-down-BAGkhHA6.js +0 -1
- package/dist/client/assets/broker-display-Q75fupqG.js +0 -2
- package/dist/client/assets/chunk-JTPDIGGW-COJ00z94.js +0 -46
- package/dist/client/assets/chunk-T65CQEWV-H2QEKfr1.js +0 -1
- package/dist/client/assets/chunk-YOZR3KYS-CrCgXw9l.js +0 -2
- package/dist/client/assets/colors-BtO5_zlx.js +0 -1
- package/dist/client/assets/content-0RBfbCIJ.js +0 -1
- package/dist/client/assets/content-BTmnk2bl.js +0 -1
- package/dist/client/assets/content-Bk5DKhyP.js +0 -1
- package/dist/client/assets/content-Bw_8GE_S.js +0 -1
- package/dist/client/assets/content-CI4gLEWi.js +0 -1
- package/dist/client/assets/content-CLCtp9Rb.js +0 -1
- package/dist/client/assets/content-C_FAGTNk.js +0 -1
- package/dist/client/assets/content-CnnzWOE3.js +0 -1
- package/dist/client/assets/content-DKlY98pO.js +0 -1
- package/dist/client/assets/content-Df7ndXTG.js +0 -1
- package/dist/client/assets/content-DkZDzzx3.js +0 -1
- package/dist/client/assets/content-DnGmb2L0.js +0 -1
- package/dist/client/assets/content-Ds-zs-Ss.js +0 -1
- package/dist/client/assets/content-JIWSyC0f.js +0 -1
- package/dist/client/assets/content-Q3TIYC8q.js +0 -1
- package/dist/client/assets/content-evaBfvxD.js +0 -1
- package/dist/client/assets/conversation-model-C2KuZUXc.js +0 -1
- package/dist/client/assets/conversation-motion-features-BJnHs3Ul.js +0 -1
- package/dist/client/assets/discover-DutlV0ZU.js +0 -2
- package/dist/client/assets/embed-entry-CJG7WEVw.js +0 -2
- package/dist/client/assets/home-moving-signal-PHSqSBu_.js +0 -1
- package/dist/client/assets/home-now-card-C_qsI6C6.js +0 -1
- package/dist/client/assets/hooks-ME7rmhpE.js +0 -2
- package/dist/client/assets/index-C1VaWNuD.js +0 -10
- package/dist/client/assets/index-C8UCRm2W.js +0 -1
- package/dist/client/assets/index-Cn0I2Hgi.js +0 -1
- package/dist/client/assets/index-Cx6Gbr6n.js +0 -1
- package/dist/client/assets/index-i7TMxlwW.css +0 -1
- package/dist/client/assets/knowledge-search-D_bLoYtC.css +0 -1
- package/dist/client/assets/lane-ask-display-B6iCAVcd.js +0 -18
- package/dist/client/assets/lane-roster-store-DN2jxXF-.js +0 -1
- package/dist/client/assets/left-BRu9pnqx.js +0 -2
- package/dist/client/assets/left-BjS1dKNV.js +0 -2
- package/dist/client/assets/left-CL-TVLJ7.js +0 -1
- package/dist/client/assets/left-DLpsDi55.js +0 -1
- package/dist/client/assets/left-DPcM9o8Y.js +0 -1
- package/dist/client/assets/left-MmTJf1tK.js +0 -1
- package/dist/client/assets/left-P80i5V8L.js +0 -1
- package/dist/client/assets/left-advisor-CbXVzAqS.js +0 -1
- package/dist/client/assets/left-agents-7mJsiNyr.js +0 -1
- package/dist/client/assets/left-default-COK26l3H.js +0 -1
- package/dist/client/assets/left-lanes-Dbdm9Veu.js +0 -1
- package/dist/client/assets/left-mission-DSenPIyb.css +0 -1
- package/dist/client/assets/left-mission-DqGR5jby.js +0 -1
- package/dist/client/assets/library-COnWzUWv.js +0 -1
- package/dist/client/assets/mentions-BZ5SBMtc.js +0 -1
- package/dist/client/assets/mesh-buckets-CLYS8Jx8.js +0 -1
- package/dist/client/assets/mesh-view-store-CBM1za_N.js +0 -1
- package/dist/client/assets/mission-control-CnU7dNt1.css +0 -1
- package/dist/client/assets/mission-control-model-C0fByIjm.js +0 -1
- package/dist/client/assets/mission-control-store-CM8mQGg8.js +0 -1
- package/dist/client/assets/observe-BLmy4quB.js +0 -1
- package/dist/client/assets/ops-screen-giu3If_N.css +0 -1
- package/dist/client/assets/page-status-BE0-J1xY.js +0 -1
- package/dist/client/assets/paperclip-Br7wUDFl.js +0 -1
- package/dist/client/assets/perf-PX8Rx0EP.js +0 -1
- package/dist/client/assets/profile-BCvk8jOQ.js +0 -1
- package/dist/client/assets/projects-inbox-BIW7nv-H.css +0 -1
- package/dist/client/assets/resolve-panes-DhD5qmQO.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-GqhZNRPY.js +0 -1
- package/dist/client/assets/right-B_08ilv6.js +0 -1
- package/dist/client/assets/right-Brm67HOL.js +0 -1
- package/dist/client/assets/right-BveAPKBW.js +0 -1
- package/dist/client/assets/right-CpTB_-Ya.js +0 -1
- package/dist/client/assets/right-CqC4Qdot.js +0 -1
- package/dist/client/assets/right-D91j9d5Y.js +0 -1
- package/dist/client/assets/right-DaLRhYl3.js +0 -1
- package/dist/client/assets/right-Dt1wOwA5.js +0 -1
- package/dist/client/assets/right-DtzqIZQF.js +0 -1
- package/dist/client/assets/router-kfcaYqZr.js +0 -1
- package/dist/client/assets/runtime-picker-C20lTGhV.js +0 -1
- package/dist/client/assets/scout-voice-Cg1qfepC.js +0 -1
- package/dist/client/assets/secondaryNavConfig-C0Srrmy8.js +0 -1
- package/dist/client/assets/secondaryNavConfig-xssF_ubT.css +0 -1
- package/dist/client/assets/system-surfaces-redesign-kuf3wuE_.css +0 -1
- package/dist/client/assets/terminal-screen-vMICbBJh.css +0 -1
- package/dist/client/assets/use-conversation-list-UG-tMN67.js +0 -1
- package/dist/client/assets/use-scout-dev-flags-DTseRrFi.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-CoIoz7JU.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as p,j as r}from"./index-C1VaWNuD.js";/* empty css */import{i as J,n as Z,s as ee}from"./colors-BtO5_zlx.js";import{a as A}from"./api-Co9aQ2Jw.js";import{u as te}from"./sse-B29iGBnw.js";import{t as re}from"./time-Dhsh_2EG.js";import{D as ne}from"./DataTable-C6aMSilS.js";import{u as ae}from"./useAgentHoverCard-BgTLNcF-.js";import{S as se}from"./search-FB2vVxCp.js";import{S as oe}from"./sliders-horizontal-57e99_qO.js";import"./perf-PX8Rx0EP.js";import"./index-BWHgHrtv.js";/* empty css */import"./index-Cx6Gbr6n.js";import"./AgentDetailCard-8viaEY8b.js";import"./AgentLiveActions-DlSKL60c.js";import"./terminal-takeover-BMeBjBB2.js";import"./Provider-D0bB7q6y.js";import"./router-kfcaYqZr.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./createLucideIcon-Dv8H8m7J.js";import"./conversation-model-C2KuZUXc.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./openContent-C6XO6kr5.js";import"./eye-C9cGk5z6.js";import"./terminal-UDy4lzV1.js";function ie(e,t){return{model:t?.data.metadata?.session?.model??e.model??null,provider:t?.data.metadata?.session?.modelProvider??e.providerName??null}}const ce=["openai","codex","codex_app_server"],ue=["anthropic","claude","claude-code","claude_stream_json"],W={"openai:gpt-5.5":{provider:"openai",model:"gpt-5.5",inputPerM:5,cachedInputPerM:.5,cacheWritePerM:null,outputPerM:30,webSearchPer1K:10},"openai:gpt-5.5-pro":{provider:"openai",model:"gpt-5.5-pro",inputPerM:30,cachedInputPerM:null,cacheWritePerM:null,outputPerM:180,webSearchPer1K:10},"openai:gpt-5.4":{provider:"openai",model:"gpt-5.4",inputPerM:2.5,cachedInputPerM:.25,cacheWritePerM:null,outputPerM:15,webSearchPer1K:10},"openai:gpt-5.4-mini":{provider:"openai",model:"gpt-5.4-mini",inputPerM:.75,cachedInputPerM:.075,cacheWritePerM:null,outputPerM:4.5,webSearchPer1K:10},"openai:gpt-5.4-nano":{provider:"openai",model:"gpt-5.4-nano",inputPerM:.2,cachedInputPerM:.02,cacheWritePerM:null,outputPerM:1.25,webSearchPer1K:10},"openai:gpt-5.4-pro":{provider:"openai",model:"gpt-5.4-pro",inputPerM:30,cachedInputPerM:null,cacheWritePerM:null,outputPerM:180,webSearchPer1K:10},"openai:gpt-5.3-codex":{provider:"openai",model:"gpt-5.3-codex",inputPerM:1.75,cachedInputPerM:.175,cacheWritePerM:null,outputPerM:14,webSearchPer1K:10},"openai:gpt-5.3-chat-latest":{provider:"openai",model:"gpt-5.3-chat-latest",inputPerM:1.75,cachedInputPerM:.175,cacheWritePerM:null,outputPerM:14,webSearchPer1K:10},"openai:gpt-5.2":{provider:"openai",model:"gpt-5.2",inputPerM:1.75,cachedInputPerM:.175,cacheWritePerM:null,outputPerM:14,webSearchPer1K:10},"openai:gpt-5.2-codex":{provider:"openai",model:"gpt-5.2-codex",inputPerM:1.75,cachedInputPerM:.175,cacheWritePerM:null,outputPerM:14,webSearchPer1K:10},"openai:gpt-5.2-chat-latest":{provider:"openai",model:"gpt-5.2-chat-latest",inputPerM:1.75,cachedInputPerM:.175,cacheWritePerM:null,outputPerM:14,webSearchPer1K:10},"openai:gpt-5.2-pro":{provider:"openai",model:"gpt-5.2-pro",inputPerM:21,cachedInputPerM:null,cacheWritePerM:null,outputPerM:168,webSearchPer1K:10},"openai:gpt-5.1":{provider:"openai",model:"gpt-5.1",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5.1-codex":{provider:"openai",model:"gpt-5.1-codex",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5.1-codex-max":{provider:"openai",model:"gpt-5.1-codex-max",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5.1-chat-latest":{provider:"openai",model:"gpt-5.1-chat-latest",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5":{provider:"openai",model:"gpt-5",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5-codex":{provider:"openai",model:"gpt-5-codex",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5-chat-latest":{provider:"openai",model:"gpt-5-chat-latest",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5-mini":{provider:"openai",model:"gpt-5-mini",inputPerM:.25,cachedInputPerM:.025,cacheWritePerM:null,outputPerM:2,webSearchPer1K:10},"openai:gpt-5-nano":{provider:"openai",model:"gpt-5-nano",inputPerM:.05,cachedInputPerM:.005,cacheWritePerM:null,outputPerM:.4,webSearchPer1K:10},"openai:gpt-5-pro":{provider:"openai",model:"gpt-5-pro",inputPerM:15,cachedInputPerM:null,cacheWritePerM:null,outputPerM:120,webSearchPer1K:10},"openai:gpt-4.1":{provider:"openai",model:"gpt-4.1",inputPerM:2,cachedInputPerM:.5,cacheWritePerM:null,outputPerM:8,webSearchPer1K:10},"openai:gpt-4.1-mini":{provider:"openai",model:"gpt-4.1-mini",inputPerM:.4,cachedInputPerM:.1,cacheWritePerM:null,outputPerM:1.6,webSearchPer1K:10},"openai:gpt-4.1-nano":{provider:"openai",model:"gpt-4.1-nano",inputPerM:.1,cachedInputPerM:.025,cacheWritePerM:null,outputPerM:.4,webSearchPer1K:10},"openai:gpt-4o":{provider:"openai",model:"gpt-4o",inputPerM:2.5,cachedInputPerM:1.25,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-4o-mini":{provider:"openai",model:"gpt-4o-mini",inputPerM:.15,cachedInputPerM:.075,cacheWritePerM:null,outputPerM:.6,webSearchPer1K:10},"anthropic:claude-opus-4.6":{provider:"anthropic",model:"claude-opus-4.6",inputPerM:5,cachedInputPerM:.5,cacheWritePerM:6.25,outputPerM:25,webSearchPer1K:10},"anthropic:claude-opus-4.5":{provider:"anthropic",model:"claude-opus-4.5",inputPerM:5,cachedInputPerM:.5,cacheWritePerM:6.25,outputPerM:25,webSearchPer1K:10},"anthropic:claude-opus-4.1":{provider:"anthropic",model:"claude-opus-4.1",inputPerM:15,cachedInputPerM:1.5,cacheWritePerM:18.75,outputPerM:75,webSearchPer1K:10},"anthropic:claude-opus-4":{provider:"anthropic",model:"claude-opus-4",inputPerM:15,cachedInputPerM:1.5,cacheWritePerM:18.75,outputPerM:75,webSearchPer1K:10},"anthropic:claude-sonnet-4.6":{provider:"anthropic",model:"claude-sonnet-4.6",inputPerM:3,cachedInputPerM:.3,cacheWritePerM:3.75,outputPerM:15,webSearchPer1K:10},"anthropic:claude-sonnet-4.5":{provider:"anthropic",model:"claude-sonnet-4.5",inputPerM:3,cachedInputPerM:.3,cacheWritePerM:3.75,outputPerM:15,webSearchPer1K:10},"anthropic:claude-sonnet-4":{provider:"anthropic",model:"claude-sonnet-4",inputPerM:3,cachedInputPerM:.3,cacheWritePerM:3.75,outputPerM:15,webSearchPer1K:10},"anthropic:claude-3-7-sonnet":{provider:"anthropic",model:"claude-3-7-sonnet",inputPerM:3,cachedInputPerM:.3,cacheWritePerM:3.75,outputPerM:15,webSearchPer1K:10},"anthropic:claude-haiku-4.5":{provider:"anthropic",model:"claude-haiku-4.5",inputPerM:1,cachedInputPerM:.1,cacheWritePerM:1.25,outputPerM:5,webSearchPer1K:10}},le={"claude-sonnet-4-5":"anthropic:claude-sonnet-4.5","claude-sonnet-4-6":"anthropic:claude-sonnet-4.6","claude-opus-4-5":"anthropic:claude-opus-4.5","claude-opus-4-6":"anthropic:claude-opus-4.6","claude-haiku-4-5":"anthropic:claude-haiku-4.5"};function pe(e){const t=e.provider?.trim().toLowerCase()??"",s=e.adapterType?.trim().toLowerCase()??"",a=V(e.model)??"",i=[t,s].filter(Boolean);return i.some(o=>ce.some(c=>o.includes(c)))?"openai":i.some(o=>ue.some(c=>o.includes(c)))?"anthropic":a.startsWith("gpt-")||a.startsWith("o")||a.includes("codex")?"openai":a.startsWith("claude-")?"anthropic":"unknown"}function V(e){return e?e.trim().toLowerCase().replace(/^(openai|anthropic)\//,"").replace(/_/g,"-").replace(/-\d{8}$/,""):null}function de(e){const t=x(e?.inputTokens),s=x(e?.cacheReadInputTokens),a=x(e?.cacheCreationInputTokens),i=x(e?.outputTokens),o=x(e?.reasoningOutputTokens),c=[t,i].reduce((m,b)=>m+(b??0),0),h=x(e?.totalTokens)??(c||null);return{input:t,uncachedInput:t==null?null:Math.max(0,t-(s??0)-(a??0)),cachedInput:s,cacheWrite:a,output:i,reasoningOutput:o,total:h,webSearchRequests:x(e?.webSearchRequests),webFetchRequests:x(e?.webFetchRequests)}}function he(e){const t=pe(e),s=V(e.model),a=de(e.usage),i=me(t,s),o=ge(e);if(!i.rateCard)return{provider:t,model:s,rateCard:null,rateCardSource:"unknown",capturedAt:e.capturedAt??Date.now(),usage:a,lineItems:[],totalUsd:null,billedTotalUsd:null,billingMode:o,subscriptionWindows:e.subscriptionWindows??[]};const c=i.rateCard,h=a.uncachedInput??a.input??0,m=a.cachedInput??0,b=a.cacheWrite??0,g=a.output??0,v=a.webSearchRequests??0,f=[j("input","Input",h,c.inputPerM,o),j("cached_input","Cached input",m,c.cachedInputPerM??c.inputPerM,o),j("cache_write","Cache write",b,c.cacheWritePerM??c.inputPerM,o),j("output","Output",g,c.outputPerM,o),{key:"web_search",label:"Web search",quantity:v,unit:"requests",rate:c.webSearchPer1K??0,billedRate:o==="subscription"?0:c.webSearchPer1K??0,costUsd:v/1e3*(c.webSearchPer1K??0),billedCostUsd:o==="subscription"?0:v/1e3*(c.webSearchPer1K??0)}].filter(P=>P.quantity>0);return{provider:t,model:s,rateCard:c,rateCardSource:i.source,capturedAt:e.capturedAt??Date.now(),usage:a,lineItems:f,totalUsd:f.reduce((P,d)=>P+d.costUsd,0),billedTotalUsd:f.reduce((P,d)=>P+d.billedCostUsd,0),billingMode:o,subscriptionWindows:e.subscriptionWindows??[]}}function me(e,t){if(e==="unknown")return{rateCard:null,source:"unknown"};const s=t?`${e}:${t}`:null;if(s&&W[s])return{rateCard:W[s],source:"exact"};const a=t?le[t]:null;if(a&&W[a])return{rateCard:W[a],source:"alias"};if(e==="anthropic"){if(t?.includes("opus"))return{rateCard:W["anthropic:claude-opus-4.5"],source:"provider-default"};if(t?.includes("haiku"))return{rateCard:W["anthropic:claude-haiku-4.5"],source:"provider-default"};if(t?.includes("sonnet")||!t)return{rateCard:W["anthropic:claude-sonnet-4.5"],source:"provider-default"}}return{rateCard:null,source:"unknown"}}function j(e,t,s,a,i){const o=i==="subscription"?0:a;return{key:e,label:t,quantity:s,unit:"tokens",rate:a,billedRate:o,costUsd:s/1e6*a,billedCostUsd:s/1e6*o}}function x(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function ge(e){if(e.billingMode)return e.billingMode;const t=e.adapterType?.trim().toLowerCase();if(t==="claude-code"||t==="claude_stream_json")return"subscription";const s=e.usage?.planType?.trim().toLowerCase();return!s||s==="api"||s.includes("api")?"api":"subscription"}const Pe=1500,T=1440*6e4,Me=90*6e4,E={needs_attention:0,in_turn:1,in_flight:2,callable:3,blocked:4},be=[{key:"agent",label:"Agent",kind:"custom",sortable:!0,sortValue:e=>e.agent.name.toLowerCase(),defaultWidth:220,minWidth:160,render:e=>r.jsxs("div",{className:"s-ops-agents-agent-cell",children:[r.jsx("span",{className:"s-ops-agents-dot",style:{background:ee(e.state)},"aria-hidden":!0}),r.jsx("span",{className:"s-ops-agents-agent-name",title:e.agent.name,children:e.agent.handle??e.agent.name})]})},{key:"task",label:"Active task",kind:"custom",sortable:!0,sortValue:e=>(e.activeTask??"").toLowerCase()||null,defaultWidth:240,minWidth:140,render:e=>e.activeTask?r.jsx("span",{className:"s-ops-agents-task",title:e.activeTask,children:e.activeTask}):r.jsx("span",{className:"s-ops-agents-task s-ops-agents-task--idle",children:"—"})},{key:"team",label:"Project",kind:"text",defaultWidth:140,minWidth:90,cls:"s-ops-agents-meta",render:e=>r.jsx("span",{className:"s-ops-agents-meta-cell",children:e.team}),sortValue:e=>e.team.toLowerCase()},{key:"machine",label:"Machine",kind:"text",defaultWidth:120,minWidth:88,cls:"s-ops-agents-meta",render:e=>r.jsx("span",{className:"s-ops-agents-meta-cell",children:e.machine}),sortValue:e=>e.machine.toLowerCase()},{key:"active",label:"Active",kind:"number",defaultWidth:90,minWidth:64,cls:"s-ops-agents-num",render:e=>e.activeFlights,sortValue:e=>e.activeFlights},{key:"sessions24h",label:"24h sessions",kind:"number",defaultWidth:108,minWidth:78,cls:"s-ops-agents-num",render:e=>e.sessions24h,sortValue:e=>e.sessions24h},{key:"throughput",label:"Throughput",kind:"custom",sortable:!1,defaultWidth:110,minWidth:90,render:e=>r.jsx(ke,{values:e.throughput,warn:e.errors>0})},{key:"avgLatency",label:"Avg latency",kind:"number",defaultWidth:108,minWidth:80,cls:"s-ops-agents-num",render:e=>D(e.avgLatencyMs),sortValue:e=>e.avgLatencyMs},{key:"input",label:"Input",kind:"number",defaultWidth:88,minWidth:64,cls:"s-ops-agents-num",render:e=>w(e.usage.uncachedInput??e.usage.input),sortValue:e=>e.usage.uncachedInput??e.usage.input??null},{key:"cacheRead",label:"Cache read",kind:"number",defaultWidth:98,minWidth:72,cls:"s-ops-agents-num",render:e=>w(e.usage.cachedInput),sortValue:e=>e.usage.cachedInput??null},{key:"cacheWrite",label:"Cache write",kind:"number",defaultWidth:98,minWidth:72,cls:"s-ops-agents-num",render:e=>w(e.usage.cacheWrite),sortValue:e=>e.usage.cacheWrite??null},{key:"output",label:"Output",kind:"number",defaultWidth:88,minWidth:64,cls:"s-ops-agents-num",render:e=>w(e.usage.output),sortValue:e=>e.usage.output??null},{key:"apiEquiv",label:"API equiv",kind:"number",defaultWidth:92,minWidth:72,cls:"s-ops-agents-num",render:e=>r.jsx("span",{className:e.cost.rateCardSource==="unknown"?"s-ops-agents-num--dim":void 0,children:N(e.cost.totalUsd)}),sortValue:e=>e.cost.totalUsd??null},{key:"billed",label:"Billed",kind:"number",defaultWidth:92,minWidth:72,cls:"s-ops-agents-num",render:e=>r.jsx("span",{className:e.cost.billingMode==="subscription"?"s-ops-agents-num--covered":void 0,children:N(e.cost.billedTotalUsd)}),sortValue:e=>e.cost.billedTotalUsd??null},{key:"errors",label:"Errors",kind:"number",defaultWidth:72,minWidth:58,cls:"s-ops-agents-num",render:e=>r.jsx("span",{className:e.errors>0?"s-ops-agents-num--warn":void 0,children:e.errors}),sortValue:e=>e.errors},{key:"lastActive",label:"Last active",kind:"time",defaultWidth:104,minWidth:78,cls:"s-ops-agents-last",render:e=>e.lastActiveAt?re(e.lastActiveAt):"—",sortValue:e=>e.lastActiveAt}];function U(e){if(!e)return null;const t=e.replace(/\/+$/,""),s=t.lastIndexOf("/");return s>=0?t.slice(s+1):t}function w(e){return e==null?"—":e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}K`:String(e)}function D(e){return e==null?"—":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`}function N(e){return e==null?"$—":e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function fe(e,t){if(!e)return null;const s=e.data.events.filter(i=>i.kind==="message"||i.kind==="tool").filter(i=>t-i.t<=Me).sort((i,o)=>i.t-o.t);if(s.length<2)return null;const a=[];for(let i=1;i<s.length;i+=1){const o=s[i].t-s[i-1].t;o>0&&o<12e4&&a.push(o)}return a.length===0?null:Math.round(a.reduce((i,o)=>i+o,0)/a.length)}function ve(e,t){const s=new Array(24).fill(0),a=t-T;for(const i of e){if(i.ts<a||i.ts>t)continue;const o=Math.min(23,Math.max(0,Math.floor((i.ts-a)/T*s.length)));s[o]+=1}return s}function ke({values:e,warn:t=!1}){const i=Math.max(1,...e),o=e.map((c,h)=>{const m=h/Math.max(1,e.length-1)*92,b=22-c/i*19-1.5;return`${m.toFixed(1)},${b.toFixed(1)}`}).join(" ");return r.jsx("svg",{className:`s-ops-agents-spark${t?" s-ops-agents-spark--warn":""}`,viewBox:"0 0 92 22","aria-hidden":"true",children:r.jsx("polyline",{points:o,fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function xe(e){return e.authorityNodeName??e.homeNodeName??e.authorityNodeId??e.homeNodeId??e.transport??U(e.cwd)??U(e.projectRoot)??"local"}function We(e){return e.project??e.role??e.agentClass??"Unassigned"}function Se(e){if(e.length===0)return null;const t={working:0,needs_attention:1,queued:2,failed:3,completed:4},a=[...e].sort((o,c)=>{const h=t[o.status]-t[c.status];return h!==0?h:(c.updatedAt??0)-(o.updatedAt??0)})[0];return(a.task??a.summary??"").trim()||null}function we(e,t,s,a,i,o){const c=t.filter(l=>l.agentId===e.id),h=c.filter(l=>{const I=l.lastMessageAt??0;return I>0&&o-I<=T}),m=e.conversationId,b=s.filter(l=>l.actorName===e.name||!!(m&&l.conversationId===m)),g=i.get(e.id),{model:v,provider:f}=ie(e,g),P=he({adapterType:g?.data.metadata?.session?.adapterType,capturedAt:g?.updatedAt??o,model:v,provider:f,usage:g?.data.metadata?.usage}),d=a.filter(l=>l.agentId===e.id);return{agent:e,team:We(e),machine:xe(e),model:v,provider:f,state:Z(e.state),activeFlights:d.length,activeTask:Se(d),sessions24h:h.length,throughput:ve(b,o),avgLatencyMs:fe(g,o),usage:P.usage,cost:P,errors:d.filter(l=>l.status==="failed"||l.status==="needs_attention").length,lastActiveAt:Math.max(0,...c.map(l=>l.lastMessageAt??0),...b.map(l=>l.ts),e.updatedAt??0)||null}}function vt({navigate:e,agents:t}){const[s,a]=p.useState(null),[i,o]=p.useState([]),[c,h]=p.useState([]),[m,b]=p.useState([]),[g,v]=p.useState(""),[f,P]=p.useState(()=>Date.now()),d=p.useRef(null),l=p.useCallback(async()=>{const n=t.map(X=>X.id).join(","),[u,k,L,$]=await Promise.allSettled([A("/api/fleet"),A("/api/conversations"),A("/api/activity"),n?A(`/api/observe/agents?ids=${encodeURIComponent(n)}`):Promise.resolve([])]);u.status==="fulfilled"&&a(u.value),k.status==="fulfilled"&&o(k.value),L.status==="fulfilled"&&h(L.value),$.status==="fulfilled"&&b($.value),P(Date.now())},[t]);p.useEffect(()=>{l()},[l]);const I=p.useCallback(()=>{d.current||(d.current=setTimeout(()=>{d.current=null,l()},Pe))},[l]);te(I),p.useEffect(()=>()=>{d.current&&(clearTimeout(d.current),d.current=null)},[]),p.useEffect(()=>{const n=setInterval(()=>P(Date.now()),1e3);return()=>clearInterval(n)},[]);const R=p.useMemo(()=>new Map(m.map(n=>[n.agentId,n])),[m]),M=p.useMemo(()=>{const n=s?.activeAsks??[];return t.map(u=>we(u,i,c,n,R,f))},[c,t,s?.activeAsks,f,R,i]),S=p.useMemo(()=>{const n=g.trim().toLowerCase();return n?M.filter(u=>`${u.agent.name} ${u.team} ${u.machine} ${u.agent.handle??""} ${u.agent.harness??""} ${u.activeTask??""}`.toLowerCase().includes(n)):M},[g,M]),[K,F]=p.useState({key:"lastActive",dir:-1}),O=p.useMemo(()=>K?.key==="agent"?void 0:(n,u)=>E[n.state]-E[u.state],[K?.key]),q=p.useMemo(()=>S.map(n=>n.agent),[S]),B=p.useMemo(()=>S.map(n=>n.agent.id),[S]),y=ae({agents:q,orderedIds:B,navigate:e,selectMode:"preview"}),z=M.filter(n=>n.state==="in_turn"||n.state==="in_flight").length,H=M.filter(n=>J(n.agent.state,n.agent)).length,Y=M.reduce((n,u)=>n+(u.usage.total??0),0),_=M.some(n=>n.cost.totalUsd!=null)?M.reduce((n,u)=>n+(u.cost.totalUsd??0),0):null,G=M.some(n=>n.cost.billedTotalUsd!=null)?M.reduce((n,u)=>n+(u.cost.billedTotalUsd??0),0):null,Q=(()=>{const n=M.map(u=>u.avgLatencyMs).filter(u=>u!=null);return n.length===0?null:Math.round(n.reduce((u,k)=>u+k,0)/n.length)})();return r.jsxs("div",{className:"s-ops-agents",children:[r.jsxs("main",{className:"s-ops-agents-main",children:[r.jsxs("div",{className:"s-ops-agents-toolbar",children:[r.jsxs("div",{className:"s-ops-agents-breadcrumb",children:["Agents ",r.jsx("span",{children:"/"})," Directory"]}),r.jsxs("div",{className:"s-ops-agents-live",children:[r.jsx("span",{className:"s-ops-agents-live-dot"}),H," active"]}),r.jsxs("div",{className:"s-ops-agents-search",children:[r.jsx(se,{size:13}),r.jsx("input",{value:g,onChange:n=>v(n.target.value),placeholder:"Search agents, tasks, projects, machines…"})]}),r.jsx("button",{className:"s-ops-agents-icon-btn",type:"button",title:"Filters",children:r.jsx(oe,{size:14})})]}),r.jsx("section",{className:"s-ops-agents-hero",children:r.jsxs("div",{children:[r.jsx("div",{className:"s-ops-agents-kicker",children:"Agents"}),r.jsx("h1",{children:"All agents"}),r.jsx("p",{children:"Every registered agent across the local fleet, sorted by live status."})]})}),r.jsxs("section",{className:"s-ops-agents-stats",children:[r.jsx(C,{label:"Running",value:String(z),sub:`of ${t.length} total`}),r.jsx(C,{label:"Tokens",value:w(Y||null),sub:_==null?"usage metadata pending":`${N(_)} API equiv`}),r.jsx(C,{label:"Avg latency",value:D(Q),sub:"recent observe events"}),r.jsx(C,{label:"Billed",value:N(G),sub:"subscription usage can mark this down"})]}),r.jsxs("section",{className:"s-ops-agents-table-panel",children:[r.jsxs("div",{className:"s-ops-agents-table-title",children:["Agents ",r.jsx("span",{children:S.length}),r.jsxs("span",{className:"s-ops-agents-hint","aria-hidden":!0,children:[r.jsx("kbd",{children:"↑"}),r.jsx("kbd",{children:"↓"})," navigate · ",r.jsx("kbd",{children:"enter"})," pin · ",r.jsx("kbd",{children:"o"})," open · ",r.jsx("kbd",{children:"esc"})," clear"]})]}),r.jsx("div",{className:"s-ops-agents-table-wrap",ref:y.containerRef,children:r.jsx(ne,{rows:S,columns:be,rowId:n=>n.agent.id,storageKey:"openscout.opsAgents.cols",sort:K,onSortChange:F,secondarySort:O,density:"compact",rowBindings:n=>{const u=y.bind(n);return{...u,onKeyDown:k=>{k.key!=="Enter"&&k.key!==" "||(k.preventDefault(),u.onClick())}}},rowState:n=>y.getState(n),empty:{title:"No agents match",body:"Adjust the search to find a different slice of the fleet."},className:"s-ops-agents-data-table",ariaLabel:"Agents directory"})})]})]}),y.card]})}function C({label:e,value:t,sub:s,tone:a="default"}){return r.jsxs("div",{className:`s-ops-agents-metric s-ops-agents-metric--${a}`,children:[r.jsx("div",{className:"s-ops-agents-metric-label",children:e}),r.jsx("div",{className:"s-ops-agents-metric-value",children:t}),r.jsx("div",{className:"s-ops-agents-metric-sub",children:s})]})}export{vt as OpsAgentsView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as t}from"./index-C1VaWNuD.js";/* empty css */import{u as d}from"./Provider-D0bB7q6y.js";/* empty css */import{u as v}from"./page-status-BE0-J1xY.js";import{A as x}from"./AgentLanesView-96lHsoX7.js";import{MissionControlView as j}from"./MissionControlView-DmaThhNR.js";import{OpsAgentsView as f}from"./OpsAgentsView-vIoY-AW1.js";import{HostAdvisorView as w}from"./HostAdvisorView-DeJ-8RZV.js";import{AtopView as N}from"./AtopView-D7vyQDtE.js";import{TailView as c}from"./TailView-_gKWfaQM.js";import{u as g}from"./useContentSecondaryNav-CoIoz7JU.js";import{OpsSubnav as S}from"./OpsSubnav-CjDTnp64.js";import"./router-kfcaYqZr.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./api-Co9aQ2Jw.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./createLucideIcon-Dv8H8m7J.js";import"./conversation-model-C2KuZUXc.js";import"./time-Dhsh_2EG.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";/* empty css */import"./tail-events-LK29oCKm.js";import"./observe-BLmy4quB.js";import"./types-B0PlfpKc.js";import"./useEmbedHeadline-DuUnwTB7.js";import"./AgentAvatar-Dz79iTxB.js";import"./SpriteAvatar-DFO4Kb4Z.js";import"./CrewAvatar-CZ_faQ_s.js";import"./SessionObserve-BVeTkcIl.js";import"./bash-format-BRV5C6Gv.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-t7-XJP-h.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-BZ5SBMtc.js";import"./AgentDetailCard-8viaEY8b.js";import"./AgentLiveActions-DlSKL60c.js";import"./terminal-takeover-BMeBjBB2.js";import"./openContent-C6XO6kr5.js";import"./eye-C9cGk5z6.js";import"./terminal-UDy4lzV1.js";import"./message-markup-DC0QFEZn.js";import"./ObservedTopologyPanel-CJVqIqQ2.js";import"./ObserveTextFlow-DCJ5EmD8.js";import"./use-reduced-motion-CPoX8iV2.js";import"./proxy-DVDRhSRR.js";import"./SessionObserveEvidence-BkOezTGV.js";import"./message-circle-joGFxfj1.js";import"./wrench-BfVeded5.js";import"./external-link-BvX5PfLh.js";import"./AgentFloorView-DuyvyMMj.js";/* empty css */import"./agent-lanes-model-tc-1hE6q.js";import"./context-budget-DqxWzalx.js";import"./lane-roster-store-DN2jxXF-.js";import"./AgentLanesPreflight-CCGBArIb.js";import"./AgentLaneChrome-Dv2lBFoH.js";import"./AgentLaneCard-Cc9uyfBr.js";/* empty css */import"./AgentLaneSummaryResize-Di4u6df2.js";import"./clipboard-e3fSpeo7.js";import"./agent-lane-card-model-CY3OE1Xu.js";import"./agent-lane-preview-BhplDYGf.js";import"./agent-lane-detail-ppJId6Jc.js";import"./AgentLaneDetailSheet-CGqtqSHQ.js";import"./SlidePanel-CETQ5NTx.js";import"./LaneTraceDetailSheet-DNIECgEl.js";import"./LaneTraceEventFocus-BB5DhFQm.js";/* empty css */import"./mission-control-store-CM8mQGg8.js";import"./MissionContextRail-DnCWPzAM.js";import"./mission-wall-CocIM1cF.js";import"./mission-control-model-C0fByIjm.js";import"./MissionFocusOverlay-K21ssTxv.js";import"./MissionLogPane-BLvSSIdT.js";/* empty css */import"./DataTable-C6aMSilS.js";/* empty css */import"./useAgentHoverCard-BgTLNcF-.js";import"./sliders-horizontal-57e99_qO.js";/* empty css */import"./compass-BdpImt_W.js";import"./layout-grid-BoVnPOk-.js";import"./refresh-cw-Bkh7Cvnd.js";import"./arrow-up-right-B09GPwFl.js";import"./cpu-CHFIGw87.js";import"./gauge-DSflSery.js";/* empty css */import"./SecondaryNav-Cs0_FQdj.js";import"./secondaryNavConfig-C0Srrmy8.js";import"./message-square-BLiFqpe_.js";import"./settings-DQEtqkM9.js";import"./git-branch-Bc_eDIpG.js";import"./scroll-text-DFcBYy5J.js";const A=220;function F(){const r=v(),o=!!(r.hover||r.content),[i,p]=n.useState(o?{hover:r.hover,content:r.content}:null),[e,s]=n.useState(o?"enter":"hidden"),m=n.useRef(null);if(n.useEffect(()=>{if(o){m.current&&(clearTimeout(m.current),m.current=null),p({hover:r.hover,content:r.content}),s(h=>h==="show"?"show":"enter");const u=requestAnimationFrame(()=>s("show"));return()=>cancelAnimationFrame(u)}return s("leave"),m.current=setTimeout(()=>{s("hidden"),p(null),m.current=null},A),()=>{m.current&&(clearTimeout(m.current),m.current=null)}},[o,r.hover,r.content]),e==="hidden"||!i)return null;const a=i.hover?.label??i.hover?.route??null,l=i.hover?.label&&i.hover?.route?i.hover.route:null;return t.jsxs("div",{className:`s-page-status s-page-status--${e}`,role:"status","aria-live":"polite",children:[t.jsx("div",{className:"s-page-status-left",children:a&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"s-page-status-arrow","aria-hidden":!0,children:"→"}),t.jsx("span",{className:"s-page-status-target",children:a}),l&&t.jsx("span",{className:"s-page-status-route",children:l})]})}),t.jsx("div",{className:"s-page-status-right",children:i.content&&t.jsx("span",{className:"s-page-status-content",children:i.content})})]})}function Ur({navigate:r,mode:o="mission",tailQuery:i}){const{agents:p,route:e}=d(),s=g();return t.jsxs("div",{className:"s-ops",children:[s?t.jsx("div",{className:"s-ops-header",children:t.jsx(S,{activeRoute:e,navigate:r})}):null,t.jsxs("div",{className:"s-ops-body",children:[o==="mission"&&t.jsx(j,{navigate:r,agents:p}),o==="agents"&&t.jsx(f,{navigate:r,agents:p}),o==="advisor"&&t.jsx(w,{navigate:r,agents:p}),o==="issues"&&t.jsx(c,{navigate:r,initialFilter:i,variant:"issues"}),o==="tail"&&t.jsx(c,{navigate:r,initialFilter:i,variant:"tail"}),o==="atop"&&t.jsx(N,{}),o==="lanes"&&t.jsx(x,{navigate:r,agents:p})]}),t.jsx(F,{})]})}export{Ur as OpsScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./index-C1VaWNuD.js";import{S as p}from"./SecondaryNav-Cs0_FQdj.js";import{O as i}from"./secondaryNavConfig-C0Srrmy8.js";/* empty css */import"./createLucideIcon-Dv8H8m7J.js";import"./message-square-BLiFqpe_.js";import"./file-text-BHro8MkG.js";import"./search-FB2vVxCp.js";import"./compass-BdpImt_W.js";import"./settings-DQEtqkM9.js";import"./terminal-UDy4lzV1.js";import"./git-branch-Bc_eDIpG.js";import"./code-xml-CkkNdRmu.js";import"./scroll-text-DFcBYy5J.js";function v({activeRoute:r,navigate:o}){return t.jsx(p,{ariaLabel:"Ops sections",activeRoute:r,groups:i,navigate:o})}export{v as OpsSubnav};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m,j as o}from"./index-C1VaWNuD.js";import{a as A}from"./api-Co9aQ2Jw.js";import{u as b,i as S}from"./Provider-D0bB7q6y.js";import{b as y}from"./router-kfcaYqZr.js";import{u as P}from"./sse-B29iGBnw.js";import{AgentsSubnav as N}from"./AgentsSubnav-Ci7uWM7P.js";import{AgentDetailWithRail as B,AgentProfileSessionsCenter as E}from"./profile-BCvk8jOQ.js";import{r as R,d as C,b as M}from"./NewChatComposer-D2Ah4T-W.js";/* empty css *//* empty css *//* empty css */import{ProjectAgentProfileBar as w}from"./ProjectAgentProfileBar-CUzZ4Rpx.js";/* empty css */import"./perf-PX8Rx0EP.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D7kGGyK_.js";import"./model-CBkMvT1w.js";import"./time-Dhsh_2EG.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./createLucideIcon-Dv8H8m7J.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./file-text-BHro8MkG.js";import"./x-DgmmnPKt.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-B8sQ_8IF.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./index-BWHgHrtv.js";import"./SecondaryNav-Cs0_FQdj.js";import"./secondaryNavConfig-C0Srrmy8.js";import"./message-square-BLiFqpe_.js";import"./search-FB2vVxCp.js";import"./compass-BdpImt_W.js";import"./settings-DQEtqkM9.js";import"./terminal-UDy4lzV1.js";import"./git-branch-Bc_eDIpG.js";import"./scroll-text-DFcBYy5J.js";import"./AgentAvatar-Dz79iTxB.js";import"./SpriteAvatar-DFO4Kb4Z.js";import"./CrewAvatar-CZ_faQ_s.js";import"./HarnessMark-DttReffF.js";import"./context-budget-DqxWzalx.js";import"./session-catalog-CG4oL_yN.js";import"./terminal-relay-CXHMdain.js";import"./BackToPicker-BHicJyfc.js";import"./openContent-C6XO6kr5.js";import"./ConversationScreen-DIU7m_aC.js";import"./runtime-picker-C20lTGhV.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./ConversationComposer-BUIjWMBi.js";import"./index-Cx6Gbr6n.js";import"./zap-Bcja1lHG.js";import"./conversation-model-C2KuZUXc.js";import"./message-markup-DC0QFEZn.js";import"./mentions-BZ5SBMtc.js";import"./AgentDetailCard-8viaEY8b.js";import"./AgentLiveActions-DlSKL60c.js";import"./terminal-takeover-BMeBjBB2.js";import"./eye-C9cGk5z6.js";import"./message-visibility-CGOmSSKs.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";import"./ConversationHeader-Bt2RBj93.js";import"./AstronautSuit-CwB4Dw07.js";import"./ConversationFeedRows-Bx0gFyG_.js";import"./ConversationPanels-o6W-cOoU.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CPoX8iV2.js";import"./proxy-DVDRhSRR.js";import"./chevron-down-D120PY4g.js";import"./activity-CzTJ-YMX.js";import"./message-circle-joGFxfj1.js";import"./tail-events-LK29oCKm.js";import"./ConversationStatus-CTYOywFh.js";import"./check-Dz2SRHft.js";import"./sparkles-D0vWLTyC.js";import"./SessionObserve-BVeTkcIl.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-t7-XJP-h.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CJVqIqQ2.js";import"./ObserveTextFlow-DCJ5EmD8.js";import"./SessionObserveEvidence-BkOezTGV.js";import"./wrench-BfVeded5.js";import"./external-link-BvX5PfLh.js";/* empty css */import"./AgentDefinitionsWorkspace-DHDS9Pgd.js";import"./agent-specialization-CtF_jI34.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-CxNbcTYf.js";import"./agent-essentials-K9B6kbTS.js";import"./NewChatOrigin-DCn5cWPZ.js";function Mo({route:t,navigate:r}){const{agents:e}=b(),p=y(t),n=m.useMemo(()=>S(e,p),[e,p]),[f,g]=m.useState([]),a=m.useCallback(async()=>{const s=await A("/api/conversations").catch(()=>[]);g(s)},[]);m.useEffect(()=>{a()},[a]),P(()=>{a()});const i=R(n,t.agentId),c=!!(t.agentId&&i&&i.id!==t.agentId),{conversationByAgentId:j}=C(f);if(m.useEffect(()=>{!t.agentId||!i||!c||r({...t,view:"agents-v2",agentId:i.id})},[r,t,i,t.agentId,c]),!i)return o.jsx(v,{activeRoute:t,navigate:r,children:o.jsx("div",{className:"av2-empty",children:"Agent not found."})});const d=t.conversationId??j.get(i.id)??i.conversationId??null,l=t.tab??(t.conversationId?"message":"profile");return o.jsx("div",{className:"s-av2-profileShell",children:o.jsx(v,{activeRoute:t,navigate:r,bar:o.jsx(w,{agent:i,conversationId:d,activeTab:l,route:t,navigate:r}),children:o.jsx("div",{className:"av2-profileCanvas",children:o.jsx(B,{agent:i,allAgents:n,conversationId:d,navigate:r,activeTab:l,renderProfile:({agent:s,sessionCatalog:x,conversationId:h,navigate:I,route:u})=>o.jsx(E,{agent:s,name:M(s,n).name,sessionCatalog:x,conversationId:h,navigate:I,route:u,homeView:"agents-v2"})})})})})}function v({activeRoute:t,children:r,navigate:e,bar:p}){return o.jsxs("div",{className:"s-secondary-nav-shell",children:[o.jsx("div",{className:"s-secondary-nav-bar",children:p??o.jsx(N,{activeRoute:t,navigate:e})}),o.jsx("div",{className:"s-secondary-nav-body",children:r})]})}export{Mo as ProjectAgentProfile};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as e}from"./index-C1VaWNuD.js";import{i as y,c as L}from"./colors-BtO5_zlx.js";import{a as u}from"./api-Co9aQ2Jw.js";import{u as T}from"./sse-B29iGBnw.js";import{t as P}from"./time-Dhsh_2EG.js";import{o as R}from"./openContent-C6XO6kr5.js";import{A as E}from"./AgentAvatar-Dz79iTxB.js";import{H as O}from"./HarnessMark-DttReffF.js";import{n as V}from"./NewChatComposer-D2Ah4T-W.js";import{h as B}from"./model-CBkMvT1w.js";import"./perf-PX8Rx0EP.js";import"./index-BWHgHrtv.js";import"./Provider-D0bB7q6y.js";import"./router-kfcaYqZr.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D7kGGyK_.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./createLucideIcon-Dv8H8m7J.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./file-text-BHro8MkG.js";import"./x-DgmmnPKt.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-B8sQ_8IF.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./SpriteAvatar-DFO4Kb4Z.js";import"./CrewAvatar-CZ_faQ_s.js";import"./runtime-picker-C20lTGhV.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./conversation-model-C2KuZUXc.js";import"./index-Cx6Gbr6n.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";function U(s){return s?s.startsWith("/Users/")?`~/${s.split("/").slice(3).join("/")}`:s:null}function _(s){const a=s.model?.trim();if(!a)return null;const o=s.harness?.trim();return o&&a.startsWith(`${o}-`)?a.slice(o.length+1).replace(/-\d{8}$/,""):a.replace(/^claude-/,"").replace(/-\d{8}$/,"")}function g(s){const a=new Map;for(const o of s){if(o.kind!=="tool"||!o.tool)continue;const t=o.tool.toLowerCase();a.set(t,(a.get(t)??0)+1)}return[...a.entries()].sort((o,t)=>t[1]-o[1]||o[0].localeCompare(t[0])).map(([o])=>o).slice(0,6)}function i({label:s,value:a,title:o}){return a?.trim()?e.jsxs("div",{className:"av2-coreMetaItem",title:o??a,children:[e.jsx("span",{className:"av2-coreMetaLabel",children:s}),e.jsx("span",{className:"av2-coreMetaValue",children:a})]}):null}function Ss({agent:s,route:a,navigate:o}){const[t,h]=c.useState(null),[C,v]=c.useState(null),m=c.useCallback(async()=>{const[r,l]=await Promise.all([u(`/api/agents/${encodeURIComponent(s.id)}/observe`).catch(()=>null),u(`/api/agents/${encodeURIComponent(s.id)}/session-catalog`).catch(()=>null)]);h(r),v(l)},[s.id]);c.useEffect(()=>{h(null),v(null),m()},[m]),T(()=>{m()});const p=s.handle?.trim().replace(/^@+/,"")||null,j=p?`@${p}`:s.name,n=s.harness?B(s.harness):null,H=_(s),w=U(s.cwd??s.projectRoot),M=(s.homeNodeName??s.authorityNodeName??"").replace(/\.local$/i,"").replace(/-local-openscout$/i,""),I=y(s.state),k=L(s.state,s),x=t?.data.events??[],d=c.useMemo(()=>g(x),[x]),f=t?.data.metadata?.usage??null,N=(()=>{const r=f?.contextWindowTokens??0,l=f?.contextInputTokens??0;return!r||r<=0||l<=0?null:Math.min(100,Math.max(0,Math.round(l/r*100)))})(),A=C?.sessions?.length??0,$=s.transport==="claude_stream_json"?"stream-json":s.transport==="codex_app_server"?"app-server":s.transport?.trim()||null,S=async()=>{try{const r=await u("/api/sessions",{method:"POST",body:JSON.stringify(V(s))}),l=r.sessionId?.trim();if(l){R(o,{view:"sessions",sessionId:l},{returnTo:a});return}const b=r.conversationId?.trim();o({...a,view:"agents-v2",agentId:r.agentId?.trim()||s.id,...b?{conversationId:b}:{},tab:"message"})}catch{}};return e.jsxs("header",{className:"av2-profileHero",children:[e.jsx(E,{agent:s,size:56,tile:!0,presence:!0}),e.jsxs("div",{className:"av2-profileHeroCore",children:[e.jsxs("div",{className:"av2-profileHeroTop",children:[e.jsxs("div",{className:"av2-profileHeroIdent",children:[e.jsx("h1",{className:"av2-profileHeroTitle",title:j,children:j}),e.jsxs("span",{className:"av2-profileHeroState","data-online":I||void 0,children:[e.jsx("span",{className:"av2-profileHeroDot","aria-hidden":!0}),k,s.updatedAt?` · ${P(s.updatedAt)}`:""]}),p&&s.name.toLowerCase()!==p.toLowerCase()?e.jsx("span",{className:"av2-profileHeroBroker",title:s.id,children:s.name}):e.jsx("span",{className:"av2-profileHeroBroker",title:s.id,children:s.id})]}),e.jsxs("div",{className:"av2-profileHeroActions",children:[e.jsx("button",{type:"button",className:"av2-heroGhost",onClick:()=>o({...a,view:"agents-v2",agentId:s.id,tab:"config"}),children:"Edit config"}),e.jsx("button",{type:"button",className:"av2-heroCta",onClick:()=>{S()},children:"+ New session"})]})]}),e.jsxs("div",{className:"av2-profileHeroMeta",children:[e.jsx(i,{label:"Project",value:s.project?`/${s.project}`:null}),e.jsx(i,{label:"Branch",value:s.branch}),e.jsx(i,{label:"Harness",value:n?n.charAt(0).toUpperCase()+n.slice(1):null,title:s.harness??void 0}),e.jsx(i,{label:"Model",value:H}),e.jsx(i,{label:"Host",value:M||null}),e.jsx(i,{label:"Root",value:w,title:s.cwd??s.projectRoot??void 0}),e.jsx(i,{label:"Transport",value:$})]}),e.jsxs("div",{className:"av2-profileHeroSignal",children:[n?e.jsx("span",{className:"av2-signalMark",title:s.harness??n,children:e.jsx(O,{harness:n,size:12})}):null,e.jsxs("span",{className:"av2-signalChip",children:[e.jsx("span",{className:"av2-signalLabel",children:"Sessions"}),e.jsx("span",{className:"av2-signalValue",children:A})]}),N!=null?e.jsxs("span",{className:"av2-signalChip",children:[e.jsx("span",{className:"av2-signalLabel",children:"Ctx"}),e.jsxs("span",{className:"av2-signalValue",children:[N,"%"]})]}):null,d.length>0?e.jsxs("span",{className:"av2-signalChip av2-signalChip--wide",title:d.join(" · "),children:[e.jsx("span",{className:"av2-signalLabel",children:"Tools"}),e.jsx("span",{className:"av2-signalValue",children:d.join(" · ")})]}):t?e.jsxs("span",{className:"av2-signalChip",children:[e.jsx("span",{className:"av2-signalLabel",children:"Tools"}),e.jsx("span",{className:"av2-signalValue",children:"—"})]}):null]})]})]})}export{Ss as ProjectAgentProfileHero};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as h,j as s}from"./index-C1VaWNuD.js";import{A as Me}from"./AgentAvatar-Dz79iTxB.js";import{H as ge}from"./HarnessMark-DttReffF.js";import{a as Ee}from"./api-Co9aQ2Jw.js";import{r as Ie,i as $e}from"./ui-LM8pS8qE.js";import{t as _,d as We,n as ee}from"./time-Dhsh_2EG.js";import{p as Fe,l as Be,s as De,f as Oe}from"./terminal-sessions-Bdt2W3Y4.js";import{r as ze,y as Z,z as ae,A as He,s as re,c as le,B as qe,E as be,F as Ge,G as _e,d as Ve,u as Ke}from"./Provider-D0bB7q6y.js";import{o as Ue}from"./openContent-C6XO6kr5.js";import{p as J}from"./NewChatComposer-D2Ah4T-W.js";import{SessionRefScreen as Xe}from"./SessionRefScreen-DetLMkTT.js";import{P as Ye,C as Ze}from"./CrewWorkspaces-DNX-QQ1h.js";import{r as X,s as V}from"./project-overview-helpers-BQTc_Ous.js";import{u as Je,r as Qe}from"./projects-inbox-DFbgVlXL.js";import{u as es}from"./useEmbedHeadline-DuUnwTB7.js";import{g as ss,a as ts,f as ce,b as ns}from"./api-HFH8wFyb.js";import{f as is}from"./cache-CeWH_KzJ.js";import{A as ue}from"./arrow-up-right-B09GPwFl.js";import{C as os}from"./chevron-right-CowuvuE6.js";import{F as as}from"./AddProjectForm-fXndbzXT.js";import{S as rs}from"./search-FB2vVxCp.js";import{A as ls}from"./arrow-right-DTX42clh.js";import{E as cs}from"./external-link-BvX5PfLh.js";import{F as us}from"./DocumentFocusViewer-D8iB6SMt.js";import"./SpriteAvatar-DFO4Kb4Z.js";import"./colors-BtO5_zlx.js";import"./CrewAvatar-CZ_faQ_s.js";import"./perf-PX8Rx0EP.js";import"./router-kfcaYqZr.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D7kGGyK_.js";import"./model-CBkMvT1w.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./file-text-BHro8MkG.js";import"./createLucideIcon-Dv8H8m7J.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-B8sQ_8IF.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./runtime-picker-C20lTGhV.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./conversation-model-C2KuZUXc.js";import"./index-Cx6Gbr6n.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./tail-events-LK29oCKm.js";import"./BackToPicker-BHicJyfc.js";import"./ConversationScreen-DIU7m_aC.js";import"./ConversationComposer-BUIjWMBi.js";import"./zap-Bcja1lHG.js";import"./message-markup-DC0QFEZn.js";import"./mentions-BZ5SBMtc.js";import"./AgentDetailCard-8viaEY8b.js";import"./AgentLiveActions-DlSKL60c.js";import"./terminal-takeover-BMeBjBB2.js";import"./eye-C9cGk5z6.js";import"./terminal-UDy4lzV1.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-Bt2RBj93.js";import"./AstronautSuit-CwB4Dw07.js";import"./ConversationFeedRows-Bx0gFyG_.js";import"./ConversationPanels-o6W-cOoU.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CPoX8iV2.js";import"./proxy-DVDRhSRR.js";import"./activity-CzTJ-YMX.js";import"./message-circle-joGFxfj1.js";import"./ConversationStatus-CTYOywFh.js";import"./check-Dz2SRHft.js";import"./sparkles-D0vWLTyC.js";import"./SessionObserve-BVeTkcIl.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-t7-XJP-h.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CJVqIqQ2.js";import"./ObserveTextFlow-DCJ5EmD8.js";import"./SessionObserveEvidence-BkOezTGV.js";import"./wrench-BfVeded5.js";import"./session-ref-lookup-state-SATH_jAP.js";/* empty css */import"./agent-specialization-CtF_jI34.js";import"./sliders-horizontal-57e99_qO.js";import"./message-square-BLiFqpe_.js";function de(e){const t=e?.trim();if(!t)return null;const i=t.split(/[\\/]/u).filter(Boolean).at(-1)??t;return i.endsWith(".jsonl")?i.slice(0,-6):i}function ds(e){return e.surfaces.filter(t=>t.backend==="tmux")}function ps(e,t){return{terminalSessionId:e.id,terminalSurfaceKey:De(t),sessionName:t.sessionName}}function ms(e,t){const i=de(t.agentId),n=new Set(t.sessionRefs.map(de).filter(r=>!!r)),o=i?.split(".",1)[0]??null;o?.startsWith("session-")&&n.add(o);for(const r of e){const a=ds(r).find(c=>n.has(c.sessionName));if(a)return ps(r,a)}return null}function hs(e,t){const i=Fe(e.terminalSurfaceKey);return i?`scout://terminal?${new URLSearchParams({session:e.terminalSessionId,surface:Be(i),mode:t}).toString()}`:null}const fs=1e4,js=2e4,xs=6e4,gs=15e3,bs=45e3,vs=["branch","unstaged","staged"];function te(e){const t=()=>{document.visibilityState==="visible"&&e()};return window.addEventListener("focus",t),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",t)}}function ws(e,t){const i=new Set;for(const n of[e,...t]){const o=n?.trim();o&&i.add(o.replace(/\/+$/u,""))}return[...i].slice(0,6)}function Ns(e){return e.replace(/\/+$/u,"").split("/").pop()?.toLocaleLowerCase()??e.toLocaleLowerCase()}function ks(e,t,i){return e.path===t||i?.worktrees.some(o=>o.path===e.path)?!0:e.repo.split("/").pop()?.toLocaleLowerCase()===(i?.name.toLocaleLowerCase()??Ns(t))}function Q(e){return e&&typeof e=="object"&&"name"in e&&e.name==="AbortError"?"The repository scan timed out.":e instanceof Error?e.message:String(e)}function Ss(e,t=[]){const i=ws(e,t).join("\0"),n=h.useMemo(()=>i?i.split("\0"):[],[i]),[o,r]=h.useState(()=>ss()),[a,c]=h.useState(()=>ts()),[m,f]=h.useState(!!(e&&!X(o,e))),[j,x]=h.useState(!!e),[w,y]=h.useState(!!e),[T,L]=h.useState(null),[S,E]=h.useState(null),[W,P]=h.useState(()=>new Map),[B,A]=h.useState(()=>new Map),[N,D]=h.useState(0),I=h.useRef(null),k=h.useCallback(()=>{I.current=null,D(d=>d+1)},[]);h.useEffect(()=>{if(!e){f(!1),L(null);return}let d=!1,p=!1,R=!0;const M=async()=>{if(p)return;p=!0,d||(f(!0),L(null));let O=null;try{let F=null;const z=N>0&&R;R=!1;try{F=await ce("standard",z,gs)}catch(C){O=Q(C)}if((!F||!X(F,e))&&I.current!==e){I.current=e;try{const C=await ce("expanded",z,bs);X(C,e)&&(F=C)}catch(C){O=Q(C)}}!d&&F&&r(C=>X(F,e)?F:C&&X(C,e)?C:F),!d&&!X(F,e)&&L(O??"Repo Watch did not include this project in its latest scan.")}finally{p=!1,d||f(!1)}};M();const l=window.setInterval(()=>{document.visibilityState==="visible"&&M()},fs),$=te(()=>{M()});return()=>{d=!0,window.clearInterval(l),$()}},[e,N]),h.useEffect(()=>{if(n.length===0){y(!1),A(new Map);return}let d=!1,p=!1,R=!0;const M=async()=>{if(p)return;p=!0,d||y(!0);const O=await Promise.allSettled(n.map(F=>is(F,[...vs],{force:N>0&&R,tier:"summary"})));if(R=!1,!d){const F=new Map,z=new Map;O.forEach((C,K)=>{const q=n[K];C.status==="fulfilled"?F.set(q,C.value.snapshot):z.set(q,Q(C.reason))}),P(C=>{const K=new Map(C);for(const q of n)K.delete(q);for(const[q,se]of F)K.set(q,se);return K}),A(z),y(!1)}p=!1};M();const l=window.setInterval(()=>{document.visibilityState==="visible"&&M()},js),$=te(()=>{M()});return()=>{d=!0,window.clearInterval(l),$()}},[n,N]),h.useEffect(()=>{if(n.length===0){x(!1),E(null);return}let d=!1,p=!1;const R=async()=>{if(!p){p=!0;try{const $=await ns(n);d||(c($),E(null))}catch($){d||E(Q($))}finally{p=!1,d||x(!1)}}};x(!0),E(null),R();const M=window.setInterval(()=>{document.visibilityState==="visible"&&R()},xs),l=te(()=>{R()});return()=>{d=!0,window.clearInterval(M),l()}},[n,N]);const u=h.useMemo(()=>X(o,e),[e,o]),g=h.useMemo(()=>e?(a?.pullRequests??[]).filter(d=>ks(d,e,u)):[],[u,e,a]),b=h.useMemo(()=>{const d=a?.paths.some(p=>n.includes(p))?a.warnings:[];return S?[S,...d]:d},[n,S,a]);return{project:u,pullRequests:g,pullRequestsLoading:j,pullRequestWarnings:b,repoLoading:m,repoError:T,diffSnapshots:W,diffErrors:B,diffLoading:w,refresh:k}}const ys=[];function Cs(e,t){return e.thread===t.thread&&e.crossProject===t.crossProject&&e.selected===t.selected&&e.cursor===t.cursor&&e.nowMs===t.nowMs&&e.workLabel===t.workLabel}const As=h.memo(function({thread:t,crossProject:i,selected:n,cursor:o,nowMs:r,onSelect:a,onOpen:c,rowRef:m,workLabel:f}){return s.jsxs("button",{ref:m,type:"button",className:"pi-row","data-state":t.group,"data-selected":n||void 0,"data-cursor":o||void 0,onClick:a,onDoubleClick:c,children:[s.jsx("span",{className:"pi-rowDot","aria-hidden":!0}),s.jsxs("span",{className:"pi-rowBody",children:[s.jsx("span",{className:"pi-rowWork",title:t.work,children:f??t.work}),s.jsxs("span",{className:"pi-rowAttr",children:[s.jsx("span",{className:"pi-rowAvatar",children:s.jsx(Me,{agent:{name:t.agentName,harness:t.harness,state:t.working?"in_turn":null},placement:"row",size:22})}),s.jsx("span",{className:"pi-rowAgent",title:t.agentName,children:t.agentName}),s.jsx("span",{className:"pi-rowHmark","aria-hidden":!0,children:s.jsx(ge,{harness:t.harness,size:11})}),i?s.jsxs("span",{className:"pi-rowChip",title:`/${t.projectTitle}`,children:["/",t.projectTitle]}):t.branch?s.jsx("span",{className:"pi-rowBranch",title:t.branch,children:t.branch}):null]})]}),s.jsxs("span",{className:"pi-rowVitals",children:[t.working?s.jsx("span",{className:"pi-rowLiveTag",children:"live"}):null,s.jsx("span",{className:"pi-rowAgo",children:t.lastActivityAt?_(t.lastActivityAt,r):"—"}),t.contextPct!=null?s.jsxs("span",{className:"pi-rowCtx",children:[t.contextPct,"%"]}):null]}),s.jsxs("span",{className:"pi-rowOpen","aria-hidden":!0,children:[s.jsx("span",{children:"Open"}),s.jsx(os,{size:14,strokeWidth:1.8})]})]})},Cs);function pe({title:e,detail:t,tone:i="muted"}){return s.jsxs("div",{className:"pi-stateBlock","data-tone":i,role:i==="loading"?"status":"note",children:[s.jsx("span",{className:"pi-statePulse","aria-hidden":!0}),s.jsx("span",{className:"pi-stateTitle",children:e}),t?s.jsx("span",{className:"pi-stateDetail",children:t}):null]})}function Rs({rows:e=7}){return s.jsxs("div",{className:"pi-loadingRows","aria-hidden":"true",children:[s.jsxs("div",{className:"pi-sectionHead pi-sectionHead--loading",children:[s.jsx("span",{className:"pi-loadingLine pi-loadingLine--label"}),s.jsx("span",{className:"pi-loadingLine pi-loadingLine--count"})]}),Array.from({length:e},(t,i)=>s.jsxs("div",{className:"pi-row pi-row--loading",children:[s.jsx("span",{className:"pi-rowDot"}),s.jsxs("span",{className:"pi-rowBody",children:[s.jsx("span",{className:"pi-loadingLine pi-loadingLine--title"}),s.jsx("span",{className:"pi-loadingLine pi-loadingLine--meta"})]}),s.jsx("span",{className:"pi-rowVitals",children:s.jsx("span",{className:"pi-loadingLine pi-loadingLine--time"})})]},i))]})}function Ts({route:e,navigate:t,slug:i,model:n,mode:o,repoProject:r}){const a=n.projects.find(S=>S.slug===i)??null,m=Z(n.threads,i).filter(S=>S.kind==="agent"),f=a?.title??i,j=a?.root??null,x=(a?.agentCount??m.length)>0,w=e.machineId?{machineId:e.machineId}:{},y={view:"agents-v2",projectSlug:i,...w},T=Ls(a?.needs??0,Math.max(a?.working??0,a?.liveSessionCount??0),a?.agentCount??(m.length>0?1:0),a?.sessionCount??0),L=r?.worktrees.length??a?.worktreeCount??0;return s.jsxs("header",{className:"pi-projectHead",children:[s.jsx("div",{className:"pi-projectHeadTop",children:s.jsxs("div",{className:"pi-projectIdent",children:[s.jsx("h1",{className:"pi-projectTitle",children:f}),s.jsxs("div",{className:"pi-projectMeta",children:[j?s.jsx("span",{title:j,children:V(j)}):null,s.jsx("span",{className:"pi-projectDigest",children:T})]})]})}),s.jsxs("div",{className:"pi-projectFacets","aria-label":"Project sections",children:[s.jsx("button",{type:"button",className:"pi-projectFacet","data-selected":o==="overview"||void 0,onClick:()=>t(y),children:s.jsx("span",{children:"Overview"})}),s.jsxs("button",{type:"button",className:"pi-projectFacet","data-selected":o==="sessions"||void 0,onClick:()=>t({...y,indexView:"sessions"}),children:[s.jsx("span",{children:"Sessions"}),s.jsx("b",{children:a?.sessionCount??0})]}),x?s.jsxs("button",{type:"button",className:"pi-projectFacet","data-selected":o==="agents"||void 0,onClick:()=>t({...y,indexView:"agents"}),children:[s.jsx("span",{children:"Agents"}),s.jsx("b",{children:a?.agentCount??m.length})]}):null,s.jsxs("button",{type:"button",className:"pi-projectFacet",title:"Open worktrees in Repos",onClick:()=>t({view:"repos",...j?{root:j}:{},...w}),children:[s.jsx("span",{children:"Worktrees"}),s.jsx("b",{children:L}),s.jsx(ue,{className:"pi-projectFacetOut",size:11,strokeWidth:2,"aria-hidden":!0})]}),s.jsxs("button",{type:"button",className:"pi-projectFacet",disabled:!j,title:j?"Open this project's AGENTS.md":"No project root known",onClick:()=>t({view:"code",project:i,path:"AGENTS.md"}),children:[s.jsx("span",{children:"Rules"}),s.jsx("b",{children:j?"set":"—"}),s.jsx(ue,{className:"pi-projectFacetOut",size:11,strokeWidth:2,"aria-hidden":!0})]})]})]})}function Ls(e,t,i,n){const o=[];return t>0&&o.push(s.jsxs("b",{children:[t," active"]},"w")),e>0&&o.push(s.jsxs("b",{children:[e," needs you"]},"n")),o.push(s.jsxs("span",{children:[i," agent",i===1?"":"s"]},"a")),o.push(s.jsxs("span",{children:[n," session",n===1?"":"s"]},"s")),o.reduce((r,a,c)=>(c>0&&r.push(s.jsx("span",{children:" · "},`sep${c}`)),r.push(a),r),[])}function ve(e){if(e.length<=18)return e;const t=e.match(/^([0-9a-f]{8})-[0-9a-f-]{27,}$/iu);return t?t[1]:`${e.slice(0,10)}…${e.slice(-5)}`}function Ps(e,t){return`${t?0:e.projects.length} tracked`}function Ms({route:e,navigate:t,projects:i}){const{onboarding:n,refreshOnboarding:o,reload:r}=Ke(),a=Es(n?.defaultHarness),[c,m]=h.useState(""),[f,j]=h.useState(""),[x,w]=h.useState(a),[y,T]=h.useState(!1),[L,S]=h.useState(null),[E,W]=h.useState(null),[P,B]=h.useState(null);h.useEffect(()=>{w(a)},[a]);const A=h.useMemo(()=>Is(i),[i]),N=h.useMemo(()=>$s(A,c),[c,A]),D=h.useMemo(()=>A.find(l=>l.slug===f)??he(A,c),[c,A,f]),I=c.trim(),k=Fs(I)&&!he(A,I),u=D??(!k&&I?N[0]??null:null),g=u?"Open project":k?"Create project":"Find project",b=!!(u||k||I);h.useEffect(()=>{f&&(A.some(l=>l.slug===f)||j(""))},[A,f]),h.useEffect(()=>{if(!P)return;const l=A.find($=>Bs($,P));l&&(B(null),t(me(e,l.slug)))},[P,t,A,e]);const d=l=>{j(l.slug),m(l.title),S(null),W(null)},p=l=>{t(me(e,l.slug))},R=async l=>{T(!0),S(null),W(null);try{await Ee("/api/onboarding/project",{method:"POST",body:JSON.stringify({contextRoot:l,sourceRoots:[l],defaultHarness:x})}),B(l),W("Project created. Refreshing inventory."),j(""),m(""),Qe(),await Promise.all([o(),r()])}catch($){S($ instanceof Error?$.message:"Could not create project.")}finally{T(!1)}},M=l=>{if(l.preventDefault(),!y){if(u){p(u);return}if(k){R(I);return}if(I){S("No project matches that search. Paste a repo path to create one.");return}S("Choose a project or paste a repo path.")}};return s.jsxs("div",{className:"pi-zero",children:[s.jsxs("div",{className:"pi-zeroHead",children:[s.jsxs("span",{className:"pi-zeroKicker",children:[s.jsx(as,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Projects"]}),s.jsx("h2",{children:"Pick a project to start."})]}),s.jsxs("form",{className:"pi-zeroComposer",onSubmit:M,children:[s.jsxs("div",{className:"pi-zeroBar",children:[s.jsxs("label",{className:"pi-zeroSelect",children:[s.jsx(rs,{size:13,strokeWidth:1.8,"aria-hidden":!0}),s.jsxs("select",{value:f,"aria-label":"Choose project",onChange:l=>{const $=A.find(O=>O.slug===l.currentTarget.value);$?d($):j("")},children:[s.jsx("option",{value:"",children:"Choose project"}),A.slice(0,80).map(l=>s.jsx("option",{value:l.slug,children:l.title},l.slug))]})]}),s.jsx("div",{className:"pi-zeroHarness",role:"group","aria-label":"Default harness",children:["claude","codex"].map(l=>s.jsx("button",{type:"button","data-on":x===l||void 0,onClick:()=>w(l),children:l==="claude"?"Claude":"Codex"},l))})]}),s.jsxs("div",{className:"pi-zeroInputRow",children:[s.jsx("textarea",{value:c,rows:2,placeholder:"Find project or paste /path/to/repo","aria-label":"Find or create project",onChange:l=>{m(l.currentTarget.value),j(""),S(null),W(null)},onKeyDown:l=>{l.key==="Enter"&&!l.shiftKey&&(l.preventDefault(),l.currentTarget.form?.requestSubmit())}}),s.jsxs("button",{type:"submit",className:"pi-zeroSend",disabled:y||!b,title:g,children:[s.jsx(ls,{size:15,strokeWidth:2,"aria-hidden":!0}),s.jsx("span",{children:y?"Working":g})]})]}),N.length>0?s.jsx("div",{className:"pi-zeroMatches","aria-label":"Matching projects",children:N.map(l=>s.jsxs("button",{type:"button",className:"pi-zeroMatch","data-selected":D?.slug===l.slug||void 0,onClick:()=>d(l),onDoubleClick:()=>p(l),children:[s.jsxs("span",{className:"pi-zeroMatchMain",children:[s.jsxs("span",{className:"pi-zeroMatchTitle",children:["/",l.title]}),s.jsx("span",{className:"pi-zeroMatchRoot",title:l.root??void 0,children:l.root?V(l.root):l.slug})]}),s.jsx("span",{className:"pi-zeroMatchMeta",children:Ds(l)})]},l.slug))}):I?s.jsx("div",{className:"pi-zeroEmpty",children:"No project matches."}):null,L?s.jsx("div",{className:"pi-zeroError",children:L}):null,E?s.jsx("div",{className:"pi-zeroStatus",children:E}):null]})]})}function Es(e){return e==="codex"?"codex":"claude"}function me(e,t){return{view:"agents-v2",projectSlug:t,...e.showEphemeral?{showEphemeral:!0}:{},...e.machineId?{machineId:e.machineId}:{}}}function Is(e){return e.map(t=>({slug:t.slug,title:t.title,root:t.root,agentCount:t.agentCount,sessionCount:t.sessionCount,lastActivityAt:t.lastActivityAt})).sort((t,i)=>i.lastActivityAt-t.lastActivityAt||i.agentCount-t.agentCount||i.sessionCount-t.sessionCount||t.title.localeCompare(i.title))}function $s(e,t){const i=H(t);return i?e.map(n=>({option:n,score:Ws(n,i)})).filter(n=>n.score!==null).sort((n,o)=>n.score-o.score||o.option.lastActivityAt-n.option.lastActivityAt||n.option.title.localeCompare(o.option.title)).slice(0,6).map(n=>n.option):e.slice(0,6)}function he(e,t){const i=H(t);return i?e.find(n=>{const o=H(n.root??""),r=H(n.root?J(n.root):"");return H(n.title)===i||H(n.slug)===i||o===i||r===i||H(n.root?V(n.root):"")===i})??null:null}function Ws(e,t){const i=H(e.title),n=H(e.slug),o=H(e.root??""),r=H(e.root?J(e.root):"");return i===t||n===t||o===t||r===t?0:i.startsWith(t)||n.startsWith(t)||r.startsWith(t)?1:i.includes(t)||n.includes(t)||r.includes(t)?2:o.includes(t)?3:null}function H(e){return e.trim().toLowerCase().replace(/^~(?=\/)/u,"").replace(/\s+/g," ")}function Fs(e){const t=e.trim();return/^(~\/|\/|\.{1,2}\/)/u.test(t)||t.includes("/")}function Bs(e,t){const i=H(t);return i?[e.root??"",e.root?V(e.root):"",e.root?J(e.root):"",e.slug,e.title].map(H).some(o=>o===i||o.endsWith(i)):!1}function Ds(e){return[fe(e.agentCount,"agent"),fe(e.sessionCount,"session"),e.lastActivityAt?_(e.lastActivityAt):null].filter(Boolean).join(" · ")}function fe(e,t){return`${e} ${t}${e===1?"":"s"}`}function Os(e,t){return Ve(e,t)}function je(e){return/^native:process:/iu.test(e??"")}function zs(e){return e.startsWith("/")||e.startsWith("~/")||e.includes("/")&&/\.(jsonl?|events)$/i.test(e)}function we(e,t,i){const n=e?.trim()??"";return!n||zs(n)?t:n}function Hs({session:e,sessionRef:t,threads:i,lookup:n,route:o,navigate:r,nowMs:a}){const[c,m]=h.useState(null),f=e?.agentName??o.selectedAgentId??o.agentId??"Session",j=e?.harness??"session",x=n?.kind==="observe"?n.observe.data:null,w=x?.metadata?.session,y=e?.lastActivityAt??n?.session?.lastMessageAt??null,[T,L,S]=h.useMemo(()=>[oe(x),ke(x,y),Ks(x,y)],[x,y]),E=w?.gitBranch??n?.session?.currentBranch??e?.branch??null,W=w?.model??null,P=w?.turnCount??x?.metadata?.usage?.assistantMessages??(n?.kind==="conversation"?n.session.messageCount:null),B=L?_(L,a):e?.lastActivityAt?_(e.lastActivityAt,a):"—",A=e?.working?`live · last ${B}`:B!=="—"?`last ${B}`:"trace resolving",N=we(e?.work,f),D=ve(t),I=n?.session??null,k=n?.kind==="observe"?n.observe.agentId??I?.agentId??e?.agentId:I?.agentId??e?.agentId,u=n?.kind==="observe"?n.observe.sessionId:I?.harnessSessionId,g=[f,j,W,E,T?`started ${We(T)}`:null,S,P!=null?`turn ${v(P)}`:null,D].filter(p=>!!p&&p!=="—");h.useEffect(()=>{let p=!0;return m(null),!k&&!u&&!t?()=>{p=!1}:(Oe({includeDiscovered:!0}).then(R=>{p&&m(ms(R,{agentId:k,sessionRefs:[t,u,e?.sessionId]}))}).catch(()=>{p&&m(null)}),()=>{p=!1})},[e?.sessionId,t,k,u]);const b=()=>{c&&Ue(r,{view:"terminal",terminalSessionId:c.terminalSessionId,terminalSurfaceKey:c.terminalSurfaceKey,mode:"takeover"},{returnTo:o})},d=c?hs(c,"takeover"):null;return s.jsxs("section",{className:"pi-sessionOverview","aria-label":"Session overview",children:[s.jsxs("section",{className:"pi-sessionMasthead","data-state":e?.working?"working":"recent",children:[s.jsxs("div",{className:"pi-sessionMastTop",children:[s.jsx("span",{className:"pi-sessionCrumb",children:"Sessions ▸"}),s.jsx("h2",{className:"pi-sessionHeadline",title:N,children:N}),s.jsxs("span",{className:"pi-sessionState",children:[e?.working?s.jsx("span",{className:"pi-sessionLiveDot","aria-hidden":!0}):null,A]})]}),s.jsx("div",{className:"pi-sessionMeta",children:g.map((p,R)=>s.jsxs("span",{title:R===g.length-1?t:p,children:[R===1?s.jsx(ge,{harness:j,size:11}):null,p]},`${p}:${R}`))}),c?s.jsxs("div",{className:"pi-sessionTerminalActions","aria-label":"tmux terminal actions",children:[s.jsxs("span",{className:"pi-sessionTerminalName",title:c.sessionName,children:["tmux · ",c.sessionName]}),s.jsx("button",{type:"button",onClick:b,children:"Open in web terminal"}),d?s.jsxs("a",{href:d,children:["Open in native terminal",s.jsx(cs,{size:11,strokeWidth:1.8,"aria-hidden":!0})]}):null]}):null]}),s.jsx(et,{lookup:n,session:e,threads:i,nowMs:a,route:o,navigate:r})]})}function qs({session:e,sessionRef:t,threads:i,route:n,navigate:o,nowMs:r}){const[a,c]=h.useState(null);return h.useEffect(()=>{c(null)},[t]),s.jsx("main",{className:"pi-sessionDetail","aria-label":"Selected session",children:s.jsxs("div",{className:"pi-sessionContent",children:[s.jsx(Hs,{session:e,sessionRef:t,threads:i,lookup:a,route:n,navigate:o,nowMs:r}),s.jsx(Xe,{sessionRef:t,navigate:o,showObserveRail:!1,onLookup:c})]})})}function v(e){return typeof e!="number"||!Number.isFinite(e)?"—":Math.abs(e)<1e3?e.toLocaleString("en-US"):Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(e).toLowerCase()}function Ne(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?"—":`${v(e)} tok`}function G(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}function Gs(e){const t=G(e?.contextInputTokens),i=G(e?.contextWindowTokens);return t===null||i===null?null:Math.max(0,Math.min(1,t/i))}function _s(e){const t=[{key:"input",label:"input",value:G(e?.inputTokens)??0},{key:"cache-read",label:"cache rd",value:G(e?.cacheReadInputTokens)??0},{key:"cache-write",label:"cache wr",value:G(e?.cacheCreationInputTokens)??0},{key:"output",label:"output",value:G(e?.outputTokens)??0},{key:"reasoning",label:"reasoning",value:G(e?.reasoningOutputTokens)??0}].filter(r=>r.value>0),i=t.reduce((r,a)=>r+a.value,0),n=t.filter(r=>r.key!=="reasoning"||i>0&&r.value/i>=.02);if(n.length>0)return n;const o=G(e?.totalTokens);return o!==null?[{key:"total",label:"total",value:o}]:[]}function Vs({buckets:e}){const t=e.reduce((i,n)=>i+n.value,0);return e.length===0?null:s.jsxs("div",{className:"pi-sessionGlanceTokens","aria-label":"Token usage",children:[s.jsx("div",{className:"pi-sessionGlanceTokenBars",children:e.map(i=>s.jsx("span",{className:"pi-sessionGlanceTokenSeg","data-kind":i.key,style:{flexGrow:t>0?Math.max(.035,i.value/t):1,flexBasis:0},title:`${i.label}: ${Ne(i.value)}`},i.key))}),s.jsx("div",{className:"pi-sessionGlanceTokenLegend",children:e.map(i=>s.jsxs("span",{children:[s.jsx("i",{"data-kind":i.key,"aria-hidden":!0}),i.label," ",s.jsx("b",{children:v(i.value)})]},i.key))})]})}function oe(e){const t=ee(e?.metadata?.session?.sessionStart);if(t!==null)return t;for(const i of e?.events??[]){const n=ee(i.at);if(n!==null)return n}return null}function ke(e,t){for(let o=(e?.events.length??0)-1;o>=0;o-=1){const r=ee(e?.events[o]?.at);if(r!==null)return r}const i=oe(e),n=e?.events.at(-1)?.t;return i!==null&&typeof n=="number"&&Number.isFinite(n)?i+n*1e3:ee(t)}function Ks(e,t){const i=oe(e),n=ke(e,t);if(i!==null&&n!==null)return ie(Math.max(0,n-i))||"—";const o=e?.events.at(-1)?.t;return typeof o=="number"&&Number.isFinite(o)&&ie(o*1e3)||"—"}function ie(e){if(typeof e!="number"||!Number.isFinite(e)||e<0)return"";const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const i=Math.floor(t/60);if(i<60)return`${i}m`;const n=Math.floor(i/60),o=i%60;if(n<48)return o>0?`${n}h ${o}m`:`${n}h`;const r=Math.floor(n/24),a=n%24;return a>0?`${r}d ${a}h`:`${r}d`}function Us(e){const t=e?.metadata?.topology;if(!t)return null;const i=t.agents.length,n=t.agents.filter(c=>c.role!=="lead").length,o=t.groups.filter(c=>c.kind==="workflow").length,r=t.tasks.length,a=[];return n>0?a.push(`${n} worker${n===1?"":"s"}`):i>0&&a.push(`${i} agent${i===1?"":"s"}`),o>0&&a.push(`${o} workflow${o===1?"":"s"}`),r>0&&a.push(`${r} task${r===1?"":"s"}`),a.length?a.join(" · "):null}function Xs(e){return[...e].sort((t,i)=>xe(i.state)-xe(t.state)||i.touches-t.touches||i.lastT-t.lastT||t.path.localeCompare(i.path)).slice(0,5).map(t=>({path:t.path,kind:t.state,detail:[t.touches>1?`${v(t.touches)} touches`:"1 touch",t.lastT>0?`last ${ie(t.lastT*1e3)}`:null].filter(Boolean).join(" · ")}))}function xe(e){switch(e){case"created":return 3;case"modified":return 2;case"read":return 1}}function Ys(e){const t=new Map;for(const i of e){if(i.kind!=="tool")continue;const n=Zs(i.tool||i.text),o=t.get(n)??{count:0,samples:[]};o.count+=1;const r=i.arg||i.detail||i.text;r&&o.samples.length<2&&o.samples.push(r),t.set(n,o)}return[...t.entries()].sort((i,n)=>n[1].count-i[1].count||i[0].localeCompare(n[0])).slice(0,5).map(([i,n])=>({name:i,count:n.count,detail:n.samples.join(" · ")||`${v(n.count)} uses`}))}function Zs(e){return(e.trim().split(/\s+/u)[0]??"tool").replace(/[_-]+/gu," ").toLowerCase()}function Js({usage:e,contextPct:t,topology:i,workspace:n,projectRoot:o,branch:r}){const a=[];return t!==null&&a.push({label:"Context",value:`${t}%`,detail:t>=80?"approaching limit":"within window",tone:t>=80?"warn":void 0}),(e?.serviceTier||e?.planType||e?.speed)&&a.push({label:"Budget",value:e.serviceTier??e.planType??e.speed??"usage",detail:[e.planType,e.speed].filter(Boolean).join(" · ")||"provider metadata"}),n&&o&&n!==o?a.push({label:"Worktree",value:V(n),detail:"session cwd differs from project root",tone:"warn"}):r&&a.push({label:"Repo",value:r,detail:"session branch"}),i&&a.push({label:"Topology",value:i,detail:"observed harness hierarchy"}),(e?.webSearchRequests||e?.webFetchRequests)&&a.push({label:"Network",value:`${v((e.webSearchRequests??0)+(e.webFetchRequests??0))} req`,detail:[e.webSearchRequests?`${v(e.webSearchRequests)} search`:null,e.webFetchRequests?`${v(e.webFetchRequests)} fetch`:null].filter(Boolean).join(" · ")}),a.slice(0,4)}function Qs({session:e,threads:t,nowMs:i}){return t.filter(n=>n.kind==="agent").filter(n=>n.agentId!==e?.agentId||n.work!==e?.work).sort((n,o)=>Number(o.working)-Number(n.working)||o.lastActivityAt-n.lastActivityAt).slice(0,4).map(n=>{const o=!!(e?.branch&&n.branch===e.branch),r=!!(e?.agentName&&n.agentName===e.agentName);return{thread:n,title:we(n.work,n.agentName,n.id),channel:n.conversationId?ve(n.conversationId):n.agentName,state:n.needs?"needs":n.working?"working":"recent",time:n.lastActivityAt?_(n.lastActivityAt,i):"—",participants:n.agentName,why:o?"same branch":r?"same agent":n.working?"active in project":"project thread"}})}function Y({label:e,value:t,title:i,detail:n}){return s.jsxs("span",{className:"pi-sessionGlanceField",title:i,children:[s.jsx("span",{children:e}),s.jsx("b",{children:t}),n?s.jsx("small",{children:n}):null]})}function et({lookup:e,session:t,threads:i,nowMs:n,route:o,navigate:r}){const[a,c]=h.useState(!1),m=h.useMemo(()=>{const k=e?.kind==="observe"?e.observe.data:null,u=k?.metadata?.session,g=k?.metadata?.usage,b=k?.events??[],d=k?.files??[],p=u?.turnCount??g?.assistantMessages??(e?.kind==="conversation"?e.session.messageCount:null),R=b.filter(U=>U.kind==="tool").length,M=d.filter(U=>U.state==="created").length,l=d.filter(U=>U.state==="modified").length,$=d.filter(U=>U.state==="read").length,O=M+l,F=Gs(g),z=F!==null?Math.round(F*100):null,C=u?.cwd??e?.session?.workspaceRoot??t?.projectRoot??null,K=u?.gitBranch??e?.session?.currentBranch??t?.branch??null,q=Us(k),se=Ne(g?.totalTokens??(typeof g?.inputTokens=="number"||typeof g?.outputTokens=="number"?(g?.inputTokens??0)+(g?.outputTokens??0):null)),ye=_s(g),Ce=O>0?[l>0?`${v(l)} mod`:null,M>0?`${v(M)} new`:null].filter(Boolean).join(" · "):$>0?"read-only":"no file trace",Ae=d.length>0?`${v(d.length)} touched`:"—",Re=Xs(d),Te=Ys(b),Le=Js({usage:g,contextPct:z,topology:q,workspace:C,projectRoot:t?.projectRoot,branch:K}),Pe=Qs({session:t,threads:i,nowMs:n});return{turnCount:p,toolCount:R,editCount:O,fileCountLabel:Ae,fileStateLabel:Ce,workspace:C,contextPct:z,showContext:z!==null,contextWarn:z!==null&&z>=80,tokenTotal:se,buckets:ye,fileSignals:Re,toolSignals:Te,contextSignals:Le,threadSignals:Pe,projectRoot:t?.projectRoot??null}},[e,t,i,n]),{turnCount:f,toolCount:j,editCount:x,fileCountLabel:w,fileStateLabel:y,workspace:T,contextPct:L,showContext:S,contextWarn:E,tokenTotal:W,buckets:P,fileSignals:B,toolSignals:A,contextSignals:N,threadSignals:D,projectRoot:I}=m;return s.jsxs("section",{className:"pi-sessionGlance","aria-label":"Session glance",children:[s.jsxs("div",{className:"pi-sessionVitals","aria-label":"Session vitals",children:[s.jsx(Y,{label:"Turns",value:v(f)}),s.jsx(Y,{label:"Tools",value:v(j)}),s.jsx(Y,{label:"Edits",value:v(x)}),s.jsx(Y,{label:"Files",value:w,detail:y!=="no file trace"?y:null}),T&&I&&T!==I?s.jsx(Y,{label:"Worktree",value:V(T),title:T}):null,S?s.jsxs("span",{className:"pi-sessionContextVital",title:"Context window usage",children:[s.jsx("span",{children:"Ctx"}),s.jsx("span",{className:"pi-sessionContextBar","aria-hidden":!0,children:s.jsx("span",{"data-warn":E||void 0,style:{width:`${L}%`}})}),s.jsxs("b",{"data-warn":E||void 0,children:[L,"%"]})]}):null,P.length>0?s.jsxs("button",{type:"button",className:"pi-sessionTokenToggle","aria-expanded":a,onClick:()=>c(k=>!k),children:[s.jsx("span",{children:"Tokens"}),s.jsx("b",{children:W}),s.jsx("i",{children:a?"▾":"▸"})]}):null]}),a&&P.length>0?s.jsx(Vs,{buckets:P}):null,s.jsx(st,{files:B,tools:A,context:N,threads:D,route:o,navigate:r})]})}function st({files:e,tools:t,context:i,threads:n,route:o,navigate:r}){return s.jsxs("section",{className:"pi-sessionSignals","aria-label":"Session work signals",children:[s.jsxs("div",{className:"pi-sessionSignalCol",children:[s.jsxs("div",{className:"pi-sessionSignalHead",children:[s.jsx("span",{children:"Files"}),s.jsx("b",{children:v(e.length)})]}),e.length>0?s.jsx("div",{className:"pi-sessionFileList",children:e.map(a=>s.jsxs("div",{className:"pi-sessionFileRow",children:[s.jsx("span",{"data-kind":a.kind,children:a.kind}),s.jsx("code",{title:a.path,children:a.path}),s.jsx("small",{children:a.detail})]},`${a.kind}:${a.path}`))}):s.jsx("span",{className:"pi-sessionSignalEmpty",children:"No file trace yet."})]}),s.jsxs("div",{className:"pi-sessionSignalCol",children:[s.jsx("div",{className:"pi-sessionSignalHead",children:s.jsx("span",{children:"Tools · Context · Topology"})}),t.length>0?s.jsx("div",{className:"pi-sessionToolGrid",children:t.map(a=>s.jsxs("span",{className:"pi-sessionToolPill",title:a.detail,children:[s.jsx("b",{children:a.name}),s.jsx("em",{children:v(a.count)})]},a.name))}):null,i.length>0?s.jsx("div",{className:"pi-sessionContextList",children:i.map(a=>s.jsxs("div",{className:"pi-sessionContextRow",children:[s.jsx("span",{children:a.label}),s.jsx("b",{"data-tone":a.tone,children:a.value}),s.jsx("small",{children:a.detail})]},`${a.label}:${a.value}`))}):t.length===0?s.jsx("span",{className:"pi-sessionSignalEmpty",children:"Trace metadata is still resolving."}):null]}),s.jsxs("div",{className:"pi-sessionSignalCol",children:[s.jsxs("div",{className:"pi-sessionSignalHead",children:[s.jsx("span",{children:"Recent threads"}),s.jsx("b",{children:v(n.length)})]}),n.length>0?s.jsx("div",{className:"pi-sessionThreadList",children:n.map(a=>s.jsxs("button",{type:"button",className:"pi-sessionThreadRow",onClick:()=>r(be(a.thread,o)),children:[s.jsx("span",{className:"pi-sessionThreadTitle",title:a.title,children:a.title}),s.jsxs("span",{className:"pi-sessionThreadMeta",children:[s.jsx("b",{children:a.channel}),s.jsx("em",{children:a.state}),s.jsx("small",{children:a.time})]}),s.jsxs("span",{className:"pi-sessionThreadWhy",children:[a.participants," · ",a.why]})]},a.thread.id))}):s.jsx("span",{className:"pi-sessionSignalEmpty",children:"No recent agent threads."})]})]})}function ne(e){return!e||e==="—"||/^\d+\s+branches$/iu.test(e)?null:e}function Se(e,t,i,n){const o=new Map,r=(c,m)=>{const f=c??e,j=ne(m),x=f??"project",w=o.get(x);if(w)return!w.branch&&j&&(w.branch=j),w;const y={key:x,root:f,branch:j,sessions:0,work:0,moving:0,lastActivityAt:0,repoWatch:null};return o.set(x,y),y};for(const c of t){const m=r(c.root,c.branch);c.working&&(m.moving+=1),m.lastActivityAt=Math.max(m.lastActivityAt,c.lastActivityAt)}const a=(c,m)=>{const f=c??e,j=o.get(f??"project");return j||(t.length>0?o.get(e??"")??o.values().next().value:r(c,m))};for(const c of i){const m=a(c.workspaceRoot??c.projectRoot,c.branch);m.sessions+=1,c.working&&(m.moving+=1,m.branch=ne(c.branch)??m.branch),m.lastActivityAt=Math.max(m.lastActivityAt,c.lastActivityAt)}for(const c of n){const m=a(c.workspaceRoot??c.projectRoot,c.branch);m.work+=1,c.working&&(m.moving+=1,m.branch=ne(c.branch)??m.branch),m.lastActivityAt=Math.max(m.lastActivityAt,c.lastActivityAt)}return o.size===0&&r(e,null),[...o.values()].sort((c,m)=>m.moving-c.moving||m.lastActivityAt-c.lastActivityAt||(c.root??"").localeCompare(m.root??""))}function tt(e){return e.worktrees.map(t=>({key:t.id,root:t.path,branch:t.branch.name,sessions:t.sessions.length,work:t.agents.length,moving:t.agents.some($e)?1:0,lastActivityAt:t.lastCommitAt??0,repoWatch:t}))}function nt({pullRequests:e,loading:t,warnings:i,onRefresh:n,nowMs:o}){return s.jsxs("section",{className:"pi-projectPullRequests","aria-label":"Open pull requests",children:[s.jsxs("div",{className:"pi-projectPullRequestsHead",children:[s.jsx("span",{children:"Open PRs"}),s.jsx("b",{children:t&&e.length===0?"…":v(e.length)})]}),e.length>0?s.jsx("div",{className:"pi-projectPullRequestList",children:e.slice(0,6).map(r=>{const a=r.updatedAt?Date.parse(r.updatedAt):Number.NaN;return s.jsxs("a",{className:"pi-projectPullRequest",href:r.url,target:"_blank",rel:"noreferrer",children:[s.jsxs("span",{className:"pi-projectPullRequestNumber",children:["#",r.number]}),s.jsx("b",{title:r.title,children:r.title}),s.jsxs("span",{className:"pi-projectPullRequestBranch",title:`${r.headRefName} → ${r.baseRefName}`,children:[r.headRefName," → ",r.baseRefName]}),s.jsx("em",{children:r.isDraft?"draft":"open"}),s.jsx("time",{children:Number.isFinite(a)?_(a,o):"updated"})]},r.id)})}):s.jsxs("div",{className:"pi-projectPullRequestState","data-loading":t||void 0,children:[s.jsx("span",{children:t?"Checking GitHub for open pull requests…":i[0]??"No open pull requests for this repository."}),!t&&i.length>0?s.jsx("button",{type:"button",onClick:n,children:"Retry"}):null]})]})}function it(e){const t=new Set;let i=0,n=0;const o=[];for(const r of e.layers){r.files.length>0&&o.push(r.kind);for(const a of r.files)t.add(a.newPath??a.oldPath??"unknown"),i+=a.additions??0,n+=a.deletions??0}return{additions:i,deletions:n,files:[...t],layers:o}}function ot({additions:e,deletions:t}){return e+t===0?s.jsx("span",{className:"pi-projectWorktreeChurnBar","data-empty":!0}):s.jsxs("span",{className:"pi-projectWorktreeChurnBar","aria-label":`${e} additions and ${t} deletions`,children:[e>0?s.jsx("i",{"data-add":!0,style:{flexGrow:e}}):null,t>0?s.jsx("i",{"data-delete":!0,style:{flexGrow:t}}):null]})}function at({project:e,repoProject:t,repoLoading:i,repoError:n,diffSnapshots:o,diffErrors:r,diffLoading:a,pullRequests:c,pullRequestsLoading:m,pullRequestWarnings:f,onRepositoryRefresh:j,threads:x,sessions:w,route:y,navigate:T,nowMs:L}){const S=e?.root??w[0]?.projectRoot??x[0]?.projectRoot??null,E=x.length,W=e?.sessionCount??w.length,P=e?.agentCount??0,B=Math.max(e?.lastActivityAt??0,w[0]?.lastActivityAt??0,x[0]?.lastActivityAt??0),A=e?.branches.length?e.branches:[...new Set([...w.map(u=>u.branch),...x.map(u=>u.branch)].filter(u=>!!u&&u!=="—"&&u!=="main"))],N=t?.worktrees.length?tt(t):Se(S,e?.worktrees??[],w,x),D=N.find(u=>u.moving>0&&u.branch)?.branch??N.find(u=>u.branch)?.branch??A[0]??"main",I=S?J(S):e?.title??y.projectSlug??"project",k=N.find(u=>u.moving>0)?.key??N.find(u=>u.branch===D)?.key??N[0]?.key;return s.jsxs("main",{className:"pi-projectOverview","aria-label":"Project overview",children:[s.jsxs("section",{className:"pi-projectSnapshot","aria-label":"Project snapshot",children:[s.jsxs("div",{className:"pi-projectRepository",children:[s.jsxs("div",{className:"pi-projectRepositoryHead",children:[s.jsx("span",{children:"Repository"}),s.jsx(us,{size:13,strokeWidth:1.7,"aria-hidden":!0})]}),s.jsxs("div",{className:"pi-projectRepositoryIdentity",children:[s.jsx("b",{children:I}),s.jsx("span",{title:S??void 0,children:S?V(S):y.projectSlug??"project"})]}),s.jsxs("div",{className:"pi-projectRepositoryCurrent",children:[N.some(u=>u.moving>0)?s.jsx("span",{className:"pi-projectRepositoryPulse","aria-label":"Active now"}):null,s.jsxs("span",{children:[s.jsx("small",{children:"Current branch"}),s.jsx("b",{title:D,children:D})]}),s.jsx("time",{children:B?_(B,L):"no activity"})]}),W>0||P>0||E>0?s.jsxs("div",{className:"pi-projectRepositoryStats","aria-label":"Repository activity",children:[W>0?s.jsxs("span",{children:[s.jsx("b",{children:v(W)})," ",W===1?"session":"sessions"]}):null,P>0?s.jsxs("span",{children:[s.jsx("b",{children:v(P)})," ",P===1?"agent":"agents"]}):null,E>0?s.jsxs("span",{children:[s.jsx("b",{children:v(E)})," ",E===1?"thread":"threads"]}):null]}):null]}),s.jsxs("div",{className:"pi-projectWorktrees",children:[s.jsxs("div",{className:"pi-projectWorktreesHead",children:[s.jsx("span",{children:"Worktree preview"}),s.jsx("b",{children:v(N.length)})]}),s.jsx("div",{className:"pi-projectWorktreeList",children:N.slice(0,6).map(u=>{const g=u.repoWatch,b=u.root?o.get(u.root)??null:null,d=b?it(b):null,p=g?Ie(g):null,R=d?.additions??p?.add??0,M=d?.deletions??p?.del??0,l=d?.files.length??(g?Math.max(g.status.changedFiles,p?.files??0):0),$=!!(l>0||g&&(!g.status.clean||g.branch.ahead>0||g.branch.behind>0)),O=c.filter(C=>C.headRefName===u.branch),F=!!(u.root&&a&&!b&&!r.has(u.root)),z=u.root?r.get(u.root)??null:"No worktree path is available.";return s.jsxs("article",{className:"pi-projectWorktree","data-active":u.key===k||void 0,"data-stranded":$||void 0,children:[s.jsx("span",{className:"pi-projectWorktreeTop",children:s.jsx("b",{title:u.branch??"main",children:u.branch??"main"})}),s.jsx("em",{title:u.root??void 0,children:u.root?V(u.root):"workspace"}),b||g?s.jsxs("div",{className:"pi-projectWorktreeDiff","data-clean":!$||void 0,children:[$?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"pi-projectWorktreeChurn",children:[s.jsxs("b",{className:"pi-projectWorktreeAdd",children:["+",v(R)]}),s.jsxs("b",{className:"pi-projectWorktreeDel",children:["−",v(M)]}),s.jsx(ot,{additions:R,deletions:M})]}),s.jsxs("small",{children:[v(l)," changed"]})]}):s.jsx("small",{children:"clean"}),u.root?s.jsx("button",{type:"button",className:"pi-projectWorktreeOpenDiff",onClick:()=>T({view:"repo-diff",path:u.root}),children:"View diff"}):null]}):s.jsxs("div",{className:"pi-projectWorktreeDiff","data-pending":!0,children:[s.jsx("small",{children:F||i?"Reading worktree diff…":z??n??"No diff data returned."}),!F&&!i?s.jsx("button",{type:"button",className:"pi-projectWorktreeOpenDiff",onClick:j,children:"Retry"}):null]}),d&&d.files.length>0?s.jsxs("span",{className:"pi-projectWorktreeFiles",title:d.files.join(`
|
|
2
|
-
`),children:[d.files.slice(0,2).map(C=>J(C)).join(" · "),d.files.length>2?` · +${d.files.length-2} more`:""]}):null,s.jsx("span",{className:"pi-projectWorktreeMeta",children:g?s.jsxs(s.Fragment,{children:[s.jsx("small",{children:g.branch.ahead>0||g.branch.behind>0?`${g.branch.ahead}↑ ${g.branch.behind}↓`:"synced"}),g.status.staged>0?s.jsxs("small",{children:[v(g.status.staged)," staged"]}):null,g.status.unstaged>0?s.jsxs("small",{children:[v(g.status.unstaged)," unstaged"]}):null,g.status.untracked>0?s.jsxs("small",{children:[v(g.status.untracked)," untracked"]}):null,g.status.conflicts>0?s.jsxs("small",{children:[v(g.status.conflicts)," conflicts"]}):null,d?.layers.map(C=>s.jsx("small",{children:C},C)),O.length>0?s.jsxs("small",{children:[O.length," PR",O.length===1?"":"s"]}):null]}):s.jsxs(s.Fragment,{children:[s.jsx("small",{children:u.lastActivityAt?_(u.lastActivityAt,L):"idle"}),s.jsxs("small",{children:[v(u.sessions)," sessions"]}),s.jsxs("small",{children:[v(u.work)," threads"]})]})})]},u.key)})}),N.length>6?s.jsxs("div",{className:"pi-projectWorktreeMore",children:["+",N.length-6," more worktrees"]}):null]})]}),s.jsx(nt,{pullRequests:c,loading:m,warnings:f,onRefresh:j,nowMs:L})]})}function rt({project:e,threads:t,sessions:i,route:n,navigate:o,nowMs:r}){const a=e?.root??i[0]?.projectRoot??t[0]?.projectRoot??null,c=h.useMemo(()=>Se(a,e?.worktrees??[],i,t).map(f=>f.root).filter(f=>!!f),[e?.worktrees,a,i,t]),m=Ss(a,c);return s.jsx(at,{project:e,repoProject:m.project,repoLoading:m.repoLoading,repoError:m.repoError,diffSnapshots:m.diffSnapshots,diffErrors:m.diffErrors,diffLoading:m.diffLoading,pullRequests:m.pullRequests,pullRequestsLoading:m.pullRequestsLoading,pullRequestWarnings:m.pullRequestWarnings,onRepositoryRefresh:m.refresh,threads:t,sessions:i,route:n,navigate:o,nowMs:r})}function ei({route:e,navigate:t,zeroPreview:i=!1,embedded:n=!1}){const{model:o,nowMs:r,loading:a,error:c,agents:m=ys}=Je(e),f=!!e.projectSlug,j=e.projectSlug?ze(o,e.projectSlug)??e.projectSlug:null,x=j&&j!==e.projectSlug?{...e,projectSlug:j}:e,w=f&&!je(e.sessionId)?e.sessionId??null:null,y=h.useMemo(()=>w?Os(o.sessions,x):null,[x,o.sessions,w]),T=f?e.indexView==="agents"?"agents":e.indexView==="sessions"?"sessions":"overview":"overview",L=f?o.projects.find(b=>b.slug===j)??null:null,S=f?L?.title??j:"Projects";es(S,n);const E=h.useMemo(()=>{if(i)return[];if(!f)return[];const b=j,d=Z(o.threads,b),p=ae(o.sessions,b);return T==="overview"?[]:T==="agents"?[]:p.length>0?p:d},[j,o.sessions,o.threads,T,f,i]),W=h.useMemo(()=>He(E),[E]),P=h.useMemo(()=>W.flatMap(b=>b.items),[W]),B=o.projects.length>0||o.threads.length>0||o.sessions.length>0,A=a&&!B,N=a&&!i,D=!f&&!N&&(i||o.projects.length===0&&E.length===0),I=!f&&!D,[k,u]=h.useState(-1),g=h.useRef(new Map);return h.useEffect(()=>{!f||!e.sessionId||!je(e.sessionId)||t({...x,indexView:"sessions",sessionId:void 0,selectedAgentId:void 0})},[x,t,e.sessionId,f]),h.useEffect(()=>{u(-1)},[j]),h.useEffect(()=>{function b(d){const p=document.activeElement;if(!!p&&(p.tagName==="INPUT"||p.tagName==="TEXTAREA"||p.isContentEditable))return;const M=P.length;if(M){if(d.key==="ArrowDown"||d.key==="j")d.preventDefault(),u(l=>l<0?0:Math.min(M-1,l+1));else if(d.key==="ArrowUp"||d.key==="k")d.preventDefault(),u(l=>l<0?0:Math.max(0,l-1));else if(d.key==="Enter"){const l=P[k<0?0:k];l&&(d.preventDefault(),t(l.kind==="session"?re(l,x):le(l,x)))}}}return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[k,x,P,t]),h.useEffect(()=>{if(k<0)return;const b=P[k];b&&g.current.get(b.id)?.scrollIntoView({block:"nearest"})},[k,P]),s.jsxs("div",{className:"s-pi s-pi-inbox","aria-busy":a||void 0,"data-loading":a||void 0,children:[f?s.jsx(Ts,{route:x,navigate:t,slug:j,model:o,mode:T,repoProject:null}):s.jsx("div",{className:"pi-inboxHead",children:s.jsxs("div",{className:"pi-inboxHeading",children:[s.jsx("h1",{className:"pi-inboxTitle",children:"Projects"}),s.jsx("span",{className:"pi-inboxDigest",children:Ps(o,i)})]})}),w?s.jsx(qs,{session:y,sessionRef:w,threads:Z(o.threads,j),route:x,navigate:t,nowMs:r}):f&&T==="overview"?s.jsx(rt,{project:L,threads:Z(o.threads,j),sessions:ae(o.sessions,j),route:x,navigate:t,nowMs:r}):f&&T==="agents"&&L?s.jsx(Ye,{project:L,threads:Z(o.threads,j),route:x,navigate:t,nowMs:r}):I?s.jsx(Ze,{model:o,agents:m,route:e,navigate:t,nowMs:r}):s.jsxs("div",{className:"pi-threads",children:[A?s.jsx(Rs,{}):null,!A&&W.map(b=>{let d=0;for(const p of W){if(p.group===b.group)break;d+=p.items.length}return s.jsxs("div",{children:[s.jsxs("div",{className:"pi-sectionHead","data-tone":b.group,children:[s.jsx("span",{className:"pi-sectionLabel",children:b.label}),s.jsx("span",{className:"pi-sectionCount",children:b.items.length})]}),b.items.map((p,R)=>{const M=d+R;return s.jsx(As,{thread:p,crossProject:!f,selected:p.kind==="session"?Ge(p,x,o.sessions):_e(p,x,o.threads),cursor:k===M,nowMs:r,onSelect:()=>{const l=p.kind==="session"?qe(p,x):be(p,x);t(l)},onOpen:()=>t(p.kind==="session"?re(p,x):le(p,x)),rowRef:l=>{l?g.current.set(p.id,l):g.current.delete(p.id)}},p.id)})]},b.group)}),!A&&E.length===0?c&&!B?s.jsx(pe,{tone:"error",title:"Projects unavailable",detail:c}):D?s.jsx("div",{className:"pi-empty",children:s.jsx(Ms,{route:e,navigate:t,projects:o.projects})}):N?s.jsx("div",{className:"pi-empty",children:"Loading…"}):s.jsx(pe,{title:lt(f,T)}):null]})]})}function lt(e,t){return e&&t==="agents"?"No visible agents in this project.":e?"No sessions in this project yet.":"No projects yet."}export{ei as ProjectsInbox,As as ThreadRow};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as p,j as e}from"./index-C1VaWNuD.js";import{t as P}from"./time-Dhsh_2EG.js";import{F as y,A as b}from"./AddProjectForm-fXndbzXT.js";import{s as k}from"./project-overview-helpers-BQTc_Ous.js";import{u as C}from"./projects-inbox-DFbgVlXL.js";import{r as A}from"./Provider-D0bB7q6y.js";import{S as x}from"./search-FB2vVxCp.js";import{X as w}from"./x-DgmmnPKt.js";import{C as F}from"./chevron-down-D120PY4g.js";import{F as v}from"./DocumentFocusViewer-D8iB6SMt.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./createLucideIcon-Dv8H8m7J.js";import"./router-kfcaYqZr.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./tail-events-LK29oCKm.js";import"./conversation-model-C2KuZUXc.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";function G(t){return t.needs>0?"needs":t.working>0||t.liveSessionCount>0?"working":"idle"}function L(t){return[t.title,t.slug,t.root??""].join(" ").toLowerCase()}function R(t,a,s){const o=a.trim().toLowerCase();return[...o?t.filter(i=>L(i).includes(o)):t].sort((i,n)=>s==="name"?i.title.localeCompare(n.title):n.lastActivityAt-i.lastActivityAt||i.title.localeCompare(n.title))}function W({rows:t=7}){return e.jsx("div",{className:"pi-railLoading","aria-hidden":"true",children:Array.from({length:t},(a,s)=>e.jsx("div",{className:"pi-projectGroup pi-projectGroup--loading",children:e.jsx("div",{className:"pi-projectGroupHead pi-projectGroupHead--flat",children:e.jsxs("span",{className:"pi-projectPath pi-projectPath--flat",children:[e.jsx(v,{size:13,strokeWidth:1.6,"aria-hidden":!0}),e.jsxs("span",{className:"pi-projectPathStack",children:[e.jsx("span",{className:"pi-loadingLine pi-loadingLine--railProject"}),e.jsx("span",{className:"pi-loadingLine pi-loadingLine--railRoot"})]})]})})},s))})}function Pe({route:t,navigate:a,zeroPreview:s=!1}){const{model:o,nowMs:l,loading:i,error:n}=C(t),[c,j]=p.useState(""),[d,N]=p.useState("recent"),[h,u]=p.useState(!1),m=p.useMemo(()=>R(s?[]:o.projects,c,d),[o.projects,c,d,s]),g=t.projectSlug?A(o,t.projectSlug)??t.projectSlug:void 0,f=i&&o.projects.length===0&&!s,S=p.useCallback(r=>{a({view:"agents-v2",projectSlug:r,...t.machineId?{machineId:t.machineId}:{},...t.showEphemeral?{showEphemeral:!0}:{}})},[a,t.machineId,t.showEphemeral]);return e.jsxs("nav",{className:"s-pi s-pi-rail","aria-label":"Projects","aria-busy":i||void 0,"data-loading":i||void 0,children:[e.jsxs("div",{className:"pi-railFind",role:"search",children:[e.jsx(x,{size:13,strokeWidth:1.8,"aria-hidden":!0}),e.jsx("input",{className:"pi-railFindInput",type:"search",value:c,placeholder:"Find project","aria-label":"Find project",onChange:r=>j(r.currentTarget.value)}),c?e.jsx("button",{type:"button",className:"pi-railFindClear","aria-label":"Clear",onClick:()=>j(""),children:e.jsx(w,{size:12,strokeWidth:2,"aria-hidden":!0})}):null]}),e.jsx("div",{className:"pi-railBody",children:e.jsxs("div",{className:"pi-railGroup pi-railGroup--projects",children:[e.jsxs("div",{className:"pi-railProjectTools",children:[e.jsx("div",{className:"pi-railLabel",children:"Projects"}),e.jsxs("label",{className:"pi-railSortWrap",title:"Sort projects",children:[e.jsx("span",{className:"pi-srOnly",children:"Sort projects"}),e.jsxs("select",{className:"pi-railSort",value:d,"aria-label":"Sort projects",onChange:r=>N(r.currentTarget.value),children:[e.jsx("option",{value:"recent",children:"Recent"}),e.jsx("option",{value:"name",children:"Name"})]}),e.jsx(F,{size:12,strokeWidth:2,"aria-hidden":!0})]}),e.jsx("button",{type:"button",className:"pi-railAddBtn","aria-expanded":h,"aria-label":"Add project",title:"Add a project by path",onClick:()=>u(r=>!r),children:e.jsx(y,{size:13,strokeWidth:1.8,"aria-hidden":!0})})]}),h?e.jsx(b,{onClose:()=>u(!1)}):null,f?e.jsx(W,{}):n&&m.length===0?e.jsx("div",{className:"pi-railEmpty",children:"Projects unavailable."}):m.length===0?e.jsx("div",{className:"pi-railEmpty",children:c?"No projects matched.":"No projects yet."}):e.jsx("div",{className:"pi-projectIndex",children:m.map(r=>e.jsx(E,{project:r,selected:g===r.slug,nowMs:l,onOpen:S},r.slug))})]})}),e.jsx("div",{className:"pi-railFoot",children:e.jsxs("button",{type:"button",className:"pi-railFootBtn",onClick:()=>a({view:"search"}),children:[e.jsx(x,{size:13,strokeWidth:1.8,"aria-hidden":!0}),"Search all Scout"]})})]})}function E({project:t,selected:a,nowMs:s,onOpen:o}){const l=G(t),i=t.lastActivityAt?P(t.lastActivityAt,s):"No activity";return e.jsx("div",{className:"pi-projectGroup pi-projectGroup--flat","data-selected":a||void 0,"data-state":l,children:e.jsx("div",{className:"pi-projectGroupHead pi-projectGroupHead--flat",children:e.jsxs("button",{type:"button",className:"pi-projectPath pi-projectPath--flat",title:t.root??t.title,"aria-current":a?"page":void 0,"aria-label":`Open /${t.title}`,onClick:()=>o(t.slug),children:[e.jsx(v,{size:13,strokeWidth:1.6,"aria-hidden":!0}),e.jsxs("span",{className:"pi-projectPathStack",children:[e.jsxs("span",{className:"pi-projectPathText",children:["/",t.title]}),e.jsxs("span",{className:"pi-projectPathMeta",children:[e.jsx("span",{children:t.root?k(t.root):"Discovered project"}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsxs("span",{children:[t.worktreeCount," ",t.worktreeCount===1?"worktree":"worktrees"]}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("time",{children:i})]})]}),l!=="idle"?e.jsx("span",{className:"pi-projectState","data-state":l,children:l==="needs"?"Needs you":"Active"}):null]})})})}export{Pe as ProjectsRail,R as filterAndSortProjects};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as m}from"./index-C1VaWNuD.js";import{p as a,k as u,u as l}from"./Provider-D0bB7q6y.js";import{d as f}from"./types-B0PlfpKc.js";import{ProjectsInbox as d}from"./ProjectsInbox-Bq29DE_o.js";import{ProjectAgentProfile as j}from"./ProjectAgentProfile-Br1eTD7G.js";import{u as w}from"./projects-inbox-DFbgVlXL.js";import{i as P}from"./model-CBkMvT1w.js";/* empty css */import"./router-kfcaYqZr.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./api-Co9aQ2Jw.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./createLucideIcon-Dv8H8m7J.js";import"./conversation-model-C2KuZUXc.js";import"./time-Dhsh_2EG.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./AgentAvatar-Dz79iTxB.js";import"./SpriteAvatar-DFO4Kb4Z.js";import"./CrewAvatar-CZ_faQ_s.js";import"./ui-LM8pS8qE.js";import"./openContent-C6XO6kr5.js";import"./SessionRefScreen-DetLMkTT.js";import"./tail-events-LK29oCKm.js";import"./BackToPicker-BHicJyfc.js";import"./ConversationScreen-DIU7m_aC.js";import"./ConversationComposer-BUIjWMBi.js";import"./zap-Bcja1lHG.js";import"./message-markup-DC0QFEZn.js";import"./mentions-BZ5SBMtc.js";import"./AgentDetailCard-8viaEY8b.js";import"./AgentLiveActions-DlSKL60c.js";import"./terminal-takeover-BMeBjBB2.js";import"./eye-C9cGk5z6.js";import"./terminal-UDy4lzV1.js";import"./message-visibility-CGOmSSKs.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";/* empty css */import"./ConversationHeader-Bt2RBj93.js";import"./AstronautSuit-CwB4Dw07.js";import"./ConversationFeedRows-Bx0gFyG_.js";import"./ConversationPanels-o6W-cOoU.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CPoX8iV2.js";import"./proxy-DVDRhSRR.js";import"./activity-CzTJ-YMX.js";import"./message-circle-joGFxfj1.js";import"./ConversationStatus-CTYOywFh.js";import"./check-Dz2SRHft.js";import"./sparkles-D0vWLTyC.js";import"./SessionObserve-BVeTkcIl.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-t7-XJP-h.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CJVqIqQ2.js";import"./ObserveTextFlow-DCJ5EmD8.js";import"./SessionObserveEvidence-BkOezTGV.js";import"./wrench-BfVeded5.js";import"./external-link-BvX5PfLh.js";import"./session-ref-lookup-state-SATH_jAP.js";/* empty css */import"./CrewWorkspaces-DNX-QQ1h.js";import"./AddProjectForm-fXndbzXT.js";import"./agent-specialization-CtF_jI34.js";import"./project-overview-helpers-BQTc_Ous.js";import"./sliders-horizontal-57e99_qO.js";import"./message-square-BLiFqpe_.js";import"./useEmbedHeadline-DuUnwTB7.js";import"./api-HFH8wFyb.js";import"./cache-CeWH_KzJ.js";import"./arrow-up-right-B09GPwFl.js";import"./AgentsSubnav-Ci7uWM7P.js";import"./SecondaryNav-Cs0_FQdj.js";import"./secondaryNavConfig-C0Srrmy8.js";import"./compass-BdpImt_W.js";import"./settings-DQEtqkM9.js";import"./git-branch-Bc_eDIpG.js";import"./scroll-text-DFcBYy5J.js";import"./profile-BCvk8jOQ.js";import"./context-budget-DqxWzalx.js";import"./session-catalog-CG4oL_yN.js";import"./terminal-relay-CXHMdain.js";/* empty css */import"./AgentDefinitionsWorkspace-DHDS9Pgd.js";import"./FileViewerPane-CxNbcTYf.js";import"./agent-essentials-K9B6kbTS.js";/* empty css *//* empty css */import"./ProjectAgentProfileBar-CUzZ4Rpx.js";function h(o,r){const{model:i,loading:t}=w(o),p=n.useRef(void 0),s=n.useRef(o);s.current=o;const c=n.useCallback(e=>{if(e&&t&&i.projects.length===0){p.current=e;return}p.current=void 0,r(a(i,e,s.current))},[t,i,r]);n.useEffect(()=>(u(e=>{c(e.root)}),()=>u(null)),[c]),n.useEffect(()=>{const e=p.current;e!==void 0&&(e&&t&&i.projects.length===0||(p.current=void 0,r(a(i,e,s.current))))},[t,i,r])}function v({route:o,navigate:r,embedded:i=!1}){const t=P(o),p=t?`profile:${o.agentId}`:"index",s=!t&&x();return m.jsx("div",{className:"s-av2","data-view":t?"profile":"index",children:m.jsx("div",{className:"av2-stagePane",children:t?m.jsx(j,{route:o,navigate:r}):m.jsx(d,{route:o,navigate:r,zeroPreview:s,embedded:i})},p)})}function Ar({navigate:o,embedded:r=!1}){const{route:i}=l(),t=i.view==="agents-v2"?i:{view:"agents-v2"};return h(t,o),m.jsx("div",{className:"pi-projectsEmbedShell",children:m.jsx(v,{route:t,navigate:o,embedded:r})})}const Hr=f({id:"projects",label:"Projects",route:{view:"agents-v2"},webPath:"/projects",screen:"ProjectsEmbedScreen",embed:{path:"/embed/projects",profile:"macos.projects",ownsInternalRoutes:!0,rootClassName:"s-projects-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0}}});function x(){if(typeof window>"u")return!1;const o=window.location.hostname.toLowerCase();if(o!=="localhost"&&o!=="127.0.0.1"&&o!=="::1")return!1;const r=new URLSearchParams(window.location.search).get("zero")?.trim().toLowerCase();return r==="projects"||r==="project"||r==="1"||r==="true"}export{Ar as ProjectsEmbedScreen,v as ProjectsScreen,Hr as scoutSurface};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./index-C1VaWNuD.js";import{A as R}from"./AgentAvatar-Dz79iTxB.js";import{H as y}from"./HarnessMark-DttReffF.js";import{t as O}from"./time-Dhsh_2EG.js";import{s as P}from"./project-overview-helpers-BQTc_Ous.js";import{u as H}from"./projects-inbox-DFbgVlXL.js";import{t as T,c as B,s as C,d as L,e as z}from"./Provider-D0bB7q6y.js";import{A as g}from"./arrow-up-right-B09GPwFl.js";import"./SpriteAvatar-DFO4Kb4Z.js";import"./colors-BtO5_zlx.js";import"./CrewAvatar-CZ_faQ_s.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./router-kfcaYqZr.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./tail-events-LK29oCKm.js";import"./conversation-model-C2KuZUXc.js";import"./createLucideIcon-Dv8H8m7J.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./index-Cx6Gbr6n.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";function V(i,o,t){if(t.sessionId){const r=L(o,t);if(r)return{kind:"session",session:r};const a=z(i,t);if(a)return{kind:"thread",thread:a}}if(t.selectedAgentId){const r=i.find(l=>l.agentId===t.selectedAgentId)??null;if(r)return{kind:"thread",thread:r};const a=o.find(l=>!l.sessionId&&l.agentId===t.selectedAgentId)??null;if(a)return{kind:"session",session:a}}return null}function p({label:i,value:o}){return s.jsxs("span",{className:"pi-stat",children:[s.jsx("span",{className:"pi-statLabel",children:i}),s.jsx("span",{className:"pi-statValue",children:o})]})}function ys({route:i,navigate:o}){const{model:t,nowMs:r,loading:a,error:l}=H(i);if(!i.sessionId&&!i.selectedAgentId)return null;const d=V(t.threads,t.sessions,i);if(!d)return s.jsxs("div",{className:"s-pi s-pi-aside",children:[s.jsx("header",{className:"pi-asideHead",children:s.jsxs("div",{className:"pi-asideIdent",children:[s.jsx("div",{className:"pi-asideTop",children:s.jsx("span",{className:"pi-asideName",children:a?"Resolving selection":l?"Project data unavailable":"Selection unavailable"})}),s.jsx("div",{className:"pi-asideSub",children:s.jsxs("span",{className:"pi-asideStatus","data-tone":a?"working":"recent",children:[a?s.jsx("span",{className:"pi-asidePulse","aria-hidden":!0}):null,a?"loading":"idle"]})})]})}),s.jsx("div",{className:"pi-asideBody",children:s.jsx("p",{className:"pi-asideMuted",children:l??"The selected item is not in the current project snapshot."})})]});const n=d.kind==="thread"?d.thread:null,e=d.kind==="session"?d.session:null,m=n?.agentName??e?.agentName??"Session",h=n?.harness??e?.harness??"session",b=n?.projectTitle??e?.projectTitle??i.projectSlug??"project",x=n?.branch??e?.branch??null,c=n?.working??e?.working??!1,f=n?.needs?"needs":c?"working":"recent",I=n?.needs?"your turn":c?"working":e?"selected":"idle",k=n?.work??e?.work??"No session detail available.",v=n?.lastActivityAt??e?.lastActivityAt??0,j=e?.sessionId??n?.sessionId??null,u=n?.projectRoot??e?.projectRoot??null,N=n?T(n,i):null,w=n?B(n,i):e?C(e,i):i,A=e?e.route?.view==="conversation"?"Open conversation":e.route?.view==="sessions"?"Open session":e.agentId?"Open agent":"Open project":n?.kind==="native"?"Open session":n?.conversationId?"Open conversation":"Open agent",S={view:"agents-v2",...i.projectSlug?{projectSlug:i.projectSlug}:{},...i.indexView?{indexView:i.indexView}:{},...i.machineId?{machineId:i.machineId}:{},...i.showEphemeral?{showEphemeral:!0}:{}};return s.jsxs("div",{className:"s-pi s-pi-aside",children:[s.jsxs("header",{className:"pi-asideHead",children:[s.jsx("span",{className:"pi-asideAvatar",children:s.jsx(R,{agent:{name:m,harness:h,state:c?"in_turn":null},placement:"row",size:38})}),s.jsxs("div",{className:"pi-asideIdent",children:[s.jsxs("div",{className:"pi-asideTop",children:[s.jsx("span",{className:"pi-asideName",title:m,children:m}),s.jsx("span",{className:"pi-asideHmark","aria-hidden":!0,children:s.jsx(y,{harness:h,size:13})}),s.jsxs("span",{className:"pi-asideProj",children:["/",b]})]}),s.jsxs("div",{className:"pi-asideSub",children:[x?s.jsx("span",{className:"pi-asideBranch",children:x}):null,s.jsxs("span",{className:"pi-asideStatus","data-tone":f,children:[c?s.jsx("span",{className:"pi-asidePulse","aria-hidden":!0}):null,I]})]})]})]}),s.jsxs("div",{className:"pi-asideBody",children:[s.jsx("h2",{className:"pi-asideHeadline",children:k}),s.jsxs("div",{className:"pi-asideReadouts",children:[s.jsx(p,{label:"Last active",value:v?O(v,r):"—"}),s.jsx(p,{label:e?"Session":"Conversations",value:e?"1":String(n?.sessionCount??0)}),s.jsx(p,{label:"Harness",value:h}),n?.contextPct!=null?s.jsx(p,{label:"Context",value:`${n.contextPct}%`}):null]}),e?s.jsxs("div",{className:"pi-asideSection",children:[s.jsx("div",{className:"pi-asideSectionHead",children:"Session context"}),s.jsxs("div",{className:"pi-asideLine",children:[j?s.jsxs("span",{title:j,children:["ref · ",j]}):s.jsx("span",{children:"No stable session reference yet."}),u?s.jsxs("span",{title:u,children:["root · ",P(u)]}):null,e.conversationId?s.jsxs("span",{title:e.conversationId,children:["conversation · ",e.conversationId]}):null]})]}):null,s.jsxs("div",{className:"pi-asideActions",children:[s.jsxs("button",{type:"button",className:"pi-asideBtn pi-asideBtnPrimary",onClick:()=>o(w),children:[A,s.jsx(g,{size:13,strokeWidth:2,"aria-hidden":!0})]}),N?s.jsxs("button",{type:"button",className:"pi-asideBtn",onClick:()=>o(N),children:["Observe",s.jsx(g,{size:13,strokeWidth:2,"aria-hidden":!0})]}):null,s.jsx("button",{type:"button",className:"pi-asideBtn",onClick:()=>o(S),children:"Clear"})]})]})]})}export{ys as ProjectsThreadAside};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as d,a1 as Je,b as Ut,y as $t,a2 as Vt,a3 as qt,K as Ht}from"./index-C1VaWNuD.js";import{h as ct,b as Wt,au as zt}from"./router-kfcaYqZr.js";import{a as V}from"./api-Co9aQ2Jw.js";import{u as Jt}from"./sse-B29iGBnw.js";import{o as Kt,i as Ke}from"./surface-activity-B1rgWB1i.js";import{i as Gt}from"./colors-BtO5_zlx.js";import{e as lt,s as Qt,i as Ge,r as Yt,b as Xt,f as Zt}from"./scoutbot-D7kGGyK_.js";import{d as en,c as tn,e as nn,f as rn,I as Oe,J as on,N as sn,l as we,K as Qe,j as Ye}from"./NewChatComposer-D2Ah4T-W.js";import{o as ut,a as an,c as cn,d as ln,h as Le,e as dt}from"./model-CBkMvT1w.js";import{F as un,a as dn,D as fn}from"./DocumentFocusViewer-D8iB6SMt.js";import{c as ft,T as pt}from"./TextDocumentSurface-2X1Gw4eA.js";import{C as pn}from"./chevron-right-CowuvuE6.js";import{F as hn}from"./file-text-BHro8MkG.js";import{c as mn}from"./createLucideIcon-Dv8H8m7J.js";import{C as gn}from"./code-xml-CkkNdRmu.js";import{A as vn}from"./arrow-left-eToA6GxC.js";import{A as wn}from"./arrow-right-DTX42clh.js";import{j as bn}from"./scout-voice-Cg1qfepC.js";import{i as yn}from"./keyboard-nav-B8sQ_8IF.js";import{u as Sn}from"./chunk-HRAB3GC3-KjjrTLCU.js";const ht={current:null,setMenu:null};function Po(){return i.useCallback((e,t)=>{e.preventDefault(),e.stopPropagation(),ht.setMenu?.({position:{x:e.clientX,y:e.clientY},items:t})},[])}function kn({children:e}){const[t,n]=i.useState(null),r=i.useRef(null);ht.setMenu=n;const o=i.useCallback(()=>{n(null)},[]);return i.useEffect(()=>{if(!t)return;const s=f=>{f.target instanceof Node&&r.current?.contains(f.target)||o()},a=f=>{f.key==="Escape"&&o()},u=()=>o(),l=f=>{f.defaultPrevented||o()};return window.addEventListener("mousedown",s,!0),window.addEventListener("keydown",a),window.addEventListener("wheel",u,!0),window.addEventListener("contextmenu",l),()=>{window.removeEventListener("mousedown",s,!0),window.removeEventListener("keydown",a),window.removeEventListener("wheel",u,!0),window.removeEventListener("contextmenu",l)}},[t,o]),i.useLayoutEffect(()=>{if(!t||!r.current)return;const s=r.current,a=s.getBoundingClientRect(),u=window.innerWidth,l=window.innerHeight;let f=t.position.x,c=t.position.y;f+a.width>u-8&&(f=u-a.width-8),c+a.height>l-8&&(c=l-a.height-8),f<8&&(f=8),c<8&&(c=8),s.style.left=`${f}px`,s.style.top=`${c}px`,s.style.visibility="visible"},[t]),d.jsxs(d.Fragment,{children:[e,t&&d.jsx("div",{ref:r,className:"s-context-menu",style:{left:t.position.x,top:t.position.y,visibility:"hidden"},role:"menu",onMouseDown:s=>s.stopPropagation(),children:t.items.map((s,a)=>s.kind==="separator"?d.jsx("div",{className:"s-context-menu-sep",role:"separator"},a):d.jsxs("button",{type:"button",className:"s-context-menu-item",role:"menuitem",onClick:()=>{s.onSelect(),o()},children:[d.jsx("span",{className:"s-context-menu-label",children:s.label}),s.shortcut&&d.jsx("span",{className:"s-context-menu-shortcut",children:s.shortcut})]},a))})]})}function An(e){const t=e instanceof Error?e.message:String(e);return En(t)?"Scout server is unreachable":t}function Cn(e){return e==="Scout server is unreachable"}function En(e){return/failed to fetch|fetch failed|networkerror|load failed|couldn'?t connect|could not connect|connection refused|econnrefused|server is unreachable/i.test(e)}const In=["codex","claude","grok","grok-acp","kimi","flue","cursor","opencode","native","worker","bridge","http","pi"],Re="openscout.operator.name",xn=new Set(["operator","you","user","unknown","null","undefined"]);function mt(e){const t=e?.trim();return!t||t.length>64||xn.has(t.toLowerCase())?null:t}function Rn(){if(typeof window>"u")return null;try{return mt(window.localStorage.getItem(Re))}catch{return null}}function Tn(e){if(!(typeof window>"u"))try{const t=mt(e);t?window.localStorage.setItem(Re,t):window.localStorage.removeItem(Re)}catch{}}const jn=new Set(In);function _e(e){const t=e?.trim().toLowerCase().replace(/_/gu,"-")??"",n=t==="claude-code"||t==="claude-stream-json"?"claude":t==="codex-app-server"||t==="codex-exec"?"codex":t==="pi-rpc"?"pi":t;return jn.has(n)?n:null}function Ce(e){const t=e?.trim();if(!t)return null;const n=t.split(/[\\/]/u).filter(Boolean).at(-1)??t;return n.endsWith(".jsonl")?n.slice(0,-6):n}function Pe(e){const t=e?.trim();if(!t)return null;if(t.startsWith("session:")){const r=t.slice(8),o=r.indexOf(":");if(o>0){const a=_e(r.slice(0,o)),u=Ce(r.slice(o+1));if(a&&u)return{refId:u,harness:a,qualified:!0}}const s=Ce(r);return s?{refId:s,harness:null,qualified:!1}:null}const n=Ce(t);return n?{refId:n,harness:null,qualified:!1}:null}function gt(e,t){const n=Pe(t);if(!n)return null;if(n.qualified)return`session:${n.harness}:${n.refId}`;const r=_e(e);return r?`session:${r}:${n.refId}`:n.refId}function Ee(e,t){const n=t?.trim();n&&e.add(n)}function Nn(e,t){const n=new Set;return Ee(n,e.authorityNodeId),Ee(n,e.homeNodeId),n.size===0&&Ee(n,t),n}function vt(e,t,n){return t?Nn(e,n).has(t):!0}function wt(e,t,n){return t?e.filter(r=>vt(r,t,n)):e}function Mo(e,t,n){return t?new Set(e.filter(r=>vt(r,t,n)).map(r=>r.id)):null}function Y(e,t,n){return!t&&!n||n&&e.authorityNodeId===n?!0:t?e.agentId&&t.has(e.agentId)||e.actorId&&t.has(e.actorId)||e.ownerId&&t.has(e.ownerId)||e.nextMoveOwnerId&&t.has(e.nextMoveOwnerId)?!0:!!e.participantIds?.some(r=>t.has(r)):!1}function On(e,t,n){return Y(e,t,n)}function Do(e,t,n){return!t&&!n?e:e.filter(r=>On(r,t,n))}function Ln(e,t){return Y(e,t)}function _n(e,t){return t?e.filter(n=>Ln(n,t)):e}function Xe(e,t){return Y(e,t)}function Bo(e,t){if(!e||!t)return e;const n=e.activeAsks.filter(a=>Y(a,t)),r=e.recentCompleted.filter(a=>Y(a,t)),o=e.needsAttention.filter(a=>Y(a,t)),s=_n(e.activity,t);return{...e,totals:{active:n.length,recentCompleted:r.length,needsAttention:o.length,activity:s.length},activeAsks:n,recentCompleted:r,needsAttention:o,activity:s}}function Fo(e,t){if(!t)return e;const n=e.activeFlights.filter(s=>Y(s,t)),r=e.childWork.filter(s=>Xe(s,t));return Xe(e,t)||n.length>0||r.length>0?{...e,activeFlights:n,childWork:r}:null}function Pn(e){const t=e.id.trim();return t.startsWith("session-")||t.startsWith("local-session-agent-")}function bt(e){return!!(Pn(e)||e.handle?.trim().toLowerCase()?.startsWith("session-")||e.definitionId?.trim().toLowerCase()?.startsWith("session-")||/^session\s+/i.test(e.name.trim())||`${e.selector??""} ${e.defaultSelector??""}`.toLowerCase().includes("@session-"))}function Mn(e){return!!(e.project?.trim()||e.projectRoot?.trim())}function Dn(e){const t=e.handle?.trim();if(t&&!t.toLowerCase().startsWith("session-")||e.role?.trim())return!0;const n=e.definitionId?.trim();return!!(n&&!n.toLowerCase().startsWith("session-")&&!n.toLowerCase().startsWith("local-session-agent-"))}function yt(e){return e.retiredFromFleet||e.staleLocalRegistration||e.agentClass==="organic"||bt(e)?!1:Mn(e)||Dn(e)}function Uo(e){return e.filter(yt)}const St=1440*6e4;function $o(e,t){const n=r=>JSON.stringify([r.activeAsks,r.needsAttention]);return e&&n(e)===n(t)?e:t}function Bn(e){const t=new Map;for(const n of e?.activeAsks??[]){const r=t.get(n.agentId)??[];r.push(n),t.set(n.agentId,r)}return t}function Fn(e){const t=new Map,n=(r,o)=>{if(!r)return;const s=t.get(r)??[];s.push(o),t.set(r,s)};for(const r of e?.needsAttention??[])n(r.agentId,{title:r.title,summary:r.summary,conversationId:r.conversationId,updatedAt:r.updatedAt});for(const r of t.values())r.sort((o,s)=>s.updatedAt-o.updatedAt);return t}function kt(e){return e?e.charAt(0).toUpperCase()+e.slice(1):"Harness"}function At(e){return e.length===1?e[0]??null:e.length>1?`${e.length} branches`:null}function Un(e,t,n,r){const o=e.group,s=o.nodes.flatMap(R=>n.get(R.row.agent.id)??[]).sort((R,b)=>b.updatedAt-R.updatedAt)[0]??null,a=!!s,u=!a&&o.nodes.some(R=>Oe(R.row)),l=cn(o,r),f=a?"needs":u?"working":"recent",c=a?"needs":u||l?"live":"idle",v=e.leadAgent,S=s?.conversationId??t.get(v.id)??v.conversationId??null;return{id:`${e.projectSlug}:agent:${v.id}`,kind:"agent",projectSlug:e.projectSlug,projectTitle:e.projectTitle,projectRoot:e.projectRoot,workspaceRoot:v.cwd??v.projectRoot??e.projectRoot,agentId:v.id,agentName:o.name,harness:Le(o.harness),branch:At(o.branches),work:s?.summary?.trim()||s?.title.trim()||ln(e,c),group:f,needs:a,working:u,lastActivityAt:o.lastActivityAt,sessionCount:o.sessionCount,contextPct:null,conversationId:S,sessionId:null}}function $n(e){return e&&e.view==="sessions"&&e.sessionId?e.sessionId:null}function Vn(e,t,n){const r=Le(t.harness);return{id:`${e.slice.slug}:native:${t.key}`,kind:"native",projectSlug:e.slice.slug,projectTitle:e.slice.title,projectRoot:e.slice.root,workspaceRoot:e.slice.root,agentId:null,agentName:`${kt(r)} session`,harness:r,source:t.harness,branch:null,work:dt(t.detail??t.label)||t.label,group:"working",needs:!1,working:!0,lastActivityAt:t.lastActivityAt??n,sessionCount:1,contextPct:null,conversationId:null,sessionId:$n(t.route)}}function qn(e,t){return e.status==="active"||e.status==="workflow"?"working":(e.lastActivityAt&&t-e.lastActivityAt<St,"recent")}function Se(e){return e?e.view==="sessions"?e.sessionId??null:e.view==="conversation"?e.conversationId:null:null}function Te(e){return!!Se(e.route)}function je(e,t,n,r,o,s){const a=Le(t.harness),u=Se(t.route),l=t.status==="active"||t.status==="workflow";return{id:`${e.slice.slug}:session:${t.key}`,kind:"session",projectSlug:e.slice.slug,projectTitle:e.slice.title,projectRoot:e.slice.root,workspaceRoot:r?.cwd??r?.projectRoot??e.slice.root,agentId:r?.id??null,agentName:r?.name??`${kt(a)} session`,harness:a,source:t.harness,branch:At(o?[o]:[]),work:dt(t.detail??t.label)||t.label,group:qn(t,n),needs:!1,working:l,lastActivityAt:t.lastActivityAt??n,latestReplyAt:s?.ts??null,latestReplyPreview:s?.summary.trim()||null,sessionCount:1,contextPct:null,conversationId:t.route?.view==="conversation"?t.route.conversationId:null,sessionId:t.route?.view==="sessions"?t.route.sessionId??u:u,route:t.route}}function Ct(e){const t=e?.trim();if(!t)return null;const n=t.split(/[\\/]/u).filter(Boolean).at(-1)??t;return n.endsWith(".jsonl")?n.slice(0,-6):n}function ne(e,t){const n=Ct(t);return n?`${_e(e)??e.trim().toLowerCase()}\0${n}`:null}function Hn(e){if(!e.raw||typeof e.raw!="object"||Array.isArray(e.raw))return null;const t=e.raw.payload;if(!t||typeof t!="object"||Array.isArray(t))return null;const n=t.role;return typeof n=="string"?n.trim().toLowerCase():null}function Wn(e){const t=e.trim();if(!t.startsWith("{"))return!1;if(t.startsWith('{"risk_level":')&&t.includes('"user_authorization":')&&t.includes('"outcome":')&&t.includes('"rationale":'))return!0;try{const n=JSON.parse(t);return typeof n.risk_level=="string"&&typeof n.user_authorization=="string"&&typeof n.outcome=="string"&&typeof n.rationale=="string"}catch{return!1}}function zn(e){if(e.kind!=="assistant")return!1;const t=e.summary.trim();if(!t||/^\[(?:assistant|message)\]$/iu.test(t))return!1;const n=Hn(e);return n&&n!=="assistant"?!1:!Wn(t)}function Jn(e){const t=new Map;for(const n of e){if(!zn(n))continue;const r=ne(n.source,n.sessionId);if(!r)continue;const o=t.get(r);(!o||n.ts>o.ts)&&t.set(r,n)}return t}function Kn(e,t,n){const r=[];for(const o of e.agents)for(const s of o.sessions)Te(s)&&r.push(je(e,s,t,o.row.agent,o.row.branch,n.get(ne(s.harness,Se(s.route))??"")??null));for(const o of e.unassigned)Te(o)&&r.push(je(e,o,t,void 0,void 0,n.get(ne(o.harness,Se(o.route))??"")??null));return r.sort((o,s)=>s.lastActivityAt-o.lastActivityAt||o.agentName.localeCompare(s.agentName))}function Gn(e,t,n,r){const o=new Set;for(const s of t){const a=ne(s.source??s.harness,s.sessionId);a&&o.add(a)}for(const s of e)for(const a of s.agents){if(!a.sessions.some(Te))continue;const u=a.row.agent,l=ne(u.harness??a.row.harness,u.harnessSessionId);l&&o.add(l)}for(const s of e)for(const a of s.agents){const u=a.row.agent;if(!bt(u))continue;const l=u.harness?.trim()||a.row.harness,f=Ct(u.harnessSessionId),c=ne(l,f);if(!f||!c||o.has(c))continue;o.add(c);const v=Oe(a.row),S={key:`fallback:${u.id}`,status:v?"active":"idle",harness:l,label:u.name,detail:a.row.activeTask??u.harnessLogPath??f,lastActivityAt:a.row.lastActivityAt??u.createdAt??n,route:{view:"sessions",sessionId:f}};t.push(je(s,S,n,u,a.row.branch,r.get(c)??null))}t.sort((s,a)=>a.lastActivityAt-s.lastActivityAt||s.agentName.localeCompare(a.agentName))}function Qn(e){const t=new Map,n=(r,o,s,a)=>{const u=t.get(r);if(!u){t.set(r,{root:r,branch:o,working:s,lastActivityAt:a});return}(s||!u.branch)&&o&&(u.branch=o),u.working||=s,u.lastActivityAt=Math.max(u.lastActivityAt,a)};for(const r of e.agents){const o=r.row.agent.cwd??r.row.agent.projectRoot??e.slice.root;if(!o)continue;const s=r.row.branch&&r.row.branch!=="—"?r.row.branch:null;n(o,s,Oe(r.row),r.row.lastActivityAt??0)}for(const r of e.slice.nativeSessions)r.cwd&&n(r.cwd,null,r.status==="active",r.lastActivityAt??0);return t.size===0&&e.slice.root&&n(e.slice.root,null,!1,e.lastActivityAt??0),[...t.values()].sort((r,o)=>Number(o.working)-Number(r.working)||o.lastActivityAt-r.lastActivityAt||r.root.localeCompare(o.root))}function Ze(e,t){return e.needs?3:e.working?2:t-e.lastActivityAt<St?1:0}function Vo(e){const{nowMs:t,showEphemeral:n}=e,r=wt(e.agents,e.machineId),o=Bn(e.fleet),s=Fn(e.fleet),{conversationByAgentId:a,sessionByAgentId:u}=en(e.sessions),l=r.map(p=>tn(p,u.get(p.id)??null,o.get(p.id)??[])),f=nn(e.discovery,t),c=rn(l,e.sessions,f),v=an(c,n).filter(p=>yt(p.leadAgent)),S=Jn(e.recentEvents??[]),R=v.map(p=>Un(p,a,s,t));for(const p of c)for(const g of p.unassigned)g.kind!=="native"||g.status!=="active"||!g.route||R.push(Vn(p,g,t));R.sort((p,g)=>Ze(g,t)-Ze(p,t)||g.lastActivityAt-p.lastActivityAt);const b=c.flatMap(p=>Kn(p,t,S));Gn(c,b,t,S);const y=new Map;for(const p of R){const g=y.get(p.projectSlug)??[];g.push(p),y.set(p.projectSlug,g)}const m=new Map;for(const p of b){const g=m.get(p.projectSlug)??[];g.push(p),m.set(p.projectSlug,g)}const N=c.map(p=>{const g=y.get(p.slice.slug)??[],P=m.get(p.slice.slug)??[],O=[...new Set(p.agents.map(w=>w.row.branch).filter(w=>!!w&&w!=="—"&&w!=="main"))],k=Qn(p);return{slug:p.slice.slug,title:p.slice.title,root:p.slice.root,agentCount:1,sessionCount:P.length,liveSessionCount:P.filter(w=>w.working).length,worktreeCount:k.length,worktrees:k,needs:g.filter(w=>w.needs).length,working:g.filter(w=>w.working).length,threadCount:g.length,lastActivityAt:p.lastActivityAt,branches:O}});return N.sort((p,g)=>ke(g)-ke(p)||g.lastActivityAt-p.lastActivityAt||p.title.localeCompare(g.title)),Xn({projects:N,threads:R,sessions:b,projectAliases:{}})}function ke(e){return e.needs>0?2:e.working>0?1:0}function et(e){return e?/\/(?:\.codex|\.claude|\.agents?)\/worktrees\/[^/]+\//iu.test(e)||/\/\.worktrees\/[^/]+/iu.test(e):!1}function tt(e){return e.replace(/^\/Users\/[^/]+(?=\/)/u,"~").replace(/\/+$/u,"")}function Yn(e){const t=new Map;for(const n of e)for(const r of n.worktrees){const o=t.get(r.root);if(!o){t.set(r.root,{...r});continue}o.branch??=r.branch,o.working||=r.working,o.lastActivityAt=Math.max(o.lastActivityAt,r.lastActivityAt)}return[...t.values()].sort((n,r)=>Number(r.working)-Number(n.working)||r.lastActivityAt-n.lastActivityAt||n.root.localeCompare(r.root))}function Xn(e){const t=new Map;for(const c of e.projects){if(!c.root||!et(c.root))continue;const v=e.projects.filter(S=>S.slug!==c.slug&&!et(S.root)&&S.worktrees.some(R=>tt(R.root)===tt(c.root)));v.length===1&&t.set(c.slug,v[0].slug)}if(t.size===0)return e;const n=new Map(e.projects.map(c=>[c.slug,c])),r=c=>{const v=t.get(c.projectSlug);if(!v)return c;const S=n.get(v);return{...c,projectSlug:S.slug,projectTitle:S.title,projectRoot:S.root}},o=c=>{const v=t.get(c.projectSlug);if(!v)return c;const S=n.get(v);return{...c,projectSlug:S.slug,projectTitle:S.title,projectRoot:S.root}},s=e.threads.map(r),a=e.sessions.map(o),u=new Map;for(const c of e.projects){const v=t.get(c.slug)??c.slug,S=u.get(v)??[];S.push(c),u.set(v,S)}const l=[...u.entries()].map(([c,v])=>{const S=n.get(c),R=s.filter(m=>m.projectSlug===c),b=a.filter(m=>m.projectSlug===c),y=Yn(v);return{...S,agentCount:1,sessionCount:b.length,liveSessionCount:b.filter(m=>m.working).length,worktreeCount:y.length,worktrees:y,needs:R.filter(m=>m.needs).length,working:R.filter(m=>m.working).length,threadCount:R.length,lastActivityAt:Math.max(...v.map(m=>m.lastActivityAt)),branches:[...new Set(v.flatMap(m=>m.branches))]}});l.sort((c,v)=>ke(v)-ke(c)||v.lastActivityAt-c.lastActivityAt||c.title.localeCompare(v.title));const f={...e.projectAliases};for(const[c,v]of t)f[c]=v;return{projects:l,threads:s,sessions:a,projectAliases:f}}function Ie(e){return e.replace(/^\/Users\/[^/]+(?=\/)/u,"~").replace(/\/+$/u,"")}function Zn(e,t){if(!t?.trim())return null;const n=Ie(t.trim());for(const r of e.projects){if(r.root&&Ie(r.root)===n)return nt(e,r.slug)??r.slug;for(const o of r.worktrees)if(Ie(o.root)===n)return nt(e,r.slug)??r.slug}return null}function nt(e,t){if(e.projects.some(o=>o.slug===t))return t;let n=t;const r=new Set;for(;Object.hasOwn(e.projectAliases,n);){if(r.has(n))return null;r.add(n),n=e.projectAliases[n]}return e.projects.some(o=>o.slug===n)?n:null}function qo(e,t,n){const r=new Set(n.map(s=>s.slug)),o={...t};for(const[s,a]of Object.entries(e??{}))r.has(s)||!r.has(a)||o[s]||(o[s]=a);return o}function Ho(e,t){return e.filter(n=>n.projectSlug===t)}function Wo(e,t){return e.filter(n=>n.projectSlug===t)}const er=["needs","working","recent"],tr={needs:"Your turn",working:"In flight",recent:"Recent"};function zo(e){const t=new Map;for(const n of e){const r=t.get(n.group)??[];r.push(n),t.set(n.group,r)}return er.filter(n=>t.has(n)).map(n=>({group:n,label:tr[n],items:t.get(n)}))}function X(e){return{view:"agents-v2",...e.projectSlug?{projectSlug:e.projectSlug}:{},...e.machineId?{machineId:e.machineId}:{}}}function Ae(e){return e.kind!=="native"||!e.sessionId?null:gt(e.source??e.harness,e.sessionId)}function nr(e,t){const n=t.projectSlug?e.filter(l=>l.projectSlug===t.projectSlug):e;if(t.selectedAgentId){const l=n.filter(f=>f.agentId===t.selectedAgentId);return l.length===1?l[0]:null}const r=t.sessionId?.trim();if(!r)return null;const o=n.filter(l=>Ae(l)===r);if(o.length===1)return o[0];const s=Pe(r);if(o.length>1||s?.qualified)return null;const a=s?.refId??r,u=n.filter(l=>l.kind==="native"&&l.sessionId===a);return u.length===1?u[0]:null}function Jo(e,t,n){return nr(n,t)===e}function Ko(e,t){return e.kind==="native"?{...X(t),sessionId:Ae(e)??void 0}:{...X(t),selectedAgentId:e.agentId??void 0}}function Go(e,t){const n=Ae(e);return n?{view:"sessions",sessionId:n}:e.conversationId?{view:"conversation",conversationId:e.conversationId}:e.agentId?ut(t,e.agentId):X(t)}function Qo(e,t){const n=Ae(e);return n?{view:"sessions",sessionId:n}:e.agentId?{...ut(t,e.agentId),tab:"observe"}:null}function Yo(e,t){const n=Me(e);return n?{...X(t),indexView:"sessions",...n?{sessionId:n}:{},selectedAgentId:void 0}:X(t)}function Xo(e,t,n){return rr(n,t)===e}function Me(e){return e.conversationId&&e.route?.view==="conversation"?e.conversationId:e.sessionId?gt(e.source??e.harness,e.sessionId):e.conversationId?e.conversationId:null}function rr(e,t){const n=t.sessionId?.trim();if(!n)return null;const r=t.projectSlug?e.filter(l=>l.projectSlug===t.projectSlug):e,o=r.filter(l=>Me(l)===n);if(o.length===1)return o[0];const s=Pe(n);if(o.length>1||s?.qualified)return null;const a=s?.refId??n,u=r.filter(l=>l.sessionId===a||l.conversationId===a||l.id===a);return u.length===1?u[0]:null}function Zo(e,t){const n=Me(e);return n?{...X(t),projectSlug:e.projectSlug,indexView:"sessions",sessionId:n,selectedAgentId:void 0}:{...X(t),projectSlug:e.projectSlug,indexView:"sessions",selectedAgentId:void 0,sessionId:void 0}}function es(e,t,n){const r=t?Zn(e,t):null;return{view:"agents-v2",...r?{projectSlug:r}:{},...n.machineId?{machineId:n.machineId}:{},...n.showEphemeral?{showEphemeral:!0}:{}}}let Et=null;function ts(e){Et=e}function or(e,t){Et?.(e,t)}const sr=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ir=mn("chevron-up",sr),ar={id:"audio",canHandle:e=>e.kind==="file"&&e.mediaType.startsWith("audio/"),render:({resource:e})=>{const t=e;return d.jsx("div",{className:"s-file-preview-media-wrap",children:d.jsx("div",{className:"s-file-preview-audio-stage",children:d.jsx("audio",{className:"s-file-preview-audio",src:t.rawUrl,controls:!0})})})}},cr={id:"binary",canHandle:()=>!0,render:({resource:e})=>{const t=e;return d.jsxs("div",{className:"s-file-preview-callout",children:[d.jsxs("div",{className:"s-file-preview-callout-title",children:[t.previewReason," — open in OS"]}),d.jsxs("div",{className:"s-file-preview-callout-copy",children:["Scout can resolve this file, but it does not have an inline preview for ",t.mediaType," yet."]})]})}},lr=new Set(["text/typescript","text/javascript","text/css","text/html","application/json","text/yaml","text/toml","text/x-shellscript","text/plain"]),ur={id:"code",canHandle:e=>e.kind==="file"&&e.previewable&&lr.has(e.mediaType),render:({resource:e})=>{const t=e,n=ft({id:t.realPath,title:t.title,uri:t.realPath,mediaType:t.mediaType,value:t.content,filename:t.title,kind:"code",readOnly:!0});return d.jsx(pt,{document:n,mode:"read",className:"s-doc-focus-document"})}},dr={id:"directory",canHandle:e=>e.kind==="directory",render:({resource:e,openFilePreview:t})=>{const n=e,r=fr(n.realPath,n.rootPath);return d.jsxs("div",{className:"s-file-preview-directory",children:[d.jsx("div",{className:"s-file-preview-breadcrumb","aria-label":"Directory breadcrumb",children:r.map((o,s)=>{const a=s===r.length-1;return d.jsxs("div",{className:"s-file-preview-breadcrumb-item",children:[s>0&&d.jsx(pn,{size:12,"aria-hidden":"true"}),a?d.jsx("span",{className:"s-file-preview-breadcrumb-current",children:o.label}):d.jsx("button",{type:"button",className:"s-file-preview-breadcrumb-link",onClick:()=>t(o.path),children:o.label})]},o.path)})}),d.jsxs("div",{className:"s-file-preview-directory-list",role:"list",children:[n.entries.map(o=>d.jsxs("button",{type:"button",className:"s-file-preview-entry",onClick:()=>t(o.path),children:[d.jsx("span",{className:"s-file-preview-entry-icon","aria-hidden":"true",children:o.kind==="directory"?d.jsx(un,{size:14}):d.jsx(hn,{size:14})}),d.jsx("span",{className:"s-file-preview-entry-name",children:o.name}),d.jsx("span",{className:"s-file-preview-entry-kind",children:o.kind==="directory"?"dir":"file"})]},o.realPath)),n.entries.length===0&&d.jsx("div",{className:"s-file-preview-directory-empty",children:"This directory is empty."})]})]})}};function fr(e,t){const n=t==="/"?"/":t.replace(/\/+$/u,""),r=e==="/"?"/":e.replace(/\/+$/u,""),o=n.split("/").filter(Boolean),s=r.split("/").filter(Boolean),a=[{label:o[o.length-1]??"/",path:n||"/"}];let u=n||"/";for(let l=o.length;l<s.length;l+=1){const f=s[l];f&&(u=u==="/"?`/${f}`:`${u}/${f}`,a.push({label:f,path:u}))}return a}const pr={id:"html",canHandle:e=>e.kind==="file"&&e.previewable&&e.mediaType==="text/html",render:({resource:e})=>d.jsx("div",{className:"s-file-preview-html-wrap",children:d.jsx("iframe",{className:"s-file-preview-html-frame",src:e.kind==="file"?e.rawUrl:"",title:e.title,sandbox:"allow-forms allow-popups allow-popups-to-escape-sandbox allow-scripts",referrerPolicy:"no-referrer"})})},hr={id:"image",canHandle:e=>e.kind==="file"&&e.mediaType.startsWith("image/"),render:({resource:e})=>d.jsx("div",{className:"s-file-preview-image-wrap",children:d.jsx("div",{className:"s-file-preview-image-stage",children:d.jsx("img",{className:"s-file-preview-image",src:e.kind==="file"?e.rawUrl:"",alt:e.title})})})},mr={id:"markdown",canHandle:e=>e.kind==="file"&&e.previewable&&e.mediaType==="text/markdown",render:({resource:e})=>{const t=e,n=ft({id:t.realPath,title:t.title,uri:t.realPath,mediaType:t.mediaType,value:t.content,filename:t.title,kind:"markdown",readOnly:!0});return d.jsx(pt,{document:n,mode:"preview",className:"s-doc-focus-document"})}},gr={id:"video",canHandle:e=>e.kind==="file"&&e.mediaType.startsWith("video/"),render:({resource:e})=>{const t=e;return d.jsx("div",{className:"s-file-preview-media-wrap",children:d.jsx("div",{className:"s-file-preview-media-stage",children:d.jsx("video",{className:"s-file-preview-video",src:t.rawUrl,controls:!0})})})}},vr=[dr,mr,pr,ur,hr,gr,ar,cr];function wr({path:e,onOpenPath:t,onOpenInCode:n,onClose:r}){const[o,s]=i.useState(null),[a,u]=i.useState(null),[l,f]=i.useState(!1),[c,v]=i.useState(null),S=i.useRef(null);i.useEffect(()=>{S.current=c},[c]),i.useEffect(()=>{if(!e){s(null),u(null),f(!1);return}let k=!1;return f(!0),u(null),s(null),V(`/api/file/preview?path=${encodeURIComponent(e)}`).then(w=>{k||(s(w),br(w,S.current,v))}).catch(w=>{k||u(w instanceof Error?w.message:"could not load file")}).finally(()=>{k||f(!1)}),()=>{k=!0}},[e]);const{currentIndex:R,prevPath:b,nextPath:y}=i.useMemo(()=>{if(!o||o.kind!=="file"||!c)return{currentIndex:-1,prevPath:null,nextPath:null};const k=c.files.findIndex(w=>w.realPath===o.realPath);return k<0?{currentIndex:-1,prevPath:null,nextPath:null}:{currentIndex:k,prevPath:k>0?c.files[k-1].path:null,nextPath:k<c.files.length-1?c.files[k+1].path:null}},[o,c]);if(i.useEffect(()=>{if(!e)return;const k=w=>{if(w.key==="Escape"){r();return}if(w.target instanceof HTMLElement){const C=w.target.tagName;if(C==="INPUT"||C==="TEXTAREA"||w.target.isContentEditable)return}w.metaKey||w.ctrlKey||w.altKey||(w.key==="ArrowLeft"&&b?(w.preventDefault(),t(b)):w.key==="ArrowRight"&&y?(w.preventDefault(),t(y)):w.key==="Backspace"&&c&&o?.kind==="file"&&(w.preventDefault(),t(c.dirPath)))};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[e,r,t,b,y,c,o]),!e)return null;const m=()=>{V("/api/file/reveal",{method:"POST",body:JSON.stringify({path:o?.realPath??e})}).catch(k=>{u(k instanceof Error?k.message:"reveal failed")})},N=o?vr.find(k=>k.canHandle(o))??null:null,p=!!(o&&o.kind==="file"&&c&&R>=0&&c.files.length>1),g=[];p&&c&&g.push({label:`Folder: ${c.dirTitle}`,icon:d.jsx(ir,{size:12}),onClick:()=>t(c.dirPath),title:`Back to ${c.dirTitle} (Backspace)`}),g.push({label:"Open in Code",icon:d.jsx(gn,{size:12}),onClick:()=>{o?.kind==="file"&&n(o.realPath,o.rootPath)},title:"Continue with this file in Scout’s Code browser",disabled:o?.kind!=="file"}),g.push({label:"Show in folder",icon:d.jsx(dn,{size:12}),onClick:m,title:"Show this file in its operating system folder",hideLabel:!0});const P=o?Sr(o):[];p&&P.unshift(`${R+1} / ${c.files.length}`);const O=o&&N?N.render({resource:o,openFilePreview:t}):null;return d.jsx(fn,{open:!0,kind:yr(o),document:null,title:o?.title??e.split("/").pop()??"File",eyebrow:"File preview",subtitle:o?.realPath??e,meta:P,state:l?"Loading…":null,error:a,body:O?d.jsxs("div",{className:`s-file-preview-shell${p?" s-file-preview-shell-nav":""}`,children:[p&&d.jsx("button",{type:"button",className:"s-file-preview-side-nav s-file-preview-side-nav-left",onClick:()=>b&&t(b),disabled:!b,"aria-label":"Previous file",title:"Previous file (←)",children:d.jsx(vn,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}),d.jsx("div",{className:"s-file-preview-shell-body",children:O}),p&&d.jsx("button",{type:"button",className:"s-file-preview-side-nav s-file-preview-side-nav-right",onClick:()=>y&&t(y),disabled:!y,"aria-label":"Next file",title:"Next file (→)",children:d.jsx(wn,{size:18,strokeWidth:1.8,"aria-hidden":"true"})})]}):null,actions:g,onClose:r})}function br(e,t,n){if(e.kind==="directory"){const o=e.entries.filter(s=>s.kind==="file");n({dirPath:e.path,dirTitle:e.title,files:o});return}if(!t){n(null);return}t.files.some(o=>o.realPath===e.realPath)||n(null)}function yr(e){return!e||e.kind==="directory"||e.mediaType==="text/markdown"||e.mediaType==="text/plain"?"doc":"code"}function Sr(e){return e.kind==="directory"?[`${e.entries.length} ${e.entries.length===1?"entry":"entries"}`]:[...e.previewable&&e.truncated?["truncated"]:[],kr(e.sizeBytes),e.mediaType]}function kr(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}const It={activity:"idle",brief:{lastDeliveredAt:null},reminders:{dueCount:0,upcomingCount:0,due:[],next:null},voice:{available:null,setupBlocked:!1,replies:!1},error:null,session:{title:null,lastActivityAt:null},conversation:{messageCount:0,loading:!0}},Q=()=>{},xt={focusScoutbot:Q,triggerBrief:Q,triggerAskState:Q,toggleVoiceReplies:Q,openScoutbotSettings:Q,startNewChat:Q,dismissReminder:Q,askReminderStatus:Q},De=i.createContext(null);function Ar({children:e}){const[t,n]=i.useState(It),r=i.useRef(xt),o=i.useCallback(l=>{n(f=>Cr(f,l)?f:l)},[]),s=i.useCallback(l=>{r.current=l},[]),a=i.useMemo(()=>({focusScoutbot:()=>r.current.focusScoutbot(),triggerBrief:()=>r.current.triggerBrief(),triggerAskState:()=>r.current.triggerAskState(),toggleVoiceReplies:()=>r.current.toggleVoiceReplies(),openScoutbotSettings:()=>r.current.openScoutbotSettings(),startNewChat:()=>r.current.startNewChat(),dismissReminder:l=>r.current.dismissReminder(l),askReminderStatus:l=>r.current.askReminderStatus(l)}),[]),u=i.useMemo(()=>({state:t,actions:a,publishState:o,registerActions:s}),[t,a,o,s]);return d.jsx(De.Provider,{value:u,children:e})}function ns(){const e=i.useContext(De);return e?{state:e.state,actions:e.actions}:{state:It,actions:xt}}function rs(){const e=i.useContext(De);return e?{publishState:e.publishState,registerActions:e.registerActions}:null}function Cr(e,t){return e.activity===t.activity&&e.brief.lastDeliveredAt===t.brief.lastDeliveredAt&&e.reminders.dueCount===t.reminders.dueCount&&e.reminders.upcomingCount===t.reminders.upcomingCount&&Er(e.reminders.due,t.reminders.due)&&Rt(e.reminders.next,t.reminders.next)&&e.voice.available===t.voice.available&&e.voice.setupBlocked===t.voice.setupBlocked&&e.voice.replies===t.voice.replies&&e.error===t.error&&e.session.title===t.session.title&&e.session.lastActivityAt===t.session.lastActivityAt&&e.conversation.messageCount===t.conversation.messageCount&&e.conversation.loading===t.conversation.loading}function Er(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Rt(e[n],t[n]))return!1;return!0}function Rt(e,t){return e===t?!0:!e||!t?!1:e.id===t.id&&e.body===t.body&&e.status===t.status&&e.dueAt===t.dueAt}const Ir="/api/voice/realtime/call",Tt="/api/voice/realtime/lease",jt="/api/voice/realtime/settings",xr="x-openscout-realtime-voice-lease",Nt="surface.realtime-voice",os="scout:realtime-voice-stop",Ne="scout:realtime-voice-settings",Rr={noise_reduction:{type:"far_field"},turn_detection:{type:"server_vad",threshold:.6,prefix_padding_ms:300,silence_duration_ms:500,create_response:!0,interrupt_response:!0}},Tr={noise_reduction:{type:"near_field"},turn_detection:{type:"server_vad",threshold:.5,prefix_padding_ms:300,silence_duration_ms:500,create_response:!0,interrupt_response:!0}},jr="/api/scoutbot/chat",Ot="openscout.realtime-voice-settings";function Lt(e){return V(jt,{signal:e,cache:"no-store"})}function ss(e){return V(jt,{method:"PUT",body:JSON.stringify({enabled:e})})}function is(e){if(window.dispatchEvent(new CustomEvent(Ne,{detail:e})),!("BroadcastChannel"in window))return;const t=new BroadcastChannel(Ot);t.postMessage(e),t.close()}function Nr(e){const t=r=>{const o=r.detail;rt(o)&&e(o)};window.addEventListener(Ne,t);const n="BroadcastChannel"in window?new BroadcastChannel(Ot):null;return n&&(n.onmessage=r=>{rt(r.data)&&e(r.data)}),()=>{window.removeEventListener(Ne,t),n?.close()}}function rt(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.enabled=="boolean"&&typeof t.configuredEnabled=="boolean"&&(t.source==="settings"||t.source==="environment")&&typeof t.locked=="boolean"}const Or=25e3;async function Lr(e={}){if(te(e.signal),!globalThis.RTCPeerConnection||!navigator.mediaDevices?.getUserMedia)throw new Error("This browser does not support realtime audio calls.");if(!(await Lt(e.signal)).enabled)throw new Error("Live voice is off. Turn it on in Settings → Voice before starting a call.");te(e.signal),e.onState?.("connecting");const n=new RTCPeerConnection,r=new Audio;r.autoplay=!0;let o=!1,s=null,a=null,u=null,l=0,f=0;const c=(y,m,N="voice")=>{f+=1,e.onTrace?.({id:`voice-${f}`,at:Date.now(),kind:N,label:y,...m?{detail:m}:{}})};let v=null;const S=()=>{if(v)return v;o=!0,e.signal?.removeEventListener("abort",b),u&&clearInterval(u),u=null,s?.getTracks().forEach(m=>m.stop()),r.pause(),r.srcObject=null,n.close();const y=a;return a=null,v=(async()=>{y&&await Hr(y),e.onState?.("ended")})(),v},R=()=>{S().catch(y=>{e.onError?.(y instanceof Error?y.message:"Could not release the realtime voice lease."),e.onState?.("error")})},b=()=>{R()};e.signal?.addEventListener("abort",b,{once:!0}),n.ontrack=({streams:y})=>{const m=y[0];if(!m||o)return;const[N]=m.getAudioTracks();N&&N.addEventListener("ended",()=>{o||e.onError?.("Realtime voice audio ended unexpectedly.")}),r.srcObject=m,r.play().catch(()=>{e.onError?.("Browser playback was blocked. Interact with the page, then start the call again.")})},n.onconnectionstatechange=()=>{o||(n.connectionState==="connected"?(e.onState?.("live"),c("Realtime channel connected","Scoutbot bridge is ready")):(n.connectionState==="failed"||n.connectionState==="disconnected")&&(e.onError?.("Realtime voice connection ended unexpectedly."),R()))};try{s=await Vr(e.inputDeviceName,e.signal),te(e.signal);for(const T of s.getTracks())n.addTrack(T,s);const y=n.createDataChannel("oai-events"),m=new Set;let N=Promise.resolve(),p=!1,g=null;const P=[],O=T=>{if(o||y.readyState!=="open")return!1;try{return y.send(JSON.stringify(T)),!0}catch{return e.onError?.("Realtime voice events channel closed unexpectedly."),!1}},k=()=>{if(p||g||P.length===0)return;const T=P.shift();if(T){if(g=T,!O({type:"response.create",response:{instructions:T}})){g=null,P.unshift(T);return}p=!0}},w=T=>{P.push(T),k()};y.addEventListener("open",()=>{if(o)return;const T=$r(e.inputDeviceName);if(!O({type:"session.update",session:{type:"realtime",audio:{input:T}}})){e.onError?.("Could not configure Scout's realtime microphone processing.");return}c("Scoutbot bridge ready","Live fleet context is available"),w("Open with one brief audible greeting: 'Hi, I’m Scoutbot. I can check the fleet and coordinate through Scout. What would you like to work on?'")}),y.addEventListener("error",()=>{o||e.onError?.("Realtime voice events channel closed unexpectedly.")}),y.addEventListener("message",T=>{const I=Pr(T.data);if(I?.type==="error"){if(_t(I.message)){g&&(P.unshift(g),g=null),p=!0,c("Scoutbot reply queued","Waiting for the current spoken response to finish","scoutbot");return}e.onError?.(I.message??"OpenAI Realtime reported an error.");return}if(I?.type==="response.created"){p=!0,g=null;return}if(I?.type==="response.done"){p=!1,g=null;for(const q of Mr(I))q.name!=="ask_scoutbot"||m.has(q.callId)||(m.add(q.callId),N=N.then(()=>_r({functionCall:q,route:e.getRoute?.()??e.route,uiContext:e.getUiContext?.(),onReply:e.onScoutbotReply,onTrace:c,send:O,requestResponse:w})).catch(W=>{e.onError?.(W instanceof Error?W.message:"Scoutbot could not complete the voice request.")}));k()}});const C=await be(n.createOffer(),e.signal);if(await be(n.setLocalDescription(C),e.signal),!C.sdp)throw new Error("Could not create a WebRTC offer.");const j=await fetch(Ir,{method:"POST",headers:{"content-type":"application/sdp"},body:C.sdp,signal:e.signal});a=j.headers.get(xr)?.trim()||null;const M=await be(j.text(),e.signal);if(!j.ok)throw new Error(Fr(M,j.status));if(!a)throw new Error("Scout started the audio connection without a concurrency lease. Please try again.");return u=setInterval(()=>{if(!a||o)return;const T=a;qr(T).then(I=>{if(!(o||T!==a)){if(I){l=0;return}e.onError?.("Realtime voice lost its server lease. Reconnect to continue safely."),R()}}).catch(()=>{l+=1,!(l<2||o)&&(e.onError?.("Realtime voice could not renew its server lease. Check the connection and try again."),R())})},Or),await be(n.setRemoteDescription({type:"answer",sdp:M}),e.signal),te(e.signal),{leaseId:a,stop:S}}catch(y){throw await S(),y}}async function _r(e){const t=Dr(e.functionCall.arguments);if(!t){e.onTrace("Scoutbot request could not be read",void 0,"error"),xe(e,{ok:!1,error:"The voice request did not include a usable Scoutbot prompt."});return}e.onTrace("Scoutbot is checking the control plane",t,"scoutbot");try{const n=await fetch(jr,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({body:t,route:e.route,uiContext:e.uiContext})}),r=await n.text();if(!n.ok)throw new Error(Br(r,n.status));const o=JSON.parse(r),s=typeof o.reply?.body=="string"?o.reply.body.trim():"";if(!s)throw new Error("Scoutbot returned an empty reply.");const a=lt(s).filter(f=>f.type==="ask-agent").length,u=e.onReply?await e.onReply(s):{agentRequests:{requested:a,sent:0,failed:a}},l=Qt(s);e.onTrace("Scoutbot reply ready",void 0,"scoutbot"),xe(e,{ok:!0,reply:l,...u.agentRequests.requested>0?{agentRequests:u.agentRequests}:{}})}catch(n){const r=n instanceof Error?n.message:"Scoutbot could not complete the voice request.";e.onTrace("Scoutbot request failed",r,"error"),xe(e,{ok:!1,error:r})}}function xe(e,t){if(!e.send({type:"conversation.item.create",item:{type:"function_call_output",call_id:e.functionCall.callId,output:JSON.stringify(t)}}))return;const r=t.agentRequests;e.requestResponse(t.ok?r&&r.requested>0?r.failed>0?"Answer using the Scoutbot result. Say clearly that Scoutbot tried to send the agent request automatically but delivery failed, and tell the operator to check the activity log. Be concise and do not mention tools, JSON, fences, or implementation details.":"Answer using the Scoutbot result. Say clearly that the agent request was sent automatically. Do not claim the requested work is complete. Be concise and do not mention tools, JSON, fences, or implementation details.":"Answer using the Scoutbot result. Speak the useful answer naturally and concisely. Do not mention tools, JSON, fences, or implementation details.":"Briefly tell the operator that Scoutbot could not complete the live lookup and state the returned error plainly.")}function _t(e){const t=e?.toLowerCase()??"";return t.includes("active response in progress")||t.includes("conversation already has an active response")||t.includes("response is already in progress")}function Pr(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return{...typeof t.type=="string"?{type:t.type}:{},...typeof t.error?.message=="string"?{message:t.error.message}:{},...t.response&&typeof t.response=="object"?{response:t.response}:{}}}catch{return null}}function Mr(e){return Array.isArray(e.response?.output)?e.response.output.flatMap(t=>{if(!t||typeof t!="object")return[];const n=t;return n.type!=="function_call"||typeof n.call_id!="string"||typeof n.name!="string"||typeof n.arguments!="string"?[]:[{callId:n.call_id,name:n.name,arguments:n.arguments}]}):[]}function Dr(e){try{const t=JSON.parse(e);if(typeof t.request!="string")return null;const n=t.request.trim();return n?n.slice(0,8e3):null}catch{return null}}function Br(e,t){try{const n=JSON.parse(e);if(typeof n.error=="string"&&n.error.trim())return n.error}catch{}return`Scoutbot could not complete the live lookup (HTTP ${t}).`}function Fr(e,t){try{const n=JSON.parse(e);if(typeof n.error=="string"&&n.error.trim())return n.error}catch{}return`Could not start realtime voice (HTTP ${t}).`}async function be(e,t){return t?(te(t),new Promise((n,r)=>{const o=()=>r(Be(t));t.addEventListener("abort",o,{once:!0}),e.then(s=>{t.removeEventListener("abort",o),n(s)},s=>{t.removeEventListener("abort",o),r(s)})})):e}async function ot(e,t){return t?(te(t),new Promise((n,r)=>{let o=!1;const s=()=>{o=!0,r(Be(t))};t.addEventListener("abort",s,{once:!0}),e.then(a=>{if(t.removeEventListener("abort",s),o||t.aborted){a.getTracks().forEach(u=>u.stop());return}n(a)},a=>{t.removeEventListener("abort",s),o||r(a)})})):e}const st={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:1},Ur=/\b(?:airpods?|earbuds?|earphones?|headsets?|headphones?|buds?|hands[- ]?free)\b/iu;function $r(e){return Ur.test(e?.trim()??"")?Tr:Rr}async function Vr(e,t){const n=await it(e);let r=await ot(navigator.mediaDevices.getUserMedia({audio:{...st,...n?{deviceId:{exact:n.deviceId}}:{}}}),t);if(!n&&e?.trim()){const o=await it(e),s=r.getAudioTracks?.()[0]?.label?.trim().toLocaleLowerCase()??"";if(o&&o.label.trim().toLocaleLowerCase()!==s)try{const a=await ot(navigator.mediaDevices.getUserMedia({audio:{...st,deviceId:{exact:o.deviceId}}}),t);r.getTracks().forEach(u=>u.stop()),r=a}catch(a){if(t?.aborted)throw r.getTracks().forEach(u=>u.stop()),a}}for(const o of r.getAudioTracks?.()??[])o.contentHint="speech";return r}async function it(e){const t=e?.trim().toLocaleLowerCase();if(!t||typeof navigator.mediaDevices.enumerateDevices!="function")return null;try{const n=(await navigator.mediaDevices.enumerateDevices()).filter(r=>r.kind==="audioinput"&&r.deviceId&&r.label.trim());return n.find(r=>r.label.trim().toLocaleLowerCase()===t)??n.find(r=>{const o=r.label.trim().toLocaleLowerCase();return o.includes(t)||t.includes(o)})??null}catch{return null}}function te(e){if(e?.aborted)throw Be(e)}function Be(e){return e.reason instanceof Error?e.reason:new DOMException("Realtime voice connection was cancelled.","AbortError")}async function qr(e){return(await fetch(`${Tt}/${encodeURIComponent(e)}`,{method:"PUT"})).ok}async function Hr(e){const t=await fetch(`${Tt}/${encodeURIComponent(e)}`,{method:"DELETE",keepalive:!0});if(!t.ok&&t.status!==404)throw new Error(`Could not release realtime voice lease (HTTP ${t.status}).`)}const Wr=[{id:"home",label:"Home",description:"Fleet overview, briefings, and recent activity.",route:{view:"inbox"}},{id:"projects",label:"Projects",description:"Projects, agents, and project-scoped work.",route:{view:"agents-v2"},deepActions:["Open a project by projectSlug.","Open an agent by agentId."]},{id:"sessions",label:"Sessions",description:"Active and recent harness sessions.",route:{view:"sessions"},deepActions:["Open a session by sessionId."]},{id:"messages",label:"Messages",description:"Direct conversations and channels.",route:{view:"messages"},deepActions:["Open a conversation by conversationId.","Filter by all, direct messages, or channels."]},{id:"dispatch",label:"Dispatch",description:"Requests, flights, work, and delivery state.",route:{view:"broker"}},{id:"search",label:"Search",description:"Knowledge and indexed workspace search.",route:{view:"search"}},{id:"operations",label:"Operations",description:"Mission Control, live activity, agent lanes, runtime, and mesh health.",route:{view:"ops",mode:"mission"}},{id:"repositories",label:"Repositories",description:"Repository and worktree status, including diffs.",route:{view:"repos"},deepActions:["Open a repository by absolute root."]},{id:"code-browser",label:"Code Browser",description:"Read files in a project or worktree.",route:{view:"code"},deepActions:["Select a project with the project field; it accepts the displayed project name or slug.","Open a file inside it with path and optional wt.","Alternatively use absolute root and file fields.","Focus a line with line and optional endLine.","Deep links: scout://{project}/{path}, scout:///{absolute/path}, or legacy scout://code/{project}/{path}."]},{id:"terminals",label:"Terminals",description:"Observe or take over terminal sessions.",route:{view:"terminal"}},{id:"settings",label:"Settings",description:"Connections, agents, communications, credentials, voice, and devices.",route:{view:"settings"}}],zr=[{id:"comms",label:"Comms",description:"Native conversations and channels.",route:{view:"messages"},deepActions:["Open a conversation by conversationId.","Open a channel by channelId."]},{id:"projects",label:"Projects",description:"Native project and agent browser.",route:{view:"agents-v2"},deepActions:["Filter to a project by projectSlug.","Select an agent by agentId."]},{id:"terminals",label:"Terminals",description:"Native terminal workspace.",route:{view:"terminal"},deepActions:["Select an agent terminal by agentId."]},{id:"tail",label:"Tail",description:"Live agent and harness activity.",route:{view:"ops",mode:"tail"}},{id:"dispatch",label:"Dispatch",description:"Dispatch and coordination overview.",route:{view:"broker"}},{id:"agent-lanes",label:"Agent Lanes",description:"Native lane overview for active agents.",route:{view:"ops",mode:"lanes"}},{id:"repositories",label:"Repositories",description:"Native repository and worktree status.",route:{view:"repos"}},{id:"code-browser",label:"Code Browser",description:"Embedded read-only project browser.",route:{view:"code"},deepActions:["Select a project with the project field; it accepts the displayed project name or slug.","Open a file inside it with path and optional wt.","Alternatively use absolute root and file fields.","Focus a line with line and optional endLine.","Deep links: scout://{project}/{path}, scout:///{absolute/path}, or legacy scout://code/{project}/{path}."]},{id:"settings",label:"Settings",description:"Native app settings; Voice is directly addressable.",route:{view:"settings"},deepActions:["Open Voice settings with section=voice."]}];function Jr(e){const t=e==="macos";return{host:e,shellLabel:t?"Scout for macOS":"OpenScout web",destinations:t?zr:Wr,rules:["When asked what navigation is available, list only these human labels and short descriptions.","Never expose internal Route.view names, aliases, URL fragments, or implementation vocabulary in the human reply.","Emit only a destination route or deep action explicitly described by this host context.","If the requested destination or deep action is absent, say it is not available in this app instead of approximating it with another page."]}}const Kr="scout:scoutbot-realtime-reply",ye="scout:scoutbot-session-changed",Gr={enabled:!1,open:!1,state:"idle",leaseId:null,error:null,trace:[],chatState:null,sessionAction:null,setOpen:()=>{},startCall:async()=>{},endCall:async()=>!0,startNewChat:async()=>{},switchChat:async()=>{},updatePreferredModel:async e=>e,clearTrace:()=>{},openVoiceSettings:()=>{}},Pt=i.createContext(Gr);function Qr({children:e}){const{route:t,applyScoutbotUiAction:n}=Mt(),r=ct(Nt,!0),[o,s]=i.useState(!1),a=r&&o,[u,l]=i.useState(!1),[f,c]=i.useState("idle"),[v,S]=i.useState(null),[R,b]=i.useState(null),[y,m]=i.useState([]),[N,p]=i.useState(null),[g,P]=i.useState(null),O=i.useRef(null),k=i.useRef(null),w=i.useRef(null),C=i.useRef(0),j=i.useRef(!1),M=i.useRef(!1),T=i.useRef({route:t,applyScoutbotUiAction:n});T.current={route:t,applyScoutbotUiAction:n};const I=i.useCallback((A,E,L="voice")=>{m(_=>[..._,{id:`voice-ui-${Date.now()}-${_.length}`,at:Date.now(),kind:L,label:A,...E?{detail:E}:{}}].slice(-100))},[]),q=i.useCallback(()=>m([]),[]),W=i.useCallback(async()=>{const A=await V("/api/scoutbot/session");return j.current||p(A),A},[]);i.useEffect(()=>{if(!r){s(!1);return}const A=new AbortController;let E=!1;const L=Nr(_=>{s(_.enabled)});return Lt(A.signal).then(_=>{E||s(_.enabled)}).catch(_=>{E||at(_)||(s(!1),b(_ instanceof Error?_.message:"Could not load live voice settings."))}),()=>{E=!0,A.abort(),L()}},[r]),i.useEffect(()=>{if(!a)return;const A=()=>{W().catch(E=>{j.current||b(E instanceof Error?E.message:"Could not load Scoutbot chats.")})};return A(),window.addEventListener(ye,A),()=>window.removeEventListener(ye,A)},[a,W]);const H=i.useCallback(async()=>{C.current+=1;const A=w.current;k.current?.abort(),k.current=null;const E=O.current;O.current=null;try{await E?.stop(),await A}catch(L){return j.current||(c("error"),b(L instanceof Error?L.message:"Could not end realtime voice cleanly.")),!1}return j.current||(S(null),c("ended"),I("Live voice ended","Microphone and host lease released","voice")),!0},[I]);i.useEffect(()=>{a||(l(!1),(O.current||f==="connecting"||f==="live")&&H())},[a,H,f]),i.useEffect(()=>(j.current=!1,()=>{j.current=!0,C.current+=1,k.current?.abort(),k.current=null,O.current?.stop().catch(()=>{}),O.current=null}),[]);const re=i.useCallback(async A=>{window.dispatchEvent(new CustomEvent(Kr,{detail:{body:A}}));const E=A.replace(/```[\s\S]*?```/gu,"").trim();E&&I("Scoutbot replied",E.slice(0,2e3),"scoutbot");let L=0,_=0,K=0;for(const F of lt(A))if(F.type==="ask-agent")L+=1,await Zr(F,I,b)?_+=1:K+=1;else if(F.type!=="reminder"){const D=Xr(F),U=F.type==="navigate"||F.type==="view-file"?"navigation":"scoutbot";I(Yr(F),D,U),T.current.applyScoutbotUiAction(F),I(Ge()?"Action sent to Scout for macOS":"Action applied in OpenScout",D,U)}return await W().catch(()=>null),{agentRequests:{requested:L,sent:_,failed:K}}},[I,W]),oe=i.useCallback(()=>{const A={type:"navigate",route:{view:"settings",section:"voice"}};I("Voice settings requested",void 0,"navigation"),T.current.applyScoutbotUiAction(A)},[I]),se=i.useCallback(async()=>{if(!a){b("Turn on live voice in Settings → Voice before starting a call."),l(!1);return}if(M.current||f==="connecting"||f==="live")return;M.current=!0,k.current?.abort();const A=O.current;O.current=null;try{await A?.stop(),S(null)}catch(D){c("error"),b(D instanceof Error?D.message:"Could not end the previous realtime voice call."),M.current=!1;return}const E=new AbortController;k.current=E;const L=C.current+1;C.current=L;let _=()=>{};const K=new Promise(D=>{_=D});w.current=K;let F=!1;b(null),m([{id:"connecting",at:Date.now(),label:"Connecting secure audio"}]),c("connecting");try{const D=await bn().then(({settings:$})=>$.inputDeviceName).catch(()=>null),U=await Lr({signal:E.signal,inputDeviceName:D,getRoute:()=>T.current.route,getUiContext:()=>Jr(Ge()?"macos":"web"),onState:$=>{!j.current&&C.current===L&&c($)},onError:$=>{if(!(j.current||C.current!==L)){if(_t($)){I("Scoutbot reply queued","Waiting for the current spoken response to finish","scoutbot");return}b($),I("Voice issue",$,"error")}},onTrace:$=>{!j.current&&C.current===L&&m(fe=>[...fe,$].slice(-100))},onScoutbotReply:$=>!j.current&&C.current===L?re($):{agentRequests:{requested:0,sent:0,failed:0}}});if(j.current||E.signal.aborted||C.current!==L){await U.stop();return}O.current=U,S(U.leaseId),F=!0}catch(D){if(!j.current&&C.current===L&&!at(D)){c("error");const U=D instanceof Error?D.message:"Could not start realtime voice.";b(U),I("Live voice could not start",U,"error")}}finally{!F&&k.current===E&&(k.current=null),_(),w.current===K&&(w.current=null),M.current=!1}},[I,re,a,f]),ie=i.useCallback(async()=>{if(!g){P("new"),b(null);try{if((O.current||f==="connecting"||f==="live")&&!await H())return;if(N?.session.messages.length===0){m([{id:`voice-chat-${Date.now()}`,at:Date.now(),kind:"scoutbot",label:"New live chat ready"}]);return}const A=await V("/api/scoutbot/session/reset",{method:"POST"});p(A),m([{id:`voice-chat-${Date.now()}`,at:Date.now(),kind:"scoutbot",label:"New live chat ready"}]),window.dispatchEvent(new CustomEvent(ye,{detail:{id:A.session.id}}))}catch(A){const E=A instanceof Error?A.message:"Could not start a new Scoutbot chat.";b(E),I("Could not start a new live chat",E,"error")}finally{P(null)}}},[I,N?.session.messages.length,H,g,f]),ae=i.useCallback(async A=>{if(!(!A||g||A===N?.session.id)){P(A),b(null);try{if((O.current||f==="connecting"||f==="live")&&!await H())return;const E=await V("/api/scoutbot/session/switch",{method:"POST",body:JSON.stringify({id:A})});p(E),m([{id:`voice-chat-${Date.now()}`,at:Date.now(),kind:"scoutbot",label:"Live chat restored",detail:E.session.title}]),window.dispatchEvent(new CustomEvent(ye,{detail:{id:E.session.id}}))}catch(E){const L=E instanceof Error?E.message:"Could not switch Scoutbot chats.";b(L),I("Could not restore the live chat",L,"error")}finally{P(null)}}},[I,N?.session.id,H,g,f]),ce=i.useCallback(async A=>{const E=A.trim();if(!E)throw new Error("Preferred model is required.");const L=await V("/api/scoutbot/config",{method:"POST",body:JSON.stringify({model:E})});return p(_=>_&&{..._,config:{..._.config,...L.config}}),I("Scoutbot preferred model updated",L.config.model,"scoutbot"),L.config.model},[I]),le=i.useMemo(()=>({enabled:a,open:u,state:f,leaseId:v,error:R,trace:y,chatState:N,sessionAction:g,setOpen:l,startCall:se,endCall:H,startNewChat:ie,switchChat:ae,updatePreferredModel:ce,clearTrace:q,openVoiceSettings:oe}),[a,u,f,v,R,y,N,g,se,H,ie,ae,ce,q,oe]);return d.jsx(Pt.Provider,{value:le,children:e})}function at(e){return(e instanceof DOMException||e instanceof Error)&&e.name==="AbortError"}function as(){return i.useContext(Pt)}function Yr(e){return e.type==="navigate"?"Navigation requested":e.type==="open-scoutbot"?"Scoutbot opened its panel":e.type==="refresh"?"Scoutbot refreshed live state":"Scoutbot opened the requested file"}function Xr(e){return e.type==="navigate"?JSON.stringify(e.route):e.type==="view-file"?e.path:e.reason?.trim()||e.type}async function Zr(e,t,n){t("Scoutbot is coordinating",`Asking ${e.targetLabel}`,"agent");try{const r=await V("/api/scoutbot/actions/ask",{method:"POST",body:JSON.stringify({targetLabel:e.targetLabel,targetAgentId:e.targetAgentId,body:e.body,channel:e.channel})});return t("Scoutbot sent the request",r.flightId?`${r.targetAgentId??r.targetLabel} · run ${r.flightId}`:r.targetAgentId??r.targetLabel,"agent"),!0}catch(r){const o=r instanceof Error?r.message:"Could not send to agent.";return t("Scoutbot could not send the request",o,"error"),n(o),!1}}function eo(e){return!!(e&&(e.message.trim().length>0||e.files.length>0||e.forwardContext))}function to(e){return[e.name,e.type,e.size,e.lastModified].join(":")}function no(e,t){const n=new Set;return[...e,...t].filter(r=>{const o=to(r);return n.has(o)?!1:(n.add(o),!0)})}function ro(e,t){const n=t.intent??e?.intent??"new-task",r=n==="route-capture",o=n==="forward-message";return{intent:n,...r&&(t.agentId??e?.agentId)?{agentId:t.agentId??e?.agentId}:{},...r&&(t.conversationId??e?.conversationId)?{conversationId:t.conversationId??e?.conversationId}:{},message:t.message??e?.message??"",files:no(e?.files??[],t.files??[]),attachmentFeedback:t.attachmentFeedback??e?.attachmentFeedback??null,mode:r?t.preferExistingChat===void 0?e?.mode??"new-session":t.preferExistingChat?"existing-chat":"new-session":"new-session",projectPath:t.projectPath??e?.projectPath??"",projectQuery:e?.projectQuery??"",...o&&(t.forwardContext??e?.forwardContext)?{forwardContext:t.forwardContext??e?.forwardContext}:{},forwardContextMode:o?t.forwardContextMode??e?.forwardContextMode??"selected-message":"selected-message"}}function oo({request:e,onClose:t,onOpenCapture:n}){const{agents:r,route:o,navigate:s}=Mt(),a=Wt(o),u=wt(r,a),l=on(o,u),[f,c]=i.useState(0),[v,S]=i.useState(null),[R,b]=i.useState(null),y=i.useRef(0),m=e?ro(R,e):null,N=i.useCallback((g,P)=>{if(g.length===0)return;const O=!!(l.agentId||l.conversationId);n({intent:O?"route-capture":"new-task",files:g,attachmentFeedback:P,agentId:l.agentId??void 0,conversationId:l.conversationId??void 0,preferExistingChat:l.canUseExistingChat})},[n,l]);i.useEffect(()=>{if(!v)return;const g=window.setTimeout(()=>S(null),5e3);return()=>window.clearTimeout(g)},[v]),i.useEffect(()=>{const g=C=>{we(C.dataTransfer)&&(C.preventDefault(),y.current+=1,c(y.current))},P=C=>{we(C.dataTransfer)&&(C.preventDefault(),C.dataTransfer&&(C.dataTransfer.dropEffect="copy"))},O=()=>{y.current!==0&&(y.current=Math.max(0,y.current-1),c(y.current))},k=C=>{if(!we(C.dataTransfer))return;C.preventDefault();const j=Qe(C.dataTransfer),M=j.filter(Ye),T=j.length-M.length;if(y.current=0,c(0),M.length===0){S(j.length===0?"Scout could not read that file. Try the attachment picker instead.":"That file type is not supported. Drop markdown, code, an image, or a video clip.");return}const I=M.length===1?`Dropped ${M[0]?.name||"1 attachment"}.`:`Dropped ${M.length} attachments.`,q=T>0?`${I} Skipped ${T} unsupported ${T===1?"file":"files"}.`:I;S(null),N(M,q)},w=C=>{if(yn(C.target)||!we(C.clipboardData))return;C.preventDefault();const j=Qe(C.clipboardData),M=j.filter(Ye);if(M.length===0){S(j.length===0?"Scout could not read that pasted file. Try the attachment picker instead.":"That pasted file type is not supported. Paste an image or video, or attach markdown or code.");return}N(M,M.length===1?`Pasted ${M[0]?.name||"1 attachment"}.`:`Pasted ${M.length} attachments.`)};return window.addEventListener("dragenter",g),window.addEventListener("dragover",P),window.addEventListener("dragleave",O),window.addEventListener("drop",k),window.addEventListener("paste",w),()=>{window.removeEventListener("dragenter",g),window.removeEventListener("dragover",P),window.removeEventListener("dragleave",O),window.removeEventListener("drop",k),window.removeEventListener("paste",w)}},[N]);const p=f>0&&!e;return d.jsxs(d.Fragment,{children:[p?d.jsx("div",{className:"s-capture-drop",role:"presentation",children:d.jsxs("div",{className:"s-capture-drop-card",children:[d.jsx("div",{className:"s-capture-drop-title",children:"Route capture"}),d.jsx("div",{className:"s-capture-drop-copy",children:"Drop markdown, code, an image, or a video clip to send it to the right agent or chat."})]})}):null,v?d.jsx("div",{className:"s-capture-feedback",role:"alert",children:v}):null,e?d.jsx(sn,{agents:u,route:o,navigate:s,onClose:t,initialAgentId:m?.agentId,initialConversationId:m?.conversationId,initialMessage:m?.message,initialFiles:m?.files,initialAttachmentFeedback:m?.attachmentFeedback??void 0,initialIntent:m?.intent,initialProjectPath:m?.projectPath,initialProjectQuery:m?.projectQuery,initialForwardContext:m?.forwardContext,initialForwardContextMode:m?.forwardContextMode,defaultMode:m?.mode,draftRestored:eo(R),onDraftChange:b,onDraftConsumed:()=>b(null)}):null]})}const Fe=i.createContext(null),so=["hello","node.upserted","actor.registered","agent.registered","agent.endpoint.upserted","invocation.requested","flight.updated","delivery.state.changed","scout.dispatched"],io=new Set(so),ao=3e4,co=250;function lo(e,t){try{return JSON.stringify(e)===JSON.stringify(t)?e:t}catch{return t}}const uo={"--hud-bg":"oklch(0.118 0.004 260)","--hud-surface":"oklch(0.205 0.005 260)","--hud-ink":"oklch(0.975 0.006 260)","--hud-muted":"oklch(0.80 0.008 260)","--hud-dim":"oklch(0.70 0.007 260)","--hud-border":"oklch(0.975 0.006 260 / 0.08)","--hud-accent":"oklch(0.86 0.17 125)","--hud-accent-soft":"oklch(0.86 0.17 125 / 0.08)","--hud-shadow-soft":"oklch(0.08 0.004 260 / 0.42)","--hud-chrome-border":"oklch(0.975 0.006 260 / 0.04)","--hud-shadow-panel":"0 12px 34px oklch(0.08 0.004 260 / 0.45)","--hud-shadow-panel-hover":"0 14px 38px oklch(0.08 0.004 260 / 0.52)","--hud-shadow-bar":"0 -10px 28px oklch(0.08 0.004 260 / 0.38)","--hud-shadow-nav":"0 8px 24px oklch(0.08 0.004 260 / 0.32)","--hud-shadow-minimap":"0 10px 24px oklch(0.08 0.004 260 / 0.38)","--hud-status-ok":"oklch(0.80 0.15 155)","--hud-status-warn":"oklch(0.82 0.15 85)","--hud-status-error":"oklch(0.72 0.18 25)","--background":"0.132 0.004 260","--foreground":"0.965 0.006 260","--card":"0.178 0.005 260","--card-foreground":"0.965 0.006 260","--popover":"0.178 0.005 260","--popover-foreground":"0.965 0.006 260","--muted-foreground":"0.72 0.008 260","--scrim":"rgba(0, 0, 0, 0.5)","--scrim-soft":"rgba(0, 0, 0, 0.3)","--info":"#62b6ff","--shadow-card":"0 8px 22px rgba(0, 0, 0, 0.22)","--shadow-card-hover":"0 14px 36px rgba(0, 0, 0, 0.30)","--cat-gold":"#d7a978","--cat-purple":"#c58cff","--cat-sky":"#38bdf8","--scout-chrome-ink-strong":"color-mix(in srgb, var(--hud-ink) 94%, transparent)","--scout-chrome-ink":"color-mix(in srgb, var(--hud-ink) 84%, transparent)","--scout-chrome-ink-soft":"color-mix(in srgb, var(--hud-ink) 68%, transparent)","--scout-chrome-ink-faint":"color-mix(in srgb, var(--hud-ink) 64%, transparent)","--scout-chrome-ink-ghost":"color-mix(in srgb, var(--hud-ink) 56%, transparent)","--scout-chrome-hover":"color-mix(in srgb, var(--hud-ink) 5%, transparent)","--scout-chrome-active":"color-mix(in srgb, var(--hud-ink) 9%, transparent)","--scout-chrome-border-soft":"color-mix(in srgb, var(--hud-ink) 8%, transparent)","--scout-chrome-avatar-ink":"#111111","--hud-font-sans":"'Inter', ui-sans-serif, system-ui, sans-serif","--hud-font-mono":"'JetBrains Mono', ui-monospace, Menlo, monospace","--hud-font-serif":"'Spectral', 'Cormorant Garamond', Georgia, serif","--hud-font-accent-title":"'Inter Tight', var(--hud-font-sans)"},fo={"--hud-bg":"oklch(0.982 0.008 78)","--hud-surface":"oklch(0.994 0.006 78)","--hud-ink":"oklch(0.26 0.018 72)","--hud-muted":"oklch(0.50 0.028 70)","--hud-dim":"oklch(0.64 0.022 72)","--hud-border":"oklch(0.86 0.016 75 / 0.92)","--hud-accent":"oklch(0.72 0.16 125)","--hud-accent-soft":"oklch(0.72 0.16 125 / 0.11)","--hud-shadow-soft":"oklch(0.42 0.02 70 / 0.11)","--hud-status-ok":"oklch(0.64 0.16 155)","--hud-status-warn":"oklch(0.72 0.15 85)","--hud-status-error":"oklch(0.62 0.19 25)","--background":"0.978 0.004 85","--foreground":"0.24 0.01 80","--card":"0.992 0.003 85","--card-foreground":"0.24 0.01 80","--popover":"0.992 0.003 85","--popover-foreground":"0.24 0.01 80","--muted-foreground":"0.56 0.014 80","--scrim":"rgba(28, 24, 20, 0.30)","--scrim-soft":"rgba(28, 24, 20, 0.16)","--info":"#2f7fd6","--shadow-card":"0 8px 22px oklch(0.42 0.02 70 / 0.09)","--shadow-card-hover":"0 14px 36px oklch(0.42 0.02 70 / 0.13)","--cat-gold":"#a9824f","--cat-purple":"#8b5cf6","--cat-sky":"#0ea5e9","--scout-chrome-ink-strong":"color-mix(in srgb, var(--hud-ink) 94%, transparent)","--scout-chrome-ink":"color-mix(in srgb, var(--hud-ink) 78%, transparent)","--scout-chrome-ink-soft":"color-mix(in srgb, var(--hud-ink) 60%, transparent)","--scout-chrome-ink-faint":"color-mix(in srgb, var(--hud-ink) 56%, transparent)","--scout-chrome-ink-ghost":"color-mix(in srgb, var(--hud-ink) 50%, transparent)","--scout-chrome-hover":"color-mix(in srgb, var(--hud-ink) 4%, transparent)","--scout-chrome-active":"color-mix(in srgb, var(--hud-ink) 8%, transparent)","--scout-chrome-border-soft":"color-mix(in srgb, var(--hud-border) 80%, transparent)","--scout-chrome-avatar-ink":"#ffffff","--hud-font-sans":"'Inter', ui-sans-serif, system-ui, sans-serif","--hud-font-mono":"'JetBrains Mono', ui-monospace, Menlo, monospace","--hud-font-serif":"'Spectral', 'Cormorant Garamond', Georgia, serif","--hud-font-accent-title":"'Inter Tight', var(--hud-font-sans)"},po=new Set(["--hud-bg","--hud-surface","--hud-ink","--hud-muted","--hud-dim","--hud-border","--hud-accent","--hud-accent-soft","--hud-shadow-soft","--hud-chrome-border","--hud-shadow-panel","--hud-shadow-panel-hover","--hud-shadow-bar","--hud-shadow-nav","--hud-shadow-minimap","--hud-status-ok","--hud-status-warn","--hud-status-error"]);function ho(e){return Object.fromEntries(Object.entries(e==="light"?fo:uo).filter(([n])=>!po.has(n)))}function cs(){return i.useContext(Fe)}function Mt(){const e=i.useContext(Fe);if(!e)throw new Error("useScout must be used inside ScoutProvider");return e}function ls({children:e,initialTheme:t="dark"}){const{route:n,navigate:r,navigateBack:o,canNavigateBack:s}=zt(),a=Sn(),u=ct(Nt,!0),[l,f]=i.useState([]),[c,v]=i.useState(!1),[S,R]=i.useState({status:"checking",message:null,lastCheckedAt:null}),[b,y]=i.useState(Je),[m,N]=i.useState(null),p=i.useRef(!1),[g,P]=i.useState(Rn),[O,k]=i.useState(!1),[w,C]=i.useState(null),[j,M]=i.useState(null),[T,I]=i.useState(""),[q,W]=i.useState(null),H=n.view==="settings",re=i.useMemo(()=>n.view!=="broker"||!n.attemptId?null:w?.id===n.attemptId?w:null,[w,n]),oe=i.useMemo(()=>n.view!=="search"||!n.hitId?null:j?.id===n.hitId?j:null,[j,n]),se=i.useMemo(()=>n.view==="agents-v2"&&n.agentId&&n.sessionId?{agentId:n.agentId,sessionId:n.sessionId}:n.view==="sessions"&&n.sessionId?{agentId:n.agentId??"",sessionId:n.sessionId}:null,[n]),ie=i.useCallback((h,x)=>{if(n.view==="agents-v2"&&n.agentId===h){r({...n,sessionId:x},{replace:!0});return}if(n.view==="sessions"){r({view:"sessions",sessionId:x,agentId:h},{replace:!0});return}r({view:"agents-v2",agentId:h,sessionId:x},{replace:!0})},[r,n]),ae=i.useCallback(()=>{r({view:"settings",section:"appearance"})},[r]),ce=i.useCallback(()=>{n.view==="settings"&&r({view:"inbox"})},[r,n.view]),le=i.useCallback(h=>{W(h??{intent:"new-task"})},[]),A=i.useCallback(()=>W(null),[]),E=i.useCallback(h=>{C(h),!(n.view==="broker"&&n.attemptId===h.id)&&r({view:"broker",attemptId:h.id,...n.view==="broker"&&n.filter?{filter:n.filter}:{}},{replace:n.view==="broker"})},[r,n]),L=i.useCallback(()=>{C(null),n.view==="broker"&&n.attemptId&&r({view:"broker",...n.filter?{filter:n.filter}:{}},{replace:!0})},[r,n]),_=i.useCallback((h,x,B)=>{if(M(h),typeof x=="string"&&I(x.trim()),n.view==="search"&&n.hitId===h.id)return;const z=B??(n.view==="search"?n.filters:void 0);r({view:"search",...n.view==="search"&&n.mode?{mode:n.mode}:{},...z?{filters:z}:{},hitId:h.id},{replace:n.view==="search"})},[r,n]),K=i.useCallback(()=>{M(null),I(""),n.view==="search"&&n.hitId&&r({view:"search",...n.mode?{mode:n.mode}:{},...n.filters?{filters:n.filters}:{}},{replace:!0})},[r,n]),F=i.useMemo(()=>Ut(),[]),D=a?.resolvedTheme??t,U=a?.template??"hudson",$=i.useMemo(()=>({...ho(D),...F??{}}),[F,D]),fe=i.useCallback(h=>{y(x=>({...x,...h}))},[]);i.useEffect(()=>{!c||l.length===0||y(h=>{const x=$t(h.agentCharacters,l);return x===h.agentCharacters?h:{...h,agentCharacters:x}})},[l,c]),i.useEffect(()=>{Vt(D,U,b),qt(b)},[U,b,D]),i.useEffect(()=>{const h=x=>{x.key!==null&&x.key!==Ht||y(Je())};return window.addEventListener("storage",h),()=>window.removeEventListener("storage",h)},[]);const Ue=i.useMemo(()=>Yt(l),[l]),$e=Ue?.id??Xt(l),Ve=Ue?.conversationId??null,pe=i.useRef(null),Z=i.useRef(null),he=n.view==="ops"?"/api/agents":"/api/agents?detail=summary",me=i.useCallback(()=>{R({status:"online",message:null,lastCheckedAt:Date.now()})},[]),ge=i.useCallback(h=>{const x=An(h);R({status:Cn(x)?"offline":"degraded",message:x,lastCheckedAt:Date.now()})},[]),J=i.useCallback(async()=>{const h=pe.current;if(h&&(await h.promise,h.url===he))return;const x=(async()=>{try{const B=await V(he);f(z=>lo(z,B)),me()}catch(B){ge(B)}finally{v(!0)}})();pe.current={url:he,promise:x};try{await x}finally{pe.current?.promise===x&&(pe.current=null)}},[he,ge,me]),G=i.useCallback(async()=>{try{const h=await V("/api/onboarding/state");p.current=!1,N(h);const x=h.operatorName?.trim()||h.operatorNameSuggestion?.trim()||null;P(x),Tn(x),me()}catch(h){ge(h),p.current=!0,N({hasLocalConfig:!0,hasProjectConfig:!0,hasOperatorName:!0,localConfigPath:null,projectRoot:null,currentDirectory:null,operatorName:null,operatorNameSuggestion:null,needed:!1})}},[ge,me]),qe=i.useCallback(()=>{k(!0),V("/api/onboarding/skip",{method:"POST",body:"{}"}).then(()=>G()).catch(()=>null)},[G]);i.useEffect(()=>{J(),G()},[J,G]),i.useEffect(()=>{const h=()=>{Ke()&&(J(),p.current&&G())},x=window.setInterval(h,ao),B=Kt(h);return()=>{window.clearInterval(x),B()}},[J,G]);const He=i.useMemo(()=>l.filter(h=>Gt(h.state)).length,[l]),[Dt,We]=i.useState(null),ue=i.useCallback(h=>{h?.trim()&&We(h.trim())},[]),de=i.useCallback(()=>We(null),[]),ee=i.useCallback(h=>{if(!(h.type!=="select-project"&&Zt(h)))switch(h.type){case"navigate":r(h.route);break;case"focus-composer":window.dispatchEvent(new CustomEvent("scout:composer-focus"));break;case"open-scoutbot":window.dispatchEvent(new CustomEvent("scout:scoutbot-panel-open",{detail:h}));break;case"refresh":J();break;case"view-file":ue(h.path);break;case"select-project":or(h,r);break}},[r,ue,J]),Bt=i.useCallback((h,x)=>{const B=h.trim(),z=x.trim();if(!B||!z)return;const ze=n.view==="conversation"||n.view==="messages"?n.conversationId:window.location.pathname==="/embed/thread"&&new URLSearchParams(window.location.search).get("conversationId")?.trim()||void 0;de(),ee({type:"navigate",route:{view:"code",root:z,file:B,...ze?{returnConversationId:ze}:{}}})},[ee,de,n]),ve=i.useRef({applyScoutbotUiAction:ee});ve.current={applyScoutbotUiAction:ee},Jt(h=>{Ke()&&io.has(h.kind)&&(Z.current!==null&&window.clearTimeout(Z.current),Z.current=window.setTimeout(()=>{Z.current=null,J()},co))}),i.useEffect(()=>()=>{Z.current!==null&&window.clearTimeout(Z.current)},[]),i.useEffect(()=>{const h=x=>{const B=x.detail,z=B&&typeof B=="object"&&"type"in B?B:null;z&&ve.current.applyScoutbotUiAction(z)};return window.addEventListener("scout:scoutbot-ui-action",h),window.scoutScoutbot={applyUiAction:x=>ve.current.applyScoutbotUiAction(x),navigate:x=>ve.current.applyScoutbotUiAction({type:"navigate",route:x})},()=>{window.removeEventListener("scout:scoutbot-ui-action",h),window.scoutScoutbot?.applyUiAction&&delete window.scoutScoutbot}},[]);const Ft=i.useMemo(()=>({route:n,navigate:r,navigateBack:o,canNavigateBack:s,agents:l,agentsLoaded:c,onlineCount:He,apiConnection:S,reload:J,appearanceDetails:b,updateAppearanceDetails:fe,onboarding:m,operatorName:g,refreshOnboarding:G,onboardingSkipped:O,skipOnboarding:qe,settingsOpen:H,openSettings:ae,closeSettings:ce,scoutbotAgentId:$e,scoutbotConversationId:Ve,applyScoutbotUiAction:ee,selectedBrokerAttempt:re,inspectBrokerAttempt:E,clearBrokerAttempt:L,selectedKnowledgeHit:oe,selectedKnowledgeQuery:T,inspectKnowledgeHit:_,clearKnowledgeHit:K,focusedSession:se,focusSession:ie,openFilePreview:ue,closeFilePreview:de,openContextCapture:le,closeContextCapture:A}),[n,r,o,s,l,c,He,S,J,b,fe,m,g,G,O,qe,H,ae,ce,$e,Ve,ee,re,E,L,oe,T,_,K,se,ie,ue,de,le,A]);return d.jsx(Fe.Provider,{value:Ft,children:d.jsx("div",{"data-scout-theme-mode":D,"data-scout-palette":b.palette,"data-scout-contrast":b.contrast,"data-scout-accent":b.accent,"data-scout-shell":b.shell,"data-scout-avatar-style":b.avatarStyle,"data-hudson-theme":D,"data-hudson-template":U,style:{...$},children:d.jsx("div",{"data-scout-theme":D,style:{display:"contents"},children:d.jsx(kn,{children:d.jsxs(Ar,{children:[u?d.jsx(Qr,{children:e}):e,d.jsx(wr,{path:Dt,onOpenPath:ue,onOpenInCode:Bt,onClose:de}),d.jsx(oo,{request:q,onClose:A,onOpenCapture:le})]})})})})})}export{zo as A,Yo as B,kn as C,uo as D,Ko as E,Xo as F,Jo as G,Fo as H,ir as I,yt as J,Mn as K,fo as L,rs as M,Nt as N,as as O,ye as P,Kr as Q,Jr as R,Fe as S,os as T,ns as U,Lt as V,ss as W,is as X,Uo as a,Po as b,Go as c,rr as d,nr as e,An as f,_n as g,cs as h,wt as i,Do as j,ts as k,Bo as l,Mo as m,ls as n,Cn as o,es as p,zn as q,nt as r,Zo as s,Qo as t,Mt as u,Vo as v,$o as w,qo as x,Ho as y,Wo as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-C1VaWNuD.js";import{s as $,b as E}from"./colors-BtO5_zlx.js";import{A as M}from"./AgentAvatar-Dz79iTxB.js";function q({name:a,meta:i,sub:s,tone:o="neutral",agent:t,avatarName:c,avatarKind:e="user",leadingIcon:n,caret:l,active:j,selected:v,unread:N,depth:f=0,detail:d,expanded:h,activityLabel:w,worktreeLabel:u,activityTone:g="working",actions:p,pinned:x,onClick:k,onKeyDown:b,onContextMenu:y,onPointerEnter:C,onPointerLeave:P,title:R,tabIndex:z}){const A=l?l==="open":d!==void 0?!!h:void 0,B=["rr-row",f===1&&"rr-row--child",j&&"rr-row--active",v&&"rr-row--selected",N&&"rr-row--unread",h&&"rr-row--expanded",w&&"rr-row--motion",x&&"rr-row--pinned",p&&"rr-row--has-actions"].filter(Boolean).join(" ");return r.jsxs("div",{className:B,children:[r.jsxs("button",{type:"button",className:"rr-row-head",onClick:k,onKeyDown:b,onContextMenu:y,onPointerEnter:C,onPointerLeave:P,title:R,tabIndex:z,"aria-expanded":A,children:[r.jsx(T,{icon:n,tone:o,caret:l,agent:t,avatarName:c,avatarKind:e}),r.jsxs("span",{className:"rr-row-body",children:[r.jsxs("span",{className:"rr-row-name",children:[x?r.jsx("span",{className:"rr-row-pin-mark","aria-label":"Pinned",title:"Pinned",children:r.jsx(S,{})}):null,a]}),s&&r.jsx("span",{className:"rr-row-sub",children:s}),u&&r.jsx("span",{className:"rr-row-worktree",children:u}),w&&r.jsxs("span",{className:`rr-row-activity rr-row-activity--${g}`,children:[r.jsxs("span",{className:"rr-row-activity-bars","aria-hidden":!0,children:[r.jsx("span",{}),r.jsx("span",{}),r.jsx("span",{}),r.jsx("span",{})]}),r.jsx("span",{className:"rr-row-activity-label",children:w})]})]}),i&&r.jsx("span",{className:"rr-row-meta",children:i})]}),p?r.jsx("div",{className:"rr-row-actions",onClick:L=>L.stopPropagation(),children:p}):null,h&&d&&r.jsx("div",{className:"rr-row-detail",children:d})]})}function T({icon:a,tone:i,caret:s,agent:o,avatarName:t,avatarKind:c}){if(s)return r.jsx("span",{className:`rr-row-caret rr-row-caret--leading rr-row-caret--${s}`,"aria-hidden":!0,children:r.jsx(G,{open:s==="open"})});if(t||o){if(c==="channel")return r.jsx("span",{className:"rr-row-hash","aria-hidden":!0,children:"#"});const n=m(i),l=n==="active"||n==="available"||n==="working"||n==="in_turn";return r.jsx("span",{className:"rr-row-avatar-wrap","aria-hidden":!0,children:r.jsx(M,{agent:o,name:t??o?.name,placement:"row",size:20,tile:!0,presence:l})})}if(a)return r.jsx("span",{className:"rr-row-icon","aria-hidden":!0,children:a});const e=m(i);return r.jsx("span",{className:`rr-row-dot rr-row-dot--${e}`,style:e==="active"||e==="available"?{background:$(e)}:void 0,"aria-hidden":!0})}function G({open:a}){return r.jsx("svg",{className:`rr-chevron${a?" rr-chevron--open":""}`,viewBox:"0 0 12 12",width:"12",height:"12",fill:"none","aria-hidden":!0,children:r.jsx("path",{d:"M4.25 3L7.75 6L4.25 9",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function m(a){return a==="channel"||a==="dm"||a==="neutral"?a:E(a)}function S(){return r.jsx("svg",{width:"9",height:"9",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":!0,children:r.jsx("path",{d:"M9.8 1.6 14.4 6.2a1 1 0 0 1-.2 1.6l-2.7 1.1-.9 3.4a.7.7 0 0 1-1.2.3L6.3 9.5 2.8 13 1.7 11.9l3.5-3.5L2.1 5.3a.7.7 0 0 1 .3-1.2l3.4-.9 1.1-2.7a1 1 0 0 1 1.6-.2Z"})})}export{q as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,j as n}from"./index-C1VaWNuD.js";/* empty css */import{D as O}from"./DataTable-C6aMSilS.js";import{p as W,a as L}from"./api-Co9aQ2Jw.js";import{t as U,n as R,f as Y}from"./time-Dhsh_2EG.js";import{u as G}from"./tail-events-LK29oCKm.js";import{o as Q}from"./openContent-C6XO6kr5.js";import{u as X}from"./Provider-D0bB7q6y.js";/* empty css */import"./perf-PX8Rx0EP.js";import"./index-BWHgHrtv.js";import"./router-kfcaYqZr.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./sse-B29iGBnw.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./createLucideIcon-Dv8H8m7J.js";import"./conversation-model-C2KuZUXc.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";const q=1e4,J=500,$=1e3,Z=6e4,D="/api/tail/discover",_=`/api/tail/recent?limit=${J}`,P=3e4,tt=[{key:"status",label:"status",cls:"s-atop-col-status",kind:"text",sortable:!1,defaultWidth:96,minWidth:70,render:t=>n.jsxs("span",{className:`s-atop-status s-atop-status--${t.status}`,children:[n.jsx("span",{className:"s-atop-status-dot","aria-hidden":"true"}),t.statusLabel]})},{key:"session",label:"session",cls:"s-atop-col-agent",kind:"text",sortable:!1,defaultWidth:168,minWidth:110,maxWidth:280,render:t=>n.jsxs("div",{className:"s-atop-agent-cell",title:t.sessionId??t.refId,children:[n.jsx("span",{className:`s-atop-chip s-atop-chip--harness s-atop-chip--harness-${st(t.source)}`,children:t.source}),n.jsx("span",{className:"s-atop-agent-id",children:t.refId.slice(0,8)})]})},{key:"project",label:"project",cls:"s-atop-col-project",kind:"text",sortable:!1,defaultWidth:200,minWidth:96,maxWidth:360,render:t=>n.jsx("span",{title:t.cwd??t.project,children:t.project})},{key:"updated",label:"updated",cls:"s-atop-col-last",kind:"time",sortable:!1,defaultWidth:86,minWidth:64,render:t=>n.jsx("span",{title:Y(t.mtimeMs),children:U(Math.max(R(t.mtimeMs)??0,R(t.lastEvent?.ts)??0))||"-"})},{key:"size",label:"size",cls:"s-atop-col-runtime",kind:"number",sortable:!1,defaultWidth:80,minWidth:64,render:t=>nt(t.size)},{key:"path",label:"path",kind:"text",sortable:!1,defaultWidth:360,minWidth:160,maxWidth:800,render:t=>n.jsx("span",{title:t.transcriptPath,children:t.cwd??t.transcriptPath})}];function z(t){const i=t?.trim();if(!i)return null;const r=F(i);return r.endsWith(".jsonl")?r.slice(0,-6):r}function F(t){const i=t.replace(/[\\/]+$/,"");return i.split(/[\\/]/).filter(Boolean).at(-1)??i}function et(t){const r=t.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean);return r.pop(),r.at(-1)??""}function st(t){return t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function nt(t){if(!Number.isFinite(t)||t<0)return"-";if(t<1024)return`${t} B`;const i=t/1024;if(i<1024)return`${i.toFixed(i>=10?0:1)} KiB`;const r=i/1024;return`${r.toFixed(r>=10?0:1)} MiB`}function at(t,i){return i?[t.refId,t.sessionId??"",t.source,t.project,t.cwd??"",t.transcriptPath,t.lastEvent?.summary??"",t.process?.command??""].join(" ").toLowerCase().includes(i.toLowerCase()):!0}function B(t){return`${t.source}\0${t.cwd??""}`}function ot(t){return`${t.source}\0${t.cwd??""}`}function it(t,i,r){if(!t?.transcripts?.length)return[];const d=new Map;for(const s of i){const l=d.get(s.sessionId);(!l||s.ts>l.ts)&&d.set(s.sessionId,s)}const h=new Map;for(const s of t.processes){if(!s.cwd)continue;const l=h.get(B(s));(!l||s.pid<l.pid)&&h.set(B(s),s)}return t.transcripts.map(s=>{const l=z(s.sessionId)??z(s.transcriptPath);if(!l)return null;const u=s.sessionId?d.get(s.sessionId)??null:null,x=h.get(ot(s))??null,m=Math.max(s.mtimeMs,u?.ts??0),j=!!x||r-m<=Z,p=s.project?.trim()||(s.cwd?F(s.cwd):et(s.transcriptPath))||"unknown";return{refId:l,source:s.source||"unknown",project:p,cwd:s.cwd,transcriptPath:s.transcriptPath,sessionId:s.sessionId,mtimeMs:s.mtimeMs,size:s.size,status:j?"run":"idle",statusLabel:j?"active":"idle",lastEvent:u,process:x}}).filter(s=>s!==null).sort((s,l)=>{const u=Math.max(s.mtimeMs,s.lastEvent?.ts??0);return Math.max(l.mtimeMs,l.lastEvent?.ts??0)-u||s.project.localeCompare(l.project)})}function Qt({navigate:t}){const{route:i}=X(),[r]=o.useState(()=>W(D,P)),[d,h]=o.useState(r),[s,l]=o.useState(()=>W(_,P)?.events??[]),[u,x]=o.useState(r===null),[m,j]=o.useState(""),[p,S]=o.useState("all"),[y,k]=o.useState(0),[N,C]=o.useState(null),[T,V]=o.useState(Date.now()),b=o.useRef(null),I=o.useCallback(async()=>{C(null);try{h(await L(D))}catch(e){C(e instanceof Error?e.message:String(e))}finally{x(!1)}},[]);o.useEffect(()=>{I();const e=setInterval(()=>{I()},q);return()=>clearInterval(e)},[I]),o.useEffect(()=>{let e=!1;return(async()=>{try{const a=await L(_);e||l(a.events??[])}catch{}})(),()=>{e=!0}},[]),G(e=>{l(a=>a.length>=$?[...a.slice(a.length-$+1),e]:[...a,e])}),o.useEffect(()=>{const e=setInterval(()=>V(Date.now()),15e3);return()=>clearInterval(e)},[]);const f=o.useMemo(()=>it(d,s,T),[d,s,T]),H=o.useMemo(()=>[...new Set(f.map(e=>e.source))].sort(),[f]),c=o.useMemo(()=>f.filter(e=>(p==="all"||e.source===p)&&at(e,m.trim())),[f,p,m]);o.useEffect(()=>{y>=c.length&&k(Math.max(0,c.length-1))},[c.length,y]);const M=o.useCallback(e=>{e&&Q(t,{view:"sessions",sessionId:e.refId},{returnTo:i})},[t,i]);o.useEffect(()=>{const e=a=>{const E=a.target,A=E instanceof HTMLInputElement||E instanceof HTMLTextAreaElement||(E?.isContentEditable??!1);if(a.key==="/"&&!A){a.preventDefault(),b.current?.focus();return}if(A){a.key==="Escape"&&E===b.current&&(j(""),b.current?.blur());return}if(a.key==="ArrowDown"||a.key==="j"){a.preventDefault(),k(w=>c.length===0?0:Math.min(c.length-1,w+1));return}if(a.key==="ArrowUp"||a.key==="k"){a.preventDefault(),k(w=>Math.max(0,w-1));return}(a.key==="Enter"||a.key==="o")&&(a.preventDefault(),M(c[y]))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c,y,M]);const K=N?[]:c,g=o.useCallback(e=>`${e.source}:${e.transcriptPath}`,[]),v=o.useMemo(()=>new Map(c.map((e,a)=>[g(e),a])),[c,g]);return n.jsxs("div",{className:"s-atop s-atop--sessions",children:[n.jsxs("div",{className:"s-atop-fbar",children:[n.jsxs("label",{className:"s-atop-search",children:[n.jsx("span",{className:"s-atop-search-prompt",children:"/"}),n.jsx("input",{ref:b,className:"s-atop-search-input",placeholder:"filter sessions",value:m,onChange:e=>j(e.target.value)}),n.jsx("kbd",{className:"s-atop-search-kbd",children:"/"})]}),n.jsx("span",{className:"s-atop-fbar-label",children:"source"}),n.jsxs("button",{type:"button",className:`s-atop-pill${p==="all"?" s-atop-pill--on":""}`,onClick:()=>S("all"),children:["all",n.jsx("span",{className:"s-atop-pill-ct",children:f.length})]}),H.map(e=>n.jsxs("button",{type:"button",className:`s-atop-pill${p===e?" s-atop-pill--on":""}`,onClick:()=>S(e),children:[e,n.jsx("span",{className:"s-atop-pill-ct",children:f.filter(a=>a.source===e).length})]},e)),n.jsx("div",{className:"s-atop-fbar-spacer"})]}),n.jsx(O,{rows:K,columns:tt,rowId:g,storageKey:"openscout.sessions.cols",rowBindings:e=>({onMouseEnter:()=>{const a=v.get(e);a!=null&&k(a)},onFocus:()=>{const a=v.get(e);a!=null&&k(a)}}),onRowClick:e=>M(e),rowClassName:e=>v.get(g(e))===y?"s-atop-row--selected":void 0,empty:N?{title:"Discovery failed",body:N}:{title:"No raw sessions",body:m?"No sessions match the current filter.":"No transcript sessions were discovered."},loading:u,density:"compact",className:"s-atop-data-table",ariaLabel:"Raw sessions"}),n.jsxs("div",{className:"s-atop-keys",children:[n.jsxs("span",{children:[n.jsx("kbd",{children:"/"}),"filter"]}),n.jsxs("span",{children:[n.jsx("kbd",{children:"j/k"}),"select"]}),n.jsxs("span",{children:[n.jsx("kbd",{children:"enter"}),"open"]}),n.jsx("span",{className:"s-atop-keys-spacer"}),n.jsxs("span",{className:"s-atop-keys-count",children:[n.jsx("strong",{children:c.length})," sessions"]})]})]})}export{Qt as RawSessionsTable};
|