@openscout/scout 0.2.96 → 0.2.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/ActivityScreen-sfonf5SR.js +1 -0
- package/dist/client/assets/{AddProjectForm-IqOtJfRs.js → AddProjectForm-fXndbzXT.js} +1 -1
- package/dist/client/assets/{AgentAvatar-6-KBVKUu.js → AgentAvatar-Dz79iTxB.js} +1 -1
- package/dist/client/assets/AgentConfigurationScreen-DDc3udYM.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-DHDS9Pgd.js +1 -0
- package/dist/client/assets/{AgentDetailCard-C9rn3Fj5.js → AgentDetailCard-8viaEY8b.js} +1 -1
- package/dist/client/assets/AgentFloorView-DuyvyMMj.js +1 -0
- package/dist/client/assets/AgentInfoScreen-qntgg2q2.js +1 -0
- package/dist/client/assets/{AgentLaneCard-DI2iW9zO.js → AgentLaneCard-Cc9uyfBr.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-D8bARHMx.js → AgentLaneChrome-Dv2lBFoH.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-52un7dKC.js → AgentLaneDetailSheet-CGqtqSHQ.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-CEBjmPTa.js → AgentLaneSummaryResize-Di4u6df2.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-BA6fRwkD.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-q20mTjms.js → AgentLanesPreflight-CCGBArIb.js} +1 -1
- package/dist/client/assets/AgentLanesView-96lHsoX7.js +2 -0
- package/dist/client/assets/{AgentLiveActions-DrEJDJef.js → AgentLiveActions-DlSKL60c.js} +1 -1
- package/dist/client/assets/AgentMasterScreen-DHrMuQ6_.js +1 -0
- package/dist/client/assets/{AgentSessions-DCPCG4xb.js → AgentSessions-DV9v34aq.js} +2 -2
- package/dist/client/assets/AgentsConsole-DTpVhS67.js +1 -0
- package/dist/client/assets/AgentsScreen-hZ4o2I-e.js +1 -0
- package/dist/client/assets/AgentsSubnav-Ci7uWM7P.js +1 -0
- package/dist/client/assets/{AstronautSuit-DbjQtfD_.js → AstronautSuit-CwB4Dw07.js} +1 -1
- package/dist/client/assets/{AtopView-Daq_ob3z.js → AtopView-D7vyQDtE.js} +1 -1
- package/dist/client/assets/{BackToPicker-CXZjBRAe.js → BackToPicker-BHicJyfc.js} +1 -1
- package/dist/client/assets/BriefingDetailScreen-B-wD_Bot.js +1 -0
- package/dist/client/assets/{BriefingsScreen-B5oMTGKv.js → BriefingsScreen-Cn4Mbam9.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-BsiU8lTD.js → BrokerMetadataPanel-BJSwU9XZ.js} +1 -1
- package/dist/client/assets/BrokerScreen-C8FQ5rlg.js +5 -0
- package/dist/client/assets/{CastPicker-_5E5hNUe.js → CastPicker-CkgTalIt.js} +1 -1
- package/dist/client/assets/{ChatCollapsedStrip-D-eXhzPf.js → ChatCollapsedStrip-7Wrg8Ge0.js} +1 -1
- package/dist/client/assets/{CodeDiffPane-n7W4iGUG.js → CodeDiffPane-DfluIWmO.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-CMsbSTDq.js → CodeProjectPicker-By_Wz9ex.js} +1 -1
- package/dist/client/assets/CodeScreen-cLC0tJ4S.js +1 -0
- package/dist/client/assets/ConversationComposer-BUIjWMBi.js +1 -0
- package/dist/client/assets/ConversationFeedRows-Bx0gFyG_.js +1 -0
- package/dist/client/assets/ConversationHeader-Bt2RBj93.js +1 -0
- package/dist/client/assets/{ConversationPanels-Dujvnmup.js → ConversationPanels-o6W-cOoU.js} +2 -2
- package/dist/client/assets/ConversationScreen-DIU7m_aC.js +2 -0
- package/dist/client/assets/{ConversationStatus-DVzSb2Hv.js → ConversationStatus-CTYOywFh.js} +1 -1
- package/dist/client/assets/{CrewAvatar-BwXjyg8N.js → CrewAvatar-CZ_faQ_s.js} +1 -1
- package/dist/client/assets/CrewWorkspaces-DNX-QQ1h.js +1 -0
- package/dist/client/assets/CrewWorkspaces-Diq11KDq.css +1 -0
- package/dist/client/assets/{DataTable-Bp8tU9AK.js → DataTable-C6aMSilS.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-B-6rmXzL.js → DispatchAftermath-ZCEB75hh.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-Do3wQ_3Z.js → DocumentFocusViewer-D8iB6SMt.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-C1orRyP9.js → EmbeddableSurfacesLab-D3iZiS8o.js} +1 -1
- package/dist/client/assets/{EmptyState-CJzXj1l5.js → EmptyState-CKPWFSjq.js} +1 -1
- package/dist/client/assets/{FileViewerPane-Df6VzXjA.js → FileViewerPane-CxNbcTYf.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-BTe1YRPr.js +1 -0
- package/dist/client/assets/{FollowScreen-DvnxYLVh.js → FollowScreen-CkR-okdL.js} +1 -1
- package/dist/client/assets/{HarnessMark-B979GCSB.js → HarnessMark-DttReffF.js} +1 -1
- package/dist/client/assets/HarnessesScreen-COO_Q8VY.js +1 -0
- package/dist/client/assets/{HerdrSession-B3McuYgi.js → HerdrSession-DsuxCtfX.js} +1 -1
- package/dist/client/assets/{HomeHero-CdUVPjkG.js → HomeHero-DXJo2QSO.js} +1 -1
- package/dist/client/assets/{HostAdvisorView-Bok5Sk5c.js → HostAdvisorView-DeJ-8RZV.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-B7XSoJsu.js → KnowledgeSearchInspector-W_zNIBRV.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-_rxJNUUh.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-HByf2ndx.js → LaneToolHoverCard-t7-XJP-h.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-DNIECgEl.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-DM-hoPxG.js → LaneTraceEventFocus-BB5DhFQm.js} +1 -1
- package/dist/client/assets/{MeshCanvas-DCLJRsBy.js → MeshCanvas-DZv2ipsy.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-cEFS9eW7.js → MeshCanvasMinimap-BXHRNb7l.js} +1 -1
- package/dist/client/assets/MeshScreen-DuNvpDC5.js +1 -0
- package/dist/client/assets/{MeshTopologyView-CCRPd8PU.js → MeshTopologyView-Dc0GSrKa.js} +2 -2
- package/dist/client/assets/MessagesScreen-dNNPFwAc.js +1 -0
- package/dist/client/assets/{MissionContextRail-DF0_kiU7.js → MissionContextRail-DnCWPzAM.js} +1 -1
- package/dist/client/assets/MissionControlView-DmaThhNR.js +1 -0
- package/dist/client/assets/MissionFocusOverlay-K21ssTxv.js +1 -0
- package/dist/client/assets/MissionLeftAgentRow-CbQm4BLv.js +1 -0
- package/dist/client/assets/{MissionLogPane-BbdDKjUl.js → MissionLogPane-BLvSSIdT.js} +1 -1
- package/dist/client/assets/{NewAgentModal-DfHxad34.js → NewAgentModal-B7qxjZlW.js} +1 -1
- package/dist/client/assets/NewChatComposer-D2Ah4T-W.js +19 -0
- package/dist/client/assets/{NewChatOrigin-B1u7ki70.js → NewChatOrigin-DCn5cWPZ.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-Co0xTii6.js → ObserveEmbedScreen-DvKGsaLv.js} +2 -2
- package/dist/client/assets/{ObserveTextFlow-ZQWwrK3i.js → ObserveTextFlow-DCJ5EmD8.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-BJUhDSuQ.js → ObservedTopologyPanel-CJVqIqQ2.js} +1 -1
- package/dist/client/assets/{OpenScoutAppShell-CUd2yOLu.js → OpenScoutAppShell-C9TOLB7u.js} +2 -2
- package/dist/client/assets/OpsAgentsView-vIoY-AW1.js +1 -0
- package/dist/client/assets/OpsScreen-CJBwshEp.js +1 -0
- package/dist/client/assets/OpsSubnav-CjDTnp64.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-Br1eTD7G.js +1 -0
- package/dist/client/assets/ProjectAgentProfileBar-CUzZ4Rpx.js +1 -0
- package/dist/client/assets/ProjectAgentProfileHero-mjxNcRvw.js +1 -0
- package/dist/client/assets/ProjectsInbox-Bq29DE_o.js +2 -0
- package/dist/client/assets/ProjectsRail-kMDA0yn4.js +1 -0
- package/dist/client/assets/ProjectsScreen-BDaJYhc0.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-B940p3vW.js +1 -0
- package/dist/client/assets/Provider-D0bB7q6y.js +1 -0
- package/dist/client/assets/{RailRow-CEH2MFBw.js → RailRow-B88JVr62.js} +1 -1
- package/dist/client/assets/RawSessionsTable-CzGhEdiZ.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-CyP1CWsX.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-kY2pHjIs.js → RepoDiffEmbedScreen-mexrJPhW.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-C6LhoKrn.js → RepoDiffPageScreen-DbqX4L3q.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-BhcIIQQg.js → RepoDiffViewer-Bw5yMC4A.js} +1 -1
- package/dist/client/assets/{RepoDiffViewerLazy-Csy_j9LD.js → RepoDiffViewerLazy-DzfoFhbl.js} +2 -2
- package/dist/client/assets/{ReposScreen-B_cB0zu7.js → ReposScreen-CzbO1Fuy.js} +2 -2
- package/dist/client/assets/{ScoutDeckSurface-CSy_fjcG.js → ScoutDeckSurface-DQoZofzH.js} +1 -1
- package/dist/client/assets/{ScoutSurface-CQVcSrin.js → ScoutSurface-NlhDsPzg.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-DqGiLYNy.js → ScoutbotFxLab-l2WAahCg.js} +1 -1
- package/dist/client/assets/{SecondaryNav-BR4VRdgh.js → SecondaryNav-Cs0_FQdj.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-BTlZ9gAg.js → SessionEmbedScreen-CpduQ0O9.js} +1 -1
- package/dist/client/assets/{SessionObserve-dQDN23pP.js → SessionObserve-BVeTkcIl.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-BRBGKAgd.js → SessionObserveEvidence-BkOezTGV.js} +1 -1
- package/dist/client/assets/SessionRefScreen-DetLMkTT.js +1 -0
- package/dist/client/assets/SessionsScreen-B-McKw6d.js +1 -0
- package/dist/client/assets/{SettingsDrawer-RGVK_bmE.js → SettingsDrawer-CPB32w0n.js} +3 -3
- package/dist/client/assets/SettingsScreen-BEzYFdjz.js +1 -0
- package/dist/client/assets/{ShikiPane-DYI9Hkge.js → ShikiPane-C0TuCATU.js} +1 -1
- package/dist/client/assets/{SlidePanel-B9ugxWgA.js → SlidePanel-CETQ5NTx.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-z5hHesx9.js → SpriteAvatar-DFO4Kb4Z.js} +1 -1
- package/dist/client/assets/{StatusPill-BFvMjmZV.js → StatusPill-BllrY-eg.js} +1 -1
- package/dist/client/assets/{TailView-0uEIj2JH.js → TailView-_gKWfaQM.js} +2 -2
- package/dist/client/assets/Terminal-DWyZTZdY.js +1 -0
- package/dist/client/assets/TerminalEmbedScreen-_SSzwhWa.js +1 -0
- package/dist/client/assets/{TerminalHeaderMount-BL07cd0q.js → TerminalHeaderMount-CY7uIWBg.js} +1 -1
- package/dist/client/assets/{TextDocumentSurface-BflAwXeZ.js → TextDocumentSurface-2X1Gw4eA.js} +1 -1
- package/dist/client/assets/{TmuxPeek-BTnjOQi0.js → TmuxPeek-CqTJRhkI.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-CgQ6GGS-.js → VoicePermissionsPanel-C4vkU-sU.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-CaLG-zDs.js → WorkDetailScreen-DqGnuK0e.js} +3 -3
- package/dist/client/assets/{WorkFilesViewer-B9Sil_No.js → WorkFilesViewer-D8-4vF5l.js} +1 -1
- package/dist/client/assets/{activity-DcrMApUY.js → activity-CzTJ-YMX.js} +1 -1
- package/dist/client/assets/{addon-fit-DMVrz5Sv.js → addon-fit-Zx3A7pGS.js} +1 -1
- package/dist/client/assets/{addon-webgl-BYvpZUyu.js → addon-webgl-DitJj-N0.js} +1 -1
- package/dist/client/assets/{agent-autocomplete-B-5QTeas.js → agent-autocomplete-BlK8wY06.js} +1 -1
- package/dist/client/assets/{agent-essentials-D7KRGYvF.js → agent-essentials-K9B6kbTS.js} +1 -1
- package/dist/client/assets/{agent-lane-card-model-CNZMPkhc.js → agent-lane-card-model-CY3OE1Xu.js} +1 -1
- package/dist/client/assets/{agent-lanes-model-DXqjs0OK.js → agent-lanes-model-tc-1hE6q.js} +1 -1
- package/dist/client/assets/{agent-master-model-DqjrVI2h.js → agent-master-model-DMcHeNq3.js} +1 -1
- package/dist/client/assets/agent-specialization-CtF_jI34.js +1 -0
- package/dist/client/assets/agents-project-DgbqDc65.css +1 -0
- package/dist/client/assets/{arc.es-NHqHWohb.js → arc.es-BNXJqSw7.js} +1 -1
- package/dist/client/assets/{arrow-down-CKtSUjmW.js → arrow-down-BAGkhHA6.js} +1 -1
- package/dist/client/assets/{arrow-left-Czpf-AE4.js → arrow-left-eToA6GxC.js} +1 -1
- package/dist/client/assets/{arrow-right-BuzMnLYP.js → arrow-right-DTX42clh.js} +1 -1
- package/dist/client/assets/{arrow-up-right-C6Wl-1uw.js → arrow-up-right-B09GPwFl.js} +1 -1
- package/dist/client/assets/{bot-rd0awxD3.js → bot-WxKXYtEX.js} +1 -1
- package/dist/client/assets/{check-ofKUE8yH.js → check-Dz2SRHft.js} +1 -1
- package/dist/client/assets/{chevron-down-wciXnOQz.js → chevron-down-D120PY4g.js} +1 -1
- package/dist/client/assets/{chevron-right-D-HdlPg8.js → chevron-right-CowuvuE6.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-Tyv9rzx7.js → chunk-HRAB3GC3-KjjrTLCU.js} +1 -1
- package/dist/client/assets/{chunk-JTPDIGGW-BC2Mandc.js → chunk-JTPDIGGW-COJ00z94.js} +3 -3
- package/dist/client/assets/{chunk-T65CQEWV-C1AWTYZZ.js → chunk-T65CQEWV-H2QEKfr1.js} +1 -1
- package/dist/client/assets/{chunk-YOZR3KYS-DwHPHa6f.js → chunk-YOZR3KYS-CrCgXw9l.js} +1 -1
- package/dist/client/assets/{clock-B88r8OrZ.js → clock-_9FDplIT.js} +1 -1
- package/dist/client/assets/{code-xml-D7pOQM9l.js → code-xml-CkkNdRmu.js} +1 -1
- package/dist/client/assets/{compass-Dt1AMXz2.js → compass-BdpImt_W.js} +1 -1
- package/dist/client/assets/content-0RBfbCIJ.js +1 -0
- package/dist/client/assets/content-BTmnk2bl.js +1 -0
- package/dist/client/assets/content-Bk5DKhyP.js +1 -0
- package/dist/client/assets/{content-nkx0swDe.js → content-Bw_8GE_S.js} +1 -1
- package/dist/client/assets/content-CI4gLEWi.js +1 -0
- package/dist/client/assets/content-CLCtp9Rb.js +1 -0
- package/dist/client/assets/content-C_FAGTNk.js +1 -0
- package/dist/client/assets/content-CnnzWOE3.js +1 -0
- package/dist/client/assets/content-DKlY98pO.js +1 -0
- package/dist/client/assets/content-Df7ndXTG.js +1 -0
- package/dist/client/assets/content-DkZDzzx3.js +1 -0
- package/dist/client/assets/content-DnGmb2L0.js +1 -0
- package/dist/client/assets/content-Ds-zs-Ss.js +1 -0
- package/dist/client/assets/content-JIWSyC0f.js +1 -0
- package/dist/client/assets/content-Q3TIYC8q.js +1 -0
- package/dist/client/assets/content-evaBfvxD.js +1 -0
- package/dist/client/assets/{context-budget-DX_fwUs3.js → context-budget-DqxWzalx.js} +1 -1
- package/dist/client/assets/{conversation-icons-tp9BX6X2.js → conversation-icons-DHGc9wbT.js} +1 -1
- package/dist/client/assets/conversation-model-C2KuZUXc.js +1 -0
- package/dist/client/assets/conversation-motion-features-BJnHs3Ul.js +1 -0
- package/dist/client/assets/{copy-CWWAJ75H.js → copy-BzdzWsQd.js} +1 -1
- package/dist/client/assets/{cpu-DrqejfkB.js → cpu-CHFIGw87.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DezKXSG2.js → createLucideIcon-Dv8H8m7J.js} +1 -1
- package/dist/client/assets/discover-DutlV0ZU.js +2 -0
- package/dist/client/assets/embed-entry-CJG7WEVw.js +2 -0
- package/dist/client/assets/{external-link-Dp_a2vRZ.js → external-link-BvX5PfLh.js} +1 -1
- package/dist/client/assets/{eye-BRyD0jno.js → eye-C9cGk5z6.js} +1 -1
- package/dist/client/assets/{file-code-corner-muIVH_xO.js → file-code-corner-jlGFdr8d.js} +1 -1
- package/dist/client/assets/{file-text-CqJgwxmv.js → file-text-BHro8MkG.js} +1 -1
- package/dist/client/assets/{gauge-hU--hKVP.js → gauge-DSflSery.js} +1 -1
- package/dist/client/assets/{gestures-DN4hEeqv.js → gestures-YA5IIwp-.js} +1 -1
- package/dist/client/assets/{git-branch-CK5v8F2v.js → git-branch-Bc_eDIpG.js} +1 -1
- package/dist/client/assets/{home-moving-signal-BjDtEJUP.js → home-moving-signal-PHSqSBu_.js} +1 -1
- package/dist/client/assets/home-now-card-C_qsI6C6.js +1 -0
- package/dist/client/assets/{home-now-card-nano-C-r_bBg5.js → home-now-card-nano-Jmy7eJ6H.js} +1 -1
- package/dist/client/assets/{hooks-D46bABUP.js → hooks-ME7rmhpE.js} +1 -1
- package/dist/client/assets/{index-DvLtl7rV.js → index-C1VaWNuD.js} +2 -2
- package/dist/client/assets/index-C8UCRm2W.js +1 -0
- package/dist/client/assets/index-Cn0I2Hgi.js +1 -0
- package/dist/client/assets/index-Cx6Gbr6n.js +1 -0
- package/dist/client/assets/{inspector-panel-Dkc7rLvY.js → inspector-panel-CwrHjRaQ.js} +2 -2
- package/dist/client/assets/{keyboard-nav-BLYDhL3Z.js → keyboard-nav-B8sQ_8IF.js} +1 -1
- package/dist/client/assets/{lane-roster-store-DOdI1O13.js → lane-roster-store-DN2jxXF-.js} +1 -1
- package/dist/client/assets/{layers-CSsg3JVP.js → layers-CW2-qHsG.js} +1 -1
- package/dist/client/assets/{layout-grid-DOChPJdZ.js → layout-grid-BoVnPOk-.js} +1 -1
- package/dist/client/assets/left-BRu9pnqx.js +2 -0
- package/dist/client/assets/left-BjS1dKNV.js +2 -0
- package/dist/client/assets/left-CL-TVLJ7.js +1 -0
- package/dist/client/assets/left-DLpsDi55.js +1 -0
- package/dist/client/assets/left-DPcM9o8Y.js +1 -0
- package/dist/client/assets/left-MmTJf1tK.js +1 -0
- package/dist/client/assets/left-P80i5V8L.js +1 -0
- package/dist/client/assets/left-advisor-CbXVzAqS.js +1 -0
- package/dist/client/assets/left-agents-7mJsiNyr.js +1 -0
- package/dist/client/assets/left-default-COK26l3H.js +1 -0
- package/dist/client/assets/left-lanes-Dbdm9Veu.js +1 -0
- package/dist/client/assets/left-mission-DqGR5jby.js +1 -0
- package/dist/client/assets/library-COnWzUWv.js +1 -0
- package/dist/client/assets/{loader-circle-pM56HNhR.js → loader-circle-DmUG_YC7.js} +1 -1
- package/dist/client/assets/{local-agents-C8xAhbO5.js → local-agents-VP1-ZlPw.js} +1 -1
- package/dist/client/assets/{mentions-DG6OQrsc.js → mentions-BZ5SBMtc.js} +1 -1
- package/dist/client/assets/mesh-buckets-CLYS8Jx8.js +1 -0
- package/dist/client/assets/{mesh-ops-BZ1h5RQs.js → mesh-ops-CKSWgax2.js} +1 -1
- package/dist/client/assets/{mesh-view-store-ChUOASK8.js → mesh-view-store-CBM1za_N.js} +1 -1
- package/dist/client/assets/{message-circle-mZCv8tvB.js → message-circle-joGFxfj1.js} +1 -1
- package/dist/client/assets/{message-markup-C2LQDm_k.js → message-markup-DC0QFEZn.js} +1 -1
- package/dist/client/assets/{message-square-C7t_qtuj.js → message-square-BLiFqpe_.js} +1 -1
- package/dist/client/assets/{mission-control-store-nDLdUZPA.js → mission-control-store-CM8mQGg8.js} +1 -1
- package/dist/client/assets/model-CBkMvT1w.js +1 -0
- package/dist/client/assets/{observe-BpEm1INu.js → observe-BLmy4quB.js} +1 -1
- package/dist/client/assets/{page-status-E5jnk48p.js → page-status-BE0-J1xY.js} +1 -1
- package/dist/client/assets/{paperclip-C64lkcbM.js → paperclip-Br7wUDFl.js} +1 -1
- package/dist/client/assets/{persistent-state-EHXw8WNy.js → persistent-state-BubPQ7tT.js} +1 -1
- package/dist/client/assets/{plus-Co-dqKul.js → plus-BWKhylds.js} +1 -1
- package/dist/client/assets/profile-BCvk8jOQ.js +1 -0
- package/dist/client/assets/projects-inbox-BIW7nv-H.css +1 -0
- package/dist/client/assets/projects-inbox-DFbgVlXL.js +1 -0
- package/dist/client/assets/{proxy-BiW5suC7.js → proxy-DVDRhSRR.js} +1 -1
- package/dist/client/assets/{radio-BOxBQX-T.js → radio-CxIXS1nU.js} +1 -1
- package/dist/client/assets/{refresh-cw-DMxGzDwn.js → refresh-cw-Bkh7Cvnd.js} +1 -1
- package/dist/client/assets/resolve-panes-DhD5qmQO.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-GqhZNRPY.js +1 -0
- package/dist/client/assets/right-B_08ilv6.js +1 -0
- package/dist/client/assets/right-Brm67HOL.js +1 -0
- package/dist/client/assets/right-BveAPKBW.js +1 -0
- package/dist/client/assets/right-CpTB_-Ya.js +1 -0
- package/dist/client/assets/right-CqC4Qdot.js +1 -0
- package/dist/client/assets/right-D91j9d5Y.js +1 -0
- package/dist/client/assets/{right-CimaAvQN.js → right-DVUq5374.js} +1 -1
- package/dist/client/assets/right-DaLRhYl3.js +1 -0
- package/dist/client/assets/right-Dt1wOwA5.js +1 -0
- package/dist/client/assets/right-DtzqIZQF.js +1 -0
- package/dist/client/assets/{rocket-BQm5_CvR.js → rocket-CnxqjX_K.js} +1 -1
- package/dist/client/assets/{router-B9vQkNJL.js → router-kfcaYqZr.js} +1 -1
- package/dist/client/assets/runtime-picker-C20lTGhV.js +1 -0
- package/dist/client/assets/{scope-views-1IYJdl41.js → scope-views-KPY85UUx.js} +1 -1
- package/dist/client/assets/{scout-voice-BVUqGhth.js → scout-voice-Cg1qfepC.js} +1 -1
- package/dist/client/assets/scoutbot-D7kGGyK_.js +3 -0
- package/dist/client/assets/{scoutbot-markdown-BQ_Ee2Ic.js → scoutbot-markdown-yb87JlSE.js} +1 -1
- package/dist/client/assets/{scroll-text-Dze_dXtQ.js → scroll-text-DFcBYy5J.js} +1 -1
- package/dist/client/assets/{search-CDko0PKE.js → search-FB2vVxCp.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-BoQ_zYR9.js → secondaryNavConfig-C0Srrmy8.js} +1 -1
- package/dist/client/assets/{selection-bridge-Din6yV3h.js → selection-bridge-qBGFCJv8.js} +1 -1
- package/dist/client/assets/{send-horizontal-CSjIm6xg.js → send-horizontal-CS7mxVhX.js} +1 -1
- package/dist/client/assets/{server-Bzj7lPIx.js → server-WY6gsbZz.js} +1 -1
- package/dist/client/assets/{session-catalog-DsaZJXZt.js → session-catalog-CG4oL_yN.js} +1 -1
- package/dist/client/assets/{session-table-BQfR7u6r.js → session-table-uJh3v-ly.js} +1 -1
- package/dist/client/assets/{settings-Dyvpkb1D.js → settings-DQEtqkM9.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-C8njVwfg.js → sliders-horizontal-57e99_qO.js} +1 -1
- package/dist/client/assets/{sparkles-CETYrxGA.js → sparkles-D0vWLTyC.js} +1 -1
- package/dist/client/assets/{sse-CD9MMUxl.js → sse-B29iGBnw.js} +1 -1
- package/dist/client/assets/{system-surfaces-redesign-QVXNeGYw.css → system-surfaces-redesign-kuf3wuE_.css} +1 -1
- package/dist/client/assets/{tail-events-Ps8KpKah.js → tail-events-LK29oCKm.js} +1 -1
- package/dist/client/assets/{terminal-9GRS_Qdc.js → terminal-UDy4lzV1.js} +1 -1
- package/dist/client/assets/{terminal-relay-GYMIvKs1.js → terminal-relay-CXHMdain.js} +1 -1
- package/dist/client/assets/{terminal-screen-BLk4PAYt.css → terminal-screen-vMICbBJh.css} +1 -1
- package/dist/client/assets/{terminal-sessions-BQ6t92tJ.js → terminal-sessions-Bdt2W3Y4.js} +1 -1
- package/dist/client/assets/{terminal-takeover-_Jyys4me.js → terminal-takeover-BMeBjBB2.js} +1 -1
- package/dist/client/assets/{use-conversation-list-C9ABzjXI.js → use-conversation-list-UG-tMN67.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-DAspZQjE.js → use-fleet-active-asks-CCGrll5q.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-Dh54ymEp.js → use-mesh-ops-items-BjyeFJTz.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-x8pJMVrG.js → use-reduced-motion-CPoX8iV2.js} +1 -1
- package/dist/client/assets/{use-scout-dev-flags-DhCbiDK3.js → use-scout-dev-flags-DTseRrFi.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-DoBwV0LX.js → useAgentHoverCard-BgTLNcF-.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-CoIoz7JU.js +1 -0
- package/dist/client/assets/useEmbedHeadline-DuUnwTB7.js +1 -0
- package/dist/client/assets/{usePierreRuntime-ejq9dCWV.js → usePierreRuntime-35AHf9RQ.js} +1 -1
- package/dist/client/assets/{wrench-DjkoAOQt.js → wrench-BfVeded5.js} +1 -1
- package/dist/client/assets/{x-CAbNespN.js → x-DgmmnPKt.js} +1 -1
- package/dist/client/assets/{xterm-Cf-ngcGP.js → xterm-DnJJmrCA.js} +1 -1
- package/dist/client/assets/{zap-Cq8eWkcF.js → zap-Bcja1lHG.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/main.mjs +5180 -9874
- package/dist/node/main.mjs +18 -2
- package/dist/pairing-runtime-controller.mjs +31 -2
- package/dist/runtime/broker-daemon.mjs +87 -13
- package/dist/scout-control-plane-web.mjs +35 -3
- package/package.json +2 -5
- package/dist/client/assets/ActivityScreen-BnoaUkVZ.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-CuZJy07q.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-Iyl4BesU.js +0 -1
- package/dist/client/assets/AgentFloorView-YT-Jjccf.js +0 -1
- package/dist/client/assets/AgentInfoScreen-Dr99gQEZ.js +0 -1
- package/dist/client/assets/AgentLanesEmbedScreen-Dgcm7zd_.js +0 -1
- package/dist/client/assets/AgentLanesView-CetZZDyF.js +0 -2
- package/dist/client/assets/AgentMasterScreen-DJPnstoD.js +0 -1
- package/dist/client/assets/AgentsConsole-CsYOoFJi.js +0 -1
- package/dist/client/assets/AgentsScreen-k8LvBuU_.js +0 -1
- package/dist/client/assets/AgentsSubnav-C4xpQhsv.js +0 -1
- package/dist/client/assets/BriefingDetailScreen-CUCXO-KH.js +0 -1
- package/dist/client/assets/BrokerScreen-BPbOHhCS.js +0 -5
- package/dist/client/assets/CodeScreen-CeuO3EhR.js +0 -1
- package/dist/client/assets/ConversationComposer-CXPKx86g.js +0 -1
- package/dist/client/assets/ConversationFeedRows-WrH-YI3L.js +0 -1
- package/dist/client/assets/ConversationHeader-BQWzGzLK.js +0 -1
- package/dist/client/assets/ConversationScreen-CR9pWB65.js +0 -2
- package/dist/client/assets/CrewWorkspaces-CkQDhyie.css +0 -1
- package/dist/client/assets/CrewWorkspaces-NKujRzwh.js +0 -1
- package/dist/client/assets/FlightObserveScreen-6mGnmWQA.js +0 -1
- package/dist/client/assets/HarnessesScreen-CHTuv8p6.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-D3o3IODW.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-BUgHz-sd.js +0 -1
- package/dist/client/assets/MeshScreen-BcxPkhm6.js +0 -1
- package/dist/client/assets/MessagesScreen-Bb5l13MO.js +0 -1
- package/dist/client/assets/MissionControlView-E3V7bENU.js +0 -1
- package/dist/client/assets/MissionFocusOverlay-h15sQFvP.js +0 -1
- package/dist/client/assets/MissionLeftAgentRow-KPdk9rSa.js +0 -1
- package/dist/client/assets/NewChatComposer-_Stj0fZy.js +0 -19
- package/dist/client/assets/OpsAgentsView-DI5wu1si.js +0 -1
- package/dist/client/assets/OpsScreen-D8fQafCl.js +0 -1
- package/dist/client/assets/OpsSubnav-1K4Jaf__.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-Bdjd_dAx.js +0 -1
- package/dist/client/assets/ProjectAgentProfileBar-k2QHHHsQ.js +0 -1
- package/dist/client/assets/ProjectAgentProfileHero-Bpxk1ui2.js +0 -1
- package/dist/client/assets/ProjectsInbox-C_bMHLCc.js +0 -2
- package/dist/client/assets/ProjectsRail-J-aH_pxT.js +0 -1
- package/dist/client/assets/ProjectsScreen-cVUkGbPz.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-_ourdM-Q.js +0 -1
- package/dist/client/assets/Provider-CtXJeLrP.js +0 -1
- package/dist/client/assets/RawSessionsTable-CDyrom-F.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-DBl3DN1H.js +0 -1
- package/dist/client/assets/SessionRefScreen-COVQMbtE.js +0 -1
- package/dist/client/assets/SessionsScreen--5OJ3p3v.js +0 -1
- package/dist/client/assets/SettingsScreen-CCxzy5IU.js +0 -1
- package/dist/client/assets/Terminal-DouZeNxc.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-dMNUbzXr.js +0 -1
- package/dist/client/assets/agent-specialization-BujJVUTD.js +0 -1
- package/dist/client/assets/agents-project-COzHxZAF.css +0 -1
- package/dist/client/assets/agents-project-model-UYiamtrU.js +0 -1
- package/dist/client/assets/content-9K38QchR.js +0 -1
- package/dist/client/assets/content-BRgnyXWh.js +0 -1
- package/dist/client/assets/content-BWPNyXJ0.js +0 -1
- package/dist/client/assets/content-BdkI07v3.js +0 -1
- package/dist/client/assets/content-C4oWa8SB.js +0 -1
- package/dist/client/assets/content-C9ijJxyl.js +0 -1
- package/dist/client/assets/content-CFZ4rghn.js +0 -1
- package/dist/client/assets/content-CIqu_Ci_.js +0 -1
- package/dist/client/assets/content-CnJF9DGO.js +0 -1
- package/dist/client/assets/content-CriW8Y8u.js +0 -1
- package/dist/client/assets/content-DDCyPPk_.js +0 -1
- package/dist/client/assets/content-DtcZeh5m.js +0 -1
- package/dist/client/assets/content-U9tsdtle.js +0 -1
- package/dist/client/assets/content-hFLK3CON.js +0 -1
- package/dist/client/assets/content-p00KQrtD.js +0 -1
- package/dist/client/assets/conversation-model-Dc02NsGp.js +0 -1
- package/dist/client/assets/conversation-motion-features-D9-RmBSq.js +0 -1
- package/dist/client/assets/discover-C2CZO4Tk.js +0 -2
- package/dist/client/assets/embed-entry-BSMUykuG.js +0 -2
- package/dist/client/assets/home-now-card-nF8OotI-.js +0 -1
- package/dist/client/assets/index-CPrU5q04.js +0 -1
- package/dist/client/assets/index-kL1WLbeS.js +0 -1
- package/dist/client/assets/index-zvhpRHao.js +0 -1
- package/dist/client/assets/left-B-SdEJSJ.js +0 -1
- package/dist/client/assets/left-B3wSE6ql.js +0 -1
- package/dist/client/assets/left-BNRFiRsb.js +0 -2
- package/dist/client/assets/left-BggzhgXN.js +0 -1
- package/dist/client/assets/left-CARCvvxS.js +0 -2
- package/dist/client/assets/left-CpokZYHt.js +0 -1
- package/dist/client/assets/left-YT7mIGuH.js +0 -1
- package/dist/client/assets/left-advisor-CCY0vkcO.js +0 -1
- package/dist/client/assets/left-agents-trhO5sL8.js +0 -1
- package/dist/client/assets/left-default-CG33elBs.js +0 -1
- package/dist/client/assets/left-lanes-CitMgeTp.js +0 -1
- package/dist/client/assets/left-mission-Zl2m_5eU.js +0 -1
- package/dist/client/assets/library-DkALuCh5.js +0 -1
- package/dist/client/assets/mesh-buckets-6y3ZIibI.js +0 -1
- package/dist/client/assets/mesh-roster-Bc7T4b7z.js +0 -1
- package/dist/client/assets/model-IGCUEsMy.js +0 -1
- package/dist/client/assets/profile-APxDsN2P.js +0 -1
- package/dist/client/assets/projects-inbox-Cg4X2lUQ.js +0 -1
- package/dist/client/assets/projects-inbox-DRBl2N85.css +0 -1
- package/dist/client/assets/resolve-panes-DeVJbS9c.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-BQe5J6xF.js +0 -1
- package/dist/client/assets/right-Bmfd3pjP.js +0 -1
- package/dist/client/assets/right-BqI-nr9G.js +0 -1
- package/dist/client/assets/right-BuCgE0fZ.js +0 -1
- package/dist/client/assets/right-BwlW6E57.js +0 -1
- package/dist/client/assets/right-C0ybUw0j.js +0 -1
- package/dist/client/assets/right-CdkcrmeD.js +0 -1
- package/dist/client/assets/right-CkCCPbCX.js +0 -1
- package/dist/client/assets/right-D3eSiy41.js +0 -1
- package/dist/client/assets/right-Dz_xD0Vj.js +0 -1
- package/dist/client/assets/scoutbot-BJIamJOH.js +0 -3
- package/dist/client/assets/text-BP3oyl8-.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-pZe2Zfk1.js +0 -1
- /package/dist/client/assets/{text-BYAFNLNq.css → runtime-picker-BYAFNLNq.css} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as o,G as is,I as ls}from"./index-C1VaWNuD.js";/* empty css */import{u as Xs,b as Qs}from"./Provider-D0bB7q6y.js";import{a as be}from"./api-Co9aQ2Jw.js";import{c as Os}from"./clipboard-e3fSpeo7.js";import{d as Zs,c as Kt}from"./colors-BtO5_zlx.js";import{r as ne,S as os,a as cs,w as Oe,s as Ut,b as Bt,d as Ht,c as qt,e as et,f as Ae,g as Yt}from"./terminal-relay-CXHMdain.js";import{p as st,m as tt,f as nt,b as rt,n as at,s as F,d as ts,o as ns,r as it,i as lt,t as ds,e as ot,q as Vt,u as Gt,j as Jt}from"./terminal-sessions-Bdt2W3Y4.js";import{H as Xt,u as ms,a as Qt,c as Zt,h as en,b as sn,A as tn}from"./HerdrSession-DsuxCtfX.js";import{D as nn,c as rn,P as an,d as us,s as Xe,T as ln,a as on}from"./session-table-uJh3v-ly.js";import{u as ps,T as cn}from"./chunk-JTPDIGGW-COJ00z94.js";import{u as Le,L as hs}from"./chunk-YOZR3KYS-CrCgXw9l.js";import{q as dn}from"./terminal-takeover-BMeBjBB2.js";import{t as mn}from"./time-Dhsh_2EG.js";import{B as xe}from"./BackToPicker-BHicJyfc.js";import{T as ct}from"./TmuxPeek-CqTJRhkI.js";import{TerminalHeaderMount as un}from"./TerminalHeaderMount-CY7uIWBg.js";import{R as fs}from"./refresh-cw-Bkh7Cvnd.js";import{E as ks}from"./external-link-BvX5PfLh.js";import{P as fe}from"./plus-BWKhylds.js";import{T as B}from"./terminal-UDy4lzV1.js";import{c as bs}from"./createLucideIcon-Dv8H8m7J.js";import{Z as dt}from"./zap-Bcja1lHG.js";import{S as pn}from"./runtime-picker-C20lTGhV.js";import{X as ye}from"./x-DgmmnPKt.js";import{E as hn}from"./eye-C9cGk5z6.js";import"./router-kfcaYqZr.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./conversation-model-C2KuZUXc.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./loader-circle-DmUG_YC7.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./check-Dz2SRHft.js";import"./copy-BzdzWsQd.js";import"./arrow-down-BAGkhHA6.js";/* empty css */import"./voice-levels-Dcr3jglk.js";const mt=6,ut=2;function Pe(s){if(s.layout?.mode)return{mode:s.layout.mode,...s.layout.columns===void 0?{}:{columns:fn(s.layout.columns)}};const t=s.cellCount??0,n=$e(s.columns??ut);return t<=1?{mode:"solo"}:n>=t?{mode:"lanes",columns:n}:{mode:"grid",columns:n}}function ze(s,t){const n=Math.max(1,Math.floor(t.tileCount)||1);if(s.mode==="solo")return 1;if(s.columns===void 0||s.columns==="dynamic"){const i=s.mode==="lanes"?n:Math.ceil(Math.sqrt(n));return Math.max(1,Math.min(mt,i))}return $e(s.columns)}function fn(s){return s==="dynamic"?"dynamic":$e(s)}function kn(s){if(s.mode==="solo")return"Solo";const t=s.mode==="lanes"?"Lanes":"Grid";return s.columns===void 0||s.columns==="dynamic"?`${t} · dynamic`:`${t} · ${s.columns} column${s.columns===1?"":"s"}`}function $e(s){return typeof s!="number"||!Number.isFinite(s)?ut:Math.max(1,Math.min(mt,Math.floor(s)))}const bn=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],rs=bs("ellipsis",bn);const xn=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],pt=bs("grid-2x2",xn);const yn=[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]],jn=bs("grip-horizontal",yn),xs=6;function gn(s="main",t="Main"){return{version:1,activeWorkspaceId:s,workspaces:[{id:s,name:t,tiles:[]}]}}function ys(){return{version:1,activeWorkspaceId:"",workspaces:[]}}function Ps(s,t,n={}){const i=()=>n.allowEmpty?ys():gn();if(!s||typeof s!="object")return i();const d=s;if(!Array.isArray(d.workspaces))return i();const l=[],m=new Set;for(const c of d.workspaces){if(!c||typeof c!="object")continue;const k=typeof c.id=="string"?c.id.trim():"",b=typeof c.name=="string"?c.name.trim():"";if(!k||!b||m.has(k)||!Array.isArray(c.tiles))continue;m.add(k);const j=typeof c.purpose=="string"?c.purpose.trim():"",N=wn(c.columns),M=Sn(c.layout),O=typeof c.updatedAt=="number"&&Number.isFinite(c.updatedAt)&&c.updatedAt>=0?c.updatedAt:null;l.push({id:k,name:b,tiles:c.tiles.filter(t),...j?{purpose:j}:{},...N?{columns:N}:{},...M?{layout:M}:{},...O===null?{}:{updatedAt:O}})}return l.length===0?i():{version:1,activeWorkspaceId:typeof d.activeWorkspaceId=="string"&&m.has(d.activeWorkspaceId)?d.activeWorkspaceId:l[0].id,workspaces:l}}function Sn(s){if(!s||typeof s!="object")return null;const t=s;if(t.mode!=="solo"&&t.mode!=="lanes"&&t.mode!=="grid")return null;if(t.columns===void 0)return{mode:t.mode};if(t.columns==="dynamic")return{mode:t.mode,columns:"dynamic"};const n=$e(t.columns);return{mode:t.mode,columns:n}}function wn(s){if(typeof s!="number"||!Number.isFinite(s))return null;const t=Math.floor(s);return t<1?null:Math.min(t,xs)}function zs(s,t){const n=t.id.trim();if(!n)return s;const i={...t,id:n},l=s.workspaces.some(m=>m.id===n)?s.workspaces.map(m=>m.id===n?i:m):[i,...s.workspaces];return{...s,activeWorkspaceId:n,workspaces:l}}function $s(s,t,n){const i=s.workspaces.findIndex(u=>u.id===t);if(i<0)return s;const d=s.workspaces[i],l={...d,...n};return Object.keys(n).every(u=>d[u]===l[u])?s:{...s,workspaces:s.workspaces.map((u,c)=>c===i?l:u)}}function Nn(s,t){return t===s.activeWorkspaceId||!s.workspaces.some(n=>n.id===t)?s:{...s,activeWorkspaceId:t}}function vn(s,t,n={}){if(s.workspaces.length<=1)return n.allowEmpty&&s.workspaces[0]?.id===t?ys():s;const i=s.workspaces.findIndex(m=>m.id===t);if(i<0)return s;const d=s.workspaces.filter(m=>m.id!==t),l=s.activeWorkspaceId===t?d[Math.min(i,d.length-1)].id:s.activeWorkspaceId;return{...s,activeWorkspaceId:l,workspaces:d}}function Cn(s,t,n){return n>1?{axis:"horizontal",edge:s.x<t.left+t.width/2?"before":"after"}:{axis:"vertical",edge:s.y<t.top+t.height/2?"before":"after"}}function Tn(s,t,n,i){if(t===n)return[...s];const d=s.findIndex(b=>b.id===t),l=s.findIndex(b=>b.id===n);if(d<0||l<0)return[...s];const m=[...s],[u]=m.splice(d,1);if(!u)return[...s];const c=m.findIndex(b=>b.id===n),k=i==="after"?c+1:c;return m.splice(Math.max(0,k),0,u),m}const In="openscout.terminal.workspaces.v1",Rn=2,En="openscout.terminal.workspace-view.v1",Qe=2;function De(s){const t=typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);return`${s}-${Date.now().toString(36)}-${t}`}const Mn=24;function ht(s,t,n){const i=t.replace(/[^A-Za-z0-9_-]+/gu,"-").replace(/^[^A-Za-z0-9_]+/u,"").slice(0,Mn).replace(/-+$/u,""),d=Wn(JSON.stringify([n,t,s]));return`scout-${s}-${i||"cell"}-${d}`}function Wn(s){let t=2166136261;for(let n=0;n<s.length;n+=1)t^=s.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,"0")}function he(s,t="shell"){return{id:De("cell"),kind:"fresh",backend:s,agent:t}}function _s(s){if(!s||typeof s!="object")return!1;const t=s;return typeof t.id!="string"||!t.id.trim()?!1:t.kind==="fresh"?typeof t.backend=="string"&&typeof t.agent=="string":t.kind==="registered"?typeof t.terminalSessionId=="string"&&typeof t.terminalSurfaceKey=="string":!1}function Fs(s){return{id:s.id,name:s.name,...s.purpose?{purpose:s.purpose}:{},columns:s.columns,...s.layout?{layout:s.layout}:{},updatedAt:s.updatedAt,tiles:s.cells.map(t=>t.surfaceId&&t.terminalSessionId?{id:t.id,kind:"registered",terminalSessionId:t.terminalSessionId,terminalSurfaceKey:t.surfaceId}:{id:t.id,kind:"fresh",backend:Ln(t.intent.hostId)?t.intent.hostId:"pty",agent:"shell"})}}function Ze(s,t={}){return{id:s.id,name:s.name,purpose:s.purpose??"",columns:ze(Pe({layout:s.layout,columns:s.columns,cellCount:s.tiles.length}),{tileCount:s.tiles.length}),layout:Pe({layout:s.layout,columns:s.columns,cellCount:s.tiles.length}),cells:s.tiles.map(n=>n.kind==="registered"?{id:n.id,surfaceId:n.terminalSurfaceKey,terminalSessionId:n.terminalSessionId,intent:An(n,t.sessions??[])}:{id:n.id,intent:{hostId:n.backend,sessionName:n.backend==="pty"?null:ht(n.backend,n.id,s.id)}})}}function An(s,t){const n=st(s.terminalSurfaceKey),i=t.find(d=>d.id===s.terminalSessionId||d.surfaces.some(l=>tt(l,s.terminalSurfaceKey)));return{...n?{hostId:n.backend,sessionName:n.hostSession}:{},...i?.cwd?{cwd:i.cwd}:{},...i?.harness?{harness:i.harness}:{},...i?.resumeCommand?{resumeCommand:i.resumeCommand}:{}}}function Ln(s){return s==="pty"||s==="tmux"||s==="zellij"||s==="herdr"}function Dn(s){if(!Array.isArray(s))return Ps(s,_s,{allowEmpty:!0});const t=s.flatMap(n=>{if(!n||typeof n!="object")return[];const i=n;if(typeof i.id!="string"||!i.id.trim())return[];const d=Array.isArray(i.cells)?i.cells:[];return[{id:i.id,name:typeof i.name=="string"&&i.name.trim()?i.name:i.id,purpose:i.purpose,columns:i.columns,updatedAt:i.updatedAt,tiles:d.map((l,m)=>({...l,id:`${i.id}-${m}`}))}]});return Ps({activeWorkspaceId:t[0]?.id??"",workspaces:t},_s,{allowEmpty:!0})}function On(s,t,n){const i=s.find(d=>d.id===t);return i?i.capabilities.control.includes(n)||i.capabilities.harnessControl.includes(n):!1}function Pn(s,t){return s.find(n=>n.id===t)??null}function zn(s){return[{value:"pty",label:"Shell",detail:"Disposable local shell",relayAttach:!0},...s.filter(t=>t.availability.installed&&t.capabilities.create).map(t=>({value:t.id,label:t.label,detail:t.description,relayAttach:t.capabilities.relayAttach})).sort((t,n)=>Number(n.relayAttach)-Number(t.relayAttach)||t.value.localeCompare(n.value))]}async function $n(){return be("/api/terminal-workspaces")}async function Ks(s){return(await be(`/api/terminal-workspaces/${encodeURIComponent(s.id)}`,{method:"PUT",body:JSON.stringify(s)})).workspace}async function _n(s,t){return be(`/api/terminal-workspaces/${encodeURIComponent(s)}/cells/${encodeURIComponent(t)}/revive`,{method:"POST",body:"{}"})}async function Fn(s){return(await be(`/api/terminal-workspaces/${encodeURIComponent(s)}`,{method:"DELETE"})).deleted}function Kn(s){const t=new Map;for(const n of s?.cells??[])t.set(n.cellId,n);return t}const Us="scout:terminal-send-line";function Un(s){const t=s.detail;if(!t||typeof t!="object"||!("line"in t))return null;const n=t.line;return typeof n=="string"&&n.trim().length>0?n:null}const te=["multiplexer","agent","session"];function Bn(s,t){if(t==="Home")return te[0];if(t==="End")return te[te.length-1];const n=t==="ArrowRight"||t==="ArrowDown"?1:t==="ArrowLeft"||t==="ArrowUp"?-1:0;if(n===0)return null;const d=(te.indexOf(s)+n+te.length)%te.length;return te[d]??null}function es(s){return`terminal-picker-tab-${s}`}function Bs(){return"terminal-picker-panel"}const ke=typeof window>"u"?o.useEffect:o.useLayoutEffect,Hn="openscout.terminal.picker-view.v1",qn="openscout.terminal.picker-source.v1",Hs={mode:"grid",columns:"dynamic"},qs=[{mode:"solo",label:"Solo",detail:"One terminal, full width",minimumCells:1},{mode:"lanes",label:"Lanes",detail:"Side by side, one row",minimumCells:2},{mode:"grid",label:"Grid",detail:"Rows and columns",minimumCells:4}],ft=[{value:"shell",label:"Shell"},{value:"codex",label:"Codex"},{value:"claude",label:"Claude"},{value:"pi",label:"Pi"}],ss="'JetBrainsMono Nerd Font', 'JetBrainsMonoNL Nerd Font', 'MesloLGS Nerd Font Mono', 'Hack Nerd Font Mono', 'JetBrains Mono', monospace",Ys=s=>{},Yn=()=>{};function Vn(){if(typeof window>"u")return{fontFamily:ss,fontSize:13};const s=new URLSearchParams(window.location.search),t=s.get("terminalFontFamily")?.trim(),n=Number(s.get("terminalFontSize"));return{fontFamily:t?`'${t.replaceAll("'","\\'")}', ${ss}`:ss,fontSize:Number.isFinite(n)&&n>=9&&n<=32?n:13}}function js(s){const t=Vn();return e.jsx(cn,{...s,renderer:s.renderer??"auto",fontFamily:t.fontFamily,fontSize:t.fontSize})}function Gn(s,t){const[n,i]=o.useState({state:"loading",sessions:[]}),d=o.useCallback(()=>{i(m=>({state:"loading",sessions:m.sessions})),nt({includeDiscovered:!0}).then(m=>{i({state:"ready",sessions:m})}).catch(m=>{i(u=>({state:"failed",sessions:u.sessions,error:m instanceof Error?m.message:String(m)}))})},[]);return o.useEffect(()=>{d()},[d]),{target:o.useMemo(()=>it(n.sessions,s,t),[n.sessions,s,t]),loadState:n.state,loadSessions:d,hasSessionHint:!!s}}function Jn(s,t,n){const i=Ut(t,n),[d,l]=o.useState(i?{state:"preparing"}:{state:"ready"}),[m,u]=o.useState(0);return o.useEffect(()=>{if(!i||!s){l({state:"ready"});return}let c=!1;return l({state:"preparing"}),be(`/api/agents/${encodeURIComponent(s)}/session-catalog`).then(k=>{if(k.resumeCommand)return dn({command:k.resumeCommand,cwd:k.resumeCwd,agentId:s})}).then(()=>{c||l({state:"ready"})}).catch(k=>{c||l({state:"failed",error:k instanceof Error?k.message:String(k)})}),()=>{c=!0}},[s,i,m]),{ready:d.state==="ready",label:d.state==="failed"?"TAKEOVER FAILED":"PREPARING TAKEOVER",status:d.state==="failed"?d.error:"Resolving live session...",onRetry:d.state==="failed"?()=>u(c=>c+1):void 0}}function Xn(s){const{agentId:t,agent:n,mode:i,navigate:d,registeredTarget:l,showContextMenu:m}=s,{hosts:u}=ms(),c=n?Zs(n.name):"var(--accent)",k=o.useRef(null),b=l?ds(l.surface):ne(n),j=i==="observe",N=l?.session.cwd??n?.cwd??n?.projectRoot??void 0,M=is(),O=ls(),S=Bt({agentId:t,agent:n,registeredTarget:l,terminalSurface:b,relayUrl:M,harness:l?.session.harness??n?.harness,cwd:N,mode:i}),f=ps({url:S.scopedRelayUrl,healthUrl:O,autoConnect:!0,...j?{}:{sessionKey:S.relayStorageSessionKey},...S.surfaceOptions??{},...S.orphanTTL?{orphanTTL:S.orphanTTL}:{},...S.cwd?{cwd:S.cwd}:{},...S.relayAgent?{agent:S.relayAgent}:{},controlMode:S.controlMode});ke(()=>{f.resize(os,cs)},[f.resize]);const v=o.useMemo(()=>j?{...f,sendInput:Ys,sendLine:Ys,restart:Yn}:f,[j,f]),w=Ht({agentId:t,registeredTarget:l}),P=Oe(w,i),R=o.useCallback(()=>{const y=k.current;y?.querySelector(".xterm-helper-textarea")?.focus(),y?.querySelector(".xterm")?.focus()},[]);o.useEffect(()=>{const y=K=>{const U=K.detail?.line;return typeof U=="string"&&U.length>0?U:null},D=K=>{const U=y(K);!U||j||(v.sendInput(U),R())},L=K=>{const U=y(K);!U||j||(v.sendLine(U),R())};return window.addEventListener("scout:terminal-send-input",D),window.addEventListener("scout:terminal-send-line",L),()=>{window.removeEventListener("scout:terminal-send-input",D),window.removeEventListener("scout:terminal-send-line",L)}},[R,j,v]);const E=o.useCallback(y=>b?qt(b,y):null,[b]),W=o.useCallback(()=>{Os(et(P))},[P]),H=o.useCallback(()=>{j||!navigator.clipboard?.readText||navigator.clipboard.readText().then(y=>{y&&v.sendInput(y)}).catch(()=>{})},[j,v]),x=o.useCallback(()=>{Ae(S.relayStorageSessionKey);const y=E("detach");if(y){y.finally(()=>f.disconnect());return}f.disconnect()},[S.relayStorageSessionKey,f,E]),A=o.useCallback(()=>{Ae(S.relayStorageSessionKey);const y=E("force-quit-bridge");if(y){y.finally(()=>{f.connect(),window.setTimeout(R,250)});return}f.connect(),window.setTimeout(R,250)},[S.relayStorageSessionKey,R,f,E]),T=o.useCallback(()=>{if(j)return;const y=E("interrupt");y?y.catch(()=>v.sendInput("")):v.sendInput(""),R()},[R,j,E,v]),$=o.useCallback(()=>{if(j)return;const y=E("quit");y?y.catch(()=>v.sendInput("")):v.sendInput(""),R()},[R,j,E,v]),Y=o.useCallback(()=>{if(j)return;const y=E("stop-job");if(y){y.finally(R);return}R()},[R,j,E]),de=o.useCallback(()=>{if(Ae(S.relayStorageSessionKey),b&&!window.confirm(`Force quit Claude in ${ns(b.sessionName)}?`))return;const y=E("force-quit");if(y){y.finally(()=>f.disconnect());return}const D=f.sessionId;if(!D){f.disconnect();return}Yt(D).catch(()=>{}).finally(()=>f.disconnect())},[S.relayStorageSessionKey,f,E,b]),z=o.useCallback(()=>{if(!b||!window.confirm(`Restart Claude in ${ns(b.sessionName)} and resume its latest session?`))return;Ae(S.relayStorageSessionKey);const y=E("restart-resume");y&&y.finally(()=>{f.disconnect(),window.setTimeout(()=>{f.connect(),window.setTimeout(R,250)},600)})},[S.relayStorageSessionKey,R,f,E,b]),V=o.useCallback(y=>{d(Oe(w,y))},[d,w]),J=o.useCallback(()=>{d(w)},[d,w]),_e=!!(l||b),Z=!j&&!!(b||f.status==="connected"),re=!j&&!!b,ee=o.useMemo(()=>{const y=b?.backend??null,D=U=>On(u,y,U),L=[];(!y||D("detach"))&&L.push({kind:"action",label:"Leave this session running",onSelect:x}),L.push({kind:"action",label:"Reconnect",onSelect:A});const K=[];return D("restart-resume")&&K.push({kind:"action",label:"Restart Claude and resume",onSelect:z}),D("force-quit")&&K.push({kind:"action",label:"Force quit Claude",onSelect:de}),K.length>0&&L.push({kind:"separator"},...K),L},[x,de,A,z,u,b?.backend]),je=o.useMemo(()=>{const y=[...ee],D=[];Z&&D.push({kind:"action",label:"Send Ctrl-C",shortcut:"⌃C",onSelect:T},{kind:"action",label:"Quit With Ctrl-D",shortcut:"⌃D",onSelect:$}),re&&D.push({kind:"action",label:"Stop Running Job",onSelect:Y}),D.length>0&&y.push({kind:"separator"},...D);const L=[];return b&&L.push({kind:"action",label:j?"Open Takeover":"Open Observe",onSelect:()=>V(j?"takeover":"observe")}),l&&L.push({kind:"action",label:"Open Summary",onSelect:J}),L.length>0&&y.push({kind:"separator"},...L),y},[Z,re,T,V,J,$,j,l,ee,Y,b]),ge=o.useCallback(y=>{m(y,je)},[je,m]),ae=o.useCallback(y=>{const D=typeof window>"u"?"":window.getSelection()?.toString()??"",L=[];D.trim()&&L.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{Os(D)}}),j||L.push({kind:"action",label:"Paste",shortcut:"⌘V",onSelect:H},{kind:"action",label:"Send Ctrl-C",shortcut:"⌃C",onSelect:T},{kind:"action",label:"Quit With Ctrl-D",shortcut:"⌃D",onSelect:$},{kind:"action",label:"Stop Running Job",onSelect:Y}),L.length>0&&L.push({kind:"separator"}),L.push({kind:"action",label:"Focus Terminal",onSelect:R},...ee,{kind:"separator"},{kind:"action",label:j?"Open Takeover":"Open Observe",onSelect:()=>V(j?"takeover":"observe")},{kind:"action",label:"Open Summary",onSelect:J},{kind:"action",label:"Copy Terminal Link",onSelect:W}),m(y,L)},[W,R,T,V,J,H,$,j,ee,m,Y]);return{color:c,terminalBodyRef:k,terminalSurface:b,readOnly:j,relay:f,terminalRelay:v,healthUrl:O,scopedRelayUrl:S.scopedRelayUrl,hasViewActions:_e,canSignalTerminal:Z,canStopTerminalJob:re,handleSessionMenu:ge,handleTerminalContextMenu:ae,openMode:V,openSummary:J,interruptTerminal:T,quitTerminal:$,stopTerminalJob:Y,terminalRouteBase:w}}function Qn({agent:s,agentId:t,color:n,navigate:i,label:d,status:l,onRetry:m}){return e.jsxs("div",{className:"s-term",children:[e.jsxs("div",{className:"s-term-bar",children:[e.jsx(xe,{slot:"terminal",fallback:{view:"terminal"},navigate:i,className:"s-term-back"}),s&&e.jsxs("div",{className:"s-term-agent",children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"18px",background:n},children:s.name[0]?.toUpperCase()}),e.jsx("span",{className:"s-term-agent-name",children:s.name}),s.handle&&e.jsxs("span",{className:"s-term-agent-handle",children:["@",s.handle]})]}),e.jsx("span",{className:"s-term-label",children:d}),e.jsx("div",{className:"s-term-status",children:m?"OFFLINE":"CONNECTING"})]}),e.jsx("div",{className:"s-term-body s-term-body--placeholder",children:e.jsxs("div",{className:"s-term-placeholder",children:[e.jsx("span",{children:l}),m&&e.jsx("button",{type:"button",onClick:m,children:"Retry"})]})})]})}function Zn({target:s,navigate:t}){const n=o.useMemo(()=>rt([s.session]).find(m=>F(m.surface)===F(s.surface)),[s]),i={view:"terminal",terminalSessionId:s.session.id,terminalSurfaceKey:F(s.surface)},d=Vt(s.session,s.surface),l=Gt(s);return e.jsx("div",{className:"s-term s-term--summary",children:e.jsxs("div",{className:"s-term-summary",children:[e.jsxs("div",{className:"s-term-summary-main",children:[e.jsx(xe,{slot:"terminal",fallback:{view:"terminal"},navigate:t,className:"s-term-back"}),e.jsxs("div",{className:"s-term-summary-mark",children:[e.jsx(B,{size:18,strokeWidth:1.7}),e.jsx("span",{children:"Terminal"})]}),e.jsxs("div",{className:"s-term-summary-heading",children:[e.jsx("h1",{children:n?.title??s.surface.sessionName}),e.jsxs("p",{children:[s.surface.backend," · ",d]})]}),e.jsxs("div",{className:"s-term-summary-actions",children:[e.jsxs("button",{type:"button",className:"s-term-summary-action s-term-summary-action--primary",onClick:()=>t(Oe(i,"takeover")),children:[e.jsx(hs,{size:14,strokeWidth:1.8}),e.jsx("span",{children:"Enter"})]}),e.jsxs("button",{type:"button",className:"s-term-summary-action",onClick:()=>t(Oe(i,"observe")),children:[e.jsx(hn,{size:14,strokeWidth:1.8}),e.jsx("span",{children:"Observe"})]})]})]}),e.jsx("div",{className:"s-term-summary-preview",children:e.jsx(ct,{surface:ds(s.surface),lines:26,columns:112,pollMs:3e4,idlePollMs:3e4,className:"s-term-preview-peek"})}),e.jsx("dl",{className:"s-term-summary-details",children:l.map(([m,u])=>e.jsxs("div",{className:"s-term-summary-detail",children:[e.jsx("dt",{children:m}),e.jsx("dd",{title:u,children:u})]},m))})]})})}function gs({agentId:s,agent:t,mode:n,navigate:i,registeredTarget:d,embedded:l=!1,tileActions:m}){const u=Qs(),c=Xn({agentId:s,agent:t,mode:n,navigate:i,registeredTarget:d,showContextMenu:u}),k=c.relay.status==="connected"?"LIVE":c.relay.status==="connecting"?"CONNECTING":"OFFLINE",b=c.relay.status==="connected"?"live":c.relay.status==="connecting"?"connecting":"offline";return e.jsxs("div",{className:`s-term${l?" s-term--embedded":""}`,children:[!l&&e.jsxs("div",{className:"s-term-bar s-term-bar--takeover",children:[e.jsxs("div",{className:"s-term-bar-left",children:[e.jsx(xe,{slot:"terminal",fallback:{view:"terminal"},navigate:i,className:"s-term-back"}),t&&e.jsxs("div",{className:"s-term-agent",children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"18px",background:c.color},children:t.name[0]?.toUpperCase()}),e.jsx("span",{className:"s-term-agent-name",children:t.name}),t.handle&&e.jsxs("span",{className:"s-term-agent-handle",children:["@",t.handle]})]}),d&&e.jsxs("div",{className:"s-term-registered-chip",children:[e.jsx(B,{size:14,strokeWidth:1.8}),e.jsx("span",{children:d.session.harness}),e.jsx("span",{children:d.session.sourceSessionId})]})]}),e.jsxs("div",{className:"s-term-bar-meta",children:[e.jsx("span",{className:"s-term-label",children:c.terminalSurface?c.readOnly?"TERMINAL OBSERVE":"TERMINAL TAKEOVER":"TAKEOVER"}),c.terminalSurface&&e.jsx("span",{className:"s-term-session",title:c.terminalSurface.sessionName,children:ns(c.terminalSurface.sessionName)})]}),e.jsxs("div",{className:"s-term-bar-actions",children:[c.hasViewActions&&e.jsxs("div",{className:"s-term-action-cluster s-term-action-cluster--view","aria-label":"Terminal view actions",children:[d&&e.jsx("button",{type:"button",className:"s-term-action",onClick:c.openSummary,title:"Leave the terminal canvas and show the session summary",children:"Summary"}),c.terminalSurface&&e.jsx("button",{type:"button",className:"s-term-action",onClick:()=>c.openMode(c.readOnly?"takeover":"observe"),title:c.readOnly?"Switch to interactive takeover":"Switch to read-only terminal observe",children:c.readOnly?"Takeover":"Observe"})]}),(c.canSignalTerminal||c.canStopTerminalJob)&&e.jsxs("div",{className:"s-term-action-cluster s-term-action-cluster--signals","aria-label":"Terminal signal actions",children:[c.canSignalTerminal&&e.jsxs("button",{type:"button",className:"s-term-action s-term-action--warn",onClick:c.interruptTerminal,title:"Send Ctrl-C to the terminal",children:[e.jsx(dt,{size:13,strokeWidth:1.8}),e.jsx("span",{children:"Ctrl-C"})]}),c.canSignalTerminal&&e.jsxs("button",{type:"button",className:"s-term-action s-term-action--warn",onClick:c.quitTerminal,title:"Send Ctrl-D / EOF to the terminal",children:[e.jsx(an,{size:13,strokeWidth:1.8}),e.jsx("span",{children:"Quit"})]}),c.canStopTerminalJob&&e.jsxs("button",{type:"button",className:"s-term-action s-term-action--warn",onClick:c.stopTerminalJob,title:"Stop Claude's current shell/tool job without quitting Claude",children:[e.jsx(pn,{size:12,strokeWidth:2}),e.jsx("span",{children:"Stop Job"})]})]}),e.jsxs("button",{type:"button",className:"s-term-action s-term-session-menu",onClick:c.handleSessionMenu,title:"Open session, recovery, and external handoff actions",children:[e.jsx(rs,{size:14,strokeWidth:1.8}),e.jsx("span",{children:"Session"})]}),e.jsx("div",{className:"s-term-status",children:k}),m]})]}),e.jsxs("div",{ref:c.terminalBodyRef,className:"s-term-body",onContextMenuCapture:c.handleTerminalContextMenu,children:[l&&e.jsxs("div",{className:"s-term-float","aria-label":"Terminal tile actions",children:[e.jsx("span",{className:"s-term-float-grip",title:"Drag to move","aria-hidden":"true",onPointerDown:j=>j.preventDefault(),children:e.jsx(jn,{size:14,strokeWidth:1.8})}),d&&e.jsxs("span",{className:"s-term-float-identity",title:`${d.session.harness} ${d.session.sourceSessionId}`,children:[e.jsx("span",{children:d.session.harness}),e.jsx("span",{children:d.session.sourceSessionId})]}),e.jsx("span",{className:`s-term-float-mark s-term-float-mark--${b}`,role:"status",title:k,"aria-label":`Relay ${k.toLowerCase()}`}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:c.handleSessionMenu,title:"Session actions","aria-label":"Session actions",children:e.jsx(rs,{size:14,strokeWidth:1.8})}),m]}),e.jsx(js,{relay:c.terminalRelay,readOnly:c.readOnly,quiet:!0,configItems:[...c.terminalSurface?[{label:"backend",value:c.terminalSurface.backend},{label:"session",value:c.terminalSurface.sessionName},...c.terminalSurface.paneId?[{label:"pane",value:c.terminalSurface.paneId}]:[],...c.terminalSurface.socketDir?[{label:"socket",value:c.terminalSurface.socketDir}]:[],{label:"mode",value:c.readOnly?"read-only":"takeover"}]:[],{label:"ws",value:c.scopedRelayUrl},{label:"health",value:c.healthUrl}]})]})]})}function er({terminalSessionId:s,terminalSurfaceKey:t,mode:n,navigate:i}){const{target:d,loadState:l,loadSessions:m,hasSessionHint:u}=Gn(s,t);return d&&n?e.jsx(gs,{agent:null,mode:n,navigate:i,registeredTarget:d},`${F(d.surface)}:${n}`):d?e.jsx(Zn,{target:d,navigate:i}):e.jsx("div",{className:"s-term s-term--empty-main",children:e.jsxs("div",{className:"s-term-empty-main-mark",children:[e.jsx(B,{size:18,strokeWidth:1.6}),e.jsx("span",{children:l==="loading"?"Loading terminal":l==="failed"?"Terminal list unavailable":u?"Terminal unavailable":"Select a terminal"}),l==="failed"&&e.jsx("button",{type:"button",className:"s-term-empty-action",onClick:m,children:"Retry"})]})})}function sr(s,t){return s.kind!=="fresh"||!s.sessionName?!1:t.some(n=>n.surfaces.some(i=>i.backend===s.backend&&i.sessionName===s.sessionName&&i.state!=="exited"))}function ce(s){return`${s.session.id}:${F(s.surface)}`}function tr(s,t,n){if(s.kind==="fresh")return{id:s.id,kind:"fresh",backend:s.backend,agent:s.agent,...s.backend==="pty"?{}:{sessionName:ht(s.backend,s.id,n)}};const i=it(t,s.terminalSessionId,s.terminalSurfaceKey);return i?{id:s.id,kind:"registered",target:i}:{id:s.id,kind:"unavailable",terminalSessionId:s.terminalSessionId,terminalSurfaceKey:s.terminalSurfaceKey}}function G(s){return{session:s.session,surface:s.surface}}function nr(s){const t=s.backend;return t!=="pty"&&!lt(t)?null:{view:"terminal",terminalBackend:t,terminalAgent:s.agent,terminalTabId:s.id,...s.sessionName?{terminalSessionName:s.sessionName}:{},...s.zellijSocketDir?{zellijSocketDir:s.zellijSocketDir}:{}}}function rr(s,t="takeover"){return{view:"terminal",terminalSessionId:s.session.id,terminalSurfaceKey:F(s.surface),mode:t}}function kt(s,t){if(typeof window>"u"){t(s);return}window.open(et(s),"_blank","noopener,noreferrer")}function ar({navigate:s}){const{agents:t}=Xs(),n=Qs(),{hosts:i}=ms(),d=o.useMemo(()=>zn(i),[i]),[l,m]=Le(In,ys(),{version:Rn,migrate:Dn}),[u,c]=Le(En,"library"),k=o.useRef(new Map),[b,j]=o.useState(null),[N,M]=o.useState(""),[O,S]=o.useState(""),[f,v]=o.useState(Hs),[w,P]=o.useState(()=>Array.from({length:4},()=>he("pty"))),[R,E]=o.useState(0),[W,H]=o.useState({state:"loading",sessions:[]}),[x,A]=o.useState(0),[T,$]=o.useState(!0),[Y,de]=Le(Hn,"list"),[z,V]=Le(qn,"multiplexer"),[J,_e]=o.useState(nn),[Z,re]=o.useState(null),[ee,je]=o.useState([]),[ge,ae]=o.useState(null),[y,D]=o.useState(null),[L,K]=o.useState(null),[U,Ns]=o.useState(!1),[Se,vs]=o.useState(null),[yt,Fe]=o.useState(null),we=o.useRef(null),Ne=o.useRef(null),ve=o.useRef("after"),Ce=o.useRef(null),Te=o.useRef(null),Ke=o.useRef(!1),X=o.useCallback((r={})=>{r.silent||H(a=>({state:"loading",sessions:a.sessions})),nt({includeDiscovered:!0}).then(a=>H({state:"ready",sessions:a})).catch(a=>{r.silent||H(p=>({state:"failed",sessions:p.sessions,error:a instanceof Error?a.message:String(a)}))})},[]);o.useEffect(()=>{X()},[X]),o.useEffect(()=>{const r=()=>{document.visibilityState==="visible"&&X({silent:!0})},a=window.setInterval(r,8e3);return window.addEventListener("focus",r),document.addEventListener("visibilitychange",r),()=>{window.clearInterval(a),window.removeEventListener("focus",r),document.removeEventListener("visibilitychange",r)}},[X]),o.useEffect(()=>{let r=!1;return $n().then(a=>{if(!r){je(a.resolutions);for(const p of a.workspaces)k.current.set(p.id,JSON.stringify(Ze(Fs(p),{sessions:W.sessions})));a.workspaces.length!==0&&m(p=>{let h=p;for(const g of a.workspaces)h=zs(h,Fs(g));return{...h,activeWorkspaceId:p.activeWorkspaceId||h.activeWorkspaceId}})}}).catch(()=>{}),()=>{r=!0}},[m]);const Cs=o.useMemo(()=>rt(W.sessions),[W.sessions]),q=o.useMemo(()=>Cs.filter(r=>r.surface.state!=="exited"),[Cs]),{managed:ie}=o.useMemo(()=>at(q),[q]),me=o.useMemo(()=>q.filter(r=>r.origin==="scout"),[q]),Ie=o.useMemo(()=>hr(t).filter(r=>!!ne(r)),[t]),Re=ie.find(r=>r.id===Z)??ie[0]??null;o.useEffect(()=>{Re?.id!==Z&&re(Re?.id??null)},[Re?.id,Z]);const Ue=o.useMemo(()=>{if(z==="multiplexer")return ie;if(z==="session")return me;const r=new Set;return Ie.flatMap(a=>{const p=q.find(h=>Ss(h,[a])?.id===a.id);return!p||r.has(p.id)?[]:(r.add(p.id),[p])})},[me,q,ie,z,Ie]),Ts=W.state==="failed"?W.error:null,Be=l.workspaces,I=l.workspaces.find(r=>r.id===l.activeWorkspaceId)??null,le=Pe({layout:I?.layout,columns:I?.columns,cellCount:I?.tiles.length??0}),Q=o.useMemo(()=>(I?.tiles??[]).map(r=>tr(r,W.sessions,I?.id??"")),[I?.id,I?.tiles,W.sessions]),He=ze(le,{tileCount:Q.length});o.useEffect(()=>{if(!I||!k.current.has(I.id))return;const r=Ze(I,{sessions:W.sessions}),a=JSON.stringify(r);k.current.get(I.id)!==a&&(k.current.set(I.id,a),Ks(r).catch(p=>ae(p instanceof Error?p.message:String(p))))},[I,W.sessions]);const oe=u==="workspace"&&!I?"library":u,_=o.useCallback(r=>{m(a=>{const p=a.workspaces.find(g=>g.id===a.activeWorkspaceId);if(!p)return a;const h=r(p.tiles);return h===p.tiles?a:$s(a,p.id,{tiles:h,updatedAt:Date.now()})})},[m]),Ee=o.useCallback(r=>{m(a=>a.activeWorkspaceId?$s(a,a.activeWorkspaceId,{layout:r,updatedAt:Date.now()}):a)},[m]),jt=o.useCallback(r=>{m(a=>Nn(a,r.id)),$(!1),c("workspace")},[m,c]),gt=o.useCallback(()=>{c("library")},[c]),ue=o.useCallback(r=>{j(r?.id??null),M(r?.name??""),S(r?.purpose??""),v(r?Pe({layout:r.layout,columns:r.columns,cellCount:r.tiles.length}):Hs),P(r?.tiles??Array.from({length:4},()=>he("pty"))),E(0),c("builder")},[c]),St=o.useCallback(r=>{v(a=>r.mode==="solo"?{mode:"solo"}:{mode:r.mode,columns:a.columns??"dynamic"}),P(a=>a.length>=r.minimumCells?a:[...a,...Array.from({length:r.minimumCells-a.length},()=>he("pty"))]),E(a=>Math.max(0,Math.min(a,r.minimumCells-1)))},[]),wt=o.useCallback(r=>{v(a=>a.mode==="solo"?{mode:"lanes",columns:r}:{...a,columns:r})},[]),Nt=o.useCallback(()=>{P(r=>{const a=[...r,he("pty")];return E(a.length-1),a})},[]),vt=o.useCallback(r=>{P(a=>{if(a.length<=1)return a;const p=a.filter((h,g)=>g!==r);return E(h=>Math.min(h,p.length-1)),p})},[]),Ct=o.useCallback(()=>{const r=N.trim();if(!r)return;const a={id:b??De("workspace"),name:r,purpose:O.trim(),columns:ze(f,{tileCount:w.length}),layout:f,tiles:w,updatedAt:Date.now()};m(h=>zs(h,a));const p=Ze(a,{sessions:W.sessions});k.current.set(a.id,JSON.stringify(p)),Ks(p).catch(h=>ae(h instanceof Error?h.message:String(h))),$(!1),c("workspace")},[b,m,c,W.sessions,w,f,N,O]),Tt=o.useCallback(r=>{m(a=>vn(a,r,{allowEmpty:!0})),Fn(r).catch(()=>{})},[m]),Is=o.useCallback((r,a="shell")=>{_(p=>[...p,he(r,a)])},[_]),pe=o.useCallback((r,a)=>{const p={kind:"registered",terminalSessionId:r.session.id,terminalSurfaceKey:F(r.surface)};_(h=>{const g=h.some(C=>C.kind==="registered"&&C.terminalSessionId===p.terminalSessionId&&ts(C.terminalSurfaceKey,p.terminalSurfaceKey));return a?h.some(C=>C.id===a)?h.map(C=>C.id===a?{...p,id:C.id}:C):h:g?h:[...h,{...p,id:De("cell")}]})},[_]),qe=o.useCallback(r=>{pe(r)},[pe]),Ye=o.useMemo(()=>new Set(Q.filter(r=>r.kind==="registered").map(r=>ce(r.target))),[Q]),Me=o.useCallback(r=>{r?.currentTarget.hasPointerCapture(r.pointerId)&&r.currentTarget.releasePointerCapture(r.pointerId),Ce.current=null,Te.current=null,Ke.current=!1,D(null),K(null),Ns(!1)},[]),It=o.useCallback((r,a)=>{const p=r.target;r.button!==0||p instanceof Element&&p.closest("button, a")||(Ce.current={pointerId:r.pointerId,target:G(a),targetId:ce(G(a)),startX:r.clientX,startY:r.clientY},r.currentTarget.setPointerCapture(r.pointerId))},[]),Rt=o.useCallback(r=>{const a=Ce.current;if(!a||a.pointerId!==r.pointerId||Math.hypot(r.clientX-a.startX,r.clientY-a.startY)<6&&!y)return;y||D(a.targetId);const h=document.querySelector(".s-term--workspace");if(h){const Ds=h.getBoundingClientRect();r.clientY<Ds.top+72&&(h.scrollTop-=28),r.clientY>Ds.bottom-72&&(h.scrollTop+=28)}const g=document.elementFromPoint(r.clientX,r.clientY),C=g?.closest(".s-term-workspace-cell"),se=!!(g?.closest(".s-term-workspace-add-cell")||!C&&g?.closest(".s-term--workspace")&&!g?.closest(".s-term-picker")),Ls=se?null:C?.dataset.terminalTileId??null;Te.current=Ls,Ke.current=se,K(Ls),Ns(se)},[y]),Et=o.useCallback(r=>{const a=Ce.current;!a||a.pointerId!==r.pointerId||(Ke.current?pe(a.target):Te.current&&pe(a.target,Te.current),Me(r))},[Me,pe]),Mt=o.useCallback(r=>{Me(r)},[Me]),Wt=o.useCallback(()=>{const r=Ue.map(G);r.length!==0&&_(a=>{const p=a.filter(g=>g.kind==="registered"),h=r.filter(g=>!p.some(C=>C.kind==="registered"&&C.terminalSessionId===g.session.id&&ts(C.terminalSurfaceKey,F(g.surface)))).map(g=>({id:De("cell"),kind:"registered",terminalSessionId:g.session.id,terminalSurfaceKey:F(g.surface)}));return h.length===0?a:[...a,...h]})},[Ue,_]),Ve=o.useCallback(r=>{_(a=>{const p=a.filter(h=>h.id!==r);return p.length===a.length?a:p})},[_]),Rs=o.useCallback((r,a,p)=>{r!==a&&_(h=>Tn(h,r,a,p))},[_]),Ge=o.useCallback((r,a)=>{_(p=>{const h=p.findIndex(se=>se.id===r),g=h+a;if(h<0||g<0||g>=p.length)return p;const C=[...p];return[C[h],C[g]]=[C[g],C[h]],C})},[_]),Es=o.useCallback((r,a)=>{_(p=>p.map(h=>h.id===r?{id:h.id,kind:"fresh",backend:a,agent:"shell"}:h))},[_]),We=o.useCallback(()=>[...qs.map(r=>({kind:"action",label:r.label,onSelect:()=>Ee(r.mode==="solo"?{mode:"solo"}:{mode:r.mode,columns:le.columns??"dynamic"})})),...le.mode==="solo"?[]:[{kind:"separator"},{kind:"action",label:"Dynamic columns",onSelect:()=>Ee({...le,columns:"dynamic"})},...Array.from({length:xs},(r,a)=>({kind:"action",label:a===0?"One column":`${a+1} columns`,onSelect:()=>Ee({...le,columns:a+1})}))],{kind:"separator"},{kind:"action",label:"Edit workspace…",onSelect:()=>I&&ue(I)}],[I,Ee,ue,le]),Ms=o.useCallback(r=>{n(r,We())},[We,n]),At=o.useCallback(r=>{n(r,ft.map(a=>({kind:"action",label:a.value==="shell"?"New shell":`New ${a.label} terminal`,onSelect:()=>Is("pty",a.value)})))},[Is,n]),Lt=o.useCallback((r,a)=>{const p=Q.findIndex(g=>g.id===a.id),h=[];p>0&&h.push({kind:"action",label:"Move left",onSelect:()=>Ge(a.id,-1)}),p>=0&&p<Q.length-1&&h.push({kind:"action",label:"Move right",onSelect:()=>Ge(a.id,1)}),h.length>0&&h.push({kind:"separator"}),h.push(...d.map(g=>({kind:"action",label:g.value==="pty"?"Replace with a disposable shell":`Replace with a session that survives (${g.label})`,onSelect:()=>Es(a.id,g.value)})),{kind:"separator"},{kind:"action",label:"Remove cell",onSelect:()=>Ve(a.id)},{kind:"separator"},...We()),n(r,h)},[Ve,We,Ge,Es,n,d,Q]),Dt=o.useCallback((r,a)=>{const p=r.target;r.button===0&&p instanceof Element&&p.closest(".s-term-bar, .s-term-float-grip")&&!p.closest("button, a")&&(we.current={pointerId:r.pointerId,tileId:a,startX:r.clientX,startY:r.clientY},r.currentTarget.setPointerCapture(r.pointerId))},[]),Ot=o.useCallback(r=>{const a=we.current;if(!a||a.pointerId!==r.pointerId||Math.hypot(r.clientX-a.startX,r.clientY-a.startY)<6&&!Se)return;Se||vs(a.tileId);const h=document.elementFromPoint(r.clientX,r.clientY)?.closest(".s-term-workspace-cell"),g=h?.dataset.terminalTileId??null;if(!h||!g||g===a.tileId){Ne.current=null,ve.current="after",Fe(null);return}const C=h.getBoundingClientRect(),se=Cn({x:r.clientX,y:r.clientY},{left:C.left,top:C.top,width:C.width,height:C.height},He);Ne.current=g,ve.current=se.edge,Fe(g)},[Se,He]),Ws=o.useCallback(r=>{const a=we.current;if(!a||a.pointerId!==r.pointerId)return;const p=Ne.current;p&&Rs(a.tileId,p,ve.current),r.currentTarget.hasPointerCapture(r.pointerId)&&r.currentTarget.releasePointerCapture(r.pointerId),we.current=null,Ne.current=null,ve.current="after",vs(null),Fe(null)},[Rs]),Pt=o.useMemo(()=>Kn(ee.find(r=>r.workspaceId===I?.id)),[I?.id,ee]),As=o.useCallback(r=>{_e(a=>rn(a,r))},[]),zt=o.useCallback((r,a)=>{const p=Bn(a,r.key);p&&(r.preventDefault(),V(p),document.getElementById(es(p))?.focus())},[V]),$t=o.useCallback(()=>{X(),A(r=>r+1)},[X]),_t=o.useCallback(r=>{I&&_n(I.id,r).then(()=>{ae(null),X()}).catch(a=>ae(a instanceof Error?a.message:String(a)))},[I,X]),Ft=o.useCallback(()=>{c(I?"workspace":"library")},[I,c]),Je=e.jsx(un,{children:e.jsxs("div",{className:"s-term-topline","aria-label":"Terminal workspace controls",children:[e.jsxs("div",{className:"s-term-topline-context",children:[e.jsx("strong",{children:oe==="builder"?b?"Edit workspace":"New workspace":oe==="library"?"Workspaces":I?.name??"Workspace"}),e.jsxs("span",{children:[Be.length," workspace",Be.length===1?"":"s",e.jsx("i",{"aria-hidden":"true",children:"·"}),q.length," terminal",q.length===1?"":"s"]})]}),e.jsxs("div",{className:"s-term-topline-actions",children:[e.jsxs("a",{className:"s-term-topline-button",href:"scout://terminal",title:"Open this terminal workspace in the Scout app",children:[e.jsx(ks,{size:13,strokeWidth:1.8}),e.jsx("span",{children:"Open in Scout"})]}),oe==="library"?e.jsxs("button",{type:"button",className:"s-term-topline-button is-primary",onClick:()=>ue(),children:[e.jsx(fe,{size:13,strokeWidth:1.9}),e.jsx("span",{children:"New workspace"})]}):oe==="builder"?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"s-term-topline-button",onClick:Ft,children:"Cancel"}),e.jsx("button",{type:"button",className:"s-term-topline-button is-primary",onClick:Ct,disabled:!N.trim(),children:b?"Save":"Create"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"s-term-topline-button",onClick:gt,children:"Workspaces"}),e.jsxs("button",{type:"button",className:"s-term-topline-button is-primary",onClick:At,children:[e.jsx(fe,{size:13,strokeWidth:1.9}),e.jsx("span",{children:"New"})]}),e.jsxs("button",{type:"button",className:"s-term-topline-button",onClick:()=>$(r=>!r),"aria-pressed":T,children:[e.jsx(B,{size:13,strokeWidth:1.8}),e.jsx("span",{children:T?"Hide picker":"Show picker"})]}),e.jsx("button",{type:"button",className:"s-term-topline-icon",onClick:Ms,title:"Workspace layout and settings","aria-label":"Workspace layout and settings",children:e.jsx(rs,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-topline-icon",onClick:$t,disabled:W.state==="loading",title:"Reload terminal inventory and previews","aria-label":"Reload terminal inventory and previews",children:e.jsx(fs,{size:13,strokeWidth:1.8})})]})]})]})});return oe==="library"?e.jsx(ir,{header:Je,workspaces:Be,sessionsReady:W.state!=="loading",onOpen:jt,onCreate:()=>ue(),onEdit:ue,onDelete:Tt}):oe==="builder"?e.jsx(or,{header:Je,editing:!!b,name:N,purpose:O,modes:qs,layout:f,startOptions:d,cells:w,selectedSlot:R,terminalItems:q,onNameChange:M,onPurposeChange:S,onApplyMode:St,onColumnsChange:wt,onSelectSlot:E,onAddCell:Nt,onRemoveCell:vt,pickerView:Y,pickerSort:J,onPickerView:de,onPickerSort:As,onAssignFresh:(r,a="shell")=>P(p=>p.map((h,g)=>g===R?{id:h.id,kind:"fresh",backend:r,agent:a}:h)),onAssignRegistered:r=>P(a=>a.map((p,h)=>h===R?{id:p.id,kind:"registered",terminalSessionId:r.session.id,terminalSurfaceKey:F(r.surface)}:p))}):e.jsxs("div",{className:"s-term s-term--workspace",children:[Je,e.jsxs("div",{className:"s-term-workspace",children:[e.jsx("h1",{className:"s-term-visually-hidden",children:I?.name??"Terminal workspace"}),Ts&&e.jsxs("div",{className:"s-term-home-error",children:[e.jsx("span",{children:"Terminal registry unavailable"}),e.jsx("code",{children:Ts})]}),ge&&e.jsxs("div",{className:"s-term-home-error",children:[e.jsx("span",{children:"This workspace is not saved to Scout — it will not follow you to another device"}),e.jsx("code",{children:ge})]}),(Q.length>0||T)&&e.jsxs("div",{className:"s-term-workspace-grid","aria-label":"Terminal tiles",style:{"--terminal-grid-columns":He},onContextMenu:Ms,children:[Q.map(r=>e.jsx("div",{className:`s-term-workspace-cell${Se===r.id?" s-term-workspace-cell--dragging":""}${yt===r.id||L===r.id?" s-term-workspace-cell--drop-target":""}`,"data-terminal-tile-id":r.id,onPointerDownCapture:a=>Dt(a,r.id),onPointerMove:Ot,onPointerUp:Ws,onPointerCancel:Ws,onContextMenu:a=>Lt(a,r),children:e.jsx(mr,{tile:r,navigate:s,onClose:Ve,resolution:Pt.get(r.id)??null,onRevive:_t,live:sr(r,W.sessions)})},`${r.id}:${x}`)),T&&e.jsxs("button",{type:"button",className:`s-term-workspace-add-cell${U?" s-term-workspace-add-cell--target":""}`,onClick:()=>$(!0),children:[e.jsx(fe,{size:20,strokeWidth:1.7}),e.jsx("strong",{children:"New slot"}),e.jsx("span",{children:y?"Drop to add":"Drag a terminal here"})]})]}),e.jsxs("section",{className:`s-term-picker${T?"":" s-term-picker--collapsed"}`,"aria-labelledby":"terminal-picker-title",onPointerDownCapture:r=>{const a=r.target;if(!(a instanceof Element))return;const p=a.closest("[data-picker-item-id]")?.dataset.pickerItemId,h=q.find(g=>g.id===p);h&&It(r,h)},onPointerMove:Rt,onPointerUp:Et,onPointerCancel:Mt,children:[e.jsxs("header",{className:"s-term-picker-head",children:[e.jsxs("div",{className:"s-term-picker-title",children:[e.jsx(B,{size:14,strokeWidth:1.8}),e.jsx("h2",{id:"terminal-picker-title",children:"Add to workspace"})]}),e.jsxs("div",{className:"s-term-picker-actions",children:[T&&z==="session"&&e.jsx("div",{className:"s-term-picker-views",role:"group","aria-label":"Picker view",children:["list","table"].map(r=>e.jsx("button",{type:"button",className:Y===r?"is-selected":"",onClick:()=>de(r),"aria-pressed":Y===r,children:r==="list"?"List":"Table"},r))}),T&&e.jsxs("button",{type:"button",className:"s-term-workspace-action",onClick:Wt,disabled:Ue.length===0,children:[e.jsx(hs,{size:13,strokeWidth:1.8}),e.jsx("span",{children:"Add all"})]}),e.jsxs("button",{type:"button",className:"s-term-picker-toggle",onClick:()=>$(r=>!r),"aria-expanded":T,children:[e.jsx("span",{children:T?"Hide":"Show terminal picker"}),e.jsx("span",{"aria-hidden":"true",children:T?"⌄":"⌃"})]})]})]}),T&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"s-term-picker-sources",role:"tablist","aria-label":"Ways to find a terminal",children:[{source:"multiplexer",label:"Multiplexer setups",detail:"Multi-pane · Herdr, tmux, Zellij",count:ie.length,icon:pt},{source:"agent",label:"Agent sessions",detail:"Agent-owned · managed terminals",count:Ie.length,icon:dt},{source:"session",label:"Recent sessions",detail:"Individual · previously opened by Scout",count:me.length,icon:B}].map(({source:r,label:a,detail:p,count:h,icon:g})=>e.jsxs("button",{type:"button",role:"tab",id:es(r),"aria-controls":Bs(),className:z===r?"is-selected":"","aria-selected":z===r,tabIndex:z===r?0:-1,onClick:()=>V(r),onKeyDown:C=>zt(C,r),children:[e.jsx(g,{size:16,strokeWidth:1.7,"aria-hidden":"true"}),e.jsxs("span",{children:[e.jsx("strong",{children:a}),e.jsx("small",{children:p})]}),e.jsx("em",{"aria-label":`${W.state==="loading"?"Loading":h} ${a.toLowerCase()}`,children:W.state==="loading"?"·":h})]},r))}),e.jsxs("div",{className:"s-term-picker-panel",role:"tabpanel",id:Bs(),"aria-labelledby":es(z),children:[e.jsx("p",{className:"s-term-picker-hint",children:z==="multiplexer"?"Preview a complete multiplexer setup, then open it or add the host-owned layout to this workspace.":z==="agent"?"Start from ownership: open the terminal associated with a managed agent, or add that surface here.":"Return to individual terminal sessions Scout has already opened or registered."}),z==="multiplexer"?e.jsx(cr,{items:ie,selectedId:Re?.id??null,attachedIds:Ye,draggedTargetId:y,onSelect:re,onAttach:qe,navigate:s}):z==="agent"?e.jsx(dr,{agents:Ie,items:q,attachedIds:Ye,onAttach:qe,navigate:s}):me.length===0&&W.state!=="loading"?e.jsxs("div",{className:"s-term-picker-empty s-term-picker-empty--explained",children:[e.jsx("strong",{children:"No recent sessions yet"}),e.jsx("span",{children:"Open or register a terminal session and it will appear here."})]}):e.jsx(xt,{items:me,view:Y,sort:J,attachedIds:Ye,draggedTargetId:y,onSort:As,onAttach:qe,navigate:s,groupManaged:!1})]})]})]})]})]})}function ir({header:s,workspaces:t,sessionsReady:n,onOpen:i,onCreate:d,onEdit:l,onDelete:m}){return e.jsxs("div",{className:"s-term s-term--workspace-library",children:[s,e.jsxs("main",{className:"s-term-workspace-library",children:[e.jsx("h1",{className:"s-term-visually-hidden",children:"Terminal workspaces"}),t.length===0?e.jsxs("section",{className:"s-term-workspace-library-empty",children:[e.jsx(pt,{size:24,strokeWidth:1.5}),e.jsx("h2",{children:"Create your first terminal workspace"}),e.jsx("p",{children:"Choose a layout, give it a purpose, place sessions, then enter the grid."}),e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:d,children:[e.jsx(fe,{size:14,strokeWidth:1.9}),e.jsx("span",{children:"Create workspace"})]})]}):e.jsx("div",{className:"s-term-workspace-library-grid",children:t.map(u=>e.jsxs("article",{className:"s-term-workspace-card",children:[e.jsx("div",{className:"s-term-workspace-card-preview",style:{"--terminal-grid-columns":u.columns??Qe},children:u.tiles.map(c=>e.jsx("span",{className:c.kind==="registered"?"is-session":"is-shell"},c.id))}),e.jsxs("div",{className:"s-term-workspace-card-copy",children:[e.jsxs("span",{children:[u.columns??Qe," column",(u.columns??Qe)===1?"":"s"," · ",u.tiles.length," cells"]}),e.jsx("h2",{children:u.name}),e.jsx("p",{children:u.purpose||"No purpose added yet."})]}),e.jsxs("div",{className:"s-term-workspace-card-actions",children:[e.jsx("button",{type:"button",className:"s-term-workspace-action",onClick:()=>l(u),children:"Edit"}),e.jsx("button",{type:"button",className:"s-term-workspace-action",onClick:()=>m(u.id),children:"Delete"}),e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:()=>i(u),disabled:!n,children:"Enter workspace"})]})]},u.id))})]})]})}function as(s,t){return s==="solo"?1:s==="lanes"?Math.max(2,Math.min(4,t)):Math.max(2,Math.min(3,t))}function lr(s,t){return s==="solo"?1:s==="lanes"?as(s,t):as(s,t)*2}function or({header:s,editing:t,name:n,purpose:i,modes:d,layout:l,startOptions:m,cells:u,selectedSlot:c,terminalItems:k,onNameChange:b,onPurposeChange:j,onApplyMode:N,onColumnsChange:M,onSelectSlot:O,onAddCell:S,onRemoveCell:f,pickerView:v,pickerSort:w,onPickerView:P,onPickerSort:R,onAssignFresh:E,onAssignRegistered:W}){const H=ze(l,{tileCount:u.length});return e.jsxs("div",{className:"s-term s-term--workspace-builder",children:[s,e.jsxs("main",{className:"s-term-workspace-builder",children:[e.jsx("h1",{className:"s-term-visually-hidden",children:t?"Edit terminal workspace":"Create terminal workspace"}),e.jsxs("section",{className:"s-term-workspace-builder-identity","aria-label":"Workspace identity",children:[e.jsxs("label",{children:[e.jsx("span",{children:"Name"}),e.jsx("input",{value:n,onChange:x=>b(x.target.value),placeholder:"Release desk",autoFocus:!0})]}),e.jsxs("label",{children:[e.jsx("span",{children:"Purpose"}),e.jsx("input",{value:i,onChange:x=>j(x.target.value),placeholder:"Cross-project release monitoring"})]})]}),e.jsxs("section",{className:"s-term-workspace-builder-layout","aria-labelledby":"workspace-layout-title",children:[e.jsxs("div",{className:"s-term-workspace-builder-section-head",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Step 1"}),e.jsx("h2",{id:"workspace-layout-title",children:"Choose the layout"})]}),e.jsxs("p",{children:[kn(l)," · ",u.length," cell",u.length===1?"":"s"]})]}),e.jsx("div",{className:"s-term-grid-presets","aria-label":"Workspace layout",children:d.map(x=>e.jsxs("button",{type:"button",className:`s-term-grid-preset${x.mode===l.mode?" s-term-grid-preset--selected":""}`,onClick:()=>N(x),"aria-pressed":x.mode===l.mode,children:[e.jsx("span",{className:"s-term-grid-preset-map",style:{"--terminal-preset-columns":as(x.mode,H)},"aria-hidden":"true",children:Array.from({length:lr(x.mode,H)},(A,T)=>e.jsx("i",{},T))}),e.jsx("span",{className:"s-term-grid-preset-label",children:x.label}),e.jsx("span",{className:"s-term-grid-preset-detail",children:x.detail})]},x.mode))}),l.mode!=="solo"&&e.jsxs("div",{className:"s-term-workspace-builder-columns",role:"group","aria-label":"Columns",children:[e.jsx("span",{children:"Columns"}),e.jsx("button",{type:"button",className:l.columns==="dynamic"||l.columns===void 0?"is-selected":"",onClick:()=>M("dynamic"),"aria-pressed":l.columns==="dynamic"||l.columns===void 0,title:"Fit the columns to the number of tiles",children:"Dynamic"}),Array.from({length:xs},(x,A)=>e.jsx("button",{type:"button",className:l.columns===A+1?"is-selected":"",onClick:()=>M(A+1),"aria-pressed":l.columns===A+1,children:A+1},A)),(l.columns==="dynamic"||l.columns===void 0)&&e.jsxs("em",{children:[H," right now"]})]})]}),e.jsxs("section",{className:"s-term-workspace-builder-placement","aria-labelledby":"workspace-placement-title",children:[e.jsxs("div",{className:"s-term-workspace-builder-section-head",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Step 2"}),e.jsx("h2",{id:"workspace-placement-title",children:"Place terminals"})]}),e.jsx("p",{children:"Select a cell, then choose a session or shell. Add as many cells as the work needs."})]}),e.jsxs("div",{className:"s-term-workspace-builder-canvas",children:[e.jsxs("div",{className:"s-term-workspace-builder-grid",style:{"--terminal-grid-columns":H},children:[u.map((x,A)=>{const T=x.kind==="registered"?k.find($=>$.session.id===x.terminalSessionId&&ts(F($.surface),x.terminalSurfaceKey)):null;return e.jsxs("div",{className:`s-term-workspace-builder-cell${c===A?" is-selected":""}`,children:[e.jsxs("button",{type:"button",className:"s-term-workspace-builder-cell-select",onClick:()=>O(A),"aria-pressed":c===A,children:[e.jsx("span",{children:String(A+1).padStart(2,"0")}),e.jsx(B,{size:17,strokeWidth:1.7}),e.jsx("strong",{children:x.kind==="registered"?T?.title??"Unavailable session":ws(x.backend,x.agent).title}),e.jsx("small",{children:x.kind==="registered"?T?.cwdLabel||T?.detail:x.backend})]}),u.length>1&&e.jsx("button",{type:"button",className:"s-term-workspace-builder-cell-remove",onClick:()=>f(A),title:"Remove this cell","aria-label":`Remove cell ${A+1}`,children:e.jsx(ye,{size:13,strokeWidth:1.9})})]},x.id)}),e.jsxs("button",{type:"button",className:"s-term-workspace-builder-cell s-term-workspace-builder-cell--add",onClick:S,children:[e.jsx(fe,{size:18,strokeWidth:1.7}),e.jsx("strong",{children:"Add cell"})]})]}),e.jsxs("aside",{className:"s-term-workspace-builder-source",children:[e.jsxs("span",{children:["Cell ",String(c+1).padStart(2,"0")]}),e.jsx("h3",{children:"Start something new"}),e.jsxs("div",{className:"s-term-workspace-builder-source-actions",children:[ft.map(x=>e.jsx("button",{type:"button",onClick:()=>E("pty",x.value),children:x.label},x.value)),m.filter(x=>x.value!=="pty").map(x=>e.jsxs("button",{type:"button",onClick:()=>E(x.value,"shell"),title:x.relayAttach?x.detail:`${x.detail} — Scout starts it; open it in ${x.label} to use it`,children:[x.label,!x.relayAttach&&e.jsx("sup",{"aria-label":"opens outside Scout",children:" ↗"})]},x.value))]}),e.jsxs("div",{className:"s-term-workspace-builder-source-head",children:[e.jsx("h3",{children:"Or use a live session"}),e.jsx("div",{className:"s-term-picker-views",role:"group","aria-label":"Session picker view",children:["list","table"].map(x=>e.jsx("button",{type:"button",className:v===x?"is-selected":"",onClick:()=>P(x),"aria-pressed":v===x,children:x==="list"?"List":"Table"},x))})]}),e.jsx("div",{className:"s-term-workspace-builder-sessions",children:k.length===0?e.jsx("span",{className:"s-term-workspace-builder-no-sessions",children:"No live sessions"}):e.jsx(xt,{items:k,view:v,sort:w,attachedIds:new Set,draggedTargetId:null,onSort:R,onAttach:x=>{const A=k.find(T=>T.session.id===x.session.id&&T.surface.sessionName===x.surface.sessionName);A&&W(A)}})})]})]})]})]})]})}function bt({item:s,attached:t,dragging:n,selected:i=!1,onSelect:d,onAttach:l,onOpen:m}){const u=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-term-picker-grip","aria-hidden":"true",children:"⠿"}),e.jsxs("div",{className:"s-term-picker-item-main",children:[e.jsx("strong",{title:s.surface.sessionName,children:s.title}),e.jsx("span",{title:s.session.cwd??s.detail,children:s.cwdLabel||s.detail})]}),e.jsxs("div",{className:"s-term-picker-item-meta",children:[e.jsx("span",{children:s.surface.backend}),e.jsx("span",{children:us(s)}),e.jsx("span",{title:s.session.cwd??void 0,children:s.project})]})]});return e.jsxs("article",{className:`s-term-picker-item${t?" s-term-picker-item--attached":""}${n?" s-term-picker-item--dragging":""}${i?" s-term-picker-item--selected":""}${d?" s-term-picker-item--selectable":""}`,"data-picker-item-id":s.id,role:d?"listitem":void 0,children:[d?e.jsx("button",{type:"button",className:"s-term-picker-item-summary s-term-picker-item-select","aria-pressed":i,onClick:d,children:u}):e.jsx("div",{className:"s-term-picker-item-summary",children:u}),m&&e.jsx("button",{type:"button",className:"s-term-picker-add",onClick:m,children:"Open"}),e.jsx("button",{type:"button",className:"s-term-picker-add",onClick:()=>l(G(s)),disabled:t,children:t?"In grid":"Add"})]})}function cr({items:s,selectedId:t,attachedIds:n,draggedTargetId:i,onSelect:d,onAttach:l,navigate:m}){const u=s.find(k=>k.id===t)??s[0]??null;if(!u)return e.jsx("div",{className:"s-term-picker-empty",children:"No multiplexers discovered"});const c=ds(u.surface);return e.jsxs("div",{className:"s-term-picker-explorer",children:[e.jsx("div",{className:"s-term-picker-list s-term-picker-list--explorer",role:"list","aria-label":"Managed multiplexers",children:s.map(k=>{const b=G(k),j=ce(b);return e.jsx(bt,{item:k,attached:n.has(j),dragging:i===j,selected:k.id===u.id,onSelect:()=>d(k.id),onAttach:l,onOpen:()=>m({view:"terminal",terminalSessionId:k.session.id,terminalSurfaceKey:F(k.surface)})},k.id)})}),e.jsxs("section",{className:"s-term-picker-preview","aria-label":`${u.title} live preview`,children:[e.jsxs("div",{className:"s-term-picker-preview-title",children:[e.jsxs("div",{children:[e.jsx("strong",{children:u.title}),e.jsxs("span",{children:[u.surface.backend," · ",u.project," · ",us(u)]})]}),e.jsx("span",{children:fr(u,Ss(u,[]))})]}),c?e.jsx(ct,{surface:c,lines:28,columns:112,className:"s-term-multiplexer-peek"}):e.jsx("div",{className:"s-term-picker-empty",children:"This host does not expose a web preview"})]})]})}function dr({agents:s,items:t,attachedIds:n,onAttach:i,navigate:d}){return s.length===0?e.jsx("div",{className:"s-term-picker-empty",children:"No terminal-backed agents"}):e.jsx("div",{className:"s-term-picker-list","aria-label":"Terminal-backed agents",children:s.map(l=>{const m=ne(l),u=t.find(b=>Ss(b,[l])?.id===l.id)??null,c=u?G(u):null,k=c?n.has(ce(c)):!1;return e.jsxs("article",{className:`s-term-picker-item${k?" s-term-picker-item--attached":""}`,"data-picker-item-id":u?.id,children:[e.jsx("span",{className:"s-term-picker-grip","aria-hidden":"true",children:e.jsx("span",{className:"s-term-picker-agent-dot","data-state":l.state})}),e.jsxs("div",{className:"s-term-picker-item-main",children:[e.jsx("strong",{title:l.name,children:l.name}),e.jsx("span",{title:l.cwd??l.projectRoot??void 0,children:l.handle?`@${l.handle}`:ot(l.cwd??l.projectRoot)})]}),e.jsxs("div",{className:"s-term-picker-item-meta",children:[e.jsx("span",{children:m?.backend??l.harness}),e.jsx("span",{children:Kt(l.state)}),e.jsx("span",{children:br(l)})]}),e.jsx("button",{type:"button",className:"s-term-picker-add",onClick:()=>d({view:"terminal",agentId:l.id,mode:"takeover"}),children:"Open"}),e.jsx("button",{type:"button",className:"s-term-picker-add",onClick:()=>c&&i(c),disabled:!c||k,title:c?void 0:"This agent has no registered terminal surface to add",children:k?"In grid":"Add"})]},l.id)})})}function xt({items:s,view:t,sort:n,attachedIds:i,draggedTargetId:d,onSort:l,onAttach:m,navigate:u,groupManaged:c=!0}){const k=o.useMemo(()=>Xe(s,n),[s,n]),{managed:b,regular:j}=o.useMemo(()=>c?at(s):{managed:[],regular:s},[c,s]),N=o.useMemo(()=>Xe(b,n),[b,n]),M=o.useMemo(()=>Xe(j,n),[j,n]),O=f=>{u?.({view:"terminal",terminalSessionId:f.session.id,terminalSurfaceKey:F(f.surface)})},S=(f,v)=>{const w=ce(G(f));return e.jsx(bt,{item:f,attached:i.has(w),dragging:d===w,onAttach:m,onOpen:v&&u?()=>O(f):void 0},f.id)};return t==="table"?e.jsx("div",{className:"s-term-picker-table-wrap",children:e.jsxs("table",{className:"s-term-picker-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[ln.map(f=>e.jsx("th",{scope:"col","aria-sort":n.column===f.id?n.direction==="asc"?"ascending":"descending":"none",children:e.jsxs("button",{type:"button",onClick:()=>l(f.id),children:[e.jsx("span",{children:f.label}),e.jsx("em",{"aria-hidden":"true",children:n.column===f.id?n.direction==="asc"?"▲":"▼":"·"})]})},f.id)),e.jsx("th",{scope:"col","aria-label":"Place"})]})}),e.jsx("tbody",{children:k.map(f=>{const v=ce(G(f)),w=on(f);return e.jsxs("tr",{"data-picker-item-id":f.id,className:i.has(v)?"is-attached":void 0,children:[e.jsx("td",{title:f.surface.sessionName,children:f.title}),e.jsx("td",{children:f.surface.backend}),e.jsx("td",{children:us(f)}),e.jsx("td",{title:f.session.cwd??void 0,children:f.project}),e.jsx("td",{children:w?mn(w):"—"}),e.jsx("td",{children:e.jsx("button",{type:"button",className:"s-term-picker-add",onClick:()=>m(G(f)),disabled:i.has(v),children:i.has(v)?"In grid":"Add"})})]},f.id)})})]})}):e.jsxs("div",{className:"s-term-picker-list","aria-label":"Available terminals",children:[N.length>0&&e.jsxs("section",{className:"s-term-picker-group","aria-label":"Managed sessions",children:[e.jsx("h3",{className:"s-term-picker-group-title",children:"Managed sessions"}),N.map(f=>S(f,!0))]}),N.length>0&&M.length>0?e.jsxs("section",{className:"s-term-picker-group","aria-label":"Terminals",children:[e.jsx("h3",{className:"s-term-picker-group-title",children:"Terminals"}),M.map(f=>S(f,!1))]}):M.map(f=>S(f,!1))]})}function mr({tile:s,navigate:t,onClose:n,resolution:i,onRevive:d,live:l=!1}){if(s.kind==="registered")return s.target.surface.backend==="herdr"?e.jsx(Vs,{tileId:s.id,backend:"herdr",sessionName:s.target.surface.sessionName,live:s.target.surface.state==="live",onClose:n,navigate:t}):e.jsx(pr,{tile:s,navigate:t,onClose:n});if(s.kind==="unavailable"){const m=i?.status==="revivable"&&!!d;return e.jsxs("section",{className:"s-term-workspace-tile s-term-workspace-tile--unavailable","aria-label":"Unavailable terminal session",children:[e.jsxs("div",{className:"s-term-bar",children:[e.jsxs("div",{className:"s-term-bar-left",children:[e.jsx("span",{className:"s-term-workspace-tile-mark",children:e.jsx(B,{size:14,strokeWidth:1.8})}),e.jsx("span",{className:"s-term-workspace-tile-name",children:"Not running"})]}),e.jsx("div",{className:"s-term-bar-actions",children:e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>n(s.id),title:"Remove cell","aria-label":"Remove cell",children:e.jsx(ye,{size:14,strokeWidth:1.8})})})]}),e.jsxs("div",{className:"s-term-workspace-unavailable-body",children:[e.jsx(B,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:m?"This tile is not running.":"This saved session is not currently live."}),e.jsx("span",{children:i?.detail??"Show the terminal picker to replace it, or wait for the session to reconnect."}),m&&e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:()=>d?.(s.id),children:"Start it again"})]})]})}return!lt(s.backend)&&s.backend!=="pty"?e.jsx(Vs,{tileId:s.id,backend:s.backend,sessionName:s.sessionName,live:l,onClose:n,navigate:t}):e.jsx(ur,{tile:s,navigate:t,onClose:n})}function Vs({tileId:s,backend:t,sessionName:n,live:i,onClose:d,navigate:l}){const{hosts:m}=ms(),u=Pn(m,t),[c,k]=o.useState("idle"),[b,j]=o.useState(null),N=t==="herdr",{topology:M}=Qt(N?n??null:null,{enabled:N&&i}),O=o.useCallback(()=>{n&&(k("starting"),j(null),Zt(t,{sessionName:n}).then(()=>k("idle")).catch(w=>{k("failed"),j(w instanceof Error?w.message:String(w))}))},[t,n]),S=o.useCallback(()=>{if(!l||!n)return;const w=Jt(t,n);w&&l({view:"terminal",terminalSurfaceKey:w})},[l,t,n]),f=o.useCallback(()=>{!l||!n||l(en(n))},[l,n]),v=N&&M?.running?M.workspaces.flatMap(w=>w.tabs):[];return e.jsxs("section",{className:"s-term-workspace-tile s-term-workspace-tile--hosted","aria-label":`${u?.label??t} session`,children:[e.jsxs("div",{className:"s-term-bar",children:[e.jsxs("div",{className:"s-term-bar-left",children:[e.jsx("span",{className:"s-term-workspace-tile-mark",children:e.jsx(B,{size:14,strokeWidth:1.8})}),e.jsx("span",{className:"s-term-workspace-tile-name",children:u?.label??t})]}),e.jsxs("div",{className:"s-term-bar-meta",children:[e.jsx("span",{className:"s-term-label",children:i?"running":"not running"}),n&&e.jsx("span",{className:"s-term-session",title:n,children:n})]}),e.jsxs("div",{className:"s-term-bar-actions",children:[N&&i&&n&&l&&e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:f,title:"Enter — open a live web terminal attached to this session","aria-label":"Enter — open a live web terminal attached to this session",children:e.jsx(hs,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>d(s),title:"Remove cell","aria-label":"Remove cell",children:e.jsx(ye,{size:14,strokeWidth:1.8})})]})]}),v.length>0?e.jsx("button",{type:"button",className:"s-term-workspace-hosted-body s-term-workspace-hosted-body--link",onClick:S,children:v.map(w=>{const P=sn(w);return e.jsxs("span",{className:"s-term-workspace-hosted-tab",children:[e.jsx("span",{className:"s-term-workspace-hosted-tab-dots",children:P.statuses.map((R,E)=>e.jsx(tn,{status:R},`${w.tabId}:${E}`))}),e.jsx("span",{className:"s-term-workspace-hosted-tab-label",children:P.label}),e.jsx("span",{className:"s-term-workspace-hosted-tab-count",children:P.statuses.length})]},w.tabId)})}):e.jsxs("div",{className:"s-term-workspace-unavailable-body",children:[e.jsx(B,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:i?`Running in ${u?.label??t}`:"Not running yet"}),e.jsx("span",{children:i?`Scout keeps this session for you. Open it in ${u?.label??t} to use it.`:`Scout can start a ${u?.label??t} session and keep it for you.`}),!i&&e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:O,disabled:c==="starting"||!n,children:c==="starting"?"Starting…":"Start it"}),b&&e.jsx("code",{children:b})]})]})}function ur({tile:s,navigate:t,onClose:n}){const i=o.useRef(null),d=is(),l=ls(),m=ws(s.backend,s.agent),u=nr(s),c=["scout-terminal-workspace",s.id,s.backend,s.agent,s.sessionName??"pty"].join("-"),k=ps({url:d,healthUrl:l,autoConnect:!0,sessionKey:c,backend:s.backend,...s.sessionName?{terminalSession:s.sessionName}:{},...s.backend==="tmux"&&s.sessionName?{tmuxSession:s.sessionName}:{},...s.backend==="zellij"&&s.sessionName?{zellijSession:s.sessionName}:{},...s.backend==="zellij"&&s.zellijSocketDir?{zellijSocketDir:s.zellijSocketDir}:{},...s.backend==="herdr"&&s.sessionName?{tmuxSession:s.sessionName}:{},agent:s.agent,controlMode:"takeover"});ke(()=>{k.resize(os,cs)},[k.resize]);const b=o.useCallback(()=>{u&&kt(u,t)},[t,u]);return e.jsx("section",{className:"s-term-workspace-tile","aria-label":m.title,children:e.jsxs("div",{className:"s-term s-term--embedded",children:[e.jsxs("div",{className:"s-term-bar s-term-bar--fresh",children:[e.jsxs("div",{className:"s-term-bar-left",children:[e.jsx("span",{className:"s-term-workspace-tile-mark",children:e.jsx(B,{size:14,strokeWidth:1.8})}),e.jsx("span",{className:"s-term-workspace-tile-name",children:m.title})]}),e.jsxs("div",{className:"s-term-bar-meta",children:[e.jsx("span",{className:"s-term-label",children:s.backend}),e.jsx("span",{className:"s-term-session",children:m.detail})]}),e.jsxs("div",{className:"s-term-bar-actions",children:[e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:()=>k.restart(),title:"Restart terminal","aria-label":"Restart terminal",children:e.jsx(fs,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:b,title:"Open terminal in a new window","aria-label":"Open terminal in a new window",children:e.jsx(ks,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>n(s.id),title:"Close tile","aria-label":"Close tile",children:e.jsx(ye,{size:14,strokeWidth:1.8})})]})]}),e.jsx("div",{ref:i,className:"s-term-body",onMouseDown:()=>{i.current?.querySelector(".xterm-helper-textarea")?.focus(),i.current?.querySelector(".xterm")?.focus()},children:e.jsx(js,{relay:k,quiet:!0,configItems:[{label:"backend",value:s.backend},{label:"agent",value:s.agent},...s.sessionName?[{label:"session",value:s.sessionName}]:[],...s.zellijSocketDir?[{label:"socket",value:s.zellijSocketDir}]:[],{label:"ws",value:d},{label:"health",value:l}]})})]})})}function pr({tile:s,navigate:t,onClose:n}){const i=o.useCallback(()=>{kt(rr(s.target),t)},[t,s.target]);return e.jsx("section",{className:"s-term-workspace-tile","aria-label":s.target.surface.sessionName,children:e.jsx(gs,{agent:null,mode:"takeover",navigate:t,registeredTarget:s.target,embedded:!0,tileActions:e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:i,title:"Open terminal in a new window","aria-label":"Open terminal in a new window",children:e.jsx(ks,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>n(s.id),title:"Close tile","aria-label":"Close tile",children:e.jsx(ye,{size:14,strokeWidth:1.8})})]})})})}function hr(s){return[...s].filter(t=>!t.retiredFromFleet).sort((t,n)=>{const i=+!!ne(n)-+!!ne(t);if(i!==0)return i;const d=(n.updatedAt??0)-(t.updatedAt??0);return d!==0?d:t.name.localeCompare(n.name)})}function Ss(s,t){const n=F(s.surface),i=t.find(l=>{const m=ne(l);return m?tt(m,n):!1});if(i)return i;const d=new Set([s.session.id,s.session.sourceSessionId,s.surface.sessionName].map(l=>l.trim()).filter(Boolean));return t.find(l=>[l.harnessSessionId,l.conversationId,l.terminalSurface?.sessionName].some(m=>m&&d.has(m)))??null}function fr(s,t){const n=Gs(s.session.metadata,"currentCommand"),i=ot(Gs(s.session.metadata,"currentPath"));if(n&&i)return`${n} in ${i}`;if(n)return`running ${n}`;if(t?.handle)return`owned by @${t.handle}`;if(t)return`owned by ${t.name}`;if(s.surface.paneId)return`pane ${s.surface.paneId}`;const d=kr(s.session.metadata,"windows");return d!==null?`${d} window${d===1?"":"s"}`:`${s.surface.backend} surface`}function Gs(s,t){const n=s?.[t];return typeof n=="string"&&n.trim()?n.trim():null}function kr(s,t){const n=s?.[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function br(s){return s.project??Js(s.projectRoot)??Js(s.cwd)??s.workspaceQualifier??s.definitionId}function Js(s){const t=s?.trim().replace(/\/+$/u,"");return t?t.split("/").pop()||t:null}function xr({route:s,navigate:t}){const n=o.useRef(null),i=s.terminalBackend??"pty",d=s.terminalAgent??"shell",l=s.terminalTabId??"adhoc",m=i==="pty"?void 0:`scout-${i}-${l}`,u=s.terminalSessionName??m,c=is(),k=ls(),b=ws(i,d),j=["scout-terminal-new",i,d,u??l].join("-"),N=ps({url:c,healthUrl:k,autoConnect:!0,sessionKey:j,backend:i,...u?{terminalSession:u}:{},...i==="tmux"&&u?{tmuxSession:u}:{},...i==="zellij"&&u?{zellijSession:u}:{},...i==="zellij"&&s.zellijSocketDir?{zellijSocketDir:s.zellijSocketDir}:{},...i==="herdr"&&u?{tmuxSession:u}:{},agent:d,controlMode:"takeover"}),M=o.useRef([]),O=o.useRef({status:N.status,sendLine:N.sendLine});return O.current={status:N.status,sendLine:N.sendLine},ke(()=>{const S=f=>{const v=Un(f);if(!v)return;const w=O.current;if(w.status==="connected"){w.sendLine(v);return}M.current=[...M.current.slice(-15),v]};return window.addEventListener(Us,S),()=>window.removeEventListener(Us,S)},[]),ke(()=>{if(N.status!=="connected"||M.current.length===0)return;const S=M.current;M.current=[];for(const f of S)N.sendLine(f)},[N.sendLine,N.status]),ke(()=>{N.resize(os,cs)},[N.resize]),e.jsxs("div",{className:"s-term",children:[e.jsxs("div",{className:"s-term-bar",children:[e.jsx(xe,{slot:"terminal",fallback:{view:"terminal"},navigate:t,className:"s-term-back"}),e.jsx("span",{className:"s-term-label",children:b.title}),e.jsx("div",{className:"s-term-status",children:b.detail}),e.jsx("div",{className:"s-term-actions",children:e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:()=>N.restart(),title:"Restart terminal","aria-label":"Restart terminal",children:e.jsx(fs,{size:14,strokeWidth:1.8})})})]}),e.jsx("div",{ref:n,className:"s-term-body",onMouseDown:()=>{n.current?.querySelector(".xterm-helper-textarea")?.focus(),n.current?.querySelector(".xterm")?.focus()},children:e.jsx(js,{relay:N,quiet:!0,configItems:[{label:"backend",value:i},{label:"agent",value:d},...u?[{label:"session",value:u}]:[],...s.zellijSocketDir?[{label:"socket",value:s.zellijSocketDir}]:[],{label:"ws",value:c},{label:"health",value:k}]})})]})}function ws(s,t){const n=t==="shell"?"Shell":t==="codex"?"Codex":t==="pi"?"Pi":"Claude";return s==="pty"?{title:n,detail:"fresh PTY tab"}:{title:`${n} ${s}`,detail:`fresh ${s} backed tab`}}function yr({agentId:s,agent:t,mode:n,navigate:i,children:d}){const l=Jn(s,t,n);return l.ready?e.jsx(e.Fragment,{children:d}):e.jsx(Qn,{agent:t,agentId:s,color:Zs(t.name),navigate:i,label:l.label,status:l.status,onRetry:l.onRetry})}function jr({navigate:s}){return e.jsx("div",{className:"s-term",children:e.jsxs("div",{className:"s-term-bar",children:[e.jsx(xe,{slot:"terminal",fallback:{view:"terminal"},navigate:s,className:"s-term-back"}),e.jsx("span",{className:"s-term-label",children:"Terminal"}),e.jsx("div",{className:"s-term-status",children:"Resolving agent..."})]})})}function gr({route:s,navigate:t}){const{agentId:n,mode:i,terminalSessionId:d,terminalSurfaceKey:l}=s,{agents:m}=Xs();if(s.terminalBackend)return e.jsx(xr,{route:s,navigate:t});const u=s.terminalSurfaceKey?st(s.terminalSurfaceKey):null;if(!n&&u?.backend==="herdr")return e.jsx(Xt,{sessionName:u.hostSession,navigate:t});if(!n)return!d&&!l?e.jsx(ar,{navigate:t}):e.jsx(er,{terminalSessionId:d,terminalSurfaceKey:l,mode:i,navigate:t});const c=m.find(j=>j.id===n)??null;if(!c)return e.jsx(jr,{navigate:t});const k=ne(c),b=k?`${k.backend}:${c.id}:${k.sessionName}:${i??"takeover"}`:`takeover:${n}:${i??"takeover"}`;return e.jsx(yr,{agentId:n,agent:c,mode:i,navigate:t,children:e.jsx(gs,{agentId:n,agent:c,mode:i,navigate:t})},b)}function Ca({agentId:s,mode:t,terminalSessionId:n,terminalSurfaceKey:i,navigate:d}){const l={view:"terminal",agentId:s,mode:t,terminalSessionId:n,terminalSurfaceKey:i};return e.jsx(gr,{route:l,navigate:d})}export{gr as TerminalContent,Ca as TerminalScreen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,j as l,a as A,b as C,S as k}from"./index-C1VaWNuD.js";import{L as y,D as T,f as L,S as x,C as R}from"./Provider-D0bB7q6y.js";import{a as P}from"./api-Co9aQ2Jw.js";import{i as I}from"./colors-BtO5_zlx.js";import{r as j,a as D}from"./router-kfcaYqZr.js";import{TerminalContent as H}from"./Terminal-DWyZTZdY.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./createLucideIcon-Dv8H8m7J.js";import"./conversation-model-C2KuZUXc.js";import"./time-Dhsh_2EG.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";/* empty css */import"./clipboard-e3fSpeo7.js";import"./terminal-relay-CXHMdain.js";import"./HerdrSession-DsuxCtfX.js";import"./chunk-YOZR3KYS-CrCgXw9l.js";import"./arrow-down-BAGkhHA6.js";import"./terminal-UDy4lzV1.js";import"./refresh-cw-Bkh7Cvnd.js";import"./check-Dz2SRHft.js";import"./copy-BzdzWsQd.js";import"./eye-C9cGk5z6.js";import"./session-table-uJh3v-ly.js";import"./chunk-JTPDIGGW-COJ00z94.js";import"./terminal-takeover-BMeBjBB2.js";import"./BackToPicker-BHicJyfc.js";import"./TmuxPeek-CqTJRhkI.js";/* empty css */import"./TerminalHeaderMount-CY7uIWBg.js";import"./external-link-BvX5PfLh.js";import"./plus-BWKhylds.js";import"./zap-Bcja1lHG.js";function g(){const t=new URLSearchParams(window.location.search).get("route")?.trim()||"/terminal",s=j(t);return s.view==="terminal"?s:{view:"terminal"}}function S(o){const t=new URLSearchParams(window.location.search);return t.set("route",D(o)),t.has("profile")||t.set("profile","macos.terminal"),`${window.location.pathname}?${t.toString()}${window.location.hash}`}function Ue(){const[o,t]=e.useState(()=>g()),s=!!(o.terminalBackend||o.agentId||o.terminalSessionId||o.terminalSurfaceKey);e.useEffect(()=>{const i=()=>t(g());return window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)},[]);const n=e.useCallback(i=>{if(i.view!=="terminal"){const p={view:"terminal"},a=S(p);window.history.pushState(null,"",a),t(p);return}const c=S(i);window.history.pushState(null,"",c),t(i)},[]);return l.jsx(M,{route:o,navigate:n,children:l.jsx("div",{className:`s-terminal-embed${s?" s-terminal-embed--surface":""}`,children:l.jsx(H,{route:o,navigate:n})})})}function M({route:o,navigate:t,children:s}){const[n,i]=e.useState([]),[c,p]=e.useState({status:"checking",message:null,lastCheckedAt:null}),a=e.useRef(null),u=e.useMemo(()=>A(),[]),f=e.useMemo(()=>C(),[]),b=e.useMemo(()=>({...u==="light"?y:T,...f??{}}),[u,f]),w=e.useCallback(()=>{p({status:"online",message:null,lastCheckedAt:Date.now()})},[]),h=e.useCallback(r=>{p({status:"offline",message:L(r),lastCheckedAt:Date.now()})},[]),m=e.useCallback(async()=>{if(a.current)return a.current;const r=(async()=>{try{i(await P("/api/agents")),w()}catch(d){h(d)}})();a.current=r;try{await r}finally{a.current=null}},[h,w]);e.useEffect(()=>{m()},[m]),e.useEffect(()=>{const r=()=>{document.visibilityState!=="hidden"&&m()},d=window.setInterval(r,15e3);return window.addEventListener("focus",r),document.addEventListener("visibilitychange",r),()=>{window.clearInterval(d),window.removeEventListener("focus",r),document.removeEventListener("visibilitychange",r)}},[m]);const v=e.useMemo(()=>n.filter(r=>I(r.state)).length,[n]),E=e.useMemo(()=>({route:o,navigate:t,navigateBack:()=>{typeof window<"u"&&window.history.back()},canNavigateBack:typeof window<"u"&&window.history.length>1,agents:n,agentsLoaded:c.status!=="checking",onlineCount:v,apiConnection:c,appearanceDetails:k,updateAppearanceDetails:()=>{},reload:m,onboarding:null,operatorName:null,refreshOnboarding:async()=>{},onboardingSkipped:!0,skipOnboarding:()=>{},settingsOpen:!1,openSettings:()=>{},closeSettings:()=>{},scoutbotAgentId:"scoutbot",scoutbotConversationId:null,applyScoutbotUiAction:()=>{},selectedBrokerAttempt:null,inspectBrokerAttempt:()=>{},clearBrokerAttempt:()=>{},selectedKnowledgeHit:null,selectedKnowledgeQuery:"",inspectKnowledgeHit:()=>{},clearKnowledgeHit:()=>{},focusedSession:null,focusSession:()=>{},openFilePreview:()=>{},closeFilePreview:()=>{},openContextCapture:()=>{},closeContextCapture:()=>{}}),[n,c,t,v,m,o]);return l.jsx(x.Provider,{value:E,children:l.jsx("div",{"data-scout-theme":u,"data-scout-theme-mode":u,style:b,children:l.jsx(R,{children:s})})})}export{Ue as TerminalEmbedScreen};
|
package/dist/client/assets/{TerminalHeaderMount-BL07cd0q.js → TerminalHeaderMount-CY7uIWBg.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,j as a}from"./index-
|
|
1
|
+
import{r as e,j as a}from"./index-C1VaWNuD.js";import{r as c}from"./index-Cx6Gbr6n.js";const u="scout-terminal-header-slot",d=typeof window>"u"?e.useEffect:e.useLayoutEffect;function r(){return typeof document>"u"?null:document.getElementById(u)}function m({children:t}){const[o,s]=e.useState(r);d(()=>{s(r())},[]);const n=o?.isConnected?o:null;return n?c.createPortal(t,n):a.jsx("div",{className:"s-term-inline-header","data-scout-terminal-header-fallback":"",children:t})}export{u as SCOUT_TERMINAL_HEADER_SLOT_ID,m as TerminalHeaderMount};
|
package/dist/client/assets/{TextDocumentSurface-BflAwXeZ.js → TextDocumentSurface-2X1Gw4eA.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as i,r as I}from"./index-
|
|
1
|
+
import{j as i,r as I}from"./index-C1VaWNuD.js";const N={cjs:"javascript",css:"css",htm:"html",html:"html",js:"javascript",jsx:"javascript",json:"json",mjs:"javascript",md:"markdown",mdx:"markdown",sh:"shell",ts:"typescript",tsx:"typescript",txt:"plain"},L=new Set(["cjs","css","htm","html","js","jsx","json","mjs","sh","ts","tsx"]);function b(t){const s=(t.filename??t.title??t.uri??"").split(/[?#]/)[0],n=s.split("/").pop()??s,r=n.lastIndexOf(".");return r>=0?n.slice(r+1).toLowerCase():""}function S(t){const e=t.mediaType?.toLowerCase()??"";return e.includes("json")?"json":e.includes("markdown")?"markdown":e.includes("javascript")?"javascript":e.includes("typescript")?"typescript":e.includes("html")?"html":e.includes("css")?"css":e.includes("shell")||e.includes("x-sh")?"shell":N[b(t)]??"plain"}function E(t){const e=t.mediaType?.toLowerCase()??"",s=b(t);if(e.includes("markdown")||s==="md"||s==="mdx")return"markdown";if(e.includes("json")||e.includes("javascript")||e.includes("typescript")||e.includes("html")||e.includes("xml")||e.includes("css")||L.has(s))return"code";if(e.startsWith("text/")||s==="txt")return"text";const n=t.value.trim();return/^#{1,6}\s+/m.test(n)||/```[\s\S]*```/.test(n)?"markdown":"text"}function it(t){const e=t.title??t.filename??t.uri?.split("/").pop()??"Untitled",s=t.language??S(t);return{id:t.id??t.uri??e,title:e,uri:t.uri,mediaType:t.mediaType,language:s,kind:t.kind??E(t),value:t.value,readOnly:t.readOnly}}function ct({document:t,mode:e,className:s}){const n=e??(t.kind==="markdown"?"preview":"read"),r=t.kind==="markdown"&&n==="preview"?i.jsx(k,{markdown:t.value}):i.jsx(W,{document:t});return i.jsx("div",{className:`s-text-document-surface s-text-document-surface-${t.kind}${s?` ${s}`:""}`,children:r})}function W({document:t}){const e=I.useMemo(()=>_(t.value,t.language??t.kind),[t.language,t.kind,t.value]);return i.jsx("pre",{className:"s-text-document-code","data-language":t.language??t.kind,children:i.jsx("code",{children:e})})}function k({markdown:t}){const e=A(t);return i.jsx("div",{className:"s-text-document-markdown",children:e.length>0?e:i.jsx("p",{})})}function A(t){const e=t.replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),s=[];let n=0;for(;n<e.length;){const r=e[n]??"";if(!r.trim()){n+=1;continue}const c=/^```(\S*)\s*$/.exec(r);if(c){const l=[];for(n+=1;n<e.length&&!/^```\s*$/.test(e[n]??"");)l.push(e[n]??""),n+=1;n<e.length&&(n+=1),s.push({kind:"code",content:l.join(`
|
|
4
4
|
`),language:c[1]||void 0});continue}const a=/^(#{1,6})\s+(.+)$/.exec(r);if(a){s.push({kind:"heading",depth:z(a[1].length),content:a[2].trim()}),n+=1;continue}if(/^ {0,3}([-*_])(?:\s*\1){2,}\s*$/.test(r)){s.push({kind:"hr"}),n+=1;continue}if(/^>\s?/.test(r)){const l=[];for(;n<e.length&&/^>\s?/.test(e[n]??"");)l.push((e[n]??"").replace(/^>\s?/,"")),n+=1;s.push({kind:"blockquote",content:l.join(" ")});continue}const o=/^(\s*)([-*+]|\d+[.)])\s+(.+)$/.exec(r);if(o){const l=/\d/.test(o[2]),m=[];for(;n<e.length;){const f=/^(\s*)([-*+]|\d+[.)])\s+(.+)$/.exec(e[n]??"");if(!f||/\d/.test(f[2])!==l)break;m.push(f[3]),n+=1}s.push({kind:"list",ordered:l,items:m});continue}const u=y(e,n);if(u){s.push(u.block),n=u.nextIndex;continue}const p=[];for(;n<e.length;){const l=e[n]??"";if(!l.trim()||/^```/.test(l)||/^(#{1,6})\s+/.test(l)||/^ {0,3}([-*_])(?:\s*\1){2,}\s*$/.test(l)||/^>\s?/.test(l)||/^(\s*)([-*+]|\d+[.)])\s+/.test(l)||y(e,n))break;p.push(l.trim()),n+=1}s.push({kind:"paragraph",content:p.join(" ")})}return s.map((r,c)=>C(r,c))}function z(t){return t<=1?1:t===2?2:t===3?3:t===4?4:t===5?5:6}function C(t,e){switch(t.kind){case"heading":{const n=`h${t.depth}`;return i.jsx(n,{children:d(t.content)},e)}case"paragraph":return i.jsx("p",{children:d(t.content)},e);case"blockquote":return i.jsx("blockquote",{children:d(t.content)},e);case"list":{const n=t.ordered?"ol":"ul";return i.jsx(n,{children:t.items.map((r,c)=>i.jsx("li",{children:d(r)},`${e}:${c}`))},e)}case"code":const s=$(t.language);return i.jsx("pre",{className:"s-text-document-fenced-code","data-language":s,children:i.jsx("code",{children:_(t.content,s)})},e);case"hr":return i.jsx("hr",{},e);case"table":return i.jsx("div",{className:"s-text-document-table-wrap",children:i.jsxs("table",{className:"s-text-document-table",children:[i.jsx("thead",{children:i.jsx("tr",{children:t.headers.map((n,r)=>i.jsx("th",{"data-align":t.alignments[r]??void 0,children:d(n)},`${e}:h:${r}`))})}),i.jsx("tbody",{children:t.rows.map((n,r)=>i.jsx("tr",{children:n.map((c,a)=>i.jsx("td",{"data-align":t.alignments[a]??void 0,children:d(c)},`${e}:r:${r}:${a}`))},`${e}:r:${r}`))})]})},e)}}function y(t,e){const s=w(t[e]??""),n=R(t[e+1]??"");if(!s||!n||s.length!==n.length)return null;const r=s.length,c=[];let a=e+2;for(;a<t.length;){const o=w(t[a]??"");if(!o||o.length<2)break;c.push(T(o,r)),a+=1}return{block:{kind:"table",alignments:n,headers:T(s,r),rows:c},nextIndex:a}}function w(t){const e=t.trim();if(!e.includes("|"))return null;let s=e;s.startsWith("|")&&(s=s.slice(1)),s.endsWith("|")&&!s.endsWith("\\|")&&(s=s.slice(0,-1));const n=[];let r="";for(let c=0;c<s.length;c+=1){const a=s[c];if(a==="\\"&&s[c+1]==="|"){r+="|",c+=1;continue}if(a==="|"){n.push(r.trim()),r="";continue}r+=a}return n.push(r.trim()),n.length>=2?n:null}function R(t){const e=w(t);if(!e||e.length<2)return null;const s=[];for(const n of e){const r=n.replace(/\s/g,"");if(!/^:?-{3,}:?$/u.test(r))return null;r.startsWith(":")&&r.endsWith(":")?s.push("center"):r.endsWith(":")?s.push("right"):r.startsWith(":")?s.push("left"):s.push(null)}return s}function T(t,e){const s=t.slice(0,e);for(;s.length<e;)s.push("");return s}const M=/\/\/[^\n]*|\/\*[\s\S]*?\*\/|`(?:\\[\s\S]|[^`\\])*`|'(?:\\.|[^'\\\n])*'|"(?:\\.|[^"\\\n])*"|\b\d+(?:\.\d+)?(?:e[+-]?\d+)?n?\b|\b[A-Za-z_$][\w$]*\b|=>|[{}()[\].,;:?]|[-+*/%=&|!<>~^]+/giu,D=/"(?:\\.|[^"\\])*"|-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b|\b(?:true|false|null)\b|[{}\[\]:,]/giu,O=/\/\*[\s\S]*?\*\/|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|#[0-9a-f]{3,8}\b|@[a-z-]+|--[a-z0-9-]+|[a-z-]+(?=\s*:)|\b\d+(?:\.\d+)?(?:%|px|r?em|vh|vw|vmin|vmax|s|ms|deg|fr)?\b|[{}():;,]|\.[a-z_][\w-]*|#[a-z_][\w-]*|[a-z_][\w-]*/giu,v=/<!--[\s\S]*?-->|<!doctype[^>]*>|<\/?[a-z][\w:-]*|\/?>|[a-z_:][\w:.-]*(?==)|=|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|&[a-z0-9#]+;/giu,P=/#[^\n]*|"(?:\\.|[^"\\])*"|'[^']*'|\$\{?[\w?@#$!-]+\}?|--?[A-Za-z0-9][\w-]*(?:=[^\s]+)?|\b(?:case|cd|do|done|echo|elif|else|esac|exit|export|fi|for|function|if|in|local|return|set|source|test|then|unset|while)\b|\b\d+\b|[|&;(){}<>]/giu,H=new Set(["abstract","as","async","await","break","case","catch","class","const","continue","declare","default","delete","do","else","enum","export","extends","finally","for","from","function","get","if","implements","import","in","infer","interface","is","keyof","let","new","of","private","protected","public","readonly","return","satisfies","set","static","switch","throw","try","type","typeof","var","void","while","with","yield"]),B=new Set(["false","null","super","this","true","undefined"]);function _(t,e){switch($(e)){case"css":return g(t,O,Z);case"html":return g(t,v,U);case"javascript":case"typescript":return g(t,M,K);case"json":return g(t,D,q);case"shell":return g(t,P,Y);default:return[t]}}function g(t,e,s){const n=[];let r=0,c=0;e.lastIndex=0;let a;for(;(a=e.exec(t))!==null;){const o=a[0];if(!o){e.lastIndex+=1;continue}a.index>r&&n.push(t.slice(r,a.index));const u=s(o,a.index,a.index+o.length,t);n.push(u?i.jsx("span",{className:`s-syntax s-syntax-${u}`,children:o},`syntax-${c++}`):o),r=a.index+o.length}return r<t.length&&n.push(t.slice(r)),n.length>0?n:[t]}function $(t){const e=String(t??"").toLowerCase().replace(/^\./,"");return e==="bash"||e==="sh"||e==="shell"||e==="zsh"?"shell":e==="css"||e==="scss"?"css":e==="html"||e==="htm"||e==="xml"||e==="svg"?"html":e==="js"||e==="jsx"||e==="javascript"||e==="mjs"||e==="cjs"?"javascript":e==="json"||e==="jsonc"?"json":e==="markdown"||e==="md"||e==="mdx"?"markdown":e==="ts"||e==="tsx"||e==="typescript"?"typescript":"plain"}function K(t,e,s,n){return t.startsWith("//")||t.startsWith("/*")?"comment":x(t)?"string":/^\d/u.test(t)?"number":H.has(t)?"keyword":B.has(t)?"literal":/^[A-Z][\w$]*$/u.test(t)?"type":/^[A-Za-z_$][\w$]*$/u.test(t)&&n.slice(s).trimStart().startsWith("(")?"function":/^[{}()[\].,;:?]$/u.test(t)?"punctuation":/^(?:=>|[-+*/%=&|!<>~^]+)$/u.test(t)?"operator":null}function q(t,e,s,n){return x(t)?n.slice(s).trimStart().startsWith(":")?"property":"string":/^-?\d/u.test(t)?"number":t==="true"||t==="false"||t==="null"?"literal":"punctuation"}function Z(t,e,s,n){return t.startsWith("/*")?"comment":x(t)?"string":t.startsWith("@")?"keyword":t.startsWith("#")&&/^#[0-9a-f]/iu.test(t)||/^\d/u.test(t)?"number":t.startsWith(".")||t.startsWith("#")?"tag":/^--/u.test(t)||n.slice(s).trimStart().startsWith(":")?"property":/^[{}():;,]$/u.test(t)?"punctuation":null}function U(t){return t.startsWith("<!--")?"comment":/^<!doctype/iu.test(t)||t.startsWith("&")?"meta":t.startsWith("<")?"tag":x(t)?"string":t==="="?"operator":t===">"||t==="/>"?"punctuation":"attribute"}function Y(t){return t.startsWith("#")?"comment":x(t)?"string":t.startsWith("$")?"property":t.startsWith("-")?"attribute":/^\d/u.test(t)?"number":/^[|&;(){}<>]$/u.test(t)?"operator":G.has(t)?"keyword":null}const G=new Set(["case","cd","do","done","echo","elif","else","esac","exit","export","fi","for","function","if","in","local","return","set","source","test","then","unset","while"]);function x(t){return t.startsWith('"')||t.startsWith("'")||t.startsWith("`")}const J=/`([^`]+)`/y,X=/\[([^\]]+)\]\(([^)\s]+)\)/y,F=/\*\*\*(.+?)\*\*\*/y,Q=/\*\*(.+?)\*\*/y,V=/__(.+?)__(?!\w)/y,tt=/~~(.+?)~~/y,et=/\*(?!\s)([^*]+?)\*/y,nt=/_(?!\s)([^_]+?)_(?!\w)/y;function h(t,e,s){t.lastIndex=s;const n=t.exec(e);return n&&n.index===s?n:null}function d(t){const e=[];let s="",n=0,r=0;const c=()=>{s&&(e.push(s),s="")};for(;n<t.length;){const a=n===0||/[^\w]/.test(t[n-1]??""),o=h(J,t,n);if(o){c(),e.push(i.jsx("code",{children:o[1]},r++)),n+=o[0].length;continue}const u=h(X,t,n);if(u){c();const j=st(u[2]);e.push(j?i.jsx("a",{href:j,target:"_blank",rel:"noreferrer",children:d(u[1])},r++):i.jsx("span",{children:d(u[1])},r++)),n+=u[0].length;continue}const p=h(F,t,n);if(p){c(),e.push(i.jsx("strong",{children:i.jsx("em",{children:d(p[1])})},r++)),n+=p[0].length;continue}const l=h(Q,t,n)??(a?h(V,t,n):null);if(l){c(),e.push(i.jsx("strong",{children:d(l[1])},r++)),n+=l[0].length;continue}const m=h(tt,t,n);if(m){c(),e.push(i.jsx("del",{children:d(m[1])},r++)),n+=m[0].length;continue}const f=h(et,t,n)??(a?h(nt,t,n):null);if(f){c(),e.push(i.jsx("em",{children:d(f[1])},r++)),n+=f[0].length;continue}s+=t[n],n+=1}return c(),e}function st(t){if(!t)return null;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"||e.protocol==="mailto:"?t:null}catch{return null}}export{ct as T,it as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as a}from"./index-
|
|
1
|
+
import{r as l,j as a}from"./index-C1VaWNuD.js";import{a as D}from"./api-Co9aQ2Jw.js";import{f as v}from"./time-Dhsh_2EG.js";/* empty css */import{R as F}from"./refresh-cw-Bkh7Cvnd.js";const M=44,B=132,H=3500,V=7e3;function W(e,t){return!!(e&&e.available===t.available&&e.sessionId===t.sessionId&&e.body===t.body&&e.lineCount===t.lineCount&&e.columnCount===t.columnCount&&e.truncated===t.truncated&&e.reason===t.reason)}function q(e){const t=new URLSearchParams({lines:String(e.lines),cols:String(e.columns)});return e.agentId?`/api/agents/${encodeURIComponent(e.agentId)}/tmux-peek?${t.toString()}`:e.surface?(t.set("backend",e.surface.backend),t.set("sessionName",e.surface.sessionName),`/api/terminal-sessions/peek?${t.toString()}`):null}function ee({agentId:e,surface:t,enabled:x=!0,lines:E=M,columns:L=B,pollMs:h=H,idlePollMs:u=V,className:N}){const[n,T]=l.useState(null),[k,m]=l.useState(!1),[A,b]=l.useState(null),[U,K]=l.useState(0),c=q({agentId:e,surface:t,lines:E,columns:L});if(l.useEffect(()=>{T(null),b(null),m(!1)},[c]),l.useEffect(()=>{if(!x||!c){m(!1);return}let r=!1,f,y=!0;const R=d=>{window.clearTimeout(f),f=window.setTimeout(()=>{S()},d)},S=async()=>{if(r)return;if(document.visibilityState!=="visible"){R(u);return}y&&m(!0);let d=h;try{const i=await D(c);if(r)return;b(null),T(o=>o&&W(o.payload,i)?o.steady?o:{...o,steady:!0}:{payload:i,observedAt:o?.observedAt??i.capturedAt,changedAt:o?i.capturedAt:null,steady:!1}),d=i.available?h:u}catch(i){if(r)return;b(i instanceof Error?i.message:String(i)),d=u}finally{r||(y&&m(!1),y=!1,R(d))}},$=()=>{document.visibilityState==="visible"&&(window.clearTimeout(f),S())};return S(),document.addEventListener("visibilitychange",$),()=>{r=!0,window.clearTimeout(f),document.removeEventListener("visibilitychange",$)}},[x,u,c,h,U]),!x||!c)return null;const s=n?.payload??null,g=s?.body??"",p=s?.lineCount??E,j=s?.columnCount??L,w=6,I=1.32,O={"--tmux-peek-columns":String(j),"--tmux-peek-rows":String(p),"--tmux-peek-font-size":`${w}px`,"--tmux-peek-line-height":String(I),"--tmux-peek-height":`${Math.ceil(p*w*I+18)}px`},C=!!(s?.available&&g),X=A||(k&&!n?"Loading terminal peek...":s?.available===!1?s.reason??"No tmux pane is available.":C?null:s?.available?"Pane is empty.":"Loading terminal peek..."),_=n?n.changedAt&&!n.steady?"Changed":n.steady?"At rest":"Peeked":null,P=n?.changedAt??n?.observedAt??null,z=n?n.changedAt?n.steady?`No terminal content change since ${v(n.changedAt)}`:`Terminal content changed ${v(n.changedAt)}`:`First terminal peek observed ${v(n.observedAt)}`:void 0;return a.jsxs("div",{className:`ctx-panel-tmux-peek${N?` ${N}`:""}`,style:O,children:[a.jsxs("div",{className:"ctx-panel-tmux-peek-head",children:[a.jsx("span",{children:"Terminal peek"}),a.jsxs("span",{className:"ctx-panel-tmux-peek-grid",children:[j,"x",p]}),s?.sessionId&&a.jsx("span",{className:"ctx-panel-tmux-peek-session",title:s.sessionId,children:s.sessionId.length>12?s.sessionId.slice(0,10):s.sessionId}),_&&P&&a.jsx("time",{className:"ctx-panel-tmux-peek-state",dateTime:new Date(P).toISOString(),title:z,children:_}),a.jsxs("button",{type:"button",className:"ctx-panel-tmux-peek-refresh",onClick:()=>K(r=>r+1),disabled:k,title:"Refresh terminal peek","aria-label":"Refresh terminal peek",children:[a.jsx(F,{size:12,strokeWidth:1.8}),a.jsx("span",{children:k?"Refreshing":"Refresh"})]})]}),C?a.jsx("pre",{className:"ctx-panel-tmux-peek-screen",children:g}):a.jsx("div",{className:"ctx-panel-tmux-peek-empty",children:X}),s?.truncated&&g&&a.jsxs("div",{className:"ctx-panel-tmux-peek-foot",children:["Last ",p," rows from tmux pane"]})]})}export{ee as T};
|
package/dist/client/assets/{VoicePermissionsPanel-CgQ6GGS-.js → VoicePermissionsPanel-C4vkU-sU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n,r as h}from"./index-
|
|
1
|
+
import{j as n,r as h}from"./index-C1VaWNuD.js";import{r as w,o as g}from"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";const p={microphone:{label:"Microphone",privacyPane:"Microphone",hint:"Scout Menu captures audio for web dictation. The browser never records.",appLabel:"Scout Menu"},speechRecognition:{label:"Speech recognition",privacyPane:"Speech Recognition",hint:"Live partials and Apple Speech fallback while Parakeet warms.",appLabel:"Scout Menu"}};function x(e){return e?e.granted?"ok":e.canRequest?"warn":e.status==="denied"||e.status==="restricted"?"fail":"warn":"idle"}function y(e){if(!e)return"Unknown";if(e.granted)return"Granted";switch(e.status){case"notDetermined":return"Not requested";case"denied":return"Denied";case"restricted":return"Restricted";case"authorized":return"Granted";default:return e.status}}function M(e,s){return e?e.granted?`${p[s].appLabel} is allowed to use ${p[s].label.toLowerCase()}.`:e.canRequest?`Click Request to show the macOS permission dialog for ${p[s].appLabel}.`:e.status==="denied"?`Choose Retry access. Scout Menu will open macOS ${p[s].privacyPane} settings and detect the change automatically.`:e.status==="restricted"?`${p[s].label} access is restricted on this Mac.`:`${p[s].appLabel} needs ${p[s].label.toLowerCase()} access before dictation works.`:"Launch Scout Menu on this Mac, then refresh."}function j(e){return!!(e&&!e.granted&&!e.canRequest&&e.status!=="unknown")}function R(e){return!!(e&&!e.granted&&e.status!=="restricted"&&e.status!=="unknown")}function L({hostOnline:e,micPermission:s,speechPermission:r,modelReady:l}){const c=s?.granted??!1,d=r?.granted??!1,u=e&&c&&d;let i="fail",t="Scout Menu not connected",a="Launch Scout Menu on this Mac. Web dictation uses the Scout voice host — not the browser microphone.";return e&&!c&&(s?.status==="denied"||s?.status==="restricted")?(i="fail",t="Microphone blocked for Scout Menu",a=s?.status==="restricted"?"Microphone access is restricted on this Mac.":"Choose Retry access below. Scout will open the right macOS pane and detect the change."):e&&!c&&s?.canRequest?(i="warn",t="Microphone access needed",a="Request permission below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&c&&!d&&(r?.status==="denied"||r?.status==="restricted")?(i="warn",t="Speech recognition blocked for Scout Menu",a=r?.status==="restricted"?"Speech recognition is restricted on this Mac.":"Open Privacy & Security → Speech Recognition to change it."):e&&c&&!d?(i="warn",t="Speech recognition needed",a="Request access below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&u?(i="ok",t=l?"Dictation ready":"Dictation ready · model warming",a="Scout Menu is running as the voice host. The browser does not capture audio."):e&&(i="warn",t="Voice host connected",a="Finish permissions below to enable dictation."),n.jsxs("div",{className:`s-voice-host-banner s-voice-host-banner--${i}`,children:[n.jsx("div",{className:"s-voice-host-banner-dot","aria-hidden":!0}),n.jsxs("div",{className:"s-voice-host-banner-copy",children:[n.jsx("div",{className:"s-voice-host-banner-title",children:t}),n.jsx("div",{className:"s-voice-host-banner-detail",children:a}),n.jsxs("div",{className:"s-voice-host-banner-meta",children:[n.jsx("span",{children:"Voice host · Scout Menu"}),n.jsx("span",{children:e?"Connected":"Offline"}),n.jsx("span",{children:"Capture · native"})]})]})]})}function f({kind:e,status:s,disabled:r,onActionError:l,onRefresh:c}){const[d,u]=h.useState(!1),i=h.useRef(s),t=p[e],a=x(s);h.useEffect(()=>{i.current=s},[s]);const m=h.useCallback(async()=>{for(let o=0;o<30;o+=1)if(await new Promise(S=>window.setTimeout(S,1e3)),await c(),i.current?.granted)return},[c]),v=h.useCallback(async()=>{u(!0);try{await w(e),await m()}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l,m]),b=h.useCallback(async()=>{u(!0);try{await g(e)}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l]);return n.jsxs("div",{className:`s-voice-permission-card s-voice-permission-card--${a}`,children:[n.jsxs("div",{className:"s-voice-permission-card-head",children:[n.jsx("span",{className:"s-voice-permission-card-dot","aria-hidden":!0}),n.jsxs("div",{children:[n.jsx("div",{className:"s-voice-permission-card-label",children:t.label}),n.jsxs("div",{className:"s-voice-permission-card-app",children:["via ",t.appLabel]})]}),n.jsx("span",{className:`s-voice-permission-card-status s-voice-permission-card-status--${a}`,children:y(s)})]}),n.jsx("p",{className:"s-voice-permission-card-hint",children:t.hint}),n.jsx("p",{className:"s-voice-permission-card-detail",children:M(s,e)}),n.jsxs("div",{className:"s-voice-permission-card-actions",children:[R(s)?n.jsx("button",{type:"button",className:"s-voice-permission-btn s-voice-permission-btn--primary",disabled:r||d,onClick:()=>{v()},children:d?s?.canRequest?"Requesting…":"Waiting for macOS…":s?.canRequest?"Request access":"Retry access"}):null,j(s)?n.jsxs("button",{type:"button",className:"s-voice-permission-btn",disabled:r||d,onClick:()=>{b()},children:["Open Privacy & Security → ",t.privacyPane]}):null]})]})}function P({permissions:e,hostOnline:s,disabled:r,onError:l,onRefresh:c}){const d=e?.find(i=>i.kind==="microphone")??null,u=e?.find(i=>i.kind==="speechRecognition")??null;return n.jsxs("div",{className:"s-voice-permissions-panel",children:[n.jsx(f,{kind:"microphone",status:s?d:null,disabled:r||!s,onActionError:l,onRefresh:c}),n.jsx(f,{kind:"speechRecognition",status:s?u:null,disabled:r||!s,onActionError:l,onRefresh:c}),s?null:n.jsx("p",{className:"s-voice-permissions-offline",children:"Scout Menu is not reporting to this web server. Permissions are managed on the Mac where Scout Menu runs."})]})}export{L as VoiceHostStatusBanner,P as VoicePermissionsPanel};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{r as h,j as e}from"./index-
|
|
1
|
+
import{r as h,j as e}from"./index-C1VaWNuD.js";import{D as Z}from"./DocumentFocusViewer-D8iB6SMt.js";import{S as O}from"./StatusPill-BllrY-eg.js";import{c as J}from"./TextDocumentSurface-2X1Gw4eA.js";import{WorkFilesViewer as he}from"./WorkFilesViewer-D8-4vF5l.js";import{r as C}from"./mentions-BZ5SBMtc.js";import{p as D,a as Y}from"./api-Co9aQ2Jw.js";import{u as W,m as ue,H as me}from"./Provider-D0bB7q6y.js";import{b as ke}from"./router-kfcaYqZr.js";import{u as pe}from"./sse-B29iGBnw.js";import{w as fe,c as ve}from"./status-tone-BM_zuRy1.js";import{t as $}from"./time-Dhsh_2EG.js";import{B as E}from"./BackToPicker-BHicJyfc.js";import{o as p}from"./openContent-C6XO6kr5.js";import{TailView as xe}from"./TailView-_gKWfaQM.js";import{M}from"./message-square-BLiFqpe_.js";import{R as V}from"./radio-CxIXS1nU.js";import{c as P}from"./createLucideIcon-Dv8H8m7J.js";import{E as ee}from"./external-link-BvX5PfLh.js";import{A as se}from"./activity-CzTJ-YMX.js";import{F as K}from"./file-text-BHro8MkG.js";import{C as we}from"./code-xml-CkkNdRmu.js";import"./x-DgmmnPKt.js";import"./chevron-right-CowuvuE6.js";import"./chevron-down-D120PY4g.js";import"./perf-PX8Rx0EP.js";import"./colors-BtO5_zlx.js";import"./index-Cx6Gbr6n.js";import"./AgentDetailCard-8viaEY8b.js";import"./AgentLiveActions-DlSKL60c.js";import"./terminal-takeover-BMeBjBB2.js";import"./eye-C9cGk5z6.js";import"./terminal-UDy4lzV1.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./conversation-model-C2KuZUXc.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./search-FB2vVxCp.js";import"./model-CBkMvT1w.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./index-BWHgHrtv.js";import"./SlidePanel-CETQ5NTx.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./tail-events-LK29oCKm.js";const je=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],ge=P("book-open",je);const Ne=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],H=P("clipboard",Ne);const ye=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],z=P("folder-tree",ye),U=3e4;function B(s){return`/api/work/${encodeURIComponent(s)}`}function G(s){switch(s){case"review":return"In review";case"waiting":return"Waiting";case"working":return"Working";case"done":return"Done";default:return s.replace(/_/g," ")}}function Ie(s){switch(s){case"badge":return"Noteworthy";case"interrupt":return"Blocked signal";default:return null}}function be({detail:s,signal:t,ownerLabel:r,nextMoveLabel:n}){const i=n==="—"?r:n;return s.attention==="interrupt"?{eyebrow:"Network signal",title:`Blocker surfaced for ${i}`,body:s.conversationId?"Open the thread if you want the blocking context.":"No thread is attached; the record and timeline hold the current context.",tone:"blocked"}:t?{eyebrow:"Network signal",title:`Plan activity from ${i}`,body:s.conversationId?"A plan or spec discussion is active in the agent network. Open the thread only if you want context.":"A plan or spec discussion is active in the agent network, but no thread is attached yet.",tone:"attention"}:s.activeFlights.length>0||s.state==="in_turn"||s.state==="in_flight"?{eyebrow:"Next move",title:`${r} is working`,body:s.conversationId?"The thread has the freshest working context.":"Watch the flight list and timeline for the next update.",tone:"active"}:s.state==="waiting"||s.state==="review"?{eyebrow:"Next move",title:`Waiting on ${n}`,body:s.conversationId?"The thread has the current unblock context.":"No thread is attached; ownership and timeline are the best context.",tone:"quiet"}:s.state==="done"?{eyebrow:"Outcome",title:"Work is done",body:s.conversationId?"The thread keeps the handoff and final context.":"The record and timeline are preserved here.",tone:"quiet"}:{eyebrow:"Next move",title:n==="—"?"No next owner set":`Next move: ${n}`,body:s.conversationId?"The thread has the latest context.":"Use the record and timeline to decide where this should go next.",tone:"quiet"}}function v({children:s,icon:t,onClick:r,primary:n=!1,disabled:i=!1}){return e.jsxs("button",{type:"button",className:`s-work-action-button${n?" s-work-action-button-primary":""}`,onClick:r,disabled:i,children:[t,e.jsx("span",{children:s})]})}function te(s){const t=s?.toLowerCase()??"";return t.includes("mcp")?"MCP request":t.includes("cli")?"CLI request":t?`${s} request`:"Scout request"}function ne(s){const t=s.primaryInvocation,r=t?.targetAgentName??t?.targetAgentId??s.ownerName??s.ownerId??"The agent";switch(t?.state??s.activeFlights[0]?.state??s.state){case"running":return`${r} is running in background. Synchronous wait may have expired, but the Run is still active.`;case"waking":return`${r} is waking up for this Run.`;case"queued":return`${r} has the Run queued.`;case"waiting":case"review":return`${r} paused and is waiting for the next move.`;case"completed":case"done":return`${r} completed this Run.`;case"failed":return`${r} reported a failure for this Run.`;case"cancelled":return"This Run was cancelled.";default:return`${r} is attached to this work item.`}}function Se(s){const t=s.primaryInvocation;return[`Work: ${s.id}`,`State: ${s.currentPhase}`,t?`Source: ${te(t.source)}`:null,t?.targetAgentName||t?.targetAgentId?`Resolved agent: ${t.targetAgentName??t.targetAgentId}`:null,t?.requestedHarness?`Requested harness: ${t.requestedHarness}`:null,t?.requestedModel?`Requested model: ${t.requestedModel}`:null,t?.requestedReasoningEffort?`Requested effort: ${t.requestedReasoningEffort}`:null,t?.resolvedHarness?`Resolved harness: ${t.resolvedHarness}`:null,t?.resolvedModel?`Resolved model: ${t.resolvedModel}`:null,t?.resolvedReasoningEffort?`Resolved effort: ${t.resolvedReasoningEffort}`:null,t?.observedModel?`Observed model: ${t.observedModel}`:null,t?.observedReasoningEffort?`Observed effort: ${t.observedReasoningEffort}`:null,t?.resolvedSessionId?`Session: ${t.resolvedSessionId}`:null,t?.flightId?`Flight: ${t.flightId}`:null,t?.invocationId?`Invocation: ${t.invocationId}`:null,s.conversationId?`Conversation: ${s.conversationId}`:null,ne(s)].filter(Boolean).join(`
|
|
2
2
|
`)}function $e(s){const t=s.primaryInvocation;return[`workId=${s.id}`,t?.flightId?`flightId=${t.flightId}`:null,t?.invocationId?`invocationId=${t.invocationId}`:null,s.conversationId?`conversationId=${s.conversationId}`:null,t?.targetAgentId?`agentId=${t.targetAgentId}`:null,t?.resolvedSessionId?`sessionId=${t.resolvedSessionId}`:null].filter(Boolean).join(`
|
|
3
|
-
`)}function Q(s){navigator.clipboard?.writeText(s)}function Ce({detail:s,navigate:t}){const{route:r}=W(),n=s.primaryInvocation,i=oe(s).query,o=$e(s),u=te(n?.source),k=n?.targetAgentName??n?.targetAgentId??s.ownerName??s.ownerId??"—",j=n?.task??re(s)??s.summary??"No original prompt captured.",x=n?.resolvedSessionId?{view:"sessions",sessionId:n.resolvedSessionId,...n.targetAgentId?{agentId:n.targetAgentId}:{}}:n?.targetAgentId?{view:"agents-v2",agentId:n.targetAgentId,tab:"observe"}:null,g=n?.resolvedSessionId?"Observe session":"Observe agent",p={view:"ops",mode:"tail",...i?{tailQuery:i}:{},workId:s.id,...n?.flightId?{flightId:n.flightId}:{},...n?.invocationId?{invocationId:n.invocationId}:{},...s.conversationId?{conversationId:s.conversationId}:{},...n?.resolvedSessionId?{sessionId:n.resolvedSessionId}:{},...n?.targetAgentId?{targetAgentId:n.targetAgentId}:{}};return e.jsxs("section",{className:"s-work-casefile-section s-work-ask-overview","data-kind":"ask","data-work-id":s.id,"data-flight-id":n?.flightId??void 0,"data-invocation-id":n?.invocationId??void 0,"data-agent-id":n?.targetAgentId??void 0,children:[e.jsx("div",{className:"s-work-ask-head",children:e.jsxs("div",{children:[e.jsxs("div",{className:"s-work-ask-badges",children:[e.jsx("span",{className:"s-work-ask-badge s-work-ask-badge-primary",children:"RUN created"}),e.jsx("span",{className:"s-work-ask-badge",children:u}),n?.state&&e.jsx("span",{className:"s-work-ask-badge",children:n.state})]}),e.jsx("h2",{className:"s-agent-section-title s-work-ask-title",children:"Message / work source of truth"}),e.jsx("p",{className:"s-work-ask-lifecycle",children:ne(s)})]})}),e.jsxs("div",{className:"s-work-ask-grid",children:[e.jsxs("div",{className:"s-work-ask-prompt",children:[e.jsx("span",{className:"s-work-ask-label",children:"Original prompt"}),e.jsx("p",{children:C(j)})]}),e.jsxs("dl",{className:"s-work-ask-facts",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Requested harness"}),e.jsx("dd",{children:n?.requestedHarness??"default"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Requested model"}),e.jsx("dd",{children:n?.requestedModel??"default"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Requested effort"}),e.jsx("dd",{children:n?.requestedReasoningEffort??"default"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved agent"}),e.jsx("dd",{children:k})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved harness"}),e.jsx("dd",{children:n?.resolvedHarness??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved model"}),e.jsx("dd",{children:n?.resolvedModel??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved effort"}),e.jsx("dd",{children:n?.resolvedReasoningEffort??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Observed model"}),e.jsx("dd",{children:n?.observedModel??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Observed effort"}),e.jsx("dd",{children:n?.observedReasoningEffort??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Session"}),e.jsx("dd",{children:n?.resolvedSessionId??n?.targetSessionId??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Flight"}),e.jsx("dd",{children:n?.flightId??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Invocation"}),e.jsx("dd",{children:n?.invocationId??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Work"}),e.jsx("dd",{children:s.id})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Conversation"}),e.jsx("dd",{children:s.conversationId??"—"})]})]})]}),e.jsxs("div",{className:"s-work-ask-actions",children:[x&&e.jsx(v,{primary:!0,icon:e.jsx(V,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>f(t,x,{returnTo:r}),children:g}),e.jsx(v,{icon:e.jsx(U,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>Q(Se(s)),children:"Copy status"}),s.conversationId&&e.jsx(v,{icon:e.jsx(M,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>f(t,{view:"conversation",conversationId:s.conversationId},{returnTo:r}),children:"Open chat"}),e.jsx(v,{icon:e.jsx(ee,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>f(t,{view:"work",workId:s.id},{returnTo:r}),children:"Open work"}),n?.resolvedSessionId&&e.jsx(v,{icon:e.jsx(V,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>f(t,{view:"sessions",sessionId:n.resolvedSessionId},{returnTo:r}),children:"Open session"}),e.jsx(v,{icon:e.jsx(se,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>f(t,p,{returnTo:r}),children:"Scout tail"}),o&&e.jsx(v,{icon:e.jsx(U,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>Q(o),children:"Copy MCP ids"}),s.conversationId&&e.jsx(v,{icon:e.jsx(M,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>f(t,{view:"conversation",conversationId:s.conversationId},{returnTo:r}),children:"Nudge agent"})]})]})}function Me({detail:s,navigate:t}){const r=!!s.conversationId,n=s.inventory??Te(s),i=n.materials.filter(l=>l.kind==="plan"||l.kind==="spec"),o=n.materials.filter(l=>l.kind==="doc"),u=n.materials.filter(l=>l.kind==="code"||l.kind==="test"||l.kind==="config"||l.kind==="asset"||l.kind==="other"),k=i.length>0,j=o.length>0,x=re(s),g=i[0]?Ae(i[0]):x??"No plan or spec file detected yet.",p=[...i,...o,...u].filter(l=>l.status!=="deleted"),[I,N]=h.useState(!1),[m,d]=h.useState(null),[b,y]=h.useState(null),[T,w]=h.useState(null),[R,a]=h.useState(null),[ae,_]=h.useState(!1),[de,le]=h.useState("all"),A=h.useCallback(l=>{N(!1),d(l)},[]),ce=h.useCallback(()=>{d(null),N(!0)},[]),q=h.useCallback(l=>{N(!1),d(null),le(l),_(!0)},[]);return h.useEffect(()=>{m&&!p.some(l=>l.id===m)&&d(null)},[m,p]),h.useEffect(()=>{if(!m){y(null),w(null),a(null);return}let l=!1;return a(m),w(null),Y(`/api/work/${encodeURIComponent(s.id)}/material?materialId=${encodeURIComponent(m)}`).then(S=>{l||y(S)}).catch(S=>{l||(y(null),w(S instanceof Error?S.message:String(S)))}).finally(()=>{l||a(null)}),()=>{l=!0}},[s.id,m]),e.jsxs("section",{className:"s-work-casefile-section s-work-materials-section",children:[e.jsxs("div",{className:"s-agent-section-heading",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"s-agent-section-title",children:"Work materials"}),e.jsxs("p",{className:"s-work-section-note",children:[Re(n.mode)," · ",n.source," evidence · ",n.confidence," confidence"]})]}),e.jsxs("div",{className:"s-work-inventory-meta","aria-label":"Inventory totals",children:[e.jsxs("span",{children:[n.totals.materials," files"]}),e.jsxs("span",{children:[n.totals.agents," agents"]}),e.jsxs("span",{children:[n.totals.sessions," sessions"]})]})]}),e.jsxs("div",{className:"s-work-material-grid",children:[e.jsxs("article",{className:"s-work-material-card s-work-material-card-primary",children:[e.jsxs("div",{className:"s-work-material-head",children:[e.jsx("span",{className:"s-work-material-icon","aria-hidden":"true",children:e.jsx(K,{size:15,strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("div",{className:"s-work-material-kicker",children:k?"Plans & specs":"Brief"}),e.jsx("div",{className:"s-work-material-title",children:k?`${i.length} surfaced`:x?"Original request":"No plan file yet"})]})]}),e.jsx("p",{className:"s-work-material-copy",children:g}),e.jsx(F,{materials:i.slice(0,3),empty:"No plan or spec files detected yet.",selectedId:m,onOpen:A}),e.jsxs("div",{className:"s-work-material-card-actions",children:[x&&e.jsxs("button",{type:"button",className:`s-work-material-link${I?" s-work-material-link-active":""}`,onClick:ce,children:[e.jsx(K,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View request"]}),i.length>3&&e.jsxs("button",{type:"button",className:"s-work-material-link",onClick:()=>q("plan"),children:[e.jsx(z,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View all ",i.length]})]})]}),e.jsxs("div",{className:`s-work-material-evidence-stack${j?"":" s-work-material-evidence-stack-single"}`,children:[j&&e.jsxs("article",{className:"s-work-material-card s-work-material-card-docs",children:[e.jsxs("div",{className:"s-work-material-head",children:[e.jsx("span",{className:"s-work-material-icon","aria-hidden":"true",children:e.jsx(ge,{size:15,strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("div",{className:"s-work-material-kicker",children:"Docs"}),e.jsxs("div",{className:"s-work-material-title",children:[o.length," documents"]})]})]}),e.jsx(F,{materials:o.slice(0,3),empty:"Docs from git or trace evidence will appear here.",selectedId:m,onOpen:A}),o.length>3&&e.jsx("div",{className:"s-work-material-card-actions",children:e.jsxs("button",{type:"button",className:"s-work-material-link",onClick:()=>q("doc"),children:[e.jsx(z,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View all ",o.length]})})]}),e.jsxs("article",{className:"s-work-material-card s-work-material-card-code",children:[e.jsxs("div",{className:"s-work-material-head",children:[e.jsx("span",{className:"s-work-material-icon","aria-hidden":"true",children:e.jsx(we,{size:15,strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("div",{className:"s-work-material-kicker",children:"Code"}),e.jsx("div",{className:"s-work-material-title",children:u.length>0?`${u.length} related files`:"No code yet"})]})]}),e.jsx(F,{materials:u.slice(0,5),empty:"Changed code from git or session traces will appear here.",selectedId:m,onOpen:A}),u.length>5&&e.jsx("div",{className:"s-work-material-card-actions",children:e.jsxs("button",{type:"button",className:"s-work-material-link",onClick:()=>q("code"),children:[e.jsx(z,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View all ",u.length]})})]})]})]}),e.jsx(We,{detail:s,summary:x,open:I,hasThread:r,navigate:t,onClose:()=>N(!1)}),e.jsx(qe,{material:p.find(l=>l.id===m)??null,content:b,loading:!!R,error:T,onClose:()=>d(null)}),e.jsx(he,{workId:s.id,workTitle:s.title,materials:p,open:ae,initialKind:de,onClose:()=>_(!1)}),n.limitations.length>0&&e.jsx("div",{className:"s-work-inventory-note",children:n.limitations[0]})]})}function We({detail:s,summary:t,open:r,hasThread:n,navigate:i,onClose:o}){const{route:u}=W();if(!r||!t)return null;const k=J({id:`${s.id}:brief`,title:"Original request",uri:`scout://work/${s.id}/brief`,mediaType:"text/markdown",value:`# Original request
|
|
3
|
+
`)}function Q(s){navigator.clipboard?.writeText(s)}function Ce({detail:s,navigate:t}){const{route:r}=W(),n=s.primaryInvocation,i=oe(s).query,o=$e(s),u=te(n?.source),k=n?.targetAgentName??n?.targetAgentId??s.ownerName??s.ownerId??"—",j=n?.task??re(s)??s.summary??"No original prompt captured.",x=n?.resolvedSessionId?{view:"sessions",sessionId:n.resolvedSessionId,...n.targetAgentId?{agentId:n.targetAgentId}:{}}:n?.targetAgentId?{view:"agents-v2",agentId:n.targetAgentId,tab:"observe"}:null,g=n?.resolvedSessionId?"Observe session":"Observe agent",f={view:"ops",mode:"tail",...i?{tailQuery:i}:{},workId:s.id,...n?.flightId?{flightId:n.flightId}:{},...n?.invocationId?{invocationId:n.invocationId}:{},...s.conversationId?{conversationId:s.conversationId}:{},...n?.resolvedSessionId?{sessionId:n.resolvedSessionId}:{},...n?.targetAgentId?{targetAgentId:n.targetAgentId}:{}};return e.jsxs("section",{className:"s-work-casefile-section s-work-ask-overview","data-kind":"ask","data-work-id":s.id,"data-flight-id":n?.flightId??void 0,"data-invocation-id":n?.invocationId??void 0,"data-agent-id":n?.targetAgentId??void 0,children:[e.jsx("div",{className:"s-work-ask-head",children:e.jsxs("div",{children:[e.jsxs("div",{className:"s-work-ask-badges",children:[e.jsx("span",{className:"s-work-ask-badge s-work-ask-badge-primary",children:"RUN created"}),e.jsx("span",{className:"s-work-ask-badge",children:u}),n?.state&&e.jsx("span",{className:"s-work-ask-badge",children:n.state})]}),e.jsx("h2",{className:"s-agent-section-title s-work-ask-title",children:"Message / work source of truth"}),e.jsx("p",{className:"s-work-ask-lifecycle",children:ne(s)})]})}),e.jsxs("div",{className:"s-work-ask-grid",children:[e.jsxs("div",{className:"s-work-ask-prompt",children:[e.jsx("span",{className:"s-work-ask-label",children:"Original prompt"}),e.jsx("p",{children:C(j)})]}),e.jsxs("dl",{className:"s-work-ask-facts",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Requested harness"}),e.jsx("dd",{children:n?.requestedHarness??"default"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Requested model"}),e.jsx("dd",{children:n?.requestedModel??"default"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Requested effort"}),e.jsx("dd",{children:n?.requestedReasoningEffort??"default"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved agent"}),e.jsx("dd",{children:k})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved harness"}),e.jsx("dd",{children:n?.resolvedHarness??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved model"}),e.jsx("dd",{children:n?.resolvedModel??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved effort"}),e.jsx("dd",{children:n?.resolvedReasoningEffort??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Observed model"}),e.jsx("dd",{children:n?.observedModel??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Observed effort"}),e.jsx("dd",{children:n?.observedReasoningEffort??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Session"}),e.jsx("dd",{children:n?.resolvedSessionId??n?.targetSessionId??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Flight"}),e.jsx("dd",{children:n?.flightId??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Invocation"}),e.jsx("dd",{children:n?.invocationId??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Work"}),e.jsx("dd",{children:s.id})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Conversation"}),e.jsx("dd",{children:s.conversationId??"—"})]})]})]}),e.jsxs("div",{className:"s-work-ask-actions",children:[x&&e.jsx(v,{primary:!0,icon:e.jsx(V,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>p(t,x,{returnTo:r}),children:g}),e.jsx(v,{icon:e.jsx(H,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>Q(Se(s)),children:"Copy status"}),s.conversationId&&e.jsx(v,{icon:e.jsx(M,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>p(t,{view:"conversation",conversationId:s.conversationId},{returnTo:r}),children:"Open chat"}),e.jsx(v,{icon:e.jsx(ee,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>p(t,{view:"work",workId:s.id},{returnTo:r}),children:"Open work"}),n?.resolvedSessionId&&e.jsx(v,{icon:e.jsx(V,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>p(t,{view:"sessions",sessionId:n.resolvedSessionId},{returnTo:r}),children:"Open session"}),e.jsx(v,{icon:e.jsx(se,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>p(t,f,{returnTo:r}),children:"Scout tail"}),o&&e.jsx(v,{icon:e.jsx(H,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>Q(o),children:"Copy MCP ids"}),s.conversationId&&e.jsx(v,{icon:e.jsx(M,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>p(t,{view:"conversation",conversationId:s.conversationId},{returnTo:r}),children:"Nudge agent"})]})]})}function Me({detail:s,navigate:t}){const r=!!s.conversationId,n=s.inventory??Te(s),i=n.materials.filter(l=>l.kind==="plan"||l.kind==="spec"),o=n.materials.filter(l=>l.kind==="doc"),u=n.materials.filter(l=>l.kind==="code"||l.kind==="test"||l.kind==="config"||l.kind==="asset"||l.kind==="other"),k=i.length>0,j=o.length>0,x=re(s),g=i[0]?Ae(i[0]):x??"No plan or spec file detected yet.",f=[...i,...o,...u].filter(l=>l.status!=="deleted"),[I,N]=h.useState(!1),[m,d]=h.useState(null),[b,y]=h.useState(null),[T,w]=h.useState(null),[R,a]=h.useState(null),[ae,_]=h.useState(!1),[de,le]=h.useState("all"),A=h.useCallback(l=>{N(!1),d(l)},[]),ce=h.useCallback(()=>{d(null),N(!0)},[]),q=h.useCallback(l=>{N(!1),d(null),le(l),_(!0)},[]);return h.useEffect(()=>{m&&!f.some(l=>l.id===m)&&d(null)},[m,f]),h.useEffect(()=>{if(!m){y(null),w(null),a(null);return}let l=!1;return a(m),w(null),Y(`/api/work/${encodeURIComponent(s.id)}/material?materialId=${encodeURIComponent(m)}`).then(S=>{l||y(S)}).catch(S=>{l||(y(null),w(S instanceof Error?S.message:String(S)))}).finally(()=>{l||a(null)}),()=>{l=!0}},[s.id,m]),e.jsxs("section",{className:"s-work-casefile-section s-work-materials-section",children:[e.jsxs("div",{className:"s-agent-section-heading",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"s-agent-section-title",children:"Work materials"}),e.jsxs("p",{className:"s-work-section-note",children:[Re(n.mode)," · ",n.source," evidence · ",n.confidence," confidence"]})]}),e.jsxs("div",{className:"s-work-inventory-meta","aria-label":"Inventory totals",children:[e.jsxs("span",{children:[n.totals.materials," files"]}),e.jsxs("span",{children:[n.totals.agents," agents"]}),e.jsxs("span",{children:[n.totals.sessions," sessions"]})]})]}),e.jsxs("div",{className:"s-work-material-grid",children:[e.jsxs("article",{className:"s-work-material-card s-work-material-card-primary",children:[e.jsxs("div",{className:"s-work-material-head",children:[e.jsx("span",{className:"s-work-material-icon","aria-hidden":"true",children:e.jsx(K,{size:15,strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("div",{className:"s-work-material-kicker",children:k?"Plans & specs":"Brief"}),e.jsx("div",{className:"s-work-material-title",children:k?`${i.length} surfaced`:x?"Original request":"No plan file yet"})]})]}),e.jsx("p",{className:"s-work-material-copy",children:g}),e.jsx(F,{materials:i.slice(0,3),empty:"No plan or spec files detected yet.",selectedId:m,onOpen:A}),e.jsxs("div",{className:"s-work-material-card-actions",children:[x&&e.jsxs("button",{type:"button",className:`s-work-material-link${I?" s-work-material-link-active":""}`,onClick:ce,children:[e.jsx(K,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View request"]}),i.length>3&&e.jsxs("button",{type:"button",className:"s-work-material-link",onClick:()=>q("plan"),children:[e.jsx(z,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View all ",i.length]})]})]}),e.jsxs("div",{className:`s-work-material-evidence-stack${j?"":" s-work-material-evidence-stack-single"}`,children:[j&&e.jsxs("article",{className:"s-work-material-card s-work-material-card-docs",children:[e.jsxs("div",{className:"s-work-material-head",children:[e.jsx("span",{className:"s-work-material-icon","aria-hidden":"true",children:e.jsx(ge,{size:15,strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("div",{className:"s-work-material-kicker",children:"Docs"}),e.jsxs("div",{className:"s-work-material-title",children:[o.length," documents"]})]})]}),e.jsx(F,{materials:o.slice(0,3),empty:"Docs from git or trace evidence will appear here.",selectedId:m,onOpen:A}),o.length>3&&e.jsx("div",{className:"s-work-material-card-actions",children:e.jsxs("button",{type:"button",className:"s-work-material-link",onClick:()=>q("doc"),children:[e.jsx(z,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View all ",o.length]})})]}),e.jsxs("article",{className:"s-work-material-card s-work-material-card-code",children:[e.jsxs("div",{className:"s-work-material-head",children:[e.jsx("span",{className:"s-work-material-icon","aria-hidden":"true",children:e.jsx(we,{size:15,strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("div",{className:"s-work-material-kicker",children:"Code"}),e.jsx("div",{className:"s-work-material-title",children:u.length>0?`${u.length} related files`:"No code yet"})]})]}),e.jsx(F,{materials:u.slice(0,5),empty:"Changed code from git or session traces will appear here.",selectedId:m,onOpen:A}),u.length>5&&e.jsx("div",{className:"s-work-material-card-actions",children:e.jsxs("button",{type:"button",className:"s-work-material-link",onClick:()=>q("code"),children:[e.jsx(z,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View all ",u.length]})})]})]})]}),e.jsx(We,{detail:s,summary:x,open:I,hasThread:r,navigate:t,onClose:()=>N(!1)}),e.jsx(qe,{material:f.find(l=>l.id===m)??null,content:b,loading:!!R,error:T,onClose:()=>d(null)}),e.jsx(he,{workId:s.id,workTitle:s.title,materials:f,open:ae,initialKind:de,onClose:()=>_(!1)}),n.limitations.length>0&&e.jsx("div",{className:"s-work-inventory-note",children:n.limitations[0]})]})}function We({detail:s,summary:t,open:r,hasThread:n,navigate:i,onClose:o}){const{route:u}=W();if(!r||!t)return null;const k=J({id:`${s.id}:brief`,title:"Original request",uri:`scout://work/${s.id}/brief`,mediaType:"text/markdown",value:`# Original request
|
|
4
4
|
|
|
5
|
-
${t}`,readOnly:!0});return e.jsx(Z,{kind:"ask",document:k,title:"Original request",eyebrow:"Brief",subtitle:s.title,meta:["request",n?"thread linked":"threadless"],mode:"preview",actions:n&&s.conversationId?[{label:"Thread",icon:e.jsx(M,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>f(i,{view:"conversation",conversationId:s.conversationId},{returnTo:u}),title:"Open source thread"}]:[],onClose:o})}function re(s){const t=[...s.timeline].sort((i,o)=>i.at-o.at),r=t.find(i=>i.kind==="collaboration_event"&&i.detailKind==="created"&&i.summary),n=t.find(i=>i.kind==="message"&&i.summary);return r?.summary??n?.summary??null}function Te(s){return{workId:s.id,generatedAt:Date.now(),mode:"trace-only",source:"broker",confidence:"low",agents:[],sessions:[],materials:[],totals:{materials:0,plans:0,specs:0,docs:0,code:0,tests:0,config:0,assets:0,agents:0,sessions:0},limitations:["Inventory is not available from this server yet."]}}function Re(s){switch(s){case"isolated-git-worktree":return"Isolated git worktree";case"shared-git-repo":return"Shared git repo";case"explicit-artifacts":return"Explicit artifacts";default:return"Trace-only"}}function Ae(s){const t=s.diffStat?`+${s.diffStat.additions} / -${s.diffStat.deletions}`:s.status;return`${s.path} · ${t} · ${s.confidence} confidence`}function F({materials:s,empty:t,selectedId:r,onOpen:n}){return s.length===0?e.jsx("div",{className:"s-work-material-empty",children:t}):e.jsx("div",{className:"s-work-material-list",children:s.map(i=>e.jsxs("button",{type:"button",className:`s-work-material-row${r===i.id?" s-work-material-row-active":""}`,title:i.path,onClick:()=>n?.(i.id),disabled:!n||i.status==="deleted",children:[e.jsx("div",{className:"s-work-material-path",children:i.path}),e.jsxs("div",{className:"s-work-material-row-meta",children:[e.jsx("span",{children:i.status}),i.diffStat&&e.jsxs("span",{children:["+",i.diffStat.additions," -",i.diffStat.deletions]}),e.jsx("span",{children:i.confidence})]})]},i.id))})}function qe({material:s,content:t,loading:r,error:n,onClose:i}){if(!s)return null;const o=t?J({id:t.materialId,title:t.title,uri:t.uri,mediaType:t.mediaType,value:t.content,readOnly:!0}):null;return e.jsx(Z,{kind:Oe(s),document:o,title:s.path,eyebrow:s.kind==="spec"?"Spec":s.kind,subtitle:t?.uri??s.worktreeRoot??void 0,meta:[s.status,s.confidence,...t?[X(t.sizeBytes)]:[]],mode:o?.kind==="markdown"?"preview":"read",state:r||!t&&!n?"Loading file...":null,error:r?null:n,notice:t?.truncated?`Preview truncated at ${X(t.content.length)}.`:null,onClose:i})}function Oe(s){return s.kind==="plan"||s.kind==="spec"?"plan":s.kind==="doc"?"doc":"code"}function X(s){return s<1024?`${s} B`:s<1024*1024?`${Math.round(s/1024)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function ie(s){const t=s.split(".");return t[t.length-1]||s}function c(s,t){const r=t?.trim();!r||r.length<3||s.add(r)}function L(s,t){c(s,t);const n=t?.trim().replace(/\/+$/,"")?.split("/").filter(Boolean).at(-1);n&&n.length>=3&&s.add(n)}function Ee(s){return s.replace(/^\/Users\/[^/]+/,"~")}function oe(s){const t=new Set,r=[],n=s.ownerName??s.ownerId??s.nextMoveOwnerName??s.nextMoveOwnerId;c(t,s.id),c(t,s.conversationId),c(t,s.ownerId),c(t,s.nextMoveOwnerId),c(t,s.ownerName),c(t,s.nextMoveOwnerName);for(const o of s.activeFlights)c(t,o.id),c(t,o.invocationId),c(t,o.agentId),c(t,o.agentName),c(t,o.conversationId),c(t,o.collaborationRecordId);for(const o of s.inventory?.agents??[])c(t,o.id),c(t,o.name),c(t,o.sessionId),L(t,o.cwd),L(t,o.projectRoot);const i=s.inventory?.sessions.find(o=>o.cwd)??s.inventory?.sessions[0]??null;for(const o of s.inventory?.sessions??[])c(t,o.id),c(t,o.conversationId),c(t,o.agentId),c(t,o.agentName),L(t,o.cwd);return n&&r.push(n),i?.cwd&&r.push(Ee(i.cwd)),{query:[...t].slice(0,20).join("|"),label:r.length>0?r.join(" · "):`Case ${ie(s.id)}`}}function ze(s){return s.kind==="message"?s.title||(s.detailKind==="agent"?"reply":"thread update"):s.kind==="flight_started"?"agent output":s.kind==="flight_completed"?s.detailKind==="completed"?"reply":s.detailKind??"flight":s.detailKind==="created"?"request created":s.title??s.kind.replace(/_/g," ")}function Be({detail:s}){const t=s.timeline.slice(0,18);return t.length===0?null:e.jsxs("section",{className:"s-work-casefile-section s-work-timeline-panel",children:[e.jsx("div",{className:"s-agent-section-heading",children:e.jsxs("div",{children:[e.jsx("h2",{className:"s-agent-section-title",children:"Timeline"}),e.jsx("p",{className:"s-work-section-note",children:"Run lifecycle, follow-up requirements, flight state, and replies attached to this work item."})]})}),e.jsx("div",{className:"s-work-timeline-list",children:t.map(r=>e.jsxs("article",{className:`s-work-timeline-row s-work-timeline-row-${r.kind}`,"data-kind":r.kind,"data-flight-id":r.flightId??void 0,"data-work-id":s.id,"data-conversation-id":r.conversationId??s.conversationId??void 0,children:[e.jsx("span",{className:"s-work-timeline-badge",children:ze(r)}),e.jsxs("div",{className:"s-work-timeline-body",children:[e.jsxs("div",{className:"s-work-timeline-meta",children:[e.jsx("span",{children:r.actorName??r.actorId??"system"}),e.jsx("span",{children:$(r.at)})]}),r.summary&&e.jsx("p",{children:C(r.summary)})]})]},r.id))})]})}function Fe({detail:s,navigate:t}){const{route:r}=W(),n=oe(s);return e.jsxs("section",{className:"s-work-casefile-section s-work-tail-section",children:[e.jsxs("div",{className:"s-agent-section-heading s-work-tail-heading",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"s-agent-section-title s-work-tail-title",children:[e.jsx(se,{"aria-hidden":"true",size:15,strokeWidth:1.8}),"Live tail"]}),e.jsxs("p",{className:"s-work-section-note",children:["Filtered to ",n.label]})]}),e.jsx(v,{icon:e.jsx(ee,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>f(t,{view:"ops",mode:"tail",tailQuery:n.query||void 0},{returnTo:r}),children:"Scout tail"})]}),e.jsx("div",{className:"s-work-tail-frame",children:e.jsx(xe,{navigate:t,initialFilter:n.query,filterLabel:n.label,filterScope:"context",chrome:"embedded"})})]})}function _s({workId:s,navigate:t}){const{agents:r,route:n}=W(),[i]=h.useState(()=>D(B(s),H)),[o,u]=h.useState(i),[k,j]=h.useState(null),[x,g]=h.useState(i!==null),p=h.useCallback(async()=>{j(null);try{const a=await Y(B(s));u(a)}catch(a){j(a instanceof Error?a.message:String(a)),u(null)}finally{g(!0)}},[s]);h.useEffect(()=>{const a=D(B(s),H);a?(u(a),g(!0)):g(!1),p()},[p,s]),fe(()=>{p()});const I=ke(n),N=h.useMemo(()=>ue(r,I),[r,I]),m=h.useMemo(()=>o?me(o,N):null,[o,N]);if(!x)return e.jsxs("div",{children:[e.jsx(E,{slot:"work",fallback:{view:"inbox"},navigate:t}),e.jsx("div",{className:"s-empty",children:e.jsx("p",{children:"Loading…"})})]});if(!o||!m)return e.jsxs("div",{className:"s-work-not-found",children:[e.jsx(E,{slot:"work",fallback:{view:"inbox"},navigate:t}),e.jsxs("div",{className:"s-work-not-found-body",children:[e.jsx("div",{className:"s-work-not-found-glyph","aria-hidden":"true",children:"□"}),e.jsx("h2",{className:"s-work-not-found-title",children:o?"Work item outside this machine scope":"Work item not found"}),e.jsx("p",{className:"s-work-not-found-sub",children:o?"Clear the machine scope or switch machines to inspect this work item.":"This work item may have been removed or does not exist on this broker."}),k&&e.jsx("p",{className:"s-work-not-found-detail",children:k})]})]});const d=m,b=Ie(d.attention),y=d.ownerName??d.ownerId??"Unassigned",T=d.nextMoveOwnerName??d.nextMoveOwnerId??"—",w=be({detail:d,signal:b,ownerLabel:y,nextMoveLabel:T}),R=d.activeFlights.length>0||d.childWork.length>0;return e.jsxs("div",{className:"s-work-detail s-work-casefile",children:[e.jsxs("div",{className:"s-work-casefile-topbar",children:[e.jsx(E,{slot:"work",fallback:{view:"inbox"},navigate:t}),e.jsxs("span",{className:"s-work-casefile-record",children:["Case ",ie(d.id)]})]}),k&&e.jsx("p",{className:"s-error",children:k}),e.jsxs("section",{className:"s-work-casefile-hero",children:[e.jsxs("div",{className:"s-work-casefile-hero-main",children:[e.jsxs("div",{className:"s-work-casefile-title-row",children:[e.jsx("h1",{className:"s-work-casefile-title",children:d.title}),e.jsx(O,{tone:pe(d),variant:"pill",children:d.currentPhase})]}),d.lastMeaningfulSummary&&e.jsx("div",{className:"s-work-casefile-summary",children:C(d.lastMeaningfulSummary)}),e.jsxs("div",{className:"s-work-casefile-meta",children:[e.jsxs("span",{children:["Updated ",$(d.updatedAt)]}),e.jsx("span",{children:y}),e.jsx("span",{children:G(d.state)}),b&&e.jsx("span",{children:b}),d.priority&&e.jsxs("span",{children:["Priority ",d.priority]})]})]}),e.jsxs("aside",{className:`s-work-next-move s-work-next-move-${w.tone}`,children:[e.jsx("div",{className:"s-work-next-move-kicker",children:w.eyebrow}),e.jsx("div",{className:"s-work-next-move-title",children:w.title}),e.jsx("p",{className:"s-work-next-move-copy",children:w.body}),e.jsx("div",{className:"s-work-next-move-actions",children:d.conversationId&&e.jsx(v,{primary:!0,icon:e.jsx(M,{"aria-hidden":"true",size:14,strokeWidth:1.8}),onClick:()=>f(t,{view:"conversation",conversationId:d.conversationId},{returnTo:n}),children:"Open thread"})})]})]}),e.jsxs("div",{className:"s-work-casefile-layout s-work-casefile-layout-main",children:[e.jsxs("div",{className:"s-work-casefile-main s-work-casefile-main-materials",children:[e.jsx(Ce,{detail:d,navigate:t}),e.jsx(Me,{detail:d,navigate:t}),e.jsx(Be,{detail:d})]}),e.jsx(Fe,{detail:d,navigate:t}),R&&e.jsxs("div",{className:"s-work-casefile-main s-work-casefile-main-lower",children:[d.activeFlights.length>0&&e.jsxs("section",{className:"s-work-casefile-section",children:[e.jsx("div",{className:"s-agent-section-heading",children:e.jsx("h2",{className:"s-agent-section-title",children:"Flights"})}),e.jsx("div",{className:"s-work-flight-list",children:d.activeFlights.map(a=>e.jsxs("button",{type:"button",className:"s-work-flight-card",onClick:a.conversationId?()=>f(t,{view:"conversation",conversationId:a.conversationId},{returnTo:n}):void 0,disabled:!a.conversationId,children:[e.jsxs("div",{className:"s-work-flight-card-header",children:[e.jsx("span",{className:"s-work-flight-card-title",children:a.agentName??a.agentId}),e.jsx(O,{tone:"working",variant:"pill",children:a.state})]}),e.jsxs("div",{className:"s-work-flight-card-meta",children:[e.jsx("span",{children:a.startedAt?`Started ${$(a.startedAt)}`:"Start time unavailable"}),a.completedAt&&e.jsxs("span",{children:["Completed ",$(a.completedAt)]})]}),a.summary&&e.jsx("div",{className:"s-work-flight-card-copy",children:a.summary})]},a.id))})]}),d.childWork.length>0&&e.jsxs("section",{className:"s-work-casefile-section",children:[e.jsx("div",{className:"s-agent-section-heading",children:e.jsx("h2",{className:"s-agent-section-title",children:"Child work"})}),e.jsx("div",{className:"s-work-related-list",children:d.childWork.map(a=>e.jsxs("button",{type:"button",className:"s-work-related-card",onClick:()=>f(t,{view:"work",workId:a.id},{returnTo:n}),children:[e.jsxs("div",{className:"s-work-related-card-header",children:[e.jsx("span",{className:"s-work-related-card-title",children:a.title}),e.jsx(O,{tone:ve(a),variant:"pill",children:a.currentPhase})]}),e.jsxs("div",{className:"s-work-related-card-meta",children:[e.jsx("span",{children:a.ownerName??a.ownerId??"Unassigned"}),e.jsx("span",{children:G(a.state)}),e.jsx("span",{children:$(a.lastMeaningfulAt)})]}),a.lastMeaningfulSummary&&e.jsx("div",{className:"s-work-related-card-copy",children:C(a.lastMeaningfulSummary)})]},a.id))})]})]})]})]})}export{_s as WorkDetailScreen};
|
|
5
|
+
${t}`,readOnly:!0});return e.jsx(Z,{kind:"ask",document:k,title:"Original request",eyebrow:"Brief",subtitle:s.title,meta:["request",n?"thread linked":"threadless"],mode:"preview",actions:n&&s.conversationId?[{label:"Thread",icon:e.jsx(M,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>p(i,{view:"conversation",conversationId:s.conversationId},{returnTo:u}),title:"Open source thread"}]:[],onClose:o})}function re(s){const t=[...s.timeline].sort((i,o)=>i.at-o.at),r=t.find(i=>i.kind==="collaboration_event"&&i.detailKind==="created"&&i.summary),n=t.find(i=>i.kind==="message"&&i.summary);return r?.summary??n?.summary??null}function Te(s){return{workId:s.id,generatedAt:Date.now(),mode:"trace-only",source:"broker",confidence:"low",agents:[],sessions:[],materials:[],totals:{materials:0,plans:0,specs:0,docs:0,code:0,tests:0,config:0,assets:0,agents:0,sessions:0},limitations:["Inventory is not available from this server yet."]}}function Re(s){switch(s){case"isolated-git-worktree":return"Isolated git worktree";case"shared-git-repo":return"Shared git repo";case"explicit-artifacts":return"Explicit artifacts";default:return"Trace-only"}}function Ae(s){const t=s.diffStat?`+${s.diffStat.additions} / -${s.diffStat.deletions}`:s.status;return`${s.path} · ${t} · ${s.confidence} confidence`}function F({materials:s,empty:t,selectedId:r,onOpen:n}){return s.length===0?e.jsx("div",{className:"s-work-material-empty",children:t}):e.jsx("div",{className:"s-work-material-list",children:s.map(i=>e.jsxs("button",{type:"button",className:`s-work-material-row${r===i.id?" s-work-material-row-active":""}`,title:i.path,onClick:()=>n?.(i.id),disabled:!n||i.status==="deleted",children:[e.jsx("div",{className:"s-work-material-path",children:i.path}),e.jsxs("div",{className:"s-work-material-row-meta",children:[e.jsx("span",{children:i.status}),i.diffStat&&e.jsxs("span",{children:["+",i.diffStat.additions," -",i.diffStat.deletions]}),e.jsx("span",{children:i.confidence})]})]},i.id))})}function qe({material:s,content:t,loading:r,error:n,onClose:i}){if(!s)return null;const o=t?J({id:t.materialId,title:t.title,uri:t.uri,mediaType:t.mediaType,value:t.content,readOnly:!0}):null;return e.jsx(Z,{kind:Oe(s),document:o,title:s.path,eyebrow:s.kind==="spec"?"Spec":s.kind,subtitle:t?.uri??s.worktreeRoot??void 0,meta:[s.status,s.confidence,...t?[X(t.sizeBytes)]:[]],mode:o?.kind==="markdown"?"preview":"read",state:r||!t&&!n?"Loading file...":null,error:r?null:n,notice:t?.truncated?`Preview truncated at ${X(t.content.length)}.`:null,onClose:i})}function Oe(s){return s.kind==="plan"||s.kind==="spec"?"plan":s.kind==="doc"?"doc":"code"}function X(s){return s<1024?`${s} B`:s<1024*1024?`${Math.round(s/1024)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function ie(s){const t=s.split(".");return t[t.length-1]||s}function c(s,t){const r=t?.trim();!r||r.length<3||s.add(r)}function L(s,t){c(s,t);const n=t?.trim().replace(/\/+$/,"")?.split("/").filter(Boolean).at(-1);n&&n.length>=3&&s.add(n)}function Ee(s){return s.replace(/^\/Users\/[^/]+/,"~")}function oe(s){const t=new Set,r=[],n=s.ownerName??s.ownerId??s.nextMoveOwnerName??s.nextMoveOwnerId;c(t,s.id),c(t,s.conversationId),c(t,s.ownerId),c(t,s.nextMoveOwnerId),c(t,s.ownerName),c(t,s.nextMoveOwnerName);for(const o of s.activeFlights)c(t,o.id),c(t,o.invocationId),c(t,o.agentId),c(t,o.agentName),c(t,o.conversationId),c(t,o.collaborationRecordId);for(const o of s.inventory?.agents??[])c(t,o.id),c(t,o.name),c(t,o.sessionId),L(t,o.cwd),L(t,o.projectRoot);const i=s.inventory?.sessions.find(o=>o.cwd)??s.inventory?.sessions[0]??null;for(const o of s.inventory?.sessions??[])c(t,o.id),c(t,o.conversationId),c(t,o.agentId),c(t,o.agentName),L(t,o.cwd);return n&&r.push(n),i?.cwd&&r.push(Ee(i.cwd)),{query:[...t].slice(0,20).join("|"),label:r.length>0?r.join(" · "):`Case ${ie(s.id)}`}}function ze(s){return s.kind==="message"?s.title||(s.detailKind==="agent"?"reply":"thread update"):s.kind==="flight_started"?"agent output":s.kind==="flight_completed"?s.detailKind==="completed"?"reply":s.detailKind??"flight":s.detailKind==="created"?"request created":s.title??s.kind.replace(/_/g," ")}function Be({detail:s}){const t=s.timeline.slice(0,18);return t.length===0?null:e.jsxs("section",{className:"s-work-casefile-section s-work-timeline-panel",children:[e.jsx("div",{className:"s-agent-section-heading",children:e.jsxs("div",{children:[e.jsx("h2",{className:"s-agent-section-title",children:"Timeline"}),e.jsx("p",{className:"s-work-section-note",children:"Run lifecycle, follow-up requirements, flight state, and replies attached to this work item."})]})}),e.jsx("div",{className:"s-work-timeline-list",children:t.map(r=>e.jsxs("article",{className:`s-work-timeline-row s-work-timeline-row-${r.kind}`,"data-kind":r.kind,"data-flight-id":r.flightId??void 0,"data-work-id":s.id,"data-conversation-id":r.conversationId??s.conversationId??void 0,children:[e.jsx("span",{className:"s-work-timeline-badge",children:ze(r)}),e.jsxs("div",{className:"s-work-timeline-body",children:[e.jsxs("div",{className:"s-work-timeline-meta",children:[e.jsx("span",{children:r.actorName??r.actorId??"system"}),e.jsx("span",{children:$(r.at)})]}),r.summary&&e.jsx("p",{children:C(r.summary)})]})]},r.id))})]})}function Fe({detail:s,navigate:t}){const{route:r}=W(),n=oe(s);return e.jsxs("section",{className:"s-work-casefile-section s-work-tail-section",children:[e.jsxs("div",{className:"s-agent-section-heading s-work-tail-heading",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"s-agent-section-title s-work-tail-title",children:[e.jsx(se,{"aria-hidden":"true",size:15,strokeWidth:1.8}),"Live tail"]}),e.jsxs("p",{className:"s-work-section-note",children:["Filtered to ",n.label]})]}),e.jsx(v,{icon:e.jsx(ee,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>p(t,{view:"ops",mode:"tail",tailQuery:n.query||void 0},{returnTo:r}),children:"Scout tail"})]}),e.jsx("div",{className:"s-work-tail-frame",children:e.jsx(xe,{navigate:t,initialFilter:n.query,filterLabel:n.label,filterScope:"context",chrome:"embedded"})})]})}function Ds({workId:s,navigate:t}){const{agents:r,route:n}=W(),[i]=h.useState(()=>D(B(s),U)),[o,u]=h.useState(i),[k,j]=h.useState(null),[x,g]=h.useState(i!==null),f=h.useCallback(async()=>{j(null);try{const a=await Y(B(s));u(a)}catch(a){j(a instanceof Error?a.message:String(a)),u(null)}finally{g(!0)}},[s]);h.useEffect(()=>{const a=D(B(s),U);a?(u(a),g(!0)):g(!1),f()},[f,s]),pe(()=>{f()});const I=ke(n),N=h.useMemo(()=>ue(r,I),[r,I]),m=h.useMemo(()=>o?me(o,N):null,[o,N]);if(!x)return e.jsxs("div",{children:[e.jsx(E,{slot:"work",fallback:{view:"inbox"},navigate:t}),e.jsx("div",{className:"s-empty",children:e.jsx("p",{children:"Loading…"})})]});if(!o||!m)return e.jsxs("div",{className:"s-work-not-found",children:[e.jsx(E,{slot:"work",fallback:{view:"inbox"},navigate:t}),e.jsxs("div",{className:"s-work-not-found-body",children:[e.jsx("div",{className:"s-work-not-found-glyph","aria-hidden":"true",children:"□"}),e.jsx("h2",{className:"s-work-not-found-title",children:o?"Work item outside this machine scope":"Work item not found"}),e.jsx("p",{className:"s-work-not-found-sub",children:o?"Clear the machine scope or switch machines to inspect this work item.":"This work item may have been removed or does not exist on this broker."}),k&&e.jsx("p",{className:"s-work-not-found-detail",children:k})]})]});const d=m,b=Ie(d.attention),y=d.ownerName??d.ownerId??"Unassigned",T=d.nextMoveOwnerName??d.nextMoveOwnerId??"—",w=be({detail:d,signal:b,ownerLabel:y,nextMoveLabel:T}),R=d.activeFlights.length>0||d.childWork.length>0;return e.jsxs("div",{className:"s-work-detail s-work-casefile",children:[e.jsxs("div",{className:"s-work-casefile-topbar",children:[e.jsx(E,{slot:"work",fallback:{view:"inbox"},navigate:t}),e.jsxs("span",{className:"s-work-casefile-record",children:["Case ",ie(d.id)]})]}),k&&e.jsx("p",{className:"s-error",children:k}),e.jsxs("section",{className:"s-work-casefile-hero",children:[e.jsxs("div",{className:"s-work-casefile-hero-main",children:[e.jsxs("div",{className:"s-work-casefile-title-row",children:[e.jsx("h1",{className:"s-work-casefile-title",children:d.title}),e.jsx(O,{tone:fe(d),variant:"pill",children:d.currentPhase})]}),d.lastMeaningfulSummary&&e.jsx("div",{className:"s-work-casefile-summary",children:C(d.lastMeaningfulSummary)}),e.jsxs("div",{className:"s-work-casefile-meta",children:[e.jsxs("span",{children:["Updated ",$(d.updatedAt)]}),e.jsx("span",{children:y}),e.jsx("span",{children:G(d.state)}),b&&e.jsx("span",{children:b}),d.priority&&e.jsxs("span",{children:["Priority ",d.priority]})]})]}),e.jsxs("aside",{className:`s-work-next-move s-work-next-move-${w.tone}`,children:[e.jsx("div",{className:"s-work-next-move-kicker",children:w.eyebrow}),e.jsx("div",{className:"s-work-next-move-title",children:w.title}),e.jsx("p",{className:"s-work-next-move-copy",children:w.body}),e.jsx("div",{className:"s-work-next-move-actions",children:d.conversationId&&e.jsx(v,{primary:!0,icon:e.jsx(M,{"aria-hidden":"true",size:14,strokeWidth:1.8}),onClick:()=>p(t,{view:"conversation",conversationId:d.conversationId},{returnTo:n}),children:"Open thread"})})]})]}),e.jsxs("div",{className:"s-work-casefile-layout s-work-casefile-layout-main",children:[e.jsxs("div",{className:"s-work-casefile-main s-work-casefile-main-materials",children:[e.jsx(Ce,{detail:d,navigate:t}),e.jsx(Me,{detail:d,navigate:t}),e.jsx(Be,{detail:d})]}),e.jsx(Fe,{detail:d,navigate:t}),R&&e.jsxs("div",{className:"s-work-casefile-main s-work-casefile-main-lower",children:[d.activeFlights.length>0&&e.jsxs("section",{className:"s-work-casefile-section",children:[e.jsx("div",{className:"s-agent-section-heading",children:e.jsx("h2",{className:"s-agent-section-title",children:"Flights"})}),e.jsx("div",{className:"s-work-flight-list",children:d.activeFlights.map(a=>e.jsxs("button",{type:"button",className:"s-work-flight-card",onClick:a.conversationId?()=>p(t,{view:"conversation",conversationId:a.conversationId},{returnTo:n}):void 0,disabled:!a.conversationId,children:[e.jsxs("div",{className:"s-work-flight-card-header",children:[e.jsx("span",{className:"s-work-flight-card-title",children:a.agentName??a.agentId}),e.jsx(O,{tone:"working",variant:"pill",children:a.state})]}),e.jsxs("div",{className:"s-work-flight-card-meta",children:[e.jsx("span",{children:a.startedAt?`Started ${$(a.startedAt)}`:"Start time unavailable"}),a.completedAt&&e.jsxs("span",{children:["Completed ",$(a.completedAt)]})]}),a.summary&&e.jsx("div",{className:"s-work-flight-card-copy",children:a.summary})]},a.id))})]}),d.childWork.length>0&&e.jsxs("section",{className:"s-work-casefile-section",children:[e.jsx("div",{className:"s-agent-section-heading",children:e.jsx("h2",{className:"s-agent-section-title",children:"Child work"})}),e.jsx("div",{className:"s-work-related-list",children:d.childWork.map(a=>e.jsxs("button",{type:"button",className:"s-work-related-card",onClick:()=>p(t,{view:"work",workId:a.id},{returnTo:n}),children:[e.jsxs("div",{className:"s-work-related-card-header",children:[e.jsx("span",{className:"s-work-related-card-title",children:a.title}),e.jsx(O,{tone:ve(a),variant:"pill",children:a.currentPhase})]}),e.jsxs("div",{className:"s-work-related-card-meta",children:[e.jsx("span",{children:a.ownerName??a.ownerId??"Unassigned"}),e.jsx("span",{children:G(a.state)}),e.jsx("span",{children:$(a.lastMeaningfulAt)})]}),a.lastMeaningfulSummary&&e.jsx("div",{className:"s-work-related-card-copy",children:C(a.lastMeaningfulSummary)})]},a.id))})]})]})]})]})}export{Ds as WorkDetailScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,j as e}from"./index-
|
|
1
|
+
import{r as c,j as e}from"./index-C1VaWNuD.js";import{D as F,F as T,a as E}from"./DocumentFocusViewer-D8iB6SMt.js";import{c as D,T as M}from"./TextDocumentSurface-2X1Gw4eA.js";import{a as R}from"./api-Co9aQ2Jw.js";import{C as L}from"./chevron-right-CowuvuE6.js";import{C as W}from"./chevron-down-D120PY4g.js";import{c as z}from"./createLucideIcon-Dv8H8m7J.js";import{F as B}from"./file-text-BHro8MkG.js";import"./x-DgmmnPKt.js";import"./perf-PX8Rx0EP.js";const A=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],O=z("image",A),P=new Set(["png","jpg","jpeg","gif","webp","avif","svg"]),g=[{value:"all",label:"All"},{value:"plan",label:"Plans"},{value:"doc",label:"Docs"},{value:"code",label:"Code"},{value:"test",label:"Tests"},{value:"config",label:"Config"},{value:"asset",label:"Assets"}];function U(s){const t=s.split("/").pop()??s,l=t.lastIndexOf(".");return l>=0?t.slice(l+1).toLowerCase():""}function v(s){return P.has(U(s.path))}function _(s){const t={type:"dir",children:[]};for(const l of s){const a=l.path.split("/").filter(Boolean);if(a.length===0)continue;let n=t;for(let f=0;f<a.length-1;f+=1){const i=a[f],p=a.slice(0,f+1).join("/");let o=n.children.find(d=>d.type==="dir"&&d.name===i);o||(o={type:"dir",name:i,path:p,children:[]},n.children.push(o)),n=o}n.children.push({type:"file",name:a[a.length-1],path:l.path,material:l})}return b(t),N(t.children)}function b(s){if(s.type==="dir"){s.children.sort((t,l)=>t.type!==l.type?t.type==="dir"?-1:1:t.name.localeCompare(l.name));for(const t of s.children)b(t)}}function N(s){return s.map(t=>{if(t.type!=="dir")return t;let l=t;for(;l.children.length===1&&l.children[0].type==="dir";){const a=l.children[0];l={type:"dir",name:`${l.name}/${a.name}`,path:a.path,children:a.children}}return{...l,children:N(l.children)}})}function G(s){switch(s){case"added":return"A";case"modified":return"M";case"deleted":return"D";case"renamed":return"R";case"untracked":return"?";case"observed":return null}}function y({node:s,depth:t,selectedId:l,collapsed:a,onToggle:n,onSelect:f}){if(s.type==="dir"){const u=a.has(s.path);return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"s-work-files-tree-row s-work-files-tree-dir",style:{paddingLeft:`${8+t*12}px`},onClick:()=>n(s.path),children:[e.jsx("span",{className:"s-work-files-tree-chevron","aria-hidden":"true",children:u?e.jsx(L,{size:12,strokeWidth:1.8}):e.jsx(W,{size:12,strokeWidth:1.8})}),e.jsx("span",{className:"s-work-files-tree-icon","aria-hidden":"true",children:u?e.jsx(T,{size:12,strokeWidth:1.8}):e.jsx(E,{size:12,strokeWidth:1.8})}),e.jsx("span",{className:"s-work-files-tree-name",children:s.name||"/"})]}),!u&&s.children.map(m=>e.jsx(y,{node:m,depth:t+1,selectedId:l,collapsed:a,onToggle:n,onSelect:f},m.type==="dir"?`d:${m.path}`:`f:${m.material.id}`))]})}const i=s.material.id===l,p=v(s.material),o=G(s.material.status),d=s.material.status==="deleted";return e.jsxs("button",{type:"button",className:`s-work-files-tree-row s-work-files-tree-file${i?" s-work-files-tree-file-selected":""}`,style:{paddingLeft:`${8+t*12}px`},onClick:()=>f(s.material),disabled:d,title:s.path,children:[e.jsx("span",{className:"s-work-files-tree-chevron","aria-hidden":"true"}),e.jsx("span",{className:"s-work-files-tree-icon","aria-hidden":"true",children:p?e.jsx(O,{size:12,strokeWidth:1.8}):e.jsx(B,{size:12,strokeWidth:1.8})}),e.jsx("span",{className:"s-work-files-tree-name",children:s.name}),o&&e.jsx("span",{className:`s-work-files-tree-status s-work-files-tree-status-${s.material.status}`,"aria-label":s.material.status,children:o})]})}function V({path:s}){const t=s.split("/").filter(Boolean);if(t.length===0)return e.jsx("span",{className:"s-work-files-breadcrumb",children:s});const l=t[t.length-1],a=t.slice(0,-1).join("/");return e.jsxs("span",{className:"s-work-files-breadcrumb",children:[a&&e.jsxs("span",{className:"s-work-files-breadcrumb-folder",children:[a,"/"]}),e.jsx("span",{className:"s-work-files-breadcrumb-name",children:l})]})}function K({workId:s,material:t}){const l=v(t),[a,n]=c.useState(null),[f,i]=c.useState(null),[p,o]=c.useState(!1);if(c.useEffect(()=>{if(l){n(null),i(null),o(!1);return}let u=!1;return o(!0),i(null),n(null),R(`/api/work/${encodeURIComponent(s)}/material?materialId=${encodeURIComponent(t.id)}`).then(m=>{u||n(m)}).catch(m=>{u||i(m instanceof Error?m.message:String(m))}).finally(()=>{u||o(!1)}),()=>{u=!0}},[l,t.id,s]),l){const u=`/api/work/${encodeURIComponent(s)}/material/raw?materialId=${encodeURIComponent(t.id)}`;return e.jsx("div",{className:"s-work-files-pane s-work-files-pane-image",children:e.jsx("img",{src:u,alt:t.path,className:"s-work-files-image"})})}if(p&&!a)return e.jsx("div",{className:"s-work-files-pane-state",children:"Loading file…"});if(f)return e.jsx("div",{className:"s-work-files-pane-state s-work-files-pane-error",children:f});if(!a)return e.jsx("div",{className:"s-work-files-pane-state",children:"No content."});const d=D({id:a.materialId,title:a.title,uri:a.uri,mediaType:a.mediaType,value:a.content,readOnly:!0});return e.jsxs("div",{className:"s-work-files-pane",children:[e.jsx(M,{document:d,mode:d.kind==="markdown"?"preview":"read"}),a.truncated&&e.jsxs("div",{className:"s-work-files-pane-notice",children:["Preview truncated at ",Math.round(a.content.length/1024)," KB."]})]})}function re({workId:s,workTitle:t,materials:l,open:a,initialKind:n="all",onClose:f}){const i=c.useMemo(()=>l.filter(r=>r.status!=="deleted"),[l]),[p,o]=c.useState(n),[d,u]=c.useState(null),[m,C]=c.useState(()=>new Set);c.useEffect(()=>{a&&o(n)},[n,a]);const x=c.useMemo(()=>p==="all"?i:p==="plan"?i.filter(r=>r.kind==="plan"||r.kind==="spec"):i.filter(r=>r.kind===p),[i,p]),j=c.useMemo(()=>_(x),[x]);c.useEffect(()=>{if(!d&&x.length>0){u(x[0].id);return}d&&!x.some(r=>r.id===d)&&u(x[0]?.id??null)},[x,d]);const S=c.useCallback(r=>{u(r.id)},[]),I=c.useCallback(r=>{C(k=>{const h=new Set(k);return h.has(r)?h.delete(r):h.add(r),h})},[]),w=x.find(r=>r.id===d)??null,$=c.useMemo(()=>{const r={all:i.length};for(const k of g)k.value!=="all"&&(r[k.value]=i.filter(h=>k.value==="plan"?h.kind==="plan"||h.kind==="spec":h.kind===k.value).length);return r},[i]);return e.jsx(F,{open:a,kind:"code",document:null,title:`Files · ${i.length}`,eyebrow:"Work materials",subtitle:t,focusable:!0,onClose:f,body:e.jsxs("div",{className:"s-work-files-layout",children:[e.jsxs("aside",{className:"s-work-files-tree","aria-label":"File tree",children:[e.jsx("div",{className:"s-work-files-tree-filters",role:"tablist",children:g.map(r=>{const k=$[r.value]??0;if(r.value!=="all"&&k===0)return null;const h=r.value===p;return e.jsxs("button",{type:"button",role:"tab","aria-selected":h,className:`s-work-files-tree-filter${h?" s-work-files-tree-filter-active":""}`,onClick:()=>o(r.value),children:[e.jsx("span",{children:r.label}),e.jsx("span",{className:"s-work-files-tree-filter-count",children:k})]},r.value)})}),e.jsx("div",{className:"s-work-files-tree-list",children:j.length===0?e.jsx("div",{className:"s-work-files-tree-empty",children:"No files match this filter."}):j.map(r=>e.jsx(y,{node:r,depth:0,selectedId:d,collapsed:m,onToggle:I,onSelect:S},r.type==="dir"?`d:${r.path}`:`f:${r.material.id}`))})]}),e.jsx("section",{className:"s-work-files-content","aria-label":"File preview",children:w?e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"s-work-files-content-head",children:[e.jsx(V,{path:w.path}),e.jsxs("div",{className:"s-work-files-content-meta",children:[e.jsx("span",{children:w.kind}),e.jsx("span",{children:w.status}),w.diffStat&&e.jsxs("span",{children:["+",w.diffStat.additions," -",w.diffStat.deletions]})]})]}),e.jsx(K,{workId:s,material:w})]}):e.jsx("div",{className:"s-work-files-pane-state",children:"Select a file to preview."})})]})})}export{re as WorkFilesViewer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t}from"./createLucideIcon-
|
|
1
|
+
import{c as t}from"./createLucideIcon-Dv8H8m7J.js";const c=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],o=t("activity",c);export{o as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as f}from"./index-
|
|
1
|
+
import{z as f}from"./index-C1VaWNuD.js";function g(o,s){for(var r=0;r<s.length;r++){const t=s[r];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in o)){const i=Object.getOwnPropertyDescriptor(t,e);i&&Object.defineProperty(o,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var a={exports:{}},d;function _(){return d||(d=1,(function(o,s){(function(r,t){o.exports=t()})(globalThis,(()=>(()=>{var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const i=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;const i=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),m=Math.max(0,parseInt(l.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),u=c-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),h=m-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-i;return{cols:Math.max(2,Math.floor(h/e.css.cell.width)),rows:Math.max(1,Math.floor(u/e.css.cell.height))}}}})(),r})()))})(a)),a.exports}var p=_();const y=f(p),v=g({__proto__:null,default:y},[p]);export{v as a};
|