@openscout/scout 0.2.102 → 0.2.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/bin/scout.mjs +6 -0
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +4 -4
- package/dist/chat.mjs +285 -0
- package/dist/client/assets/ActivityScreen-CcDdQTBK.js +1 -0
- package/dist/client/assets/{AddProjectForm-DfbjlFfy.js → AddProjectForm-CHNJ4NnS.js} +1 -1
- package/dist/client/assets/{AdventureEvidence-Dzz9VbuE.js → AdventureEvidence-B4mEvXeD.js} +1 -1
- package/dist/client/assets/{AdventureReader-ClMxT0e4.js → AdventureReader-ZsBDQITY.js} +1 -1
- package/dist/client/assets/{AdventureScenery-D548O0x4.js → AdventureScenery-DSxDlqG1.js} +1 -1
- package/dist/client/assets/AgentAdventures-BxrYq_2v.js +1 -0
- package/dist/client/assets/{AgentAvatar-BIwg54Tj.js → AgentAvatar-NZOqcsB2.js} +1 -1
- package/dist/client/assets/AgentConfigurationScreen-BhD1PEAM.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-BqS6MXqF.js +1 -0
- package/dist/client/assets/{AgentDetailCard-CFDE8TLi.js → AgentDetailCard-MIEBKw_S.js} +1 -1
- package/dist/client/assets/AgentFloorView-A0dDRlRV.js +1 -0
- package/dist/client/assets/{AgentFloorWorld-BDJmXl3C.js → AgentFloorWorld-BTqwmK5G.js} +1 -1
- package/dist/client/assets/AgentInfoScreen-DuaN0sgE.js +1 -0
- package/dist/client/assets/{AgentLaneCard-C6YmwPxQ.js → AgentLaneCard-C4rKLLdT.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-D9uJ4QY7.js → AgentLaneChrome-fGC-ZrJS.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-KYckCBCX.js → AgentLaneDetailSheet-BTF4_th9.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-BBYBS3DO.js → AgentLaneSummaryResize-DgSeA_vS.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-CeNiaZ9_.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-pw2vMO3Q.js → AgentLanesPreflight-CcS23wij.js} +1 -1
- package/dist/client/assets/{AgentLanesView-aAyC7lHf.js → AgentLanesView-WZhEDBFE.js} +1 -1
- package/dist/client/assets/{AgentLiveActions-lYzicnNa.js → AgentLiveActions-6Kfr1uOT.js} +1 -1
- package/dist/client/assets/AgentMasterScreen-DUDUTAnU.js +1 -0
- package/dist/client/assets/{AgentSessions-Cox2zS-e.js → AgentSessions-CO1WGa8Z.js} +2 -2
- package/dist/client/assets/AgentsConsole-BQOWkj35.js +1 -0
- package/dist/client/assets/AgentsScreen-BMNAj1PH.js +1 -0
- package/dist/client/assets/AgentsSubnav-CeHhuzyM.js +1 -0
- package/dist/client/assets/{AstronautSuit-C-4I5YKi.js → AstronautSuit-D67fIBdR.js} +1 -1
- package/dist/client/assets/{AtopView-DKm-ERYC.js → AtopView-Ck30FbzG.js} +1 -1
- package/dist/client/assets/{BackToPicker-Bys9ColC.js → BackToPicker-CkBhGRlD.js} +1 -1
- package/dist/client/assets/BriefingDetailScreen-yZG8_m4h.js +1 -0
- package/dist/client/assets/{BriefingsScreen-D4Zf31Y6.js → BriefingsScreen-DTxYMr3a.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-1GoSl2BV.js → BrokerMetadataPanel-crirZCdo.js} +1 -1
- package/dist/client/assets/BrokerScreen-CT37VQiL.js +8 -0
- package/dist/client/assets/Canvas-CRP0KjKb.js +1 -0
- package/dist/client/assets/{CastPicker-BuwE_JQp.js → CastPicker-ZPomvOf-.js} +1 -1
- package/dist/client/assets/ChannelComposer-BVItWlEz.js +1 -0
- package/dist/client/assets/ChannelSidebar-B-2spawY.js +1 -0
- package/dist/client/assets/{CharacterFamilyPreview-CfO3j8Of.js → CharacterFamilyPreview-ckVkecDO.js} +1 -1
- package/dist/client/assets/ChatAvatar-DKBsbOqk.js +1 -0
- package/dist/client/assets/ChatBits-CLJ71hTY.js +1 -0
- package/dist/client/assets/{ChatCollapsedStrip-TV0j1xTB.js → ChatCollapsedStrip-Co0NmqOO.js} +1 -1
- package/dist/client/assets/ChatRightPanel-pKQtkAgl.js +1 -0
- package/dist/client/assets/ChatSpaceSurface-NrLwdPkE.js +1 -0
- package/dist/client/assets/ChatSpaceTheme-BPMgPdVK.css +1 -0
- package/dist/client/assets/ChatSpaceTheme-D37Jk7bl.js +1 -0
- package/dist/client/assets/{CodeDiffPane-DB6-mqtX.js → CodeDiffPane-D-iv28LJ.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-B_LNLpIK.js → CodeProjectPicker-CZ3gDdiT.js} +1 -1
- package/dist/client/assets/{CodeScreen-C9H160XS.js → CodeScreen-CSC-zbP9.js} +1 -1
- package/dist/client/assets/{CommsCanvas-DOKw3Q8i.js → CommsCanvas-DdNAwjGW.js} +1 -1
- package/dist/client/assets/{CommsDeck-C18JA7rK.js → CommsDeck-mGWY7Ivi.js} +1 -1
- package/dist/client/assets/{CommsFlowGraph-Czg-KTS0.js → CommsFlowGraph-voDD9M5R.js} +1 -1
- package/dist/client/assets/{CommsFlowMap-CzBWvSa5.js → CommsFlowMap-C33sgD48.js} +1 -1
- package/dist/client/assets/{CommsSelection-g1twA-Lb.js → CommsSelection-BL8aYD7z.js} +1 -1
- package/dist/client/assets/{ConversationComposer-B7RU6LKd.js → ConversationComposer-DNcn5U6D.js} +1 -1
- package/dist/client/assets/ConversationFeedRows-RnYSa7Io.js +1 -0
- package/dist/client/assets/ConversationHeader-Y9TEJxP_.js +1 -0
- package/dist/client/assets/{ConversationPanels-C9yCAoJy.js → ConversationPanels-6pprBpmq.js} +2 -2
- package/dist/client/assets/ConversationScreen-tpj4cqWs.js +2 -0
- package/dist/client/assets/{ConversationStatus-CK-YfLpi.js → ConversationStatus-Cv-7hErW.js} +1 -1
- package/dist/client/assets/{CrewAvatar-CJhuqTsJ.js → CrewAvatar-zgzC3cbU.js} +1 -1
- package/dist/client/assets/{CrewSprite-hgpA3SWB.js → CrewSprite-Dp9KBBGY.js} +1 -1
- package/dist/client/assets/CrewWorkspaces-DDuYMByu.css +1 -0
- package/dist/client/assets/CrewWorkspaces-K2jcyLec.js +1 -0
- package/dist/client/assets/{DataTable-BMOZ1-z8.js → DataTable-av71ehJV.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-DDlwqSCY.js → DispatchAftermath-CcYGUB10.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-f12RRQpV.js → DocumentFocusViewer-DlMiEALb.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-DGl9EMRV.js → EmbeddableSurfacesLab-CTkO_tQR.js} +1 -1
- package/dist/client/assets/{EmptyState-uyYN5piI.js → EmptyState-CYUwYyAW.js} +1 -1
- package/dist/client/assets/{FileViewerPane-HtiDbj9N.js → FileViewerPane-Cxhixtks.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-CvzhzuWc.js +1 -0
- package/dist/client/assets/{FloorContextSheet-DV-SYA0K.js → FloorContextSheet-Vj_wVZq1.js} +1 -1
- package/dist/client/assets/{FloorExchangePanel-D59nvRCF.js → FloorExchangePanel-CjHSDXad.js} +1 -1
- package/dist/client/assets/{FloorMessagePasses-BCwsz9VS.js → FloorMessagePasses-BG4ebnX5.js} +1 -1
- package/dist/client/assets/{FloorReplay-BHo79HCD.js → FloorReplay-BoYaGY9t.js} +1 -1
- package/dist/client/assets/FloorResourcesSheet-_Iy5UqgY.js +1 -0
- package/dist/client/assets/{FloorSavedWork-2tjBoy06.js → FloorSavedWork-jbtRs-YE.js} +1 -1
- package/dist/client/assets/{FloorTacticalHUD-Bngao6sn.js → FloorTacticalHUD-BhyOqlL5.js} +1 -1
- package/dist/client/assets/{FollowScreen-eHXOlK-u.js → FollowScreen-CupyOgt4.js} +1 -1
- package/dist/client/assets/HarnessMark-DSvM_H7H.js +1 -0
- package/dist/client/assets/HarnessesScreen-DyjqbZ4k.js +1 -0
- package/dist/client/assets/{HerdrSession-CtJOUn7H.js → HerdrSession-Dcm3vf9U.js} +1 -1
- package/dist/client/assets/{HomeHero-Cvwx2H0w.js → HomeHero-pIZtE1cC.js} +1 -1
- package/dist/client/assets/{HostAdvisorView-CTJXIc1Q.js → HostAdvisorView-Dv5meXo2.js} +1 -1
- package/dist/client/assets/InviteLandingScreen-xZQ2na1z.js +1 -0
- package/dist/client/assets/InviteSheet--5Zjct25.js +1 -0
- package/dist/client/assets/JumpPalette-BmiSOEmp.js +1 -0
- package/dist/client/assets/{KnowledgeSearchInspector-DwGMVmFL.js → KnowledgeSearchInspector-B8yiM524.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-BPqAjHnH.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-C6YehJqD.js → LaneToolHoverCard-D2cnTeUd.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-jl4XQmEx.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-WLNZZVi_.js → LaneTraceEventFocus-BLhVHwff.js} +1 -1
- package/dist/client/assets/{MeshCanvas-FDDGE69h.js → MeshCanvas-BR25OBTJ.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-CGRzQCac.js → MeshCanvasMinimap-ClVolr4-.js} +1 -1
- package/dist/client/assets/MeshScreen-BW1dMFWF.js +1 -0
- package/dist/client/assets/{MeshTopologyView-C2Cv_2gx.js → MeshTopologyView-BT3ke2D1.js} +2 -2
- package/dist/client/assets/MessagesScreen-CtNMfIvC.js +1 -0
- package/dist/client/assets/{MissionContextRail-CVSZJnvX.js → MissionContextRail-CafjuseK.js} +1 -1
- package/dist/client/assets/MissionControlView-BjPOViGY.js +1 -0
- package/dist/client/assets/{MissionFocusOverlay-B9SiuO-i.js → MissionFocusOverlay-nhy3hkxQ.js} +1 -1
- package/dist/client/assets/MissionLeftAgentRow-Dms0DBjO.js +1 -0
- package/dist/client/assets/{MissionLogPane-CMBiI29U.js → MissionLogPane-DiUf3vWW.js} +1 -1
- package/dist/client/assets/NativeAreaScreen-BQSTo8As.js +1 -0
- package/dist/client/assets/NativeAreaScreen-Brix6xDB.js +1 -0
- package/dist/client/assets/NativeAreaScreen-D7HyQNlM.js +1 -0
- package/dist/client/assets/{NewAgentModal-Cl4nsGhu.js → NewAgentModal-BQ2wQ5gp.js} +1 -1
- package/dist/client/assets/NewChatComposer-BEXS8vV6.js +19 -0
- package/dist/client/assets/{NewChatOrigin-CyPPWTJP.js → NewChatOrigin-C8ROO4ps.js} +1 -1
- package/dist/client/assets/{NodeDetailPanel-BUG8rOb-.js → NodeDetailPanel-BNTqYC7m.js} +1 -1
- package/dist/client/assets/{NodeMenu-Fw8ATWQA.js → NodeMenu-CcOeFRCB.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-BPiSXXvm.js → ObserveEmbedScreen-Dh30EjAQ.js} +2 -2
- package/dist/client/assets/{ObserveTextFlow-ET0dD1wO.js → ObserveTextFlow-CC5mnngm.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-DkEkQzo-.js → ObservedTopologyPanel-DF6tRZL_.js} +1 -1
- package/dist/client/assets/OpenScoutAppShell-D9pgw36i.js +31 -0
- package/dist/client/assets/OpsAgentsView-D3rM0udq.js +1 -0
- package/dist/client/assets/OpsScreen-DySeNQ1V.js +1 -0
- package/dist/client/assets/OpsSubnav-C9E0r3GZ.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-FUav75j2.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-C1fR65Eh.js → ProjectAgentProfileBar-C8z22pJ2.js} +1 -1
- package/dist/client/assets/ProjectAgentProfileHero-BLK0EwMg.js +1 -0
- package/dist/client/assets/ProjectsInbox-DfCXReZK.js +2 -0
- package/dist/client/assets/ProjectsRail-CELVubfJ.js +1 -0
- package/dist/client/assets/ProjectsScreen-DMw4TLKy.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-D1Sh4fnX.js +1 -0
- package/dist/client/assets/{Provider-5Hotn7NQ.js → Provider-CNZluAZb.js} +2 -2
- package/dist/client/assets/{RailRow-BYguXNm4.js → RailRow-DUPqXMZh.js} +1 -1
- package/dist/client/assets/RailToggle-BwmY70B8.js +1 -0
- package/dist/client/assets/RawSessionsTable-6OVJq0JZ.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-D41TYY0x.js +9 -0
- package/dist/client/assets/{RenderedWorkerSprite-CvdWO32C.js → RenderedWorkerSprite-C8fxndAh.js} +1 -1
- package/dist/client/assets/{ReplayClock-B7JLTp8A.js → ReplayClock-DUVJjrIu.js} +1 -1
- package/dist/client/assets/{ReplayLog-DZTpf2CW.js → ReplayLog-Bek1Vc4W.js} +1 -1
- package/dist/client/assets/{ReplayOutpost-CvWQa30T.js → ReplayOutpost-DlRg3172.js} +1 -1
- package/dist/client/assets/{RepoDiffEmbedScreen-Cbu0_PJW.js → RepoDiffEmbedScreen-CVUMnt6A.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-Chwm6GXL.js → RepoDiffPageScreen-D9-s5PyB.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-C2mb0Wj-.js → RepoDiffViewer-D7FN-oyY.js} +1 -1
- package/dist/client/assets/RepoDiffViewerLazy-BpMR7tlx.js +2 -0
- package/dist/client/assets/{ReposScreen-C7JZQmyh.js → ReposScreen-BQ7HO1om.js} +2 -2
- package/dist/client/assets/{RiggedWorkerCharacter-DNe731GE.js → RiggedWorkerCharacter-CJMWlvV-.js} +1 -1
- package/dist/client/assets/{SageModelStudio-BR1J2D4R.js → SageModelStudio-B526NSnw.js} +1 -1
- package/dist/client/assets/{ScoutDeckSurface-flRamdvE.js → ScoutDeckSurface-ChkvGyEW.js} +1 -1
- package/dist/client/assets/{ScoutSurface-BpklGmDL.js → ScoutSurface-6g1f5chk.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-DeK7ySWZ.js → ScoutbotFxLab-BuwBdnPf.js} +1 -1
- package/dist/client/assets/{SecondaryNav-BkTn5tkq.js → SecondaryNav-Bs-_VwTC.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-CcQN6xlo.js → SessionEmbedScreen-C2wf35-P.js} +1 -1
- package/dist/client/assets/{SessionObserve-DaqDhqDI.js → SessionObserve-B64YsYhy.js} +9 -9
- package/dist/client/assets/{SessionObserve-BOBJSfs0.css → SessionObserve-CDdJ7fAE.css} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-Drv-D8Oh.js → SessionObserveEvidence-CS1aQBpQ.js} +1 -1
- package/dist/client/assets/SessionRefScreen-DURV0MpF.js +1 -0
- package/dist/client/assets/SessionsScreen-D71ZR-8t.js +1 -0
- package/dist/client/assets/{SettingsDrawer-BDapR4E9.js → SettingsDrawer-Nz98oBVl.js} +3 -3
- package/dist/client/assets/SettingsScreen-CYBHal6y.js +1 -0
- package/dist/client/assets/{SharedFloorCharacter-CSYG_t9t.js → SharedFloorCharacter-V04kD5T9.js} +1 -1
- package/dist/client/assets/SharedWorkFloor-C0xxW4SN.js +2 -0
- package/dist/client/assets/{ShikiPane-BudrOxNK.js → ShikiPane-XwFI-pCp.js} +1 -1
- package/dist/client/assets/{SlidePanel-Datu7XG4.js → SlidePanel-BMpkXai_.js} +1 -1
- package/dist/client/assets/SpaceSwitcher-BfeIf-ad.js +1 -0
- package/dist/client/assets/{SpriteAvatar-BW1JzkDt.js → SpriteAvatar-aHeF4ZQZ.js} +1 -1
- package/dist/client/assets/{SproutActionSprite-DveCzg6l.js → SproutActionSprite-DI5N3gOj.js} +1 -1
- package/dist/client/assets/{StatusPill-MxYClPG5.js → StatusPill-Dw4LP7wu.js} +1 -1
- package/dist/client/assets/{TailView-Dn7uWmPz.js → TailView-BofjmUMJ.js} +2 -2
- package/dist/client/assets/Terminal-jIqnIZZ6.js +4 -0
- package/dist/client/assets/TerminalEmbedScreen-3XsjuySR.js +1 -0
- package/dist/client/assets/{TerminalHeaderMount-DCGstkZ4.js → TerminalHeaderMount-CwbQhXcI.js} +1 -1
- package/dist/client/assets/TerminalRelay--qOBwnbR.js +46 -0
- package/dist/client/assets/{TextDocumentSurface-BhYvAB0o.js → TextDocumentSurface-BK6Qy41F.js} +1 -1
- package/dist/client/assets/{TmuxPeek-BhK0V9Qt.js → TmuxPeek-DpUT9Tpc.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-CecFWzva.js → VoicePermissionsPanel-D35fOnQj.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-CwtRCm_-.js → WorkDetailScreen-Bcf_yHhU.js} +2 -2
- package/dist/client/assets/{WorkFilesViewer-DJHftsH9.js → WorkFilesViewer-t8AEyx3Q.js} +1 -1
- package/dist/client/assets/{WorkRunView-x5PH1byG.js → WorkRunView-_mhG_FR2.js} +1 -1
- package/dist/client/assets/WorldActorTalk-CKerDikx.js +1 -0
- package/dist/client/assets/{WorldCharacter-Dn4sIXNP.js → WorldCharacter-BRrj3MQN.js} +1 -1
- package/dist/client/assets/{WorldMinimap-Blqg0d5r.js → WorldMinimap-DOptgrc4.js} +1 -1
- package/dist/client/assets/{WorldSky-DV9bpvXj.js → WorldSky-D-RJzSa6.js} +1 -1
- package/dist/client/assets/{activity-CSUhvjD0.js → activity-BJqFrZyB.js} +1 -1
- package/dist/client/assets/{addon-fit-MR98IWES.js → addon-fit-CHohcvS3.js} +1 -1
- package/dist/client/assets/{addon-webgl-CIIKXrvK.js → addon-webgl-CaRy2x2b.js} +1 -1
- package/dist/client/assets/agent-autocomplete-_u9o5EZu.js +2 -0
- package/dist/client/assets/{agent-essentials-8t2il7PV.js → agent-essentials-bKWYOZaH.js} +1 -1
- package/dist/client/assets/{agent-floor-actor-3v9drnxh.js → agent-floor-actor-DW8zLht0.js} +1 -1
- package/dist/client/assets/{agent-lane-card-model-l0stnU9N.js → agent-lane-card-model-CeqQGp-8.js} +1 -1
- package/dist/client/assets/{agent-lane-detail-Db7KyAlf.js → agent-lane-detail-Ti3trpfH.js} +1 -1
- package/dist/client/assets/{agent-lane-preview-B8lsQJOQ.js → agent-lane-preview-Dpa3DuOn.js} +1 -1
- package/dist/client/assets/{agent-lanes-model-CX0wTcnF.js → agent-lanes-model-DMAdqCmK.js} +1 -1
- package/dist/client/assets/{agent-specialization-CiVxQsFT.js → agent-specialization-BplZUa_0.js} +1 -1
- package/dist/client/assets/{api-B9_IqFKY.js → api-BQYTwoz6.js} +1 -1
- package/dist/client/assets/{api-CaROe5_H.js → api-DSqpVKC7.js} +1 -1
- package/dist/client/assets/{arc.es-BzhWalCl.js → arc.es-CubLvQ4W.js} +1 -1
- package/dist/client/assets/{arrow-left-PuKdO3NM.js → arrow-left-DFfKAq0d.js} +1 -1
- package/dist/client/assets/{arrow-right-ldbfp4SZ.js → arrow-right-DmAWnyAH.js} +1 -1
- package/dist/client/assets/{arrow-up-right-Hn754ybA.js → arrow-up-right-B0aLKiyF.js} +1 -1
- package/dist/client/assets/at-sign-DM7xeppo.js +1 -0
- package/dist/client/assets/{book-open-BlJnpf2U.js → book-open-BL9qvhEI.js} +1 -1
- package/dist/client/assets/{bot-CfN9PSBF.js → bot-BhAVbcCA.js} +1 -1
- package/dist/client/assets/{cache-DEy9E34b.js → cache-DGBo3vIf.js} +1 -1
- package/dist/client/assets/chat-api-BPVC0asu.js +1 -0
- package/dist/client/assets/chat-space-model-B6Jg2CY4.js +4 -0
- package/dist/client/assets/{check-B8dMv3Is.js → check-g7D7-c1J.js} +1 -1
- package/dist/client/assets/{chevron-down-B5eMsn5c.js → chevron-down-CDzRQQGl.js} +1 -1
- package/dist/client/assets/{chevron-right-C7UGFpkl.js → chevron-right-DKGTLiqc.js} +1 -1
- package/dist/client/assets/{chevron-up-BHOEgHcn.js → chevron-up-DX7R6KY2.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-C5X-kFhb.js → chunk-HRAB3GC3-Dvk_QpRq.js} +1 -1
- package/dist/client/assets/{clock-DFcRbtrl.js → clock-CQb4FeMf.js} +1 -1
- package/dist/client/assets/{code-xml-BmyLM0I2.js → code-xml-Cmadr3pQ.js} +1 -1
- package/dist/client/assets/{coffee-C_D9zooM.js → coffee-ljG1_krY.js} +1 -1
- package/dist/client/assets/{compass-DTZdCpv9.js → compass-CvzkzkIh.js} +1 -1
- package/dist/client/assets/content-0AXa0klu.js +1 -0
- package/dist/client/assets/content-BEyJ19Lx.js +1 -0
- package/dist/client/assets/content-BN5weWKW.js +1 -0
- package/dist/client/assets/content-BNokkm7C.js +1 -0
- package/dist/client/assets/content-BV4PUM9q.js +1 -0
- package/dist/client/assets/content-BxUPlcx5.js +1 -0
- package/dist/client/assets/content-CIC5sku8.js +1 -0
- package/dist/client/assets/content-CKJ9zb7Z.js +1 -0
- package/dist/client/assets/content-CdkTyxqk.js +1 -0
- package/dist/client/assets/content-CnhhSCZq.js +1 -0
- package/dist/client/assets/content-D1Ze_FG9.js +1 -0
- package/dist/client/assets/content-DY3F9Vfr.js +1 -0
- package/dist/client/assets/content-DrKBYpcb.js +1 -0
- package/dist/client/assets/content-LSStQYj5.js +1 -0
- package/dist/client/assets/content-YvU-D0hF.js +1 -0
- package/dist/client/assets/content-oKQMyVnH.js +1 -0
- package/dist/client/assets/{context-budget-DemtXu7E.js → context-budget-8qFKqM-j.js} +1 -1
- package/dist/client/assets/{conversation-icons-BQ4OeOmr.js → conversation-icons-CIRaxmid.js} +1 -1
- package/dist/client/assets/{conversation-model-BGFHoxQ0.js → conversation-model-m8HhzroS.js} +1 -1
- package/dist/client/assets/conversation-motion-features-D9PxLoDt.js +1 -0
- package/dist/client/assets/{copy-D9WUpQRf.js → copy-BGOC1tJB.js} +1 -1
- package/dist/client/assets/{cpu-Ck_4tB_-.js → cpu-Q6nrHFTN.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DkjnzvcJ.js → createLucideIcon-ChvMq-zl.js} +1 -1
- package/dist/client/assets/{credentials-C4VXz2hr.js → credentials-OeoF-VKJ.js} +1 -1
- package/dist/client/assets/discover-DlwbftpC.js +2 -0
- package/dist/client/assets/embed-entry-c0lwtjBG.js +2 -0
- package/dist/client/assets/{external-link-RT4Ph-6-.js → external-link-BVccgH0n.js} +1 -1
- package/dist/client/assets/{eye-CtqSV8BS.js → eye-CsGfEVR6.js} +1 -1
- package/dist/client/assets/{file-code-corner-D_Aptal2.js → file-code-corner-Be6da5l3.js} +1 -1
- package/dist/client/assets/{file-text-ChtICwub.js → file-text-DP6txVW-.js} +1 -1
- package/dist/client/assets/{flag-CqdOxVkI.js → flag-DAFE2wZ5.js} +1 -1
- package/dist/client/assets/{floor-context-model-DZBpo_oD.js → floor-context-model-rWKqaKmV.js} +1 -1
- package/dist/client/assets/{floor-message-passes-CJh9f8Jp.js → floor-message-passes-CO3Ix_wR.js} +1 -1
- package/dist/client/assets/{folder-0fWevPvQ.js → folder-B_S7gBVr.js} +1 -1
- package/dist/client/assets/{gauge-Dgtfxf_o.js → gauge-DQCGlE3o.js} +1 -1
- package/dist/client/assets/{gestures-BDCZ1FRG.js → gestures-CofqY4Km.js} +1 -1
- package/dist/client/assets/{git-branch-CA3cHKCI.js → git-branch-DcUCsWdJ.js} +1 -1
- package/dist/client/assets/{go-shortcuts-DKtw4qYx.js → go-shortcuts-KQy-ZOpV.js} +1 -1
- package/dist/client/assets/{home-moving-signal-B7m-ngb2.js → home-moving-signal-BIHUGNfI.js} +1 -1
- package/dist/client/assets/home-now-card-CaLgZze2.js +1 -0
- package/dist/client/assets/{home-now-card-nano-D1ScGrgv.js → home-now-card-nano-CvU8B61b.js} +1 -1
- package/dist/client/assets/hooks-DaUOREpP.js +2 -0
- package/dist/client/assets/index-CGbs0SBm.css +1 -0
- package/dist/client/assets/index-CbqBwfIW.js +1 -0
- package/dist/client/assets/index-CyPMl7Up.js +1 -0
- package/dist/client/assets/index-DReVb7jZ.js +10 -0
- package/dist/client/assets/index-PQpJveGO.js +1 -0
- package/dist/client/assets/{index-CvsM3jm8.js → index-kkXUq-zf.js} +1 -1
- package/dist/client/assets/{inspector-panel-BLhDODb3.js → inspector-panel-CLU7wjnT.js} +2 -2
- package/dist/client/assets/{keyboard-nav-CXfav14z.js → keyboard-nav-CJXPaHXj.js} +1 -1
- package/dist/client/assets/lane-ask-display-BTVSakyo.js +18 -0
- package/dist/client/assets/{lane-observe-BD21P8BB.js → lane-observe-CteDwdD-.js} +3 -3
- package/dist/client/assets/{lane-roster-store-DzNHP392.js → lane-roster-store-Ch9t6lb0.js} +1 -1
- package/dist/client/assets/{layers-Bolb8ejU.js → layers-BOwyWodP.js} +1 -1
- package/dist/client/assets/{layout-grid-DI9tVJ2E.js → layout-grid-B36Qsh0y.js} +1 -1
- package/dist/client/assets/left-0vBrvrBG.js +2 -0
- package/dist/client/assets/left-C6SyaqlJ.js +1 -0
- package/dist/client/assets/left-CTuXysZR.js +2 -0
- package/dist/client/assets/left-Cc6s4DT2.js +1 -0
- package/dist/client/assets/left-DF5caiyh.js +1 -0
- package/dist/client/assets/left-DgT4tWCx.js +1 -0
- package/dist/client/assets/left-R0wppTTr.js +1 -0
- package/dist/client/assets/left-advisor-C-kt8V28.js +1 -0
- package/dist/client/assets/left-agents-thnBO156.js +1 -0
- package/dist/client/assets/left-default-CT42fnpF.js +1 -0
- package/dist/client/assets/left-lanes-CSmZgciK.js +1 -0
- package/dist/client/assets/left-mission-C86x6i9h.js +1 -0
- package/dist/client/assets/library-DdhYL_9v.js +1 -0
- package/dist/client/assets/{loader-circle-DurUYl7E.js → loader-circle-DNUsuPWz.js} +1 -1
- package/dist/client/assets/{local-agents-D9fYYRyj.js → local-agents-I40PawYA.js} +1 -1
- package/dist/client/assets/{machine-children-RGS4Q0r6.js → machine-children-CdhNzDF0.js} +1 -1
- package/dist/client/assets/{mentions-Ctw1ECUC.js → mentions-Ck_Vjnyp.js} +1 -1
- package/dist/client/assets/{mesh-ops-CGpRk4ik.js → mesh-ops-DSlvHp-D.js} +1 -1
- package/dist/client/assets/{mesh-view-store-CliSYsmt.js → mesh-view-store-C1-mdP3P.js} +1 -1
- package/dist/client/assets/{message-circle-CSiJj6yo.js → message-circle-cI5_A5mj.js} +1 -1
- package/dist/client/assets/{message-markup-DgFSyb3f.js → message-markup-6Tgo4qFJ.js} +1 -1
- package/dist/client/assets/{message-square-NmXWtWLR.js → message-square-CJW4WRlo.js} +1 -1
- package/dist/client/assets/{mission-control-store-DZ29Mlj1.js → mission-control-store-p_cboAm4.js} +1 -1
- package/dist/client/assets/monitor-C7_cHlkC.js +1 -0
- package/dist/client/assets/{nav-destinations-CyXnw9kh.js → nav-destinations-CU_euC-Q.js} +1 -1
- package/dist/client/assets/{observe-CkfOxYx_.js → observe-CtS0l3zu.js} +1 -1
- package/dist/client/assets/{operator-attention-DGR4kOog.js → operator-attention-DBaRg5ep.js} +1 -1
- package/dist/client/assets/{page-status-CkS3SZu-.js → page-status-DwFR4wSw.js} +1 -1
- package/dist/client/assets/{panel-right-BNTJhy8M.js → panel-right-qP17MwMl.js} +1 -1
- package/dist/client/assets/{pause-DWS7YGQ3.js → pause-B_hliKuR.js} +1 -1
- package/dist/client/assets/{persistent-state-xsuk6Kc-.js → persistent-state-BUsTTZFE.js} +1 -1
- package/dist/client/assets/{pin-DWlD1BOF.js → pin-Oi4qHR6M.js} +1 -1
- package/dist/client/assets/{play-D_Pggug4.js → play-CVeRmqLH.js} +1 -1
- package/dist/client/assets/{plus-D_wLGJGT.js → plus-D5NLH_fM.js} +1 -1
- package/dist/client/assets/profile-BegEUmB7.js +1 -0
- package/dist/client/assets/projects-inbox-CKPLZN8s.css +1 -0
- package/dist/client/assets/{projects-inbox-DvbqJO3q.js → projects-inbox-CfwxCTdN.js} +1 -1
- package/dist/client/assets/provider-DwmCoSlc.js +1 -0
- package/dist/client/assets/{proxy-DOG46ja4.js → proxy-DgzP27W8.js} +1 -1
- package/dist/client/assets/{radio-C_jtwbFP.js → radio-Cas2qg1D.js} +1 -1
- package/dist/client/assets/{refresh-cw-Da9DDLk2.js → refresh-cw-IcD2lPoT.js} +1 -1
- package/dist/client/assets/resolve-panes-pfZTezKo.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-D5ksvrb_.js +1 -0
- package/dist/client/assets/right-BDaCJ0CF.js +1 -0
- package/dist/client/assets/right-BP6lXRFS.js +1 -0
- package/dist/client/assets/right-Cb1VCrdj.js +1 -0
- package/dist/client/assets/right-CeFaxfBo.js +1 -0
- package/dist/client/assets/right-Ck2SrYCj.js +1 -0
- package/dist/client/assets/right-D-uv5YfF.js +1 -0
- package/dist/client/assets/right-DJMSICky.js +1 -0
- package/dist/client/assets/right-Dnljs8ah.js +1 -0
- package/dist/client/assets/right-SdCSF8PP.js +1 -0
- package/dist/client/assets/{right-BLJsc2-p.js → right-cjPTwPXS.js} +1 -1
- package/dist/client/assets/{rocket-DyrYDo8V.js → rocket-DAqYvu8I.js} +1 -1
- package/dist/client/assets/router-C-MF5-mb.js +1 -0
- package/dist/client/assets/{runtime-picker-DdsttHHc.js → runtime-picker-C_AVYF63.js} +1 -1
- package/dist/client/assets/{scope-views-B7PZGlhY.js → scope-views-Dl3ml9OZ.js} +1 -1
- package/dist/client/assets/{scout-voice-DOQ_B77g.js → scout-voice-CqAyfblr.js} +1 -1
- package/dist/client/assets/{scoutbot-markdown-Bz0Vbto2.js → scoutbot-markdown-DwvGQOWo.js} +1 -1
- package/dist/client/assets/{scroll-text-DwC8r2g6.js → scroll-text-B0tKI9Sg.js} +1 -1
- package/dist/client/assets/{search-C4VlW_0l.js → search-UsM-9-_W.js} +1 -1
- package/dist/client/assets/secondaryNavConfig-D15P1Y9k.css +1 -0
- package/dist/client/assets/secondaryNavConfig-DzNHk6IH.js +1 -0
- package/dist/client/assets/{selection-bridge-B5jqyMR9.js → selection-bridge-OTS2iFkt.js} +1 -1
- package/dist/client/assets/{send-horizontal-pOtGI7FM.js → send-horizontal-BlQsRK6C.js} +1 -1
- package/dist/client/assets/{send-to-agent-session-BZGq_ycy.js → send-to-agent-session-C1mgqdow.js} +1 -1
- package/dist/client/assets/{server-ms1yxUYJ.js → server-DBlPW0Mp.js} +1 -1
- package/dist/client/assets/{session-catalog-s-T_w41t.js → session-catalog-CnpZMB7C.js} +1 -1
- package/dist/client/assets/{session-table-CDx_16xf.js → session-table-CGkfG5Yd.js} +1 -1
- package/dist/client/assets/{sessions-view-DzYGsKWS.js → sessions-view-Bge4XZ4I.js} +1 -1
- package/dist/client/assets/{settings-TJIkkZ0P.js → settings-C69Zjrpq.js} +1 -1
- package/dist/client/assets/{shared-work-artifacts-4IIQXQfc.js → shared-work-artifacts-DfNl9KTo.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-CHf3ntw0.js → sliders-horizontal-6bzeod7c.js} +1 -1
- package/dist/client/assets/{sparkles-BbOFw3d0.js → sparkles-Cc5lPZRv.js} +1 -1
- package/dist/client/assets/{sse-v5QLsOHV.js → sse-A8AyLH0g.js} +1 -1
- package/dist/client/assets/{tail-events-DQ46QBW1.js → tail-events-C4WdhVeK.js} +1 -1
- package/dist/client/assets/{terminal-96JWDYDL.js → terminal-DMZjX1es.js} +1 -1
- package/dist/client/assets/{terminal-relay-Bfx8pg80.js → terminal-relay-mO89dX-Y.js} +1 -1
- package/dist/client/assets/{terminal-sessions-Ch9aYlgi.js → terminal-sessions-3RfJpen8.js} +1 -1
- package/dist/client/assets/{terminal-takeover-BlpxpvSp.js → terminal-takeover-CZZsnPzj.js} +1 -1
- package/dist/client/assets/use-beside-D3cJpA5p.js +1 -0
- package/dist/client/assets/{use-conversation-list-A_YUf8lo.js → use-conversation-list-D5EnpVba.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-DFs_u-vM.js → use-fleet-active-asks-D_QOmjg5.js} +1 -1
- package/dist/client/assets/{use-mesh-node-state-Ck9CYplv.js → use-mesh-node-state-3V3ADQ-G.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-Be1WmwCg.js → use-mesh-ops-items-DI9GKWlF.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-D7n3vK8t.js → use-reduced-motion-CiaZHMnk.js} +1 -1
- package/dist/client/assets/use-scout-dev-flags-CkdAHlDR.js +1 -0
- package/dist/client/assets/{useAgentHoverCard-Dr-OjNFF.js → useAgentHoverCard-A3QGXqIy.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-DrL_nkCZ.js +1 -0
- package/dist/client/assets/{useEmbedHeadline-BL8wQawZ.js → useEmbedHeadline-atkQVfGw.js} +1 -1
- package/dist/client/assets/usePersistentState-Y8XwSTg-.js +1 -0
- package/dist/client/assets/{usePierreRuntime-DJkRHMoe.js → usePierreRuntime-DTvcwISe.js} +1 -1
- package/dist/client/assets/users-RLK3P5U4.js +1 -0
- package/dist/client/assets/{wrench-BsMTSeji.js → wrench-B4maQJai.js} +1 -1
- package/dist/client/assets/{x-DI1ktCYb.js → x-rlMdRqJF.js} +1 -1
- package/dist/client/assets/{xterm-B1YBE4Gq.js → xterm-B1zHHOLQ.js} +1 -1
- package/dist/client/assets/{zap-sKPkh4sQ.js → zap-B4X0OrEw.js} +1 -1
- package/dist/client/index.html +15 -3
- package/dist/drizzle/0019_session_actor_targets.sql +227 -0
- package/dist/drizzle/README.md +19 -0
- package/dist/drizzle/meta/0019_snapshot.json +6804 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/highlights-eq9cgrbb.scm +604 -0
- package/dist/highlights-ghv9g403.scm +205 -0
- package/dist/highlights-hk7bwhj4.scm +284 -0
- package/dist/highlights-r812a2qc.scm +150 -0
- package/dist/highlights-x6tmsnaa.scm +115 -0
- package/dist/injections-73j83es3.scm +27 -0
- package/dist/main.mjs +1214 -722
- package/dist/node/main.mjs +133 -22
- package/dist/pairing-runtime-controller.mjs +715 -492
- package/dist/runtime/base-daemon.mjs +14176 -58
- package/dist/runtime/broker-daemon.mjs +15520 -445
- package/dist/runtime/broker-process-manager.mjs +5 -3
- package/dist/runtime/mesh-discover.mjs +5 -3
- package/dist/scout-control-plane-web.mjs +21065 -3387
- package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/dist/update-helper.mjs +83 -17
- package/package.json +2 -2
- package/dist/client/assets/ActivityScreen-DCALiEXY.js +0 -1
- package/dist/client/assets/AgentAdventures-NwTKeF0F.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-B2Hw0ce1.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-CwZJ833X.js +0 -1
- package/dist/client/assets/AgentFloorView-l2wNKFob.js +0 -1
- package/dist/client/assets/AgentInfoScreen-ClZM1wQb.js +0 -1
- package/dist/client/assets/AgentLanesEmbedScreen-DqHwqY0X.js +0 -1
- package/dist/client/assets/AgentMasterScreen-By6DN0jF.js +0 -1
- package/dist/client/assets/AgentsConsole-Dq0S_hRA.js +0 -1
- package/dist/client/assets/AgentsScreen-Bi9Lx47B.js +0 -1
- package/dist/client/assets/AgentsSubnav-BOobgtGE.js +0 -1
- package/dist/client/assets/BriefingDetailScreen-sprFl4Nk.js +0 -1
- package/dist/client/assets/BrokerScreen-CejzhRsB.js +0 -8
- package/dist/client/assets/ConversationFeedRows-DVqnZQH0.js +0 -1
- package/dist/client/assets/ConversationHeader-CCSU8uo_.js +0 -1
- package/dist/client/assets/ConversationScreen-tTP6B_F-.js +0 -2
- package/dist/client/assets/CrewWorkspaces-4O8dgRUD.js +0 -1
- package/dist/client/assets/CrewWorkspaces-Diq11KDq.css +0 -1
- package/dist/client/assets/FlightObserveScreen-DDXfNbsw.js +0 -1
- package/dist/client/assets/FloorResourcesSheet-Djrgd_ZU.js +0 -1
- package/dist/client/assets/HarnessMark-Bt47OeHy.js +0 -1
- package/dist/client/assets/HarnessesScreen-M84sFjWY.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-WC0WhFio.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-mAhj7MJi.js +0 -1
- package/dist/client/assets/MeshScreen-DlfiMlaR.js +0 -1
- package/dist/client/assets/MessagesScreen-BZ7yaGJx.js +0 -1
- package/dist/client/assets/MissionControlView-DpGhxG4a.js +0 -1
- package/dist/client/assets/MissionLeftAgentRow-DhhRRim0.js +0 -1
- package/dist/client/assets/NativeAreaScreen-BQyHHRAM.js +0 -1
- package/dist/client/assets/NativeAreaScreen-Ditv-TYW.js +0 -1
- package/dist/client/assets/NativeAreaScreen-Dq3uPSEI.js +0 -1
- package/dist/client/assets/NewChatComposer-JjLbm3W2.js +0 -19
- package/dist/client/assets/OpenScoutAppShell-CzKbjwCA.js +0 -22
- package/dist/client/assets/OpsAgentsView-CZbtkcQH.js +0 -1
- package/dist/client/assets/OpsScreen-DJq-aBmX.js +0 -1
- package/dist/client/assets/OpsSubnav-9sURjajO.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-q_1tMJIL.js +0 -1
- package/dist/client/assets/ProjectAgentProfileHero-DyEFyTFs.js +0 -1
- package/dist/client/assets/ProjectsInbox-Bs8I__my.js +0 -2
- package/dist/client/assets/ProjectsRail-Deb38OJ1.js +0 -1
- package/dist/client/assets/ProjectsScreen-CgLiYiss.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-C0Yw3yIL.js +0 -1
- package/dist/client/assets/RawSessionsTable-DIhmlvk-.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-3oU7b7V5.js +0 -1
- package/dist/client/assets/RepoDiffViewerLazy-BQ6ZCrsq.js +0 -2
- package/dist/client/assets/SessionRefScreen-BOQ1_ydg.js +0 -1
- package/dist/client/assets/SessionsScreen-R8QKvoey.js +0 -1
- package/dist/client/assets/SettingsScreen-DirtO7Z0.js +0 -1
- package/dist/client/assets/SharedWorkFloor-yPWFLZwX.js +0 -2
- package/dist/client/assets/Terminal-D-DsQlmV.js +0 -4
- package/dist/client/assets/TerminalEmbedScreen-9Gmln759.js +0 -1
- package/dist/client/assets/WorldActorTalk-uIH2jGqA.js +0 -1
- package/dist/client/assets/agent-autocomplete-CeHQpuG9.js +0 -10
- package/dist/client/assets/arrow-down-WoVlkUmg.js +0 -1
- package/dist/client/assets/chunk-JTPDIGGW-ZC-98AHT.js +0 -46
- package/dist/client/assets/chunk-T65CQEWV-CSVUz2rY.js +0 -1
- package/dist/client/assets/chunk-YOZR3KYS-B59jqwO0.js +0 -2
- package/dist/client/assets/content-B5Q4pb9R.js +0 -1
- package/dist/client/assets/content-BK1IfOZs.js +0 -1
- package/dist/client/assets/content-BeEsWLEm.js +0 -1
- package/dist/client/assets/content-BkOwEknW.js +0 -1
- package/dist/client/assets/content-C32W5kAG.js +0 -1
- package/dist/client/assets/content-CoqyLs9v.js +0 -1
- package/dist/client/assets/content-CwpdIS5b.js +0 -1
- package/dist/client/assets/content-DS2OkJ3Q.js +0 -1
- package/dist/client/assets/content-DXKaPDfn.js +0 -1
- package/dist/client/assets/content-DZt5-dkI.js +0 -1
- package/dist/client/assets/content-DbQJH8L1.js +0 -1
- package/dist/client/assets/content-DetoiaHq.js +0 -1
- package/dist/client/assets/content-Dhu3wL7J.js +0 -1
- package/dist/client/assets/content-Dpv34iZu.js +0 -1
- package/dist/client/assets/content-TtQJb61D.js +0 -1
- package/dist/client/assets/content-ymNb2R7g.js +0 -1
- package/dist/client/assets/conversation-motion-features-9x8uZpwh.js +0 -1
- package/dist/client/assets/discover-C8IOY7_K.js +0 -2
- package/dist/client/assets/embed-entry-CG3CfCbm.js +0 -2
- package/dist/client/assets/home-now-card-DduXkHRR.js +0 -1
- package/dist/client/assets/hooks-C6VyQTQe.js +0 -2
- package/dist/client/assets/index-C5cX8dkl.js +0 -1
- package/dist/client/assets/index-C8uS5szO.js +0 -10
- package/dist/client/assets/index-Ck1__1yL.css +0 -1
- package/dist/client/assets/index-ClOOrVG1.js +0 -1
- package/dist/client/assets/index-Crtgfc9I.js +0 -1
- package/dist/client/assets/lane-ask-display-B6iCAVcd.js +0 -18
- package/dist/client/assets/left-B-_z_nqj.js +0 -2
- package/dist/client/assets/left-B1LY7rJc.js +0 -1
- package/dist/client/assets/left-C6bdjWcG.js +0 -2
- package/dist/client/assets/left-CF4iuqlz.js +0 -1
- package/dist/client/assets/left-DLtNyZl1.js +0 -1
- package/dist/client/assets/left-Fpxoq-VY.js +0 -1
- package/dist/client/assets/left-N2wXfTlp.js +0 -1
- package/dist/client/assets/left-advisor-CeIjCKbd.js +0 -1
- package/dist/client/assets/left-agents-upjHVlOj.js +0 -1
- package/dist/client/assets/left-default-08gmdCtb.js +0 -1
- package/dist/client/assets/left-lanes-Cvsp73Hw.js +0 -1
- package/dist/client/assets/left-mission-W1LLaz74.js +0 -1
- package/dist/client/assets/library-DLKBVUJ6.js +0 -1
- package/dist/client/assets/profile-C3KgiZvc.js +0 -1
- package/dist/client/assets/projects-inbox-BIW7nv-H.css +0 -1
- package/dist/client/assets/resolve-panes-DuowGRTk.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-BkTbqteq.js +0 -1
- package/dist/client/assets/right-B9OUA6Ho.js +0 -1
- package/dist/client/assets/right-BDQnjetX.js +0 -1
- package/dist/client/assets/right-BUbKHmRH.js +0 -1
- package/dist/client/assets/right-Ci2IcD4s.js +0 -1
- package/dist/client/assets/right-CmCce3e5.js +0 -1
- package/dist/client/assets/right-D7w0zM5a.js +0 -1
- package/dist/client/assets/right-DIoON_bv.js +0 -1
- package/dist/client/assets/right-E0Jr3VN5.js +0 -1
- package/dist/client/assets/right-lCdAk9dW.js +0 -1
- package/dist/client/assets/router-BKiMcYa7.js +0 -1
- package/dist/client/assets/secondaryNavConfig-DAXIFtVd.js +0 -1
- package/dist/client/assets/secondaryNavConfig-xssF_ubT.css +0 -1
- package/dist/client/assets/use-beside-Df-F2Uvg.js +0 -1
- package/dist/client/assets/use-scout-dev-flags-0TXfQcG0.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-CGvMOVGY.js +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{r as h,j as i}from"./index-DReVb7jZ.js";import{a as Ht}from"./provider-DwmCoSlc.js";import{u as ks,E as bi,F as Wt,A as Gt,a as Si,G as De,H as ws,I as ki,J as js}from"./Provider-CNZluAZb.js";import{H as wi,A as ji,S as Ci,o as Pi,a as Ei,b as wo,c as jo}from"./agent-autocomplete-_u9o5EZu.js";import{a as Z}from"./api-DSqpVKC7.js";import{c as rt}from"./clipboard-e3fSpeo7.js";import{e as Ti}from"./credentials-OeoF-VKJ.js";import{b as Cs,u as Ni,a as Le}from"./persistent-state-BUsTTZFE.js";import{s as Se,e as Ri,S as Ps}from"./scoutbot-Bk3nyrkj.js";import{g as Di,s as Li,l as Ai,j as Vi,e as Mi,a as Ii}from"./scout-voice-CqAyfblr.js";import{d as Bi,f as Es,n as Be}from"./time-Dhsh_2EG.js";import{S as Oi}from"./scoutbot-markdown-DwvGQOWo.js";import{L as re}from"./loader-circle-DNUsuPWz.js";import{P as Co}from"./plus-D5NLH_fM.js";import{C as Mt}from"./chevron-down-CDzRQQGl.js";import{C as _i}from"./chevron-up-DX7R6KY2.js";import{c as ft}from"./createLucideIcon-ChvMq-zl.js";import{S as Po,a as Eo}from"./runtime-picker-C_AVYF63.js";import{S as Ui}from"./send-horizontal-BlQsRK6C.js";import{C as zi}from"./copy-BGOC1tJB.js";import{m as V,p as dt,a as Fi,n as je,i as $i,b as To,d as No,r as It,t as Ro,f as z,e as Oe,S as Hi,g as G,h as Do,j as jt,k as Lo,o as M,q as ke,s as Ct,v as Ts,M as Wi,w as Ao,P as Vo,x as Gi,y as Mo,z as Ns,A as Yi,B as Ae,C as qi,c as Xi,u as Io}from"./use-reduced-motion-CiaZHMnk.js";import{i as ne,b as Ki,r as Ji,s as Rs,p as Bt,d as Zi,e as Bo,f as Qi,h as ye,t as be,j as Pt,k as Ds,l as en,m as tn,n as sn,o as on,q as Yt,u as Et,v as nn,w as rn,x as Oo,y as an,z as cn,A as ln,B as un,C as Ls,D as dn,F as _o,g as hn,a as mn,c as fn}from"./gestures-CofqY4Km.js";import{R as As}from"./rocket-DAqYvu8I.js";import{X as pn}from"./x-rlMdRqJF.js";import{R as xn}from"./refresh-cw-IcD2lPoT.js";import{S as gn}from"./settings-C69Zjrpq.js";import{V as Vs}from"./fx-z37u1o2z.js";import{B as vn}from"./bot-BhAVbcCA.js";import{d as yn}from"./types-B0PlfpKc.js";const bn=[["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"}]],Sn=ft("archive",bn);const kn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],wn=ft("circle-check",kn);const jn=[["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"}]],Uo=ft("volume-2",jn);const Cn=[["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"}]],zo=ft("volume-x",Cn);function Pn(e){return e==="x"||e==="y"?ne[e]?null:(ne[e]=!0,()=>{ne[e]=!1}):ne.x||ne.y?null:(ne.x=ne.y=!0,()=>{ne.x=ne.y=!1})}function qt(e){return Ki(e)&&"ownerSVGElement"in e}const at=new WeakMap;let ct;const Fo=(e,t,s)=>(o,r)=>r&&r[0]?r[0][e+"Size"]:qt(o)&&"getBBox"in o?o.getBBox()[t]:o[s],En=Fo("inline","width","offsetWidth"),Tn=Fo("block","height","offsetHeight");function Nn({target:e,borderBoxSize:t}){at.get(e)?.forEach(s=>{s(e,{get width(){return En(e,t)},get height(){return Tn(e,t)}})})}function Rn(e){e.forEach(Nn)}function Dn(){typeof ResizeObserver>"u"||(ct=new ResizeObserver(Rn))}function Ln(e,t){ct||Dn();const s=Ji(e);return s.forEach(o=>{let r=at.get(o);r||(r=new Set,at.set(o,r)),r.add(t),ct?.observe(o)}),()=>{s.forEach(o=>{const r=at.get(o);r?.delete(t),r?.size||ct?.unobserve(o)})}}const lt=new Set;let we;function An(){we=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};lt.forEach(t=>t(e))},window.addEventListener("resize",we)}function Vn(e){return lt.add(e),we||An(),()=>{lt.delete(e),!lt.size&&typeof we=="function"&&(window.removeEventListener("resize",we),we=void 0)}}function Ms(e,t){return typeof e=="function"?Vn(e):Ln(e,t)}function Mn(e){return qt(e)&&e.tagName==="svg"}function Ot(e,t){e.min=t.min,e.max=t.max}function J(e,t){Ot(e.x,t.x),Ot(e.y,t.y)}function Is(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const $o=1e-4,In=1-$o,Bn=1+$o,Ho=.01,On=0-Ho,_n=0+Ho;function F(e){return e.max-e.min}function Un(e,t,s){return Math.abs(e-t)<=s}function Bs(e,t,s,o=.5){e.origin=o,e.originPoint=V(t.min,t.max,e.origin),e.scale=F(s)/F(t),e.translate=V(s.min,s.max,e.origin)-e.originPoint,(e.scale>=In&&e.scale<=Bn||isNaN(e.scale))&&(e.scale=1),(e.translate>=On&&e.translate<=_n||isNaN(e.translate))&&(e.translate=0)}function Me(e,t,s,o){Bs(e.x,t.x,s.x,o?o.originX:void 0),Bs(e.y,t.y,s.y,o?o.originY:void 0)}function Os(e,t,s,o=0){const r=o?V(s.min,s.max,o):s.min;e.min=r+t.min,e.max=e.min+F(t)}function zn(e,t,s,o){Os(e.x,t.x,s.x,o?.x),Os(e.y,t.y,s.y,o?.y)}function _s(e,t,s,o=0){const r=o?V(s.min,s.max,o):s.min;e.min=t.min-r,e.max=e.min+F(t)}function ht(e,t,s,o){_s(e.x,t.x,s.x,o?.x),_s(e.y,t.y,s.y,o?.y)}function Us(e,t,s,o,r){return e-=t,e=Rs(e,1/s,o),r!==void 0&&(e=Rs(e,1/r,o)),e}function Fn(e,t=0,s=1,o=.5,r,c=e,n=e){if(dt.test(t)&&(t=parseFloat(t),t=V(n.min,n.max,t/100)-n.min),typeof t!="number")return;let a=V(c.min,c.max,o);e===c&&(a-=t),e.min=Us(e.min,t,s,a,r),e.max=Us(e.max,t,s,a,r)}function zs(e,t,[s,o,r],c,n){Fn(e,t[s],t[o],t[r],t.scale,c,n)}const $n=["x","scaleX","originX"],Hn=["y","scaleY","originY"];function Fs(e,t,s,o){zs(e.x,t,$n,s?s.x:void 0,o?o.x:void 0),zs(e.y,t,Hn,s?s.y:void 0,o?o.y:void 0)}function $s(e){return e.translate===0&&e.scale===1}function Wo(e){return $s(e.x)&&$s(e.y)}function Hs(e,t){return e.min===t.min&&e.max===t.max}function Wn(e,t){return Hs(e.x,t.x)&&Hs(e.y,t.y)}function Ws(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Go(e,t){return Ws(e.x,t.x)&&Ws(e.y,t.y)}function Gs(e){return F(e.x)/F(e.y)}function Ys(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Q(e){return[e("x"),e("y")]}function Gn(e,t,s){let o="";const r=e.x.translate/t.x,c=e.y.translate/t.y,n=s?.z||0;if((r||c||n)&&(o=`translate3d(${r}px, ${c}px, ${n}px) `),(t.x!==1||t.y!==1)&&(o+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:l,rotate:d,pathRotation:f,rotateX:m,rotateY:x,skewX:v,skewY:b}=s;l&&(o=`perspective(${l}px) ${o}`),d&&(o+=`rotate(${d}deg) `),f&&(o+=`rotate(${f}deg) `),m&&(o+=`rotateX(${m}deg) `),x&&(o+=`rotateY(${x}deg) `),v&&(o+=`skewX(${v}deg) `),b&&(o+=`skewY(${b}deg) `)}const a=e.x.scale*t.x,u=e.y.scale*t.y;return(a!==1||u!==1)&&(o+=`scale(${a}, ${u})`),o||"none"}const Yo=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Yn=Yo.length,qs=e=>typeof e=="string"?parseFloat(e):e,Xs=e=>typeof e=="number"||Fi.test(e);function qn(e,t,s,o,r,c){r?(e.opacity=V(0,s.opacity??1,Xn(o)),e.opacityExit=V(t.opacity??1,0,Kn(o))):c&&(e.opacity=V(t.opacity??1,s.opacity??1,o));for(let n=0;n<Yn;n++){const a=Yo[n];let u=Ks(t,a),l=Ks(s,a);if(u===void 0&&l===void 0)continue;u||(u=0),l||(l=0),u===0||l===0||Xs(u)===Xs(l)?(e[a]=Math.max(V(qs(u),qs(l),o),0),(dt.test(l)||dt.test(u))&&(e[a]+="%")):e[a]=l}(t.rotate||s.rotate)&&(e.rotate=V(t.rotate||0,s.rotate||0,o))}function Ks(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Xn=qo(0,.5,Zi),Kn=qo(.5,.95,je);function qo(e,t,s){return o=>o<e?0:o>t?1:s(Bt(e,t,o))}function Jn(e,t,s){const o=$i(e)?e:To(e);return o.start(Bo("",o,t,s)),o.animation}const Zn=(e,t)=>e.depth-t.depth;class Qn{constructor(){this.children=[],this.isDirty=!1}add(t){No(this.children,t),this.isDirty=!0}remove(t){It(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Zn),this.isDirty=!1,this.children.forEach(t)}}function er(e,t){const s=Ro.now(),o=({timestamp:r})=>{const c=r-s;c>=t&&(Oe(o),e(c-t))};return z.setup(o,!0),()=>Oe(o)}class tr{constructor(){this.members=[]}add(t){No(this.members,t);for(let s=this.members.length-1;s>=0;s--){const o=this.members[s];if(o===t||o===this.lead||o===this.prevLead)continue;const r=o.instance;(!r||r.isConnected===!1)&&!o.snapshot&&(It(this.members,o),o.unmount())}t.scheduleRender()}remove(t){if(It(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){for(let s=this.members.indexOf(t)-1;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1&&o.instance?.isConnected!==!1)return this.promote(o),!0}return!1}promote(t,s){const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.updateSnapshot(),t.scheduleRender();const{layoutDependency:r}=o.options,{layoutDependency:c}=t.options;(r===void 0||r!==c)&&(t.resumeFrom=o,s&&(o.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const ut={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Tt=["","X","Y","Z"],sr=1e3;let or=0;function Nt(e,t,s,o){const{latestValues:r}=t;r[e]&&(s[e]=r[e],t.setStaticValue(e,0),o&&(o[e]=0))}function Xo(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=on(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:r,layoutId:c}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",z,!(r||c))}const{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&Xo(o)}function Ko({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(n={},a=t?.()){this.id=or++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(rr),this.nodes.forEach(hr),this.nodes.forEach(mr),this.nodes.forEach(ar)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=n,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new Qn)}addEventListener(n,a){return this.eventHandlers.has(n)||this.eventHandlers.set(n,new Hi),this.eventHandlers.get(n).add(a)}notifyListeners(n,...a){const u=this.eventHandlers.get(n);u&&u.notify(...a)}hasListeners(n){return this.eventHandlers.has(n)}mount(n){if(this.instance)return;this.isSVG=qt(n)&&!Mn(n),this.instance=n;const{layoutId:a,layout:u,visualElement:l}=this.options;if(l&&!l.current&&l.mount(n),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||a)&&(this.isLayoutDirty=!0),e){let d,f=0;const m=()=>this.root.updateBlockedByResize=!1;z.read(()=>{f=window.innerWidth}),e(n,()=>{const x=window.innerWidth;x!==f&&(f=x,this.root.updateBlockedByResize=!0,d&&d(),d=er(m,250),ut.hasAnimatedSinceResize&&(ut.hasAnimatedSinceResize=!1,this.nodes.forEach(Qs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||l.getDefaultTransition()||vr,{onLayoutAnimationStart:b,onLayoutAnimationComplete:j}=l.getProps(),S=!this.targetLayout||!Go(this.targetLayout,x),w=!f&&m;if(this.options.layoutRoot||this.resumeFrom||w||f&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...Qi(v,"layout"),onPlay:b,onComplete:j};(l.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(d,w,P.path)}else f||Qs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const n=this.getStack();n&&n.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Oe(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(fr),this.animationId++)}getTransformTemplate(){const{visualElement:n}=this.options;return n&&n.getProps().transformTemplate}willUpdate(n=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Xo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:u}=this.options;if(a===void 0&&!u)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),n&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(lr),this.nodes.forEach(Js);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Zs);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ur),this.nodes.forEach(dr),this.nodes.forEach(ir),this.nodes.forEach(nr)):this.nodes.forEach(Zs),this.clearAllSnapshots();const a=Ro.now();G.delta=Do(0,1e3/60,a-G.timestamp),G.timestamp=a,G.isProcessing=!0,jt.update.process(G),jt.preRender.process(G),jt.render.process(G),G.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Lo.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(cr),this.sharedNodes.forEach(pr)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,z.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){z.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!F(this.snapshot.measuredBox.x)&&!F(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const n=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=M()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,n?n.layoutBox:void 0)}updateScroll(n="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===n&&(a=!1),a&&this.instance){const u=o(this.instance);this.scroll={animationId:this.root.animationId,phase:n,isRoot:u,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!r)return;const n=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Wo(this.projectionDelta),u=this.getTransformTemplate(),l=u?u(this.latestValues,""):void 0,d=l!==this.prevTransformTemplateValue;n&&this.instance&&(a||ye(this.latestValues)||d)&&(r(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(n=!0){const a=this.measurePageBox();let u=this.removeElementScroll(a);return n&&(u=this.removeTransform(u)),yr(u),{animationId:this.root.animationId,measuredBox:a,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:n}=this.options;if(!n)return M();const a=n.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(br))){const{scroll:l}=this.root;l&&(be(a.x,l.offset.x),be(a.y,l.offset.y))}return a}removeElementScroll(n){const a=M();if(J(a,n),this.scroll?.wasRoot)return a;for(let u=0;u<this.path.length;u++){const l=this.path[u],{scroll:d,options:f}=l;l!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&J(a,n),be(a.x,d.offset.x),be(a.y,d.offset.y))}return a}applyTransform(n,a=!1,u){const l=u||M();J(l,n);for(let d=0;d<this.path.length;d++){const f=this.path[d];!a&&f.options.layoutScroll&&f.scroll&&f!==f.root&&(be(l.x,-f.scroll.offset.x),be(l.y,-f.scroll.offset.y)),ye(f.latestValues)&&Pt(l,f.latestValues,f.layout?.layoutBox)}return ye(this.latestValues)&&Pt(l,this.latestValues,this.layout?.layoutBox),l}removeTransform(n){const a=M();J(a,n);for(let u=0;u<this.path.length;u++){const l=this.path[u];if(!ye(l.latestValues))continue;let d;l.instance&&(Ds(l.latestValues)&&l.updateSnapshot(),d=M(),J(d,l.measurePageBox())),Fs(a,l.latestValues,l.snapshot?.layoutBox,d)}return ye(this.latestValues)&&Fs(a,this.latestValues),a}setTargetDelta(n){this.targetDelta=n,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(n){this.options={...this.options,...n,crossfade:n.crossfade!==void 0?n.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==G.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(n=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==a;if(!(n||u&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=G.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=M(),this.targetWithTransforms=M()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zn(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):J(this.target,this.layout.layoutBox),en(this.target,this.targetDelta)):J(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Ds(this.parent.latestValues)||tn(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(n,a,u){this.relativeParent=n,this.linkedParentVersion=n.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=M(),this.relativeTargetOrigin=M(),ht(this.relativeTargetOrigin,a,u,this.options.layoutAnchor||void 0),J(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const n=this.getLead(),a=!!this.resumingFrom||this!==n;let u=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(u=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===G.timestamp&&(u=!1),u)return;const{layout:l,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||d))return;J(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,m=this.treeScale.y;sn(this.layoutCorrected,this.treeScale,this.path,a),n.layout&&!n.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(n.target=n.layout.layoutBox,n.targetWithTransforms=M());const{target:x}=n;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Is(this.prevProjectionDelta.x,this.projectionDelta.x),Is(this.prevProjectionDelta.y,this.projectionDelta.y)),Me(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Ys(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ys(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(n=!0){if(this.options.visualElement?.scheduleRender(),n){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ke(),this.projectionDelta=ke(),this.projectionDeltaWithTransform=ke()}setAnimationOrigin(n,a=!1,u){const l=this.snapshot,d=l?l.latestValues:{},f={...this.latestValues},m=ke();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const x=M(),v=l?l.source:void 0,b=this.layout?this.layout.source:void 0,j=v!==b,S=this.getStack(),w=!S||S.members.length<=1,P=!!(j&&!w&&this.options.crossfade===!0&&!this.path.some(gr));this.animationProgress=0;let C;const N=u?.interpolateProjection(n);this.mixTargetDelta=L=>{const D=L/1e3,y=N?.(D);y?(m.x.translate=y.x,m.x.scale=V(n.x.scale,1,D),m.x.origin=n.x.origin,m.x.originPoint=n.x.originPoint,m.y.translate=y.y,m.y.scale=V(n.y.scale,1,D),m.y.origin=n.y.origin,m.y.originPoint=n.y.originPoint):(eo(m.x,n.x,D),eo(m.y,n.y,D)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ht(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),xr(this.relativeTarget,this.relativeTargetOrigin,x,D),C&&Wn(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=M()),J(C,this.relativeTarget)),j&&(this.animationValues=f,qn(f,d,this.latestValues,D,P,w)),y&&y.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=y.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(n){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Oe(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=z.update(()=>{ut.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=To(0)),this.motionValue.jump(0,!1),this.currentAnimation=Jn(this.motionValue,[0,1e3],{...n,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),n.onUpdate&&n.onUpdate(a)},onStop:()=>{},onComplete:()=>{n.onComplete&&n.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const n=this.getStack();n&&n.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(sr),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const n=this.getLead();let{targetWithTransforms:a,target:u,layout:l,latestValues:d}=n;if(!(!a||!u||!l)){if(this!==n&&this.layout&&l&&Jo(this.options.animationType,this.layout.layoutBox,l.layoutBox)){u=this.target||M();const f=F(this.layout.layoutBox.x);u.x.min=n.target.x.min,u.x.max=u.x.min+f;const m=F(this.layout.layoutBox.y);u.y.min=n.target.y.min,u.y.max=u.y.min+m}J(a,u),Pt(a,d),Me(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(n,a){this.sharedNodes.has(n)||this.sharedNodes.set(n,new tr),this.sharedNodes.get(n).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const n=this.getStack();return n?n.lead===this:!0}getLead(){const{layoutId:n}=this.options;return n?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:n}=this.options;return n?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:n}=this.options;if(n)return this.root.sharedNodes.get(n)}promote({needsReset:n,transition:a,preserveFollowOpacity:u}={}){const l=this.getStack();l&&l.promote(this,u),n&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const n=this.getStack();return n?n.relegate(this):!1}resetSkewAndRotation(){const{visualElement:n}=this.options;if(!n)return;let a=!1;const{latestValues:u}=n;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;const l={};u.z&&Nt("z",n,l,this.animationValues);for(let d=0;d<Tt.length;d++)Nt(`rotate${Tt[d]}`,n,l,this.animationValues),Nt(`skew${Tt[d]}`,n,l,this.animationValues);n.render();for(const d in l)n.setStaticValue(d,l[d]),this.animationValues&&(this.animationValues[d]=l[d]);n.scheduleRender()}applyProjectionStyles(n,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){n.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,n.visibility="",n.opacity="",n.pointerEvents=Ct(a?.pointerEvents)||"",n.transform=u?u(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(n.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,n.pointerEvents=Ct(a?.pointerEvents)||""),this.hasProjected&&!ye(this.latestValues)&&(n.transform=u?u({},""):"none",this.hasProjected=!1);return}n.visibility="";const d=l.animationValues||l.latestValues;this.applyTransformsToTarget();let f=Gn(this.projectionDeltaWithTransform,this.treeScale,d);u&&(f=u(d,f)),n.transform=f;const{x:m,y:x}=this.projectionDelta;n.transformOrigin=`${m.origin*100}% ${x.origin*100}% 0`,l.animationValues?n.opacity=l===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:n.opacity=l===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in Ts){if(d[v]===void 0)continue;const{correct:b,applyTo:j,isCSSVariable:S}=Ts[v],w=f==="none"?d[v]:b(d[v],l);if(j){const P=j.length;for(let C=0;C<P;C++)n[j[C]]=w}else S?this.options.visualElement.renderState.vars[v]=w:n[v]=w}this.options.layoutId&&(n.pointerEvents=l===this?Ct(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(n=>n.currentAnimation?.stop()),this.root.nodes.forEach(Js),this.root.sharedNodes.clear()}}}function ir(e){e.updateLayout()}function nr(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=e.layout,{animationType:r}=e.options,c=t.source!==e.layout.source;if(r==="size")Q(d=>{const f=c?t.measuredBox[d]:t.layoutBox[d],m=F(f);f.min=s[d].min,f.max=f.min+m});else if(r==="x"||r==="y"){const d=r==="x"?"y":"x";Ot(c?t.measuredBox[d]:t.layoutBox[d],s[d])}else Jo(r,t.layoutBox,s)&&Q(d=>{const f=c?t.measuredBox[d]:t.layoutBox[d],m=F(s[d]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+m)});const n=ke();Me(n,s,t.layoutBox);const a=ke();c?Me(a,e.applyTransform(o,!0),t.measuredBox):Me(a,s,t.layoutBox);const u=!Wo(n);let l=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:m}=d;if(f&&m){const x=e.options.layoutAnchor||void 0,v=M();ht(v,t.layoutBox,f.layoutBox,x);const b=M();ht(b,s,m.layoutBox,x),Go(v,b)||(l=!0),d.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=v,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:a,layoutDelta:n,hasLayoutChanged:u,hasRelativeLayoutChanged:l})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function rr(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ar(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function cr(e){e.clearSnapshot()}function Js(e){e.clearMeasurements()}function lr(e){e.isLayoutDirty=!0,e.updateLayout()}function Zs(e){e.isLayoutDirty=!1}function ur(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function dr(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Qs(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function hr(e){e.resolveTargetDelta()}function mr(e){e.calcProjection()}function fr(e){e.resetSkewAndRotation()}function pr(e){e.removeLeadSnapshot()}function eo(e,t,s){e.translate=V(t.translate,0,s),e.scale=V(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function to(e,t,s,o){e.min=V(t.min,s.min,o),e.max=V(t.max,s.max,o)}function xr(e,t,s,o){to(e.x,t.x,s.x,o),to(e.y,t.y,s.y,o)}function gr(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const vr={duration:.45,ease:[.4,0,.1,1]},so=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),oo=so("applewebkit/")&&!so("chrome/")?Math.round:je;function io(e){e.min=oo(e.min),e.max=oo(e.max)}function yr(e){io(e.x),io(e.y)}function Jo(e,t,s){return e==="position"||e==="preserve-aspect"&&!Un(Gs(t),Gs(s),.2)}function br(e){return e!==e.root&&e.scroll?.wasRoot}const Sr=Ko({attachResizeListener:(e,t)=>Yt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Rt={current:void 0},Zo=Ko({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Rt.current){const e=new Sr({});e.mount(window),e.setOptions({layoutScroll:!0}),Rt.current=e}return Rt.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});function no(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function kr(...e){return t=>{let s=!1;const o=e.map(r=>{const c=no(r,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let r=0;r<o.length;r++){const c=o[r];typeof c=="function"?c():no(e[r],null)}}}}function wr(...e){return h.useCallback(kr(...e),e)}class jr extends h.Component{getSnapshotBeforeUpdate(t){const s=this.props.childRef.current;if(Et(s)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const o=s.offsetParent,r=Et(o)&&o.offsetWidth||0,c=Et(o)&&o.offsetHeight||0,n=getComputedStyle(s),a=this.props.sizeRef.current;a.height=parseFloat(n.height),a.width=parseFloat(n.width),a.top=s.offsetTop,a.left=s.offsetLeft,a.right=r-a.width-a.left,a.bottom=c-a.height-a.top,a.direction=n.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Cr({children:e,isPresent:t,anchorX:s,anchorY:o,root:r,pop:c}){const n=h.useId(),a=h.useRef(null),u=h.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:l}=h.useContext(Wi),d=e.props?.ref??e?.ref,f=wr(a,d);return h.useInsertionEffect(()=>{const{width:m,height:x,top:v,left:b,right:j,bottom:S,direction:w}=u.current;if(t||c===!1||!a.current||!m||!x)return;const P=w==="rtl",C=s==="left"?P?`right: ${j}`:`left: ${b}`:P?`left: ${b}`:`right: ${j}`,N=o==="bottom"?`bottom: ${S}`:`top: ${v}`;a.current.dataset.motionPopId=n;const L=document.createElement("style");l&&(L.nonce=l);const D=r??document.head;return D.appendChild(L),L.sheet&&L.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${n}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${m}px !important;
|
|
5
|
+
height: ${x}px !important;
|
|
6
|
+
${C}px !important;
|
|
7
|
+
${N}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{a.current?.removeAttribute("data-motion-pop-id"),D.contains(L)&&D.removeChild(L)}},[t]),i.jsx(jr,{isPresent:t,childRef:a,sizeRef:u,pop:c,children:c===!1?e:h.cloneElement(e,{ref:f})})}const Pr=({children:e,initial:t,isPresent:s,onExitComplete:o,custom:r,presenceAffectsLayout:c,mode:n,anchorX:a,anchorY:u,root:l})=>{const d=Ao(Er),f=h.useId();let m=!0,x=h.useMemo(()=>(m=!1,{id:f,initial:t,isPresent:s,custom:r,onExitComplete:v=>{d.set(v,!0);for(const b of d.values())if(!b)return;o&&o()},register:v=>(d.set(v,!1),()=>d.delete(v))}),[s,d,o]);return c&&m&&(x={...x}),h.useMemo(()=>{d.forEach((v,b)=>d.set(b,!1))},[s]),h.useEffect(()=>{!s&&!d.size&&o&&o()},[s]),e=i.jsx(Cr,{pop:n==="popLayout",isPresent:s,anchorX:a,anchorY:u,root:l,children:e}),i.jsx(Vo.Provider,{value:x,children:e})};function Er(){return new Map}function Qo(e=!0){const t=h.useContext(Vo);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:o,register:r}=t,c=h.useId();h.useEffect(()=>{if(e)return r(c)},[e]);const n=h.useCallback(()=>e&&o&&o(c),[c,o,e]);return!s&&o?[!1,n]:[!0]}const st=e=>e.key||"";function ro(e){const t=[];return h.Children.forEach(e,s=>{h.isValidElement(s)&&t.push(s)}),t}const Tr=({children:e,custom:t,initial:s=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:c="sync",propagate:n=!1,anchorX:a="left",anchorY:u="top",root:l})=>{const[d,f]=Qo(n),m=h.useMemo(()=>ro(e),[e]),x=n&&!d?[]:m.map(st),v=h.useRef(!0),b=h.useRef(m),j=Ao(()=>new Map),S=h.useRef(new Set),[w,P]=h.useState(m),[C,N]=h.useState(m);Gi(()=>{v.current=!1,b.current=m;for(let y=0;y<C.length;y++){const T=st(C[y]);x.includes(T)?(j.delete(T),S.current.delete(T)):j.get(T)!==!0&&j.set(T,!1)}},[C,x.length,x.join("-")]);const L=[];if(m!==w){let y=[...m];for(let T=0;T<C.length;T++){const I=C[T],A=st(I);x.includes(A)||(y.splice(T,0,I),L.push(I))}return c==="wait"&&L.length&&(y=L),N(ro(y)),P(m),null}const{forceRender:D}=h.useContext(Mo);return i.jsx(i.Fragment,{children:C.map(y=>{const T=st(y),I=n&&!d?!1:m===C||x.includes(T),A=()=>{if(S.current.has(T))return;if(j.has(T))S.current.add(T),j.set(T,!0);else return;let B=!0;j.forEach(q=>{q||(B=!1)}),B&&(D?.(),N(b.current),n&&f?.(),o&&o())};return i.jsx(Pr,{isPresent:I,initial:!v.current||s?void 0:!1,custom:t,presenceAffectsLayout:r,mode:c,root:l,onExitComplete:I?void 0:A,anchorX:a,anchorY:u,children:y},T)})})};function Ie(e,t,s,o){return Yt(e,t,nn(s),o)}const ei=({current:e})=>e?e.ownerDocument.defaultView:null,ao=(e,t)=>Math.abs(e-t);function Nr(e,t){const s=ao(e.x,t.x),o=ao(e.y,t.y);return Math.sqrt(s**2+o**2)}const co=new Set(["auto","scroll"]);class ti{constructor(t,s,{transformPagePoint:o,contextWindow:r=window,dragSnapToOrigin:c=!1,distanceThreshold:n=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ot(this.lastRawMoveEventInfo,this.transformPagePoint));const x=Dt(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,b=Nr(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!b)return;const{point:j}=x,{timestamp:S}=G;this.history.push({...j,timestamp:S});const{onStart:w,onMove:P}=this.handlers;v||(w&&w(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,x)},this.handlePointerMove=(x,v)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=v,this.lastMoveEventInfo=ot(v,this.transformPagePoint),z.update(this.updatePoint,!0)},this.handlePointerUp=(x,v)=>{this.end();const{onEnd:b,onSessionEnd:j,resumeAnimation:S}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Dt(x.type==="pointercancel"?this.lastMoveEventInfo:ot(v,this.transformPagePoint),this.history);this.startEvent&&b&&b(x,w),j&&j(x,w)},!rn(t))return;this.dragSnapToOrigin=c,this.handlers=s,this.transformPagePoint=o,this.distanceThreshold=n,this.contextWindow=r||window;const u=Oo(t),l=ot(u,this.transformPagePoint),{point:d}=l,{timestamp:f}=G;this.history=[{...d,timestamp:f}];const{onSessionStart:m}=s;m&&m(t,Dt(l,this.history)),this.removeListeners=an(Ie(this.contextWindow,"pointermove",this.handlePointerMove),Ie(this.contextWindow,"pointerup",this.handlePointerUp),Ie(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let s=t.parentElement;for(;s;){const o=getComputedStyle(s);(co.has(o.overflowX)||co.has(o.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const s=this.scrollPositions.get(t);if(!s)return;const o=t===window,r=o?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},c={x:r.x-s.x,y:r.y-s.y};c.x===0&&c.y===0||(o?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=c.x,this.lastMoveEventInfo.point.y+=c.y):this.history.length>0&&(this.history[0].x-=c.x,this.history[0].y-=c.y),this.scrollPositions.set(t,r),z.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Oe(this.updatePoint)}}function ot(e,t){return t?{point:t(e.point)}:e}function lo(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Dt({point:e},t){return{point:e,delta:lo(e,si(t)),offset:lo(e,Rr(t)),velocity:Dr(t,.1)}}function Rr(e){return e[0]}function si(e){return e[e.length-1]}function Dr(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,o=null;const r=si(e);for(;s>=0&&(o=e[s],!(r.timestamp-o.timestamp>Ns(t)));)s--;if(!o)return{x:0,y:0};o===e[0]&&e.length>2&&r.timestamp-o.timestamp>Ns(t)*2&&(o=e[1]);const c=Yi(r.timestamp-o.timestamp);if(c===0)return{x:0,y:0};const n={x:(r.x-o.x)/c,y:(r.y-o.y)/c};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}function Lr(e,{min:t,max:s},o){return t!==void 0&&e<t?e=o?V(t,e,o.min):Math.max(e,t):s!==void 0&&e>s&&(e=o?V(s,e,o.max):Math.min(e,s)),e}function uo(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function Ar(e,{top:t,left:s,bottom:o,right:r}){return{x:uo(e.x,s,r),y:uo(e.y,t,o)}}function ho(e,t){let s=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,o]=[o,s]),{min:s,max:o}}function Vr(e,t){return{x:ho(e.x,t.x),y:ho(e.y,t.y)}}function Mr(e,t){let s=.5;const o=F(e),r=F(t);return r>o?s=Bt(t.min,t.max-o,e.min):o>r&&(s=Bt(e.min,e.max-r,t.min)),Do(0,1,s)}function Ir(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const _t=.35;function Br(e=_t){return e===!1?e=0:e===!0&&(e=_t),{x:mo(e,"left","right"),y:mo(e,"top","bottom")}}function mo(e,t,s){return{min:fo(e,t),max:fo(e,s)}}function fo(e,t){return typeof e=="number"?e:e[t]||0}const Or=new WeakMap;class _r{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=M(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:o}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const c=f=>{s&&this.snapToCursor(Oo(f).point),this.stopAnimation()},n=(f,m)=>{const{drag:x,dragPropagation:v,onDragStart:b}=this.getProps();if(x&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Pn(x),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Q(S=>{let w=this.getAxisMotionValue(S).get()||0;if(dt.test(w)){const{projection:P}=this.visualElement;if(P&&P.layout){const C=P.layout.layoutBox[S];C&&(w=F(C)*(parseFloat(w)/100))}}this.originPoint[S]=w}),b&&z.update(()=>b(f,m),!1,!0),Ls(this.visualElement,"transform");const{animationState:j}=this.visualElement;j&&j.setActive("whileDrag",!0)},a=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m;const{dragPropagation:x,dragDirectionLock:v,onDirectionLock:b,onDrag:j}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:S}=m;if(v&&this.currentDirection===null){this.currentDirection=zr(S),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",m.point,S),this.updateAxis("y",m.point,S),this.visualElement.render(),j&&z.update(()=>j(f,m),!1,!0)},u=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m,this.stop(f,m),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new ti(t,{onSessionStart:c,onStart:n,onMove:a,onSessionEnd:u,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:o,contextWindow:ei(this.visualElement),element:this.visualElement.current})}stop(t,s){const o=t||this.latestPointerEvent,r=s||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!r||!o)return;const{velocity:n}=r;this.startAnimation(n);const{onDragEnd:a}=this.getProps();a&&z.postRender(()=>a(o,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,o){const{drag:r}=this.getProps();if(!o||!it(t,r,this.currentDirection))return;const c=this.getAxisMotionValue(t);let n=this.originPoint[t]+o[t];this.constraints&&this.constraints[t]&&(n=Lr(n,this.constraints[t],this.elastic[t])),c.set(n)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;t&&Ae(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&o?this.constraints=Ar(o.layoutBox,t):this.constraints=!1,this.elastic=Br(s),r!==this.constraints&&!Ae(t)&&o&&this.constraints&&!this.hasMutatedConstraints&&Q(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=Ir(o.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!Ae(t))return!1;const o=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());const c=cn(o,r.root,this.visualElement.getTransformPagePoint());let n=Vr(r.layout.layoutBox,c);if(s){const a=s(ln(n));this.hasMutatedConstraints=!!a,a&&(n=un(a))}return n}startAnimation(t){const{drag:s,dragMomentum:o,dragElastic:r,dragTransition:c,dragSnapToOrigin:n,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},l=Q(d=>{if(!it(d,s,this.currentDirection))return;let f=u&&u[d]||{};(n===!0||n===d)&&(f={min:0,max:0});const m=r?200:1e6,x=r?40:1e7,v={type:"inertia",velocity:o?t[d]:0,bounceStiffness:m,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...c,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(l).then(a)}startAxisValueAnimation(t,s){const o=this.getAxisMotionValue(t);return Ls(this.visualElement,t),o.start(Bo(t,o,0,s,this.visualElement,!1))}stopAnimation(){Q(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps()[s];return r||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Q(s=>{const{drag:o}=this.getProps();if(!it(s,o,this.currentDirection))return;const{projection:r}=this.visualElement,c=this.getAxisMotionValue(s);if(r&&r.layout){const{min:n,max:a}=r.layout.layoutBox[s],u=c.get()||0;c.set(t[s]-V(n,a,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:o}=this.visualElement;if(!Ae(s)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Q(n=>{const a=this.getAxisMotionValue(n);if(a&&this.constraints!==!1){const u=a.get();r[n]=Mr({min:u,max:u},this.constraints[n])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.constraints=!1,this.resolveConstraints(),Q(n=>{if(!it(n,t,null))return;const a=this.getAxisMotionValue(n),{min:u,max:l}=this.constraints[n];a.set(V(u,l,r[n]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Or.set(this.visualElement,this);const t=this.visualElement.current,s=Ie(t,"pointerdown",l=>{const{drag:d,dragListener:f=!0}=this.getProps(),m=l.target,x=m!==t&&dn(m);d&&f&&!x&&this.start(l)});let o;const r=()=>{const{dragConstraints:l}=this.getProps();Ae(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),o||(o=Ur(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:c}=this.visualElement,n=c.addEventListener("measure",r);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),z.read(r);const a=Yt(window,"resize",()=>this.scalePositionWithinConstraints()),u=c.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:d})=>{this.isDragging&&d&&(Q(f=>{const m=this.getAxisMotionValue(f);m&&(this.originPoint[f]+=l[f].translate,m.set(m.get()+l[f].translate))}),this.visualElement.render())}));return()=>{a(),s(),n(),u&&u(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:c=!1,dragElastic:n=_t,dragMomentum:a=!0}=t;return{...t,drag:s,dragDirectionLock:o,dragPropagation:r,dragConstraints:c,dragElastic:n,dragMomentum:a}}}function po(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Ur(e,t,s){const o=Ms(e,po(s)),r=Ms(t,po(s));return()=>{o(),r()}}function it(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function zr(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class Fr extends _o{constructor(t){super(t),this.removeGroupControls=je,this.removeListeners=je,this.controls=new _r(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||je}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Lt=e=>(t,s)=>{e&&z.update(()=>e(t,s),!1,!0)};class $r extends _o{constructor(){super(...arguments),this.removePointerDownListener=je}onPointerDown(t){this.session=new ti(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ei(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:Lt(t),onStart:Lt(s),onMove:Lt(o),onEnd:(c,n)=>{delete this.session,r&&z.postRender(()=>r(c,n))}}}mount(){this.removePointerDownListener=Ie(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let At=!1;class Hr extends h.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:o,layoutId:r}=this.props,{projection:c}=t;c&&(s.group&&s.group.add(c),o&&o.register&&r&&o.register(c),At&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ut.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:o,drag:r,isPresent:c}=this.props,{projection:n}=o;return n&&(n.isPresent=c,t.layoutDependency!==s&&n.setOptions({...n.options,layoutDependency:s}),At=!0,r||t.layoutDependency!==s||s===void 0||t.isPresent!==c?n.willUpdate():this.safeToRemove(),t.isPresent!==c&&(c?n.promote():n.relegate()||z.postRender(()=>{const a=n.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:s}=this.props,{projection:o}=t;o&&(o.options.layoutAnchor=s,o.root.didUpdate(),Lo.postRender(()=>{!o.currentAnimation&&o.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:o}=this.props,{projection:r}=t;At=!0,r&&(r.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function oi(e){const[t,s]=Qo(),o=h.useContext(Mo);return i.jsx(Hr,{...e,layoutGroup:o,switchLayoutGroup:h.useContext(qi),isPresent:t,safeToRemove:s})}const Wr={pan:{Feature:$r},drag:{Feature:Fr,ProjectionNode:Zo,MeasureLayout:oi}},Gr={layout:{ProjectionNode:Zo,MeasureLayout:oi}},Yr={...mn,...hn,...Wr,...Gr},ii=Xi(Yr,fn),qr=new Set(["air-local","local","mini","node"]),Xr=new Set(["main","master","trunk"]);function Kr(e){return e.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,t=>Jr(t)).replace(/\b(session|conversation|message|flight|invocation|work)(?:\s+(?:id|ref))?\s*[:#]?\s+([a-z0-9][a-z0-9._:-]{9,})\b/gi,(t,s,o)=>`${s.toLowerCase()} ending in ${Ut(o)}`).replace(/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,t=>`ID ending in ${Ut(t)}`).replace(/@?([a-z][a-z0-9-]*(?:\.[a-z0-9][a-z0-9-]*){2,})\b/gi,(t,s)=>Zr(t)?t:Qr(s)).replace(/`([^`]+)`/g,(t,s)=>ea(s)).replace(/\s+/g," ").trim()}function Jr(e){try{return new URL(e).hostname.replace(/^www\./,"").replace(/\./g," dot ")}catch{return"link"}}function Zr(e){const t=e.replace(/^@/,"").toLowerCase();return/\.(com|app|dev|org|net|io|local)(?:\b|\/)/.test(t)&&!t.endsWith(".air-local")}function Qr(e){const t=e.split(".").filter(Boolean);if(t.length<2)return e;const s=[...t];for(;s.length>1&&qr.has(s.at(-1).toLowerCase());)s.pop();const[o,...r]=s,c=r.filter(n=>!Xr.has(n.toLowerCase())).map(zt).filter(Boolean);return[zt(o),...c].filter(Boolean).join(", ")}function ea(e){return/^[a-z0-9][a-z0-9._:-]{12,}$/i.test(e)?`ID ending in ${Ut(e)}`:zt(e)}function Ut(e){return(e.replace(/[^a-z0-9]/gi,"").slice(-4)||e.slice(-4)).split("").join(" ")}function zt(e){return e.replace(/^@/,"").replace(/[_./:-]+/g," ").replace(/\s+/g," ").trim()}function ta({state:e,chatExpanded:t,onToggleExpanded:s,sessionPickerOpen:o,onToggleSessionPicker:r,onStartNewChat:c,startingNewChat:n,onSwitchSession:a,switchingSessionId:u,sending:l,briefing:d,pendingAsk:f,onArchiveSession:m,archivingSessionId:x,onAssistantContextMenu:v,suggestedPrompts:b,onSelectPrompt:j}){const w=e.session.messages,P=t?w:w.slice(-4),C=t?0:Math.max(0,w.length-P.length),N=w.length,L=e.sessions.length,D=e.retention,y=w.length===0&&!f&&!l&&!d,T=n||l||d||!!u||!!x,I=e.session.createdAt?Bi(e.session.createdAt):null,A=y?"Scout conversation":e.session.title&&e.session.title!=="New Scout Session"?e.session.title:`Session ${e.session.id.slice(0,8)}`,B=h.useRef(null),q=w[w.length-1]?.id??null,ee=w[w.length-1]?.body??"";return h.useEffect(()=>{const R=B.current;R&&(R.scrollTop=R.scrollHeight)},[q,ee,f,l,t,e.session.id]),i.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:[i.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:[i.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsx("span",{className:"min-w-0 truncate text-[var(--scout-chrome-ink)]",title:e.session.id,children:A}),I&&!y&&i.jsxs("span",{className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]",children:["· ",I]}),!y&&i.jsxs("span",{className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]",children:["· ",N," msg",N===1?"":"s"]})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsxs("button",{type:"button",title:"Start a new chat (keeps this chat in Chats)","aria-label":"Start new chat",onClick:c,disabled:T,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:[n?i.jsx(re,{size:10,className:"animate-spin"}):i.jsx(Co,{size:10}),i.jsx("span",{children:n?"Starting":"New chat"})]}),i.jsxs("button",{type:"button",title:`Switch chat (${L} total)`,"aria-label":"Switch chat",onClick:r,className:`flex items-center gap-1 rounded border px-1.5 py-0.5 text-2xs uppercase tracking-[0.1em] transition-colors ${o?"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:[i.jsx(wi,{size:10}),i.jsx("span",{children:"Chats"}),i.jsx("span",{className:"text-[var(--scout-chrome-ink-ghost)]",children:L}),i.jsx(Mt,{size:9,className:o?"rotate-180 transition-transform":"transition-transform"})]}),N>4&&i.jsxs("button",{type:"button",title:t?"Collapse chat":"View full session","aria-label":t?"Collapse chat":"View full session",onClick:s,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:[i.jsx("span",{children:t?"Collapse":"Full"}),t?i.jsx(_i,{size:9}):i.jsx(Mt,{size:9})]})]})]}),o&&i.jsxs("div",{className:"shrink-0 border-b border-[var(--scout-chrome-border-soft)] px-2 py-1.5",children:[i.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:[i.jsx("span",{children:"Recent chats"}),D&&D.archivedCount>0&&i.jsxs("span",{children:[D.archivedCount," archived"]})]}),i.jsx("div",{className:"flex max-h-40 flex-col gap-0.5 overflow-y-auto pr-0.5",children:e.sessions.map(R=>{const X=R.id===e.session.id,ae=u===R.id,K=x===R.id,_=Es(R.updatedAt)||"unknown",$=R.title&&R.title!=="New Scout Session"?R.title:`Session ${R.id.slice(0,8)}`;return i.jsxs("div",{className:`flex items-center gap-2 rounded border px-2 py-1 text-left transition-colors ${X?"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:[i.jsxs("button",{type:"button",onClick:()=>{X||a(R.id)},disabled:X||!!u||!!x,className:"flex min-w-0 flex-1 items-center gap-2 text-left disabled:cursor-not-allowed disabled:opacity-40",children:[i.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${X?"bg-lime-300":"bg-[var(--scout-chrome-ink-ghost)]"}`}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-[var(--scout-chrome-ink)]",children:$}),i.jsxs("span",{className:"shrink-0 text-2xs text-[var(--scout-chrome-ink-ghost)]",children:[R.messageCount," msg"]}),i.jsx("span",{className:"shrink-0 text-2xs text-[var(--scout-chrome-ink-ghost)]",children:_}),ae&&i.jsx(re,{size:10,className:"shrink-0 animate-spin text-lime-200"})]}),i.jsx("button",{type:"button",title:"Archive chat","aria-label":`Archive chat ${$}`,onClick:()=>m(R.id),disabled:!!u||!!x,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:K?i.jsx(re,{size:10,className:"animate-spin"}):i.jsx(Sn,{size:10})})]},R.id)})})]}),i.jsxs("div",{ref:B,className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-2.5 py-2",children:[C>0&&i.jsxs("button",{type:"button",onClick:s,className:"self-start text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)] hover:text-[var(--scout-chrome-ink)]",children:["↑ ",C," earlier message",C===1?"":"s"]}),y&&i.jsx(sa,{suggestedPrompts:b,onSelectPrompt:j}),P.map((R,X)=>{const ae=na(P[X-1],R),K=ra(R.createdAt);return i.jsxs("div",{className:"flex flex-col gap-1",children:[ae&&i.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:Es(R.createdAt),"aria-label":K,children:K}),i.jsx(xo,{role:R.role,body:R.body,onContextMenu:R.role==="assistant"&&v?_=>v(_,R.body):void 0})]},R.id)}),f&&i.jsx(xo,{role:"user",body:f,pending:!0}),l&&!f&&i.jsx("p",{className:"text-[var(--scout-chrome-ink-ghost)]",children:"Reading the control plane…"}),d&&i.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:[i.jsx(re,{size:12,className:"shrink-0 animate-spin text-lime-300","aria-hidden":"true"}),i.jsxs("div",{className:"min-w-0 flex flex-col gap-0.5",children:[i.jsx("span",{className:"text-xs uppercase tracking-[0.14em] text-lime-300",children:"Briefing"}),i.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:"Codex is reviewing the control-plane snapshot. Voice will pick up when it lands."})]})]})]})]})}function sa({suggestedPrompts:e=[],onSelectPrompt:t}){return i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col justify-start gap-2 px-1 py-2.5",children:[e.length>0?i.jsx("div",{className:"grid gap-1",children:e.slice(0,3).map(s=>i.jsx("button",{type:"button",onClick:()=>t?.(s),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:s},s))}):null,i.jsxs("div",{className:"max-w-[30rem]",children:[i.jsx("div",{className:"font-sans text-lg font-semibold leading-tight text-[var(--scout-chrome-ink)]",children:"Start with a question."}),i.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 oa({agents:e,draft:t,onDraftChange:s,onSubmit:o,sending:r,recording:c,voiceLabel:n,voiceBusy:a,voiceUnavailable:u,voiceHeld:l=!1,onMicClick:d,prominent:f=!1,autoFocus:m,focusSignal:x}){const v=h.useRef(null),b=h.useCallback(()=>{const P=v.current;P&&(P.textarea?P.textarea.focus({preventScroll:!0}):P.focus())},[]);h.useEffect(()=>{m&&b()},[m,b]),h.useEffect(()=>{x&&b()},[x,b]);let j="Start talking";u&&(j="Set up Scout voice"),c&&(j="Stop talking"),(a||l)&&(j=n);const S=a||c||l,w=["w-full resize-none rounded border font-mono text-sm leading-relaxed text-[var(--scout-chrome-ink)] placeholder:text-[var(--scout-chrome-ink-ghost)]",f?"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 i.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:P=>{P.preventDefault(),o()},children:[i.jsx(ji,{ref:v,agents:e,value:t,onChange:s,onSubmit:()=>{t.trim()&&!r&&o()},placeholder:l?"Type while live voice is on…":f?"Ask Scout about what you are seeing…":"Ask Scout…",rows:f?4:2,disabled:r,submitOnEnter:!0,className:"min-w-0",textareaClassName:w}),i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("button",{type:"button",title:j,"aria-label":j,onClick:d,disabled:r||a||l,className:`flex h-8 items-center justify-center rounded border transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${c?"border-lime-300/50 bg-lime-300/10 text-lime-200":l?"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)]"} ${S?"gap-1.5 px-3 font-mono text-xs uppercase tracking-[0.12em]":"w-9"}`,children:[a?i.jsx(re,{size:13,className:"animate-spin"}):c?i.jsx(Po,{size:12,className:"fill-current"}):i.jsx(Eo,{size:13}),S&&i.jsx("span",{className:"truncate",children:n})]}),i.jsx("button",{type:"submit",title:"Send","aria-label":"Send",disabled:!t.trim()||r,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:r?i.jsx(re,{size:13,className:"animate-spin"}):i.jsx(Ui,{size:13})})]})]})}function xo({role:e,body:t,pending:s=!1,onContextMenu:o}){const r=e==="user",c=r?t:Se(t),[n,a]=h.useState(!1),u=h.useCallback(()=>{rt(c).then(()=>{a(!0),window.setTimeout(()=>a(!1),1200)}).catch(()=>{})},[c]);return i.jsxs("div",{className:"group flex flex-col gap-0.5",onContextMenu:o,children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("span",{className:`text-2xs uppercase tracking-[0.12em] ${r?"text-[var(--scout-chrome-ink-ghost)]":"text-lime-300"}`,children:[r?"You":"Reply",s&&" · sending"]}),i.jsx("button",{type:"button",title:n?"Copied":"Copy message","aria-label":n?"Copied message":"Copy message",disabled:s||!c.trim(),onClick:u,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:n?i.jsx(wn,{size:11}):i.jsx(zi,{size:11})})]}),r?i.jsx("p",{className:`whitespace-pre-wrap break-words text-sm leading-relaxed text-[var(--scout-chrome-ink)] ${s?"opacity-60":""}`,children:c}):i.jsx("div",{className:s?"opacity-60":"",children:i.jsx(Oi,{text:c})})]})}const ia=5*6e4;function na(e,t){if(!e||!Ft(e.createdAt,t.createdAt))return!0;const s=Be(e.createdAt),o=Be(t.createdAt);return s===null||o===null?!0:Math.abs(o-s)>=ia}function Ft(e,t){const s=Be(e),o=Be(t);if(s===null||o===null)return!1;const r=new Date(s),c=new Date(o);return r.getFullYear()===c.getFullYear()&&r.getMonth()===c.getMonth()&&r.getDate()===c.getDate()}function ra(e){const t=Be(e);if(t===null)return"";const s=new Date(t),o=new Date,r=new Date(o);r.setDate(o.getDate()-1);const c=s.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return Ft(t,o.getTime())?`Today ${c}`:Ft(t,r.getTime())?`Yesterday ${c}`:s.getFullYear()===o.getFullYear()?`${s.toLocaleDateString([],{month:"short",day:"numeric"})} ${c}`:`${s.toLocaleDateString([],{month:"short",day:"numeric",year:"numeric"})} ${c}`}const aa={"--scout-chrome-bg":"#f3f0e9","--scout-chrome-ink":"#2a2d2f","--scout-chrome-ink-strong":"#171a1c","--scout-chrome-ink-faint":"#6f716e","--scout-chrome-ink-ghost":"#9b9a94","--scout-chrome-border-soft":"#d9d4ca","--scout-chrome-hover":"#e9e5dc","--scout-chrome-active":"#ded8cc","--scout-accent":"#b58a3f"},go=[2,4,7,5,3,6,9,5,3,4,8,6,3,5,9,6,3,5,7,4,2,4,6,3],ca=go.map((e,t)=>{const s=t/go.length*Math.PI*2-Math.PI/2,o=24-e/2,r=24+e/2;return{x1:36+Math.cos(s)*o,y1:36+Math.sin(s)*o,x2:36+Math.cos(s)*r,y2:36+Math.sin(s)*r}});function la({recording:e,sending:t,speaking:s,voiceAvailable:o,voiceProbeState:r,voiceState:c}){return s?"speaking":t?"thinking":e&&c==="processing"?"processing":e?"listening":r!=="idle"||c==="starting"||o===null?"checking":o===!1?"unavailable":"ready"}const ua={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 da(e){switch(e){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"Transcribing voice turn";case"thinking":return"Scout is thinking";case"ready":return"Start voice turn"}}function ha(e){return e==="listening"||e==="processing"?"listen":e==="thinking"?"think":e==="speaking"?"speak":null}function ma({phase:e,disabled:t,onClick:s}){const o=Io(),r=e==="listening"||e==="speaking",c=da(e);return i.jsx(ii.div,{animate:r&&!o?{scale:[1,1.025,1]}:{scale:1},transition:r&&!o?{duration:2.2,ease:"easeInOut",repeat:1/0}:{duration:.18},children:i.jsx("button",{type:"button",onClick:s,disabled:t,"aria-label":c,title:c,className:"group grid h-28 w-28 place-items-center rounded-full border border-[#d4cfc5] bg-white text-[#232729] shadow-[0_14px_34px_rgba(55,48,38,0.12)] outline-none transition-[border-color,box-shadow,transform] duration-200 hover:border-[#b9b2a6] hover:shadow-[0_17px_38px_rgba(55,48,38,0.16)] focus-visible:ring-2 focus-visible:ring-[#9c7736] focus-visible:ring-offset-4 focus-visible:ring-offset-[#f3f0e9] active:scale-[0.98] disabled:cursor-wait disabled:opacity-65",children:i.jsxs("svg",{viewBox:"0 0 72 72",className:"h-[72px] w-[72px]","aria-hidden":"true",children:[i.jsx("circle",{cx:"36",cy:"36",r:"24",fill:"none",stroke:"#d2cec6",strokeWidth:"0.8"}),ca.map((n,a)=>i.jsx("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:r?"#817b71":"#a5a198",strokeWidth:"1.15",strokeLinecap:"round"},a)),i.jsx("circle",{cx:"36",cy:"36",r:"7.5",fill:r?"#b98a3b":"#d3b16d"})]})})})}const fa=[{id:"listen",label:"Listen"},{id:"think",label:"Think"},{id:"speak",label:"Speak"}];function pa({messages:e,pendingAsk:t,partial:s,error:o,status:r,recording:c,sending:n,speaking:a,voiceAvailable:u,voiceInputSource:l,voiceProbeState:d,voiceState:f,voiceReplies:m,settingsOpen:x,setupPanel:v,settingsPanel:b,assistantModel:j,onPrimaryAction:S,onToggleVoiceReplies:w,onToggleSettings:P,onNewChat:C,onOpenLive:N}){const L=Io(),D=h.useRef(null),y=la({recording:c,sending:n,speaking:a,voiceAvailable:u,voiceProbeState:d,voiceState:f}),T=ua[y],I=y==="checking"||y==="processing"||y==="thinking",A=l??(u===!0?"Default input from Scout Menu":"Checking microphone…"),B=e.slice(-12),q=s||(n&&B.at(-1)?.body!==t?t:null),ee=B.length===0&&!q,R=ha(y),X=j?.trim()||"Turn-based voice",ae=u===!1?"Mic offline":u===null?"Checking mic":"Mic active",K=y==="unavailable"?"bg-[#a25549]":y==="ready"||y==="checking"?"bg-[#a7a49d]":"bg-[#b58a3f]";return h.useEffect(()=>{D.current?.scrollIntoView({block:"nearest"})},[e.length,t]),i.jsxs("section",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden bg-[#f3f0e9] text-[#2a2d2f]",style:aa,"aria-label":"Direct voice conversation",children:[i.jsxs("header",{className:"flex min-h-14 shrink-0 items-center justify-between gap-2 border-b border-[#d9d4ca] px-3 py-2.5 sm:gap-4 sm:px-7",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[i.jsx("h1",{className:"truncate font-[var(--font-accent-title)] text-[15px] font-semibold tracking-[-0.018em] text-[#171a1c] sm:text-[17px]",children:"Direct Voice"}),i.jsx("span",{className:"hidden h-4 w-px bg-[#d6d1c7] sm:block","aria-hidden":"true"}),i.jsxs("div",{className:"hidden min-w-0 items-center gap-2 sm:flex","aria-live":"polite",children:[i.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${K}`,"aria-hidden":"true"}),i.jsx("span",{className:"truncate text-xs text-[#6f716e]",children:T.label})]})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 sm:gap-2",children:[i.jsxs("div",{className:"flex rounded-md border border-[#cbc5ba] bg-[#e8e3da] p-0.5",role:"tablist","aria-label":"Voice mode",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":"true",className:"rounded-[4px] bg-[#202426] px-2 py-1.5 text-[11px] font-medium text-white shadow-[0_1px_2px_rgba(0,0,0,0.14)] sm:px-3",children:"Direct"}),i.jsx("button",{type:"button",role:"tab","aria-selected":"false",onClick:N,disabled:!N,className:"rounded-[4px] px-2 py-1.5 text-[11px] font-medium text-[#6a6c69] transition-colors hover:bg-white/65 hover:text-[#232628] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#9c7736] disabled:cursor-default disabled:opacity-45 sm:px-3",children:"Live"})]}),i.jsxs("button",{type:"button",onClick:C,className:"hidden h-8 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-[#4f5352] transition-colors hover:bg-[#e7e2d9] hover:text-[#191c1e] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#9c7736] min-[430px]:flex sm:px-2.5","aria-label":"Start a new voice conversation",title:"New conversation",children:[i.jsx(Co,{size:14,"aria-hidden":"true"}),i.jsx("span",{className:"hidden md:inline",children:"New chat"})]}),i.jsx("button",{type:"button",onClick:w,className:`grid h-8 w-8 place-items-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#9c7736] ${m?"bg-[#e1d5bd] text-[#765923]":"text-[#6e706d] hover:bg-[#e7e2d9] hover:text-[#191c1e]"}`,"aria-pressed":m,"aria-label":m?"Mute spoken replies":"Enable spoken replies",title:m?"Spoken replies on":"Spoken replies off",children:m?i.jsx(Uo,{size:15}):i.jsx(zo,{size:15})}),i.jsx("button",{type:"button",onClick:P,className:`grid h-8 w-8 place-items-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#9c7736] ${x?"bg-[#e1d5bd] text-[#765923]":"text-[#6e706d] hover:bg-[#e7e2d9] hover:text-[#191c1e]"}`,"aria-expanded":x,"aria-label":"Voice and Scoutbot settings",title:"Voice and Scoutbot settings",children:i.jsx(Ci,{size:15})})]})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i.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:i.jsxs("div",{className:"w-full max-w-[720px]",children:[ee?i.jsxs("div",{className:"pt-1",children:[i.jsx("p",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[#8b8983]",children:"Conversation"}),i.jsx("p",{className:"mt-2 max-w-[38ch] text-sm leading-6 text-[#737570]",children:"Your voice turns and Scout’s replies will appear here."})]}):i.jsxs("div",{className:"space-y-8 sm:space-y-9",children:[B.map(_=>{const $=_.role==="assistant";return i.jsxs("article",{className:"max-w-[68ch]",children:[i.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[i.jsx("span",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[#575a59]",children:$?"Scout":"You"}),$&&i.jsx("span",{className:"text-[10px] text-[#8a8983]",children:X})]}),i.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-[15px] leading-6 text-[#25292a] sm:text-base sm:leading-7",children:$?Se(_.body):_.body})]},_.id)}),q&&i.jsxs("article",{className:"max-w-[68ch]","aria-live":"polite",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[#765923]",children:"You"}),i.jsx("span",{className:"text-[10px] text-[#9a7a40]",children:s?"Listening":"Sending"})]}),i.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-[15px] leading-6 text-[#25292a] sm:text-base sm:leading-7",children:q})]})]}),i.jsx("div",{ref:D})]})})}),i.jsx(Tr,{initial:!1,children:(v||x||o)&&i.jsx(ii.div,{initial:L?!1:{opacity:0,y:6},animate:{opacity:1,y:0},exit:L?void 0:{opacity:0,y:6},className:"max-h-[34vh] shrink-0 overflow-y-auto border-y border-[#d9d4ca] bg-[#eeeae2]",children:i.jsxs("div",{className:"mx-auto w-full max-w-[880px] px-6 py-4 sm:px-10 lg:px-14",children:[o&&i.jsx("p",{className:"mb-3 text-sm leading-6 text-[#93483f]",children:o}),v,x&&b]})})}),i.jsxs("div",{className:"shrink-0 px-5 pb-4 pt-3 sm:px-8 sm:pb-5",children:[i.jsxs("div",{className:"flex flex-col items-center text-center",children:[i.jsx(ma,{phase:y,disabled:I,onClick:S}),i.jsxs("div",{className:"mt-3","aria-live":"polite",children:[i.jsx("p",{className:"text-sm font-semibold text-[#24282a]",children:T.label}),i.jsx("p",{className:"mt-0.5 text-xs text-[#7a7b76]",children:T.helper})]}),i.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-[#7b6a49]",children:[i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#b58a3f]","aria-hidden":"true"}),i.jsx("span",{children:ae})]})]}),i.jsxs("footer",{className:"mx-auto mt-4 flex w-full max-w-[880px] flex-col items-stretch justify-between gap-2 border-t border-[#d9d4ca] pt-3 text-[11px] text-[#747570] sm:flex-row sm:items-center sm:gap-4",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx(Eo,{size:12,className:"shrink-0 text-[#8b7350]","aria-hidden":"true"}),i.jsxs("span",{className:"truncate",children:["Input: ",A]})]}),i.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 sm:justify-start","aria-label":`Voice turn state: ${T.label}`,children:fa.map(_=>{const $=R===_.id;return i.jsx("span",{className:$?"font-medium text-[#5e4821]":"text-[#96948e]",children:_.label},_.id)})}),r&&!n&&y!=="listening"&&i.jsx("span",{className:"hidden max-w-48 truncate text-right text-[#96948e] lg:block",children:r})]})]})]})}function vo({icon:e,title:t,onClick:s,disabled:o,active:r,badge:c}){return i.jsxs("button",{type:"button",title:t,"aria-label":t,onClick:s,disabled:o,className:`flex shrink-0 items-center gap-1 rounded border p-1 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${r?"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:[e,c&&i.jsx("span",{className:"font-mono text-3xs tracking-tight",children:c})]})}function yo({issue:e,probeState:t,onLaunch:s,onRetry:o,onSettings:r,onDismiss:c}){const n=t==="probing"||t==="launching";return i.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:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(As,{size:13,className:"mt-0.5 shrink-0 text-[var(--scout-chrome-ink-faint)]"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"uppercase tracking-[0.14em] text-[var(--scout-chrome-ink-faint)]",children:"Scout Voice"}),i.jsx("p",{className:"mt-1 leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"Open Scout Menu to use speech."}),e&&i.jsx("p",{className:"mt-2 break-words leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:e})]}),c?i.jsx("button",{type:"button",title:"Hide voice setup","aria-label":"Hide voice setup",onClick:c,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:i.jsx(pn,{size:11})}):null]}),i.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-1.5",children:[i.jsx(Vt,{icon:t==="launching"?i.jsx(re,{size:12,className:"animate-spin"}):i.jsx(As,{size:12}),label:t==="launching"?"Opening":"Open",onClick:s,disabled:t==="probing",title:"Open Scout services"}),i.jsx(Vt,{icon:t==="probing"?i.jsx(re,{size:12,className:"animate-spin"}):i.jsx(xn,{size:12}),label:"Retry",onClick:o,disabled:n,title:"Check Scout voice again"}),i.jsx(Vt,{icon:i.jsx(gn,{size:12}),label:"Voice",onClick:r,disabled:t==="probing",title:"Open Scoutbot voice settings"})]})]})}function Vt({icon:e,label:t,onClick:s,disabled:o,title:r}){return i.jsxs("button",{type:"button",title:r,onClick:s,disabled:o,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:[e,t]})}const Ve="gpt-4o-mini-tts",xa={openai:"OpenAI",elevenlabs:"ElevenLabs",nvidia:"NVIDIA",system:"System"},$t="us-woman",mt=[{id:"us-woman",label:"US Woman",locale:"US English",presentation:"Woman",voiceName:"Marin",description:"Warm, clear, and conversational.",provider:"openai",accentFromPrompt:!1,speech:{modelId:Ve,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:Ve,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:Ve,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:Ve,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."}}],Ce={modelId:Ve,voiceId:"marin",instructions:"Speak naturally, clearly, and conversationally."},ga={modelId:"",voiceId:"",instructions:"",playback:"host"};function va(e){return e==="custom"||e==="device"||mt.some(t=>t.id===e)}function ya(e,t={}){return e==="device"?ga:e==="custom"?{modelId:t.modelId?.trim()||Ce.modelId,voiceId:t.voiceId?.trim()||Ce.voiceId,instructions:t.instructions?.trim()||Ce.instructions}:mt.find(s=>s.id===e)?.speech??mt.find(s=>s.id===$t).speech}function bo({presentation:e,voicePresetId:t,onVoicePresetId:s,speechSelectionId:o,onSpeechSelectionId:r,customSpeechModelId:c,onCustomSpeechModelId:n,customSpeechVoiceId:a,onCustomSpeechVoiceId:u,customSpeechInstructions:l,onCustomSpeechInstructions:d,voiceDefaults:f,modelDraft:m,onModelDraft:x,modelOptions:v=[],promptDraft:b,onPromptDraft:j,configLoading:S,configSaving:w,configError:P,configStatus:C,onSave:N,onReload:L}){const D=e==="direct-voice";return i.jsx("div",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--hud-surface)] p-3",children:i.jsxs("div",{className:"flex flex-col gap-3",children:[D?i.jsxs("fieldset",{className:"flex flex-col gap-2",children:[i.jsx("legend",{className:"mb-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Scout voice"}),i.jsx("div",{className:"grid grid-cols-2 gap-2",role:"radiogroup","aria-label":"Scout voice",children:mt.map(y=>{const T=o===y.id;return i.jsxs("button",{type:"button",role:"radio","aria-checked":T,onClick:()=>r(y.id),className:`min-h-20 rounded border p-2.5 text-left transition ${T?"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:[i.jsx("span",{className:"block font-mono text-xs font-bold uppercase tracking-[0.1em]",children:y.label}),i.jsxs("span",{className:"mt-1 block font-mono text-2xs leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:[y.voiceName," · ",y.description]}),i.jsxs("span",{className:"mt-1 block font-mono text-2xs leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:[xa[y.provider]," · ",y.speech.modelId," · ",y.speech.voiceId]}),y.accentFromPrompt&&i.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."})]},y.id)})}),i.jsxs("button",{type:"button",role:"radio","aria-checked":o==="device",onClick:()=>r("device"),className:`rounded border px-2.5 py-2 text-left font-mono text-xs transition ${o==="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:[i.jsx("span",{className:"font-bold uppercase tracking-[0.1em]",children:"This Mac's voice"}),i.jsx("span",{className:"ml-2 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."})]}),i.jsxs("button",{type:"button",role:"radio","aria-checked":o==="custom",onClick:()=>r("custom"),className:`rounded border px-2.5 py-2 text-left font-mono text-xs transition ${o==="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:[i.jsx("span",{className:"font-bold uppercase tracking-[0.1em]",children:"Custom voice"}),i.jsx("span",{className:"ml-2 text-[var(--scout-chrome-ink-ghost)]",children:"Use any supported model, voice, and style."})]}),o==="custom"&&i.jsxs("div",{className:"grid gap-2 rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] p-2.5",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.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",i.jsx("input",{value:c,onChange:y=>n(y.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)]"})]}),i.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",i.jsx("input",{value:a,onChange:y=>u(y.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)]"})]})]}),i.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",i.jsx("textarea",{value:l,onChange:y=>d(y.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)]"})]})]}),i.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."})]}):i.jsxs(i.Fragment,{children:[i.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",i.jsx("select",{value:t,onChange:y=>s(y.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:Vs.map(y=>i.jsxs("option",{value:y.id,children:[y.label," — ",y.family]},y.id))}),i.jsx("span",{className:"font-mono text-2xs normal-case leading-relaxed tracking-normal text-[var(--scout-chrome-ink-ghost)]",children:Vs.find(y=>y.id===t)?.description??"Custom voice mood for spoken replies."})]}),i.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",i.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:f?`${f.modelId}${f.voiceId?` / ${f.voiceId}`:""}`:"Unavailable"})]})]}),i.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",v.length>0?i.jsx("select",{value:m,onChange:y=>x(y.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:S||w,children:v.map(y=>i.jsx("option",{value:y.id,children:y.label},y.id))}):i.jsx("input",{value:m,onChange:y=>x(y.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:S||w})]}),i.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",i.jsx("textarea",{value:b,onChange:y=>j(y.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:S||w})]}),P&&i.jsx("div",{className:"font-mono text-xs leading-relaxed text-[var(--hud-status-error)]",children:P}),C&&i.jsx("div",{className:"font-mono text-xs leading-relaxed text-[var(--hud-accent)]",children:C}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:N,disabled:S||w||!b.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:[(S||w)&&i.jsx(re,{size:13,className:"animate-spin"}),w?"Saving":"Save"]}),i.jsx("button",{type:"button",onClick:L,disabled:S||w,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 ba="chill-dispatcher",Sa=6e4,ka=2500,wa=1.2,ja={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 Ca(e){const t=Math.min(1,e/8);return{saturationAmount:.035+t*.025,presencePeakDb:1.5+t*1.5}}function Pa(e,t){return{...e==="chill-dispatcher"?ja:{},...Ca(t)}}function ni(e,t,s){return new Promise((o,r)=>{const c=window.setTimeout(()=>r(new Error(s)),t);e.then(o,r).finally(()=>window.clearTimeout(c))})}async function nt(e,t={}){!e.sessionId&&!t.allowCurrentSession||await ni(e.cancel(),ka,"Timed out releasing Scout voice session.").catch(()=>{})}function Ea(e){const t=e instanceof Error?e.message:String(e);return/session_cancelled|was cancelled|cancelled/i.test(t)}const So=new RegExp("(?:^|(?<=[\\s(`'\"<>]))(?:~\\/|\\/(?:Users|home|opt|var|etc|tmp|private)\\/)[^\\s)`'\"<>]+\\.[A-Za-z0-9]{1,8}\\b","g");function Ta(e){const t=[],s=new Set;So.lastIndex=0;let o;for(;(o=So.exec(e))!==null;)s.has(o[0])||(s.add(o[0]),t.push(o[0]));return t}function ko(e){const t=e.split("/").filter(Boolean);return t.length<=2?e:`…/${t.slice(-2).join("/")}`}function Na(){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 Ra=["Explain what went wrong here.","Help me rewrite this message.","What should I try next?"];function Da({height:e,forceExpanded:t=!1,fill:s=!1,presentation:o="chat",onOpenLive:r}={}){const{applyScoutbotUiAction:c,agents:n,route:a,onlineCount:u}=ks(),l=bi(),d=Ht(Wt,!0),f=Gt(),m=d&&(f.state==="connecting"||f.state==="live"),[x,v]=Cs("openscout.scoutbot.collapsed",!0),[b,j]=h.useState(""),[S,w]=h.useState(!1),[P,C]=h.useState(null),[N,L]=h.useState(null),[D,y]=h.useState(null),[T,I]=h.useState("idle"),[A,B]=Cs("openscout.scoutbot.voiceReplies",!1),[q]=Ni("openscout.scoutbot.voiceSpeed",wa),[ee,R]=Le("openscout.scoutbot.voicePresetId",ba),[X,ae]=Le("openscout.scoutbot.speechProfileId",$t),[K,_]=Le("openscout.scoutbot.customSpeechModelId",Ce.modelId),[$,Xt]=Le("openscout.scoutbot.customSpeechVoiceId",Ce.voiceId),[_e,Kt]=Le("openscout.scoutbot.customSpeechInstructions",Ce.instructions),[te,Ue]=h.useState(!1),[pt,le]=h.useState(null),[xt,Pe]=h.useState(""),[se,gt]=h.useState(!1),[ai,Jt]=h.useState(null),[Zt,vt]=h.useState(null),[Va,ze]=h.useState(null),[yt,H]=h.useState(null),[de,Ee]=h.useState(!1),[ci,Fe]=h.useState(!1),[Y,he]=h.useState(null),[me,Qt]=h.useState(!1),[bt,es]=h.useState(null),[ts,ss]=h.useState(!1),[os,is]=h.useState(!1),[ns,$e]=h.useState(null),[rs,St]=h.useState(null),[He,We]=h.useState(""),[as,cs]=h.useState([]),[Ge,Ye]=h.useState(""),[ls,us]=h.useState(null),[li,fe]=h.useState(!1),[ui,pe]=h.useState(0),[di,qe]=h.useState(!1),[kt,ds]=h.useState(null),Xe=va(X)?X:$t,Te=h.useMemo(()=>ya(Xe,{modelId:K,voiceId:$,instructions:_e}),[_e,K,$,Xe]),Ke=h.useRef(Di()),xe=h.useRef(!1),oe=h.useRef(null),ge=h.useRef(null),ue=h.useRef(null),Je=h.useRef(A);Je.current=A,h.useEffect(()=>{o==="direct-voice"&&(Je.current=!0,B(!0))},[o,B]),h.useEffect(()=>(xe.current=!0,()=>{xe.current=!1,ge.current="discard";const p=oe.current;oe.current=null,p&&nt(p,{allowCurrentSession:!0}),ue.current?.stop(),ue.current=null}),[]);const O=h.useCallback(()=>{ue.current?.stop(),ue.current=null,gt(!1)},[]),Ze=h.useCallback(p=>{if(!p)return;O();const g=Kr(p),k=o==="direct-voice"?Li(g,{speed:q,modelId:Te.modelId,voiceId:Te.voiceId,instructions:Te.instructions,playback:Te.playback}):Ai(g,{speed:q,presetId:ee,params:Pa(ee,u)});ue.current=k,gt(!0),k.promise.catch(E=>{Vi(E)||console.warn("[scoutbot] reply speech unavailable",{message:E instanceof Error?E.message:String(E)})}).finally(()=>{ue.current===k&&(ue.current=null,gt(!1))})},[O,q,Te,u,o,ee]),hs=h.useCallback(p=>{Je.current&&Ze(p)},[Ze]),ms=h.useCallback(p=>{Ze(Se(p))},[Ze]),{openFilePreview:fs}=ks(),ps=Si(),hi=h.useCallback((p,g)=>{const k=window.getSelection()?.toString().trim(),E=Se(g),U=Ta(E),W=[];if(k&&(W.push({kind:"action",label:"Copy selection",shortcut:"⌘C",onSelect:()=>{rt(k)}}),W.push({kind:"separator"})),W.push({kind:"action",label:"Copy message",onSelect:()=>{rt(E)}}),U.length>0){W.push({kind:"separator"});for(const ce of U.slice(0,5)){const wt=ko(ce);W.push({kind:"action",label:`Preview ${wt}`,onSelect:()=>fs(ce)})}for(const ce of U.slice(0,5)){const wt=ko(ce);W.push({kind:"action",label:`Open ${wt} in OS`,onSelect:()=>{Z("/api/file/reveal",{method:"POST",body:JSON.stringify({path:ce})}).catch(()=>{})}})}W.push({kind:"action",label:U.length===1?"Copy path":"Copy first path",onSelect:()=>{rt(U[0])}})}W.push({kind:"separator"}),W.push({kind:"action",label:se?"Say again (stop current)":"Say",onSelect:()=>ms(g)}),ps(p,W)},[fs,ms,ps,se]);h.useEffect(()=>()=>{O()},[O]);const mi=Ra,ve=h.useCallback(p=>{const g=[...p.messages].reverse().find(E=>E.role==="user"),k=[...p.messages].reverse().find(E=>E.role==="assistant");vt(g?.body??null),ze(k?Se(k.body):null)},[]),Ne=h.useCallback(async()=>{try{const p=await Z("/api/scoutbot/session");he(p),ve(p.session)}catch{he(null)}},[ve]);h.useEffect(()=>{Ne()},[Ne]);const Qe=h.useCallback(async()=>{ss(!0),$e(null);try{const p=await Z("/api/scoutbot/config");We(p.model),cs(p.modelOptions??[]),Ye(p.systemPrompt),St(null)}catch(p){$e(p instanceof Error?p.message:"Could not load settings.")}finally{ss(!1)}},[]);h.useEffect(()=>{de&&Qe()},[Qe,de]),h.useEffect(()=>{if(!de)return;let p=!1;return Z("/api/voice/defaults").then(g=>{p||us(g)}).catch(()=>{p||us(null)}),()=>{p=!0}},[de]);const xs=h.useCallback(async()=>{is(!0),$e(null),St(null);try{const p=await Z("/api/scoutbot/config",{method:"POST",body:JSON.stringify({model:He,systemPrompt:Ge})});We(p.config.model),cs(p.config.modelOptions??[]),Ye(p.config.systemPrompt),St("Saved")}catch(p){$e(p instanceof Error?p.message:"Could not save settings.")}finally{is(!1)}},[He,Ge]),fi=h.useCallback(async p=>{if(!(!p||kt)){ds(p),C(null),O();try{const g=await Z("/api/scoutbot/session/switch",{method:"POST",body:JSON.stringify({id:p})});he(g),ve(g.session),qe(!1),fe(!1),window.dispatchEvent(new CustomEvent(De,{detail:{id:g.session.id}}))}catch(g){C(g instanceof Error?g.message:"Could not switch session.")}finally{ds(null)}}},[O,kt,ve]),et=h.useCallback(async()=>{if(!(me||S)){if(Y?.session.messages.length===0){j(""),C(null),fe(!1),qe(!1),H("New chat ready"),pe(p=>p+1);return}Qt(!0),C(null),H("Starting new chat"),O();try{const p=await Z("/api/scoutbot/session/reset",{method:"POST"});he(p),j(""),vt(null),ze(null),fe(!1),qe(!1),H("New chat ready"),pe(g=>g+1),window.dispatchEvent(new CustomEvent(De,{detail:{id:p.session.id}}))}catch(p){H(null),C(p instanceof Error?p.message:"Could not start a new chat.")}finally{Qt(!1)}}},[me,S,Y,O]),pi=h.useCallback(async p=>{if(!(!p||bt)){es(p),C(null),O();try{const g=await Z("/api/scoutbot/session/archive",{method:"POST",body:JSON.stringify({id:p})});he(g),ve(g.session),fe(!1),H("session archived"),window.dispatchEvent(new CustomEvent(De,{detail:{id:g.session.id}}))}catch(g){C(g instanceof Error?g.message:"Could not archive session.")}finally{es(null)}}},[bt,O,ve]),tt=h.useCallback((p,g)=>{L(g),Jt(p.activeInputDeviceName),y(g?null:p.lastUnavailableReason??"Scout voice service is not reachable."),I("idle")},[]),ie=h.useCallback(async(p=!1)=>{const g=Ke.current;I(E=>E==="launching"?E:"probing");const k=await g.probe(p?{force:!0}:void 0);return tt(g,k),k},[tt]);h.useEffect(()=>{Mi();const p=Ke.current,g=Ii(k=>{L(k.ok),Jt(k.inputDeviceName),y(k.ok?null:k.reason),I("idle")});return p.connectionState==="unknown"?ie():tt(p,p.connectionState==="connected"),g},[tt,ie]);const gs=h.useCallback(()=>{const p=Ke.current;C(null),I("launching"),p.launch({source:"openscout",context:Na()}),window.setTimeout(()=>{ie(!0)},2400)},[ie]),vs=h.useCallback(p=>{const g=Se(p);ze(g);for(const k of Ri(p))k.type==="ask-agent"?(H(`Sending to ${k.targetLabel}`),Z("/api/scoutbot/actions/ask",{method:"POST",body:JSON.stringify({targetLabel:k.targetLabel,targetAgentId:k.targetAgentId,body:k.body,channel:k.channel})}).then(E=>{H(E.flightId?`Sent to ${E.targetAgentId??E.targetLabel} · run ${E.flightId}`:`Sent to ${E.targetAgentId??E.targetLabel}`)}).catch(E=>{H(null),C(E instanceof Error?E.message:"Could not send to agent.")})):k.type!=="reminder"&&c(k);hs(g)},[c,hs]);h.useEffect(()=>{const p=()=>{H("Scoutbot replied by voice"),Ne()},g=()=>{H("Scoutbot chat changed"),Ne()};return window.addEventListener(ws,p),window.addEventListener(De,g),()=>{window.removeEventListener(ws,p),window.removeEventListener(De,g)}},[Ne]);const Re=h.useCallback(async p=>{const g=p.trim();if(!(!g||S)){w(!0),C(null),vt(g),ze(null),H("Sending"),j(k=>k.trim()===g?"":k);try{await Ti().catch(()=>null);const k=await Z("/api/scoutbot/chat",{method:"POST",body:JSON.stringify({body:g,route:a,uiContext:ki("web")})});he({session:k.session,sessions:k.sessions,config:k.config}),H("Reply received"),vs(k.reply.body)}catch(k){H(null),C(k instanceof Error?k.message:"Could not send.")}finally{w(!1)}}},[vs,a,S]),ys=h.useCallback(async()=>{if(te)return;const p=Ke.current;if(ge.current=null,C(null),Pe(""),le("starting"),N!==!0&&!await ie(!0)){le(null);return}let g=null,k=!1;const E=async()=>{!g||k||(k=!0,await nt(g,{allowCurrentSession:oe.current===g}),oe.current===g&&(oe.current=null))};try{if(g=await p.startLive({onState:le,onPartial:Pe},{surface:o==="direct-voice"?"direct-voice":"chat-composer"}),!xe.current){await nt(g,{allowCurrentSession:!0});return}oe.current=g,Ue(!0);const U=await g.result;if(await E(),!xe.current||(Ue(!1),Pe(""),ge.current))return;le("done"),U.text&&await Re(U.text)}catch(U){const W=ge.current;if(!xe.current)return;const ce=!!W||Ea(U);if(await E(),Ue(!1),Pe(""),W==="stop-failed")return;le(ce?null:"error"),ce||C(U instanceof Error?U.message:"Scout voice recording failed.")}finally{xe.current&&await E(),ge.current=null}},[Re,o,ie,te,N]),bs=h.useCallback(async()=>{const p=oe.current;if(p){le("processing");try{await ni(p.stop(),Sa,"Scout voice did not finish processing the recording.")}catch(g){ge.current="stop-failed",await nt(p,{allowCurrentSession:!0}),oe.current===p&&(oe.current=null,Ue(!1),Pe(""),le("error")),C(g instanceof Error?`Scout voice recording did not finish: ${g.message}`:"Scout voice recording did not finish.")}}},[]);h.useEffect(()=>{const p=()=>v(!1);return window.addEventListener("scout:scoutbot-panel-open",p),()=>window.removeEventListener("scout:scoutbot-panel-open",p)},[v]),h.useEffect(()=>Pi(()=>v(!x)),[x,v]),h.useEffect(()=>{const p=g=>{const k=g.detail,E=k&&typeof k=="object"&&"body"in k?k.body:null;typeof E=="string"&&E.trim()&&(v(!1),Re(E))};return window.addEventListener(Ps,p),()=>window.removeEventListener(Ps,p)},[Re,v]),h.useEffect(()=>{const p=g=>{const k=g.detail,E=k&&typeof k=="object"&&"body"in k?k.body:null;typeof E=="string"&&E.trim()&&(v(!1),j(E),pe(U=>U+1))};return window.addEventListener("scout:scoutbot-compose",p),()=>window.removeEventListener("scout:scoutbot-compose",p)},[v]);const Ss=h.useMemo(()=>{const p=se?"speaking":S?"thinking":te?"listening":"idle",g=Y?.session??null,k=g&&g.messages.length>0?g.messages[g.messages.length-1]:null;return{activity:p,brief:{lastDeliveredAt:null},reminders:{dueCount:0,upcomingCount:0,due:[],next:null},voice:{available:N,setupBlocked:N===!1,replies:A},error:P,session:{title:g?.title??null,lastActivityAt:k?.createdAt??g?.updatedAt??null},conversation:{messageCount:g?.messages.length??0,loading:Y===null}}},[se,S,te,N,A,P,Y]);h.useEffect(()=>{l?.publishState(Ss)},[l,Ss]),h.useEffect(()=>{if(!l)return;const p={focusScoutbot:()=>v(!1),triggerBrief:()=>{v(!1),pe(g=>g+1)},triggerAskState:()=>{v(!1),pe(g=>g+1)},toggleVoiceReplies:()=>{const g=!A;B(g),g||O()},openScoutbotSettings:()=>{v(!1),Ee(!0)},startNewChat:()=>{v(!1),me||et()},dismissReminder:()=>{},askReminderStatus:()=>{v(!1),pe(g=>g+1)}};l.registerActions(p)},[l,v,A,B,O,Ee,me,et]),h.useEffect(()=>{N===!0&&Fe(!1)},[N]);const xi=m?"Live call":te?pt==="processing"?"Sending":"Stop":T==="probing"?"Checking Voice":T==="launching"?"Opening Scout":N===!1?"Open Scout":"Start Talking",gi=Y!==null&&Y.session.messages.length===0&&!S;if(o==="direct-voice")return i.jsx(pa,{messages:Y?.session.messages??[],pendingAsk:S?Zt:null,partial:xt,error:P,status:yt,recording:te,sending:S,speaking:se,voiceAvailable:N,voiceInputSource:ai,voiceProbeState:T,voiceState:pt,voiceReplies:A,settingsOpen:de,assistantModel:Y?.session.model??Y?.config.model??null,setupPanel:N===!1?i.jsx(yo,{issue:D,probeState:T,onLaunch:gs,onRetry:()=>{ie(!0)},onSettings:()=>Ee(!0),onDismiss:()=>Fe(!1)}):null,settingsPanel:i.jsx(bo,{presentation:"direct-voice",voicePresetId:ee,onVoicePresetId:R,speechSelectionId:Xe,onSpeechSelectionId:ae,customSpeechModelId:K,onCustomSpeechModelId:_,customSpeechVoiceId:$,onCustomSpeechVoiceId:Xt,customSpeechInstructions:_e,onCustomSpeechInstructions:Kt,voiceDefaults:ls,modelDraft:He,onModelDraft:We,modelOptions:as,promptDraft:Ge,onPromptDraft:Ye,configLoading:ts,configSaving:os,configError:ns,configStatus:rs,onSave:()=>{xs()},onReload:()=>{Qe()}}),onPrimaryAction:()=>{se?O():te?bs():N===!1?ie(!0):ys()},onToggleVoiceReplies:()=>{const p=!A;Je.current=p,B(p),p||O()},onToggleSettings:()=>Ee(p=>!p),onNewChat:()=>{me||et()},onOpenLive:r});if(x&&!t)return i.jsx("div",{className:"flex shrink-0 items-center border-t border-[var(--scout-chrome-border-soft)] px-3 py-1.5",children:i.jsx(Ei,{})});const vi=s?"flex h-full min-h-0 flex-col overflow-hidden border-t border-[var(--scout-chrome-border-soft)]":e===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)]",yi=e===void 0||s?void 0:{height:`${e}px`};return i.jsxs("section",{className:vi,style:yi,children:[i.jsxs("div",{className:"flex shrink-0 flex-col gap-2 px-3 pt-2.5 pb-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("div",{className:"flex min-w-0 items-center gap-2",children:i.jsx(vn,{size:20,className:"shrink-0 text-lime-300","aria-hidden":"true"})}),i.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[i.jsx(vo,{icon:A?i.jsx(Uo,{size:11}):i.jsx(zo,{size:11}),title:m?A?"Voice replies on for typed chat (live call has its own audio)":"Voice replies off for typed chat (live call has its own audio)":A?"Voice replies on (click to mute)":"Voice replies off (click to enable)",onClick:()=>{const p=!A;B(p),p||O()},active:A}),!t&&i.jsx(vo,{icon:i.jsx(Mt,{size:11}),title:"Minimize",onClick:()=>v(!0)})]})]}),de&&i.jsx(bo,{presentation:"chat",voicePresetId:ee,onVoicePresetId:R,speechSelectionId:Xe,onSpeechSelectionId:ae,customSpeechModelId:K,onCustomSpeechModelId:_,customSpeechVoiceId:$,onCustomSpeechVoiceId:Xt,customSpeechInstructions:_e,onCustomSpeechInstructions:Kt,voiceDefaults:ls,modelDraft:He,onModelDraft:We,modelOptions:as,promptDraft:Ge,onPromptDraft:Ye,configLoading:ts,configSaving:os,configError:ns,configStatus:rs,onSave:()=>{xs()},onReload:()=>{Qe()}})]}),i.jsx("div",{className:"flex min-h-0 flex-1 flex-col px-3 pb-1.5",children:Y&&i.jsx(ta,{state:Y,chatExpanded:li,onToggleExpanded:()=>fe(p=>!p),sessionPickerOpen:di,onToggleSessionPicker:()=>qe(p=>!p),onStartNewChat:()=>{et()},startingNewChat:me,onSwitchSession:p=>{fi(p)},switchingSessionId:kt,sending:S,briefing:!1,pendingAsk:S?Zt:null,onArchiveSession:p=>{pi(p)},archivingSessionId:bt,onAssistantContextMenu:hi,suggestedPrompts:mi,onSelectPrompt:p=>{j(p),fe(!1)}})}),i.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:[N===!1&&ci&&!m&&i.jsx(yo,{issue:D,probeState:T,onLaunch:gs,onRetry:()=>{ie(!0)},onSettings:()=>Ee(!0),onDismiss:()=>Fe(!1)}),(xt||se)&&!m&&i.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:[i.jsx("span",{className:"min-w-0 truncate",children:se?"Speaking reply…":xt}),se&&i.jsx("button",{type:"button",title:"Stop spoken reply",onClick:O,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:i.jsx(Po,{size:11,className:"fill-current"})})]}),yt&&!S&&i.jsx("div",{className:"font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)]",children:yt}),i.jsx(oa,{agents:n,draft:b,onDraftChange:j,onSubmit:()=>{Re(b)},sending:S,recording:te,voiceLabel:xi,voiceBusy:pt==="processing"||T==="probing"||T==="launching",voiceUnavailable:N===!1,voiceHeld:m,onMicClick:()=>{if(!m){if(N===!1){Fe(!0);return}te?bs():ys()}},prominent:gi&&!m,autoFocus:t,focusSignal:ui}),P&&i.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:P})]})]})}function ri({dictationActive:e=!1,autoStart:t=!1}){const s=Ht(Wt,!0),{enabled:o,state:r,leaseId:c,startCall:n,endCall:a}=Gt(),u=h.useRef(!1),l=h.useRef(null),[d,f]=h.useState(()=>window.innerWidth>=720&&window.innerHeight>=520?"page":"compact"),m=window.webkit?.messageHandlers?.scoutRealtimeVoice;return h.useEffect(()=>{const x=()=>{f(window.innerWidth>=720&&window.innerHeight>=520?"page":"compact")};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]),h.useEffect(()=>{m?.postMessage({kind:"session-state",state:r,leaseId:c})},[c,m,r]),h.useEffect(()=>{const x=()=>{if(l.current)return l.current;const b=a().finally(()=>{l.current===b&&(l.current=null)});return l.current=b,b},v=()=>{x()};return window.__scoutRealtimeVoiceStop=x,window.addEventListener(js,v),window.__scoutRealtimeVoiceStopRequested&&x(),()=>{window.removeEventListener(js,v),window.__scoutRealtimeVoiceStop===x&&delete window.__scoutRealtimeVoiceStop}},[a]),h.useEffect(()=>{!t||e||!s||!o||u.current||r!=="idle"&&r!=="ended"&&r!=="error"||(u.current=!0,n())},[t,e,s,o,n,r]),s?o?i.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[i.jsx(wo,{state:r,onMinimize:m?()=>m.postMessage("minimize"):void 0,onExpand:m?()=>m.postMessage(d==="page"?"restore":"expand"):void 0,layout:d}),i.jsx(jo,{dictationActive:e,layout:d})]}):i.jsxs("div",{className:"flex h-full flex-col justify-center gap-2 p-4",children:[i.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Live voice is disabled"}),i.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."})]}):i.jsxs("div",{className:"flex h-full flex-col justify-center gap-2 p-4",children:[i.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Live voice is off"}),i.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 La(){const e=Ht(Wt,!0),{enabled:t,state:s}=Gt(),[o,r]=h.useState("direct"),c=e&&t;return o==="direct"?i.jsx("main",{className:"h-full min-h-0 overflow-hidden bg-[#f3f0e9]",children:i.jsx(Da,{forceExpanded:!0,fill:!0,presentation:"direct-voice",onOpenLive:()=>r("realtime")})}):i.jsxs("main",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-[var(--scout-chrome-bg)]",children:[i.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:[i.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[i.jsx("h1",{className:"truncate font-[var(--font-accent-title)] text-[17px] font-semibold tracking-[-0.018em] text-[var(--scout-chrome-ink-strong)]",children:"GPT Live"}),i.jsx("span",{className:"hidden h-4 w-px bg-[var(--scout-chrome-border-soft)] sm:block","aria-hidden":"true"}),i.jsxs("span",{className:"hidden items-center gap-2 text-xs text-[var(--scout-chrome-ink-faint)] sm:flex",children:[i.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${c?"bg-[var(--scout-accent)]":"bg-[var(--scout-chrome-ink-ghost)]"}`,"aria-hidden":"true"}),c?"Ready for a live call":"Live voice unavailable"]})]}),i.jsxs("div",{className:"flex rounded-md border border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)] p-0.5",role:"tablist","aria-label":"Voice mode",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":"false",onClick:()=>r("direct"),className:"rounded-[4px] px-3 py-1.5 text-[11px] font-medium text-[var(--scout-chrome-ink-faint)] transition-colors hover:text-[var(--scout-chrome-ink-strong)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--scout-accent)]",children:"Direct"}),i.jsx("button",{type:"button",role:"tab","aria-selected":"true",className:"rounded-[4px] bg-[var(--scout-chrome-ink-strong)] px-3 py-1.5 text-[11px] font-medium text-[var(--scout-chrome-bg)] shadow-[0_1px_2px_rgba(0,0,0,0.14)]",children:"Live"})]})]}),i.jsx("section",{className:"min-h-0 flex-1 overflow-hidden",children:c?i.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[i.jsx(wo,{state:s,layout:"page"}),i.jsx(jo,{dictationActive:!1,layout:"page"})]}):i.jsx(ri,{})})]})}const Aa=yn({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:e=>({dictationActive:e.get("dictationActive")==="1",autoStart:e.get("autoStart")==="1"})}}),dc=Object.freeze(Object.defineProperty({__proto__:null,RealtimeVoicePage:La,RealtimeVoiceScreen:ri,scoutSurface:Aa},Symbol.toStringTag,{value:"Module"}));export{La as R,Da as S,dc as a};
|
package/dist/client/assets/{RenderedWorkerSprite-CvdWO32C.js → RenderedWorkerSprite-C8fxndAh.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as p}from"./index-
|
|
1
|
+
import{r as i,j as p}from"./index-DReVb7jZ.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-DReVb7jZ.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-DReVb7jZ.js";import{s as a}from"./observe-CtS0l3zu.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-C8uS5szO.js";import{C as S}from"./CrewSprite-hgpA3SWB.js";import{S as ye}from"./SproutActionSprite-DveCzg6l.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-DReVb7jZ.js";import{C as S}from"./CrewSprite-Dp9KBBGY.js";import{S as ye}from"./SproutActionSprite-DI5N3gOj.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-Cbu0_PJW.js → RepoDiffEmbedScreen-CVUMnt6A.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-DReVb7jZ.js";import{R as c}from"./RepoDiffViewerLazy-BpMR7tlx.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-Chwm6GXL.js → RepoDiffPageScreen-D9-s5PyB.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-DReVb7jZ.js";import{R as l}from"./RepoDiffViewerLazy-BpMR7tlx.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-C8uS5szO.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-DJkRHMoe.js";import{C as ce}from"./chevron-down-B5eMsn5c.js";import{C as de}from"./check-B8dMv3Is.js";import{L as ue}from"./loader-circle-DurUYl7E.js";import{S as fe}from"./send-horizontal-pOtGI7FM.js";import{F as he}from"./file-code-corner-D_Aptal2.js";import{C as me}from"./code-xml-BmyLM0I2.js";import{X as pe}from"./x-DI1ktCYb.js";import{r as O,a as Y,f as V}from"./cache-DEy9E34b.js";import{M as xe}from"./message-square-NmXWtWLR.js";import{R as ge}from"./refresh-cw-Da9DDLk2.js";import{P as be}from"./plus-D_wLGJGT.js";import{a as B}from"./api-CaROe5_H.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./createLucideIcon-DkjnzvcJ.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-DReVb7jZ.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-DTvcwISe.js";import{C as ce}from"./chevron-down-CDzRQQGl.js";import{C as de}from"./check-g7D7-c1J.js";import{L as ue}from"./loader-circle-DNUsuPWz.js";import{S as fe}from"./send-horizontal-BlQsRK6C.js";import{F as he}from"./file-code-corner-Be6da5l3.js";import{C as me}from"./code-xml-Cmadr3pQ.js";import{X as pe}from"./x-rlMdRqJF.js";import{r as O,a as Y,f as V}from"./cache-DGBo3vIf.js";import{M as xe}from"./message-square-CJW4WRlo.js";import{R as ge}from"./refresh-cw-IcD2lPoT.js";import{P as be}from"./plus-D5NLH_fM.js";import{a as B}from"./api-DSqpVKC7.js";import"./chunk-HRAB3GC3-Dvk_QpRq.js";import"./createLucideIcon-ChvMq-zl.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-D7FN-oyY.js","assets/index-DReVb7jZ.js","assets/index-CGbs0SBm.css","assets/ui-LM8pS8qE.js","assets/usePierreRuntime-DTvcwISe.js","assets/chunk-HRAB3GC3-Dvk_QpRq.js","assets/chevron-down-CDzRQQGl.js","assets/createLucideIcon-ChvMq-zl.js","assets/check-g7D7-c1J.js","assets/loader-circle-DNUsuPWz.js","assets/send-horizontal-BlQsRK6C.js","assets/file-code-corner-Be6da5l3.js","assets/code-xml-Cmadr3pQ.js","assets/x-rlMdRqJF.js","assets/cache-DGBo3vIf.js","assets/api-DSqpVKC7.js","assets/message-square-CJW4WRlo.js","assets/refresh-cw-IcD2lPoT.js","assets/plus-D5NLH_fM.js","assets/repo-diff-DyYmQMSA.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r as i,_ as s}from"./index-DReVb7jZ.js";/* empty css */const a=i.lazy(()=>s(()=>import("./RepoDiffViewer-D7FN-oyY.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};
|