@openscout/scout 0.2.90 → 0.2.92
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 +12 -4
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/{ActivityScreen-BUeb4ERK.js → ActivityScreen-DkUP7V7M.js} +1 -1
- package/dist/client/assets/{AddProjectForm-DtTfn4Zk.js → AddProjectForm-CpyytDf2.js} +1 -1
- package/dist/client/assets/{AgentAvatar-CneOa70z.js → AgentAvatar-D8ZtMluU.js} +1 -1
- package/dist/client/assets/{AgentConfigurationScreen-CkZ7EjZh.js → AgentConfigurationScreen-BlGI6fuM.js} +1 -1
- package/dist/client/assets/{AgentDefinitionsWorkspace-0Y3kqMtv.js → AgentDefinitionsWorkspace-CfaDVCVt.js} +1 -1
- package/dist/client/assets/{AgentDetailCard-Dtc02KUO.js → AgentDetailCard-BTiOmh-a.js} +1 -1
- package/dist/client/assets/{AgentFloorView-B5raPB_U.js → AgentFloorView-DjNLILLt.js} +1 -1
- package/dist/client/assets/{AgentInfoScreen-DFG4ElZD.js → AgentInfoScreen-DG5dlHb_.js} +1 -1
- package/dist/client/assets/{AgentLaneCard-BRAkw8YJ.js → AgentLaneCard-lfRNb7JD.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-T8QE5742.js → AgentLaneChrome-Dlwrbq3g.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-C8RYotnv.js → AgentLaneDetailSheet-BzYzBfcW.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-FyYweLo_.js → AgentLaneSummaryResize-6SOEWUnr.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-Crxx1srt.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-Cil3dNwu.js → AgentLanesPreflight-C3uOiOzd.js} +1 -1
- package/dist/client/assets/{AgentLanesView-DPfO8MOo.js → AgentLanesView-ChNlmY-F.js} +1 -1
- package/dist/client/assets/{AgentLiveActions-DwScaVRF.js → AgentLiveActions-BJ5dIfL3.js} +1 -1
- package/dist/client/assets/{AgentSessions-DKoWA0Lm.js → AgentSessions-DpY0htZV.js} +1 -1
- package/dist/client/assets/{AgentsConsole-DoBIWGoq.js → AgentsConsole-CHyXrjhm.js} +1 -1
- package/dist/client/assets/{AgentsScreen-JuUiSuwY.js → AgentsScreen-BhCjX2lD.js} +1 -1
- package/dist/client/assets/AgentsSubnav-az_VDkri.js +1 -0
- package/dist/client/assets/{AtopView-ycxMrRwp.js → AtopView-BjjPM8OX.js} +1 -1
- package/dist/client/assets/{BackToPicker-D6WgIDb-.js → BackToPicker-D1LV6Cqp.js} +1 -1
- package/dist/client/assets/{BriefingDetailScreen-Zw-taW1s.js → BriefingDetailScreen-B7qJ90Np.js} +1 -1
- package/dist/client/assets/{BriefingsScreen-BerYOoWS.js → BriefingsScreen-CW6N829d.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-Cu93j-Ga.js → BrokerMetadataPanel-BhjECqOK.js} +1 -1
- package/dist/client/assets/{BrokerScreen-CeN90URH.js → BrokerScreen-X3z50712.js} +1 -1
- package/dist/client/assets/{ChatCollapsedStrip-DdKyMSEM.js → ChatCollapsedStrip-DNR9osDy.js} +1 -1
- package/dist/client/assets/{CodeDiffPane-BjCOBLze.js → CodeDiffPane-Bx_2VAzv.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-NSGdCaK0.js → CodeProjectPicker-C1yOJKvs.js} +1 -1
- package/dist/client/assets/{CodeScreen-CA9Sq6Dx.js → CodeScreen-CIKK1LcZ.js} +1 -1
- package/dist/client/assets/{ContextMenu-DnFcmfMR.js → ContextMenu-CHIuVKz7.js} +1 -1
- package/dist/client/assets/{ConversationComposer-CjRXFkvY.js → ConversationComposer-Bf7Ga_49.js} +1 -1
- package/dist/client/assets/{ConversationFeedRows-CgRTIpAv.js → ConversationFeedRows-Cm1Lgo43.js} +1 -1
- package/dist/client/assets/{ConversationHeader-CRmdtuL7.js → ConversationHeader-B_GXrKR0.js} +1 -1
- package/dist/client/assets/{ConversationPanels-DCkcLIHk.js → ConversationPanels-BTBbEvrP.js} +2 -2
- package/dist/client/assets/{ConversationScreen-Br0QQ3xo.js → ConversationScreen-B3l2m3JI.js} +1 -1
- package/dist/client/assets/{ConversationStatus-BJ1CMbAv.js → ConversationStatus-BqhUHD85.js} +1 -1
- package/dist/client/assets/{DataTable-Dzqiaha4.js → DataTable-CJbbgBdA.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-B0WMg_z3.js → DispatchAftermath-BDA9CrOd.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-CZVVIAD5.js → DocumentFocusViewer-B9vodVmG.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-C3a7hJWO.js → EmbeddableSurfacesLab-BdsYRDky.js} +1 -1
- package/dist/client/assets/{EmptyState-CYNJZMrZ.js → EmptyState-BRY5jTpz.js} +1 -1
- package/dist/client/assets/{FileViewerPane-Fwt8_KmD.js → FileViewerPane-9Bveqm9c.js} +1 -1
- package/dist/client/assets/{FleetSearch-Dsi_l2KW.js → FleetSearch-Bj9SCl2f.js} +1 -1
- package/dist/client/assets/{FlightObserveScreen-g_tiGmvz.js → FlightObserveScreen-BVMdsiCC.js} +1 -1
- package/dist/client/assets/{FollowScreen-Bb_rcrzi.js → FollowScreen-BifwHWOV.js} +1 -1
- package/dist/client/assets/{HarnessMark-DrE57dUq.js → HarnessMark-BPAphNjx.js} +1 -1
- package/dist/client/assets/{HarnessesScreen-CAsCJ_tG.js → HarnessesScreen-fMnbnrD4.js} +1 -1
- package/dist/client/assets/{HerdrSession-1eVu9Owj.js → HerdrSession-BujfGzrP.js} +1 -1
- package/dist/client/assets/{HomeHero-W445QrG1.js → HomeHero-BgM6S39l.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-CbPVg3fr.js → KnowledgeSearchInspector-B4ZY24xE.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchScreen-C1lN1xJk.js → KnowledgeSearchScreen-Ch_WENUC.js} +1 -1
- package/dist/client/assets/{LaneToolHoverCard-BkBcDYm-.js → LaneToolHoverCard-B7KdvQvf.js} +1 -1
- package/dist/client/assets/{LaneTraceDetailSheet-CzTd44rf.js → LaneTraceDetailSheet-H3AnN-vN.js} +1 -1
- package/dist/client/assets/{LaneTraceEventFocus-BmMmPTyJ.js → LaneTraceEventFocus-mkMw2wJU.js} +1 -1
- package/dist/client/assets/{MeshCanvas-DwkjsiJ5.js → MeshCanvas-CpKcWxKy.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-vmCpU1sD.js → MeshCanvasMinimap-C9IoGHbe.js} +1 -1
- package/dist/client/assets/{MeshScreen-CkMepUpT.js → MeshScreen-48QkJSDI.js} +1 -1
- package/dist/client/assets/{MeshTopologyView-BD2xLE2C.js → MeshTopologyView-DFzr0IZM.js} +2 -2
- package/dist/client/assets/{MessageComposerSuggestions-qbalTne_.js → MessageComposerSuggestions-FdVHnT_q.js} +1 -1
- package/dist/client/assets/{MessagesScreen-C8UynyLC.js → MessagesScreen-BMOOfbWX.js} +1 -1
- package/dist/client/assets/{MissionContextRail-D5MEP2f4.js → MissionContextRail-Y8QxUZGE.js} +1 -1
- package/dist/client/assets/{MissionControlView-K_I7eftL.js → MissionControlView-BpsHKu1F.js} +1 -1
- package/dist/client/assets/{MissionFocusOverlay-CWKLdUKG.js → MissionFocusOverlay-BPnAEA3F.js} +1 -1
- package/dist/client/assets/{MissionLeftAgentRow-ByGrNAcs.js → MissionLeftAgentRow-iOZ6ds9L.js} +1 -1
- package/dist/client/assets/{MissionLogPane-ZwHJ137T.js → MissionLogPane-B0csI89E.js} +1 -1
- package/dist/client/assets/{NewAgentModal-Do9aVvan.js → NewAgentModal-DBHJR9Qm.js} +1 -1
- package/dist/client/assets/{NewChatComposer-DKlNX1UA.js → NewChatComposer-Hd7pI5Ac.js} +1 -1
- package/dist/client/assets/{NewChatOrigin-DXPvX-hh.js → NewChatOrigin-DmuJ32wa.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-Dghsq2on.js → ObserveEmbedScreen-DyArn7Id.js} +1 -1
- package/dist/client/assets/{ObserveTextFlow-DWNlmTVm.js → ObserveTextFlow-CkMrtT8s.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-BlmGoxCE.js → ObservedTopologyPanel-CaSZZP05.js} +1 -1
- package/dist/client/assets/{OpenScoutAppShell-DDqQi-oe.js → OpenScoutAppShell-BtlKkiuF.js} +1 -1
- package/dist/client/assets/{OpsAgentsView-Bn_fGBdo.js → OpsAgentsView-CnqrwbC2.js} +1 -1
- package/dist/client/assets/OpsScreen-DOlmlVkP.js +1 -0
- package/dist/client/assets/OpsSubnav-Dj3ShAKv.js +1 -0
- package/dist/client/assets/{PlanView-B6gKo543.js → PlanView-BLGdWDx6.js} +1 -1
- package/dist/client/assets/ProjectAgentProfile-Dv1sVnQl.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-C5QWwZCn.js → ProjectAgentProfileBar-BLVg5EeA.js} +1 -1
- package/dist/client/assets/{ProjectAgentProfileHero-DC7Dd8VL.js → ProjectAgentProfileHero-0-GDhsPT.js} +1 -1
- package/dist/client/assets/{ProjectsInbox-DCLrDmj1.js → ProjectsInbox-B3DpAI5b.js} +1 -1
- package/dist/client/assets/{ProjectsRail-C4hiXYSb.js → ProjectsRail-BDl7U9Jq.js} +1 -1
- package/dist/client/assets/ProjectsScreen-Dl2FcGrR.js +1 -0
- package/dist/client/assets/{ProjectsThreadAside-DYmL2dCY.js → ProjectsThreadAside-BcGC5mHE.js} +1 -1
- package/dist/client/assets/{Provider-p-xuaAoE.js → Provider-cJCdHAxu.js} +1 -1
- package/dist/client/assets/{RailRow-bRkkXIpR.js → RailRow-CLcVmywd.js} +1 -1
- package/dist/client/assets/{RawSessionsTable-B7WKmXrk.js → RawSessionsTable-DBto4Ts-.js} +1 -1
- package/dist/client/assets/{RealtimeVoiceScreen-BzP3BQq9.js → RealtimeVoiceScreen-DXEU5v3g.js} +1 -1
- package/dist/client/assets/{RepoDiffEmbedScreen-xjzjcJ_c.js → RepoDiffEmbedScreen-BCDXFE3D.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-DRzIY-dk.js → RepoDiffPageScreen-m62FiWXC.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-CNDp01KM.js → RepoDiffViewer-PaNeZMhJ.js} +1 -1
- package/dist/client/assets/RepoDiffViewerLazy-CWE5GxMP.js +2 -0
- package/dist/client/assets/{ReposScreen-CpaLC_NU.js → ReposScreen-Cksv1cAD.js} +1 -1
- package/dist/client/assets/{ScoutDeckSurface-DkpZ-0DH.js → ScoutDeckSurface-BCjPl7C4.js} +1 -1
- package/dist/client/assets/{ScoutSurface-BENBUt5-.js → ScoutSurface-CkgT7A-c.js} +1 -1
- package/dist/client/assets/{ScoutbotBroadcastChip-CGZyxS5H.js → ScoutbotBroadcastChip-DkiRCHuK.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-Bk2ZsfPp.js → ScoutbotFxLab-D-kV5j4T.js} +1 -1
- package/dist/client/assets/{ScoutbotRealtimeVoiceCall-n63LdBZs.js → ScoutbotRealtimeVoiceCall-1ixiEn1L.js} +1 -1
- package/dist/client/assets/{SecondaryNav-B4IsujYh.js → SecondaryNav-_wyKjwNf.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-CPfH-jqN.js → SessionEmbedScreen-CJZmIBV7.js} +1 -1
- package/dist/client/assets/{SessionObserve-B-SkP3tu.js → SessionObserve-yYA8Gy5s.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-CF5jnH3-.js → SessionObserveEvidence-cHdjYOJe.js} +1 -1
- package/dist/client/assets/{SessionRefScreen-C-4jjmVG.js → SessionRefScreen-OkTY7Szg.js} +1 -1
- package/dist/client/assets/SessionsScreen-B-GFjxIA.js +1 -0
- package/dist/client/assets/{SettingsDrawer-DATxwZrn.js → SettingsDrawer-Co11RFX0.js} +1 -1
- package/dist/client/assets/{SettingsScreen-Bu53X7J_.js → SettingsScreen-Cn09nq5_.js} +1 -1
- package/dist/client/assets/{ShikiPane-DH8yYDks.js → ShikiPane-dBS9hD-z.js} +1 -1
- package/dist/client/assets/{SlidePanel-RFXJpfUa.js → SlidePanel-CH-3-8_2.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-CEYdCzem.js → SpriteAvatar-DS6Tmyua.js} +1 -1
- package/dist/client/assets/{StatusPill-9uy70ttd.js → StatusPill-C8m9ZymF.js} +1 -1
- package/dist/client/assets/{TailView-6bIrgdxN.js → TailView-B0BSopPs.js} +1 -1
- package/dist/client/assets/{Terminal-BI6km7H4.js → Terminal-U8gjIdm3.js} +1 -1
- package/dist/client/assets/{TerminalEmbedScreen-D4JOWwtm.js → TerminalEmbedScreen-CTmdE7us.js} +1 -1
- package/dist/client/assets/{TextDocumentSurface-BcP9vvji.js → TextDocumentSurface-BWJCGBZf.js} +1 -1
- package/dist/client/assets/{TmuxPeek-IaWqCgyJ.js → TmuxPeek-B4QdHbGm.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-C80iZxgy.js → VoicePermissionsPanel-Dd4ITJy_.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-CweZ6fEd.js → WorkDetailScreen-mJs0mb99.js} +1 -1
- package/dist/client/assets/{WorkFilesViewer-Dy_-06iI.js → WorkFilesViewer-ODzLXKxj.js} +1 -1
- package/dist/client/assets/{activity-DS0u0Itf.js → activity-CC8JzJNH.js} +1 -1
- package/dist/client/assets/{addon-fit-CN888B3D.js → addon-fit-CaZ-uLrg.js} +1 -1
- package/dist/client/assets/{addon-webgl-CoAnanQS.js → addon-webgl-B8utL3bM.js} +1 -1
- package/dist/client/assets/{agent-essentials-CuK4G_zS.js → agent-essentials-B3wcxg_v.js} +1 -1
- package/dist/client/assets/{arc.es-BET9ev6q.js → arc.es-uFv9UrHn.js} +1 -1
- package/dist/client/assets/{arrow-down-DxxPnPwh.js → arrow-down-w1HPzDSE.js} +1 -1
- package/dist/client/assets/{arrow-left-CXDkJuCg.js → arrow-left-B-3GJ7ct.js} +1 -1
- package/dist/client/assets/{arrow-up-right-Bj8RjSqW.js → arrow-up-right-G6bJXxhK.js} +1 -1
- package/dist/client/assets/{bot-BSGSicKC.js → bot-DzCOGKi6.js} +1 -1
- package/dist/client/assets/{check-BfA0T8UD.js → check-BX8nRgop.js} +1 -1
- package/dist/client/assets/{chevron-down-BVg09D6U.js → chevron-down-B3VVRJcV.js} +1 -1
- package/dist/client/assets/{chevron-right-CaEwYkxE.js → chevron-right-BYMV1511.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-HhKwnZCi.js → chunk-HRAB3GC3-dRd2eQMJ.js} +1 -1
- package/dist/client/assets/{chunk-JTPDIGGW-DX2eTIQ_.js → chunk-JTPDIGGW-BjX67kHU.js} +3 -3
- package/dist/client/assets/{chunk-T65CQEWV-D-bOfuCH.js → chunk-T65CQEWV-kP6nJjkU.js} +1 -1
- package/dist/client/assets/{chunk-YOZR3KYS-oS9dlQCI.js → chunk-YOZR3KYS-C13bZPVd.js} +1 -1
- package/dist/client/assets/{clock-C3TUL7D7.js → clock-B9ukVaVn.js} +1 -1
- package/dist/client/assets/{code-xml-Dbvjk9Kw.js → code-xml-BFc3TMSm.js} +1 -1
- package/dist/client/assets/{content-CiOMtgQc.js → content-B8gahuBy.js} +1 -1
- package/dist/client/assets/content-BIqX06OQ.js +1 -0
- package/dist/client/assets/content-BKDZ6Fxe.js +1 -0
- package/dist/client/assets/content-C15Ya-iu.js +1 -0
- package/dist/client/assets/content-CDE9tJDF.js +1 -0
- package/dist/client/assets/content-CSAfI-PX.js +1 -0
- package/dist/client/assets/content-CTF9D60D.js +1 -0
- package/dist/client/assets/{content-CJuH5cDP.js → content-CbAGkYQO.js} +1 -1
- package/dist/client/assets/content-CtqLJOVp.js +1 -0
- package/dist/client/assets/content-Dvs1KRfo.js +1 -0
- package/dist/client/assets/content-DyJdVZjI.js +1 -0
- package/dist/client/assets/{content-C2TZOKSE.js → content-Ji7ATaf7.js} +1 -1
- package/dist/client/assets/content-eqZXKWcP.js +1 -0
- package/dist/client/assets/content-iyyQKwvA.js +1 -0
- package/dist/client/assets/content-pDE7Fpb9.js +1 -0
- package/dist/client/assets/content-pPSd2dua.js +1 -0
- package/dist/client/assets/{conversation-icons-DmC_Ak3z.js → conversation-icons-gpsv650H.js} +1 -1
- package/dist/client/assets/conversation-motion-features-DXtKlmuM.js +1 -0
- package/dist/client/assets/{copy-C79v_7D-.js → copy-BFmOcWof.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DCq_3fQn.js → createLucideIcon-CFBn0Sdk.js} +1 -1
- package/dist/client/assets/{discover-IEnbrH8_.js → discover-DKf0aTr_.js} +2 -2
- package/dist/client/assets/embed-entry-RlQUTtc4.js +2 -0
- package/dist/client/assets/{external-link-Dd8xaveL.js → external-link-B1TI5yIt.js} +1 -1
- package/dist/client/assets/{eye-DkU59kfl.js → eye-1J4yOUoG.js} +1 -1
- package/dist/client/assets/{file-text-BITQqGtF.js → file-text-DcYSrI4v.js} +1 -1
- package/dist/client/assets/{gestures-B5rLNRpi.js → gestures-CcEOV6Sr.js} +1 -1
- package/dist/client/assets/{home-moving-signal-Bs635mVw.js → home-moving-signal-Bh2FugbH.js} +1 -1
- package/dist/client/assets/{home-now-card-VxlLjg1A.js → home-now-card-ByRH5fFx.js} +1 -1
- package/dist/client/assets/{home-now-card-nano-C06GMiwD.js → home-now-card-nano-y1EhBvVL.js} +1 -1
- package/dist/client/assets/{hooks-BWiLxTw1.js → hooks-DUZwL3Aq.js} +1 -1
- package/dist/client/assets/index-BBznYVWk.css +1 -0
- package/dist/client/assets/{index-BTj2MguM.js → index-BTuq-8Iv.js} +1 -1
- package/dist/client/assets/index-CmwGCxUk.js +1 -0
- package/dist/client/assets/{index-BZovGpDk.js → index-DmFAhGPj.js} +2 -2
- package/dist/client/assets/{index-vbaJ8sin.js → index-Dtaswdsh.js} +1 -1
- package/dist/client/assets/{inspector-panel-C96HcyK5.js → inspector-panel-DzgS5_Mv.js} +1 -1
- package/dist/client/assets/{keyboard-nav-CHo_xmjw.js → keyboard-nav-h1IdakpD.js} +1 -1
- package/dist/client/assets/{lane-roster-store-B6ybJlHJ.js → lane-roster-store-71vFgAem.js} +1 -1
- package/dist/client/assets/{left-DMJkmJOF.js → left-8NITBvFX.js} +1 -1
- package/dist/client/assets/{left-COMAiMfB.js → left-B2HEqrTM.js} +1 -1
- package/dist/client/assets/{left-C6Zj3cR4.js → left-CTYUvXbe.js} +1 -1
- package/dist/client/assets/{left-BuJ0wJW1.js → left-CwDRT50z.js} +1 -1
- package/dist/client/assets/{left-l92tw5Kc.js → left-CxlDLJlw.js} +1 -1
- package/dist/client/assets/{left-Ce4WKYPK.js → left-XFXxNd4g.js} +1 -1
- package/dist/client/assets/{left-agents-BuSyVNGE.js → left-agents-Ck4Xn-R8.js} +1 -1
- package/dist/client/assets/{left-default-DRHywOKX.js → left-default-BeOyS0bR.js} +1 -1
- package/dist/client/assets/{left-lanes-4-aUyyrV.js → left-lanes-DZp3jJMo.js} +1 -1
- package/dist/client/assets/{left-mission-e849d_Td.js → left-mission-CuKFQ5xL.js} +1 -1
- package/dist/client/assets/left-p1hkO6P0.js +1 -0
- package/dist/client/assets/{left-plan-MchYwAB_.js → left-plan-3rrFENhp.js} +1 -1
- package/dist/client/assets/{library-DygjpA6u.js → library-E--gKzEZ.js} +1 -1
- package/dist/client/assets/{loader-circle-B-l2Wj3-.js → loader-circle-d6PKL_KD.js} +1 -1
- package/dist/client/assets/{local-agents-Wof5knTJ.js → local-agents-B5pq17tZ.js} +1 -1
- package/dist/client/assets/{mentions-BjXfeF7t.js → mentions-agCGDgyA.js} +1 -1
- package/dist/client/assets/{mesh-ops-C1gq8zKf.js → mesh-ops-5pZCYptW.js} +1 -1
- package/dist/client/assets/{mesh-view-store-B56D3f77.js → mesh-view-store-KJzABIkN.js} +1 -1
- package/dist/client/assets/{message-circle-BwVx5X0q.js → message-circle-CJO-pi7b.js} +1 -1
- package/dist/client/assets/{message-markup-DlVX-iuc.js → message-markup-CyRDLdOn.js} +1 -1
- package/dist/client/assets/{message-square-BnkG6tae.js → message-square-D1hMsMj_.js} +1 -1
- package/dist/client/assets/{mission-control-store-CMgIVjLJ.js → mission-control-store-Ce6dOvnZ.js} +1 -1
- package/dist/client/assets/{observe-DVHAcIrv.js → observe-BSWVM8YA.js} +1 -1
- package/dist/client/assets/{page-status-Bg2hd27j.js → page-status-D2FQLJOX.js} +1 -1
- package/dist/client/assets/{paperclip-DblaLD_N.js → paperclip-iZmDMOS5.js} +1 -1
- package/dist/client/assets/{plus-BAI0t5g9.js → plus-gZ0T0eBI.js} +1 -1
- package/dist/client/assets/{profile-3Q4sUtvJ.js → profile-Dxj3VVOM.js} +1 -1
- package/dist/client/assets/{projects-inbox-Da2hYEn6.js → projects-inbox-Dzt_GQDv.js} +1 -1
- package/dist/client/assets/{radio-BGtkyCG9.js → radio-RMLfV4EO.js} +1 -1
- package/dist/client/assets/{refresh-cw-DtF8xPqX.js → refresh-cw-C4x1x6b_.js} +1 -1
- package/dist/client/assets/resolve-panes-C9gF0w4e.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-DxbY5RCH.js +1 -0
- package/dist/client/assets/{right-Dd2DscRz.js → right-5L7Tn0zG.js} +1 -1
- package/dist/client/assets/{right-BU_W1kSH.js → right-CYtkMmRu.js} +1 -1
- package/dist/client/assets/{right-CUP-NIDG.js → right-CreoQzPP.js} +1 -1
- package/dist/client/assets/{right-c4PAdFYZ.js → right-D-k9Z1Fe.js} +1 -1
- package/dist/client/assets/{right-ByptvkVX.js → right-D9xFfy2b.js} +1 -1
- package/dist/client/assets/{right-BlR7h0US.js → right-DI7zHADe.js} +1 -1
- package/dist/client/assets/{right-BwgwTGGd.js → right-DUbJ3WVc.js} +1 -1
- package/dist/client/assets/{right-DmVHd8Xj.js → right-DiybhsiK.js} +1 -1
- package/dist/client/assets/{right-Ch_jrNe2.js → right-Jh_1Q88s.js} +1 -1
- package/dist/client/assets/{right-B8qg3JdB.js → right-udr1qTJG.js} +1 -1
- package/dist/client/assets/{rocket-BWh18pt_.js → rocket-CMM-IdLy.js} +1 -1
- package/dist/client/assets/{router-63XV_E7f.js → router-Cn_s9IGH.js} +1 -1
- package/dist/client/assets/{runtime-picker-BXKJbLot.js → runtime-picker--IW3cRry.js} +1 -1
- package/dist/client/assets/{scope-views-Dm2_-NPi.js → scope-views-BIfMTXU4.js} +1 -1
- package/dist/client/assets/{scout-voice-D8Q5sZOL.js → scout-voice-CwbOz6EN.js} +1 -1
- package/dist/client/assets/{scroll-text-DZb3mmYo.js → scroll-text-DPPYrqB9.js} +1 -1
- package/dist/client/assets/{search-1QMVOxF3.js → search-DAyagUtF.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-c0cz3MkJ.js → secondaryNavConfig-Dw3gS1jR.js} +1 -1
- package/dist/client/assets/{selection-bridge-O9C4kGfF.js → selection-bridge-BXw09aRF.js} +1 -1
- package/dist/client/assets/{send-horizontal-DbyEkGql.js → send-horizontal-IcG46D2M.js} +1 -1
- package/dist/client/assets/{server-Bncn9S7r.js → server-BySujhDV.js} +1 -1
- package/dist/client/assets/{session-catalog-DC6BlBBC.js → session-catalog-ClS9xf6i.js} +1 -1
- package/dist/client/assets/{session-table-BUPq9Viy.js → session-table-BdpHs1GN.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-CMe8Bay1.js → sliders-horizontal-R5pWUUcH.js} +1 -1
- package/dist/client/assets/{sparkles-_7cTZsIH.js → sparkles-DJOBD_8l.js} +1 -1
- package/dist/client/assets/{sse-Bb0EOcU9.js → sse-CxXt4tqI.js} +1 -1
- package/dist/client/assets/{tail-events-C12pfUax.js → tail-events-BdvqZHLr.js} +1 -1
- package/dist/client/assets/{terminal-xGf_F3y7.js → terminal-DJPUp_Qn.js} +1 -1
- package/dist/client/assets/{terminal-relay-BgfVJXIL.js → terminal-relay-TffuSPGs.js} +1 -1
- package/dist/client/assets/{terminal-takeover--05EYhJm.js → terminal-takeover-BOFPRPjR.js} +1 -1
- package/dist/client/assets/{use-conversation-list-DWX02INv.js → use-conversation-list-C-dPcjQe.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-Cnwa4hTK.js → use-fleet-active-asks-BHzeBZSW.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-BRFm37oY.js → use-mesh-ops-items-KmaauBr_.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-C8cWvIZ3.js → use-reduced-motion-CYqhYqHO.js} +1 -1
- package/dist/client/assets/{use-scout-dev-flags-FkMreOOb.js → use-scout-dev-flags-BJbw87PK.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-DvPZSJK3.js → useAgentHoverCard-C6o0tlat.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-DjHBrgnS.js +1 -0
- package/dist/client/assets/{usePierreRuntime-C8WJ0X3F.js → usePierreRuntime-Cm7-qdm0.js} +1 -1
- package/dist/client/assets/{wrench-_tHBGTop.js → wrench-CvRjjByE.js} +1 -1
- package/dist/client/assets/{x-CrGUKNRv.js → x-C8ayPBtj.js} +1 -1
- package/dist/client/assets/{xterm-Ks-VlLTq.js → xterm-B0ci4Q9a.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/main.mjs +348 -254
- package/dist/scout-web-server.mjs +2 -96660
- package/package.json +3 -3
- package/dist/client/assets/AgentLanesEmbedScreen-Br7cmZVO.js +0 -1
- package/dist/client/assets/AgentsSubnav-BV0WAgzf.js +0 -1
- package/dist/client/assets/OpsScreen-DHnT-Q9R.js +0 -1
- package/dist/client/assets/OpsSubnav-CJRD7MjM.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-Be1VOkI4.js +0 -1
- package/dist/client/assets/ProjectsScreen-jruZRjgD.js +0 -1
- package/dist/client/assets/RepoDiffViewerLazy-b6vjYxez.js +0 -2
- package/dist/client/assets/SessionsScreen-HAjFvmIq.js +0 -1
- package/dist/client/assets/content-BQuEedeL.js +0 -1
- package/dist/client/assets/content-BUae-L_N.js +0 -1
- package/dist/client/assets/content-BfG98J1k.js +0 -1
- package/dist/client/assets/content-BkVTfkAC.js +0 -1
- package/dist/client/assets/content-BsNMos_d.js +0 -1
- package/dist/client/assets/content-CCn98eSk.js +0 -1
- package/dist/client/assets/content-CYnPp9yo.js +0 -1
- package/dist/client/assets/content-CcrUhm4P.js +0 -1
- package/dist/client/assets/content-CxuVONeQ.js +0 -1
- package/dist/client/assets/content-Dmq9n1_L.js +0 -1
- package/dist/client/assets/content-DskHP2NI.js +0 -1
- package/dist/client/assets/content-DvvzL2HK.js +0 -1
- package/dist/client/assets/content-snCAUbwv.js +0 -1
- package/dist/client/assets/conversation-motion-features-DPiGTO21.js +0 -1
- package/dist/client/assets/embed-entry-XUPb-AzL.js +0 -2
- package/dist/client/assets/index-9as_JTUs.css +0 -1
- package/dist/client/assets/index-DiiEQwdc.js +0 -1
- package/dist/client/assets/left-DrCbY6ja.js +0 -1
- package/dist/client/assets/resolve-panes-D4tlKNCT.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-B27lj3Ci.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-CNlrhvvx.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,j as r}from"./index-BZovGpDk.js";import{a as G}from"./api-h5zurxmi.js";import{c as je}from"./clipboard-e3fSpeo7.js";import{f as ze}from"./scoutbot-BTIErYHo.js";import{g as Ae,f as Ce}from"./api-BkjHJfgJ.js";import{d as Ke}from"./types-B0PlfpKc.js";import{r as Oe,C as He}from"./CodeDiffPane-BjCOBLze.js";import{r as qe,a as Ge,w as Ve,b as Xe,f as xe,C as Je,s as Qe}from"./CodeProjectPicker-NSGdCaK0.js";import{ShikiPane as Ye}from"./ShikiPane-DH8yYDks.js";/* empty css */import{A as Ze}from"./arrow-left-CXDkJuCg.js";import{C as et}from"./chevron-right-CaEwYkxE.js";import{C as tt}from"./check-BfA0T8UD.js";import{C as nt}from"./copy-C79v_7D-.js";import"./cache-Dr0why2k.js";import"./usePierreRuntime-C8WJ0X3F.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";/* empty css */import"./chevron-down-BVg09D6U.js";import"./createLucideIcon-DCq_3fQn.js";import"./search-1QMVOxF3.js";const st=new Set(["node_modules",".git","dist",".next",".build","DerivedData","__pycache__",".venv","target"]);function we(i){const l=i.lastIndexOf("/");return l>0?i.slice(0,l):"/"}function ce(i){const l=i.lastIndexOf("/");return l>=0?i.slice(l+1):i}function V(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function S(i){return i.toLowerCase().replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function rt(i,l,k){const g=S(l),f=i.projects.find(u=>S(u.name)===g||S(ce(u.root))===g);if(!f)return null;const x=k?f.worktrees.find(u=>u.name===k||u.branch.name===k||S(u.name)===S(k)):f.worktrees[0];return{projectName:f.name,root:x?.path??f.root}}function ye(i,l){if(!l.startsWith(`${i}/`))return[];const k=l.slice(i.length+1).split("/"),g=[];let f=i;for(const x of k.slice(0,-1))f=`${f}/${x}`,g.push(f);return g}function it(i){switch(i){case"untracked":return"U";case"conflicted":return"C";case"staged":return"S";case"unstaged":return"M";case"staged+unstaged":return"SM";default:return i.charAt(0).toUpperCase()}}function be(i,l,k,g,f){const x=k.get(i);if(!x){f.push({path:`${i}#loading`,name:"Loading…",kind:"file",depth:l,loading:!0});return}for(const u of x)u.kind==="directory"&&st.has(u.name)||(f.push({path:u.path,name:u.name,kind:u.kind,depth:l}),u.kind==="directory"&&g.has(u.path)&&be(u.path,l+1,k,g,f))}function Nt({route:i,navigate:l,root:k,file:g,project:f,path:x,wt:u,line:Le,endLine:Ne,returnConversationId:Re,embedded:X=!1}){const I=k??i?.root??null,B=g??i?.file??null,p=f??i?.project??null,b=x??i?.path??null,P=u??i?.wt??null,j=Le??i?.line,w=Ne??i?.endLine,C=Re??i?.returnConversationId??null,[h,le]=s.useState(()=>Ae()),[o,J]=s.useState(()=>I??(p?null:qe())),[y,Q]=s.useState(()=>new Map),[L,U]=s.useState(()=>new Set),[de,ue]=s.useState(null),[a,W]=s.useState(B),[c,_]=s.useState(null),[Ee,Y]=s.useState(!1),[fe,z]=s.useState(null),[pe,Z]=s.useState("idle"),[M,ee]=s.useState("source"),[m,te]=s.useState(()=>j&&j>0?{line:j,...w&&w>=j?{endLine:w}:{}}:null),[N,A]=s.useState(()=>p?{phase:"resolving"}:{phase:"idle"}),ne=p?`${p}\0${b??""}\0${P??""}`:null,R=s.useRef(null),se=s.useRef(null),T=s.useRef(ne);T.current!==ne&&(T.current=ne,R.current=null,se.current=null),s.useEffect(()=>{te(j&&j>0?{line:j,...w&&w>=j?{endLine:w}:{}}:null)},[w,j]),s.useEffect(()=>{if(h)return;let e=!1;return Ce("quick",!1,2e4).then(t=>{e||le(t)}).catch(()=>{}),()=>{e=!0}},[h]);const E=s.useCallback(async e=>{try{const t=await G(`/api/file/preview?path=${encodeURIComponent(e)}`);if(t.kind!=="directory")return;const n=t.entries.map(d=>({name:d.name,path:d.path,kind:d.kind}));Q(d=>new Map(d).set(e,n))}catch(t){ue(t instanceof Error?t.message:String(t))}},[]),$=s.useCallback((e,t)=>{if(!t)return;const n=ye(e,t);if(n.length!==0){U(d=>new Set([...d,...n]));for(const d of n)E(d)}},[E]);s.useEffect(()=>{if(!p)return;const e=`${p}\0${b??""}\0${P??""}`;if(R.current===e)return;const t=n=>{R.current=e;const d=b?`${n}/${b}`:null;A({phase:"idle"}),J(n),W(d),$(n,d)};if(h){const n=rt(h,p,P);if(n){t(n.root);return}}se.current!==e&&(A({phase:"resolving"}),G(`/api/code/resolve-project?slug=${encodeURIComponent(p)}`).then(n=>{R.current===e||T.current!==e||t(n.root)}).catch(n=>{if(R.current===e||T.current!==e)return;se.current=e;const d=n instanceof Error?n.message:String(n);A({phase:"failed",message:d.includes(p)?d:`Can't resolve project "${p}": ${d}`})}))},[p,b,P,h,$]),s.useEffect(()=>{if(o||p||!h)return;const e=h.projects[0];e&&J(e.worktrees[0]?.path??e.root)},[o,p,h]);const he=s.useRef(a);he.current=a,s.useEffect(()=>{if(!o)return;ue(null);const e=Ge(o),t=he.current,n=t?ye(o,t):[];e?(Q(new Map(Object.entries(e.entries))),U(new Set([...e.expanded,...n])),!t&&e.selectedFile&&W(e.selectedFile)):(Q(new Map),U(new Set(n)));const d=new Set([o,...e?.expanded??[],...n]);for(const ae of d)E(ae);Ce("quick",!1,2e4).then(le).catch(()=>{})},[o,E]),s.useEffect(()=>{!o||y.size===0||(Ve(o,{entries:y,expanded:L,selectedFile:a}),Xe(o))},[o,y,L,a]),s.useEffect(()=>{!I||!B||$(I,B)},[I,B,$]);const re=s.useRef(new Map),ie=s.useRef(new Set),$e=3e4,K=s.useCallback(e=>{const t=re.current.get(e);return t?Date.now()-t.at>$e?(re.current.delete(e),null):t.preview:null},[]),O=s.useCallback((e,t)=>{const n=re.current;if(n.set(e,{at:Date.now(),preview:t}),n.size>80){const d=n.keys().next().value;d&&n.delete(d)}},[]),Fe=s.useCallback(e=>{K(e)||ie.current.has(e)||(ie.current.add(e),G(`/api/file/preview?path=${encodeURIComponent(e)}`).then(t=>O(e,t)).catch(()=>{}).finally(()=>ie.current.delete(e)))},[K,O]);s.useEffect(()=>{if(Z("idle"),!a){_(null),z(null);return}const e=K(a);if(e){_(e.kind==="file"?e:null),z(null),Y(!1);return}let t=!1;return Y(!0),z(null),G(`/api/file/preview?path=${encodeURIComponent(a)}`).then(n=>{t||(O(a,n),_(n.kind==="file"?n:null))}).catch(n=>{t||(_(null),z(n instanceof Error?n.message:String(n)))}).finally(()=>{t||Y(!1)}),()=>{t=!0}},[a,K,O]);const Me=s.useMemo(()=>{if(!o)return[];const e=[];return be(o,0,y,L,e),e},[o,y,L]),me=s.useCallback((e,t)=>{const n=C?{returnConversationId:C}:{};if(h){for(const d of h.projects)for(const[ae,ge]of d.worktrees.entries())if(ge.path===e){const ve=t&&t.startsWith(`${e}/`)?t.slice(e.length+1):void 0;return{view:"code",project:S(d.name),...ve?{path:ve}:{},...ae>0?{wt:ge.name}:{},...n}}}return{view:"code",root:e,...t?{file:t}:{},...n}},[C,h]),oe=s.useCallback(()=>{if(!C)return;const e={view:"conversation",conversationId:C};ze({type:"navigate",route:e})||l?.(e)},[l,C]);s.useEffect(()=>{if(!C)return;const e=t=>{if(!t.defaultPrevented&&!(!t.metaKey||t.key!=="[")){if(t.target instanceof HTMLElement){const n=t.target.tagName;if(n==="INPUT"||n==="TEXTAREA"||t.target.isContentEditable)return}t.preventDefault(),oe()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[C,oe]);const H=s.useCallback((e,t)=>{X||!l||l(me(e,t))},[X,l,me]),Te=s.useCallback(e=>{U(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),y.has(e)||E(e)},[y,E]),De=s.useCallback(e=>{te(null),W(e),o&&H(o,e)},[o,H]),v=s.useMemo(()=>{if(!h||!o)return null;for(const e of h.projects)for(const t of e.worktrees)if(t.path===o)return{project:e,worktree:t};return null},[h,o]),F=s.useMemo(()=>{const e=new Map;if(!o||!v)return e;for(const t of v.worktree.status.files)e.set(`${o}/${t.path}`,t.status);return e},[o,v]),Ie=s.useMemo(()=>{const e=new Set;if(!o)return e;for(const t of F.keys()){let n=we(t);for(;n.startsWith(o)&&(e.add(n),n!==o);)n=we(n)}return e},[o,F]),q=!!(o&&a&&Oe(o,a));s.useEffect(()=>{q||ee("source")},[q]);const Be=a&&o&&a.startsWith(`${o}/`)?a.slice(o.length+1):c?.kind==="file"?c.title:a?ce(a):null,Pe=s.useCallback(async()=>{if(!c||c.kind!=="file"||!c.previewable)return;await je(c.content)&&(Z("copied"),window.setTimeout(()=>Z("idle"),1500))},[c]),[Ue,ke]=s.useState("idle"),D=s.useMemo(()=>{if(!o)return null;if(v){const e=a&&a.startsWith(`${o}/`)?a.slice(o.length+1):void 0,t=v.project.worktrees[0]?.path;return xe({project:S(v.project.name),...e?{path:e}:{},...t&&t!==o?{wt:v.worktree.name}:{},...m?.line?{line:m.line}:{},...m?.endLine?{endLine:m.endLine}:{}})}return xe({...a?{file:a}:{root:o},...m?.line?{line:m.line}:{},...m?.endLine?{endLine:m.endLine}:{}})},[o,a,v,m]),We=s.useCallback(async()=>{if(!D)return;await je(D)&&(ke("copied"),window.setTimeout(()=>ke("idle"),1500))},[D]),_e=s.useCallback(e=>{R.current=T.current,A({phase:"idle"}),te(e.line&&e.line>0?{line:e.line,...e.endLine&&e.endLine>=e.line?{endLine:e.endLine}:{}}:null),W(e.file??null),J(e.root),e.file&&$(e.root,e.file),H(e.root,e.file??null)},[$,H]);return r.jsxs("div",{className:"s-code-screen","data-embedded":X||void 0,children:[r.jsxs("div",{className:"s-code-head",children:[C?r.jsxs("button",{type:"button",className:"s-code-returnThread",onClick:oe,title:"Back to thread (⌘[)",children:[r.jsx(Ze,{size:13,strokeWidth:1.9,"aria-hidden":!0}),r.jsx("span",{children:"Back to thread"})]}):null,r.jsx(Je,{snapshot:h,root:o,onSelect:_e}),v?.worktree.diff.branchShortstat?r.jsx("span",{className:"s-code-headStat",children:v.worktree.diff.branchShortstat}):null,o?r.jsx("span",{className:"s-code-headPath",title:o,children:Qe(o)}):null,D?r.jsx("button",{type:"button",className:"s-code-copyLink",title:D,onClick:()=>{We()},children:Ue==="copied"?"Copied scout://":"Copy scout://"}):null]}),r.jsxs("div",{className:"s-code-body",children:[r.jsx("div",{className:"s-code-tree",role:"tree","aria-label":"Files",children:de?r.jsx("div",{className:"s-code-treeNote",children:de}):o?Me.map(e=>e.loading?r.jsx("div",{className:"s-code-node s-code-node--loading",style:{paddingLeft:10+e.depth*14},children:e.name},e.path):r.jsxs("button",{type:"button",role:"treeitem",className:"s-code-node","data-selected":e.path===a||void 0,"data-diff":e.kind==="file"?F.get(e.path):void 0,"aria-expanded":e.kind==="directory"?L.has(e.path):void 0,style:{paddingLeft:10+e.depth*14},onClick:()=>e.kind==="directory"?Te(e.path):De(e.path),onMouseEnter:e.kind==="file"?()=>Fe(e.path):void 0,children:[e.kind==="directory"?r.jsx(et,{size:11,strokeWidth:2,className:"s-code-nodeChevron","data-open":L.has(e.path)||void 0,"aria-hidden":!0}):r.jsx("span",{className:"s-code-nodeSpacer","aria-hidden":!0}),r.jsx("span",{className:"s-code-nodeName",children:e.name}),e.kind==="file"&&F.has(e.path)?r.jsx("span",{className:"s-code-nodeBadge","data-diff":F.get(e.path),children:it(F.get(e.path)??"")}):null,e.kind==="directory"&&Ie.has(e.path)?r.jsx("span",{className:"s-code-nodeDot","aria-label":"Contains changes"}):null]},e.path)):N.phase==="resolving"?r.jsxs("div",{className:"s-code-treeNote",children:["Resolving “",p,"”…"]}):N.phase==="failed"?r.jsx("div",{className:"s-code-treeNote",children:N.message}):r.jsx("div",{className:"s-code-treeNote",children:"No repo selected."})}),r.jsxs("div",{className:"s-code-main",children:[a?r.jsxs("div",{className:"s-code-fileHead",children:[r.jsx("span",{className:"s-code-filePath",children:Be}),q?r.jsxs("div",{className:"s-code-fileMode",role:"tablist","aria-label":"File view",children:[r.jsx("button",{type:"button",role:"tab","aria-selected":M==="source","data-selected":M==="source"||void 0,onClick:()=>ee("source"),children:"Source"}),r.jsx("button",{type:"button",role:"tab","aria-selected":M==="changes","data-selected":M==="changes"||void 0,onClick:()=>ee("changes"),children:"Changes"})]}):null,c?.kind==="file"?r.jsxs("span",{className:"s-code-fileMeta",children:[V(c.sizeBytes),c.previewable&&c.truncated?" · truncated":"",m?` · L${m.line}${m.endLine?`–${m.endLine}`:""}`:""]}):null,c?.kind==="file"&&c.previewable?r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"s-code-fileAction",onClick:()=>{Pe()},title:"Copy file contents",children:[pe==="copied"?r.jsx(tt,{size:12,"aria-hidden":!0}):r.jsx(nt,{size:12,"aria-hidden":!0}),pe==="copied"?"Copied":"Copy"]}),r.jsx("a",{className:"s-code-fileAction",href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"Raw"})]}):null]}):null,M==="changes"&&q&&o&&a?r.jsx(He,{root:o,file:a},`${o}\0${a}`):Ee?r.jsxs("div",{className:"s-code-empty",children:["Loading ",a?ce(a):"file","…"]}):fe?r.jsx("div",{className:"s-code-empty",children:fe}):c&&c.kind==="file"&&c.previewable?r.jsxs(r.Fragment,{children:[c.truncated?r.jsxs("div",{className:"s-code-fileNote",children:["Showing the first ",V(256*1024)," of ",V(c.sizeBytes)," ·"," ",r.jsx("a",{href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"open raw"})]}):null,r.jsx(Ye,{code:c.content,path:c.path,focusLine:m?.line,endLine:m?.endLine})]}):c&&c.kind==="file"?r.jsxs("div",{className:"s-code-empty",children:[c.previewReason," · ",V(c.sizeBytes)," ·"," ",r.jsx("a",{href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"open raw"})]}):N.phase==="resolving"?r.jsxs("div",{className:"s-code-empty",children:["Opening ",b??`“${p}”`,"…"]}):N.phase==="failed"?r.jsx("div",{className:"s-code-empty",children:N.message}):r.jsx("div",{className:"s-code-empty",children:"Pick a file to read."})]})]})]})}const Rt=Ke({id:"code",label:"Code Browser",route:{view:"code"},webPath:"/code",screen:"CodeContent",embed:{path:"/embed/code",profile:"macos.code",rootClassName:"s-code-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:i=>({root:i.get("root")?.trim()||void 0,file:i.get("file")?.trim()||void 0,project:i.get("project")?.trim()||void 0,path:i.get("path")?.trim()||void 0,wt:i.get("wt")?.trim()||void 0,line:Se(i.get("line")),endLine:Se(i.get("endLine")),returnConversationId:i.get("fromConversation")?.trim()||void 0})}});function Se(i){if(!i)return;const l=Number.parseInt(i,10);return Number.isSafeInteger(l)&&l>0?l:void 0}export{Nt as CodeContent,Rt as scoutSurface};
|
|
1
|
+
import{r as s,j as r}from"./index-DmFAhGPj.js";import{a as G}from"./api-h5zurxmi.js";import{c as je}from"./clipboard-e3fSpeo7.js";import{f as ze}from"./scoutbot-BTIErYHo.js";import{g as Ae,f as Ce}from"./api-BkjHJfgJ.js";import{d as Ke}from"./types-B0PlfpKc.js";import{r as Oe,C as He}from"./CodeDiffPane-Bx_2VAzv.js";import{r as qe,a as Ge,w as Ve,b as Xe,f as xe,C as Je,s as Qe}from"./CodeProjectPicker-C1yOJKvs.js";import{ShikiPane as Ye}from"./ShikiPane-dBS9hD-z.js";/* empty css */import{A as Ze}from"./arrow-left-B-3GJ7ct.js";import{C as et}from"./chevron-right-BYMV1511.js";import{C as tt}from"./check-BX8nRgop.js";import{C as nt}from"./copy-BFmOcWof.js";import"./cache-Dr0why2k.js";import"./usePierreRuntime-Cm7-qdm0.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";/* empty css */import"./chevron-down-B3VVRJcV.js";import"./createLucideIcon-CFBn0Sdk.js";import"./search-DAyagUtF.js";const st=new Set(["node_modules",".git","dist",".next",".build","DerivedData","__pycache__",".venv","target"]);function we(i){const l=i.lastIndexOf("/");return l>0?i.slice(0,l):"/"}function ce(i){const l=i.lastIndexOf("/");return l>=0?i.slice(l+1):i}function V(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function S(i){return i.toLowerCase().replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function rt(i,l,k){const g=S(l),f=i.projects.find(u=>S(u.name)===g||S(ce(u.root))===g);if(!f)return null;const x=k?f.worktrees.find(u=>u.name===k||u.branch.name===k||S(u.name)===S(k)):f.worktrees[0];return{projectName:f.name,root:x?.path??f.root}}function ye(i,l){if(!l.startsWith(`${i}/`))return[];const k=l.slice(i.length+1).split("/"),g=[];let f=i;for(const x of k.slice(0,-1))f=`${f}/${x}`,g.push(f);return g}function it(i){switch(i){case"untracked":return"U";case"conflicted":return"C";case"staged":return"S";case"unstaged":return"M";case"staged+unstaged":return"SM";default:return i.charAt(0).toUpperCase()}}function be(i,l,k,g,f){const x=k.get(i);if(!x){f.push({path:`${i}#loading`,name:"Loading…",kind:"file",depth:l,loading:!0});return}for(const u of x)u.kind==="directory"&&st.has(u.name)||(f.push({path:u.path,name:u.name,kind:u.kind,depth:l}),u.kind==="directory"&&g.has(u.path)&&be(u.path,l+1,k,g,f))}function Nt({route:i,navigate:l,root:k,file:g,project:f,path:x,wt:u,line:Le,endLine:Ne,returnConversationId:Re,embedded:X=!1}){const I=k??i?.root??null,B=g??i?.file??null,p=f??i?.project??null,b=x??i?.path??null,P=u??i?.wt??null,j=Le??i?.line,w=Ne??i?.endLine,C=Re??i?.returnConversationId??null,[h,le]=s.useState(()=>Ae()),[o,J]=s.useState(()=>I??(p?null:qe())),[y,Q]=s.useState(()=>new Map),[L,U]=s.useState(()=>new Set),[de,ue]=s.useState(null),[a,W]=s.useState(B),[c,_]=s.useState(null),[Ee,Y]=s.useState(!1),[fe,z]=s.useState(null),[pe,Z]=s.useState("idle"),[M,ee]=s.useState("source"),[m,te]=s.useState(()=>j&&j>0?{line:j,...w&&w>=j?{endLine:w}:{}}:null),[N,A]=s.useState(()=>p?{phase:"resolving"}:{phase:"idle"}),ne=p?`${p}\0${b??""}\0${P??""}`:null,R=s.useRef(null),se=s.useRef(null),T=s.useRef(ne);T.current!==ne&&(T.current=ne,R.current=null,se.current=null),s.useEffect(()=>{te(j&&j>0?{line:j,...w&&w>=j?{endLine:w}:{}}:null)},[w,j]),s.useEffect(()=>{if(h)return;let e=!1;return Ce("quick",!1,2e4).then(t=>{e||le(t)}).catch(()=>{}),()=>{e=!0}},[h]);const E=s.useCallback(async e=>{try{const t=await G(`/api/file/preview?path=${encodeURIComponent(e)}`);if(t.kind!=="directory")return;const n=t.entries.map(d=>({name:d.name,path:d.path,kind:d.kind}));Q(d=>new Map(d).set(e,n))}catch(t){ue(t instanceof Error?t.message:String(t))}},[]),$=s.useCallback((e,t)=>{if(!t)return;const n=ye(e,t);if(n.length!==0){U(d=>new Set([...d,...n]));for(const d of n)E(d)}},[E]);s.useEffect(()=>{if(!p)return;const e=`${p}\0${b??""}\0${P??""}`;if(R.current===e)return;const t=n=>{R.current=e;const d=b?`${n}/${b}`:null;A({phase:"idle"}),J(n),W(d),$(n,d)};if(h){const n=rt(h,p,P);if(n){t(n.root);return}}se.current!==e&&(A({phase:"resolving"}),G(`/api/code/resolve-project?slug=${encodeURIComponent(p)}`).then(n=>{R.current===e||T.current!==e||t(n.root)}).catch(n=>{if(R.current===e||T.current!==e)return;se.current=e;const d=n instanceof Error?n.message:String(n);A({phase:"failed",message:d.includes(p)?d:`Can't resolve project "${p}": ${d}`})}))},[p,b,P,h,$]),s.useEffect(()=>{if(o||p||!h)return;const e=h.projects[0];e&&J(e.worktrees[0]?.path??e.root)},[o,p,h]);const he=s.useRef(a);he.current=a,s.useEffect(()=>{if(!o)return;ue(null);const e=Ge(o),t=he.current,n=t?ye(o,t):[];e?(Q(new Map(Object.entries(e.entries))),U(new Set([...e.expanded,...n])),!t&&e.selectedFile&&W(e.selectedFile)):(Q(new Map),U(new Set(n)));const d=new Set([o,...e?.expanded??[],...n]);for(const ae of d)E(ae);Ce("quick",!1,2e4).then(le).catch(()=>{})},[o,E]),s.useEffect(()=>{!o||y.size===0||(Ve(o,{entries:y,expanded:L,selectedFile:a}),Xe(o))},[o,y,L,a]),s.useEffect(()=>{!I||!B||$(I,B)},[I,B,$]);const re=s.useRef(new Map),ie=s.useRef(new Set),$e=3e4,K=s.useCallback(e=>{const t=re.current.get(e);return t?Date.now()-t.at>$e?(re.current.delete(e),null):t.preview:null},[]),O=s.useCallback((e,t)=>{const n=re.current;if(n.set(e,{at:Date.now(),preview:t}),n.size>80){const d=n.keys().next().value;d&&n.delete(d)}},[]),Fe=s.useCallback(e=>{K(e)||ie.current.has(e)||(ie.current.add(e),G(`/api/file/preview?path=${encodeURIComponent(e)}`).then(t=>O(e,t)).catch(()=>{}).finally(()=>ie.current.delete(e)))},[K,O]);s.useEffect(()=>{if(Z("idle"),!a){_(null),z(null);return}const e=K(a);if(e){_(e.kind==="file"?e:null),z(null),Y(!1);return}let t=!1;return Y(!0),z(null),G(`/api/file/preview?path=${encodeURIComponent(a)}`).then(n=>{t||(O(a,n),_(n.kind==="file"?n:null))}).catch(n=>{t||(_(null),z(n instanceof Error?n.message:String(n)))}).finally(()=>{t||Y(!1)}),()=>{t=!0}},[a,K,O]);const Me=s.useMemo(()=>{if(!o)return[];const e=[];return be(o,0,y,L,e),e},[o,y,L]),me=s.useCallback((e,t)=>{const n=C?{returnConversationId:C}:{};if(h){for(const d of h.projects)for(const[ae,ge]of d.worktrees.entries())if(ge.path===e){const ve=t&&t.startsWith(`${e}/`)?t.slice(e.length+1):void 0;return{view:"code",project:S(d.name),...ve?{path:ve}:{},...ae>0?{wt:ge.name}:{},...n}}}return{view:"code",root:e,...t?{file:t}:{},...n}},[C,h]),oe=s.useCallback(()=>{if(!C)return;const e={view:"conversation",conversationId:C};ze({type:"navigate",route:e})||l?.(e)},[l,C]);s.useEffect(()=>{if(!C)return;const e=t=>{if(!t.defaultPrevented&&!(!t.metaKey||t.key!=="[")){if(t.target instanceof HTMLElement){const n=t.target.tagName;if(n==="INPUT"||n==="TEXTAREA"||t.target.isContentEditable)return}t.preventDefault(),oe()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[C,oe]);const H=s.useCallback((e,t)=>{X||!l||l(me(e,t))},[X,l,me]),Te=s.useCallback(e=>{U(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),y.has(e)||E(e)},[y,E]),De=s.useCallback(e=>{te(null),W(e),o&&H(o,e)},[o,H]),v=s.useMemo(()=>{if(!h||!o)return null;for(const e of h.projects)for(const t of e.worktrees)if(t.path===o)return{project:e,worktree:t};return null},[h,o]),F=s.useMemo(()=>{const e=new Map;if(!o||!v)return e;for(const t of v.worktree.status.files)e.set(`${o}/${t.path}`,t.status);return e},[o,v]),Ie=s.useMemo(()=>{const e=new Set;if(!o)return e;for(const t of F.keys()){let n=we(t);for(;n.startsWith(o)&&(e.add(n),n!==o);)n=we(n)}return e},[o,F]),q=!!(o&&a&&Oe(o,a));s.useEffect(()=>{q||ee("source")},[q]);const Be=a&&o&&a.startsWith(`${o}/`)?a.slice(o.length+1):c?.kind==="file"?c.title:a?ce(a):null,Pe=s.useCallback(async()=>{if(!c||c.kind!=="file"||!c.previewable)return;await je(c.content)&&(Z("copied"),window.setTimeout(()=>Z("idle"),1500))},[c]),[Ue,ke]=s.useState("idle"),D=s.useMemo(()=>{if(!o)return null;if(v){const e=a&&a.startsWith(`${o}/`)?a.slice(o.length+1):void 0,t=v.project.worktrees[0]?.path;return xe({project:S(v.project.name),...e?{path:e}:{},...t&&t!==o?{wt:v.worktree.name}:{},...m?.line?{line:m.line}:{},...m?.endLine?{endLine:m.endLine}:{}})}return xe({...a?{file:a}:{root:o},...m?.line?{line:m.line}:{},...m?.endLine?{endLine:m.endLine}:{}})},[o,a,v,m]),We=s.useCallback(async()=>{if(!D)return;await je(D)&&(ke("copied"),window.setTimeout(()=>ke("idle"),1500))},[D]),_e=s.useCallback(e=>{R.current=T.current,A({phase:"idle"}),te(e.line&&e.line>0?{line:e.line,...e.endLine&&e.endLine>=e.line?{endLine:e.endLine}:{}}:null),W(e.file??null),J(e.root),e.file&&$(e.root,e.file),H(e.root,e.file??null)},[$,H]);return r.jsxs("div",{className:"s-code-screen","data-embedded":X||void 0,children:[r.jsxs("div",{className:"s-code-head",children:[C?r.jsxs("button",{type:"button",className:"s-code-returnThread",onClick:oe,title:"Back to thread (⌘[)",children:[r.jsx(Ze,{size:13,strokeWidth:1.9,"aria-hidden":!0}),r.jsx("span",{children:"Back to thread"})]}):null,r.jsx(Je,{snapshot:h,root:o,onSelect:_e}),v?.worktree.diff.branchShortstat?r.jsx("span",{className:"s-code-headStat",children:v.worktree.diff.branchShortstat}):null,o?r.jsx("span",{className:"s-code-headPath",title:o,children:Qe(o)}):null,D?r.jsx("button",{type:"button",className:"s-code-copyLink",title:D,onClick:()=>{We()},children:Ue==="copied"?"Copied scout://":"Copy scout://"}):null]}),r.jsxs("div",{className:"s-code-body",children:[r.jsx("div",{className:"s-code-tree",role:"tree","aria-label":"Files",children:de?r.jsx("div",{className:"s-code-treeNote",children:de}):o?Me.map(e=>e.loading?r.jsx("div",{className:"s-code-node s-code-node--loading",style:{paddingLeft:10+e.depth*14},children:e.name},e.path):r.jsxs("button",{type:"button",role:"treeitem",className:"s-code-node","data-selected":e.path===a||void 0,"data-diff":e.kind==="file"?F.get(e.path):void 0,"aria-expanded":e.kind==="directory"?L.has(e.path):void 0,style:{paddingLeft:10+e.depth*14},onClick:()=>e.kind==="directory"?Te(e.path):De(e.path),onMouseEnter:e.kind==="file"?()=>Fe(e.path):void 0,children:[e.kind==="directory"?r.jsx(et,{size:11,strokeWidth:2,className:"s-code-nodeChevron","data-open":L.has(e.path)||void 0,"aria-hidden":!0}):r.jsx("span",{className:"s-code-nodeSpacer","aria-hidden":!0}),r.jsx("span",{className:"s-code-nodeName",children:e.name}),e.kind==="file"&&F.has(e.path)?r.jsx("span",{className:"s-code-nodeBadge","data-diff":F.get(e.path),children:it(F.get(e.path)??"")}):null,e.kind==="directory"&&Ie.has(e.path)?r.jsx("span",{className:"s-code-nodeDot","aria-label":"Contains changes"}):null]},e.path)):N.phase==="resolving"?r.jsxs("div",{className:"s-code-treeNote",children:["Resolving “",p,"”…"]}):N.phase==="failed"?r.jsx("div",{className:"s-code-treeNote",children:N.message}):r.jsx("div",{className:"s-code-treeNote",children:"No repo selected."})}),r.jsxs("div",{className:"s-code-main",children:[a?r.jsxs("div",{className:"s-code-fileHead",children:[r.jsx("span",{className:"s-code-filePath",children:Be}),q?r.jsxs("div",{className:"s-code-fileMode",role:"tablist","aria-label":"File view",children:[r.jsx("button",{type:"button",role:"tab","aria-selected":M==="source","data-selected":M==="source"||void 0,onClick:()=>ee("source"),children:"Source"}),r.jsx("button",{type:"button",role:"tab","aria-selected":M==="changes","data-selected":M==="changes"||void 0,onClick:()=>ee("changes"),children:"Changes"})]}):null,c?.kind==="file"?r.jsxs("span",{className:"s-code-fileMeta",children:[V(c.sizeBytes),c.previewable&&c.truncated?" · truncated":"",m?` · L${m.line}${m.endLine?`–${m.endLine}`:""}`:""]}):null,c?.kind==="file"&&c.previewable?r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"s-code-fileAction",onClick:()=>{Pe()},title:"Copy file contents",children:[pe==="copied"?r.jsx(tt,{size:12,"aria-hidden":!0}):r.jsx(nt,{size:12,"aria-hidden":!0}),pe==="copied"?"Copied":"Copy"]}),r.jsx("a",{className:"s-code-fileAction",href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"Raw"})]}):null]}):null,M==="changes"&&q&&o&&a?r.jsx(He,{root:o,file:a},`${o}\0${a}`):Ee?r.jsxs("div",{className:"s-code-empty",children:["Loading ",a?ce(a):"file","…"]}):fe?r.jsx("div",{className:"s-code-empty",children:fe}):c&&c.kind==="file"&&c.previewable?r.jsxs(r.Fragment,{children:[c.truncated?r.jsxs("div",{className:"s-code-fileNote",children:["Showing the first ",V(256*1024)," of ",V(c.sizeBytes)," ·"," ",r.jsx("a",{href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"open raw"})]}):null,r.jsx(Ye,{code:c.content,path:c.path,focusLine:m?.line,endLine:m?.endLine})]}):c&&c.kind==="file"?r.jsxs("div",{className:"s-code-empty",children:[c.previewReason," · ",V(c.sizeBytes)," ·"," ",r.jsx("a",{href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"open raw"})]}):N.phase==="resolving"?r.jsxs("div",{className:"s-code-empty",children:["Opening ",b??`“${p}”`,"…"]}):N.phase==="failed"?r.jsx("div",{className:"s-code-empty",children:N.message}):r.jsx("div",{className:"s-code-empty",children:"Pick a file to read."})]})]})]})}const Rt=Ke({id:"code",label:"Code Browser",route:{view:"code"},webPath:"/code",screen:"CodeContent",embed:{path:"/embed/code",profile:"macos.code",rootClassName:"s-code-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:i=>({root:i.get("root")?.trim()||void 0,file:i.get("file")?.trim()||void 0,project:i.get("project")?.trim()||void 0,path:i.get("path")?.trim()||void 0,wt:i.get("wt")?.trim()||void 0,line:Se(i.get("line")),endLine:Se(i.get("endLine")),returnConversationId:i.get("fromConversation")?.trim()||void 0})}});function Se(i){if(!i)return;const l=Number.parseInt(i,10);return Number.isSafeInteger(l)&&l>0?l:void 0}export{Nt as CodeContent,Rt as scoutSurface};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,j as s}from"./index-
|
|
1
|
+
import{r as u,j as s}from"./index-DmFAhGPj.js";const x={current:null,setMenu:null};function p(){return u.useCallback((i,t)=>{i.preventDefault(),i.stopPropagation(),x.setMenu?.({position:{x:i.clientX,y:i.clientY},items:t})},[])}function f({children:i}){const[t,w]=u.useState(null),d=u.useRef(null);x.setMenu=w;const r=u.useCallback(()=>{w(null)},[]);return u.useEffect(()=>{if(!t)return;const e=n=>{n.target instanceof Node&&d.current?.contains(n.target)||r()},o=n=>{n.key==="Escape"&&r()},l=()=>r(),c=n=>{n.defaultPrevented||r()};return window.addEventListener("mousedown",e,!0),window.addEventListener("keydown",o),window.addEventListener("wheel",l,!0),window.addEventListener("contextmenu",c),()=>{window.removeEventListener("mousedown",e,!0),window.removeEventListener("keydown",o),window.removeEventListener("wheel",l,!0),window.removeEventListener("contextmenu",c)}},[t,r]),u.useLayoutEffect(()=>{if(!t||!d.current)return;const e=d.current,o=e.getBoundingClientRect(),l=window.innerWidth,c=window.innerHeight;let n=t.position.x,a=t.position.y;n+o.width>l-8&&(n=l-o.width-8),a+o.height>c-8&&(a=c-o.height-8),n<8&&(n=8),a<8&&(a=8),e.style.left=`${n}px`,e.style.top=`${a}px`,e.style.visibility="visible"},[t]),s.jsxs(s.Fragment,{children:[i,t&&s.jsx("div",{ref:d,className:"s-context-menu",style:{left:t.position.x,top:t.position.y,visibility:"hidden"},role:"menu",onMouseDown:e=>e.stopPropagation(),children:t.items.map((e,o)=>e.kind==="separator"?s.jsx("div",{className:"s-context-menu-sep",role:"separator"},o):s.jsxs("button",{type:"button",className:"s-context-menu-item",role:"menuitem",onClick:()=>{e.onSelect(),r()},children:[s.jsx("span",{className:"s-context-menu-label",children:e.label}),e.shortcut&&s.jsx("span",{className:"s-context-menu-shortcut",children:e.shortcut})]},o))})]})}export{f as C,p as u};
|
package/dist/client/assets/{ConversationComposer-CjRXFkvY.js → ConversationComposer-Bf7Ga_49.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,j as e}from"./index-
|
|
1
|
+
import{r as u,j as e}from"./index-DmFAhGPj.js";import{d as G}from"./colors-BtO5_zlx.js";import{M as J}from"./runtime-picker--IW3cRry.js";import{i as Y,r as Z,d as z,a as ee,M}from"./MessageComposerSuggestions-FdVHnT_q.js";import{F as se}from"./file-text-DcYSrI4v.js";import"./index-CmwGCxUk.js";import{c as te}from"./createLucideIcon-CFBn0Sdk.js";import{X as ae}from"./x-C8ayPBtj.js";const ne=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],re=te("reply",ne),_="Only markdown, code, images, and video clips can be attached.";function be(){const[o,g]=u.useState([]),[p,x]=u.useState(null),[c,h]=u.useState(null),[m,j]=u.useState(0),a=u.useRef(null),k=u.useCallback((n,l="Attached")=>{const i=n.filter(Y);return i.length===0?(n.length>0&&h(_),0):(h(null),g(N=>{const F=new Set(N.map(d=>`${d.name}:${d.size}:${d.lastModified}`)),q=i.filter(d=>!F.has(`${d.name}:${d.size}:${d.lastModified}`));return q.length>0?[...N,...q]:N}),x(i.length===1?`${l} ${i[0]?.name??"1 attachment"}.`:`${l} ${i.length} attachments.`),i.length)},[]),b=u.useCallback(n=>{g(l=>l.filter(i=>i!==n)),x(null)},[]),y=u.useCallback(()=>{g([]),x(null),h(null),j(0)},[]),$=u.useCallback(()=>{a.current?.click()},[]),R=u.useCallback(n=>{const l=Z(n.clipboardData);l.length!==0&&(n.preventDefault(),k(l,"Pasted"))},[k]),f=u.useMemo(()=>({onDragOver:n=>{z(n.dataTransfer)&&(n.preventDefault(),j(l=>l===0?1:l))},onDragLeave:n=>{n.currentTarget.contains(n.relatedTarget)||j(0)},onDrop:n=>{if(!z(n.dataTransfer))return;n.preventDefault(),j(0);const l=ee(n.dataTransfer);if(l.length===0){h(_);return}k(l,"Dropped")}}),[k]);return{files:o,hasFiles:o.length>0,feedback:p,error:c,dragActive:m>0,stage:k,remove:b,clear:y,setError:h,openPicker:$,dropHandlers:f,onPaste:R,inputRef:a}}function oe({file:o,onRemove:g}){const p=u.useMemo(()=>URL.createObjectURL(o),[o]);u.useEffect(()=>()=>URL.revokeObjectURL(p),[p]);const x=o.type.startsWith("video/"),c=o.type.startsWith("image/");return e.jsxs("div",{className:"s-msg-compose-attachment",children:[x?e.jsx("video",{src:p,muted:!0,playsInline:!0}):c?e.jsx("img",{src:p,alt:o.name}):e.jsxs("div",{className:"s-msg-compose-attachment-file",title:o.name,children:[e.jsx(se,{size:18,"aria-hidden":"true"}),e.jsx("span",{children:o.name})]}),e.jsx("button",{type:"button",className:"s-msg-compose-attachment-remove","aria-label":`Remove ${o.name}`,onClick:g,children:"×"})]})}function le({attachments:o,accept:g="image/*,video/*,text/markdown,.md,.markdown,text/plain,.txt"}){const{files:p,feedback:x,error:c,remove:h,stage:m,inputRef:j}=o;return e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:j,type:"file",multiple:!0,accept:g,className:"s-msg-compose-file-input",onChange:a=>{m([...a.target.files??[]]),a.target.value=""}}),p.length>0?e.jsx("div",{className:"s-msg-compose-attachments","aria-label":"Staged attachments",children:p.map(a=>e.jsx(oe,{file:a,onRemove:()=>h(a)},`${a.name}:${a.size}:${a.lastModified}`))}):null,c?e.jsx("div",{className:"s-msg-compose-attach-note","data-tone":"error",role:"alert",children:c}):x?e.jsx("div",{className:"s-msg-compose-attach-note","data-tone":"muted",role:"status",children:x}):null]})}function ce({composeRef:o,draft:g,setDraft:p,composePlaceholder:x,slashState:c,setSlashState:h,filteredSlashCommands:m,applySlashCommand:j,mentionState:a,setMentionState:k,filteredMentions:b,applyMention:y,updateTriggersFromDraft:$,closeSuggestions:R,replyTarget:f,onCancelReply:n,isStopMode:l,sending:i,composeAction:N,onSend:F,onInterrupt:q,attachments:d,isAgentBusy:H,busyIntent:P,onBusyIntentChange:T,queued:v,queueNote:I,onEditQueued:K,editingQueuedId:C,editingAttachmentCount:E,onCancelEdit:W,onUnqueue:S,onSendQueuedNow:Q}){const B=e.jsxs(e.Fragment,{children:[c.open?e.jsx(M,{label:"Slash commands",items:m.map(s=>({id:s.command,token:s.label,description:s.description})),activeIndex:c.index,onPick:s=>{const t=m[s];t&&j(t)},onActiveIndexChange:s=>h(t=>({...t,index:s}))}):null,a.open?e.jsx(M,{label:"Mention agent",items:b.map(s=>({id:s.id,token:`@${s.handle}`,description:s.name,avatar:{label:s.name[0]?.toUpperCase()??"?",color:G(s.name)}})),activeIndex:a.index,onPick:s=>{const t=b[s];t&&y(t)},onActiveIndexChange:s=>k(t=>({...t,index:s}))}):null]}),V=g.trim().length>0,A=C!==null,L=V||d.hasFiles||E>0,D=H&&L,w=D&&P==="steer",O=A?v.findIndex(s=>s.id===C)+1:0,U=D?e.jsxs("div",{className:"s-msg-compose-mode",role:"group","aria-label":"What Send does while this turn is running",children:[e.jsx("button",{type:"button",className:"s-msg-compose-mode-btn","data-mode":"queue","aria-pressed":P==="queue",title:"Hold this draft until the running turn lands",disabled:i,onClick:()=>T("queue"),children:"Queue"}),e.jsx("button",{type:"button",className:"s-msg-compose-mode-btn","data-mode":"steer","aria-pressed":P==="steer",title:"Interrupt the running turn and deliver this now",disabled:i,onClick:()=>T("steer"),children:"Steer"})]}):null,X=v.length>0||U?e.jsxs("div",{className:"s-msg-compose-queue",role:"group","aria-label":"Queued messages",children:[e.jsxs("div",{className:"s-msg-compose-queue-head",children:[e.jsx("span",{className:"s-msg-compose-queue-kicker",children:v.length>0?`Queue · ${v.length}`:"Queues next"}),e.jsx("span",{className:"s-msg-compose-queue-hint",children:A?w?`Rewriting ${O} — send interrupts this turn`:`Rewriting ${O} — send returns it to its place`:v.length>0?w?"Send interrupts this turn":I??"":w?"Interrupts this turn on send":"Sends when this turn lands"}),U]}),v.map((s,t)=>e.jsxs("div",{className:"s-msg-compose-queue-row","data-editing":s.id===C?"true":void 0,children:[e.jsx("span",{className:"s-msg-compose-queue-index",children:t+1}),e.jsx("span",{className:"s-msg-compose-queue-body",children:s.body.trim()||"Attachments only"}),s.attachments.length>0?e.jsxs("span",{className:"s-msg-compose-queue-clip",children:[s.attachments.length," file",s.attachments.length===1?"":"s"]}):null,s.id===C?e.jsx("button",{type:"button",className:"s-msg-compose-queue-edit",title:"Stop rewriting — leave this row as it was","aria-label":`Cancel rewriting queued message ${t+1}`,onClick:W,children:"Cancel edit"}):e.jsx("button",{type:"button",className:"s-msg-compose-queue-edit",title:"Pull this back into the input box to rewrite it","aria-label":`Edit queued message ${t+1}`,disabled:i||A,onClick:()=>K(s.id),children:"Edit"}),e.jsx("button",{type:"button",className:"s-msg-compose-queue-now",title:"Interrupt this turn and send this now","aria-label":`Send queued message ${t+1} now`,disabled:i||s.id===C,onClick:()=>Q(s.id),children:"Send now"}),e.jsx("button",{type:"button",className:"s-msg-compose-queue-drop",title:"Cancel — drop this from the queue","aria-label":`Cancel queued message ${t+1}`,onClick:()=>S(s.id),children:"×"})]},s.id))]}):null;return e.jsx(J,{density:"thread",value:g,onChange:(s,t)=>{p(s),$(s,t?.caret??s.length)},onSend:F,placeholder:x,sending:i,stopMode:l,onStop:q,canSend:L,sendTitle:w?"Steer — interrupt this turn and send now (Cmd+Enter)":D?"Queue for the next turn (Cmd+Enter)":"Send (Cmd+Enter)",sendAriaLabel:w?"Steer — interrupt this turn and send now (Cmd+Enter)":D?"Queue message for the next turn (Cmd+Enter)":N==="steer"?"Send follow-up (Cmd+Enter)":"Send message (Cmd+Enter)",showAttach:!0,onAttach:d.openPicker,onPaste:d.onPaste,dropHandlers:d.dropHandlers,dragActive:d.dragActive,textareaRef:o,overlay:B,above:X,aboveAttached:!0,header:e.jsxs(e.Fragment,{children:[f?e.jsxs("div",{className:"s-thread-compose-reply",role:"status",children:[e.jsx(re,{className:"s-thread-compose-reply-icon",size:13,strokeWidth:1.8,"aria-hidden":"true"}),e.jsx("span",{className:"s-thread-compose-reply-label",children:"Replying to"}),e.jsx("span",{className:"s-thread-compose-reply-actor",children:f.actorLabel}),e.jsx("span",{className:"s-thread-compose-reply-preview",title:f.preview,children:f.preview}),e.jsx("button",{type:"button",className:"s-thread-compose-reply-cancel","aria-label":"Cancel reply",title:"Cancel reply",onClick:n,children:e.jsx(ae,{size:13,strokeWidth:1.8,"aria-hidden":"true"})})]}):null,A&&E>0?e.jsxs("div",{className:"s-msg-compose-carried",role:"status",children:[E," file",E===1?"":"s"," stay attached to this draft"]}):null,e.jsx(le,{attachments:d})]}),tools:e.jsxs("span",{className:"s-thread-compose-hint s-msg-compose-tools-hint",children:[e.jsx("kbd",{className:"s-kbd",children:"/"})," commands"," · ",e.jsx("kbd",{className:"s-kbd",children:"@"})," agents"]}),onSelect:s=>{const t=s.currentTarget;$(t.value,t.selectionStart)},onBlur:()=>{setTimeout(R,120)},onKeyDown:s=>{if(!(c.open&&m.length>0||a.open&&b.length>0))return!1;if(s.key==="ArrowDown")return c.open?h(r=>({...r,index:(r.index+1)%m.length})):a.open&&k(r=>({...r,index:(r.index+1)%b.length})),!0;if(s.key==="ArrowUp")return c.open?h(r=>({...r,index:(r.index-1+m.length)%m.length})):a.open&&k(r=>({...r,index:(r.index-1+b.length)%b.length})),!0;if(s.key==="Escape")return R(),!0;if((s.key==="Enter"||s.key==="Tab")&&!s.shiftKey&&!s.metaKey&&!s.ctrlKey&&!s.altKey){if(c.open){const r=m[c.index]??m[0];r&&j(r)}else if(a.open){const r=b[a.index]??b[0];r&&y(r)}return!0}return!1}})}const je=Object.freeze(Object.defineProperty({__proto__:null,ConversationComposer:ce},Symbol.toStringTag,{value:"Module"}));export{ce as C,je as a,be as u};
|
package/dist/client/assets/{ConversationFeedRows-CgRTIpAv.js → ConversationFeedRows-Cm1Lgo43.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./index-
|
|
1
|
+
import{j as t}from"./index-DmFAhGPj.js";import{M as p}from"./message-markup-CyRDLdOn.js";import{f as d}from"./conversation-model-CHwHZNw-.js";import{t as n}from"./time-Dhsh_2EG.js";import"./mentions-agCGDgyA.js";import"./colors-BtO5_zlx.js";import"./index-CmwGCxUk.js";import"./api-h5zurxmi.js";import"./Provider-cJCdHAxu.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./HarnessMark-BPAphNjx.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./AgentDetailCard-BTiOmh-a.js";import"./AgentLiveActions-BJ5dIfL3.js";import"./terminal-takeover-BOFPRPjR.js";import"./openContent-C6XO6kr5.js";import"./eye-1J4yOUoG.js";import"./terminal-DJPUp_Qn.js";function l({at:a}){const i=d(a);return t.jsxs("div",{className:"s-thread-day-divider","aria-label":i,children:[t.jsx("span",{className:"s-thread-day-line","aria-hidden":"true"}),t.jsx("span",{className:"s-thread-day-label",children:i}),t.jsx("span",{className:"s-thread-day-line","aria-hidden":"true"})]})}function st({row:a,expanded:i,showDayDivider:e,onToggle:s}){const m=`${a.recipients.length} recipients`;return t.jsxs("div",{className:["s-thread-feed-block","s-thread-fanout",e&&"s-thread-feed-block--full-width"].filter(Boolean).join(" "),children:[e&&t.jsx(l,{at:a.createdAt}),a.messages.map(r=>t.jsx("span",{id:`msg-${r.id}`,className:"s-thread-fanout-anchor","aria-hidden":"true"},r.id)),t.jsxs("button",{type:"button",className:"s-thread-fanout-summary","aria-expanded":i,onClick:s,title:a.recipients.join(", "),children:[t.jsx("span",{className:"s-thread-fanout-caret","aria-hidden":"true",children:i?"▾":"▸"}),t.jsx("span",{className:"s-thread-fanout-label",children:m}),t.jsx("span",{className:"s-thread-fanout-time",children:n(a.createdAt)})]}),i&&t.jsxs("div",{className:"s-thread-fanout-detail",children:[t.jsx("ul",{className:"s-thread-fanout-recipients",children:a.messages.map((r,o)=>t.jsx("li",{className:"s-thread-fanout-recipient",children:a.recipients[o]},r.id))}),t.jsx("div",{className:"s-thread-fanout-body",children:t.jsx(p,{text:a.messages[0].body})})]})]})}export{st as FanOutRow,l as ThreadDayDivider};
|
package/dist/client/assets/{ConversationHeader-CRmdtuL7.js → ConversationHeader-B_GXrKR0.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-DmFAhGPj.js";import{c as p}from"./clipboard-e3fSpeo7.js";import{b as A}from"./router-Cn_s9IGH.js";import{A as f}from"./AgentAvatar-D8ZtMluU.js";import{u as $}from"./ContextMenu-CHIuVKz7.js";import{B as I}from"./BackToPicker-D1LV6Cqp.js";import{o as j}from"./openContent-C6XO6kr5.js";import{v as S,w as L}from"./conversation-model-CHwHZNw-.js";import{E as M}from"./eye-1J4yOUoG.js";import{c as T}from"./createLucideIcon-CFBn0Sdk.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";const B=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],F=T("user-plus",B);function R({showBackNav:r,isDm:t,navigate:l,route:n,canonicalConversationId:x,threadTitle:d,agentId:c,sessionId:a,detailRoute:h,visibleParticipants:b,hiddenParticipantCount:v,operator:m,canAddParticipants:k,onToggleAddParticipant:g}){const C=$(),u=A(n);return e.jsxs("div",{className:"s-thread-center-header",onClick:s=>{s.target?.closest("button,a,input,select,textarea")||!t||!h||j(l,h,{returnTo:n})},style:t&&h?{cursor:"pointer"}:void 0,onContextMenu:s=>{const o=[{kind:"action",label:"Copy Title",onSelect:()=>{p(d)}}];c&&o.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{p(c)}}),!c&&a&&o.push({kind:"action",label:"Copy Session ID",onSelect:()=>{p(a)}}),o.push({kind:"action",label:"Copy Conversation ID",onSelect:()=>{p(x)}}),C(s,o)},children:[r&&e.jsx(I,{slot:"conversation",fallback:{view:"inbox"},navigate:l,label:"Back",className:"s-thread-header-back"}),e.jsx("div",{className:"s-thread-center-header-info",children:t&&h?e.jsx("button",{type:"button",className:"s-thread-center-header-name",title:`Open ${d} details`,onClick:()=>j(l,h,{returnTo:n}),children:d}):e.jsx("span",{className:"s-thread-center-header-name",children:d})}),e.jsxs("div",{className:"s-thread-center-header-right",children:[b.length>0&&e.jsxs("div",{className:"s-thread-participants","aria-label":"Conversation participants",children:[b.map(s=>{const i=[s.model??(s.harness?"model unknown":null),s.reasoningEffort].filter(Boolean).join(" · ")||null,w=i?`${s.name} · ${i}`:s.title,y=e.jsxs(e.Fragment,{children:[e.jsx(f,{agent:s.agent??void 0,name:s.name,placement:"turn",className:"s-thread-participant-avatar",title:s.name}),e.jsxs("span",{className:"s-thread-participant-identity",children:[e.jsx("span",{className:"s-thread-participant-name",children:s.name}),i&&e.jsx("span",{className:"s-thread-participant-model",title:i,children:i})]})]}),N=s.agent?{view:"agents-v2",agentId:s.agent.id,...u?{machineId:u}:{}}:s.sessionId?{view:"sessions",sessionId:s.sessionId,...u?{machineId:u}:{}}:null;return N?e.jsx("button",{type:"button",className:"s-thread-participant-pill s-thread-participant-pill--button",title:`Open ${s.name} ${s.agent?"profile":"session"}${i?` · ${i}`:""}`,onClick:()=>j(l,N,{returnTo:n}),children:y},s.id):e.jsx("span",{className:"s-thread-participant-pill",title:w,children:y},s.id)}),v>0&&e.jsxs("span",{className:"s-thread-participant-overflow",children:["+",v]}),m.active?e.jsxs("span",{className:"s-thread-participant-pill s-thread-participant-pill--operator",title:`${m.name} · in this conversation`,children:[e.jsx(f,{name:m.name,placement:"turn",className:"s-thread-participant-avatar s-thread-participant-avatar--operator",title:m.name}),e.jsx("span",{className:"s-thread-participant-identity",children:e.jsx("span",{className:"s-thread-participant-name",children:"You"})})]}):e.jsxs("span",{className:"s-thread-participant-observer",title:`${m.name} · observing (not in thread)`,children:[e.jsx(M,{size:12,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Observing"})]})]}),k&&e.jsx("button",{type:"button",className:"s-thread-add-participant-trigger",onClick:g,title:"Add participant","aria-label":"Add participant",children:e.jsx(F,{size:14,strokeWidth:1.9,"aria-hidden":"true"})})]})]})}function P({canonicalConversationId:r,conversationAlias:t}){return e.jsxs("div",{className:"s-thread-identity-row",children:[e.jsxs("button",{type:"button",className:"s-thread-identity-chip",title:r,onClick:()=>{p(r)},children:[e.jsx("span",{children:S()}),e.jsx("strong",{children:L(r)})]}),t&&e.jsxs("span",{className:"s-thread-identity-chip",title:t,children:[e.jsx("span",{children:"Alias"}),e.jsx("strong",{children:t})]})]})}function ee({agents:r,addParticipantId:t,setAddParticipantId:l,addingParticipant:n,addParticipantError:x,onCancel:d,onSubmit:c}){return e.jsxs("form",{className:"s-thread-add-participant",onSubmit:a=>{a.preventDefault(),c()},children:[e.jsxs("div",{className:"s-thread-add-participant-row",children:[e.jsxs("div",{className:"s-thread-add-participant-field",children:[e.jsx("label",{className:"s-thread-add-participant-label",htmlFor:"thread-add-participant-select",children:"Agent"}),e.jsx("select",{id:"thread-add-participant-select",className:"s-thread-add-participant-select",value:t,onChange:a=>l(a.target.value),autoFocus:!0,children:r.map(a=>e.jsx("option",{value:a.id,children:a.name},a.id))})]}),e.jsxs("div",{className:"s-thread-add-participant-actions",children:[e.jsx("button",{type:"button",className:"s-btn s-btn-sm",onClick:d,disabled:n,children:"Cancel"}),e.jsx("button",{type:"submit",className:"s-btn s-btn-primary s-btn-sm",disabled:n||t.trim().length===0,children:n?"Adding...":"Add"})]})]}),x&&e.jsx("div",{className:"s-thread-add-participant-error",children:x})]})}export{ee as AddParticipantForm,R as ConversationHeader,P as ConversationIdentityRow};
|
package/dist/client/assets/{ConversationPanels-DCkcLIHk.js → ConversationPanels-BTBbEvrP.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/conversation-motion-features-
|
|
2
|
-
import{j as e,_ as M,r as x}from"./index-BZovGpDk.js";import{b as L,t as _,g as S,r as R,d as $,m as w,c as E,e as I,p as P}from"./conversation-model-CHwHZNw-.js";import{n as W,d as b,f as B,s as z}from"./colors-BtO5_zlx.js";import{i as y}from"./sessionRead-CvFz2RHv.js";import{t as j,f as k}from"./time-Dhsh_2EG.js";import{u as U}from"./Provider-p-xuaAoE.js";import{o as f}from"./openContent-C6XO6kr5.js";import{u as D,L as F,m as p}from"./use-reduced-motion-C8cWvIZ3.js";import{A as O}from"./activity-DS0u0Itf.js";import{T as H}from"./terminal-xGf_F3y7.js";import{M as K}from"./message-circle-BwVx5X0q.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";const G=[{head:"30%",body:"88%",short:"62%"},{head:"22%",body:"76%",short:"48%"},{head:"34%",body:"82%",short:"68%"}],J=()=>M(()=>import("./conversation-motion-features-DPiGTO21.js"),__vite__mapDeps([0,1,2,3,4])).then(a=>a.default);function Y({onOpenTrace:a,onOpenTerminal:i,onSteer:d,compact:r=!1}){return!a&&!i&&!d?null:e.jsxs("nav",{className:`s-thread-working-actions${r?" s-thread-working-actions--compact":""}`,"aria-label":"Working turn actions",children:[a&&e.jsxs("button",{type:"button",className:"s-thread-working-action s-thread-working-action--primary",onClick:a,title:"Watch this run's live trace",children:[e.jsx(O,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Live trace"})]}),i&&e.jsxs("button",{type:"button",className:"s-thread-working-action",onClick:i,title:"Jump into this agent's terminal",children:[e.jsx(H,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Terminal"})]}),d&&e.jsxs("button",{type:"button",className:"s-thread-working-action",onClick:d,title:"Write an interrupting message to steer this turn",children:[e.jsx(K,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Steer…"})]})]})}const q={think:"Thinking",tool:"Tool",ask:"Prompt",message:"Says",note:"Note",system:"System",boot:"Boot"};function N({steps:a,phase:i,limit:d=5,compact:r=!1}){const l=a.slice(-d),o=a.length-l.length;return l.length===0?i?e.jsxs("div",{className:"s-thread-steps-phase",children:[e.jsx("span",{children:i.label}),e.jsx("strong",{children:i.detail})]}):null:e.jsxs("div",{className:`s-thread-steps${r?" s-thread-steps--compact":""}`,children:[o>0&&e.jsxs("div",{className:"s-thread-steps-elided",children:[o," earlier step",o===1?"":"s"]}),e.jsx("ol",{"aria-label":"Live steps in this turn",children:l.map(s=>e.jsxs("li",{"data-kind":s.kind,children:[e.jsx("span",{className:"s-thread-step-mark","aria-hidden":"true"}),e.jsx("span",{className:"s-thread-step-kind",children:q[s.kind]}),e.jsxs("span",{className:"s-thread-step-body",children:[s.tool?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-thread-step-tool",children:s.tool}),s.arg&&e.jsx("span",{className:"s-thread-step-arg",children:s.arg})]}):e.jsx("span",{className:"s-thread-step-text",children:s.text}),s.repeatCount>1&&e.jsxs("span",{className:"s-thread-step-repeat",children:["×",s.repeatCount]}),s.outcome&&e.jsx("span",{className:"s-thread-step-outcome",children:s.outcome})]}),e.jsx("time",{title:k(s.ts),children:j(s.ts)})]},s.id))})]})}function Q({events:a,limit:i=3,compact:d=!1}){const r=a.slice(0,i);return r.length===0?null:e.jsx("ol",{className:`s-thread-motion-events${d?" s-thread-motion-events--compact":""}`,"aria-label":"Latest run activity",children:r.map(l=>e.jsxs("li",{children:[e.jsx("span",{className:"s-thread-motion-event-kind",children:L(l.kind)}),e.jsx("span",{className:"s-thread-motion-event-summary",children:_(l)??"Activity recorded"}),e.jsx("time",{title:k(l.ts),children:j(l.ts)})]},l.id))})}function He(){const a=D();return e.jsx(F,{features:J,strict:!0,children:e.jsxs(p.section,{className:"s-thread-skeleton","aria-busy":"true","aria-live":"polite",initial:a?!1:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:[.2,.7,.3,1]},children:[e.jsxs("div",{className:"s-thread-skeleton-intro",role:"status",children:[e.jsxs("div",{className:"s-thread-loader-mark","aria-hidden":"true",children:[e.jsx(p.span,{className:"s-thread-loader-orbit",animate:a?void 0:{rotate:360},transition:{duration:3.2,ease:"linear",repeat:1/0},children:e.jsx("span",{})}),e.jsx(p.span,{className:"s-thread-loader-core",animate:a?void 0:{scale:[.88,1,.88],opacity:[.58,1,.58]},transition:{duration:1.8,ease:"easeInOut",repeat:1/0}})]}),e.jsxs("span",{className:"s-thread-skeleton-copy",children:[e.jsx("strong",{children:"Composer ready"}),e.jsx("span",{children:"Gathering the conversation…"})]})]}),e.jsx("div",{className:"s-thread-skeleton-turns","aria-hidden":"true",children:G.map((i,d)=>e.jsxs(p.div,{className:"s-thread-skeleton-turn",initial:a?!1:{opacity:0,y:7},animate:{opacity:1,y:0},transition:{delay:a?0:.05+d*.055,duration:.24,ease:[.2,.7,.3,1]},children:[e.jsx("span",{className:"s-thread-skeleton-avatar"}),e.jsxs("div",{className:"s-thread-skeleton-lines",children:[e.jsx("span",{className:"s-thread-skeleton-line s-thread-skeleton-line--head",style:{width:i.head}}),e.jsx("span",{className:"s-thread-skeleton-line",style:{width:i.body}}),e.jsx("span",{className:"s-thread-skeleton-line s-thread-skeleton-line--short",style:{width:i.short}})]})]},`${i.head}-${i.body}`))})]})})}function Ke({sessions:a,activeConversationId:i,needsYouIds:d,lastViewed:r,navigate:l}){const o=a.filter(n=>d.has(n.id)||n.agentId&&d.has(n.agentId)),s=x.useMemo(()=>S(a),[a]);return e.jsx("aside",{className:"s-thread-rail",children:e.jsxs("div",{className:"s-thread-rail-scroll",children:[o.length>0&&e.jsxs("div",{className:"s-thread-rail-section s-thread-rail-section--needs-you",children:[e.jsx("div",{className:"s-thread-rail-section-label",children:"Needs you"}),o.map(n=>e.jsx(g,{session:n,active:n.id===i,unread:y(n.lastMessageAt,n.id,r),needsYou:!0,navigate:l},`needs-${n.id}`))]}),s.map(n=>e.jsxs("div",{className:"s-thread-rail-section",children:[e.jsx("div",{className:"s-thread-rail-section-label",children:n.workspace}),n.sessions.map(c=>e.jsx(g,{session:c,active:c.id===i,unread:y(c.lastMessageAt,c.id,r),needsYou:!1,navigate:l},c.id))]},n.workspace))]})})}function Ge({sessionMeta:a,agents:i,flights:d,conversationId:r,navigate:l,route:o}){const s=x.useMemo(()=>a?a.participantIds.filter(t=>t!=="operator").map(t=>R(i,[t])).filter(t=>t!==null):[],[a,i]),n={id:"operator",name:"You",handle:"operator",activity:null,state:"ready",agent:null},c=x.useMemo(()=>s.map(t=>({id:t.id,name:t.name,handle:w(t)??E(t.id)??t.id,activity:$(t,d,r),state:W(t.state),agent:t})),[s,d,r]),h=[n,...c];return e.jsxs("aside",{className:"s-thread-sidebar",children:[e.jsxs("div",{className:"s-thread-sidebar-section",children:[e.jsx("div",{className:"s-thread-sidebar-label",children:"In this conversation"}),h.map(t=>{const m=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"28px",background:b(t.name)},children:t.name[0]?.toUpperCase()??"?"}),e.jsxs("div",{className:"s-thread-sidebar-participant-info",children:[e.jsx("span",{className:"s-thread-sidebar-participant-name",children:t.name}),e.jsxs("span",{className:"s-thread-sidebar-participant-handle",children:["@",t.handle]})]}),e.jsx("div",{className:"s-thread-sidebar-participant-activity",children:t.activity?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-thread-sidebar-activity-dot s-thread-sidebar-activity-dot--pulse",style:{background:"var(--green)"}}),e.jsx("span",{className:"s-thread-sidebar-activity-label",children:t.activity})]}):B(t.state)||t.id==="operator"?e.jsx("span",{className:"s-thread-sidebar-activity-dot",style:{background:z(t.state)}}):e.jsx("span",{className:"s-thread-sidebar-activity-dot",style:{background:"var(--dim)"}})})]});return t.agent?e.jsx("button",{type:"button",className:"s-thread-sidebar-participant s-thread-sidebar-participant--clickable",onClick:()=>f(l,{view:"agents-v2",agentId:t.agent.id},{returnTo:o}),title:`Open ${t.name} profile`,children:m},t.id):e.jsx("div",{className:"s-thread-sidebar-participant",children:m},t.id)})]}),c.length>0&&e.jsxs("div",{className:"s-thread-sidebar-section",children:[e.jsx("div",{className:"s-thread-sidebar-label",children:"Conversation mesh"}),e.jsx(V,{participants:c})]})]})}function Je({agentName:a,title:i,detail:d,snapshot:r,events:l,steps:o,phase:s,tone:n,workspaceName:c,branch:h,startedAt:t,onOpenTrace:m,onOpenTerminal:A,onSteer:C}){const T=t?j(t):"now";return e.jsxs("section",{className:`s-thread-motion-panel s-thread-motion-panel--${n}`,"aria-live":"polite",children:[e.jsxs("div",{className:"s-thread-motion-head",children:[e.jsx("div",{className:"s-thread-motion-beacon","aria-hidden":"true",children:e.jsx("span",{})}),e.jsxs("div",{className:"s-thread-motion-title-block",children:[e.jsx("div",{className:"s-thread-motion-kicker",children:"Currently working"}),e.jsx("h2",{children:i}),e.jsx("p",{children:d})]})]}),e.jsx("div",{className:"s-thread-motion-meter","aria-hidden":"true",children:X.map((u,v)=>e.jsx("span",{style:{"--bar-height":`${u}%`,"--bar-delay":`${v*74}ms`}},`${u}-${v}`))}),e.jsxs("dl",{className:"s-thread-motion-stats",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Session"}),e.jsx("dd",{children:T})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Activity"}),e.jsx("dd",{children:r.activityLabel})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Last"}),e.jsx("dd",{children:r.lastActivityLabel})]})]}),e.jsxs("div",{className:"s-thread-motion-latest",children:[e.jsx("span",{children:a}),e.jsx("strong",{children:r.latest})]}),o.length>0?e.jsx(N,{steps:o,phase:null,limit:6}):l.length>0?e.jsx(Q,{events:l,limit:4}):s?e.jsx(N,{steps:o,phase:s,limit:6}):e.jsxs("div",{className:"s-thread-motion-waiting",children:[e.jsx("span",{children:"Session created"}),e.jsx("strong",{children:"waiting for the first trace event"})]}),(c||h)&&e.jsxs("div",{className:"s-thread-motion-chips",children:[c&&e.jsx("span",{children:c}),h&&e.jsx("span",{children:h})]}),e.jsx(Y,{onOpenTrace:m,onOpenTerminal:A,onSteer:C})]})}function g({session:a,active:i,unread:d,needsYou:r,navigate:l}){const{route:o}=U(),s=I(a),n=(a.agentName??s)[0]?.toUpperCase()??"?",c=a.kind==="direct",h=P(a.workspaceRoot)??a.kind;return e.jsxs("button",{type:"button",className:["s-thread-rail-item",i&&"s-thread-rail-item--active",r&&"s-thread-rail-item--needs-you"].filter(Boolean).join(" "),onClick:()=>f(l,{view:"conversation",conversationId:a.id},{returnTo:o}),children:[c?e.jsx("div",{className:"s-thread-rail-avatar",style:{background:b(a.agentName??s)},children:n}):e.jsx("div",{className:"s-thread-rail-avatar s-thread-rail-avatar--channel",children:"#"}),e.jsxs("div",{className:"s-thread-rail-body",children:[e.jsx("span",{className:"s-thread-rail-name",children:s}),e.jsx("span",{className:"s-thread-rail-sub",children:h})]}),e.jsxs("div",{className:"s-thread-rail-trailing",children:[d&&!r&&e.jsx("span",{className:"s-thread-rail-presence-dot",style:{background:"var(--accent)"}}),r&&e.jsx("span",{className:"s-thread-rail-badge s-thread-rail-badge--amber",children:"!"})]})]})}function V({participants:a}){const o=a.map((s,n)=>{const c=2*Math.PI*n/a.length-Math.PI/2;return{...s,x:130+55*Math.cos(c),y:80+55*Math.sin(c)}});return e.jsx("div",{className:"s-thread-mini-mesh",children:e.jsxs("svg",{viewBox:"0 0 260 160","aria-label":"Conversation participant mesh",children:[o.map(s=>e.jsx("line",{x1:130,y1:80,x2:s.x,y2:s.y,className:"s-thread-mini-mesh-edge"},`edge-${s.id}`)),e.jsx("circle",{cx:130,cy:80,r:16,className:"s-thread-mini-mesh-node s-thread-mini-mesh-node--center"}),e.jsx("text",{x:130,y:80,className:"s-thread-mini-mesh-label s-thread-mini-mesh-label--center",children:"OP"}),o.map(s=>e.jsxs("g",{children:[e.jsx("circle",{cx:s.x,cy:s.y,r:16,className:"s-thread-mini-mesh-node",style:s.state==="in_turn"||s.state==="in_flight"?{stroke:"var(--green)"}:void 0}),e.jsx("text",{x:s.x,y:s.y,className:"s-thread-mini-mesh-label",children:s.name.slice(0,3).toUpperCase()})]},`node-${s.id}`))]})})}const X=[42,76,54,88,34,66,92,48,72,38,84,58];export{Ke as ChannelRail,Ge as PresenceSidebar,He as ThreadLoadingSkeleton,Je as ThreadMotionPanel,Y as WorkingTurnActions,Q as WorkingTurnActivityPreview,N as WorkingTurnSteps};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/conversation-motion-features-DXtKlmuM.js","assets/gestures-CcEOV6Sr.js","assets/index-DmFAhGPj.js","assets/index-BBznYVWk.css","assets/use-reduced-motion-CYqhYqHO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,_ as M,r as x}from"./index-DmFAhGPj.js";import{b as L,t as _,g as S,r as R,d as $,m as w,c as E,e as I,p as P}from"./conversation-model-CHwHZNw-.js";import{n as W,d as b,f as B,s as z}from"./colors-BtO5_zlx.js";import{i as y}from"./sessionRead-CvFz2RHv.js";import{t as j,f as k}from"./time-Dhsh_2EG.js";import{u as U}from"./Provider-cJCdHAxu.js";import{o as f}from"./openContent-C6XO6kr5.js";import{u as D,L as F,m as p}from"./use-reduced-motion-CYqhYqHO.js";import{A as O}from"./activity-CC8JzJNH.js";import{T as H}from"./terminal-DJPUp_Qn.js";import{M as K}from"./message-circle-CJO-pi7b.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";const G=[{head:"30%",body:"88%",short:"62%"},{head:"22%",body:"76%",short:"48%"},{head:"34%",body:"82%",short:"68%"}],J=()=>M(()=>import("./conversation-motion-features-DXtKlmuM.js"),__vite__mapDeps([0,1,2,3,4])).then(a=>a.default);function Y({onOpenTrace:a,onOpenTerminal:i,onSteer:d,compact:r=!1}){return!a&&!i&&!d?null:e.jsxs("nav",{className:`s-thread-working-actions${r?" s-thread-working-actions--compact":""}`,"aria-label":"Working turn actions",children:[a&&e.jsxs("button",{type:"button",className:"s-thread-working-action s-thread-working-action--primary",onClick:a,title:"Watch this run's live trace",children:[e.jsx(O,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Live trace"})]}),i&&e.jsxs("button",{type:"button",className:"s-thread-working-action",onClick:i,title:"Jump into this agent's terminal",children:[e.jsx(H,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Terminal"})]}),d&&e.jsxs("button",{type:"button",className:"s-thread-working-action",onClick:d,title:"Write an interrupting message to steer this turn",children:[e.jsx(K,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Steer…"})]})]})}const q={think:"Thinking",tool:"Tool",ask:"Prompt",message:"Says",note:"Note",system:"System",boot:"Boot"};function N({steps:a,phase:i,limit:d=5,compact:r=!1}){const l=a.slice(-d),o=a.length-l.length;return l.length===0?i?e.jsxs("div",{className:"s-thread-steps-phase",children:[e.jsx("span",{children:i.label}),e.jsx("strong",{children:i.detail})]}):null:e.jsxs("div",{className:`s-thread-steps${r?" s-thread-steps--compact":""}`,children:[o>0&&e.jsxs("div",{className:"s-thread-steps-elided",children:[o," earlier step",o===1?"":"s"]}),e.jsx("ol",{"aria-label":"Live steps in this turn",children:l.map(s=>e.jsxs("li",{"data-kind":s.kind,children:[e.jsx("span",{className:"s-thread-step-mark","aria-hidden":"true"}),e.jsx("span",{className:"s-thread-step-kind",children:q[s.kind]}),e.jsxs("span",{className:"s-thread-step-body",children:[s.tool?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-thread-step-tool",children:s.tool}),s.arg&&e.jsx("span",{className:"s-thread-step-arg",children:s.arg})]}):e.jsx("span",{className:"s-thread-step-text",children:s.text}),s.repeatCount>1&&e.jsxs("span",{className:"s-thread-step-repeat",children:["×",s.repeatCount]}),s.outcome&&e.jsx("span",{className:"s-thread-step-outcome",children:s.outcome})]}),e.jsx("time",{title:k(s.ts),children:j(s.ts)})]},s.id))})]})}function Q({events:a,limit:i=3,compact:d=!1}){const r=a.slice(0,i);return r.length===0?null:e.jsx("ol",{className:`s-thread-motion-events${d?" s-thread-motion-events--compact":""}`,"aria-label":"Latest run activity",children:r.map(l=>e.jsxs("li",{children:[e.jsx("span",{className:"s-thread-motion-event-kind",children:L(l.kind)}),e.jsx("span",{className:"s-thread-motion-event-summary",children:_(l)??"Activity recorded"}),e.jsx("time",{title:k(l.ts),children:j(l.ts)})]},l.id))})}function He(){const a=D();return e.jsx(F,{features:J,strict:!0,children:e.jsxs(p.section,{className:"s-thread-skeleton","aria-busy":"true","aria-live":"polite",initial:a?!1:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:[.2,.7,.3,1]},children:[e.jsxs("div",{className:"s-thread-skeleton-intro",role:"status",children:[e.jsxs("div",{className:"s-thread-loader-mark","aria-hidden":"true",children:[e.jsx(p.span,{className:"s-thread-loader-orbit",animate:a?void 0:{rotate:360},transition:{duration:3.2,ease:"linear",repeat:1/0},children:e.jsx("span",{})}),e.jsx(p.span,{className:"s-thread-loader-core",animate:a?void 0:{scale:[.88,1,.88],opacity:[.58,1,.58]},transition:{duration:1.8,ease:"easeInOut",repeat:1/0}})]}),e.jsxs("span",{className:"s-thread-skeleton-copy",children:[e.jsx("strong",{children:"Composer ready"}),e.jsx("span",{children:"Gathering the conversation…"})]})]}),e.jsx("div",{className:"s-thread-skeleton-turns","aria-hidden":"true",children:G.map((i,d)=>e.jsxs(p.div,{className:"s-thread-skeleton-turn",initial:a?!1:{opacity:0,y:7},animate:{opacity:1,y:0},transition:{delay:a?0:.05+d*.055,duration:.24,ease:[.2,.7,.3,1]},children:[e.jsx("span",{className:"s-thread-skeleton-avatar"}),e.jsxs("div",{className:"s-thread-skeleton-lines",children:[e.jsx("span",{className:"s-thread-skeleton-line s-thread-skeleton-line--head",style:{width:i.head}}),e.jsx("span",{className:"s-thread-skeleton-line",style:{width:i.body}}),e.jsx("span",{className:"s-thread-skeleton-line s-thread-skeleton-line--short",style:{width:i.short}})]})]},`${i.head}-${i.body}`))})]})})}function Ke({sessions:a,activeConversationId:i,needsYouIds:d,lastViewed:r,navigate:l}){const o=a.filter(n=>d.has(n.id)||n.agentId&&d.has(n.agentId)),s=x.useMemo(()=>S(a),[a]);return e.jsx("aside",{className:"s-thread-rail",children:e.jsxs("div",{className:"s-thread-rail-scroll",children:[o.length>0&&e.jsxs("div",{className:"s-thread-rail-section s-thread-rail-section--needs-you",children:[e.jsx("div",{className:"s-thread-rail-section-label",children:"Needs you"}),o.map(n=>e.jsx(g,{session:n,active:n.id===i,unread:y(n.lastMessageAt,n.id,r),needsYou:!0,navigate:l},`needs-${n.id}`))]}),s.map(n=>e.jsxs("div",{className:"s-thread-rail-section",children:[e.jsx("div",{className:"s-thread-rail-section-label",children:n.workspace}),n.sessions.map(c=>e.jsx(g,{session:c,active:c.id===i,unread:y(c.lastMessageAt,c.id,r),needsYou:!1,navigate:l},c.id))]},n.workspace))]})})}function Ge({sessionMeta:a,agents:i,flights:d,conversationId:r,navigate:l,route:o}){const s=x.useMemo(()=>a?a.participantIds.filter(t=>t!=="operator").map(t=>R(i,[t])).filter(t=>t!==null):[],[a,i]),n={id:"operator",name:"You",handle:"operator",activity:null,state:"ready",agent:null},c=x.useMemo(()=>s.map(t=>({id:t.id,name:t.name,handle:w(t)??E(t.id)??t.id,activity:$(t,d,r),state:W(t.state),agent:t})),[s,d,r]),h=[n,...c];return e.jsxs("aside",{className:"s-thread-sidebar",children:[e.jsxs("div",{className:"s-thread-sidebar-section",children:[e.jsx("div",{className:"s-thread-sidebar-label",children:"In this conversation"}),h.map(t=>{const m=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"28px",background:b(t.name)},children:t.name[0]?.toUpperCase()??"?"}),e.jsxs("div",{className:"s-thread-sidebar-participant-info",children:[e.jsx("span",{className:"s-thread-sidebar-participant-name",children:t.name}),e.jsxs("span",{className:"s-thread-sidebar-participant-handle",children:["@",t.handle]})]}),e.jsx("div",{className:"s-thread-sidebar-participant-activity",children:t.activity?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-thread-sidebar-activity-dot s-thread-sidebar-activity-dot--pulse",style:{background:"var(--green)"}}),e.jsx("span",{className:"s-thread-sidebar-activity-label",children:t.activity})]}):B(t.state)||t.id==="operator"?e.jsx("span",{className:"s-thread-sidebar-activity-dot",style:{background:z(t.state)}}):e.jsx("span",{className:"s-thread-sidebar-activity-dot",style:{background:"var(--dim)"}})})]});return t.agent?e.jsx("button",{type:"button",className:"s-thread-sidebar-participant s-thread-sidebar-participant--clickable",onClick:()=>f(l,{view:"agents-v2",agentId:t.agent.id},{returnTo:o}),title:`Open ${t.name} profile`,children:m},t.id):e.jsx("div",{className:"s-thread-sidebar-participant",children:m},t.id)})]}),c.length>0&&e.jsxs("div",{className:"s-thread-sidebar-section",children:[e.jsx("div",{className:"s-thread-sidebar-label",children:"Conversation mesh"}),e.jsx(V,{participants:c})]})]})}function Je({agentName:a,title:i,detail:d,snapshot:r,events:l,steps:o,phase:s,tone:n,workspaceName:c,branch:h,startedAt:t,onOpenTrace:m,onOpenTerminal:A,onSteer:C}){const T=t?j(t):"now";return e.jsxs("section",{className:`s-thread-motion-panel s-thread-motion-panel--${n}`,"aria-live":"polite",children:[e.jsxs("div",{className:"s-thread-motion-head",children:[e.jsx("div",{className:"s-thread-motion-beacon","aria-hidden":"true",children:e.jsx("span",{})}),e.jsxs("div",{className:"s-thread-motion-title-block",children:[e.jsx("div",{className:"s-thread-motion-kicker",children:"Currently working"}),e.jsx("h2",{children:i}),e.jsx("p",{children:d})]})]}),e.jsx("div",{className:"s-thread-motion-meter","aria-hidden":"true",children:X.map((u,v)=>e.jsx("span",{style:{"--bar-height":`${u}%`,"--bar-delay":`${v*74}ms`}},`${u}-${v}`))}),e.jsxs("dl",{className:"s-thread-motion-stats",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Session"}),e.jsx("dd",{children:T})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Activity"}),e.jsx("dd",{children:r.activityLabel})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Last"}),e.jsx("dd",{children:r.lastActivityLabel})]})]}),e.jsxs("div",{className:"s-thread-motion-latest",children:[e.jsx("span",{children:a}),e.jsx("strong",{children:r.latest})]}),o.length>0?e.jsx(N,{steps:o,phase:null,limit:6}):l.length>0?e.jsx(Q,{events:l,limit:4}):s?e.jsx(N,{steps:o,phase:s,limit:6}):e.jsxs("div",{className:"s-thread-motion-waiting",children:[e.jsx("span",{children:"Session created"}),e.jsx("strong",{children:"waiting for the first trace event"})]}),(c||h)&&e.jsxs("div",{className:"s-thread-motion-chips",children:[c&&e.jsx("span",{children:c}),h&&e.jsx("span",{children:h})]}),e.jsx(Y,{onOpenTrace:m,onOpenTerminal:A,onSteer:C})]})}function g({session:a,active:i,unread:d,needsYou:r,navigate:l}){const{route:o}=U(),s=I(a),n=(a.agentName??s)[0]?.toUpperCase()??"?",c=a.kind==="direct",h=P(a.workspaceRoot)??a.kind;return e.jsxs("button",{type:"button",className:["s-thread-rail-item",i&&"s-thread-rail-item--active",r&&"s-thread-rail-item--needs-you"].filter(Boolean).join(" "),onClick:()=>f(l,{view:"conversation",conversationId:a.id},{returnTo:o}),children:[c?e.jsx("div",{className:"s-thread-rail-avatar",style:{background:b(a.agentName??s)},children:n}):e.jsx("div",{className:"s-thread-rail-avatar s-thread-rail-avatar--channel",children:"#"}),e.jsxs("div",{className:"s-thread-rail-body",children:[e.jsx("span",{className:"s-thread-rail-name",children:s}),e.jsx("span",{className:"s-thread-rail-sub",children:h})]}),e.jsxs("div",{className:"s-thread-rail-trailing",children:[d&&!r&&e.jsx("span",{className:"s-thread-rail-presence-dot",style:{background:"var(--accent)"}}),r&&e.jsx("span",{className:"s-thread-rail-badge s-thread-rail-badge--amber",children:"!"})]})]})}function V({participants:a}){const o=a.map((s,n)=>{const c=2*Math.PI*n/a.length-Math.PI/2;return{...s,x:130+55*Math.cos(c),y:80+55*Math.sin(c)}});return e.jsx("div",{className:"s-thread-mini-mesh",children:e.jsxs("svg",{viewBox:"0 0 260 160","aria-label":"Conversation participant mesh",children:[o.map(s=>e.jsx("line",{x1:130,y1:80,x2:s.x,y2:s.y,className:"s-thread-mini-mesh-edge"},`edge-${s.id}`)),e.jsx("circle",{cx:130,cy:80,r:16,className:"s-thread-mini-mesh-node s-thread-mini-mesh-node--center"}),e.jsx("text",{x:130,y:80,className:"s-thread-mini-mesh-label s-thread-mini-mesh-label--center",children:"OP"}),o.map(s=>e.jsxs("g",{children:[e.jsx("circle",{cx:s.x,cy:s.y,r:16,className:"s-thread-mini-mesh-node",style:s.state==="in_turn"||s.state==="in_flight"?{stroke:"var(--green)"}:void 0}),e.jsx("text",{x:s.x,y:s.y,className:"s-thread-mini-mesh-label",children:s.name.slice(0,3).toUpperCase()})]},`node-${s.id}`))]})})}const X=[42,76,54,88,34,66,92,48,72,38,84,58];export{Ke as ChannelRail,Ge as PresenceSidebar,He as ThreadLoadingSkeleton,Je as ThreadMotionPanel,Y as WorkingTurnActions,Q as WorkingTurnActivityPreview,N as WorkingTurnSteps};
|
package/dist/client/assets/{ConversationScreen-Br0QQ3xo.js → ConversationScreen-B3l2m3JI.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,r as a}from"./index-BZovGpDk.js";import{c as it,w as Qn,p as Ht,d as Ms,h as Vn,l as zn,f as Gn,s as Ns,g as Jn,i as Xn,j as Yn}from"./NewChatComposer-DKlNX1UA.js";import{a as K}from"./api-h5zurxmi.js";import{u as Zn}from"./MessageComposerSuggestions-qbalTne_.js";import"./runtime-picker-BXKJbLot.js";import{u as ea,C as ta}from"./ConversationComposer-CjRXFkvY.js";import"./index-DiiEQwdc.js";import{u as sa,e as na}from"./Provider-p-xuaAoE.js";import{o as aa,q as ra,x as te,y as Is,z as oa,A as be,B as ia,C as la,D as ca,E as da,c as As,S as js,F as ua,G as ma,H as ha,I as pa,J as fa,K as ga,L as ya,s as wa,M as Sa,N as ba,e as Ta,p as xa,r as Rs,O as va,P as ka,Q as Ca,R as Ma,u as Na,T as Ia,U as Aa,V as Es,W as ja,X as Ra,Y as lt,n as Ea,Z as La,_ as $a,$ as Ls,a0 as Pa,a1 as Fa,a2 as Oa,a3 as qa,a4 as $s,a5 as Da,a6 as Ps,a7 as Ba,a8 as Ha,a9 as Ua}from"./conversation-model-CHwHZNw-.js";import{u as _a}from"./sse-Bb0EOcU9.js";import{n as Vt,t as Ut,f as Fs}from"./time-Dhsh_2EG.js";import{M as Wa}from"./message-markup-DlVX-iuc.js";import{i as _t}from"./message-visibility-kJM8XcSG.js";import{b as Ka}from"./router-63XV_E7f.js";import{f as Qa}from"./scoutbot-BTIErYHo.js";import{s as Va}from"./sessionRead-CvFz2RHv.js";import{o as ct}from"./openContent-C6XO6kr5.js";import{u as za}from"./ContextMenu-DnFcmfMR.js";import{c as Be}from"./clipboard-e3fSpeo7.js";import{A as Wt}from"./AgentAvatar-CneOa70z.js";import{d as Ga}from"./types-B0PlfpKc.js";/* empty css */import{ConversationHeader as Ja,ConversationIdentityRow as Xa,AddParticipantForm as Ya}from"./ConversationHeader-CRmdtuL7.js";import{FanOutRow as Za,ThreadDayDivider as er}from"./ConversationFeedRows-CgRTIpAv.js";import{ThreadLoadingSkeleton as tr,ThreadMotionPanel as sr,WorkingTurnSteps as nr,WorkingTurnActivityPreview as ar,WorkingTurnActions as rr}from"./ConversationPanels-DCkcLIHk.js";import{g as or,c as ir,d as lr,e as cr,f as dr}from"./tail-display-BRcJltQa.js";import{u as ur}from"./tail-events-C12pfUax.js";import{PinnedAskCard as mr,ConversationStatusStrip as hr}from"./ConversationStatus-BJ1CMbAv.js";import"./HarnessMark-DrE57dUq.js";import"./colors-BtO5_zlx.js";import"./NewChatOrigin-DXPvX-hh.js";import"./keyboard-nav-CHo_xmjw.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-CrGUKNRv.js";import"./createLucideIcon-DCq_3fQn.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./loader-circle-B-l2Wj3-.js";import"./file-text-BITQqGtF.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./surface-activity-B1rgWB1i.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./index-BWHgHrtv.js";import"./mentions-BjXfeF7t.js";import"./AgentDetailCard-Dtc02KUO.js";import"./AgentLiveActions-DwScaVRF.js";import"./terminal-takeover--05EYhJm.js";import"./eye-DkU59kfl.js";import"./terminal-xGf_F3y7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";import"./BackToPicker-D6WgIDb-.js";import"./use-reduced-motion-C8cWvIZ3.js";import"./activity-DS0u0Itf.js";import"./message-circle-BwVx5X0q.js";import"./lane-edit-display-C_Aujldz.js";const pr=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)(?:$|[?#])/iu,fr=/\bhttps?:\/\/[^\s<>"')\]]+/giu;function He(s){if(typeof s!="string")return null;try{const i=new URL(s.trim());return i.protocol==="http:"||i.protocol==="https:"?i.toString():null}catch{return null}}function V(s,i){const d=s?.[i];return typeof d=="string"&&d.trim()?d.trim():null}function gr(s){return s.mediaType.toLowerCase().startsWith("image/")}function yr(s){return pr.test(s)}function wr(s){try{const i=new URL(s),d=[i.pathname==="/"?"":i.pathname,i.search].join("").trim();return{host:i.hostname.replace(/^www\./iu,""),detail:d||i.hostname}}catch{return{host:s,detail:s}}}function Sr(s){const i=new Set,d=[];for(const h of s.matchAll(fr)){const u=h[0]?.replace(/[.,;:!?]+$/u,""),v=He(u);!v||i.has(v)||(i.add(v),d.push(v))}return d}const br=/^\/api\/blobs\/[^/]+$/u;function Kt(s){try{const i=new URL(s);return br.test(i.pathname)?`${i.pathname}${i.search}`:s}catch{return s}}function ut(s){return He(s.url)??He(V(s.metadata,"url"))??He(V(s.metadata,"href"))}function Tr(s){const i=s.metadata??null,d=V(i,"kind")??V(i,"type"),h=ut(s);if(!h||d!=="link_preview"&&d!=="link-preview"&&s.mediaType!=="text/x-uri")return null;const u=wr(h);return{id:s.id,url:h,title:V(i,"title")??u.host,description:V(i,"description"),imageUrl:He(V(i,"imageUrl")??V(i,"image")),siteName:V(i,"siteName")??u.host}}function xr({src:s,alt:i}){const[d,h]=a.useState(!1);return d?o.jsxs("a",{className:"s-message-embed s-message-embed--file",href:s,target:"_blank",rel:"noreferrer",children:[o.jsx("span",{className:"s-message-embed-title",children:i}),o.jsx("span",{className:"s-message-embed-description",children:"Preview unavailable"})]}):o.jsx("a",{className:"s-message-embed s-message-embed--image",href:s,target:"_blank",rel:"noreferrer",children:o.jsx("img",{src:s,alt:i,loading:"lazy",decoding:"async",onError:()=>h(!0)})})}function vr({preview:s}){return o.jsxs("a",{className:"s-message-embed s-message-embed--link",href:s.url,target:"_blank",rel:"noreferrer",children:[s.imageUrl&&o.jsx("span",{className:"s-message-embed-thumb",children:o.jsx("img",{src:s.imageUrl,alt:"",loading:"lazy",decoding:"async"})}),o.jsxs("span",{className:"s-message-embed-copy",children:[s.siteName&&o.jsx("span",{className:"s-message-embed-site",children:s.siteName}),o.jsx("span",{className:"s-message-embed-title",children:s.title}),s.description&&o.jsx("span",{className:"s-message-embed-description",children:s.description})]})]})}function kr({message:s}){const i=s.attachments??[],d=new Set,h=[],u=[];for(const m of i){const I=ut(m);if(I&&gr(m)){d.add(m.id),h.push({id:m.id,src:Kt(I),alt:m.fileName??"Image attachment"});continue}const T=Tr(m);T&&(d.add(m.id),u.push(T))}const v=new Set(u.map(m=>m.url)),O=new Set(i.map(ut).filter(m=>!!m));for(const m of Sr(s.body))O.has(m)||v.has(m)||yr(m)&&h.push({id:m,src:Kt(m),alt:"Embedded image"});const f=i.filter(m=>!d.has(m.id));return h.length===0&&u.length===0&&f.length===0?null:o.jsxs("div",{className:"s-message-embeds",children:[h.map(m=>o.jsx(xr,{src:m.src,alt:m.alt},m.id)),u.slice(0,1).map(m=>o.jsx(vr,{preview:m},m.id)),f.map(m=>{const I=ut(m),T=I?Kt(I):null,p=m.fileName??V(m.metadata,"title")??m.mediaType;return T?o.jsxs("a",{className:"s-message-embed s-message-embed--file",href:T,target:"_blank",rel:"noreferrer",children:[o.jsx("span",{className:"s-message-embed-title",children:p}),o.jsx("span",{className:"s-message-embed-description",children:m.mediaType})]},m.id):o.jsxs("div",{className:"s-message-embed s-message-embed--file",children:[o.jsx("span",{className:"s-message-embed-title",children:p}),o.jsx("span",{className:"s-message-embed-description",children:m.mediaType})]},m.id)})]})}const zt=60;function dt(s,i,d){const h=d?.trim();if(!h)return;const u=h.toLowerCase();i.has(u)||(i.add(u),s.push(h))}function Cr(s){const i=[],d=new Set;dt(i,d,s.observeSessionId);for(const h of s.flight?.sessions??[])dt(i,d,h.sessionId);return dt(i,d,s.agent?.harnessSessionId),dt(i,d,s.sessionMeta?.harnessSessionId),i}function Os(s,i){const d=s.sessionId?.trim().toLowerCase();return d?i.some(h=>{const u=h.trim().toLowerCase();return u?d.includes(u)||u.includes(d):!1}):!1}function _s(s,i){return s.ts!==i.ts?s.ts-i.ts:s.id.localeCompare(i.id)}function qs(s,i){const d=new Map;for(const h of[...s,...i])d.set(h.id,h);return[...d.values()].sort(_s).slice(-zt)}function Mr(s){const i=or(s).sort(_s),d=ir(i.map(u=>({event:u,meta:lr(u)}))),h=[];for(const u of d){if(u.event.kind==="other")continue;if(u.event.kind==="tool-result"){const m=h.at(-1);m?.kind==="tool"&&(m.outcome=u.meta.result?.outcome??m.outcome??"done",m.ts=u.event.ts);continue}const v=Nr(u.event),O=Ir(u.event,cr(u.event,u.meta),v);if(!O&&v!=="think")continue;const f={id:u.event.id,ts:u.event.ts,kind:v,text:O,repeatCount:u.repeatCount};u.meta.tool&&(f.tool=u.meta.tool),u.meta.arg&&(f.arg=mt(u.meta.arg)),u.meta.result?.outcome&&(f.outcome=u.meta.result.outcome),h.push(f)}return h}const Ds=160;function mt(s){const i=s.replace(/\s+/gu," ").trim();return i.length>Ds?`${i.slice(0,Ds-1)}…`:i}const Ws=/^\[thinking\]\s*$/iu;function Nr(s){return Ws.test(s.summary.trim())?"think":dr(s)}function Ir(s,i,d){return d==="think"&&Ws.test(s.summary.trim())?"":mt(i)}const Ar=15e3;function jr(s){const i=s?.outcome;return typeof i=="string"&&i.trim()?i.trim():void 0}function Rr(s){const{observe:i,flight:d}=s;if(!i||!d)return[];const h=i.data.events.filter(f=>f.kind!=="boot"&&f.kind!=="system");if(h.length===0)return[];const u=Vt(d.startedAt),v=u!==null?h.filter(f=>typeof f.at=="number"&&f.at>=u-Ar):[];return(v.length>0?v:i.data.live?h:[]).slice(-zt).map(f=>{const m={id:`observe:${i.sessionId??"session"}:${f.id}`,ts:f.at??f.t,kind:f.kind,text:mt(f.text||f.tool||"step"),repeatCount:1};f.tool&&(m.tool=f.tool),f.arg&&(m.arg=mt(f.arg));const I=jr(f.result);return I&&(m.outcome=I),f.diff&&(m.outcome=`+${f.diff.add} −${f.diff.del}`),m})}function Er(s){const i=s.at(-1);return i?i.tool?i.arg?`${i.tool} · ${i.arg}`:i.tool:i.kind==="think"?i.text||"Thinking":i.text||null:null}function Lr(s){if(s.length===0)return null;const i=s.filter(u=>u.kind==="tool").length,d=s.filter(u=>u.kind==="think").length,h=[];return i>0&&h.push(`${i} tool${i===1?"":"s"}`),d>0&&h.push(`${d} thinking`),h.length===0?`${s.length} step${s.length===1?"":"s"}`:h.join(" · ")}function $r(s){const i=s.flight?.state;return i==="queued"?{label:"Queued",detail:"waiting for the session to come online"}:i==="waking"?{label:"Waking",detail:"starting the session"}:i==="running"||i==="waiting"?s.hasSessionScope?{label:"Session live",detail:"waiting for the first trace line"}:{label:"Session live",detail:"no trace stream for this session yet"}:s.awaitingResponse?{label:"Sent",detail:"waiting for the agent to pick this up"}:null}function Pr(s){const{sessionIds:i,active:d}=s,h=i.join("|"),u=d&&i.length>0,[v,O]=a.useState([]);return a.useEffect(()=>{O([])},[h]),a.useEffect(()=>{if(!u)return;let f=!1;const m=new URLSearchParams({limit:String(zt*3),transcripts:"true"});return K(`/api/tail/recent?${m.toString()}`).then(I=>{if(f)return;const T=(I.events??[]).filter(p=>Os(p,i));T.length!==0&&O(p=>qs(p,T))}).catch(()=>{}),()=>{f=!0}},[u,h]),ur(f=>{u&&Os(f,i)&&O(m=>qs(m,[f]))},u),a.useMemo(()=>u?Mr(v):[],[u,v])}const Fr=3500;function Bs(s){const i=s?.trim().replace(/^#/,"");if(!i?.startsWith("msg-"))return null;const d=i.slice(4).trim();if(!d)return null;try{return decodeURIComponent(d)}catch{return d}}const Or=64;function qr(s){const i=s?.clientMessageId;return typeof i=="string"&&i.trim()?i.trim():null}function Hs(s){const i=s.body.replace(/\s+/gu," ").trim();if(i)return i.length>180?`${i.slice(0,179).trimEnd()}…`:i;const d=s.attachments?.length??0;return d===1?"Attachment":d>1?`${d} attachments`:"Message"}function Us(s,i){const d=s.toLocaleLowerCase().indexOf(i.toLocaleLowerCase());if(d<0)return s;const h=s.slice(0,d),u=s.slice(d+i.length);return!h&&u.startsWith(" ")?u.slice(1):h.endsWith(" ")&&u.startsWith(" ")?`${h}${u.slice(1)}`:`${h}${u}`}function Dr(s){return s instanceof TypeError||typeof DOMException<"u"&&s instanceof DOMException&&s.name==="AbortError"}function ei({conversationId:s,initialDraft:i,navigate:d,embedded:h,showBackNav:u=!0,treatment:v="standard"}){const{agents:O,route:f,openContextCapture:m}=sa(),I=Ka(f),T=a.useMemo(()=>na(O,I),[O,I]),[p,ht]=a.useState(null),Gt=a.useRef(null);Gt.current=p;const Ue=a.useMemo(()=>it(s),[s]),[Ks,Qs]=a.useState(()=>Ue?{[s]:Ue}:{}),k=Ks[s]??Ue??[],[Vs,Jt]=a.useState(()=>Ue!==null),Te=a.useRef(null),zs=a.useMemo(()=>{const t=Te.current;return t===null?null:new Set(k.filter(e=>!t.has(e.id)).map(e=>e.id))},[k]),Xt=Te.current===null&&k.length>0;a.useEffect(()=>{if(k.length===0)return;const t=Te.current??new Set;for(const e of k)t.add(e.id);Te.current=t},[k]),a.useEffect(()=>{Te.current=null,Jt(it(s)!==null)},[s]);const Yt=!Vs&&k.length===0,z=a.useCallback(t=>{Qs(e=>{const n=e[s]??it(s)??[],r=typeof t=="function"?t(n):t,l=Qn(s,r);return{...e,[s]:l}})},[s]),Gs=Ht(s),[w,he]=a.useState(Gs),[xe,ve]=a.useState([]),[_e,pt]=a.useState(null),[We,ke]=a.useState(null),[Ke,Js]=a.useState(()=>typeof window>"u"?null:Bs(window.location.hash)),[Zt,pe]=a.useState(null),[fe,ft]=a.useState(!1),[Xs,Ce]=a.useState(!1),[gt,Qe]=a.useState(0),Ve=a.useRef(null),Me=a.useRef(null),es=a.useRef(null),Ne=a.useRef(!0),ze=a.useRef(!1),ge=a.useRef(null),L=a.useRef(null),Ie=a.useRef(new Set),Ae=a.useRef(null),ts=a.useRef(0),ss=a.useRef(null),je=a.useRef(null),se=a.useRef(s);se.current=s;const ne=a.useRef(new Map),Ys=Ms(s),Ge=a.useRef(!1);a.useLayoutEffect(()=>{const t=Me.current,e=Ve.current;!t||!e||(e.scrollTop=t.scrollTop+(e.scrollHeight-t.scrollHeight),Me.current=null,Ge.current=!0)}),a.useEffect(()=>{ft(!1),Me.current=null,Ge.current=!1,Ne.current=!0,ze.current=!1,Ce(!1),Qe(0),Lt(new Set),ne.current.clear(),he(Ht(s))},[s]);const x=p?.agentId??null,N=p?.kind==="direct",yt=a.useMemo(()=>new Set([s,...p?.equivalentConversationIds??[]]),[s,p?.equivalentConversationIds]),Q=a.useMemo(()=>x?T.find(t=>t.id===x)??null:null,[T,x]),ns=aa(p),Zs=ra({resolvedAgentId:Q?.id,sessionId:ns,machineId:I}),[as,rs]=a.useState(null);a.useEffect(()=>{K("/api/fleet").then(t=>{rs(e=>te(e,Is(t.activeAsks,s,x)))}).catch(()=>{})},[s,x]);const H=a.useCallback(async(t={})=>{const e=t.messageMode??"none",n=t.includeMetadata??!0;pe(null);try{const r=n?await K(`/api/session/${encodeURIComponent(s)}`).catch(()=>null):Gt.current;if(se.current!==s)return;ht(M=>te(M,r));const l=r?.agentId??null,c=r?.id&&r.id!==s?r.id:s;if(c!==s){d({view:"conversation",conversationId:c});return}const g=it(c),R=Vn(c),S=e==="initial"&&!R,y=e==="refresh"||e==="initial",[b,U,E]=await Promise.all([S?zn(c):y?Gn(c,{refresh:!0}):Promise.resolve(g),K(`/api/flights?conversationId=${encodeURIComponent(c)}`),K("/api/fleet?limit=24&activityLimit=160").catch(()=>oa())]);if(se.current!==s)return;const Z=be(b??[]),D=Z.filter(M=>!_t(M));b&&z(M=>te(M,ia(M,D))),Jt(!0),Va(c);const _=Z.at(-1);_&&je.current!==_.id&&(je.current=_.id,K(`/api/conversations/${encodeURIComponent(c)}/read-cursor`,{method:"POST",body:JSON.stringify({lastReadMessageId:_.id})}).catch(()=>{je.current===_.id&&(je.current=null)}));const W=la(U),B=Ht(c),ee=W??B;Ie.current=new Set([...U.map(M=>M.invocationId),...B?.invocationId?.startsWith("pending:")?[]:B?.invocationId?[B.invocationId]:[]]),W&&B?.id===W.id&&Ns(c,W.id);const rt=ee?.agentId??l??null,$=ca(E.activity,ee,c,rt),ot=da(E.activeAsks,ee,c,rt);he(M=>te(M,ee)),ve(M=>te(M,$)),ke(M=>te(M,ot)),rs(M=>te(M,Is(E.activeAsks,c,l)))}catch(r){if(se.current!==s)return;pe(r instanceof Error?r.message:String(r))}},[s,d,z]);a.useEffect(()=>{H({messageMode:"initial"})},[H]),a.useEffect(()=>{je.current=null},[s]),a.useEffect(()=>{Ae.current=w},[w]);const en=a.useCallback(async()=>{if(fe||!Ms(s))return;const t=Ve.current,e=t?{scrollHeight:t.scrollHeight,scrollTop:t.scrollTop}:null;ft(!0),pe(null);try{const n=await Jn(s);if(se.current!==s)return;e&&(Me.current=e),z(be(n).filter(r=>!_t(r)))}catch(n){se.current===s&&pe(n instanceof Error?n.message:String(n))}finally{se.current===s&&ft(!1)}},[s,fe,z]),[A,q]=a.useState(()=>i??""),[ae,re]=a.useState(null),[G,Je]=a.useState(!1),[C,tn]=a.useState("operator"),[oe,Re]=a.useState({open:!1,query:"",triggerStart:-1,index:0}),[ie,Ee]=a.useState({open:!1,query:"",triggerStart:-1,index:0}),[P,J]=a.useState(null),[wt,Xe]=a.useState(!1),[St,Ye]=a.useState(""),[sn,Le]=a.useState(null),[nn,bt]=a.useState(!1);a.useEffect(()=>{Xe(!1),Ye(""),Le(null),bt(!1)},[s]),a.useEffect(()=>{if(!i)return;const t=`${s}:${i}`;ss.current!==t&&(ss.current=t,q(i),requestAnimationFrame(()=>L.current?.focus()))},[s,i]);const le=a.useMemo(()=>{const t=new Map;for(const e of p?.participants??[])t.set(e.actorId,e),e.agentId&&t.set(e.agentId,e);return t},[p]),Tt=a.useMemo(()=>{const t=new Set,e=[];for(const n of p?.participantIds??[]){if(n==="operator")continue;const r=le.get(n),l=r?.scopedAlias?.trim().replace(/^@+/,"");if(!l)continue;const c=l.toLowerCase();t.has(c)||(t.add(c),e.push({id:n,label:r?.label??r?.displayName??l,name:r?.displayName??l,handle:l}))}for(const n of T){const r=n.handle?.trim().replace(/^@+/,"")??As(n.id)??n.id;if(!r)continue;const l=r.toLowerCase();t.has(l)||(t.add(l),e.push({id:n.id,label:r,name:n.name??r,handle:r}))}return e.sort((n,r)=>n.handle.localeCompare(r.handle))},[le,T,p]),an=a.useMemo(()=>{if(!oe.open)return[];const t=oe.query.toLowerCase();return t?js.filter(e=>e.command.toLowerCase().startsWith("/"+t)||e.command.toLowerCase().includes(t)):js},[oe.open,oe.query]),rn=a.useMemo(()=>{if(!ie.open)return[];const t=ie.query.toLowerCase();return t?Tt.filter(e=>e.handle.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)).slice(0,8):Tt.slice(0,8)},[ie.open,ie.query,Tt]),on=a.useCallback(()=>{Re(t=>t.open?{...t,open:!1}:t),Ee(t=>t.open?{...t,open:!1}:t)},[]),ln=a.useCallback((t,e)=>{const n=ua(t,e);Re(n?l=>({open:!0,query:n.query,triggerStart:n.start,index:l.open&&l.triggerStart===n.start?l.index:0}):l=>l.open?{...l,open:!1}:l);const r=ma(t,e);Ee(r?l=>({open:!0,query:r.query,triggerStart:r.start,index:l.open&&l.triggerStart===r.start?l.index:0}):l=>l.open?{...l,open:!1}:l)},[]),cn=a.useCallback(t=>{const e=L.current,n=oe.triggerStart;if(n<0)return;const r=e?.selectionStart??A.length,l=A.slice(0,n),c=A.slice(r),g=t.insert,R=`${l}${g}${c}`;q(R),Re(S=>({...S,open:!1})),requestAnimationFrame(()=>{const S=L.current;if(!S)return;const y=l.length+g.length;S.focus(),S.setSelectionRange(y,y)})},[A,oe.triggerStart]),dn=a.useCallback(t=>{const e=L.current,n=ie.triggerStart;if(n<0)return;const r=e?.selectionStart??A.length,l=A.slice(0,n),c=A.slice(r),g=c.length===0||!c.startsWith(" "),R=`@${t.handle}${g?" ":""}`,S=`${l}${R}${c}`;q(S),Ee(y=>({...y,open:!1})),requestAnimationFrame(()=>{const y=L.current;if(!y)return;const b=l.length+R.length;y.focus(),y.setSelectionRange(b,b)})},[A,ie.triggerStart]);a.useEffect(()=>{const t=L.current;if(!t)return;t.style.height="0px";const e=Math.min(Math.max(t.scrollHeight,40),160);t.style.height=`${e}px`,t.style.overflowY=t.scrollHeight>e?"auto":"hidden"},[A]),a.useEffect(()=>{K("/api/user").then(t=>tn(t.name)).catch(()=>{})},[]);const Ze=a.useMemo(()=>ha(k,C),[k,C]);a.useEffect(()=>{P===null||Ze===null||Ze>=P&&J(null)},[P,Ze]);const un=a.useMemo(()=>pa(w),[w]),ye=Date.now(),mn=fa(w,Ze,ye),xt=un&&!ga(w)&&!mn,os=N&&(G||P!==null||xt),is=N&&ya({sending:G,awaitingResponse:P!==null,currentFlight:w}),F=wa({name:Q?.name,agentName:p?.agentName,id:x,title:p?.title}),j=a.useMemo(()=>N?Sa({agentName:F,agentState:Q?.state??null,sending:G,currentFlight:w,showWorkingTurn:xt,awaitingResponse:P!==null}):{label:"Open",detail:"",tone:"idle",showStrip:!1,showTyping:!1},[Q?.state,F,P,w,ye,N,G,xt]),vt=w?.startedAt??We?.startedAt??P,kt=Vt(vt),ls=Da(vt,ye),[,hn]=a.useState(0);a.useEffect(()=>{if(!j.showTyping||kt===null)return;const t=Math.max(0,Date.now()-kt),e=[$s.sustained,$s.long].find(r=>r>t);if(e===void 0)return;const n=window.setTimeout(()=>hn(r=>r+1),e-t+50);return()=>window.clearTimeout(n)},[kt,j.showTyping,ls]);const pn="Live",Ct=a.useMemo(()=>ba({currentFlight:w,presence:j,turnActivity:xe,turnAsk:We,awaitingResponseSince:P,nowMs:ye}),[P,w,ye,j,xe,We]),fn="s-thread-msg-card s-thread-msg-working-card s-thread-msg-card--avatar-row",gn="s-thread-msg-kind",yn="s-thread-turn-snapshot",wn="s-thread-turn-snapshot-pulse",Sn="s-thread-presence-line",bn=["s-thread-presence-strip",`s-thread-presence-strip--${ls}`].filter(Boolean).join(" "),Mt=p?Ta(p):F,cs=p?.id??s,Tn=p?.alias?.trim()||null,et=xa(p?.workspaceRoot),xn=j.tone,Nt=k.length===0&&N&&(j.showTyping||w!==null||xe.length>0||We!==null||P!==null),ds=a.useMemo(()=>p?p.participantIds.includes("operator"):N,[N,p]),$e=w?.agentId??x,Pe=$e?Rs(T,[$e]):null,Fe=Pe?.id??$e,Oe=w?.sessions.at(-1)?.sessionId??Pe?.harnessSessionId??void 0,us=w?.id?()=>{ct(d,{view:"sessions",flightId:w.id,...Fe?{agentId:Fe}:{},...Oe?{sessionId:Oe}:{},...I?{machineId:I}:{}},{returnTo:f})}:void 0,ms=w?.id??null;a.useEffect(()=>{if(!ms||!Fe){pt(null);return}let t=!1;const e=Oe?`?sessionId=${encodeURIComponent(Oe)}`:"",n=async()=>{try{const l=await K(`/api/agents/${encodeURIComponent(Fe)}/observe${e}`);if(t)return;pt(c=>te(c,l))}catch{}};n();const r=window.setInterval(()=>{n()},Fr);return()=>{t=!0,window.clearInterval(r),pt(null)}},[ms,Fe,Oe]);const It=a.useMemo(()=>Cr({flight:w,agent:Pe??Q,sessionMeta:p,observeSessionId:_e?.sessionId}),[Q,w,p,_e?.sessionId,Pe]),hs=Pr({sessionIds:It,active:j.showTyping||Nt}),vn=a.useMemo(()=>Rr({observe:_e,flight:w}),[w,_e]),X=hs.length>0?hs:vn,At=a.useMemo(()=>X.length>0?null:$r({flight:w,hasSessionScope:It.length>0,awaitingResponse:P!==null}),[P,w,It.length,X.length]),jt=Lr(X),Rt=Er(X),ps=X.at(-1)??null,Et=ps?Ut(ps.ts,ye):null,ce=a.useMemo(()=>Rt?{...Ct,latest:Rt,...jt?{activityLabel:jt}:{},...Et?{lastActivityLabel:Et}:{}}:Ct,[Et,Rt,Ct,jt]),kn=`${F}: ${ce.latest}`,fs=$e&&va(Pe)?()=>{ct(d,{view:"terminal",agentId:$e,mode:"takeover"},{returnTo:f})}:void 0,gs=N?()=>{h&&Qa({type:"focus-composer",reason:"Steer the active conversation"})||requestAnimationFrame(()=>{L.current?.focus({preventScroll:!0}),L.current?.scrollIntoView({block:"nearest"})})}:void 0,ys=a.useMemo(()=>(p?p.participantIds.filter(e=>e!=="operator"):x?[x]:[]).map(e=>{const n=Rs(T,[e]),r=le.get(e);return{id:e,name:r?.scopedAlias??n?.name??r?.displayName??As(e)??e,title:r?.label??n?.id??e,agent:n,sessionId:r?.sessionId??null,harness:n?.harness??r?.harness??null,model:n?.model??null,reasoningEffort:n?.reasoningEffort??null}}),[x,le,T,p]),ws=ys.slice(0,4),Cn=Math.max(ys.length-ws.length,0),Mn=a.useMemo(()=>({name:C,active:ds}),[ds,C]),tt=a.useMemo(()=>new Map(k.map(t=>[t.id,t])),[k]),st=a.useMemo(()=>ka(k),[k]),[Nn,Lt]=a.useState(()=>new Set),In=a.useCallback(t=>{Lt(e=>{const n=new Set(e);return n.delete(t)||n.add(t),n})},[]),Ss=a.useMemo(()=>{const t=new Map;for(const e of st)if(e.kind==="fanout")for(const n of e.messages)t.set(n.id,e.key);return t},[st]),nt=a.useCallback(t=>{const e=Ss.get(t);e&&Lt(c=>c.has(e)?c:new Set(c).add(e));const n=document.getElementById(`msg-${t}`);if(!n)return;const r=n.closest(".s-thread-fanout")??n,l=r===n?"s-thread-msg--flash":"s-thread-fanout--flash";r.scrollIntoView({behavior:"smooth",block:"center"}),r.classList.add(l),window.setTimeout(()=>r.classList.remove(l),1200)},[Ss]);a.useEffect(()=>{const t=()=>Js(Bs(window.location.hash));return window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t)},[]),a.useEffect(()=>{if(!Ke||!tt.has(Ke))return;const t=window.setTimeout(()=>nt(Ke),50);return()=>window.clearTimeout(t)},[Ke,tt,nt]),_a(a.useCallback(t=>{if(t.kind==="message.posted"){const e=t.payload?.message;if(!e||!yt.has(e.conversationId))return;const n=e.actorId==="operator",r=N&&!n&&e.class==="agent",l={id:e.id,conversationId:e.conversationId,actorId:e.actorId,actorName:r?F:Ca(e.actorId,T,C),body:e.body,createdAt:e.createdAt,class:n?"operator":e.class,attachments:e.attachments,metadata:e.metadata,replyToMessageId:e.replyToMessageId??e.n??null};if(_t(l))return;if(z(c=>{const g=qr(e.metadata),R=g?ne.current.get(g):void 0;if(c.some(S=>S.id===e.id))return g&&ne.current.delete(g),c;if(n&&g){const S=Ma(c,g,R);if(S!==-1){const y=[...c];return y[S]=l,ne.current.delete(g),be(y)}}return be([...c,l])}),r){const c=Vt(e.createdAt)??Date.now();J(g=>g===null||c<g||Na(Ae.current)?g:null),he(g=>Ia(g)?null:g)}return}if(t.kind==="invocation.requested"){const e=t.payload?.invocation;if(!e||e.targetAgentId!==x||!e.conversationId||!yt.has(e.conversationId))return;Ie.current.add(e.id),ve([]),ke(null),J(n=>n??Date.now());return}if(t.kind==="flight.updated"){const e=t.payload?.flight;if(!e||e.targetAgentId!==x||!(Ie.current.has(e.invocationId)||Ae.current?.id===e.id))return;if(Aa.has(e.state)){Ns(s,e.id),he(c=>c?.id===e.id?null:c),ve([]),ke(null),J(null),H({messageMode:"refresh",includeMetadata:!1});return}Ie.current.add(e.invocationId);const r=Ae.current?.id===e.id,l=Es(e,s,x??"",Ae.current);ja(l)&&J(null),he(l),r||(ve([]),ke(null));return}t.kind!=="agent.endpoint.upserted"&&t.kind==="unknown"&&H({messageMode:"refresh"})},[x,F,s,yt,N,H,C,T])),a.useEffect(()=>{if(!os)return;const t=setInterval(()=>{H({messageMode:"refresh",includeMetadata:!1})},5e3);return()=>clearInterval(t)},[os,H]),a.useEffect(()=>{const t=()=>{if(document.visibilityState!=="visible")return;const e=Date.now();e-ts.current<1e3||(ts.current=e,H({messageMode:"refresh"}))};return window.addEventListener("focus",t),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",t)}},[H]);const $t=a.useRef(null),bs=a.useRef(!1),Pt=a.useRef(!1),Ft=a.useCallback(t=>{const e=es.current;e&&(ze.current=!0,ge.current!==null&&clearTimeout(ge.current),e.scrollIntoView({behavior:t}),ge.current=setTimeout(()=>{ze.current=!1,ge.current=null},t==="smooth"?700:0))},[]);a.useEffect(()=>()=>{ge.current!==null&&clearTimeout(ge.current)},[]);const An=a.useCallback(()=>{const t=Ve.current;if(!t||ze.current)return;const n=t.scrollHeight-t.clientHeight-t.scrollTop<=Or;Ne.current=n,n?(Ce(!1),Qe(0)):Ce(!0)},[]),jn=a.useCallback(()=>{Ne.current=!0,Ce(!1),Qe(0),Ft("smooth")},[Ft]);a.useEffect(()=>{const t=k.at(-1)?.id??null,e=!!(t&&t!==$t.current),n=Ra({newestMessageId:t,previousNewestMessageId:$t.current,showTyping:j.showTyping,previousShowTyping:bs.current,historyRestorePending:Ge.current||Me.current!==null,initialScrollDone:Pt.current,nearBottom:Ne.current});n!=="none"?(Ft(n),Pt.current=!0):e&&Pt.current&&!Ne.current&&(Ce(!0),Qe(r=>r+1)),Ge.current=!1,$t.current=t,bs.current=j.showTyping});const[,Rn]=a.useState(0);a.useEffect(()=>{const t=setInterval(()=>Rn(e=>e+1),15e3);return()=>clearInterval(t)},[]);const de=ea(),[ue,Y]=a.useState([]),[Ts,at]=a.useState("queue"),[we,Se]=a.useState(null),qe=async(t,e)=>{const n=t.trim(),r=e?.attachments??[],l=e?.replyTarget??null;if(!n&&r.length===0||G)return"failed";const g=e?.forceAction??Ps({isDm:N,hasOutstandingReply:is}),R=Date.now(),S=Yn(),y={id:`optimistic-${S}`,conversationId:s,actorId:"operator",actorName:C,body:n,createdAt:R,class:"operator",...l?{replyToMessageId:l.messageId}:{},metadata:{clientMessageId:S,deliveryState:"sending"},...r.length>0?{attachments:r}:{}};Je(!0),g!=="message"&&J(R),pe(null),ne.current.set(S,y.id),z(b=>be([...b,y]));try{const b=await K(`/api/chats/${encodeURIComponent(s)}/messages`,{method:"POST",body:JSON.stringify({body:n,clientMessageId:S,...l?{replyToMessageId:l.messageId}:{},...r.length>0?{attachments:r}:{}})}),U=b.chatId?.trim()??b.conversationId?.trim();if(U&&U!==s)throw new Error(`Send returned a different Chat (${U}) instead of appending to ${s}.`);if(b.messageId?.trim()){const E=b.messageId.trim();z(Z=>be(Z.map(D=>D.id===y.id?{...D,id:E,metadata:{clientMessageId:S}}:D))),ne.current.delete(S)}return b.flight?(Ie.current.add(b.flight.invocationId),he(Es(b.flight,s,x??"")),ve([]),ke(null)):g!=="message"&&J(null),"sent"}catch(b){return Dr(b)?(z(U=>U.map(E=>E.id===y.id?{...E,metadata:{...E.metadata??{},deliveryState:"unknown"}}:E)),"unknown"):(z(U=>U.filter(E=>E.id!==y.id)),ne.current.delete(S),J(null),pe(b instanceof Error?b.message:String(b)),"failed")}finally{Je(!1)}},En=async()=>{const t=A.trim(),e=ae,n=de.files,r=we?.attachments??[];if(!t&&n.length===0&&r.length===0)return null;let l=[];if(n.length>0){Je(!0);try{l=await Zn(n)}catch(c){return de.setError(c instanceof Error?c.message:String(c)),null}finally{Je(!1)}}return q(""),re(null),de.clear(),Se(null),{body:t,attachments:[...r,...l],replyTarget:e}},Ln=async()=>{const t=Ha({isAgentBusy:me,intent:Ts}),e=we?.id??null,n=await En();if(!n)return;if(t==="queue"){Y(c=>e?c.map(g=>g.id===e?{...g,body:n.body,attachments:n.attachments,replyTarget:n.replyTarget}:g):[...c,{id:`queued-${Date.now()}-${c.length}`,body:n.body,attachments:n.attachments,replyTarget:n.replyTarget,queuedAt:Date.now()}]);return}e&&Y(c=>c.filter(g=>g.id!==e));const r=()=>{q(n.body),Se(n.attachments.length>0?{id:null,attachments:n.attachments}:null),re(n.replyTarget),requestAnimationFrame(()=>L.current?.focus())};if(t==="steer"){at("queue"),await Dt(),await qe(n.body,{forceAction:"steer",attachments:n.attachments,replyTarget:n.replyTarget})==="failed"&&r();return}await qe(n.body,{attachments:n.attachments,replyTarget:n.replyTarget})==="failed"&&r()},$n=t=>{Y(e=>e.filter(n=>n.id!==t)),Se(e=>e?.id===t?null:e)},Pn=t=>{const e=ue.find(n=>n.id===t);e&&(q(e.body),re(e.replyTarget??null),Se({id:t,attachments:e.attachments}),requestAnimationFrame(()=>{const n=L.current;n&&(n.focus(),n.setSelectionRange(n.value.length,n.value.length))}))},Fn=()=>{Se(null),q(""),re(null),de.clear()},On=async t=>{const e=ue.find(r=>r.id===t);if(!e)return;Y(r=>r.filter(l=>l.id!==t)),await Dt(),await qe(e.body,{forceAction:"steer",attachments:e.attachments,replyTarget:e.replyTarget??null})==="failed"&&Y(r=>[e,...r])},Ot=a.useCallback((t,e)=>{const n=e?.trim().replace(/^@+/,"")||null,r=n?`@${n}`:null,l=ae?.insertedMention?Us(A,ae.insertedMention):A,c=!!(!N&&r&&!l.toLocaleLowerCase().includes(r.toLocaleLowerCase())),g=c&&r?l.trim()?`${l.trimEnd()} ${r} `:`${r} `:l;q(g),re({messageId:t.id,actorLabel:n?`@${n}`:t.actorName,preview:Hs(t),insertedMention:c?r:null}),requestAnimationFrame(()=>L.current?.focus())},[A,N,ae?.insertedMention]),qn=a.useCallback(()=>{const t=ae?.insertedMention;re(null),t&&q(e=>Us(e,t)),requestAnimationFrame(()=>L.current?.focus())},[ae]),qt=a.useCallback(t=>{const e=new URL(window.location.href);f.view==="agents-v2"&&e.searchParams.set("tab","message"),e.hash=`msg-${t}`,Be(e.toString())},[f.view]),xs=a.useCallback((t,e,n)=>{const r=Xn({conversationId:s,selectedMessageId:t.id,messages:k.map(l=>({id:l.id,actorLabel:l.id===t.id?e:lt(l,C)?C:l.actorName,body:l.body,attachmentCount:l.attachments?.length??0}))});m({intent:"forward-message",forwardContext:r,forwardContextMode:"selected-message",...n?{projectPath:n}:{}})},[s,k,m,C]),Dt=async()=>{if(x)try{await K("/api/agents/"+encodeURIComponent(x)+"/interrupt",{method:"POST",body:JSON.stringify({})})}catch{}},me=j.tone==="working"||j.tone==="pending",Dn=Ps({isDm:N,hasOutstandingReply:is}),Bn=N?`Message ${F} — type / to route or @ to mention an agent`:p?.kind==="channel"?`Comment in #${Ea(p)} — mention @agent to request a reply`:`Comment in ${Mt} — mention @agent to request a reply`,vs=we?.attachments??[],Hn=!A.trim()&&!de.hasFiles&&vs.length===0&&me,Bt=a.useRef(!1);a.useEffect(()=>{const t=we?.id??null,e=t?ue.filter(r=>r.id!==t):ue;if(!La({isAgentBusy:me,sending:G,queued:e})||Bt.current)return;const n=e[0];n&&(Bt.current=!0,Y(r=>r.filter(l=>l.id!==n.id)),qe(n.body,{attachments:n.attachments,replyTarget:n.replyTarget??null}).then(r=>{r==="failed"&&Y(l=>[n,...l])}).finally(()=>{Bt.current=!1}))},[me,G,ue,we]),a.useEffect(()=>{me||at("queue")},[me]),a.useEffect(()=>{Y([]),Se(null),re(null),at("queue"),de.clear()},[s]);const Un=$a(ue),ks=za(),_n=a.useCallback((t,e)=>{const n=window.getSelection()?.toString().trim(),r=lt(e,C),l=e.actorId?le.get(e.actorId):null,c=r?null:Ls(e,T,x),g=(l?.scopedAlias?.trim()||c?.handle?.trim()||null)?.replace(/^@+/,"")??null,R=g?`@${g}`:e.actorName,S=(c?.id||l?.agentId||e.actorId||"").trim(),y=[];r||y.push({kind:"action",label:"Reply",onSelect:()=>Ot(e,g)}),y.push({kind:"action",label:"Forward to new task…",onSelect:()=>xs(e,R,l?.workspaceRoot??c?.projectRoot??c?.cwd??void 0)}),y.push({kind:"separator"}),n&&y.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{Be(n)}}),y.push({kind:"action",label:"Copy Message",onSelect:()=>{Be(e.body)}}),y.push({kind:"action",label:"Copy Link",onSelect:()=>qt(e.id)}),y.push({kind:"separator"}),!r&&S&&y.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{Be(S)}}),y.push({kind:"action",label:"Copy Message ID",onSelect:()=>{Be(e.id)}}),ks(t,y)},[x,Ot,qt,xs,C,le,T,ks]),Wn=async(t,e)=>{const n=`@${e.agentId} `,r=A.trim();if(r){q(""),await qe(`${n}${r}`,{forceAction:"invoke"});return}q(n),L.current?.focus()},De=a.useMemo(()=>{if(!p)return[];const t=new Set(p.participantIds);return T.filter(e=>!t.has(e.id)&&!e.retiredFromFleet).sort((e,n)=>e.name.localeCompare(n.name))},[p,T]);a.useEffect(()=>{wt&&Ye(t=>t&&De.some(e=>e.id===t)?t:De[0]?.id??"")},[wt,De]);const Cs=!!(p&&["direct","group_direct","channel"].includes(p.kind)&&De.length>0),Kn=a.useCallback(async()=>{if(!p)return;const t=St.trim();if(t){bt(!0),Le(null);try{const e=await K(`/api/conversations/${encodeURIComponent(p.id)}/members`,{method:"POST",body:JSON.stringify({actorId:t})});e.session?ht(e.session):ht(n=>n&&{...n,kind:e.kind,participantIds:e.participantIds}),Xe(!1),Ye(""),await H({messageMode:"none"})}catch(e){Le(e instanceof Error?e.message:String(e))}finally{bt(!1)}}},[St,H,p]);return o.jsx("div",{className:`s-thread-layout${h?" s-thread-layout--embedded":""}`,"data-thread-treatment":v==="standard"?void 0:v,children:o.jsxs("div",{className:"s-thread-center",children:[!h&&o.jsx(Ja,{showBackNav:u,isDm:N,navigate:d,route:f,canonicalConversationId:cs,threadTitle:Mt,agentId:Q?.id??null,sessionId:ns,detailRoute:Zs,visibleParticipants:ws,hiddenParticipantCount:Cn,operator:Mn,canAddParticipants:Cs,onToggleAddParticipant:()=>{Le(null),Xe(t=>!t)}}),!h&&p&&o.jsx(Xa,{canonicalConversationId:cs,conversationAlias:Tn}),!h&&wt&&Cs&&o.jsx(Ya,{agents:De,addParticipantId:St,setAddParticipantId:Ye,addingParticipant:nn,addParticipantError:sn,onCancel:()=>{Xe(!1),Le(null)},onSubmit:()=>{Kn()}}),as&&o.jsx(mr,{pinnedAsk:as,onAnswer:()=>{L.current?.focus()}}),o.jsx(hr,{presence:j,agent:Q}),Zt&&o.jsx("p",{className:"s-thread-error",children:Zt}),o.jsxs("div",{className:"s-thread-feed",ref:Ve,onScroll:An,children:[!Yt&&k.length>0&&Ys&&o.jsx("div",{className:"s-thread-history-control",children:o.jsxs("button",{type:"button",className:"s-thread-history-button",disabled:fe,"aria-busy":fe,onClick:()=>{en()},children:[fe&&o.jsx("span",{className:"s-thread-history-spinner","aria-hidden":"true"}),fe?"Loading earlier messages…":"Load earlier messages"]})}),Yt?o.jsx(tr,{}):k.length===0?Nt?o.jsx(sr,{agentName:F,title:j.label,detail:j.detail||ce.latest,snapshot:ce,events:xe,steps:X,phase:At,tone:xn,workspaceName:et,branch:p?.currentBranch,startedAt:vt,onOpenTrace:us,onOpenTerminal:fs,onSteer:gs}):o.jsxs("div",{className:"s-thread-empty",children:[o.jsx("div",{className:"s-thread-empty-glyph","aria-hidden":"true",children:N?"@":"#"}),o.jsx("p",{children:Mt}),o.jsx("p",{children:N?"No messages yet. Send a message to start working with this agent.":"No messages yet. Start the conversation below."}),(et||p?.currentBranch)&&o.jsxs("div",{className:"s-thread-empty-chips",children:[et&&o.jsx("span",{className:"s-thread-empty-chip",children:et}),p?.currentBranch&&o.jsx("span",{className:"s-thread-empty-chip",children:p.currentBranch})]})]}):st.map((t,e)=>{const n=Pa(t,e);if(t.kind==="fanout")return o.jsx(Za,{row:t,expanded:Nn.has(t.key),showDayDivider:n,onToggle:()=>In(t.key)},t.key);const r=t.message,l=lt(r,C),c=Fa(r),g=c?"scout.dispatch":r.class,R=Ba(g),S=g==="status",y=Fs(r.createdAt),b=l?null:Ls(r,T,x),E=le.get(r.actorId)?.scopedAlias?.trim()||null,Z=!l&&E?E:r.actorName,D=l?C.toLowerCase():E??b?.handle??null,_=Oa(r.body),W=_?qa({flightId:_.flightId,replyToMessageId:r.replyToMessageId,messagesById:tt,agents:T,operatorName:C}):null,B=!_&&r.replyToMessageId?tt.get(r.replyToMessageId)??null:null,ee=B?lt(B,C)?C:B.actorName:null,rt=_?_.body:r.body;return o.jsxs("div",{className:["s-thread-feed-block",l&&"s-thread-feed-block--you",n&&"s-thread-feed-block--full-width"].filter(Boolean).join(" "),children:[n&&o.jsx(er,{at:r.createdAt}),o.jsx("article",{id:`msg-${r.id}`,className:["s-thread-msg",l&&"s-thread-msg--you",S&&"s-thread-msg--tool",(Xt||zs?.has(r.id))&&"s-thread-msg--enter"].filter(Boolean).join(" "),style:Xt?{animationDelay:`${Math.max(0,7-(st.length-1-e))*26}ms`}:void 0,"data-class":g,onContextMenu:$=>_n($,r),children:o.jsx("div",{className:"s-thread-msg-card",children:o.jsxs("div",{className:"s-thread-msg-card-content",children:[o.jsxs("div",{className:"s-thread-msg-header",children:[o.jsxs("div",{className:"s-thread-msg-meta",children:[(()=>{const $=!l&&b?()=>ct(d,{view:"agents-v2",agentId:b.id},{returnTo:f}):null,ot=l?C:Z??"?",M=o.jsx(Wt,{agent:b??void 0,name:ot,placement:"turn",className:"s-thread-msg-avatar",title:ot});return $?o.jsx("button",{type:"button",className:"s-thread-msg-avatar--nav",onClick:$,"aria-label":`View profile for ${r.actorName??"agent"}`,title:`View profile for ${r.actorName??"agent"}`,children:M}):M})(),!l&&b?o.jsx("button",{type:"button",className:"s-thread-msg-actor s-thread-msg-actor--nav",onClick:()=>ct(d,{view:"agents-v2",agentId:b.id},{returnTo:f}),title:`View profile for ${r.actorName}`,children:Z}):o.jsx("span",{className:"s-thread-msg-actor",children:l?C:Z}),D&&o.jsxs("span",{className:"s-thread-msg-handle",children:["@",D]}),R&&o.jsx("span",{className:"s-thread-msg-kind",children:R})]}),o.jsx("span",{className:"s-thread-msg-time",title:y,children:Ut(r.createdAt)}),o.jsxs("span",{className:"s-thread-msg-actions",children:[!l&&D&&o.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":`Reply to @${D}`,title:`Reply to @${D}`,onClick:()=>Ot(r,D),children:o.jsx(Qt,{})}),o.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":"Copy link to message",title:"Copy link to message",onClick:()=>qt(r.id),children:o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M6.5 9.5a2.5 2.5 0 0 0 3.54 0l2.12-2.12a2.5 2.5 0 0 0-3.54-3.54l-.7.7"}),o.jsx("path",{d:"M9.5 6.5a2.5 2.5 0 0 0-3.54 0L3.84 8.62a2.5 2.5 0 0 0 3.54 3.54l.7-.7"})]})})]})]}),W&&o.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open the originating request${W.flightId?` · ${W.flightId}`:""}`,onClick:()=>nt(W.originatingMessageId),children:[o.jsx(Qt,{}),o.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),o.jsx("span",{className:"s-thread-reply-ctx-title",children:W.title}),o.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",W.from]}),o.jsx("span",{className:"s-thread-reply-ctx-status",children:"· done"})]}),B&&ee&&o.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open message from ${ee}`,onClick:()=>nt(B.id),children:[o.jsx(Qt,{}),o.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),o.jsx("span",{className:"s-thread-reply-ctx-title",children:Hs(B)}),o.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",ee]})]}),o.jsx("div",{className:"s-thread-msg-body",title:y,children:o.jsx(Wa,{text:rt})}),o.jsx(kr,{message:r}),c&&c.candidates.length>0&&o.jsx("div",{className:"s-thread-dispatch",children:c.candidates.map($=>o.jsxs("button",{type:"button",className:"s-thread-dispatch-tile",onClick:()=>{Wn(c,$)},children:[o.jsxs("span",{className:"s-thread-dispatch-tile-id",children:["@",$.agentId]}),o.jsx("span",{className:"s-thread-dispatch-tile-state",children:$.endpointState}),o.jsx("span",{className:"s-thread-dispatch-tile-meta",children:[$.workspace,$.node,$.projectRoot].filter(Boolean).join(" · ")||$.displayName})]},$.agentId))})]})})})]},r.id)}),j.showTyping&&!Nt&&o.jsx("div",{className:"s-thread-feed-block",children:o.jsx("div",{className:"s-thread-msg","aria-live":"polite",children:o.jsxs("div",{className:fn,children:[o.jsx(Wt,{agent:Q??void 0,name:F,placement:"turn",className:"s-thread-msg-avatar s-thread-msg-avatar--working",title:F}),o.jsxs("div",{className:"s-thread-msg-card-content",children:[o.jsxs("div",{className:"s-thread-msg-header",children:[o.jsxs("div",{className:"s-thread-msg-meta",children:[o.jsx("span",{className:"s-thread-msg-actor",children:F}),o.jsx("span",{className:gn,children:pn})]}),o.jsx("span",{className:"s-thread-msg-time",title:w?.startedAt?Fs(w.startedAt):"now",children:w?.startedAt?Ut(w.startedAt):"now"})]}),o.jsxs("div",{className:"s-thread-msg-working-body",children:[o.jsxs("div",{className:yn,children:[o.jsx("span",{className:wn,"aria-hidden":"true"}),o.jsxs("div",{className:"s-thread-turn-snapshot-main",children:[o.jsx("span",{className:"s-thread-turn-snapshot-label",children:"Latest"}),o.jsx("span",{className:"s-thread-msg-working-copy",children:ce.latest})]})]}),o.jsxs("dl",{className:"s-thread-turn-snapshot-stats",children:[o.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[o.jsx("dt",{children:"Activity"}),o.jsx("dd",{children:ce.activityLabel})]}),o.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[o.jsx("dt",{children:"Elapsed"}),o.jsx("dd",{children:ce.elapsedLabel})]}),o.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[o.jsx("dt",{children:"Last"}),o.jsx("dd",{children:ce.lastActivityLabel})]})]}),X.length>0||At?o.jsx(nr,{steps:X,phase:At,limit:5,compact:!0}):o.jsx(ar,{events:xe,limit:4,compact:!0}),o.jsx(rr,{onOpenTrace:us,onOpenTerminal:fs,onSteer:gs,compact:!0})]})]})]})})}),Xs&>>0&&o.jsxs("button",{type:"button",className:"s-thread-new-messages",onClick:jn,children:[o.jsx("span",{"aria-hidden":"true",children:"↓"})," ",gt," new ",gt===1?"message":"messages"," · jump to latest"]}),o.jsx("div",{ref:es})]}),j.showTyping&&o.jsxs("div",{className:Sn,children:[o.jsx("div",{className:"s-thread-presence-line-avatars",children:o.jsx(Wt,{agent:Q??void 0,name:F,placement:"turn",className:"s-thread-presence-line-avatar",title:F})}),o.jsx("span",{className:"s-thread-presence-line-label",children:kn}),o.jsx("div",{className:bn,"aria-hidden":"true"})]}),o.jsx(ta,{composeRef:L,draft:A,setDraft:q,composePlaceholder:Bn,slashState:oe,setSlashState:Re,filteredSlashCommands:an,applySlashCommand:cn,mentionState:ie,setMentionState:Ee,filteredMentions:rn,applyMention:dn,updateTriggersFromDraft:ln,closeSuggestions:on,replyTarget:ae,onCancelReply:qn,isStopMode:Hn,sending:G,composeAction:Dn,onSend:()=>{Ln()},onInterrupt:()=>{Dt()},attachments:de,isAgentBusy:me,busyIntent:Ts,onBusyIntentChange:at,queued:ue,queueNote:Un,onEditQueued:Pn,editingQueuedId:we?.id??null,editingAttachmentCount:vs.length,onCancelEdit:Fn,onUnqueue:$n,onSendQueuedNow:t=>{On(t)}})]})})}function Qt(){return o.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("polyline",{points:"9 14 4 9 9 4"}),o.jsx("path",{d:"M20 20v-7a4 4 0 0 0-4-4H4"})]})}const ti=Ga({id:"thread",label:"Thread",route:{view:"conversation",conversationId:""},webPath:"/chat",screen:"ConversationScreen",embed:{path:"/embed/thread",profile:"macos.thread",rootClassName:"s-thread-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:Ua}});export{ei as ConversationScreen,ti as scoutSurface};
|
|
1
|
+
import{j as o,r as a}from"./index-DmFAhGPj.js";import{c as it,w as Qn,p as Ht,d as Ms,h as Vn,l as zn,f as Gn,s as Ns,g as Jn,i as Xn,j as Yn}from"./NewChatComposer-Hd7pI5Ac.js";import{a as K}from"./api-h5zurxmi.js";import{u as Zn}from"./MessageComposerSuggestions-FdVHnT_q.js";import"./runtime-picker--IW3cRry.js";import{u as ea,C as ta}from"./ConversationComposer-Bf7Ga_49.js";import"./index-CmwGCxUk.js";import{u as sa,e as na}from"./Provider-cJCdHAxu.js";import{o as aa,q as ra,x as te,y as Is,z as oa,A as be,B as ia,C as la,D as ca,E as da,c as As,S as js,F as ua,G as ma,H as ha,I as pa,J as fa,K as ga,L as ya,s as wa,M as Sa,N as ba,e as Ta,p as xa,r as Rs,O as va,P as ka,Q as Ca,R as Ma,u as Na,T as Ia,U as Aa,V as Es,W as ja,X as Ra,Y as lt,n as Ea,Z as La,_ as $a,$ as Ls,a0 as Pa,a1 as Fa,a2 as Oa,a3 as qa,a4 as $s,a5 as Da,a6 as Ps,a7 as Ba,a8 as Ha,a9 as Ua}from"./conversation-model-CHwHZNw-.js";import{u as _a}from"./sse-CxXt4tqI.js";import{n as Vt,t as Ut,f as Fs}from"./time-Dhsh_2EG.js";import{M as Wa}from"./message-markup-CyRDLdOn.js";import{i as _t}from"./message-visibility-kJM8XcSG.js";import{b as Ka}from"./router-Cn_s9IGH.js";import{f as Qa}from"./scoutbot-BTIErYHo.js";import{s as Va}from"./sessionRead-CvFz2RHv.js";import{o as ct}from"./openContent-C6XO6kr5.js";import{u as za}from"./ContextMenu-CHIuVKz7.js";import{c as Be}from"./clipboard-e3fSpeo7.js";import{A as Wt}from"./AgentAvatar-D8ZtMluU.js";import{d as Ga}from"./types-B0PlfpKc.js";/* empty css */import{ConversationHeader as Ja,ConversationIdentityRow as Xa,AddParticipantForm as Ya}from"./ConversationHeader-B_GXrKR0.js";import{FanOutRow as Za,ThreadDayDivider as er}from"./ConversationFeedRows-Cm1Lgo43.js";import{ThreadLoadingSkeleton as tr,ThreadMotionPanel as sr,WorkingTurnSteps as nr,WorkingTurnActivityPreview as ar,WorkingTurnActions as rr}from"./ConversationPanels-BTBbEvrP.js";import{g as or,c as ir,d as lr,e as cr,f as dr}from"./tail-display-BRcJltQa.js";import{u as ur}from"./tail-events-BdvqZHLr.js";import{PinnedAskCard as mr,ConversationStatusStrip as hr}from"./ConversationStatus-BqhUHD85.js";import"./HarnessMark-BPAphNjx.js";import"./colors-BtO5_zlx.js";import"./NewChatOrigin-DmuJ32wa.js";import"./keyboard-nav-h1IdakpD.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-C8ayPBtj.js";import"./createLucideIcon-CFBn0Sdk.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./loader-circle-d6PKL_KD.js";import"./file-text-DcYSrI4v.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./surface-activity-B1rgWB1i.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./index-BWHgHrtv.js";import"./mentions-agCGDgyA.js";import"./AgentDetailCard-BTiOmh-a.js";import"./AgentLiveActions-BJ5dIfL3.js";import"./terminal-takeover-BOFPRPjR.js";import"./eye-1J4yOUoG.js";import"./terminal-DJPUp_Qn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";import"./BackToPicker-D1LV6Cqp.js";import"./use-reduced-motion-CYqhYqHO.js";import"./activity-CC8JzJNH.js";import"./message-circle-CJO-pi7b.js";import"./lane-edit-display-C_Aujldz.js";const pr=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)(?:$|[?#])/iu,fr=/\bhttps?:\/\/[^\s<>"')\]]+/giu;function He(s){if(typeof s!="string")return null;try{const i=new URL(s.trim());return i.protocol==="http:"||i.protocol==="https:"?i.toString():null}catch{return null}}function V(s,i){const d=s?.[i];return typeof d=="string"&&d.trim()?d.trim():null}function gr(s){return s.mediaType.toLowerCase().startsWith("image/")}function yr(s){return pr.test(s)}function wr(s){try{const i=new URL(s),d=[i.pathname==="/"?"":i.pathname,i.search].join("").trim();return{host:i.hostname.replace(/^www\./iu,""),detail:d||i.hostname}}catch{return{host:s,detail:s}}}function Sr(s){const i=new Set,d=[];for(const h of s.matchAll(fr)){const u=h[0]?.replace(/[.,;:!?]+$/u,""),v=He(u);!v||i.has(v)||(i.add(v),d.push(v))}return d}const br=/^\/api\/blobs\/[^/]+$/u;function Kt(s){try{const i=new URL(s);return br.test(i.pathname)?`${i.pathname}${i.search}`:s}catch{return s}}function ut(s){return He(s.url)??He(V(s.metadata,"url"))??He(V(s.metadata,"href"))}function Tr(s){const i=s.metadata??null,d=V(i,"kind")??V(i,"type"),h=ut(s);if(!h||d!=="link_preview"&&d!=="link-preview"&&s.mediaType!=="text/x-uri")return null;const u=wr(h);return{id:s.id,url:h,title:V(i,"title")??u.host,description:V(i,"description"),imageUrl:He(V(i,"imageUrl")??V(i,"image")),siteName:V(i,"siteName")??u.host}}function xr({src:s,alt:i}){const[d,h]=a.useState(!1);return d?o.jsxs("a",{className:"s-message-embed s-message-embed--file",href:s,target:"_blank",rel:"noreferrer",children:[o.jsx("span",{className:"s-message-embed-title",children:i}),o.jsx("span",{className:"s-message-embed-description",children:"Preview unavailable"})]}):o.jsx("a",{className:"s-message-embed s-message-embed--image",href:s,target:"_blank",rel:"noreferrer",children:o.jsx("img",{src:s,alt:i,loading:"lazy",decoding:"async",onError:()=>h(!0)})})}function vr({preview:s}){return o.jsxs("a",{className:"s-message-embed s-message-embed--link",href:s.url,target:"_blank",rel:"noreferrer",children:[s.imageUrl&&o.jsx("span",{className:"s-message-embed-thumb",children:o.jsx("img",{src:s.imageUrl,alt:"",loading:"lazy",decoding:"async"})}),o.jsxs("span",{className:"s-message-embed-copy",children:[s.siteName&&o.jsx("span",{className:"s-message-embed-site",children:s.siteName}),o.jsx("span",{className:"s-message-embed-title",children:s.title}),s.description&&o.jsx("span",{className:"s-message-embed-description",children:s.description})]})]})}function kr({message:s}){const i=s.attachments??[],d=new Set,h=[],u=[];for(const m of i){const I=ut(m);if(I&&gr(m)){d.add(m.id),h.push({id:m.id,src:Kt(I),alt:m.fileName??"Image attachment"});continue}const T=Tr(m);T&&(d.add(m.id),u.push(T))}const v=new Set(u.map(m=>m.url)),O=new Set(i.map(ut).filter(m=>!!m));for(const m of Sr(s.body))O.has(m)||v.has(m)||yr(m)&&h.push({id:m,src:Kt(m),alt:"Embedded image"});const f=i.filter(m=>!d.has(m.id));return h.length===0&&u.length===0&&f.length===0?null:o.jsxs("div",{className:"s-message-embeds",children:[h.map(m=>o.jsx(xr,{src:m.src,alt:m.alt},m.id)),u.slice(0,1).map(m=>o.jsx(vr,{preview:m},m.id)),f.map(m=>{const I=ut(m),T=I?Kt(I):null,p=m.fileName??V(m.metadata,"title")??m.mediaType;return T?o.jsxs("a",{className:"s-message-embed s-message-embed--file",href:T,target:"_blank",rel:"noreferrer",children:[o.jsx("span",{className:"s-message-embed-title",children:p}),o.jsx("span",{className:"s-message-embed-description",children:m.mediaType})]},m.id):o.jsxs("div",{className:"s-message-embed s-message-embed--file",children:[o.jsx("span",{className:"s-message-embed-title",children:p}),o.jsx("span",{className:"s-message-embed-description",children:m.mediaType})]},m.id)})]})}const zt=60;function dt(s,i,d){const h=d?.trim();if(!h)return;const u=h.toLowerCase();i.has(u)||(i.add(u),s.push(h))}function Cr(s){const i=[],d=new Set;dt(i,d,s.observeSessionId);for(const h of s.flight?.sessions??[])dt(i,d,h.sessionId);return dt(i,d,s.agent?.harnessSessionId),dt(i,d,s.sessionMeta?.harnessSessionId),i}function Os(s,i){const d=s.sessionId?.trim().toLowerCase();return d?i.some(h=>{const u=h.trim().toLowerCase();return u?d.includes(u)||u.includes(d):!1}):!1}function _s(s,i){return s.ts!==i.ts?s.ts-i.ts:s.id.localeCompare(i.id)}function qs(s,i){const d=new Map;for(const h of[...s,...i])d.set(h.id,h);return[...d.values()].sort(_s).slice(-zt)}function Mr(s){const i=or(s).sort(_s),d=ir(i.map(u=>({event:u,meta:lr(u)}))),h=[];for(const u of d){if(u.event.kind==="other")continue;if(u.event.kind==="tool-result"){const m=h.at(-1);m?.kind==="tool"&&(m.outcome=u.meta.result?.outcome??m.outcome??"done",m.ts=u.event.ts);continue}const v=Nr(u.event),O=Ir(u.event,cr(u.event,u.meta),v);if(!O&&v!=="think")continue;const f={id:u.event.id,ts:u.event.ts,kind:v,text:O,repeatCount:u.repeatCount};u.meta.tool&&(f.tool=u.meta.tool),u.meta.arg&&(f.arg=mt(u.meta.arg)),u.meta.result?.outcome&&(f.outcome=u.meta.result.outcome),h.push(f)}return h}const Ds=160;function mt(s){const i=s.replace(/\s+/gu," ").trim();return i.length>Ds?`${i.slice(0,Ds-1)}…`:i}const Ws=/^\[thinking\]\s*$/iu;function Nr(s){return Ws.test(s.summary.trim())?"think":dr(s)}function Ir(s,i,d){return d==="think"&&Ws.test(s.summary.trim())?"":mt(i)}const Ar=15e3;function jr(s){const i=s?.outcome;return typeof i=="string"&&i.trim()?i.trim():void 0}function Rr(s){const{observe:i,flight:d}=s;if(!i||!d)return[];const h=i.data.events.filter(f=>f.kind!=="boot"&&f.kind!=="system");if(h.length===0)return[];const u=Vt(d.startedAt),v=u!==null?h.filter(f=>typeof f.at=="number"&&f.at>=u-Ar):[];return(v.length>0?v:i.data.live?h:[]).slice(-zt).map(f=>{const m={id:`observe:${i.sessionId??"session"}:${f.id}`,ts:f.at??f.t,kind:f.kind,text:mt(f.text||f.tool||"step"),repeatCount:1};f.tool&&(m.tool=f.tool),f.arg&&(m.arg=mt(f.arg));const I=jr(f.result);return I&&(m.outcome=I),f.diff&&(m.outcome=`+${f.diff.add} −${f.diff.del}`),m})}function Er(s){const i=s.at(-1);return i?i.tool?i.arg?`${i.tool} · ${i.arg}`:i.tool:i.kind==="think"?i.text||"Thinking":i.text||null:null}function Lr(s){if(s.length===0)return null;const i=s.filter(u=>u.kind==="tool").length,d=s.filter(u=>u.kind==="think").length,h=[];return i>0&&h.push(`${i} tool${i===1?"":"s"}`),d>0&&h.push(`${d} thinking`),h.length===0?`${s.length} step${s.length===1?"":"s"}`:h.join(" · ")}function $r(s){const i=s.flight?.state;return i==="queued"?{label:"Queued",detail:"waiting for the session to come online"}:i==="waking"?{label:"Waking",detail:"starting the session"}:i==="running"||i==="waiting"?s.hasSessionScope?{label:"Session live",detail:"waiting for the first trace line"}:{label:"Session live",detail:"no trace stream for this session yet"}:s.awaitingResponse?{label:"Sent",detail:"waiting for the agent to pick this up"}:null}function Pr(s){const{sessionIds:i,active:d}=s,h=i.join("|"),u=d&&i.length>0,[v,O]=a.useState([]);return a.useEffect(()=>{O([])},[h]),a.useEffect(()=>{if(!u)return;let f=!1;const m=new URLSearchParams({limit:String(zt*3),transcripts:"true"});return K(`/api/tail/recent?${m.toString()}`).then(I=>{if(f)return;const T=(I.events??[]).filter(p=>Os(p,i));T.length!==0&&O(p=>qs(p,T))}).catch(()=>{}),()=>{f=!0}},[u,h]),ur(f=>{u&&Os(f,i)&&O(m=>qs(m,[f]))},u),a.useMemo(()=>u?Mr(v):[],[u,v])}const Fr=3500;function Bs(s){const i=s?.trim().replace(/^#/,"");if(!i?.startsWith("msg-"))return null;const d=i.slice(4).trim();if(!d)return null;try{return decodeURIComponent(d)}catch{return d}}const Or=64;function qr(s){const i=s?.clientMessageId;return typeof i=="string"&&i.trim()?i.trim():null}function Hs(s){const i=s.body.replace(/\s+/gu," ").trim();if(i)return i.length>180?`${i.slice(0,179).trimEnd()}…`:i;const d=s.attachments?.length??0;return d===1?"Attachment":d>1?`${d} attachments`:"Message"}function Us(s,i){const d=s.toLocaleLowerCase().indexOf(i.toLocaleLowerCase());if(d<0)return s;const h=s.slice(0,d),u=s.slice(d+i.length);return!h&&u.startsWith(" ")?u.slice(1):h.endsWith(" ")&&u.startsWith(" ")?`${h}${u.slice(1)}`:`${h}${u}`}function Dr(s){return s instanceof TypeError||typeof DOMException<"u"&&s instanceof DOMException&&s.name==="AbortError"}function ei({conversationId:s,initialDraft:i,navigate:d,embedded:h,showBackNav:u=!0,treatment:v="standard"}){const{agents:O,route:f,openContextCapture:m}=sa(),I=Ka(f),T=a.useMemo(()=>na(O,I),[O,I]),[p,ht]=a.useState(null),Gt=a.useRef(null);Gt.current=p;const Ue=a.useMemo(()=>it(s),[s]),[Ks,Qs]=a.useState(()=>Ue?{[s]:Ue}:{}),k=Ks[s]??Ue??[],[Vs,Jt]=a.useState(()=>Ue!==null),Te=a.useRef(null),zs=a.useMemo(()=>{const t=Te.current;return t===null?null:new Set(k.filter(e=>!t.has(e.id)).map(e=>e.id))},[k]),Xt=Te.current===null&&k.length>0;a.useEffect(()=>{if(k.length===0)return;const t=Te.current??new Set;for(const e of k)t.add(e.id);Te.current=t},[k]),a.useEffect(()=>{Te.current=null,Jt(it(s)!==null)},[s]);const Yt=!Vs&&k.length===0,z=a.useCallback(t=>{Qs(e=>{const n=e[s]??it(s)??[],r=typeof t=="function"?t(n):t,l=Qn(s,r);return{...e,[s]:l}})},[s]),Gs=Ht(s),[w,he]=a.useState(Gs),[xe,ve]=a.useState([]),[_e,pt]=a.useState(null),[We,ke]=a.useState(null),[Ke,Js]=a.useState(()=>typeof window>"u"?null:Bs(window.location.hash)),[Zt,pe]=a.useState(null),[fe,ft]=a.useState(!1),[Xs,Ce]=a.useState(!1),[gt,Qe]=a.useState(0),Ve=a.useRef(null),Me=a.useRef(null),es=a.useRef(null),Ne=a.useRef(!0),ze=a.useRef(!1),ge=a.useRef(null),L=a.useRef(null),Ie=a.useRef(new Set),Ae=a.useRef(null),ts=a.useRef(0),ss=a.useRef(null),je=a.useRef(null),se=a.useRef(s);se.current=s;const ne=a.useRef(new Map),Ys=Ms(s),Ge=a.useRef(!1);a.useLayoutEffect(()=>{const t=Me.current,e=Ve.current;!t||!e||(e.scrollTop=t.scrollTop+(e.scrollHeight-t.scrollHeight),Me.current=null,Ge.current=!0)}),a.useEffect(()=>{ft(!1),Me.current=null,Ge.current=!1,Ne.current=!0,ze.current=!1,Ce(!1),Qe(0),Lt(new Set),ne.current.clear(),he(Ht(s))},[s]);const x=p?.agentId??null,N=p?.kind==="direct",yt=a.useMemo(()=>new Set([s,...p?.equivalentConversationIds??[]]),[s,p?.equivalentConversationIds]),Q=a.useMemo(()=>x?T.find(t=>t.id===x)??null:null,[T,x]),ns=aa(p),Zs=ra({resolvedAgentId:Q?.id,sessionId:ns,machineId:I}),[as,rs]=a.useState(null);a.useEffect(()=>{K("/api/fleet").then(t=>{rs(e=>te(e,Is(t.activeAsks,s,x)))}).catch(()=>{})},[s,x]);const H=a.useCallback(async(t={})=>{const e=t.messageMode??"none",n=t.includeMetadata??!0;pe(null);try{const r=n?await K(`/api/session/${encodeURIComponent(s)}`).catch(()=>null):Gt.current;if(se.current!==s)return;ht(M=>te(M,r));const l=r?.agentId??null,c=r?.id&&r.id!==s?r.id:s;if(c!==s){d({view:"conversation",conversationId:c});return}const g=it(c),R=Vn(c),S=e==="initial"&&!R,y=e==="refresh"||e==="initial",[b,U,E]=await Promise.all([S?zn(c):y?Gn(c,{refresh:!0}):Promise.resolve(g),K(`/api/flights?conversationId=${encodeURIComponent(c)}`),K("/api/fleet?limit=24&activityLimit=160").catch(()=>oa())]);if(se.current!==s)return;const Z=be(b??[]),D=Z.filter(M=>!_t(M));b&&z(M=>te(M,ia(M,D))),Jt(!0),Va(c);const _=Z.at(-1);_&&je.current!==_.id&&(je.current=_.id,K(`/api/conversations/${encodeURIComponent(c)}/read-cursor`,{method:"POST",body:JSON.stringify({lastReadMessageId:_.id})}).catch(()=>{je.current===_.id&&(je.current=null)}));const W=la(U),B=Ht(c),ee=W??B;Ie.current=new Set([...U.map(M=>M.invocationId),...B?.invocationId?.startsWith("pending:")?[]:B?.invocationId?[B.invocationId]:[]]),W&&B?.id===W.id&&Ns(c,W.id);const rt=ee?.agentId??l??null,$=ca(E.activity,ee,c,rt),ot=da(E.activeAsks,ee,c,rt);he(M=>te(M,ee)),ve(M=>te(M,$)),ke(M=>te(M,ot)),rs(M=>te(M,Is(E.activeAsks,c,l)))}catch(r){if(se.current!==s)return;pe(r instanceof Error?r.message:String(r))}},[s,d,z]);a.useEffect(()=>{H({messageMode:"initial"})},[H]),a.useEffect(()=>{je.current=null},[s]),a.useEffect(()=>{Ae.current=w},[w]);const en=a.useCallback(async()=>{if(fe||!Ms(s))return;const t=Ve.current,e=t?{scrollHeight:t.scrollHeight,scrollTop:t.scrollTop}:null;ft(!0),pe(null);try{const n=await Jn(s);if(se.current!==s)return;e&&(Me.current=e),z(be(n).filter(r=>!_t(r)))}catch(n){se.current===s&&pe(n instanceof Error?n.message:String(n))}finally{se.current===s&&ft(!1)}},[s,fe,z]),[A,q]=a.useState(()=>i??""),[ae,re]=a.useState(null),[G,Je]=a.useState(!1),[C,tn]=a.useState("operator"),[oe,Re]=a.useState({open:!1,query:"",triggerStart:-1,index:0}),[ie,Ee]=a.useState({open:!1,query:"",triggerStart:-1,index:0}),[P,J]=a.useState(null),[wt,Xe]=a.useState(!1),[St,Ye]=a.useState(""),[sn,Le]=a.useState(null),[nn,bt]=a.useState(!1);a.useEffect(()=>{Xe(!1),Ye(""),Le(null),bt(!1)},[s]),a.useEffect(()=>{if(!i)return;const t=`${s}:${i}`;ss.current!==t&&(ss.current=t,q(i),requestAnimationFrame(()=>L.current?.focus()))},[s,i]);const le=a.useMemo(()=>{const t=new Map;for(const e of p?.participants??[])t.set(e.actorId,e),e.agentId&&t.set(e.agentId,e);return t},[p]),Tt=a.useMemo(()=>{const t=new Set,e=[];for(const n of p?.participantIds??[]){if(n==="operator")continue;const r=le.get(n),l=r?.scopedAlias?.trim().replace(/^@+/,"");if(!l)continue;const c=l.toLowerCase();t.has(c)||(t.add(c),e.push({id:n,label:r?.label??r?.displayName??l,name:r?.displayName??l,handle:l}))}for(const n of T){const r=n.handle?.trim().replace(/^@+/,"")??As(n.id)??n.id;if(!r)continue;const l=r.toLowerCase();t.has(l)||(t.add(l),e.push({id:n.id,label:r,name:n.name??r,handle:r}))}return e.sort((n,r)=>n.handle.localeCompare(r.handle))},[le,T,p]),an=a.useMemo(()=>{if(!oe.open)return[];const t=oe.query.toLowerCase();return t?js.filter(e=>e.command.toLowerCase().startsWith("/"+t)||e.command.toLowerCase().includes(t)):js},[oe.open,oe.query]),rn=a.useMemo(()=>{if(!ie.open)return[];const t=ie.query.toLowerCase();return t?Tt.filter(e=>e.handle.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)).slice(0,8):Tt.slice(0,8)},[ie.open,ie.query,Tt]),on=a.useCallback(()=>{Re(t=>t.open?{...t,open:!1}:t),Ee(t=>t.open?{...t,open:!1}:t)},[]),ln=a.useCallback((t,e)=>{const n=ua(t,e);Re(n?l=>({open:!0,query:n.query,triggerStart:n.start,index:l.open&&l.triggerStart===n.start?l.index:0}):l=>l.open?{...l,open:!1}:l);const r=ma(t,e);Ee(r?l=>({open:!0,query:r.query,triggerStart:r.start,index:l.open&&l.triggerStart===r.start?l.index:0}):l=>l.open?{...l,open:!1}:l)},[]),cn=a.useCallback(t=>{const e=L.current,n=oe.triggerStart;if(n<0)return;const r=e?.selectionStart??A.length,l=A.slice(0,n),c=A.slice(r),g=t.insert,R=`${l}${g}${c}`;q(R),Re(S=>({...S,open:!1})),requestAnimationFrame(()=>{const S=L.current;if(!S)return;const y=l.length+g.length;S.focus(),S.setSelectionRange(y,y)})},[A,oe.triggerStart]),dn=a.useCallback(t=>{const e=L.current,n=ie.triggerStart;if(n<0)return;const r=e?.selectionStart??A.length,l=A.slice(0,n),c=A.slice(r),g=c.length===0||!c.startsWith(" "),R=`@${t.handle}${g?" ":""}`,S=`${l}${R}${c}`;q(S),Ee(y=>({...y,open:!1})),requestAnimationFrame(()=>{const y=L.current;if(!y)return;const b=l.length+R.length;y.focus(),y.setSelectionRange(b,b)})},[A,ie.triggerStart]);a.useEffect(()=>{const t=L.current;if(!t)return;t.style.height="0px";const e=Math.min(Math.max(t.scrollHeight,40),160);t.style.height=`${e}px`,t.style.overflowY=t.scrollHeight>e?"auto":"hidden"},[A]),a.useEffect(()=>{K("/api/user").then(t=>tn(t.name)).catch(()=>{})},[]);const Ze=a.useMemo(()=>ha(k,C),[k,C]);a.useEffect(()=>{P===null||Ze===null||Ze>=P&&J(null)},[P,Ze]);const un=a.useMemo(()=>pa(w),[w]),ye=Date.now(),mn=fa(w,Ze,ye),xt=un&&!ga(w)&&!mn,os=N&&(G||P!==null||xt),is=N&&ya({sending:G,awaitingResponse:P!==null,currentFlight:w}),F=wa({name:Q?.name,agentName:p?.agentName,id:x,title:p?.title}),j=a.useMemo(()=>N?Sa({agentName:F,agentState:Q?.state??null,sending:G,currentFlight:w,showWorkingTurn:xt,awaitingResponse:P!==null}):{label:"Open",detail:"",tone:"idle",showStrip:!1,showTyping:!1},[Q?.state,F,P,w,ye,N,G,xt]),vt=w?.startedAt??We?.startedAt??P,kt=Vt(vt),ls=Da(vt,ye),[,hn]=a.useState(0);a.useEffect(()=>{if(!j.showTyping||kt===null)return;const t=Math.max(0,Date.now()-kt),e=[$s.sustained,$s.long].find(r=>r>t);if(e===void 0)return;const n=window.setTimeout(()=>hn(r=>r+1),e-t+50);return()=>window.clearTimeout(n)},[kt,j.showTyping,ls]);const pn="Live",Ct=a.useMemo(()=>ba({currentFlight:w,presence:j,turnActivity:xe,turnAsk:We,awaitingResponseSince:P,nowMs:ye}),[P,w,ye,j,xe,We]),fn="s-thread-msg-card s-thread-msg-working-card s-thread-msg-card--avatar-row",gn="s-thread-msg-kind",yn="s-thread-turn-snapshot",wn="s-thread-turn-snapshot-pulse",Sn="s-thread-presence-line",bn=["s-thread-presence-strip",`s-thread-presence-strip--${ls}`].filter(Boolean).join(" "),Mt=p?Ta(p):F,cs=p?.id??s,Tn=p?.alias?.trim()||null,et=xa(p?.workspaceRoot),xn=j.tone,Nt=k.length===0&&N&&(j.showTyping||w!==null||xe.length>0||We!==null||P!==null),ds=a.useMemo(()=>p?p.participantIds.includes("operator"):N,[N,p]),$e=w?.agentId??x,Pe=$e?Rs(T,[$e]):null,Fe=Pe?.id??$e,Oe=w?.sessions.at(-1)?.sessionId??Pe?.harnessSessionId??void 0,us=w?.id?()=>{ct(d,{view:"sessions",flightId:w.id,...Fe?{agentId:Fe}:{},...Oe?{sessionId:Oe}:{},...I?{machineId:I}:{}},{returnTo:f})}:void 0,ms=w?.id??null;a.useEffect(()=>{if(!ms||!Fe){pt(null);return}let t=!1;const e=Oe?`?sessionId=${encodeURIComponent(Oe)}`:"",n=async()=>{try{const l=await K(`/api/agents/${encodeURIComponent(Fe)}/observe${e}`);if(t)return;pt(c=>te(c,l))}catch{}};n();const r=window.setInterval(()=>{n()},Fr);return()=>{t=!0,window.clearInterval(r),pt(null)}},[ms,Fe,Oe]);const It=a.useMemo(()=>Cr({flight:w,agent:Pe??Q,sessionMeta:p,observeSessionId:_e?.sessionId}),[Q,w,p,_e?.sessionId,Pe]),hs=Pr({sessionIds:It,active:j.showTyping||Nt}),vn=a.useMemo(()=>Rr({observe:_e,flight:w}),[w,_e]),X=hs.length>0?hs:vn,At=a.useMemo(()=>X.length>0?null:$r({flight:w,hasSessionScope:It.length>0,awaitingResponse:P!==null}),[P,w,It.length,X.length]),jt=Lr(X),Rt=Er(X),ps=X.at(-1)??null,Et=ps?Ut(ps.ts,ye):null,ce=a.useMemo(()=>Rt?{...Ct,latest:Rt,...jt?{activityLabel:jt}:{},...Et?{lastActivityLabel:Et}:{}}:Ct,[Et,Rt,Ct,jt]),kn=`${F}: ${ce.latest}`,fs=$e&&va(Pe)?()=>{ct(d,{view:"terminal",agentId:$e,mode:"takeover"},{returnTo:f})}:void 0,gs=N?()=>{h&&Qa({type:"focus-composer",reason:"Steer the active conversation"})||requestAnimationFrame(()=>{L.current?.focus({preventScroll:!0}),L.current?.scrollIntoView({block:"nearest"})})}:void 0,ys=a.useMemo(()=>(p?p.participantIds.filter(e=>e!=="operator"):x?[x]:[]).map(e=>{const n=Rs(T,[e]),r=le.get(e);return{id:e,name:r?.scopedAlias??n?.name??r?.displayName??As(e)??e,title:r?.label??n?.id??e,agent:n,sessionId:r?.sessionId??null,harness:n?.harness??r?.harness??null,model:n?.model??null,reasoningEffort:n?.reasoningEffort??null}}),[x,le,T,p]),ws=ys.slice(0,4),Cn=Math.max(ys.length-ws.length,0),Mn=a.useMemo(()=>({name:C,active:ds}),[ds,C]),tt=a.useMemo(()=>new Map(k.map(t=>[t.id,t])),[k]),st=a.useMemo(()=>ka(k),[k]),[Nn,Lt]=a.useState(()=>new Set),In=a.useCallback(t=>{Lt(e=>{const n=new Set(e);return n.delete(t)||n.add(t),n})},[]),Ss=a.useMemo(()=>{const t=new Map;for(const e of st)if(e.kind==="fanout")for(const n of e.messages)t.set(n.id,e.key);return t},[st]),nt=a.useCallback(t=>{const e=Ss.get(t);e&&Lt(c=>c.has(e)?c:new Set(c).add(e));const n=document.getElementById(`msg-${t}`);if(!n)return;const r=n.closest(".s-thread-fanout")??n,l=r===n?"s-thread-msg--flash":"s-thread-fanout--flash";r.scrollIntoView({behavior:"smooth",block:"center"}),r.classList.add(l),window.setTimeout(()=>r.classList.remove(l),1200)},[Ss]);a.useEffect(()=>{const t=()=>Js(Bs(window.location.hash));return window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t)},[]),a.useEffect(()=>{if(!Ke||!tt.has(Ke))return;const t=window.setTimeout(()=>nt(Ke),50);return()=>window.clearTimeout(t)},[Ke,tt,nt]),_a(a.useCallback(t=>{if(t.kind==="message.posted"){const e=t.payload?.message;if(!e||!yt.has(e.conversationId))return;const n=e.actorId==="operator",r=N&&!n&&e.class==="agent",l={id:e.id,conversationId:e.conversationId,actorId:e.actorId,actorName:r?F:Ca(e.actorId,T,C),body:e.body,createdAt:e.createdAt,class:n?"operator":e.class,attachments:e.attachments,metadata:e.metadata,replyToMessageId:e.replyToMessageId??e.n??null};if(_t(l))return;if(z(c=>{const g=qr(e.metadata),R=g?ne.current.get(g):void 0;if(c.some(S=>S.id===e.id))return g&&ne.current.delete(g),c;if(n&&g){const S=Ma(c,g,R);if(S!==-1){const y=[...c];return y[S]=l,ne.current.delete(g),be(y)}}return be([...c,l])}),r){const c=Vt(e.createdAt)??Date.now();J(g=>g===null||c<g||Na(Ae.current)?g:null),he(g=>Ia(g)?null:g)}return}if(t.kind==="invocation.requested"){const e=t.payload?.invocation;if(!e||e.targetAgentId!==x||!e.conversationId||!yt.has(e.conversationId))return;Ie.current.add(e.id),ve([]),ke(null),J(n=>n??Date.now());return}if(t.kind==="flight.updated"){const e=t.payload?.flight;if(!e||e.targetAgentId!==x||!(Ie.current.has(e.invocationId)||Ae.current?.id===e.id))return;if(Aa.has(e.state)){Ns(s,e.id),he(c=>c?.id===e.id?null:c),ve([]),ke(null),J(null),H({messageMode:"refresh",includeMetadata:!1});return}Ie.current.add(e.invocationId);const r=Ae.current?.id===e.id,l=Es(e,s,x??"",Ae.current);ja(l)&&J(null),he(l),r||(ve([]),ke(null));return}t.kind!=="agent.endpoint.upserted"&&t.kind==="unknown"&&H({messageMode:"refresh"})},[x,F,s,yt,N,H,C,T])),a.useEffect(()=>{if(!os)return;const t=setInterval(()=>{H({messageMode:"refresh",includeMetadata:!1})},5e3);return()=>clearInterval(t)},[os,H]),a.useEffect(()=>{const t=()=>{if(document.visibilityState!=="visible")return;const e=Date.now();e-ts.current<1e3||(ts.current=e,H({messageMode:"refresh"}))};return window.addEventListener("focus",t),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",t)}},[H]);const $t=a.useRef(null),bs=a.useRef(!1),Pt=a.useRef(!1),Ft=a.useCallback(t=>{const e=es.current;e&&(ze.current=!0,ge.current!==null&&clearTimeout(ge.current),e.scrollIntoView({behavior:t}),ge.current=setTimeout(()=>{ze.current=!1,ge.current=null},t==="smooth"?700:0))},[]);a.useEffect(()=>()=>{ge.current!==null&&clearTimeout(ge.current)},[]);const An=a.useCallback(()=>{const t=Ve.current;if(!t||ze.current)return;const n=t.scrollHeight-t.clientHeight-t.scrollTop<=Or;Ne.current=n,n?(Ce(!1),Qe(0)):Ce(!0)},[]),jn=a.useCallback(()=>{Ne.current=!0,Ce(!1),Qe(0),Ft("smooth")},[Ft]);a.useEffect(()=>{const t=k.at(-1)?.id??null,e=!!(t&&t!==$t.current),n=Ra({newestMessageId:t,previousNewestMessageId:$t.current,showTyping:j.showTyping,previousShowTyping:bs.current,historyRestorePending:Ge.current||Me.current!==null,initialScrollDone:Pt.current,nearBottom:Ne.current});n!=="none"?(Ft(n),Pt.current=!0):e&&Pt.current&&!Ne.current&&(Ce(!0),Qe(r=>r+1)),Ge.current=!1,$t.current=t,bs.current=j.showTyping});const[,Rn]=a.useState(0);a.useEffect(()=>{const t=setInterval(()=>Rn(e=>e+1),15e3);return()=>clearInterval(t)},[]);const de=ea(),[ue,Y]=a.useState([]),[Ts,at]=a.useState("queue"),[we,Se]=a.useState(null),qe=async(t,e)=>{const n=t.trim(),r=e?.attachments??[],l=e?.replyTarget??null;if(!n&&r.length===0||G)return"failed";const g=e?.forceAction??Ps({isDm:N,hasOutstandingReply:is}),R=Date.now(),S=Yn(),y={id:`optimistic-${S}`,conversationId:s,actorId:"operator",actorName:C,body:n,createdAt:R,class:"operator",...l?{replyToMessageId:l.messageId}:{},metadata:{clientMessageId:S,deliveryState:"sending"},...r.length>0?{attachments:r}:{}};Je(!0),g!=="message"&&J(R),pe(null),ne.current.set(S,y.id),z(b=>be([...b,y]));try{const b=await K(`/api/chats/${encodeURIComponent(s)}/messages`,{method:"POST",body:JSON.stringify({body:n,clientMessageId:S,...l?{replyToMessageId:l.messageId}:{},...r.length>0?{attachments:r}:{}})}),U=b.chatId?.trim()??b.conversationId?.trim();if(U&&U!==s)throw new Error(`Send returned a different Chat (${U}) instead of appending to ${s}.`);if(b.messageId?.trim()){const E=b.messageId.trim();z(Z=>be(Z.map(D=>D.id===y.id?{...D,id:E,metadata:{clientMessageId:S}}:D))),ne.current.delete(S)}return b.flight?(Ie.current.add(b.flight.invocationId),he(Es(b.flight,s,x??"")),ve([]),ke(null)):g!=="message"&&J(null),"sent"}catch(b){return Dr(b)?(z(U=>U.map(E=>E.id===y.id?{...E,metadata:{...E.metadata??{},deliveryState:"unknown"}}:E)),"unknown"):(z(U=>U.filter(E=>E.id!==y.id)),ne.current.delete(S),J(null),pe(b instanceof Error?b.message:String(b)),"failed")}finally{Je(!1)}},En=async()=>{const t=A.trim(),e=ae,n=de.files,r=we?.attachments??[];if(!t&&n.length===0&&r.length===0)return null;let l=[];if(n.length>0){Je(!0);try{l=await Zn(n)}catch(c){return de.setError(c instanceof Error?c.message:String(c)),null}finally{Je(!1)}}return q(""),re(null),de.clear(),Se(null),{body:t,attachments:[...r,...l],replyTarget:e}},Ln=async()=>{const t=Ha({isAgentBusy:me,intent:Ts}),e=we?.id??null,n=await En();if(!n)return;if(t==="queue"){Y(c=>e?c.map(g=>g.id===e?{...g,body:n.body,attachments:n.attachments,replyTarget:n.replyTarget}:g):[...c,{id:`queued-${Date.now()}-${c.length}`,body:n.body,attachments:n.attachments,replyTarget:n.replyTarget,queuedAt:Date.now()}]);return}e&&Y(c=>c.filter(g=>g.id!==e));const r=()=>{q(n.body),Se(n.attachments.length>0?{id:null,attachments:n.attachments}:null),re(n.replyTarget),requestAnimationFrame(()=>L.current?.focus())};if(t==="steer"){at("queue"),await Dt(),await qe(n.body,{forceAction:"steer",attachments:n.attachments,replyTarget:n.replyTarget})==="failed"&&r();return}await qe(n.body,{attachments:n.attachments,replyTarget:n.replyTarget})==="failed"&&r()},$n=t=>{Y(e=>e.filter(n=>n.id!==t)),Se(e=>e?.id===t?null:e)},Pn=t=>{const e=ue.find(n=>n.id===t);e&&(q(e.body),re(e.replyTarget??null),Se({id:t,attachments:e.attachments}),requestAnimationFrame(()=>{const n=L.current;n&&(n.focus(),n.setSelectionRange(n.value.length,n.value.length))}))},Fn=()=>{Se(null),q(""),re(null),de.clear()},On=async t=>{const e=ue.find(r=>r.id===t);if(!e)return;Y(r=>r.filter(l=>l.id!==t)),await Dt(),await qe(e.body,{forceAction:"steer",attachments:e.attachments,replyTarget:e.replyTarget??null})==="failed"&&Y(r=>[e,...r])},Ot=a.useCallback((t,e)=>{const n=e?.trim().replace(/^@+/,"")||null,r=n?`@${n}`:null,l=ae?.insertedMention?Us(A,ae.insertedMention):A,c=!!(!N&&r&&!l.toLocaleLowerCase().includes(r.toLocaleLowerCase())),g=c&&r?l.trim()?`${l.trimEnd()} ${r} `:`${r} `:l;q(g),re({messageId:t.id,actorLabel:n?`@${n}`:t.actorName,preview:Hs(t),insertedMention:c?r:null}),requestAnimationFrame(()=>L.current?.focus())},[A,N,ae?.insertedMention]),qn=a.useCallback(()=>{const t=ae?.insertedMention;re(null),t&&q(e=>Us(e,t)),requestAnimationFrame(()=>L.current?.focus())},[ae]),qt=a.useCallback(t=>{const e=new URL(window.location.href);f.view==="agents-v2"&&e.searchParams.set("tab","message"),e.hash=`msg-${t}`,Be(e.toString())},[f.view]),xs=a.useCallback((t,e,n)=>{const r=Xn({conversationId:s,selectedMessageId:t.id,messages:k.map(l=>({id:l.id,actorLabel:l.id===t.id?e:lt(l,C)?C:l.actorName,body:l.body,attachmentCount:l.attachments?.length??0}))});m({intent:"forward-message",forwardContext:r,forwardContextMode:"selected-message",...n?{projectPath:n}:{}})},[s,k,m,C]),Dt=async()=>{if(x)try{await K("/api/agents/"+encodeURIComponent(x)+"/interrupt",{method:"POST",body:JSON.stringify({})})}catch{}},me=j.tone==="working"||j.tone==="pending",Dn=Ps({isDm:N,hasOutstandingReply:is}),Bn=N?`Message ${F} — type / to route or @ to mention an agent`:p?.kind==="channel"?`Comment in #${Ea(p)} — mention @agent to request a reply`:`Comment in ${Mt} — mention @agent to request a reply`,vs=we?.attachments??[],Hn=!A.trim()&&!de.hasFiles&&vs.length===0&&me,Bt=a.useRef(!1);a.useEffect(()=>{const t=we?.id??null,e=t?ue.filter(r=>r.id!==t):ue;if(!La({isAgentBusy:me,sending:G,queued:e})||Bt.current)return;const n=e[0];n&&(Bt.current=!0,Y(r=>r.filter(l=>l.id!==n.id)),qe(n.body,{attachments:n.attachments,replyTarget:n.replyTarget??null}).then(r=>{r==="failed"&&Y(l=>[n,...l])}).finally(()=>{Bt.current=!1}))},[me,G,ue,we]),a.useEffect(()=>{me||at("queue")},[me]),a.useEffect(()=>{Y([]),Se(null),re(null),at("queue"),de.clear()},[s]);const Un=$a(ue),ks=za(),_n=a.useCallback((t,e)=>{const n=window.getSelection()?.toString().trim(),r=lt(e,C),l=e.actorId?le.get(e.actorId):null,c=r?null:Ls(e,T,x),g=(l?.scopedAlias?.trim()||c?.handle?.trim()||null)?.replace(/^@+/,"")??null,R=g?`@${g}`:e.actorName,S=(c?.id||l?.agentId||e.actorId||"").trim(),y=[];r||y.push({kind:"action",label:"Reply",onSelect:()=>Ot(e,g)}),y.push({kind:"action",label:"Forward to new task…",onSelect:()=>xs(e,R,l?.workspaceRoot??c?.projectRoot??c?.cwd??void 0)}),y.push({kind:"separator"}),n&&y.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{Be(n)}}),y.push({kind:"action",label:"Copy Message",onSelect:()=>{Be(e.body)}}),y.push({kind:"action",label:"Copy Link",onSelect:()=>qt(e.id)}),y.push({kind:"separator"}),!r&&S&&y.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{Be(S)}}),y.push({kind:"action",label:"Copy Message ID",onSelect:()=>{Be(e.id)}}),ks(t,y)},[x,Ot,qt,xs,C,le,T,ks]),Wn=async(t,e)=>{const n=`@${e.agentId} `,r=A.trim();if(r){q(""),await qe(`${n}${r}`,{forceAction:"invoke"});return}q(n),L.current?.focus()},De=a.useMemo(()=>{if(!p)return[];const t=new Set(p.participantIds);return T.filter(e=>!t.has(e.id)&&!e.retiredFromFleet).sort((e,n)=>e.name.localeCompare(n.name))},[p,T]);a.useEffect(()=>{wt&&Ye(t=>t&&De.some(e=>e.id===t)?t:De[0]?.id??"")},[wt,De]);const Cs=!!(p&&["direct","group_direct","channel"].includes(p.kind)&&De.length>0),Kn=a.useCallback(async()=>{if(!p)return;const t=St.trim();if(t){bt(!0),Le(null);try{const e=await K(`/api/conversations/${encodeURIComponent(p.id)}/members`,{method:"POST",body:JSON.stringify({actorId:t})});e.session?ht(e.session):ht(n=>n&&{...n,kind:e.kind,participantIds:e.participantIds}),Xe(!1),Ye(""),await H({messageMode:"none"})}catch(e){Le(e instanceof Error?e.message:String(e))}finally{bt(!1)}}},[St,H,p]);return o.jsx("div",{className:`s-thread-layout${h?" s-thread-layout--embedded":""}`,"data-thread-treatment":v==="standard"?void 0:v,children:o.jsxs("div",{className:"s-thread-center",children:[!h&&o.jsx(Ja,{showBackNav:u,isDm:N,navigate:d,route:f,canonicalConversationId:cs,threadTitle:Mt,agentId:Q?.id??null,sessionId:ns,detailRoute:Zs,visibleParticipants:ws,hiddenParticipantCount:Cn,operator:Mn,canAddParticipants:Cs,onToggleAddParticipant:()=>{Le(null),Xe(t=>!t)}}),!h&&p&&o.jsx(Xa,{canonicalConversationId:cs,conversationAlias:Tn}),!h&&wt&&Cs&&o.jsx(Ya,{agents:De,addParticipantId:St,setAddParticipantId:Ye,addingParticipant:nn,addParticipantError:sn,onCancel:()=>{Xe(!1),Le(null)},onSubmit:()=>{Kn()}}),as&&o.jsx(mr,{pinnedAsk:as,onAnswer:()=>{L.current?.focus()}}),o.jsx(hr,{presence:j,agent:Q}),Zt&&o.jsx("p",{className:"s-thread-error",children:Zt}),o.jsxs("div",{className:"s-thread-feed",ref:Ve,onScroll:An,children:[!Yt&&k.length>0&&Ys&&o.jsx("div",{className:"s-thread-history-control",children:o.jsxs("button",{type:"button",className:"s-thread-history-button",disabled:fe,"aria-busy":fe,onClick:()=>{en()},children:[fe&&o.jsx("span",{className:"s-thread-history-spinner","aria-hidden":"true"}),fe?"Loading earlier messages…":"Load earlier messages"]})}),Yt?o.jsx(tr,{}):k.length===0?Nt?o.jsx(sr,{agentName:F,title:j.label,detail:j.detail||ce.latest,snapshot:ce,events:xe,steps:X,phase:At,tone:xn,workspaceName:et,branch:p?.currentBranch,startedAt:vt,onOpenTrace:us,onOpenTerminal:fs,onSteer:gs}):o.jsxs("div",{className:"s-thread-empty",children:[o.jsx("div",{className:"s-thread-empty-glyph","aria-hidden":"true",children:N?"@":"#"}),o.jsx("p",{children:Mt}),o.jsx("p",{children:N?"No messages yet. Send a message to start working with this agent.":"No messages yet. Start the conversation below."}),(et||p?.currentBranch)&&o.jsxs("div",{className:"s-thread-empty-chips",children:[et&&o.jsx("span",{className:"s-thread-empty-chip",children:et}),p?.currentBranch&&o.jsx("span",{className:"s-thread-empty-chip",children:p.currentBranch})]})]}):st.map((t,e)=>{const n=Pa(t,e);if(t.kind==="fanout")return o.jsx(Za,{row:t,expanded:Nn.has(t.key),showDayDivider:n,onToggle:()=>In(t.key)},t.key);const r=t.message,l=lt(r,C),c=Fa(r),g=c?"scout.dispatch":r.class,R=Ba(g),S=g==="status",y=Fs(r.createdAt),b=l?null:Ls(r,T,x),E=le.get(r.actorId)?.scopedAlias?.trim()||null,Z=!l&&E?E:r.actorName,D=l?C.toLowerCase():E??b?.handle??null,_=Oa(r.body),W=_?qa({flightId:_.flightId,replyToMessageId:r.replyToMessageId,messagesById:tt,agents:T,operatorName:C}):null,B=!_&&r.replyToMessageId?tt.get(r.replyToMessageId)??null:null,ee=B?lt(B,C)?C:B.actorName:null,rt=_?_.body:r.body;return o.jsxs("div",{className:["s-thread-feed-block",l&&"s-thread-feed-block--you",n&&"s-thread-feed-block--full-width"].filter(Boolean).join(" "),children:[n&&o.jsx(er,{at:r.createdAt}),o.jsx("article",{id:`msg-${r.id}`,className:["s-thread-msg",l&&"s-thread-msg--you",S&&"s-thread-msg--tool",(Xt||zs?.has(r.id))&&"s-thread-msg--enter"].filter(Boolean).join(" "),style:Xt?{animationDelay:`${Math.max(0,7-(st.length-1-e))*26}ms`}:void 0,"data-class":g,onContextMenu:$=>_n($,r),children:o.jsx("div",{className:"s-thread-msg-card",children:o.jsxs("div",{className:"s-thread-msg-card-content",children:[o.jsxs("div",{className:"s-thread-msg-header",children:[o.jsxs("div",{className:"s-thread-msg-meta",children:[(()=>{const $=!l&&b?()=>ct(d,{view:"agents-v2",agentId:b.id},{returnTo:f}):null,ot=l?C:Z??"?",M=o.jsx(Wt,{agent:b??void 0,name:ot,placement:"turn",className:"s-thread-msg-avatar",title:ot});return $?o.jsx("button",{type:"button",className:"s-thread-msg-avatar--nav",onClick:$,"aria-label":`View profile for ${r.actorName??"agent"}`,title:`View profile for ${r.actorName??"agent"}`,children:M}):M})(),!l&&b?o.jsx("button",{type:"button",className:"s-thread-msg-actor s-thread-msg-actor--nav",onClick:()=>ct(d,{view:"agents-v2",agentId:b.id},{returnTo:f}),title:`View profile for ${r.actorName}`,children:Z}):o.jsx("span",{className:"s-thread-msg-actor",children:l?C:Z}),D&&o.jsxs("span",{className:"s-thread-msg-handle",children:["@",D]}),R&&o.jsx("span",{className:"s-thread-msg-kind",children:R})]}),o.jsx("span",{className:"s-thread-msg-time",title:y,children:Ut(r.createdAt)}),o.jsxs("span",{className:"s-thread-msg-actions",children:[!l&&D&&o.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":`Reply to @${D}`,title:`Reply to @${D}`,onClick:()=>Ot(r,D),children:o.jsx(Qt,{})}),o.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":"Copy link to message",title:"Copy link to message",onClick:()=>qt(r.id),children:o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M6.5 9.5a2.5 2.5 0 0 0 3.54 0l2.12-2.12a2.5 2.5 0 0 0-3.54-3.54l-.7.7"}),o.jsx("path",{d:"M9.5 6.5a2.5 2.5 0 0 0-3.54 0L3.84 8.62a2.5 2.5 0 0 0 3.54 3.54l.7-.7"})]})})]})]}),W&&o.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open the originating request${W.flightId?` · ${W.flightId}`:""}`,onClick:()=>nt(W.originatingMessageId),children:[o.jsx(Qt,{}),o.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),o.jsx("span",{className:"s-thread-reply-ctx-title",children:W.title}),o.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",W.from]}),o.jsx("span",{className:"s-thread-reply-ctx-status",children:"· done"})]}),B&&ee&&o.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open message from ${ee}`,onClick:()=>nt(B.id),children:[o.jsx(Qt,{}),o.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),o.jsx("span",{className:"s-thread-reply-ctx-title",children:Hs(B)}),o.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",ee]})]}),o.jsx("div",{className:"s-thread-msg-body",title:y,children:o.jsx(Wa,{text:rt})}),o.jsx(kr,{message:r}),c&&c.candidates.length>0&&o.jsx("div",{className:"s-thread-dispatch",children:c.candidates.map($=>o.jsxs("button",{type:"button",className:"s-thread-dispatch-tile",onClick:()=>{Wn(c,$)},children:[o.jsxs("span",{className:"s-thread-dispatch-tile-id",children:["@",$.agentId]}),o.jsx("span",{className:"s-thread-dispatch-tile-state",children:$.endpointState}),o.jsx("span",{className:"s-thread-dispatch-tile-meta",children:[$.workspace,$.node,$.projectRoot].filter(Boolean).join(" · ")||$.displayName})]},$.agentId))})]})})})]},r.id)}),j.showTyping&&!Nt&&o.jsx("div",{className:"s-thread-feed-block",children:o.jsx("div",{className:"s-thread-msg","aria-live":"polite",children:o.jsxs("div",{className:fn,children:[o.jsx(Wt,{agent:Q??void 0,name:F,placement:"turn",className:"s-thread-msg-avatar s-thread-msg-avatar--working",title:F}),o.jsxs("div",{className:"s-thread-msg-card-content",children:[o.jsxs("div",{className:"s-thread-msg-header",children:[o.jsxs("div",{className:"s-thread-msg-meta",children:[o.jsx("span",{className:"s-thread-msg-actor",children:F}),o.jsx("span",{className:gn,children:pn})]}),o.jsx("span",{className:"s-thread-msg-time",title:w?.startedAt?Fs(w.startedAt):"now",children:w?.startedAt?Ut(w.startedAt):"now"})]}),o.jsxs("div",{className:"s-thread-msg-working-body",children:[o.jsxs("div",{className:yn,children:[o.jsx("span",{className:wn,"aria-hidden":"true"}),o.jsxs("div",{className:"s-thread-turn-snapshot-main",children:[o.jsx("span",{className:"s-thread-turn-snapshot-label",children:"Latest"}),o.jsx("span",{className:"s-thread-msg-working-copy",children:ce.latest})]})]}),o.jsxs("dl",{className:"s-thread-turn-snapshot-stats",children:[o.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[o.jsx("dt",{children:"Activity"}),o.jsx("dd",{children:ce.activityLabel})]}),o.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[o.jsx("dt",{children:"Elapsed"}),o.jsx("dd",{children:ce.elapsedLabel})]}),o.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[o.jsx("dt",{children:"Last"}),o.jsx("dd",{children:ce.lastActivityLabel})]})]}),X.length>0||At?o.jsx(nr,{steps:X,phase:At,limit:5,compact:!0}):o.jsx(ar,{events:xe,limit:4,compact:!0}),o.jsx(rr,{onOpenTrace:us,onOpenTerminal:fs,onSteer:gs,compact:!0})]})]})]})})}),Xs&>>0&&o.jsxs("button",{type:"button",className:"s-thread-new-messages",onClick:jn,children:[o.jsx("span",{"aria-hidden":"true",children:"↓"})," ",gt," new ",gt===1?"message":"messages"," · jump to latest"]}),o.jsx("div",{ref:es})]}),j.showTyping&&o.jsxs("div",{className:Sn,children:[o.jsx("div",{className:"s-thread-presence-line-avatars",children:o.jsx(Wt,{agent:Q??void 0,name:F,placement:"turn",className:"s-thread-presence-line-avatar",title:F})}),o.jsx("span",{className:"s-thread-presence-line-label",children:kn}),o.jsx("div",{className:bn,"aria-hidden":"true"})]}),o.jsx(ta,{composeRef:L,draft:A,setDraft:q,composePlaceholder:Bn,slashState:oe,setSlashState:Re,filteredSlashCommands:an,applySlashCommand:cn,mentionState:ie,setMentionState:Ee,filteredMentions:rn,applyMention:dn,updateTriggersFromDraft:ln,closeSuggestions:on,replyTarget:ae,onCancelReply:qn,isStopMode:Hn,sending:G,composeAction:Dn,onSend:()=>{Ln()},onInterrupt:()=>{Dt()},attachments:de,isAgentBusy:me,busyIntent:Ts,onBusyIntentChange:at,queued:ue,queueNote:Un,onEditQueued:Pn,editingQueuedId:we?.id??null,editingAttachmentCount:vs.length,onCancelEdit:Fn,onUnqueue:$n,onSendQueuedNow:t=>{On(t)}})]})})}function Qt(){return o.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("polyline",{points:"9 14 4 9 9 4"}),o.jsx("path",{d:"M20 20v-7a4 4 0 0 0-4-4H4"})]})}const ti=Ga({id:"thread",label:"Thread",route:{view:"conversation",conversationId:""},webPath:"/chat",screen:"ConversationScreen",embed:{path:"/embed/thread",profile:"macos.thread",rootClassName:"s-thread-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:Ua}});export{ei as ConversationScreen,ti as scoutSurface};
|
package/dist/client/assets/{ConversationStatus-BJ1CMbAv.js → ConversationStatus-BqhUHD85.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-DmFAhGPj.js";import{c as e,h as n}from"./conversation-model-CHwHZNw-.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";function o({pinnedAsk:a,onAnswer:t}){return s.jsxs("div",{className:"s-thread-pinned-ask",children:[s.jsx("div",{className:"s-thread-pinned-ask-label",children:"Agent question · Awaiting operator"}),s.jsx("div",{className:"s-thread-pinned-ask-body",children:a.task}),s.jsxs("div",{className:"s-thread-pinned-ask-routing",children:[s.jsx("span",{children:a.agentName??e(a.agentId)??a.agentId}),s.jsx("span",{className:"s-thread-pinned-ask-routing-arrow",children:"→"}),s.jsx("span",{children:"You"})]}),s.jsx("div",{className:"s-thread-pinned-ask-actions",children:s.jsx("button",{type:"button",className:"s-ops-btn s-ops-btn--primary",onClick:t,children:"Answer"})}),s.jsx("div",{className:"s-thread-pinned-ask-strip"})]})}function c({presence:a,agent:t}){return a.showStrip?s.jsxs("div",{className:`s-thread-status s-thread-status--${a.tone}`,"aria-live":"polite",children:[s.jsx("span",{className:"s-thread-status-dot",style:{background:n(a,t?.state??null)}}),s.jsxs("div",{className:"s-thread-status-copy",children:[s.jsx("span",{className:"s-thread-status-label",children:a.label}),s.jsx("span",{className:"s-thread-status-detail",children:a.detail})]})]}):null}export{c as ConversationStatusStrip,o as PinnedAskCard};
|