@openscout/scout 0.2.107 → 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 +53 -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 +26 -4
- package/server.json +2 -2
- 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
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{r as s,j as e}from"./index-BFbLvCJn.js";import{k as gs}from"./router-CJIx83Ia.js";import{u as Zt,B as Hs,D as Ss,E as Vt,a as Ws,F as Qe,G as es,H as ts,I as Gs,J as qs,K as ss}from"./Provider-BEXAZWd9.js";import{H as Ys,A as Js,S as Qs,a as Ks,m as ks,o as Xs,b as Zs,V as eo,c as to,d as so}from"./direct-voice-DAOUU-kc.js";import{r as oo,a as he}from"./api-DSqpVKC7.js";import{c as St}from"./clipboard-e3fSpeo7.js";import{e as no}from"./credentials-OeoF-VKJ.js";import{b as os,u as ro,a as Ke}from"./persistent-state-3mbBFRDO.js";import{s as Le,e as ao,S as ns}from"./scoutbot-Bk3nyrkj.js";import{p as io,i as co,j as lo,k as uo,g as mo,s as po,l as ho,m as Ct,e as fo,b as vo,n as xo,q as bo}from"./scout-voice-Cdh6pCsb.js";import{d as go,f as rs,n as et}from"./time-Dhsh_2EG.js";import{S as ws}from"./scoutbot-markdown-7PRQHaAc.js";import{L as ke}from"./loader-circle-CCG7hG7z.js";import{P as ys}from"./plus-B0hdY0fF.js";import{C as Tt}from"./chevron-down-DEDSNJNY.js";import{C as So}from"./chevron-up-CzveykKG.js";import{c as wt}from"./createLucideIcon-CKbjXlwv.js";import{S as js,e as Ns}from"./runtime-picker-IRcTkMZ5.js";import{S as ko}from"./send-horizontal-_Tf_It04.js";import{C as wo}from"./copy-C1XrY27_.js";import{localLiveWellSpec as yo,VoiceControlWell as Cs,gptLiveWellSpec as jo}from"./VoiceControlWell-BkjuWjYu.js";import{u as Es}from"./use-reduced-motion-DkdIQBwh.js";import{d as No,E as as,t as is,c as Co,e as Eo,f as Io,r as To}from"./voice-turn-ledger-BMZxlSjg.js";import{R as cs}from"./rocket-BahsdUe6.js";import{X as Lo}from"./x-BcfhXYiF.js";import{R as Mo}from"./refresh-cw-BcqctLqo.js";import{S as Ro}from"./settings-bo9X410k.js";import{V as ls}from"./fx-z37u1o2z.js";import{B as Po}from"./bot-BNv_ZJzi.js";import{d as Vo}from"./types-B0PlfpKc.js";import{VoiceTurnDetails as Ao}from"./VoiceTurnDetails-kS7lfbmt.js";import{gptStageStops as _o,localStageStops as Oo,VoiceTurnStageTrack as Do,VoiceTurnHero as $o,voiceTurnQuoteWho as zo}from"./VoiceTurnStage-DLY6aYDg.js";import{VoiceTurnView as Bo,VoiceTurnSettle as Fo}from"./VoiceTurnView-CF4tIldB.js";/* empty css */const Uo=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Ho=wt("archive",Uo);const Wo=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Go=wt("circle-check",Wo);const qo=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Is=wt("volume-2",qo);const Yo=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],Ts=wt("volume-x",Yo),Jo=new Set(["air-local","local","mini","node"]),Qo=new Set(["main","master","trunk"]);function ds(t){return t.replace(/```[\s\S]*?```/g," code omitted ").replace(/\*\*([^*\n]+)\*\*/g,"$1").replace(/(^|[\s(])\*([^\s*][^*\n]*?[^\s*]|[^\s*])\*(?=[\s)\].,!?;:]|$)/g,"$1$2").replace(/(^|[\s(])_([^\s_][^_\n]*?[^\s_]|[^\s_])_(?=[\s)\].,!?;:]|$)/g,"$1$2").replace(/^\s*[-*]\s+/gm,"").replace(/\bhttps?:\/\/[^\s)]+/gi,o=>Ko(o)).replace(/\b(session|conversation|message|flight|invocation|work)(?:\s+(?:id|ref))?\s*[:#]?\s+([a-z0-9][a-z0-9._:-]{9,})\b/gi,(o,r,a)=>`${r.toLowerCase()} ending in ${Lt(a)}`).replace(/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,o=>`ID ending in ${Lt(o)}`).replace(/@?([a-z][a-z0-9-]*(?:\.[a-z0-9][a-z0-9-]*){2,})\b/gi,(o,r)=>Xo(o)?o:Zo(r)).replace(/`([^`]+)`/g,(o,r)=>en(r)).replace(/\s+/g," ").trim()}function Ko(t){try{return new URL(t).hostname.replace(/^www\./,"").replace(/\./g," dot ")}catch{return"link"}}function Xo(t){const o=t.replace(/^@/,"").toLowerCase();return/\.(com|app|dev|org|net|io|local)(?:\b|\/)/.test(o)&&!o.endsWith(".air-local")}function Zo(t){const o=t.split(".").filter(Boolean);if(o.length<2)return t;const r=[...o];for(;r.length>1&&Jo.has(r.at(-1).toLowerCase());)r.pop();const[a,...c]=r,u=c.filter(f=>!Qo.has(f.toLowerCase())).map(Mt).filter(Boolean);return[Mt(a),...u].filter(Boolean).join(", ")}function en(t){return/^[a-z0-9][a-z0-9._:-]{12,}$/i.test(t)?`ID ending in ${Lt(t)}`:Mt(t)}function Lt(t){return(t.replace(/[^a-z0-9]/gi,"").slice(-4)||t.slice(-4)).split("").join(" ")}function Mt(t){return t.replace(/^@/,"").replace(/[_./:-]+/g," ").replace(/\s+/g," ").trim()}async function tn(t,o){const r=()=>fetch("/api/scoutbot/chat",{method:"POST",headers:{"content-type":"application/json",accept:"text/event-stream"},body:JSON.stringify({body:t.body,route:t.route,uiContext:t.uiContext,...t.voiceTurn?{voiceTurn:t.voiceTurn}:{},stream:!0}),signal:t.signal});let a=await r();if(a.status===401&&await oo()&&(a=await r()),!a.ok){const b=await a.text().catch(()=>"");let p=b||`HTTP ${a.status}`;try{const j=JSON.parse(b);typeof j?.error=="string"&&j.error&&(p=j.error)}catch{}throw new Error(p)}if(!a.body)throw new Error("Scoutbot reply stream is unavailable in this browser.");let c=!1;const u=b=>{if(c||t.signal?.aborted)return;let p="message";const j=[];for(const v of b.split(`
|
|
2
|
+
`))v.startsWith("event:")?p=v.slice(6).trim():v.startsWith("data:")&&j.push(v.slice(5).replace(/^ /,""));if(j.length===0)return;let x;try{x=JSON.parse(j.join(`
|
|
3
|
+
`))}catch{return}if(p==="sentence"){typeof x.text=="string"&&x.text&&o.onSentence?.(x.text);return}if(p==="final"){c=!0,o.onFinal?.(x);return}if(p==="error"){c=!0;const v=typeof x.error=="string"&&x.error?x.error:"Scoutbot assistant failed",k=typeof x.status=="number"&&Number.isFinite(x.status)?x.status:500;o.onError?.({message:v,status:k})}},f=a.body.getReader(),C=()=>{f.cancel().catch(()=>{})};t.signal?.addEventListener("abort",C,{once:!0}),t.signal?.aborted&&C();try{const b=new TextDecoder;let p="";for(;!c&&!t.signal?.aborted;){const{done:j,value:x}=await f.read();if(j)break;p+=b.decode(x,{stream:!0}),p=p.replace(/\r\n/g,`
|
|
4
|
+
`);let v=p.indexOf(`
|
|
5
|
+
|
|
6
|
+
`);for(;v>=0;){const k=p.slice(0,v);p=p.slice(v+2),u(k),v=p.indexOf(`
|
|
7
|
+
|
|
8
|
+
`)}}if(p+=b.decode(),p.trim()&&u(p),t.signal?.aborted)throw new DOMException("Scoutbot request was cancelled.","AbortError");if(!c)throw new Error("Scoutbot reply stream ended before the reply completed.")}finally{t.signal?.removeEventListener("abort",C),C(),f.releaseLock()}}function sn(t={},o={}){const r=t.prepare??io,a=t.play??co,c=t.toSpoken??(d=>d),u=new AbortController,f=[];let C=!1,b=!1,p=!1,j=!1,x=!1,v=!1,k=null;const O=()=>({...t.speed!==void 0?{speed:t.speed}:{},...t.modelId?{modelId:t.modelId}:{},...t.voiceId?{voiceId:t.voiceId}:{},...t.instructions?{instructions:t.instructions}:{},...t.playback?{playback:t.playback}:{},signal:u.signal}),V=d=>{const L=f[d];if(!L||L.prepared||b)return;x||(x=!0,o.onPrepareStart?.());const l=r(L.text,O());l.catch(()=>{}),L.prepared=l};let A,U;const M=new Promise((d,L)=>{A=d,U=L}),E=()=>{const d=k;k=null,d?.()},H=async()=>{let d=0;for(;;){if(b)throw Et();if(d>=f.length){if(C)return;await new Promise(z=>{k=z});continue}V(d),V(d+1);const L=f[d],l=await L.prepared;if(b)throw Et();await a(l,{signal:u.signal,onPlaybackStart:v?void 0:()=>{v=!0,o.onPlaybackStart?.(L.text)}}),d+=1}},w=d=>{p||(p=!0,C=!0,b=!!d,u.abort(),E(),j&&(j=!1,lo()),d?U(d):A())};return H().then(()=>w(),d=>{w(d instanceof Error?d:new Error(String(d)))}),{promise:M,push:d=>{if(b||C)return;let L;try{L=c(d)}catch(l){w(l instanceof Error?l:new Error(String(l)));return}L&&(j||(uo(),j=!0),f.push({text:L,prepared:null}),E())},finish:()=>{b||C||(C=!0,E())},stop:()=>{w(Et())}}}function Et(){const t=new Error("Speech stopped.");return t.name="AbortError",t}function on({state:t,chatExpanded:o,onToggleExpanded:r,sessionPickerOpen:a,onToggleSessionPicker:c,onStartNewChat:u,startingNewChat:f,onSwitchSession:C,switchingSessionId:b,sending:p,briefing:j,pendingAsk:x,onArchiveSession:v,archivingSessionId:k,onAssistantContextMenu:O,suggestedPrompts:V,onSelectPrompt:A}){const M=t.session.messages,E=o?M:M.slice(-4),H=o?0:Math.max(0,M.length-E.length),w=M.length,d=t.sessions.length,L=t.retention,l=M.length===0&&!x&&!p&&!j,z=f||p||j||!!b||!!k,W=t.session.createdAt?go(t.session.createdAt):null,D=l?"Scout conversation":t.session.title&&t.session.title!=="New Scout Session"?t.session.title:`Session ${t.session.id.slice(0,8)}`,R=s.useRef(null),ie=M[M.length-1]?.id??null,ne=M[M.length-1]?.body??"";return s.useEffect(()=>{const h=R.current;h&&(h.scrollTop=h.scrollHeight)},[ie,ne,x,p,o,t.session.id]),e.jsxs("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-hidden rounded border border-[var(--scout-chrome-border-soft)] bg-black/10 font-mono text-xs text-[var(--scout-chrome-ink-faint)]",children:[e.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-[var(--scout-chrome-border-soft)] px-2.5 py-1.5",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 truncate text-[var(--scout-chrome-ink)]",title:t.session.id,children:D}),W&&!l&&e.jsxs("span",{className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]",children:["· ",W]}),!l&&e.jsxs("span",{className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]",children:["· ",w," msg",w===1?"":"s"]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsxs("button",{type:"button",title:"Start a new chat (keeps this chat in Chats)","aria-label":"Start new chat",onClick:u,disabled:z,className:"flex items-center gap-1 rounded border border-lime-300/30 bg-lime-300/[0.06] px-1.5 py-0.5 text-2xs uppercase tracking-[0.1em] text-lime-100 transition-colors hover:border-lime-300/50 hover:bg-lime-300/10 disabled:cursor-not-allowed disabled:opacity-40",children:[f?e.jsx(ke,{size:10,className:"animate-spin"}):e.jsx(ys,{size:10}),e.jsx("span",{children:f?"Starting":"New chat"})]}),e.jsxs("button",{type:"button",title:`Switch chat (${d} total)`,"aria-label":"Switch chat",onClick:c,className:`flex items-center gap-1 rounded border px-1.5 py-0.5 text-2xs uppercase tracking-[0.1em] transition-colors ${a?"border-lime-300/40 bg-lime-300/10 text-lime-100":"border-[var(--scout-chrome-border-soft)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]"}`,children:[e.jsx(Ys,{size:10}),e.jsx("span",{children:"Chats"}),e.jsx("span",{className:"text-[var(--scout-chrome-ink-ghost)]",children:d}),e.jsx(Tt,{size:9,className:a?"rotate-180 transition-transform":"transition-transform"})]}),w>4&&e.jsxs("button",{type:"button",title:o?"Collapse chat":"View full session","aria-label":o?"Collapse chat":"View full session",onClick:r,className:"flex items-center gap-1 rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 text-2xs uppercase tracking-[0.1em] text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]",children:[e.jsx("span",{children:o?"Collapse":"Full"}),o?e.jsx(So,{size:9}):e.jsx(Tt,{size:9})]})]})]}),a&&e.jsxs("div",{className:"shrink-0 border-b border-[var(--scout-chrome-border-soft)] px-2 py-1.5",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2 px-0.5 text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)]",children:[e.jsx("span",{children:"Recent chats"}),L&&L.archivedCount>0&&e.jsxs("span",{children:[L.archivedCount," archived"]})]}),e.jsx("div",{className:"flex max-h-40 flex-col gap-0.5 overflow-y-auto pr-0.5",children:t.sessions.map(h=>{const B=h.id===t.session.id,re=b===h.id,_=k===h.id,ee=rs(h.updatedAt)||"unknown",K=h.title&&h.title!=="New Scout Session"?h.title:`Session ${h.id.slice(0,8)}`;return e.jsxs("div",{className:`flex items-center gap-2 rounded border px-2 py-1 text-left transition-colors ${B?"border-lime-300/40 bg-lime-300/[0.06] text-lime-100":"border-transparent text-[var(--scout-chrome-ink-faint)] hover:border-[var(--scout-chrome-border-soft)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]"}`,children:[e.jsxs("button",{type:"button",onClick:()=>{B||C(h.id)},disabled:B||!!b||!!k,className:"flex min-w-0 flex-1 items-center gap-2 text-left disabled:cursor-not-allowed disabled:opacity-40",children:[e.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${B?"bg-lime-300":"bg-[var(--scout-chrome-ink-ghost)]"}`}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-[var(--scout-chrome-ink)]",children:K}),e.jsxs("span",{className:"shrink-0 text-2xs text-[var(--scout-chrome-ink-ghost)]",children:[h.messageCount," msg"]}),e.jsx("span",{className:"shrink-0 text-2xs text-[var(--scout-chrome-ink-ghost)]",children:ee}),re&&e.jsx(ke,{size:10,className:"shrink-0 animate-spin text-lime-200"})]}),e.jsx("button",{type:"button",title:"Archive chat","aria-label":`Archive chat ${K}`,onClick:()=>v(h.id),disabled:!!b||!!k,className:"flex h-5 w-5 shrink-0 items-center justify-center rounded border border-transparent text-[var(--scout-chrome-ink-ghost)] transition-colors hover:border-[var(--scout-chrome-border-soft)] hover:bg-black/20 hover:text-[var(--scout-chrome-ink)] disabled:cursor-not-allowed disabled:opacity-30",children:_?e.jsx(ke,{size:10,className:"animate-spin"}):e.jsx(Ho,{size:10})})]},h.id)})})]}),e.jsxs("div",{ref:R,className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-2.5 py-2",children:[H>0&&e.jsxs("button",{type:"button",onClick:r,className:"self-start text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)] hover:text-[var(--scout-chrome-ink)]",children:["↑ ",H," earlier message",H===1?"":"s"]}),l&&e.jsx(nn,{suggestedPrompts:V,onSelectPrompt:A}),E.map((h,B)=>{const re=cn(E[B-1],h),_=ln(h.createdAt);return e.jsxs("div",{className:"flex flex-col gap-1",children:[re&&e.jsx("div",{className:"self-center rounded-full bg-white/[0.06] px-2.5 py-0.5 font-mono text-2xs font-medium text-[var(--scout-chrome-ink-ghost)]",title:rs(h.createdAt),"aria-label":_,children:_}),e.jsx(us,{role:h.role,body:h.body,onContextMenu:h.role==="assistant"&&O?ee=>O(ee,h.body):void 0})]},h.id)}),x&&e.jsx(us,{role:"user",body:x,pending:!0}),p&&!x&&e.jsx("p",{className:"text-[var(--scout-chrome-ink-ghost)]",children:"Reading the control plane…"}),j&&e.jsxs("div",{className:"flex items-center gap-2 rounded border border-lime-300/30 bg-lime-300/[0.06] px-2.5 py-2 font-mono text-xs leading-relaxed text-lime-100",children:[e.jsx(ke,{size:12,className:"shrink-0 animate-spin text-lime-300","aria-hidden":"true"}),e.jsxs("div",{className:"min-w-0 flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-xs uppercase tracking-[0.14em] text-lime-300",children:"Briefing"}),e.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:"Codex is reviewing the control-plane snapshot. Voice will pick up when it lands."})]})]})]})]})}function nn({suggestedPrompts:t=[],onSelectPrompt:o}){return e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col justify-start gap-2 px-1 py-2.5",children:[t.length>0?e.jsx("div",{className:"grid gap-1",children:t.slice(0,3).map(r=>e.jsx("button",{type:"button",onClick:()=>o?.(r),className:"min-h-7 truncate rounded border border-[var(--scout-chrome-border-soft)] bg-black/10 px-2.5 text-left font-mono text-xs leading-snug text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]",children:r},r))}):null,e.jsxs("div",{className:"max-w-[30rem]",children:[e.jsx("div",{className:"font-sans text-lg font-semibold leading-tight text-[var(--scout-chrome-ink)]",children:"Start with a question."}),e.jsx("p",{className:"mt-0.5 font-sans text-xs leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Paste a failed result or ask about what you are seeing. Scout replies when you ask."})]})]})}function rn({agents:t,draft:o,onDraftChange:r,onSubmit:a,sending:c,recording:u,voiceLabel:f,voiceBusy:C,voiceUnavailable:b,voiceHeld:p=!1,onMicClick:j,prominent:x=!1,autoFocus:v,focusSignal:k}){const O=s.useRef(null),V=s.useCallback(()=>{const E=O.current;E&&(E.textarea?E.textarea.focus({preventScroll:!0}):E.focus())},[]);s.useEffect(()=>{v&&V()},[v,V]),s.useEffect(()=>{k&&V()},[k,V]);let A="Start talking";b&&(A="Set up Scout voice"),u&&(A="Stop talking"),(C||p)&&(A=f);const U=C||u||p,M=["w-full resize-none rounded border font-mono text-sm leading-relaxed text-[var(--scout-chrome-ink)] placeholder:text-[var(--scout-chrome-ink-ghost)]",x?"min-h-[88px] max-h-[170px] border-lime-300/30 bg-black/25 px-3 py-2 text-md":"min-h-[44px] max-h-[124px] border-[var(--scout-chrome-border-soft)] bg-black/20 px-2 py-1.5"].join(" ");return e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:E=>{E.preventDefault(),a()},children:[e.jsx(Js,{ref:O,agents:t,value:o,onChange:r,onSubmit:()=>{o.trim()&&!c&&a()},placeholder:p?"Type while live voice is on…":x?"Ask Scout about what you are seeing…":"Ask Scout…",rows:x?4:2,disabled:c,submitOnEnter:!0,className:"min-w-0",textareaClassName:M}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("button",{type:"button",title:A,"aria-label":A,onClick:j,disabled:c||C||p,className:`flex h-8 items-center justify-center rounded border transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${u?"border-lime-300/50 bg-lime-300/10 text-lime-200":p?"border-lime-300/25 bg-lime-300/[0.05] text-lime-100/70":"border-[var(--scout-chrome-border-soft)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]"} ${U?"gap-1.5 px-3 font-mono text-xs uppercase tracking-[0.12em]":"w-9"}`,children:[C?e.jsx(ke,{size:13,className:"animate-spin"}):u?e.jsx(js,{size:12,className:"fill-current"}):e.jsx(Ns,{size:13}),U&&e.jsx("span",{className:"truncate",children:f})]}),e.jsx("button",{type:"submit",title:"Send","aria-label":"Send",disabled:!o.trim()||c,className:"flex h-8 w-9 items-center justify-center rounded bg-lime-300/90 text-black transition-opacity disabled:cursor-not-allowed disabled:opacity-40",children:c?e.jsx(ke,{size:13,className:"animate-spin"}):e.jsx(ko,{size:13})})]})]})}function us({role:t,body:o,pending:r=!1,onContextMenu:a}){const c=t==="user",u=c?o:Le(o),[f,C]=s.useState(!1),b=s.useCallback(()=>{St(u).then(()=>{C(!0),window.setTimeout(()=>C(!1),1200)}).catch(()=>{})},[u]);return e.jsxs("div",{className:"group flex flex-col gap-0.5",onContextMenu:a,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("span",{className:`text-2xs uppercase tracking-[0.12em] ${c?"text-[var(--scout-chrome-ink-ghost)]":"text-lime-300"}`,children:[c?"You":"Reply",r&&" · sending"]}),e.jsx("button",{type:"button",title:f?"Copied":"Copy message","aria-label":f?"Copied message":"Copy message",disabled:r||!u.trim(),onClick:b,className:"flex h-5 w-5 shrink-0 items-center justify-center rounded border border-[var(--scout-chrome-border-soft)] text-[var(--scout-chrome-ink-ghost)] opacity-70 transition hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)] disabled:cursor-not-allowed disabled:opacity-20 group-hover:opacity-100",children:f?e.jsx(Go,{size:11}):e.jsx(wo,{size:11})})]}),c?e.jsx("p",{className:`whitespace-pre-wrap break-words text-sm leading-relaxed text-[var(--scout-chrome-ink)] ${r?"opacity-60":""}`,children:u}):e.jsx("div",{className:r?"opacity-60":"",children:e.jsx(ws,{text:u})})]})}const an=5*6e4;function cn(t,o){if(!t||!Rt(t.createdAt,o.createdAt))return!0;const r=et(t.createdAt),a=et(o.createdAt);return r===null||a===null?!0:Math.abs(a-r)>=an}function Rt(t,o){const r=et(t),a=et(o);if(r===null||a===null)return!1;const c=new Date(r),u=new Date(a);return c.getFullYear()===u.getFullYear()&&c.getMonth()===u.getMonth()&&c.getDate()===u.getDate()}function ln(t){const o=et(t);if(o===null)return"";const r=new Date(o),a=new Date,c=new Date(a);c.setDate(a.getDate()-1);const u=r.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return Rt(o,a.getTime())?`Today ${u}`:Rt(o,c.getTime())?`Yesterday ${u}`:r.getFullYear()===a.getFullYear()?`${r.toLocaleDateString([],{month:"short",day:"numeric"})} ${u}`:`${r.toLocaleDateString([],{month:"short",day:"numeric",year:"numeric"})} ${u}`}const ms=[2,4,7,5,3,6,9,5,3,4,8,6,3,5,9,6,3,5,7,4,2,4,6,3],dn=ms.map((t,o)=>{const r=o/ms.length*Math.PI*2-Math.PI/2,a=24-t/2,c=24+t/2;return{x1:36+Math.cos(r)*a,y1:36+Math.sin(r)*a,x2:36+Math.cos(r)*c,y2:36+Math.sin(r)*c}});function un({recording:t,sending:o,speaking:r,voiceAvailable:a,voiceProbeState:c,voiceState:u}){return r?"speaking":o?"thinking":t&&u==="processing"?"processing":t?"listening":c!=="idle"||u==="starting"||a===null?"checking":a===!1?"unavailable":"ready"}const mn={checking:{label:"Getting voice ready",helper:"Checking your microphone and speech services"},unavailable:{label:"Voice is offline",helper:"Tap to reconnect"},listening:{label:"Listening",helper:"Tap to finish your turn"},processing:{label:"Transcribing",helper:"Turning speech into text"},thinking:{label:"Scout is thinking",helper:"Your turn is in"},speaking:{label:"Scout is speaking",helper:"Tap to interrupt"},ready:{label:"Ready to listen",helper:"Tap to speak"}};function pn(t){switch(t){case"listening":return"Finish and send voice turn";case"speaking":return"Stop spoken reply";case"unavailable":return"Retry voice connection";case"checking":return"Checking voice";case"processing":return"Cancel turn";case"thinking":return"Cancel turn";case"ready":return"Start voice turn"}}function hn(t){return t==="listening"||t==="processing"?"listen":t==="thinking"?"think":t==="speaking"?"speak":null}function fn({phase:t,disabled:o,onClick:r}){const a=Es(),c=t==="listening"||t==="speaking",u=pn(t);return e.jsx(ks.div,{animate:c&&!a?{scale:[1,1.025,1]}:{scale:1},transition:c&&!a?{duration:2.2,ease:"easeInOut",repeat:1/0}:{duration:.18},children:e.jsx("button",{type:"button",onClick:r,disabled:o,"aria-label":u,title:u,className:"group grid h-28 w-28 place-items-center rounded-full border border-[var(--dvp-dial-border)] bg-[var(--dvp-dial-bg)] text-[var(--dvp-dial-ink)] shadow-[var(--dvp-dial-shadow)] outline-none transition-[border-color,box-shadow,transform] duration-200 hover:border-[var(--dvp-dial-border-hover)] hover:shadow-[var(--dvp-dial-shadow-hover)] focus-visible:ring-2 focus-visible:ring-[var(--dvp-focus)] focus-visible:ring-offset-4 focus-visible:ring-offset-[var(--dvp-bg)] active:scale-[0.98] disabled:cursor-wait disabled:opacity-65",children:e.jsxs("svg",{viewBox:"0 0 72 72",className:"h-[72px] w-[72px]","aria-hidden":"true",children:[e.jsx("circle",{cx:36,cy:36,r:24,fill:"none",stroke:"var(--dvp-ring)",strokeWidth:.8}),dn.map((f,C)=>e.jsx("line",{x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,stroke:c?"var(--dvp-wave-active)":"var(--dvp-wave)",strokeWidth:"1.15",strokeLinecap:"round"},C)),e.jsx("circle",{cx:36,cy:36,r:7.5,fill:c?"var(--dvp-orb-active)":"var(--dvp-orb)"})]})})})}const vn=[{id:"listen",label:"Listen"},{id:"think",label:"Think"},{id:"speak",label:"Speak"}];function xn({messages:t,pendingAsk:o,partial:r,error:a,status:c,recording:u,sending:f,speaking:C,voiceAvailable:b,voiceInputSource:p,voiceProbeState:j,voiceState:x,voiceReplies:v,settingsOpen:k,setupPanel:O,settingsPanel:V,assistantModel:A,speechIdentity:U,onPrimaryAction:M,onToggleVoiceReplies:E,onToggleSettings:H,onNewChat:w,onDiscardTake:d,onOpenLive:L,showModeSwitch:l=!0,showHeading:z=!0,showTranscript:W=!0,title:D="Direct Voice",onVoicePhaseChange:R}){const ie=Es(),ne=s.useRef(null),h=un({recording:u,sending:f,speaking:C,voiceAvailable:b,voiceProbeState:j,voiceState:x}),B=mn[h],re=h==="checking",_=b===!1?"No microphone available":p??(b===!0?"Default input from Scout Menu":"Checking microphone…"),ee=t.slice(-12),K=r||(f&&ee.at(-1)?.body!==o?o:null),fe=ee.length===0&&!K,Ie=hn(h),we=A?.trim()||"Turn-based voice",Me=h==="unavailable"?"bg-[var(--dvp-dot-off)]":h==="ready"||h==="checking"?"bg-[var(--dvp-dot-idle)]":"bg-[var(--dvp-accent)]",[ce,ae]=s.useState(null),[X,ve]=s.useState(0);s.useEffect(()=>{if(!u){ae(null),ve(0);return}const I=Date.now();ae(I);const Q=window.setInterval(()=>ve(Date.now()-I),100);return()=>window.clearInterval(Q)},[u]);const le=u&&ce!==null?`${(X/1e3).toFixed(1)}s`:void 0,xe=W?null:yo({phase:h,voiceReplies:v,inputLabel:_,inputWarn:b===!1,speechIdentity:U??null,assistantModel:A,recordingClock:le}),N=h==="listening"||h==="processing"||h==="thinking"||h==="speaking"?"row":"card",q=I=>{I==="mic"?d?.():I==="speaker"&&E()},J=I=>{I==="new-chat"?w():H()};return s.useEffect(()=>{ne.current?.scrollIntoView({block:"nearest"})},[t.length,o]),s.useEffect(()=>{R?.(h)},[R,h]),e.jsxs("section",{className:`dvp-room relative flex min-h-0 w-full flex-col bg-[var(--dvp-bg)] text-[var(--dvp-ink)] ${W?"h-full overflow-hidden":"dvp-room--instrument overflow-visible"}`,"aria-label":`${D} conversation`,children:[(z||W)&&e.jsxs("header",{className:"flex min-h-14 shrink-0 items-center justify-between gap-2 border-b border-[var(--dvp-border)] px-3 py-2.5 sm:gap-4 sm:px-7",children:[z?e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("h1",{className:"truncate font-[var(--font-accent-title)] text-sm font-semibold tracking-[-0.018em] text-[var(--dvp-heading)] sm:text-base",children:D}),e.jsx("span",{className:"hidden h-4 w-px bg-[var(--dvp-divider)] sm:block","aria-hidden":"true"}),e.jsxs("div",{className:"hidden min-w-0 items-center gap-2 sm:flex","aria-live":"polite",children:[e.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${Me}`,"aria-hidden":"true"}),e.jsx("span",{className:"truncate text-xs text-[var(--dvp-muted)]",children:B.label})]})]}):e.jsx("div",{className:"min-w-0 flex-1"}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 sm:gap-2",children:[l&&e.jsxs("div",{className:"flex rounded-md border border-[var(--dvp-switch-border)] bg-[var(--dvp-switch-bg)] p-0.5",role:"tablist","aria-label":"Voice mode",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":"true",className:"rounded-[4px] bg-[var(--dvp-switch-active-bg)] px-2 py-1.5 text-[11px] font-medium text-[var(--dvp-switch-active-ink)] shadow-[0_1px_2px_rgba(0,0,0,0.14)] sm:px-3",children:"Local"}),e.jsx("button",{type:"button",role:"tab","aria-selected":"false",onClick:L,disabled:!L,className:"rounded-[4px] px-2 py-1.5 text-[11px] font-medium text-[var(--dvp-switch-idle)] transition-colors hover:bg-[var(--dvp-switch-hover)] hover:text-[var(--dvp-heading)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--dvp-focus)] disabled:cursor-default disabled:opacity-45 sm:px-3",children:"Live"})]}),e.jsxs("button",{type:"button",onClick:w,className:"hidden h-8 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-[var(--dvp-btn)] transition-colors hover:bg-[var(--dvp-hover)] hover:text-[var(--dvp-btn-hover-ink)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--dvp-focus)] min-[430px]:flex sm:px-2.5","aria-label":"Start a new voice conversation",title:"New conversation",children:[e.jsx(ys,{size:14,"aria-hidden":"true"}),e.jsx("span",{className:"hidden md:inline",children:"New chat"})]}),e.jsx("button",{type:"button",onClick:E,className:`grid h-8 w-8 place-items-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--dvp-focus)] ${v?"bg-[var(--dvp-switch-active-bg)] text-[var(--dvp-switch-active-ink)]":"text-[var(--dvp-btn)] hover:bg-[var(--dvp-hover)] hover:text-[var(--dvp-btn-hover-ink)]"}`,"aria-pressed":v,"aria-label":v?"Mute spoken replies":"Enable spoken replies",title:v?"Spoken replies on":"Spoken replies off",children:v?e.jsx(Is,{size:15}):e.jsx(Ts,{size:15})}),e.jsx("button",{type:"button",onClick:H,className:`grid h-8 w-8 place-items-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--dvp-focus)] ${k?"bg-[var(--dvp-accent-soft)] text-[var(--dvp-accent-ink)]":"text-[var(--dvp-btn)] hover:bg-[var(--dvp-hover)] hover:text-[var(--dvp-btn-hover-ink)]"}`,"aria-expanded":k,"aria-label":"Voice and Scoutbot settings",title:"Voice and Scoutbot settings",children:e.jsx(Qs,{size:15})})]})]}),W?e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx("div",{className:"mx-auto flex min-h-full w-full max-w-[880px] flex-col px-6 py-8 sm:px-10 sm:py-10 lg:px-14",children:e.jsxs("div",{className:"w-full max-w-[720px]",children:[fe?e.jsxs("div",{className:"pt-1",children:[e.jsx("p",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--dvp-meta-dim)]",children:"Conversation"}),e.jsx("p",{className:"mt-2 max-w-[38ch] text-sm leading-6 text-[var(--dvp-muted)]",children:"Your voice turns and Scout’s replies will appear here."})]}):e.jsxs("div",{className:"space-y-8 sm:space-y-9",children:[ee.map(I=>{const Q=I.role==="assistant";return e.jsxs("article",{className:"max-w-[68ch]",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[e.jsx("span",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--dvp-meta)]",children:Q?"Scout":"You"}),Q&&e.jsx("span",{className:"text-[10px] text-[var(--dvp-meta-dim)]",children:we})]}),Q?e.jsx("div",{className:"dvp-markdown mt-1.5 text-sm leading-6 text-[var(--dvp-body)] sm:text-base sm:leading-7",children:e.jsx(ws,{text:Le(I.body)})}):e.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-sm leading-6 text-[var(--dvp-body)] sm:text-base sm:leading-7",children:I.body})]},I.id)}),K&&e.jsxs("article",{className:"max-w-[68ch]","aria-live":"polite",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--dvp-accent-ink)]",children:"You"}),e.jsx("span",{className:"text-[10px] text-[var(--dvp-you-meta)]",children:r?"Listening":"Sending"})]}),e.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-sm leading-6 text-[var(--dvp-body)] sm:text-base sm:leading-7",children:K})]})]}),e.jsx("div",{ref:ne})]})})}):null,e.jsx(Ks,{initial:!1,children:(O||k||a&&W)&&e.jsx(ks.div,{initial:ie?!1:{opacity:0,y:6},animate:{opacity:1,y:0},exit:ie?void 0:{opacity:0,y:6},className:"max-h-[34vh] shrink-0 overflow-y-auto border-y border-[var(--dvp-border)] bg-[var(--dvp-well)]",children:e.jsxs("div",{className:"mx-auto w-full max-w-[880px] px-6 py-4 sm:px-10 lg:px-14",children:[a&&W&&e.jsx("p",{className:"mb-3 text-sm leading-6 text-[var(--dvp-error)]",children:a}),O,k&&V]})})}),e.jsx("div",{className:W?"shrink-0 px-5 pb-4 pt-3 sm:px-8 sm:pb-5":"dvp-instrument-stage",children:!W&&xe?e.jsxs(e.Fragment,{children:[e.jsx(Cs,{spec:xe,layout:N,onCta:M,onFlag:q,onTail:J}),a&&e.jsx("p",{className:"dvp-instrument-error",children:a})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center text-center",children:[e.jsx(fn,{phase:h,disabled:re,onClick:M}),e.jsxs("div",{className:"mt-3","aria-live":"polite",children:[e.jsx("p",{className:"text-sm font-semibold text-[var(--dvp-phase)]",children:B.label}),e.jsx("p",{className:"mt-0.5 text-xs text-[var(--dvp-helper)]",children:B.helper})]})]}),W&&e.jsxs("footer",{className:"mx-auto mt-4 flex w-full max-w-[880px] flex-col items-stretch justify-between gap-2 border-t border-[var(--dvp-border)] pt-3 text-[11px] text-[var(--dvp-footer)] sm:flex-row sm:items-center sm:gap-4",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(Ns,{size:12,className:"shrink-0 text-[var(--dvp-mic-icon)]","aria-hidden":"true"}),e.jsxs("span",{className:"truncate",children:["Input: ",_]})]}),e.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 sm:justify-start","aria-label":`Voice turn state: ${B.label}`,children:vn.map(I=>{const Q=Ie===I.id;return e.jsx("span",{className:Q?"font-medium text-[var(--dvp-stage-active)]":"text-[var(--dvp-stage-dim)]","aria-current":Q?"step":void 0,children:I.label},I.id)})}),c&&!f&&h!=="listening"&&e.jsx("span",{className:"hidden max-w-48 truncate text-right text-[var(--dvp-stage-dim)] lg:block",children:c})]})]})})]})}function ps({icon:t,title:o,onClick:r,disabled:a,active:c,badge:u}){return e.jsxs("button",{type:"button",title:o,"aria-label":o,onClick:r,disabled:a,className:`flex shrink-0 items-center gap-1 rounded border p-1 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${c?"border-lime-300/50 bg-lime-300/10 text-lime-200":"border-[var(--scout-chrome-border-soft)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]"}`,children:[t,u&&e.jsx("span",{className:"font-mono text-3xs tracking-tight",children:u})]})}function hs({issue:t,probeState:o,onLaunch:r,onRetry:a,onSettings:c,onDismiss:u}){const f=o==="probing"||o==="launching";return e.jsxs("div",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-black/15 px-2.5 py-2 font-mono text-xs text-[var(--scout-chrome-ink)]",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(cs,{size:13,className:"mt-0.5 shrink-0 text-[var(--scout-chrome-ink-faint)]"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"uppercase tracking-[0.14em] text-[var(--scout-chrome-ink-faint)]",children:"Scout Voice"}),e.jsx("p",{className:"mt-1 leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"Open Scout Menu to use speech."}),t&&e.jsx("p",{className:"mt-2 break-words leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:t})]}),u?e.jsx("button",{type:"button",title:"Hide voice setup","aria-label":"Hide voice setup",onClick:u,className:"shrink-0 rounded border border-transparent p-1 text-[var(--scout-chrome-ink-ghost)] transition-colors hover:border-[var(--scout-chrome-border-soft)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]",children:e.jsx(Lo,{size:11})}):null]}),e.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-1.5",children:[e.jsx(It,{icon:o==="launching"?e.jsx(ke,{size:12,className:"animate-spin"}):e.jsx(cs,{size:12}),label:o==="launching"?"Opening":"Open",onClick:r,disabled:o==="probing",title:"Open Scout services"}),e.jsx(It,{icon:o==="probing"?e.jsx(ke,{size:12,className:"animate-spin"}):e.jsx(Mo,{size:12}),label:"Retry",onClick:a,disabled:f,title:"Check Scout voice again"}),e.jsx(It,{icon:e.jsx(Ro,{size:12}),label:"Voice",onClick:c,disabled:o==="probing",title:"Open Scoutbot voice settings"})]})]})}function It({icon:t,label:o,onClick:r,disabled:a,title:c}){return e.jsxs("button",{type:"button",title:c,onClick:r,disabled:a,className:"flex min-h-7 items-center justify-center gap-1.5 rounded border border-[var(--scout-chrome-border-soft)] px-2 text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)] disabled:cursor-not-allowed disabled:opacity-45",children:[t,o]})}const Ze="gpt-4o-mini-tts",kt={openai:"OpenAI",elevenlabs:"ElevenLabs",nvidia:"NVIDIA",system:"System"},Pt="us-woman",tt=[{id:"us-woman",label:"US Woman",locale:"US English",presentation:"Woman",voiceName:"Marin",description:"Warm, clear, and conversational.",provider:"openai",accentFromPrompt:!1,speech:{modelId:Ze,voiceId:"marin",instructions:"Speak in clear, natural American English with a warm, grounded feminine presentation. Keep the delivery conversational and responsive."}},{id:"us-man",label:"US Man",locale:"US English",presentation:"Man",voiceName:"Cedar",description:"Grounded, calm, and direct.",provider:"openai",accentFromPrompt:!1,speech:{modelId:Ze,voiceId:"cedar",instructions:"Speak in clear, natural American English with a warm, grounded masculine presentation. Keep the delivery conversational and responsive."}},{id:"british-woman",label:"British Woman",locale:"British English",presentation:"Woman",voiceName:"Marin",description:"Warm with a subtle British cadence.",provider:"openai",accentFromPrompt:!0,speech:{modelId:Ze,voiceId:"marin",instructions:"Speak in natural British English with a subtle contemporary British accent and a warm, grounded feminine presentation. Avoid theatrical or exaggerated delivery."}},{id:"british-man",label:"British Man",locale:"British English",presentation:"Man",voiceName:"Cedar",description:"Calm with a subtle British cadence.",provider:"openai",accentFromPrompt:!0,speech:{modelId:Ze,voiceId:"cedar",instructions:"Speak in natural British English with a subtle contemporary British accent and a calm, grounded masculine presentation. Avoid theatrical or exaggerated delivery."}}],Ue={modelId:Ze,voiceId:"marin",instructions:"Speak naturally, clearly, and conversationally."},bn={modelId:"",voiceId:"",instructions:"",playback:"host"};function gn(t){return t==="custom"||t==="device"||tt.some(o=>o.id===t)}function Ls(t,o={}){return t==="device"?bn:t==="custom"?{modelId:o.modelId?.trim()||Ue.modelId,voiceId:o.voiceId?.trim()||Ue.voiceId,instructions:o.instructions?.trim()||Ue.instructions}:tt.find(r=>r.id===t)?.speech??tt.find(r=>r.id===Pt).speech}function Sn(t,o={}){if(t==="device")return{selectionId:t,voiceLabel:"This Mac",provider:"system",providerLabel:kt.system,modelId:"",voiceId:"",metered:!1};const r=tt.find(c=>c.id===t);if(r)return{selectionId:t,voiceLabel:r.voiceName,provider:r.provider,providerLabel:kt[r.provider],modelId:r.speech.modelId,voiceId:r.speech.voiceId,metered:r.provider!=="system"};const a=Ls("custom",o);return{selectionId:"custom",voiceLabel:a.voiceId||"Custom",provider:"openai",providerLabel:kt.openai,modelId:a.modelId,voiceId:a.voiceId,metered:!0}}function fs({presentation:t,voicePresetId:o,onVoicePresetId:r,speechSelectionId:a,onSpeechSelectionId:c,customSpeechModelId:u,onCustomSpeechModelId:f,customSpeechVoiceId:C,onCustomSpeechVoiceId:b,customSpeechInstructions:p,onCustomSpeechInstructions:j,voiceDefaults:x,modelDraft:v,onModelDraft:k,modelOptions:O=[],promptDraft:V,onPromptDraft:A,configLoading:U,configSaving:M,configError:E,configStatus:H,onSave:w,onReload:d}){const L=t==="direct-voice";return e.jsx("div",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--hud-surface)] p-3",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[L?e.jsxs("fieldset",{className:"flex flex-col gap-2",children:[e.jsx("legend",{className:"mb-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Scout voice"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",role:"radiogroup","aria-label":"Scout voice",children:tt.map(l=>{const z=a===l.id;return e.jsxs("button",{type:"button",role:"radio","aria-checked":z,onClick:()=>c(l.id),className:`min-h-20 rounded border p-2.5 text-left transition ${z?"border-[var(--hud-accent)] bg-[var(--hud-accent-soft)] text-[var(--scout-chrome-ink)]":"border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)]"}`,children:[e.jsx("span",{className:"block font-mono text-xs font-bold uppercase tracking-[0.1em]",children:l.label}),e.jsxs("span",{className:"mt-1 block font-mono text-2xs leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:[l.voiceName," · ",l.description]}),e.jsxs("span",{className:"mt-1 block font-mono text-2xs leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:[kt[l.provider]," · ",l.speech.modelId," · ",l.speech.voiceId]}),l.accentFromPrompt&&e.jsx("span",{className:"mt-1 block font-mono text-2xs leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"Accent is prompted, not a separate voice."})]},l.id)})}),e.jsxs("button",{type:"button",role:"radio","aria-checked":a==="device",onClick:()=>c("device"),className:`rounded border px-2.5 py-2 text-left font-mono text-xs transition ${a==="device"?"border-[var(--hud-accent)] bg-[var(--hud-accent-soft)] text-[var(--scout-chrome-ink)]":"border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)]"}`,children:[e.jsx("span",{className:"block font-bold uppercase tracking-[0.1em]",children:"This Mac's voice"}),e.jsx("span",{className:"mt-1 block leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"Speaks through Scout Menu in its own Settings › Voice pick. The only way to hear installed voices such as Kokoro."})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":a==="custom",onClick:()=>c("custom"),className:`rounded border px-2.5 py-2 text-left font-mono text-xs transition ${a==="custom"?"border-[var(--hud-accent)] bg-[var(--hud-accent-soft)] text-[var(--scout-chrome-ink)]":"border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)]"}`,children:[e.jsx("span",{className:"block font-bold uppercase tracking-[0.1em]",children:"Custom voice"}),e.jsx("span",{className:"mt-1 block leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"Use any supported model, voice, and style."})]}),a==="custom"&&e.jsxs("div",{className:"grid gap-2 rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] p-2.5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Speech model",e.jsx("input",{value:u,onChange:l=>f(l.target.value),placeholder:"gpt-4o-mini-tts",className:"rounded border border-[var(--scout-chrome-border-soft)] px-2 py-1.5 font-mono text-xs normal-case tracking-normal text-[var(--scout-chrome-ink)] placeholder:text-[var(--scout-chrome-ink-ghost)] bg-[var(--hud-bg)]"})]}),e.jsxs("label",{className:"flex flex-col gap-1 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Voice ID",e.jsx("input",{value:C,onChange:l=>b(l.target.value),placeholder:"marin",className:"rounded border border-[var(--scout-chrome-border-soft)] px-2 py-1.5 font-mono text-xs normal-case tracking-normal text-[var(--scout-chrome-ink)] placeholder:text-[var(--scout-chrome-ink-ghost)] bg-[var(--hud-bg)]"})]})]}),e.jsxs("label",{className:"flex flex-col gap-1 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Speaking style",e.jsx("textarea",{value:p,onChange:l=>j(l.target.value),rows:3,placeholder:"Speak naturally, clearly, and conversationally.",className:"w-full resize-y rounded border border-[var(--scout-chrome-border-soft)] px-2 py-1.5 font-mono text-xs normal-case leading-relaxed tracking-normal text-[var(--scout-chrome-ink)] placeholder:text-[var(--scout-chrome-ink-ghost)] bg-[var(--hud-bg)]"})]})]}),e.jsx("p",{className:"font-mono text-2xs normal-case leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"Request-based TTS, separate from GPT Live. Replies are AI-generated speech."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"flex flex-col gap-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Voice FX",e.jsx("select",{value:o,onChange:l=>r(l.target.value),className:"rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] px-2 py-1.5 font-mono text-sm normal-case tracking-normal text-[var(--scout-chrome-ink)]",children:ls.map(l=>e.jsxs("option",{value:l.id,children:[l.label," — ",l.family]},l.id))}),e.jsx("span",{className:"font-mono text-2xs normal-case leading-relaxed tracking-normal text-[var(--scout-chrome-ink-ghost)]",children:ls.find(l=>l.id===o)?.description??"Custom voice mood for spoken replies."})]}),e.jsxs("div",{className:"flex flex-col gap-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Scout Voice",e.jsx("div",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] px-2 py-1.5 font-mono text-sm normal-case tracking-normal text-[var(--scout-chrome-ink)]",children:x?`${x.modelId}${x.voiceId?` / ${x.voiceId}`:""}`:"Unavailable"})]})]}),e.jsxs("label",{className:"flex flex-col gap-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Preferred model",O.length>0?e.jsx("select",{value:v,onChange:l=>k(l.target.value),className:"rounded border border-[var(--scout-chrome-border-soft)] px-2 py-1.5 font-mono text-sm normal-case tracking-normal text-[var(--scout-chrome-ink)] bg-[var(--hud-bg)]",disabled:U||M,children:O.map(l=>e.jsx("option",{value:l.id,children:l.label},l.id))}):e.jsx("input",{value:v,onChange:l=>k(l.target.value),placeholder:"gpt-5.6-luna",className:"rounded border border-[var(--scout-chrome-border-soft)] px-2 py-1.5 font-mono text-sm normal-case tracking-normal text-[var(--scout-chrome-ink)] placeholder:text-[var(--scout-chrome-ink-ghost)] bg-[var(--hud-bg)]",disabled:U||M})]}),e.jsxs("label",{className:"flex flex-col gap-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["System Prompt",e.jsx("textarea",{value:V,onChange:l=>A(l.target.value),rows:6,className:"w-full resize-y rounded border border-[var(--scout-chrome-border-soft)] px-2 py-1.5 font-mono text-xs normal-case leading-relaxed tracking-normal text-[var(--scout-chrome-ink)] bg-[var(--hud-bg)]",disabled:U||M})]}),E&&e.jsx("div",{className:"font-mono text-xs leading-relaxed text-[var(--hud-status-error)]",children:E}),H&&e.jsx("div",{className:"font-mono text-xs leading-relaxed text-[var(--hud-accent)]",children:H}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:w,disabled:U||M||!V.trim(),className:"flex items-center justify-center gap-2 rounded bg-[var(--hud-accent)] px-2.5 py-2 font-mono text-xs font-bold uppercase tracking-[0.12em] text-black transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",children:[(U||M)&&e.jsx(ke,{size:13,className:"animate-spin"}),M?"Saving":"Save"]}),e.jsx("button",{type:"button",onClick:d,disabled:U||M,className:"rounded border border-[var(--scout-chrome-border-soft)] px-2.5 py-2 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)] disabled:cursor-not-allowed disabled:opacity-40",children:"Reload"})]})]})})}const kn="chill-dispatcher",wn=6e4,yn=2500,jn=1.2,Nn={lowCutHz:160,highCutHz:5200,bandQ:.35,saturationAmount:.035,bitcrushAmount:0,hissGain:0,hissCutoffHz:1800,presencePeakDb:1.5,presenceCenterHz:1500,presenceQ:.65,compressorThresholdDb:-15,compressorRatio:2.2,clickEnabled:!0,clickGain:.24,clickDurationMs:45,squelchTailEnabled:!0,squelchTailGain:.018,squelchTailDurationMs:95,outputGain:1,wetMix:.38};function Cn(t){const o=Math.min(1,t/8);return{saturationAmount:.035+o*.025,presencePeakDb:1.5+o*1.5}}function En(t,o){return{...t==="chill-dispatcher"?Nn:{},...Cn(o)}}function Ms(t,o,r){return new Promise((a,c)=>{const u=window.setTimeout(()=>c(new Error(r)),o);t.then(a,c).finally(()=>window.clearTimeout(u))})}async function Xe(t,o={}){!t.sessionId&&!o.allowCurrentSession||await Ms(t.cancel(),yn,"Timed out releasing Scout voice session.").catch(()=>{})}function In(t){const o=t instanceof Error?t.message:String(t);return/session_cancelled|was cancelled|cancelled/i.test(o)}const vs=new RegExp("(?:^|(?<=[\\s(`'\"<>]))(?:~\\/|\\/(?:Users|home|opt|var|etc|tmp|private)\\/)[^\\s)`'\"<>]+\\.[A-Za-z0-9]{1,8}\\b","g");function Tn(t){const o=[],r=new Set;vs.lastIndex=0;let a;for(;(a=vs.exec(t))!==null;)r.has(a[0])||(r.add(a[0]),o.push(a[0]));return o}function xs(t){const o=t.split("/").filter(Boolean);return o.length<=2?t:`…/${o.slice(-2).join("/")}`}function Ln(){return{requesterName:"OpenScout",productName:"Scout Voice",headline:"Turn on local voice",body:"Scout voice handles local speech capture and spoken replies. Start Scout services, then return here to talk with your workspace.",actionLabel:"Return to OpenScout",logo:{url:new URL("/openscout-icon.png",window.location.href).toString(),symbolName:"sparkles"}}}const Mn=["Explain what went wrong here.","Help me rewrite this message.","What should I try next?"];function Rn({height:t,forceExpanded:o=!1,fill:r=!1,presentation:a="chat",onOpenLive:c,voiceModeSwitch:u=!0,voiceTitle:f,voiceHeading:C=!0,voiceTranscript:b=!0,onVoicePhaseChange:p,onSpeechIdentityChange:j,onLedgerEvent:x}={}){const{applyScoutbotUiAction:v,agents:k,route:O,onlineCount:V}=Zt(),A=Hs(),U=gs(Ss,!0),M=Vt(),E=U&&(M.state==="connecting"||M.state==="live"),[H,w]=os("openscout.scoutbot.collapsed",!0),[d,L]=s.useState(""),[l,z]=s.useState(!1),[W,D]=s.useState(null),[R,ie]=s.useState(null),[ne,h]=s.useState(null),[B,re]=s.useState("idle"),[_,ee]=os("openscout.scoutbot.voiceReplies",!1),[K]=ro("openscout.scoutbot.voiceSpeed",jn),[fe,Ie]=Ke("openscout.scoutbot.voicePresetId",kn),[we,Me]=Ke("openscout.scoutbot.speechProfileId",Pt),[ce,ae]=Ke("openscout.scoutbot.customSpeechModelId",Ue.modelId),[X,ve]=Ke("openscout.scoutbot.customSpeechVoiceId",Ue.voiceId),[le,xe]=Ke("openscout.scoutbot.customSpeechInstructions",Ue.instructions),[N,q]=s.useState(!1),[J,I]=s.useState(null),[Q,ye]=s.useState(""),[de,Re]=s.useState(!1),[be,st]=s.useState(null),[He,Pe]=s.useState(null),[Ve,Z]=s.useState(null),[Ae,Y]=s.useState(null),[je,Te]=s.useState(!1),[ot,_e]=s.useState(!1),[F,ge]=s.useState(null),[Ne,nt]=s.useState(!1),[We,rt]=s.useState(null),[at,it]=s.useState(!1),[ct,Ge]=s.useState(!1),[lt,ue]=s.useState(null),[g,te]=s.useState(null),[se,dt]=s.useState(""),[At,_t]=s.useState([]),[ut,mt]=s.useState(""),[Ot,Dt]=s.useState(null),[Ps,Oe]=s.useState(!1),[Vs,De]=s.useState(0),[As,pt]=s.useState(!1),[yt,$t]=s.useState(null),$e=gn(we)?we:Pt,oe=s.useMemo(()=>Ls($e,{modelId:ce,voiceId:X,instructions:le}),[le,ce,X,$e]),jt=s.useMemo(()=>Sn($e,{modelId:ce,voiceId:X,instructions:le}),[le,ce,X,$e]),ht=s.useRef(mo()),ze=s.useRef(!1),me=s.useRef(null),Ce=s.useRef(null),Ee=s.useRef(null),pe=s.useRef(null),qe=s.useRef(_);qe.current=_;const zt=s.useRef(x);zt.current=x;const T=s.useCallback(n=>{zt.current?.(n)},[]);s.useEffect(()=>(ze.current=!0,()=>{ze.current=!1,Ce.current="discard";const n=me.current;me.current=null,n&&Xe(n,{allowCurrentSession:!0}),Ee.current?.abort(),pe.current?.stop(),pe.current=null}),[]),s.useEffect(()=>{j?.(jt)},[j,jt]);const G=s.useCallback(()=>{pe.current?.stop(),pe.current=null,Re(!1)},[]),ft=s.useCallback(n=>{if(!n)return;G();const i=ds(n);T({t:"prep-open",at:Date.now(),label:oe.playback==="host"?"speech on this Mac":"tts"});const m=()=>{T({t:"speak-open",at:Date.now(),text:i.slice(0,180)})},S=a==="direct-voice"?po(i,{speed:K,modelId:oe.modelId,voiceId:oe.voiceId,instructions:oe.instructions,playback:oe.playback,onPlaybackStart:m}):ho(i,{speed:K,presetId:fe,params:En(fe,V),onPlaybackStart:m});pe.current=S,Re(!0),S.promise.catch(y=>{if(!Ct(y)){const $=y instanceof Error?y.message:String(y);console.warn("[scoutbot] reply speech unavailable",{message:$}),D($)}}).finally(()=>{pe.current===S&&(pe.current=null,Re(!1),T({t:"speak-close",at:Date.now()}),T({t:"close",at:Date.now()}))})},[T,G,K,oe,V,a,fe]),Bt=s.useCallback(n=>{qe.current&&ft(n)},[ft]),Ft=s.useCallback(n=>{ft(Le(n))},[ft]),{openFilePreview:Ut}=Zt(),Ht=Ws(),_s=s.useCallback((n,i)=>{const m=window.getSelection()?.toString().trim(),S=Le(i),y=Tn(S),$=[];if(m&&($.push({kind:"action",label:"Copy selection",shortcut:"⌘C",onSelect:()=>{St(m)}}),$.push({kind:"separator"})),$.push({kind:"action",label:"Copy message",onSelect:()=>{St(S)}}),y.length>0){$.push({kind:"separator"});for(const P of y.slice(0,5)){const Fe=xs(P);$.push({kind:"action",label:`Preview ${Fe}`,onSelect:()=>Ut(P)})}for(const P of y.slice(0,5)){const Fe=xs(P);$.push({kind:"action",label:`Open ${Fe} in OS`,onSelect:()=>{he("/api/file/reveal",{method:"POST",body:JSON.stringify({path:P})}).catch(()=>{})}})}$.push({kind:"action",label:y.length===1?"Copy path":"Copy first path",onSelect:()=>{St(y[0])}})}$.push({kind:"separator"}),$.push({kind:"action",label:de?"Say again (stop current)":"Say",onSelect:()=>Ft(i)}),Ht(n,$)},[Ut,Ft,Ht,de]);s.useEffect(()=>()=>{G()},[G]);const Os=Mn,Be=s.useCallback(n=>{const i=[...n.messages].reverse().find(S=>S.role==="user"),m=[...n.messages].reverse().find(S=>S.role==="assistant");Pe(i?.body??null),Z(m?Le(m.body):null)},[]),Ye=s.useCallback(async()=>{try{const n=await he("/api/scoutbot/session");ge(n),Be(n.session)}catch{ge(null)}},[Be]);s.useEffect(()=>{Ye()},[Ye]);const vt=s.useCallback(async()=>{it(!0),ue(null);try{const n=await he("/api/scoutbot/config");dt(n.model),_t(n.modelOptions??[]),mt(n.systemPrompt),te(null)}catch(n){ue(n instanceof Error?n.message:"Could not load settings.")}finally{it(!1)}},[]);s.useEffect(()=>{je&&vt()},[vt,je]),s.useEffect(()=>{if(!je)return;let n=!1;return he("/api/voice/defaults").then(i=>{n||Dt(i)}).catch(()=>{n||Dt(null)}),()=>{n=!0}},[je]);const Wt=s.useCallback(async()=>{Ge(!0),ue(null),te(null);try{const n=await he("/api/scoutbot/config",{method:"POST",body:JSON.stringify({model:se,systemPrompt:ut})});dt(n.config.model),_t(n.config.modelOptions??[]),mt(n.config.systemPrompt),te("Saved")}catch(n){ue(n instanceof Error?n.message:"Could not save settings.")}finally{Ge(!1)}},[se,ut]),Ds=s.useCallback(async n=>{if(!(!n||yt)){$t(n),D(null),Ee.current?.abort(),G();try{const i=await he("/api/scoutbot/session/switch",{method:"POST",body:JSON.stringify({id:n})});ge(i),Be(i.session),pt(!1),Oe(!1),window.dispatchEvent(new CustomEvent(Qe,{detail:{id:i.session.id}}))}catch(i){D(i instanceof Error?i.message:"Could not switch session.")}finally{$t(null)}}},[G,yt,Be]),xt=s.useCallback(async()=>{if(!Ne){if(Ee.current?.abort(),F?.session.messages.length===0){L(""),D(null),Oe(!1),pt(!1),Y("New chat ready"),De(n=>n+1);return}nt(!0),D(null),Y("Starting new chat"),G();try{const n=await he("/api/scoutbot/session/reset",{method:"POST"});ge(n),L(""),Pe(null),Z(null),Oe(!1),pt(!1),Y("New chat ready"),De(i=>i+1),window.dispatchEvent(new CustomEvent(Qe,{detail:{id:n.session.id}}))}catch(n){Y(null),D(n instanceof Error?n.message:"Could not start a new chat.")}finally{nt(!1)}}},[Ne,F,G]),$s=s.useCallback(async n=>{if(!(!n||We)){rt(n),D(null),Ee.current?.abort(),G();try{const i=await he("/api/scoutbot/session/archive",{method:"POST",body:JSON.stringify({id:n})});ge(i),Be(i.session),Oe(!1),Y("session archived"),window.dispatchEvent(new CustomEvent(Qe,{detail:{id:i.session.id}}))}catch(i){D(i instanceof Error?i.message:"Could not archive session.")}finally{rt(null)}}},[We,G,Be]),bt=s.useCallback((n,i)=>{ie(i),st(n.activeInputDeviceName),h(i?null:n.lastUnavailableReason??"Scout voice service is not reachable."),re("idle")},[]),Se=s.useCallback(async(n=!1)=>{const i=ht.current;re(S=>S==="launching"?S:"probing");const m=await i.probe(n?{force:!0}:void 0);return bt(i,m),m},[bt]);s.useEffect(()=>{fo();const n=ht.current,i=vo(m=>{ie(m.ok),st(m.inputDeviceName),h(m.ok?null:m.reason),re("idle")});return n.connectionState==="unknown"?Se():bt(n,n.connectionState==="connected"),i},[bt,Se]);const Gt=s.useCallback(()=>{const n=ht.current;D(null),re("launching"),n.launch({source:"openscout",context:Ln()}),window.setTimeout(()=>{Se(!0)},2400)},[Se]),gt=s.useCallback(n=>{for(const i of ao(n))i.type!=="reminder"&&(T({t:"action",at:Date.now(),label:No(i)}),i.type==="ask-agent"?(Y(`Sending to ${i.targetLabel}`),he("/api/scoutbot/actions/ask",{method:"POST",body:JSON.stringify({targetLabel:i.targetLabel,targetAgentId:i.targetAgentId,body:i.body,channel:i.channel})}).then(m=>{Y(m.flightId?`Sent to ${m.targetAgentId??m.targetLabel} · run ${m.flightId}`:`Sent to ${m.targetAgentId??m.targetLabel}`)}).catch(m=>{Y(null),D(m instanceof Error?m.message:"Could not send to agent.")})):v(i))},[v,T]),qt=s.useCallback(n=>{const i=Le(n);Z(i),T({t:"bot-close",at:Date.now()}),gt(n),qe.current||T({t:"close",at:Date.now()}),Bt(i)},[gt,T,Bt]);s.useEffect(()=>{const n=()=>{Y("Scoutbot replied by voice"),Ye()},i=()=>{Y("Scoutbot chat changed"),Ye()};return window.addEventListener(es,n),window.addEventListener(Qe,i),()=>{window.removeEventListener(es,n),window.removeEventListener(Qe,i)}},[Ye]);const Yt=s.useCallback(async(n,i)=>{G();const m=sn({speed:K,modelId:oe.modelId,voiceId:oe.voiceId,instructions:oe.instructions,playback:oe.playback,toSpoken:ds},{onPrepareStart:()=>{Re(!0),T({t:"prep-open",at:Date.now(),label:oe.playback==="host"?"speech on this Mac":"tts"})},onPlaybackStart:P=>{T({t:"speak-open",at:Date.now(),text:P.slice(0,180)})}}),S={promise:m.promise,stop:m.stop};pe.current=S,m.promise.catch(P=>{if(!Ct(P)){const Fe=P instanceof Error?P.message:String(P);console.warn("[scoutbot] reply speech unavailable",{message:Fe}),D(Fe)}}).finally(()=>{pe.current===S&&(pe.current=null,Re(!1),T({t:"speak-close",at:Date.now()}),T({t:"close",at:Date.now()}))});let y=!1,$=null;try{await tn({body:n,route:O,uiContext:{...ts("web"),usageMode:a==="direct-voice"?"local":"chat"},signal:i.signal},{onSentence:P=>m.push(P),onFinal:P=>{y=!0,m.finish(),!i.signal.aborted&&(ge({session:P.session,sessions:P.sessions,config:P.config}),Y("Reply received"),Z(Le(P.reply.body)),T({t:"bot-close",at:Date.now()}),gt(P.reply.body))},onError:({message:P})=>{$=new Error(P),T({t:"bot-close",at:Date.now()}),m.finish()}})}catch(P){throw m.finish(),P}if($)throw $;if(!y&&!i.signal.aborted)throw m.finish(),new Error("Scoutbot reply stream ended before the reply completed.")},[gt,T,a,O,oe,G,K]),Je=s.useCallback(async(n,i)=>{const m=n.trim();if(!m||l)return;const S=new AbortController;Ee.current=S,z(!0),D(null),Pe(m),Z(null),Y("Sending"),T({t:"bot-open",at:Date.now(),label:F?.config.model??F?.session.model??"reply"}),L(y=>y.trim()===m?"":y);try{if(await no().catch(()=>null),S.signal.aborted)return;if(i?.streamVoiceReply){await Yt(m,S);return}const y=await he("/api/scoutbot/chat",{method:"POST",body:JSON.stringify({body:m,route:O,uiContext:{...ts("web"),usageMode:a==="direct-voice"?"local":"chat"}}),signal:S.signal});if(S.signal.aborted)return;ge({session:y.session,sessions:y.sessions,config:y.config}),Y("Reply received"),qt(y.reply.body)}catch(y){Y(null),!S.signal.aborted&&!Ct(y)&&D(y instanceof Error?y.message:"Could not send.")}finally{Ee.current===S&&(Ee.current=null),z(!1),S.signal.aborted&&(T({t:"bot-close",at:Date.now()}),T({t:"close",at:Date.now()}))}},[T,qt,a,O,Yt,l,F]),Jt=s.useCallback(async()=>{if(N)return;const n=ht.current;if(Ce.current=null,D(null),ye(""),I("starting"),xo(),R!==!0&&!await Se(!0)){I(null);return}let i=null,m=!1;const S=async()=>{!i||m||(m=!0,await Xe(i,{allowCurrentSession:me.current===i}),me.current===i&&(me.current=null))};try{if(i=await n.startLive({onState:I,onPartial:ye},{surface:a==="direct-voice"?"direct-voice":"chat-composer"}),!ze.current){await Xe(i,{allowCurrentSession:!0});return}me.current=i,q(!0),T({t:"you-open",at:Date.now()});const y=await i.result;if(await S(),!ze.current)return;if(q(!1),ye(""),T({t:"you-close",at:Date.now(),text:y.text}),T({t:"host-close",at:Date.now()}),Ce.current){T({t:"close",at:Date.now()});return}if(I("done"),y.text){const $=a==="direct-voice"&&qe.current&&oe.playback!=="host";await Je(y.text,$?{streamVoiceReply:!0}:void 0)}else T({t:"close",at:Date.now()})}catch(y){const $=Ce.current;if(!ze.current)return;const P=!!$||In(y);if(await S(),q(!1),ye(""),$==="stop-failed")return;I(P?null:"error"),T({t:"host-close",at:Date.now()}),T({t:"close",at:Date.now()}),P||D(y instanceof Error?y.message:"Scout voice recording failed.")}finally{ze.current&&await S(),Ce.current=null}},[Je,T,a,Se,N,oe,R]),Qt=s.useCallback(async()=>{const n=me.current;if(n){I("processing"),T({t:"you-close",at:Date.now(),text:Q}),T({t:"host-open",at:Date.now(),label:"transcribe"});try{await Ms(n.stop(),wn,"Scout voice did not finish processing the recording.")}catch(i){const m=Ce.current==="discard";Ce.current??="stop-failed",await Xe(n,{allowCurrentSession:!0}),me.current===n&&(me.current=null,q(!1),ye(""),I(m?null:"error")),m||D(i instanceof Error?`Scout voice recording did not finish: ${i.message}`:"Scout voice recording did not finish.")}}},[T,Q]),Nt=s.useCallback(async()=>{const n=me.current;n&&(Ce.current="discard",await Xe(n,{allowCurrentSession:!0}))},[]),Kt=s.useCallback(async()=>{Ee.current?.abort(),G(),await Nt()},[Nt,G]);s.useEffect(()=>{const n=()=>w(!1);return window.addEventListener("scout:scoutbot-panel-open",n),()=>window.removeEventListener("scout:scoutbot-panel-open",n)},[w]),s.useEffect(()=>Xs(()=>w(!H)),[H,w]),s.useEffect(()=>{const n=i=>{const m=i.detail,S=m&&typeof m=="object"&&"body"in m?m.body:null;typeof S=="string"&&S.trim()&&(w(!1),Je(S))};return window.addEventListener(ns,n),()=>window.removeEventListener(ns,n)},[Je,w]),s.useEffect(()=>{const n=i=>{const m=i.detail,S=m&&typeof m=="object"&&"body"in m?m.body:null;typeof S=="string"&&S.trim()&&(w(!1),L(S),De(y=>y+1))};return window.addEventListener("scout:scoutbot-compose",n),()=>window.removeEventListener("scout:scoutbot-compose",n)},[w]);const Xt=s.useMemo(()=>{const n=de?"speaking":l?"thinking":N?"listening":"idle",i=F?.session??null,m=i&&i.messages.length>0?i.messages[i.messages.length-1]:null;return{activity:n,brief:{lastDeliveredAt:null},reminders:{dueCount:0,upcomingCount:0,due:[],next:null},voice:{available:R,setupBlocked:R===!1,replies:_},error:W,session:{title:i?.title??null,lastActivityAt:m?.createdAt??i?.updatedAt??null},conversation:{messageCount:i?.messages.length??0,loading:F===null}}},[de,l,N,R,_,W,F]);s.useEffect(()=>{A?.publishState(Xt)},[A,Xt]),s.useEffect(()=>{if(!A)return;const n={focusScoutbot:()=>w(!1),triggerBrief:()=>{w(!1),De(i=>i+1)},triggerAskState:()=>{w(!1),De(i=>i+1)},toggleVoiceReplies:()=>{const i=!_;ee(i),i||G()},openScoutbotSettings:()=>{w(!1),Te(!0)},startNewChat:()=>{w(!1),Ne||xt()},dismissReminder:()=>{},askReminderStatus:()=>{w(!1),De(i=>i+1)}};A.registerActions(n)},[A,w,_,ee,G,Te,Ne,xt]),s.useEffect(()=>{R===!0&&_e(!1)},[R]);const zs=E?"Live call":N?J==="processing"?"Sending":"Stop":B==="probing"?"Checking Voice":B==="launching"?"Opening Scout":R===!1?"Open Scout":"Start Talking",Bs=F!==null&&F.session.messages.length===0&&!l;if(a==="direct-voice")return e.jsx(xn,{messages:F?.session.messages??[],pendingAsk:l?He:null,partial:Q,error:W,status:Ae,recording:N,sending:l,speaking:de,voiceAvailable:R,voiceInputSource:be,voiceProbeState:B,voiceState:J,voiceReplies:_,settingsOpen:je,assistantModel:F?.session.model??F?.config.model??null,speechIdentity:jt,setupPanel:R===!1?e.jsx(hs,{issue:ne,probeState:B,onLaunch:Gt,onRetry:()=>{Se(!0)},onSettings:()=>Te(!0),onDismiss:()=>_e(!1)}):null,settingsPanel:e.jsx(fs,{presentation:"direct-voice",voicePresetId:fe,onVoicePresetId:Ie,speechSelectionId:$e,onSpeechSelectionId:Me,customSpeechModelId:ce,onCustomSpeechModelId:ae,customSpeechVoiceId:X,onCustomSpeechVoiceId:ve,customSpeechInstructions:le,onCustomSpeechInstructions:xe,voiceDefaults:Ot,modelDraft:se,onModelDraft:dt,modelOptions:At,promptDraft:ut,onPromptDraft:mt,configLoading:at,configSaving:ct,configError:lt,configStatus:g,onSave:()=>{Wt()},onReload:()=>{vt()}}),onPrimaryAction:()=>{l||N&&J==="processing"?Kt():de?G():N?Qt():R===!1?Se(!0):Jt()},onToggleVoiceReplies:()=>{const n=!_;qe.current=n,ee(n),n||G()},onToggleSettings:()=>Te(n=>!n),onDiscardTake:()=>{Nt()},onNewChat:()=>{Kt().finally(()=>{Ne||xt()})},onOpenLive:c,showModeSwitch:u,showHeading:C,showTranscript:b,title:f,onVoicePhaseChange:p});if(H&&!o)return e.jsx("div",{className:"flex shrink-0 items-center border-t border-[var(--scout-chrome-border-soft)] px-3 py-1.5",children:e.jsx(Zs,{})});const Fs=r?"flex h-full min-h-0 flex-col overflow-hidden border-t border-[var(--scout-chrome-border-soft)]":t===void 0?"flex max-h-[60vh] shrink-0 flex-col overflow-hidden border-t border-[var(--scout-chrome-border-soft)]":"flex shrink-0 flex-col overflow-hidden border-t border-[var(--scout-chrome-border-soft)]",Us=t===void 0||r?void 0:{height:`${t}px`};return e.jsxs("section",{className:Fs,style:Us,children:[e.jsxs("div",{className:"flex shrink-0 flex-col gap-2 px-3 pt-2.5 pb-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"flex min-w-0 items-center gap-2",children:e.jsx(Po,{size:20,className:"shrink-0 text-lime-300","aria-hidden":"true"})}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx(ps,{icon:_?e.jsx(Is,{size:11}):e.jsx(Ts,{size:11}),title:E?_?"Voice replies on for typed chat (live call has its own audio)":"Voice replies off for typed chat (live call has its own audio)":_?"Voice replies on (click to mute)":"Voice replies off (click to enable)",onClick:()=>{const n=!_;ee(n),n||G()},active:_}),!o&&e.jsx(ps,{icon:e.jsx(Tt,{size:11}),title:"Minimize",onClick:()=>w(!0)})]})]}),je&&e.jsx(fs,{presentation:"chat",voicePresetId:fe,onVoicePresetId:Ie,speechSelectionId:$e,onSpeechSelectionId:Me,customSpeechModelId:ce,onCustomSpeechModelId:ae,customSpeechVoiceId:X,onCustomSpeechVoiceId:ve,customSpeechInstructions:le,onCustomSpeechInstructions:xe,voiceDefaults:Ot,modelDraft:se,onModelDraft:dt,modelOptions:At,promptDraft:ut,onPromptDraft:mt,configLoading:at,configSaving:ct,configError:lt,configStatus:g,onSave:()=>{Wt()},onReload:()=>{vt()}})]}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col px-3 pb-1.5",children:F&&e.jsx(on,{state:F,chatExpanded:Ps,onToggleExpanded:()=>Oe(n=>!n),sessionPickerOpen:As,onToggleSessionPicker:()=>pt(n=>!n),onStartNewChat:()=>{xt()},startingNewChat:Ne,onSwitchSession:n=>{Ds(n)},switchingSessionId:yt,sending:l,briefing:!1,pendingAsk:l?He:null,onArchiveSession:n=>{$s(n)},archivingSessionId:We,onAssistantContextMenu:_s,suggestedPrompts:Os,onSelectPrompt:n=>{L(n),Oe(!1)}})}),e.jsxs("div",{className:"flex shrink-0 flex-col gap-1.5 border-t border-[var(--scout-chrome-border-soft)] bg-black/10 px-3 pt-2 pb-2.5",children:[R===!1&&ot&&!E&&e.jsx(hs,{issue:ne,probeState:B,onLaunch:Gt,onRetry:()=>{Se(!0)},onSettings:()=>Te(!0),onDismiss:()=>_e(!1)}),(Q||de)&&!E&&e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded border border-[var(--scout-chrome-border-soft)] bg-black/10 px-2.5 py-2 font-mono text-xs leading-relaxed text-[var(--scout-chrome-ink-faint)]",children:[e.jsx("span",{className:"min-w-0 truncate",children:de?"Speaking reply…":Q}),de&&e.jsx("button",{type:"button",title:"Stop spoken reply",onClick:G,className:"shrink-0 rounded border border-[var(--scout-chrome-border-soft)] p-1 text-[var(--scout-chrome-ink)] hover:bg-[var(--scout-chrome-hover)]",children:e.jsx(js,{size:11,className:"fill-current"})})]}),Ae&&!l&&e.jsx("div",{className:"font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)]",children:Ae}),e.jsx(rn,{agents:k,draft:d,onDraftChange:L,onSubmit:()=>{Je(d)},sending:l,recording:N,voiceLabel:zs,voiceBusy:J==="processing"||B==="probing"||B==="launching",voiceUnavailable:R===!1,voiceHeld:E,onMicClick:()=>{if(!E){if(R===!1){_e(!0);return}N?Qt():Jt()}},prominent:Bs&&!E,autoFocus:o,focusSignal:Vs}),W&&e.jsx("div",{className:"rounded border border-red-400/30 bg-red-400/10 px-2.5 py-2 font-mono text-xs leading-relaxed text-red-200",children:W})]})]})}function Pn({dictationActive:t=!1,autoStart:o=!1}){const r=gs(Ss,!0),{enabled:a,state:c,leaseId:u,startCall:f,endCall:C}=Vt(),b=s.useRef(!1),p=s.useRef(null),[j,x]=s.useState(()=>window.innerWidth>=720&&window.innerHeight>=520?"page":"compact"),v=window.webkit?.messageHandlers?.scoutRealtimeVoice;return s.useEffect(()=>{const k=()=>{x(window.innerWidth>=720&&window.innerHeight>=520?"page":"compact")};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]),s.useEffect(()=>{v?.postMessage({kind:"session-state",state:c,leaseId:u})},[u,v,c]),s.useEffect(()=>{const k=()=>{if(p.current)return p.current;const V=C().finally(()=>{p.current===V&&(p.current=null)});return p.current=V,V},O=()=>{k()};return window.__scoutRealtimeVoiceStop=k,window.addEventListener(ss,O),window.__scoutRealtimeVoiceStopRequested&&k(),()=>{window.removeEventListener(ss,O),window.__scoutRealtimeVoiceStop===k&&delete window.__scoutRealtimeVoiceStop}},[C]),s.useEffect(()=>{!o||t||!r||!a||b.current||c!=="idle"&&c!=="ended"&&c!=="error"||(b.current=!0,f())},[o,t,r,a,f,c]),r?a?e.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsx(to,{state:c,onMinimize:v?()=>v.postMessage("minimize"):void 0,onExpand:v?()=>v.postMessage(j==="page"?"restore":"expand"):void 0,layout:j}),e.jsx(so,{dictationActive:t,layout:j})]}):e.jsxs("div",{className:"flex h-full flex-col justify-center gap-2 p-4",children:[e.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Live voice is disabled"}),e.jsx("p",{className:"text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Enable realtime voice in Settings → Voice. The footer Voice control starts and manages calls."})]}):e.jsxs("div",{className:"flex h-full flex-col justify-center gap-2 p-4",children:[e.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Live voice is off"}),e.jsx("p",{className:"text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"This Scout build has live conversations disabled. Calls use the configured OpenAI API account when the feature is available."})]})}function Vn(t){const o=Math.max(0,Math.floor(t/1e3));return`${String(Math.floor(o/60)).padStart(2,"0")}:${String(o%60).padStart(2,"0")}`}function An(t){return t?`OpenAI ${t.model} · ${t.voice} · metered`:"OpenAI realtime · metered"}function Rs(t){if(!t)return"on-device STT · voice host resolving…";const o=`${t.providerLabel}${t.modelId?` ${t.modelId}`:""} · ${t.voiceLabel}`;return t.metered?`on-device STT · ${o} · metered per reply`:`on-device STT · ${o} · unmetered`}const bs=t=>`${t.toFixed(1)}s`,_n=1;function On(t,o){switch(t){case"listening":return"the take is recording · nothing is sent until Send";case"processing":return"turning speech into text";case"thinking":return"your turn is in";case"speaking":return o?.metered?"spoken reply · metered":"spoken reply · unmetered";default:return Rs(o)}}function Dn(){const{state:t,leaseId:o,enabled:r,error:a,sessionAction:c,endCall:u,startCall:f,startNewChat:C,openVoiceSettings:b,micMuted:p,playbackMuted:j,setMicMuted:x,setPlaybackMuted:v,ledger:k}=Vt(),[O,V]=s.useState("gpt-live"),[A,U]=s.useState(!1),[M,E]=s.useState(null),H=s.useRef(!1),w=t==="connecting"||t==="live"||o!=null,d=w?"gpt-live":O,[L,l]=s.useState(as),[z,W]=s.useState("ready"),[D,R]=s.useState(!1),[ie,ne]=s.useState(null),[h,B]=s.useState(null),[re,_]=s.useState(null),[ee,K]=s.useState(null),[fe,Ie]=s.useState(0),[we,Me]=s.useState(()=>Date.now()),ce=s.useRef(null),ae=t==="connecting"||t==="live";s.useEffect(()=>{const g=new AbortController;Gs(g.signal).then(se=>{se.model&&se.voice&&_({model:se.model,voice:se.voice})}).catch(()=>{});const te=qs(se=>{se.model&&se.voice&&_({model:se.model,voice:se.voice})});return()=>{g.abort(),te()}},[]),s.useEffect(()=>{let g=!1;return bo().then(({settings:te})=>{g||K(te.inputDeviceName??"browser default")}).catch(()=>{g||K("browser default")}),()=>{g=!0}},[]),s.useEffect(()=>{if(t==="connecting"&&(ce.current=Date.now(),Ie(0)),t!=="live"&&t!=="connecting")return;const g=window.setInterval(()=>{const te=ce.current;te&&Ie(Date.now()-te)},250);return()=>window.clearInterval(g)},[t]);const X=ae||t==="ended"?Vn(fe):void 0,ve=An(re),le=Rs(h),xe=d==="gpt-live"?k??as:L,N=xe.turns.at(-1),q=ie?xe.turns.find(g=>g.id===ie):void 0,J=!!N?.spans.some(g=>g.end===null);s.useEffect(()=>{R(!1),ne(null)},[d]),s.useEffect(()=>{if(!J)return;const g=window.setInterval(()=>Me(Date.now()),120);return()=>window.clearInterval(g)},[J]);const I=N&&J&&!q?Math.max(0,(we-N.origin)/1e3):void 0,Q=z==="listening"||z==="processing"||z==="thinking"||z==="speaking",ye=N&&!J&&N.spans.length>0?Math.max(...N.spans.map(g=>g.end??0)):null,de=!!(d==="local-live"&&Q&&N&&ye!==null&&(we-N.origin)/1e3-ye<_n),be=!!(N&&!q&&(J||de||!!(d==="gpt-live"&&t==="live"&&N&&!J))),st=I??(N?is(N):0),He=be&&N?Co(N,st):null,Pe=He?.who??"open",Ve=q??N,Z=q??(be?N:void 0),Ae=D&&Ve,Y=d==="gpt-live"?re?.voice??null:h?.voiceLabel??null,je=!!N?.spans.some(g=>g.lane==="voice"&&g.tone==="speak"&&g.end===null),Te=d==="gpt-live"?_o({state:t,floorWho:be?Pe:"open",speakOpen:je,voiceName:Y}):Oo(Z,q?void 0:I,Y),ot="live · billed per second · the meter is running",_e=!Z&&!(d==="gpt-live"&&t==="live"),F=q?"holding":be?Pe:d==="gpt-live"?t==="live"?"live":t==="connecting"?"connecting":"ready":z==="checking"?"checking":z==="unavailable"?"offline":"ready",ge=F==="you"||F==="live"?"open":F==="Scout"?d==="gpt-live"?"sky":"wait":F==="Scoutbot"?"wait":"dim",Ne=be&&I!==void 0?bs(I):Z?bs(is(Z)):d==="gpt-live"&&ae?X:void 0,nt=q?Eo(q):be?He?.beneath??(d==="gpt-live"?ot:On(z,h)):d==="gpt-live"&&t==="live"?ot:d==="gpt-live"?ve:le,We=Z&&Io(Z.quote)||void 0,rt=_e?d==="gpt-live"?"Start a call and hold the floor.":"Tap, talk, send. The reply speaks.":Z?"…":"The floor is open.",at=N&&J?N.id:null,it=N&&J?Math.max(0,(we-N.origin)/1e3):void 0,ct=d==="gpt-live"?ae&&X?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"voice-readout-clock",children:X})," · metered"]}):t==="ended"&&X?`last call ${X} · metered`:ve:le,Ge=async g=>{if(!(g===d||H.current)){H.current=!0,U(!0),E(null);try{if(g==="local-live"&&w&&!await u()){V("gpt-live"),E("Call cleanup is incomplete. Retry ending the API call before switching to Local.");return}R(!1),ne(null),V(g)}catch{V("gpt-live"),E("Could not end the API call. Retry before switching to Local.")}finally{H.current=!1,U(!1)}}},lt=()=>{if(q){ne(null),R(!0);return}R(g=>!g)},ue=jo({enabled:r,state:t,error:a,clock:ae?X:void 0,meterLine:ve,inputLabel:ee??"browser default",micMuted:p,playbackMuted:j,newChatBusy:c!==null});return w&&!ae&&(ue.cta={label:"Retry ending call",tone:"end"},ue.note="Call cleanup is incomplete. End this call before starting another.",ue.noteError=!0),A&&(ue.cta={...ue.cta,label:"Ending call…",disabled:!0,busy:!0}),e.jsxs("main",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-[var(--scout-chrome-bg)]",children:[e.jsxs("header",{className:"flex min-h-14 shrink-0 items-center justify-between gap-4 border-b border-[var(--scout-chrome-border-soft)] px-4 py-2.5 sm:px-7",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("span",{className:"hidden shrink-0 font-mono text-[10px] font-semibold uppercase tracking-[0.08em] text-[var(--scout-chrome-ink-ghost)] md:block",children:"Voice"}),e.jsx("h1",{className:"truncate font-[var(--font-accent-title)] text-base font-semibold tracking-[-0.018em] text-[var(--scout-chrome-ink-strong)]",children:d==="gpt-live"?"GPT Live":"Local Live"}),e.jsx("span",{className:"hidden h-4 w-px bg-[var(--scout-chrome-border-soft)] sm:block","aria-hidden":"true"}),e.jsx("span",{className:"voice-readout hidden sm:block","aria-live":"polite",children:ct})]}),e.jsxs("div",{className:"voice-mode-switch",role:"tablist","aria-label":"Voice mode",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":d==="gpt-live",disabled:A,onClick:()=>{Ge("gpt-live")},children:"GPT Live"}),e.jsx("button",{type:"button",role:"tab","aria-selected":d==="local-live",disabled:A,title:w?"Ends local audio and releases the call lease before switching. Provider usage confirmation is separate.":void 0,onClick:()=>{Ge("local-live")},children:"Local Live"})]})]}),M&&e.jsx("p",{role:"alert",className:"shrink-0 px-4 py-2 text-sm text-[var(--scout-chrome-ink-strong)]",children:M}),e.jsx("div",{className:"max-h-[40%] shrink-0 overflow-y-auto",children:e.jsx(eo,{mode:d==="gpt-live"?"api":"local",active:d==="gpt-live"?ae:z==="thinking",currentLeaseId:o})}),e.jsxs("section",{className:"voice-instrument min-h-0 flex-1 overflow-hidden",children:[e.jsx("div",{className:"voice-instrument-main flex min-h-0 flex-col overflow-hidden",children:e.jsxs("div",{className:"voice-stack",children:[e.jsx(Do,{mode:d,stops:Te,connecting:d==="gpt-live"&&t==="connecting",error:d==="gpt-live"&&t==="error",continuous:d==="gpt-live"&&t==="live"}),q&&e.jsxs("p",{className:"vtl-hold",children:[e.jsx("b",{children:"holding"})," this turn ·"," ",e.jsx("button",{type:"button",onClick:()=>{ne(null),R(!1)},children:"back to now"})]}),e.jsx($o,{who:F,whoTone:ge,clock:Ne,story:nt,quote:We,quoteWho:zo(Z),placeholder:rt,turn:Z,now:q?void 0:I,live:be&&J,lanesOpen:!!Ae,onToggleLanes:Ve?lt:void 0}),Ae&&Ve&&e.jsxs("div",{className:"overflow-x-auto",children:[e.jsx(Bo,{turn:Ve,now:I,mode:d}),e.jsx(Ao,{turn:Ve,now:I})]}),e.jsx("div",{className:"voice-stack-ctl",children:d==="gpt-live"?e.jsx(Cs,{layout:ae?"row":"card",spec:ue,onCta:()=>{H.current||(w?u():r?f():b())},onFlag:g=>{g==="mic"?x(!p):g==="speaker"&&v(!j)},onTail:g=>{g==="new-chat"?C():b()}}):e.jsx(Rn,{forceExpanded:!0,presentation:"direct-voice",voiceModeSwitch:!1,voiceHeading:!1,voiceTranscript:!1,voiceTitle:"Local Live",onSpeechIdentityChange:B,onLedgerEvent:g=>l(te=>To(te,g)),onVoicePhaseChange:W})})]})}),e.jsxs("aside",{className:"voice-instrument-trace flex min-h-0 flex-col",children:[e.jsx("p",{className:"voice-trace-kicker",children:"This call"}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx(Fo,{turns:xe.turns,selectedId:ie,mode:d,liveId:at,now:it,onSelect:g=>{ne(te=>te===g?null:g),R(!0)}})})]})]})]})}const $n=Vo({id:"voice",label:"Voice",route:{view:"voice"},webPath:"/voice",screen:"RealtimeVoiceScreen",embed:{path:"/embed/voice",profile:"macos.voice",rootClassName:"s-voice-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:t=>({dictationActive:t.get("dictationActive")==="1",autoStart:t.get("autoStart")==="1"})}}),Sr=Object.freeze(Object.defineProperty({__proto__:null,RealtimeVoicePage:Dn,RealtimeVoiceScreen:Pn,scoutSurface:$n},Symbol.toStringTag,{value:"Module"}));export{Dn as R,Rn as S,Sr as a};
|
package/dist/client/assets/{RenderedWorkerSprite-Dhlyg89J.js → RenderedWorkerSprite-BNhFXMIo.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as p}from"./index-
|
|
1
|
+
import{r as i,j as p}from"./index-BFbLvCJn.js";const v="/assets/worker-rendered-v1-DmGVMlVi.png",m="/assets/worker-thinking-v1-ujakpzrK.png",b="/assets/worker-working-v1-BROAvJ_z.png",f="/assets/worker-waiting-v1-DbTSsfJJ.png",h="/assets/pip-idle-v1-Tt-CZsRG.png",S="/assets/pip-thinking-v1-BoHWSEye.png",j="/assets/pip-working-v1-wWQLRS1z.png",R="/assets/pip-waiting-v1-DkuvJ-dN.png",d={id:"sage-worker",name:"Sage",poses:{idle:v,thinking:m,working:b,waiting:f}},W={id:"pip-worker",name:"Pip",poses:{idle:h,thinking:S,working:j,waiting:R}},_=[d,W];function x({posture:g,paused:a=!1,size:t=76,character:e=d}){const r=i.useRef(null),[l,k]=i.useState(!0),[c,u]=i.useState(()=>typeof document>"u"||!document.hidden);return i.useEffect(()=>{const s=r.current;if(!s)return;const n=new IntersectionObserver(([w])=>k(w.isIntersecting));n.observe(s);const o=()=>u(!document.hidden);return document.addEventListener("visibilitychange",o),()=>{n.disconnect(),document.removeEventListener("visibilitychange",o)}},[]),p.jsx("span",{ref:r,"aria-hidden":"true",className:`rendered-worker${a||!l||!c?" is-paused":""}`,style:{"--worker-size":`${t}px`},children:Object.entries({idle:e.poses.idle,thinking:e.poses.thinking||e.poses.idle,working:e.poses.working||e.poses.idle,waiting:e.poses.waiting||e.poses.idle}).map(([s,n])=>p.jsx("img",{src:n,alt:"",draggable:!1,width:t,height:t,className:`rendered-worker__pose is-${s}${g===s?" is-current":""}`},s))})}const E=Object.freeze(Object.defineProperty({__proto__:null,RenderedWorkerSprite:x},Symbol.toStringTag,{value:"Module"}));export{x as R,E as a,_ as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f,j as u}from"./index-
|
|
1
|
+
import{r as f,j as u}from"./index-BFbLvCJn.js";function h({at:t,nextAt:o,start:n,duration:s,running:e}){const a=f.useRef(null);return f.useEffect(()=>{const p=performance.now();let c=0;const i=()=>{const l=e?Math.min(1,(performance.now()-p)/s):0,d=t+Math.max(0,o-t)*l,m=Math.max(0,Math.floor(d-n)),r=Math.floor(m/1e3);a.current&&(a.current.textContent=`T+ ${String(Math.floor(r/3600)).padStart(2,"0")}:${String(Math.floor(r/60)%60).padStart(2,"0")}:${String(r%60).padStart(2,"0")}.${String(m%1e3).padStart(3,"0")}`),e&&l<1&&(c=requestAnimationFrame(i))};return i(),()=>cancelAnimationFrame(c)},[t,o,n,s,e]),u.jsx("time",{ref:a,className:"adventures__elapsed-clock",title:"Playback time interpolated between recorded observations","aria-label":"Playback elapsed time"})}export{h as ReplayClock};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as r}from"./index-
|
|
1
|
+
import{r as i,j as r}from"./index-BFbLvCJn.js";import{s as a}from"./observe-M3rLosT5.js";import{f as m}from"./floor-preview-text-HrORUJ7D.js";import"./api-DSqpVKC7.js";import"./agent-state-DDhnFEEP.js";import"./surface-activity-B1rgWB1i.js";function h({stops:l,index:o,onInspect:s}){const n=i.useRef(null),c=i.useRef(!0);return i.useEffect(()=>{c.current&&n.current&&(n.current.scrollTop=0)},[o,l.length]),r.jsxs("div",{className:"replay-log",ref:n,role:"region","aria-label":"Replay event log",tabIndex:0,onScroll:()=>{const e=n.current;e&&(c.current=e.scrollTop<24)},children:[l.slice(0,o+1).map((e,t)=>({stop:e,position:t})).reverse().map(({stop:e,position:t})=>r.jsxs("button",{type:"button",className:t===o?"is-current":"",onClick:()=>s(t),children:[r.jsx("time",{children:new Date(e.at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),r.jsx("span",{className:"replay-log__kind",children:e.event.tool||e.kind}),r.jsx("span",{children:m(a(e.event))||e.label})]},e.id)),l.length?null:r.jsx("p",{children:"No recorded events yet."})]})}export{h as ReplayLog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,m as ae,j as e}from"./index-EsrkGBcv.js";import{C as S}from"./CrewSprite-Dhryjx2c.js";import{S as ye}from"./SproutActionSprite-BSiTS4en.js";import{b as je}from"./adventure-playback-DTfkhIc0.js";import{p as ve}from"./adventure-habitats-v1-M1lcpTJh.js";/* empty css */const O={start:"Starting",think:"Thinking",read:"Reading",edit:"Editing",tool:"Running",message:"Handing off",wait:"Waiting",end:"Turn complete",stopped:"Interrupted"},oe={domes:.16,biodome:.46,hangar:.84},z={start:"domes",end:"domes",stopped:"domes",wait:"domes",message:"domes",think:"biodome",read:"biodome",edit:"hangar",tool:"hangar"},be=2172/724,N=150,ge=70,Ne=.9,we=110,Me=900,T=(t,a,n)=>Math.max(a,Math.min(n,t));function H(t,a){const n=oe[t]*a.panoramaWidth;return T(a.stageWidth/2-n,Math.min(0,a.stageWidth-a.panoramaWidth),0)}function ke(t,a){const n=new Map,r=N/2;return t.map(f=>{const u=z[f],M=(n.get(u)??0)+1;n.set(u,M);const y=H(u,a),c=oe[u]*a.panoramaWidth,k=(M%5-2)*ge;return T(c+k,r-y,a.stageWidth-r-y)})}function Ee(t,a,n){return t+H(a,n)}function Re(t,a,n){const r=Math.abs(a-t);return T(r/Ne,we,Me)/Math.max(.25,n)}function Ce(t,a){return a<t}function Se(t,a){return t==="travel"?a?"jump":"run":t==="land"?"land":"idle"}function Be(t){return t.checkpoint?1:t.routine?.32:.64}function ne(t){return t==="think"?"thought":t==="message"?"speech":null}function Te(t){return ne(t)===null}const $e=14,Le=19,Ae=22,We=12,Ie=3;function De(t,a){return Math.max(0,t-a-N-$e)}function Oe(t){const a=t-Ae-We;return T(Math.floor(a/Le),1,Ie)}const P={start:"var(--s-dim)",think:"var(--s-muted)",read:"var(--cat-sky)",edit:"var(--cat-gold)",tool:"var(--cat-purple)",message:"var(--info)",wait:"var(--color-status-warn-fg)",end:"var(--color-status-ok-fg)",stopped:"var(--color-status-error-fg)"};function B(t){const a=Math.round(t/1e3);return`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`}function Ge({stops:t,index:a,onSeek:n,playing:r,onPlayingChange:f,speed:u,onSpeedChange:M,actor:y,evidence:c,recipient:k,paused:w=!1,header:le,onInspect:$}){const F=l.useRef(null),V=l.useRef(null),G=l.useRef(null),[g,re]=l.useState({stageWidth:1080,panoramaWidth:1410}),[K,ie]=l.useState(420),[L,E]=l.useState("work"),[m,Y]=l.useState(null),[Z,q]=l.useState(null);l.useLayoutEffect(()=>{const s=F.current;if(!s)return;const o=()=>{const{width:C,height:D}=s.getBoundingClientRect(),fe=Math.max(D*1.12,D+50);re({stageWidth:C,panoramaWidth:Math.max(C,fe*be)}),ie(D)};o();const x=new ResizeObserver(o);return x.observe(s),()=>x.disconnect()},[]);const _=l.useMemo(()=>t.map(s=>s.kind),[t]),d=l.useMemo(()=>t.map(s=>je(s)),[t]),ce=l.useMemo(()=>ke(_,g),[_,g]),i=Math.max(0,Math.min(t.length-1,a)),p=t[i],h=d[i],j=_[i],v=p?Ee(ce[i],z[j],g):g.stageWidth/2,ue=p?H(z[j],g):0,J=l.useRef(v),Q=J.current,de=Ce(Q,v),R=Re(Q,v,u);l.useEffect(()=>{J.current=v},[v]);const A=r?R:260;l.useEffect(()=>{if(!r||!h){E("work");return}E("travel");const s=260/Math.max(.25,u),o=window.setTimeout(()=>E(h.checkpoint?"land":"work"),R),x=window.setTimeout(()=>E("work"),R+s);return()=>{window.clearTimeout(o),window.clearTimeout(x)}},[i,r,u,h?.checkpoint]),l.useEffect(()=>{if(!r||!h)return;if(i+1>=t.length){f(!1);return}const s=window.setTimeout(()=>n(i+1),Math.min(h.durationMs,2600)/u);return()=>window.clearTimeout(s)},[r,i,u,h,t.length,n,f]),l.useEffect(()=>{G.current?.scrollIntoView({block:"nearest",behavior:"smooth"})},[i]);const pe=l.useMemo(()=>d.slice(0,i+1).reduce((s,o)=>s+o.durationMs,0),[d,i]),he=l.useMemo(()=>d.reduce((s,o)=>s+o.durationMs,0),[d]),me=l.useCallback(s=>{const o=V.current?.getBoundingClientRect();if(!o||t.length<2)return;const x=(s.clientX-o.left)/o.width;n(Math.max(0,Math.min(t.length-1,Math.round(x*(t.length-1)))))},[n,t.length]),W=l.useCallback(s=>{$?$(s):q(s)},[$]),b=y?ae(y.agent.name):void 0,I=k?ae(k.agent.name):void 0,_e=j==="think"&&L==="work",ee=L==="work"?ne(j):null,te=Oe(De(K,K*.38)),se=Se(L,!!h?.checkpoint),xe=w||!r;return!p||!h?null:e.jsxs("div",{className:"replay-outpost",children:[e.jsxs("div",{className:"replay-outpost__head",children:[b?e.jsx(S,{slug:b,size:26,paused:w}):null,e.jsx("div",{className:"replay-outpost__who",children:y?.agent.name??"Unknown agent"}),e.jsx("div",{className:"replay-outpost__spacer"}),le]}),e.jsxs("div",{className:"replay-outpost__stage",ref:F,children:[e.jsx("img",{className:"replay-outpost__panorama",src:ve,alt:"",draggable:!1,style:{width:g.panoramaWidth,transform:`translateX(${ue}px)`,transitionDuration:`${A}ms`}}),e.jsx("div",{className:"replay-outpost__veil"}),e.jsxs("div",{className:"replay-outpost__hud",children:[e.jsx("span",{className:"replay-outpost__hud-dot","data-failed":h.checkpoint&&j==="stopped"?"":void 0}),e.jsx("span",{className:"replay-outpost__hud-who",children:y?.agent.name??""}),e.jsxs("span",{className:"replay-outpost__hud-step",children:[i+1," / ",t.length]})]}),e.jsxs("div",{className:"replay-outpost__actor",style:{transform:`translateX(${v-N/2}px)`,transitionDuration:`${A}ms`},children:[e.jsx("div",{className:`replay-outpost__art${se==="jump"?" is-hopping":""}`,style:{transform:de?"scaleX(-1)":void 0,animationDuration:`${R}ms`},children:_e&&b?e.jsx("span",{className:"replay-outpost__standing",children:e.jsx(S,{slug:b,size:N,paused:w,expression:"look-up"})}):b==="sprout"?e.jsx(ye,{action:se,size:N,paused:xe,playbackRate:u}):b?e.jsx("span",{className:"replay-outpost__standing",children:e.jsx(S,{slug:b,size:N,paused:w})}):null}),e.jsx("div",{className:"replay-outpost__shadow"}),ee==="thought"?e.jsxs("div",{className:"replay-outpost__bubble is-thought",style:{"--replay-bubble-lines":te},children:[e.jsx("p",{className:"replay-outpost__bubble-text",children:p.event.text.trim()}),e.jsx("span",{className:"replay-outpost__puff is-big"}),e.jsx("span",{className:"replay-outpost__puff is-small"})]}):ee==="speech"?e.jsxs("div",{className:"replay-outpost__bubble is-speech",style:{"--replay-bubble-lines":te},children:[p.event.to&&!I?e.jsxs("span",{className:"replay-outpost__bubble-to",children:["to ",p.event.to]}):null,e.jsx("p",{className:"replay-outpost__bubble-text",children:p.event.text.trim()||h.label||p.label}),e.jsx("span",{className:"replay-outpost__tail"})]}):Te(j)?e.jsxs("div",{className:"replay-outpost__doing",children:[e.jsx("div",{className:"replay-outpost__activity",children:O[j]}),e.jsx("div",{className:"replay-outpost__target",children:h.label||p.artifact||p.label})]}):null]}),p.event.to&&I?e.jsxs("div",{className:"replay-outpost__handoff",style:{left:v+170,transitionDuration:`${A}ms`},children:[e.jsx("span",{className:"replay-outpost__standing",children:e.jsx(S,{slug:I,size:78,paused:w})}),e.jsx("div",{className:"replay-outpost__shadow is-small"}),e.jsxs("div",{className:"replay-outpost__handoff-label",children:["to ",p.event.to]})]}):null]}),e.jsxs("div",{className:"replay-outpost__ridge",children:[e.jsxs("div",{className:"replay-outpost__transport",children:[e.jsx("button",{type:"button",className:"replay-outpost__play",onClick:()=>f(!r),"aria-label":r?"Pause replay":"Play replay",children:r?e.jsxs("svg",{width:"9",height:"10",viewBox:"0 0 9 10","aria-hidden":"true",children:[e.jsx("rect",{width:"3",height:"10",fill:"currentColor"}),e.jsx("rect",{x:"6",width:"3",height:"10",fill:"currentColor"})]}):e.jsx("svg",{width:"9",height:"10",viewBox:"0 0 9 10","aria-hidden":"true",children:e.jsx("path",{d:"M0 0l9 5-9 5z",fill:"currentColor"})})}),e.jsxs("select",{className:"replay-outpost__speed",value:u,onChange:s=>M(Number(s.target.value)),"aria-label":"Replay speed",children:[e.jsx("option",{value:1,children:"1×"}),e.jsx("option",{value:2,children:"2×"}),e.jsx("option",{value:4,children:"4×"})]})]}),e.jsxs("div",{className:"replay-outpost__bars",ref:V,onClick:me,onMouseLeave:()=>Y(null),children:[t.map((s,o)=>e.jsx("div",{className:`replay-outpost__bar${o<=i?" is-seen":""}${o===i?" is-now":""}`,style:{height:`${Be(d[o])*100}%`,color:P[_[o]]},onMouseEnter:()=>Y(o),children:d[o].checkpoint?e.jsx("span",{className:"replay-outpost__flag"}):null},s.id)),m!==null&&t[m]?e.jsxs("div",{className:"replay-outpost__tip",style:{left:`${(m+.5)/t.length*100}%`},children:[e.jsxs("div",{className:"replay-outpost__tip-kind",style:{color:P[_[m]]},children:[O[_[m]]," · ",B(d[m].durationMs)]}),e.jsx("div",{className:"replay-outpost__tip-title",children:d[m].label||t[m].artifact})]}):null]}),e.jsxs("div",{className:"replay-outpost__elapsed",children:[B(pe)," ",e.jsxs("span",{children:["/ ",B(he)]})]})]}),e.jsxs("div",{className:"replay-outpost__subsurface",children:[e.jsx("div",{className:"replay-outpost__log",children:t.map((s,o)=>e.jsxs("div",{ref:o===i?G:void 0,className:`replay-outpost__row${o===i?" is-now":""}${o>i?" is-ahead":""}`,style:{color:P[_[o]]},children:[e.jsx("span",{className:"replay-outpost__at",children:B(d.slice(0,o+1).reduce((x,C)=>x+C.durationMs,0))}),e.jsx("span",{className:"replay-outpost__pip"}),e.jsxs("span",{className:"replay-outpost__text",children:[e.jsx("span",{className:"replay-outpost__title",children:d[o].label||s.artifact||s.label}),e.jsx("span",{className:"replay-outpost__activity-small",children:O[_[o]]})]}),e.jsxs("span",{className:"replay-outpost__ms",children:[Math.round(d[o].durationMs),"ms"]})]},s.id))}),e.jsxs("div",{className:"replay-outpost__satchel",children:[e.jsxs("div",{className:"replay-outpost__satchel-head",children:[e.jsx("span",{children:"Collected"}),e.jsx("span",{children:c.changed.length+c.runs.length+c.read.length})]}),!c.changed.length&&!c.runs.length&&!c.read.length?e.jsx("p",{className:"replay-outpost__satchel-empty",children:"Nothing gathered yet — the satchel fills as the run proceeds."}):null,e.jsx(U,{name:"Changed",hue:"var(--cat-gold)",count:c.changed.length,children:c.changed.map(s=>e.jsx(X,{label:s.path,onOpen:()=>W({type:"file",path:s.path,changed:!0,clue:s.clue,observations:s.observations})},s.path))}),e.jsx(U,{name:"Proved",hue:"var(--cat-purple)",count:c.runs.length,children:c.runs.map(s=>e.jsx(X,{label:s.command,note:s.outcome==="passed"?"passed":s.outcome==="failed"?"failed":void 0,failed:s.outcome==="failed",onOpen:()=>W({type:"run",id:s.id,command:s.command,outcome:s.outcome,clue:s.clue})},s.id))}),e.jsx(U,{name:"Explored",hue:"var(--cat-sky)",count:c.read.length,children:c.read.map(s=>e.jsx(X,{label:s.path,onOpen:()=>W({type:"file",path:s.path,changed:!1,clue:s.clue,observations:s.observations})},s.path))})]})]}),Z?e.jsx(Pe,{target:Z,onClose:()=>q(null)}):null]})}function U({name:t,hue:a,count:n,children:r}){return n?e.jsxs("div",{className:"replay-outpost__shelf",children:[e.jsxs("div",{className:"replay-outpost__shelf-name",style:{color:a},children:[t," ",e.jsx("span",{children:n})]}),e.jsx("ul",{className:"replay-outpost__shelf-list",children:r})]}):null}function X({label:t,note:a,failed:n,onOpen:r}){return e.jsx("li",{className:"replay-outpost__shelf-item",children:e.jsxs("button",{type:"button",className:"replay-outpost__shelf-button",onClick:r,"data-failed":n?"":void 0,children:[a?e.jsx("b",{children:a}):null,e.jsx("span",{children:t})]})})}function Pe({target:t,onClose:a}){l.useEffect(()=>{const r=f=>{f.key==="Escape"&&a()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[a]);const n=t.type==="run"&&t.outcome==="failed";return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"replay-outpost__scrim",onClick:a,"aria-label":"Close"}),e.jsxs("aside",{className:"replay-outpost__reader",role:"dialog","aria-label":t.type==="file"?t.path:t.command,children:[e.jsxs("div",{className:"replay-outpost__reader-head",children:[e.jsx("div",{className:"replay-outpost__reader-kind","data-failed":n?"":void 0,children:t.type==="file"?t.changed?"Changed":"Explored":"Proved"}),e.jsx("div",{className:"replay-outpost__reader-title",children:t.type==="file"?t.path:t.command}),e.jsx("div",{className:"replay-outpost__reader-meta",children:t.type==="file"?`${t.observations} observation${t.observations===1?"":"s"}`:t.outcome}),e.jsx("button",{type:"button",className:"replay-outpost__reader-close",onClick:a,"aria-label":"Close",children:e.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9","aria-hidden":"true",children:e.jsx("path",{d:"M1 1l7 7M8 1l-7 7",stroke:"currentColor",strokeWidth:"1.4",fill:"none"})})})]}),e.jsx("div",{className:"replay-outpost__reader-body",children:t.clue||"Nothing captured for this item."})]})]})}export{Ge as ReplayOutpost};
|
|
1
|
+
import{r as l,m as ae,j as e}from"./index-BFbLvCJn.js";import{C as S}from"./CrewSprite-CguHb2Ny.js";import{S as ye}from"./SproutActionSprite-BrFCmgWS.js";import{b as je}from"./adventure-playback-DTfkhIc0.js";import{p as ve}from"./adventure-habitats-v1-M1lcpTJh.js";/* empty css */const O={start:"Starting",think:"Thinking",read:"Reading",edit:"Editing",tool:"Running",message:"Handing off",wait:"Waiting",end:"Turn complete",stopped:"Interrupted"},oe={domes:.16,biodome:.46,hangar:.84},z={start:"domes",end:"domes",stopped:"domes",wait:"domes",message:"domes",think:"biodome",read:"biodome",edit:"hangar",tool:"hangar"},be=2172/724,N=150,ge=70,Ne=.9,we=110,Me=900,T=(t,a,n)=>Math.max(a,Math.min(n,t));function H(t,a){const n=oe[t]*a.panoramaWidth;return T(a.stageWidth/2-n,Math.min(0,a.stageWidth-a.panoramaWidth),0)}function ke(t,a){const n=new Map,r=N/2;return t.map(f=>{const u=z[f],M=(n.get(u)??0)+1;n.set(u,M);const y=H(u,a),c=oe[u]*a.panoramaWidth,k=(M%5-2)*ge;return T(c+k,r-y,a.stageWidth-r-y)})}function Ee(t,a,n){return t+H(a,n)}function Re(t,a,n){const r=Math.abs(a-t);return T(r/Ne,we,Me)/Math.max(.25,n)}function Ce(t,a){return a<t}function Se(t,a){return t==="travel"?a?"jump":"run":t==="land"?"land":"idle"}function Be(t){return t.checkpoint?1:t.routine?.32:.64}function ne(t){return t==="think"?"thought":t==="message"?"speech":null}function Te(t){return ne(t)===null}const $e=14,Le=19,Ae=22,We=12,Ie=3;function De(t,a){return Math.max(0,t-a-N-$e)}function Oe(t){const a=t-Ae-We;return T(Math.floor(a/Le),1,Ie)}const P={start:"var(--s-dim)",think:"var(--s-muted)",read:"var(--cat-sky)",edit:"var(--cat-gold)",tool:"var(--cat-purple)",message:"var(--info)",wait:"var(--color-status-warn-fg)",end:"var(--color-status-ok-fg)",stopped:"var(--color-status-error-fg)"};function B(t){const a=Math.round(t/1e3);return`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`}function Ge({stops:t,index:a,onSeek:n,playing:r,onPlayingChange:f,speed:u,onSpeedChange:M,actor:y,evidence:c,recipient:k,paused:w=!1,header:le,onInspect:$}){const F=l.useRef(null),V=l.useRef(null),G=l.useRef(null),[g,re]=l.useState({stageWidth:1080,panoramaWidth:1410}),[K,ie]=l.useState(420),[L,E]=l.useState("work"),[m,Y]=l.useState(null),[Z,q]=l.useState(null);l.useLayoutEffect(()=>{const s=F.current;if(!s)return;const o=()=>{const{width:C,height:D}=s.getBoundingClientRect(),fe=Math.max(D*1.12,D+50);re({stageWidth:C,panoramaWidth:Math.max(C,fe*be)}),ie(D)};o();const x=new ResizeObserver(o);return x.observe(s),()=>x.disconnect()},[]);const _=l.useMemo(()=>t.map(s=>s.kind),[t]),d=l.useMemo(()=>t.map(s=>je(s)),[t]),ce=l.useMemo(()=>ke(_,g),[_,g]),i=Math.max(0,Math.min(t.length-1,a)),p=t[i],h=d[i],j=_[i],v=p?Ee(ce[i],z[j],g):g.stageWidth/2,ue=p?H(z[j],g):0,J=l.useRef(v),Q=J.current,de=Ce(Q,v),R=Re(Q,v,u);l.useEffect(()=>{J.current=v},[v]);const A=r?R:260;l.useEffect(()=>{if(!r||!h){E("work");return}E("travel");const s=260/Math.max(.25,u),o=window.setTimeout(()=>E(h.checkpoint?"land":"work"),R),x=window.setTimeout(()=>E("work"),R+s);return()=>{window.clearTimeout(o),window.clearTimeout(x)}},[i,r,u,h?.checkpoint]),l.useEffect(()=>{if(!r||!h)return;if(i+1>=t.length){f(!1);return}const s=window.setTimeout(()=>n(i+1),Math.min(h.durationMs,2600)/u);return()=>window.clearTimeout(s)},[r,i,u,h,t.length,n,f]),l.useEffect(()=>{G.current?.scrollIntoView({block:"nearest",behavior:"smooth"})},[i]);const pe=l.useMemo(()=>d.slice(0,i+1).reduce((s,o)=>s+o.durationMs,0),[d,i]),he=l.useMemo(()=>d.reduce((s,o)=>s+o.durationMs,0),[d]),me=l.useCallback(s=>{const o=V.current?.getBoundingClientRect();if(!o||t.length<2)return;const x=(s.clientX-o.left)/o.width;n(Math.max(0,Math.min(t.length-1,Math.round(x*(t.length-1)))))},[n,t.length]),W=l.useCallback(s=>{$?$(s):q(s)},[$]),b=y?ae(y.agent.name):void 0,I=k?ae(k.agent.name):void 0,_e=j==="think"&&L==="work",ee=L==="work"?ne(j):null,te=Oe(De(K,K*.38)),se=Se(L,!!h?.checkpoint),xe=w||!r;return!p||!h?null:e.jsxs("div",{className:"replay-outpost",children:[e.jsxs("div",{className:"replay-outpost__head",children:[b?e.jsx(S,{slug:b,size:26,paused:w}):null,e.jsx("div",{className:"replay-outpost__who",children:y?.agent.name??"Unknown agent"}),e.jsx("div",{className:"replay-outpost__spacer"}),le]}),e.jsxs("div",{className:"replay-outpost__stage",ref:F,children:[e.jsx("img",{className:"replay-outpost__panorama",src:ve,alt:"",draggable:!1,style:{width:g.panoramaWidth,transform:`translateX(${ue}px)`,transitionDuration:`${A}ms`}}),e.jsx("div",{className:"replay-outpost__veil"}),e.jsxs("div",{className:"replay-outpost__hud",children:[e.jsx("span",{className:"replay-outpost__hud-dot","data-failed":h.checkpoint&&j==="stopped"?"":void 0}),e.jsx("span",{className:"replay-outpost__hud-who",children:y?.agent.name??""}),e.jsxs("span",{className:"replay-outpost__hud-step",children:[i+1," / ",t.length]})]}),e.jsxs("div",{className:"replay-outpost__actor",style:{transform:`translateX(${v-N/2}px)`,transitionDuration:`${A}ms`},children:[e.jsx("div",{className:`replay-outpost__art${se==="jump"?" is-hopping":""}`,style:{transform:de?"scaleX(-1)":void 0,animationDuration:`${R}ms`},children:_e&&b?e.jsx("span",{className:"replay-outpost__standing",children:e.jsx(S,{slug:b,size:N,paused:w,expression:"look-up"})}):b==="sprout"?e.jsx(ye,{action:se,size:N,paused:xe,playbackRate:u}):b?e.jsx("span",{className:"replay-outpost__standing",children:e.jsx(S,{slug:b,size:N,paused:w})}):null}),e.jsx("div",{className:"replay-outpost__shadow"}),ee==="thought"?e.jsxs("div",{className:"replay-outpost__bubble is-thought",style:{"--replay-bubble-lines":te},children:[e.jsx("p",{className:"replay-outpost__bubble-text",children:p.event.text.trim()}),e.jsx("span",{className:"replay-outpost__puff is-big"}),e.jsx("span",{className:"replay-outpost__puff is-small"})]}):ee==="speech"?e.jsxs("div",{className:"replay-outpost__bubble is-speech",style:{"--replay-bubble-lines":te},children:[p.event.to&&!I?e.jsxs("span",{className:"replay-outpost__bubble-to",children:["to ",p.event.to]}):null,e.jsx("p",{className:"replay-outpost__bubble-text",children:p.event.text.trim()||h.label||p.label}),e.jsx("span",{className:"replay-outpost__tail"})]}):Te(j)?e.jsxs("div",{className:"replay-outpost__doing",children:[e.jsx("div",{className:"replay-outpost__activity",children:O[j]}),e.jsx("div",{className:"replay-outpost__target",children:h.label||p.artifact||p.label})]}):null]}),p.event.to&&I?e.jsxs("div",{className:"replay-outpost__handoff",style:{left:v+170,transitionDuration:`${A}ms`},children:[e.jsx("span",{className:"replay-outpost__standing",children:e.jsx(S,{slug:I,size:78,paused:w})}),e.jsx("div",{className:"replay-outpost__shadow is-small"}),e.jsxs("div",{className:"replay-outpost__handoff-label",children:["to ",p.event.to]})]}):null]}),e.jsxs("div",{className:"replay-outpost__ridge",children:[e.jsxs("div",{className:"replay-outpost__transport",children:[e.jsx("button",{type:"button",className:"replay-outpost__play",onClick:()=>f(!r),"aria-label":r?"Pause replay":"Play replay",children:r?e.jsxs("svg",{width:"9",height:"10",viewBox:"0 0 9 10","aria-hidden":"true",children:[e.jsx("rect",{width:"3",height:"10",fill:"currentColor"}),e.jsx("rect",{x:"6",width:"3",height:"10",fill:"currentColor"})]}):e.jsx("svg",{width:"9",height:"10",viewBox:"0 0 9 10","aria-hidden":"true",children:e.jsx("path",{d:"M0 0l9 5-9 5z",fill:"currentColor"})})}),e.jsxs("select",{className:"replay-outpost__speed",value:u,onChange:s=>M(Number(s.target.value)),"aria-label":"Replay speed",children:[e.jsx("option",{value:1,children:"1×"}),e.jsx("option",{value:2,children:"2×"}),e.jsx("option",{value:4,children:"4×"})]})]}),e.jsxs("div",{className:"replay-outpost__bars",ref:V,onClick:me,onMouseLeave:()=>Y(null),children:[t.map((s,o)=>e.jsx("div",{className:`replay-outpost__bar${o<=i?" is-seen":""}${o===i?" is-now":""}`,style:{height:`${Be(d[o])*100}%`,color:P[_[o]]},onMouseEnter:()=>Y(o),children:d[o].checkpoint?e.jsx("span",{className:"replay-outpost__flag"}):null},s.id)),m!==null&&t[m]?e.jsxs("div",{className:"replay-outpost__tip",style:{left:`${(m+.5)/t.length*100}%`},children:[e.jsxs("div",{className:"replay-outpost__tip-kind",style:{color:P[_[m]]},children:[O[_[m]]," · ",B(d[m].durationMs)]}),e.jsx("div",{className:"replay-outpost__tip-title",children:d[m].label||t[m].artifact})]}):null]}),e.jsxs("div",{className:"replay-outpost__elapsed",children:[B(pe)," ",e.jsxs("span",{children:["/ ",B(he)]})]})]}),e.jsxs("div",{className:"replay-outpost__subsurface",children:[e.jsx("div",{className:"replay-outpost__log",children:t.map((s,o)=>e.jsxs("div",{ref:o===i?G:void 0,className:`replay-outpost__row${o===i?" is-now":""}${o>i?" is-ahead":""}`,style:{color:P[_[o]]},children:[e.jsx("span",{className:"replay-outpost__at",children:B(d.slice(0,o+1).reduce((x,C)=>x+C.durationMs,0))}),e.jsx("span",{className:"replay-outpost__pip"}),e.jsxs("span",{className:"replay-outpost__text",children:[e.jsx("span",{className:"replay-outpost__title",children:d[o].label||s.artifact||s.label}),e.jsx("span",{className:"replay-outpost__activity-small",children:O[_[o]]})]}),e.jsxs("span",{className:"replay-outpost__ms",children:[Math.round(d[o].durationMs),"ms"]})]},s.id))}),e.jsxs("div",{className:"replay-outpost__satchel",children:[e.jsxs("div",{className:"replay-outpost__satchel-head",children:[e.jsx("span",{children:"Collected"}),e.jsx("span",{children:c.changed.length+c.runs.length+c.read.length})]}),!c.changed.length&&!c.runs.length&&!c.read.length?e.jsx("p",{className:"replay-outpost__satchel-empty",children:"Nothing gathered yet — the satchel fills as the run proceeds."}):null,e.jsx(U,{name:"Changed",hue:"var(--cat-gold)",count:c.changed.length,children:c.changed.map(s=>e.jsx(X,{label:s.path,onOpen:()=>W({type:"file",path:s.path,changed:!0,clue:s.clue,observations:s.observations})},s.path))}),e.jsx(U,{name:"Proved",hue:"var(--cat-purple)",count:c.runs.length,children:c.runs.map(s=>e.jsx(X,{label:s.command,note:s.outcome==="passed"?"passed":s.outcome==="failed"?"failed":void 0,failed:s.outcome==="failed",onOpen:()=>W({type:"run",id:s.id,command:s.command,outcome:s.outcome,clue:s.clue})},s.id))}),e.jsx(U,{name:"Explored",hue:"var(--cat-sky)",count:c.read.length,children:c.read.map(s=>e.jsx(X,{label:s.path,onOpen:()=>W({type:"file",path:s.path,changed:!1,clue:s.clue,observations:s.observations})},s.path))})]})]}),Z?e.jsx(Pe,{target:Z,onClose:()=>q(null)}):null]})}function U({name:t,hue:a,count:n,children:r}){return n?e.jsxs("div",{className:"replay-outpost__shelf",children:[e.jsxs("div",{className:"replay-outpost__shelf-name",style:{color:a},children:[t," ",e.jsx("span",{children:n})]}),e.jsx("ul",{className:"replay-outpost__shelf-list",children:r})]}):null}function X({label:t,note:a,failed:n,onOpen:r}){return e.jsx("li",{className:"replay-outpost__shelf-item",children:e.jsxs("button",{type:"button",className:"replay-outpost__shelf-button",onClick:r,"data-failed":n?"":void 0,children:[a?e.jsx("b",{children:a}):null,e.jsx("span",{children:t})]})})}function Pe({target:t,onClose:a}){l.useEffect(()=>{const r=f=>{f.key==="Escape"&&a()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[a]);const n=t.type==="run"&&t.outcome==="failed";return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"replay-outpost__scrim",onClick:a,"aria-label":"Close"}),e.jsxs("aside",{className:"replay-outpost__reader",role:"dialog","aria-label":t.type==="file"?t.path:t.command,children:[e.jsxs("div",{className:"replay-outpost__reader-head",children:[e.jsx("div",{className:"replay-outpost__reader-kind","data-failed":n?"":void 0,children:t.type==="file"?t.changed?"Changed":"Explored":"Proved"}),e.jsx("div",{className:"replay-outpost__reader-title",children:t.type==="file"?t.path:t.command}),e.jsx("div",{className:"replay-outpost__reader-meta",children:t.type==="file"?`${t.observations} observation${t.observations===1?"":"s"}`:t.outcome}),e.jsx("button",{type:"button",className:"replay-outpost__reader-close",onClick:a,"aria-label":"Close",children:e.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9","aria-hidden":"true",children:e.jsx("path",{d:"M1 1l7 7M8 1l-7 7",stroke:"currentColor",strokeWidth:"1.4",fill:"none"})})})]}),e.jsx("div",{className:"replay-outpost__reader-body",children:t.clue||"Nothing captured for this item."})]})]})}export{Ge as ReplayOutpost};
|
package/dist/client/assets/{RepoDiffEmbedScreen-BWxvRDrS.js → RepoDiffEmbedScreen-BmQX_8E-.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-BFbLvCJn.js";import{R as c}from"./RepoDiffViewerLazy-DL6A2o_z.js";/* empty css */const l=["unstaged","staged","branch"];function o(e){const t=e.getAll("layer").filter(r=>l.includes(r));return t.length>0?t:void 0}function p(){const e=typeof window>"u"?new URLSearchParams:new URLSearchParams(window.location.search),t=e.get("path")?.trim()??"",r=e.getAll("file").map(i=>i.trim()).filter(Boolean),a=e.get("sessionId")?.trim()||void 0,n=e.get("agentId")?.trim()||void 0,d=e.get("include")==="all"||e.get("include")==="touched"?"all":"changed";return t?s.jsx(c,{path:t,layers:o(e),files:r,session:a||n?{sessionId:a,agentId:n,include:d}:null,className:"rd-embed"}):s.jsx("div",{className:"rd-viewer rd-embed","data-scout-theme":!0,children:s.jsx("div",{className:"rd-center",children:s.jsxs("div",{className:"rd-center-card",children:[s.jsx("div",{className:"rd-center-title",children:"No worktree path"}),s.jsxs("div",{className:"rd-center-body",children:["This embed needs a ",s.jsx("code",{children:"?path=<absolute-path>"})," query parameter."]})]})})})}export{p as RepoDiffEmbedScreen,p as default};
|
package/dist/client/assets/{RepoDiffPageScreen-DN94irmY.js → RepoDiffPageScreen-B9oAjrC6.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-BFbLvCJn.js";import{R as l}from"./RepoDiffViewerLazy-DL6A2o_z.js";/* empty css */const f=1;function m(t=typeof performance>"u"?void 0:performance){const r=(t?.getEntriesByType?.("navigation")??[]).find(i=>typeof i.type=="string");return r?r.type==="reload":t?.navigation?.type===f}function u({path:t,layers:n,files:r,sessionId:i,agentId:o,include:s,navigate:c}){const a=t.trim();if(!a)return e.jsx("div",{className:"rd-viewer",children:e.jsx("div",{className:"rd-center",children:e.jsxs("div",{className:"rd-center-card",children:[e.jsx("div",{className:"rd-center-title",children:"No worktree path"}),e.jsxs("div",{className:"rd-center-body",children:["This page needs a ",e.jsx("code",{children:"?path=<absolute-path>"})," query parameter."]})]})})});const d=[a,n?.join(",")??"",r?.join("\0")??"",i??"",o??"",s??""].join(""),p=m();return e.jsx(l,{path:a,layers:n,files:r,session:i||o?{sessionId:i,agentId:o,include:s}:null,forceInitialLoad:p,onClose:()=>c({view:"repos"})},d)}export{u as RepoDiffPageScreen,u as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as n}from"./index-EsrkGBcv.js";import{a as X,p as Z}from"./ui-LM8pS8qE.js";/* empty css */import{a as T,s as q,l as ee,L as te,f as K,S as ne,r as se,b as re,c as _,d as ie,u as ae,V as A,C as H,D as le,e as oe}from"./usePierreRuntime-BAQdiN0L.js";import{C as ce}from"./chevron-down-l1mrh5S9.js";import{C as de}from"./check-lrJ3a73a.js";import{L as ue}from"./loader-circle-OvccU82H.js";import{S as fe}from"./send-horizontal-CH0-fbZE.js";import{F as he}from"./file-code-corner-CsU7jJpu.js";import{C as me}from"./code-xml-BhcNbLWU.js";import{X as pe}from"./x-DAehov0E.js";import{r as O,a as Y,f as V}from"./cache-DGBo3vIf.js";import{M as xe}from"./message-square-BxesYglW.js";import{R as ge}from"./refresh-cw-BmVr7sCD.js";import{P as be}from"./plus-DFDDeGKu.js";import{a as B}from"./api-DSqpVKC7.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./createLucideIcon-zZ8Hx7er.js";function je({snapshot:e,selectedFile:t,targets:r,targetId:s,onTargetId:i,draft:c,onDraft:f,contextItems:o,onRemoveContextItem:p,pending:a,status:d,error:g,textareaRef:k,onSubmit:S}){const[u,y]=l.useState(!1),b=l.useRef(null),w=r.find(h=>h.id===s)??null,m=w?.label??"Scout",C=r[0]?.id??null,N=t?T(t):null,I=(c.trim().length>0||o.length>0)&&!a,R=l.useMemo(()=>[...r.map(h=>({id:h.id,label:h.label,suffix:h.id===C?"best context":null})),{id:"scout",label:"Scout",suffix:null}],[C,r]);return l.useEffect(()=>{if(!u)return;const h=$=>{const D=b.current;D&&$.target instanceof Node&&D.contains($.target)||y(!1)};return document.addEventListener("pointerdown",h),()=>document.removeEventListener("pointerdown",h)},[u]),n.jsxs("div",{className:"rd-comment",children:[o.length>0?n.jsx("div",{className:"rd-comment-context","aria-label":"Included diff context",children:o.map(h=>n.jsx(ye,{item:h,disabled:a,onRemove:p},h.id))}):null,n.jsxs("div",{className:"rd-comment-main",children:[n.jsxs("div",{className:"rd-target-picker",ref:b,children:[n.jsxs("button",{type:"button",className:"rd-target-button",onClick:()=>y(h=>!h),onKeyDown:h=>{h.stopPropagation(),h.key==="Escape"&&y(!1)},disabled:a,"aria-label":"Diff comment target","aria-haspopup":"listbox","aria-expanded":u,title:"Diff comment target",children:[n.jsx("span",{children:m}),n.jsx(ce,{size:13,strokeWidth:2,"aria-hidden":!0})]}),u?n.jsx("div",{className:"rd-target-menu",role:"listbox","aria-label":"Diff comment target",children:R.map(h=>{const $=h.id===(w?.id??"scout");return n.jsxs("button",{type:"button",className:"rd-target-option",role:"option","aria-selected":$,onClick:()=>{i(h.id),y(!1)},children:[n.jsx("span",{className:"rd-target-option-label",children:h.label}),h.suffix?n.jsx("span",{className:"rd-target-option-suffix",children:h.suffix}):null,n.jsx("span",{className:"rd-target-option-check","aria-hidden":!0,children:$?n.jsx(de,{size:12,strokeWidth:2.2}):null})]},h.id)})}):null]}),n.jsx("textarea",{ref:k,value:c,onChange:h=>f(h.currentTarget.value),onKeyDown:h=>{h.stopPropagation(),(h.metaKey||h.ctrlKey)&&h.key==="Enter"&&(h.preventDefault(),S())},rows:1,disabled:a,placeholder:o.length>0?`Send to ${m} with included context`:"Leave a note on this diff…","aria-label":"Diff comment"}),n.jsxs("button",{type:"button",className:"rd-comment-send",disabled:!I,onClick:S,title:"Send diff comment","aria-label":"Send diff comment",children:[a?n.jsx(ue,{size:13,className:"rd-comment-spin","aria-hidden":!0}):n.jsx(fe,{size:13,"aria-hidden":!0}),n.jsx("span",{children:a?"Sending":"Send"})]})]}),n.jsx("div",{className:"rd-comment-meta",children:g?n.jsx("span",{className:"err",children:g}):d?n.jsx("span",{className:"ok",children:d}):n.jsxs("span",{children:[e.scope?.kind==="session"?"Session diff":"Worktree diff",N?` · ${N}`:""]})})]})}function ye({item:e,disabled:t,onRemove:r}){const s=e.kind==="file"?he:me;return n.jsxs("div",{className:`rd-context-item ${e.kind}`,children:[n.jsxs("div",{className:"rd-context-head",children:[n.jsx("span",{className:"rd-context-icon","aria-hidden":!0,children:n.jsx(s,{size:12,strokeWidth:2})}),n.jsx("span",{className:"rd-context-label",title:e.label,children:e.label}),n.jsx("span",{className:"rd-context-detail",children:e.detail}),n.jsx("button",{type:"button",className:"rd-context-remove",onClick:()=>r(e.id),disabled:t,title:"Remove included context","aria-label":"Remove included context",children:n.jsx(pe,{size:11,strokeWidth:2.2,"aria-hidden":!0})})]}),e.preview?n.jsx("pre",{className:"rd-context-preview",children:e.preview}):null]})}function Ce({heading:e,worktreePath:t,snapshot:r,freshness:s,activeLayer:i,onLayer:c,layout:f,onLayout:o,refreshing:p,onRefresh:a,onFocusComment:d,onClose:g,onOpenAsPage:k}){const{dir:S}=q(t);return n.jsxs("div",{className:"rd-header",children:[n.jsxs("div",{className:"rd-header-id",children:[n.jsxs("div",{className:"rd-header-title",children:[n.jsx("span",{className:"rd-header-name",title:t,children:e}),r.scope?n.jsx(ke,{snapshot:r}):null,S?n.jsx("span",{className:"rd-header-dir",children:S}):null]}),n.jsx("div",{className:"rd-header-sub",children:n.jsx(Ne,{layers:r.layers,activeLayer:i,onLayer:c})}),n.jsx(Se,{freshness:s,generatedAt:r.generatedAt})]}),n.jsxs("div",{className:"rd-header-actions",children:[n.jsx("button",{type:"button",className:"rd-close","aria-label":"Comment on diff",title:"Comment on diff",onClick:d,children:n.jsx(xe,{size:14,strokeWidth:2,"aria-hidden":!0})}),n.jsxs("div",{className:"rd-segmented",role:"group","aria-label":"Diff layout",children:[n.jsx("button",{type:"button",className:f==="unified"?"on":"","aria-pressed":f==="unified",onClick:()=>o("unified"),children:"Unified"}),n.jsx("button",{type:"button",className:f==="split"?"on":"","aria-pressed":f==="split",onClick:()=>o("split"),children:"Split"})]}),n.jsx("button",{type:"button",className:`rd-close${p?" spinning":""}`,"aria-label":"Refresh diff",title:"Fetch fresh diff",onClick:a,disabled:p,children:n.jsx(ge,{size:14,strokeWidth:2,"aria-hidden":!0})}),k?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Open diff as page",title:"Open as full page",onClick:k,children:"↗"}):null,g?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Close",onClick:g,children:"✕"}):null]})]})}function $e({snapshot:e}){const t=[];e.coverage.truncatedLayers>0&&t.push({level:"warning",text:`${e.coverage.truncatedLayers} layer${e.coverage.truncatedLayers===1?"":"s"} truncated — the native diff hit a size budget; some files or hunks are omitted.`}),e.coverage.scanBudgetReached&&t.push({level:"warning",text:"Scan budget reached — this diff is partial."});for(const r of e.diagnostics)t.push({level:r.level,text:r.path?`${r.message} (${r.path})`:r.message});return t.length===0?null:n.jsx(n.Fragment,{children:t.map((r,s)=>n.jsxs("div",{className:`rd-banner ${r.level}`,children:[n.jsx("span",{className:"rd-banner-dot","aria-hidden":!0}),n.jsx("span",{children:r.text})]},s))})}function ke({snapshot:e}){const t=e.scope;if(!t)return null;const r=t.kind==="session"?`Session · ${t.filteredPaths.length} files`:t.filteredPaths.length>0?`Filtered · ${t.filteredPaths.length} files`:"Worktree",s=t.kind==="session"?`${t.label}: path-filtered diff from ${t.changedFiles} changed / ${t.touchedFiles} touched session files`:t.label;return n.jsx("span",{className:`rd-scope-pill ${t.kind}`,title:s,children:r})}function Se({freshness:e,generatedAt:t}){const r=e?.fetchedAt??t,s=Math.max(0,Date.now()-r),i=e?.cacheHit?`Prefetched ${O(s)}`:`Updated ${O(s)}`;return n.jsxs("div",{className:"rd-freshness",title:new Date(r).toLocaleString(),children:[n.jsx("span",{children:i}),e?.refreshing?n.jsx("span",{children:"Refreshing…"}):null,e?.refreshError?n.jsx("span",{children:"Refresh failed"}):null]})}function Ne({layers:e,activeLayer:t,onLayer:r}){return n.jsx("div",{className:"rd-layers",role:"tablist","aria-label":"Diff layers",children:e.map(s=>{const i=ee(s);return n.jsxs("button",{type:"button",role:"tab","aria-selected":s.kind===t,className:"rd-layer-tab"+(s.kind===t?" on":""),onClick:()=>r(s.kind),title:s.shortstat??void 0,children:[n.jsx("span",{children:te[s.kind]??s.kind}),n.jsx("span",{className:"rd-layer-stat",children:s.files.length===0?"clean":n.jsxs(n.Fragment,{children:[s.files.length,"f"," ",n.jsxs("span",{style:{color:"var(--rd-add)"},children:["+",i.add]})," ",n.jsxs("span",{style:{color:"var(--rd-del)"},children:["−",i.del]}),s.truncated?" ⚠":""]})})]},s.kind)})})}const G="openscout.repo-diff.files-rail-width",U=268,we=196,ve=520;function Ie(e,t){if(e.length<=t)return e;const r=e.lastIndexOf(".");if(r<=0){const p=Math.max(1,Math.floor((t-1)/2)),a=t-p-1;return e.slice(0,p)+"…"+e.slice(-Math.max(1,a))}const s=e.slice(0,r),i=e.slice(r),c=t-i.length-1;if(c<2){const p=Math.max(1,t-i.length-1);return s.slice(0,p)+"…"+i}const f=Math.max(1,Math.floor(c/2)),o=Math.max(1,c-f);return s.slice(0,f)+"…"+s.slice(-o)+i}function De(e,t){return Math.max(8,Math.floor((e-178-t*14)/6.7))}function W(e){return Math.max(we,Math.min(ve,Math.round(e)))}function Re(){if(typeof window>"u")return U;const e=Number(window.localStorage.getItem(G));return Number.isFinite(e)?W(e):U}function Le(e){const t={name:"",path:"",firstIndex:Number.MAX_SAFE_INTEGER,children:new Map,files:[]};for(const r of e){t.firstIndex=Math.min(t.firstIndex,r.index);const s=r.dir?r.dir.split("/").filter(Boolean):[];let i=t;for(const c of s){const f=i.path?`${i.path}/${c}`:c;let o=i.children.get(c);o||(o={name:c,path:f,firstIndex:r.index,children:new Map,files:[]},i.children.set(c,o)),o.firstIndex=Math.min(o.firstIndex,r.index),i=o}i.files.push(r)}return t}function J(e){let t=e.files.length;for(const r of e.children.values())t+=J(r);return t}function Pe({layer:e,selectedFileKey:t,onSelect:r,onIncludeFile:s}){const[i,c]=l.useState(Re),[f,o]=l.useState(()=>new Set),p=l.useMemo(()=>(e?.files??[]).map((u,y)=>{const b=K(u,y),w=T(u),{name:m,dir:C}=q(w),N=(u.status==="renamed"||u.status==="copied")&&u.oldPath&&u.newPath&&u.oldPath!==u.newPath;return{file:u,index:y,key:b,display:w,name:m,dir:C,renamed:!!N}}),[e]),a=l.useMemo(()=>Le(p),[p]),d=l.useCallback(u=>{o(y=>{const b=new Set(y);return b.has(u)?b.delete(u):b.add(u),b})},[]),g=l.useCallback(u=>{u.preventDefault();const y=u.clientX,b=i,w=C=>{c(W(b+C.clientX-y))},m=()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",m),c(C=>{const N=W(C);return window.localStorage.setItem(G,String(N)),N})};window.addEventListener("pointermove",w),window.addEventListener("pointerup",m,{once:!0})},[i]),k=(u,y)=>n.jsx(Fe,{entry:u,depth:y,railWidth:i,selected:u.key===t,onSelect:r,onIncludeFile:s},u.key),S=(u,y)=>{const b=[],w=[...u.children.values()].sort((m,C)=>m.firstIndex!==C.firstIndex?m.firstIndex-C.firstIndex:m.name.localeCompare(C.name));for(const m of w){const C=f.has(m.path);b.push(n.jsxs("button",{type:"button",className:"rd-dir-row",style:{paddingLeft:12+y*14},onClick:()=>d(m.path),title:m.path,children:[n.jsx("span",{className:"rd-dir-caret",children:C?"›":"⌄"}),n.jsx("span",{className:"rd-dir-name",children:m.name}),n.jsx("span",{className:"rd-dir-count",children:J(m)})]},`dir:${m.path}`)),C||b.push(...S(m,y+1))}for(const m of u.files)b.push(k(m,y));return b};return n.jsxs("div",{className:"rd-rail",style:{width:i},children:[n.jsx("div",{className:"rd-rail-head",children:e?`Changed files · ${e.files.length}`:"Changed files"}),n.jsx("div",{className:"rd-rail-list",children:S(a,0)}),n.jsx("div",{className:"rd-rail-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file navigation",onPointerDown:g})]})}function Fe({entry:e,depth:t,railWidth:r,selected:s,onSelect:i,onIncludeFile:c}){const{file:f,key:o,display:p,name:a,dir:d,renamed:g}=e,k=De(r,t),S=Ie(a,k);return n.jsxs("div",{className:"rd-file-row"+(s?" on":""),title:g?`${f.oldPath} → ${f.newPath}`:p,children:[n.jsxs("button",{type:"button",className:"rd-file-pick",style:{paddingLeft:18+t*14},onClick:()=>i(o),children:[n.jsx("span",{className:`rd-file-glyph ${f.status}`,children:ne[f.status]}),n.jsxs("span",{className:"rd-file-id",children:[n.jsx("span",{className:"rd-file-name",children:S}),n.jsx("span",{className:"rd-file-dir",children:g?`${f.oldPath} → ${d||a}`:d}),n.jsx(Ee,{file:f})]})]}),n.jsx("span",{className:"rd-file-churn",children:f.binary?n.jsx("span",{className:"add",style:{color:"var(--muted)"},children:"bin"}):n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"add",children:["+",f.additions??0]}),n.jsxs("span",{className:"del",children:["−",f.deletions??0]})]})}),n.jsx("button",{type:"button",className:"rd-file-include",onClick:u=>{u.stopPropagation(),c(f,o)},"aria-label":`Include ${p} in comment`,title:"Include in comment",children:n.jsx(be,{size:12,strokeWidth:2,"aria-hidden":!0})})]})}function Ee({file:e}){const t=[];return e.binary&&t.push("BINARY"),e.truncated&&t.push("TRUNCATED"),e.status==="conflict"&&t.push("CONFLICT"),t.length===0?null:n.jsx("span",{className:"rd-file-tags",children:t.map(r=>n.jsx("span",{className:"rd-file-tag",children:r},r))})}function Me(e){switch(e?.trim().toLowerCase()){case"active":case"working":case"running":case"in_turn":return 80;case"queued":case"waiting":case"waking":case"in_flight":return 50;case"idle":case"available":return 25;case"offline":case"retired":case"stale":return-40;default:return 0}}function Te(e){return e.newPath??e.oldPath??"(unknown)"}function Q(e){const t=e.scope?.kind==="session"?e.scope.agentId:null,r=new Map;for(const s of e.scout.hints)s.agentId&&r.set(s.agentId,(r.get(s.agentId)??0)+1);return e.scout.agents.map(s=>({id:s.id,label:X(s),score:Me(s.state)+(s.id===t?1e3:0)+(r.get(s.id)??0)*10})).sort((s,i)=>{const c=i.score-s.score;return c!==0?c:s.label.localeCompare(i.label)})}function Ae(e){return Q(e)[0]??null}function Ke(e){const t=e.files.reduce((r,s)=>({add:r.add+(s.additions??0),del:r.del+(s.deletions??0)}),{add:0,del:0});return`${e.kind}: ${e.files.length} file${e.files.length===1?"":"s"}, +${t.add} -${t.del}${e.truncated?", truncated":""}`}function z(e){const t=e.binary?"binary":`+${e.additions??0} -${e.deletions??0}`;return`${e.status}: ${Te(e)} (${t}${e.truncated?", truncated":""})`}function We(e){const t=e.scope;return t?t.kind==="session"?`session ${t.sessionId??t.refId??"(unknown)"} (${t.changedFiles} changed / ${t.touchedFiles} touched files, ${t.include})`:t.filteredPaths.length>0?`filtered worktree (${t.filteredPaths.length} paths)`:"worktree":"worktree"}function ze(e){const{comment:t,includedContext:r=[],snapshot:s,activeLayer:i,selectedFile:c}=e,o=((i?s.layers.find(d=>d.kind===i)??null:null)?.files??s.layers.flatMap(d=>d.files)).slice(0,12).map(z),p=s.scout.agents.map(d=>X(d)).slice(0,8),a=["Operator comment on repo diff:",t,"","Repo Diff context:",`- Worktree: ${s.worktreePath}`,`- Scope: ${We(s)}`,`- Active layer: ${i??"none"}`];return r.length>0&&a.splice(3,0,"Included diff context:",...r.map(d=>d.trim()).filter(Boolean),""),c&&a.push(`- Selected file: ${z(c)}`),a.push(`- Layers: ${s.layers.map(Ke).join("; ")}`),p.length>0&&a.push(`- Attached agents: ${p.join(", ")}`),s.scout.sessions.length>0&&a.push(`- Sessions: ${s.scout.sessions.map(d=>d.id).slice(0,8).join(", ")}`),o.length>0&&a.push(`- Changed files: ${o.join(", ")}`),s.diagnostics.length>0&&a.push(`- Diagnostics: ${s.diagnostics.map(d=>d.message).join("; ")}`),a.join(`
|
|
1
|
+
import{r as l,j as n}from"./index-BFbLvCJn.js";import{a as X,p as Z}from"./ui-LM8pS8qE.js";/* empty css */import{a as T,s as q,l as ee,L as te,f as K,S as ne,r as se,b as re,c as _,d as ie,u as ae,V as A,C as H,D as le,e as oe}from"./usePierreRuntime-DUXZ-DTK.js";import{C as ce}from"./chevron-down-DEDSNJNY.js";import{C as de}from"./check-BM6QtbB7.js";import{L as ue}from"./loader-circle-CCG7hG7z.js";import{S as fe}from"./send-horizontal-_Tf_It04.js";import{F as he}from"./file-code-corner-DtMWHBN3.js";import{C as me}from"./code-xml-E9gBuiVs.js";import{X as pe}from"./x-BcfhXYiF.js";import{r as O,a as Y,f as V}from"./cache-DGBo3vIf.js";import{M as xe}from"./message-square-BwqBIfv5.js";import{R as ge}from"./refresh-cw-BcqctLqo.js";import{P as be}from"./plus-B0hdY0fF.js";import{a as B}from"./api-DSqpVKC7.js";import"./chunk-HRAB3GC3-DVhUsgOw.js";import"./createLucideIcon-CKbjXlwv.js";function je({snapshot:e,selectedFile:t,targets:r,targetId:s,onTargetId:i,draft:c,onDraft:f,contextItems:o,onRemoveContextItem:p,pending:a,status:d,error:g,textareaRef:k,onSubmit:S}){const[u,y]=l.useState(!1),b=l.useRef(null),w=r.find(h=>h.id===s)??null,m=w?.label??"Scout",C=r[0]?.id??null,N=t?T(t):null,I=(c.trim().length>0||o.length>0)&&!a,R=l.useMemo(()=>[...r.map(h=>({id:h.id,label:h.label,suffix:h.id===C?"best context":null})),{id:"scout",label:"Scout",suffix:null}],[C,r]);return l.useEffect(()=>{if(!u)return;const h=$=>{const D=b.current;D&&$.target instanceof Node&&D.contains($.target)||y(!1)};return document.addEventListener("pointerdown",h),()=>document.removeEventListener("pointerdown",h)},[u]),n.jsxs("div",{className:"rd-comment",children:[o.length>0?n.jsx("div",{className:"rd-comment-context","aria-label":"Included diff context",children:o.map(h=>n.jsx(ye,{item:h,disabled:a,onRemove:p},h.id))}):null,n.jsxs("div",{className:"rd-comment-main",children:[n.jsxs("div",{className:"rd-target-picker",ref:b,children:[n.jsxs("button",{type:"button",className:"rd-target-button",onClick:()=>y(h=>!h),onKeyDown:h=>{h.stopPropagation(),h.key==="Escape"&&y(!1)},disabled:a,"aria-label":"Diff comment target","aria-haspopup":"listbox","aria-expanded":u,title:"Diff comment target",children:[n.jsx("span",{children:m}),n.jsx(ce,{size:13,strokeWidth:2,"aria-hidden":!0})]}),u?n.jsx("div",{className:"rd-target-menu",role:"listbox","aria-label":"Diff comment target",children:R.map(h=>{const $=h.id===(w?.id??"scout");return n.jsxs("button",{type:"button",className:"rd-target-option",role:"option","aria-selected":$,onClick:()=>{i(h.id),y(!1)},children:[n.jsx("span",{className:"rd-target-option-label",children:h.label}),h.suffix?n.jsx("span",{className:"rd-target-option-suffix",children:h.suffix}):null,n.jsx("span",{className:"rd-target-option-check","aria-hidden":!0,children:$?n.jsx(de,{size:12,strokeWidth:2.2}):null})]},h.id)})}):null]}),n.jsx("textarea",{ref:k,value:c,onChange:h=>f(h.currentTarget.value),onKeyDown:h=>{h.stopPropagation(),(h.metaKey||h.ctrlKey)&&h.key==="Enter"&&(h.preventDefault(),S())},rows:1,disabled:a,placeholder:o.length>0?`Send to ${m} with included context`:"Leave a note on this diff…","aria-label":"Diff comment"}),n.jsxs("button",{type:"button",className:"rd-comment-send",disabled:!I,onClick:S,title:"Send diff comment","aria-label":"Send diff comment",children:[a?n.jsx(ue,{size:13,className:"rd-comment-spin","aria-hidden":!0}):n.jsx(fe,{size:13,"aria-hidden":!0}),n.jsx("span",{children:a?"Sending":"Send"})]})]}),n.jsx("div",{className:"rd-comment-meta",children:g?n.jsx("span",{className:"err",children:g}):d?n.jsx("span",{className:"ok",children:d}):n.jsxs("span",{children:[e.scope?.kind==="session"?"Session diff":"Worktree diff",N?` · ${N}`:""]})})]})}function ye({item:e,disabled:t,onRemove:r}){const s=e.kind==="file"?he:me;return n.jsxs("div",{className:`rd-context-item ${e.kind}`,children:[n.jsxs("div",{className:"rd-context-head",children:[n.jsx("span",{className:"rd-context-icon","aria-hidden":!0,children:n.jsx(s,{size:12,strokeWidth:2})}),n.jsx("span",{className:"rd-context-label",title:e.label,children:e.label}),n.jsx("span",{className:"rd-context-detail",children:e.detail}),n.jsx("button",{type:"button",className:"rd-context-remove",onClick:()=>r(e.id),disabled:t,title:"Remove included context","aria-label":"Remove included context",children:n.jsx(pe,{size:11,strokeWidth:2.2,"aria-hidden":!0})})]}),e.preview?n.jsx("pre",{className:"rd-context-preview",children:e.preview}):null]})}function Ce({heading:e,worktreePath:t,snapshot:r,freshness:s,activeLayer:i,onLayer:c,layout:f,onLayout:o,refreshing:p,onRefresh:a,onFocusComment:d,onClose:g,onOpenAsPage:k}){const{dir:S}=q(t);return n.jsxs("div",{className:"rd-header",children:[n.jsxs("div",{className:"rd-header-id",children:[n.jsxs("div",{className:"rd-header-title",children:[n.jsx("span",{className:"rd-header-name",title:t,children:e}),r.scope?n.jsx(ke,{snapshot:r}):null,S?n.jsx("span",{className:"rd-header-dir",children:S}):null]}),n.jsx("div",{className:"rd-header-sub",children:n.jsx(Ne,{layers:r.layers,activeLayer:i,onLayer:c})}),n.jsx(Se,{freshness:s,generatedAt:r.generatedAt})]}),n.jsxs("div",{className:"rd-header-actions",children:[n.jsx("button",{type:"button",className:"rd-close","aria-label":"Comment on diff",title:"Comment on diff",onClick:d,children:n.jsx(xe,{size:14,strokeWidth:2,"aria-hidden":!0})}),n.jsxs("div",{className:"rd-segmented",role:"group","aria-label":"Diff layout",children:[n.jsx("button",{type:"button",className:f==="unified"?"on":"","aria-pressed":f==="unified",onClick:()=>o("unified"),children:"Unified"}),n.jsx("button",{type:"button",className:f==="split"?"on":"","aria-pressed":f==="split",onClick:()=>o("split"),children:"Split"})]}),n.jsx("button",{type:"button",className:`rd-close${p?" spinning":""}`,"aria-label":"Refresh diff",title:"Fetch fresh diff",onClick:a,disabled:p,children:n.jsx(ge,{size:14,strokeWidth:2,"aria-hidden":!0})}),k?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Open diff as page",title:"Open as full page",onClick:k,children:"↗"}):null,g?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Close",onClick:g,children:"✕"}):null]})]})}function $e({snapshot:e}){const t=[];e.coverage.truncatedLayers>0&&t.push({level:"warning",text:`${e.coverage.truncatedLayers} layer${e.coverage.truncatedLayers===1?"":"s"} truncated — the native diff hit a size budget; some files or hunks are omitted.`}),e.coverage.scanBudgetReached&&t.push({level:"warning",text:"Scan budget reached — this diff is partial."});for(const r of e.diagnostics)t.push({level:r.level,text:r.path?`${r.message} (${r.path})`:r.message});return t.length===0?null:n.jsx(n.Fragment,{children:t.map((r,s)=>n.jsxs("div",{className:`rd-banner ${r.level}`,children:[n.jsx("span",{className:"rd-banner-dot","aria-hidden":!0}),n.jsx("span",{children:r.text})]},s))})}function ke({snapshot:e}){const t=e.scope;if(!t)return null;const r=t.kind==="session"?`Session · ${t.filteredPaths.length} files`:t.filteredPaths.length>0?`Filtered · ${t.filteredPaths.length} files`:"Worktree",s=t.kind==="session"?`${t.label}: path-filtered diff from ${t.changedFiles} changed / ${t.touchedFiles} touched session files`:t.label;return n.jsx("span",{className:`rd-scope-pill ${t.kind}`,title:s,children:r})}function Se({freshness:e,generatedAt:t}){const r=e?.fetchedAt??t,s=Math.max(0,Date.now()-r),i=e?.cacheHit?`Prefetched ${O(s)}`:`Updated ${O(s)}`;return n.jsxs("div",{className:"rd-freshness",title:new Date(r).toLocaleString(),children:[n.jsx("span",{children:i}),e?.refreshing?n.jsx("span",{children:"Refreshing…"}):null,e?.refreshError?n.jsx("span",{children:"Refresh failed"}):null]})}function Ne({layers:e,activeLayer:t,onLayer:r}){return n.jsx("div",{className:"rd-layers",role:"tablist","aria-label":"Diff layers",children:e.map(s=>{const i=ee(s);return n.jsxs("button",{type:"button",role:"tab","aria-selected":s.kind===t,className:"rd-layer-tab"+(s.kind===t?" on":""),onClick:()=>r(s.kind),title:s.shortstat??void 0,children:[n.jsx("span",{children:te[s.kind]??s.kind}),n.jsx("span",{className:"rd-layer-stat",children:s.files.length===0?"clean":n.jsxs(n.Fragment,{children:[s.files.length,"f"," ",n.jsxs("span",{style:{color:"var(--rd-add)"},children:["+",i.add]})," ",n.jsxs("span",{style:{color:"var(--rd-del)"},children:["−",i.del]}),s.truncated?" ⚠":""]})})]},s.kind)})})}const G="openscout.repo-diff.files-rail-width",U=268,we=196,ve=520;function Ie(e,t){if(e.length<=t)return e;const r=e.lastIndexOf(".");if(r<=0){const p=Math.max(1,Math.floor((t-1)/2)),a=t-p-1;return e.slice(0,p)+"…"+e.slice(-Math.max(1,a))}const s=e.slice(0,r),i=e.slice(r),c=t-i.length-1;if(c<2){const p=Math.max(1,t-i.length-1);return s.slice(0,p)+"…"+i}const f=Math.max(1,Math.floor(c/2)),o=Math.max(1,c-f);return s.slice(0,f)+"…"+s.slice(-o)+i}function De(e,t){return Math.max(8,Math.floor((e-178-t*14)/6.7))}function W(e){return Math.max(we,Math.min(ve,Math.round(e)))}function Re(){if(typeof window>"u")return U;const e=Number(window.localStorage.getItem(G));return Number.isFinite(e)?W(e):U}function Le(e){const t={name:"",path:"",firstIndex:Number.MAX_SAFE_INTEGER,children:new Map,files:[]};for(const r of e){t.firstIndex=Math.min(t.firstIndex,r.index);const s=r.dir?r.dir.split("/").filter(Boolean):[];let i=t;for(const c of s){const f=i.path?`${i.path}/${c}`:c;let o=i.children.get(c);o||(o={name:c,path:f,firstIndex:r.index,children:new Map,files:[]},i.children.set(c,o)),o.firstIndex=Math.min(o.firstIndex,r.index),i=o}i.files.push(r)}return t}function J(e){let t=e.files.length;for(const r of e.children.values())t+=J(r);return t}function Pe({layer:e,selectedFileKey:t,onSelect:r,onIncludeFile:s}){const[i,c]=l.useState(Re),[f,o]=l.useState(()=>new Set),p=l.useMemo(()=>(e?.files??[]).map((u,y)=>{const b=K(u,y),w=T(u),{name:m,dir:C}=q(w),N=(u.status==="renamed"||u.status==="copied")&&u.oldPath&&u.newPath&&u.oldPath!==u.newPath;return{file:u,index:y,key:b,display:w,name:m,dir:C,renamed:!!N}}),[e]),a=l.useMemo(()=>Le(p),[p]),d=l.useCallback(u=>{o(y=>{const b=new Set(y);return b.has(u)?b.delete(u):b.add(u),b})},[]),g=l.useCallback(u=>{u.preventDefault();const y=u.clientX,b=i,w=C=>{c(W(b+C.clientX-y))},m=()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",m),c(C=>{const N=W(C);return window.localStorage.setItem(G,String(N)),N})};window.addEventListener("pointermove",w),window.addEventListener("pointerup",m,{once:!0})},[i]),k=(u,y)=>n.jsx(Fe,{entry:u,depth:y,railWidth:i,selected:u.key===t,onSelect:r,onIncludeFile:s},u.key),S=(u,y)=>{const b=[],w=[...u.children.values()].sort((m,C)=>m.firstIndex!==C.firstIndex?m.firstIndex-C.firstIndex:m.name.localeCompare(C.name));for(const m of w){const C=f.has(m.path);b.push(n.jsxs("button",{type:"button",className:"rd-dir-row",style:{paddingLeft:12+y*14},onClick:()=>d(m.path),title:m.path,children:[n.jsx("span",{className:"rd-dir-caret",children:C?"›":"⌄"}),n.jsx("span",{className:"rd-dir-name",children:m.name}),n.jsx("span",{className:"rd-dir-count",children:J(m)})]},`dir:${m.path}`)),C||b.push(...S(m,y+1))}for(const m of u.files)b.push(k(m,y));return b};return n.jsxs("div",{className:"rd-rail",style:{width:i},children:[n.jsx("div",{className:"rd-rail-head",children:e?`Changed files · ${e.files.length}`:"Changed files"}),n.jsx("div",{className:"rd-rail-list",children:S(a,0)}),n.jsx("div",{className:"rd-rail-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file navigation",onPointerDown:g})]})}function Fe({entry:e,depth:t,railWidth:r,selected:s,onSelect:i,onIncludeFile:c}){const{file:f,key:o,display:p,name:a,dir:d,renamed:g}=e,k=De(r,t),S=Ie(a,k);return n.jsxs("div",{className:"rd-file-row"+(s?" on":""),title:g?`${f.oldPath} → ${f.newPath}`:p,children:[n.jsxs("button",{type:"button",className:"rd-file-pick",style:{paddingLeft:18+t*14},onClick:()=>i(o),children:[n.jsx("span",{className:`rd-file-glyph ${f.status}`,children:ne[f.status]}),n.jsxs("span",{className:"rd-file-id",children:[n.jsx("span",{className:"rd-file-name",children:S}),n.jsx("span",{className:"rd-file-dir",children:g?`${f.oldPath} → ${d||a}`:d}),n.jsx(Ee,{file:f})]})]}),n.jsx("span",{className:"rd-file-churn",children:f.binary?n.jsx("span",{className:"add",style:{color:"var(--muted)"},children:"bin"}):n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"add",children:["+",f.additions??0]}),n.jsxs("span",{className:"del",children:["−",f.deletions??0]})]})}),n.jsx("button",{type:"button",className:"rd-file-include",onClick:u=>{u.stopPropagation(),c(f,o)},"aria-label":`Include ${p} in comment`,title:"Include in comment",children:n.jsx(be,{size:12,strokeWidth:2,"aria-hidden":!0})})]})}function Ee({file:e}){const t=[];return e.binary&&t.push("BINARY"),e.truncated&&t.push("TRUNCATED"),e.status==="conflict"&&t.push("CONFLICT"),t.length===0?null:n.jsx("span",{className:"rd-file-tags",children:t.map(r=>n.jsx("span",{className:"rd-file-tag",children:r},r))})}function Me(e){switch(e?.trim().toLowerCase()){case"active":case"working":case"running":case"in_turn":return 80;case"queued":case"waiting":case"waking":case"in_flight":return 50;case"idle":case"available":return 25;case"offline":case"retired":case"stale":return-40;default:return 0}}function Te(e){return e.newPath??e.oldPath??"(unknown)"}function Q(e){const t=e.scope?.kind==="session"?e.scope.agentId:null,r=new Map;for(const s of e.scout.hints)s.agentId&&r.set(s.agentId,(r.get(s.agentId)??0)+1);return e.scout.agents.map(s=>({id:s.id,label:X(s),score:Me(s.state)+(s.id===t?1e3:0)+(r.get(s.id)??0)*10})).sort((s,i)=>{const c=i.score-s.score;return c!==0?c:s.label.localeCompare(i.label)})}function Ae(e){return Q(e)[0]??null}function Ke(e){const t=e.files.reduce((r,s)=>({add:r.add+(s.additions??0),del:r.del+(s.deletions??0)}),{add:0,del:0});return`${e.kind}: ${e.files.length} file${e.files.length===1?"":"s"}, +${t.add} -${t.del}${e.truncated?", truncated":""}`}function z(e){const t=e.binary?"binary":`+${e.additions??0} -${e.deletions??0}`;return`${e.status}: ${Te(e)} (${t}${e.truncated?", truncated":""})`}function We(e){const t=e.scope;return t?t.kind==="session"?`session ${t.sessionId??t.refId??"(unknown)"} (${t.changedFiles} changed / ${t.touchedFiles} touched files, ${t.include})`:t.filteredPaths.length>0?`filtered worktree (${t.filteredPaths.length} paths)`:"worktree":"worktree"}function ze(e){const{comment:t,includedContext:r=[],snapshot:s,activeLayer:i,selectedFile:c}=e,o=((i?s.layers.find(d=>d.kind===i)??null:null)?.files??s.layers.flatMap(d=>d.files)).slice(0,12).map(z),p=s.scout.agents.map(d=>X(d)).slice(0,8),a=["Operator comment on repo diff:",t,"","Repo Diff context:",`- Worktree: ${s.worktreePath}`,`- Scope: ${We(s)}`,`- Active layer: ${i??"none"}`];return r.length>0&&a.splice(3,0,"Included diff context:",...r.map(d=>d.trim()).filter(Boolean),""),c&&a.push(`- Selected file: ${z(c)}`),a.push(`- Layers: ${s.layers.map(Ke).join("; ")}`),p.length>0&&a.push(`- Attached agents: ${p.join(", ")}`),s.scout.sessions.length>0&&a.push(`- Sessions: ${s.scout.sessions.map(d=>d.id).slice(0,8).join(", ")}`),o.length>0&&a.push(`- Changed files: ${o.join(", ")}`),s.diagnostics.length>0&&a.push(`- Diagnostics: ${s.diagnostics.map(d=>d.message).join("; ")}`),a.join(`
|
|
2
2
|
`)}function _e(e){const{snapshot:t,activeLayer:r,file:s}=e,i=[r??"diff",z(s)];return t.scope?.kind==="session"&&i.push(`session ${t.scope.sessionId??t.scope.refId??"scope"}`),`[Diff context: ${i.join(" · ")}]`}function He(e,t,r){return!e||!t?null:e.files.find((s,i)=>r(s,i)===t)??null}function Oe(e,t=120){const r=e.replace(/\s+/g," ").trim();return r.length>t?`${r.slice(0,t-3)}...`:r}function Be(e,t=7){const r=e.trimEnd().split(`
|
|
3
3
|
`),s=r.slice(0,t),i=r.length-s.length;return i>0?`${s.join(`
|
|
4
4
|
`)}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RepoDiffViewer-Ch_lIMt-.js","assets/index-BFbLvCJn.js","assets/index-BRNHY2fp.css","assets/ui-LM8pS8qE.js","assets/usePierreRuntime-DUXZ-DTK.js","assets/chunk-HRAB3GC3-DVhUsgOw.js","assets/chevron-down-DEDSNJNY.js","assets/createLucideIcon-CKbjXlwv.js","assets/check-BM6QtbB7.js","assets/loader-circle-CCG7hG7z.js","assets/send-horizontal-_Tf_It04.js","assets/file-code-corner-DtMWHBN3.js","assets/code-xml-E9gBuiVs.js","assets/x-BcfhXYiF.js","assets/cache-DGBo3vIf.js","assets/api-DSqpVKC7.js","assets/message-square-BwqBIfv5.js","assets/refresh-cw-BcqctLqo.js","assets/plus-B0hdY0fF.js","assets/repo-diff-DyYmQMSA.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r as i,_ as s}from"./index-BFbLvCJn.js";/* empty css */const a=i.lazy(()=>s(()=>import("./RepoDiffViewer-Ch_lIMt-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])).then(r=>({default:r.RepoDiffViewer})));function t(){return e.jsx("div",{className:"rd-viewer","data-scout-theme":!0,children:e.jsx("div",{className:"rd-center",children:e.jsxs("div",{className:"rd-center-card",children:[e.jsx("div",{className:"rd-spinner","aria-hidden":!0}),e.jsx("div",{className:"rd-center-title",children:"Opening diff viewer…"})]})})})}function c(r){return e.jsx(i.Suspense,{fallback:e.jsx(t,{}),children:e.jsx(a,{...r})})}export{c as R};
|