@openscout/scout 0.2.106 → 0.2.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -16
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/ActivityScreen-C1H-vL0L.js +1 -0
- package/dist/client/assets/{AddProjectForm-CusDRiVO.js → AddProjectForm-4sVXmjfN.js} +1 -1
- package/dist/client/assets/{AdventureEvidence-CyegKk1V.js → AdventureEvidence-D5wq1vu8.js} +1 -1
- package/dist/client/assets/{AdventureReader-X-hbTOi0.js → AdventureReader-BICypcDY.js} +1 -1
- package/dist/client/assets/{AdventureScenery-LPXSVP67.js → AdventureScenery-CGEcG0zV.js} +1 -1
- package/dist/client/assets/AgentAdventures-5yBt-Zl3.js +1 -0
- package/dist/client/assets/{AgentAvatar-CrP1eXxk.js → AgentAvatar-Dn8TUv5W.js} +1 -1
- package/dist/client/assets/AgentConfigurationScreen-C0D9WNyL.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-BzcBdC_s.js +1 -0
- package/dist/client/assets/{AgentDetailCard-DtHT3sCo.js → AgentDetailCard-CI-ufaEP.js} +1 -1
- package/dist/client/assets/AgentFloorView-D8tlGlgy.js +1 -0
- package/dist/client/assets/{AgentFloorWorld-CjoIa6jA.js → AgentFloorWorld-DqmnQexg.js} +1 -1
- package/dist/client/assets/AgentInfoScreen-BnRhfcFy.js +1 -0
- package/dist/client/assets/{AgentLaneCard-BaZ2g-f8.js → AgentLaneCard-pppHFROz.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-TF1SlJSc.js → AgentLaneChrome-RptImDFc.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-EzEPsn3g.js → AgentLaneDetailSheet-BqbwGskh.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-dpp7YvrX.js → AgentLaneSummaryResize-DaIgwyVh.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-De6C4ZOw.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-Ry-aqDTr.js → AgentLanesPreflight-BQfj2twF.js} +1 -1
- package/dist/client/assets/{AgentLanesView-BJi9xXz6.js → AgentLanesView-CiISx7pu.js} +1 -1
- package/dist/client/assets/{AgentLiveActions-CfTupTEl.js → AgentLiveActions-CkRGkv13.js} +1 -1
- package/dist/client/assets/AgentMasterScreen-CijN_4tN.js +1 -0
- package/dist/client/assets/{AgentSessions-B1gOhDBf.js → AgentSessions-ghjQcSrh.js} +2 -2
- package/dist/client/assets/AgentsConsole-D8upjDpn.js +1 -0
- package/dist/client/assets/AgentsScreen-C17BFqjf.js +1 -0
- package/dist/client/assets/AgentsSubnav-_1GVC4hj.js +1 -0
- package/dist/client/assets/{AstronautSuit-Cchnc4Ug.js → AstronautSuit-Dzu4GOMR.js} +1 -1
- package/dist/client/assets/{AtopView-gkEp4y__.js → AtopView-DJK5b3lZ.js} +1 -1
- package/dist/client/assets/{BackToPicker-CUkjnoVk.js → BackToPicker-BPU7kbXq.js} +1 -1
- package/dist/client/assets/BriefingDetailScreen-CTvFw523.js +1 -0
- package/dist/client/assets/{BriefingsScreen-B1HlBMGZ.js → BriefingsScreen-DpVC3OUk.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-Dk242Yh_.js → BrokerMetadataPanel-glRVdwkU.js} +1 -1
- package/dist/client/assets/BrokerScreen-CqKsBwEx.js +8 -0
- package/dist/client/assets/{CastPicker-BXUtPAGC.js → CastPicker-Y29K5kKk.js} +1 -1
- package/dist/client/assets/ChannelComposer-D4EY9jVW.js +1 -0
- package/dist/client/assets/{ChannelSidebar-e9DOPulb.js → ChannelSidebar-CVmykV4d.js} +1 -1
- package/dist/client/assets/{CharacterFamilyPreview-DMfw7UM_.js → CharacterFamilyPreview-Bj8oMD-5.js} +1 -1
- package/dist/client/assets/{ChatAvatar-C3a_o5Hj.js → ChatAvatar-BsAOShUr.js} +1 -1
- package/dist/client/assets/{ChatBits-CsvxbToF.js → ChatBits-Cq54CmyB.js} +1 -1
- package/dist/client/assets/{ChatCollapsedStrip-FEmQ_G9J.js → ChatCollapsedStrip-B0DdrOo2.js} +1 -1
- package/dist/client/assets/{ChatRichInput-DhtwFxQE.js → ChatRichInput-DYJRhGTP.js} +1 -1
- package/dist/client/assets/ChatRightPanel-D94Lw7ud.js +1 -0
- package/dist/client/assets/ChatSpaceSurface-Cp532VmZ.js +1 -0
- package/dist/client/assets/{ChatSpaceTheme-CUH8bTZc.js → ChatSpaceTheme-DPzYpw-v.js} +1 -1
- package/dist/client/assets/{CodeDiffPane-DuQRwpgK.js → CodeDiffPane-DCgMUi39.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-ZQ6gSBpg.js → CodeProjectPicker-Dq787L77.js} +1 -1
- package/dist/client/assets/{CodeScreen-BXyKeL5T.js → CodeScreen-BN4TkiR0.js} +1 -1
- package/dist/client/assets/{CommsCanvas-THp0r_U8.js → CommsCanvas-Dh056d91.js} +1 -1
- package/dist/client/assets/{CommsDeck-BVmSMV2V.js → CommsDeck-CRXKIerH.js} +1 -1
- package/dist/client/assets/{CommsFlowGraph-DxoOaLF_.js → CommsFlowGraph-Cc48o9u_.js} +1 -1
- package/dist/client/assets/{CommsFlowMap-Vi8ziCPg.js → CommsFlowMap-Ckasql5e.js} +1 -1
- package/dist/client/assets/{CommsSelection-BUoRbu9o.js → CommsSelection-CuphnUny.js} +1 -1
- package/dist/client/assets/{ComposerAttachments-DW0AIb8k.js → ComposerAttachments-9uYp_Lh5.js} +1 -1
- package/dist/client/assets/ConversationComposer-hYtLurqy.js +1 -0
- package/dist/client/assets/ConversationFeedRows-Bu0ZJcy8.js +1 -0
- package/dist/client/assets/ConversationHeader-L9738YVP.js +1 -0
- package/dist/client/assets/{ConversationPanels-D9oC0xG5.js → ConversationPanels-D6KuqvGu.js} +2 -2
- package/dist/client/assets/ConversationScreen-Pzxy9x4m.js +2 -0
- package/dist/client/assets/ConversationStatus-BEefIbXq.js +1 -0
- package/dist/client/assets/{CrewAvatar-kTznzqcO.js → CrewAvatar-a_C_F9r_.js} +1 -1
- package/dist/client/assets/{CrewSprite-Dhryjx2c.js → CrewSprite-CguHb2Ny.js} +1 -1
- package/dist/client/assets/{CrewStage-vdO0qm3D.js → CrewStage-IPpS3Oja.js} +1 -1
- package/dist/client/assets/{CrewWorkspaces-DCBzAAS4.js → CrewWorkspaces-BTPtcEcx.js} +1 -1
- package/dist/client/assets/{DataTable-aH-jCyDq.js → DataTable-DnL_8SAu.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-66uQAorV.js → DispatchAftermath-CoAYaL3B.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-DJr0v0D_.js → DocumentFocusViewer-mxzPxQQW.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-BBa70EhJ.js → EmbeddableSurfacesLab-BAZ_eRMc.js} +1 -1
- package/dist/client/assets/{EmptyState-CZlrHXy-.js → EmptyState-DLiLgtPK.js} +1 -1
- package/dist/client/assets/{FileViewerPane-BAO6mtjD.js → FileViewerPane-Dc7AoVod.js} +1 -1
- package/dist/client/assets/{FleetRollCallHud-C5q2567n.js → FleetRollCallHud-VhpxVcGO.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-C1kASP3J.js +1 -0
- package/dist/client/assets/{FloorContextSheet-2_NVPQor.js → FloorContextSheet-BfrXNoBn.js} +1 -1
- package/dist/client/assets/{FloorExchangePanel-BU1pPu8K.js → FloorExchangePanel-DsG1cRzu.js} +1 -1
- package/dist/client/assets/{FloorMessagePasses-cLW2UGNP.js → FloorMessagePasses-Cm3LbkHd.js} +1 -1
- package/dist/client/assets/{FloorReplay-VFzA6Kxc.js → FloorReplay-Bg7kA-tR.js} +1 -1
- package/dist/client/assets/FloorResourcesSheet-Ba9HubO2.js +1 -0
- package/dist/client/assets/{FloorSavedWork-BeHDejWz.js → FloorSavedWork-BDOvV3mA.js} +1 -1
- package/dist/client/assets/{FloorTacticalHUD-CO-iiFpb.js → FloorTacticalHUD-4d-Hr-YL.js} +1 -1
- package/dist/client/assets/{FollowScreen-CFfkIbc6.js → FollowScreen-DFVSlsQV.js} +1 -1
- package/dist/client/assets/{HarnessMark-C4naWc16.js → HarnessMark-CP-PWk2W.js} +1 -1
- package/dist/client/assets/HarnessesScreen-j-91IoOo.js +1 -0
- package/dist/client/assets/{HerdrSession-_t7yM8vX.js → HerdrSession-H2mmxeTK.js} +1 -1
- package/dist/client/assets/{HomeHero-DouPyNmz.js → HomeHero-g4H3Ctxg.js} +1 -1
- package/dist/client/assets/{HostAdvisorView-CnM1i8hW.js → HostAdvisorView-Cyt3b5Fq.js} +1 -1
- package/dist/client/assets/{InviteLandingScreen-CEjG2E34.js → InviteLandingScreen-C3DtAGD4.js} +1 -1
- package/dist/client/assets/{InviteSheet-CwxZtWCl.js → InviteSheet-BiGMNpsE.js} +1 -1
- package/dist/client/assets/{JumpPalette-O1aJE9gR.js → JumpPalette-goXAVByA.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-32n9baT-.js → KnowledgeSearchInspector-BbOQIqdF.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-DC8yX-kA.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-CJa110yk.js → LaneToolHoverCard-B8Am_1DC.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-CngYIxdI.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-TbrNHRj_.js → LaneTraceEventFocus-BRR_jcl9.js} +1 -1
- package/dist/client/assets/{MeshCanvas-DWZHYh1A.js → MeshCanvas-DzkuY_XI.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-iswYFpIb.js → MeshCanvasMinimap-BrscEPAH.js} +1 -1
- package/dist/client/assets/MeshScreen-CAtRB8K6.js +1 -0
- package/dist/client/assets/{MeshTopologyView-BVvtqI8q.js → MeshTopologyView-B1I2dAhu.js} +2 -2
- package/dist/client/assets/{MessageEmbeds-ksPazAKH.js → MessageEmbeds-B-FbWI7a.js} +1 -1
- package/dist/client/assets/MessagesScreen-hq7D3Lfi.js +1 -0
- package/dist/client/assets/{MissionContextRail-D62-Wis8.js → MissionContextRail-ClR8amG1.js} +1 -1
- package/dist/client/assets/MissionControlView-D6gbMrgx.js +1 -0
- package/dist/client/assets/{MissionFocusOverlay-C1zys3Jv.js → MissionFocusOverlay-CzeNgI9Q.js} +1 -1
- package/dist/client/assets/MissionLeftAgentRow-CB3cgeYr.js +1 -0
- package/dist/client/assets/{MissionLogPane-B19lYSY9.js → MissionLogPane-2PMEoG44.js} +1 -1
- package/dist/client/assets/NativeAreaScreen-BnlrAWT8.js +1 -0
- package/dist/client/assets/NativeAreaScreen-DSR5Tf6F.js +1 -0
- package/dist/client/assets/NativeAreaScreen-fGsxyeC3.js +1 -0
- package/dist/client/assets/{NewAgentModal-Bh-L-emz.js → NewAgentModal-4b_3aoZE.js} +1 -1
- package/dist/client/assets/{NewChatComposer-C97-iTMK.js → NewChatComposer-D-VB5vdt.js} +1 -1
- package/dist/client/assets/{NewChatOrigin-DFbF_XvR.js → NewChatOrigin-BYsEu9dZ.js} +1 -1
- package/dist/client/assets/{NodeDetailPanel-CElOEpCh.js → NodeDetailPanel-9NaEnZAQ.js} +1 -1
- package/dist/client/assets/{NodeMenu-B-jjHf1c.js → NodeMenu-BgJMmffZ.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-B7Qt69Ms.js → ObserveEmbedScreen-W7Q5HbXP.js} +2 -2
- package/dist/client/assets/{ObserveTextFlow-PFnG_10h.js → ObserveTextFlow-C0oQEerY.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-CUTIoLZJ.js → ObservedTopologyPanel-Ci7emnnj.js} +1 -1
- package/dist/client/assets/OpenScoutAppShell-Di9qdmI0.js +22 -0
- package/dist/client/assets/OpsAgentsView-DVotOMg2.js +1 -0
- package/dist/client/assets/OpsScreen-C955zgr3.js +1 -0
- package/dist/client/assets/OpsSubnav-CjMVj7Sk.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-B1VqGSmu.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-DHuMKJj-.js → ProjectAgentProfileBar-DhVU7zew.js} +1 -1
- package/dist/client/assets/ProjectAgentProfileHero-CJk-Dx4t.js +1 -0
- package/dist/client/assets/ProjectsInbox-B7kap8nR.js +2 -0
- package/dist/client/assets/ProjectsRail-BhSaqbv0.js +1 -0
- package/dist/client/assets/ProjectsScreen-CSb7nwjb.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-pEJutIO8.js +1 -0
- package/dist/client/assets/{Provider-C35yu29I.js → Provider-BEXAZWd9.js} +2 -2
- package/dist/client/assets/{RailRow-BjmWK420.js → RailRow-Ddz90weI.js} +1 -1
- package/dist/client/assets/RawSessionsTable-TdKlJIPl.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-BU5KmlNo.js +8 -0
- package/dist/client/assets/{RenderedWorkerSprite-Dhlyg89J.js → RenderedWorkerSprite-BNhFXMIo.js} +1 -1
- package/dist/client/assets/{ReplayClock-348f17bW.js → ReplayClock-wLpb4VqN.js} +1 -1
- package/dist/client/assets/{ReplayLog-CBnAM3ui.js → ReplayLog-IUyQdklN.js} +1 -1
- package/dist/client/assets/{ReplayOutpost-DyRPfNFx.js → ReplayOutpost-C4djhjZJ.js} +1 -1
- package/dist/client/assets/{RepoDiffEmbedScreen-BWxvRDrS.js → RepoDiffEmbedScreen-BmQX_8E-.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-DN94irmY.js → RepoDiffPageScreen-B9oAjrC6.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-_4JVXBIW.js → RepoDiffViewer-Ch_lIMt-.js} +1 -1
- package/dist/client/assets/RepoDiffViewerLazy-DL6A2o_z.js +2 -0
- package/dist/client/assets/{ReposScreen-uMCpt0e9.js → ReposScreen-D-E7fSAB.js} +2 -2
- package/dist/client/assets/{RiggedWorkerCharacter-q6QRc7_o.js → RiggedWorkerCharacter-CF6fhzGd.js} +1 -1
- package/dist/client/assets/{SageModelStudio-CNDhZhgD.js → SageModelStudio-CSet_ITs.js} +1 -1
- package/dist/client/assets/{ScoutDeckSurface-CUaU4R6T.js → ScoutDeckSurface-BJ-fl8AX.js} +1 -1
- package/dist/client/assets/{ScoutSurface-3_25USO_.js → ScoutSurface-BvFRdce6.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-CRqhYe0a.js → ScoutbotFxLab-CfPzycZ7.js} +1 -1
- package/dist/client/assets/{SecondaryNav-D7dbV2qo.js → SecondaryNav-1FjBDWuY.js} +1 -1
- package/dist/client/assets/{SessionContextStrip-CXfs9hUD.js → SessionContextStrip-BoiIxXvS.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-D0zFmou-.js → SessionEmbedScreen-BizGNGOz.js} +1 -1
- package/dist/client/assets/{SessionHopMenu-E6VJZrE0.js → SessionHopMenu-DX6PJPNk.js} +1 -1
- package/dist/client/assets/{SessionObserve-DXxBvejJ.js → SessionObserve-Dw3bVQYF.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-Cuj_KHxR.js → SessionObserveEvidence-uD1OX-R5.js} +1 -1
- package/dist/client/assets/SessionRefScreen-Ch9H-qVk.js +1 -0
- package/dist/client/assets/SessionsScreen-DUeP23Xy.js +1 -0
- package/dist/client/assets/{SettingsDrawer-juCpnbH6.js → SettingsDrawer-BVrP6J52.js} +3 -3
- package/dist/client/assets/SettingsScreen-BcJ05LE5.js +1 -0
- package/dist/client/assets/{SharedFloorCharacter-DNEiaOUh.js → SharedFloorCharacter-dnamlt1p.js} +1 -1
- package/dist/client/assets/SharedWorkFloor-H-e2TVj9.js +2 -0
- package/dist/client/assets/{ShikiPane-CRtTYkMj.js → ShikiPane-CDiIT_qn.js} +1 -1
- package/dist/client/assets/{SlidePanel-_CHAQdOa.js → SlidePanel-D5oPQocF.js} +1 -1
- package/dist/client/assets/{SpaceSwitcher-BLgSCf_T.js → SpaceSwitcher-WccPJ0fS.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-CpZWf54-.js → SpriteAvatar-D53GaaK3.js} +1 -1
- package/dist/client/assets/{SproutActionSprite-BSiTS4en.js → SproutActionSprite-BrFCmgWS.js} +1 -1
- package/dist/client/assets/{StatusPill-2gCP6H7A.js → StatusPill-jT--OXbn.js} +1 -1
- package/dist/client/assets/{TailView-CYSijNTy.js → TailView-B44cSuyl.js} +2 -2
- package/dist/client/assets/Terminal-D0PanmIk.js +4 -0
- package/dist/client/assets/TerminalEmbedScreen-Eddi4sts.js +1 -0
- package/dist/client/assets/{TerminalHeaderMount-Cq4OD_xN.js → TerminalHeaderMount-CYYcKxQ-.js} +1 -1
- package/dist/client/assets/{TextDocumentSurface-D52m7Vd8.js → TextDocumentSurface-DBslUq9k.js} +1 -1
- package/dist/client/assets/{TmuxPeek-CXFeweMg.js → TmuxPeek-Ctw5yYO5.js} +1 -1
- package/dist/client/assets/{VoiceControlWell-DF3bjcYA.js → VoiceControlWell-BkjuWjYu.js} +1 -1
- package/dist/client/assets/{VoicePathDiagram-CmpHWfO-.js → VoicePathDiagram-u0i6ntbx.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-Ok2nfxHw.js → VoicePermissionsPanel-9Nuw-xCr.js} +1 -1
- package/dist/client/assets/{VoiceTurnDetails-wAByRaNB.js → VoiceTurnDetails-kS7lfbmt.js} +1 -1
- package/dist/client/assets/{VoiceTurnStage-edoJalLV.js → VoiceTurnStage-DLY6aYDg.js} +1 -1
- package/dist/client/assets/{VoiceTurnView-D-8g5E4r.js → VoiceTurnView-CF4tIldB.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-zQkNVy2F.js → WorkDetailScreen-BrrkENYq.js} +2 -2
- package/dist/client/assets/{WorkFilesViewer-vNt01sDd.js → WorkFilesViewer-B63sKRYZ.js} +1 -1
- package/dist/client/assets/{WorkRunView-BDkR7Edq.js → WorkRunView-DLIzAsc3.js} +1 -1
- package/dist/client/assets/WorldActorTalk-CHhFTiQV.js +1 -0
- package/dist/client/assets/{WorldCharacter-CIIlutQq.js → WorldCharacter-CJGx2DVy.js} +1 -1
- package/dist/client/assets/{WorldMinimap-B6HNgcDe.js → WorldMinimap-DL12pBw3.js} +1 -1
- package/dist/client/assets/{WorldSky-Jm2Z6dfW.js → WorldSky-BlPNvGLo.js} +1 -1
- package/dist/client/assets/{activity-CIlFrfPJ.js → activity-CXkZ620t.js} +1 -1
- package/dist/client/assets/{addon-fit-dFpj9Kfq.js → addon-fit-G3qi01sy.js} +1 -1
- package/dist/client/assets/{addon-webgl-BFCGRtGh.js → addon-webgl-Bo7kSgOB.js} +1 -1
- package/dist/client/assets/{agent-essentials-BGGvT5G6.js → agent-essentials-DnfdGmIX.js} +1 -1
- package/dist/client/assets/{agent-specialization-DDc7mLCW.js → agent-specialization-DYX_DSlY.js} +1 -1
- package/dist/client/assets/{arc.es-C1SQHJ3k.js → arc.es-CLA3XI14.js} +1 -1
- package/dist/client/assets/arrow-down--OUDFWIq.js +1 -0
- package/dist/client/assets/{arrow-left-MVUKauwQ.js → arrow-left-DNjQHf4C.js} +1 -1
- package/dist/client/assets/{arrow-right-Bp-FpE5V.js → arrow-right-A_yyXwoH.js} +1 -1
- package/dist/client/assets/arrow-up-DFy-9ghF.js +1 -0
- package/dist/client/assets/{arrow-up-right-BPedAgxO.js → arrow-up-right-DUW1A1Hb.js} +1 -1
- package/dist/client/assets/{book-open-CV98WMSp.js → book-open-B_idZgTF.js} +1 -1
- package/dist/client/assets/{bot-B4zLQ4IN.js → bot-BNv_ZJzi.js} +1 -1
- package/dist/client/assets/{chat-api-DSJMBYoT.js → chat-api-BHGHALv2.js} +1 -1
- package/dist/client/assets/{chat-message-markup-91DIry6R.js → chat-message-markup-esR-YLtN.js} +1 -1
- package/dist/client/assets/{chat-transport-DNS5CB2I.js → chat-transport-CtxnPLMU.js} +1 -1
- package/dist/client/assets/{check-lrJ3a73a.js → check-BM6QtbB7.js} +1 -1
- package/dist/client/assets/{chevron-down-l1mrh5S9.js → chevron-down-DEDSNJNY.js} +1 -1
- package/dist/client/assets/{chevron-right-DrfqcerI.js → chevron-right-B02kAw12.js} +1 -1
- package/dist/client/assets/{chevron-up-CETZJzjV.js → chevron-up-CzveykKG.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-DbVLgbWX.js → chunk-HRAB3GC3-DVhUsgOw.js} +1 -1
- package/dist/client/assets/chunk-JTPDIGGW-hdpdYwXb.js +46 -0
- package/dist/client/assets/chunk-T65CQEWV-G_Z0lqtn.js +1 -0
- package/dist/client/assets/chunk-YOZR3KYS-apgUnfXh.js +2 -0
- package/dist/client/assets/{clock-BV1aqPkK.js → clock-8tb9t2t9.js} +1 -1
- package/dist/client/assets/{code-xml-BhcNbLWU.js → code-xml-E9gBuiVs.js} +1 -1
- package/dist/client/assets/{coffee-D7EAOdCk.js → coffee-D0YEK6-l.js} +1 -1
- package/dist/client/assets/{compass-63TUaz5_.js → compass-EmGkpxIe.js} +1 -1
- package/dist/client/assets/content-B-rn1rka.js +1 -0
- package/dist/client/assets/content-BHV-ZU8_.js +1 -0
- package/dist/client/assets/content-BI9yWpWC.js +1 -0
- package/dist/client/assets/content-BLVuukzF.js +1 -0
- package/dist/client/assets/content-BP3cQkAj.js +1 -0
- package/dist/client/assets/content-BRY-UTkP.js +1 -0
- package/dist/client/assets/content-BXTmYOPB.js +1 -0
- package/dist/client/assets/content-C3DZ77HZ.js +1 -0
- package/dist/client/assets/content-CPchclaV.js +1 -0
- package/dist/client/assets/{content-nGlEZhUI.js → content-CVqPTQnr.js} +1 -1
- package/dist/client/assets/content-CjAERU44.js +1 -0
- package/dist/client/assets/content-CoYG0nWL.js +1 -0
- package/dist/client/assets/content-DK1KeRPw.js +1 -0
- package/dist/client/assets/content-iWBSSXa6.js +1 -0
- package/dist/client/assets/content-ryJeaQk8.js +1 -0
- package/dist/client/assets/content-srNyLgDt.js +1 -0
- package/dist/client/assets/{conversation-icons-Tqba2d56.js → conversation-icons-Dxn9N1Kx.js} +1 -1
- package/dist/client/assets/conversation-motion-features-BfmPlONx.js +1 -0
- package/dist/client/assets/{copy-xKeM5ZtU.js → copy-C1XrY27_.js} +1 -1
- package/dist/client/assets/{cpu-BOTa_WLr.js → cpu-DVZ_LhPn.js} +1 -1
- package/dist/client/assets/{createLucideIcon-zZ8Hx7er.js → createLucideIcon-CKbjXlwv.js} +1 -1
- package/dist/client/assets/direct-voice-DAOUU-kc.js +10 -0
- package/dist/client/assets/discover-BNa3BPr_.js +2 -0
- package/dist/client/assets/embed-entry-gK3z8Yxi.js +2 -0
- package/dist/client/assets/{external-link-CUObqmgX.js → external-link-Df1R34rX.js} +1 -1
- package/dist/client/assets/{eye-LrO-cXQt.js → eye-CD-_aphP.js} +1 -1
- package/dist/client/assets/{file-code-corner-CsU7jJpu.js → file-code-corner-DtMWHBN3.js} +1 -1
- package/dist/client/assets/{file-text-CnISiiw6.js → file-text-BOJQiS8p.js} +1 -1
- package/dist/client/assets/{flag-C4wl8z2-.js → flag-CeKO8NoD.js} +1 -1
- package/dist/client/assets/{folder-D5prSkzz.js → folder-C2emmTHq.js} +1 -1
- package/dist/client/assets/{gauge-D9_5iJEm.js → gauge-BR5CrhRM.js} +1 -1
- package/dist/client/assets/{gestures-QZub3Ot9.js → gestures-Dh8szhcU.js} +1 -1
- package/dist/client/assets/{git-branch-B0_fPLO7.js → git-branch-C45vy8qT.js} +1 -1
- package/dist/client/assets/{go-shortcuts-DicR7sUf.js → go-shortcuts--25Qg0lD.js} +1 -1
- package/dist/client/assets/{home-moving-signal-rpMhsOJB.js → home-moving-signal-BiiyEKEb.js} +1 -1
- package/dist/client/assets/home-now-card-DaCpqUZe.js +1 -0
- package/dist/client/assets/{home-now-card-nano-B5Dv3-pb.js → home-now-card-nano-wbxgyY4q.js} +1 -1
- package/dist/client/assets/hooks-JNwYSH18.js +2 -0
- package/dist/client/assets/{index-EsrkGBcv.js → index-BFbLvCJn.js} +2 -2
- package/dist/client/assets/index-BRNHY2fp.css +1 -0
- package/dist/client/assets/index-BrXaMEdK.js +1 -0
- package/dist/client/assets/index-CXzJ_hGx.js +1 -0
- package/dist/client/assets/{index-CHD0qcfL.js → index-V8FYEUpD.js} +1 -1
- package/dist/client/assets/index-mYtyYeAe.js +1 -0
- package/dist/client/assets/{inspector-panel-BkgUDn6G.js → inspector-panel-BgU5xUln.js} +2 -2
- package/dist/client/assets/{keyboard-nav-DDHegDbx.js → keyboard-nav-CEe-ApvZ.js} +1 -1
- package/dist/client/assets/{lane-roster-store-D-RSWjb-.js → lane-roster-store-MraynTHP.js} +1 -1
- package/dist/client/assets/{layers-C8PDiMul.js → layers-ClmyjwpB.js} +1 -1
- package/dist/client/assets/{layout-grid-Cor2frzj.js → layout-grid-DG2-JaPn.js} +1 -1
- package/dist/client/assets/left-B66YR0c5.js +1 -0
- package/dist/client/assets/left-BP5P8lzw.js +2 -0
- package/dist/client/assets/left-BbCKRDbW.js +1 -0
- package/dist/client/assets/left-CaY5FK2k.js +1 -0
- package/dist/client/assets/left-CemrfeSs.js +1 -0
- package/dist/client/assets/left-DcYA26sH.js +1 -0
- package/dist/client/assets/left-DdMMaqFT.js +2 -0
- package/dist/client/assets/left-advisor-DBml48M5.js +1 -0
- package/dist/client/assets/left-agents-DowYF2ag.js +1 -0
- package/dist/client/assets/left-default-Bifaeg_V.js +1 -0
- package/dist/client/assets/left-lanes-BGhjdqpD.js +1 -0
- package/dist/client/assets/left-mission-CvXPUovR.js +1 -0
- package/dist/client/assets/library-CnC8uzJt.js +1 -0
- package/dist/client/assets/{loader-circle-OvccU82H.js → loader-circle-CCG7hG7z.js} +1 -1
- package/dist/client/assets/{local-agents-BqnoxJrq.js → local-agents-BMcFlY_x.js} +1 -1
- package/dist/client/assets/{log-in-7SnYqW5w.js → log-in-VL9mdgeE.js} +1 -1
- package/dist/client/assets/{machine-children-DxcqCLmd.js → machine-children-DvCiQxwA.js} +1 -1
- package/dist/client/assets/{mentions-ByUvhS-v.js → mentions-s5oW4aQU.js} +1 -1
- package/dist/client/assets/{mesh-ops-CiZ8xSAx.js → mesh-ops-9SzD3sPw.js} +1 -1
- package/dist/client/assets/{mesh-view-store-DZvJC4KU.js → mesh-view-store-CVqzYz4K.js} +1 -1
- package/dist/client/assets/{message-circle-CxRVKNE-.js → message-circle-BB3rFCVD.js} +1 -1
- package/dist/client/assets/{message-markup-Zwo3t4cI.js → message-markup-D1C7GzHo.js} +1 -1
- package/dist/client/assets/{message-square-BxesYglW.js → message-square-BwqBIfv5.js} +1 -1
- package/dist/client/assets/{mission-control-store-elEEsIvb.js → mission-control-store-e8F85JhP.js} +1 -1
- package/dist/client/assets/{monitor-DTTYEb73.js → monitor-M0VSmHQ-.js} +1 -1
- package/dist/client/assets/{nav-destinations-uorRqFxf.js → nav-destinations-B3R5zxFX.js} +1 -1
- package/dist/client/assets/{observe-BJqERJVj.js → observe-M3rLosT5.js} +1 -1
- package/dist/client/assets/{page-status-BswZLqvA.js → page-status-BIuh3C5p.js} +1 -1
- package/dist/client/assets/{panel-right-Bv7sP_fc.js → panel-right-WKLdPm0F.js} +1 -1
- package/dist/client/assets/{paperclip-BjcuP_Hx.js → paperclip-DLf_ABSv.js} +1 -1
- package/dist/client/assets/{pause-C2XTlkjs.js → pause-7mmEEvVx.js} +1 -1
- package/dist/client/assets/{persistent-state-KRk_yb0q.js → persistent-state-3mbBFRDO.js} +1 -1
- package/dist/client/assets/{pin-C2mFOV1l.js → pin-q_0gAA6i.js} +1 -1
- package/dist/client/assets/{play-FT6K3It1.js → play-N5-hnPCV.js} +1 -1
- package/dist/client/assets/{plus-DFDDeGKu.js → plus-B0hdY0fF.js} +1 -1
- package/dist/client/assets/profile-B7ZGToTo.js +1 -0
- package/dist/client/assets/{projects-inbox-C0FUCv_p.js → projects-inbox-CMFBjQt0.js} +1 -1
- package/dist/client/assets/{proxy-AJsmwA6h.js → proxy-k0ILOVkK.js} +1 -1
- package/dist/client/assets/{radio-DRoOZsws.js → radio-Bjqmv997.js} +1 -1
- package/dist/client/assets/{refresh-cw-BmVr7sCD.js → refresh-cw-BcqctLqo.js} +1 -1
- package/dist/client/assets/resolve-panes-wzGu9d8o.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-C8SOo5oZ.js +1 -0
- package/dist/client/assets/right-9rMRZN_r.js +1 -0
- package/dist/client/assets/right-BHZq648O.js +1 -0
- package/dist/client/assets/{right-DWPVB-nK.js → right-BNJzCaH9.js} +1 -1
- package/dist/client/assets/right-CAd7lTvY.js +1 -0
- package/dist/client/assets/right-Cc57bCTW.js +1 -0
- package/dist/client/assets/right-DY49Prjj.js +1 -0
- package/dist/client/assets/right-DfU47xKY.js +1 -0
- package/dist/client/assets/right-Dr7vxdZl.js +1 -0
- package/dist/client/assets/right-DsE4aR3A.js +1 -0
- package/dist/client/assets/right-zlkRjnkv.js +1 -0
- package/dist/client/assets/{rocket-CGl4RTV7.js → rocket-BahsdUe6.js} +1 -1
- package/dist/client/assets/router-CJIx83Ia.js +1 -0
- package/dist/client/assets/runtime-picker-IRcTkMZ5.js +1 -0
- package/dist/client/assets/{scope-views-RUWwCVAr.js → scope-views-KDtZoLUC.js} +1 -1
- package/dist/client/assets/{scout-voice-CZx60X6E.js → scout-voice-Cdh6pCsb.js} +1 -1
- package/dist/client/assets/{scoutbot-markdown-BKEBSbG0.js → scoutbot-markdown-7PRQHaAc.js} +1 -1
- package/dist/client/assets/{scroll-text-DNjxhyO2.js → scroll-text-CA0QxBHu.js} +1 -1
- package/dist/client/assets/{search-DT42oyRW.js → search-Bv2IONmc.js} +1 -1
- package/dist/client/assets/secondaryNavConfig-Bmb-oRvD.js +1 -0
- package/dist/client/assets/{selection-bridge-x3wFUjxj.js → selection-bridge-CthAuPRw.js} +1 -1
- package/dist/client/assets/{send-horizontal-CH0-fbZE.js → send-horizontal-_Tf_It04.js} +1 -1
- package/dist/client/assets/{send-to-agent-session-DoKCDBJ4.js → send-to-agent-session-CWDHHgFB.js} +1 -1
- package/dist/client/assets/{server-QfsgMLk1.js → server-U_l8A83n.js} +1 -1
- package/dist/client/assets/{session-catalog-CvSdPHPe.js → session-catalog-Dx4tl3sx.js} +1 -1
- package/dist/client/assets/{session-recap-queue-41l2XVkI.js → session-recap-queue-GeicPLsQ.js} +1 -1
- package/dist/client/assets/{session-table-L-pns6Zl.js → session-table-BI62J4NP.js} +1 -1
- package/dist/client/assets/{sessions-view-Dc-QAa7O.js → sessions-view-lGMwwZY7.js} +1 -1
- package/dist/client/assets/{settings-BVh7kldq.js → settings-bo9X410k.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-782VC_yy.js → sliders-horizontal-CPSx6wd2.js} +1 -1
- package/dist/client/assets/{sparkles-BjHq_DNK.js → sparkles-Br-bA2aZ.js} +1 -1
- package/dist/client/assets/{sse-BCPRocpq.js → sse-BVxO0zNp.js} +1 -1
- package/dist/client/assets/{tail-events-d0yAYxR0.js → tail-events-C6NWFB1N.js} +1 -1
- package/dist/client/assets/{terminal-hQKQygcf.js → terminal-DMBAZjPP.js} +1 -1
- package/dist/client/assets/{terminal-relay-Bxs1hp-j.js → terminal-relay-CpGHpDa8.js} +1 -1
- package/dist/client/assets/{terminal-takeover-Ay5C2c-M.js → terminal-takeover-CXwdoZ5j.js} +1 -1
- package/dist/client/assets/{triangle-alert-CHoRGdVO.js → triangle-alert-BZikHKuT.js} +1 -1
- package/dist/client/assets/use-beside-DopIbJwf.js +1 -0
- package/dist/client/assets/{use-conversation-list-CY4JciOV.js → use-conversation-list-CGtcpdPd.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-CymmXWH4.js → use-fleet-active-asks-DAHOPYPV.js} +1 -1
- package/dist/client/assets/{use-mesh-node-state-BvaqtODo.js → use-mesh-node-state-BlWIPTc4.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-BSYaqH_0.js → use-mesh-ops-items-pKWBro7o.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-3gMYZNIp.js → use-reduced-motion-DkdIQBwh.js} +1 -1
- package/dist/client/assets/use-scout-dev-flags-CduUFb7l.js +1 -0
- package/dist/client/assets/{useAgentHoverCard-BANmpjMh.js → useAgentHoverCard-DNlXPYQf.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-LJGNYG3U.js +1 -0
- package/dist/client/assets/{useEmbedHeadline-D6pJRxUg.js → useEmbedHeadline-BeeBDb7E.js} +1 -1
- package/dist/client/assets/{usePierreRuntime-BAQdiN0L.js → usePierreRuntime-DUXZ-DTK.js} +1 -1
- package/dist/client/assets/useSidebarCollapse-DoMvU_2R.js +1 -0
- package/dist/client/assets/{users-BUjx36gx.js → users-BQPEIUfd.js} +1 -1
- package/dist/client/assets/{wrench-DR0i5BU7.js → wrench-C-wjicn5.js} +1 -1
- package/dist/client/assets/{x-DAehov0E.js → x-BcfhXYiF.js} +1 -1
- package/dist/client/assets/{xterm-BXQiLVnI.js → xterm-qXD45dc0.js} +1 -1
- package/dist/client/assets/{zap-CEjZNZbI.js → zap-BqL8ttGz.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/main.mjs +1 -1
- package/package.json +29 -5
- package/server.json +31 -0
- package/dist/client/assets/ActivityScreen-CZmGwQ2U.js +0 -1
- package/dist/client/assets/AgentAdventures-BAgxdOF8.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-1L0IQm2w.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-DguGs7jZ.js +0 -1
- package/dist/client/assets/AgentFloorView-DH4jiDgw.js +0 -1
- package/dist/client/assets/AgentInfoScreen-DYtmKkeE.js +0 -1
- package/dist/client/assets/AgentLanesEmbedScreen-BlSof_6S.js +0 -1
- package/dist/client/assets/AgentMasterScreen-EJhmuKgl.js +0 -1
- package/dist/client/assets/AgentsConsole-RXGqRvcb.js +0 -1
- package/dist/client/assets/AgentsScreen-ChwMBs11.js +0 -1
- package/dist/client/assets/AgentsSubnav-DwNX4yy0.js +0 -1
- package/dist/client/assets/BriefingDetailScreen-DrlC3qkm.js +0 -1
- package/dist/client/assets/BrokerScreen-DwOF6bMA.js +0 -8
- package/dist/client/assets/Canvas-X9pVSkw3.js +0 -1
- package/dist/client/assets/ChannelComposer-DoK7IDGa.js +0 -1
- package/dist/client/assets/ChatRightPanel-C1h_aIkn.js +0 -1
- package/dist/client/assets/ChatSpaceSurface-BXyLYKHn.js +0 -1
- package/dist/client/assets/ConversationComposer-CUQyArlk.js +0 -1
- package/dist/client/assets/ConversationFeedRows-DWiOfT-y.js +0 -1
- package/dist/client/assets/ConversationHeader-C-ZWscKj.js +0 -1
- package/dist/client/assets/ConversationScreen-CUfsQ4MR.js +0 -2
- package/dist/client/assets/ConversationStatus--IPm2nGh.js +0 -1
- package/dist/client/assets/FlightObserveScreen-DZ2mrw91.js +0 -1
- package/dist/client/assets/FloorResourcesSheet-C-kQ6Ren.js +0 -1
- package/dist/client/assets/HarnessesScreen-DX3NLcDG.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-Dd6jrQ0A.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-DYrd0BIf.js +0 -1
- package/dist/client/assets/MeshScreen-8nAzQVbm.js +0 -1
- package/dist/client/assets/MessagesScreen-C3WB4T21.js +0 -1
- package/dist/client/assets/MissionControlView-B9cNPXvl.js +0 -1
- package/dist/client/assets/MissionLeftAgentRow-vycMV77n.js +0 -1
- package/dist/client/assets/NativeAreaScreen-B1RLa85C.js +0 -1
- package/dist/client/assets/NativeAreaScreen-CV0OhGra.js +0 -1
- package/dist/client/assets/NativeAreaScreen-CzuZt6o1.js +0 -1
- package/dist/client/assets/OpenScoutAppShell-37PDFfA4.js +0 -31
- package/dist/client/assets/OpsAgentsView-DajlX8LO.js +0 -1
- package/dist/client/assets/OpsScreen-jVcaBKGi.js +0 -1
- package/dist/client/assets/OpsSubnav-BOOYShHE.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-D_wlW4sQ.js +0 -1
- package/dist/client/assets/ProjectAgentProfileHero-Dbebtug1.js +0 -1
- package/dist/client/assets/ProjectsInbox-Cgu7B4--.js +0 -2
- package/dist/client/assets/ProjectsRail-CDWocin_.js +0 -1
- package/dist/client/assets/ProjectsScreen-B_CJycqW.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-1MMl_qUD.js +0 -1
- package/dist/client/assets/RawSessionsTable-DzT90hWu.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-B6ylX3WQ.js +0 -16
- package/dist/client/assets/RepoDiffViewerLazy-XGVC3WXv.js +0 -2
- package/dist/client/assets/SessionRefScreen-DqLSUlCE.js +0 -1
- package/dist/client/assets/SessionsScreen-BLIRkohT.js +0 -1
- package/dist/client/assets/SettingsScreen-BtGzE2-O.js +0 -1
- package/dist/client/assets/SharedWorkFloor-D9mf9KSg.js +0 -2
- package/dist/client/assets/Terminal-Bi97yb5s.js +0 -4
- package/dist/client/assets/TerminalEmbedScreen-Bqop67Bq.js +0 -1
- package/dist/client/assets/TerminalRelay-DrikpUSJ.js +0 -46
- package/dist/client/assets/WorldActorTalk-BvSg_b1y.js +0 -1
- package/dist/client/assets/content-B1lgE8qr.js +0 -1
- package/dist/client/assets/content-B5l11YyQ.js +0 -1
- package/dist/client/assets/content-BNZOZEpX.js +0 -1
- package/dist/client/assets/content-BRIxP155.js +0 -1
- package/dist/client/assets/content-BWd8gt8L.js +0 -1
- package/dist/client/assets/content-BfwS2jAK.js +0 -1
- package/dist/client/assets/content-C4p43_eT.js +0 -1
- package/dist/client/assets/content-CdYfaoDV.js +0 -1
- package/dist/client/assets/content-CzldLxw0.js +0 -1
- package/dist/client/assets/content-D-olnc4U.js +0 -1
- package/dist/client/assets/content-DTioimq4.js +0 -1
- package/dist/client/assets/content-LOebm3_d.js +0 -1
- package/dist/client/assets/content-oyzDM-LK.js +0 -1
- package/dist/client/assets/content-x1PHxED7.js +0 -1
- package/dist/client/assets/content-zX3ZY3T9.js +0 -1
- package/dist/client/assets/conversation-motion-features-C5zjuNwE.js +0 -1
- package/dist/client/assets/direct-voice-BbLPuJ04.js +0 -2
- package/dist/client/assets/discover-DJFxyV1k.js +0 -2
- package/dist/client/assets/embed-entry-Lyvu0Kfc.js +0 -2
- package/dist/client/assets/home-now-card-ByE6Umcx.js +0 -1
- package/dist/client/assets/hooks-_eCZZPsR.js +0 -2
- package/dist/client/assets/index-724SdE6r.js +0 -1
- package/dist/client/assets/index-CN4rBB_s.css +0 -1
- package/dist/client/assets/index-D1d98iYf.js +0 -1
- package/dist/client/assets/index-gGHPA-By.js +0 -1
- package/dist/client/assets/left-Bn5X7x2o.js +0 -2
- package/dist/client/assets/left-BqS0fYX1.js +0 -1
- package/dist/client/assets/left-CTCeeeD3.js +0 -1
- package/dist/client/assets/left-DhtVPVux.js +0 -1
- package/dist/client/assets/left-K39b-Wvx.js +0 -2
- package/dist/client/assets/left-KGmueNPt.js +0 -1
- package/dist/client/assets/left-P_GOYB-s.js +0 -1
- package/dist/client/assets/left-advisor-B0N47De2.js +0 -1
- package/dist/client/assets/left-agents-CsSNc51Y.js +0 -1
- package/dist/client/assets/left-default-BlO5LP2T.js +0 -1
- package/dist/client/assets/left-lanes-C4PhaJE6.js +0 -1
- package/dist/client/assets/left-mission-BjTE5vPa.js +0 -1
- package/dist/client/assets/library-CkWNPHRp.js +0 -1
- package/dist/client/assets/profile-DTmzN16I.js +0 -1
- package/dist/client/assets/provider-Dojd8quC.js +0 -1
- package/dist/client/assets/resolve-panes-pbY1fCWi.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-YWkZTq1t.js +0 -1
- package/dist/client/assets/right-49kO-6nD.js +0 -1
- package/dist/client/assets/right-APtItA8A.js +0 -1
- package/dist/client/assets/right-BJwhPqtn.js +0 -1
- package/dist/client/assets/right-BPqrf4ek.js +0 -1
- package/dist/client/assets/right-D7djOy6K.js +0 -1
- package/dist/client/assets/right-DKOUCRob.js +0 -1
- package/dist/client/assets/right-DMNrVzg7.js +0 -1
- package/dist/client/assets/right-DppeMCy4.js +0 -1
- package/dist/client/assets/right-GAL5Mw1v.js +0 -1
- package/dist/client/assets/router-DCtl8wqb.js +0 -1
- package/dist/client/assets/runtime-picker-DXu2bOTh.js +0 -1
- package/dist/client/assets/secondaryNavConfig-CS1svh6n.js +0 -1
- package/dist/client/assets/use-beside-DoRC1nt0.js +0 -1
- package/dist/client/assets/use-scout-dev-flags-DS_pYYQd.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-C6OBu-3_.js +0 -1
- package/dist/client/assets/usePersistentState-B8lP7TRb.js +0 -1
- package/dist/client/assets/useSidebarCollapse-OL_8J5cL.js +0 -1
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{r as t,j as e}from"./index-EsrkGBcv.js";import{r as xs}from"./index-724SdE6r.js";import{D as js}from"./runtime-picker-DXu2bOTh.js";import{E as Ee}from"./EmptyState-CZlrHXy-.js";import"./router-DCtl8wqb.js";import{uploadMediaFiles as ks,isRoutableMediaFile as vs}from"./media-blobs-Bi8pxr1u.js";import{A as ws,R as Ns,B as Ss,D as As}from"./NewChatComposer-C97-iTMK.js";import{p as Is,a as ie}from"./api-DSqpVKC7.js";import{c as Rs}from"./clipboard-e3fSpeo7.js";import{u as Cs}from"./sse-BCPRocpq.js";import{b as ze}from"./status-tone-BM_zuRy1.js";import{t as Fe,b as ts,n as ee}from"./time-Dhsh_2EG.js";import{u as ns}from"./Provider-C35yu29I.js";import{o as We}from"./openContent-C6XO6kr5.js";import{g as $s,b as le,h as os,d as Ds,i as Es,j as Fs,k as Ms}from"./broker-display-BkBzyvbR.js";import{BrokerMetadataPanel as Ts}from"./BrokerMetadataPanel-Dk242Yh_.js";import{DispatchAftermath as Ls}from"./DispatchAftermath-66uQAorV.js";import{i as Ps,c as Bs,n as Ye}from"./keyboard-nav-DDHegDbx.js";import{ShikiPane as zs}from"./ShikiPane-CRtTYkMj.js";import{d as Os}from"./types-B0PlfpKc.js";import{u as qs}from"./useEmbedHeadline-D6pJRxUg.js";/* empty css */import{L as ke}from"./loader-circle-OvccU82H.js";import{R as _s}from"./refresh-cw-BmVr7sCD.js";import{X as Me}from"./x-DAehov0E.js";import{c as is}from"./createLucideIcon-zZ8Hx7er.js";import{E as Xe}from"./external-link-CUObqmgX.js";import{M as ls}from"./message-square-BxesYglW.js";import{A as Te}from"./arrow-right-Bp-FpE5V.js";import{P as Us,A as Ks}from"./paperclip-BjcuP_Hx.js";import{P as Js}from"./plus-DFDDeGKu.js";import{C as Ze}from"./chevron-down-l1mrh5S9.js";import{S as Hs}from"./send-horizontal-CH0-fbZE.js";import{C as Qs}from"./check-lrJ3a73a.js";import{C as Gs}from"./copy-xKeM5ZtU.js";import{R as Vs}from"./radio-DRoOZsws.js";import{M as Ws,a as Ys}from"./DocumentFocusViewer-DJr0v0D_.js";const Xs=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Zs=is("arrow-down",Xs);const er=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],sr=is("hash",er),rr=160;function De(s){const a=new URLSearchParams({limit:String(rr)});return s&&a.set("cursor",s),`/api/broker?${a.toString()}`}const es={index:-1,request:0};function ar(s,a){return{index:a,request:s.request+1}}function cs(s,a){return a===s.index?s:{index:a,request:s.request}}function tr(s,a){return s.index<a?s:cs(s,a>0?a-1:-1)}function nr(s,a){return s.request!==a}function or({enabled:s,rowCount:a,onActivateRow:n,onClearSelection:o}){const[f,u]=t.useState(es),b=f.index,p=t.useRef(new Map),j=t.useRef(es.request),c=t.useCallback(y=>{u(h=>ar(h,typeof y=="function"?y(h.index):y))},[]),w=t.useCallback(y=>{u(h=>cs(h,typeof y=="function"?y(h.index):y))},[]);t.useEffect(()=>{if(!nr(f,j.current)||(j.current=f.request,f.index<0))return;const y=p.current.get(f.index);y?.scrollIntoView({block:"nearest"}),y?.focus()},[f]),t.useEffect(()=>{u(y=>tr(y,a))},[a]);const A=t.useCallback((y,h)=>{h?p.current.set(y,h):p.current.delete(y)},[]);t.useEffect(()=>{if(!s)return;const y=h=>{if(document.querySelector(".sys-broker-page")&&!(Ps(h.target)||Bs())&&a!==0){if(h.key==="Escape"){o&&(h.preventDefault(),o(),w(-1));return}if(h.key==="ArrowDown"||h.key==="j"){h.preventDefault(),c(N=>Ye(N,a,1));return}if(h.key==="ArrowUp"||h.key==="k"){h.preventDefault(),c(N=>Ye(N,a,-1));return}if(h.key==="Home"||h.key==="g"&&!h.shiftKey){h.preventDefault(),c(0);return}if(h.key==="End"||h.key==="G"){h.preventDefault(),c(a-1);return}if(h.key==="Enter"||h.key===" "){const N=b<0?0:b;h.preventDefault(),c(N),n(N)}}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s,b,c,n,o,a,w]);const F=t.useCallback(y=>({tabIndex:b===y?0:-1,ref:h=>A(y,h),onFocus:()=>w(y)}),[b,A,w]);return{focusedIndex:b,setFocusedIndex:w,getRowFocusProps:F}}const xe=["all","delivered","failed"],ir=3e4,lr={all:"All",delivered:"Delivered",failed:"Failed"};function cr(s){switch(s){case"success":return"Success";case"failed_query":return"Query failure";case"failed_delivery":return"Delivery failure";default:return"Delivery attempt"}}function ds(s){return s.messageId??s.deliveryId??s.invocationId??s.id}function Le(s){switch(ze(s.kind,s.status)){case"success":return"Delivered";case"danger":return"Failed";case"working":return"Pending";case"warning":return"Held";default:return s.status?s.status.charAt(0).toUpperCase()+s.status.slice(1):"Queued"}}function Ie(s){if(!s)return"··";const a=s.trim().split(/\s+/).filter(Boolean);if(a.length===0)return"··";const n=a[a.length-1];return/^\d+$/.test(n)?n.slice(-2):a.length>=2?(a[0][0]+a[1][0]).toUpperCase():s.trim().slice(0,2).toUpperCase()}function dr(s){const a=ee(s)??0;return new Date(a).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Ae(s){const a=ee(s);return a===null?"—":new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Ce(s,a,n=0){if(!s||typeof s!="object"||Array.isArray(s)||n>3)return;const o=s;for(const f of a)if(o[f]!==void 0&&o[f]!==null)return o[f];for(const f of Object.values(o)){const u=Ce(f,a,n+1);if(u!==void 0)return u}}function z(s,...a){const n=Ce(s.metadata,a);return typeof n!="string"&&typeof n!="number"?null:String(n).trim()||null}function Re(s,...a){const n=Ce(s.metadata,a);return typeof n=="number"||typeof n=="string"?ee(n):null}function Pe(s){switch(s){case"dm":return"Direct · agent";case"channel":return"Channel";case"broadcast":return"Broadcast";case null:return"No route";default:return s.replaceAll("_"," ")}}function Be(s,a){if(a==="to")return s.route==="channel"?"Channel":s.route==="broadcast"?"Broadcast":s.target?.toLowerCase().includes("operator")?"Operator":"Agent lane";const n=z(s,"class","actorClass")?.toLowerCase();return n==="operator"||n==="human"?"Operator":n==="agent"?"Agent":s.actorName?.toLowerCase().includes("operator")?"Operator":"Sender"}function ss(s){const a=Ce(s.metadata,["latencyMs","durationMs"]);if(typeof a=="number"&&Number.isFinite(a)&&a>=0)return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(a<1e4?1:0)}s`;const n=Re(s,"sentAt","createdAt")??ee(s.ts),o=Re(s,"deliveredAt","completedAt");if(n===null||o===null||o<n)return"—";const f=o-n;return f<1e3?`${f}ms`:`${(f/1e3).toFixed(f<1e4?1:0)}s`}function Oe({route:s}){switch(s){case"channel":return e.jsx(sr,{size:12,"aria-hidden":"true"});case"broadcast":return e.jsx(Vs,{size:12,"aria-hidden":"true"});case"dm":return e.jsx(Ks,{size:12,"aria-hidden":"true"});default:return e.jsx(ls,{size:12,"aria-hidden":"true"})}}function ur(s,a){if(!a)return null;const n=a.trim().replace(/^@/,"").toLowerCase();return s.find(o=>[o.id,o.name,o.handle,o.selector,o.defaultSelector,o.conversationId,o.harnessSessionId].some(f=>f?.trim().replace(/^@/,"").toLowerCase()===n))??null}function rs(s,a,n){const o=n==="from"?s.actorName:s.target,f=ur(a,o),u=f?.name??o??(n==="from"?"Unknown":"No target"),b=f?"Agent":n==="to"&&s.conversationId?"Session route":Be(s,n);return{label:u,kind:b,agent:f}}function hr(s,a,n){const o=n.agent??a.agent;return[{label:"From",value:a.kind},{label:"To",value:n.kind},{label:"Target",value:s.target??n.label},{label:"Channel",value:Pe(s.route)},{label:"Project",value:o?.project??z(s,"project","projectName")},{label:"Branch",value:o?.branch??z(s,"branch")},{label:"Runtime",value:o?[o.harness,o.model,o.reasoningEffort].filter(Boolean).join(" · ")||null:[z(s,"harness"),z(s,"model")].filter(Boolean).join(" · ")||null},{label:"Machine",value:o?.authorityNodeName??o?.homeNodeName??o?.authorityNodeId??o?.homeNodeId??z(s,"machine","machineName","nodeName")}].filter(f=>!!f.value)}function as({party:s,route:a,side:n}){return e.jsxs("span",{className:`sys-broker-route-end sys-broker-route-end--${n}`,children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:s.agent||n==="from"?Ie(s.label):e.jsx(Oe,{route:a})}),e.jsx("span",{className:"sys-broker-endpoint-name",title:s.label,children:s.label})]})}function fr({attempt:s,agents:a}){const n=rs(s,a,"from"),o=rs(s,a,"to"),f=hr(s,n,o),u=`dispatch-route-${s.id}`;return e.jsxs("span",{className:"sys-broker-route",tabIndex:0,"aria-describedby":u,children:[e.jsx(as,{party:n,route:s.route,side:"from"}),e.jsx(Te,{className:"sys-broker-route-arrow",size:11,"aria-hidden":"true"}),e.jsx(as,{party:o,route:s.route,side:"to"}),e.jsxs("span",{className:"sys-broker-endpoint-card",id:u,role:"tooltip",children:[e.jsx("span",{className:"sys-broker-endpoint-card-head",children:e.jsxs("span",{className:"sys-broker-endpoint-card-edge",children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:Ie(n.label)}),e.jsx("strong",{children:n.label}),e.jsx(Te,{className:"sys-broker-route-arrow",size:11,"aria-hidden":"true"}),e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:o.agent?Ie(o.label):e.jsx(Oe,{route:s.route})}),e.jsx("strong",{children:o.label})]})}),e.jsx("span",{className:"sys-broker-endpoint-card-body",children:f.map(b=>e.jsxs("span",{className:"sys-broker-endpoint-card-field",children:[e.jsx("small",{children:b.label}),e.jsx("code",{title:b.value,children:b.value})]},b.label))})]})]})}function je(s){const a=ee(s)??0,n=new Date(a);return`${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`}function mr(s,a=Date.now()){const n=ee(s)??0,o=new Date(n),f=new Date(a),u=new Date(a);return u.setDate(u.getDate()-1),je(s)===je(f.getTime())?"Today":je(s)===je(u.getTime())?"Yesterday":o.toLocaleDateString(void 0,{month:"short",day:"numeric",year:o.getFullYear()===f.getFullYear()?void 0:"numeric"})}function pr(s,a,n){return{...a,source:s.source,attempts:[...s.attempts,...a.attempts],failedQueries:s.failedQueries,failedDeliveries:s.failedDeliveries,dialogue:s.dialogue,ledger:{...a.ledger,cursors:{...s.ledger.cursors,[n]:a.ledger.cursors[n]},hasMore:{...s.ledger.hasMore,[n]:a.ledger.hasMore[n]}}}}function br({navigate:s,embedded:a=!1,initialAttemptId:n}){qs("Dispatch",a);const{route:o,agents:f,selectedBrokerAttempt:u,inspectBrokerAttempt:b,clearBrokerAttempt:p}=ns(),[j]=t.useState(()=>Is(De(),ir)),[c,w]=t.useState(j),A=o.view==="broker"?o.filter??"all":"all",[F,y]=t.useState(j===null),[h,N]=t.useState(!1),[L,ce]=t.useState(!1),[O,T]=t.useState(null),H=t.useRef(j),M=t.useRef(0),q=t.useRef(null),Q=t.useCallback(async(l="initial")=>{const d=++M.current;!H.current&&l!=="background"?(y(!0),T(null)):N(!0);try{const g=await ie(De());if(d!==M.current)return;H.current=g,w(g),T(null)}catch(g){if(d!==M.current)return;T(g instanceof Error?g.message:String(g))}finally{d===M.current&&(y(!1),N(!1))}},[]),de=t.useCallback(async()=>{const l=H.current;if(!l||L)return;const d="attempts",g=l.ledger.cursors[d];if(!g||!l.ledger.hasMore[d])return;const S=++M.current;ce(!0),T(null);try{const K=await ie(De(g));if(S!==M.current)return;const E=H.current,re=E?pr(E,K,d):K;H.current=re,w(re)}catch(K){if(S!==M.current)return;T(K instanceof Error?K.message:String(K))}finally{S===M.current&&ce(!1)}},[L]),ne=t.useCallback(()=>{q.current||(q.current=setTimeout(()=>{q.current=null,Q("background")},250))},[Q]);t.useEffect(()=>(Q("initial"),()=>{q.current&&clearTimeout(q.current)}),[Q]),Cs(l=>{(l.kind==="message.posted"||l.kind==="delivery.planned"||l.kind==="delivery.attempted"||l.kind==="delivery.state.changed"||l.kind==="scout.dispatched")&&ne()});const v=t.useMemo(()=>{if(!c)return[];const l=new Map(c.dialogue.map(d=>[d.id,d.body]));return $s(c.attempts).map(d=>{const g=d.messageId?l.get(d.messageId):null;return g&&g!==d.detail?{...d,detail:g}:d})},[c]),R=t.useMemo(()=>{switch(A){case"delivered":return v.filter(l=>!le(l));case"failed":return v.filter(le);default:return v}},[A,v]),ue=c?.ledger.hasMore.attempts??!1,_=t.useMemo(()=>({all:v.length,delivered:v.filter(l=>!le(l)).length,failed:v.filter(le).length}),[v]),D=t.useMemo(()=>{const l=o.view==="broker"?o.attemptId:void 0;return!c||!l?null:v.find(d=>d.id===l)??c.attempts.find(d=>d.id===l)??c.failedQueries.find(d=>d.id===l)??c.failedDeliveries.find(d=>d.id===l)??null},[c,v,o]),he=D?`${D.id}\0${D.status}\0${D.ts}`:null,G=u?`${u.id}\0${u.status}\0${u.ts}`:null;t.useEffect(()=>{D&&he!==G&&b(D)},[G,b,D,he]);const[C,U]=t.useState(null),$=t.useRef(!1),V=t.useCallback(l=>{if(a){$.current=!0,U(l);return}b(l)},[a,b]),I=t.useCallback(()=>{if(a){$.current=!0,U(null);return}p()},[p,a]),se=t.useCallback(l=>{const d=R[l];d&&(V(d),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}})))},[R,V]),{getRowFocusProps:W,setFocusedIndex:Y}=or({enabled:!!c&&R.length>0,rowCount:R.length,onActivateRow:se,onClearSelection:I}),P=C?.id??null,oe=C?`${C.id} ${C.status} ${C.ts}`:null;t.useEffect(()=>{if(!a||!P)return;const l=v.find(d=>d.id===P);l&&`${l.id} ${l.status} ${l.ts}`!==oe&&U(l)},[a,P,oe,v]),t.useEffect(()=>{if(!a||!n||!c||$.current||C)return;const l=v.find(d=>d.id===n)??c.attempts.find(d=>d.id===n)??c.failedQueries.find(d=>d.id===n)??c.failedDeliveries.find(d=>d.id===n);l&&($.current=!0,U(l))},[c,a,C,v,n]),t.useEffect(()=>{const l=o.view==="broker"?o.attemptId:void 0;if(!l)return;const d=R.findIndex(g=>g.id===l);d>=0&&Y(d)},[R,A,o,Y]);const ve=t.useCallback(l=>{const g=(xe.indexOf(A)+l+xe.length)%xe.length,S=xe[g];s({view:"broker",...S==="all"?{}:{filter:S}})},[A,s]),fe=a?C:null;return e.jsx("div",{className:`s-ops${a?" s-ops--embedded":""}${fe?" s-ops--split":""}`,children:e.jsxs("div",{className:"s-ops-body",children:[e.jsxs("div",{className:"sys-surface-page sys-surface-page-wide sys-surface-page-fluid sys-broker-page",children:[e.jsxs("div",{className:"sys-ledger-toolbar","aria-label":"Dispatch controls",children:[c?e.jsx("div",{className:"sys-tab-row sys-tab-row--toolbar",role:"tablist","aria-label":"Dispatch message filters",onKeyDown:l=>{l.key==="ArrowRight"?(l.preventDefault(),ve(1)):l.key==="ArrowLeft"&&(l.preventDefault(),ve(-1))},children:xe.map(l=>e.jsxs("button",{type:"button",role:"tab","aria-selected":A===l,className:`sys-tab${A===l?" sys-tab-active":""}`,onClick:()=>s({view:"broker",...l==="all"?{}:{filter:l}}),children:[e.jsx("span",{children:lr[l]}),e.jsx("span",{className:"sys-tab-count",children:_[l]})]},l))}):e.jsx("div",{className:"sys-ledger-kicker",children:"Dispatch ledger"}),e.jsxs("div",{className:"sys-page-actions sys-ledger-actions",children:[e.jsx("div",{className:"sys-sync-note",children:F?"Loading dispatch ledger...":c?`Updated ${Fe(c.generatedAt)}${c.source?.latestMessageAt?` · latest message ${Fe(c.source.latestMessageAt)}`:""}`:"Waiting for dispatch data"}),e.jsx("button",{type:"button",className:"s-btn",disabled:F||h,onClick:()=>{Q("manual")},children:h?"Refreshing...":"Refresh"})]})]}),O&&e.jsxs("div",{className:"sys-banner sys-banner-warning",children:[e.jsx("strong",{children:"Refresh failed."}),e.jsx("span",{children:O})]}),h&&c&&e.jsxs("div",{className:"sys-broker-source-note",role:"status","aria-live":"polite",children:[e.jsx(ke,{className:"sys-broker-source-spinner",size:12,"aria-hidden":"true"}),e.jsx("strong",{children:"Updating dispatches…"})]}),!h&&c?.source?.mode==="sqlite_projection"&&c.source.status==="degraded"&&c.source.detail&&e.jsxs("div",{className:"sys-broker-source-note sys-broker-source-note--warning",role:"status","aria-label":c.source.detail,title:c.source.detail,children:[e.jsx("span",{className:"sys-broker-source-dot","aria-hidden":"true"}),e.jsx("strong",{children:c.source.brokerReachable?"Dispatch history is loading":"Dispatch may be out of date"}),e.jsx("span",{children:c.source.brokerReachable?"Broker online; showing saved dispatch history while live messages load.":"Live broker unavailable; showing saved dispatch history."})]}),F&&!c&&e.jsx("div",{className:"sys-broker-empty-wrap",children:e.jsx(Ee,{className:"sys-state-card-centered",icon:e.jsx(ke,{className:"sys-broker-source-spinner",size:24,"aria-hidden":"true"}),title:"Loading dispatch",body:"Reading the dispatch database snapshot."})}),!F&&!c&&!O&&e.jsx("div",{className:"sys-broker-empty-wrap",children:e.jsx(Ee,{className:"sys-state-card-centered",title:"No dispatch data",body:"No dispatch rows are available yet."})}),c&&e.jsxs(e.Fragment,{children:[e.jsx(yr,{attempts:R,agents:f,selectedAttemptId:a?C?.id??null:u?.id??(o.view==="broker"?o.attemptId??null:null),onInspect:V,getRowFocusProps:W}),R.length>0&&ue&&e.jsx("div",{className:"sys-ledger-footer",children:e.jsx("button",{type:"button",className:"s-btn",disabled:L,onClick:()=>{de()},children:L?"Loading older...":"Load older"})})]})]}),fe&&e.jsx("div",{className:"s-broker-embed-detail",children:e.jsx(us,{attempt:fe,navigate:s,onClose:I})})]})})}function yr({attempts:s,agents:a,selectedAttemptId:n,onInspect:o,getRowFocusProps:f}){if(s.length===0)return e.jsx("div",{className:"sys-broker-empty-wrap",children:e.jsx(Ee,{className:"sys-state-card-centered",title:"No dispatch rows",body:"No dispatch rows are available yet."})});const u=s.reduce((b,p,j)=>{const c=je(p.ts),w=b[b.length-1];return w?.key===c?w.attempts.push({attempt:p,index:j}):b.push({key:c,label:mr(p.ts),attempts:[{attempt:p,index:j}]}),b},[]);return e.jsxs("div",{className:"sys-broker-wire","aria-label":"Dispatch ledger",children:[e.jsxs("div",{className:"sys-broker-wire-head","aria-hidden":"true",children:[e.jsx("span",{className:"sys-broker-col sys-broker-col--route",children:"Route"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--msg",children:"Message"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--time",children:"Time"})]}),u.map(b=>e.jsxs("section",{className:"sys-broker-day","aria-labelledby":`dispatch-day-${b.key}`,children:[e.jsxs("header",{className:"sys-broker-day-head",children:[e.jsx("h2",{id:`dispatch-day-${b.key}`,children:b.label}),e.jsxs("span",{children:[b.attempts.length," ",b.attempts.length===1?"dispatch":"dispatches"]})]}),e.jsx("div",{className:"sys-broker-wire-body",role:"list",children:b.attempts.map(({attempt:p,index:j})=>{const c=ze(p.kind,p.status),w=le(p),A=!w&&(c==="working"||c==="warning"),F=os(p),y=Le(p),h=w?F:A?y:null,N=()=>{o(p),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}}))};return e.jsxs("div",{role:"listitem",className:`sys-broker-wire-row${w?" sys-broker-wire-row--failure":A?" sys-broker-wire-row--pending":""}${n===p.id?" sys-broker-wire-row--selected":""}`,"aria-label":`${y}. Inspect ${p.detail}`,onClick:N,...f(j),children:[e.jsx("div",{className:"sys-broker-cell sys-broker-col--route",children:e.jsx(fr,{attempt:p,agents:a})}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--msg",children:[e.jsx("span",{className:"sys-broker-msg",title:p.detail,children:p.detail}),h&&e.jsx("span",{className:`sys-broker-msg-error sys-broker-msg-error--${w?"danger":"warning"}`,title:h,children:h})]}),e.jsx("div",{className:"sys-broker-cell sys-broker-col--time",children:e.jsx("time",{className:"sys-broker-time-abs",title:`${Fe(p.ts)} · ${ts(p.ts)}`,children:dr(p.ts)})})]},p.id)})})]},b.key))]})}function gr(s){const a=ds(s);return[{label:"Kind",value:cr(s.kind)},{label:"Time",value:ts(s.ts)},{label:"Actor",value:s.actorName},{label:"Target",value:s.target},{label:"Route",value:s.route},{label:"Conversation",value:s.conversationId},{label:"Reference",value:a},{label:"Message",value:s.messageId===a?null:s.messageId},{label:"Delivery",value:s.deliveryId===a?null:s.deliveryId},{label:"Invocation",value:s.invocationId===a?null:s.invocationId}].filter(n=>!!n.value)}function J({value:s,subject:a,className:n}){const[o,f]=t.useState("idle"),u=t.useRef(null);t.useEffect(()=>{f("idle")},[s]),t.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const b=t.useCallback(async()=>{const c=await Rs(s);u.current&&clearTimeout(u.current),f(c?"copied":"failed"),u.current=setTimeout(()=>{f("idle"),u.current=null},1500)},[s]),p=o==="copied",j=o==="failed";return e.jsx("button",{type:"button",className:`sys-copy-btn${n?` ${n}`:""}${p?" sys-copy-btn--copied":""}${j?" sys-copy-btn--failed":""}`,onClick:()=>{b()},title:p?`Copied ${a}`:j?"Copy failed":`Copy ${a}`,"aria-label":p?`Copied ${a}`:j?`Copy ${a} failed`:`Copy ${a}`,children:p?e.jsx(Qs,{size:14,"aria-hidden":"true"}):e.jsx(Gs,{size:14,"aria-hidden":"true"})})}function xr(s){const a=s.trim();if(a.startsWith("{")||a.startsWith("["))try{return{code:JSON.stringify(JSON.parse(a),null,2),path:"payload.json",language:"JSON"}}catch{}return{code:s,path:"payload.md",language:"Text · Markdown"}}function jr({payload:s}){const a=t.useMemo(()=>xr(s),[s]),[n,o]=t.useState(!1),f=t.useRef(null),u=a.code.split(`
|
|
2
|
-
`).length;t.useEffect(()=>{const p=f.current;!p||!n||p.open||p.showModal()},[n]),t.useEffect(()=>{o(!1)},[s]);const b=e.jsx("div",{className:"sys-broker-payload-code","data-language":a.path==="payload.json"?"json":"markdown",role:"region","aria-label":`Dispatch payload, ${a.language}`,tabIndex:0,children:e.jsx(zs,{code:a.code,path:a.path})});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sys-broker-payload-head",children:[e.jsx("span",{className:"sys-detail-label",children:"Payload"}),e.jsxs("span",{className:"sys-broker-payload-meta",children:[a.language," · ",u," ",u===1?"line":"lines"]}),e.jsx(J,{value:s,subject:"payload"}),e.jsx("button",{type:"button",className:"sys-copy-btn sys-broker-payload-expand",onClick:()=>o(!0),title:"Expand payload","aria-label":"Expand payload",children:e.jsx(Ws,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-resizer",children:b}),n&&xs.createPortal(e.jsxs("dialog",{ref:f,className:"sys-broker-payload-dialog","aria-label":"Expanded dispatch payload",onCancel:p=>{p.preventDefault(),o(!1)},onClose:()=>o(!1),children:[e.jsxs("header",{className:"sys-broker-payload-dialog-head",children:[e.jsxs("div",{children:[e.jsx("span",{className:"sys-detail-label",children:"Dispatch payload"}),e.jsxs("span",{className:"sys-broker-payload-meta",children:[a.language," · ",u," ",u===1?"line":"lines"]})]}),e.jsx(J,{value:s,subject:"payload"}),e.jsx("button",{type:"button",className:"sys-copy-btn",onClick:()=>o(!1),title:"Return payload to inspector","aria-label":"Return payload to inspector",children:e.jsx(Ys,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-dialog-body",children:b})]}),document.body)]})}function kr({attempt:s}){const a=Ms(s);return e.jsxs("div",{className:"sys-broker-route-failure",role:"status",children:[e.jsx("span",{className:"sys-broker-route-failure-mark","aria-hidden":"true",children:e.jsx(Me,{size:14})}),e.jsxs("div",{children:[e.jsx("span",{className:"sys-detail-label",children:"Routing stopped"}),e.jsx("strong",{children:a}),e.jsx("p",{children:s.detail})]}),e.jsx(J,{value:s.detail,subject:"failure detail"})]})}function us({attempt:s,navigate:a,onClose:n}){const{route:o,agents:f,scoutbotAgentId:u}=ns(),b=gr(s),p=Ds(s.metadata),j=le(s),c=s.kind==="failed_query",w=os(s),A=ze(s.kind,s.status),F=Re(s,"sentAt","createdAt")??ee(s.ts),y=Re(s,"deliveredAt","completedAt")??ee(s.ts),h=ds(s),[N,L]=t.useState("idle"),[ce,O]=t.useState(null),[T,H]=t.useState(null),[M,q]=t.useState(!1),[Q,de]=t.useState(!1),[ne,v]=t.useState(""),[R,ue]=t.useState(""),[_,D]=t.useState("idle"),[he,G]=t.useState(null),[C,U]=t.useState(""),[$,V]=t.useState(""),[I,se]=t.useState(""),[W,Y]=t.useState(""),[P,oe]=t.useState("medium"),[ve,fe]=t.useState(null),[l,d]=t.useState([]),[g,S]=t.useState("idle"),[K,E]=t.useState(null),re=z(s,"harness"),we=z(s,"model"),Ne=z(s,"reasoningEffort","effort"),qe=t.useRef(null),_e=t.useRef(null),me=t.useMemo(()=>Es(s),[s]),k=t.useMemo(()=>f.filter(r=>!r.retiredFromFleet&&!r.staleLocalRegistration).slice().sort((r,i)=>r.id===u?-1:i.id===u?1:(i.updatedAt??0)-(r.updatedAt??0)||r.name.localeCompare(i.name)),[f,u]),pe=t.useMemo(()=>Fs(s,k)?.id??"",[s,k]),be=k.find(r=>r.id!==u)?.id??k[0]?.id??"",Se=k[0]?.id??"",ae=k.find(r=>r.id===be)??null,hs=t.useMemo(()=>{const r=new Map;for(const i of k){const m=i.projectRoot?.trim()||i.cwd?.trim();if(!m)continue;const x=m.split("/").filter(Boolean).at(-1)??m;r.set(m,i.project?.trim()||x)}return[...r.entries()].map(([i,m])=>({path:i,label:m}))},[k]),Ue=t.useRef({originalTargetAgentId:pe,firstRoutableAgentId:Se,defaultForwardAgentId:be,defaultForwardAgent:ae,effort:"medium"});Ue.current={originalTargetAgentId:pe,firstRoutableAgentId:Se,defaultForwardAgentId:be,defaultForwardAgent:ae,effort:z(s,"reasoningEffort","effort")||"medium"};const ye=t.useRef(!1);t.useEffect(()=>{const r=Ue.current;ye.current=!1,L("idle"),O(null),H(null),q(!1),de(!1),v(""),ue(r.originalTargetAgentId||r.firstRoutableAgentId),D("idle"),G(null),U(r.defaultForwardAgentId),V(r.defaultForwardAgent?.projectRoot?.trim()||r.defaultForwardAgent?.cwd?.trim()||""),se(r.defaultForwardAgent?.harness?.trim()||""),Y(r.defaultForwardAgent?.model?.trim()||""),oe(r.effort),d([]),S("idle"),E(null)},[s.id]),t.useEffect(()=>{ye.current||(ue(r=>r||pe||Se),U(r=>r||be),V(r=>r||ae?.projectRoot?.trim()||ae?.cwd?.trim()||""),se(r=>r||ae?.harness?.trim()||""),Y(r=>r||ae?.model?.trim()||""))},[ae,be,Se,pe]),t.useEffect(()=>{const r=new URLSearchParams({scope:"global+project"});$&&r.set("projectRoot",$);let i=!1;return ie(`/api/runner/options?${r.toString()}`).then(m=>{!i&&m.schemaVersion==="openscout.runtime-capabilities.v1"&&fe(m)}).catch(()=>{}),()=>{i=!0}},[$]);const fs=t.useCallback(()=>{q(!0),window.requestAnimationFrame(()=>qe.current?.focus())},[]),Ke=t.useCallback(()=>{q(!1),de(!1),v(""),d([]),S("idle"),E(null)},[]),ms=t.useCallback(async()=>{const r=k.find(i=>i.id===R);if(!(!r||_==="sending")){D("sending"),G(null);try{const i=await ie("/api/ask",{method:"POST",body:JSON.stringify({body:s.detail,targetAgentId:r.id,targetLabel:r.name,...re||we||Ne?{execution:{...re?{harness:re}:{},...we?{model:we}:{},...Ne?{reasoningEffort:Ne}:{},session:"new"}}:{},metadata:{source:"scout-dispatch-redispatch",originalDispatchId:s.id,...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),m=i.flightId??i.flight?.id;D("sent"),G(`New dispatch sent to ${r.name}${m?` · ${m}`:""}`)}catch(i){D("failed"),G(`Retry failed. ${i instanceof Error?i.message:String(i)}`)}}},[s,R,_,Ne,re,we,k]),Je=t.useCallback(async()=>{const r=ne.trim(),i=k.find(m=>m.id===C);if(!(!r||!i||g==="sending")){S("sending"),E(l.length>0?`Uploading ${l.length} ${l.length===1?"attachment":"attachments"}…`:null);try{const m=l.length>0?await ks(l):[],x=await ie("/api/ask",{method:"POST",body:JSON.stringify({body:`${r}
|
|
3
|
-
|
|
4
|
-
Attached dispatch context:
|
|
5
|
-
${me}`,targetAgentId:i.id,targetLabel:i.name,...m.length>0?{attachments:m}:{},execution:{...I?{harness:I}:{},...W?{model:W}:{},...P?{reasoningEffort:P}:{}},metadata:{source:"scout-dispatch-forward",originalDispatchId:s.id,...$?{targetProjectPath:$}:{},...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),X=x.flightId??x.flight?.id;S("sent"),E(`Request sent to ${i.name}${X?` · ${X}`:""}`),v(""),d([])}catch(m){S("failed"),E(`Request wasn't sent. ${m instanceof Error?m.message:String(m)}`)}}},[s,me,C,P,l,I,W,$,g,ne,k]),ps=t.useCallback(r=>{const i=r.filter(vs),m=r.length-i.length;i.length>0&&(d(x=>[...x,...i]),S("idle"),E(null)),m>0&&(S("failed"),E("Attach markdown, code, an image, or a video clip."))},[]),B=k.find(r=>r.id===R)??null,te=k.find(r=>r.id===C)??null,ge=k.filter(r=>$?(r.projectRoot?.trim()||r.cwd?.trim())===$:!0),He=ve??Ns,$e=t.useMemo(()=>{const r=ws(He),i=[W,te?.harness===I?te.model:null,...ge.filter(x=>x.harness===I).map(x=>x.model)].map(x=>x?.trim()).filter(x=>!!x);let m=r.harnesses;return m.some(x=>x.value===I)||(m=[{value:I,label:I||"default",models:[]},...m]),m=m.map(x=>{if(x.value!==I)return x;const X=x.models.some(Z=>Z.value==="")?x.models:[{value:"",label:"Default",note:"harness picks"},...x.models],gs=new Set(X.map(Z=>Z.value)),Ve=i.filter(Z=>!gs.has(Z)).map(Z=>({value:Z,label:Z,note:"observed"}));return Ve.length===0&&X===x.models?x:{...x,models:[...X,...Ve]}}),{...r,harnesses:m}},[He,te,I,W,ge]);t.useEffect(()=>{const r=Ss($e,I);!r||r.some(i=>i.value===P)||oe(r.find(i=>i.value==="medium")?.value??r[0]?.value??"")},[$e,I,P]);const Qe=j?"Investigate why this dispatch failed. Say what stopped it, whether anything was received, and propose a recovery: who should take it and what should happen next.":"Summarize this dispatch and what happened next. Flag anything that needs the operator.",bs=t.useCallback(async()=>{if(N==="sending")return;if(T){We(a,{view:"conversation",conversationId:T},{returnTo:o});return}const r=k.find(i=>i.id===u);if(!r){L("failed"),O("Scout isn't reachable right now.");return}L("sending"),O(null);try{const i=await ie("/api/ask",{method:"POST",body:JSON.stringify({body:`${Qe}
|
|
6
|
-
|
|
7
|
-
Attached dispatch context:
|
|
8
|
-
${me}`,targetAgentId:r.id,targetLabel:"Scout",metadata:{source:"scout-dispatch-investigate",originalDispatchId:s.id,...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),m=i.flightId??i.flight?.id;L("sent"),H(i.conversationId??null),O(i.conversationId?"Investigation started. Open it to follow along.":`Investigation sent to Scout${m?` · ${m}`:""}.`)}catch(i){L("failed"),O(`Investigation wasn't sent. ${i instanceof Error?i.message:String(i)}`)}},[s,me,T,Qe,N,a,k,o,u]),ys=t.useMemo(()=>{const r={state:Le(s),reference:h,channel:Pe(s.route),latency:ss(s),sent:Ae(F),[j?"failed":"delivered"]:Ae(y)};for(const i of b)r[i.label.toLowerCase()]=i.value;return JSON.stringify(r,null,2)},[s,y,j,h,b,F]),Ge=e.jsxs("div",{className:"sys-broker-action-row",children:[e.jsxs("div",{className:"sys-broker-action-line",children:[e.jsx("span",{className:"sys-broker-action-label",id:"dispatch-redispatch-title",children:"Retry"}),e.jsxs("div",{className:"sys-broker-redispatch-controls",children:[e.jsx("select",{"aria-label":"Retry destination",value:R,disabled:_==="sending"||k.length===0,onChange:r=>{ue(r.target.value),D("idle"),G(null)},children:k.length===0?e.jsx("option",{value:"",children:"No agents available"}):e.jsxs(e.Fragment,{children:[!R&&e.jsx("option",{value:"",children:"Original destination unavailable"}),k.map(r=>e.jsxs("option",{value:r.id,children:[r.id===u?"Scout":r.name,r.project?` · ${r.project}`:""]},r.id))]})}),e.jsxs("button",{type:"button",className:"sys-broker-redispatch-send",disabled:!B||_==="sending",onClick:()=>{ms()},children:[_==="sending"?e.jsx(ke,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(_s,{size:13,"aria-hidden":"true"}),_==="sending"?"Retrying…":"Retry dispatch"]})]})]}),B&&e.jsxs("div",{className:"sys-broker-action-target-meta",children:[B.harness&&e.jsx("span",{children:B.harness}),B.model&&e.jsx("span",{children:B.model}),(B.cwd??B.projectRoot)&&e.jsx("code",{children:B.cwd??B.projectRoot})]}),he&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${_}`,role:"status",children:he})]});return e.jsxs("aside",{className:"sys-panel sys-broker-inspector","aria-label":"Dispatch route inspector",children:[e.jsx("header",{className:"sys-broker-inspector-head",children:e.jsxs("div",{className:"sys-broker-inspector-status",children:[e.jsx("span",{className:`sys-broker-dot sys-broker-dot--${A}`,"aria-hidden":"true"}),e.jsx("strong",{className:`sys-broker-state sys-broker-state--${A}`,children:Le(s)}),e.jsx("code",{title:h,children:h}),e.jsx(J,{value:me,subject:"dispatch context",className:"sys-broker-inspector-copy"}),e.jsx("button",{type:"button",className:"sys-copy-btn sys-broker-inspector-close",onClick:n,title:"Close inspector","aria-label":"Close inspector",children:e.jsx(Me,{size:14,"aria-hidden":"true"})})]})}),e.jsxs("div",{className:"sys-broker-inspector-body",children:[e.jsxs("section",{className:"sys-broker-route-stack","aria-label":"Dispatch route",children:[e.jsxs("div",{className:"sys-broker-route-party",children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-route-avatar","aria-hidden":"true",children:Ie(s.actorName)}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["From · ",Be(s,"from")]}),e.jsx("strong",{children:s.actorName??"Unknown sender"})]}),s.actorName&&e.jsx(J,{value:s.actorName,subject:"sender"})]}),e.jsx(Zs,{className:"sys-broker-route-down",size:17,"aria-hidden":"true"}),e.jsxs("div",{className:"sys-broker-route-party",children:[e.jsx("span",{className:"sys-broker-route-target-icon","aria-hidden":"true",children:e.jsx(Oe,{route:s.route})}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["To · ",Be(s,"to")]}),e.jsx("code",{title:s.target??"No target",children:s.target??"No target"})]}),s.target&&e.jsx(J,{value:s.target,subject:"target"}),s.conversationId&&e.jsxs("button",{type:"button",className:"sys-broker-route-button",onClick:()=>We(a,{view:"conversation",conversationId:s.conversationId},{returnTo:o}),children:[e.jsx(Xe,{size:11,"aria-hidden":"true"}),"Route"]})]})]}),e.jsxs("section",{className:"sys-broker-payload",children:[c?e.jsx(kr,{attempt:s}):e.jsx(jr,{payload:s.detail}),j&&!c&&w&&e.jsxs("div",{className:"sys-broker-inspector-error",role:"status",children:[e.jsx("span",{className:"sys-broker-inspector-error-label",children:"Error"}),e.jsx("p",{children:w})]})]}),e.jsx(Ls,{attempt:s,targetAgentId:pe||null,navigate:a,returnTo:o}),e.jsxs("section",{className:"sys-broker-actions","aria-label":"Dispatch actions",children:[j&&Ge,e.jsxs("div",{className:"sys-broker-intents",children:[e.jsxs("button",{type:"button",className:`sys-broker-intent${j?"":" sys-broker-intent--primary"}`,disabled:N==="sending",onClick:()=>{bs()},children:[N==="sending"?e.jsx(ke,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):T?e.jsx(Xe,{size:13,"aria-hidden":"true"}):e.jsx(ls,{size:13,"aria-hidden":"true"}),N==="sending"?"Asking Scout…":T?"Open investigation":"Investigate with Scout"]}),e.jsxs("button",{type:"button",className:"sys-broker-intent","aria-expanded":M,onClick:()=>M?Ke():fs(),children:[e.jsx(Te,{size:13,"aria-hidden":"true"}),"Forward to agent…"]})]}),ce&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${N}`,role:"status",children:ce}),M&&e.jsxs("div",{className:"sys-broker-forward-draft",children:[e.jsxs("div",{className:"sys-broker-forward-draft-head",children:[e.jsx("span",{className:"sys-broker-action-label",children:"Forward to agent"}),e.jsx("button",{type:"button",className:"sys-broker-forward-discard",onClick:Ke,children:"Discard"})]}),e.jsxs("form",{className:"sys-broker-message-composer",onSubmit:r=>{r.preventDefault(),Je()},children:[e.jsx("textarea",{ref:qe,id:"dispatch-message-input","aria-label":"Forward message",value:ne,rows:3,placeholder:`What should ${te?.id===u?"Scout":te?.name??"this agent"} investigate or do?`,disabled:g==="sending",onChange:r=>{v(r.target.value),g!=="idle"&&(S("idle"),E(null))},onKeyDown:r=>{r.key==="Enter"&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),Je())}}),l.length>0&&e.jsx("div",{className:"sys-broker-composer-attachments","aria-label":"Attachments",children:l.map((r,i)=>e.jsxs("span",{children:[e.jsx(Us,{size:10,"aria-hidden":"true"}),e.jsx("span",{title:r.name,children:r.name}),e.jsx("button",{type:"button",onClick:()=>d(m=>m.filter((x,X)=>X!==i)),"aria-label":`Remove ${r.name}`,children:e.jsx(Me,{size:10,"aria-hidden":"true"})})]},`${r.name}:${r.size}:${i}`))}),e.jsxs("footer",{children:[e.jsxs("div",{className:"sys-broker-composer-left",children:[e.jsx("input",{ref:_e,type:"file",multiple:!0,hidden:!0,disabled:g==="sending",onChange:r=>{ps([...r.target.files??[]]),r.target.value=""}}),e.jsx("button",{type:"button",className:"sys-broker-composer-attach",disabled:g==="sending",onClick:()=>_e.current?.click(),"aria-label":"Attach files",title:"Attach files",children:e.jsx(Js,{size:16,"aria-hidden":"true"})}),e.jsx("span",{className:"sys-broker-message-attachment",title:h,children:"Context + payload attached"})]}),e.jsxs("div",{className:"sys-broker-composer-targets",children:[e.jsx("span",{className:"sys-broker-composer-route-label",children:"To"}),e.jsxs("label",{title:"Forward target",children:[e.jsx("span",{children:"Agent"}),e.jsx("select",{"aria-label":"Forward target",value:C,disabled:g==="sending"||ge.length===0,onChange:r=>{const i=k.find(m=>m.id===r.target.value)??null;ye.current=!0,U(r.target.value),i&&(V(i.projectRoot?.trim()||i.cwd?.trim()||""),se(i.harness?.trim()||""),Y(i.model?.trim()||"")),S("idle"),E(null)},children:ge.length===0?e.jsx("option",{value:"",children:"No agents"}):ge.map(r=>e.jsx("option",{value:r.id,children:r.id===u?"Scout":r.name},r.id))})]}),e.jsxs("button",{type:"button",className:"sys-broker-forward-adjust-toggle","aria-expanded":Q,onClick:()=>de(r=>!r),children:["Adjust",e.jsx(Ze,{size:11,"aria-hidden":"true"})]}),e.jsx(js,{className:"sys-broker-composer-mic",disabled:g==="sending",onAppend:r=>v(i=>i.trim()?`${i.trimEnd()} ${r}`:r),onError:r=>{S("failed"),E(r)}})]}),e.jsx("button",{type:"submit",className:"sys-broker-composer-send",disabled:!ne.trim()||!te||g==="sending","aria-label":`Ask ${te?.name??"recipient"} about this dispatch`,children:g==="sending"?e.jsx(ke,{size:14,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(Hs,{size:14,"aria-hidden":"true"})})]}),Q&&e.jsxs("div",{className:"sys-broker-composer-targets sys-broker-forward-adjust",children:[e.jsxs("label",{title:"Project target",children:[e.jsx("span",{children:"Project"}),e.jsxs("select",{"aria-label":"Project target",value:$,disabled:g==="sending",onChange:r=>{const i=r.target.value,m=k.find(x=>!i||(x.projectRoot?.trim()||x.cwd?.trim())===i)??null;ye.current=!0,V(i),m&&(U(m.id),se(m.harness?.trim()||""),Y(m.model?.trim()||""))},children:[e.jsx("option",{value:"",children:"Any project"}),hs.map(r=>e.jsx("option",{value:r.path,children:r.label},r.path))]})]}),e.jsx(As,{catalog:$e,value:{harness:I,model:W,effort:P},onChange:r=>{ye.current=!0,se(r.harness),Y(r.model),oe(r.effort)},disabled:g==="sending"})]})]}),K&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${g}`,role:"status",children:K})]})]}),e.jsxs("details",{className:"sys-broker-technical",children:[e.jsxs("summary",{children:[e.jsx("span",{children:"Technical details"}),e.jsx(Ze,{size:13,"aria-hidden":"true"})]}),e.jsxs("dl",{className:"sys-broker-delivery-grid",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Channel"}),e.jsx("dd",{children:Pe(s.route)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Latency"}),e.jsx("dd",{className:"sys-broker-delivery-accent",children:ss(s)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Sent"}),e.jsx("dd",{children:Ae(F)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:j?"Failed":"Delivered"}),e.jsx("dd",{children:Ae(y)})]})]}),e.jsxs("div",{className:"sys-broker-record-head",children:[e.jsx("span",{className:"sys-detail-label",children:"Record"}),e.jsx(J,{value:ys,subject:"record as JSON",className:"sys-broker-metadata-copy"})]}),e.jsx("div",{className:"sys-broker-inspector-rows",children:b.map(r=>e.jsxs("div",{className:"sys-broker-inspector-row",children:[e.jsx("span",{className:"sys-detail-label",children:r.label}),e.jsx("code",{className:"sys-detail-value",children:r.value}),e.jsx(J,{value:r.value,subject:r.label.toLowerCase()})]},r.label))}),e.jsxs("div",{className:"sys-broker-metadata",children:[e.jsxs("div",{className:"sys-broker-metadata-head",children:[e.jsx("span",{className:"sys-detail-label",children:"Metadata"}),e.jsx(J,{value:p,subject:"metadata",className:"sys-broker-metadata-copy"})]}),e.jsx(Ts,{metadata:s.metadata,rawJson:p})]}),!j&&Ge]})]})]})}const vr=Os({id:"dispatch",label:"Dispatch",route:{view:"broker"},webPath:"/dispatch",screen:"BrokerScreen",embed:{path:"/embed/dispatch",profile:"macos.dispatch",rootClassName:"s-broker-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},ownsInternalRoutes:!0,resolveEmbedProps:s=>{const a=s.get("attempt")?.trim();return a?{initialAttemptId:a}:{}},hosts:{macos:!0}}}),oa=Object.freeze(Object.defineProperty({__proto__:null,BrokerAttemptInspector:us,BrokerScreen:br,scoutSurface:vr},Symbol.toStringTag,{value:"Module"}));export{us as B,br as a,De as b,oa as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as i}from"./index-EsrkGBcv.js";const _=({panOffset:h,scale:a,onPan:R,onPanStart:E,onPanEnd:u,isPanLocked:d=!1,onClick:k,showGuides:g=!1,onGuidesChange:$,gridOpacity:C=1})=>{const[B,X]=n.useState(g),[G,K]=n.useState(!1),o=n.useRef(!1),v=n.useRef({x:0,y:0}),r=n.useRef({active:!1,startX:0,startY:0}),j=n.useRef(null),x=n.useRef(null),y=n.useRef(null),A=4,H=n.useRef({x:0,y:0}),w=n.useRef(0),b=n.useRef(!1);n.useEffect(()=>{X(g)},[g]);const Y=n.useCallback(e=>{const s=e;return s?s.tagName==="INPUT"||s.tagName==="TEXTAREA"||s.isContentEditable:!1},[]),z=n.useCallback(e=>{const s=e;return s?!!s.closest('button, [role="button"], a, input, textarea, select, [data-interactive="true"]'):!1},[]),c=n.useCallback(e=>{o.current=e,K(e)},[]);n.useEffect(()=>{const e=t=>{if(w.current=t.buttons,r.current.active&&(t.buttons&1)!==1&&(r.current.active=!1),o.current&&(t.buttons&1)!==1){c(!1),r.current.active=!1,u?.(),document.body.style.cursor="";return}if(d&&o.current){c(!1),r.current.active=!1,u?.(),document.body.style.cursor="";return}const l=j.current?.getBoundingClientRect(),f=l?t.clientX-l.left:t.clientX,V=l?t.clientY-l.top:t.clientY;if(H.current={x:f,y:V},x.current&&(x.current.style.left=`${f}px`),y.current&&(y.current.style.top=`${V}px`),r.current.active&&!o.current){const P=t.clientX-r.current.startX,Q=t.clientY-r.current.startY;Math.hypot(P,Q)>=A&&(r.current.active=!1,c(!0),b.current=!0,E?.(),v.current={x:t.clientX,y:t.clientY},document.body.style.cursor="grabbing")}o.current&&(R({x:(t.clientX-v.current.x)/a,y:(t.clientY-v.current.y)/a}),v.current={x:t.clientX,y:t.clientY})},s=t=>{w.current=t.buttons,r.current.active=!1,o.current&&(c(!1),u?.(),document.body.style.cursor="")},I=t=>{(t.metaKey||t.ctrlKey)&&t.key==="\\"&&(t.preventDefault(),X(l=>{const f=!l;return $?.(f),f}))},m=()=>{r.current.active=!1,s(new MouseEvent("mouseup"))};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",s),window.addEventListener("keydown",I),window.addEventListener("blur",m),document.addEventListener("visibilitychange",m),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",s),window.removeEventListener("keydown",I),window.removeEventListener("blur",m),document.removeEventListener("visibilitychange",m)}},[R,u,E,a,Y,z,d,c,$]),n.useEffect(()=>{!d||!o.current||(c(!1),u?.(),document.body.style.cursor="")},[d,u,c]);const U=e=>{b.current=!1,!(d||e.button!==0)&&(Y(e.target)||z(e.target)||(w.current=e.buttons,r.current={active:!0,startX:e.clientX,startY:e.clientY},e.preventDefault()))},F=e=>{!b.current&&k&&k(e),b.current=!1},[M,W]=n.useState({w:0,h:0});n.useEffect(()=>{const e=()=>W({w:window.innerWidth,h:window.innerHeight});return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const S=Math.max(.4,Math.min(2,a)),p=100*S,L=20*S,q="var(--hud-canvas-dot-minor)",J="var(--hud-canvas-dot-major)",N="color-mix(in srgb, oklch(var(--accent)) 18%, transparent)",T=(M.w/2+h.x*a)%p,D=(M.h/2+h.y*a)%p;return i.jsxs("div",{ref:j,className:`absolute inset-0 z-0 overflow-hidden bg-background ${G?"cursor-grabbing":"cursor-grab"}`,onMouseDown:U,onClick:F,children:[i.jsx("div",{className:"absolute pointer-events-none",style:{inset:"-100px",opacity:.8*C,transition:"opacity 1s ease",backgroundImage:`radial-gradient(circle, ${q} 1px, transparent 1px)`,backgroundSize:`${L}px ${L}px`,backgroundPosition:`${T+100}px ${D+100}px`}}),i.jsx("div",{className:"absolute pointer-events-none",style:{inset:"-100px",opacity:.45*C,transition:"opacity 1s ease",backgroundImage:`radial-gradient(circle, ${J} 1.5px, transparent 1.5px)`,backgroundSize:`${p}px ${p}px`,backgroundPosition:`${T+100}px ${D+100}px`}}),B&&i.jsxs(i.Fragment,{children:[i.jsx("div",{ref:x,className:"absolute top-0 bottom-0 w-px pointer-events-none",style:{left:0,backgroundColor:N}}),i.jsx("div",{ref:y,className:"absolute left-0 right-0 h-px pointer-events-none",style:{top:0,backgroundColor:N}})]})]})};export{_ as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as t}from"./index-EsrkGBcv.js";import{u as V}from"./ComposerAttachments-DW0AIb8k.js";import{ChatRichInput as X}from"./ChatRichInput-DhtwFxQE.js";import{u as G}from"./chat-transport-DNS5CB2I.js";import{MemberAvatar as v}from"./ChatAvatar-C3a_o5Hj.js";import{w as R,d as H,b as k,a as L,E as J}from"./chat-space-model-aW3Fd8_U.js";import{X as Y}from"./x-DAehov0E.js";import{P as Z,A as T}from"./paperclip-BjcuP_Hx.js";import{c as M}from"./createLucideIcon-zZ8Hx7er.js";import{C as ee}from"./chevron-down-l1mrh5S9.js";import{L as te}from"./loader-circle-OvccU82H.js";import"./media-blobs-Bi8pxr1u.js";import"./api-DSqpVKC7.js";import"./file-text-CnISiiw6.js";import"./message-markup-BQW5jdJw.js";import"./chat-api-DSJMBYoT.js";import"./SpriteAvatar-CpZWf54-.js";import"./agent-state-DDhnFEEP.js";import"./colors-CFlbwC25.js";const ae=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],se=M("arrow-up",ae);const oe=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],ne=M("bold",oe);const re=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],le=M("code",re);const ie=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],ce=M("italic",ie);const pe=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],he=M("list",pe);function O(l,o){const d=l.slice(0,o),i=d.lastIndexOf("@");if(i<0||i>0&&!/\s/u.test(d[i-1]??""))return null;const u=d.slice(i+1);return/\n/u.test(u)||u.split(" ").length>3?null:{start:i,text:u}}function de(l,o){const d=Math.max(0,Math.min(o,l.length)),i=l.slice(0,d),u=i.length>0&&!/\s$/u.test(i)?" ":"",N=`${i}${u}@`;return{next:`${N}${l.slice(d)}`,caret:N.length}}function Pe({members:l,draft:o,onDraftChange:d,askTargetId:i,onAskTargetChange:u,onSend:N,sending:r,error:E,placeholder:q,variant:b="channel",autoFocus:W=!1}){const c=n.useRef(null),F=n.useRef(null),[m,j]=n.useState(null),[w,$]=n.useState(0),[C,D]=n.useState(!1),p=G(),s=V(),I=n.useMemo(()=>p.asks?l.filter(R):[],[p.asks,l]),B=n.useMemo(()=>l.filter(H),[l]),x=n.useMemo(()=>l.find(e=>e.actorId===i)??null,[l,i]),f=n.useMemo(()=>{if(!m)return[];const e=m.text.trim().toLowerCase();return[...l.filter(h=>k(h).toLowerCase().includes(e)||h.displayName.toLowerCase().includes(e))].sort((h,y)=>Number(L(y))-Number(L(h))).slice(0,8)},[l,m]);n.useEffect(()=>{$(0)},[m?.text]),n.useEffect(()=>{W&&c.current?.focus()},[W]);const S=n.useCallback(e=>{D(!1),e==="toggle"?F.current?.focus():c.current?.focus()},[]),z=n.useCallback(e=>{const a=c.current,h=a?.textBeforeCaret()??o,y=m??O(h,h.length),g=k(e);a?y?a.replaceMention(y.start,g):a.insertText(`${h.endsWith(" ")||h===""?"":" "}@${g} `):d(`${o}${o.endsWith(" ")||o===""?"":" "}@${g} `),p.asks&&R(e)&&u(e.actorId),j(null)},[p.asks,o,u,d,m]),Q=n.useCallback(()=>{const e=c.current,a=e?.textBeforeCaret()??o,h=a.length>0&&!/\s$/u.test(a)?" ":"";if(e?.insertText(`${h}@`),e){const y=e.textBeforeCaret();j({start:Math.max(0,y.length-1),text:""})}else{const{next:y,caret:g}=de(o,o.length);d(y),j({start:g-1,text:""})}D(!1),requestAnimationFrame(()=>c.current?.focus())},[o,d]),A=!r&&(o.trim().length>0||s.hasFiles),P=n.useCallback(()=>{if(r||!o.trim()&&!s.hasFiles)return;const e=s.files;Promise.resolve(N(e)).then(a=>{a!==!1&&s.clear()})},[s,o,N,r]),U=n.useCallback(e=>{if(!(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)){if(m&&f.length>0){if(e.key==="ArrowDown"){e.preventDefault(),$(a=>(a+1)%f.length);return}if(e.key==="ArrowUp"){e.preventDefault(),$(a=>(a-1+f.length)%f.length);return}if(e.key==="Enter"||e.key==="Tab"){e.preventDefault();const a=f[w];a&&z(a);return}if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),j(null);return}}if(e.key==="Escape"&&C){e.preventDefault(),e.stopPropagation(),D(!1);return}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="b"){e.preventDefault(),c.current?.applyFormat("bold");return}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="i"){e.preventDefault(),c.current?.applyFormat("italic");return}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="e"){e.preventDefault(),c.current?.applyFormat("code");return}e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),A&&P())}},[w,z,A,f,C,m,r,P]),_=J(x?k(x):null),K=x?`Send — asks ${k(x)}`:b==="thread"?"Send reply":"Send to the channel";return t.jsxs("div",{className:"chat-composer","data-variant":b,"data-drag":p.attachments&&s.dragActive?"true":void 0,...p.attachments?s.dropHandlers:{},children:[b==="channel"&&x?t.jsxs("div",{className:"chat-ask-target",children:[t.jsx("span",{className:"label-sm",style:{color:"var(--dim)"},children:"Asking"}),t.jsxs("span",{className:"chip chip--sm chip--mono chip--neutral",children:[t.jsx(v,{member:x,size:14}),k(x)]}),t.jsx("button",{type:"button",className:"chat-ask-target-clear",onClick:()=>u(null),"aria-label":"Clear ask target — send as a channel update instead",children:"×"}),_?t.jsx("span",{className:"chat-composer-hint",children:_}):null]}):null,t.jsx(X,{ref:c,value:o,placeholder:q,disabled:r,onChange:e=>{d(e);const a=c.current?.textBeforeCaret()??e;j(O(a,a.length))},onKeyDown:U,onPaste:p.attachments?s.onPaste:void 0,onDragOver:p.attachments?s.dropHandlers.onDragOver:void 0,onDrop:p.attachments?s.dropHandlers.onDrop:void 0,onBlur:()=>j(null)}),p.attachments?t.jsxs(t.Fragment,{children:[t.jsx("input",{ref:s.inputRef,type:"file",multiple:!0,accept:"image/*,video/*,audio/*,.mp4,.webm,.mov,.mp3,.wav,.m4a,.html,.htm,text/html,text/markdown,.md,.markdown,text/plain,.txt",className:"chat-composer-file-input","aria-hidden":"true",tabIndex:-1,onChange:e=>{s.stage([...e.target.files??[]]),e.target.value=""}}),s.files.length>0?t.jsx("div",{className:"chat-composer-files","aria-label":"Attached files",children:s.files.map(e=>t.jsxs("span",{className:"chat-composer-file",children:[t.jsx("span",{children:e.name}),t.jsx("button",{type:"button","aria-label":`Remove ${e.name}`,onClick:()=>s.remove(e),children:t.jsx(Y,{size:12,strokeWidth:2,"aria-hidden":!0})})]},`${e.name}:${e.size}:${e.lastModified}`))}):null,s.error?t.jsx("p",{className:"chat-send-error",role:"alert",children:s.error}):null]}):null,m&&f.length>0?t.jsx("div",{className:"chat-mention-popup",role:"listbox","aria-label":"Mention a member",children:f.map((e,a)=>t.jsxs("button",{type:"button",role:"option","aria-selected":a===w,"data-active":a===w,className:"chat-mention-option",onMouseDown:h=>{h.preventDefault(),z(e)},children:[t.jsx(v,{member:e,size:18}),k(e),t.jsx("span",{className:"chat-mention-kind",children:H(e)?"via API":L(e)?"agent":"person"})]},e.actorId))}):null,C&&b==="channel"&&p.asks?t.jsx("div",{className:"chat-mention-popup",role:"listbox","aria-label":"Choose an agent to ask",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),S("toggle"))},children:I.length===0&&B.length===0?t.jsx("div",{className:"chat-side-empty",children:"No agent has joined this channel yet. Invite one from the Invite sheet."}):t.jsxs(t.Fragment,{children:[I.map(e=>t.jsxs("button",{type:"button",role:"option","aria-selected":e.actorId===i,"data-active":e.actorId===i,className:"chat-mention-option",onClick:()=>{u(e.actorId),S("input")},children:[t.jsx(v,{member:e,size:18}),k(e),t.jsx("span",{className:"chat-mention-kind",children:e.reception.summary.toLowerCase()})]},e.actorId)),B.map(e=>t.jsxs("button",{type:"button",role:"option","aria-selected":!1,"aria-disabled":"true",disabled:!0,className:"chat-mention-option",children:[t.jsx(v,{member:e,size:18}),k(e),t.jsx("span",{className:"chat-mention-kind",children:"via API — post to reach it"})]},e.actorId)),I.length===0?t.jsx("div",{className:"chat-side-empty",children:"API participants read posts when they poll. Send a channel message instead."}):null]})}):null,E?t.jsx("p",{className:"chat-send-error",role:"alert",children:E}):null,t.jsxs("div",{className:"chat-composer-foot",children:[t.jsxs("span",{className:"chat-composer-tools",children:[p.attachments?t.jsx("button",{type:"button",className:"chat-composer-tool chat-composer-tool--icon",onClick:s.openPicker,disabled:r,"aria-label":"Attach a file",title:"Attach a file",children:t.jsx(Z,{size:14,strokeWidth:2,"aria-hidden":!0})}):null,t.jsx("button",{type:"button",className:"chat-composer-tool chat-composer-tool--icon",onClick:Q,disabled:r,"aria-label":"Mention a member",title:"Mention a member",children:t.jsx(T,{size:14,strokeWidth:2,"aria-hidden":!0})}),t.jsx("button",{type:"button",className:"chat-composer-tool chat-composer-tool--icon",onMouseDown:e=>{e.preventDefault(),c.current?.applyFormat("bold")},disabled:r,"aria-label":"Bold",title:"Bold",children:t.jsx(ne,{size:14,strokeWidth:2,"aria-hidden":!0})}),t.jsx("button",{type:"button",className:"chat-composer-tool chat-composer-tool--icon",onMouseDown:e=>{e.preventDefault(),c.current?.applyFormat("italic")},disabled:r,"aria-label":"Italic",title:"Italic",children:t.jsx(ce,{size:14,strokeWidth:2,"aria-hidden":!0})}),t.jsx("button",{type:"button",className:"chat-composer-tool chat-composer-tool--icon",onMouseDown:e=>{e.preventDefault(),c.current?.applyFormat("code")},disabled:r,"aria-label":"Code",title:"Code",children:t.jsx(le,{size:14,strokeWidth:2,"aria-hidden":!0})}),t.jsx("button",{type:"button",className:"chat-composer-tool chat-composer-tool--icon",onMouseDown:e=>{e.preventDefault(),c.current?.applyFormat("list")},disabled:r,"aria-label":"List",title:"List",children:t.jsx(he,{size:14,strokeWidth:2,"aria-hidden":!0})}),b==="channel"&&p.asks?t.jsxs("button",{ref:F,type:"button",className:"chat-composer-tool","data-active":C,"aria-expanded":C,"aria-haspopup":"listbox",disabled:r,onClick:()=>D(e=>!e),children:[x?"Change agent":"Ask an agent",t.jsx(ee,{size:12,strokeWidth:2,"aria-hidden":!0})]}):null]}),t.jsxs("span",{className:"chat-composer-right",children:[t.jsx("span",{className:"chat-enter",children:b==="thread"?"↵ send":"↵ send · ⇧↵ newline"}),t.jsx("button",{type:"button",className:"chat-composer-send",onClick:P,disabled:!A,"aria-label":r?"Sending…":K,title:r?"Sending…":K,children:r?t.jsx(te,{size:15,strokeWidth:2.2,className:"chat-composer-spin","aria-hidden":!0}):t.jsx(se,{size:16,strokeWidth:2.4,"aria-hidden":!0})})]})]})]})}export{Pe as ChannelComposer,de as mentionInsertion};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./index-EsrkGBcv.js";import{u as G}from"./chat-transport-DNS5CB2I.js";import{MemberAvatar as F}from"./ChatAvatar-C3a_o5Hj.js";import{ChannelComposer as J}from"./ChannelComposer-DoK7IDGa.js";import{Turn as O,Field as x,CopyAction as Q,ReceptionBlock as U}from"./ChatBits-CsvxbToF.js";import{c as V,m as X,a as f,b,d as Y,e as Z,f as _,g as E,h as ee,j as ae,k as se,l as ne}from"./chat-space-model-aW3Fd8_U.js";import"./chat-api-DSJMBYoT.js";import"./api-DSqpVKC7.js";import"./SpriteAvatar-CpZWf54-.js";import"./agent-state-DDhnFEEP.js";import"./colors-CFlbwC25.js";import"./ComposerAttachments-DW0AIb8k.js";import"./media-blobs-Bi8pxr1u.js";import"./file-text-CnISiiw6.js";import"./createLucideIcon-zZ8Hx7er.js";import"./ChatRichInput-DhtwFxQE.js";import"./message-markup-BQW5jdJw.js";import"./x-DAehov0E.js";import"./paperclip-BjcuP_Hx.js";import"./chevron-down-l1mrh5S9.js";import"./loader-circle-OvccU82H.js";import"./clipboard-e3fSpeo7.js";import"./MessageEmbeds-ksPazAKH.js";import"./chat-message-markup-91DIry6R.js";function te(s){return s.length>12?`…${s.slice(-8)}`:s}function le({member:s,viewerActorId:r,onOpen:c}){const n=E(s,r),o=s.reception.state==="disconnected"||s.reception.state==="unavailable";return e.jsxs("button",{type:"button",className:"chat-member-row",onClick:()=>c(s.actorId),children:[e.jsx(F,{member:s,size:24}),e.jsx("span",{className:"chat-member-name",children:b(s)}),n?e.jsx("span",{className:"chat-member-fact","data-stranded":o&&n!=="you",children:n}):null]})}function ce({invite:s,nowMs:r,onRevoke:c,busy:n,canRevoke:o}){const d=ee(s),p=s.invitee?.displayName?.trim(),t=ae(s.expiresAt,r);return e.jsxs("div",{className:"chat-invite-row",children:[e.jsx("span",{className:"chat-token-hint",children:se(s.tokenHint)}),e.jsx("span",{children:[ne(d),p?`for ${p}`:null,t].filter(Boolean).join(" · ")}),o?e.jsx("button",{type:"button",className:"chat-invite-revoke",disabled:n,onClick:()=>c(s.id),children:"Revoke"}):s.state==="active"?e.jsx("span",{}):e.jsx("span",{className:"chat-invite-revoke","aria-hidden":"false",children:s.state})]})}function Le({view:s,channel:r,members:c,membersById:n,invites:o,inviteError:d,revokingInviteId:p,viewerActorId:t,viewerIsOperator:L,nowMs:h,threadRoot:j,threadReplies:k,threadRequest:P,threadDraft:$,onThreadDraftChange:w,onSendThreadReply:B,onReact:v,onCopyLink:g,onStopAsk:H,focusMessageId:y,threadSending:M,threadError:S,onClose:u,onBack:z,onOpenMember:D,onMention:K,onRevokeInvite:q,onInvite:C,overlay:N}){const I=G();if(s.kind==="none")return null;const T=V(r.title);if(s.kind==="thread")return e.jsxs("aside",{className:"chat-rpanel","data-overlay":N,"aria-label":"Thread",children:[e.jsxs("header",{className:"chat-rpanel-head",children:[e.jsx("span",{className:"chat-rpanel-title",children:"Thread"}),e.jsx("span",{className:"chat-rpanel-scope",children:T}),e.jsx("button",{type:"button",className:"chat-rpanel-close",onClick:u,"aria-label":"Close panel",children:"×"})]}),e.jsxs("div",{className:"chat-rpanel-body",children:[j?e.jsx("div",{className:"chat-anchor-msg",children:e.jsx(O,{message:j,members:n,nowMs:h,request:P,withTargetOnChip:!1,onReact:v,onCopyLink:g,onStopAsk:H,focused:y===j.id})}):e.jsx("p",{className:"chat-feed-notice",children:"This thread's anchor message is no longer in the channel feed."}),k.map(a=>e.jsx(O,{message:a,members:n,nowMs:h,onReact:v,onCopyLink:g,focused:y===a.id},a.id)),k.length===0&&j?e.jsx("p",{className:"chat-feed-notice",children:"No replies yet."}):null,e.jsx("div",{className:"chat-thread-composer",children:e.jsx(J,{members:c,draft:$,onDraftChange:w,askTargetId:null,onAskTargetChange:()=>{},onSend:B,sending:M,error:S,placeholder:"Reply in thread…",variant:"thread"})})]})]});if(s.kind==="member"){const a=X(n,s.actorId),i=f(a),m=a.owner?.displayName?.trim()??null,l=a.reception.attachedSessionId,W=i&&a.owner?.actorId===t;return e.jsxs("aside",{className:"chat-rpanel","data-overlay":N,"aria-label":"Member",children:[e.jsxs("header",{className:"chat-rpanel-head",children:[e.jsx("button",{type:"button",className:"chat-rpanel-back",onClick:z,"aria-label":"Back to members",children:"‹"}),e.jsx("span",{className:"chat-rpanel-title",children:"Member"}),e.jsx("button",{type:"button",className:"chat-rpanel-close",onClick:u,"aria-label":"Close panel",children:"×"})]}),e.jsxs("div",{className:"chat-rpanel-body",children:[e.jsxs("div",{className:"chat-mcard-head",children:[e.jsx(F,{member:a,size:32}),e.jsxs("div",{children:[e.jsx("div",{className:"chat-mcard-name",children:b(a)}),e.jsx("div",{className:"chat-mcard-sub",children:[i?"agent":a.kind==="unknown"?"former member":"person",Y(a)?"via API":null,m?`owned by ${m}`:null,a.actorId===t?"you":null].filter(Boolean).join(" · ")})]})]}),a.harness||a.projectRoot||l||a.nodeId?e.jsxs("div",{className:"chat-psec chat-kv",children:[a.harness?e.jsx(x,{label:"Harness",children:[a.harness,a.model].filter(Boolean).join(" · ")}):null,a.projectRoot?e.jsx(x,{label:"Project",children:a.projectRoot}):null,l?e.jsxs(x,{label:"Session",children:[te(l),e.jsx(Q,{value:l,label:"copy",className:"chat-copy-inline",copiedLabel:"ok"})]}):null,a.nodeId?e.jsx(x,{label:"Node",children:a.nodeId}):null]}):null,i?e.jsxs("div",{className:"chat-psec",children:[e.jsx(U,{member:a,nowMs:h}),a.reception.redeemedAt?e.jsx("span",{className:"chat-conn-evidence",children:`joined ${Z(a.reception.redeemedAt,h)}`}):null]}):null,e.jsxs("div",{className:"chat-psec",style:{display:"flex",gap:"var(--space-sm)",flexWrap:"wrap"},children:[e.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>K(a.actorId),children:"Mention"}),W||a.actorId===t?e.jsx("button",{type:"button",className:"btn btn--sm",onClick:C,children:"Copy agent invitation"}):null]})]})]})}const A=[...c].sort((a,i)=>{const m=Number(f(a)),l=Number(f(i));return m!==l?m-l:b(a).localeCompare(b(i))}),R=o.filter(a=>a.state==="active");return e.jsxs("aside",{className:"chat-rpanel","data-overlay":N,"aria-label":"Members",children:[e.jsxs("header",{className:"chat-rpanel-head",children:[e.jsx("span",{className:"chat-rpanel-title",children:"Members"}),e.jsx("span",{className:"chat-rpanel-scope",children:T}),e.jsx("button",{type:"button",className:"chat-rpanel-close",onClick:u,"aria-label":"Close panel",children:"×"})]}),e.jsxs("div",{className:"chat-rpanel-body",children:[e.jsxs("div",{className:"chat-psec",children:[e.jsx("span",{className:"label-sm",children:"In this channel"}),A.length===0?e.jsx("p",{className:"chat-feed-notice",children:"The roster is empty."}):A.map(a=>e.jsx(le,{member:a,viewerActorId:t,onOpen:D},a.actorId))]}),e.jsxs("div",{className:"chat-psec",children:[e.jsx("span",{className:"label-sm",children:"Invited"}),d?e.jsx("p",{className:"chat-sheet-error",children:d}):null,I.inviteList?R.length===0&&!d?e.jsx("p",{className:"chat-feed-notice",children:"No outstanding invitations."}):R.map(a=>e.jsx(ce,{invite:a,nowMs:h,onRevoke:q,busy:p===a.id,canRevoke:I.inviteRevoke&&_(a,{actorId:t,isOperator:L})},a.id)):e.jsx("p",{className:"chat-feed-notice",children:"This server does not list outstanding invitations. A link is shown once, when you create it."}),e.jsx("div",{style:{marginTop:"var(--space-sm)"},children:e.jsx("button",{type:"button",className:"btn btn--sm",onClick:C,children:"Invite"})})]})]})]})}export{Le as ChatRightPanel,le as MemberRow};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as a}from"./index-EsrkGBcv.js";import{D as ee,C as te}from"./chat-api-DSJMBYoT.js";import{a as Ht,u as $t,b as Bt,c as Ut}from"./chat-transport-DNS5CB2I.js";import{u as qt,S as Oe,R as Vt,a as Xt}from"./useSidebarCollapse-OL_8J5cL.js";import{useScoutStandaloneAppearance as Kt,ChatSpaceTheme as Fe}from"./ChatSpaceTheme-CUH8bTZc.js";import{ChannelSidebar as Gt}from"./ChannelSidebar-e9DOPulb.js";import{ChannelComposer as Yt}from"./ChannelComposer-DoK7IDGa.js";import{ChatRightPanel as Jt}from"./ChatRightPanel-C1h_aIkn.js";import{Facepile as Qt}from"./ChatAvatar-C3a_o5Hj.js";import{Turn as Zt}from"./ChatBits-CsvxbToF.js";import{InviteSheet as en}from"./InviteSheet-CwxZtWCl.js";import{JumpPalette as tn}from"./JumpPalette-O1aJE9gR.js";import{s as nn,p as sn,q as an,t as rn,u as nt,v as on,b as cn,w as ln,x as dn,c as st,B as un,F as hn,R as mn}from"./chat-space-model-aW3Fd8_U.js";import{uploadMediaFiles as pn}from"./media-blobs-Bi8pxr1u.js";import{c as fn}from"./clipboard-e3fSpeo7.js";import"./api-DSqpVKC7.js";import"./usePersistentState-B8lP7TRb.js";import"./theme-vars-DNK0nn3k.js";import"./SpaceSwitcher-BLgSCf_T.js";import"./SpriteAvatar-CpZWf54-.js";import"./agent-state-DDhnFEEP.js";import"./colors-CFlbwC25.js";import"./ComposerAttachments-DW0AIb8k.js";import"./file-text-CnISiiw6.js";import"./createLucideIcon-zZ8Hx7er.js";import"./ChatRichInput-DhtwFxQE.js";import"./message-markup-BQW5jdJw.js";import"./x-DAehov0E.js";import"./paperclip-BjcuP_Hx.js";import"./chevron-down-l1mrh5S9.js";import"./loader-circle-OvccU82H.js";import"./MessageEmbeds-ksPazAKH.js";import"./chat-message-markup-91DIry6R.js";import"./keyboard-nav-DDHegDbx.js";import"./users-BUjx36gx.js";import"./bot-B4zLQ4IN.js";import"./monitor-DTTYEb73.js";function at(){let c=0;return{begin(){const r=c;return()=>r===c},reset(){c+=1}}}const gn=["ready","channel.changed"],wn=350,bn=2e3,vn=3e4,In=3;function Cn(c,r){const l=`/api/channels/${encodeURIComponent(c)}/events`;return r&&r!=="home"?`${l}?space=${encodeURIComponent(r)}`:l}const Sn={now:()=>Date.now(),setTimer:(c,r)=>setTimeout(c,r),clearTimer:c=>clearTimeout(c)};function En(c){const r=globalThis.EventSource;return typeof r!="function"?null:new r(c,{withCredentials:!0})}function yn(c){const{channelId:r,space:l,onInvalidate:d,createEventSource:m=En,onStatus:q,minRefreshMs:Y=wn,clock:h=Sn}=c;let b=!1,M=null,A=null,C=null,z=!1,s=!1,P=Number.NEGATIVE_INFINITY,x=!1,_=0,i=0;const N=I=>{b||q?.(I)},y=()=>{A!==null&&(h.clearTimer(A),A=null)},R=()=>{C!==null&&(h.clearTimer(C),C=null)},k=()=>{A=null,!b&&(z=!0,s=!1,P=h.now(),Promise.resolve().then(()=>b?void 0:d()).catch(()=>{}).then(()=>{z=!1,s&&!b&&V()}))},V=()=>{if(b)return;if(z){s=!0;return}if(A!==null)return;const I=Math.max(0,Y-(h.now()-P));if(I===0){k();return}A=h.setTimer(k,I)},le=()=>{const L=Math.min(bn*2**Math.max(0,(x?i:_)-1),vn);N("retrying"),R(),C=h.setTimer(()=>{C=null,O()},L)};function O(){if(b||M!==null)return;N("connecting");let I=null;try{I=m(Cn(r,l))}catch{I=null}if(!I){N("unsupported");return}M=I;const L=I,ne=()=>!b&&M===L;L.addEventListener("open",()=>{ne()&&(x=!0,_=0,i=0,N("live"))});for(const de of gn)L.addEventListener(de,()=>{ne()&&V()});L.addEventListener("error",()=>{if(ne()){if(M=null,L.close(),x){i+=1,le();return}if(_+=1,_>=In){N("unavailable");return}le()}})}return O(),()=>{if(b)return;b=!0,y(),R(),s=!1;const I=M;M=null,I?.close()}}const rt="appshell.chat.sidebar.manualCollapsed",ct="openscout.chat.panel.width",ce=360,lt=280,dt=520;function kn(){if(!(typeof window>"u"))try{if(window.localStorage.getItem(rt)!=null)return;const c=window.localStorage.getItem("openscout.chat.rail")==="1";window.localStorage.setItem(rt,JSON.stringify(c))}catch{}}function xn(){if(typeof window>"u")return ce;try{const c=Number(window.localStorage.getItem(ct));return!Number.isFinite(c)||c<=0?ce:Math.max(lt,Math.min(dt,Math.round(c)))}catch{return ce}}function ot(c){if(!(typeof window>"u"))try{window.localStorage.setItem(ct,String(c))}catch{}}function Tn(){const[c,r]=n.useState(()=>typeof window<"u"?window.innerWidth:1280);return n.useEffect(()=>{const l=()=>r(window.innerWidth);return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]),c}function it(c){const[r,l]=n.useState(()=>typeof window<"u"&&window.matchMedia?window.matchMedia(c).matches:!1);return n.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const d=window.matchMedia(c),m=()=>l(d.matches);return m(),d.addEventListener("change",m),()=>d.removeEventListener("change",m)},[c]),r}function We(c,r,l){const d=n.useRef(c);d.current=c,n.useEffect(()=>{if(!l)return;let m=!1,q=!1;const Y=()=>{m||q||typeof document<"u"&&document.hidden||(q=!0,d.current().finally(()=>{q=!1}))},h=setInterval(Y,r),b=()=>{typeof document<"u"&&!document.hidden&&Y()};return document.addEventListener("visibilitychange",b),()=>{m=!0,clearInterval(h),document.removeEventListener("visibilitychange",b)}},[l,r])}function Mn(c,r,l,d){const m=n.useRef(l);m.current=l,n.useEffect(()=>{if(!(!r||!c))return yn({channelId:c,space:d,onInvalidate:()=>m.current()})},[c,r,d])}async function Nn(c,r){return c.length===0?[]:r(c)}function ps({signedOut:c}={}){const r=Ht(),l=$t(),d=Bt(),{theme:m,preference:q,setPreference:Y}=Kt(),[h,b]=n.useState("loading"),[M,A]=n.useState(null),[C,z]=n.useState(null),[s,P]=n.useState(()=>d.read().channelId),[x,_]=n.useState(()=>d.read().messageId),[i,N]=n.useState(()=>d.read().space??ee),[y,R]=n.useState(null),[k,V]=n.useState([]),[le,O]=n.useState([]),[I,L]=n.useState(null),[ne,de]=n.useState(null),[Se,se]=n.useState(null),[ut,ae]=n.useState(!1),[ht,Ee]=n.useState({}),[mt,ze]=n.useState({}),[pt,He]=n.useState({}),[J,F]=n.useState({kind:"none"}),[ye,ue]=n.useState(!1),[ke,he]=n.useState(!1),[xe,$e]=n.useState(!1),[ft,Be]=n.useState(null),[Te,Ue]=n.useState(!1),[gt,qe]=n.useState(null),[me,wt]=n.useState(()=>Date.now()),[bt,W]=n.useState(()=>d.read().channelId?"channel":"list");kn();const vt=Tn(),Q=it("(max-width: 899px)"),pe=it("(max-width: 1199px)"),p=qt("chat",Q?1600:vt,Oe),Me=n.useRef(p.width),[fe,Ve]=n.useState(xn),Ne=n.useRef(fe),[It,ge]=n.useState(null),Re=n.useRef(null),Xe=n.useRef(null),we=n.useRef(null),[H]=n.useState(at),[Le]=n.useState(at),Ke=n.useRef(i);Ke.current!==i&&(Ke.current=i,Le.reset());const $=n.useCallback(async e=>{const t=Le.begin();try{const o=await r.bootstrap({recoverSession:!new URLSearchParams(window.location.search).has("signedOut"),space:i});if(!t())return;z(o),o.space&&o.space!==i&&N(o.space),b("ready"),A(null)}catch(o){if(!t())return;if(o instanceof te&&o.isUnauthenticated){if(!e&&h==="ready"){ae(!0);return}b("gate"),A(o.message);return}e?(b("error"),A(o instanceof Error?o.message:"Scout Chat could not be reached.")):ae(!0)}},[Le,r,h,i]);n.useEffect(()=>{$(!0)},[$]),We(()=>$(!1),un,h==="ready");const j=n.useMemo(()=>nn((C?.channels??[]).filter(e=>e.kind==="channel")),[C]),B=n.useMemo(()=>(C?.channels??[]).filter(e=>e.kind==="direct"||e.kind==="group_direct"),[C]),Ge=n.useMemo(()=>new Set([...j,...B].map(e=>e.id)),[j,B]),Ct=n.useMemo(()=>C?.spaces?.length?C.spaces:[{slug:i,title:i===ee?"Home":i,conversationId:null,isDefault:i===ee,channelCount:j.length}],[C,j.length,i]);n.useEffect(()=>{if(h!=="ready"||s&&Ge.has(s))return;const e=j[0]?.id??B[0]?.id??null;e!==s&&(P(e),d.write({channelId:e,space:i,messageId:null},!0))},[d,s,j,B,h,Ge,i]),n.useEffect(()=>{const e=()=>{const t=d.read();P(t.channelId),N(t.space??ee),_(t.messageId),F({kind:"none"}),W(t.channelId?"channel":"list")};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[d]);const v=n.useMemo(()=>[...j,...B].find(e=>e.id===s)??null,[j,s,B]),D=n.useCallback(async()=>{if(!s)return;const e=H.begin();try{const t=await r.feed(s,i);if(!e())return;R(t),se(null),ae(!1)}catch(t){if(!e())return;if(t instanceof te&&t.isUnauthenticated){se(t.message);return}ae(!0)}},[s,r,H,i]),re=n.useCallback(async()=>{if(!s)return;const e=H.begin();try{const t=await r.members(s,i);if(!e())return;V(o=>{const u=t.members??[];return u.length===0?o:we.current!==s?(we.current=s,u):sn(o,u)})}catch{if(!e())return;ae(!0)}},[s,r,H,i]),oe=n.useCallback(async()=>{if(!s||!l.inviteList)return;const e=H.begin();try{const t=await r.invites(s,i);if(!e())return;O(t.invites??[]),L(null)}catch(t){if(!e())return;O([]),L(t instanceof te&&t.isUnauthenticated?"Only members of this channel can manage its invitations.":t instanceof Error?t.message:"Invitations could not be read.")}},[l.inviteList,s,r,H,i]);n.useEffect(()=>{H.reset(),R(null),O([]),se(null),F({kind:"none"}),we.current!==s&&(we.current=null)},[s,H]),n.useEffect(()=>{s&&(D(),re(),oe())},[s,D,oe,re]),We(D,hn,h==="ready"&&!!s),We(re,mn,h==="ready"&&!!s),Mn(s,h==="ready"&&l.liveStream,D,i),n.useEffect(()=>{const e=setInterval(()=>wt(Date.now()),3e4);return()=>clearInterval(e)},[]);const be=n.useMemo(()=>{const e=new Map;for(const t of k)e.set(t.actorId,t);return e},[k]),X=n.useMemo(()=>an({messages:y?.messages??[],requests:y?.requests??[],nowMs:me}),[y,me]),f=C?.viewer??null,St=n.useMemo(()=>{const e=new Set;return!s||!f||rn({projection:X,viewerActorId:f.actorId,members:k})&&e.add(s),e},[s,k,X,f]);n.useEffect(()=>{const e=Xe.current;if(!e)return;e.scrollHeight-e.scrollTop-e.clientHeight<160&&(e.scrollTop=e.scrollHeight)},[X.lastMessageAt]);const Ae=s?ht[s]??"":"",je=s?pt[s]??null:null,Et=n.useCallback(e=>{s&&Ee(t=>({...t,[s]:e}))},[s]),De=n.useCallback(e=>{s&&He(t=>({...t,[s]:e}))},[s]),ve=n.useCallback(async e=>{if(!s)return!1;const t=e.body.trim(),o=e.files??[];if(!t&&o.length===0)return!1;const u=Re.current,E=u&&u.channelId===s&&u.body===t&&u.replyToMessageId===e.replyToMessageId&&u.targetActorId===e.targetActorId,T=E?u.requestId:nt(),g=E&&u?.attachments?u.attachments:o.length>0?await Nn(o,w=>r.uploadAttachments?r.uploadAttachments(s,w,i):pn(w)):void 0;return Re.current={channelId:s,body:t,replyToMessageId:e.replyToMessageId,targetActorId:e.targetActorId,requestId:T,attachments:g},e.targetActorId?await r.postAsk(s,{requestId:T,body:t,targetActorId:e.targetActorId,space:i,...e.replyToMessageId?{replyToMessageId:e.replyToMessageId}:{}}):await r.postMessage(s,{requestId:T,body:t,space:i,...e.replyToMessageId?{replyToMessageId:e.replyToMessageId}:{},...g&&g.length>0?{attachments:g}:{}}),Re.current=null,await D(),re(),!0},[s,r,D,re,i]),Ye=n.useCallback((e,t,o)=>{if(!s)return;const u=y;R(g=>g&&{...g,messages:g.messages.map(w=>w.id===e?{...w,reactions:on(w.reactions,t,o)}:w)});const E=nt();(o?r.removeReaction:r.addReaction)(s,{messageId:e,emoji:t,requestId:E,space:i}).then(()=>{D()}).catch(g=>{R(u),se(g instanceof te?g.message:"That reaction did not save.")})},[s,r,y,D,i]),Je=n.useCallback(e=>{s&&r.cancelAsk(s,e,i).then(t=>{R(o=>o&&{...o,requests:o.requests.map(u=>u.flightId===e?{...u,state:t.request.state}:u)})}).catch(()=>{D()})},[s,r,D,i]),yt=n.useCallback((e=[])=>!s||xe?Promise.resolve(!1):(Be(null),$e(!0),ve({body:Ae,replyToMessageId:null,targetActorId:je,files:e}).then(t=>(t&&(Ee(o=>({...o,[s]:""})),He(o=>({...o,[s]:null}))),t)).catch(t=>(Be(t instanceof te?t.message:"That did not send. The text is still here — try again."),!1)).finally(()=>$e(!1))),[je,s,Ae,ve,xe]),S=J.kind==="thread"?J.rootMessageId:null,Pe=S?mt[S]??"":"",kt=n.useCallback((e=[])=>!S||Te?Promise.resolve(!1):(qe(null),Ue(!0),ve({body:Pe,replyToMessageId:S,targetActorId:null,files:e}).then(t=>(t&&ze(o=>({...o,[S]:""})),t)).catch(t=>(qe(t instanceof te?t.message:"That reply did not send."),!1)).finally(()=>Ue(!1))),[ve,Pe,S,Te]),Ie=n.useCallback(e=>{P(e),d.write({channelId:e,space:i,messageId:null},!1),_(null),F({kind:"none"}),W("channel")},[d,i]),xt=n.useCallback(e=>{e!==i&&(N(e),P(null),z(null),R(null),V([]),O([]),F({kind:"none"}),W("list"),d.write({channelId:null,space:e,messageId:null},!1),_(null))},[d,i]),Qe=n.useCallback(e=>{if(!s)return;const t=Ut(window.location.href,{channelId:s,messageId:e,space:i});d.write({channelId:s,space:i,messageId:e},!0),_(e),fn(t)},[d,s,i]),K=n.useCallback(e=>{F(e),W(e.kind==="none"?"channel":"panel")},[]),Ze=n.useRef(null);n.useEffect(()=>{if(!x||!y)return;const e=y.messages.find(o=>o.id===x);if(!e||(e.replyToMessageId&&(F({kind:"thread",rootMessageId:e.replyToMessageId}),W("panel")),Ze.current===x))return;Ze.current=x;const t=window.requestAnimationFrame(()=>{document.querySelector(`[data-message-id="${CSS.escape(x)}"]`)?.scrollIntoView({block:"center",behavior:"smooth"})});return()=>window.cancelAnimationFrame(t)},[y,x]);const Z=n.useCallback(()=>{F({kind:"none"}),W("channel")},[]),Ce=n.useCallback(()=>{p.toggleCollapsed()},[p]),Tt=n.useCallback(e=>{e.preventDefault(),e.stopPropagation();const t=p.effectiveCollapsed,o=e.clientX,u=t?Oe:p.expandedWidth;Me.current=u,p.beginResize(u,t);const E=()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",g),document.removeEventListener("pointercancel",w),window.removeEventListener("blur",w)},T=U=>{const ie=u+(U.clientX-o);Me.current=ie,p.updateResize(ie)},g=()=>{p.commitDrag(Me.current??u,t),E()},w=()=>{p.clearDrag(),E()};document.addEventListener("pointermove",T),document.addEventListener("pointerup",g),document.addEventListener("pointercancel",w),window.addEventListener("blur",w)},[p]),Mt=n.useCallback(e=>{e.preventDefault(),e.stopPropagation();const t=e.clientX,o=fe;Ne.current=o,ge(o);const u=()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",g),document.removeEventListener("pointercancel",w),window.removeEventListener("blur",w)},E=U=>Math.max(lt,Math.min(dt,Math.round(U))),T=U=>{const ie=E(o-(U.clientX-t));Ne.current=ie,ge(ie)},g=()=>{const U=E(Ne.current??o);Ve(U),ot(U),ge(null),u()},w=()=>{ge(null),u()};document.addEventListener("pointermove",T),document.addEventListener("pointerup",g),document.addEventListener("pointercancel",w),window.addEventListener("blur",w)},[fe]),Nt=n.useCallback(()=>{(async()=>{try{await r.signOut();const e=new URL(window.location.href);e.searchParams.set("signedOut","1"),window.location.assign(e.pathname+e.search)}catch(e){se(e instanceof Error?e.message:"Could not sign out. Try again.")}})()},[r]),Rt=n.useCallback(async e=>{const t=await r.createChannel({title:e.title,...e.topic?{topic:e.topic}:{},space:i});await $(!1),Ie(t.conversation.id)},[r,$,Ie,i]),Lt=n.useCallback(async e=>{const t=await r.createSpace({title:e.title,...e.channel?{channel:e.channel}:{}});N(t.space.slug),z(null),R(null),V([]),O([]),P(t.channel?.id??null),F({kind:"none"}),W(t.channel?"channel":"list"),d.write({channelId:t.channel?.id??null,space:t.space.slug,messageId:null},!1)},[d,r]),At=n.useMemo(()=>l.spaceDelete&&r.deleteSpace?async e=>{await r.deleteSpace(e),z(null),R(null),V([]),O([]),P(null),F({kind:"none"}),W("list"),N(ee),d.write({channelId:null,space:ee,messageId:null},!1),await $(!0)}:null,[d,l.spaceDelete,r,$]),jt=n.useCallback(async e=>{if(!(!s||!f)){de(e);try{await r.revokeInvite(s,e,f.actorId,i),await oe()}catch(t){L(t instanceof Error?t.message:"That invitation could not be revoked.")}finally{de(null)}}},[s,r,oe,i,f]),Dt=n.useCallback(e=>{const t=be.get(e);if(!t||!s)return;const o=cn(t);Ee(u=>{const E=u[s]??"",T=E.length===0||E.endsWith(" ")?"":" ";return{...u,[s]:`${E}${T}@${o} `}}),l.asks&&ln(t)&&De(e),Z()},[l.asks,s,Z,be,De]);if(n.useEffect(()=>{const e=t=>{if((t.metaKey||t.ctrlKey)&&t.key.toLowerCase()==="k"){t.preventDefault(),he(o=>!o);return}if((t.metaKey||t.ctrlKey)&&t.key.toLowerCase()==="b"){const o=document.activeElement;if(o instanceof HTMLElement&&(o.tagName==="TEXTAREA"||o.tagName==="INPUT"||o.isContentEditable))return;t.preventDefault(),Ce();return}if(t.key==="Escape"){if(ke||ye)return;if(J.kind!=="none"){t.preventDefault(),Z();return}const o=document.activeElement;o instanceof HTMLElement&&o.tagName==="TEXTAREA"&&o.blur()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Z,J.kind,ke,ye,Ce]),h==="loading")return a.jsx(Fe,{theme:m,className:"chat-centered",children:a.jsx("p",{className:"chat-card-meta",children:"Loading Scout Chat…"})});if(h==="gate"&&c)return c({signInHref:`${l.signIn.startPath}?${l.signIn.returnToParam}=${encodeURIComponent(window.location.pathname+window.location.search)}`,signInLabel:l.signIn.label,note:l.signIn.note??null,message:M});if(h==="gate"||h==="error"){const e=h==="gate";return a.jsx(Fe,{theme:m,className:"chat-centered",children:a.jsxs("div",{className:"chat-card",children:[a.jsx("span",{className:"chat-card-eyebrow",children:"Scout Chat"}),a.jsx("h1",{children:e?"You are not signed in":"Scout Chat is unavailable"}),a.jsx("p",{children:e?l.signIn.prompt:M??"The chat service did not answer."}),e?a.jsxs(a.Fragment,{children:[a.jsx("a",{className:"btn btn--accent",href:`${l.signIn.startPath}?${l.signIn.returnToParam}=${encodeURIComponent(window.location.pathname+window.location.search)}`,children:l.signIn.label}),l.signIn.note?a.jsx("p",{className:"chat-card-note",children:l.signIn.note}):null]}):a.jsx("button",{type:"button",className:"btn",onClick:()=>{$(!0)},children:"Try again"}),e&&M?a.jsx("p",{className:"chat-card-note",children:M}):null]})})}const Pt=f?.displayName??"you",_t=k.length>0?dn(k):"reading…",G=p.effectiveCollapsed&&!Q,et=G?Oe:p.width,tt=It??fe,Ot={"--sidebar-w":`${et}px`,"--panel-w":`${tt}px`},_e=J.kind!=="none",Ft=S?(y?.messages??[]).find(e=>e.id===S)??null:null,Wt=S?X.repliesByRoot.get(S)??[]:[],zt=S?X.requestsByMessage.get(S)??null:null;return a.jsxs(Fe,{theme:m,className:"chat-space",compactView:bt,railed:G,style:Ot,children:[a.jsxs("header",{className:"chat-topbar",children:[a.jsxs("div",{className:"chat-topbar-band",children:[a.jsxs("div",{className:"chat-space-name",children:[a.jsx("b",{children:"Scout Chat"}),v?a.jsx("span",{children:v.authorityNodeId}):null]}),Q?null:a.jsx(Vt,{side:"left",collapsed:G,label:"Sidebar",onToggle:Ce,className:"chat-band-toggle"})]}),a.jsxs("button",{type:"button",className:"chat-jump",onClick:()=>he(!0),children:["⌕ Jump to a channel or person",a.jsx("span",{className:"chat-kbd",children:"⌘K"})]})]}),a.jsxs("div",{className:"chat-body","data-panel":_e&&!pe?"open":"closed",children:[a.jsx(Gt,{channels:j,directs:B,spaces:Ct,activeSpace:i,selectedId:s,addressedChannelIds:St,canCreate:f?.isOperator===!0,viewerName:Pt,viewerIsHost:f?.isOperator===!0,railed:G,themePreference:q,onSelect:Ie,onSelectSpace:xt,onCreate:Rt,onCreateSpace:Lt,onDeleteSpace:At,onInvite:()=>ue(!0),onExpandRail:Ce,onOpenProfile:v&&f?()=>K({kind:"member",actorId:f.actorId}):null,onThemePreference:Y,onSignOut:Nt}),v?a.jsxs("main",{className:"chat-channel","aria-label":st(v.title),children:[a.jsxs("header",{className:"chat-chan-head",children:[a.jsx("button",{type:"button",className:"chat-compact-back",onClick:()=>W("list"),"aria-label":"Back to channels",children:"‹"}),a.jsxs("span",{className:"chat-chan-name",children:[a.jsx("span",{className:"chat-hash",children:"#"}),v.title.replace(/^#/u,"")]}),a.jsx("span",{className:`chat-topic${v.topic?"":" chat-topic--empty"}`,children:v.topic??"No topic set"}),a.jsx(Qt,{members:k,countLabel:_t,onOpen:()=>K({kind:"members"})}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>ue(!0),children:"Invite"})]}),a.jsxs("div",{className:"chat-feed",ref:Xe,role:"log","aria-label":"Channel messages",children:[ut?a.jsx("p",{className:"chat-feed-notice",children:"Reconnecting — this is the last reading that came back."}):null,Se?a.jsx("p",{className:"chat-feed-notice","data-tone":"error",children:Se}):null,!y&&!Se?a.jsx("p",{className:"chat-feed-notice",children:"Loading messages…"}):null,y&&X.entries.length===0?a.jsx("p",{className:"chat-feed-empty",children:"Nothing has been posted here yet. Say something, or invite the people and agents who belong in this room."}):null,X.entries.map(e=>e.kind==="day"?a.jsx("div",{className:"chat-day",children:a.jsx("span",{className:"label-sm",children:e.label})},e.id):e.kind==="status"?a.jsx("div",{className:"chat-status-line",children:e.message.body},e.id):e.kind==="status-fold"?a.jsx(Rn,{label:e.label,messages:e.messages},e.id):a.jsx(Zt,{message:e.message,members:be,nowMs:me,request:e.request,replyCount:e.replyCount,lastReplyAt:e.lastReplyAt,onOpenThread:()=>K({kind:"thread",rootMessageId:e.message.id}),onOpenMember:t=>K({kind:"member",actorId:t}),onReact:Ye,onCopyLink:Qe,onStopAsk:Je,focused:x===e.message.id},e.id))]}),a.jsx("div",{className:"chat-composer-wrap",children:a.jsx(Yt,{members:k,draft:Ae,onDraftChange:Et,askTargetId:je,onAskTargetChange:De,onSend:yt,sending:xe,error:ft,placeholder:`Message ${st(v.title)}`})})]}):a.jsx("main",{className:"chat-channel",children:a.jsx("div",{className:"chat-feed",children:a.jsx("p",{className:"chat-feed-empty",children:f?.isOperator?"Create a channel to start.":"You are not in a channel yet. Open the invitation you were sent."})})}),v&&_e&&pe&&!Q?a.jsx("div",{className:"chat-panel-scrim",role:"presentation",onClick:Z}):null,Q?null:a.jsx("div",{"data-scout-sidebar-resize-handle":"",role:"separator","aria-orientation":"vertical","aria-label":G?"Expand sidebar (drag out)":"Resize or collapse sidebar",title:G?"Drag out to expand · double-click to expand":"Drag to resize · drag in to collapse · double-click to reset",onPointerDown:Tt,onDoubleClick:e=>{e.preventDefault(),G?(p.setExpandedWidth(Xt),p.setCollapsed(!1)):p.resetExpandedWidth()},style:{position:"absolute",left:Math.max(0,et-3),top:0,bottom:0,width:6,zIndex:50,cursor:"ew-resize",touchAction:"none"}}),p.isSidebarResizing&&p.dragGhostWidth!=null?a.jsx("div",{"data-scout-sidebar-resize-ghost":"","aria-hidden":"true",className:"scout-sidebar-resize-ghost",style:{position:"absolute",left:p.dragGhostWidth,top:0,bottom:0,width:2,transform:"translateX(-50%)",zIndex:55,pointerEvents:"none"}}):null,v&&f?a.jsx(Jt,{view:J,channel:v,members:k,membersById:be,invites:le,inviteError:I,revokingInviteId:ne,viewerActorId:f.actorId,viewerIsOperator:f.isOperator,nowMs:me,threadRoot:Ft,threadReplies:Wt,threadRequest:zt,threadDraft:Pe,onThreadDraftChange:e=>{S&&ze(t=>({...t,[S]:e}))},onSendThreadReply:kt,onReact:Ye,onCopyLink:Qe,onStopAsk:Je,focusMessageId:x,threadSending:Te,threadError:gt,onClose:Z,onBack:()=>K({kind:"members"}),onOpenMember:e=>K({kind:"member",actorId:e}),onMention:Dt,onRevokeInvite:e=>{jt(e)},onInvite:()=>ue(!0),overlay:pe}):null,v&&_e&&!pe&&!Q?a.jsx("div",{"data-scout-sidebar-resize-handle":"",role:"separator","aria-orientation":"vertical","aria-label":"Resize inspector",title:"Drag to resize · double-click to reset",onPointerDown:Mt,onDoubleClick:e=>{e.preventDefault(),Ve(ce),ot(ce)},style:{position:"absolute",right:Math.max(0,tt-3),top:0,bottom:0,width:6,zIndex:50,cursor:"ew-resize",touchAction:"none"}}):null]}),ye&&v&&f?a.jsx(en,{space:i,channel:v,viewerActorId:f.actorId,viewerName:f.displayName,onClose:()=>ue(!1),onInvitesChanged:()=>{oe()}},`${i}:${v.id}`):null,ke?a.jsx(tn,{channels:[...j,...B],members:k,onClose:()=>he(!1),onPick:e=>{he(!1),e.kind==="channel"?Ie(e.id):K({kind:"member",actorId:e.id})}}):null]})}function Rn({label:c,messages:r}){const[l,d]=n.useState(!1);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"chat-status-line",children:[a.jsx("button",{type:"button",className:"chat-fold",onClick:()=>d(m=>!m),children:`${l?"⌃":"⌵"} ${c}`}),a.jsx("span",{className:"chip chip--sm chip--mono chip--ghost chip--neutral",children:r.length})]}),l?r.map(m=>a.jsx("div",{className:"chat-status-line",children:m.body},m.id)):null]})}export{ps as ChatSpaceSurface};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./index-EsrkGBcv.js";import{A as J}from"./AgentAvatar-CrP1eXxk.js";import{M as T}from"./runtime-picker-DXu2bOTh.js";import{M as $}from"./NewChatComposer-C97-iTMK.js";import{C as V}from"./ComposerAttachments-DW0AIb8k.js";import"./index-724SdE6r.js";import{c as z}from"./createLucideIcon-zZ8Hx7er.js";import{Z as Y}from"./zap-CEjZNZbI.js";import{X as M}from"./x-DAehov0E.js";import"./Provider-C35yu29I.js";import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./router-DCtl8wqb.js";import"./api-DSqpVKC7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-BCPRocpq.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./time-Dhsh_2EG.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./file-text-CnISiiw6.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./keyboard-nav-DDHegDbx.js";import"./media-blobs-Bi8pxr1u.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./SpriteAvatar-CpZWf54-.js";import"./CrewAvatar-kTznzqcO.js";import"./HarnessMark-C4naWc16.js";import"./colors-CFlbwC25.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-OvccU82H.js";import"./conversation-model-FxDeWlle.js";import"./conversations-DoAAO6kA.js";import"./NewChatOrigin-DFbF_XvR.js";import"./chevron-down-l1mrh5S9.js";import"./search-DT42oyRW.js";const S=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ee=z("pencil",S);const se=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],te=z("reply",se);function es({composeRef:P,draft:N,setDraft:R,composePlaceholder:K,slashState:n,setSlashState:b,filteredSlashCommands:r,applySlashCommand:w,mentionState:a,setMentionState:j,filteredMentions:i,applyMention:f,updateTriggersFromDraft:v,closeSuggestions:y,replyTarget:u,onCancelReply:H,isStopMode:L,sending:p,composeAction:_,onSend:I,onInterrupt:W,attachments:c,isAgentBusy:D,busyIntent:k,onBusyIntentChange:C,queued:l,queueNote:F,onEditQueued:O,editingQueuedId:m,editingAttachmentCount:h,onCancelEdit:Q,onUnqueue:Z,onSendQueuedNow:U}){const X=s.jsxs(s.Fragment,{children:[n.open?s.jsx($,{label:"Slash commands",items:r.map(e=>({id:e.command,token:e.label,description:e.description})),activeIndex:n.index,onPick:e=>{const t=r[e];t&&w(t)},onActiveIndexChange:e=>b(t=>({...t,index:e}))}):null,a.open?s.jsx($,{label:"Mention agent",items:i.map(e=>({id:e.id,token:`@${e.handle}`,description:e.name,avatarNode:s.jsx(J,{name:e.name,size:20,tile:!0,presence:!1})})),activeIndex:a.index,onPick:e=>{const t=i[e];t&&f(t)},onActiveIndexChange:e=>j(t=>({...t,index:e}))}):null]}),B=N.trim().length>0,x=m!==null,q=B||c.hasFiles||h>0,g=D&&q,d=g&&k==="steer",A=x?l.findIndex(e=>e.id===m)+1:0,E=g?s.jsxs("div",{className:"s-msg-compose-mode",role:"group","aria-label":"What Send does while this turn is running",children:[s.jsx("button",{type:"button",className:"s-msg-compose-mode-btn","data-mode":"queue","aria-pressed":k==="queue",title:"Hold this draft until the running turn lands",disabled:p,onClick:()=>C("queue"),children:"Queue"}),s.jsx("button",{type:"button",className:"s-msg-compose-mode-btn","data-mode":"steer","aria-pressed":k==="steer",title:"Interrupt the running turn and deliver this now",disabled:p,onClick:()=>C("steer"),children:"Steer"})]}):null,G=l.length>0||E?s.jsxs("div",{className:"s-msg-compose-queue",role:"group","aria-label":"Queued messages",children:[s.jsxs("div",{className:"s-msg-compose-queue-head",children:[s.jsx("span",{className:"s-msg-compose-queue-kicker",children:l.length>0?`Queue · ${l.length}`:"Queues next"}),s.jsx("span",{className:"s-msg-compose-queue-hint",children:x?d?`Rewriting ${A} — send interrupts this turn`:`Rewriting ${A} — send returns it to its place`:l.length>0?d?"Send interrupts this turn":F??"":d?"Interrupts this turn on send":"Sends when this turn lands"}),E]}),l.map((e,t)=>s.jsxs("div",{className:"s-msg-compose-queue-row","data-editing":e.id===m?"true":void 0,children:[s.jsx("span",{className:"s-msg-compose-queue-index",children:t+1}),s.jsx("span",{className:"s-msg-compose-queue-body",children:e.body.trim()||"Attachments only"}),e.attachments.length>0?s.jsxs("span",{className:"s-msg-compose-queue-clip",children:[e.attachments.length," file",e.attachments.length===1?"":"s"]}):null,e.id===m?s.jsx("button",{type:"button",className:"s-msg-compose-queue-edit btn btn--sm btn--ghost",title:"Stop rewriting — leave this row as it was","aria-label":`Cancel rewriting queued message ${t+1}`,onClick:Q,children:"Cancel edit"}):s.jsxs("button",{type:"button",className:"s-msg-compose-queue-edit btn btn--sm btn--ghost",title:"Pull this back into the input box to rewrite it","aria-label":`Edit queued message ${t+1}`,disabled:p||x,onClick:()=>O(e.id),children:[s.jsx(ee,{size:11,"aria-hidden":"true"}),s.jsx("span",{children:"Edit"})]}),s.jsxs("button",{type:"button",className:"s-msg-compose-queue-now btn btn--sm btn--accent",title:"Interrupt this turn and send this now","aria-label":`Send queued message ${t+1} now`,disabled:p||e.id===m,onClick:()=>U(e.id),children:[s.jsx(Y,{size:11,"aria-hidden":"true"}),s.jsx("span",{children:"Send now"})]}),s.jsx("button",{type:"button",className:"s-msg-compose-queue-drop btn btn--ghost btn--icon",title:"Cancel — drop this from the queue","aria-label":`Cancel queued message ${t+1}`,onClick:()=>Z(e.id),children:"×"})]},e.id))]}):null;return s.jsx(T,{density:"thread",value:N,onChange:(e,t)=>{R(e),v(e,t?.caret??e.length)},onSend:I,placeholder:K,sending:p,stopMode:L,onStop:W,canSend:q,sendTitle:d?"Steer — interrupt this turn and send now (Cmd+Enter)":g?"Queue for the next turn (Cmd+Enter)":"Send (Cmd+Enter)",sendAriaLabel:d?"Steer — interrupt this turn and send now (Cmd+Enter)":g?"Queue message for the next turn (Cmd+Enter)":_==="steer"?"Send follow-up (Cmd+Enter)":"Send message (Cmd+Enter)",showAttach:!0,onAttach:c.openPicker,onPaste:c.onPaste,dropHandlers:c.dropHandlers,dragActive:c.dragActive,textareaRef:P,overlay:X,above:G,aboveAttached:!0,header:s.jsxs(s.Fragment,{children:[u?s.jsxs("div",{className:"s-thread-compose-reply surface-card surface-card--inset",role:"status",children:[s.jsx(te,{className:"s-thread-compose-reply-icon text-muted",size:13,strokeWidth:1.8,"aria-hidden":"true"}),s.jsx("span",{className:"s-thread-compose-reply-label label-xs text-muted",children:"Replying to"}),s.jsx("span",{className:"s-thread-compose-reply-actor chip chip--sm chip--mono chip--neutral",children:u.actorLabel}),s.jsx("span",{className:"s-thread-compose-reply-preview text-muted",title:u.preview,children:u.preview}),s.jsx("button",{type:"button",className:"s-thread-compose-reply-cancel btn btn--ghost btn--icon","aria-label":"Cancel reply",title:"Cancel reply",onClick:H,children:s.jsx(M,{size:13,strokeWidth:1.8,"aria-hidden":"true"})})]}):null,x&&h>0?s.jsxs("div",{className:"s-msg-compose-carried",role:"status",children:[h," file",h===1?"":"s"," stay attached to this draft"]}):null,s.jsx(V,{attachments:c})]}),tools:s.jsxs("span",{className:"s-thread-compose-hint s-msg-compose-tools-hint",children:[s.jsx("kbd",{className:"s-kbd",children:"/"})," commands"," · ",s.jsx("kbd",{className:"s-kbd",children:"@"})," agents"]}),onSelect:e=>{const t=e.currentTarget;v(t.value,t.selectionStart)},onBlur:()=>{setTimeout(y,120)},onKeyDown:e=>{if(!(n.open&&r.length>0||a.open&&i.length>0))return!1;if(e.key==="ArrowDown")return n.open?b(o=>({...o,index:(o.index+1)%r.length})):a.open&&j(o=>({...o,index:(o.index+1)%i.length})),!0;if(e.key==="ArrowUp")return n.open?b(o=>({...o,index:(o.index-1+r.length)%r.length})):a.open&&j(o=>({...o,index:(o.index-1+i.length)%i.length})),!0;if(e.key==="Escape")return y(),!0;if((e.key==="Enter"||e.key==="Tab")&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey){if(n.open){const o=r[n.index]??r[0];o&&w(o)}else if(a.open){const o=i[a.index]??i[0];o&&f(o)}return!0}return!1}})}export{es as ConversationComposer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./index-EsrkGBcv.js";import{M as p}from"./message-markup-Zwo3t4cI.js";import{f as d}from"./conversation-model-FxDeWlle.js";import{t as n}from"./time-Dhsh_2EG.js";import"./message-markup-BQW5jdJw.js";import"./mentions-ByUvhS-v.js";import"./colors-CFlbwC25.js";import"./agent-state-DDhnFEEP.js";import"./index-724SdE6r.js";import"./api-DSqpVKC7.js";import"./Provider-C35yu29I.js";import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./router-DCtl8wqb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-BCPRocpq.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-C97-iTMK.js";import"./runtime-picker-DXu2bOTh.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-OvccU82H.js";import"./createLucideIcon-zZ8Hx7er.js";import"./media-blobs-Bi8pxr1u.js";import"./HarnessMark-C4naWc16.js";import"./NewChatOrigin-DFbF_XvR.js";import"./keyboard-nav-DDHegDbx.js";import"./x-DAehov0E.js";import"./chevron-down-l1mrh5S9.js";import"./search-DT42oyRW.js";import"./file-text-CnISiiw6.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./AgentDetailCard-DtHT3sCo.js";import"./AgentLiveActions-CfTupTEl.js";import"./terminal-takeover-Ay5C2c-M.js";import"./openContent-C6XO6kr5.js";import"./eye-LrO-cXQt.js";import"./terminal-hQKQygcf.js";import"./conversations-DoAAO6kA.js";function l({at:i}){const r=d(i);return t.jsxs("div",{className:"s-thread-day-divider","aria-label":r,children:[t.jsx("span",{className:"s-thread-day-line","aria-hidden":"true"}),t.jsx("span",{className:"s-thread-day-label",children:r}),t.jsx("span",{className:"s-thread-day-line","aria-hidden":"true"})]})}function ht({row:i,expanded:r,showDayDivider:e,onToggle:s}){const m=`${i.recipients.length} recipients`;return t.jsxs("div",{className:["s-thread-feed-block","s-thread-fanout",e&&"s-thread-feed-block--full-width"].filter(Boolean).join(" "),children:[e&&t.jsx(l,{at:i.createdAt}),i.messages.map(a=>t.jsx("span",{id:`msg-${a.id}`,className:"s-thread-fanout-anchor","aria-hidden":"true"},a.id)),t.jsxs("button",{type:"button",className:"s-thread-fanout-summary","aria-expanded":r,onClick:s,title:i.recipients.join(", "),children:[t.jsx("span",{className:"s-thread-fanout-caret","aria-hidden":"true",children:r?"▾":"▸"}),t.jsx("span",{className:"s-thread-fanout-label",children:m}),t.jsx("span",{className:"s-thread-fanout-time",children:n(i.createdAt)})]}),r&&t.jsxs("div",{className:"s-thread-fanout-detail",children:[t.jsx("ul",{className:"s-thread-fanout-recipients",children:i.messages.map((a,o)=>t.jsx("li",{className:"s-thread-fanout-recipient",children:i.recipients[o]},a.id))}),t.jsx("div",{className:"s-thread-fanout-body",children:t.jsx(p,{text:i.messages[0].body})})]})]})}export{ht as FanOutRow,l as ThreadDayDivider};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as S,j as e,H as Z}from"./index-EsrkGBcv.js";import{c as M}from"./clipboard-e3fSpeo7.js";import{d as ee}from"./router-DCtl8wqb.js";import{A as P}from"./AgentAvatar-CrP1eXxk.js";import{H as te}from"./HarnessMark-C4naWc16.js";import{a as se}from"./Provider-C35yu29I.js";import{n as ne,c as ae}from"./agent-state-DDhnFEEP.js";import{B as re}from"./BackToPicker-CUkjnoVk.js";import{o as _}from"./openContent-C6XO6kr5.js";import{AstronautSuit as oe}from"./AstronautSuit-Cchnc4Ug.js";import{n as ie,o as le}from"./conversation-model-FxDeWlle.js";import{E as ce}from"./eye-LrO-cXQt.js";import{P as de}from"./panel-right-Bv7sP_fc.js";import{c as me}from"./createLucideIcon-zZ8Hx7er.js";import"./api-DSqpVKC7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./SpriteAvatar-CpZWf54-.js";import"./CrewAvatar-kTznzqcO.js";import"./runtime-picker-DXu2bOTh.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-OvccU82H.js";import"./colors-CFlbwC25.js";import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-BCPRocpq.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-C97-iTMK.js";import"./media-blobs-Bi8pxr1u.js";import"./index-724SdE6r.js";import"./NewChatOrigin-DFbF_XvR.js";import"./keyboard-nav-DDHegDbx.js";import"./x-DAehov0E.js";import"./chevron-down-l1mrh5S9.js";import"./search-DT42oyRW.js";import"./file-text-CnISiiw6.js";import"./model-CBkMvT1w.js";import"./time-Dhsh_2EG.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./conversations-DoAAO6kA.js";const he=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],pe=me("user-plus",he),Y=150,B=320,ue=1.4,xe=1.1,G=5,fe=22,J=5200,ve=1,ge=1200;function je(n){S.useEffect(()=>{const s=n.current;if(!s||window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;let i=[],r=[],d=-9999,x=-9999,m=0;const c=()=>{i=[],r=[],s.querySelectorAll(".sprite-cell--eye circle").forEach(o=>{const a=o.getBoundingClientRect();if(!a.width)return;const u=o.closest("[data-state]");i.push({el:o,cx:a.left+a.width/2,cy:a.top+a.height/2,working:u?.dataset.state==="in_flight"})}),s.querySelectorAll(".s-thread-participant-avatar svg").forEach(o=>{const a=o.getBoundingClientRect();a.width&&r.push({el:o,cx:a.left+a.width/2,cy:a.top+a.height/2})})},E=o=>o<Y?1:o>B?0:(B-o)/(B-Y),j=o=>{for(const a of i){const u=d-a.cx,y=x-a.cy,p=Math.hypot(u,y),v=E(p),b=p<1?1:p;let A=u/b*ue*v;const L=y/b*xe*v;if(a.working&&v<1){const w=o%J/J;A+=Math.sin(w*Math.PI*2)*ve*(1-v)}a.el.style.transform=`translate(${A.toFixed(2)}px, ${L.toFixed(2)}px)`}for(const a of r){const u=d-a.cx,y=Math.hypot(u,x-a.cy),p=E(y),v=Math.max(-G,Math.min(G,u/fe))*p;a.el.style.transform=v===0?"":`rotate(${v.toFixed(2)}deg)`}m=requestAnimationFrame(j)},f=o=>{d=o.clientX,x=o.clientY};c();const h=window.setInterval(c,ge);return m=requestAnimationFrame(j),window.addEventListener("resize",c),document.addEventListener("pointermove",f,{passive:!0}),()=>{cancelAnimationFrame(m),window.clearInterval(h),window.removeEventListener("resize",c),document.removeEventListener("pointermove",f);for(const o of i)o.el.style.transform="";for(const o of r)o.el.style.transform=""}},[n])}function I(n,s,i){const r=i?Z[i.trim().toLowerCase()]:void 0;return{"--fp-z":String(n-s),"--fp-i":String(s),...r==null?{}:{"--fp-suit-hue":String(r)}}}function be(n){if(n<1e3)return String(n);const s=n/1e3;return s<10?`${s.toFixed(1).replace(/\.0$/,"")}k`:`${Math.round(s)}k`}function T({name:n,runtime:s,state:i,action:r}){return e.jsxs("span",{className:"s-thread-participant-card","aria-hidden":"true",children:[e.jsx("strong",{children:n}),s?e.jsx("span",{children:s}):null,e.jsx("span",{children:i}),r?e.jsx("span",{className:"s-thread-participant-card-action",children:r}):null]})}function H({count:n,className:s,style:i,rosterId:r,expanded:d,onClick:x}){const m=`${n} more participant${n===1?"":"s"}`;return e.jsx("button",{type:"button",className:`s-thread-participant s-thread-participant--button ${s}`,style:i,"aria-label":`${m}; open participant list`,"aria-haspopup":"dialog","aria-controls":r,"aria-expanded":d,onClick:x,children:e.jsxs("span",{className:"s-thread-participant-face s-thread-participant-face--overflow",children:["+",be(n)]})})}const ye=[{id:"thread",label:"Thread",hint:"The conversation in order"},{id:"flow",label:"Flow",hint:"Who asked whom, who waited, and where the work branched"},{id:"map",label:"Map",hint:"Who exchanges work with whom, and on which model"},{id:"canvas",label:"Canvas",hint:"The same window laid out left to right, with nobody folded away"}];function Nt({showBackNav:n,backLabel:s,isDm:i,navigate:r,route:d,canonicalConversationId:x,threadTitle:m,agentId:c,sessionId:E,detailRoute:j,participants:f,operator:h,canAddParticipants:o,onToggleAddParticipant:a,view:u,onChangeView:y,beside:p}){const v=se(),b=ee(d),A=S.useRef(null),L=S.useRef(null),w=S.useId(),[N,C]=S.useState(!1);je(A);const $=f.slice(0,3),z=Math.max(f.length-$.length,0),U=Math.max(f.length-2,0),W=Math.max(f.length-1,0),k=$.length+(z>0?1:0)+(h.active?1:0);S.useEffect(()=>{if(!N)return;const t=g=>{L.current?.contains(g.target)||C(!1)},l=g=>{g.key==="Escape"&&C(!1)};return document.addEventListener("mousedown",t),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("keydown",l)}},[N]);const O=t=>t.agent?{view:"agents-v2",agentId:t.agent.id,...b?{machineId:b}:{}}:t.sessionId?{view:"sessions",sessionId:t.sessionId,...b?{machineId:b}:{}}:null,q=t=>{const l=O(t);l&&(C(!1),_(r,l,{returnTo:d}))};return e.jsxs("div",{className:"s-thread-center-header",onClick:t=>{t.target?.closest("button,a,input,select,textarea")||!i||!j||_(r,j,{returnTo:d})},style:i&&j?{cursor:"pointer"}:void 0,onContextMenu:t=>{const l=[{kind:"action",label:"Copy Title",onSelect:()=>{M(m)}}];c&&l.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{M(c)}}),!c&&E&&l.push({kind:"action",label:"Copy Session ID",onSelect:()=>{M(E)}}),l.push({kind:"action",label:"Copy Conversation ID",onSelect:()=>{M(x)}}),v(t,l)},children:[n&&e.jsx(re,{slot:"conversation",fallback:{view:"inbox"},navigate:r,label:s??"Back",className:"s-thread-header-back"}),e.jsx("div",{className:"s-thread-center-header-info",children:i&&j?e.jsx("button",{type:"button",className:"s-thread-center-header-name",title:`Open ${m} details`,onClick:()=>_(r,j,{returnTo:d}),children:m}):e.jsx("span",{className:"s-thread-center-header-name",title:m,children:m})}),e.jsxs("div",{className:"s-thread-center-header-right",children:[e.jsx("div",{className:"s-thread-view-toggle",role:"group","aria-label":"Conversation view",children:ye.map(t=>e.jsx("button",{type:"button",className:`s-thread-view-option${u===t.id?" s-thread-view-option--on":""}`,"aria-pressed":u===t.id,title:t.hint,onClick:()=>y(t.id),children:t.label},t.id))}),f.length>0&&e.jsxs("div",{className:"s-thread-participants",ref:t=>{A.current=t,L.current=t},"aria-label":"Conversation participants",children:[$.map((t,l)=>{const g=[t.harness,t.model,t.reasoningEffort].filter(Boolean).join(" · ")||null,F=t.agent?ne(t.agent.state??null,t.agent):null,D=t.agent?ae(t.agent.state??null,t.agent):"Session participant",V=O(t),X=V?t.agent?"Open profile":"Open session":null,Q=[t.name,g,D,X].filter(Boolean).join(", "),K=e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"s-thread-participant-face",children:[e.jsx(oe,{}),e.jsx(P,{agent:t.agent??void 0,name:t.name,placement:"turn",size:28,className:"s-thread-participant-avatar",gaze:"pointer"})]}),t.harness?e.jsx(te,{harness:t.harness,size:9,className:"s-thread-participant-harness",title:null}):null,e.jsx(T,{name:t.name,runtime:g,state:D,action:X})]}),R={className:"s-thread-participant",style:I(k,l,t.harness),"data-state":F??void 0,"data-compact-hidden":l>=2?"true":void 0,"data-narrow-hidden":l>=1?"true":void 0,"aria-label":Q};return V?e.jsx("button",{type:"button",...R,className:`${R.className} s-thread-participant--button`,onClick:()=>q(t),children:K},t.id):e.jsx("span",{...R,role:"group",tabIndex:0,children:K},t.id)}),z>0?e.jsx(H,{count:z,className:"s-thread-participant--desktop-overflow",style:I(k,$.length),rosterId:w,expanded:N,onClick:()=>C(t=>!t)}):null,U>0?e.jsx(H,{count:U,className:"s-thread-participant--compact-overflow",style:I(k,2),rosterId:w,expanded:N,onClick:()=>C(t=>!t)}):null,W>0?e.jsx(H,{count:W,className:"s-thread-participant--narrow-overflow",style:I(k,1),rosterId:w,expanded:N,onClick:()=>C(t=>!t)}):null,h.active?e.jsxs("span",{className:"s-thread-participant s-thread-participant--operator",style:I(k,k-1),role:"group",tabIndex:0,"aria-label":`${h.name}, you, in this conversation`,children:[e.jsx("span",{className:"s-thread-participant-face",children:e.jsx(P,{name:h.name,placement:"turn",size:28,className:"s-thread-participant-avatar",gaze:"pointer"})}),e.jsx(T,{name:`${h.name} (you)`,runtime:null,state:"In this conversation",action:null})]}):e.jsxs("span",{className:"s-thread-participant-observer",role:"group",tabIndex:0,"aria-label":`${h.name}, observing, not in this conversation`,children:[e.jsx(ce,{size:15,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx(T,{name:h.name,runtime:null,state:"Observing, not in this conversation",action:null})]}),N?e.jsxs("div",{id:w,className:"s-thread-participant-roster",role:"dialog","aria-label":"Conversation participants",onClick:t=>t.stopPropagation(),children:[e.jsx("strong",{className:"s-thread-participant-roster-title",children:"Participants"}),e.jsxs("div",{className:"s-thread-participant-roster-list",children:[f.map(t=>{const l=O(t),g=[t.harness,t.model].filter(Boolean).join(" · "),F=e.jsxs(e.Fragment,{children:[e.jsx(P,{agent:t.agent??void 0,name:t.name,placement:"turn",size:24,className:"s-thread-participant-roster-avatar"}),e.jsxs("span",{children:[e.jsx("strong",{children:t.name}),g?e.jsx("small",{children:g}):null]})]});return l?e.jsx("button",{type:"button",className:"s-thread-participant-roster-row",onClick:()=>q(t),children:F},t.id):e.jsx("div",{className:"s-thread-participant-roster-row",children:F},t.id)}),h.active?e.jsxs("div",{className:"s-thread-participant-roster-row",children:[e.jsx(P,{name:h.name,placement:"turn",size:24,className:"s-thread-participant-roster-avatar"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[h.name," (you)"]}),e.jsx("small",{children:"Operator"})]})]}):null]})]}):null]}),p&&e.jsx("button",{type:"button",className:`s-thread-add-participant-trigger${p.on?" is-on":""}`,onClick:p.toggle,title:p.on?"Close the column beside the stage":"Keep this conversation beside the stage","aria-label":p.on?"Close beside":"Keep beside","aria-pressed":p.on,children:e.jsx(de,{size:14,strokeWidth:1.9,"aria-hidden":"true"})}),o&&e.jsx("button",{type:"button",className:"s-thread-add-participant-trigger",onClick:a,title:"Add participant","aria-label":"Add participant",children:e.jsx(pe,{size:14,strokeWidth:1.9,"aria-hidden":"true"})})]})]})}function Ct({canonicalConversationId:n,conversationAlias:s}){return e.jsxs("div",{className:"s-thread-identity-row",children:[e.jsxs("button",{type:"button",className:"s-thread-identity-chip",title:n,onClick:()=>{M(n)},children:[e.jsx("span",{children:ie()}),e.jsx("strong",{children:le(n)})]}),s&&e.jsxs("span",{className:"s-thread-identity-chip",title:s,children:[e.jsx("span",{children:"Alias"}),e.jsx("strong",{children:s})]})]})}function kt({agents:n,addParticipantId:s,setAddParticipantId:i,addingParticipant:r,addParticipantError:d,onCancel:x,onSubmit:m}){return e.jsxs("form",{className:"s-thread-add-participant",onSubmit:c=>{c.preventDefault(),m()},children:[e.jsxs("div",{className:"s-thread-add-participant-row",children:[e.jsxs("div",{className:"s-thread-add-participant-field",children:[e.jsx("label",{className:"s-thread-add-participant-label",htmlFor:"thread-add-participant-select",children:"Agent"}),e.jsx("select",{id:"thread-add-participant-select",className:"s-thread-add-participant-select",value:s,onChange:c=>i(c.target.value),autoFocus:!0,children:n.map(c=>e.jsx("option",{value:c.id,children:c.name},c.id))})]}),e.jsxs("div",{className:"s-thread-add-participant-actions",children:[e.jsx("button",{type:"button",className:"s-btn s-btn-sm",onClick:x,disabled:r,children:"Cancel"}),e.jsx("button",{type:"submit",className:"s-btn s-btn-primary s-btn-sm",disabled:r||s.trim().length===0,children:r?"Adding...":"Add"})]})]}),d&&e.jsx("div",{className:"s-thread-add-participant-error",children:d})]})}export{kt as AddParticipantForm,Nt as ConversationHeader,Ct as ConversationIdentityRow};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as a,j as r}from"./index-EsrkGBcv.js";import{j as wt,w as ya,k as Zt,l as Ws,m as wa,o as Sa,q as va,s as Us,t as Ta,u as xa,v as Ca}from"./NewChatComposer-C97-iTMK.js";import{a as q}from"./api-DSqpVKC7.js";import{uploadMediaFiles as ba}from"./media-blobs-Bi8pxr1u.js";import"./runtime-picker-DXu2bOTh.js";import{d as _s,u as Ma}from"./router-DCtl8wqb.js";import{u as ka}from"./ComposerAttachments-DW0AIb8k.js";import"./index-724SdE6r.js";import{b as Ia}from"./machine-scope-DJt9RZ2w.js";import{d as Aa,b as Na,e as ja,l as J,q as Vs,u as Ra,v as Me,w as Ea,x as La,y as Fa,z as $a,s as Oa,c as Ks,S as Qs,A as Pa,B as qa,C as Da,D as Ba,g as zs,E as Ha,F as Wa,k as Ua,p as _a,r as es,G as Va,H as Ka,I as Qa,J as za,K as Ja,L as Js,M as Ga,N as Ya,O as Ge,P as Xa,Q as Za,R as Gs,T as er,U as tr,V as sr,W as nr,X as Ys,Y as ar,Z as Xs,_ as rr,a as or,$ as ir,a0 as lr}from"./conversation-model-FxDeWlle.js";import{u as cr}from"./sse-BCPRocpq.js";import{n as ts,t as St,f as Zs}from"./time-Dhsh_2EG.js";import{s as dr,h as ur,e as mr,T as en,b as hr,j as pr,k as fr,g as gr}from"./conversations-DoAAO6kA.js";import{M as yr}from"./message-markup-Zwo3t4cI.js";import{a as ss,i as ns,b as wr}from"./message-visibility-DwxgcgYK.js";import{d as Sr}from"./operator-attention-DBaRg5ep.js";import{f as as,a as vr}from"./scoutbot-Bk3nyrkj.js";import{s as Tr}from"./sessionRead-CvFz2RHv.js";import{u as xr,a as Cr}from"./Provider-C35yu29I.js";import{o as Ye}from"./openContent-C6XO6kr5.js";import{c as Xe}from"./clipboard-e3fSpeo7.js";import{M as br}from"./MessageEmbeds-ksPazAKH.js";import{A as rs}from"./AgentAvatar-CrP1eXxk.js";import{d as Mr}from"./types-B0PlfpKc.js";/* empty css */import{ConversationHeader as kr,ConversationIdentityRow as Ir,AddParticipantForm as Ar}from"./ConversationHeader-C-ZWscKj.js";import{CommsFlowPane as Nr}from"./CommsFlowGraph-DxoOaLF_.js";import{a as jr}from"./use-beside-DoRC1nt0.js";import{ConversationComposer as Rr}from"./ConversationComposer-CUQyArlk.js";import{FanOutRow as Er,ThreadDayDivider as Lr}from"./ConversationFeedRows-DWiOfT-y.js";import{T as Fr,t as tn,m as sn,a as $r,b as Or,o as Pr,d as qr,s as Dr,l as Br,c as Hr,e as Wr,W as Ur,f as _r,g as Vr}from"./ConversationPanels-D9oC0xG5.js";import{u as Kr}from"./tail-events-d0yAYxR0.js";import{PinnedAskCard as Qr,ConversationStatusStrip as zr,ConversationFlightOutcome as Jr}from"./ConversationStatus--IPm2nGh.js";import{S as Gr}from"./SessionContextStrip-CXfs9hUD.js";import"./createLucideIcon-zZ8Hx7er.js";import"./HarnessMark-C4naWc16.js";import"./colors-CFlbwC25.js";import"./agent-state-DDhnFEEP.js";import"./NewChatOrigin-DFbF_XvR.js";import"./keyboard-nav-DDHegDbx.js";import"./x-DAehov0E.js";import"./chevron-down-l1mrh5S9.js";import"./search-DT42oyRW.js";import"./loader-circle-OvccU82H.js";import"./file-text-CnISiiw6.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./index-BWHgHrtv.js";import"./message-markup-BQW5jdJw.js";import"./mentions-ByUvhS-v.js";import"./AgentDetailCard-DtHT3sCo.js";import"./AgentLiveActions-CfTupTEl.js";import"./terminal-takeover-Ay5C2c-M.js";import"./eye-LrO-cXQt.js";import"./terminal-hQKQygcf.js";import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./surface-activity-B1rgWB1i.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./SpriteAvatar-CpZWf54-.js";import"./CrewAvatar-kTznzqcO.js";import"./BackToPicker-CUkjnoVk.js";import"./AstronautSuit-Cchnc4Ug.js";import"./panel-right-Bv7sP_fc.js";import"./comms-gesture-_aGFo6g3.js";import"./CommsCanvas-THp0r_U8.js";import"./comms-deck-CBhsXnY-.js";import"./CommsFlowMap-Vi8ziCPg.js";import"./CommsSelection-BUoRbu9o.js";/* empty css */import"./use-conversation-list-CY4JciOV.js";import"./agent-master-model-Bk_yuUXJ.js";import"./zap-CEjZNZbI.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./use-reduced-motion-3gMYZNIp.js";import"./proxy-AJsmwA6h.js";import"./activity-CIlFrfPJ.js";import"./message-circle-CxRVKNE-.js";import"./check-lrJ3a73a.js";import"./sparkles-BjHq_DNK.js";import"./triangle-alert-CHoRGdVO.js";const ln="scout:conversations:failure-dismissals:v1",Yr=64;let is={};function cn(){try{if(typeof localStorage<"u"){const o=JSON.parse(localStorage.getItem(ln)??"null");eo(o)&&(is=ls(o))}}catch{}return ls(is)}function Xr(o){is=ls(o);try{typeof localStorage<"u"&&localStorage.setItem(ln,JSON.stringify(o))}catch{}}function nn(o){return new Set(cn()[o]??[])}function Zr(o,m){const u=cn(),S=(u[o]??[]).filter(D=>D!==m);S.push(m),u[o]=S.slice(-100);const b=Object.keys(u);for(const D of b.slice(0,Math.max(0,b.length-Yr)))delete u[D];return Xr(u),new Set(u[o])}function ls(o){return Object.fromEntries(Object.entries(o).map(([m,u])=>[m,[...u]]))}function eo(o){return!o||typeof o!="object"||Array.isArray(o)?!1:Object.values(o).every(m=>Array.isArray(m)&&m.every(u=>typeof u=="string"&&u.length>0))}function to(o){const{sessionIds:m,active:u}=o,S=m.join("|"),b=u&&m.length>0,[D,ke]=a.useState([]);return a.useEffect(()=>{ke([])},[S]),a.useEffect(()=>{if(!b)return;let G=!1;const pe=new URLSearchParams({limit:String(Fr*3),transcripts:"true"});return q(`/api/tail/recent?${pe.toString()}`).then(O=>{if(G)return;const Ie=(O.events??[]).filter(B=>tn(B,m));Ie.length!==0&&ke(B=>sn(B,Ie))}).catch(()=>{}),()=>{G=!0}},[b,S]),Kr(G=>{b&&tn(G,m)&&ke(pe=>sn(pe,[G]))},b),a.useMemo(()=>b?$r(D):[],[b,D])}const so=3500;function an(o){const m=o?.trim().replace(/^#/,"");if(!m?.startsWith("msg-"))return null;const u=m.slice(4).trim();if(!u)return null;try{return decodeURIComponent(u)}catch{return u}}const no=64;function ao(o){const m=o?.clientMessageId;return typeof m=="string"&&m.trim()?m.trim():null}function rn(o){const m=o.body.replace(/\s+/gu," ").trim();if(m)return m.length>180?`${m.slice(0,179).trimEnd()}…`:m;const u=o.attachments?.length??0;return u===1?"Attachment":u>1?`${u} attachments`:"Message"}function on(o,m){const u=o.toLocaleLowerCase().indexOf(m.toLocaleLowerCase());if(u<0)return o;const S=o.slice(0,u),b=o.slice(u+m.length);return!S&&b.startsWith(" ")?b.slice(1):S.endsWith(" ")&&b.startsWith(" ")?`${S}${b.slice(1)}`:`${S}${b}`}function ro(o){return o instanceof TypeError||typeof DOMException<"u"&&o instanceof DOMException&&o.name==="AbortError"}function Ji({conversationId:o,initialDraft:m,navigate:u,embedded:S,showBackNav:b=!0,beside:D,backLabel:ke,treatment:G="standard"}){const{agents:pe,route:O,openContextCapture:Ie}=xr(),B=_s(O),T=a.useMemo(()=>Ia(pe,B),[pe,B]),[c,vt]=a.useState(null),cs=a.useRef(null);cs.current=c;const Ze=a.useMemo(()=>wt(o),[o]),[dn,un]=a.useState(()=>Ze?{[o]:Ze}:{}),y=dn[o]??Ze??[],[mn,ds]=a.useState(()=>Ze!==null),Ae=a.useRef(null),us=a.useMemo(()=>{const e=Ae.current;return e===null?null:new Set(y.filter(t=>!e.has(t.id)).map(t=>t.id))},[y]),et=Ae.current===null&&y.length>0;a.useEffect(()=>{if(y.length===0)return;const e=Ae.current??new Set;for(const t of y)e.add(t.id);Ae.current=e},[y]),a.useEffect(()=>{Ae.current=null,ds(wt(o)!==null)},[o]);const ms=!mn&&y.length===0,K=a.useCallback(e=>{un(t=>{const s=t[o]??wt(o)??[],n=typeof e=="function"?e(s):e,i=ya(o,n);return{...t,[o]:i}})},[o]),hn=Zt(o),[p,fe]=a.useState(hn),[Tt,xt]=a.useState(null),[Ne,je]=a.useState([]),[tt,Ct]=a.useState(null),[st,Re]=a.useState(null),[nt,pn]=a.useState(()=>typeof window>"u"?null:an(window.location.hash)),[hs,se]=a.useState(null),[bt,ps]=a.useState(()=>nn(o)),[ge,Mt]=a.useState(!1),[fn,Ee]=a.useState(!1),[kt,at]=a.useState(0),Le=a.useRef(null),Fe=a.useRef(null),gn=a.useRef(null),$e=a.useRef(!0),rt=a.useRef(!1),ye=a.useRef(null),M=a.useRef(null),Oe=a.useRef(new Set),Pe=a.useRef(null),fs=a.useRef(0),gs=a.useRef(null),qe=a.useRef(null),De=a.useRef(new Set),Y=a.useRef(o);Y.current=o;const ne=a.useRef(new Map),yn=Ws(o),ot=a.useRef(!1);a.useLayoutEffect(()=>{const e=Fe.current,t=Le.current;!e||!t||(t.scrollTop=e.scrollTop+(t.scrollHeight-e.scrollHeight),Fe.current=null,ot.current=!0)}),a.useEffect(()=>{Mt(!1),Fe.current=null,ot.current=!1,$e.current=!0,rt.current=!1,Ee(!1),at(0),Vt(new Set),ne.current.clear(),fe(Zt(o)),xt(null),ps(nn(o))},[o]);const it=a.useCallback(async e=>{let s=typeof e.metadata?.flightId=="string"?e.metadata.flightId.trim():"";if(!s&&e.replyToMessageId)try{s=(await q(`/api/flights?conversationId=${encodeURIComponent(o)}&active=false`)).find(i=>i.messageId===e.replyToMessageId)?.id??""}catch{}await Sr({...s?{flightId:s}:{},conversationId:o,messageId:e.replyToMessageId??e.id,itemUpdatedAt:ts(e.createdAt)??Date.now()})},[o]),ys=a.useCallback(e=>{const t=e.replyToMessageId??e.id;ps(Zr(o,e.id)),as({type:"dismiss-conversation-failure",conversationId:o,messageId:t,reason:"The operator cleared this delivery issue"});const s=`${o}:${e.id}`;De.current.add(s),it(e).catch(()=>{De.current.delete(s)})},[o,it]);a.useEffect(()=>{for(const e of y){if(!bt.has(e.id)||!ss(e))continue;const t=`${o}:${e.id}`;De.current.has(t)||(De.current.add(t),it(e).catch(()=>{De.current.delete(t)}))}},[o,bt,y,it]);const x=c?.agentId??null,C=c?.kind==="direct",lt=a.useMemo(()=>new Set([o,...c?.equivalentConversationIds??[]]),[o,c?.equivalentConversationIds]),_=a.useMemo(()=>x?T.find(e=>e.id===x)??null:null,[T,x]),ws=Aa(c),Ss=Na(c),wn=ja({resolvedAgentId:_?.id,sessionId:ws,machineId:B}),[It,vs]=a.useState(null);a.useEffect(()=>{q("/api/fleet").then(e=>{vs(t=>J(t,Vs(e.activeAsks,o,x)))}).catch(()=>{})},[o,x]);const R=a.useCallback(async(e={})=>{const t=e.messageMode??"none",s=e.includeMetadata??!0;se(null);try{const n=s?await q(`/api/session/${encodeURIComponent(o)}`).catch(()=>null):cs.current;if(Y.current!==o)return;vt(w=>J(w,n));const i=n?.agentId??null,l=n?.id&&n.id!==o?n.id:o;if(l!==o){u({view:"conversation",conversationId:l});return}const d=wt(l),A=wa(l),f=t==="initial"&&!A,h=t==="refresh"||t==="initial",g=Promise.all([q(`/api/flights?conversationId=${encodeURIComponent(l)}&active=false`).catch(()=>[]),q("/api/fleet?limit=24&activityLimit=160").catch(()=>Ra())]),W=await(f?Sa(l):h?va(l,{refresh:!0}):Promise.resolve(d));if(Y.current!==o)return;const j=Me(W??[]),he=j.filter(w=>!ns(w));W&&K(w=>J(w,Ea(w,he))),ds(!0),Tr(l);const N=j.at(-1);N&&qe.current!==N.id&&(qe.current=N.id,q(`/api/conversations/${encodeURIComponent(l)}/read-cursor`,{method:"POST",body:JSON.stringify({lastReadMessageId:N.id})}).catch(()=>{qe.current===N.id&&(qe.current=null)}));const[Q,V]=await g;if(Y.current!==o)return;const U=La(Q),z=Zt(l),be=U??z;Oe.current=new Set([...Q.map(w=>w.invocationId),...z?.invocationId?.startsWith("pending:")?[]:z?.invocationId?[z.invocationId]:[]]),U&&z?.id===U.id&&Us(l,U.id);const F=be?.agentId??i??null,Xt=Fa(V.activity,be,l,F),yt=$a(V.activeAsks,be,l,F);fe(w=>J(w,be)),xt(w=>J(w,Oa(Q))),je(w=>J(w,Xt)),Re(w=>J(w,yt)),vs(w=>J(w,Vs(V.activeAsks,l,i)))}catch(n){if(Y.current!==o)return;se(n instanceof Error?n.message:String(n))}},[o,u,K]);a.useEffect(()=>{R({messageMode:"initial"})},[R]),a.useEffect(()=>{qe.current=null},[o]),a.useEffect(()=>{Pe.current=p},[p]);const Sn=a.useCallback(async()=>{if(ge||!Ws(o))return;const e=Le.current,t=e?{scrollHeight:e.scrollHeight,scrollTop:e.scrollTop}:null;Mt(!0),se(null);try{const s=await Ta(o);if(Y.current!==o)return;t&&(Fe.current=t),K(Me(s).filter(n=>!ns(n)))}catch(s){Y.current===o&&se(s instanceof Error?s.message:String(s))}finally{Y.current===o&&Mt(!1)}},[o,ge,K]),[k,P]=a.useState(()=>m??""),[ae,re]=a.useState(null),[H,ct]=a.useState(!1),[v,vn]=a.useState("operator"),[oe,Be]=a.useState({open:!1,query:"",triggerStart:-1,index:0}),[ie,He]=a.useState({open:!1,query:"",triggerStart:-1,index:0}),[E,X]=a.useState(null),[At,dt]=a.useState(!1),[Nt,ut]=a.useState(""),[Tn,We]=a.useState(null),[xn,jt]=a.useState(!1);a.useEffect(()=>{dt(!1),ut(""),We(null),jt(!1)},[o]),a.useEffect(()=>{if(!m)return;const e=`${o}:${m}`;gs.current!==e&&(gs.current=e,P(m),requestAnimationFrame(()=>M.current?.focus()))},[o,m]);const Z=a.useMemo(()=>{const e=new Map;for(const t of c?.participants??[])e.set(t.actorId,t),t.agentId&&e.set(t.agentId,t);return e},[c]),Rt=a.useMemo(()=>{const e=new Set,t=[];for(const s of c?.participantIds??[]){if(s==="operator")continue;const n=Z.get(s),i=n?.scopedAlias?.trim().replace(/^@+/,"");if(!i)continue;const l=i.toLowerCase();e.has(l)||(e.add(l),t.push({id:s,label:n?.label??n?.displayName??i,name:n?.displayName??i,handle:i}))}for(const s of T){const n=s.handle?.trim().replace(/^@+/,"")??Ks(s.id)??s.id;if(!n)continue;const i=n.toLowerCase();e.has(i)||(e.add(i),t.push({id:s.id,label:n,name:s.name??n,handle:n}))}return t.sort((s,n)=>s.handle.localeCompare(n.handle))},[Z,T,c]),Cn=a.useMemo(()=>{if(!oe.open)return[];const e=oe.query.toLowerCase();return e?Qs.filter(t=>t.command.toLowerCase().startsWith("/"+e)||t.command.toLowerCase().includes(e)):Qs},[oe.open,oe.query]),bn=a.useMemo(()=>{if(!ie.open)return[];const e=ie.query.toLowerCase();return e?Rt.filter(t=>t.handle.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||t.label.toLowerCase().includes(e)).slice(0,8):Rt.slice(0,8)},[ie.open,ie.query,Rt]),Mn=a.useCallback(()=>{Be(e=>e.open?{...e,open:!1}:e),He(e=>e.open?{...e,open:!1}:e)},[]),kn=a.useCallback((e,t)=>{const s=Pa(e,t);Be(s?i=>({open:!0,query:s.query,triggerStart:s.start,index:i.open&&i.triggerStart===s.start?i.index:0}):i=>i.open?{...i,open:!1}:i);const n=qa(e,t);He(n?i=>({open:!0,query:n.query,triggerStart:n.start,index:i.open&&i.triggerStart===n.start?i.index:0}):i=>i.open?{...i,open:!1}:i)},[]),In=a.useCallback(e=>{const t=M.current,s=oe.triggerStart;if(s<0)return;const n=t?.selectionStart??k.length,i=k.slice(0,s),l=k.slice(n),d=e.insert,A=`${i}${d}${l}`;P(A),Be(f=>({...f,open:!1})),requestAnimationFrame(()=>{const f=M.current;if(!f)return;const h=i.length+d.length;f.focus(),f.setSelectionRange(h,h)})},[k,oe.triggerStart]),An=a.useCallback(e=>{const t=M.current,s=ie.triggerStart;if(s<0)return;const n=t?.selectionStart??k.length,i=k.slice(0,s),l=k.slice(n),d=l.length===0||!l.startsWith(" "),A=`@${e.handle}${d?" ":""}`,f=`${i}${A}${l}`;P(f),He(h=>({...h,open:!1})),requestAnimationFrame(()=>{const h=M.current;if(!h)return;const g=i.length+A.length;h.focus(),h.setSelectionRange(g,g)})},[k,ie.triggerStart]);a.useEffect(()=>{const e=M.current;if(!e)return;e.style.height="0px";const t=Math.min(Math.max(e.scrollHeight,40),160);e.style.height=`${t}px`,e.style.overflowY=e.scrollHeight>t?"auto":"hidden"},[k]),a.useEffect(()=>{q("/api/user").then(e=>vn(e.name)).catch(()=>{})},[]);const mt=a.useMemo(()=>Da(y,v),[y,v]);a.useEffect(()=>{E===null||mt===null||mt>=E&&X(null)},[E,mt]);const Nn=a.useMemo(()=>dr(p),[p]),we=Date.now(),jn=ur(p,mt,we),Et=Nn&&!mr(p)&&!jn,Ts=C&&(H||E!==null||Et),xs=C&&Ba({sending:H,awaitingResponse:E!==null,currentFlight:p}),L=zs({name:_?.name,agentName:c?.agentName,id:x,title:c?.title}),I=a.useMemo(()=>C?Ha({agentName:L,agentState:_?.state??null,sending:H,currentFlight:p,showWorkingTurn:Et,awaitingResponse:E!==null}):{label:"Open",detail:"",tone:"idle",showStrip:!1,showTyping:!1},[_?.state,L,E,p,we,C,H,Et]),Lt=p?.startedAt??st?.startedAt??E,Ft=ts(Lt),Cs=ar(Lt,we),[,Rn]=a.useState(0);a.useEffect(()=>{if(!I.showTyping||Ft===null)return;const e=Math.max(0,Date.now()-Ft),t=[Ys.sustained,Ys.long].find(n=>n>e);if(t===void 0)return;const s=window.setTimeout(()=>Rn(n=>n+1),t-e+50);return()=>window.clearTimeout(s)},[Ft,I.showTyping,Cs]);const En="Live",$t=a.useMemo(()=>Wa({currentFlight:p,presence:I,turnActivity:Ne,turnAsk:st,awaitingResponseSince:E,nowMs:we}),[E,p,we,I,Ne,st]),Ln="s-thread-msg-card s-thread-msg-working-card s-thread-msg-card--avatar-row",Fn="s-thread-msg-kind",$n="s-thread-turn-snapshot",On="s-thread-turn-snapshot-pulse",Pn="s-thread-presence-line",qn=["s-thread-presence-strip",`s-thread-presence-strip--${Cs}`].filter(Boolean).join(" "),Ot=c?Ua(c):L,Ue=c?.id??o,Dn=c?.alias?.trim()||null,ht=_a(c?.workspaceRoot),Bn=I.tone,Pt=y.length===0&&C&&(I.showTyping||p!==null||Ne.length>0||st!==null||E!==null),Se=Tt&&en.has(Tt.state)?Tt:null,Hn=!!(Se&&y.some(e=>ss(e)!==null&&e.metadata?.flightId===Se.id)),bs=Se?.sessions.at(-1)?.sessionId??Ss,Wn=Se&&bs?()=>{const e=or({sessionId:bs,machineId:B});e&&Ye(u,e,{returnTo:O})}:void 0,Ms=a.useMemo(()=>c?c.participantIds.includes("operator"):C,[C,c]),_e=p?.agentId??x,Ve=_e?es(T,[_e]):null,Ke=Ve?.id??_e,Qe=p?.sessions.at(-1)?.sessionId??Ve?.harnessSessionId??void 0,ks=p?.id?()=>{Ye(u,{view:"sessions",flightId:p.id,...Ke?{agentId:Ke}:{},...Qe?{sessionId:Qe}:{},...B?{machineId:B}:{}},{returnTo:O})}:void 0,Is=p?.id??null;a.useEffect(()=>{if(!Is||!Ke){Ct(null);return}let e=!1;const t=Qe?`?sessionId=${encodeURIComponent(Qe)}`:"",s=async()=>{try{const i=await q(`/api/agents/${encodeURIComponent(Ke)}/observe${t}`);if(e)return;Ct(l=>J(l,i))}catch{}};s();const n=window.setInterval(()=>{s()},so);return()=>{e=!0,window.clearInterval(n),Ct(null)}},[Is,Ke,Qe]);const qt=a.useMemo(()=>Or({flight:p,agent:Ve??_,sessionMeta:c,observeSessionId:tt?.sessionId}),[_,p,c,tt?.sessionId,Ve]),As=to({sessionIds:qt,active:I.showTyping||Pt}),Un=a.useMemo(()=>Pr({observe:tt,flight:p}),[p,tt]),ee=As.length>0?As:Un,Dt=a.useMemo(()=>ee.length>0?null:qr({flight:p,hasSessionScope:qt.length>0,awaitingResponse:E!==null}),[E,p,qt.length,ee.length]),Bt=Dr(ee),Ht=Br(ee),Ns=ee.at(-1)??null,Wt=Ns?St(Ns.ts,we):null,le=a.useMemo(()=>Ht?{...$t,latest:Ht,...Bt?{activityLabel:Bt}:{},...Wt?{lastActivityLabel:Wt}:{}}:$t,[Wt,Ht,$t,Bt]),_n=`${L}: ${le.latest}`,js=_e&&Va(Ve)?()=>{Ye(u,{view:"terminal",agentId:_e,mode:"takeover"},{returnTo:O})}:void 0,Ut=C?()=>{S&&as({type:"focus-composer",reason:"Steer the active conversation"})||requestAnimationFrame(()=>{M.current?.focus({preventScroll:!0}),M.current?.scrollIntoView({block:"nearest"})})}:void 0,[ve,Rs]=a.useState(()=>{if(S||typeof window>"u")return"thread";const e=new URLSearchParams(window.location.search).get("view");return e==="flow"||e==="map"||e==="canvas"?e:"thread"}),Vn=a.useCallback(e=>Rs(e),[]),Es=jr(u,_s(O)??void 0),Kn=a.useCallback(e=>{Rs("thread"),Es(e)},[Es]),Qn=Ma();a.useEffect(()=>{if(S||typeof window>"u")return;const e=new URL(window.location.href),t=ve==="thread"?"":ve;(e.searchParams.get("view")??"")!==t&&(t?e.searchParams.set("view",t):e.searchParams.delete("view"),window.history.replaceState(window.history.state,"",`${e.pathname}${e.search}${e.hash}`))},[S,ve,Qn.searchStr]);const zn=a.useMemo(()=>(c?c.participantIds.filter(t=>t!=="operator"):x?[x]:[]).map(t=>{const s=es(T,[t]),n=Z.get(t);return{id:t,name:n?.scopedAlias??s?.name??n?.displayName??Ks(t)??t,title:n?.label??s?.id??t,agent:s,sessionId:n?.sessionId??null,harness:s?.harness??n?.harness??null,model:s?.model??null,reasoningEffort:s?.reasoningEffort??null}}),[x,Z,T,c]),Jn=a.useMemo(()=>({name:v,active:Ms}),[Ms,v]),ce=a.useMemo(()=>new Map(y.map(e=>[e.id,e])),[y]),_t=a.useMemo(()=>T.find(e=>vr(e)&&!!e.conversationId?.trim())?.conversationId?.trim()??null,[T]),ze=a.useMemo(()=>Ka(y),[y]),[Gn,Vt]=a.useState(()=>new Set),Yn=a.useCallback(e=>{Vt(t=>{const s=new Set(t);return s.delete(e)||s.add(e),s})},[]),Ls=a.useMemo(()=>{const e=new Map;for(const t of ze)if(t.kind==="fanout")for(const s of t.messages)e.set(s.id,t.key);return e},[ze]),pt=a.useCallback(e=>{const t=Ls.get(e);t&&Vt(l=>l.has(t)?l:new Set(l).add(t));const s=document.getElementById(`msg-${e}`);if(!s)return;const n=s.closest(".s-thread-fanout")??s,i=n===s?"s-thread-msg--flash":"s-thread-fanout--flash";n.scrollIntoView({behavior:"smooth",block:"center"}),n.classList.add(i),window.setTimeout(()=>n.classList.remove(i),1200)},[Ls]);a.useEffect(()=>{const e=()=>pn(an(window.location.hash));return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),a.useEffect(()=>{if(!nt||!ce.has(nt))return;const e=window.setTimeout(()=>pt(nt),50);return()=>window.clearTimeout(e)},[nt,ce,pt]),cr(a.useCallback(e=>{if(e.kind==="message.posted"){const t=e.payload?.message;if(!t||!lt.has(t.conversationId))return;const s=t.actorId==="operator",n=C&&!s&&t.class==="agent",i={id:t.id,conversationId:t.conversationId,actorId:t.actorId,actorName:n?L:Qa(t.actorId,T,v),body:t.body,createdAt:t.createdAt,class:s?"operator":t.class,attachments:t.attachments,metadata:t.metadata,replyToMessageId:t.replyToMessageId??t.n??null};if(ns(i))return;if(K(l=>{const d=ao(t.metadata),A=d?ne.current.get(d):void 0;if(l.some(f=>f.id===t.id))return d&&ne.current.delete(d),l;if(s&&d){const f=za(l,d,A);if(f!==-1){const h=[...l];return h[f]=i,ne.current.delete(d),Me(h)}}return Me([...l,i])}),n){const l=ts(t.createdAt)??Date.now();X(d=>d===null||l<d||hr(Pe.current)?d:null),fe(d=>pr(d)?null:d)}return}if(e.kind==="invocation.requested"){const t=e.payload?.invocation;if(!Ja(t,lt))return;Oe.current.add(t.id),je([]),Re(null),X(s=>s??Date.now()),R({messageMode:"none",includeMetadata:!1});return}if(e.kind==="conversation.upserted"){const t=e.payload?.conversation;t?.id&<.has(t.id)&&R({messageMode:"none",includeMetadata:!1});return}if(e.kind==="flight.updated"){const t=e.payload?.flight;if(!t||!(Oe.current.has(t.invocationId)||Pe.current?.id===t.id))return;const n=Js(t,o,x??"",Pe.current);if(xt(l=>Ga(l,n)),en.has(t.state)){Us(o,t.id),fe(l=>l?.id===t.id?null:l),je([]),Re(null),X(null),R({messageMode:"refresh",includeMetadata:!1});return}Oe.current.add(t.invocationId);const i=Pe.current?.id===t.id;fr(n)&&X(null),fe(n),i||(je([]),Re(null));return}e.kind!=="agent.endpoint.upserted"&&e.kind==="unknown"&&R({messageMode:"refresh"})},[x,L,o,lt,C,R,v,T])),a.useEffect(()=>{if(!Ts)return;const e=setInterval(()=>{R({messageMode:"refresh",includeMetadata:!1})},5e3);return()=>clearInterval(e)},[Ts,R]),a.useEffect(()=>{const e=()=>{if(document.visibilityState!=="visible")return;const t=Date.now();t-fs.current<1e3||(fs.current=t,R({messageMode:"refresh"}))};return window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}},[R]);const Kt=a.useRef(null),Fs=a.useRef(!1),Qt=a.useRef(!1),zt=a.useCallback(e=>{const t=Le.current;t&&(rt.current=!0,ye.current!==null&&clearTimeout(ye.current),e==="instant"?t.scrollTop=t.scrollHeight:t.scrollTo({top:t.scrollHeight,behavior:"smooth"}),ye.current=setTimeout(()=>{rt.current=!1,ye.current=null},e==="smooth"?700:0))},[]);a.useEffect(()=>()=>{ye.current!==null&&clearTimeout(ye.current)},[]);const Xn=a.useCallback(()=>{const e=Le.current;if(!e||rt.current)return;const s=e.scrollHeight-e.clientHeight-e.scrollTop<=no;$e.current=s,s?(Ee(!1),at(0)):Ee(!0)},[]),Zn=a.useCallback(()=>{$e.current=!0,Ee(!1),at(0),zt("smooth")},[zt]);a.useEffect(()=>{const e=y.at(-1)?.id??null,t=!!(e&&e!==Kt.current),s=Ya({newestMessageId:e,previousNewestMessageId:Kt.current,showTyping:I.showTyping,previousShowTyping:Fs.current,historyRestorePending:ot.current||Fe.current!==null,initialScrollDone:Qt.current,nearBottom:$e.current});s!=="none"?(zt(s),Qt.current=!0):t&&Qt.current&&!$e.current&&(Ee(!0),at(n=>n+1)),ot.current=!1,Kt.current=e,Fs.current=I.showTyping});const[,ea]=a.useState(0);a.useEffect(()=>{const e=setInterval(()=>ea(t=>t+1),15e3);return()=>clearInterval(e)},[]);const de=ka(),[ue,te]=a.useState([]),[$s,ft]=a.useState("queue"),[Te,xe]=a.useState(null),Ce=async(e,t)=>{const s=e.trim(),n=t?.attachments??[],i=t?.replyTarget??null;if(!s&&n.length===0||H)return"failed";const d=t?.forceAction??Xs({isDm:C,hasOutstandingReply:xs}),A=Date.now(),f=Ca(),h={id:`optimistic-${f}`,conversationId:o,actorId:"operator",actorName:v,body:s,createdAt:A,class:"operator",...i?{replyToMessageId:i.messageId}:{},metadata:{clientMessageId:f,deliveryState:"sending"},...n.length>0?{attachments:n}:{}};ct(!0),d!=="message"&&X(A),se(null),ne.current.set(f,h.id),K(g=>Me([...g,h]));try{const g=await q(`/api/chats/${encodeURIComponent(o)}/messages`,{method:"POST",body:JSON.stringify({body:s,clientMessageId:f,...i?{replyToMessageId:i.messageId}:{},...n.length>0?{attachments:n}:{}})}),W=g.chatId?.trim()??g.conversationId?.trim();if(W&&W!==o)throw new Error(`Send returned a different Chat (${W}) instead of appending to ${o}.`);if(g.messageId?.trim()){const j=g.messageId.trim();K(he=>Me(he.map(N=>N.id===h.id?{...N,id:j,metadata:{clientMessageId:f}}:N))),ne.current.delete(f)}return g.flight?(Oe.current.add(g.flight.invocationId),fe(Js(g.flight,o,x??"")),je([]),Re(null)):d!=="message"&&X(null),"sent"}catch(g){return ro(g)?(K(W=>W.map(j=>j.id===h.id?{...j,metadata:{...j.metadata??{},deliveryState:"unknown"}}:j)),"unknown"):(K(W=>W.filter(j=>j.id!==h.id)),ne.current.delete(f),X(null),se(g instanceof Error?g.message:String(g)),"failed")}finally{ct(!1)}},ta=async e=>{const t=e.replyToMessageId?ce.get(e.replyToMessageId):null;if(!t||H)return;const s=[];for(const i of t.attachments??[]){if(!i.url){se("This request includes an attachment that can’t be reused. Add it again, then retry."),requestAnimationFrame(()=>M.current?.focus());return}s.push({id:i.id,mediaType:i.mediaType,...i.fileName?{fileName:i.fileName}:{},url:i.url})}await Ce(t.body,{forceAction:"invoke",attachments:s})!=="failed"&&ys(e)},sa=(e,t,s)=>{if(!_t)return;const n=e.replyToMessageId?ce.get(e.replyToMessageId)?.body.trim():"",i=n?`${n.slice(0,1200)}${n.length>1200?"…":""}`:"(The original request is no longer available in this transcript.)",l=[`Help me recover a failed request to ${t}.`,s,"","Original request:",i].join(`
|
|
2
|
-
`),d={view:"conversation",conversationId:_t,composeDraft:l};S&&as({type:"navigate",route:d,reason:"Ask @scoutbot to help recover a failed conversation request"})||u(d)},na=async()=>{const e=k.trim(),t=ae,s=de.files,n=Te?.attachments??[];if(!e&&s.length===0&&n.length===0)return null;let i=[];if(s.length>0){ct(!0);try{i=await ba(s)}catch(l){return de.setError(l instanceof Error?l.message:String(l)),null}finally{ct(!1)}}return P(""),re(null),de.clear(),xe(null),{body:e,attachments:[...n,...i],replyTarget:t}},aa=async()=>{const e=ir({isAgentBusy:me,intent:$s}),t=Te?.id??null,s=await na();if(!s)return;if(e==="queue"){te(l=>t?l.map(d=>d.id===t?{...d,body:s.body,attachments:s.attachments,replyTarget:s.replyTarget}:d):[...l,{id:`queued-${Date.now()}-${l.length}`,body:s.body,attachments:s.attachments,replyTarget:s.replyTarget,queuedAt:Date.now()}]);return}t&&te(l=>l.filter(d=>d.id!==t));const n=()=>{P(s.body),xe(s.attachments.length>0?{id:null,attachments:s.attachments}:null),re(s.replyTarget),requestAnimationFrame(()=>M.current?.focus())};if(e==="steer"){ft("queue"),await Gt(),await Ce(s.body,{forceAction:"steer",attachments:s.attachments,replyTarget:s.replyTarget})==="failed"&&n();return}await Ce(s.body,{attachments:s.attachments,replyTarget:s.replyTarget})==="failed"&&n()},ra=e=>{te(t=>t.filter(s=>s.id!==e)),xe(t=>t?.id===e?null:t)},oa=e=>{const t=ue.find(s=>s.id===e);t&&(P(t.body),re(t.replyTarget??null),xe({id:e,attachments:t.attachments}),requestAnimationFrame(()=>{const s=M.current;s&&(s.focus(),s.setSelectionRange(s.value.length,s.value.length))}))},ia=()=>{xe(null),P(""),re(null),de.clear()},la=async e=>{const t=ue.find(n=>n.id===e);if(!t)return;te(n=>n.filter(i=>i.id!==e)),await Gt(),await Ce(t.body,{forceAction:"steer",attachments:t.attachments,replyTarget:t.replyTarget??null})==="failed"&&te(n=>[t,...n])},gt=a.useCallback((e,t)=>{const s=t?.trim().replace(/^@+/,"")||null,n=s?`@${s}`:null,i=ae?.insertedMention?on(k,ae.insertedMention):k,l=!!(!C&&n&&!i.toLocaleLowerCase().includes(n.toLocaleLowerCase())),d=l&&n?i.trim()?`${i.trimEnd()} ${n} `:`${n} `:i;P(d),re({messageId:e.id,actorLabel:s?`@${s}`:e.actorName,preview:rn(e),insertedMention:l?n:null}),requestAnimationFrame(()=>M.current?.focus())},[k,C,ae?.insertedMention]),ca=a.useCallback(()=>{const e=ae?.insertedMention;re(null),e&&P(t=>on(t,e)),requestAnimationFrame(()=>M.current?.focus())},[ae]),Jt=a.useCallback(e=>{const t=new URL(window.location.href);O.view==="agents-v2"&&t.searchParams.set("tab","message"),t.hash=`msg-${e}`,Xe(t.toString())},[O.view]),Os=a.useCallback((e,t,s)=>{const n=xa({conversationId:o,selectedMessageId:e.id,messages:y.map(i=>({id:i.id,actorLabel:i.id===e.id?t:Ge(i,v)?v:i.actorName,body:i.body,attachmentCount:i.attachments?.length??0}))});Ie({intent:"forward-message",forwardContext:n,forwardContextMode:"selected-message",...s?{projectPath:s}:{}})},[o,y,Ie,v]),Gt=async()=>{if(x)try{await q("/api/agents/"+encodeURIComponent(x)+"/interrupt",{method:"POST",body:JSON.stringify({})})}catch{}},me=I.tone==="working"||I.tone==="pending",da=Xs({isDm:C,hasOutstandingReply:xs}),ua=C?`Message ${L} — type / to route or @ to mention an agent`:c?.kind==="channel"?`Comment in #${gr(c)} — mention @agent to request a reply`:`Comment in ${Ot} — mention @agent to request a reply`,Ps=Te?.attachments??[],ma=!k.trim()&&!de.hasFiles&&Ps.length===0&&me,Yt=a.useRef(!1);a.useEffect(()=>{const e=Te?.id??null,t=e?ue.filter(n=>n.id!==e):ue;if(!Xa({isAgentBusy:me,sending:H,queued:t})||Yt.current)return;const s=t[0];s&&(Yt.current=!0,te(n=>n.filter(i=>i.id!==s.id)),Ce(s.body,{attachments:s.attachments,replyTarget:s.replyTarget??null}).then(n=>{n==="failed"&&te(i=>[s,...i])}).finally(()=>{Yt.current=!1}))},[me,H,ue,Te]),a.useEffect(()=>{me||ft("queue")},[me]),a.useEffect(()=>{te([]),xe(null),re(null),ft("queue"),de.clear()},[o]);const ha=Za(ue),qs=Cr(),pa=a.useCallback((e,t)=>{const s=window.getSelection()?.toString().trim(),n=Ge(t,v),i=t.actorId?Z.get(t.actorId):null,l=n?null:Gs(t,T,x),d=(i?.scopedAlias?.trim()||l?.handle?.trim()||null)?.replace(/^@+/,"")??null,A=d?`@${d}`:t.actorName,f=(l?.id||i?.agentId||t.actorId||"").trim(),h=[];n||h.push({kind:"action",label:"Reply",onSelect:()=>gt(t,d)}),h.push({kind:"action",label:"Forward to new task…",onSelect:()=>Os(t,A,i?.workspaceRoot??l?.projectRoot??l?.cwd??void 0)}),h.push({kind:"separator"}),s&&h.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{Xe(s)}}),h.push({kind:"action",label:"Copy Message",onSelect:()=>{Xe(t.body)}}),h.push({kind:"action",label:"Copy Link",onSelect:()=>Jt(t.id)}),h.push({kind:"separator"}),!n&&f&&h.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{Xe(f)}}),h.push({kind:"action",label:"Copy Message ID",onSelect:()=>{Xe(t.id)}}),qs(e,h)},[x,gt,Jt,Os,v,Z,T,qs]),fa=async(e,t)=>{const s=`@${t.agentId} `,n=k.trim();if(n){P(""),await Ce(`${s}${n}`,{forceAction:"invoke"});return}P(s),M.current?.focus()},Je=a.useMemo(()=>{if(!c)return[];const e=new Set(c.participantIds);return T.filter(t=>!e.has(t.id)&&!t.retiredFromFleet).sort((t,s)=>t.name.localeCompare(s.name))},[c,T]);a.useEffect(()=>{At&&ut(e=>e&&Je.some(t=>t.id===e)?e:Je[0]?.id??"")},[At,Je]);const Ds=!!(c&&["direct","group_direct","channel"].includes(c.kind)&&Je.length>0),ga=a.useCallback(async()=>{if(!c)return;const e=Nt.trim();if(e){jt(!0),We(null);try{const t=await q(`/api/conversations/${encodeURIComponent(c.id)}/members`,{method:"POST",body:JSON.stringify({actorId:e})});t.session?vt(t.session):vt(s=>s&&{...s,kind:t.kind,participantIds:t.participantIds}),dt(!1),ut(""),await R({messageMode:"none"})}catch(t){We(t instanceof Error?t.message:String(t))}finally{jt(!1)}}},[Nt,R,c]);return r.jsx("div",{className:`s-thread-layout${S?" s-thread-layout--embedded":""}`,"data-thread-treatment":G==="standard"?void 0:G,children:r.jsxs("div",{className:"s-thread-center",children:[!S&&r.jsx(kr,{showBackNav:b,backLabel:ke,beside:D&&Ue?{on:D.has(Ue),toggle:()=>D.toggle(Ue)}:void 0,isDm:C,navigate:u,route:O,canonicalConversationId:Ue,threadTitle:Ot,agentId:_?.id??null,sessionId:ws,detailRoute:wn,participants:zn,operator:Jn,canAddParticipants:Ds,view:ve,onChangeView:Vn,onToggleAddParticipant:()=>{We(null),dt(e=>!e)}}),!S&&c&&r.jsx(Ir,{canonicalConversationId:Ue,conversationAlias:Dn}),!S&&At&&Ds&&r.jsx(Ar,{agents:Je,addParticipantId:Nt,setAddParticipantId:ut,addingParticipant:xn,addParticipantError:Tn,onCancel:()=>{dt(!1),We(null)},onSubmit:()=>{ga()}}),It&&r.jsx(Qr,{pinnedAsk:It,onAnswer:()=>{const e=[...y].reverse().find(t=>t.actorId===It.agentId)??[...y].reverse().find(t=>!Ge(t,v)&&t.class!=="status"&&t.class!=="system");e?gt(e,e.actorId?Z.get(e.actorId)?.scopedAlias??null:null):M.current?.focus()},onSteer:Ut}),r.jsx(zr,{presence:I,agent:_}),c&&r.jsx(Gr,{harness:c.harness,model:c.model,hostName:c.executionNodeName,workspaceRoot:c.workspaceRoot,sessionId:Ss,machineId:B,navigate:u}),hs&&r.jsx("p",{className:"s-thread-error",children:hs}),ve!=="thread"?r.jsx(Nr,{messages:y,view:ve,participants:c?.participants,onStage:Kn,beside:D}):r.jsxs("div",{className:"s-thread-feed","data-conversation-id":o,ref:Le,onScroll:Xn,children:[!ms&&y.length>0&&yn&&r.jsx("div",{className:"s-thread-history-control",children:r.jsxs("button",{type:"button",className:"s-thread-history-button",disabled:ge,"aria-busy":ge,onClick:()=>{Sn()},children:[ge&&r.jsx("span",{className:"s-thread-history-spinner","aria-hidden":"true"}),ge?"Loading earlier messages…":"Load earlier messages"]})}),ms?r.jsx(Hr,{}):y.length===0?Pt?r.jsx(Wr,{agentName:L,title:I.label,detail:I.detail||le.latest,snapshot:le,events:Ne,steps:ee,phase:Dt,tone:Bn,workspaceName:ht,branch:c?.currentBranch,startedAt:Lt,onOpenTrace:ks,onOpenTerminal:js,onSteer:Ut}):r.jsxs("div",{className:"s-thread-empty",children:[r.jsx("div",{className:"s-thread-empty-glyph","aria-hidden":"true",children:C?"@":"#"}),r.jsx("p",{children:Ot}),r.jsx("p",{children:C?"No messages yet. Send a message to start working with this agent.":"No messages yet. Start the conversation below."}),(ht||c?.currentBranch)&&r.jsxs("div",{className:"s-thread-empty-chips",children:[ht&&r.jsx("span",{className:"s-thread-empty-chip",children:ht}),c?.currentBranch&&r.jsx("span",{className:"s-thread-empty-chip",children:c.currentBranch})]})]}):ze.map((e,t)=>{const s=er(e,t);if(e.kind==="fanout")return r.jsx(Er,{row:e,expanded:Gn.has(e.key),showDayDivider:s,onToggle:()=>Yn(e.key)},e.key);const n=e.message,i=Ge(n,v),l=tr(n),d=l?"scout.dispatch":n.class,A=rr(d),f=d==="status",h=Zs(n.createdAt),g=i?null:Gs(n,T,x),j=(n.actorId?Z.get(n.actorId):void 0)?.scopedAlias?.trim()||null,he=!i&&j?j:n.actorName,N=i?v.toLowerCase():j??g?.handle??null,Q=sr(n.body),V=Q?nr({flightId:Q.flightId,replyToMessageId:n.replyToMessageId,messagesById:ce,agents:T,operatorName:v}):null,U=!Q&&n.replyToMessageId?ce.get(n.replyToMessageId)??null:null,z=U?Ge(U,v)?v:U.actorName:null,be=Q?Q.body:n.body,F=ss(n);if(F&&bt.has(n.id))return null;const Xt=typeof n.metadata?.targetAgentId=="string"?n.metadata.targetAgentId:null,yt=F?es(T,[Xt,F.target]):null,w=F?zs({name:yt?.name,id:yt?.id,title:wr(F.target)}):null;return r.jsxs("div",{className:["s-thread-feed-block",i&&"s-thread-feed-block--you",s&&"s-thread-feed-block--full-width"].filter(Boolean).join(" "),children:[s&&r.jsx(Lr,{at:n.createdAt}),F&&w?r.jsxs("article",{id:`msg-${n.id}`,className:["s-thread-msg","s-thread-failure-notice",(et||us?.has(n.id))&&"s-thread-msg--enter"].filter(Boolean).join(" "),style:et?{animationDelay:`${Math.max(0,7-(ze.length-1-t))*26}ms`}:void 0,"data-class":d,"aria-label":"Delivery issue",children:[r.jsx("span",{className:"s-thread-failure-notice-mark","aria-hidden":"true",children:"!"}),r.jsxs("div",{className:"s-thread-failure-notice-content",children:[r.jsxs("p",{children:[r.jsxs("strong",{children:[w," couldn’t reply."]})," ",r.jsx("span",{children:F.explanation})]}),F.technicalDetail&&r.jsxs("details",{className:"s-thread-failure-notice-details",children:[r.jsx("summary",{children:"Technical details"}),r.jsx("pre",{children:F.technicalDetail})]}),r.jsxs("div",{className:"s-thread-failure-notice-actions",children:[n.replyToMessageId&&ce.has(n.replyToMessageId)&&r.jsx("button",{className:"s-thread-failure-notice-action s-thread-failure-notice-action--primary",type:"button",disabled:H,onClick:()=>{ta(n)},children:H?"Retrying…":"Retry"}),_t&&r.jsx("button",{className:"s-thread-failure-notice-action",type:"button",onClick:()=>sa(n,w,F.explanation),children:"Ask @scoutbot"}),r.jsx("button",{className:"s-thread-failure-notice-action s-thread-failure-notice-action--clear",type:"button",onClick:()=>ys(n),"aria-label":`Clear delivery issue for ${w}`,children:"Clear"})]})]}),r.jsx("span",{className:"s-thread-failure-notice-time",title:h,children:St(n.createdAt)})]}):r.jsx("article",{id:`msg-${n.id}`,className:["s-thread-msg",i&&"s-thread-msg--you",f&&"s-thread-msg--tool",(et||us?.has(n.id))&&"s-thread-msg--enter"].filter(Boolean).join(" "),style:et?{animationDelay:`${Math.max(0,7-(ze.length-1-t))*26}ms`}:void 0,"data-class":d,onContextMenu:$=>pa($,n),children:r.jsx("div",{className:"s-thread-msg-card",children:r.jsxs("div",{className:"s-thread-msg-card-content",children:[r.jsxs("div",{className:"s-thread-msg-header",children:[r.jsxs("div",{className:"s-thread-msg-meta",children:[(()=>{const $=!i&&g?()=>Ye(u,{view:"agents-v2",agentId:g.id},{returnTo:O}):null,Bs=i?v:he??"?",Hs=r.jsx(rs,{agent:g??void 0,name:Bs,placement:"turn",size:28,className:"s-thread-msg-avatar",title:Bs,gaze:"pointer"});return $?r.jsx("button",{type:"button",className:"s-thread-msg-avatar--nav",onClick:$,"aria-label":`View profile for ${n.actorName??"agent"}`,title:`View profile for ${n.actorName??"agent"}`,children:Hs}):Hs})(),!i&&g?r.jsx("button",{type:"button",className:"s-thread-msg-actor s-thread-msg-actor--nav",onClick:()=>Ye(u,{view:"agents-v2",agentId:g.id},{returnTo:O}),title:`View profile for ${n.actorName}`,children:he}):r.jsx("span",{className:"s-thread-msg-actor",children:i?v:he}),N&&r.jsxs("span",{className:"s-thread-msg-handle",children:["@",N]}),A&&r.jsx("span",{className:"s-thread-msg-kind",children:A})]}),r.jsx("span",{className:"s-thread-msg-time",title:h,children:St(n.createdAt)}),r.jsxs("span",{className:"s-thread-msg-actions",children:[!i&&N&&r.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":`Reply to @${N}`,title:`Reply to @${N}`,onClick:()=>gt(n,N),children:r.jsx(os,{})}),r.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":"Copy link to message",title:"Copy link to message",onClick:()=>Jt(n.id),children:r.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M6.5 9.5a2.5 2.5 0 0 0 3.54 0l2.12-2.12a2.5 2.5 0 0 0-3.54-3.54l-.7.7"}),r.jsx("path",{d:"M9.5 6.5a2.5 2.5 0 0 0-3.54 0L3.84 8.62a2.5 2.5 0 0 0 3.54 3.54l.7-.7"})]})})]})]}),V&&r.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open the originating request${V.flightId?` · ${V.flightId}`:""}`,onClick:()=>pt(V.originatingMessageId),children:[r.jsx(os,{}),r.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),r.jsx("span",{className:"s-thread-reply-ctx-title",children:V.title}),r.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",V.from]}),r.jsx("span",{className:"s-thread-reply-ctx-status",children:"· done"})]}),U&&z&&r.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open message from ${z}`,onClick:()=>pt(U.id),children:[r.jsx(os,{}),r.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),r.jsx("span",{className:"s-thread-reply-ctx-title",children:rn(U)}),r.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",z]})]}),r.jsx("div",{className:"s-thread-msg-body",children:r.jsx(yr,{text:be})}),r.jsx(br,{message:n}),l&&l.candidates.length>0&&r.jsx("div",{className:"s-thread-dispatch",children:l.candidates.map($=>r.jsxs("button",{type:"button",className:"s-thread-dispatch-tile",onClick:()=>{fa(l,$)},children:[r.jsxs("span",{className:"s-thread-dispatch-tile-id",children:["@",$.agentId]}),r.jsx("span",{className:"s-thread-dispatch-tile-state",children:$.endpointState}),r.jsx("span",{className:"s-thread-dispatch-tile-meta",children:[$.workspace,$.node,$.projectRoot].filter(Boolean).join(" · ")||$.displayName})]},$.agentId))})]})})})]},n.id)}),Se&&!Hn&&r.jsx("div",{className:"s-thread-feed-block",children:r.jsx(Jr,{flight:Se,onOpenSession:Wn})}),I.showTyping&&!Pt&&r.jsx("div",{className:"s-thread-feed-block",children:r.jsx("div",{className:"s-thread-msg","aria-live":"polite",children:r.jsxs("div",{className:Ln,children:[r.jsx(rs,{agent:_??void 0,name:L,placement:"turn",size:28,className:"s-thread-msg-avatar s-thread-msg-avatar--working",title:L,gaze:"pointer"}),r.jsxs("div",{className:"s-thread-msg-card-content",children:[r.jsxs("div",{className:"s-thread-msg-header",children:[r.jsxs("div",{className:"s-thread-msg-meta",children:[r.jsx("span",{className:"s-thread-msg-actor",children:L}),r.jsx("span",{className:Fn,children:En})]}),r.jsx("span",{className:"s-thread-msg-time",title:p?.startedAt?Zs(p.startedAt):"now",children:p?.startedAt?St(p.startedAt):"now"})]}),r.jsxs("div",{className:"s-thread-msg-working-body",children:[r.jsxs("div",{className:$n,children:[r.jsx("span",{className:On,"aria-hidden":"true"}),r.jsxs("div",{className:"s-thread-turn-snapshot-main",children:[r.jsx("span",{className:"s-thread-turn-snapshot-label",children:"Latest"}),r.jsx("span",{className:"s-thread-msg-working-copy",children:le.latest})]})]}),r.jsxs("dl",{className:"s-thread-turn-snapshot-stats",children:[r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Activity"}),r.jsx("dd",{children:le.activityLabel})]}),r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Elapsed"}),r.jsx("dd",{children:le.elapsedLabel})]}),r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Last"}),r.jsx("dd",{children:le.lastActivityLabel})]})]}),ee.length>0||Dt?r.jsx(Ur,{steps:ee,phase:Dt,limit:5,compact:!0}):r.jsx(_r,{events:Ne,limit:4,compact:!0}),r.jsx(Vr,{onOpenTrace:ks,onOpenTerminal:js,onSteer:Ut,compact:!0})]})]})]})})}),fn&&kt>0&&r.jsxs("button",{type:"button",className:"s-thread-new-messages",onClick:Zn,children:[r.jsx("span",{"aria-hidden":"true",children:"↓"})," ",kt," new ",kt===1?"message":"messages"," · jump to latest"]}),r.jsx("div",{ref:gn})]}),I.showTyping&&r.jsxs("div",{className:Pn,children:[r.jsx("div",{className:"s-thread-presence-line-avatars",children:r.jsx(rs,{agent:_??void 0,name:L,placement:"turn",size:22,className:"s-thread-presence-line-avatar",title:L})}),r.jsx("span",{className:"s-thread-presence-line-label",children:_n}),r.jsx("div",{className:qn,"aria-hidden":"true"})]}),r.jsx(Rr,{composeRef:M,draft:k,setDraft:P,composePlaceholder:ua,slashState:oe,setSlashState:Be,filteredSlashCommands:Cn,applySlashCommand:In,mentionState:ie,setMentionState:He,filteredMentions:bn,applyMention:An,updateTriggersFromDraft:kn,closeSuggestions:Mn,replyTarget:ae,onCancelReply:ca,isStopMode:ma,sending:H,composeAction:da,onSend:()=>{aa()},onInterrupt:()=>{Gt()},attachments:de,isAgentBusy:me,busyIntent:$s,onBusyIntentChange:ft,queued:ue,queueNote:ha,onEditQueued:oa,editingQueuedId:Te?.id??null,editingAttachmentCount:Ps.length,onCancelEdit:ia,onUnqueue:ra,onSendQueuedNow:e=>{la(e)}})]})})}function os(){return r.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("polyline",{points:"9 14 4 9 9 4"}),r.jsx("path",{d:"M20 20v-7a4 4 0 0 0-4-4H4"})]})}const Gi=Mr({id:"thread",label:"Thread",route:{view:"conversation",conversationId:""},webPath:"/chat",screen:"ConversationScreen",embed:{path:"/embed/thread",profile:"macos.thread",rootClassName:"s-thread-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:lr}});export{Ji as ConversationScreen,Gi as scoutSurface};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as j,j as e}from"./index-EsrkGBcv.js";import{c as v}from"./conversation-model-FxDeWlle.js";import{A as y}from"./AgentAvatar-CrP1eXxk.js";import{C as b}from"./check-lrJ3a73a.js";import{C as w}from"./NewChatComposer-C97-iTMK.js";import{S as C}from"./sparkles-BjHq_DNK.js";import{X as f}from"./x-DAehov0E.js";import{T as I}from"./triangle-alert-CHoRGdVO.js";import{c as E}from"./createLucideIcon-zZ8Hx7er.js";import"./agent-state-DDhnFEEP.js";import"./time-Dhsh_2EG.js";import"./conversations-DoAAO6kA.js";import"./Provider-C35yu29I.js";import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./router-DCtl8wqb.js";import"./api-DSqpVKC7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-BCPRocpq.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./file-text-CnISiiw6.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./keyboard-nav-DDHegDbx.js";import"./media-blobs-Bi8pxr1u.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./SpriteAvatar-CpZWf54-.js";import"./CrewAvatar-kTznzqcO.js";import"./HarnessMark-C4naWc16.js";import"./runtime-picker-DXu2bOTh.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-OvccU82H.js";import"./colors-CFlbwC25.js";import"./index-724SdE6r.js";import"./NewChatOrigin-DFbF_XvR.js";import"./chevron-down-l1mrh5S9.js";import"./search-DT42oyRW.js";const z=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],S=E("shield-alert",z);function L(t){const s=t.split(/\r?\n/).map(r=>r.trim()).find(Boolean)??"",a=110;return s.length>a?`${s.slice(0,a-1).trimEnd()}…`:s}function $e({pinnedAsk:t,onAnswer:s,onApprove:a,onReject:r,onSteer:n,enableKeyboard:d=!0}){const l=t.summary?.trim()||null,o=L(t.task),p=l&&l!==t.task.trim()?l:o,N=p!==o&&o.length>0,c=/\b(?:approve|approval|permission|allow|proceed|confirm|gate)\b/i.test(p),h=t.agentName??v(t.agentId)??t.agentId,g=c?`${h} needs approval`:`${h} asks`,u=j.useCallback(()=>{a?a():s()},[a,s]),x=j.useCallback(()=>{n?n():s()},[n,s]);return j.useEffect(()=>{if(!d)return;const k=i=>{const m=document.activeElement;m instanceof HTMLInputElement||m instanceof HTMLTextAreaElement||m instanceof HTMLElement&&m.isContentEditable||i.metaKey||i.ctrlKey||i.altKey||(i.key==="y"||i.key==="Y"?(i.preventDefault(),u()):i.key==="s"||i.key==="S"?(i.preventDefault(),x()):(i.key==="n"||i.key==="N")&&r&&(i.preventDefault(),r()))};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[d,u,x,r]),e.jsxs("div",{className:`s-thread-pinned-ask surface-card ${c?"s-thread-pinned-ask--approval":"s-thread-pinned-ask--question"}`,role:"alert","aria-live":"assertive",children:[e.jsx(y,{agent:{id:t.agentId,name:h,harness:t.harness,state:"needs"},size:44,placement:"row",presence:!0,gaze:"up",className:"s-thread-pinned-ask-coin"}),e.jsxs("div",{className:"s-thread-pinned-ask-body",children:[e.jsx("span",{className:"s-thread-pinned-ask-eyebrow",children:g}),e.jsx("p",{className:"s-thread-pinned-ask-text",children:p}),N&&e.jsxs("p",{className:"s-thread-pinned-ask-context",children:["Re: ",o]})]}),e.jsxs("div",{className:"s-thread-pinned-ask-actions",children:[e.jsxs("button",{type:"button",className:"btn btn--primary s-thread-pinned-ask-btn",onClick:u,title:c?"Approve this gate [Y]":"Answer this question [Y]",children:[e.jsx("kbd",{className:"s-kbd",children:"[Y]"}),c?e.jsx(b,{size:13,strokeWidth:2.2}):e.jsx(w,{size:13}),e.jsx("span",{children:c?"Approve":"Answer"})]}),e.jsxs("button",{type:"button",className:"btn btn--ghost s-thread-pinned-ask-btn",onClick:x,title:"Provide guidance or steer [S]",children:[e.jsx("kbd",{className:"s-kbd",children:"[S]"}),e.jsx(C,{size:13,strokeWidth:1.9}),e.jsx("span",{children:"Steer"})]}),r&&e.jsxs("button",{type:"button",className:"btn btn--danger s-thread-pinned-ask-btn",onClick:r,title:"Reject or decline [N]",children:[e.jsx("kbd",{className:"s-kbd",children:"[N]"}),e.jsx(f,{size:13,strokeWidth:2.2}),e.jsx("span",{children:"Reject"})]})]})]})}function Ae({title:t,description:s,diff:a,command:r,risk:n="medium",onApprove:d,onReject:l,onSteer:o}){return e.jsxs("div",{className:"s-thread-approval-gate surface-card",role:"alert",children:[e.jsxs("div",{className:"s-thread-approval-gate-head",children:[e.jsxs("div",{className:"s-thread-approval-gate-title-wrap",children:[e.jsx(S,{size:16,className:"text-amber","aria-hidden":"true"}),e.jsx("span",{className:"label-sm text-amber",children:"Execution Approval Gate"}),n&&e.jsxs("span",{className:"chip chip--sm chip--mono chip--neutral",children:[n.toUpperCase()," RISK"]})]}),e.jsx("h3",{className:"s-thread-approval-gate-title",children:t}),s&&e.jsx("p",{className:"s-thread-approval-gate-desc",children:s})]}),r&&e.jsxs("div",{className:"s-thread-approval-gate-command surface-card surface-card--inset",children:[e.jsx("span",{className:"label-xs text-muted",children:"Command"}),e.jsx("code",{className:"s-thread-approval-gate-code",children:r})]}),a&&e.jsxs("div",{className:"s-thread-approval-gate-diff surface-card surface-card--inset",children:[e.jsx("span",{className:"label-xs text-muted",children:"Diff Preview"}),e.jsx("pre",{className:"s-thread-approval-gate-diff-pre",children:e.jsx("code",{children:a})})]}),e.jsxs("div",{className:"s-thread-approval-gate-actions",children:[e.jsxs("button",{type:"button",className:"btn btn--primary",onClick:d,children:[e.jsx("kbd",{className:"s-kbd",children:"[Y]"}),e.jsx(b,{size:13}),e.jsx("span",{children:"Approve Action"})]}),e.jsxs("button",{type:"button",className:"btn btn--danger",onClick:l,children:[e.jsx("kbd",{className:"s-kbd",children:"[N]"}),e.jsx(f,{size:13}),e.jsx("span",{children:"Reject"})]}),o&&e.jsxs("button",{type:"button",className:"btn btn--ghost",onClick:o,children:[e.jsx("kbd",{className:"s-kbd",children:"[S]"}),e.jsx("span",{children:"Steer…"})]})]})]})}function De({presence:t}){if(!t.showStrip)return null;const s=t.tone==="working";return e.jsxs("div",{className:`s-thread-status s-thread-status--${t.tone}`,"aria-live":"polite",children:[e.jsx("span",{className:"s-thread-status-dot-wrap","aria-hidden":"true",children:e.jsx("span",{className:`dot dot--sm ${s?"dot--working dot--pulse":"dot--neutral"}`})}),e.jsxs("div",{className:"s-thread-status-copy",children:[e.jsx("span",{className:"s-thread-status-label label-xs",children:t.label}),e.jsx("span",{className:"s-thread-status-detail",children:t.detail})]})]})}function T(t){switch(t){case"completed":return"Invocation completed";case"failed":return"Invocation failed";case"cancelled":return"Invocation cancelled";case"queued":return"Invocation queued";case"waking":return"Invocation waking";case"waiting":return"Invocation waiting";case"running":return"Invocation running";default:return`Invocation ${t.replace(/_/g," ")}`}}function $(t){switch(t){case"failed":return"failed";case"cancelled":return"cancelled";case"completed":return"completed";default:return"active"}}function Me({flight:t,onOpenSession:s}){const a=$(t.state),r=t.summary?.trim()||null,n=a==="failed"?I:a==="cancelled"?f:b;return e.jsxs("div",{className:`s-thread-flight-outcome s-thread-flight-outcome--${a}`,role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"s-thread-flight-outcome-head",children:[e.jsx("span",{className:"s-thread-flight-outcome-mark","aria-hidden":"true",children:e.jsx(n,{size:12,strokeWidth:2.2})}),e.jsx("span",{className:"label-sm s-thread-flight-outcome-title",children:T(t.state)})]}),r&&e.jsx("p",{className:"s-thread-flight-outcome-summary",children:r}),e.jsx("p",{className:"s-thread-flight-outcome-note text-muted",children:"Broker outcome · observed turns are shown in the session when available."}),s&&e.jsx("div",{className:"s-thread-flight-outcome-actions",children:e.jsx("button",{type:"button",className:"btn btn--ghost",onClick:s,children:e.jsx("span",{children:"Open session"})})})]})}export{Ae as ApprovalGateCard,Me as ConversationFlightOutcome,De as ConversationStatusStrip,$e as PinnedAskCard};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m,j as s}from"./index-EsrkGBcv.js";import{a as k}from"./api-DSqpVKC7.js";import{u as R}from"./sse-BCPRocpq.js";import{d as $,t as F}from"./time-Dhsh_2EG.js";import{SessionRefScreen as I}from"./SessionRefScreen-DqLSUlCE.js";/* empty css */import{c as E}from"./createLucideIcon-zZ8Hx7er.js";import{X as A}from"./x-DAehov0E.js";import"./index-BWHgHrtv.js";import"./tail-events-d0yAYxR0.js";import"./BackToPicker-CUkjnoVk.js";import"./router-DCtl8wqb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./ConversationScreen-CUfsQ4MR.js";import"./NewChatComposer-C97-iTMK.js";import"./runtime-picker-DXu2bOTh.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-OvccU82H.js";import"./media-blobs-Bi8pxr1u.js";import"./index-724SdE6r.js";import"./HarnessMark-C4naWc16.js";import"./conversation-model-FxDeWlle.js";import"./agent-state-DDhnFEEP.js";import"./conversations-DoAAO6kA.js";import"./colors-CFlbwC25.js";import"./NewChatOrigin-DFbF_XvR.js";import"./keyboard-nav-DDHegDbx.js";import"./chevron-down-l1mrh5S9.js";import"./search-DT42oyRW.js";import"./file-text-CnISiiw6.js";import"./ComposerAttachments-DW0AIb8k.js";import"./machine-scope-DJt9RZ2w.js";import"./message-markup-Zwo3t4cI.js";import"./message-markup-BQW5jdJw.js";import"./mentions-ByUvhS-v.js";import"./Provider-C35yu29I.js";import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./AgentDetailCard-DtHT3sCo.js";import"./AgentLiveActions-CfTupTEl.js";import"./terminal-takeover-Ay5C2c-M.js";import"./openContent-C6XO6kr5.js";import"./eye-LrO-cXQt.js";import"./terminal-hQKQygcf.js";import"./message-visibility-DwxgcgYK.js";import"./operator-attention-DBaRg5ep.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./MessageEmbeds-ksPazAKH.js";import"./AgentAvatar-CrP1eXxk.js";import"./SpriteAvatar-CpZWf54-.js";import"./CrewAvatar-kTznzqcO.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-C-ZWscKj.js";import"./AstronautSuit-Cchnc4Ug.js";import"./panel-right-Bv7sP_fc.js";import"./CommsFlowGraph-DxoOaLF_.js";import"./comms-gesture-_aGFo6g3.js";import"./CommsCanvas-THp0r_U8.js";import"./comms-deck-CBhsXnY-.js";import"./CommsFlowMap-Vi8ziCPg.js";import"./CommsSelection-BUoRbu9o.js";/* empty css */import"./use-conversation-list-CY4JciOV.js";import"./agent-master-model-Bk_yuUXJ.js";import"./use-beside-DoRC1nt0.js";import"./ConversationComposer-CUQyArlk.js";import"./zap-CEjZNZbI.js";import"./ConversationFeedRows-DWiOfT-y.js";import"./ConversationPanels-D9oC0xG5.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./use-reduced-motion-3gMYZNIp.js";import"./proxy-AJsmwA6h.js";import"./activity-CIlFrfPJ.js";import"./message-circle-CxRVKNE-.js";import"./ConversationStatus--IPm2nGh.js";import"./check-lrJ3a73a.js";import"./sparkles-BjHq_DNK.js";import"./triangle-alert-CHoRGdVO.js";import"./SessionContextStrip-CXfs9hUD.js";import"./SessionObserve-DXxBvejJ.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-Czggx8oM.js";import"./LaneToolHoverCard-CJa110yk.js";import"./lane-observe-CteDwdD-.js";import"./lane-ask-display-BTVSakyo.js";import"./SessionHopMenu-E6VJZrE0.js";import"./external-link-CUObqmgX.js";import"./ObservedTopologyPanel-CUTIoLZJ.js";import"./ObserveTextFlow-PFnG_10h.js";import"./SessionObserveEvidence-Cuj_KHxR.js";import"./wrench-DR0i5BU7.js";import"./session-ref-lookup-state-SATH_jAP.js";/* empty css */const T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],L=E("columns-2",T);function S(i){const o=new Map;for(const r of i)o.delete(r.sessionId),o.set(r.sessionId,r);return[...o.values()]}function M(i,o){const r=S(i),d=o?.trim()||null;return r.find(n=>n.sessionId===d)?.sessionId??r.at(-1)?.sessionId??d}function O(i){return i.length<=34?i:`${i.slice(0,15)}…${i.slice(-14)}`}function q(i,o){return o===0?i.strategy||"dispatch":i.strategy?`switched via ${i.strategy}`:"session changed"}function y({label:i,sessions:o,value:r,onChange:d}){return s.jsxs("label",{className:"s-flight-observe-select-wrap",children:[s.jsx("span",{children:i}),s.jsx("select",{className:"s-flight-observe-select",value:r,onChange:n=>d(n.currentTarget.value),children:o.map(n=>s.jsxs("option",{value:n.sessionId,children:[n.harness?`${n.harness} · `:"",n.sessionId]},n.sessionId))})]})}function Ue({route:i,navigate:o}){const[r,d]=m.useState(null),[n,j]=m.useState(!0),[h,N]=m.useState(null),u=m.useCallback(async()=>{try{const e=await k(`/api/flights?active=false&flightId=${encodeURIComponent(i.flightId)}`);d(e[0]??null),N(e.length===0?"This flight is not available on the connected broker.":null)}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(!1)}},[i.flightId]);m.useEffect(()=>{j(!0),u()},[u]),R(()=>{u()});const v=r?.sessions??[],a=m.useMemo(()=>S(v),[v]),g=M(v,i.sessionId),t=a.find(e=>e.sessionId===g)??null,l=a.find(e=>e.sessionId===i.compareSessionId)??null,f=!!(t&&l&&t.sessionId!==l.sessionId),c=m.useCallback((e,p)=>{o({...i,sessionId:e,...p?{compareSessionId:p}:{compareSessionId:void 0}})},[o,i]),w=m.useCallback(()=>{if(!t||a.length<2)return;const e=[...a].reverse().find(p=>p.sessionId!==t.sessionId);e&&c(t.sessionId,e.sessionId)},[t,a,c]),C=m.useCallback(e=>{if(!f||!t||!l){c(e);return}c(e,e===l.sessionId?t.sessionId:l.sessionId)},[l,t,f,c]);return s.jsxs("div",{className:"s-flight-observe",children:[s.jsxs("header",{className:"s-flight-observe-header",children:[s.jsxs("div",{className:"s-flight-observe-heading",children:[s.jsx("div",{className:"s-flight-observe-eyebrow",children:"Flight observe"}),s.jsxs("div",{className:"s-flight-observe-title-row",children:[s.jsx("h2",{children:r?.agentName||r?.agentId||"Flight"}),s.jsx("span",{className:`s-flight-observe-state s-flight-observe-state--${r?.state??"loading"}`,children:r?.state??(n?"loading":"unknown")})]}),s.jsx("div",{className:"s-flight-observe-id",title:i.flightId,children:i.flightId}),r?.summary&&s.jsx("p",{children:r.summary})]}),s.jsxs("div",{className:"s-flight-observe-actions",children:[a.length>1&&!f&&s.jsxs("button",{type:"button",onClick:w,children:[s.jsx(L,{size:13})," Split view"]}),f&&t&&s.jsxs("button",{type:"button",onClick:()=>c(t.sessionId),children:[s.jsx(A,{size:13})," Close split"]})]})]}),v.length>0&&s.jsx("nav",{className:"s-flight-observe-trace","aria-label":"Flight session history",children:v.map((e,p)=>{const b=t?.sessionId===e.sessionId,x=l?.sessionId===e.sessionId;return s.jsxs("div",{className:"s-flight-observe-trace-step",children:[p>0&&s.jsx("span",{className:"s-flight-observe-trace-arrow","aria-hidden":"true",children:"→"}),s.jsxs("button",{type:"button",className:"s-flight-observe-session-chip","data-selected":b||x,"data-observe-role":b?"primary":x?"compare":"idle","aria-pressed":b||x,title:e.sessionId,onClick:()=>C(e.sessionId),children:[s.jsxs("span",{className:"s-flight-observe-session-chip-top",children:[s.jsx("span",{children:e.harness||e.transport||"session"}),s.jsx("time",{title:new Date(e.startedAt).toLocaleString(),children:$(e.startedAt)||F(e.startedAt)})]}),s.jsx("strong",{children:O(e.sessionId)}),s.jsx("small",{children:q(e,p)})]})]},`${e.sessionId}:${e.startedAt}:${p}`)})}),h&&!g&&s.jsx("div",{className:"s-flight-observe-message s-flight-observe-message--error",children:h}),h&&g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Flight record unavailable"}),s.jsx("span",{children:"Showing the concrete session captured by this link."})]}),!h&&n&&s.jsx("div",{className:"s-flight-observe-message",children:"Resolving the flight’s session trace…"}),!h&&!n&&a.length===0&&!g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Waiting for a session"}),s.jsx("span",{children:"The flight is stable here; its trace will appear as soon as a harness acknowledges dispatch."})]}),g&&!f&&s.jsx("main",{className:"s-flight-observe-single",children:s.jsx(I,{sessionRef:g,navigate:o,machineId:i.machineId})}),!h&&t&&l&&f&&s.jsxs("main",{className:"s-flight-observe-split",children:[s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Primary session",sessions:a,value:t.sessionId,onChange:e=>c(e,e===l.sessionId?t.sessionId:l.sessionId)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(I,{sessionRef:t.sessionId,navigate:o,machineId:i.machineId,showObserveRail:!1})})]}),s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Compare session",sessions:a.filter(e=>e.sessionId!==t.sessionId),value:l.sessionId,onChange:e=>c(t.sessionId,e)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(I,{sessionRef:l.sessionId,navigate:o,machineId:i.machineId,showObserveRail:!1})})]})]})]})}export{Ue as FlightObserveScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as s}from"./index-EsrkGBcv.js";import{b as O}from"./shared-work-artifacts-DfNl9KTo.js";import{u as E}from"./Provider-C35yu29I.js";import{a as R}from"./router-DCtl8wqb.js";import{f as P,a as B}from"./terminal-sessions-3RfJpen8.js";import{b as H}from"./agent-lane-detail-Ti3trpfH.js";import{l as k}from"./agent-lanes-model-DMAdqCmK.js";/* empty css */import{F as S}from"./file-code-corner-CsU7jJpu.js";import{G as C}from"./git-branch-B0_fPLO7.js";import{T as z}from"./terminal-hQKQygcf.js";import{X as G}from"./x-DAehov0E.js";import{A as m}from"./arrow-up-right-BPedAgxO.js";import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./api-DSqpVKC7.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-BCPRocpq.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-C97-iTMK.js";import"./runtime-picker-DXu2bOTh.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-OvccU82H.js";import"./createLucideIcon-zZ8Hx7er.js";import"./media-blobs-Bi8pxr1u.js";import"./index-724SdE6r.js";import"./HarnessMark-C4naWc16.js";import"./conversation-model-FxDeWlle.js";import"./time-Dhsh_2EG.js";import"./conversations-DoAAO6kA.js";import"./colors-CFlbwC25.js";import"./NewChatOrigin-DFbF_XvR.js";import"./keyboard-nav-DDHegDbx.js";import"./chevron-down-l1mrh5S9.js";import"./search-DT42oyRW.js";import"./file-text-CnISiiw6.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./lane-observe-CteDwdD-.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./lane-ask-display-BTVSakyo.js";import"./context-budget-8qFKqM-j.js";const p={artifacts:"Artifact shelf",branches:"Branch board",terminals:"Terminal bay"};function Qe({view:o,lanes:h,onView:F,onClose:L,onActor:x}){const{openFilePreview:T}=E(),[f,$]=n.useState([]),[u,j]=n.useState(null),[b,w]=n.useState(!0),[l,_]=n.useState(!1),[y,v]=n.useState("");n.useEffect(()=>{if(o!=="terminals")return;let e=!0;const r=()=>P().then(c=>{e&&($(B(c)),j(null))}).catch(()=>{e&&j("Terminal discovery is unavailable. Retry or open the terminal workspace.")}).finally(()=>{e&&w(!1)});r();const t=window.setInterval(()=>{document.hidden||r()},15e3);return()=>{e=!1,window.clearInterval(t)}},[o]);const A=h.map(e=>({lane:e,stats:H(e)})),i=new Map,d=new Map(O(h).map(e=>[e.id,{path:e.path,resolved:e.resolvedPath,owners:e.owners,state:e.state}]));for(const{lane:e,stats:r}of A){const t=e.facts?.cwd||r.cwd||"",c=e.facts?.branch||r.branch;if(c){const N=`${t}\0${c}`,g=i.get(N)??{branch:c,cwd:t,owners:[]};g.owners.push(e),i.set(N,g)}}const a=e=>e.toLowerCase().includes(y.toLowerCase()),I=o==="artifacts"?S:o==="branches"?C:z;return s.jsxs("aside",{className:"agent-floor__trace-panel floor-context","aria-label":`${p[o]} context sheet`,children:[s.jsxs("header",{className:"floor-context__header",children:[s.jsx(I,{size:20}),s.jsxs("div",{children:[s.jsx("h2",{children:p[o]}),s.jsx("p",{children:o==="terminals"?"Discovered sessions · refreshes every 15s":"Across the loaded fleet"})]}),s.jsx("button",{type:"button",onClick:L,"aria-label":"Close resource sheet",children:s.jsx(G,{size:17})})]}),s.jsx("nav",{className:"floor-context__tabs","aria-label":"Resource sheets",children:["artifacts","branches","terminals"].map(e=>s.jsx("button",{type:"button","aria-pressed":o===e,onClick:()=>{v(""),F(e)},children:p[e]},e))}),s.jsxs("div",{className:"floor-context__body",children:[s.jsx("input",{className:"floor-context__search","aria-label":"Filter floor resources",placeholder:o==="terminals"?"Find a session or workspace…":"Filter by path or branch…",value:y,onChange:e=>v(e.target.value)}),o==="artifacts"?s.jsxs("section",{children:[s.jsxs("h3",{children:["Observed changed files ",s.jsx("span",{children:d.size})]}),s.jsx("p",{className:"floor-context__scope",children:"Files changed in loaded session history. Select a file to preview."}),[...d].filter(([,e])=>a(e.path)).map(([e,r])=>s.jsxs("article",{className:"floor-context__resource",children:[s.jsxs("button",{className:"floor-context__resource-title",type:"button",disabled:!r.resolved,onClick:()=>r.resolved&&T(r.resolved),children:[s.jsx(S,{size:15}),s.jsx("strong",{children:r.path.split("/").at(-1)}),s.jsx(m,{size:13})]}),s.jsx("code",{title:r.resolved??r.path,children:r.resolved??r.path}),s.jsxs("small",{children:[r.state,r.owners.length>1?` · ${r.owners.length} {row.owners.length === 1 ? "actor" : "actors"} touched this file`:""]}),s.jsx("div",{className:"floor-context__owners",children:r.owners.map(t=>s.jsxs("button",{type:"button",onClick:()=>x(t),children:[k(t.agent,t.source)," · ",t.id.slice(-5)]},t.id))})]},e)),[...d.values()].some(e=>a(e.path))?null:s.jsx("p",{className:"floor-context__empty",children:"No observed changed files match this view."})]}):null,o==="branches"?s.jsxs("section",{children:[s.jsxs("h3",{children:["Observed branches ",s.jsx("span",{children:i.size})]}),s.jsx("p",{className:"floor-context__scope",children:"Branches and workspaces reported by these sessions."}),[...i].filter(([,e])=>a(`${e.branch} ${e.cwd}`)).map(([e,r])=>s.jsxs("article",{className:"floor-context__resource",children:[s.jsxs("h3",{children:[s.jsx(C,{size:15}),r.branch,s.jsxs("span",{children:[r.owners.length," ",r.owners.length===1?"actor":"actors"]})]}),s.jsx("code",{children:r.cwd||"Workspace not reported"}),s.jsx("div",{className:"floor-context__owners",children:r.owners.map(t=>s.jsxs("button",{type:"button",onClick:()=>x(t),children:[k(t.agent,t.source)," · ",t.id.slice(-5)]},t.id))})]},e)),[...i.values()].some(e=>a(`${e.branch} ${e.cwd}`))?null:s.jsx("p",{className:"floor-context__empty",children:"No reported branches match this view."})]}):null,o==="terminals"?s.jsxs("section",{children:[s.jsxs("nav",{className:"floor-context__tabs",children:[s.jsx("button",{type:"button","aria-pressed":!l,onClick:()=>_(!1),children:"All terminals"}),s.jsx("button",{type:"button","aria-pressed":l,onClick:()=>_(!0),children:"Herdr"})]}),s.jsx("p",{className:"floor-context__scope",children:"All discovered terminal surfaces. Opening a session uses observe mode."}),u?s.jsx("p",{role:"alert",className:"floor-context__empty",children:u}):null,b?s.jsx("p",{className:"floor-context__empty",children:"Loading terminals…"}):f.filter(e=>(!l||e.surface.backend==="herdr")&&a(e.searchable)).map(e=>s.jsxs("article",{className:"floor-context__resource",children:[s.jsxs("a",{className:"floor-context__resource-title",href:R({view:"terminal",terminalSessionId:e.session.id,terminalSurfaceKey:e.key,mode:"observe"}),children:[s.jsx(z,{size:15}),s.jsx("strong",{children:e.title}),s.jsx(m,{size:13})]}),s.jsxs("small",{children:[e.surface.backend," · ",e.condition]}),s.jsx("code",{children:e.session.cwd||e.project})]},e.id)),!b&&!f.some(e=>(!l||e.surface.backend==="herdr")&&a(e.searchable))?s.jsxs("p",{className:"floor-context__empty",children:["No ",l?"Herdr ":"","terminals match this view."]}):null,s.jsxs("a",{className:"floor-context__resource-title",href:"/terminal",children:["Open terminal workspace ",s.jsx(m,{size:13})]})]}):null]})]})}export{Qe as FloorResourcesSheet};
|