@openscout/scout 0.2.97 → 0.2.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/ActivityScreen-sfonf5SR.js +1 -0
- package/dist/client/assets/{AddProjectForm-r_1tVuWk.js → AddProjectForm-fXndbzXT.js} +1 -1
- package/dist/client/assets/{AgentAvatar-B7c0egdP.js → AgentAvatar-Dz79iTxB.js} +1 -1
- package/dist/client/assets/AgentConfigurationScreen-DDc3udYM.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-DHDS9Pgd.js +1 -0
- package/dist/client/assets/{AgentDetailCard-B_KLcgsP.js → AgentDetailCard-8viaEY8b.js} +1 -1
- package/dist/client/assets/AgentFloorView-DuyvyMMj.js +1 -0
- package/dist/client/assets/AgentInfoScreen-qntgg2q2.js +1 -0
- package/dist/client/assets/{AgentLaneCard-ajZvcfdW.js → AgentLaneCard-Cc9uyfBr.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-CTp39syR.js → AgentLaneChrome-Dv2lBFoH.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-DRc-TpMB.js → AgentLaneDetailSheet-CGqtqSHQ.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-VMNDo7kD.js → AgentLaneSummaryResize-Di4u6df2.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-BA6fRwkD.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-CFadSaia.js → AgentLanesPreflight-CCGBArIb.js} +1 -1
- package/dist/client/assets/AgentLanesView-96lHsoX7.js +2 -0
- package/dist/client/assets/{AgentLiveActions-CsQA3pu_.js → AgentLiveActions-DlSKL60c.js} +1 -1
- package/dist/client/assets/AgentMasterScreen-DHrMuQ6_.js +1 -0
- package/dist/client/assets/{AgentSessions-BePq5Lgc.js → AgentSessions-DV9v34aq.js} +2 -2
- package/dist/client/assets/AgentsConsole-DTpVhS67.js +1 -0
- package/dist/client/assets/AgentsScreen-hZ4o2I-e.js +1 -0
- package/dist/client/assets/AgentsSubnav-Ci7uWM7P.js +1 -0
- package/dist/client/assets/{AstronautSuit-Cjjcv6yQ.js → AstronautSuit-CwB4Dw07.js} +1 -1
- package/dist/client/assets/{AtopView-PxWQd-sX.js → AtopView-D7vyQDtE.js} +1 -1
- package/dist/client/assets/{BackToPicker-Cto0Ioz9.js → BackToPicker-BHicJyfc.js} +1 -1
- package/dist/client/assets/BriefingDetailScreen-B-wD_Bot.js +1 -0
- package/dist/client/assets/{BriefingsScreen-DNyFBrPn.js → BriefingsScreen-Cn4Mbam9.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-DbaCQlhw.js → BrokerMetadataPanel-BJSwU9XZ.js} +1 -1
- package/dist/client/assets/BrokerScreen-C8FQ5rlg.js +5 -0
- package/dist/client/assets/{CastPicker-CTBHjjGw.js → CastPicker-CkgTalIt.js} +1 -1
- package/dist/client/assets/{ChatCollapsedStrip-D4rc7wBQ.js → ChatCollapsedStrip-7Wrg8Ge0.js} +1 -1
- package/dist/client/assets/{CodeDiffPane-QvxCUzTi.js → CodeDiffPane-DfluIWmO.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-DplkpM7f.js → CodeProjectPicker-By_Wz9ex.js} +1 -1
- package/dist/client/assets/CodeScreen-cLC0tJ4S.js +1 -0
- package/dist/client/assets/ConversationComposer-BUIjWMBi.js +1 -0
- package/dist/client/assets/ConversationFeedRows-Bx0gFyG_.js +1 -0
- package/dist/client/assets/ConversationHeader-Bt2RBj93.js +1 -0
- package/dist/client/assets/{ConversationPanels-fMo6Uy1v.js → ConversationPanels-o6W-cOoU.js} +2 -2
- package/dist/client/assets/ConversationScreen-DIU7m_aC.js +2 -0
- package/dist/client/assets/{ConversationStatus-DI5GCiyW.js → ConversationStatus-CTYOywFh.js} +1 -1
- package/dist/client/assets/{CrewAvatar-CXJHLNVM.js → CrewAvatar-CZ_faQ_s.js} +1 -1
- package/dist/client/assets/CrewWorkspaces-DNX-QQ1h.js +1 -0
- package/dist/client/assets/{DataTable-DXIlOlVu.js → DataTable-C6aMSilS.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-CrELgl2e.js → DispatchAftermath-ZCEB75hh.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-DFFE85Tq.js → DocumentFocusViewer-D8iB6SMt.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-DgpewB3y.js → EmbeddableSurfacesLab-D3iZiS8o.js} +1 -1
- package/dist/client/assets/{EmptyState-D9X16fKq.js → EmptyState-CKPWFSjq.js} +1 -1
- package/dist/client/assets/{FileViewerPane-CY0RN78e.js → FileViewerPane-CxNbcTYf.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-BTe1YRPr.js +1 -0
- package/dist/client/assets/{FollowScreen-wZ-z67mX.js → FollowScreen-CkR-okdL.js} +1 -1
- package/dist/client/assets/{HarnessMark-DAaWPiT_.js → HarnessMark-DttReffF.js} +1 -1
- package/dist/client/assets/HarnessesScreen-COO_Q8VY.js +1 -0
- package/dist/client/assets/{HerdrSession-CYKRfBad.js → HerdrSession-DsuxCtfX.js} +1 -1
- package/dist/client/assets/{HomeHero-DYyd3cpz.js → HomeHero-DXJo2QSO.js} +1 -1
- package/dist/client/assets/{HostAdvisorView-NtM0bsg8.js → HostAdvisorView-DeJ-8RZV.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-CU6BCFcS.js → KnowledgeSearchInspector-W_zNIBRV.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-_rxJNUUh.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-Bo2Zl-1a.js → LaneToolHoverCard-t7-XJP-h.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-DNIECgEl.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-Cek_64zR.js → LaneTraceEventFocus-BB5DhFQm.js} +1 -1
- package/dist/client/assets/{MeshCanvas-TvsID4fe.js → MeshCanvas-DZv2ipsy.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-CxqeVVco.js → MeshCanvasMinimap-BXHRNb7l.js} +1 -1
- package/dist/client/assets/MeshScreen-DuNvpDC5.js +1 -0
- package/dist/client/assets/{MeshTopologyView-BjprutE8.js → MeshTopologyView-Dc0GSrKa.js} +2 -2
- package/dist/client/assets/MessagesScreen-dNNPFwAc.js +1 -0
- package/dist/client/assets/{MissionContextRail-Be0uXljQ.js → MissionContextRail-DnCWPzAM.js} +1 -1
- package/dist/client/assets/MissionControlView-DmaThhNR.js +1 -0
- package/dist/client/assets/MissionFocusOverlay-K21ssTxv.js +1 -0
- package/dist/client/assets/MissionLeftAgentRow-CbQm4BLv.js +1 -0
- package/dist/client/assets/{MissionLogPane-EsM_S3ro.js → MissionLogPane-BLvSSIdT.js} +1 -1
- package/dist/client/assets/{NewAgentModal-Cqiq1CE1.js → NewAgentModal-B7qxjZlW.js} +1 -1
- package/dist/client/assets/NewChatComposer-D2Ah4T-W.js +19 -0
- package/dist/client/assets/{NewChatOrigin-D7hwp6dm.js → NewChatOrigin-DCn5cWPZ.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-CGHI_hb5.js → ObserveEmbedScreen-DvKGsaLv.js} +2 -2
- package/dist/client/assets/{ObserveTextFlow-BcrGQet8.js → ObserveTextFlow-DCJ5EmD8.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-BhVsvwkh.js → ObservedTopologyPanel-CJVqIqQ2.js} +1 -1
- package/dist/client/assets/{OpenScoutAppShell-BtfvMkAp.js → OpenScoutAppShell-C9TOLB7u.js} +2 -2
- package/dist/client/assets/OpsAgentsView-vIoY-AW1.js +1 -0
- package/dist/client/assets/OpsScreen-CJBwshEp.js +1 -0
- package/dist/client/assets/OpsSubnav-CjDTnp64.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-Br1eTD7G.js +1 -0
- package/dist/client/assets/ProjectAgentProfileBar-CUzZ4Rpx.js +1 -0
- package/dist/client/assets/ProjectAgentProfileHero-mjxNcRvw.js +1 -0
- package/dist/client/assets/ProjectsInbox-Bq29DE_o.js +2 -0
- package/dist/client/assets/ProjectsRail-kMDA0yn4.js +1 -0
- package/dist/client/assets/ProjectsScreen-BDaJYhc0.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-B940p3vW.js +1 -0
- package/dist/client/assets/Provider-D0bB7q6y.js +1 -0
- package/dist/client/assets/{RailRow-ClMmtaIE.js → RailRow-B88JVr62.js} +1 -1
- package/dist/client/assets/RawSessionsTable-CzGhEdiZ.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-CyP1CWsX.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-CjZ5ew3y.js → RepoDiffEmbedScreen-mexrJPhW.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-CdTFfmbk.js → RepoDiffPageScreen-DbqX4L3q.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-BFperHQg.js → RepoDiffViewer-Bw5yMC4A.js} +1 -1
- package/dist/client/assets/{RepoDiffViewerLazy-BkBmbi1Z.js → RepoDiffViewerLazy-DzfoFhbl.js} +2 -2
- package/dist/client/assets/{ReposScreen-C8dT4bK0.js → ReposScreen-CzbO1Fuy.js} +2 -2
- package/dist/client/assets/{ScoutDeckSurface-BcJsm2Kq.js → ScoutDeckSurface-DQoZofzH.js} +1 -1
- package/dist/client/assets/{ScoutSurface-DmzEtrx8.js → ScoutSurface-NlhDsPzg.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-DU15Plja.js → ScoutbotFxLab-l2WAahCg.js} +1 -1
- package/dist/client/assets/{SecondaryNav-BrXMtvKE.js → SecondaryNav-Cs0_FQdj.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-Bt4flmAx.js → SessionEmbedScreen-CpduQ0O9.js} +1 -1
- package/dist/client/assets/{SessionObserve-BCehTlO8.js → SessionObserve-BVeTkcIl.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-Bb6U-dem.js → SessionObserveEvidence-BkOezTGV.js} +1 -1
- package/dist/client/assets/SessionRefScreen-DetLMkTT.js +1 -0
- package/dist/client/assets/SessionsScreen-B-McKw6d.js +1 -0
- package/dist/client/assets/{SettingsDrawer-BieUmb8g.js → SettingsDrawer-CPB32w0n.js} +3 -3
- package/dist/client/assets/SettingsScreen-BEzYFdjz.js +1 -0
- package/dist/client/assets/{ShikiPane-DPWsVNtn.js → ShikiPane-C0TuCATU.js} +1 -1
- package/dist/client/assets/{SlidePanel-BMRIR6bH.js → SlidePanel-CETQ5NTx.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-56DTXxSV.js → SpriteAvatar-DFO4Kb4Z.js} +1 -1
- package/dist/client/assets/{StatusPill-BcuYUgsD.js → StatusPill-BllrY-eg.js} +1 -1
- package/dist/client/assets/{TailView-BDy8c2VB.js → TailView-_gKWfaQM.js} +2 -2
- package/dist/client/assets/Terminal-DWyZTZdY.js +1 -0
- package/dist/client/assets/TerminalEmbedScreen-_SSzwhWa.js +1 -0
- package/dist/client/assets/{TerminalHeaderMount-Cy-uxkey.js → TerminalHeaderMount-CY7uIWBg.js} +1 -1
- package/dist/client/assets/{TextDocumentSurface-BeSwe3Yl.js → TextDocumentSurface-2X1Gw4eA.js} +1 -1
- package/dist/client/assets/{TmuxPeek-B4no_aGI.js → TmuxPeek-CqTJRhkI.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-Bd16scwz.js → VoicePermissionsPanel-C4vkU-sU.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-DIFQufak.js → WorkDetailScreen-DqGnuK0e.js} +3 -3
- package/dist/client/assets/{WorkFilesViewer-CT5XEFGf.js → WorkFilesViewer-D8-4vF5l.js} +1 -1
- package/dist/client/assets/{activity-CqZafWfx.js → activity-CzTJ-YMX.js} +1 -1
- package/dist/client/assets/{addon-fit-CM6F_JRD.js → addon-fit-Zx3A7pGS.js} +1 -1
- package/dist/client/assets/{addon-webgl-DRTiePFC.js → addon-webgl-DitJj-N0.js} +1 -1
- package/dist/client/assets/{agent-autocomplete-DXUBnlkN.js → agent-autocomplete-BlK8wY06.js} +1 -1
- package/dist/client/assets/{agent-essentials-vytdybaX.js → agent-essentials-K9B6kbTS.js} +1 -1
- package/dist/client/assets/{agent-lane-card-model-CNZMPkhc.js → agent-lane-card-model-CY3OE1Xu.js} +1 -1
- package/dist/client/assets/{agent-lanes-model-DXqjs0OK.js → agent-lanes-model-tc-1hE6q.js} +1 -1
- package/dist/client/assets/{agent-master-model-DAZL92oe.js → agent-master-model-DMcHeNq3.js} +1 -1
- package/dist/client/assets/agent-specialization-CtF_jI34.js +1 -0
- package/dist/client/assets/{arc.es-Bh84oHJ7.js → arc.es-BNXJqSw7.js} +1 -1
- package/dist/client/assets/{arrow-down-DvTsLokL.js → arrow-down-BAGkhHA6.js} +1 -1
- package/dist/client/assets/{arrow-left-DHfdXJVZ.js → arrow-left-eToA6GxC.js} +1 -1
- package/dist/client/assets/{arrow-right-BBsrogWf.js → arrow-right-DTX42clh.js} +1 -1
- package/dist/client/assets/{arrow-up-right-CY0Vw_67.js → arrow-up-right-B09GPwFl.js} +1 -1
- package/dist/client/assets/{bot-DzkOUFBb.js → bot-WxKXYtEX.js} +1 -1
- package/dist/client/assets/{check-DbIkldnK.js → check-Dz2SRHft.js} +1 -1
- package/dist/client/assets/{chevron-down-C475vltS.js → chevron-down-D120PY4g.js} +1 -1
- package/dist/client/assets/{chevron-right-CnZRSd-V.js → chevron-right-CowuvuE6.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-DLNT8aOo.js → chunk-HRAB3GC3-KjjrTLCU.js} +1 -1
- package/dist/client/assets/{chunk-JTPDIGGW-Ci5j4vzV.js → chunk-JTPDIGGW-COJ00z94.js} +3 -3
- package/dist/client/assets/{chunk-T65CQEWV-BtNvicWs.js → chunk-T65CQEWV-H2QEKfr1.js} +1 -1
- package/dist/client/assets/{chunk-YOZR3KYS-DN5EJulq.js → chunk-YOZR3KYS-CrCgXw9l.js} +1 -1
- package/dist/client/assets/{clock-DVvENUU5.js → clock-_9FDplIT.js} +1 -1
- package/dist/client/assets/{code-xml-CvKBY3KA.js → code-xml-CkkNdRmu.js} +1 -1
- package/dist/client/assets/{compass-BcRI_YXo.js → compass-BdpImt_W.js} +1 -1
- package/dist/client/assets/content-0RBfbCIJ.js +1 -0
- package/dist/client/assets/content-BTmnk2bl.js +1 -0
- package/dist/client/assets/content-Bk5DKhyP.js +1 -0
- package/dist/client/assets/{content-BNyAjpUl.js → content-Bw_8GE_S.js} +1 -1
- package/dist/client/assets/content-CI4gLEWi.js +1 -0
- package/dist/client/assets/content-CLCtp9Rb.js +1 -0
- package/dist/client/assets/content-C_FAGTNk.js +1 -0
- package/dist/client/assets/content-CnnzWOE3.js +1 -0
- package/dist/client/assets/content-DKlY98pO.js +1 -0
- package/dist/client/assets/content-Df7ndXTG.js +1 -0
- package/dist/client/assets/content-DkZDzzx3.js +1 -0
- package/dist/client/assets/content-DnGmb2L0.js +1 -0
- package/dist/client/assets/content-Ds-zs-Ss.js +1 -0
- package/dist/client/assets/content-JIWSyC0f.js +1 -0
- package/dist/client/assets/content-Q3TIYC8q.js +1 -0
- package/dist/client/assets/content-evaBfvxD.js +1 -0
- package/dist/client/assets/{context-budget-DX_fwUs3.js → context-budget-DqxWzalx.js} +1 -1
- package/dist/client/assets/{conversation-icons-CBMKBGHd.js → conversation-icons-DHGc9wbT.js} +1 -1
- package/dist/client/assets/conversation-model-C2KuZUXc.js +1 -0
- package/dist/client/assets/conversation-motion-features-BJnHs3Ul.js +1 -0
- package/dist/client/assets/{copy-Cj-owMb-.js → copy-BzdzWsQd.js} +1 -1
- package/dist/client/assets/{cpu-DuD3RFX5.js → cpu-CHFIGw87.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DthwWQIg.js → createLucideIcon-Dv8H8m7J.js} +1 -1
- package/dist/client/assets/discover-DutlV0ZU.js +2 -0
- package/dist/client/assets/embed-entry-CJG7WEVw.js +2 -0
- package/dist/client/assets/{external-link-C_nxk0MJ.js → external-link-BvX5PfLh.js} +1 -1
- package/dist/client/assets/{eye-FnaaPfja.js → eye-C9cGk5z6.js} +1 -1
- package/dist/client/assets/{file-code-corner-DDPq4Cur.js → file-code-corner-jlGFdr8d.js} +1 -1
- package/dist/client/assets/{file-text--hfhwZH1.js → file-text-BHro8MkG.js} +1 -1
- package/dist/client/assets/{gauge-BVEknshP.js → gauge-DSflSery.js} +1 -1
- package/dist/client/assets/{gestures-3gw5VgUS.js → gestures-YA5IIwp-.js} +1 -1
- package/dist/client/assets/{git-branch-DJyvr0k-.js → git-branch-Bc_eDIpG.js} +1 -1
- package/dist/client/assets/{home-moving-signal-BPqBoNSm.js → home-moving-signal-PHSqSBu_.js} +1 -1
- package/dist/client/assets/home-now-card-C_qsI6C6.js +1 -0
- package/dist/client/assets/{home-now-card-nano-G8kMB32m.js → home-now-card-nano-Jmy7eJ6H.js} +1 -1
- package/dist/client/assets/{hooks-BMsQzo9j.js → hooks-ME7rmhpE.js} +1 -1
- package/dist/client/assets/{index-BI9AljSD.js → index-C1VaWNuD.js} +2 -2
- package/dist/client/assets/index-C8UCRm2W.js +1 -0
- package/dist/client/assets/index-Cn0I2Hgi.js +1 -0
- package/dist/client/assets/index-Cx6Gbr6n.js +1 -0
- package/dist/client/assets/{inspector-panel-CFSArQ8Y.js → inspector-panel-CwrHjRaQ.js} +2 -2
- package/dist/client/assets/{keyboard-nav-e6yGeorb.js → keyboard-nav-B8sQ_8IF.js} +1 -1
- package/dist/client/assets/{lane-roster-store-Q7pcblY5.js → lane-roster-store-DN2jxXF-.js} +1 -1
- package/dist/client/assets/{layers-Dz2dKOnU.js → layers-CW2-qHsG.js} +1 -1
- package/dist/client/assets/{layout-grid-Bvs5fdB4.js → layout-grid-BoVnPOk-.js} +1 -1
- package/dist/client/assets/left-BRu9pnqx.js +2 -0
- package/dist/client/assets/left-BjS1dKNV.js +2 -0
- package/dist/client/assets/left-CL-TVLJ7.js +1 -0
- package/dist/client/assets/left-DLpsDi55.js +1 -0
- package/dist/client/assets/left-DPcM9o8Y.js +1 -0
- package/dist/client/assets/left-MmTJf1tK.js +1 -0
- package/dist/client/assets/left-P80i5V8L.js +1 -0
- package/dist/client/assets/left-advisor-CbXVzAqS.js +1 -0
- package/dist/client/assets/left-agents-7mJsiNyr.js +1 -0
- package/dist/client/assets/left-default-COK26l3H.js +1 -0
- package/dist/client/assets/left-lanes-Dbdm9Veu.js +1 -0
- package/dist/client/assets/left-mission-DqGR5jby.js +1 -0
- package/dist/client/assets/library-COnWzUWv.js +1 -0
- package/dist/client/assets/{loader-circle-B2W9DPG5.js → loader-circle-DmUG_YC7.js} +1 -1
- package/dist/client/assets/{local-agents-DKr-gIDC.js → local-agents-VP1-ZlPw.js} +1 -1
- package/dist/client/assets/{mentions-DuLQnEcn.js → mentions-BZ5SBMtc.js} +1 -1
- package/dist/client/assets/mesh-buckets-CLYS8Jx8.js +1 -0
- package/dist/client/assets/{mesh-ops-CRR-KnCG.js → mesh-ops-CKSWgax2.js} +1 -1
- package/dist/client/assets/{mesh-view-store-CiET-yN8.js → mesh-view-store-CBM1za_N.js} +1 -1
- package/dist/client/assets/{message-circle-B2DoYKDO.js → message-circle-joGFxfj1.js} +1 -1
- package/dist/client/assets/{message-markup-Cc_O-WdA.js → message-markup-DC0QFEZn.js} +1 -1
- package/dist/client/assets/{message-square-O-Hu9Mk2.js → message-square-BLiFqpe_.js} +1 -1
- package/dist/client/assets/{mission-control-store-DDAgWKUl.js → mission-control-store-CM8mQGg8.js} +1 -1
- package/dist/client/assets/model-CBkMvT1w.js +1 -0
- package/dist/client/assets/{observe-Da2mRAsc.js → observe-BLmy4quB.js} +1 -1
- package/dist/client/assets/{page-status-Crtgjbq3.js → page-status-BE0-J1xY.js} +1 -1
- package/dist/client/assets/{paperclip-BudMKSyr.js → paperclip-Br7wUDFl.js} +1 -1
- package/dist/client/assets/{persistent-state-xJz-qAFc.js → persistent-state-BubPQ7tT.js} +1 -1
- package/dist/client/assets/{plus-BJ1If8vj.js → plus-BWKhylds.js} +1 -1
- package/dist/client/assets/profile-BCvk8jOQ.js +1 -0
- package/dist/client/assets/projects-inbox-BIW7nv-H.css +1 -0
- package/dist/client/assets/projects-inbox-DFbgVlXL.js +1 -0
- package/dist/client/assets/{proxy-1BABCaDb.js → proxy-DVDRhSRR.js} +1 -1
- package/dist/client/assets/{radio-B5OpHrrK.js → radio-CxIXS1nU.js} +1 -1
- package/dist/client/assets/{refresh-cw-DmNAhaH0.js → refresh-cw-Bkh7Cvnd.js} +1 -1
- package/dist/client/assets/resolve-panes-DhD5qmQO.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-GqhZNRPY.js +1 -0
- package/dist/client/assets/right-B_08ilv6.js +1 -0
- package/dist/client/assets/right-Brm67HOL.js +1 -0
- package/dist/client/assets/right-BveAPKBW.js +1 -0
- package/dist/client/assets/right-CpTB_-Ya.js +1 -0
- package/dist/client/assets/right-CqC4Qdot.js +1 -0
- package/dist/client/assets/right-D91j9d5Y.js +1 -0
- package/dist/client/assets/{right-D8id_DWQ.js → right-DVUq5374.js} +1 -1
- package/dist/client/assets/right-DaLRhYl3.js +1 -0
- package/dist/client/assets/right-Dt1wOwA5.js +1 -0
- package/dist/client/assets/right-DtzqIZQF.js +1 -0
- package/dist/client/assets/{rocket-D3-TUJ2m.js → rocket-CnxqjX_K.js} +1 -1
- package/dist/client/assets/{router-DTtux5sP.js → router-kfcaYqZr.js} +1 -1
- package/dist/client/assets/runtime-picker-C20lTGhV.js +1 -0
- package/dist/client/assets/{scope-views-CPM0sBw_.js → scope-views-KPY85UUx.js} +1 -1
- package/dist/client/assets/{scout-voice-BZKsdquE.js → scout-voice-Cg1qfepC.js} +1 -1
- package/dist/client/assets/scoutbot-D7kGGyK_.js +3 -0
- package/dist/client/assets/{scoutbot-markdown-CQ7Y1McC.js → scoutbot-markdown-yb87JlSE.js} +1 -1
- package/dist/client/assets/{scroll-text-kPhYbh-M.js → scroll-text-DFcBYy5J.js} +1 -1
- package/dist/client/assets/{search-DmFM_9jm.js → search-FB2vVxCp.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-C9bQ9_IA.js → secondaryNavConfig-C0Srrmy8.js} +1 -1
- package/dist/client/assets/{selection-bridge-Dy2mtMyi.js → selection-bridge-qBGFCJv8.js} +1 -1
- package/dist/client/assets/{send-horizontal-qyjNgEaV.js → send-horizontal-CS7mxVhX.js} +1 -1
- package/dist/client/assets/{server-nWqndnxu.js → server-WY6gsbZz.js} +1 -1
- package/dist/client/assets/{session-catalog-BkmktBHI.js → session-catalog-CG4oL_yN.js} +1 -1
- package/dist/client/assets/{session-table-DKSF0mrS.js → session-table-uJh3v-ly.js} +1 -1
- package/dist/client/assets/{settings-C6h9y5XX.js → settings-DQEtqkM9.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-BhHKxsCO.js → sliders-horizontal-57e99_qO.js} +1 -1
- package/dist/client/assets/{sparkles-Cf8gin88.js → sparkles-D0vWLTyC.js} +1 -1
- package/dist/client/assets/{sse-DDHEHUgz.js → sse-B29iGBnw.js} +1 -1
- package/dist/client/assets/{system-surfaces-redesign-QVXNeGYw.css → system-surfaces-redesign-kuf3wuE_.css} +1 -1
- package/dist/client/assets/{tail-events-BdUrO0kb.js → tail-events-LK29oCKm.js} +1 -1
- package/dist/client/assets/{terminal-C3YRPfyz.js → terminal-UDy4lzV1.js} +1 -1
- package/dist/client/assets/{terminal-relay-BFhdIstF.js → terminal-relay-CXHMdain.js} +1 -1
- package/dist/client/assets/{terminal-screen-BLk4PAYt.css → terminal-screen-vMICbBJh.css} +1 -1
- package/dist/client/assets/{terminal-sessions-BQ6t92tJ.js → terminal-sessions-Bdt2W3Y4.js} +1 -1
- package/dist/client/assets/{terminal-takeover-B6H4llRR.js → terminal-takeover-BMeBjBB2.js} +1 -1
- package/dist/client/assets/{use-conversation-list-DO5J8T1H.js → use-conversation-list-UG-tMN67.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-BtgNnRgK.js → use-fleet-active-asks-CCGrll5q.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-N1HHhChY.js → use-mesh-ops-items-BjyeFJTz.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-8WuxLa5l.js → use-reduced-motion-CPoX8iV2.js} +1 -1
- package/dist/client/assets/{use-scout-dev-flags-B31qTy6m.js → use-scout-dev-flags-DTseRrFi.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-Bkv-Uz_V.js → useAgentHoverCard-BgTLNcF-.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-CoIoz7JU.js +1 -0
- package/dist/client/assets/useEmbedHeadline-DuUnwTB7.js +1 -0
- package/dist/client/assets/{usePierreRuntime-BfZHKAkI.js → usePierreRuntime-35AHf9RQ.js} +1 -1
- package/dist/client/assets/{wrench-DkxnZRlR.js → wrench-BfVeded5.js} +1 -1
- package/dist/client/assets/{x-DfRJbqrh.js → x-DgmmnPKt.js} +1 -1
- package/dist/client/assets/{xterm-CJw8Epxv.js → xterm-DnJJmrCA.js} +1 -1
- package/dist/client/assets/{zap-CIo8msJB.js → zap-Bcja1lHG.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/main.mjs +5116 -9854
- package/dist/node/main.mjs +18 -2
- package/dist/pairing-runtime-controller.mjs +23 -2
- package/dist/runtime/broker-daemon.mjs +29 -3
- package/dist/scout-control-plane-web.mjs +27 -3
- package/package.json +2 -5
- package/dist/client/assets/ActivityScreen-y-5DLleY.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-BD7Unt2P.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-BbcZc9Xk.js +0 -1
- package/dist/client/assets/AgentFloorView-DMFiHs21.js +0 -1
- package/dist/client/assets/AgentInfoScreen-DHGLRddI.js +0 -1
- package/dist/client/assets/AgentLanesEmbedScreen-C5k_dDS8.js +0 -1
- package/dist/client/assets/AgentLanesView-u5vpLwQf.js +0 -2
- package/dist/client/assets/AgentMasterScreen-C5WlWNmk.js +0 -1
- package/dist/client/assets/AgentsConsole-BuiZ_bDo.js +0 -1
- package/dist/client/assets/AgentsScreen-CRi-hG2k.js +0 -1
- package/dist/client/assets/AgentsSubnav-DUsya4WK.js +0 -1
- package/dist/client/assets/BriefingDetailScreen-C29smC5d.js +0 -1
- package/dist/client/assets/BrokerScreen-CS0s4Gm4.js +0 -5
- package/dist/client/assets/CodeScreen-CrR2JaVj.js +0 -1
- package/dist/client/assets/ConversationComposer-H8_hsYSc.js +0 -1
- package/dist/client/assets/ConversationFeedRows-hlEFlURs.js +0 -1
- package/dist/client/assets/ConversationHeader-B0ZBhE_E.js +0 -1
- package/dist/client/assets/ConversationScreen-CXAHQwQ3.js +0 -2
- package/dist/client/assets/CrewWorkspaces-Bz2Dcnt4.js +0 -1
- package/dist/client/assets/FlightObserveScreen-qyzHzxLa.js +0 -1
- package/dist/client/assets/HarnessesScreen-DbKkQM4o.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-DvbRRPQB.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-C3C8UjXv.js +0 -1
- package/dist/client/assets/MeshScreen-BJ-j9YXv.js +0 -1
- package/dist/client/assets/MessagesScreen-CyNIZ3-X.js +0 -1
- package/dist/client/assets/MissionControlView-Bj7cAbZd.js +0 -1
- package/dist/client/assets/MissionFocusOverlay-DvTw6ts5.js +0 -1
- package/dist/client/assets/MissionLeftAgentRow-B0QG7Gys.js +0 -1
- package/dist/client/assets/NewChatComposer-C_1op4dH.js +0 -19
- package/dist/client/assets/OpsAgentsView-DBYtmLnh.js +0 -1
- package/dist/client/assets/OpsScreen-CuYVgkC_.js +0 -1
- package/dist/client/assets/OpsSubnav-BEU4kKXm.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-BhXAZEkW.js +0 -1
- package/dist/client/assets/ProjectAgentProfileBar-uJw9Wdfk.js +0 -1
- package/dist/client/assets/ProjectAgentProfileHero-CIMS4Dy_.js +0 -1
- package/dist/client/assets/ProjectsInbox-JgU0lrY8.js +0 -2
- package/dist/client/assets/ProjectsRail-p99BRBOa.js +0 -1
- package/dist/client/assets/ProjectsScreen-BB45DU53.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-BHDTJWOz.js +0 -1
- package/dist/client/assets/Provider-Bu-C8Hxc.js +0 -1
- package/dist/client/assets/RawSessionsTable-BtKdQPiv.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-KPHJgO1l.js +0 -1
- package/dist/client/assets/SessionRefScreen-C8BiRVPx.js +0 -1
- package/dist/client/assets/SessionsScreen-BNvjUflN.js +0 -1
- package/dist/client/assets/SettingsScreen-3JvX1WFL.js +0 -1
- package/dist/client/assets/Terminal-BlUQY9_Z.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-DTjxktyr.js +0 -1
- package/dist/client/assets/agent-specialization-BtxLN4UR.js +0 -1
- package/dist/client/assets/agents-project-model-UYiamtrU.js +0 -1
- package/dist/client/assets/content--T3p6akp.js +0 -1
- package/dist/client/assets/content-4nFMLuzF.js +0 -1
- package/dist/client/assets/content-BJ4nHvcu.js +0 -1
- package/dist/client/assets/content-BmGp9wNl.js +0 -1
- package/dist/client/assets/content-CBWhwaRo.js +0 -1
- package/dist/client/assets/content-CQlykFbe.js +0 -1
- package/dist/client/assets/content-CevL0DgF.js +0 -1
- package/dist/client/assets/content-Ch8pf2bj.js +0 -1
- package/dist/client/assets/content-Cpvdcm_l.js +0 -1
- package/dist/client/assets/content-DfS3vgAu.js +0 -1
- package/dist/client/assets/content-DpQdNePJ.js +0 -1
- package/dist/client/assets/content-Dqpibejl.js +0 -1
- package/dist/client/assets/content-TV0nd6-r.js +0 -1
- package/dist/client/assets/content-odbb5H4U.js +0 -1
- package/dist/client/assets/content-uXHLPHe0.js +0 -1
- package/dist/client/assets/conversation-model-QsJVfSeG.js +0 -1
- package/dist/client/assets/conversation-motion-features-BFLHX2eg.js +0 -1
- package/dist/client/assets/discover-B3uQlh5L.js +0 -2
- package/dist/client/assets/embed-entry-DkRcHKTh.js +0 -2
- package/dist/client/assets/home-now-card-UspVW2-2.js +0 -1
- package/dist/client/assets/index-C-v0Z6ZS.js +0 -1
- package/dist/client/assets/index-D9DzUORB.js +0 -1
- package/dist/client/assets/index-DfsTyYDx.js +0 -1
- package/dist/client/assets/left-B4Ak-Ibt.js +0 -2
- package/dist/client/assets/left-BMb493FZ.js +0 -1
- package/dist/client/assets/left-BjFLvVOC.js +0 -1
- package/dist/client/assets/left-CsXQ8Q3G.js +0 -1
- package/dist/client/assets/left-FNH7faCI.js +0 -1
- package/dist/client/assets/left-POkqE8gI.js +0 -2
- package/dist/client/assets/left-UulOTcWh.js +0 -1
- package/dist/client/assets/left-advisor-CJkQS2d6.js +0 -1
- package/dist/client/assets/left-agents-CFMxyEjT.js +0 -1
- package/dist/client/assets/left-default-rnX5HANc.js +0 -1
- package/dist/client/assets/left-lanes-BpLXT_qH.js +0 -1
- package/dist/client/assets/left-mission-B0bhseWw.js +0 -1
- package/dist/client/assets/library-D1iXfda2.js +0 -1
- package/dist/client/assets/mesh-buckets-6y3ZIibI.js +0 -1
- package/dist/client/assets/mesh-roster-Bc7T4b7z.js +0 -1
- package/dist/client/assets/model-IGCUEsMy.js +0 -1
- package/dist/client/assets/profile-B3qDSbrH.js +0 -1
- package/dist/client/assets/projects-inbox-CLek3QaG.js +0 -1
- package/dist/client/assets/projects-inbox-DRBl2N85.css +0 -1
- package/dist/client/assets/resolve-panes-DXw-cHaj.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-CDdbRDEa.js +0 -1
- package/dist/client/assets/right-BgJ4mQLf.js +0 -1
- package/dist/client/assets/right-Bk6h7o-Z.js +0 -1
- package/dist/client/assets/right-BrICCmEt.js +0 -1
- package/dist/client/assets/right-C1QIbqFZ.js +0 -1
- package/dist/client/assets/right-CfliKiHY.js +0 -1
- package/dist/client/assets/right-CtOLXB9s.js +0 -1
- package/dist/client/assets/right-DJ34yMAi.js +0 -1
- package/dist/client/assets/right-DiFmtw6d.js +0 -1
- package/dist/client/assets/right-Lx79pxpG.js +0 -1
- package/dist/client/assets/scoutbot-BJIamJOH.js +0 -3
- package/dist/client/assets/text-Faa3ZStB.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-Bpkc8ayb.js +0 -1
- /package/dist/client/assets/{text-BYAFNLNq.css → runtime-picker-BYAFNLNq.css} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,j as m}from"./index-C1VaWNuD.js";import{p as a,k as u,u as l}from"./Provider-D0bB7q6y.js";import{d as f}from"./types-B0PlfpKc.js";import{ProjectsInbox as d}from"./ProjectsInbox-Bq29DE_o.js";import{ProjectAgentProfile as j}from"./ProjectAgentProfile-Br1eTD7G.js";import{u as w}from"./projects-inbox-DFbgVlXL.js";import{i as P}from"./model-CBkMvT1w.js";/* empty css */import"./router-kfcaYqZr.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./api-Co9aQ2Jw.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./createLucideIcon-Dv8H8m7J.js";import"./conversation-model-C2KuZUXc.js";import"./time-Dhsh_2EG.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./AgentAvatar-Dz79iTxB.js";import"./SpriteAvatar-DFO4Kb4Z.js";import"./CrewAvatar-CZ_faQ_s.js";import"./ui-LM8pS8qE.js";import"./openContent-C6XO6kr5.js";import"./SessionRefScreen-DetLMkTT.js";import"./tail-events-LK29oCKm.js";import"./BackToPicker-BHicJyfc.js";import"./ConversationScreen-DIU7m_aC.js";import"./ConversationComposer-BUIjWMBi.js";import"./zap-Bcja1lHG.js";import"./message-markup-DC0QFEZn.js";import"./mentions-BZ5SBMtc.js";import"./AgentDetailCard-8viaEY8b.js";import"./AgentLiveActions-DlSKL60c.js";import"./terminal-takeover-BMeBjBB2.js";import"./eye-C9cGk5z6.js";import"./terminal-UDy4lzV1.js";import"./message-visibility-CGOmSSKs.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";/* empty css */import"./ConversationHeader-Bt2RBj93.js";import"./AstronautSuit-CwB4Dw07.js";import"./ConversationFeedRows-Bx0gFyG_.js";import"./ConversationPanels-o6W-cOoU.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CPoX8iV2.js";import"./proxy-DVDRhSRR.js";import"./activity-CzTJ-YMX.js";import"./message-circle-joGFxfj1.js";import"./ConversationStatus-CTYOywFh.js";import"./check-Dz2SRHft.js";import"./sparkles-D0vWLTyC.js";import"./SessionObserve-BVeTkcIl.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-t7-XJP-h.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CJVqIqQ2.js";import"./ObserveTextFlow-DCJ5EmD8.js";import"./SessionObserveEvidence-BkOezTGV.js";import"./wrench-BfVeded5.js";import"./external-link-BvX5PfLh.js";import"./session-ref-lookup-state-SATH_jAP.js";/* empty css */import"./CrewWorkspaces-DNX-QQ1h.js";import"./AddProjectForm-fXndbzXT.js";import"./agent-specialization-CtF_jI34.js";import"./project-overview-helpers-BQTc_Ous.js";import"./sliders-horizontal-57e99_qO.js";import"./message-square-BLiFqpe_.js";import"./useEmbedHeadline-DuUnwTB7.js";import"./api-HFH8wFyb.js";import"./cache-CeWH_KzJ.js";import"./arrow-up-right-B09GPwFl.js";import"./AgentsSubnav-Ci7uWM7P.js";import"./SecondaryNav-Cs0_FQdj.js";import"./secondaryNavConfig-C0Srrmy8.js";import"./compass-BdpImt_W.js";import"./settings-DQEtqkM9.js";import"./git-branch-Bc_eDIpG.js";import"./scroll-text-DFcBYy5J.js";import"./profile-BCvk8jOQ.js";import"./context-budget-DqxWzalx.js";import"./session-catalog-CG4oL_yN.js";import"./terminal-relay-CXHMdain.js";/* empty css */import"./AgentDefinitionsWorkspace-DHDS9Pgd.js";import"./FileViewerPane-CxNbcTYf.js";import"./agent-essentials-K9B6kbTS.js";/* empty css *//* empty css */import"./ProjectAgentProfileBar-CUzZ4Rpx.js";function h(o,r){const{model:i,loading:t}=w(o),p=n.useRef(void 0),s=n.useRef(o);s.current=o;const c=n.useCallback(e=>{if(e&&t&&i.projects.length===0){p.current=e;return}p.current=void 0,r(a(i,e,s.current))},[t,i,r]);n.useEffect(()=>(u(e=>{c(e.root)}),()=>u(null)),[c]),n.useEffect(()=>{const e=p.current;e!==void 0&&(e&&t&&i.projects.length===0||(p.current=void 0,r(a(i,e,s.current))))},[t,i,r])}function v({route:o,navigate:r,embedded:i=!1}){const t=P(o),p=t?`profile:${o.agentId}`:"index",s=!t&&x();return m.jsx("div",{className:"s-av2","data-view":t?"profile":"index",children:m.jsx("div",{className:"av2-stagePane",children:t?m.jsx(j,{route:o,navigate:r}):m.jsx(d,{route:o,navigate:r,zeroPreview:s,embedded:i})},p)})}function Ar({navigate:o,embedded:r=!1}){const{route:i}=l(),t=i.view==="agents-v2"?i:{view:"agents-v2"};return h(t,o),m.jsx("div",{className:"pi-projectsEmbedShell",children:m.jsx(v,{route:t,navigate:o,embedded:r})})}const Hr=f({id:"projects",label:"Projects",route:{view:"agents-v2"},webPath:"/projects",screen:"ProjectsEmbedScreen",embed:{path:"/embed/projects",profile:"macos.projects",ownsInternalRoutes:!0,rootClassName:"s-projects-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0}}});function x(){if(typeof window>"u")return!1;const o=window.location.hostname.toLowerCase();if(o!=="localhost"&&o!=="127.0.0.1"&&o!=="::1")return!1;const r=new URLSearchParams(window.location.search).get("zero")?.trim().toLowerCase();return r==="projects"||r==="project"||r==="1"||r==="true"}export{Ar as ProjectsEmbedScreen,v as ProjectsScreen,Hr as scoutSurface};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./index-C1VaWNuD.js";import{A as R}from"./AgentAvatar-Dz79iTxB.js";import{H as y}from"./HarnessMark-DttReffF.js";import{t as O}from"./time-Dhsh_2EG.js";import{s as P}from"./project-overview-helpers-BQTc_Ous.js";import{u as H}from"./projects-inbox-DFbgVlXL.js";import{t as T,c as B,s as C,d as L,e as z}from"./Provider-D0bB7q6y.js";import{A as g}from"./arrow-up-right-B09GPwFl.js";import"./SpriteAvatar-DFO4Kb4Z.js";import"./colors-BtO5_zlx.js";import"./CrewAvatar-CZ_faQ_s.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./router-kfcaYqZr.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./tail-events-LK29oCKm.js";import"./conversation-model-C2KuZUXc.js";import"./createLucideIcon-Dv8H8m7J.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./index-Cx6Gbr6n.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";function V(i,o,t){if(t.sessionId){const r=L(o,t);if(r)return{kind:"session",session:r};const a=z(i,t);if(a)return{kind:"thread",thread:a}}if(t.selectedAgentId){const r=i.find(l=>l.agentId===t.selectedAgentId)??null;if(r)return{kind:"thread",thread:r};const a=o.find(l=>!l.sessionId&&l.agentId===t.selectedAgentId)??null;if(a)return{kind:"session",session:a}}return null}function p({label:i,value:o}){return s.jsxs("span",{className:"pi-stat",children:[s.jsx("span",{className:"pi-statLabel",children:i}),s.jsx("span",{className:"pi-statValue",children:o})]})}function ys({route:i,navigate:o}){const{model:t,nowMs:r,loading:a,error:l}=H(i);if(!i.sessionId&&!i.selectedAgentId)return null;const d=V(t.threads,t.sessions,i);if(!d)return s.jsxs("div",{className:"s-pi s-pi-aside",children:[s.jsx("header",{className:"pi-asideHead",children:s.jsxs("div",{className:"pi-asideIdent",children:[s.jsx("div",{className:"pi-asideTop",children:s.jsx("span",{className:"pi-asideName",children:a?"Resolving selection":l?"Project data unavailable":"Selection unavailable"})}),s.jsx("div",{className:"pi-asideSub",children:s.jsxs("span",{className:"pi-asideStatus","data-tone":a?"working":"recent",children:[a?s.jsx("span",{className:"pi-asidePulse","aria-hidden":!0}):null,a?"loading":"idle"]})})]})}),s.jsx("div",{className:"pi-asideBody",children:s.jsx("p",{className:"pi-asideMuted",children:l??"The selected item is not in the current project snapshot."})})]});const n=d.kind==="thread"?d.thread:null,e=d.kind==="session"?d.session:null,m=n?.agentName??e?.agentName??"Session",h=n?.harness??e?.harness??"session",b=n?.projectTitle??e?.projectTitle??i.projectSlug??"project",x=n?.branch??e?.branch??null,c=n?.working??e?.working??!1,f=n?.needs?"needs":c?"working":"recent",I=n?.needs?"your turn":c?"working":e?"selected":"idle",k=n?.work??e?.work??"No session detail available.",v=n?.lastActivityAt??e?.lastActivityAt??0,j=e?.sessionId??n?.sessionId??null,u=n?.projectRoot??e?.projectRoot??null,N=n?T(n,i):null,w=n?B(n,i):e?C(e,i):i,A=e?e.route?.view==="conversation"?"Open conversation":e.route?.view==="sessions"?"Open session":e.agentId?"Open agent":"Open project":n?.kind==="native"?"Open session":n?.conversationId?"Open conversation":"Open agent",S={view:"agents-v2",...i.projectSlug?{projectSlug:i.projectSlug}:{},...i.indexView?{indexView:i.indexView}:{},...i.machineId?{machineId:i.machineId}:{},...i.showEphemeral?{showEphemeral:!0}:{}};return s.jsxs("div",{className:"s-pi s-pi-aside",children:[s.jsxs("header",{className:"pi-asideHead",children:[s.jsx("span",{className:"pi-asideAvatar",children:s.jsx(R,{agent:{name:m,harness:h,state:c?"in_turn":null},placement:"row",size:38})}),s.jsxs("div",{className:"pi-asideIdent",children:[s.jsxs("div",{className:"pi-asideTop",children:[s.jsx("span",{className:"pi-asideName",title:m,children:m}),s.jsx("span",{className:"pi-asideHmark","aria-hidden":!0,children:s.jsx(y,{harness:h,size:13})}),s.jsxs("span",{className:"pi-asideProj",children:["/",b]})]}),s.jsxs("div",{className:"pi-asideSub",children:[x?s.jsx("span",{className:"pi-asideBranch",children:x}):null,s.jsxs("span",{className:"pi-asideStatus","data-tone":f,children:[c?s.jsx("span",{className:"pi-asidePulse","aria-hidden":!0}):null,I]})]})]})]}),s.jsxs("div",{className:"pi-asideBody",children:[s.jsx("h2",{className:"pi-asideHeadline",children:k}),s.jsxs("div",{className:"pi-asideReadouts",children:[s.jsx(p,{label:"Last active",value:v?O(v,r):"—"}),s.jsx(p,{label:e?"Session":"Conversations",value:e?"1":String(n?.sessionCount??0)}),s.jsx(p,{label:"Harness",value:h}),n?.contextPct!=null?s.jsx(p,{label:"Context",value:`${n.contextPct}%`}):null]}),e?s.jsxs("div",{className:"pi-asideSection",children:[s.jsx("div",{className:"pi-asideSectionHead",children:"Session context"}),s.jsxs("div",{className:"pi-asideLine",children:[j?s.jsxs("span",{title:j,children:["ref · ",j]}):s.jsx("span",{children:"No stable session reference yet."}),u?s.jsxs("span",{title:u,children:["root · ",P(u)]}):null,e.conversationId?s.jsxs("span",{title:e.conversationId,children:["conversation · ",e.conversationId]}):null]})]}):null,s.jsxs("div",{className:"pi-asideActions",children:[s.jsxs("button",{type:"button",className:"pi-asideBtn pi-asideBtnPrimary",onClick:()=>o(w),children:[A,s.jsx(g,{size:13,strokeWidth:2,"aria-hidden":!0})]}),N?s.jsxs("button",{type:"button",className:"pi-asideBtn",onClick:()=>o(N),children:["Observe",s.jsx(g,{size:13,strokeWidth:2,"aria-hidden":!0})]}):null,s.jsx("button",{type:"button",className:"pi-asideBtn",onClick:()=>o(S),children:"Clear"})]})]})]})}export{ys as ProjectsThreadAside};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,j as d,a1 as Je,b as Ut,y as $t,a2 as Vt,a3 as qt,K as Ht}from"./index-C1VaWNuD.js";import{h as ct,b as Wt,au as zt}from"./router-kfcaYqZr.js";import{a as V}from"./api-Co9aQ2Jw.js";import{u as Jt}from"./sse-B29iGBnw.js";import{o as Kt,i as Ke}from"./surface-activity-B1rgWB1i.js";import{i as Gt}from"./colors-BtO5_zlx.js";import{e as lt,s as Qt,i as Ge,r as Yt,b as Xt,f as Zt}from"./scoutbot-D7kGGyK_.js";import{d as en,c as tn,e as nn,f as rn,I as Oe,J as on,N as sn,l as we,K as Qe,j as Ye}from"./NewChatComposer-D2Ah4T-W.js";import{o as ut,a as an,c as cn,d as ln,h as Le,e as dt}from"./model-CBkMvT1w.js";import{F as un,a as dn,D as fn}from"./DocumentFocusViewer-D8iB6SMt.js";import{c as ft,T as pt}from"./TextDocumentSurface-2X1Gw4eA.js";import{C as pn}from"./chevron-right-CowuvuE6.js";import{F as hn}from"./file-text-BHro8MkG.js";import{c as mn}from"./createLucideIcon-Dv8H8m7J.js";import{C as gn}from"./code-xml-CkkNdRmu.js";import{A as vn}from"./arrow-left-eToA6GxC.js";import{A as wn}from"./arrow-right-DTX42clh.js";import{j as bn}from"./scout-voice-Cg1qfepC.js";import{i as yn}from"./keyboard-nav-B8sQ_8IF.js";import{u as Sn}from"./chunk-HRAB3GC3-KjjrTLCU.js";const ht={current:null,setMenu:null};function Po(){return i.useCallback((e,t)=>{e.preventDefault(),e.stopPropagation(),ht.setMenu?.({position:{x:e.clientX,y:e.clientY},items:t})},[])}function kn({children:e}){const[t,n]=i.useState(null),r=i.useRef(null);ht.setMenu=n;const o=i.useCallback(()=>{n(null)},[]);return i.useEffect(()=>{if(!t)return;const s=f=>{f.target instanceof Node&&r.current?.contains(f.target)||o()},a=f=>{f.key==="Escape"&&o()},u=()=>o(),l=f=>{f.defaultPrevented||o()};return window.addEventListener("mousedown",s,!0),window.addEventListener("keydown",a),window.addEventListener("wheel",u,!0),window.addEventListener("contextmenu",l),()=>{window.removeEventListener("mousedown",s,!0),window.removeEventListener("keydown",a),window.removeEventListener("wheel",u,!0),window.removeEventListener("contextmenu",l)}},[t,o]),i.useLayoutEffect(()=>{if(!t||!r.current)return;const s=r.current,a=s.getBoundingClientRect(),u=window.innerWidth,l=window.innerHeight;let f=t.position.x,c=t.position.y;f+a.width>u-8&&(f=u-a.width-8),c+a.height>l-8&&(c=l-a.height-8),f<8&&(f=8),c<8&&(c=8),s.style.left=`${f}px`,s.style.top=`${c}px`,s.style.visibility="visible"},[t]),d.jsxs(d.Fragment,{children:[e,t&&d.jsx("div",{ref:r,className:"s-context-menu",style:{left:t.position.x,top:t.position.y,visibility:"hidden"},role:"menu",onMouseDown:s=>s.stopPropagation(),children:t.items.map((s,a)=>s.kind==="separator"?d.jsx("div",{className:"s-context-menu-sep",role:"separator"},a):d.jsxs("button",{type:"button",className:"s-context-menu-item",role:"menuitem",onClick:()=>{s.onSelect(),o()},children:[d.jsx("span",{className:"s-context-menu-label",children:s.label}),s.shortcut&&d.jsx("span",{className:"s-context-menu-shortcut",children:s.shortcut})]},a))})]})}function An(e){const t=e instanceof Error?e.message:String(e);return En(t)?"Scout server is unreachable":t}function Cn(e){return e==="Scout server is unreachable"}function En(e){return/failed to fetch|fetch failed|networkerror|load failed|couldn'?t connect|could not connect|connection refused|econnrefused|server is unreachable/i.test(e)}const In=["codex","claude","grok","grok-acp","kimi","flue","cursor","opencode","native","worker","bridge","http","pi"],Re="openscout.operator.name",xn=new Set(["operator","you","user","unknown","null","undefined"]);function mt(e){const t=e?.trim();return!t||t.length>64||xn.has(t.toLowerCase())?null:t}function Rn(){if(typeof window>"u")return null;try{return mt(window.localStorage.getItem(Re))}catch{return null}}function Tn(e){if(!(typeof window>"u"))try{const t=mt(e);t?window.localStorage.setItem(Re,t):window.localStorage.removeItem(Re)}catch{}}const jn=new Set(In);function _e(e){const t=e?.trim().toLowerCase().replace(/_/gu,"-")??"",n=t==="claude-code"||t==="claude-stream-json"?"claude":t==="codex-app-server"||t==="codex-exec"?"codex":t==="pi-rpc"?"pi":t;return jn.has(n)?n:null}function Ce(e){const t=e?.trim();if(!t)return null;const n=t.split(/[\\/]/u).filter(Boolean).at(-1)??t;return n.endsWith(".jsonl")?n.slice(0,-6):n}function Pe(e){const t=e?.trim();if(!t)return null;if(t.startsWith("session:")){const r=t.slice(8),o=r.indexOf(":");if(o>0){const a=_e(r.slice(0,o)),u=Ce(r.slice(o+1));if(a&&u)return{refId:u,harness:a,qualified:!0}}const s=Ce(r);return s?{refId:s,harness:null,qualified:!1}:null}const n=Ce(t);return n?{refId:n,harness:null,qualified:!1}:null}function gt(e,t){const n=Pe(t);if(!n)return null;if(n.qualified)return`session:${n.harness}:${n.refId}`;const r=_e(e);return r?`session:${r}:${n.refId}`:n.refId}function Ee(e,t){const n=t?.trim();n&&e.add(n)}function Nn(e,t){const n=new Set;return Ee(n,e.authorityNodeId),Ee(n,e.homeNodeId),n.size===0&&Ee(n,t),n}function vt(e,t,n){return t?Nn(e,n).has(t):!0}function wt(e,t,n){return t?e.filter(r=>vt(r,t,n)):e}function Mo(e,t,n){return t?new Set(e.filter(r=>vt(r,t,n)).map(r=>r.id)):null}function Y(e,t,n){return!t&&!n||n&&e.authorityNodeId===n?!0:t?e.agentId&&t.has(e.agentId)||e.actorId&&t.has(e.actorId)||e.ownerId&&t.has(e.ownerId)||e.nextMoveOwnerId&&t.has(e.nextMoveOwnerId)?!0:!!e.participantIds?.some(r=>t.has(r)):!1}function On(e,t,n){return Y(e,t,n)}function Do(e,t,n){return!t&&!n?e:e.filter(r=>On(r,t,n))}function Ln(e,t){return Y(e,t)}function _n(e,t){return t?e.filter(n=>Ln(n,t)):e}function Xe(e,t){return Y(e,t)}function Bo(e,t){if(!e||!t)return e;const n=e.activeAsks.filter(a=>Y(a,t)),r=e.recentCompleted.filter(a=>Y(a,t)),o=e.needsAttention.filter(a=>Y(a,t)),s=_n(e.activity,t);return{...e,totals:{active:n.length,recentCompleted:r.length,needsAttention:o.length,activity:s.length},activeAsks:n,recentCompleted:r,needsAttention:o,activity:s}}function Fo(e,t){if(!t)return e;const n=e.activeFlights.filter(s=>Y(s,t)),r=e.childWork.filter(s=>Xe(s,t));return Xe(e,t)||n.length>0||r.length>0?{...e,activeFlights:n,childWork:r}:null}function Pn(e){const t=e.id.trim();return t.startsWith("session-")||t.startsWith("local-session-agent-")}function bt(e){return!!(Pn(e)||e.handle?.trim().toLowerCase()?.startsWith("session-")||e.definitionId?.trim().toLowerCase()?.startsWith("session-")||/^session\s+/i.test(e.name.trim())||`${e.selector??""} ${e.defaultSelector??""}`.toLowerCase().includes("@session-"))}function Mn(e){return!!(e.project?.trim()||e.projectRoot?.trim())}function Dn(e){const t=e.handle?.trim();if(t&&!t.toLowerCase().startsWith("session-")||e.role?.trim())return!0;const n=e.definitionId?.trim();return!!(n&&!n.toLowerCase().startsWith("session-")&&!n.toLowerCase().startsWith("local-session-agent-"))}function yt(e){return e.retiredFromFleet||e.staleLocalRegistration||e.agentClass==="organic"||bt(e)?!1:Mn(e)||Dn(e)}function Uo(e){return e.filter(yt)}const St=1440*6e4;function $o(e,t){const n=r=>JSON.stringify([r.activeAsks,r.needsAttention]);return e&&n(e)===n(t)?e:t}function Bn(e){const t=new Map;for(const n of e?.activeAsks??[]){const r=t.get(n.agentId)??[];r.push(n),t.set(n.agentId,r)}return t}function Fn(e){const t=new Map,n=(r,o)=>{if(!r)return;const s=t.get(r)??[];s.push(o),t.set(r,s)};for(const r of e?.needsAttention??[])n(r.agentId,{title:r.title,summary:r.summary,conversationId:r.conversationId,updatedAt:r.updatedAt});for(const r of t.values())r.sort((o,s)=>s.updatedAt-o.updatedAt);return t}function kt(e){return e?e.charAt(0).toUpperCase()+e.slice(1):"Harness"}function At(e){return e.length===1?e[0]??null:e.length>1?`${e.length} branches`:null}function Un(e,t,n,r){const o=e.group,s=o.nodes.flatMap(R=>n.get(R.row.agent.id)??[]).sort((R,b)=>b.updatedAt-R.updatedAt)[0]??null,a=!!s,u=!a&&o.nodes.some(R=>Oe(R.row)),l=cn(o,r),f=a?"needs":u?"working":"recent",c=a?"needs":u||l?"live":"idle",v=e.leadAgent,S=s?.conversationId??t.get(v.id)??v.conversationId??null;return{id:`${e.projectSlug}:agent:${v.id}`,kind:"agent",projectSlug:e.projectSlug,projectTitle:e.projectTitle,projectRoot:e.projectRoot,workspaceRoot:v.cwd??v.projectRoot??e.projectRoot,agentId:v.id,agentName:o.name,harness:Le(o.harness),branch:At(o.branches),work:s?.summary?.trim()||s?.title.trim()||ln(e,c),group:f,needs:a,working:u,lastActivityAt:o.lastActivityAt,sessionCount:o.sessionCount,contextPct:null,conversationId:S,sessionId:null}}function $n(e){return e&&e.view==="sessions"&&e.sessionId?e.sessionId:null}function Vn(e,t,n){const r=Le(t.harness);return{id:`${e.slice.slug}:native:${t.key}`,kind:"native",projectSlug:e.slice.slug,projectTitle:e.slice.title,projectRoot:e.slice.root,workspaceRoot:e.slice.root,agentId:null,agentName:`${kt(r)} session`,harness:r,source:t.harness,branch:null,work:dt(t.detail??t.label)||t.label,group:"working",needs:!1,working:!0,lastActivityAt:t.lastActivityAt??n,sessionCount:1,contextPct:null,conversationId:null,sessionId:$n(t.route)}}function qn(e,t){return e.status==="active"||e.status==="workflow"?"working":(e.lastActivityAt&&t-e.lastActivityAt<St,"recent")}function Se(e){return e?e.view==="sessions"?e.sessionId??null:e.view==="conversation"?e.conversationId:null:null}function Te(e){return!!Se(e.route)}function je(e,t,n,r,o,s){const a=Le(t.harness),u=Se(t.route),l=t.status==="active"||t.status==="workflow";return{id:`${e.slice.slug}:session:${t.key}`,kind:"session",projectSlug:e.slice.slug,projectTitle:e.slice.title,projectRoot:e.slice.root,workspaceRoot:r?.cwd??r?.projectRoot??e.slice.root,agentId:r?.id??null,agentName:r?.name??`${kt(a)} session`,harness:a,source:t.harness,branch:At(o?[o]:[]),work:dt(t.detail??t.label)||t.label,group:qn(t,n),needs:!1,working:l,lastActivityAt:t.lastActivityAt??n,latestReplyAt:s?.ts??null,latestReplyPreview:s?.summary.trim()||null,sessionCount:1,contextPct:null,conversationId:t.route?.view==="conversation"?t.route.conversationId:null,sessionId:t.route?.view==="sessions"?t.route.sessionId??u:u,route:t.route}}function Ct(e){const t=e?.trim();if(!t)return null;const n=t.split(/[\\/]/u).filter(Boolean).at(-1)??t;return n.endsWith(".jsonl")?n.slice(0,-6):n}function ne(e,t){const n=Ct(t);return n?`${_e(e)??e.trim().toLowerCase()}\0${n}`:null}function Hn(e){if(!e.raw||typeof e.raw!="object"||Array.isArray(e.raw))return null;const t=e.raw.payload;if(!t||typeof t!="object"||Array.isArray(t))return null;const n=t.role;return typeof n=="string"?n.trim().toLowerCase():null}function Wn(e){const t=e.trim();if(!t.startsWith("{"))return!1;if(t.startsWith('{"risk_level":')&&t.includes('"user_authorization":')&&t.includes('"outcome":')&&t.includes('"rationale":'))return!0;try{const n=JSON.parse(t);return typeof n.risk_level=="string"&&typeof n.user_authorization=="string"&&typeof n.outcome=="string"&&typeof n.rationale=="string"}catch{return!1}}function zn(e){if(e.kind!=="assistant")return!1;const t=e.summary.trim();if(!t||/^\[(?:assistant|message)\]$/iu.test(t))return!1;const n=Hn(e);return n&&n!=="assistant"?!1:!Wn(t)}function Jn(e){const t=new Map;for(const n of e){if(!zn(n))continue;const r=ne(n.source,n.sessionId);if(!r)continue;const o=t.get(r);(!o||n.ts>o.ts)&&t.set(r,n)}return t}function Kn(e,t,n){const r=[];for(const o of e.agents)for(const s of o.sessions)Te(s)&&r.push(je(e,s,t,o.row.agent,o.row.branch,n.get(ne(s.harness,Se(s.route))??"")??null));for(const o of e.unassigned)Te(o)&&r.push(je(e,o,t,void 0,void 0,n.get(ne(o.harness,Se(o.route))??"")??null));return r.sort((o,s)=>s.lastActivityAt-o.lastActivityAt||o.agentName.localeCompare(s.agentName))}function Gn(e,t,n,r){const o=new Set;for(const s of t){const a=ne(s.source??s.harness,s.sessionId);a&&o.add(a)}for(const s of e)for(const a of s.agents){if(!a.sessions.some(Te))continue;const u=a.row.agent,l=ne(u.harness??a.row.harness,u.harnessSessionId);l&&o.add(l)}for(const s of e)for(const a of s.agents){const u=a.row.agent;if(!bt(u))continue;const l=u.harness?.trim()||a.row.harness,f=Ct(u.harnessSessionId),c=ne(l,f);if(!f||!c||o.has(c))continue;o.add(c);const v=Oe(a.row),S={key:`fallback:${u.id}`,status:v?"active":"idle",harness:l,label:u.name,detail:a.row.activeTask??u.harnessLogPath??f,lastActivityAt:a.row.lastActivityAt??u.createdAt??n,route:{view:"sessions",sessionId:f}};t.push(je(s,S,n,u,a.row.branch,r.get(c)??null))}t.sort((s,a)=>a.lastActivityAt-s.lastActivityAt||s.agentName.localeCompare(a.agentName))}function Qn(e){const t=new Map,n=(r,o,s,a)=>{const u=t.get(r);if(!u){t.set(r,{root:r,branch:o,working:s,lastActivityAt:a});return}(s||!u.branch)&&o&&(u.branch=o),u.working||=s,u.lastActivityAt=Math.max(u.lastActivityAt,a)};for(const r of e.agents){const o=r.row.agent.cwd??r.row.agent.projectRoot??e.slice.root;if(!o)continue;const s=r.row.branch&&r.row.branch!=="—"?r.row.branch:null;n(o,s,Oe(r.row),r.row.lastActivityAt??0)}for(const r of e.slice.nativeSessions)r.cwd&&n(r.cwd,null,r.status==="active",r.lastActivityAt??0);return t.size===0&&e.slice.root&&n(e.slice.root,null,!1,e.lastActivityAt??0),[...t.values()].sort((r,o)=>Number(o.working)-Number(r.working)||o.lastActivityAt-r.lastActivityAt||r.root.localeCompare(o.root))}function Ze(e,t){return e.needs?3:e.working?2:t-e.lastActivityAt<St?1:0}function Vo(e){const{nowMs:t,showEphemeral:n}=e,r=wt(e.agents,e.machineId),o=Bn(e.fleet),s=Fn(e.fleet),{conversationByAgentId:a,sessionByAgentId:u}=en(e.sessions),l=r.map(p=>tn(p,u.get(p.id)??null,o.get(p.id)??[])),f=nn(e.discovery,t),c=rn(l,e.sessions,f),v=an(c,n).filter(p=>yt(p.leadAgent)),S=Jn(e.recentEvents??[]),R=v.map(p=>Un(p,a,s,t));for(const p of c)for(const g of p.unassigned)g.kind!=="native"||g.status!=="active"||!g.route||R.push(Vn(p,g,t));R.sort((p,g)=>Ze(g,t)-Ze(p,t)||g.lastActivityAt-p.lastActivityAt);const b=c.flatMap(p=>Kn(p,t,S));Gn(c,b,t,S);const y=new Map;for(const p of R){const g=y.get(p.projectSlug)??[];g.push(p),y.set(p.projectSlug,g)}const m=new Map;for(const p of b){const g=m.get(p.projectSlug)??[];g.push(p),m.set(p.projectSlug,g)}const N=c.map(p=>{const g=y.get(p.slice.slug)??[],P=m.get(p.slice.slug)??[],O=[...new Set(p.agents.map(w=>w.row.branch).filter(w=>!!w&&w!=="—"&&w!=="main"))],k=Qn(p);return{slug:p.slice.slug,title:p.slice.title,root:p.slice.root,agentCount:1,sessionCount:P.length,liveSessionCount:P.filter(w=>w.working).length,worktreeCount:k.length,worktrees:k,needs:g.filter(w=>w.needs).length,working:g.filter(w=>w.working).length,threadCount:g.length,lastActivityAt:p.lastActivityAt,branches:O}});return N.sort((p,g)=>ke(g)-ke(p)||g.lastActivityAt-p.lastActivityAt||p.title.localeCompare(g.title)),Xn({projects:N,threads:R,sessions:b,projectAliases:{}})}function ke(e){return e.needs>0?2:e.working>0?1:0}function et(e){return e?/\/(?:\.codex|\.claude|\.agents?)\/worktrees\/[^/]+\//iu.test(e)||/\/\.worktrees\/[^/]+/iu.test(e):!1}function tt(e){return e.replace(/^\/Users\/[^/]+(?=\/)/u,"~").replace(/\/+$/u,"")}function Yn(e){const t=new Map;for(const n of e)for(const r of n.worktrees){const o=t.get(r.root);if(!o){t.set(r.root,{...r});continue}o.branch??=r.branch,o.working||=r.working,o.lastActivityAt=Math.max(o.lastActivityAt,r.lastActivityAt)}return[...t.values()].sort((n,r)=>Number(r.working)-Number(n.working)||r.lastActivityAt-n.lastActivityAt||n.root.localeCompare(r.root))}function Xn(e){const t=new Map;for(const c of e.projects){if(!c.root||!et(c.root))continue;const v=e.projects.filter(S=>S.slug!==c.slug&&!et(S.root)&&S.worktrees.some(R=>tt(R.root)===tt(c.root)));v.length===1&&t.set(c.slug,v[0].slug)}if(t.size===0)return e;const n=new Map(e.projects.map(c=>[c.slug,c])),r=c=>{const v=t.get(c.projectSlug);if(!v)return c;const S=n.get(v);return{...c,projectSlug:S.slug,projectTitle:S.title,projectRoot:S.root}},o=c=>{const v=t.get(c.projectSlug);if(!v)return c;const S=n.get(v);return{...c,projectSlug:S.slug,projectTitle:S.title,projectRoot:S.root}},s=e.threads.map(r),a=e.sessions.map(o),u=new Map;for(const c of e.projects){const v=t.get(c.slug)??c.slug,S=u.get(v)??[];S.push(c),u.set(v,S)}const l=[...u.entries()].map(([c,v])=>{const S=n.get(c),R=s.filter(m=>m.projectSlug===c),b=a.filter(m=>m.projectSlug===c),y=Yn(v);return{...S,agentCount:1,sessionCount:b.length,liveSessionCount:b.filter(m=>m.working).length,worktreeCount:y.length,worktrees:y,needs:R.filter(m=>m.needs).length,working:R.filter(m=>m.working).length,threadCount:R.length,lastActivityAt:Math.max(...v.map(m=>m.lastActivityAt)),branches:[...new Set(v.flatMap(m=>m.branches))]}});l.sort((c,v)=>ke(v)-ke(c)||v.lastActivityAt-c.lastActivityAt||c.title.localeCompare(v.title));const f={...e.projectAliases};for(const[c,v]of t)f[c]=v;return{projects:l,threads:s,sessions:a,projectAliases:f}}function Ie(e){return e.replace(/^\/Users\/[^/]+(?=\/)/u,"~").replace(/\/+$/u,"")}function Zn(e,t){if(!t?.trim())return null;const n=Ie(t.trim());for(const r of e.projects){if(r.root&&Ie(r.root)===n)return nt(e,r.slug)??r.slug;for(const o of r.worktrees)if(Ie(o.root)===n)return nt(e,r.slug)??r.slug}return null}function nt(e,t){if(e.projects.some(o=>o.slug===t))return t;let n=t;const r=new Set;for(;Object.hasOwn(e.projectAliases,n);){if(r.has(n))return null;r.add(n),n=e.projectAliases[n]}return e.projects.some(o=>o.slug===n)?n:null}function qo(e,t,n){const r=new Set(n.map(s=>s.slug)),o={...t};for(const[s,a]of Object.entries(e??{}))r.has(s)||!r.has(a)||o[s]||(o[s]=a);return o}function Ho(e,t){return e.filter(n=>n.projectSlug===t)}function Wo(e,t){return e.filter(n=>n.projectSlug===t)}const er=["needs","working","recent"],tr={needs:"Your turn",working:"In flight",recent:"Recent"};function zo(e){const t=new Map;for(const n of e){const r=t.get(n.group)??[];r.push(n),t.set(n.group,r)}return er.filter(n=>t.has(n)).map(n=>({group:n,label:tr[n],items:t.get(n)}))}function X(e){return{view:"agents-v2",...e.projectSlug?{projectSlug:e.projectSlug}:{},...e.machineId?{machineId:e.machineId}:{}}}function Ae(e){return e.kind!=="native"||!e.sessionId?null:gt(e.source??e.harness,e.sessionId)}function nr(e,t){const n=t.projectSlug?e.filter(l=>l.projectSlug===t.projectSlug):e;if(t.selectedAgentId){const l=n.filter(f=>f.agentId===t.selectedAgentId);return l.length===1?l[0]:null}const r=t.sessionId?.trim();if(!r)return null;const o=n.filter(l=>Ae(l)===r);if(o.length===1)return o[0];const s=Pe(r);if(o.length>1||s?.qualified)return null;const a=s?.refId??r,u=n.filter(l=>l.kind==="native"&&l.sessionId===a);return u.length===1?u[0]:null}function Jo(e,t,n){return nr(n,t)===e}function Ko(e,t){return e.kind==="native"?{...X(t),sessionId:Ae(e)??void 0}:{...X(t),selectedAgentId:e.agentId??void 0}}function Go(e,t){const n=Ae(e);return n?{view:"sessions",sessionId:n}:e.conversationId?{view:"conversation",conversationId:e.conversationId}:e.agentId?ut(t,e.agentId):X(t)}function Qo(e,t){const n=Ae(e);return n?{view:"sessions",sessionId:n}:e.agentId?{...ut(t,e.agentId),tab:"observe"}:null}function Yo(e,t){const n=Me(e);return n?{...X(t),indexView:"sessions",...n?{sessionId:n}:{},selectedAgentId:void 0}:X(t)}function Xo(e,t,n){return rr(n,t)===e}function Me(e){return e.conversationId&&e.route?.view==="conversation"?e.conversationId:e.sessionId?gt(e.source??e.harness,e.sessionId):e.conversationId?e.conversationId:null}function rr(e,t){const n=t.sessionId?.trim();if(!n)return null;const r=t.projectSlug?e.filter(l=>l.projectSlug===t.projectSlug):e,o=r.filter(l=>Me(l)===n);if(o.length===1)return o[0];const s=Pe(n);if(o.length>1||s?.qualified)return null;const a=s?.refId??n,u=r.filter(l=>l.sessionId===a||l.conversationId===a||l.id===a);return u.length===1?u[0]:null}function Zo(e,t){const n=Me(e);return n?{...X(t),projectSlug:e.projectSlug,indexView:"sessions",sessionId:n,selectedAgentId:void 0}:{...X(t),projectSlug:e.projectSlug,indexView:"sessions",selectedAgentId:void 0,sessionId:void 0}}function es(e,t,n){const r=t?Zn(e,t):null;return{view:"agents-v2",...r?{projectSlug:r}:{},...n.machineId?{machineId:n.machineId}:{},...n.showEphemeral?{showEphemeral:!0}:{}}}let Et=null;function ts(e){Et=e}function or(e,t){Et?.(e,t)}const sr=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ir=mn("chevron-up",sr),ar={id:"audio",canHandle:e=>e.kind==="file"&&e.mediaType.startsWith("audio/"),render:({resource:e})=>{const t=e;return d.jsx("div",{className:"s-file-preview-media-wrap",children:d.jsx("div",{className:"s-file-preview-audio-stage",children:d.jsx("audio",{className:"s-file-preview-audio",src:t.rawUrl,controls:!0})})})}},cr={id:"binary",canHandle:()=>!0,render:({resource:e})=>{const t=e;return d.jsxs("div",{className:"s-file-preview-callout",children:[d.jsxs("div",{className:"s-file-preview-callout-title",children:[t.previewReason," — open in OS"]}),d.jsxs("div",{className:"s-file-preview-callout-copy",children:["Scout can resolve this file, but it does not have an inline preview for ",t.mediaType," yet."]})]})}},lr=new Set(["text/typescript","text/javascript","text/css","text/html","application/json","text/yaml","text/toml","text/x-shellscript","text/plain"]),ur={id:"code",canHandle:e=>e.kind==="file"&&e.previewable&&lr.has(e.mediaType),render:({resource:e})=>{const t=e,n=ft({id:t.realPath,title:t.title,uri:t.realPath,mediaType:t.mediaType,value:t.content,filename:t.title,kind:"code",readOnly:!0});return d.jsx(pt,{document:n,mode:"read",className:"s-doc-focus-document"})}},dr={id:"directory",canHandle:e=>e.kind==="directory",render:({resource:e,openFilePreview:t})=>{const n=e,r=fr(n.realPath,n.rootPath);return d.jsxs("div",{className:"s-file-preview-directory",children:[d.jsx("div",{className:"s-file-preview-breadcrumb","aria-label":"Directory breadcrumb",children:r.map((o,s)=>{const a=s===r.length-1;return d.jsxs("div",{className:"s-file-preview-breadcrumb-item",children:[s>0&&d.jsx(pn,{size:12,"aria-hidden":"true"}),a?d.jsx("span",{className:"s-file-preview-breadcrumb-current",children:o.label}):d.jsx("button",{type:"button",className:"s-file-preview-breadcrumb-link",onClick:()=>t(o.path),children:o.label})]},o.path)})}),d.jsxs("div",{className:"s-file-preview-directory-list",role:"list",children:[n.entries.map(o=>d.jsxs("button",{type:"button",className:"s-file-preview-entry",onClick:()=>t(o.path),children:[d.jsx("span",{className:"s-file-preview-entry-icon","aria-hidden":"true",children:o.kind==="directory"?d.jsx(un,{size:14}):d.jsx(hn,{size:14})}),d.jsx("span",{className:"s-file-preview-entry-name",children:o.name}),d.jsx("span",{className:"s-file-preview-entry-kind",children:o.kind==="directory"?"dir":"file"})]},o.realPath)),n.entries.length===0&&d.jsx("div",{className:"s-file-preview-directory-empty",children:"This directory is empty."})]})]})}};function fr(e,t){const n=t==="/"?"/":t.replace(/\/+$/u,""),r=e==="/"?"/":e.replace(/\/+$/u,""),o=n.split("/").filter(Boolean),s=r.split("/").filter(Boolean),a=[{label:o[o.length-1]??"/",path:n||"/"}];let u=n||"/";for(let l=o.length;l<s.length;l+=1){const f=s[l];f&&(u=u==="/"?`/${f}`:`${u}/${f}`,a.push({label:f,path:u}))}return a}const pr={id:"html",canHandle:e=>e.kind==="file"&&e.previewable&&e.mediaType==="text/html",render:({resource:e})=>d.jsx("div",{className:"s-file-preview-html-wrap",children:d.jsx("iframe",{className:"s-file-preview-html-frame",src:e.kind==="file"?e.rawUrl:"",title:e.title,sandbox:"allow-forms allow-popups allow-popups-to-escape-sandbox allow-scripts",referrerPolicy:"no-referrer"})})},hr={id:"image",canHandle:e=>e.kind==="file"&&e.mediaType.startsWith("image/"),render:({resource:e})=>d.jsx("div",{className:"s-file-preview-image-wrap",children:d.jsx("div",{className:"s-file-preview-image-stage",children:d.jsx("img",{className:"s-file-preview-image",src:e.kind==="file"?e.rawUrl:"",alt:e.title})})})},mr={id:"markdown",canHandle:e=>e.kind==="file"&&e.previewable&&e.mediaType==="text/markdown",render:({resource:e})=>{const t=e,n=ft({id:t.realPath,title:t.title,uri:t.realPath,mediaType:t.mediaType,value:t.content,filename:t.title,kind:"markdown",readOnly:!0});return d.jsx(pt,{document:n,mode:"preview",className:"s-doc-focus-document"})}},gr={id:"video",canHandle:e=>e.kind==="file"&&e.mediaType.startsWith("video/"),render:({resource:e})=>{const t=e;return d.jsx("div",{className:"s-file-preview-media-wrap",children:d.jsx("div",{className:"s-file-preview-media-stage",children:d.jsx("video",{className:"s-file-preview-video",src:t.rawUrl,controls:!0})})})}},vr=[dr,mr,pr,ur,hr,gr,ar,cr];function wr({path:e,onOpenPath:t,onOpenInCode:n,onClose:r}){const[o,s]=i.useState(null),[a,u]=i.useState(null),[l,f]=i.useState(!1),[c,v]=i.useState(null),S=i.useRef(null);i.useEffect(()=>{S.current=c},[c]),i.useEffect(()=>{if(!e){s(null),u(null),f(!1);return}let k=!1;return f(!0),u(null),s(null),V(`/api/file/preview?path=${encodeURIComponent(e)}`).then(w=>{k||(s(w),br(w,S.current,v))}).catch(w=>{k||u(w instanceof Error?w.message:"could not load file")}).finally(()=>{k||f(!1)}),()=>{k=!0}},[e]);const{currentIndex:R,prevPath:b,nextPath:y}=i.useMemo(()=>{if(!o||o.kind!=="file"||!c)return{currentIndex:-1,prevPath:null,nextPath:null};const k=c.files.findIndex(w=>w.realPath===o.realPath);return k<0?{currentIndex:-1,prevPath:null,nextPath:null}:{currentIndex:k,prevPath:k>0?c.files[k-1].path:null,nextPath:k<c.files.length-1?c.files[k+1].path:null}},[o,c]);if(i.useEffect(()=>{if(!e)return;const k=w=>{if(w.key==="Escape"){r();return}if(w.target instanceof HTMLElement){const C=w.target.tagName;if(C==="INPUT"||C==="TEXTAREA"||w.target.isContentEditable)return}w.metaKey||w.ctrlKey||w.altKey||(w.key==="ArrowLeft"&&b?(w.preventDefault(),t(b)):w.key==="ArrowRight"&&y?(w.preventDefault(),t(y)):w.key==="Backspace"&&c&&o?.kind==="file"&&(w.preventDefault(),t(c.dirPath)))};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[e,r,t,b,y,c,o]),!e)return null;const m=()=>{V("/api/file/reveal",{method:"POST",body:JSON.stringify({path:o?.realPath??e})}).catch(k=>{u(k instanceof Error?k.message:"reveal failed")})},N=o?vr.find(k=>k.canHandle(o))??null:null,p=!!(o&&o.kind==="file"&&c&&R>=0&&c.files.length>1),g=[];p&&c&&g.push({label:`Folder: ${c.dirTitle}`,icon:d.jsx(ir,{size:12}),onClick:()=>t(c.dirPath),title:`Back to ${c.dirTitle} (Backspace)`}),g.push({label:"Open in Code",icon:d.jsx(gn,{size:12}),onClick:()=>{o?.kind==="file"&&n(o.realPath,o.rootPath)},title:"Continue with this file in Scout’s Code browser",disabled:o?.kind!=="file"}),g.push({label:"Show in folder",icon:d.jsx(dn,{size:12}),onClick:m,title:"Show this file in its operating system folder",hideLabel:!0});const P=o?Sr(o):[];p&&P.unshift(`${R+1} / ${c.files.length}`);const O=o&&N?N.render({resource:o,openFilePreview:t}):null;return d.jsx(fn,{open:!0,kind:yr(o),document:null,title:o?.title??e.split("/").pop()??"File",eyebrow:"File preview",subtitle:o?.realPath??e,meta:P,state:l?"Loading…":null,error:a,body:O?d.jsxs("div",{className:`s-file-preview-shell${p?" s-file-preview-shell-nav":""}`,children:[p&&d.jsx("button",{type:"button",className:"s-file-preview-side-nav s-file-preview-side-nav-left",onClick:()=>b&&t(b),disabled:!b,"aria-label":"Previous file",title:"Previous file (←)",children:d.jsx(vn,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}),d.jsx("div",{className:"s-file-preview-shell-body",children:O}),p&&d.jsx("button",{type:"button",className:"s-file-preview-side-nav s-file-preview-side-nav-right",onClick:()=>y&&t(y),disabled:!y,"aria-label":"Next file",title:"Next file (→)",children:d.jsx(wn,{size:18,strokeWidth:1.8,"aria-hidden":"true"})})]}):null,actions:g,onClose:r})}function br(e,t,n){if(e.kind==="directory"){const o=e.entries.filter(s=>s.kind==="file");n({dirPath:e.path,dirTitle:e.title,files:o});return}if(!t){n(null);return}t.files.some(o=>o.realPath===e.realPath)||n(null)}function yr(e){return!e||e.kind==="directory"||e.mediaType==="text/markdown"||e.mediaType==="text/plain"?"doc":"code"}function Sr(e){return e.kind==="directory"?[`${e.entries.length} ${e.entries.length===1?"entry":"entries"}`]:[...e.previewable&&e.truncated?["truncated"]:[],kr(e.sizeBytes),e.mediaType]}function kr(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}const It={activity:"idle",brief:{lastDeliveredAt:null},reminders:{dueCount:0,upcomingCount:0,due:[],next:null},voice:{available:null,setupBlocked:!1,replies:!1},error:null,session:{title:null,lastActivityAt:null},conversation:{messageCount:0,loading:!0}},Q=()=>{},xt={focusScoutbot:Q,triggerBrief:Q,triggerAskState:Q,toggleVoiceReplies:Q,openScoutbotSettings:Q,startNewChat:Q,dismissReminder:Q,askReminderStatus:Q},De=i.createContext(null);function Ar({children:e}){const[t,n]=i.useState(It),r=i.useRef(xt),o=i.useCallback(l=>{n(f=>Cr(f,l)?f:l)},[]),s=i.useCallback(l=>{r.current=l},[]),a=i.useMemo(()=>({focusScoutbot:()=>r.current.focusScoutbot(),triggerBrief:()=>r.current.triggerBrief(),triggerAskState:()=>r.current.triggerAskState(),toggleVoiceReplies:()=>r.current.toggleVoiceReplies(),openScoutbotSettings:()=>r.current.openScoutbotSettings(),startNewChat:()=>r.current.startNewChat(),dismissReminder:l=>r.current.dismissReminder(l),askReminderStatus:l=>r.current.askReminderStatus(l)}),[]),u=i.useMemo(()=>({state:t,actions:a,publishState:o,registerActions:s}),[t,a,o,s]);return d.jsx(De.Provider,{value:u,children:e})}function ns(){const e=i.useContext(De);return e?{state:e.state,actions:e.actions}:{state:It,actions:xt}}function rs(){const e=i.useContext(De);return e?{publishState:e.publishState,registerActions:e.registerActions}:null}function Cr(e,t){return e.activity===t.activity&&e.brief.lastDeliveredAt===t.brief.lastDeliveredAt&&e.reminders.dueCount===t.reminders.dueCount&&e.reminders.upcomingCount===t.reminders.upcomingCount&&Er(e.reminders.due,t.reminders.due)&&Rt(e.reminders.next,t.reminders.next)&&e.voice.available===t.voice.available&&e.voice.setupBlocked===t.voice.setupBlocked&&e.voice.replies===t.voice.replies&&e.error===t.error&&e.session.title===t.session.title&&e.session.lastActivityAt===t.session.lastActivityAt&&e.conversation.messageCount===t.conversation.messageCount&&e.conversation.loading===t.conversation.loading}function Er(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Rt(e[n],t[n]))return!1;return!0}function Rt(e,t){return e===t?!0:!e||!t?!1:e.id===t.id&&e.body===t.body&&e.status===t.status&&e.dueAt===t.dueAt}const Ir="/api/voice/realtime/call",Tt="/api/voice/realtime/lease",jt="/api/voice/realtime/settings",xr="x-openscout-realtime-voice-lease",Nt="surface.realtime-voice",os="scout:realtime-voice-stop",Ne="scout:realtime-voice-settings",Rr={noise_reduction:{type:"far_field"},turn_detection:{type:"server_vad",threshold:.6,prefix_padding_ms:300,silence_duration_ms:500,create_response:!0,interrupt_response:!0}},Tr={noise_reduction:{type:"near_field"},turn_detection:{type:"server_vad",threshold:.5,prefix_padding_ms:300,silence_duration_ms:500,create_response:!0,interrupt_response:!0}},jr="/api/scoutbot/chat",Ot="openscout.realtime-voice-settings";function Lt(e){return V(jt,{signal:e,cache:"no-store"})}function ss(e){return V(jt,{method:"PUT",body:JSON.stringify({enabled:e})})}function is(e){if(window.dispatchEvent(new CustomEvent(Ne,{detail:e})),!("BroadcastChannel"in window))return;const t=new BroadcastChannel(Ot);t.postMessage(e),t.close()}function Nr(e){const t=r=>{const o=r.detail;rt(o)&&e(o)};window.addEventListener(Ne,t);const n="BroadcastChannel"in window?new BroadcastChannel(Ot):null;return n&&(n.onmessage=r=>{rt(r.data)&&e(r.data)}),()=>{window.removeEventListener(Ne,t),n?.close()}}function rt(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.enabled=="boolean"&&typeof t.configuredEnabled=="boolean"&&(t.source==="settings"||t.source==="environment")&&typeof t.locked=="boolean"}const Or=25e3;async function Lr(e={}){if(te(e.signal),!globalThis.RTCPeerConnection||!navigator.mediaDevices?.getUserMedia)throw new Error("This browser does not support realtime audio calls.");if(!(await Lt(e.signal)).enabled)throw new Error("Live voice is off. Turn it on in Settings → Voice before starting a call.");te(e.signal),e.onState?.("connecting");const n=new RTCPeerConnection,r=new Audio;r.autoplay=!0;let o=!1,s=null,a=null,u=null,l=0,f=0;const c=(y,m,N="voice")=>{f+=1,e.onTrace?.({id:`voice-${f}`,at:Date.now(),kind:N,label:y,...m?{detail:m}:{}})};let v=null;const S=()=>{if(v)return v;o=!0,e.signal?.removeEventListener("abort",b),u&&clearInterval(u),u=null,s?.getTracks().forEach(m=>m.stop()),r.pause(),r.srcObject=null,n.close();const y=a;return a=null,v=(async()=>{y&&await Hr(y),e.onState?.("ended")})(),v},R=()=>{S().catch(y=>{e.onError?.(y instanceof Error?y.message:"Could not release the realtime voice lease."),e.onState?.("error")})},b=()=>{R()};e.signal?.addEventListener("abort",b,{once:!0}),n.ontrack=({streams:y})=>{const m=y[0];if(!m||o)return;const[N]=m.getAudioTracks();N&&N.addEventListener("ended",()=>{o||e.onError?.("Realtime voice audio ended unexpectedly.")}),r.srcObject=m,r.play().catch(()=>{e.onError?.("Browser playback was blocked. Interact with the page, then start the call again.")})},n.onconnectionstatechange=()=>{o||(n.connectionState==="connected"?(e.onState?.("live"),c("Realtime channel connected","Scoutbot bridge is ready")):(n.connectionState==="failed"||n.connectionState==="disconnected")&&(e.onError?.("Realtime voice connection ended unexpectedly."),R()))};try{s=await Vr(e.inputDeviceName,e.signal),te(e.signal);for(const T of s.getTracks())n.addTrack(T,s);const y=n.createDataChannel("oai-events"),m=new Set;let N=Promise.resolve(),p=!1,g=null;const P=[],O=T=>{if(o||y.readyState!=="open")return!1;try{return y.send(JSON.stringify(T)),!0}catch{return e.onError?.("Realtime voice events channel closed unexpectedly."),!1}},k=()=>{if(p||g||P.length===0)return;const T=P.shift();if(T){if(g=T,!O({type:"response.create",response:{instructions:T}})){g=null,P.unshift(T);return}p=!0}},w=T=>{P.push(T),k()};y.addEventListener("open",()=>{if(o)return;const T=$r(e.inputDeviceName);if(!O({type:"session.update",session:{type:"realtime",audio:{input:T}}})){e.onError?.("Could not configure Scout's realtime microphone processing.");return}c("Scoutbot bridge ready","Live fleet context is available"),w("Open with one brief audible greeting: 'Hi, I’m Scoutbot. I can check the fleet and coordinate through Scout. What would you like to work on?'")}),y.addEventListener("error",()=>{o||e.onError?.("Realtime voice events channel closed unexpectedly.")}),y.addEventListener("message",T=>{const I=Pr(T.data);if(I?.type==="error"){if(_t(I.message)){g&&(P.unshift(g),g=null),p=!0,c("Scoutbot reply queued","Waiting for the current spoken response to finish","scoutbot");return}e.onError?.(I.message??"OpenAI Realtime reported an error.");return}if(I?.type==="response.created"){p=!0,g=null;return}if(I?.type==="response.done"){p=!1,g=null;for(const q of Mr(I))q.name!=="ask_scoutbot"||m.has(q.callId)||(m.add(q.callId),N=N.then(()=>_r({functionCall:q,route:e.getRoute?.()??e.route,uiContext:e.getUiContext?.(),onReply:e.onScoutbotReply,onTrace:c,send:O,requestResponse:w})).catch(W=>{e.onError?.(W instanceof Error?W.message:"Scoutbot could not complete the voice request.")}));k()}});const C=await be(n.createOffer(),e.signal);if(await be(n.setLocalDescription(C),e.signal),!C.sdp)throw new Error("Could not create a WebRTC offer.");const j=await fetch(Ir,{method:"POST",headers:{"content-type":"application/sdp"},body:C.sdp,signal:e.signal});a=j.headers.get(xr)?.trim()||null;const M=await be(j.text(),e.signal);if(!j.ok)throw new Error(Fr(M,j.status));if(!a)throw new Error("Scout started the audio connection without a concurrency lease. Please try again.");return u=setInterval(()=>{if(!a||o)return;const T=a;qr(T).then(I=>{if(!(o||T!==a)){if(I){l=0;return}e.onError?.("Realtime voice lost its server lease. Reconnect to continue safely."),R()}}).catch(()=>{l+=1,!(l<2||o)&&(e.onError?.("Realtime voice could not renew its server lease. Check the connection and try again."),R())})},Or),await be(n.setRemoteDescription({type:"answer",sdp:M}),e.signal),te(e.signal),{leaseId:a,stop:S}}catch(y){throw await S(),y}}async function _r(e){const t=Dr(e.functionCall.arguments);if(!t){e.onTrace("Scoutbot request could not be read",void 0,"error"),xe(e,{ok:!1,error:"The voice request did not include a usable Scoutbot prompt."});return}e.onTrace("Scoutbot is checking the control plane",t,"scoutbot");try{const n=await fetch(jr,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({body:t,route:e.route,uiContext:e.uiContext})}),r=await n.text();if(!n.ok)throw new Error(Br(r,n.status));const o=JSON.parse(r),s=typeof o.reply?.body=="string"?o.reply.body.trim():"";if(!s)throw new Error("Scoutbot returned an empty reply.");const a=lt(s).filter(f=>f.type==="ask-agent").length,u=e.onReply?await e.onReply(s):{agentRequests:{requested:a,sent:0,failed:a}},l=Qt(s);e.onTrace("Scoutbot reply ready",void 0,"scoutbot"),xe(e,{ok:!0,reply:l,...u.agentRequests.requested>0?{agentRequests:u.agentRequests}:{}})}catch(n){const r=n instanceof Error?n.message:"Scoutbot could not complete the voice request.";e.onTrace("Scoutbot request failed",r,"error"),xe(e,{ok:!1,error:r})}}function xe(e,t){if(!e.send({type:"conversation.item.create",item:{type:"function_call_output",call_id:e.functionCall.callId,output:JSON.stringify(t)}}))return;const r=t.agentRequests;e.requestResponse(t.ok?r&&r.requested>0?r.failed>0?"Answer using the Scoutbot result. Say clearly that Scoutbot tried to send the agent request automatically but delivery failed, and tell the operator to check the activity log. Be concise and do not mention tools, JSON, fences, or implementation details.":"Answer using the Scoutbot result. Say clearly that the agent request was sent automatically. Do not claim the requested work is complete. Be concise and do not mention tools, JSON, fences, or implementation details.":"Answer using the Scoutbot result. Speak the useful answer naturally and concisely. Do not mention tools, JSON, fences, or implementation details.":"Briefly tell the operator that Scoutbot could not complete the live lookup and state the returned error plainly.")}function _t(e){const t=e?.toLowerCase()??"";return t.includes("active response in progress")||t.includes("conversation already has an active response")||t.includes("response is already in progress")}function Pr(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return{...typeof t.type=="string"?{type:t.type}:{},...typeof t.error?.message=="string"?{message:t.error.message}:{},...t.response&&typeof t.response=="object"?{response:t.response}:{}}}catch{return null}}function Mr(e){return Array.isArray(e.response?.output)?e.response.output.flatMap(t=>{if(!t||typeof t!="object")return[];const n=t;return n.type!=="function_call"||typeof n.call_id!="string"||typeof n.name!="string"||typeof n.arguments!="string"?[]:[{callId:n.call_id,name:n.name,arguments:n.arguments}]}):[]}function Dr(e){try{const t=JSON.parse(e);if(typeof t.request!="string")return null;const n=t.request.trim();return n?n.slice(0,8e3):null}catch{return null}}function Br(e,t){try{const n=JSON.parse(e);if(typeof n.error=="string"&&n.error.trim())return n.error}catch{}return`Scoutbot could not complete the live lookup (HTTP ${t}).`}function Fr(e,t){try{const n=JSON.parse(e);if(typeof n.error=="string"&&n.error.trim())return n.error}catch{}return`Could not start realtime voice (HTTP ${t}).`}async function be(e,t){return t?(te(t),new Promise((n,r)=>{const o=()=>r(Be(t));t.addEventListener("abort",o,{once:!0}),e.then(s=>{t.removeEventListener("abort",o),n(s)},s=>{t.removeEventListener("abort",o),r(s)})})):e}async function ot(e,t){return t?(te(t),new Promise((n,r)=>{let o=!1;const s=()=>{o=!0,r(Be(t))};t.addEventListener("abort",s,{once:!0}),e.then(a=>{if(t.removeEventListener("abort",s),o||t.aborted){a.getTracks().forEach(u=>u.stop());return}n(a)},a=>{t.removeEventListener("abort",s),o||r(a)})})):e}const st={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:1},Ur=/\b(?:airpods?|earbuds?|earphones?|headsets?|headphones?|buds?|hands[- ]?free)\b/iu;function $r(e){return Ur.test(e?.trim()??"")?Tr:Rr}async function Vr(e,t){const n=await it(e);let r=await ot(navigator.mediaDevices.getUserMedia({audio:{...st,...n?{deviceId:{exact:n.deviceId}}:{}}}),t);if(!n&&e?.trim()){const o=await it(e),s=r.getAudioTracks?.()[0]?.label?.trim().toLocaleLowerCase()??"";if(o&&o.label.trim().toLocaleLowerCase()!==s)try{const a=await ot(navigator.mediaDevices.getUserMedia({audio:{...st,deviceId:{exact:o.deviceId}}}),t);r.getTracks().forEach(u=>u.stop()),r=a}catch(a){if(t?.aborted)throw r.getTracks().forEach(u=>u.stop()),a}}for(const o of r.getAudioTracks?.()??[])o.contentHint="speech";return r}async function it(e){const t=e?.trim().toLocaleLowerCase();if(!t||typeof navigator.mediaDevices.enumerateDevices!="function")return null;try{const n=(await navigator.mediaDevices.enumerateDevices()).filter(r=>r.kind==="audioinput"&&r.deviceId&&r.label.trim());return n.find(r=>r.label.trim().toLocaleLowerCase()===t)??n.find(r=>{const o=r.label.trim().toLocaleLowerCase();return o.includes(t)||t.includes(o)})??null}catch{return null}}function te(e){if(e?.aborted)throw Be(e)}function Be(e){return e.reason instanceof Error?e.reason:new DOMException("Realtime voice connection was cancelled.","AbortError")}async function qr(e){return(await fetch(`${Tt}/${encodeURIComponent(e)}`,{method:"PUT"})).ok}async function Hr(e){const t=await fetch(`${Tt}/${encodeURIComponent(e)}`,{method:"DELETE",keepalive:!0});if(!t.ok&&t.status!==404)throw new Error(`Could not release realtime voice lease (HTTP ${t.status}).`)}const Wr=[{id:"home",label:"Home",description:"Fleet overview, briefings, and recent activity.",route:{view:"inbox"}},{id:"projects",label:"Projects",description:"Projects, agents, and project-scoped work.",route:{view:"agents-v2"},deepActions:["Open a project by projectSlug.","Open an agent by agentId."]},{id:"sessions",label:"Sessions",description:"Active and recent harness sessions.",route:{view:"sessions"},deepActions:["Open a session by sessionId."]},{id:"messages",label:"Messages",description:"Direct conversations and channels.",route:{view:"messages"},deepActions:["Open a conversation by conversationId.","Filter by all, direct messages, or channels."]},{id:"dispatch",label:"Dispatch",description:"Requests, flights, work, and delivery state.",route:{view:"broker"}},{id:"search",label:"Search",description:"Knowledge and indexed workspace search.",route:{view:"search"}},{id:"operations",label:"Operations",description:"Mission Control, live activity, agent lanes, runtime, and mesh health.",route:{view:"ops",mode:"mission"}},{id:"repositories",label:"Repositories",description:"Repository and worktree status, including diffs.",route:{view:"repos"},deepActions:["Open a repository by absolute root."]},{id:"code-browser",label:"Code Browser",description:"Read files in a project or worktree.",route:{view:"code"},deepActions:["Select a project with the project field; it accepts the displayed project name or slug.","Open a file inside it with path and optional wt.","Alternatively use absolute root and file fields.","Focus a line with line and optional endLine.","Deep links: scout://{project}/{path}, scout:///{absolute/path}, or legacy scout://code/{project}/{path}."]},{id:"terminals",label:"Terminals",description:"Observe or take over terminal sessions.",route:{view:"terminal"}},{id:"settings",label:"Settings",description:"Connections, agents, communications, credentials, voice, and devices.",route:{view:"settings"}}],zr=[{id:"comms",label:"Comms",description:"Native conversations and channels.",route:{view:"messages"},deepActions:["Open a conversation by conversationId.","Open a channel by channelId."]},{id:"projects",label:"Projects",description:"Native project and agent browser.",route:{view:"agents-v2"},deepActions:["Filter to a project by projectSlug.","Select an agent by agentId."]},{id:"terminals",label:"Terminals",description:"Native terminal workspace.",route:{view:"terminal"},deepActions:["Select an agent terminal by agentId."]},{id:"tail",label:"Tail",description:"Live agent and harness activity.",route:{view:"ops",mode:"tail"}},{id:"dispatch",label:"Dispatch",description:"Dispatch and coordination overview.",route:{view:"broker"}},{id:"agent-lanes",label:"Agent Lanes",description:"Native lane overview for active agents.",route:{view:"ops",mode:"lanes"}},{id:"repositories",label:"Repositories",description:"Native repository and worktree status.",route:{view:"repos"}},{id:"code-browser",label:"Code Browser",description:"Embedded read-only project browser.",route:{view:"code"},deepActions:["Select a project with the project field; it accepts the displayed project name or slug.","Open a file inside it with path and optional wt.","Alternatively use absolute root and file fields.","Focus a line with line and optional endLine.","Deep links: scout://{project}/{path}, scout:///{absolute/path}, or legacy scout://code/{project}/{path}."]},{id:"settings",label:"Settings",description:"Native app settings; Voice is directly addressable.",route:{view:"settings"},deepActions:["Open Voice settings with section=voice."]}];function Jr(e){const t=e==="macos";return{host:e,shellLabel:t?"Scout for macOS":"OpenScout web",destinations:t?zr:Wr,rules:["When asked what navigation is available, list only these human labels and short descriptions.","Never expose internal Route.view names, aliases, URL fragments, or implementation vocabulary in the human reply.","Emit only a destination route or deep action explicitly described by this host context.","If the requested destination or deep action is absent, say it is not available in this app instead of approximating it with another page."]}}const Kr="scout:scoutbot-realtime-reply",ye="scout:scoutbot-session-changed",Gr={enabled:!1,open:!1,state:"idle",leaseId:null,error:null,trace:[],chatState:null,sessionAction:null,setOpen:()=>{},startCall:async()=>{},endCall:async()=>!0,startNewChat:async()=>{},switchChat:async()=>{},updatePreferredModel:async e=>e,clearTrace:()=>{},openVoiceSettings:()=>{}},Pt=i.createContext(Gr);function Qr({children:e}){const{route:t,applyScoutbotUiAction:n}=Mt(),r=ct(Nt,!0),[o,s]=i.useState(!1),a=r&&o,[u,l]=i.useState(!1),[f,c]=i.useState("idle"),[v,S]=i.useState(null),[R,b]=i.useState(null),[y,m]=i.useState([]),[N,p]=i.useState(null),[g,P]=i.useState(null),O=i.useRef(null),k=i.useRef(null),w=i.useRef(null),C=i.useRef(0),j=i.useRef(!1),M=i.useRef(!1),T=i.useRef({route:t,applyScoutbotUiAction:n});T.current={route:t,applyScoutbotUiAction:n};const I=i.useCallback((A,E,L="voice")=>{m(_=>[..._,{id:`voice-ui-${Date.now()}-${_.length}`,at:Date.now(),kind:L,label:A,...E?{detail:E}:{}}].slice(-100))},[]),q=i.useCallback(()=>m([]),[]),W=i.useCallback(async()=>{const A=await V("/api/scoutbot/session");return j.current||p(A),A},[]);i.useEffect(()=>{if(!r){s(!1);return}const A=new AbortController;let E=!1;const L=Nr(_=>{s(_.enabled)});return Lt(A.signal).then(_=>{E||s(_.enabled)}).catch(_=>{E||at(_)||(s(!1),b(_ instanceof Error?_.message:"Could not load live voice settings."))}),()=>{E=!0,A.abort(),L()}},[r]),i.useEffect(()=>{if(!a)return;const A=()=>{W().catch(E=>{j.current||b(E instanceof Error?E.message:"Could not load Scoutbot chats.")})};return A(),window.addEventListener(ye,A),()=>window.removeEventListener(ye,A)},[a,W]);const H=i.useCallback(async()=>{C.current+=1;const A=w.current;k.current?.abort(),k.current=null;const E=O.current;O.current=null;try{await E?.stop(),await A}catch(L){return j.current||(c("error"),b(L instanceof Error?L.message:"Could not end realtime voice cleanly.")),!1}return j.current||(S(null),c("ended"),I("Live voice ended","Microphone and host lease released","voice")),!0},[I]);i.useEffect(()=>{a||(l(!1),(O.current||f==="connecting"||f==="live")&&H())},[a,H,f]),i.useEffect(()=>(j.current=!1,()=>{j.current=!0,C.current+=1,k.current?.abort(),k.current=null,O.current?.stop().catch(()=>{}),O.current=null}),[]);const re=i.useCallback(async A=>{window.dispatchEvent(new CustomEvent(Kr,{detail:{body:A}}));const E=A.replace(/```[\s\S]*?```/gu,"").trim();E&&I("Scoutbot replied",E.slice(0,2e3),"scoutbot");let L=0,_=0,K=0;for(const F of lt(A))if(F.type==="ask-agent")L+=1,await Zr(F,I,b)?_+=1:K+=1;else if(F.type!=="reminder"){const D=Xr(F),U=F.type==="navigate"||F.type==="view-file"?"navigation":"scoutbot";I(Yr(F),D,U),T.current.applyScoutbotUiAction(F),I(Ge()?"Action sent to Scout for macOS":"Action applied in OpenScout",D,U)}return await W().catch(()=>null),{agentRequests:{requested:L,sent:_,failed:K}}},[I,W]),oe=i.useCallback(()=>{const A={type:"navigate",route:{view:"settings",section:"voice"}};I("Voice settings requested",void 0,"navigation"),T.current.applyScoutbotUiAction(A)},[I]),se=i.useCallback(async()=>{if(!a){b("Turn on live voice in Settings → Voice before starting a call."),l(!1);return}if(M.current||f==="connecting"||f==="live")return;M.current=!0,k.current?.abort();const A=O.current;O.current=null;try{await A?.stop(),S(null)}catch(D){c("error"),b(D instanceof Error?D.message:"Could not end the previous realtime voice call."),M.current=!1;return}const E=new AbortController;k.current=E;const L=C.current+1;C.current=L;let _=()=>{};const K=new Promise(D=>{_=D});w.current=K;let F=!1;b(null),m([{id:"connecting",at:Date.now(),label:"Connecting secure audio"}]),c("connecting");try{const D=await bn().then(({settings:$})=>$.inputDeviceName).catch(()=>null),U=await Lr({signal:E.signal,inputDeviceName:D,getRoute:()=>T.current.route,getUiContext:()=>Jr(Ge()?"macos":"web"),onState:$=>{!j.current&&C.current===L&&c($)},onError:$=>{if(!(j.current||C.current!==L)){if(_t($)){I("Scoutbot reply queued","Waiting for the current spoken response to finish","scoutbot");return}b($),I("Voice issue",$,"error")}},onTrace:$=>{!j.current&&C.current===L&&m(fe=>[...fe,$].slice(-100))},onScoutbotReply:$=>!j.current&&C.current===L?re($):{agentRequests:{requested:0,sent:0,failed:0}}});if(j.current||E.signal.aborted||C.current!==L){await U.stop();return}O.current=U,S(U.leaseId),F=!0}catch(D){if(!j.current&&C.current===L&&!at(D)){c("error");const U=D instanceof Error?D.message:"Could not start realtime voice.";b(U),I("Live voice could not start",U,"error")}}finally{!F&&k.current===E&&(k.current=null),_(),w.current===K&&(w.current=null),M.current=!1}},[I,re,a,f]),ie=i.useCallback(async()=>{if(!g){P("new"),b(null);try{if((O.current||f==="connecting"||f==="live")&&!await H())return;if(N?.session.messages.length===0){m([{id:`voice-chat-${Date.now()}`,at:Date.now(),kind:"scoutbot",label:"New live chat ready"}]);return}const A=await V("/api/scoutbot/session/reset",{method:"POST"});p(A),m([{id:`voice-chat-${Date.now()}`,at:Date.now(),kind:"scoutbot",label:"New live chat ready"}]),window.dispatchEvent(new CustomEvent(ye,{detail:{id:A.session.id}}))}catch(A){const E=A instanceof Error?A.message:"Could not start a new Scoutbot chat.";b(E),I("Could not start a new live chat",E,"error")}finally{P(null)}}},[I,N?.session.messages.length,H,g,f]),ae=i.useCallback(async A=>{if(!(!A||g||A===N?.session.id)){P(A),b(null);try{if((O.current||f==="connecting"||f==="live")&&!await H())return;const E=await V("/api/scoutbot/session/switch",{method:"POST",body:JSON.stringify({id:A})});p(E),m([{id:`voice-chat-${Date.now()}`,at:Date.now(),kind:"scoutbot",label:"Live chat restored",detail:E.session.title}]),window.dispatchEvent(new CustomEvent(ye,{detail:{id:E.session.id}}))}catch(E){const L=E instanceof Error?E.message:"Could not switch Scoutbot chats.";b(L),I("Could not restore the live chat",L,"error")}finally{P(null)}}},[I,N?.session.id,H,g,f]),ce=i.useCallback(async A=>{const E=A.trim();if(!E)throw new Error("Preferred model is required.");const L=await V("/api/scoutbot/config",{method:"POST",body:JSON.stringify({model:E})});return p(_=>_&&{..._,config:{..._.config,...L.config}}),I("Scoutbot preferred model updated",L.config.model,"scoutbot"),L.config.model},[I]),le=i.useMemo(()=>({enabled:a,open:u,state:f,leaseId:v,error:R,trace:y,chatState:N,sessionAction:g,setOpen:l,startCall:se,endCall:H,startNewChat:ie,switchChat:ae,updatePreferredModel:ce,clearTrace:q,openVoiceSettings:oe}),[a,u,f,v,R,y,N,g,se,H,ie,ae,ce,q,oe]);return d.jsx(Pt.Provider,{value:le,children:e})}function at(e){return(e instanceof DOMException||e instanceof Error)&&e.name==="AbortError"}function as(){return i.useContext(Pt)}function Yr(e){return e.type==="navigate"?"Navigation requested":e.type==="open-scoutbot"?"Scoutbot opened its panel":e.type==="refresh"?"Scoutbot refreshed live state":"Scoutbot opened the requested file"}function Xr(e){return e.type==="navigate"?JSON.stringify(e.route):e.type==="view-file"?e.path:e.reason?.trim()||e.type}async function Zr(e,t,n){t("Scoutbot is coordinating",`Asking ${e.targetLabel}`,"agent");try{const r=await V("/api/scoutbot/actions/ask",{method:"POST",body:JSON.stringify({targetLabel:e.targetLabel,targetAgentId:e.targetAgentId,body:e.body,channel:e.channel})});return t("Scoutbot sent the request",r.flightId?`${r.targetAgentId??r.targetLabel} · run ${r.flightId}`:r.targetAgentId??r.targetLabel,"agent"),!0}catch(r){const o=r instanceof Error?r.message:"Could not send to agent.";return t("Scoutbot could not send the request",o,"error"),n(o),!1}}function eo(e){return!!(e&&(e.message.trim().length>0||e.files.length>0||e.forwardContext))}function to(e){return[e.name,e.type,e.size,e.lastModified].join(":")}function no(e,t){const n=new Set;return[...e,...t].filter(r=>{const o=to(r);return n.has(o)?!1:(n.add(o),!0)})}function ro(e,t){const n=t.intent??e?.intent??"new-task",r=n==="route-capture",o=n==="forward-message";return{intent:n,...r&&(t.agentId??e?.agentId)?{agentId:t.agentId??e?.agentId}:{},...r&&(t.conversationId??e?.conversationId)?{conversationId:t.conversationId??e?.conversationId}:{},message:t.message??e?.message??"",files:no(e?.files??[],t.files??[]),attachmentFeedback:t.attachmentFeedback??e?.attachmentFeedback??null,mode:r?t.preferExistingChat===void 0?e?.mode??"new-session":t.preferExistingChat?"existing-chat":"new-session":"new-session",projectPath:t.projectPath??e?.projectPath??"",projectQuery:e?.projectQuery??"",...o&&(t.forwardContext??e?.forwardContext)?{forwardContext:t.forwardContext??e?.forwardContext}:{},forwardContextMode:o?t.forwardContextMode??e?.forwardContextMode??"selected-message":"selected-message"}}function oo({request:e,onClose:t,onOpenCapture:n}){const{agents:r,route:o,navigate:s}=Mt(),a=Wt(o),u=wt(r,a),l=on(o,u),[f,c]=i.useState(0),[v,S]=i.useState(null),[R,b]=i.useState(null),y=i.useRef(0),m=e?ro(R,e):null,N=i.useCallback((g,P)=>{if(g.length===0)return;const O=!!(l.agentId||l.conversationId);n({intent:O?"route-capture":"new-task",files:g,attachmentFeedback:P,agentId:l.agentId??void 0,conversationId:l.conversationId??void 0,preferExistingChat:l.canUseExistingChat})},[n,l]);i.useEffect(()=>{if(!v)return;const g=window.setTimeout(()=>S(null),5e3);return()=>window.clearTimeout(g)},[v]),i.useEffect(()=>{const g=C=>{we(C.dataTransfer)&&(C.preventDefault(),y.current+=1,c(y.current))},P=C=>{we(C.dataTransfer)&&(C.preventDefault(),C.dataTransfer&&(C.dataTransfer.dropEffect="copy"))},O=()=>{y.current!==0&&(y.current=Math.max(0,y.current-1),c(y.current))},k=C=>{if(!we(C.dataTransfer))return;C.preventDefault();const j=Qe(C.dataTransfer),M=j.filter(Ye),T=j.length-M.length;if(y.current=0,c(0),M.length===0){S(j.length===0?"Scout could not read that file. Try the attachment picker instead.":"That file type is not supported. Drop markdown, code, an image, or a video clip.");return}const I=M.length===1?`Dropped ${M[0]?.name||"1 attachment"}.`:`Dropped ${M.length} attachments.`,q=T>0?`${I} Skipped ${T} unsupported ${T===1?"file":"files"}.`:I;S(null),N(M,q)},w=C=>{if(yn(C.target)||!we(C.clipboardData))return;C.preventDefault();const j=Qe(C.clipboardData),M=j.filter(Ye);if(M.length===0){S(j.length===0?"Scout could not read that pasted file. Try the attachment picker instead.":"That pasted file type is not supported. Paste an image or video, or attach markdown or code.");return}N(M,M.length===1?`Pasted ${M[0]?.name||"1 attachment"}.`:`Pasted ${M.length} attachments.`)};return window.addEventListener("dragenter",g),window.addEventListener("dragover",P),window.addEventListener("dragleave",O),window.addEventListener("drop",k),window.addEventListener("paste",w),()=>{window.removeEventListener("dragenter",g),window.removeEventListener("dragover",P),window.removeEventListener("dragleave",O),window.removeEventListener("drop",k),window.removeEventListener("paste",w)}},[N]);const p=f>0&&!e;return d.jsxs(d.Fragment,{children:[p?d.jsx("div",{className:"s-capture-drop",role:"presentation",children:d.jsxs("div",{className:"s-capture-drop-card",children:[d.jsx("div",{className:"s-capture-drop-title",children:"Route capture"}),d.jsx("div",{className:"s-capture-drop-copy",children:"Drop markdown, code, an image, or a video clip to send it to the right agent or chat."})]})}):null,v?d.jsx("div",{className:"s-capture-feedback",role:"alert",children:v}):null,e?d.jsx(sn,{agents:u,route:o,navigate:s,onClose:t,initialAgentId:m?.agentId,initialConversationId:m?.conversationId,initialMessage:m?.message,initialFiles:m?.files,initialAttachmentFeedback:m?.attachmentFeedback??void 0,initialIntent:m?.intent,initialProjectPath:m?.projectPath,initialProjectQuery:m?.projectQuery,initialForwardContext:m?.forwardContext,initialForwardContextMode:m?.forwardContextMode,defaultMode:m?.mode,draftRestored:eo(R),onDraftChange:b,onDraftConsumed:()=>b(null)}):null]})}const Fe=i.createContext(null),so=["hello","node.upserted","actor.registered","agent.registered","agent.endpoint.upserted","invocation.requested","flight.updated","delivery.state.changed","scout.dispatched"],io=new Set(so),ao=3e4,co=250;function lo(e,t){try{return JSON.stringify(e)===JSON.stringify(t)?e:t}catch{return t}}const uo={"--hud-bg":"oklch(0.118 0.004 260)","--hud-surface":"oklch(0.205 0.005 260)","--hud-ink":"oklch(0.975 0.006 260)","--hud-muted":"oklch(0.80 0.008 260)","--hud-dim":"oklch(0.70 0.007 260)","--hud-border":"oklch(0.975 0.006 260 / 0.08)","--hud-accent":"oklch(0.86 0.17 125)","--hud-accent-soft":"oklch(0.86 0.17 125 / 0.08)","--hud-shadow-soft":"oklch(0.08 0.004 260 / 0.42)","--hud-chrome-border":"oklch(0.975 0.006 260 / 0.04)","--hud-shadow-panel":"0 12px 34px oklch(0.08 0.004 260 / 0.45)","--hud-shadow-panel-hover":"0 14px 38px oklch(0.08 0.004 260 / 0.52)","--hud-shadow-bar":"0 -10px 28px oklch(0.08 0.004 260 / 0.38)","--hud-shadow-nav":"0 8px 24px oklch(0.08 0.004 260 / 0.32)","--hud-shadow-minimap":"0 10px 24px oklch(0.08 0.004 260 / 0.38)","--hud-status-ok":"oklch(0.80 0.15 155)","--hud-status-warn":"oklch(0.82 0.15 85)","--hud-status-error":"oklch(0.72 0.18 25)","--background":"0.132 0.004 260","--foreground":"0.965 0.006 260","--card":"0.178 0.005 260","--card-foreground":"0.965 0.006 260","--popover":"0.178 0.005 260","--popover-foreground":"0.965 0.006 260","--muted-foreground":"0.72 0.008 260","--scrim":"rgba(0, 0, 0, 0.5)","--scrim-soft":"rgba(0, 0, 0, 0.3)","--info":"#62b6ff","--shadow-card":"0 8px 22px rgba(0, 0, 0, 0.22)","--shadow-card-hover":"0 14px 36px rgba(0, 0, 0, 0.30)","--cat-gold":"#d7a978","--cat-purple":"#c58cff","--cat-sky":"#38bdf8","--scout-chrome-ink-strong":"color-mix(in srgb, var(--hud-ink) 94%, transparent)","--scout-chrome-ink":"color-mix(in srgb, var(--hud-ink) 84%, transparent)","--scout-chrome-ink-soft":"color-mix(in srgb, var(--hud-ink) 68%, transparent)","--scout-chrome-ink-faint":"color-mix(in srgb, var(--hud-ink) 64%, transparent)","--scout-chrome-ink-ghost":"color-mix(in srgb, var(--hud-ink) 56%, transparent)","--scout-chrome-hover":"color-mix(in srgb, var(--hud-ink) 5%, transparent)","--scout-chrome-active":"color-mix(in srgb, var(--hud-ink) 9%, transparent)","--scout-chrome-border-soft":"color-mix(in srgb, var(--hud-ink) 8%, transparent)","--scout-chrome-avatar-ink":"#111111","--hud-font-sans":"'Inter', ui-sans-serif, system-ui, sans-serif","--hud-font-mono":"'JetBrains Mono', ui-monospace, Menlo, monospace","--hud-font-serif":"'Spectral', 'Cormorant Garamond', Georgia, serif","--hud-font-accent-title":"'Inter Tight', var(--hud-font-sans)"},fo={"--hud-bg":"oklch(0.982 0.008 78)","--hud-surface":"oklch(0.994 0.006 78)","--hud-ink":"oklch(0.26 0.018 72)","--hud-muted":"oklch(0.50 0.028 70)","--hud-dim":"oklch(0.64 0.022 72)","--hud-border":"oklch(0.86 0.016 75 / 0.92)","--hud-accent":"oklch(0.72 0.16 125)","--hud-accent-soft":"oklch(0.72 0.16 125 / 0.11)","--hud-shadow-soft":"oklch(0.42 0.02 70 / 0.11)","--hud-status-ok":"oklch(0.64 0.16 155)","--hud-status-warn":"oklch(0.72 0.15 85)","--hud-status-error":"oklch(0.62 0.19 25)","--background":"0.978 0.004 85","--foreground":"0.24 0.01 80","--card":"0.992 0.003 85","--card-foreground":"0.24 0.01 80","--popover":"0.992 0.003 85","--popover-foreground":"0.24 0.01 80","--muted-foreground":"0.56 0.014 80","--scrim":"rgba(28, 24, 20, 0.30)","--scrim-soft":"rgba(28, 24, 20, 0.16)","--info":"#2f7fd6","--shadow-card":"0 8px 22px oklch(0.42 0.02 70 / 0.09)","--shadow-card-hover":"0 14px 36px oklch(0.42 0.02 70 / 0.13)","--cat-gold":"#a9824f","--cat-purple":"#8b5cf6","--cat-sky":"#0ea5e9","--scout-chrome-ink-strong":"color-mix(in srgb, var(--hud-ink) 94%, transparent)","--scout-chrome-ink":"color-mix(in srgb, var(--hud-ink) 78%, transparent)","--scout-chrome-ink-soft":"color-mix(in srgb, var(--hud-ink) 60%, transparent)","--scout-chrome-ink-faint":"color-mix(in srgb, var(--hud-ink) 56%, transparent)","--scout-chrome-ink-ghost":"color-mix(in srgb, var(--hud-ink) 50%, transparent)","--scout-chrome-hover":"color-mix(in srgb, var(--hud-ink) 4%, transparent)","--scout-chrome-active":"color-mix(in srgb, var(--hud-ink) 8%, transparent)","--scout-chrome-border-soft":"color-mix(in srgb, var(--hud-border) 80%, transparent)","--scout-chrome-avatar-ink":"#ffffff","--hud-font-sans":"'Inter', ui-sans-serif, system-ui, sans-serif","--hud-font-mono":"'JetBrains Mono', ui-monospace, Menlo, monospace","--hud-font-serif":"'Spectral', 'Cormorant Garamond', Georgia, serif","--hud-font-accent-title":"'Inter Tight', var(--hud-font-sans)"},po=new Set(["--hud-bg","--hud-surface","--hud-ink","--hud-muted","--hud-dim","--hud-border","--hud-accent","--hud-accent-soft","--hud-shadow-soft","--hud-chrome-border","--hud-shadow-panel","--hud-shadow-panel-hover","--hud-shadow-bar","--hud-shadow-nav","--hud-shadow-minimap","--hud-status-ok","--hud-status-warn","--hud-status-error"]);function ho(e){return Object.fromEntries(Object.entries(e==="light"?fo:uo).filter(([n])=>!po.has(n)))}function cs(){return i.useContext(Fe)}function Mt(){const e=i.useContext(Fe);if(!e)throw new Error("useScout must be used inside ScoutProvider");return e}function ls({children:e,initialTheme:t="dark"}){const{route:n,navigate:r,navigateBack:o,canNavigateBack:s}=zt(),a=Sn(),u=ct(Nt,!0),[l,f]=i.useState([]),[c,v]=i.useState(!1),[S,R]=i.useState({status:"checking",message:null,lastCheckedAt:null}),[b,y]=i.useState(Je),[m,N]=i.useState(null),p=i.useRef(!1),[g,P]=i.useState(Rn),[O,k]=i.useState(!1),[w,C]=i.useState(null),[j,M]=i.useState(null),[T,I]=i.useState(""),[q,W]=i.useState(null),H=n.view==="settings",re=i.useMemo(()=>n.view!=="broker"||!n.attemptId?null:w?.id===n.attemptId?w:null,[w,n]),oe=i.useMemo(()=>n.view!=="search"||!n.hitId?null:j?.id===n.hitId?j:null,[j,n]),se=i.useMemo(()=>n.view==="agents-v2"&&n.agentId&&n.sessionId?{agentId:n.agentId,sessionId:n.sessionId}:n.view==="sessions"&&n.sessionId?{agentId:n.agentId??"",sessionId:n.sessionId}:null,[n]),ie=i.useCallback((h,x)=>{if(n.view==="agents-v2"&&n.agentId===h){r({...n,sessionId:x},{replace:!0});return}if(n.view==="sessions"){r({view:"sessions",sessionId:x,agentId:h},{replace:!0});return}r({view:"agents-v2",agentId:h,sessionId:x},{replace:!0})},[r,n]),ae=i.useCallback(()=>{r({view:"settings",section:"appearance"})},[r]),ce=i.useCallback(()=>{n.view==="settings"&&r({view:"inbox"})},[r,n.view]),le=i.useCallback(h=>{W(h??{intent:"new-task"})},[]),A=i.useCallback(()=>W(null),[]),E=i.useCallback(h=>{C(h),!(n.view==="broker"&&n.attemptId===h.id)&&r({view:"broker",attemptId:h.id,...n.view==="broker"&&n.filter?{filter:n.filter}:{}},{replace:n.view==="broker"})},[r,n]),L=i.useCallback(()=>{C(null),n.view==="broker"&&n.attemptId&&r({view:"broker",...n.filter?{filter:n.filter}:{}},{replace:!0})},[r,n]),_=i.useCallback((h,x,B)=>{if(M(h),typeof x=="string"&&I(x.trim()),n.view==="search"&&n.hitId===h.id)return;const z=B??(n.view==="search"?n.filters:void 0);r({view:"search",...n.view==="search"&&n.mode?{mode:n.mode}:{},...z?{filters:z}:{},hitId:h.id},{replace:n.view==="search"})},[r,n]),K=i.useCallback(()=>{M(null),I(""),n.view==="search"&&n.hitId&&r({view:"search",...n.mode?{mode:n.mode}:{},...n.filters?{filters:n.filters}:{}},{replace:!0})},[r,n]),F=i.useMemo(()=>Ut(),[]),D=a?.resolvedTheme??t,U=a?.template??"hudson",$=i.useMemo(()=>({...ho(D),...F??{}}),[F,D]),fe=i.useCallback(h=>{y(x=>({...x,...h}))},[]);i.useEffect(()=>{!c||l.length===0||y(h=>{const x=$t(h.agentCharacters,l);return x===h.agentCharacters?h:{...h,agentCharacters:x}})},[l,c]),i.useEffect(()=>{Vt(D,U,b),qt(b)},[U,b,D]),i.useEffect(()=>{const h=x=>{x.key!==null&&x.key!==Ht||y(Je())};return window.addEventListener("storage",h),()=>window.removeEventListener("storage",h)},[]);const Ue=i.useMemo(()=>Yt(l),[l]),$e=Ue?.id??Xt(l),Ve=Ue?.conversationId??null,pe=i.useRef(null),Z=i.useRef(null),he=n.view==="ops"?"/api/agents":"/api/agents?detail=summary",me=i.useCallback(()=>{R({status:"online",message:null,lastCheckedAt:Date.now()})},[]),ge=i.useCallback(h=>{const x=An(h);R({status:Cn(x)?"offline":"degraded",message:x,lastCheckedAt:Date.now()})},[]),J=i.useCallback(async()=>{const h=pe.current;if(h&&(await h.promise,h.url===he))return;const x=(async()=>{try{const B=await V(he);f(z=>lo(z,B)),me()}catch(B){ge(B)}finally{v(!0)}})();pe.current={url:he,promise:x};try{await x}finally{pe.current?.promise===x&&(pe.current=null)}},[he,ge,me]),G=i.useCallback(async()=>{try{const h=await V("/api/onboarding/state");p.current=!1,N(h);const x=h.operatorName?.trim()||h.operatorNameSuggestion?.trim()||null;P(x),Tn(x),me()}catch(h){ge(h),p.current=!0,N({hasLocalConfig:!0,hasProjectConfig:!0,hasOperatorName:!0,localConfigPath:null,projectRoot:null,currentDirectory:null,operatorName:null,operatorNameSuggestion:null,needed:!1})}},[ge,me]),qe=i.useCallback(()=>{k(!0),V("/api/onboarding/skip",{method:"POST",body:"{}"}).then(()=>G()).catch(()=>null)},[G]);i.useEffect(()=>{J(),G()},[J,G]),i.useEffect(()=>{const h=()=>{Ke()&&(J(),p.current&&G())},x=window.setInterval(h,ao),B=Kt(h);return()=>{window.clearInterval(x),B()}},[J,G]);const He=i.useMemo(()=>l.filter(h=>Gt(h.state)).length,[l]),[Dt,We]=i.useState(null),ue=i.useCallback(h=>{h?.trim()&&We(h.trim())},[]),de=i.useCallback(()=>We(null),[]),ee=i.useCallback(h=>{if(!(h.type!=="select-project"&&Zt(h)))switch(h.type){case"navigate":r(h.route);break;case"focus-composer":window.dispatchEvent(new CustomEvent("scout:composer-focus"));break;case"open-scoutbot":window.dispatchEvent(new CustomEvent("scout:scoutbot-panel-open",{detail:h}));break;case"refresh":J();break;case"view-file":ue(h.path);break;case"select-project":or(h,r);break}},[r,ue,J]),Bt=i.useCallback((h,x)=>{const B=h.trim(),z=x.trim();if(!B||!z)return;const ze=n.view==="conversation"||n.view==="messages"?n.conversationId:window.location.pathname==="/embed/thread"&&new URLSearchParams(window.location.search).get("conversationId")?.trim()||void 0;de(),ee({type:"navigate",route:{view:"code",root:z,file:B,...ze?{returnConversationId:ze}:{}}})},[ee,de,n]),ve=i.useRef({applyScoutbotUiAction:ee});ve.current={applyScoutbotUiAction:ee},Jt(h=>{Ke()&&io.has(h.kind)&&(Z.current!==null&&window.clearTimeout(Z.current),Z.current=window.setTimeout(()=>{Z.current=null,J()},co))}),i.useEffect(()=>()=>{Z.current!==null&&window.clearTimeout(Z.current)},[]),i.useEffect(()=>{const h=x=>{const B=x.detail,z=B&&typeof B=="object"&&"type"in B?B:null;z&&ve.current.applyScoutbotUiAction(z)};return window.addEventListener("scout:scoutbot-ui-action",h),window.scoutScoutbot={applyUiAction:x=>ve.current.applyScoutbotUiAction(x),navigate:x=>ve.current.applyScoutbotUiAction({type:"navigate",route:x})},()=>{window.removeEventListener("scout:scoutbot-ui-action",h),window.scoutScoutbot?.applyUiAction&&delete window.scoutScoutbot}},[]);const Ft=i.useMemo(()=>({route:n,navigate:r,navigateBack:o,canNavigateBack:s,agents:l,agentsLoaded:c,onlineCount:He,apiConnection:S,reload:J,appearanceDetails:b,updateAppearanceDetails:fe,onboarding:m,operatorName:g,refreshOnboarding:G,onboardingSkipped:O,skipOnboarding:qe,settingsOpen:H,openSettings:ae,closeSettings:ce,scoutbotAgentId:$e,scoutbotConversationId:Ve,applyScoutbotUiAction:ee,selectedBrokerAttempt:re,inspectBrokerAttempt:E,clearBrokerAttempt:L,selectedKnowledgeHit:oe,selectedKnowledgeQuery:T,inspectKnowledgeHit:_,clearKnowledgeHit:K,focusedSession:se,focusSession:ie,openFilePreview:ue,closeFilePreview:de,openContextCapture:le,closeContextCapture:A}),[n,r,o,s,l,c,He,S,J,b,fe,m,g,G,O,qe,H,ae,ce,$e,Ve,ee,re,E,L,oe,T,_,K,se,ie,ue,de,le,A]);return d.jsx(Fe.Provider,{value:Ft,children:d.jsx("div",{"data-scout-theme-mode":D,"data-scout-palette":b.palette,"data-scout-contrast":b.contrast,"data-scout-accent":b.accent,"data-scout-shell":b.shell,"data-scout-avatar-style":b.avatarStyle,"data-hudson-theme":D,"data-hudson-template":U,style:{...$},children:d.jsx("div",{"data-scout-theme":D,style:{display:"contents"},children:d.jsx(kn,{children:d.jsxs(Ar,{children:[u?d.jsx(Qr,{children:e}):e,d.jsx(wr,{path:Dt,onOpenPath:ue,onOpenInCode:Bt,onClose:de}),d.jsx(oo,{request:q,onClose:A,onOpenCapture:le})]})})})})})}export{zo as A,Yo as B,kn as C,uo as D,Ko as E,Xo as F,Jo as G,Fo as H,ir as I,yt as J,Mn as K,fo as L,rs as M,Nt as N,as as O,ye as P,Kr as Q,Jr as R,Fe as S,os as T,ns as U,Lt as V,ss as W,is as X,Uo as a,Po as b,Go as c,rr as d,nr as e,An as f,_n as g,cs as h,wt as i,Do as j,ts as k,Bo as l,Mo as m,ls as n,Cn as o,es as p,zn as q,nt as r,Zo as s,Qo as t,Mt as u,Vo as v,$o as w,qo as x,Ho as y,Wo as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./index-
|
|
1
|
+
import{j as r}from"./index-C1VaWNuD.js";import{s as $,b as E}from"./colors-BtO5_zlx.js";import{A as M}from"./AgentAvatar-Dz79iTxB.js";function q({name:a,meta:i,sub:s,tone:o="neutral",agent:t,avatarName:c,avatarKind:e="user",leadingIcon:n,caret:l,active:j,selected:v,unread:N,depth:f=0,detail:d,expanded:h,activityLabel:w,worktreeLabel:u,activityTone:g="working",actions:p,pinned:x,onClick:k,onKeyDown:b,onContextMenu:y,onPointerEnter:C,onPointerLeave:P,title:R,tabIndex:z}){const A=l?l==="open":d!==void 0?!!h:void 0,B=["rr-row",f===1&&"rr-row--child",j&&"rr-row--active",v&&"rr-row--selected",N&&"rr-row--unread",h&&"rr-row--expanded",w&&"rr-row--motion",x&&"rr-row--pinned",p&&"rr-row--has-actions"].filter(Boolean).join(" ");return r.jsxs("div",{className:B,children:[r.jsxs("button",{type:"button",className:"rr-row-head",onClick:k,onKeyDown:b,onContextMenu:y,onPointerEnter:C,onPointerLeave:P,title:R,tabIndex:z,"aria-expanded":A,children:[r.jsx(T,{icon:n,tone:o,caret:l,agent:t,avatarName:c,avatarKind:e}),r.jsxs("span",{className:"rr-row-body",children:[r.jsxs("span",{className:"rr-row-name",children:[x?r.jsx("span",{className:"rr-row-pin-mark","aria-label":"Pinned",title:"Pinned",children:r.jsx(S,{})}):null,a]}),s&&r.jsx("span",{className:"rr-row-sub",children:s}),u&&r.jsx("span",{className:"rr-row-worktree",children:u}),w&&r.jsxs("span",{className:`rr-row-activity rr-row-activity--${g}`,children:[r.jsxs("span",{className:"rr-row-activity-bars","aria-hidden":!0,children:[r.jsx("span",{}),r.jsx("span",{}),r.jsx("span",{}),r.jsx("span",{})]}),r.jsx("span",{className:"rr-row-activity-label",children:w})]})]}),i&&r.jsx("span",{className:"rr-row-meta",children:i})]}),p?r.jsx("div",{className:"rr-row-actions",onClick:L=>L.stopPropagation(),children:p}):null,h&&d&&r.jsx("div",{className:"rr-row-detail",children:d})]})}function T({icon:a,tone:i,caret:s,agent:o,avatarName:t,avatarKind:c}){if(s)return r.jsx("span",{className:`rr-row-caret rr-row-caret--leading rr-row-caret--${s}`,"aria-hidden":!0,children:r.jsx(G,{open:s==="open"})});if(t||o){if(c==="channel")return r.jsx("span",{className:"rr-row-hash","aria-hidden":!0,children:"#"});const n=m(i),l=n==="active"||n==="available"||n==="working"||n==="in_turn";return r.jsx("span",{className:"rr-row-avatar-wrap","aria-hidden":!0,children:r.jsx(M,{agent:o,name:t??o?.name,placement:"row",size:20,tile:!0,presence:l})})}if(a)return r.jsx("span",{className:"rr-row-icon","aria-hidden":!0,children:a});const e=m(i);return r.jsx("span",{className:`rr-row-dot rr-row-dot--${e}`,style:e==="active"||e==="available"?{background:$(e)}:void 0,"aria-hidden":!0})}function G({open:a}){return r.jsx("svg",{className:`rr-chevron${a?" rr-chevron--open":""}`,viewBox:"0 0 12 12",width:"12",height:"12",fill:"none","aria-hidden":!0,children:r.jsx("path",{d:"M4.25 3L7.75 6L4.25 9",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function m(a){return a==="channel"||a==="dm"||a==="neutral"?a:E(a)}function S(){return r.jsx("svg",{width:"9",height:"9",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":!0,children:r.jsx("path",{d:"M9.8 1.6 14.4 6.2a1 1 0 0 1-.2 1.6l-2.7 1.1-.9 3.4a.7.7 0 0 1-1.2.3L6.3 9.5 2.8 13 1.7 11.9l3.5-3.5L2.1 5.3a.7.7 0 0 1 .3-1.2l3.4-.9 1.1-2.7a1 1 0 0 1 1.6-.2Z"})})}export{q as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,j as n}from"./index-C1VaWNuD.js";/* empty css */import{D as O}from"./DataTable-C6aMSilS.js";import{p as W,a as L}from"./api-Co9aQ2Jw.js";import{t as U,n as R,f as Y}from"./time-Dhsh_2EG.js";import{u as G}from"./tail-events-LK29oCKm.js";import{o as Q}from"./openContent-C6XO6kr5.js";import{u as X}from"./Provider-D0bB7q6y.js";/* empty css */import"./perf-PX8Rx0EP.js";import"./index-BWHgHrtv.js";import"./router-kfcaYqZr.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./sse-B29iGBnw.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./createLucideIcon-Dv8H8m7J.js";import"./conversation-model-C2KuZUXc.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";const q=1e4,J=500,$=1e3,Z=6e4,D="/api/tail/discover",_=`/api/tail/recent?limit=${J}`,P=3e4,tt=[{key:"status",label:"status",cls:"s-atop-col-status",kind:"text",sortable:!1,defaultWidth:96,minWidth:70,render:t=>n.jsxs("span",{className:`s-atop-status s-atop-status--${t.status}`,children:[n.jsx("span",{className:"s-atop-status-dot","aria-hidden":"true"}),t.statusLabel]})},{key:"session",label:"session",cls:"s-atop-col-agent",kind:"text",sortable:!1,defaultWidth:168,minWidth:110,maxWidth:280,render:t=>n.jsxs("div",{className:"s-atop-agent-cell",title:t.sessionId??t.refId,children:[n.jsx("span",{className:`s-atop-chip s-atop-chip--harness s-atop-chip--harness-${st(t.source)}`,children:t.source}),n.jsx("span",{className:"s-atop-agent-id",children:t.refId.slice(0,8)})]})},{key:"project",label:"project",cls:"s-atop-col-project",kind:"text",sortable:!1,defaultWidth:200,minWidth:96,maxWidth:360,render:t=>n.jsx("span",{title:t.cwd??t.project,children:t.project})},{key:"updated",label:"updated",cls:"s-atop-col-last",kind:"time",sortable:!1,defaultWidth:86,minWidth:64,render:t=>n.jsx("span",{title:Y(t.mtimeMs),children:U(Math.max(R(t.mtimeMs)??0,R(t.lastEvent?.ts)??0))||"-"})},{key:"size",label:"size",cls:"s-atop-col-runtime",kind:"number",sortable:!1,defaultWidth:80,minWidth:64,render:t=>nt(t.size)},{key:"path",label:"path",kind:"text",sortable:!1,defaultWidth:360,minWidth:160,maxWidth:800,render:t=>n.jsx("span",{title:t.transcriptPath,children:t.cwd??t.transcriptPath})}];function z(t){const i=t?.trim();if(!i)return null;const r=F(i);return r.endsWith(".jsonl")?r.slice(0,-6):r}function F(t){const i=t.replace(/[\\/]+$/,"");return i.split(/[\\/]/).filter(Boolean).at(-1)??i}function et(t){const r=t.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean);return r.pop(),r.at(-1)??""}function st(t){return t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function nt(t){if(!Number.isFinite(t)||t<0)return"-";if(t<1024)return`${t} B`;const i=t/1024;if(i<1024)return`${i.toFixed(i>=10?0:1)} KiB`;const r=i/1024;return`${r.toFixed(r>=10?0:1)} MiB`}function at(t,i){return i?[t.refId,t.sessionId??"",t.source,t.project,t.cwd??"",t.transcriptPath,t.lastEvent?.summary??"",t.process?.command??""].join(" ").toLowerCase().includes(i.toLowerCase()):!0}function B(t){return`${t.source}\0${t.cwd??""}`}function ot(t){return`${t.source}\0${t.cwd??""}`}function it(t,i,r){if(!t?.transcripts?.length)return[];const d=new Map;for(const s of i){const l=d.get(s.sessionId);(!l||s.ts>l.ts)&&d.set(s.sessionId,s)}const h=new Map;for(const s of t.processes){if(!s.cwd)continue;const l=h.get(B(s));(!l||s.pid<l.pid)&&h.set(B(s),s)}return t.transcripts.map(s=>{const l=z(s.sessionId)??z(s.transcriptPath);if(!l)return null;const u=s.sessionId?d.get(s.sessionId)??null:null,x=h.get(ot(s))??null,m=Math.max(s.mtimeMs,u?.ts??0),j=!!x||r-m<=Z,p=s.project?.trim()||(s.cwd?F(s.cwd):et(s.transcriptPath))||"unknown";return{refId:l,source:s.source||"unknown",project:p,cwd:s.cwd,transcriptPath:s.transcriptPath,sessionId:s.sessionId,mtimeMs:s.mtimeMs,size:s.size,status:j?"run":"idle",statusLabel:j?"active":"idle",lastEvent:u,process:x}}).filter(s=>s!==null).sort((s,l)=>{const u=Math.max(s.mtimeMs,s.lastEvent?.ts??0);return Math.max(l.mtimeMs,l.lastEvent?.ts??0)-u||s.project.localeCompare(l.project)})}function Qt({navigate:t}){const{route:i}=X(),[r]=o.useState(()=>W(D,P)),[d,h]=o.useState(r),[s,l]=o.useState(()=>W(_,P)?.events??[]),[u,x]=o.useState(r===null),[m,j]=o.useState(""),[p,S]=o.useState("all"),[y,k]=o.useState(0),[N,C]=o.useState(null),[T,V]=o.useState(Date.now()),b=o.useRef(null),I=o.useCallback(async()=>{C(null);try{h(await L(D))}catch(e){C(e instanceof Error?e.message:String(e))}finally{x(!1)}},[]);o.useEffect(()=>{I();const e=setInterval(()=>{I()},q);return()=>clearInterval(e)},[I]),o.useEffect(()=>{let e=!1;return(async()=>{try{const a=await L(_);e||l(a.events??[])}catch{}})(),()=>{e=!0}},[]),G(e=>{l(a=>a.length>=$?[...a.slice(a.length-$+1),e]:[...a,e])}),o.useEffect(()=>{const e=setInterval(()=>V(Date.now()),15e3);return()=>clearInterval(e)},[]);const f=o.useMemo(()=>it(d,s,T),[d,s,T]),H=o.useMemo(()=>[...new Set(f.map(e=>e.source))].sort(),[f]),c=o.useMemo(()=>f.filter(e=>(p==="all"||e.source===p)&&at(e,m.trim())),[f,p,m]);o.useEffect(()=>{y>=c.length&&k(Math.max(0,c.length-1))},[c.length,y]);const M=o.useCallback(e=>{e&&Q(t,{view:"sessions",sessionId:e.refId},{returnTo:i})},[t,i]);o.useEffect(()=>{const e=a=>{const E=a.target,A=E instanceof HTMLInputElement||E instanceof HTMLTextAreaElement||(E?.isContentEditable??!1);if(a.key==="/"&&!A){a.preventDefault(),b.current?.focus();return}if(A){a.key==="Escape"&&E===b.current&&(j(""),b.current?.blur());return}if(a.key==="ArrowDown"||a.key==="j"){a.preventDefault(),k(w=>c.length===0?0:Math.min(c.length-1,w+1));return}if(a.key==="ArrowUp"||a.key==="k"){a.preventDefault(),k(w=>Math.max(0,w-1));return}(a.key==="Enter"||a.key==="o")&&(a.preventDefault(),M(c[y]))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c,y,M]);const K=N?[]:c,g=o.useCallback(e=>`${e.source}:${e.transcriptPath}`,[]),v=o.useMemo(()=>new Map(c.map((e,a)=>[g(e),a])),[c,g]);return n.jsxs("div",{className:"s-atop s-atop--sessions",children:[n.jsxs("div",{className:"s-atop-fbar",children:[n.jsxs("label",{className:"s-atop-search",children:[n.jsx("span",{className:"s-atop-search-prompt",children:"/"}),n.jsx("input",{ref:b,className:"s-atop-search-input",placeholder:"filter sessions",value:m,onChange:e=>j(e.target.value)}),n.jsx("kbd",{className:"s-atop-search-kbd",children:"/"})]}),n.jsx("span",{className:"s-atop-fbar-label",children:"source"}),n.jsxs("button",{type:"button",className:`s-atop-pill${p==="all"?" s-atop-pill--on":""}`,onClick:()=>S("all"),children:["all",n.jsx("span",{className:"s-atop-pill-ct",children:f.length})]}),H.map(e=>n.jsxs("button",{type:"button",className:`s-atop-pill${p===e?" s-atop-pill--on":""}`,onClick:()=>S(e),children:[e,n.jsx("span",{className:"s-atop-pill-ct",children:f.filter(a=>a.source===e).length})]},e)),n.jsx("div",{className:"s-atop-fbar-spacer"})]}),n.jsx(O,{rows:K,columns:tt,rowId:g,storageKey:"openscout.sessions.cols",rowBindings:e=>({onMouseEnter:()=>{const a=v.get(e);a!=null&&k(a)},onFocus:()=>{const a=v.get(e);a!=null&&k(a)}}),onRowClick:e=>M(e),rowClassName:e=>v.get(g(e))===y?"s-atop-row--selected":void 0,empty:N?{title:"Discovery failed",body:N}:{title:"No raw sessions",body:m?"No sessions match the current filter.":"No transcript sessions were discovered."},loading:u,density:"compact",className:"s-atop-data-table",ariaLabel:"Raw sessions"}),n.jsxs("div",{className:"s-atop-keys",children:[n.jsxs("span",{children:[n.jsx("kbd",{children:"/"}),"filter"]}),n.jsxs("span",{children:[n.jsx("kbd",{children:"j/k"}),"select"]}),n.jsxs("span",{children:[n.jsx("kbd",{children:"enter"}),"open"]}),n.jsx("span",{className:"s-atop-keys-spacer"}),n.jsxs("span",{className:"s-atop-keys-count",children:[n.jsx("strong",{children:c.length})," sessions"]})]})]})}export{Qt as RawSessionsTable};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,j as e}from"./index-C1VaWNuD.js";import{h as ot}from"./router-kfcaYqZr.js";import{I as bs,u as Rt,M as gs,N as nt,O as rt,b as vs,P as be,Q as Mt,R as Ss,T as Vt}from"./Provider-D0bB7q6y.js";import{H as ks,A as ws,V as Gt,a as Yt,S as ys,b as js,m as qt,o as Ns,c as Cs,d as Jt,e as Qt}from"./agent-autocomplete-BlK8wY06.js";import{a as H}from"./api-Co9aQ2Jw.js";import{c as De}from"./clipboard-e3fSpeo7.js";import{e as Es}from"./credentials-BTce3VP1.js";import{b as Lt,u as Ts,a as ge}from"./persistent-state-BubPQ7tT.js";import{s as ue,e as Is,S as At}from"./scoutbot-D7kGGyK_.js";import{g as _s,b as Rs,c as Ms,i as Vs,e as Ls,s as As}from"./scout-voice-Cg1qfepC.js";import{d as Ps,f as Pt,n as Se}from"./time-Dhsh_2EG.js";import{S as Os}from"./scoutbot-markdown-yb87JlSE.js";import{L as K}from"./loader-circle-DmUG_YC7.js";import{P as Xt}from"./plus-BWKhylds.js";import{C as Ke}from"./chevron-down-D120PY4g.js";import{c as Kt}from"./createLucideIcon-Dv8H8m7J.js";import{S as Zt,a as es}from"./runtime-picker-C20lTGhV.js";import{S as zs}from"./send-horizontal-CS7mxVhX.js";import{C as $s}from"./copy-BzdzWsQd.js";import{u as ts}from"./use-reduced-motion-CPoX8iV2.js";import{R as Ot}from"./rocket-CnxqjX_K.js";import{X as Ds}from"./x-DgmmnPKt.js";import{R as Bs}from"./refresh-cw-Bkh7Cvnd.js";import{S as Us}from"./settings-DQEtqkM9.js";import{V as zt}from"./fx-z37u1o2z.js";import{B as Fs}from"./bot-WxKXYtEX.js";import{d as Hs}from"./types-B0PlfpKc.js";const Ws=[["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"}]],Gs=Kt("archive",Ws);const Ys=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],qs=Kt("circle-check",Ys),Js=new Set(["air-local","local","mini","node"]),Qs=new Set(["main","master","trunk"]);function Xs(t){return t.replace(/```[\s\S]*?```/g," code omitted ").replace(/\*\*([^*\n]+)\*\*/g,"$1").replace(/(^|[\s(])\*([^\s*][^*\n]*?[^\s*]|[^\s*])\*(?=[\s)\].,!?;:]|$)/g,"$1$2").replace(/(^|[\s(])_([^\s_][^_\n]*?[^\s_]|[^\s_])_(?=[\s)\].,!?;:]|$)/g,"$1$2").replace(/^\s*[-*]\s+/gm,"").replace(/\bhttps?:\/\/[^\s)]+/gi,o=>Ks(o)).replace(/\b(session|conversation|message|flight|invocation|work)(?:\s+(?:id|ref))?\s*[:#]?\s+([a-z0-9][a-z0-9._:-]{9,})\b/gi,(o,a,i)=>`${a.toLowerCase()} ending in ${Ze(i)}`).replace(/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,o=>`ID ending in ${Ze(o)}`).replace(/@?([a-z][a-z0-9-]*(?:\.[a-z0-9][a-z0-9-]*){2,})\b/gi,(o,a)=>Zs(o)?o:eo(a)).replace(/`([^`]+)`/g,(o,a)=>to(a)).replace(/\s+/g," ").trim()}function Ks(t){try{return new URL(t).hostname.replace(/^www\./,"").replace(/\./g," dot ")}catch{return"link"}}function Zs(t){const o=t.replace(/^@/,"").toLowerCase();return/\.(com|app|dev|org|net|io|local)(?:\b|\/)/.test(o)&&!o.endsWith(".air-local")}function eo(t){const o=t.split(".").filter(Boolean);if(o.length<2)return t;const a=[...o];for(;a.length>1&&Js.has(a.at(-1).toLowerCase());)a.pop();const[i,...c]=a,d=c.filter(p=>!Qs.has(p.toLowerCase())).map(et).filter(Boolean);return[et(i),...d].filter(Boolean).join(", ")}function to(t){return/^[a-z0-9][a-z0-9._:-]{12,}$/i.test(t)?`ID ending in ${Ze(t)}`:et(t)}function Ze(t){return(t.replace(/[^a-z0-9]/gi,"").slice(-4)||t.slice(-4)).split("").join(" ")}function et(t){return t.replace(/^@/,"").replace(/[_./:-]+/g," ").replace(/\s+/g," ").trim()}function so({state:t,chatExpanded:o,onToggleExpanded:a,sessionPickerOpen:i,onToggleSessionPicker:c,onStartNewChat:d,startingNewChat:p,onSwitchSession:j,switchingSessionId:N,sending:g,briefing:V,pendingAsk:C,onArchiveSession:f,archivingSessionId:b,onAssistantContextMenu:h,suggestedPrompts:_,onSelectPrompt:y}){const I=t.session.messages,E=o?I:I.slice(-4),k=o?0:Math.max(0,I.length-E.length),w=I.length,S=t.sessions.length,u=t.retention,T=I.length===0&&!C&&!g&&!V,P=p||g||V||!!N||!!b,W=t.session.createdAt?Ps(t.session.createdAt):null,R=T?"Scout conversation":t.session.title&&t.session.title!=="New Scout Session"?t.session.title:`Session ${t.session.id.slice(0,8)}`,O=n.useRef(null),G=I[I.length-1]?.id??null,Y=I[I.length-1]?.body??"";return n.useEffect(()=>{const x=O.current;x&&(x.scrollTop=x.scrollHeight)},[G,Y,C,g,o,t.session.id]),e.jsxs("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-hidden rounded border border-[var(--scout-chrome-border-soft)] bg-black/10 font-mono text-xs text-[var(--scout-chrome-ink-faint)]",children:[e.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-[var(--scout-chrome-border-soft)] px-2.5 py-1.5",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 truncate text-[var(--scout-chrome-ink)]",title:t.session.id,children:R}),W&&!T&&e.jsxs("span",{className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]",children:["· ",W]}),!T&&e.jsxs("span",{className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]",children:["· ",w," msg",w===1?"":"s"]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsxs("button",{type:"button",title:"Start a new chat (keeps this chat in Chats)","aria-label":"Start new chat",onClick:d,disabled:P,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:[p?e.jsx(K,{size:10,className:"animate-spin"}):e.jsx(Xt,{size:10}),e.jsx("span",{children:p?"Starting":"New chat"})]}),e.jsxs("button",{type:"button",title:`Switch chat (${S} total)`,"aria-label":"Switch chat",onClick:c,className:`flex items-center gap-1 rounded border px-1.5 py-0.5 text-2xs uppercase tracking-[0.1em] transition-colors ${i?"border-lime-300/40 bg-lime-300/10 text-lime-100":"border-[var(--scout-chrome-border-soft)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]"}`,children:[e.jsx(ks,{size:10}),e.jsx("span",{children:"Chats"}),e.jsx("span",{className:"text-[var(--scout-chrome-ink-ghost)]",children:S}),e.jsx(Ke,{size:9,className:i?"rotate-180 transition-transform":"transition-transform"})]}),w>4&&e.jsxs("button",{type:"button",title:o?"Collapse chat":"View full session","aria-label":o?"Collapse chat":"View full session",onClick:a,className:"flex items-center gap-1 rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 text-2xs uppercase tracking-[0.1em] text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]",children:[e.jsx("span",{children:o?"Collapse":"Full"}),o?e.jsx(bs,{size:9}):e.jsx(Ke,{size:9})]})]})]}),i&&e.jsxs("div",{className:"shrink-0 border-b border-[var(--scout-chrome-border-soft)] px-2 py-1.5",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2 px-0.5 text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)]",children:[e.jsx("span",{children:"Recent chats"}),u&&u.archivedCount>0&&e.jsxs("span",{children:[u.archivedCount," archived"]})]}),e.jsx("div",{className:"flex max-h-40 flex-col gap-0.5 overflow-y-auto pr-0.5",children:t.sessions.map(x=>{const U=x.id===t.session.id,Z=N===x.id,F=b===x.id,L=Pt(x.updatedAt)||"unknown",z=x.title&&x.title!=="New Scout Session"?x.title:`Session ${x.id.slice(0,8)}`;return e.jsxs("div",{className:`flex items-center gap-2 rounded border px-2 py-1 text-left transition-colors ${U?"border-lime-300/40 bg-lime-300/[0.06] text-lime-100":"border-transparent text-[var(--scout-chrome-ink-faint)] hover:border-[var(--scout-chrome-border-soft)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]"}`,children:[e.jsxs("button",{type:"button",onClick:()=>{U||j(x.id)},disabled:U||!!N||!!b,className:"flex min-w-0 flex-1 items-center gap-2 text-left disabled:cursor-not-allowed disabled:opacity-40",children:[e.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${U?"bg-lime-300":"bg-[var(--scout-chrome-ink-ghost)]"}`}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-[var(--scout-chrome-ink)]",children:z}),e.jsxs("span",{className:"shrink-0 text-2xs text-[var(--scout-chrome-ink-ghost)]",children:[x.messageCount," msg"]}),e.jsx("span",{className:"shrink-0 text-2xs text-[var(--scout-chrome-ink-ghost)]",children:L}),Z&&e.jsx(K,{size:10,className:"shrink-0 animate-spin text-lime-200"})]}),e.jsx("button",{type:"button",title:"Archive chat","aria-label":`Archive chat ${z}`,onClick:()=>f(x.id),disabled:!!N||!!b,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:F?e.jsx(K,{size:10,className:"animate-spin"}):e.jsx(Gs,{size:10})})]},x.id)})})]}),e.jsxs("div",{ref:O,className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-2.5 py-2",children:[k>0&&e.jsxs("button",{type:"button",onClick:a,className:"self-start text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)] hover:text-[var(--scout-chrome-ink)]",children:["↑ ",k," earlier message",k===1?"":"s"]}),T&&e.jsx(oo,{suggestedPrompts:_,onSelectPrompt:y}),E.map((x,U)=>{const Z=ao(E[U-1],x),F=io(x.createdAt);return e.jsxs("div",{className:"flex flex-col gap-1",children:[Z&&e.jsx("div",{className:"self-center rounded-full bg-white/[0.06] px-2.5 py-0.5 font-mono text-2xs font-medium text-[var(--scout-chrome-ink-ghost)]",title:Pt(x.createdAt),"aria-label":F,children:F}),e.jsx($t,{role:x.role,body:x.body,onContextMenu:x.role==="assistant"&&h?L=>h(L,x.body):void 0})]},x.id)}),C&&e.jsx($t,{role:"user",body:C,pending:!0}),g&&!C&&e.jsx("p",{className:"text-[var(--scout-chrome-ink-ghost)]",children:"Reading the control plane…"}),V&&e.jsxs("div",{className:"flex items-center gap-2 rounded border border-lime-300/30 bg-lime-300/[0.06] px-2.5 py-2 font-mono text-xs leading-relaxed text-lime-100",children:[e.jsx(K,{size:12,className:"shrink-0 animate-spin text-lime-300","aria-hidden":"true"}),e.jsxs("div",{className:"min-w-0 flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-xs uppercase tracking-[0.14em] text-lime-300",children:"Briefing"}),e.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:"Codex is reviewing the control-plane snapshot. Voice will pick up when it lands."})]})]})]})]})}function oo({suggestedPrompts:t=[],onSelectPrompt:o}){return e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col justify-start gap-2 px-1 py-2.5",children:[t.length>0?e.jsx("div",{className:"grid gap-1",children:t.slice(0,3).map(a=>e.jsx("button",{type:"button",onClick:()=>o?.(a),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:a},a))}):null,e.jsxs("div",{className:"max-w-[30rem]",children:[e.jsx("div",{className:"font-sans text-lg font-semibold leading-tight text-[var(--scout-chrome-ink)]",children:"Start with a question."}),e.jsx("p",{className:"mt-0.5 font-sans text-xs leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Paste a failed result or ask about what you are seeing. Scout replies when you ask."})]})]})}function no({agents:t,draft:o,onDraftChange:a,onSubmit:i,sending:c,recording:d,voiceLabel:p,voiceBusy:j,voiceUnavailable:N,voiceHeld:g=!1,onMicClick:V,prominent:C=!1,autoFocus:f,focusSignal:b}){const h=n.useRef(null),_=n.useCallback(()=>{const E=h.current;E&&(E.textarea?E.textarea.focus({preventScroll:!0}):E.focus())},[]);n.useEffect(()=>{f&&_()},[f,_]),n.useEffect(()=>{b&&_()},[b,_]);let y="Start talking";N&&(y="Set up Scout voice"),d&&(y="Stop talking"),(j||g)&&(y=p);const v=j||d||g,I=["w-full resize-none rounded border font-mono text-sm leading-relaxed text-[var(--scout-chrome-ink)] placeholder:text-[var(--scout-chrome-ink-ghost)]",C?"min-h-[88px] max-h-[170px] border-lime-300/30 bg-black/25 px-3 py-2 text-md":"min-h-[44px] max-h-[124px] border-[var(--scout-chrome-border-soft)] bg-black/20 px-2 py-1.5"].join(" ");return e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:E=>{E.preventDefault(),i()},children:[e.jsx(ws,{ref:h,agents:t,value:o,onChange:a,onSubmit:()=>{o.trim()&&!c&&i()},placeholder:g?"Type while live voice is on…":C?"Ask Scout about what you are seeing…":"Ask Scout…",rows:C?4:2,disabled:c,submitOnEnter:!0,className:"min-w-0",textareaClassName:I}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("button",{type:"button",title:y,"aria-label":y,onClick:V,disabled:c||j||g,className:`flex h-8 items-center justify-center rounded border transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${d?"border-lime-300/50 bg-lime-300/10 text-lime-200":g?"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)]"} ${v?"gap-1.5 px-3 font-mono text-xs uppercase tracking-[0.12em]":"w-9"}`,children:[j?e.jsx(K,{size:13,className:"animate-spin"}):d?e.jsx(Zt,{size:12,className:"fill-current"}):e.jsx(es,{size:13}),v&&e.jsx("span",{className:"truncate",children:p})]}),e.jsx("button",{type:"submit",title:"Send","aria-label":"Send",disabled:!o.trim()||c,className:"flex h-8 w-9 items-center justify-center rounded bg-lime-300/90 text-black transition-opacity disabled:cursor-not-allowed disabled:opacity-40",children:c?e.jsx(K,{size:13,className:"animate-spin"}):e.jsx(zs,{size:13})})]})]})}function $t({role:t,body:o,pending:a=!1,onContextMenu:i}){const c=t==="user",d=c?o:ue(o),[p,j]=n.useState(!1),N=n.useCallback(()=>{De(d).then(()=>{j(!0),window.setTimeout(()=>j(!1),1200)}).catch(()=>{})},[d]);return e.jsxs("div",{className:"group flex flex-col gap-0.5",onContextMenu:i,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("span",{className:`text-2xs uppercase tracking-[0.12em] ${c?"text-[var(--scout-chrome-ink-ghost)]":"text-lime-300"}`,children:[c?"You":"Reply",a&&" · sending"]}),e.jsx("button",{type:"button",title:p?"Copied":"Copy message","aria-label":p?"Copied message":"Copy message",disabled:a||!d.trim(),onClick:N,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:p?e.jsx(qs,{size:11}):e.jsx($s,{size:11})})]}),c?e.jsx("p",{className:`whitespace-pre-wrap break-words text-sm leading-relaxed text-[var(--scout-chrome-ink)] ${a?"opacity-60":""}`,children:d}):e.jsx("div",{className:a?"opacity-60":"",children:e.jsx(Os,{text:d})})]})}const ro=5*6e4;function ao(t,o){if(!t||!tt(t.createdAt,o.createdAt))return!0;const a=Se(t.createdAt),i=Se(o.createdAt);return a===null||i===null?!0:Math.abs(i-a)>=ro}function tt(t,o){const a=Se(t),i=Se(o);if(a===null||i===null)return!1;const c=new Date(a),d=new Date(i);return c.getFullYear()===d.getFullYear()&&c.getMonth()===d.getMonth()&&c.getDate()===d.getDate()}function io(t){const o=Se(t);if(o===null)return"";const a=new Date(o),i=new Date,c=new Date(i);c.setDate(i.getDate()-1);const d=a.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return tt(o,i.getTime())?`Today ${d}`:tt(o,c.getTime())?`Yesterday ${d}`:a.getFullYear()===i.getFullYear()?`${a.toLocaleDateString([],{month:"short",day:"numeric"})} ${d}`:`${a.toLocaleDateString([],{month:"short",day:"numeric",year:"numeric"})} ${d}`}const co={"--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"},Dt=[2,4,7,5,3,6,9,5,3,4,8,6,3,5,9,6,3,5,7,4,2,4,6,3],lo=Dt.map((t,o)=>{const a=o/Dt.length*Math.PI*2-Math.PI/2,i=24-t/2,c=24+t/2;return{x1:36+Math.cos(a)*i,y1:36+Math.sin(a)*i,x2:36+Math.cos(a)*c,y2:36+Math.sin(a)*c}});function uo({recording:t,sending:o,speaking:a,voiceAvailable:i,voiceProbeState:c,voiceState:d}){return a?"speaking":o?"thinking":t&&d==="processing"?"processing":t?"listening":c!=="idle"||d==="starting"||i===null?"checking":i===!1?"unavailable":"ready"}const mo={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 ho(t){switch(t){case"listening":return"Finish and send voice turn";case"speaking":return"Stop spoken reply";case"unavailable":return"Retry voice connection";case"checking":return"Checking voice";case"processing":return"Transcribing voice turn";case"thinking":return"Scout is thinking";case"ready":return"Start voice turn"}}function po(t){return t==="listening"||t==="processing"?"listen":t==="thinking"?"think":t==="speaking"?"speak":null}function xo({phase:t,disabled:o,onClick:a}){const i=ts(),c=t==="listening"||t==="speaking",d=ho(t);return e.jsx(qt.div,{animate:c&&!i?{scale:[1,1.025,1]}:{scale:1},transition:c&&!i?{duration:2.2,ease:"easeInOut",repeat:1/0}:{duration:.18},children:e.jsx("button",{type:"button",onClick:a,disabled:o,"aria-label":d,title:d,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:e.jsxs("svg",{viewBox:"0 0 72 72",className:"h-[72px] w-[72px]","aria-hidden":"true",children:[e.jsx("circle",{cx:"36",cy:"36",r:"24",fill:"none",stroke:"#d2cec6",strokeWidth:"0.8"}),lo.map((p,j)=>e.jsx("line",{x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,stroke:c?"#817b71":"#a5a198",strokeWidth:"1.15",strokeLinecap:"round"},j)),e.jsx("circle",{cx:"36",cy:"36",r:"7.5",fill:c?"#b98a3b":"#d3b16d"})]})})})}const fo=[{id:"listen",label:"Listen"},{id:"think",label:"Think"},{id:"speak",label:"Speak"}];function bo({messages:t,pendingAsk:o,partial:a,error:i,status:c,recording:d,sending:p,speaking:j,voiceAvailable:N,voiceInputSource:g,voiceProbeState:V,voiceState:C,voiceReplies:f,settingsOpen:b,setupPanel:h,settingsPanel:_,assistantModel:y,onPrimaryAction:v,onToggleVoiceReplies:I,onToggleSettings:E,onNewChat:k,onOpenLive:w}){const S=ts(),u=n.useRef(null),T=uo({recording:d,sending:p,speaking:j,voiceAvailable:N,voiceProbeState:V,voiceState:C}),P=mo[T],W=T==="checking"||T==="processing"||T==="thinking",R=g??(N===!0?"Default input from Scout Menu":"Checking microphone…"),O=t.slice(-12),G=a||(p&&O.at(-1)?.body!==o?o:null),Y=O.length===0&&!G,x=po(T),U=y?.trim()||"Turn-based voice",Z=N===!1?"Mic offline":N===null?"Checking mic":"Mic active",F=T==="unavailable"?"bg-[#a25549]":T==="ready"||T==="checking"?"bg-[#a7a49d]":"bg-[#b58a3f]";return n.useEffect(()=>{u.current?.scrollIntoView({block:"nearest"})},[t.length,o]),e.jsxs("section",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden bg-[#f3f0e9] text-[#2a2d2f]",style:co,"aria-label":"Direct voice conversation",children:[e.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:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("h1",{className:"truncate font-[var(--font-accent-title)] text-[15px] font-semibold tracking-[-0.018em] text-[#171a1c] sm:text-[17px]",children:"Direct Voice"}),e.jsx("span",{className:"hidden h-4 w-px bg-[#d6d1c7] sm:block","aria-hidden":"true"}),e.jsxs("div",{className:"hidden min-w-0 items-center gap-2 sm:flex","aria-live":"polite",children:[e.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${F}`,"aria-hidden":"true"}),e.jsx("span",{className:"truncate text-xs text-[#6f716e]",children:P.label})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 sm:gap-2",children:[e.jsxs("div",{className:"flex rounded-md border border-[#cbc5ba] bg-[#e8e3da] p-0.5",role:"tablist","aria-label":"Voice mode",children:[e.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"}),e.jsx("button",{type:"button",role:"tab","aria-selected":"false",onClick:w,disabled:!w,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"})]}),e.jsxs("button",{type:"button",onClick:k,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:[e.jsx(Xt,{size:14,"aria-hidden":"true"}),e.jsx("span",{className:"hidden md:inline",children:"New chat"})]}),e.jsx("button",{type:"button",onClick:I,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] ${f?"bg-[#e1d5bd] text-[#765923]":"text-[#6e706d] hover:bg-[#e7e2d9] hover:text-[#191c1e]"}`,"aria-pressed":f,"aria-label":f?"Mute spoken replies":"Enable spoken replies",title:f?"Spoken replies on":"Spoken replies off",children:f?e.jsx(Gt,{size:15}):e.jsx(Yt,{size:15})}),e.jsx("button",{type:"button",onClick:E,className:`grid h-8 w-8 place-items-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#9c7736] ${b?"bg-[#e1d5bd] text-[#765923]":"text-[#6e706d] hover:bg-[#e7e2d9] hover:text-[#191c1e]"}`,"aria-expanded":b,"aria-label":"Voice and Scoutbot settings",title:"Voice and Scoutbot settings",children:e.jsx(ys,{size:15})})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx("div",{className:"mx-auto flex min-h-full w-full max-w-[880px] flex-col px-6 py-8 sm:px-10 sm:py-10 lg:px-14",children:e.jsxs("div",{className:"w-full max-w-[720px]",children:[Y?e.jsxs("div",{className:"pt-1",children:[e.jsx("p",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[#8b8983]",children:"Conversation"}),e.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."})]}):e.jsxs("div",{className:"space-y-8 sm:space-y-9",children:[O.map(L=>{const z=L.role==="assistant";return e.jsxs("article",{className:"max-w-[68ch]",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[e.jsx("span",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[#575a59]",children:z?"Scout":"You"}),z&&e.jsx("span",{className:"text-[10px] text-[#8a8983]",children:U})]}),e.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-[15px] leading-6 text-[#25292a] sm:text-base sm:leading-7",children:z?ue(L.body):L.body})]},L.id)}),G&&e.jsxs("article",{className:"max-w-[68ch]","aria-live":"polite",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[#765923]",children:"You"}),e.jsx("span",{className:"text-[10px] text-[#9a7a40]",children:a?"Listening":"Sending"})]}),e.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-[15px] leading-6 text-[#25292a] sm:text-base sm:leading-7",children:G})]})]}),e.jsx("div",{ref:u})]})})}),e.jsx(js,{initial:!1,children:(h||b||i)&&e.jsx(qt.div,{initial:S?!1:{opacity:0,y:6},animate:{opacity:1,y:0},exit:S?void 0:{opacity:0,y:6},className:"max-h-[34vh] shrink-0 overflow-y-auto border-y border-[#d9d4ca] bg-[#eeeae2]",children:e.jsxs("div",{className:"mx-auto w-full max-w-[880px] px-6 py-4 sm:px-10 lg:px-14",children:[i&&e.jsx("p",{className:"mb-3 text-sm leading-6 text-[#93483f]",children:i}),h,b&&_]})})}),e.jsxs("div",{className:"shrink-0 px-5 pb-4 pt-3 sm:px-8 sm:pb-5",children:[e.jsxs("div",{className:"flex flex-col items-center text-center",children:[e.jsx(xo,{phase:T,disabled:W,onClick:v}),e.jsxs("div",{className:"mt-3","aria-live":"polite",children:[e.jsx("p",{className:"text-sm font-semibold text-[#24282a]",children:P.label}),e.jsx("p",{className:"mt-0.5 text-xs text-[#7a7b76]",children:P.helper})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-[#7b6a49]",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#b58a3f]","aria-hidden":"true"}),e.jsx("span",{children:Z})]})]}),e.jsxs("footer",{className:"mx-auto mt-4 flex w-full max-w-[880px] flex-col items-stretch justify-between gap-2 border-t border-[#d9d4ca] pt-3 text-[11px] text-[#747570] sm:flex-row sm:items-center sm:gap-4",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(es,{size:12,className:"shrink-0 text-[#8b7350]","aria-hidden":"true"}),e.jsxs("span",{className:"truncate",children:["Input: ",R]})]}),e.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 sm:justify-start","aria-label":`Voice turn state: ${P.label}`,children:fo.map(L=>{const z=x===L.id;return e.jsx("span",{className:z?"font-medium text-[#5e4821]":"text-[#96948e]",children:L.label},L.id)})}),c&&!p&&T!=="listening"&&e.jsx("span",{className:"hidden max-w-48 truncate text-right text-[#96948e] lg:block",children:c})]})]})]})}function Bt({icon:t,title:o,onClick:a,disabled:i,active:c,badge:d}){return e.jsxs("button",{type:"button",title:o,"aria-label":o,onClick:a,disabled:i,className:`flex shrink-0 items-center gap-1 rounded border p-1 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${c?"border-lime-300/50 bg-lime-300/10 text-lime-200":"border-[var(--scout-chrome-border-soft)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]"}`,children:[t,d&&e.jsx("span",{className:"font-mono text-3xs tracking-tight",children:d})]})}function Ut({issue:t,probeState:o,onLaunch:a,onRetry:i,onSettings:c,onDismiss:d}){const p=o==="probing"||o==="launching";return e.jsxs("div",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-black/15 px-2.5 py-2 font-mono text-xs text-[var(--scout-chrome-ink)]",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ot,{size:13,className:"mt-0.5 shrink-0 text-[var(--scout-chrome-ink-faint)]"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"uppercase tracking-[0.14em] text-[var(--scout-chrome-ink-faint)]",children:"Scout Voice"}),e.jsx("p",{className:"mt-1 leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"Open Scout Menu to use speech."}),t&&e.jsx("p",{className:"mt-2 break-words leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:t})]}),d?e.jsx("button",{type:"button",title:"Hide voice setup","aria-label":"Hide voice setup",onClick:d,className:"shrink-0 rounded border border-transparent p-1 text-[var(--scout-chrome-ink-ghost)] transition-colors hover:border-[var(--scout-chrome-border-soft)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]",children:e.jsx(Ds,{size:11})}):null]}),e.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-1.5",children:[e.jsx(Xe,{icon:o==="launching"?e.jsx(K,{size:12,className:"animate-spin"}):e.jsx(Ot,{size:12}),label:o==="launching"?"Opening":"Open",onClick:a,disabled:o==="probing",title:"Open Scout services"}),e.jsx(Xe,{icon:o==="probing"?e.jsx(K,{size:12,className:"animate-spin"}):e.jsx(Bs,{size:12}),label:"Retry",onClick:i,disabled:p,title:"Check Scout voice again"}),e.jsx(Xe,{icon:e.jsx(Us,{size:12}),label:"Voice",onClick:c,disabled:o==="probing",title:"Open Scoutbot voice settings"})]})]})}function Xe({icon:t,label:o,onClick:a,disabled:i,title:c}){return e.jsxs("button",{type:"button",title:c,onClick:a,disabled:i,className:"flex min-h-7 items-center justify-center gap-1.5 rounded border border-[var(--scout-chrome-border-soft)] px-2 text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)] disabled:cursor-not-allowed disabled:opacity-45",children:[t,o]})}const ve="gpt-4o-mini-tts",st="us-woman",Be=[{id:"us-woman",label:"US Woman",locale:"US English",presentation:"Woman",voiceName:"Marin",description:"Warm, clear, and conversational.",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.",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.",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.",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."}}],me={modelId:ve,voiceId:"marin",instructions:"Speak naturally, clearly, and conversationally."};function go(t){return t==="custom"||Be.some(o=>o.id===t)}function vo(t,o={}){return t==="custom"?{modelId:o.modelId?.trim()||me.modelId,voiceId:o.voiceId?.trim()||me.voiceId,instructions:o.instructions?.trim()||me.instructions}:Be.find(a=>a.id===t)?.speech??Be.find(a=>a.id===st).speech}function Ft({presentation:t,voicePresetId:o,onVoicePresetId:a,speechSelectionId:i,onSpeechSelectionId:c,customSpeechModelId:d,onCustomSpeechModelId:p,customSpeechVoiceId:j,onCustomSpeechVoiceId:N,customSpeechInstructions:g,onCustomSpeechInstructions:V,voiceDefaults:C,modelDraft:f,onModelDraft:b,promptDraft:h,onPromptDraft:_,configLoading:y,configSaving:v,configError:I,configStatus:E,onSave:k,onReload:w}){const S=t==="direct-voice";return e.jsx("div",{className:`rounded border border-[var(--scout-chrome-border-soft)] p-3 ${S?"bg-[#f8f5ef]":"bg-black/10"}`,children:e.jsxs("div",{className:"flex flex-col gap-3",children:[S?e.jsxs("fieldset",{className:"flex flex-col gap-2",children:[e.jsx("legend",{className:"mb-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Scout voice"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",role:"radiogroup","aria-label":"Scout voice",children:Be.map(u=>{const T=i===u.id;return e.jsxs("button",{type:"button",role:"radio","aria-checked":T,onClick:()=>c(u.id),className:`min-h-20 rounded border p-2.5 text-left transition ${T?S?"border-[#b89a5f] bg-[#efe5d0] text-[var(--scout-chrome-ink)]":"border-lime-300/60 bg-lime-300/10 text-[var(--scout-chrome-ink)]":S?"border-[var(--scout-chrome-border-soft)] bg-white/55 text-[var(--scout-chrome-ink-faint)] hover:bg-white":"border-[var(--scout-chrome-border-soft)] bg-black/20 text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)]"}`,children:[e.jsx("span",{className:"block font-mono text-xs font-bold uppercase tracking-[0.1em]",children:u.label}),e.jsxs("span",{className:"mt-1 block font-mono text-2xs leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:[u.voiceName," · ",u.description]})]},u.id)})}),e.jsxs("button",{type:"button",role:"radio","aria-checked":i==="custom",onClick:()=>c("custom"),className:`rounded border px-2.5 py-2 text-left font-mono text-xs transition ${i==="custom"?S?"border-[#b89a5f] bg-[#efe5d0] text-[var(--scout-chrome-ink)]":"border-lime-300/60 bg-lime-300/10 text-[var(--scout-chrome-ink)]":S?"border-[var(--scout-chrome-border-soft)] bg-white/55 text-[var(--scout-chrome-ink-faint)] hover:bg-white":"border-[var(--scout-chrome-border-soft)] bg-black/20 text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)]"}`,children:[e.jsx("span",{className:"font-bold uppercase tracking-[0.1em]",children:"Custom voice"}),e.jsx("span",{className:"ml-2 text-[var(--scout-chrome-ink-ghost)]",children:"Use any supported model, voice, and style."})]}),i==="custom"&&e.jsxs("div",{className:`grid gap-2 rounded border border-[var(--scout-chrome-border-soft)] p-2.5 ${S?"bg-white/55":"bg-black/20"}`,children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Speech model",e.jsx("input",{value:d,onChange:u=>p(u.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)] ${S?"bg-white/75":"bg-black/25"}`})]}),e.jsxs("label",{className:"flex flex-col gap-1 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Voice ID",e.jsx("input",{value:j,onChange:u=>N(u.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)] ${S?"bg-white/75":"bg-black/25"}`})]})]}),e.jsxs("label",{className:"flex flex-col gap-1 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Speaking style",e.jsx("textarea",{value:g,onChange:u=>V(u.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)] ${S?"bg-white/75":"bg-black/25"}`})]})]}),e.jsx("p",{className:"font-mono text-2xs normal-case leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"Request-based TTS, separate from GPT Live. Replies are AI-generated speech."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"flex flex-col gap-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Voice FX",e.jsx("select",{value:o,onChange:u=>a(u.target.value),className:"rounded border border-[var(--scout-chrome-border-soft)] bg-black/20 px-2 py-1.5 font-mono text-sm normal-case tracking-normal text-[var(--scout-chrome-ink)]",children:zt.map(u=>e.jsxs("option",{value:u.id,children:[u.label," — ",u.family]},u.id))}),e.jsx("span",{className:"font-mono text-2xs normal-case leading-relaxed tracking-normal text-[var(--scout-chrome-ink-ghost)]",children:zt.find(u=>u.id===o)?.description??"Custom voice mood for spoken replies."})]}),e.jsxs("div",{className:"flex flex-col gap-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Scout Voice",e.jsx("div",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-black/20 px-2 py-1.5 font-mono text-sm normal-case tracking-normal text-[var(--scout-chrome-ink)]",children:C?`${C.modelId}${C.voiceId?` / ${C.voiceId}`:""}`:"Unavailable"})]})]}),e.jsxs("label",{className:"flex flex-col gap-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Preferred model",e.jsx("input",{value:f,onChange:u=>b(u.target.value),placeholder:"gpt-4.1-mini",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)] ${S?"bg-white/75":"bg-black/20"}`,disabled:y||v})]}),e.jsxs("label",{className:"flex flex-col gap-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["System Prompt",e.jsx("textarea",{value:h,onChange:u=>_(u.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)] ${S?"bg-white/75":"bg-black/20"}`,disabled:y||v})]}),I&&e.jsx("div",{className:`font-mono text-xs leading-relaxed ${S?"text-[#93483f]":"text-red-300"}`,children:I}),E&&e.jsx("div",{className:`font-mono text-xs leading-relaxed ${S?"text-[#765923]":"text-lime-200"}`,children:E}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:k,disabled:y||v||!h.trim(),className:`flex items-center justify-center gap-2 rounded px-2.5 py-2 font-mono text-xs font-bold uppercase tracking-[0.12em] transition-opacity disabled:cursor-not-allowed disabled:opacity-40 ${S?"bg-[#282c2d] text-white hover:bg-[#151819]":"bg-lime-300/90 text-black"}`,children:[(y||v)&&e.jsx(K,{size:13,className:"animate-spin"}),v?"Saving":"Save"]}),e.jsx("button",{type:"button",onClick:w,disabled:y||v,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 So="chill-dispatcher",ko=6e4,wo=2500,yo=1.2,jo={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 No(t){const o=Math.min(1,t/8);return{saturationAmount:.035+o*.025,presencePeakDb:1.5+o*1.5}}function Co(t,o){return{...t==="chill-dispatcher"?jo:{},...No(o)}}function ss(t,o,a){return new Promise((i,c)=>{const d=window.setTimeout(()=>c(new Error(a)),o);t.then(i,c).finally(()=>window.clearTimeout(d))})}async function $e(t,o={}){!t.sessionId&&!o.allowCurrentSession||await ss(t.cancel(),wo,"Timed out releasing Scout voice session.").catch(()=>{})}function Eo(t){const o=t instanceof Error?t.message:String(t);return/session_cancelled|was cancelled|cancelled/i.test(o)}const Ht=new RegExp("(?:^|(?<=[\\s(`'\"<>]))(?:~\\/|\\/(?:Users|home|opt|var|etc|tmp|private)\\/)[^\\s)`'\"<>]+\\.[A-Za-z0-9]{1,8}\\b","g");function To(t){const o=[],a=new Set;Ht.lastIndex=0;let i;for(;(i=Ht.exec(t))!==null;)a.has(i[0])||(a.add(i[0]),o.push(i[0]));return o}function Wt(t){const o=t.split("/").filter(Boolean);return o.length<=2?t:`…/${o.slice(-2).join("/")}`}function Io(){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 _o=["Explain what went wrong here.","Help me rewrite this message.","What should I try next?"];function Ro({height:t,forceExpanded:o=!1,fill:a=!1,presentation:i="chat",onOpenLive:c}={}){const{applyScoutbotUiAction:d,agents:p,route:j,onlineCount:N}=Rt(),g=gs(),V=ot(nt,!0),C=rt(),f=V&&(C.state==="connecting"||C.state==="live"),[b,h]=Lt("openscout.scoutbot.collapsed",!0),[_,y]=n.useState(""),[v,I]=n.useState(!1),[E,k]=n.useState(null),[w,S]=n.useState(null),[u,T]=n.useState(null),[P,W]=n.useState("idle"),[R,O]=Lt("openscout.scoutbot.voiceReplies",!1),[G]=Ts("openscout.scoutbot.voiceSpeed",yo),[Y,x]=ge("openscout.scoutbot.voicePresetId",So),[U,Z]=ge("openscout.scoutbot.speechProfileId",st),[F,L]=ge("openscout.scoutbot.customSpeechModelId",me.modelId),[z,at]=ge("openscout.scoutbot.customSpeechVoiceId",me.voiceId),[ke,it]=ge("openscout.scoutbot.customSpeechInstructions",me.instructions),[q,we]=n.useState(!1),[Ue,te]=n.useState(null),[Fe,he]=n.useState(""),[J,He]=n.useState(!1),[ns,ct]=n.useState(null),[lt,We]=n.useState(null),[Lo,ye]=n.useState(null),[Ge,$]=n.useState(null),[oe,pe]=n.useState(!1),[rs,je]=n.useState(!1),[B,ne]=n.useState(null),[re,dt]=n.useState(!1),[Ye,ut]=n.useState(null),[mt,ht]=n.useState(!1),[pt,xt]=n.useState(!1),[ft,Ne]=n.useState(null),[bt,qe]=n.useState(null),[Ce,Ee]=n.useState(""),[Te,Ie]=n.useState(""),[gt,vt]=n.useState(null),[as,ae]=n.useState(!1),[is,ie]=n.useState(0),[cs,_e]=n.useState(!1),[Je,St]=n.useState(null),Re=go(U)?U:st,Me=n.useMemo(()=>vo(Re,{modelId:F,voiceId:z,instructions:ke}),[ke,F,z,Re]),Ve=n.useRef(_s()),ce=n.useRef(!1),Q=n.useRef(null),le=n.useRef(null),se=n.useRef(null),Le=n.useRef(R);Le.current=R,n.useEffect(()=>{i==="direct-voice"&&(Le.current=!0,O(!0))},[i,O]),n.useEffect(()=>(ce.current=!0,()=>{ce.current=!1,le.current="discard";const s=Q.current;Q.current=null,s&&$e(s,{allowCurrentSession:!0}),se.current?.stop(),se.current=null}),[]);const M=n.useCallback(()=>{se.current?.stop(),se.current=null,He(!1)},[]),Ae=n.useCallback(s=>{if(!s)return;M();const r=Xs(s),l=i==="direct-voice"?Rs(r,{speed:G,modelId:Me.modelId,voiceId:Me.voiceId,instructions:Me.instructions}):Ms(r,{speed:G,presetId:Y,params:Co(Y,N)});se.current=l,He(!0),l.promise.catch(m=>{Vs(m)||k(m instanceof Error?m.message:"Scout voice speech failed.")}).finally(()=>{se.current===l&&(se.current=null,He(!1))})},[M,G,Me,N,i,Y]),kt=n.useCallback(s=>{Le.current&&Ae(s)},[Ae]),wt=n.useCallback(s=>{Ae(ue(s))},[Ae]),{openFilePreview:yt}=Rt(),jt=vs(),ls=n.useCallback((s,r)=>{const l=window.getSelection()?.toString().trim(),m=ue(r),A=To(m),D=[];if(l&&(D.push({kind:"action",label:"Copy selection",shortcut:"⌘C",onSelect:()=>{De(l)}}),D.push({kind:"separator"})),D.push({kind:"action",label:"Copy message",onSelect:()=>{De(m)}}),A.length>0){D.push({kind:"separator"});for(const ee of A.slice(0,5)){const Qe=Wt(ee);D.push({kind:"action",label:`Preview ${Qe}`,onSelect:()=>yt(ee)})}for(const ee of A.slice(0,5)){const Qe=Wt(ee);D.push({kind:"action",label:`Open ${Qe} in OS`,onSelect:()=>{H("/api/file/reveal",{method:"POST",body:JSON.stringify({path:ee})}).catch(()=>{})}})}D.push({kind:"action",label:A.length===1?"Copy path":"Copy first path",onSelect:()=>{De(A[0])}})}D.push({kind:"separator"}),D.push({kind:"action",label:J?"Say again (stop current)":"Say",onSelect:()=>wt(r)}),jt(s,D)},[yt,wt,jt,J]);n.useEffect(()=>()=>{M()},[M]);const ds=_o,de=n.useCallback(s=>{const r=[...s.messages].reverse().find(m=>m.role==="user"),l=[...s.messages].reverse().find(m=>m.role==="assistant");We(r?.body??null),ye(l?ue(l.body):null)},[]),xe=n.useCallback(async()=>{try{const s=await H("/api/scoutbot/session");ne(s),de(s.session)}catch{ne(null)}},[de]);n.useEffect(()=>{xe()},[xe]);const Pe=n.useCallback(async()=>{ht(!0),Ne(null);try{const s=await H("/api/scoutbot/config");Ee(s.model),Ie(s.systemPrompt),qe(null)}catch(s){Ne(s instanceof Error?s.message:"Could not load settings.")}finally{ht(!1)}},[]);n.useEffect(()=>{oe&&Pe()},[Pe,oe]),n.useEffect(()=>{if(!oe)return;let s=!1;return H("/api/voice/defaults").then(r=>{s||vt(r)}).catch(()=>{s||vt(null)}),()=>{s=!0}},[oe]);const Nt=n.useCallback(async()=>{xt(!0),Ne(null),qe(null);try{const s=await H("/api/scoutbot/config",{method:"POST",body:JSON.stringify({model:Ce,systemPrompt:Te})});Ee(s.config.model),Ie(s.config.systemPrompt),qe("Saved")}catch(s){Ne(s instanceof Error?s.message:"Could not save settings.")}finally{xt(!1)}},[Ce,Te]),us=n.useCallback(async s=>{if(!(!s||Je)){St(s),k(null),M();try{const r=await H("/api/scoutbot/session/switch",{method:"POST",body:JSON.stringify({id:s})});ne(r),de(r.session),_e(!1),ae(!1),window.dispatchEvent(new CustomEvent(be,{detail:{id:r.session.id}}))}catch(r){k(r instanceof Error?r.message:"Could not switch session.")}finally{St(null)}}},[M,Je,de]),Oe=n.useCallback(async()=>{if(!(re||v)){if(B?.session.messages.length===0){y(""),k(null),ae(!1),_e(!1),$("New chat ready"),ie(s=>s+1);return}dt(!0),k(null),$("Starting new chat"),M();try{const s=await H("/api/scoutbot/session/reset",{method:"POST"});ne(s),y(""),We(null),ye(null),ae(!1),_e(!1),$("New chat ready"),ie(r=>r+1),window.dispatchEvent(new CustomEvent(be,{detail:{id:s.session.id}}))}catch(s){$(null),k(s instanceof Error?s.message:"Could not start a new chat.")}finally{dt(!1)}}},[re,v,B,M]),ms=n.useCallback(async s=>{if(!(!s||Ye)){ut(s),k(null),M();try{const r=await H("/api/scoutbot/session/archive",{method:"POST",body:JSON.stringify({id:s})});ne(r),de(r.session),ae(!1),$("session archived"),window.dispatchEvent(new CustomEvent(be,{detail:{id:r.session.id}}))}catch(r){k(r instanceof Error?r.message:"Could not archive session.")}finally{ut(null)}}},[Ye,M,de]),ze=n.useCallback((s,r)=>{S(r),ct(s.activeInputDeviceName),T(r?null:s.lastUnavailableReason??"Scout voice service is not reachable."),W("idle")},[]),X=n.useCallback(async(s=!1)=>{const r=Ve.current;W(m=>m==="launching"?m:"probing");const l=await r.probe(s?{force:!0}:void 0);return ze(r,l),l},[ze]);n.useEffect(()=>{Ls();const s=Ve.current,r=As(l=>{S(l.ok),ct(l.inputDeviceName),T(l.ok?null:l.reason),W("idle")});return s.connectionState==="unknown"?X():ze(s,s.connectionState==="connected"),r},[ze,X]);const Ct=n.useCallback(()=>{const s=Ve.current;k(null),W("launching"),s.launch({source:"openscout",context:Io()}),window.setTimeout(()=>{X(!0)},2400)},[X]),Et=n.useCallback(s=>{const r=ue(s);ye(r);for(const l of Is(s))l.type==="ask-agent"?($(`Sending to ${l.targetLabel}`),H("/api/scoutbot/actions/ask",{method:"POST",body:JSON.stringify({targetLabel:l.targetLabel,targetAgentId:l.targetAgentId,body:l.body,channel:l.channel})}).then(m=>{$(m.flightId?`Sent to ${m.targetAgentId??m.targetLabel} · run ${m.flightId}`:`Sent to ${m.targetAgentId??m.targetLabel}`)}).catch(m=>{$(null),k(m instanceof Error?m.message:"Could not send to agent.")})):l.type!=="reminder"&&d(l);kt(r)},[d,kt]);n.useEffect(()=>{const s=()=>{$("Scoutbot replied by voice"),xe()},r=()=>{$("Scoutbot chat changed"),xe()};return window.addEventListener(Mt,s),window.addEventListener(be,r),()=>{window.removeEventListener(Mt,s),window.removeEventListener(be,r)}},[xe]);const fe=n.useCallback(async s=>{const r=s.trim();if(!(!r||v)){I(!0),k(null),We(r),ye(null),$("Sending"),y(l=>l.trim()===r?"":l);try{await Es().catch(()=>null);const l=await H("/api/scoutbot/chat",{method:"POST",body:JSON.stringify({body:r,route:j,uiContext:Ss("web")})});ne({session:l.session,sessions:l.sessions,config:l.config}),$("Reply received"),Et(l.reply.body)}catch(l){$(null),k(l instanceof Error?l.message:"Could not send.")}finally{I(!1)}}},[Et,j,v]),Tt=n.useCallback(async()=>{if(q)return;const s=Ve.current;if(le.current=null,k(null),he(""),te("starting"),w!==!0&&!await X(!0)){te(null);return}let r=null,l=!1;const m=async()=>{!r||l||(l=!0,await $e(r,{allowCurrentSession:Q.current===r}),Q.current===r&&(Q.current=null))};try{if(r=await s.startLive({onState:te,onPartial:he},{surface:i==="direct-voice"?"direct-voice":"chat-composer"}),!ce.current){await $e(r,{allowCurrentSession:!0});return}Q.current=r,we(!0);const A=await r.result;if(await m(),!ce.current||(we(!1),he(""),le.current))return;te("done"),A.text&&await fe(A.text)}catch(A){const D=le.current;if(!ce.current)return;const ee=!!D||Eo(A);if(await m(),we(!1),he(""),D==="stop-failed")return;te(ee?null:"error"),ee||k(A instanceof Error?A.message:"Scout voice recording failed.")}finally{ce.current&&await m(),le.current=null}},[fe,i,X,q,w]),It=n.useCallback(async()=>{const s=Q.current;if(s){te("processing");try{await ss(s.stop(),ko,"Scout voice did not finish processing the recording.")}catch(r){le.current="stop-failed",await $e(s,{allowCurrentSession:!0}),Q.current===s&&(Q.current=null,we(!1),he(""),te("error")),k(r instanceof Error?`Scout voice recording did not finish: ${r.message}`:"Scout voice recording did not finish.")}}},[]);n.useEffect(()=>{const s=()=>h(!1);return window.addEventListener("scout:scoutbot-panel-open",s),()=>window.removeEventListener("scout:scoutbot-panel-open",s)},[h]),n.useEffect(()=>Ns(()=>h(!b)),[b,h]),n.useEffect(()=>{const s=r=>{const l=r.detail,m=l&&typeof l=="object"&&"body"in l?l.body:null;typeof m=="string"&&m.trim()&&(h(!1),fe(m))};return window.addEventListener(At,s),()=>window.removeEventListener(At,s)},[fe,h]),n.useEffect(()=>{const s=r=>{const l=r.detail,m=l&&typeof l=="object"&&"body"in l?l.body:null;typeof m=="string"&&m.trim()&&(h(!1),y(m),ie(A=>A+1))};return window.addEventListener("scout:scoutbot-compose",s),()=>window.removeEventListener("scout:scoutbot-compose",s)},[h]);const _t=n.useMemo(()=>{const s=J?"speaking":v?"thinking":q?"listening":"idle",r=B?.session??null,l=r&&r.messages.length>0?r.messages[r.messages.length-1]:null;return{activity:s,brief:{lastDeliveredAt:null},reminders:{dueCount:0,upcomingCount:0,due:[],next:null},voice:{available:w,setupBlocked:w===!1,replies:R},error:E,session:{title:r?.title??null,lastActivityAt:l?.createdAt??r?.updatedAt??null},conversation:{messageCount:r?.messages.length??0,loading:B===null}}},[J,v,q,w,R,E,B]);n.useEffect(()=>{g?.publishState(_t)},[g,_t]),n.useEffect(()=>{if(!g)return;const s={focusScoutbot:()=>h(!1),triggerBrief:()=>{h(!1),ie(r=>r+1)},triggerAskState:()=>{h(!1),ie(r=>r+1)},toggleVoiceReplies:()=>{const r=!R;O(r),r||M()},openScoutbotSettings:()=>{h(!1),pe(!0)},startNewChat:()=>{h(!1),re||Oe()},dismissReminder:()=>{},askReminderStatus:()=>{h(!1),ie(r=>r+1)}};g.registerActions(s)},[g,h,R,O,M,pe,re,Oe]),n.useEffect(()=>{w===!0&&je(!1)},[w]);const hs=f?"Live call":q?Ue==="processing"?"Sending":"Stop":P==="probing"?"Checking Voice":P==="launching"?"Opening Scout":w===!1?"Open Scout":"Start Talking",ps=B!==null&&B.session.messages.length===0&&!v;if(i==="direct-voice")return e.jsx(bo,{messages:B?.session.messages??[],pendingAsk:v?lt:null,partial:Fe,error:E,status:Ge,recording:q,sending:v,speaking:J,voiceAvailable:w,voiceInputSource:ns,voiceProbeState:P,voiceState:Ue,voiceReplies:R,settingsOpen:oe,assistantModel:B?.session.model??B?.config.model??null,setupPanel:w===!1?e.jsx(Ut,{issue:u,probeState:P,onLaunch:Ct,onRetry:()=>{X(!0)},onSettings:()=>pe(!0),onDismiss:()=>je(!1)}):null,settingsPanel:e.jsx(Ft,{presentation:"direct-voice",voicePresetId:Y,onVoicePresetId:x,speechSelectionId:Re,onSpeechSelectionId:Z,customSpeechModelId:F,onCustomSpeechModelId:L,customSpeechVoiceId:z,onCustomSpeechVoiceId:at,customSpeechInstructions:ke,onCustomSpeechInstructions:it,voiceDefaults:gt,modelDraft:Ce,onModelDraft:Ee,promptDraft:Te,onPromptDraft:Ie,configLoading:mt,configSaving:pt,configError:ft,configStatus:bt,onSave:()=>{Nt()},onReload:()=>{Pe()}}),onPrimaryAction:()=>{J?M():q?It():w===!1?X(!0):Tt()},onToggleVoiceReplies:()=>{const s=!R;Le.current=s,O(s),s||M()},onToggleSettings:()=>pe(s=>!s),onNewChat:()=>{re||Oe()},onOpenLive:c});if(b&&!o)return e.jsx("div",{className:"flex shrink-0 items-center border-t border-[var(--scout-chrome-border-soft)] px-3 py-1.5",children:e.jsx(Cs,{})});const xs=a?"flex h-full min-h-0 flex-col overflow-hidden border-t border-[var(--scout-chrome-border-soft)]":t===void 0?"flex max-h-[60vh] shrink-0 flex-col overflow-hidden border-t border-[var(--scout-chrome-border-soft)]":"flex shrink-0 flex-col overflow-hidden border-t border-[var(--scout-chrome-border-soft)]",fs=t===void 0||a?void 0:{height:`${t}px`};return e.jsxs("section",{className:xs,style:fs,children:[e.jsxs("div",{className:"flex shrink-0 flex-col gap-2 px-3 pt-2.5 pb-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"flex min-w-0 items-center gap-2",children:e.jsx(Fs,{size:20,className:"shrink-0 text-lime-300","aria-hidden":"true"})}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx(Bt,{icon:R?e.jsx(Gt,{size:11}):e.jsx(Yt,{size:11}),title:f?R?"Voice replies on for typed chat (live call has its own audio)":"Voice replies off for typed chat (live call has its own audio)":R?"Voice replies on (click to mute)":"Voice replies off (click to enable)",onClick:()=>{const s=!R;O(s),s||M()},active:R}),!o&&e.jsx(Bt,{icon:e.jsx(Ke,{size:11}),title:"Minimize",onClick:()=>h(!0)})]})]}),oe&&e.jsx(Ft,{presentation:"chat",voicePresetId:Y,onVoicePresetId:x,speechSelectionId:Re,onSpeechSelectionId:Z,customSpeechModelId:F,onCustomSpeechModelId:L,customSpeechVoiceId:z,onCustomSpeechVoiceId:at,customSpeechInstructions:ke,onCustomSpeechInstructions:it,voiceDefaults:gt,modelDraft:Ce,onModelDraft:Ee,promptDraft:Te,onPromptDraft:Ie,configLoading:mt,configSaving:pt,configError:ft,configStatus:bt,onSave:()=>{Nt()},onReload:()=>{Pe()}})]}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col px-3 pb-1.5",children:B&&e.jsx(so,{state:B,chatExpanded:as,onToggleExpanded:()=>ae(s=>!s),sessionPickerOpen:cs,onToggleSessionPicker:()=>_e(s=>!s),onStartNewChat:()=>{Oe()},startingNewChat:re,onSwitchSession:s=>{us(s)},switchingSessionId:Je,sending:v,briefing:!1,pendingAsk:v?lt:null,onArchiveSession:s=>{ms(s)},archivingSessionId:Ye,onAssistantContextMenu:ls,suggestedPrompts:ds,onSelectPrompt:s=>{y(s),ae(!1)}})}),e.jsxs("div",{className:"flex shrink-0 flex-col gap-1.5 border-t border-[var(--scout-chrome-border-soft)] bg-black/10 px-3 pt-2 pb-2.5",children:[w===!1&&rs&&!f&&e.jsx(Ut,{issue:u,probeState:P,onLaunch:Ct,onRetry:()=>{X(!0)},onSettings:()=>pe(!0),onDismiss:()=>je(!1)}),(Fe||J)&&!f&&e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded border border-[var(--scout-chrome-border-soft)] bg-black/10 px-2.5 py-2 font-mono text-xs leading-relaxed text-[var(--scout-chrome-ink-faint)]",children:[e.jsx("span",{className:"min-w-0 truncate",children:J?"Speaking reply…":Fe}),J&&e.jsx("button",{type:"button",title:"Stop spoken reply",onClick:M,className:"shrink-0 rounded border border-[var(--scout-chrome-border-soft)] p-1 text-[var(--scout-chrome-ink)] hover:bg-[var(--scout-chrome-hover)]",children:e.jsx(Zt,{size:11,className:"fill-current"})})]}),Ge&&!v&&e.jsx("div",{className:"font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)]",children:Ge}),e.jsx(no,{agents:p,draft:_,onDraftChange:y,onSubmit:()=>{fe(_)},sending:v,recording:q,voiceLabel:hs,voiceBusy:Ue==="processing"||P==="probing"||P==="launching",voiceUnavailable:w===!1,voiceHeld:f,onMicClick:()=>{if(!f){if(w===!1){je(!0);return}q?It():Tt()}},prominent:ps&&!f,autoFocus:o,focusSignal:is}),E&&e.jsx("div",{className:"rounded border border-red-400/30 bg-red-400/10 px-2.5 py-2 font-mono text-xs leading-relaxed text-red-200",children:E})]})]})}function os({dictationActive:t=!1,autoStart:o=!1}){const a=ot(nt,!0),{enabled:i,state:c,leaseId:d,startCall:p,endCall:j}=rt(),N=n.useRef(!1),g=n.useRef(null),[V,C]=n.useState(()=>window.innerWidth>=720&&window.innerHeight>=520?"page":"compact"),f=window.webkit?.messageHandlers?.scoutRealtimeVoice;return n.useEffect(()=>{const b=()=>{C(window.innerWidth>=720&&window.innerHeight>=520?"page":"compact")};return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]),n.useEffect(()=>{f?.postMessage({kind:"session-state",state:c,leaseId:d})},[d,f,c]),n.useEffect(()=>{const b=()=>{if(g.current)return g.current;const _=j().finally(()=>{g.current===_&&(g.current=null)});return g.current=_,_},h=()=>{b()};return window.__scoutRealtimeVoiceStop=b,window.addEventListener(Vt,h),window.__scoutRealtimeVoiceStopRequested&&b(),()=>{window.removeEventListener(Vt,h),window.__scoutRealtimeVoiceStop===b&&delete window.__scoutRealtimeVoiceStop}},[j]),n.useEffect(()=>{!o||t||!a||!i||N.current||c!=="idle"&&c!=="ended"&&c!=="error"||(N.current=!0,p())},[o,t,a,i,p,c]),a?i?e.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsx(Jt,{state:c,onMinimize:f?()=>f.postMessage("minimize"):void 0,onExpand:f?()=>f.postMessage(V==="page"?"restore":"expand"):void 0,layout:V}),e.jsx(Qt,{dictationActive:t,layout:V})]}):e.jsxs("div",{className:"flex h-full flex-col justify-center gap-2 p-4",children:[e.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Live voice is disabled"}),e.jsx("p",{className:"text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Enable realtime voice in Settings → Voice. The footer Voice control starts and manages calls."})]}):e.jsxs("div",{className:"flex h-full flex-col justify-center gap-2 p-4",children:[e.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Live voice is off"}),e.jsx("p",{className:"text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"This Scout build has live conversations disabled. Calls use the configured OpenAI API account when the feature is available."})]})}function Mo(){const t=ot(nt,!0),{enabled:o,state:a}=rt(),[i,c]=n.useState("direct"),d=t&&o;return i==="direct"?e.jsx("main",{className:"h-full min-h-0 overflow-hidden bg-[#f3f0e9]",children:e.jsx(Ro,{forceExpanded:!0,fill:!0,presentation:"direct-voice",onOpenLive:()=>c("realtime")})}):e.jsxs("main",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-[var(--scout-chrome-bg)]",children:[e.jsxs("header",{className:"flex min-h-14 shrink-0 items-center justify-between gap-4 border-b border-[var(--scout-chrome-border-soft)] px-4 py-2.5 sm:px-7",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("h1",{className:"truncate font-[var(--font-accent-title)] text-[17px] font-semibold tracking-[-0.018em] text-[var(--scout-chrome-ink-strong)]",children:"GPT Live"}),e.jsx("span",{className:"hidden h-4 w-px bg-[var(--scout-chrome-border-soft)] sm:block","aria-hidden":"true"}),e.jsxs("span",{className:"hidden items-center gap-2 text-xs text-[var(--scout-chrome-ink-faint)] sm:flex",children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${d?"bg-[var(--scout-accent)]":"bg-[var(--scout-chrome-ink-ghost)]"}`,"aria-hidden":"true"}),d?"Ready for a live call":"Live voice unavailable"]})]}),e.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:[e.jsx("button",{type:"button",role:"tab","aria-selected":"false",onClick:()=>c("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"}),e.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"})]})]}),e.jsx("section",{className:"min-h-0 flex-1 overflow-hidden",children:d?e.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[e.jsx(Jt,{state:a,layout:"page"}),e.jsx(Qt,{dictationActive:!1,layout:"page"})]}):e.jsx(os,{})})]})}const Vo=Hs({id:"voice",label:"Voice",route:{view:"voice"},webPath:"/voice",screen:"RealtimeVoiceScreen",embed:{path:"/embed/voice",profile:"macos.voice",rootClassName:"s-voice-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:t=>({dictationActive:t.get("dictationActive")==="1",autoStart:t.get("autoStart")==="1"})}}),ln=Object.freeze(Object.defineProperty({__proto__:null,RealtimeVoicePage:Mo,RealtimeVoiceScreen:os,scoutSurface:Vo},Symbol.toStringTag,{value:"Module"}));export{Mo as R,Ro as S,ln as a};
|
package/dist/client/assets/{RepoDiffEmbedScreen-CjZ5ew3y.js → RepoDiffEmbedScreen-mexrJPhW.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-C1VaWNuD.js";import{R as c}from"./RepoDiffViewerLazy-DzfoFhbl.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-CdTFfmbk.js → RepoDiffPageScreen-DbqX4L3q.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-C1VaWNuD.js";import{R as l}from"./RepoDiffViewerLazy-DzfoFhbl.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-BI9AljSD.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-BfZHKAkI.js";import{C as ce}from"./chevron-down-C475vltS.js";import{C as de}from"./check-DbIkldnK.js";import{L as ue}from"./loader-circle-B2W9DPG5.js";import{S as fe}from"./send-horizontal-qyjNgEaV.js";import{F as he}from"./file-code-corner-DDPq4Cur.js";import{C as me}from"./code-xml-CvKBY3KA.js";import{X as pe}from"./x-DfRJbqrh.js";import{r as O,a as Y,f as V}from"./cache-CeWH_KzJ.js";import{M as xe}from"./message-square-O-Hu9Mk2.js";import{R as ge}from"./refresh-cw-DmNAhaH0.js";import{P as be}from"./plus-BJ1If8vj.js";import{a as B}from"./api-Co9aQ2Jw.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./createLucideIcon-DthwWQIg.js";import"./perf-PX8Rx0EP.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-C1VaWNuD.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-35AHf9RQ.js";import{C as ce}from"./chevron-down-D120PY4g.js";import{C as de}from"./check-Dz2SRHft.js";import{L as ue}from"./loader-circle-DmUG_YC7.js";import{S as fe}from"./send-horizontal-CS7mxVhX.js";import{F as he}from"./file-code-corner-jlGFdr8d.js";import{C as me}from"./code-xml-CkkNdRmu.js";import{X as pe}from"./x-DgmmnPKt.js";import{r as O,a as Y,f as V}from"./cache-CeWH_KzJ.js";import{M as xe}from"./message-square-BLiFqpe_.js";import{R as ge}from"./refresh-cw-Bkh7Cvnd.js";import{P as be}from"./plus-BWKhylds.js";import{a as B}from"./api-Co9aQ2Jw.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./createLucideIcon-Dv8H8m7J.js";import"./perf-PX8Rx0EP.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
|
`)}
|
package/dist/client/assets/{RepoDiffViewerLazy-BkBmbi1Z.js → RepoDiffViewerLazy-DzfoFhbl.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RepoDiffViewer-
|
|
2
|
-
import{j as e,r as i,_ as s}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RepoDiffViewer-Bw5yMC4A.js","assets/index-C1VaWNuD.js","assets/index-i7TMxlwW.css","assets/ui-LM8pS8qE.js","assets/usePierreRuntime-35AHf9RQ.js","assets/chunk-HRAB3GC3-KjjrTLCU.js","assets/chevron-down-D120PY4g.js","assets/createLucideIcon-Dv8H8m7J.js","assets/check-Dz2SRHft.js","assets/loader-circle-DmUG_YC7.js","assets/send-horizontal-CS7mxVhX.js","assets/file-code-corner-jlGFdr8d.js","assets/code-xml-CkkNdRmu.js","assets/x-DgmmnPKt.js","assets/cache-CeWH_KzJ.js","assets/api-Co9aQ2Jw.js","assets/perf-PX8Rx0EP.js","assets/message-square-BLiFqpe_.js","assets/refresh-cw-Bkh7Cvnd.js","assets/plus-BWKhylds.js","assets/repo-diff-DyYmQMSA.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r as i,_ as s}from"./index-C1VaWNuD.js";/* empty css */const a=i.lazy(()=>s(()=>import("./RepoDiffViewer-Bw5yMC4A.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])).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};
|