@openscout/scout 0.2.95 → 0.2.96
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/bin/scout +26 -10
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/{ActivityScreen--eANwuxa.js → ActivityScreen-BnoaUkVZ.js} +1 -1
- package/dist/client/assets/{AddProjectForm-CcD6qvV8.js → AddProjectForm-IqOtJfRs.js} +1 -1
- package/dist/client/assets/{AgentAvatar-CYhf6twS.js → AgentAvatar-6-KBVKUu.js} +1 -1
- package/dist/client/assets/{AgentConfigurationScreen-BTI24HQX.js → AgentConfigurationScreen-CuZJy07q.js} +1 -1
- package/dist/client/assets/{AgentDefinitionsWorkspace-srmN6-vj.js → AgentDefinitionsWorkspace-Iyl4BesU.js} +1 -1
- package/dist/client/assets/{AgentDetailCard-UqPNpcvB.js → AgentDetailCard-C9rn3Fj5.js} +1 -1
- package/dist/client/assets/{AgentFloorView-XXNgI5Cj.js → AgentFloorView-YT-Jjccf.js} +1 -1
- package/dist/client/assets/{AgentInfoScreen-CimdOnZ9.js → AgentInfoScreen-Dr99gQEZ.js} +1 -1
- package/dist/client/assets/{AgentLaneCard-Z-aOBR3W.js → AgentLaneCard-DI2iW9zO.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-CyhA1reW.js → AgentLaneChrome-D8bARHMx.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-BNzjMjIH.js → AgentLaneDetailSheet-52un7dKC.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-Box8-_rS.js → AgentLaneSummaryResize-CEBjmPTa.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-Dgcm7zd_.js +1 -0
- package/dist/client/assets/AgentLanesPreflight-q20mTjms.js +1 -0
- package/dist/client/assets/AgentLanesView-CetZZDyF.js +2 -0
- package/dist/client/assets/{AgentLiveActions-BwuzOE8h.js → AgentLiveActions-DrEJDJef.js} +1 -1
- package/dist/client/assets/AgentMasterScreen-DJPnstoD.js +1 -0
- package/dist/client/assets/{AgentSessions-CsZwoukw.js → AgentSessions-DCPCG4xb.js} +1 -1
- package/dist/client/assets/{AgentsConsole-KCao4XmX.js → AgentsConsole-CsYOoFJi.js} +1 -1
- package/dist/client/assets/{AgentsScreen-CtPAmwRX.js → AgentsScreen-k8LvBuU_.js} +1 -1
- package/dist/client/assets/AgentsSubnav-C4xpQhsv.js +1 -0
- package/dist/client/assets/{AstronautSuit-Ckx7lu7G.js → AstronautSuit-DbjQtfD_.js} +1 -1
- package/dist/client/assets/{AtopView-DYlpgEHf.js → AtopView-Daq_ob3z.js} +1 -1
- package/dist/client/assets/{BackToPicker-4JaeRvDm.js → BackToPicker-CXZjBRAe.js} +1 -1
- package/dist/client/assets/{BriefingDetailScreen-D6-xqrpo.js → BriefingDetailScreen-CUCXO-KH.js} +1 -1
- package/dist/client/assets/{BriefingsScreen-DKxSDEmk.js → BriefingsScreen-B5oMTGKv.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-BbREmsbK.js → BrokerMetadataPanel-BsiU8lTD.js} +1 -1
- package/dist/client/assets/{BrokerScreen-fbPIouMw.js → BrokerScreen-BPbOHhCS.js} +1 -1
- package/dist/client/assets/{CastPicker-BcA2vDDV.js → CastPicker-_5E5hNUe.js} +1 -1
- package/dist/client/assets/ChatCollapsedStrip-D-eXhzPf.js +1 -0
- package/dist/client/assets/{CodeDiffPane-Cn8Y9hAt.js → CodeDiffPane-n7W4iGUG.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-nPFktrco.js → CodeProjectPicker-CMsbSTDq.js} +1 -1
- package/dist/client/assets/{CodeScreen-BlAxtxE5.js → CodeScreen-CeuO3EhR.js} +1 -1
- package/dist/client/assets/{ConversationComposer-2HjbGPL9.js → ConversationComposer-CXPKx86g.js} +1 -1
- package/dist/client/assets/{ConversationFeedRows-C6wUqJrx.js → ConversationFeedRows-WrH-YI3L.js} +1 -1
- package/dist/client/assets/{ConversationHeader-C8vfXaTF.js → ConversationHeader-BQWzGzLK.js} +1 -1
- package/dist/client/assets/{ConversationPanels-CNCIbpqU.js → ConversationPanels-Dujvnmup.js} +2 -2
- package/dist/client/assets/ConversationScreen-CR9pWB65.js +2 -0
- package/dist/client/assets/{ConversationStatus-DZuyKsWN.js → ConversationStatus-DVzSb2Hv.js} +1 -1
- package/dist/client/assets/{CrewAvatar-CTIuxp4G.js → CrewAvatar-BwXjyg8N.js} +1 -1
- package/dist/client/assets/CrewWorkspaces-CkQDhyie.css +1 -0
- package/dist/client/assets/CrewWorkspaces-NKujRzwh.js +1 -0
- package/dist/client/assets/{DataTable-6IDhanr5.js → DataTable-Bp8tU9AK.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-DC1u9itO.js → DispatchAftermath-B-6rmXzL.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-DZVhS7as.js → DocumentFocusViewer-Do3wQ_3Z.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-BKUFJMCV.js → EmbeddableSurfacesLab-C1orRyP9.js} +1 -1
- package/dist/client/assets/{EmptyState-CeBl0iGd.js → EmptyState-CJzXj1l5.js} +1 -1
- package/dist/client/assets/{FileViewerPane-DQlpNt2S.js → FileViewerPane-Df6VzXjA.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-6mGnmWQA.js +1 -0
- package/dist/client/assets/{FollowScreen-BXHOp3gb.js → FollowScreen-DvnxYLVh.js} +1 -1
- package/dist/client/assets/{HarnessMark-D5CA5uSp.js → HarnessMark-B979GCSB.js} +1 -1
- package/dist/client/assets/{HarnessesScreen-DhFXq1qz.js → HarnessesScreen-CHTuv8p6.js} +1 -1
- package/dist/client/assets/{HerdrSession-BRhs5LIR.js → HerdrSession-B3McuYgi.js} +1 -1
- package/dist/client/assets/{HomeHero-DMABJuze.js → HomeHero-CdUVPjkG.js} +1 -1
- package/dist/client/assets/{HostAdvisorView-RAociATV.js → HostAdvisorView-Bok5Sk5c.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-CZPyVNSw.js → KnowledgeSearchInspector-B7XSoJsu.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchScreen-mGTKIg00.js → KnowledgeSearchScreen-D3o3IODW.js} +1 -1
- package/dist/client/assets/{LaneToolHoverCard-D_DMlBeT.js → LaneToolHoverCard-HByf2ndx.js} +1 -1
- package/dist/client/assets/{LaneTraceDetailSheet-BEHg3LmH.js → LaneTraceDetailSheet-BUgHz-sd.js} +1 -1
- package/dist/client/assets/{LaneTraceEventFocus-DVimcizS.js → LaneTraceEventFocus-DM-hoPxG.js} +1 -1
- package/dist/client/assets/{MeshCanvas-BOuZx4AM.js → MeshCanvas-DCLJRsBy.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-wL-1N94e.js → MeshCanvasMinimap-cEFS9eW7.js} +1 -1
- package/dist/client/assets/{MeshScreen-DMY9Bmh5.js → MeshScreen-BcxPkhm6.js} +1 -1
- package/dist/client/assets/{MeshTopologyView-DiDcX5f4.js → MeshTopologyView-CCRPd8PU.js} +2 -2
- package/dist/client/assets/MessagesScreen-Bb5l13MO.js +1 -0
- package/dist/client/assets/{MissionContextRail-DrNKXG5u.js → MissionContextRail-DF0_kiU7.js} +1 -1
- package/dist/client/assets/{MissionControlView-ByBlHVN8.js → MissionControlView-E3V7bENU.js} +1 -1
- package/dist/client/assets/{MissionFocusOverlay-D1i6R6Zt.js → MissionFocusOverlay-h15sQFvP.js} +1 -1
- package/dist/client/assets/{MissionLeftAgentRow-DN9NcCML.js → MissionLeftAgentRow-KPdk9rSa.js} +1 -1
- package/dist/client/assets/{MissionLogPane-DSeIv3Xo.js → MissionLogPane-BbdDKjUl.js} +1 -1
- package/dist/client/assets/{NewAgentModal-V7yK6J6j.js → NewAgentModal-DfHxad34.js} +1 -1
- package/dist/client/assets/NewChatComposer-_Stj0fZy.js +19 -0
- package/dist/client/assets/{NewChatOrigin-DdpzE4kz.js → NewChatOrigin-B1u7ki70.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-l_Q3ts2q.js → ObserveEmbedScreen-Co0xTii6.js} +1 -1
- package/dist/client/assets/{ObserveTextFlow-BSEtYTxU.js → ObserveTextFlow-ZQWwrK3i.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-CdGUXxGR.js → ObservedTopologyPanel-BJUhDSuQ.js} +1 -1
- package/dist/client/assets/{OpenScoutAppShell-DN8dOSK4.js → OpenScoutAppShell-CUd2yOLu.js} +25 -25
- package/dist/client/assets/{OpsAgentsView-ntGr4pz4.js → OpsAgentsView-DI5wu1si.js} +1 -1
- package/dist/client/assets/OpsScreen-D8fQafCl.js +1 -0
- package/dist/client/assets/OpsSubnav-1K4Jaf__.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-Bdjd_dAx.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-BQET-qrY.js → ProjectAgentProfileBar-k2QHHHsQ.js} +1 -1
- package/dist/client/assets/{ProjectAgentProfileHero-Ck8mThtx.js → ProjectAgentProfileHero-Bpxk1ui2.js} +1 -1
- package/dist/client/assets/ProjectsInbox-C_bMHLCc.js +2 -0
- package/dist/client/assets/ProjectsRail-J-aH_pxT.js +1 -0
- package/dist/client/assets/ProjectsScreen-cVUkGbPz.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-_ourdM-Q.js +1 -0
- package/dist/client/assets/{Provider-B2xuo3rf.js → Provider-CtXJeLrP.js} +1 -1
- package/dist/client/assets/{RailRow-B-GycCBx.js → RailRow-CEH2MFBw.js} +1 -1
- package/dist/client/assets/{RawSessionsTable-AQThi6sm.js → RawSessionsTable-CDyrom-F.js} +1 -1
- package/dist/client/assets/RealtimeVoiceScreen-DBl3DN1H.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-DXWoRF_c.js → RepoDiffEmbedScreen-kY2pHjIs.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-D_274ExO.js → RepoDiffPageScreen-C6LhoKrn.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-DbedmHDX.js → RepoDiffViewer-BhcIIQQg.js} +1 -1
- package/dist/client/assets/{RepoDiffViewerLazy-C0--fPtk.js → RepoDiffViewerLazy-Csy_j9LD.js} +2 -2
- package/dist/client/assets/{ReposScreen-D39_YG4H.js → ReposScreen-B_cB0zu7.js} +1 -1
- package/dist/client/assets/ScoutDeckSurface-CSy_fjcG.js +1 -0
- package/dist/client/assets/{ScoutSurface-UsRy0t-I.js → ScoutSurface-CQVcSrin.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-Fmdfboxs.js → ScoutbotFxLab-DqGiLYNy.js} +1 -1
- package/dist/client/assets/{SecondaryNav-o2RL9H8H.js → SecondaryNav-BR4VRdgh.js} +1 -1
- package/dist/client/assets/SessionEmbedScreen-BTlZ9gAg.js +1 -0
- package/dist/client/assets/{SessionObserve-Dsd0j05N.js → SessionObserve-dQDN23pP.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-DopQYDkD.js → SessionObserveEvidence-BRBGKAgd.js} +1 -1
- package/dist/client/assets/SessionRefScreen-COVQMbtE.js +1 -0
- package/dist/client/assets/SessionsScreen--5OJ3p3v.js +1 -0
- package/dist/client/assets/{SettingsDrawer-_AwuopMS.js → SettingsDrawer-RGVK_bmE.js} +1 -1
- package/dist/client/assets/{SettingsScreen-Cw4DDfJP.js → SettingsScreen-CCxzy5IU.js} +1 -1
- package/dist/client/assets/{ShikiPane-BfHc_3pM.js → ShikiPane-DYI9Hkge.js} +1 -1
- package/dist/client/assets/{SlidePanel-C-q7XwTa.js → SlidePanel-B9ugxWgA.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-Bs68ZENy.js → SpriteAvatar-z5hHesx9.js} +1 -1
- package/dist/client/assets/{StatusPill-ZZQwxB1a.js → StatusPill-BFvMjmZV.js} +1 -1
- package/dist/client/assets/{TailView-Q4FVMsUH.js → TailView-0uEIj2JH.js} +1 -1
- package/dist/client/assets/{Terminal-D7zqHwHV.js → Terminal-DouZeNxc.js} +1 -1
- package/dist/client/assets/{TerminalEmbedScreen-CXIJ7qv6.js → TerminalEmbedScreen-dMNUbzXr.js} +1 -1
- package/dist/client/assets/{TerminalHeaderMount-BnBLOPbb.js → TerminalHeaderMount-BL07cd0q.js} +1 -1
- package/dist/client/assets/{TextDocumentSurface-CKQP-cBT.js → TextDocumentSurface-BflAwXeZ.js} +1 -1
- package/dist/client/assets/{TmuxPeek-V9dGESfO.js → TmuxPeek-BTnjOQi0.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-k7sbLXx2.js → VoicePermissionsPanel-CgQ6GGS-.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-60p9litn.js → WorkDetailScreen-CaLG-zDs.js} +1 -1
- package/dist/client/assets/{WorkFilesViewer-BjJS7GyM.js → WorkFilesViewer-B9Sil_No.js} +1 -1
- package/dist/client/assets/{activity-Bj3Hnbj3.js → activity-DcrMApUY.js} +1 -1
- package/dist/client/assets/{addon-fit-BL-NTWRU.js → addon-fit-DMVrz5Sv.js} +1 -1
- package/dist/client/assets/{addon-webgl-CIMgmNjg.js → addon-webgl-BYvpZUyu.js} +1 -1
- package/dist/client/assets/{agent-autocomplete-DXlvdc4b.js → agent-autocomplete-B-5QTeas.js} +1 -1
- package/dist/client/assets/{agent-essentials-BOMHR0_U.js → agent-essentials-D7KRGYvF.js} +1 -1
- package/dist/client/assets/{agent-lane-card-model-CTLxf3R4.js → agent-lane-card-model-CNZMPkhc.js} +1 -1
- package/dist/client/assets/{agent-lanes-model-AfrjRNK5.js → agent-lanes-model-DXqjs0OK.js} +2 -2
- package/dist/client/assets/agent-master-I1W-5d-x.css +1 -0
- package/dist/client/assets/agent-master-model-DqjrVI2h.js +1 -0
- package/dist/client/assets/{agent-specialization-BIPIBW8u.js → agent-specialization-BujJVUTD.js} +1 -1
- package/dist/client/assets/{arc.es-IR5r6sj_.js → arc.es-NHqHWohb.js} +1 -1
- package/dist/client/assets/{arrow-down-BydciYFZ.js → arrow-down-CKtSUjmW.js} +1 -1
- package/dist/client/assets/{arrow-left-CghA0kTw.js → arrow-left-Czpf-AE4.js} +1 -1
- package/dist/client/assets/{arrow-right-iJFv3jNh.js → arrow-right-BuzMnLYP.js} +1 -1
- package/dist/client/assets/{arrow-up-right-CCfZXPqD.js → arrow-up-right-C6Wl-1uw.js} +1 -1
- package/dist/client/assets/{bot-B5sub1-i.js → bot-rd0awxD3.js} +1 -1
- package/dist/client/assets/{check-C18YQC90.js → check-ofKUE8yH.js} +1 -1
- package/dist/client/assets/{chevron-down-Mp9mu_yd.js → chevron-down-wciXnOQz.js} +1 -1
- package/dist/client/assets/{chevron-right-CzH-TaSF.js → chevron-right-D-HdlPg8.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-swV8PA2k.js → chunk-HRAB3GC3-Tyv9rzx7.js} +1 -1
- package/dist/client/assets/{chunk-JTPDIGGW-BKXqcLKw.js → chunk-JTPDIGGW-BC2Mandc.js} +3 -3
- package/dist/client/assets/{chunk-T65CQEWV-vYbNJ8E6.js → chunk-T65CQEWV-C1AWTYZZ.js} +1 -1
- package/dist/client/assets/{chunk-YOZR3KYS-U65yUmqt.js → chunk-YOZR3KYS-DwHPHa6f.js} +1 -1
- package/dist/client/assets/{clock-B4PTFi5m.js → clock-B88r8OrZ.js} +1 -1
- package/dist/client/assets/{code-xml-Jtxsp5d1.js → code-xml-D7pOQM9l.js} +1 -1
- package/dist/client/assets/{compass-0_54-vz3.js → compass-Dt1AMXz2.js} +1 -1
- package/dist/client/assets/content-9K38QchR.js +1 -0
- package/dist/client/assets/content-BRgnyXWh.js +1 -0
- package/dist/client/assets/{content-CHghn-rT.js → content-BWPNyXJ0.js} +1 -1
- package/dist/client/assets/content-BdkI07v3.js +1 -0
- package/dist/client/assets/content-C4oWa8SB.js +1 -0
- package/dist/client/assets/content-C9ijJxyl.js +1 -0
- package/dist/client/assets/content-CFZ4rghn.js +1 -0
- package/dist/client/assets/content-CIqu_Ci_.js +1 -0
- package/dist/client/assets/content-CnJF9DGO.js +1 -0
- package/dist/client/assets/content-CriW8Y8u.js +1 -0
- package/dist/client/assets/content-DDCyPPk_.js +1 -0
- package/dist/client/assets/content-DtcZeh5m.js +1 -0
- package/dist/client/assets/content-U9tsdtle.js +1 -0
- package/dist/client/assets/content-hFLK3CON.js +1 -0
- package/dist/client/assets/{content-DMbawvqU.js → content-nkx0swDe.js} +1 -1
- package/dist/client/assets/content-p00KQrtD.js +1 -0
- package/dist/client/assets/{conversation-icons-BV10B2Me.js → conversation-icons-tp9BX6X2.js} +1 -1
- package/dist/client/assets/{conversation-model-CwF6Y9gx.js → conversation-model-Dc02NsGp.js} +1 -1
- package/dist/client/assets/conversation-motion-features-D9-RmBSq.js +1 -0
- package/dist/client/assets/{copy-Dtpx4FOE.js → copy-CWWAJ75H.js} +1 -1
- package/dist/client/assets/{cpu-BjVis9mc.js → cpu-DrqejfkB.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DXpqZP7I.js → createLucideIcon-DezKXSG2.js} +1 -1
- package/dist/client/assets/{ctx-panel-D_HJ3nhb.css → ctx-panel-F05jXK4Q.css} +1 -1
- package/dist/client/assets/discover-C2CZO4Tk.js +2 -0
- package/dist/client/assets/embed-entry-BSMUykuG.js +2 -0
- package/dist/client/assets/{external-link-Ckiyzjwo.js → external-link-Dp_a2vRZ.js} +1 -1
- package/dist/client/assets/{eye-CpfyvdLq.js → eye-BRyD0jno.js} +1 -1
- package/dist/client/assets/{file-code-corner-7mo7EviR.js → file-code-corner-muIVH_xO.js} +1 -1
- package/dist/client/assets/{file-text-KijGBnME.js → file-text-CqJgwxmv.js} +1 -1
- package/dist/client/assets/{gauge-y-Xg8Mrv.js → gauge-hU--hKVP.js} +1 -1
- package/dist/client/assets/{gestures-Bq9XnSqY.js → gestures-DN4hEeqv.js} +1 -1
- package/dist/client/assets/{git-branch-BQ_x8KZL.js → git-branch-CK5v8F2v.js} +1 -1
- package/dist/client/assets/{home-moving-signal-DtRpiNa0.js → home-moving-signal-BjDtEJUP.js} +1 -1
- package/dist/client/assets/{home-now-card-DFb4GOgM.js → home-now-card-nF8OotI-.js} +1 -1
- package/dist/client/assets/{home-now-card-nano-D--m9jpq.js → home-now-card-nano-C-r_bBg5.js} +1 -1
- package/dist/client/assets/{hooks-9d1SoaQA.js → hooks-D46bABUP.js} +1 -1
- package/dist/client/assets/index-CPrU5q04.js +1 -0
- package/dist/client/assets/{index-CZ-05hKz.js → index-DvLtl7rV.js} +5 -5
- package/dist/client/assets/index-kL1WLbeS.js +1 -0
- package/dist/client/assets/index-zvhpRHao.js +1 -0
- package/dist/client/assets/{inspector-panel-C-EhEDYy.js → inspector-panel-Dkc7rLvY.js} +1 -1
- package/dist/client/assets/{keyboard-nav-DFhAJkW3.js → keyboard-nav-BLYDhL3Z.js} +1 -1
- package/dist/client/assets/{lane-roster-store-gUBsydNf.js → lane-roster-store-DOdI1O13.js} +1 -1
- package/dist/client/assets/{layers-CGou-LwV.js → layers-CSsg3JVP.js} +1 -1
- package/dist/client/assets/{layout-grid-BrZt31QH.js → layout-grid-DOChPJdZ.js} +1 -1
- package/dist/client/assets/left-B-SdEJSJ.js +1 -0
- package/dist/client/assets/{left-B_o51JV6.js → left-B3wSE6ql.js} +1 -1
- package/dist/client/assets/{left-CwHZCGO3.js → left-BNRFiRsb.js} +1 -1
- package/dist/client/assets/{left-DA0amyfu.js → left-BggzhgXN.js} +1 -1
- package/dist/client/assets/left-CARCvvxS.js +2 -0
- package/dist/client/assets/left-CpokZYHt.js +1 -0
- package/dist/client/assets/{left-CwLs0okF.js → left-YT7mIGuH.js} +1 -1
- package/dist/client/assets/{left-advisor-DU3s01gk.js → left-advisor-CCY0vkcO.js} +1 -1
- package/dist/client/assets/left-agents-trhO5sL8.js +1 -0
- package/dist/client/assets/{left-default-uvuvDmt0.js → left-default-CG33elBs.js} +1 -1
- package/dist/client/assets/{left-lanes-DnNLgec8.js → left-lanes-CitMgeTp.js} +1 -1
- package/dist/client/assets/{left-mission-DN3-NLPC.js → left-mission-Zl2m_5eU.js} +1 -1
- package/dist/client/assets/{library-DIo5NiGP.js → library-DkALuCh5.js} +1 -1
- package/dist/client/assets/{loader-circle-BiohlpM3.js → loader-circle-pM56HNhR.js} +1 -1
- package/dist/client/assets/{local-agents-wUIaBcEr.js → local-agents-C8xAhbO5.js} +1 -1
- package/dist/client/assets/{mentions-CcPFMbmZ.js → mentions-DG6OQrsc.js} +1 -1
- package/dist/client/assets/{mesh-buckets-ByyFXdKT.js → mesh-buckets-6y3ZIibI.js} +1 -1
- package/dist/client/assets/{mesh-ops-CvGyjK84.js → mesh-ops-BZ1h5RQs.js} +1 -1
- package/dist/client/assets/{mesh-roster-n2nDpEmA.js → mesh-roster-Bc7T4b7z.js} +1 -1
- package/dist/client/assets/{mesh-view-store-BpxGm71b.js → mesh-view-store-ChUOASK8.js} +1 -1
- package/dist/client/assets/{message-circle-B2ddzBrX.js → message-circle-mZCv8tvB.js} +1 -1
- package/dist/client/assets/{message-markup-RkfmDfME.js → message-markup-C2LQDm_k.js} +1 -1
- package/dist/client/assets/{message-square-D9YYWE0x.js → message-square-C7t_qtuj.js} +1 -1
- package/dist/client/assets/{message-visibility-DwxgcgYK.js → message-visibility-CGOmSSKs.js} +1 -1
- package/dist/client/assets/{mission-control-store-Bf4b54MV.js → mission-control-store-nDLdUZPA.js} +1 -1
- package/dist/client/assets/{observe-CJRIvOCn.js → observe-BpEm1INu.js} +1 -1
- package/dist/client/assets/{page-status-BptpTdQ-.js → page-status-E5jnk48p.js} +1 -1
- package/dist/client/assets/{paperclip-B1UNGl5d.js → paperclip-C64lkcbM.js} +1 -1
- package/dist/client/assets/{persistent-state-YI-WHSCF.js → persistent-state-EHXw8WNy.js} +1 -1
- package/dist/client/assets/{plus-CuU_X0-8.js → plus-Co-dqKul.js} +1 -1
- package/dist/client/assets/{profile-rY8jO38P.js → profile-APxDsN2P.js} +1 -1
- package/dist/client/assets/projects-inbox-Cg4X2lUQ.js +1 -0
- package/dist/client/assets/projects-inbox-DRBl2N85.css +1 -0
- package/dist/client/assets/{proxy-DnLpZIi9.js → proxy-BiW5suC7.js} +1 -1
- package/dist/client/assets/{radio-Dm1ItnA4.js → radio-BOxBQX-T.js} +1 -1
- package/dist/client/assets/{refresh-cw-BRn9Oxxl.js → refresh-cw-DMxGzDwn.js} +1 -1
- package/dist/client/assets/resolve-panes-DeVJbS9c.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-BQe5J6xF.js +1 -0
- package/dist/client/assets/{right-BJltPRnd.js → right-Bmfd3pjP.js} +1 -1
- package/dist/client/assets/{right-Beh3nCUB.js → right-BqI-nr9G.js} +1 -1
- package/dist/client/assets/{right-D3aTKf1F.js → right-BuCgE0fZ.js} +1 -1
- package/dist/client/assets/{right-Shpw_xDy.js → right-BwlW6E57.js} +1 -1
- package/dist/client/assets/{right-CPP7GyOm.js → right-C0ybUw0j.js} +1 -1
- package/dist/client/assets/{right-BbyYdzHn.js → right-CdkcrmeD.js} +1 -1
- package/dist/client/assets/{right-CJnB_Bg7.js → right-CimaAvQN.js} +1 -1
- package/dist/client/assets/{right-C1yumXNx.js → right-CkCCPbCX.js} +1 -1
- package/dist/client/assets/{right-DI1B79nR.js → right-D3eSiy41.js} +1 -1
- package/dist/client/assets/{right-DtsRNX5b.js → right-Dz_xD0Vj.js} +1 -1
- package/dist/client/assets/{rocket-DOwXHKWA.js → rocket-BQm5_CvR.js} +1 -1
- package/dist/client/assets/router-B9vQkNJL.js +1 -0
- package/dist/client/assets/{scope-views-A4_vP97W.js → scope-views-1IYJdl41.js} +1 -1
- package/dist/client/assets/{scout-voice-BhPzrc6P.js → scout-voice-BVUqGhth.js} +1 -1
- package/dist/client/assets/{scoutbot-markdown-jh7tzFB1.js → scoutbot-markdown-BQ_Ee2Ic.js} +1 -1
- package/dist/client/assets/{scroll-text-DO0GQzvN.js → scroll-text-Dze_dXtQ.js} +1 -1
- package/dist/client/assets/{search-D1tJSAWe.js → search-CDko0PKE.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-B9IF8wXl.js → secondaryNavConfig-BoQ_zYR9.js} +1 -1
- package/dist/client/assets/{selection-bridge-i2S9zpf8.js → selection-bridge-Din6yV3h.js} +1 -1
- package/dist/client/assets/{send-horizontal-CgLppsIC.js → send-horizontal-CSjIm6xg.js} +1 -1
- package/dist/client/assets/{server-Dymv5Emh.js → server-Bzj7lPIx.js} +1 -1
- package/dist/client/assets/{session-catalog-DNaOEzoQ.js → session-catalog-DsaZJXZt.js} +1 -1
- package/dist/client/assets/session-ref-lookup-state-SATH_jAP.js +1 -0
- package/dist/client/assets/{session-table-PTQVoTyc.js → session-table-BQfR7u6r.js} +1 -1
- package/dist/client/assets/{settings-2fC_G9nX.js → settings-Dyvpkb1D.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-BPSMHhbm.js → sliders-horizontal-C8njVwfg.js} +1 -1
- package/dist/client/assets/{sparkles-Dy8p5xN8.js → sparkles-CETYrxGA.js} +1 -1
- package/dist/client/assets/{sse-CiOSzE5n.js → sse-CD9MMUxl.js} +1 -1
- package/dist/client/assets/{tail-events-BMQmSx1n.js → tail-events-Ps8KpKah.js} +1 -1
- package/dist/client/assets/{terminal-yN9xN-h9.js → terminal-9GRS_Qdc.js} +1 -1
- package/dist/client/assets/{terminal-relay-9lhzEp2V.js → terminal-relay-GYMIvKs1.js} +1 -1
- package/dist/client/assets/{terminal-takeover-DANQfTcy.js → terminal-takeover-_Jyys4me.js} +1 -1
- package/dist/client/assets/{text-CnZ0e1-V.js → text-BP3oyl8-.js} +1 -1
- package/dist/client/assets/{text-rLpBg4_z.css → text-BYAFNLNq.css} +1 -1
- package/dist/client/assets/{use-conversation-list-D9BNLfnW.js → use-conversation-list-C9ABzjXI.js} +1 -1
- package/dist/client/assets/use-fleet-active-asks-DAspZQjE.js +1 -0
- package/dist/client/assets/{use-mesh-ops-items-BIvIHlqe.js → use-mesh-ops-items-Dh54ymEp.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-CKkhq9c5.js → use-reduced-motion-x8pJMVrG.js} +1 -1
- package/dist/client/assets/{use-scout-dev-flags-B2KCzPxn.js → use-scout-dev-flags-DhCbiDK3.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-CHBsxcbp.js → useAgentHoverCard-DoBwV0LX.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-pZe2Zfk1.js +1 -0
- package/dist/client/assets/{usePierreRuntime-DUuXH5yp.js → usePierreRuntime-ejq9dCWV.js} +1 -1
- package/dist/client/assets/{wrench-YcXMlsh2.js → wrench-DjkoAOQt.js} +1 -1
- package/dist/client/assets/{x-e3h2hDsp.js → x-CAbNespN.js} +1 -1
- package/dist/client/assets/{xterm-Byp1Hep_.js → xterm-Cf-ngcGP.js} +1 -1
- package/dist/client/assets/{zap-nMcjPoWB.js → zap-Cq8eWkcF.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/drizzle/0009_old_korg.sql +72 -0
- package/dist/drizzle/0010_sparkling_colonel_america.sql +2 -0
- package/dist/drizzle/0011_funny_onslaught.sql +4 -0
- package/dist/drizzle/0012_high_blazing_skull.sql +16 -0
- package/dist/drizzle/0013_perfect_juggernaut.sql +1 -0
- package/dist/drizzle/0014_legal_meggan.sql +6 -0
- package/dist/drizzle/0015_lame_marvel_boy.sql +12 -0
- package/dist/drizzle/0016_early_goliath.sql +6 -0
- package/dist/drizzle/meta/0009_snapshot.json +6262 -0
- package/dist/drizzle/meta/0010_snapshot.json +6286 -0
- package/dist/drizzle/meta/0011_snapshot.json +6337 -0
- package/dist/drizzle/meta/0012_snapshot.json +6458 -0
- package/dist/drizzle/meta/0013_snapshot.json +6465 -0
- package/dist/drizzle/meta/0014_snapshot.json +6503 -0
- package/dist/drizzle/meta/0015_snapshot.json +6596 -0
- package/dist/drizzle/meta/0016_snapshot.json +6611 -0
- package/dist/drizzle/meta/_journal.json +56 -0
- package/dist/main.mjs +1306 -360
- package/dist/node/main.mjs +314 -12
- package/dist/pairing-runtime-controller.mjs +608 -108
- package/dist/runtime/base-daemon.mjs +30 -3
- package/dist/runtime/broker-daemon.mjs +4771 -529
- package/dist/runtime/broker-process-manager.mjs +23 -2
- package/dist/runtime/mesh-discover.mjs +23 -2
- package/dist/scout-control-plane-web.mjs +1914 -478
- package/package.json +2 -2
- package/dist/client/assets/AgentLanesEmbedScreen-BmLnN4on.js +0 -1
- package/dist/client/assets/AgentLanesPreflight-5B6sXvRB.js +0 -1
- package/dist/client/assets/AgentLanesView-DHyzVBk6.js +0 -2
- package/dist/client/assets/AgentsSubnav-CDMjKeYC.js +0 -1
- package/dist/client/assets/ChatCollapsedStrip-Ycm0ecaX.js +0 -1
- package/dist/client/assets/ConversationScreen-BNULZAp2.js +0 -2
- package/dist/client/assets/CrewWorkspaces-CJhBKVoZ.css +0 -1
- package/dist/client/assets/CrewWorkspaces-CkPYIA46.js +0 -1
- package/dist/client/assets/FlightObserveScreen-CDWGSKZg.js +0 -1
- package/dist/client/assets/MessagesScreen-Eulveud3.js +0 -1
- package/dist/client/assets/NewChatComposer-hlWT-nbR.js +0 -19
- package/dist/client/assets/OpsScreen-Ppen_Lmj.js +0 -1
- package/dist/client/assets/OpsSubnav-GAKsoSor.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-BLlp2e6t.js +0 -1
- package/dist/client/assets/ProjectsInbox-Dlt8OQ8O.js +0 -2
- package/dist/client/assets/ProjectsRail-DCfNMmnW.js +0 -1
- package/dist/client/assets/ProjectsScreen-BP-hmI1m.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-CWpMjGIH.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-D7zZHK_t.js +0 -1
- package/dist/client/assets/ScoutDeckSurface-CKT3qdqY.js +0 -1
- package/dist/client/assets/SessionEmbedScreen-RD5XOx7R.js +0 -1
- package/dist/client/assets/SessionRefScreen-B_cTv47v.js +0 -1
- package/dist/client/assets/SessionsScreen-Bq0Z77On.js +0 -1
- package/dist/client/assets/archive-BjcGiAy8.js +0 -1
- package/dist/client/assets/content-6RvWTrtk.js +0 -1
- package/dist/client/assets/content-BCgwMUqz.js +0 -1
- package/dist/client/assets/content-Bf2VLhx0.js +0 -1
- package/dist/client/assets/content-BrU_38-m.js +0 -1
- package/dist/client/assets/content-BvvJN8rN.js +0 -1
- package/dist/client/assets/content-CAeEqYPw.js +0 -1
- package/dist/client/assets/content-CI_Z9DXk.js +0 -1
- package/dist/client/assets/content-CbyKONhW.js +0 -1
- package/dist/client/assets/content-Czogvp43.js +0 -1
- package/dist/client/assets/content-DFk0zNzX.js +0 -1
- package/dist/client/assets/content-DHe4DgkA.js +0 -1
- package/dist/client/assets/content-DTz7cKjo.js +0 -1
- package/dist/client/assets/content-E3kudY-W.js +0 -1
- package/dist/client/assets/content-LpO0aO_U.js +0 -1
- package/dist/client/assets/conversation-motion-features-BKkCRaWR.js +0 -1
- package/dist/client/assets/discover-CHbrEItO.js +0 -2
- package/dist/client/assets/embed-entry-vil28MyU.js +0 -2
- package/dist/client/assets/index-BVlMw8x_.js +0 -1
- package/dist/client/assets/index-Cn0GR-q1.js +0 -1
- package/dist/client/assets/index-DosI4AG9.js +0 -1
- package/dist/client/assets/left-BpgWnaah.js +0 -1
- package/dist/client/assets/left-Cx0kv6pe.js +0 -1
- package/dist/client/assets/left-agents-qL5PpUY-.js +0 -1
- package/dist/client/assets/left-z-6CkuBe.js +0 -2
- package/dist/client/assets/projects-inbox-BBs1hG13.css +0 -1
- package/dist/client/assets/projects-inbox-D-zAb9Gp.js +0 -1
- package/dist/client/assets/resolve-panes-DO6LkwhQ.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-CIF288wY.js +0 -1
- package/dist/client/assets/router-DJj2WbDg.js +0 -1
- package/dist/client/assets/use-fleet-active-asks-BeAdcl09.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-D0mUhxTF.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as n}from"./index-CZ-05hKz.js";import{a as X,p as Z}from"./ui-LM8pS8qE.js";/* empty css */import{a as T,s as q,l as ee,L as te,f as K,S as ne,r as se,b as re,c as _,d as ie,u as ae,V as A,C as H,D as le,e as oe}from"./usePierreRuntime-DUuXH5yp.js";import{C as ce}from"./chevron-down-Mp9mu_yd.js";import{C as de}from"./check-C18YQC90.js";import{L as ue}from"./loader-circle-BiohlpM3.js";import{S as fe}from"./send-horizontal-CgLppsIC.js";import{F as he}from"./file-code-corner-7mo7EviR.js";import{C as me}from"./code-xml-Jtxsp5d1.js";import{X as pe}from"./x-e3h2hDsp.js";import{r as O,a as Y,f as V}from"./cache-CeWH_KzJ.js";import{M as xe}from"./message-square-D9YYWE0x.js";import{R as ge}from"./refresh-cw-BRn9Oxxl.js";import{P as be}from"./plus-CuU_X0-8.js";import{a as B}from"./api-Co9aQ2Jw.js";import"./chunk-HRAB3GC3-swV8PA2k.js";import"./createLucideIcon-DXpqZP7I.js";import"./perf-PX8Rx0EP.js";function je({snapshot:e,selectedFile:t,targets:r,targetId:s,onTargetId:i,draft:c,onDraft:f,contextItems:o,onRemoveContextItem:p,pending:a,status:d,error:g,textareaRef:k,onSubmit:S}){const[u,y]=l.useState(!1),b=l.useRef(null),w=r.find(h=>h.id===s)??null,m=w?.label??"Scout",C=r[0]?.id??null,N=t?T(t):null,I=(c.trim().length>0||o.length>0)&&!a,R=l.useMemo(()=>[...r.map(h=>({id:h.id,label:h.label,suffix:h.id===C?"best context":null})),{id:"scout",label:"Scout",suffix:null}],[C,r]);return l.useEffect(()=>{if(!u)return;const h=$=>{const D=b.current;D&&$.target instanceof Node&&D.contains($.target)||y(!1)};return document.addEventListener("pointerdown",h),()=>document.removeEventListener("pointerdown",h)},[u]),n.jsxs("div",{className:"rd-comment",children:[o.length>0?n.jsx("div",{className:"rd-comment-context","aria-label":"Included diff context",children:o.map(h=>n.jsx(ye,{item:h,disabled:a,onRemove:p},h.id))}):null,n.jsxs("div",{className:"rd-comment-main",children:[n.jsxs("div",{className:"rd-target-picker",ref:b,children:[n.jsxs("button",{type:"button",className:"rd-target-button",onClick:()=>y(h=>!h),onKeyDown:h=>{h.stopPropagation(),h.key==="Escape"&&y(!1)},disabled:a,"aria-label":"Diff comment target","aria-haspopup":"listbox","aria-expanded":u,title:"Diff comment target",children:[n.jsx("span",{children:m}),n.jsx(ce,{size:13,strokeWidth:2,"aria-hidden":!0})]}),u?n.jsx("div",{className:"rd-target-menu",role:"listbox","aria-label":"Diff comment target",children:R.map(h=>{const $=h.id===(w?.id??"scout");return n.jsxs("button",{type:"button",className:"rd-target-option",role:"option","aria-selected":$,onClick:()=>{i(h.id),y(!1)},children:[n.jsx("span",{className:"rd-target-option-label",children:h.label}),h.suffix?n.jsx("span",{className:"rd-target-option-suffix",children:h.suffix}):null,n.jsx("span",{className:"rd-target-option-check","aria-hidden":!0,children:$?n.jsx(de,{size:12,strokeWidth:2.2}):null})]},h.id)})}):null]}),n.jsx("textarea",{ref:k,value:c,onChange:h=>f(h.currentTarget.value),onKeyDown:h=>{h.stopPropagation(),(h.metaKey||h.ctrlKey)&&h.key==="Enter"&&(h.preventDefault(),S())},rows:1,disabled:a,placeholder:o.length>0?`Send to ${m} with included context`:"Leave a note on this diff…","aria-label":"Diff comment"}),n.jsxs("button",{type:"button",className:"rd-comment-send",disabled:!I,onClick:S,title:"Send diff comment","aria-label":"Send diff comment",children:[a?n.jsx(ue,{size:13,className:"rd-comment-spin","aria-hidden":!0}):n.jsx(fe,{size:13,"aria-hidden":!0}),n.jsx("span",{children:a?"Sending":"Send"})]})]}),n.jsx("div",{className:"rd-comment-meta",children:g?n.jsx("span",{className:"err",children:g}):d?n.jsx("span",{className:"ok",children:d}):n.jsxs("span",{children:[e.scope?.kind==="session"?"Session diff":"Worktree diff",N?` · ${N}`:""]})})]})}function ye({item:e,disabled:t,onRemove:r}){const s=e.kind==="file"?he:me;return n.jsxs("div",{className:`rd-context-item ${e.kind}`,children:[n.jsxs("div",{className:"rd-context-head",children:[n.jsx("span",{className:"rd-context-icon","aria-hidden":!0,children:n.jsx(s,{size:12,strokeWidth:2})}),n.jsx("span",{className:"rd-context-label",title:e.label,children:e.label}),n.jsx("span",{className:"rd-context-detail",children:e.detail}),n.jsx("button",{type:"button",className:"rd-context-remove",onClick:()=>r(e.id),disabled:t,title:"Remove included context","aria-label":"Remove included context",children:n.jsx(pe,{size:11,strokeWidth:2.2,"aria-hidden":!0})})]}),e.preview?n.jsx("pre",{className:"rd-context-preview",children:e.preview}):null]})}function Ce({heading:e,worktreePath:t,snapshot:r,freshness:s,activeLayer:i,onLayer:c,layout:f,onLayout:o,refreshing:p,onRefresh:a,onFocusComment:d,onClose:g,onOpenAsPage:k}){const{dir:S}=q(t);return n.jsxs("div",{className:"rd-header",children:[n.jsxs("div",{className:"rd-header-id",children:[n.jsxs("div",{className:"rd-header-title",children:[n.jsx("span",{className:"rd-header-name",title:t,children:e}),r.scope?n.jsx(ke,{snapshot:r}):null,S?n.jsx("span",{className:"rd-header-dir",children:S}):null]}),n.jsx("div",{className:"rd-header-sub",children:n.jsx(Ne,{layers:r.layers,activeLayer:i,onLayer:c})}),n.jsx(Se,{freshness:s,generatedAt:r.generatedAt})]}),n.jsxs("div",{className:"rd-header-actions",children:[n.jsx("button",{type:"button",className:"rd-close","aria-label":"Comment on diff",title:"Comment on diff",onClick:d,children:n.jsx(xe,{size:14,strokeWidth:2,"aria-hidden":!0})}),n.jsxs("div",{className:"rd-segmented",role:"group","aria-label":"Diff layout",children:[n.jsx("button",{type:"button",className:f==="unified"?"on":"","aria-pressed":f==="unified",onClick:()=>o("unified"),children:"Unified"}),n.jsx("button",{type:"button",className:f==="split"?"on":"","aria-pressed":f==="split",onClick:()=>o("split"),children:"Split"})]}),n.jsx("button",{type:"button",className:`rd-close${p?" spinning":""}`,"aria-label":"Refresh diff",title:"Fetch fresh diff",onClick:a,disabled:p,children:n.jsx(ge,{size:14,strokeWidth:2,"aria-hidden":!0})}),k?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Open diff as page",title:"Open as full page",onClick:k,children:"↗"}):null,g?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Close",onClick:g,children:"✕"}):null]})]})}function $e({snapshot:e}){const t=[];e.coverage.truncatedLayers>0&&t.push({level:"warning",text:`${e.coverage.truncatedLayers} layer${e.coverage.truncatedLayers===1?"":"s"} truncated — the native diff hit a size budget; some files or hunks are omitted.`}),e.coverage.scanBudgetReached&&t.push({level:"warning",text:"Scan budget reached — this diff is partial."});for(const r of e.diagnostics)t.push({level:r.level,text:r.path?`${r.message} (${r.path})`:r.message});return t.length===0?null:n.jsx(n.Fragment,{children:t.map((r,s)=>n.jsxs("div",{className:`rd-banner ${r.level}`,children:[n.jsx("span",{className:"rd-banner-dot","aria-hidden":!0}),n.jsx("span",{children:r.text})]},s))})}function ke({snapshot:e}){const t=e.scope;if(!t)return null;const r=t.kind==="session"?`Session · ${t.filteredPaths.length} files`:t.filteredPaths.length>0?`Filtered · ${t.filteredPaths.length} files`:"Worktree",s=t.kind==="session"?`${t.label}: path-filtered diff from ${t.changedFiles} changed / ${t.touchedFiles} touched session files`:t.label;return n.jsx("span",{className:`rd-scope-pill ${t.kind}`,title:s,children:r})}function Se({freshness:e,generatedAt:t}){const r=e?.fetchedAt??t,s=Math.max(0,Date.now()-r),i=e?.cacheHit?`Prefetched ${O(s)}`:`Updated ${O(s)}`;return n.jsxs("div",{className:"rd-freshness",title:new Date(r).toLocaleString(),children:[n.jsx("span",{children:i}),e?.refreshing?n.jsx("span",{children:"Refreshing…"}):null,e?.refreshError?n.jsx("span",{children:"Refresh failed"}):null]})}function Ne({layers:e,activeLayer:t,onLayer:r}){return n.jsx("div",{className:"rd-layers",role:"tablist","aria-label":"Diff layers",children:e.map(s=>{const i=ee(s);return n.jsxs("button",{type:"button",role:"tab","aria-selected":s.kind===t,className:"rd-layer-tab"+(s.kind===t?" on":""),onClick:()=>r(s.kind),title:s.shortstat??void 0,children:[n.jsx("span",{children:te[s.kind]??s.kind}),n.jsx("span",{className:"rd-layer-stat",children:s.files.length===0?"clean":n.jsxs(n.Fragment,{children:[s.files.length,"f"," ",n.jsxs("span",{style:{color:"var(--rd-add)"},children:["+",i.add]})," ",n.jsxs("span",{style:{color:"var(--rd-del)"},children:["−",i.del]}),s.truncated?" ⚠":""]})})]},s.kind)})})}const G="openscout.repo-diff.files-rail-width",U=268,we=196,ve=520;function Ie(e,t){if(e.length<=t)return e;const r=e.lastIndexOf(".");if(r<=0){const p=Math.max(1,Math.floor((t-1)/2)),a=t-p-1;return e.slice(0,p)+"…"+e.slice(-Math.max(1,a))}const s=e.slice(0,r),i=e.slice(r),c=t-i.length-1;if(c<2){const p=Math.max(1,t-i.length-1);return s.slice(0,p)+"…"+i}const f=Math.max(1,Math.floor(c/2)),o=Math.max(1,c-f);return s.slice(0,f)+"…"+s.slice(-o)+i}function De(e,t){return Math.max(8,Math.floor((e-178-t*14)/6.7))}function W(e){return Math.max(we,Math.min(ve,Math.round(e)))}function Re(){if(typeof window>"u")return U;const e=Number(window.localStorage.getItem(G));return Number.isFinite(e)?W(e):U}function Le(e){const t={name:"",path:"",firstIndex:Number.MAX_SAFE_INTEGER,children:new Map,files:[]};for(const r of e){t.firstIndex=Math.min(t.firstIndex,r.index);const s=r.dir?r.dir.split("/").filter(Boolean):[];let i=t;for(const c of s){const f=i.path?`${i.path}/${c}`:c;let o=i.children.get(c);o||(o={name:c,path:f,firstIndex:r.index,children:new Map,files:[]},i.children.set(c,o)),o.firstIndex=Math.min(o.firstIndex,r.index),i=o}i.files.push(r)}return t}function J(e){let t=e.files.length;for(const r of e.children.values())t+=J(r);return t}function Pe({layer:e,selectedFileKey:t,onSelect:r,onIncludeFile:s}){const[i,c]=l.useState(Re),[f,o]=l.useState(()=>new Set),p=l.useMemo(()=>(e?.files??[]).map((u,y)=>{const b=K(u,y),w=T(u),{name:m,dir:C}=q(w),N=(u.status==="renamed"||u.status==="copied")&&u.oldPath&&u.newPath&&u.oldPath!==u.newPath;return{file:u,index:y,key:b,display:w,name:m,dir:C,renamed:!!N}}),[e]),a=l.useMemo(()=>Le(p),[p]),d=l.useCallback(u=>{o(y=>{const b=new Set(y);return b.has(u)?b.delete(u):b.add(u),b})},[]),g=l.useCallback(u=>{u.preventDefault();const y=u.clientX,b=i,w=C=>{c(W(b+C.clientX-y))},m=()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",m),c(C=>{const N=W(C);return window.localStorage.setItem(G,String(N)),N})};window.addEventListener("pointermove",w),window.addEventListener("pointerup",m,{once:!0})},[i]),k=(u,y)=>n.jsx(Fe,{entry:u,depth:y,railWidth:i,selected:u.key===t,onSelect:r,onIncludeFile:s},u.key),S=(u,y)=>{const b=[],w=[...u.children.values()].sort((m,C)=>m.firstIndex!==C.firstIndex?m.firstIndex-C.firstIndex:m.name.localeCompare(C.name));for(const m of w){const C=f.has(m.path);b.push(n.jsxs("button",{type:"button",className:"rd-dir-row",style:{paddingLeft:12+y*14},onClick:()=>d(m.path),title:m.path,children:[n.jsx("span",{className:"rd-dir-caret",children:C?"›":"⌄"}),n.jsx("span",{className:"rd-dir-name",children:m.name}),n.jsx("span",{className:"rd-dir-count",children:J(m)})]},`dir:${m.path}`)),C||b.push(...S(m,y+1))}for(const m of u.files)b.push(k(m,y));return b};return n.jsxs("div",{className:"rd-rail",style:{width:i},children:[n.jsx("div",{className:"rd-rail-head",children:e?`Changed files · ${e.files.length}`:"Changed files"}),n.jsx("div",{className:"rd-rail-list",children:S(a,0)}),n.jsx("div",{className:"rd-rail-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file navigation",onPointerDown:g})]})}function Fe({entry:e,depth:t,railWidth:r,selected:s,onSelect:i,onIncludeFile:c}){const{file:f,key:o,display:p,name:a,dir:d,renamed:g}=e,k=De(r,t),S=Ie(a,k);return n.jsxs("div",{className:"rd-file-row"+(s?" on":""),title:g?`${f.oldPath} → ${f.newPath}`:p,children:[n.jsxs("button",{type:"button",className:"rd-file-pick",style:{paddingLeft:18+t*14},onClick:()=>i(o),children:[n.jsx("span",{className:`rd-file-glyph ${f.status}`,children:ne[f.status]}),n.jsxs("span",{className:"rd-file-id",children:[n.jsx("span",{className:"rd-file-name",children:S}),n.jsx("span",{className:"rd-file-dir",children:g?`${f.oldPath} → ${d||a}`:d}),n.jsx(Ee,{file:f})]})]}),n.jsx("span",{className:"rd-file-churn",children:f.binary?n.jsx("span",{className:"add",style:{color:"var(--muted)"},children:"bin"}):n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"add",children:["+",f.additions??0]}),n.jsxs("span",{className:"del",children:["−",f.deletions??0]})]})}),n.jsx("button",{type:"button",className:"rd-file-include",onClick:u=>{u.stopPropagation(),c(f,o)},"aria-label":`Include ${p} in comment`,title:"Include in comment",children:n.jsx(be,{size:12,strokeWidth:2,"aria-hidden":!0})})]})}function Ee({file:e}){const t=[];return e.binary&&t.push("BINARY"),e.truncated&&t.push("TRUNCATED"),e.status==="conflict"&&t.push("CONFLICT"),t.length===0?null:n.jsx("span",{className:"rd-file-tags",children:t.map(r=>n.jsx("span",{className:"rd-file-tag",children:r},r))})}function Me(e){switch(e?.trim().toLowerCase()){case"active":case"working":case"running":case"in_turn":return 80;case"queued":case"waiting":case"waking":case"in_flight":return 50;case"idle":case"available":return 25;case"offline":case"retired":case"stale":return-40;default:return 0}}function Te(e){return e.newPath??e.oldPath??"(unknown)"}function Q(e){const t=e.scope?.kind==="session"?e.scope.agentId:null,r=new Map;for(const s of e.scout.hints)s.agentId&&r.set(s.agentId,(r.get(s.agentId)??0)+1);return e.scout.agents.map(s=>({id:s.id,label:X(s),score:Me(s.state)+(s.id===t?1e3:0)+(r.get(s.id)??0)*10})).sort((s,i)=>{const c=i.score-s.score;return c!==0?c:s.label.localeCompare(i.label)})}function Ae(e){return Q(e)[0]??null}function Ke(e){const t=e.files.reduce((r,s)=>({add:r.add+(s.additions??0),del:r.del+(s.deletions??0)}),{add:0,del:0});return`${e.kind}: ${e.files.length} file${e.files.length===1?"":"s"}, +${t.add} -${t.del}${e.truncated?", truncated":""}`}function z(e){const t=e.binary?"binary":`+${e.additions??0} -${e.deletions??0}`;return`${e.status}: ${Te(e)} (${t}${e.truncated?", truncated":""})`}function We(e){const t=e.scope;return t?t.kind==="session"?`session ${t.sessionId??t.refId??"(unknown)"} (${t.changedFiles} changed / ${t.touchedFiles} touched files, ${t.include})`:t.filteredPaths.length>0?`filtered worktree (${t.filteredPaths.length} paths)`:"worktree":"worktree"}function ze(e){const{comment:t,includedContext:r=[],snapshot:s,activeLayer:i,selectedFile:c}=e,o=((i?s.layers.find(d=>d.kind===i)??null:null)?.files??s.layers.flatMap(d=>d.files)).slice(0,12).map(z),p=s.scout.agents.map(d=>X(d)).slice(0,8),a=["Operator comment on repo diff:",t,"","Repo Diff context:",`- Worktree: ${s.worktreePath}`,`- Scope: ${We(s)}`,`- Active layer: ${i??"none"}`];return r.length>0&&a.splice(3,0,"Included diff context:",...r.map(d=>d.trim()).filter(Boolean),""),c&&a.push(`- Selected file: ${z(c)}`),a.push(`- Layers: ${s.layers.map(Ke).join("; ")}`),p.length>0&&a.push(`- Attached agents: ${p.join(", ")}`),s.scout.sessions.length>0&&a.push(`- Sessions: ${s.scout.sessions.map(d=>d.id).slice(0,8).join(", ")}`),o.length>0&&a.push(`- Changed files: ${o.join(", ")}`),s.diagnostics.length>0&&a.push(`- Diagnostics: ${s.diagnostics.map(d=>d.message).join("; ")}`),a.join(`
|
|
1
|
+
import{r as l,j as n}from"./index-DvLtl7rV.js";import{a as X,p as Z}from"./ui-LM8pS8qE.js";/* empty css */import{a as T,s as q,l as ee,L as te,f as K,S as ne,r as se,b as re,c as _,d as ie,u as ae,V as A,C as H,D as le,e as oe}from"./usePierreRuntime-ejq9dCWV.js";import{C as ce}from"./chevron-down-wciXnOQz.js";import{C as de}from"./check-ofKUE8yH.js";import{L as ue}from"./loader-circle-pM56HNhR.js";import{S as fe}from"./send-horizontal-CSjIm6xg.js";import{F as he}from"./file-code-corner-muIVH_xO.js";import{C as me}from"./code-xml-D7pOQM9l.js";import{X as pe}from"./x-CAbNespN.js";import{r as O,a as Y,f as V}from"./cache-CeWH_KzJ.js";import{M as xe}from"./message-square-C7t_qtuj.js";import{R as ge}from"./refresh-cw-DMxGzDwn.js";import{P as be}from"./plus-Co-dqKul.js";import{a as B}from"./api-Co9aQ2Jw.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";import"./createLucideIcon-DezKXSG2.js";import"./perf-PX8Rx0EP.js";function je({snapshot:e,selectedFile:t,targets:r,targetId:s,onTargetId:i,draft:c,onDraft:f,contextItems:o,onRemoveContextItem:p,pending:a,status:d,error:g,textareaRef:k,onSubmit:S}){const[u,y]=l.useState(!1),b=l.useRef(null),w=r.find(h=>h.id===s)??null,m=w?.label??"Scout",C=r[0]?.id??null,N=t?T(t):null,I=(c.trim().length>0||o.length>0)&&!a,R=l.useMemo(()=>[...r.map(h=>({id:h.id,label:h.label,suffix:h.id===C?"best context":null})),{id:"scout",label:"Scout",suffix:null}],[C,r]);return l.useEffect(()=>{if(!u)return;const h=$=>{const D=b.current;D&&$.target instanceof Node&&D.contains($.target)||y(!1)};return document.addEventListener("pointerdown",h),()=>document.removeEventListener("pointerdown",h)},[u]),n.jsxs("div",{className:"rd-comment",children:[o.length>0?n.jsx("div",{className:"rd-comment-context","aria-label":"Included diff context",children:o.map(h=>n.jsx(ye,{item:h,disabled:a,onRemove:p},h.id))}):null,n.jsxs("div",{className:"rd-comment-main",children:[n.jsxs("div",{className:"rd-target-picker",ref:b,children:[n.jsxs("button",{type:"button",className:"rd-target-button",onClick:()=>y(h=>!h),onKeyDown:h=>{h.stopPropagation(),h.key==="Escape"&&y(!1)},disabled:a,"aria-label":"Diff comment target","aria-haspopup":"listbox","aria-expanded":u,title:"Diff comment target",children:[n.jsx("span",{children:m}),n.jsx(ce,{size:13,strokeWidth:2,"aria-hidden":!0})]}),u?n.jsx("div",{className:"rd-target-menu",role:"listbox","aria-label":"Diff comment target",children:R.map(h=>{const $=h.id===(w?.id??"scout");return n.jsxs("button",{type:"button",className:"rd-target-option",role:"option","aria-selected":$,onClick:()=>{i(h.id),y(!1)},children:[n.jsx("span",{className:"rd-target-option-label",children:h.label}),h.suffix?n.jsx("span",{className:"rd-target-option-suffix",children:h.suffix}):null,n.jsx("span",{className:"rd-target-option-check","aria-hidden":!0,children:$?n.jsx(de,{size:12,strokeWidth:2.2}):null})]},h.id)})}):null]}),n.jsx("textarea",{ref:k,value:c,onChange:h=>f(h.currentTarget.value),onKeyDown:h=>{h.stopPropagation(),(h.metaKey||h.ctrlKey)&&h.key==="Enter"&&(h.preventDefault(),S())},rows:1,disabled:a,placeholder:o.length>0?`Send to ${m} with included context`:"Leave a note on this diff…","aria-label":"Diff comment"}),n.jsxs("button",{type:"button",className:"rd-comment-send",disabled:!I,onClick:S,title:"Send diff comment","aria-label":"Send diff comment",children:[a?n.jsx(ue,{size:13,className:"rd-comment-spin","aria-hidden":!0}):n.jsx(fe,{size:13,"aria-hidden":!0}),n.jsx("span",{children:a?"Sending":"Send"})]})]}),n.jsx("div",{className:"rd-comment-meta",children:g?n.jsx("span",{className:"err",children:g}):d?n.jsx("span",{className:"ok",children:d}):n.jsxs("span",{children:[e.scope?.kind==="session"?"Session diff":"Worktree diff",N?` · ${N}`:""]})})]})}function ye({item:e,disabled:t,onRemove:r}){const s=e.kind==="file"?he:me;return n.jsxs("div",{className:`rd-context-item ${e.kind}`,children:[n.jsxs("div",{className:"rd-context-head",children:[n.jsx("span",{className:"rd-context-icon","aria-hidden":!0,children:n.jsx(s,{size:12,strokeWidth:2})}),n.jsx("span",{className:"rd-context-label",title:e.label,children:e.label}),n.jsx("span",{className:"rd-context-detail",children:e.detail}),n.jsx("button",{type:"button",className:"rd-context-remove",onClick:()=>r(e.id),disabled:t,title:"Remove included context","aria-label":"Remove included context",children:n.jsx(pe,{size:11,strokeWidth:2.2,"aria-hidden":!0})})]}),e.preview?n.jsx("pre",{className:"rd-context-preview",children:e.preview}):null]})}function Ce({heading:e,worktreePath:t,snapshot:r,freshness:s,activeLayer:i,onLayer:c,layout:f,onLayout:o,refreshing:p,onRefresh:a,onFocusComment:d,onClose:g,onOpenAsPage:k}){const{dir:S}=q(t);return n.jsxs("div",{className:"rd-header",children:[n.jsxs("div",{className:"rd-header-id",children:[n.jsxs("div",{className:"rd-header-title",children:[n.jsx("span",{className:"rd-header-name",title:t,children:e}),r.scope?n.jsx(ke,{snapshot:r}):null,S?n.jsx("span",{className:"rd-header-dir",children:S}):null]}),n.jsx("div",{className:"rd-header-sub",children:n.jsx(Ne,{layers:r.layers,activeLayer:i,onLayer:c})}),n.jsx(Se,{freshness:s,generatedAt:r.generatedAt})]}),n.jsxs("div",{className:"rd-header-actions",children:[n.jsx("button",{type:"button",className:"rd-close","aria-label":"Comment on diff",title:"Comment on diff",onClick:d,children:n.jsx(xe,{size:14,strokeWidth:2,"aria-hidden":!0})}),n.jsxs("div",{className:"rd-segmented",role:"group","aria-label":"Diff layout",children:[n.jsx("button",{type:"button",className:f==="unified"?"on":"","aria-pressed":f==="unified",onClick:()=>o("unified"),children:"Unified"}),n.jsx("button",{type:"button",className:f==="split"?"on":"","aria-pressed":f==="split",onClick:()=>o("split"),children:"Split"})]}),n.jsx("button",{type:"button",className:`rd-close${p?" spinning":""}`,"aria-label":"Refresh diff",title:"Fetch fresh diff",onClick:a,disabled:p,children:n.jsx(ge,{size:14,strokeWidth:2,"aria-hidden":!0})}),k?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Open diff as page",title:"Open as full page",onClick:k,children:"↗"}):null,g?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Close",onClick:g,children:"✕"}):null]})]})}function $e({snapshot:e}){const t=[];e.coverage.truncatedLayers>0&&t.push({level:"warning",text:`${e.coverage.truncatedLayers} layer${e.coverage.truncatedLayers===1?"":"s"} truncated — the native diff hit a size budget; some files or hunks are omitted.`}),e.coverage.scanBudgetReached&&t.push({level:"warning",text:"Scan budget reached — this diff is partial."});for(const r of e.diagnostics)t.push({level:r.level,text:r.path?`${r.message} (${r.path})`:r.message});return t.length===0?null:n.jsx(n.Fragment,{children:t.map((r,s)=>n.jsxs("div",{className:`rd-banner ${r.level}`,children:[n.jsx("span",{className:"rd-banner-dot","aria-hidden":!0}),n.jsx("span",{children:r.text})]},s))})}function ke({snapshot:e}){const t=e.scope;if(!t)return null;const r=t.kind==="session"?`Session · ${t.filteredPaths.length} files`:t.filteredPaths.length>0?`Filtered · ${t.filteredPaths.length} files`:"Worktree",s=t.kind==="session"?`${t.label}: path-filtered diff from ${t.changedFiles} changed / ${t.touchedFiles} touched session files`:t.label;return n.jsx("span",{className:`rd-scope-pill ${t.kind}`,title:s,children:r})}function Se({freshness:e,generatedAt:t}){const r=e?.fetchedAt??t,s=Math.max(0,Date.now()-r),i=e?.cacheHit?`Prefetched ${O(s)}`:`Updated ${O(s)}`;return n.jsxs("div",{className:"rd-freshness",title:new Date(r).toLocaleString(),children:[n.jsx("span",{children:i}),e?.refreshing?n.jsx("span",{children:"Refreshing…"}):null,e?.refreshError?n.jsx("span",{children:"Refresh failed"}):null]})}function Ne({layers:e,activeLayer:t,onLayer:r}){return n.jsx("div",{className:"rd-layers",role:"tablist","aria-label":"Diff layers",children:e.map(s=>{const i=ee(s);return n.jsxs("button",{type:"button",role:"tab","aria-selected":s.kind===t,className:"rd-layer-tab"+(s.kind===t?" on":""),onClick:()=>r(s.kind),title:s.shortstat??void 0,children:[n.jsx("span",{children:te[s.kind]??s.kind}),n.jsx("span",{className:"rd-layer-stat",children:s.files.length===0?"clean":n.jsxs(n.Fragment,{children:[s.files.length,"f"," ",n.jsxs("span",{style:{color:"var(--rd-add)"},children:["+",i.add]})," ",n.jsxs("span",{style:{color:"var(--rd-del)"},children:["−",i.del]}),s.truncated?" ⚠":""]})})]},s.kind)})})}const G="openscout.repo-diff.files-rail-width",U=268,we=196,ve=520;function Ie(e,t){if(e.length<=t)return e;const r=e.lastIndexOf(".");if(r<=0){const p=Math.max(1,Math.floor((t-1)/2)),a=t-p-1;return e.slice(0,p)+"…"+e.slice(-Math.max(1,a))}const s=e.slice(0,r),i=e.slice(r),c=t-i.length-1;if(c<2){const p=Math.max(1,t-i.length-1);return s.slice(0,p)+"…"+i}const f=Math.max(1,Math.floor(c/2)),o=Math.max(1,c-f);return s.slice(0,f)+"…"+s.slice(-o)+i}function De(e,t){return Math.max(8,Math.floor((e-178-t*14)/6.7))}function W(e){return Math.max(we,Math.min(ve,Math.round(e)))}function Re(){if(typeof window>"u")return U;const e=Number(window.localStorage.getItem(G));return Number.isFinite(e)?W(e):U}function Le(e){const t={name:"",path:"",firstIndex:Number.MAX_SAFE_INTEGER,children:new Map,files:[]};for(const r of e){t.firstIndex=Math.min(t.firstIndex,r.index);const s=r.dir?r.dir.split("/").filter(Boolean):[];let i=t;for(const c of s){const f=i.path?`${i.path}/${c}`:c;let o=i.children.get(c);o||(o={name:c,path:f,firstIndex:r.index,children:new Map,files:[]},i.children.set(c,o)),o.firstIndex=Math.min(o.firstIndex,r.index),i=o}i.files.push(r)}return t}function J(e){let t=e.files.length;for(const r of e.children.values())t+=J(r);return t}function Pe({layer:e,selectedFileKey:t,onSelect:r,onIncludeFile:s}){const[i,c]=l.useState(Re),[f,o]=l.useState(()=>new Set),p=l.useMemo(()=>(e?.files??[]).map((u,y)=>{const b=K(u,y),w=T(u),{name:m,dir:C}=q(w),N=(u.status==="renamed"||u.status==="copied")&&u.oldPath&&u.newPath&&u.oldPath!==u.newPath;return{file:u,index:y,key:b,display:w,name:m,dir:C,renamed:!!N}}),[e]),a=l.useMemo(()=>Le(p),[p]),d=l.useCallback(u=>{o(y=>{const b=new Set(y);return b.has(u)?b.delete(u):b.add(u),b})},[]),g=l.useCallback(u=>{u.preventDefault();const y=u.clientX,b=i,w=C=>{c(W(b+C.clientX-y))},m=()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",m),c(C=>{const N=W(C);return window.localStorage.setItem(G,String(N)),N})};window.addEventListener("pointermove",w),window.addEventListener("pointerup",m,{once:!0})},[i]),k=(u,y)=>n.jsx(Fe,{entry:u,depth:y,railWidth:i,selected:u.key===t,onSelect:r,onIncludeFile:s},u.key),S=(u,y)=>{const b=[],w=[...u.children.values()].sort((m,C)=>m.firstIndex!==C.firstIndex?m.firstIndex-C.firstIndex:m.name.localeCompare(C.name));for(const m of w){const C=f.has(m.path);b.push(n.jsxs("button",{type:"button",className:"rd-dir-row",style:{paddingLeft:12+y*14},onClick:()=>d(m.path),title:m.path,children:[n.jsx("span",{className:"rd-dir-caret",children:C?"›":"⌄"}),n.jsx("span",{className:"rd-dir-name",children:m.name}),n.jsx("span",{className:"rd-dir-count",children:J(m)})]},`dir:${m.path}`)),C||b.push(...S(m,y+1))}for(const m of u.files)b.push(k(m,y));return b};return n.jsxs("div",{className:"rd-rail",style:{width:i},children:[n.jsx("div",{className:"rd-rail-head",children:e?`Changed files · ${e.files.length}`:"Changed files"}),n.jsx("div",{className:"rd-rail-list",children:S(a,0)}),n.jsx("div",{className:"rd-rail-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file navigation",onPointerDown:g})]})}function Fe({entry:e,depth:t,railWidth:r,selected:s,onSelect:i,onIncludeFile:c}){const{file:f,key:o,display:p,name:a,dir:d,renamed:g}=e,k=De(r,t),S=Ie(a,k);return n.jsxs("div",{className:"rd-file-row"+(s?" on":""),title:g?`${f.oldPath} → ${f.newPath}`:p,children:[n.jsxs("button",{type:"button",className:"rd-file-pick",style:{paddingLeft:18+t*14},onClick:()=>i(o),children:[n.jsx("span",{className:`rd-file-glyph ${f.status}`,children:ne[f.status]}),n.jsxs("span",{className:"rd-file-id",children:[n.jsx("span",{className:"rd-file-name",children:S}),n.jsx("span",{className:"rd-file-dir",children:g?`${f.oldPath} → ${d||a}`:d}),n.jsx(Ee,{file:f})]})]}),n.jsx("span",{className:"rd-file-churn",children:f.binary?n.jsx("span",{className:"add",style:{color:"var(--muted)"},children:"bin"}):n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"add",children:["+",f.additions??0]}),n.jsxs("span",{className:"del",children:["−",f.deletions??0]})]})}),n.jsx("button",{type:"button",className:"rd-file-include",onClick:u=>{u.stopPropagation(),c(f,o)},"aria-label":`Include ${p} in comment`,title:"Include in comment",children:n.jsx(be,{size:12,strokeWidth:2,"aria-hidden":!0})})]})}function Ee({file:e}){const t=[];return e.binary&&t.push("BINARY"),e.truncated&&t.push("TRUNCATED"),e.status==="conflict"&&t.push("CONFLICT"),t.length===0?null:n.jsx("span",{className:"rd-file-tags",children:t.map(r=>n.jsx("span",{className:"rd-file-tag",children:r},r))})}function Me(e){switch(e?.trim().toLowerCase()){case"active":case"working":case"running":case"in_turn":return 80;case"queued":case"waiting":case"waking":case"in_flight":return 50;case"idle":case"available":return 25;case"offline":case"retired":case"stale":return-40;default:return 0}}function Te(e){return e.newPath??e.oldPath??"(unknown)"}function Q(e){const t=e.scope?.kind==="session"?e.scope.agentId:null,r=new Map;for(const s of e.scout.hints)s.agentId&&r.set(s.agentId,(r.get(s.agentId)??0)+1);return e.scout.agents.map(s=>({id:s.id,label:X(s),score:Me(s.state)+(s.id===t?1e3:0)+(r.get(s.id)??0)*10})).sort((s,i)=>{const c=i.score-s.score;return c!==0?c:s.label.localeCompare(i.label)})}function Ae(e){return Q(e)[0]??null}function Ke(e){const t=e.files.reduce((r,s)=>({add:r.add+(s.additions??0),del:r.del+(s.deletions??0)}),{add:0,del:0});return`${e.kind}: ${e.files.length} file${e.files.length===1?"":"s"}, +${t.add} -${t.del}${e.truncated?", truncated":""}`}function z(e){const t=e.binary?"binary":`+${e.additions??0} -${e.deletions??0}`;return`${e.status}: ${Te(e)} (${t}${e.truncated?", truncated":""})`}function We(e){const t=e.scope;return t?t.kind==="session"?`session ${t.sessionId??t.refId??"(unknown)"} (${t.changedFiles} changed / ${t.touchedFiles} touched files, ${t.include})`:t.filteredPaths.length>0?`filtered worktree (${t.filteredPaths.length} paths)`:"worktree":"worktree"}function ze(e){const{comment:t,includedContext:r=[],snapshot:s,activeLayer:i,selectedFile:c}=e,o=((i?s.layers.find(d=>d.kind===i)??null:null)?.files??s.layers.flatMap(d=>d.files)).slice(0,12).map(z),p=s.scout.agents.map(d=>X(d)).slice(0,8),a=["Operator comment on repo diff:",t,"","Repo Diff context:",`- Worktree: ${s.worktreePath}`,`- Scope: ${We(s)}`,`- Active layer: ${i??"none"}`];return r.length>0&&a.splice(3,0,"Included diff context:",...r.map(d=>d.trim()).filter(Boolean),""),c&&a.push(`- Selected file: ${z(c)}`),a.push(`- Layers: ${s.layers.map(Ke).join("; ")}`),p.length>0&&a.push(`- Attached agents: ${p.join(", ")}`),s.scout.sessions.length>0&&a.push(`- Sessions: ${s.scout.sessions.map(d=>d.id).slice(0,8).join(", ")}`),o.length>0&&a.push(`- Changed files: ${o.join(", ")}`),s.diagnostics.length>0&&a.push(`- Diagnostics: ${s.diagnostics.map(d=>d.message).join("; ")}`),a.join(`
|
|
2
2
|
`)}function _e(e){const{snapshot:t,activeLayer:r,file:s}=e,i=[r??"diff",z(s)];return t.scope?.kind==="session"&&i.push(`session ${t.scope.sessionId??t.scope.refId??"scope"}`),`[Diff context: ${i.join(" · ")}]`}function He(e,t,r){return!e||!t?null:e.files.find((s,i)=>r(s,i)===t)??null}function Oe(e,t=120){const r=e.replace(/\s+/g," ").trim();return r.length>t?`${r.slice(0,t-3)}...`:r}function Be(e,t=7){const r=e.trimEnd().split(`
|
|
3
3
|
`),s=r.slice(0,t),i=r.length-s.length;return i>0?`${s.join(`
|
|
4
4
|
`)}
|
package/dist/client/assets/{RepoDiffViewerLazy-C0--fPtk.js → RepoDiffViewerLazy-Csy_j9LD.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RepoDiffViewer-
|
|
2
|
-
import{j as e,r as i,_ as s}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RepoDiffViewer-BhcIIQQg.js","assets/index-DvLtl7rV.js","assets/index-i7TMxlwW.css","assets/ui-LM8pS8qE.js","assets/usePierreRuntime-ejq9dCWV.js","assets/chunk-HRAB3GC3-Tyv9rzx7.js","assets/chevron-down-wciXnOQz.js","assets/createLucideIcon-DezKXSG2.js","assets/check-ofKUE8yH.js","assets/loader-circle-pM56HNhR.js","assets/send-horizontal-CSjIm6xg.js","assets/file-code-corner-muIVH_xO.js","assets/code-xml-D7pOQM9l.js","assets/x-CAbNespN.js","assets/cache-CeWH_KzJ.js","assets/api-Co9aQ2Jw.js","assets/perf-PX8Rx0EP.js","assets/message-square-C7t_qtuj.js","assets/refresh-cw-DMxGzDwn.js","assets/plus-Co-dqKul.js","assets/repo-diff-DyYmQMSA.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r as i,_ as s}from"./index-DvLtl7rV.js";/* empty css */const a=i.lazy(()=>s(()=>import("./RepoDiffViewer-BhcIIQQg.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])).then(r=>({default:r.RepoDiffViewer})));function t(){return e.jsx("div",{className:"rd-viewer","data-scout-theme":!0,children:e.jsx("div",{className:"rd-center",children:e.jsxs("div",{className:"rd-center-card",children:[e.jsx("div",{className:"rd-spinner","aria-hidden":!0}),e.jsx("div",{className:"rd-center-title",children:"Opening diff viewer…"})]})})})}function c(r){return e.jsx(i.Suspense,{fallback:e.jsx(t,{}),children:e.jsx(a,{...r})})}export{c as R};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as d,j as e}from"./index-
|
|
1
|
+
import{r as d,j as e}from"./index-DvLtl7rV.js";import{E as te}from"./EmptyState-CJzXj1l5.js";import{u as qe,a as _e}from"./Provider-CtXJeLrP.js";import{g as Be,f as pe,b as He}from"./api-HFH8wFyb.js";import{a as Ue}from"./api-Co9aQ2Jw.js";import{c as ne}from"./clipboard-e3fSpeo7.js";import{u as Ke}from"./keyboard-nav-BLYDhL3Z.js";/* empty css */import{f as v,c as Ve,b as Ee,r as Pe,u as Ae,i as le,w as Ie,k as Me,l as ze,m as G,a as X,s as Ge,h as Xe}from"./ui-LM8pS8qE.js";import{B as Te,p as Ye,c as Je}from"./selection-bridge-Din6yV3h.js";import{S as Qe}from"./SlidePanel-B9ugxWgA.js";import{R as Ze}from"./RepoDiffViewerLazy-Csy_j9LD.js";import{p as es}from"./cache-CeWH_KzJ.js";import{R as ss}from"./refresh-cw-DMxGzDwn.js";import{S as ts}from"./sliders-horizontal-C8njVwfg.js";import"./router-B9vQkNJL.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./sse-CD9MMUxl.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./createLucideIcon-DezKXSG2.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./file-text-CqJgwxmv.js";import"./x-CAbNespN.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./NewChatComposer-_Stj0fZy.js";import"./text-BP3oyl8-.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-pM56HNhR.js";import"./conversation-model-Dc02NsGp.js";import"./time-Dhsh_2EG.js";import"./index-zvhpRHao.js";import"./HarnessMark-B979GCSB.js";import"./NewChatOrigin-B1u7ki70.js";import"./chevron-down-wciXnOQz.js";import"./search-CDko0PKE.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";/* empty css */const me=[{value:"claude",label:"Claude"},{value:"codex",label:"Codex"},{value:"pi",label:"Grok"}],ns=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"XHigh"}],rs=[{value:"new",label:"New session",hint:"Start a fresh harness session for this agent"},{value:"existing",label:"Continue session",hint:"Resume this agent’s current harness session"}];function fe(s){return`gh pr checkout ${s.number}`}function as(s){return[`Please review pull request #${s.number}: ${s.title}`,"",`URL: ${s.url}`,`Repo: ${s.repo}`,`Branch: ${s.headRefName||"head"} → ${s.baseRefName||"base"}`,s.path?`Local path: ${s.path}`:null,s.author?`Author: @${s.author}`:null,s.isDraft?"Status: draft":"Status: open","","Read the diff, summarize the change, call out risks or test gaps, and recommend ship / revise / hold."].filter(t=>t!=null).join(`
|
|
2
2
|
`)}function Q(s){return s.handle?.trim()||s.name?.trim()||s.id}function ge(s,t){const r=s?.trim(),n=t?.trim();return!r||!n?!1:r===n||r.startsWith(`${n}/`)||n.startsWith(`${r}/`)}function is(s){switch(s?.trim().toLowerCase()){case"available":case"idle":case"callable":return 40;case"active":case"working":case"running":case"in_turn":case"in_flight":return 20;case"queued":case"waiting":case"waking":return 10;case"offline":case"retired":case"stale":case"blocked":return-50;default:return 0}}function ls(s,t,r){const n=r?.trim()||s.path?.trim()||null,a=s.repo.split("/").pop()?.toLowerCase()??"",l=s.headRefName?.trim()??"";return t.filter(o=>!o.retiredFromFleet).map(o=>{let c=is(o.state);return(ge(o.projectRoot,n)||ge(o.cwd,n))&&(c+=1e3),a&&o.project?.trim().toLowerCase()===a&&(c+=400),l&&o.branch?.trim()===l&&(c+=200),{agent:o,score:c}}).sort((o,c)=>c.score!==o.score?c.score-o.score:Q(o.agent).localeCompare(Q(c.agent))).map(o=>o.agent)}function je(s,t){const r=new Map,n=s.path?.trim();if(n){const a=n.split("/").filter(Boolean).at(-1)??n;r.set(n,s.repo||a)}for(const a of t){const l=a.root?.trim();l&&(r.has(l)||r.set(l,a.name?.trim()||l.split("/").filter(Boolean).at(-1)||l))}return[...r.entries()].map(([a,l])=>({path:a,label:l}))}function re(s,t){return s?.harness?.trim()||t?.trim()||"claude"}function os(s){return s?.model?.trim()||""}function cs(s,t){const r=new Set,n=t?.model?.trim();n&&r.add(n);for(const a of s){const l=a.model?.trim();l&&r.add(l)}return[...r]}function ds(s){const t=s.harness?.trim()||void 0,r=s.model?.trim()||void 0,n=s.reasoningEffort?.trim()||void 0;return{...t?{harness:t}:{},...r?{model:r}:{},...n?{reasoningEffort:n}:{}}}async function us(s,t){const r=as(s),n=t.projectPath.trim();if(!n)throw new Error("Pick a project path for the review.");const a=ds(t),l=t.agent??null,o=l&&t.sessionMode==="existing"?"existing":"new";if(l&&o==="existing"&&!l.harnessSessionId?.trim())throw new Error(`@${Q(l)} has no live harness session to continue. Pick “New session” instead.`);const c=await Ue("/api/sessions",{method:"POST",body:JSON.stringify({target:l?{agentId:l.id,projectPath:n}:{projectPath:n},execution:{session:o,...o==="existing"&&l?.harnessSessionId?.trim()?{targetSessionId:l.harnessSessionId.trim()}:{},...a},agent:{persistence:l?"sticky":"one_time",...l?.handle?.trim()?{handle:l.handle.trim()}:{}},seed:{instructions:r}})}),h=c.flightId??c.flight?.id??null,p=c.targetAgentId??c.flight?.targetAgentId??c.agentId??l?.id??null,u=c.targetLabel?.trim()||(l?Q(l):null)||p||"one-time reviewer",m=l?o==="existing"?"continue":"new session":"one-time";return{message:[`Assigned #${s.number} for review → ${u.startsWith("@")?u:`@${u}`}`,`· ${m}`,a.harness?`· ${a.harness}`:null,a.model?`· ${a.model}`:null,a.reasoningEffort?`· ${a.reasoningEffort}`:null,h?`· ${h}`:null].filter(Boolean).join(" "),flightId:h,conversationId:c.conversationId??null,targetAgentId:p,targetLabel:u}}function hs(s){window.open(s.url,"_blank","noopener,noreferrer")}function ps(s,t={}){const{matchingWorktree:r,onBeginAssign:n,onSelectWorktreeId:a,onOpenDiff:l,onStatus:o}=t,c=[];return n&&c.push({kind:"action",label:"Assign for review…",onSelect:()=>n(s)}),c.push({kind:"action",label:"Open on GitHub",onSelect:()=>hs(s)}),r&&a&&c.push({kind:"action",label:`Select worktree · ${r.branch}`,onSelect:()=>a(r.id)}),r&&l&&c.push({kind:"action",label:"Open local diff",onSelect:()=>l(r.path)}),c.push({kind:"separator"},{kind:"action",label:"Copy link",onSelect:()=>{ne(s.url).then(h=>{o?.(h?`Copied link for #${s.number}`:`Could not copy link for #${s.number}`)})}},{kind:"action",label:"Copy checkout command",onSelect:()=>{ne(fe(s)).then(h=>{o?.(h?`Copied: ${fe(s)}`:`Could not copy checkout command for #${s.number}`)})}},{kind:"action",label:"Copy title",onSelect:()=>{ne(`#${s.number} ${s.title}`).then(h=>{o?.(h?`Copied title for #${s.number}`:`Could not copy title for #${s.number}`)})}}),c}function ms(s){return s.startsWith("/Users/")?`~/${s.split("/").slice(3).join("/")}`:s}function fs(s){const t=s.handle?.trim()||s.name?.trim()||s.id,r=[s.harness?.trim(),s.model?.trim(),s.state?.trim(),s.harnessSessionId?.trim()?"session":null].filter(Boolean);return r.length>0?`@${t} · ${r.join(" · ")}`:`@${t}`}function Y(s){const t=s?.trim();return t?t.length>18?`${t.slice(0,10)}…${t.slice(-4)}`:t:null}function gs({pr:s,agents:t,projects:r,pending:n,error:a,onClose:l,onPendingChange:o,onError:c,onAssigned:h}){const p=Ke(),u=d.useMemo(()=>je(s,r),[s,r]),[m,N]=d.useState(()=>u[0]?.path??s.path?.trim()??""),[b,T]=d.useState(""),C=d.useMemo(()=>ls(s,t,m),[t,s,m]),g=C.find(i=>i.id===b)??null,j=!!g?.harnessSessionId?.trim(),[$,P]=d.useState(()=>re(null)),[M,A]=d.useState(""),[x,k]=d.useState("medium"),[R,y]=d.useState("new");d.useEffect(()=>{const w=je(s,r)[0]?.path??s.path?.trim()??"";N(w),T(""),P(re(null)),A(""),k("medium"),y("new"),c(null)},[s.id]),d.useEffect(()=>{m&&u.some(i=>i.path===m)||N(u[0]?.path??s.path?.trim()??"")},[s.path,u,m]),d.useEffect(()=>{if(!g){y("new");return}P(re(g)),A(os(g)),y(g.harnessSessionId?.trim()?"existing":"new")},[g?.id]),d.useEffect(()=>{b&&(C.some(i=>i.id===b)||T(""))},[b,C]),d.useEffect(()=>{R==="existing"&&g&&!j&&y("new")},[j,g,R]);const L=d.useMemo(()=>cs(C,g),[C,g]),I=!!m.trim()&&!n&&!(g&&R==="existing"&&!j),W=async()=>{if(I){o(!0),c(null);try{const i=await us(s,{projectPath:m.trim(),harness:$,model:M,reasoningEffort:x,agent:g,sessionMode:g?R:"new"});h(i)}catch(i){c(i instanceof Error?i.message:String(i))}finally{o(!1)}}},F=n?"Assigning…":g?R==="existing"?"Continue session · review":"New session · review":"Start review",D=g?R==="existing"?`Continues @${g.handle?.trim()||g.name}'s current session${Y(g.harnessSessionId)?` (${Y(g.harnessSessionId)})`:""}.`:`Starts a fresh harness session for @${g.handle?.trim()||g.name}.`:"Starts a disposable one-time reviewer on the project with the runtime above.";return e.jsx("div",{className:"rw-pr-assign-backdrop",role:"presentation",onMouseDown:i=>{i.target===i.currentTarget&&!n&&l()},children:e.jsxs("div",{ref:p.ref,className:"rw-pr-assign-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"rw-pr-assign-title",tabIndex:-1,onKeyDown:i=>{p.onKeyDown(i),i.key==="Escape"&&!n&&(i.stopPropagation(),l())},children:[e.jsxs("div",{className:"rw-pr-assign-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"rw-pr-assign-eyebrow",children:"Assign for review"}),e.jsxs("h2",{id:"rw-pr-assign-title",className:"rw-pr-assign-title",children:["#",s.number," · launch review"]}),e.jsx("p",{className:"rw-pr-assign-copy",title:s.title,children:s.title}),e.jsxs("p",{className:"rw-pr-assign-meta",children:[s.repo," · ",s.headRefName||"head"," → ",s.baseRefName||"base"]})]}),e.jsx("button",{type:"button",className:"rw-pr-assign-close",onClick:l,disabled:n,children:"Cancel"})]}),e.jsxs("div",{className:"rw-pr-assign-body",children:[e.jsxs("div",{className:"rw-pr-assign-fields",children:[e.jsxs("label",{className:"rw-pr-assign-field",children:[e.jsx("span",{children:"Project"}),e.jsx("select",{value:m,disabled:n||u.length===0,onChange:i=>N(i.target.value),"aria-label":"Project path",children:u.length===0?e.jsx("option",{value:"",children:"No local project"}):u.map(i=>e.jsxs("option",{value:i.path,children:[i.label," · ",ms(i.path)]},i.path))})]}),e.jsxs("label",{className:"rw-pr-assign-field",children:[e.jsx("span",{children:"Harness"}),e.jsxs("select",{value:$,disabled:n,onChange:i=>P(i.target.value),"aria-label":"Harness",children:[me.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value)),$&&!me.some(i=>i.value===$)?e.jsx("option",{value:$,children:$}):null]})]}),e.jsxs("label",{className:"rw-pr-assign-field",children:[e.jsx("span",{children:"Model"}),e.jsx("input",{list:"rw-pr-assign-models",value:M,disabled:n,placeholder:"Default for harness",onChange:i=>A(i.target.value),"aria-label":"Model"}),e.jsx("datalist",{id:"rw-pr-assign-models",children:L.map(i=>e.jsx("option",{value:i},i))})]}),e.jsxs("label",{className:"rw-pr-assign-field",children:[e.jsx("span",{children:"Effort"}),e.jsx("select",{value:x,disabled:n,onChange:i=>k(i.target.value),"aria-label":"Reasoning effort",children:ns.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{className:"rw-pr-assign-field rw-pr-assign-field--wide",children:[e.jsxs("span",{children:["Agent ",e.jsx("em",{children:"(optional)"})]}),e.jsxs("select",{value:b,disabled:n,onChange:i=>T(i.target.value),"aria-label":"Existing agent (optional)",children:[e.jsx("option",{value:"",children:"New one-time reviewer on project"}),C.map(i=>e.jsx("option",{value:i.id,children:fs(i)},i.id))]})]}),g?e.jsxs("fieldset",{className:"rw-pr-assign-session",disabled:n,children:[e.jsx("legend",{children:"Session"}),e.jsx("div",{className:"rw-pr-assign-session-choices",role:"radiogroup","aria-label":"Session mode",children:rs.map(i=>{const w=i.value==="existing"&&!j,O=R===i.value;return e.jsxs("button",{type:"button",role:"radio","aria-checked":O,className:"rw-pr-assign-session-choice","data-active":O||void 0,disabled:w,title:w?"This agent has no live harness session to continue":i.hint,onClick:()=>y(i.value),children:[e.jsx("span",{className:"rw-pr-assign-session-title",children:i.label}),e.jsx("span",{className:"rw-pr-assign-session-sub",children:w?"No live session on this agent":i.value==="existing"&&Y(g.harnessSessionId)?Y(g.harnessSessionId):i.hint})]},i.value)})})]}):null]}),e.jsx("p",{className:"rw-pr-assign-hint",children:D}),a?e.jsx("div",{className:"rw-pr-assign-error",role:"alert",children:a}):null,e.jsx("div",{className:"rw-pr-assign-actions",children:e.jsx("button",{type:"button",className:"rw-pr-assign-submit",disabled:!I,onClick:()=>{W()},children:F})})]})]})})}const js=/^Skipped missing repo-watch path:\s*(.+)$/i,xs=4;function bs(s){const t=s.trim().replace(/\/+$/,"")||s.trim();if(!t)return"unknown paths";if(t==="~"||t.startsWith("~/"))return"~/*";if(!t.startsWith("/")){const[n]=t.split(/[\\/]/).filter(Boolean);return n?`${n}/*`:t}const r=t.split("/").filter(Boolean);return r[0]==="Users"&&r[1]?`/Users/${r[1]}/*`:r[0]==="Volumes"&&r[1]?`/Volumes/${r[1]}/*`:r.length>=2?`/${r[0]}/${r[1]}/*`:`/${r[0]??""}`}function ws(s,t){const r=[...new Set(s)];if(r.length===1)return{message:`Skipped missing repo-watch path: ${r[0]}`,examples:[],rawCount:1};const n=r.slice(0,xs),a=r.length-n.length;return a>0&&n.push(`+${a} more`),{message:`Skipped ${r.length} missing repo-watch paths under ${t}. These look like stale broker hints.`,examples:n,rawCount:r.length}}function xe(s,t){if(s.length===0)return;const r=new Map;for(const n of s){const a=bs(n),l=r.get(a);l?l.push(n):r.set(a,[n])}for(const[n,a]of r)t.push(ws(a,n));s.length=0}function vs(s){const t=[],r=[];for(const n of s){const a=js.exec(n);if(a){r.push(a[1].trim());continue}xe(r,t),t.push({message:n,examples:[],rawCount:1})}return xe(r,t),t}const be={attention:"desc",name:"asc",churn:"desc",files:"desc",drift:"desc",attached:"desc"},we="attention";function Ns(s){return!s.status.clean||s.branch.ahead>0||s.branch.behind>0||s.agents.some(le)||s.sessions.length>0||s.error!=null}function Ss(s,t){const r=Ve(s),n=Ee(s),{add:a,del:l,total:o}=Pe(s),c=Ae(s);return{wt:s,project:t,state:Ie(s),add:a,del:l,churn:o,files:n.files+Math.max(r.files,s.status.changedFiles),live:c.filter(le).length,agentsUnique:c}}function De(s){return s.status.conflicts>0||s.error!=null}function ks(s){const t=s.flatMap(l=>l.worktrees.filter(De).map(o=>{const c=o.branch.name??o.name;return o.status.conflicts>0?`${l.name}/${c}: ${v(o.status.conflicts)} conflict${o.status.conflicts===1?"":"s"}`:`${l.name}/${c}: scan error`})),r="Worktrees blocked by conflicts or scan errors.";if(t.length===0)return r;const n=t.slice(0,8),a=t.length-n.length;return[r,...n,a>0?`+${a} more`:null].filter(l=>!!l).join(`
|
|
3
3
|
`)}function ys({snapshot:s,selectedId:t,onSelect:r,onViewDiff:n,scanDepth:a,scanMorePending:l,onScanMore:o,openPullRequestCount:c,openPullRequestTitle:h}){const[p,u]=d.useState(we),[m,N]=d.useState(be[we]),[b,T]=d.useState(!1),{liveRows:C,cleanRows:g,stats:j,blockedTitle:$}=d.useMemo(()=>{const x=[],k=[];let R=0,y=0,L=0;for(const F of s.projects)for(const D of F.worktrees){const i=Ss(D,F);L+=i.files,i.live>0&&R++,De(D)&&y++,(Ns(D)?x:k).push(i)}const I=s.totals,W={repos:I.projects,worktrees:I.worktrees,dirtyWorktrees:I.dirtyWorktrees,changedFiles:L,live:R,blocked:y};return{liveRows:x,cleanRows:k,stats:W,blockedTitle:ks(s.projects)}},[s.projects,s.totals]),P=d.useMemo(()=>{const x=Ds(C,p,m),k=new Map;for(const R of x){const y=k.get(R.project.id);y?y.push(R):k.set(R.project.id,[R])}return[...k.values()]},[C,p,m]);function M(x){x===p?N(k=>k==="asc"?"desc":"asc"):(u(x),N(be[x]))}const A=C.length===0&&g.length===0;return e.jsxs("section",{className:"rw-table",children:[e.jsxs("div",{className:"rw-head",children:[e.jsxs("div",{className:"rw-head-top",children:[e.jsx("span",{className:"rw-eyebrow",children:"STATE OF REPOS"}),g.length>0?e.jsxs("button",{type:"button",className:"rw-clean",style:{marginLeft:"auto"},onClick:()=>T(x=>!x),"aria-pressed":b,children:[b?"hide":"show"," clean & idle (",g.length,")"]}):null]}),e.jsxs("div",{className:"stats",children:[e.jsx(U,{v:j.repos,k:"REPOS"}),j.worktrees>j.repos?e.jsx(U,{v:j.worktrees,k:"WORKTREES",title:`${v(j.worktrees)} worktrees across ${v(j.repos)} repos.`}):null,e.jsx(U,{v:j.changedFiles,k:"CHANGED",title:`${v(j.changedFiles)} changed files across ${v(j.dirtyWorktrees)} dirty worktree${j.dirtyWorktrees===1?"":"s"}.`}),j.live>0?e.jsx(U,{v:j.live,k:"WORKING",tone:"mint"}):null,(c??0)>0?e.jsx(U,{v:c??0,k:"OPEN PRS",tone:"amber",title:h??void 0}):null,j.blocked>0?e.jsx(U,{v:j.blocked,k:"BLOCKED",tone:"coral",title:$}):null]})]}),e.jsxs("div",{className:"tbl-wrap",children:[e.jsxs("div",{className:"tbl-head",children:[e.jsx(V,{label:"REPO / BRANCH · WORKTREE",k:"name",sortKey:p,dir:m,onSort:M}),e.jsx(V,{label:"CHURN",k:"churn",sortKey:p,dir:m,onSort:M,align:"r"}),e.jsx(V,{label:"FILES",k:"files",sortKey:p,dir:m,onSort:M,align:"c"}),e.jsx(V,{label:"DRIFT",k:"drift",sortKey:p,dir:m,onSort:M,align:"c"}),e.jsx(V,{label:"ATTACHED",k:"attached",sortKey:p,dir:m,onSort:M})]}),A?e.jsx("div",{className:"rw-empty",children:"No repositories discovered yet."}):P.map(x=>x.length>1?e.jsx(Cs,{group:x,selectedId:t,onSelect:r,onViewDiff:n},x[0].project.id):e.jsx(ie,{row:x[0],top:!0,selected:t===x[0].wt.id,onSelect:()=>r(x[0].wt.id),onViewDiff:n},x[0].wt.id)),b&&g.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"tbl-head",style:{position:"static"},children:e.jsxs("span",{children:["CLEAN & IDLE · ",g.length]})}),g.map(x=>e.jsx(ie,{row:x,top:!0,clean:!0,selected:t===x.wt.id,onSelect:()=>r(x.wt.id),onViewDiff:n},x.wt.id))]}):null,e.jsx(Rs,{snapshot:s,scanDepth:a,scanMorePending:l,onScanMore:o})]})]})}function Rs({snapshot:s,scanDepth:t,scanMorePending:r,onScanMore:n}){const a=$s(s),l=vs(s.warnings),o=l.reduce((c,h)=>c+h.rawCount,0);return e.jsxs("div",{className:"scan-coverage",children:[e.jsxs("div",{className:"scan-coverage-row",children:[e.jsx("b",{children:"SCAN"}),e.jsx("span",{className:"scan-main",children:a.summary}),a.canScanMore&&t==="standard"?e.jsx("button",{type:"button",onClick:n,disabled:r,children:r?"Scanning":"Scan more"}):e.jsx("span",{className:"scan-chip",children:t==="expanded"?"expanded":"standard"})]}),l.length>0?e.jsxs("details",{className:"scan-details",children:[e.jsxs("summary",{children:[v(l.length)," diagnostic group",l.length===1?"":"s",o!==l.length?` (${v(o)} raw)`:""]}),e.jsx("ul",{children:l.map((c,h)=>e.jsxs("li",{children:[e.jsx("span",{children:c.message}),c.examples.length>0?e.jsx("span",{className:"scan-detail-examples",children:c.examples.join(" · ")}):null]},`${h}:${c.message}`))})]}):null]})}function $s(s){let t=null,r=0,n=0,a=0,l=0,o=0,c=0;for(const p of s.warnings){const u=/limited discovery to (\d+) repositories/i.exec(p);if(u){t=`discovery capped at ${u[1]}`;continue}if(/limited .* to \d+ worktrees/i.test(p)){r++;continue}if(/skipped unreadable worktree/i.test(p)){n++;continue}if(/skipped missing repo-watch path/i.test(p)){a++;continue}if(/scan budget|stopped discovery|stopped scanning/i.test(p)){l++;continue}if(/could not resolve git common directory/i.test(p)){o++;continue}c++}const h=[`${v(s.totals.projects)} repo${s.totals.projects===1?"":"s"}`,`${v(s.totals.worktrees)} worktree${s.totals.worktrees===1?"":"s"}`];return t&&h.push(t),r&&h.push(`${v(r)} repo${r===1?"":"s"} at worktree cap`),n&&h.push(`${v(n)} unreadable worktree${n===1?"":"s"} skipped`),a&&h.push(`${v(a)} missing path${a===1?"":"s"}`),o&&h.push(`${v(o)} unresolved git dir${o===1?"":"s"}`),l&&h.push("scan budget reached"),c&&h.push(`${v(c)} other diagnostic${c===1?"":"s"}`),{summary:h.join(" · "),canScanMore:t!==null||r>0||l>0}}function Cs({group:s,selectedId:t,onSelect:r,onViewDiff:n}){const a=s[0].project,l=s.some(p=>p.state==="error"),o=s.reduce((p,u)=>p+u.add,0),c=s.reduce((p,u)=>p+u.del,0),h=s.reduce((p,u)=>p+(u.live?1:0),0);return e.jsxs("div",{children:[e.jsxs("div",{className:"repo-grp"+(l?" attn":""),children:[e.jsxs("div",{className:"rg-name",children:[e.jsx("span",{className:"rg-tw","aria-hidden":!0,children:e.jsx("svg",{width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",style:{transform:"rotate(90deg)"},children:e.jsx("path",{d:"M3 2l4 3.5L3 9",stroke:"currentColor",strokeWidth:"1.3",fill:"none"})})}),e.jsx("span",{className:"dot "+Ts(s)}),e.jsx("span",{className:"rg-nm",children:a.name}),e.jsx("span",{className:"rg-path",children:Me(a.root,3)}),e.jsxs("span",{className:"rg-badge",children:[a.worktrees.length," worktrees"]})]}),e.jsx("div",{className:"rg-agg",children:o||c?e.jsxs("span",{children:[e.jsxs("span",{style:{color:"var(--mint-dim)"},children:["+",v(o)]})," ",e.jsxs("span",{style:{color:"var(--coral-dim)"},children:["−",v(c)]})]}):"—"}),e.jsx("div",{}),e.jsx("div",{}),e.jsx("div",{className:"rg-agg",style:{textAlign:"left"},children:h?`${h} working`:""})]}),s.map((p,u)=>e.jsx(ie,{row:p,guide:!0,last:u===s.length-1,selected:t===p.wt.id,onSelect:()=>r(p.wt.id),onViewDiff:n},p.wt.id))]})}function ie({row:s,top:t,guide:r,last:n,clean:a,selected:l,onSelect:o,onViewDiff:c}){const{wt:h,project:p}=s,u=h.branch,m=Ee(h),N=!!c&&(s.files>0||m.has||h.branch.ahead>0);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:["wt",l?"sel":"",s.state==="error"?"attn":""].join(" "),style:t&&!a?{borderTop:"1px solid var(--line)"}:void 0,onClick:o,role:"button",tabIndex:0,onKeyDown:o?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),o())}:void 0,children:[e.jsxs("div",{className:"wt-name",children:[r?e.jsx("span",{className:"tw-guide"+(n?" last":"")}):null,e.jsxs("div",{className:"inner",children:[e.jsx("span",{className:"dot "+s.state}),e.jsxs("span",{className:"br",children:[t&&!r?e.jsxs("span",{className:"lead",children:[p.name," "]}):null,e.jsx(Te,{branch:h.branch,fallback:h.name})]}),e.jsx(Ms,{wt:h})]})]}),e.jsx(Es,{add:s.add,del:s.del}),e.jsx("div",{className:"files",children:s.files>0?e.jsxs("span",{children:[s.files,h.status.conflicts>0?e.jsxs("span",{className:"conf",children:[" ⚠",h.status.conflicts]}):null]}):e.jsx("span",{className:"dash",children:"—"})}),e.jsx(Ps,{ahead:u.ahead,behind:u.behind}),e.jsxs("div",{className:"agents-cell",children:[e.jsx(Is,{row:s}),N?e.jsx("button",{type:"button",className:"wt-diff",title:`View diff · ${s.files} changed file${s.files===1?"":"s"}`,"aria-label":"View diff",onClick:b=>{b.stopPropagation(),c?.(h.path)},children:"diff"}):null]})]})})}function U({v:s,k:t,tone:r,title:n}){return e.jsxs("div",{className:"stat",title:n,"aria-label":n?`${v(s)} ${t}. ${n}`:void 0,children:[e.jsx("span",{className:"v"+(r?" "+r:""),children:v(s)}),e.jsx("span",{className:"k",children:t})]})}function V({label:s,k:t,sortKey:r,dir:n,onSort:a,align:l}){const o=r===t;return e.jsx("div",{className:l==="r"?"r":l==="c"?"c":"",children:e.jsxs("button",{type:"button",className:o?"on":"",onClick:()=>a(t),children:[e.jsx("span",{children:s}),e.jsx("span",{className:"caret","aria-hidden":!0,children:n==="asc"?"▲":"▼"})]})})}function Es({add:s,del:t}){if(!s&&!t)return e.jsx("div",{className:"churn",children:e.jsx("span",{className:"dash",children:"—"})});const r=s+t||1;return e.jsxs("div",{className:"churn",children:[e.jsxs("span",{className:"nums",children:[e.jsxs("span",{className:"add",children:["+",v(s)]}),e.jsx("span",{className:"sl",children:"/"}),e.jsxs("span",{className:"del",children:["−",v(t)]})]}),e.jsxs("span",{className:"cbar",title:`+${v(s)} −${v(t)}`,children:[e.jsx("span",{className:"g",style:{width:s/r*100+"%"}}),e.jsx("span",{className:"r",style:{width:t/r*100+"%"}})]})]})}function Ps({ahead:s,behind:t}){return!s&&!t?e.jsx("div",{className:"drift",children:e.jsx("span",{className:"dash",children:"—"})}):e.jsxs("div",{className:"drift",children:[s?e.jsxs("span",{className:"dp ahead",children:["↑",s]}):null,t?e.jsxs("span",{className:"dp behind",children:["↓",t]}):null]})}const As=2;function Is({row:s}){const t=s.agentsUnique,r=s.wt.sessions,n=[...t.map(o=>`${X(o)} (${o.state??"—"})`),...r.map(o=>`session ${Ge(o)}`)].join(`
|
|
4
4
|
`);if(t.length===0)return e.jsx("div",{className:"agents",title:n,children:r.length>0?e.jsxs("span",{className:"ahandle",children:[r.length," session",r.length===1?"":"s"]}):e.jsx("span",{className:"dash",children:"—"})});const a=t.slice(0,As),l=t.length-a.length;return e.jsxs("div",{className:"agents",title:n,children:[s.live>0?e.jsxs("span",{className:"alive",children:[e.jsx("span",{className:"d"}),s.live]}):null,e.jsx("span",{className:"ahandle",children:a.map(o=>X(o)).join(" ")}),l>0?e.jsxs("span",{className:"amore",children:["+",l]}):null]})}function Ms({wt:s}){const t=[];return s.branch.detached?t.push({label:"DETACHED",cls:""}):s.branch.upstream||t.push({label:"LOCAL",cls:""}),s.error!=null&&t.push({label:"SCAN ERR",cls:"err"}),s.isBare&&t.push({label:"BARE",cls:""}),e.jsx(e.Fragment,{children:t.map(r=>e.jsx("span",{className:"tag "+r.cls,children:r.label},r.label))})}const ve={error:3,live:2,dirty:1,clean:0};function Ts(s){return s.reduce((t,r)=>ve[r.state]>ve[t]?r.state:t,"clean")}function Ds(s,t,r){const n=r==="asc"?1:-1,a=u=>{switch(t){case"attention":return-G(u.wt.attention);case"churn":return u.churn;case"files":return u.files;case"drift":return u.wt.branch.ahead+u.wt.branch.behind;case"attached":return u.live*1e6+u.agentsUnique.length*1e3+u.wt.sessions.length;default:return 0}},l=new Map;for(const u of s){const m=l.get(u.project.id);m?m.push(u):l.set(u.project.id,[u])}const o=(u,m)=>{if(t==="name")return ze(u,m,n);const N=(a(u)-a(m))*n;if(N!==0)return N;const b=G(u.wt.attention)-G(m.wt.attention);return b!==0?b:u.wt.path.localeCompare(m.wt.path)},c=u=>u.reduce((m,N)=>Math.max(m,a(N)),-1/0),h=[...l.values()].sort((u,m)=>{if(t==="name")return u[0].project.name.localeCompare(m[0].project.name)*n;const N=(c(u)-c(m))*n;return N!==0?N:u[0].project.name.localeCompare(m[0].project.name)}),p=[];for(const u of h)p.push(...[...u].sort(o));return p}const J=8;function Ne(s){if(s.error!=null)return 0;const{ahead:t,behind:r}=s.branch;return t>0&&r>0?1:r>0||t>0?2:3}function Ls(s){const t=(s.name??"").trim();if(t){const a=t.split(/[\s_\-/]+/).filter(Boolean);if(a.length>=2)return(a[0][0]+a[1][0]).toUpperCase();if(a.length===1)return a[0].slice(0,2).toUpperCase()}return(X(s).replace(/^@/,"").replace(/[^a-z0-9]/gi,"").slice(0,2)||"··").toUpperCase()}function Os({snapshot:s,selectedId:t,onSelect:r}){return e.jsxs("section",{className:"bd",children:[e.jsx("div",{className:"bd-head",children:"BRANCH DRIFT — distance from each worktree's base · behind ← origin → ahead · flags call out what needs a rebase"}),e.jsxs("div",{className:"bd-axis",children:[e.jsx("div",{}),e.jsxs("div",{className:"bd-axis-track",children:[e.jsx("span",{className:"bd-axis-lbl",style:{left:"0%"},children:"−8"}),e.jsx("span",{className:"bd-axis-lbl",style:{left:"25%"},children:"−4"}),e.jsx("span",{className:"bd-axis-lbl bd-origin-lbl",style:{left:"50%"},children:"origin"}),e.jsx("span",{className:"bd-axis-lbl",style:{left:"75%"},children:"+4"}),e.jsx("span",{className:"bd-axis-lbl",style:{left:"100%"},children:"+8"}),e.jsx("span",{className:"bd-axis-cap",children:"COMMITS ←"})]}),e.jsx("div",{}),e.jsx("div",{}),e.jsx("div",{})]}),s.projects.map(n=>e.jsx(Ws,{project:n,selectedId:t,onSelect:r},n.id))]})}function Ws({project:s,selectedId:t,onSelect:r}){const n=[...s.worktrees].sort((a,l)=>Ne(a)-Ne(l));return e.jsxs("div",{className:"bd-grp",children:[e.jsxs("div",{className:"bd-grp-h",children:[e.jsx("span",{className:"bd-grp-nm",children:s.name}),e.jsx("span",{className:"bd-grp-path",children:Me(s.root,3)})]}),n.map(a=>e.jsx(Fs,{wt:a,selected:t===a.id,onSelect:()=>r(a.id)},a.id))]})}function Fs({wt:s,selected:t,onSelect:r}){const n=Ie(s),{ahead:a,behind:l}=s.branch,o=s.error!=null,c=Ae(s);return e.jsxs("div",{className:["bd-row",t?"sel":""].join(" "),role:"button",tabIndex:0,onClick:r,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),r())},children:[e.jsxs("div",{className:"bd-id",children:[e.jsx("span",{className:"dot "+n}),e.jsx("span",{className:"bd-br",children:e.jsx(Te,{branch:s.branch,fallback:s.name})})]}),e.jsx(qs,{ahead:a,behind:l,hasError:o}),e.jsx(_s,{wt:s,hasError:o}),e.jsx(Hs,{agents:c}),e.jsx(Us,{ahead:a,behind:l,hasError:o})]})}function qs({ahead:s,behind:t,hasError:r}){const n=s===0&&t===0;return e.jsxs("div",{className:"bd-track",children:[e.jsx("span",{className:"bd-tick",style:{left:"0%"}}),e.jsx("span",{className:"bd-tick",style:{left:"25%"}}),e.jsx("span",{className:"bd-tick bd-tick-origin",style:{left:"50%"}}),e.jsx("span",{className:"bd-tick",style:{left:"75%"}}),e.jsx("span",{className:"bd-tick",style:{left:"100%"}}),r||n?e.jsx("span",{className:"bd-origin-ring"}):e.jsxs(e.Fragment,{children:[t>0?e.jsxs("span",{className:"bd-bar bd-behind",style:{right:"50%",width:Math.min(t,J)/J*50+"%"},children:[e.jsx("span",{className:"bd-cap bd-cap-l"}),e.jsxs("span",{className:"bd-lbl bd-lbl-l",children:["↓",t]})]}):null,s>0?e.jsxs("span",{className:"bd-bar bd-ahead",style:{left:"50%",width:Math.min(s,J)/J*50+"%"},children:[e.jsx("span",{className:"bd-cap bd-cap-r"}),e.jsxs("span",{className:"bd-lbl bd-lbl-r",children:["↑",s]})]}):null]})]})}function _s({wt:s,hasError:t}){const{add:r,del:n,has:a}=Pe(s);if(t||!a)return e.jsx("div",{className:"bd-churn",children:e.jsx("span",{className:"dash",children:"—"})});const l=r+n||1;return e.jsxs("div",{className:"bd-churn",children:[e.jsxs("span",{className:"bd-churn-nums",children:[e.jsxs("span",{className:"add",children:["+",v(r)]}),e.jsx("span",{className:"sl",children:"/"}),e.jsxs("span",{className:"del",children:["−",v(n)]})]}),e.jsxs("span",{className:"bd-cbar",title:`+${v(r)} −${v(n)}`,children:[e.jsx("span",{className:"g",style:{width:r/l*100+"%"}}),e.jsx("span",{className:"r",style:{width:n/l*100+"%"}})]})]})}const Bs=2;function Hs({agents:s}){if(s.length===0)return e.jsx("div",{className:"bd-agents",children:e.jsx("span",{className:"dash",children:"—"})});const t=s.slice(0,Bs),r=s.length-t.length;return e.jsxs("div",{className:"bd-agents",title:s.map(n=>`${X(n)} (${n.state??"—"})`).join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as d,j as t}from"./index-DvLtl7rV.js";import{a as Jt,f as gs,g as xs,d as vs,p as ks,h as bs,i as js}from"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";const Ae=1,ct="scout:surface-push";class Ss{constructor(n,s,a=ys()){this.surface=n,this.currentScope=s,this.handler=a}surface;currentScope;handler;bootstrap(){return this.request("bootstrap",{})}agents={list:n=>this.request("agents.list",{},n),observe:(n,s)=>this.request("agents.observe",{agentIds:s},n)};tail={recent:(n,s)=>this.request("tail.recent",{...s?{cursor:s}:{}},n),subscribe:(n,s)=>{const a=Qt("tail.delta",s);return this.request("tail.subscribe",{},n).catch(()=>a()),a}};codex={startSession:n=>this.request("codex.session.start",{route:n}),snapshot:n=>this.request("codex.thread.snapshot",{route:n}),connect:n=>this.request("codex.thread.connect",{route:n}),start:(n,s)=>this.request("codex.turn.start",{route:n,text:s}),steer:(n,s)=>this.request("codex.turn.steer",{route:n,text:s}),interrupt:n=>this.request("codex.turn.interrupt",{route:n})};dispatch={diagnostics:(n,s)=>this.request("dispatch.diagnostics",{...s?{cursor:s}:{}},n),ask:n=>this.request("dispatch.ask",n),review:n=>this.request("dispatch.review",n),subscribe:(n,s)=>{const a=Qt("dispatch.delta",s);return this.request("dispatch.subscribe",{},n).catch(()=>a()),a}};native={setLaneSelection:async n=>{await this.request("native.setLaneSelection",{selection:n})},openExternalURL:async n=>{await this.request("native.openExternalURL",{url:n})},getPreferences:n=>this.request("native.getPreferences",{keys:n}),setPreferences:async n=>{await this.request("native.setPreferences",n)},cancel:async n=>{await this.request("native.cancel",{requestId:n})},voice:{snapshot:()=>this.request("native.voice.snapshot",{}),toggleInput:()=>this.request("native.voice.toggleInput",{}),speak:n=>this.request("native.voice.speak",{text:n}),stopOutput:()=>this.request("native.voice.stopOutput",{})}};selectedScope(){return this.currentScope()}async request(n,s,a){const r=_s(),l={v:Ae,id:r,surface:this.surface,method:n,params:s,...a?{hostIds:a.hostIds}:{}},u=await this.handler.postMessage(l);if(u.v!==Ae||u.id!==r||u.method!==n)throw new Error("Scout native surface returned a mismatched reply");if("error"in u)throw new Error(`${u.error.code}: ${u.error.message}`);return u.result}}function ys(){const e=window.webkit?.messageHandlers?.scoutSurface;if(!e)throw new Error("Scout native surface bridge is unavailable");return e}function _s(){return globalThis.crypto?.randomUUID?.()??`surface-${Date.now()}-${Math.random().toString(16).slice(2)}`}function Qt(e,n){const s=a=>{const r=a.detail;r?.stream!==e||!("payload"in r)||n({hostId:r.hostId,cursor:{epoch:r.epoch,sequence:r.sequence,connectionRevision:r.connectionRevision},...e==="tail.delta"?{events:r.payload.events}:{records:r.payload.records}})};return window.addEventListener(ct,s),()=>window.removeEventListener(ct,s)}function ms(){window.__scoutSurface={onPush(e){window.dispatchEvent(new CustomEvent(ct,{detail:e}))}}}const ws="/api/surfaces/deck",ln="scout.surface.preferences.v1";function Ns(e,n){return window.webkit?.messageHandlers?.scoutSurface?new Ss(e,n):new Is(e,n)}class Is{constructor(n,s,a=ws){this.surface=n,this.currentScope=s,this.endpoint=a}surface;currentScope;endpoint;pending=new Map;voice=new Cs;async bootstrap(){const n=await this.request("bootstrap",{});if(!this.voice.inputAvailable)return n;const s=new Set(n.capabilities);return s.add("native.voice.snapshot"),s.add("native.voice.toggleInput"),this.voice.outputAvailable&&(s.add("native.voice.speak"),s.add("native.voice.stopOutput")),{...n,capabilities:[...s],device:{platform:"web",formFactor:Ts()}}}agents={list:n=>this.request("agents.list",{},n),observe:(n,s)=>this.request("agents.observe",{agentIds:s},n)};tail={recent:(n,s)=>this.request("tail.recent",{...s?{cursor:s}:{}},n),subscribe:(n,s)=>{let a=new Set;const r=async()=>{try{const u=await this.tail.recent(n);for(const p of u.hosts){if(!p.ready)continue;const k=p.value.events.filter(y=>!a.has(y.id));a=new Set(p.value.events.map(y=>y.id)),k.length>0&&s({hostId:p.hostId,cursor:p.value.cursor,events:k})}}catch{}};r();const l=window.setInterval(()=>{r()},2e3);return()=>{window.clearInterval(l)}}};codex={startSession:n=>this.request("codex.session.start",{route:n}),snapshot:n=>this.request("codex.thread.snapshot",{route:n}),connect:n=>this.request("codex.thread.connect",{route:n}),start:(n,s)=>this.request("codex.turn.start",{route:n,text:s}),steer:(n,s)=>this.request("codex.turn.steer",{route:n,text:s}),interrupt:n=>this.request("codex.turn.interrupt",{route:n})};dispatch={diagnostics:()=>Promise.reject(new Error("Dispatch is unavailable on the Deck surface.")),ask:n=>Promise.reject(new Error("Dispatch is unavailable on the Deck surface.")),review:n=>Promise.reject(new Error("Dispatch is unavailable on the Deck surface.")),subscribe:(n,s)=>()=>{}};native={setLaneSelection:async n=>{await this.request("native.setLaneSelection",{selection:n})},openExternalURL:async n=>{const s=new URL(n);if(s.protocol!=="https:")throw new Error("Only https URLs can be opened from the Deck.");window.open(s,"_blank","noopener,noreferrer")},getPreferences:async n=>({entries:Zt().filter(a=>n.includes(a.key))}),setPreferences:async n=>{const s=new Map(Zt().map(a=>[a.key,a]));for(const a of n.entries)s.set(a.key,a);localStorage.setItem(ln,JSON.stringify([...s.values()]))},cancel:async n=>{this.pending.get(n)?.abort(),this.pending.delete(n)},voice:{snapshot:()=>Promise.resolve(this.voice.snapshot()),toggleInput:()=>this.voice.toggleInput(),speak:n=>this.voice.speak(n),stopOutput:()=>this.voice.stopOutput()}};selectedScope(){return this.currentScope()}async request(n,s,a){if(this.surface!=="deck")throw new Error("The web surface transport currently supports Scout Deck only.");const r=As(),l=new AbortController;this.pending.set(r,l);const u={v:Ae,id:r,surface:this.surface,method:n,params:s,...a?{hostIds:a.hostIds}:{}};try{const p=await fetch(this.endpoint,{method:"POST",credentials:"same-origin",cache:"no-store",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(u),signal:l.signal});if(!p.ok){const y=await p.json().catch(()=>null);throw new Error(y?.error||`Scout Deck web bridge returned HTTP ${p.status}.`)}const k=await p.json();if(k.v!==Ae||k.id!==r||k.method!==n)throw new Error("Scout Deck web bridge returned a mismatched reply.");if("error"in k)throw new Error(`${k.error.code}: ${k.error.message}`);return k.result}finally{this.pending.delete(r)}}}class Cs{live=null;inputRun=0;state={input:{state:"idle",partialText:"",finalText:"",finalCount:0,engine:"parakeet",modelReady:!0,unavailableReason:null},output:{speaking:!1}};get inputAvailable(){return typeof fetch=="function"}get outputAvailable(){return"speechSynthesis"in window&&"SpeechSynthesisUtterance"in window}snapshot(){return{input:{...this.state.input},output:{...this.state.output}}}async toggleInput(){if(this.state.input.state==="listening"){const n=this.live;if(this.state={...this.state,input:{...this.state.input,state:"transcribing"}},n)try{await n.stop()}catch(s){this.failInput(s,this.inputRun)}return this.snapshot()}if(this.state.input.state==="preparing"||this.state.input.state==="transcribing"){const n=this.live;return this.inputRun+=1,this.live=null,await n?.cancel().catch(()=>{}),this.state={...this.state,input:{...this.state.input,state:"idle",partialText:"",unavailableReason:null}},this.snapshot()}return this.stopOutput(),this.startInput(),this.snapshot()}async speak(n){const s=n.trim();if(!s||!this.outputAvailable)return this.snapshot();window.speechSynthesis.cancel();const a=new SpeechSynthesisUtterance(s);return a.onstart=()=>{this.state={...this.state,output:{speaking:!0}}},a.onend=a.onerror=()=>{this.state={...this.state,output:{speaking:!1}}},window.speechSynthesis.speak(a),this.state={...this.state,output:{speaking:!0}},this.snapshot()}async stopOutput(){return this.outputAvailable&&window.speechSynthesis.cancel(),this.state={...this.state,output:{speaking:!1}},this.snapshot()}async startInput(){const n=++this.inputRun;this.state={...this.state,input:{...this.state.input,state:"preparing",partialText:"",unavailableReason:null}};try{let s=await Jt({surface:"scout-deck",requestPermissions:!0});if(n!==this.inputRun)return;if(!s.ready&&s.issue?.code==="microphone_not_requested"){if(await Es(1800),n!==this.inputRun)return;s=await Jt({surface:"scout-deck"})}if(!(s.ready||s.issue?.code==="microphone_not_requested")){this.state={...this.state,input:{...this.state.input,state:"unavailable",engine:s.settings.preference==="apple"?"apple":"parakeet",modelReady:!!s.settings.modelReady,unavailableReason:gs(s.issue)}};return}const r=xs();if(await r.probe({force:!0}).catch(()=>!1),n!==this.inputRun)return;const l=await r.startLive({onState:u=>this.applyInputState(u,n),onPartial:u=>{n===this.inputRun&&(this.state={...this.state,input:{...this.state.input,partialText:u}})}},{surface:"scout-deck"});if(n!==this.inputRun){await l.cancel().catch(()=>{});return}this.live=l,this.state={...this.state,input:{...this.state.input,state:"listening",engine:s.settings.preference==="apple"?"apple":"parakeet",modelReady:!!s.settings.modelReady,unavailableReason:null}},l.result.then(u=>this.finishInput(u.text,n)).catch(u=>this.failInput(u,n))}catch(s){this.failInput(s,n)}}applyInputState(n,s){if(s!==this.inputRun)return;const a=n==="recording"?"listening":n==="processing"||n==="done"?"transcribing":n==="cancelled"?"idle":n==="error"?"unavailable":"preparing";this.state={...this.state,input:{...this.state.input,state:a}}}finishInput(n,s){if(s!==this.inputRun)return;this.live=null;const a=n.trim();this.state={...this.state,input:{...this.state.input,state:a?"idle":"unavailable",partialText:"",finalText:a||this.state.input.finalText,finalCount:a?this.state.input.finalCount+1:this.state.input.finalCount,unavailableReason:a?null:"No speech was detected. Tap to try again."}}}failInput(n,s){if(s!==this.inputRun)return;this.live=null;const a=n instanceof Error?n.message:String(n),r=n instanceof Error&&n.name==="AbortError";this.state={...this.state,input:{...this.state.input,state:r?"idle":"unavailable",partialText:"",unavailableReason:r?null:a}}}}function Zt(){try{const e=JSON.parse(localStorage.getItem(ln)??"[]");return Array.isArray(e)?e:[]}catch{return[]}}function Ts(){const e=Math.min(window.screen.width,window.screen.height);return/iPad/i.test(navigator.userAgent)?"ipad":/Mobi|iPhone|Android/i.test(navigator.userAgent)&&e<700?"phone":e<1100?"tablet":"desktop"}function Es(e){return new Promise(n=>window.setTimeout(n,e))}function As(){return globalThis.crypto?.randomUUID?.()??`surface-${Date.now()}-${Math.random().toString(16).slice(2)}`}function st(e,n){const s=e.find(a=>a.key===n);return s?[s,...e.filter(a=>a.key!==n)]:[...e]}async function Rs(e,n){const s=e.filter(l=>l.transport==="codex_app_server"),r=(await Promise.allSettled(s.map(async l=>({lane:l,snapshot:await n({hostId:l.hostId,agentId:l.id})})))).flatMap(l=>l.status==="fulfilled"?[l.value]:[]);return r.find(({snapshot:l})=>l.state==="running")?.lane.key??r.find(({snapshot:l})=>l.state==="idle")?.lane.key??null}const dn=["ops","yoke","console","brief"],ot={ops:{label:"Ops",tagline:"Agent operations · routed control"},yoke:{label:"Yoke",tagline:"Two-grip cockpit · thumb-anchored"},console:{label:"Console",tagline:"Fleet board · one command bar"},brief:{label:"Brief",tagline:"Single column · command palette"}},Os=9e3,en="scout.deck.hostScope",ce="scout.deck.lane.v1",un="scout.deck.treatment.v2",tn="scout.deck.autoSend",nn="scout.deck.voiceOut",at="scout.deck.voiceModel",Te="scout.deck.voiceId",sn="scout.deck.voiceSpeed",ne="gpt-4o-mini-tts",pn="alloy",Ls=1,an=44,Ds=160,Ms=[{id:"air",name:"MacBook Air",state:"connected"},{id:"studio",name:"Studio",state:"connected"}],se=Date.now(),Se=[Ee("air","MacBook Air","01","OpenScout","codex","gpt-5.6","active","~/dev/openscout",[["tool","Verifying the native surface bundle","bun run build:native-surfaces"],["think","Mapping Deck to Scout's Codex session","Session state stays binary-native and host-scoped."],["message","Controller contract is live.","Start, steer, and interrupt map directly to the selected thread."]]),Ee("studio","Studio","02","SpeakEasy","claude","opus-5","active","~/dev/SpeakEasy",[["message","Control deck reference review","Channel bank, focused stage, and restrained signal color."],["tool","Captured iPad landscape states","Connected, partial, and offline."],["think","Keep harness semantics explicit","A future Claude adapter can earn its own control vocabulary."]]),Ee("air","MacBook Air","03","Hudson","claude","sonnet-5","waiting","~/dev/hudson",[["message","Waiting for operator review","One navigation decision needs attention."],["note","Candidate build is ready","No active tool call."]]),Ee("studio","Studio","04","Release","codex","gpt-5.4","idle","~/dev/openscout",[["system","Last run completed","Checks passed 18 minutes ago."]])],ae={adapter:"codex_app_server",agentId:"01",threadId:"019fa45a-scout-deck",turnId:"turn_8d17",state:"running",capabilities:{connect:!0,start:!0,steer:!0,interrupt:!0,queue:!1,approvals:!1},capabilityNotes:{queue:"A Scout-managed Codex session runs one active turn at a time; Deck does not invent a client-side queue.",approvals:"Approval prompts remain runtime-owned and are not actionable from Deck yet."},snapshot:{session:{id:"019fa45a-scout-deck",name:"Rework the Deck turn flow",adapterType:"codex",status:"active",cwd:"/Users/arach/dev/openscout",model:"gpt-5.6",providerMeta:{threadId:"019fa45a-scout-deck"}},currentTurnId:"turn_8d17",turns:[{id:"turn_8d11",status:"completed",startedAt:se-214e3,endedAt:se-176e3,isUserTurn:!0,blocks:[{status:"completed",block:{id:"input_8d11",turnId:"turn_8d11",type:"text",status:"completed",index:0,text:"Make Deck operate on the selected Scout-managed Codex session directly."}}]},{id:"turn_8d15",status:"completed",startedAt:se-164e3,endedAt:se-71e3,isUserTurn:!1,blocks:[{status:"completed",block:{id:"reason_8d15",turnId:"turn_8d15",type:"reasoning",status:"completed",index:0,text:"Tracing the trusted bridge to Scout's broker-managed Codex session."}},{status:"completed",block:{id:"tool_8d15",turnId:"turn_8d15",type:"action",status:"completed",index:1,action:{kind:"command",status:"completed",command:"bun run build:native-surfaces",output:"native surfaces validated"}}},{status:"completed",block:{id:"text_8d15",turnId:"turn_8d15",type:"text",status:"completed",index:2,text:"The control path is separated from Scout messaging and keeps Codex semantics visible."}}]},{id:"turn_8d17",status:"streaming",startedAt:se-43e3,isUserTurn:!1,blocks:[{status:"streaming",block:{id:"reason_8d17",turnId:"turn_8d17",type:"reasoning",status:"streaming",index:0,text:"Refining the controller hierarchy for iPad landscape."}},{status:"streaming",block:{id:"tool_8d17",turnId:"turn_8d17",type:"action",status:"streaming",index:1,action:{kind:"command",status:"running",command:"bun test scout-surface-contract",output:"running focused contract checks…"}}}]}]}},it={input:{state:"idle",partialText:"",finalText:"",finalCount:0,engine:"parakeet",modelReady:!0,unavailableReason:null},output:{speaking:!1}},rt={defaultModelId:ne,defaultVoiceId:pn,source:"fallback",models:[{id:ne,name:"GPT-4o mini TTS",provider:"openai",available:!0},{id:"eleven_multilingual_v2",name:"Eleven Multilingual v2",provider:"elevenlabs",available:!0},{id:"magpie-tts-multilingual",name:"Magpie TTS Multilingual",provider:"nvidia",available:!0}],voices:[{id:"alloy",name:"Alloy",provider:"openai",modelId:ne,available:!0,isDefault:!0},{id:"coral",name:"Coral",provider:"openai",modelId:ne,available:!0,isDefault:!1},{id:"fable",name:"Fable",provider:"openai",modelId:ne,available:!0,isDefault:!1},{id:"nova",name:"Nova",provider:"openai",modelId:ne,available:!0,isDefault:!1},{id:"9BWtsMINqrJLrRacOk9x",name:"Aria",provider:"elevenlabs",modelId:"eleven_multilingual_v2",available:!0,isDefault:!0},{id:"Magpie-Multilingual.EN-US.Aria",name:"Aria",language:"en-US",provider:"nvidia",modelId:"magpie-tts-multilingual",available:!0,isDefault:!0}]};function $s(e){const n=e.get("treatment");if(rn(n))return n;const s=localStorage.getItem(un);return rn(s)?s:"ops"}function rn(e){return e!=null&&dn.includes(e)}function Ps(e){const n=Number(e.get("lane"));return Number.isInteger(n)?Math.min(Math.max(n-1,0),Se.length-1):0}function Vs(){const e=new URLSearchParams(window.location.search),n=e.get("preview")==="1",s=e.get("agent")?.trim()||null,a=n&&e.get("voice")==="listening"?{...it,input:{...it.input,state:"listening",partialText:"Make voice the fastest path into this active turn."}}:it,[r,l]=d.useState(()=>window.__scoutSurfaceBootstrap??null),[u,p]=d.useState(()=>$s(e)),[k,y]=d.useState(n?Se:[]),[m,U]=d.useState("all"),[T,f]=d.useState(n?Se[Ps(e)]?.key??Se[0]?.key??null:localStorage.getItem(ce)),[c,x]=d.useState(n?"ready":"waiting"),[X,Ue]=d.useState(null),[w,R]=d.useState(n?ae:null),[H,K]=d.useState(!1),[_t,E]=d.useState(null),[he,wn]=d.useState(null),[fe,ge]=d.useState(""),[Nn,O]=d.useState(null),[J,V]=d.useState(null),[mt,He]=d.useState(()=>Date.now()),[In,Ke]=d.useState("thread"),[S,A]=d.useState(a),[wt,Cn]=d.useState(n),[_e,Tn]=d.useState(()=>localStorage.getItem(nn)!=="off"),[En,Nt]=d.useState(n?rt:null),[Q,It]=d.useState(()=>localStorage.getItem(at)||ne),[me,Fe]=d.useState(()=>localStorage.getItem(Te)||pn),[We,An]=d.useState(()=>{const i=Number(localStorage.getItem(sn));return Number.isFinite(i)&&i>=.5&&i<=2?i:Ls}),[Ct,Z]=d.useState("idle"),[Rn,On]=d.useState(null),[Ge,Ln]=d.useState(()=>localStorage.getItem(tn)!=="off"),[Dn,M]=d.useState(null),[Mn,Tt]=d.useState(n&&e.get("audio")==="open"),[$n,Et]=d.useState(()=>Array.from({length:an},()=>0)),_=d.useRef(null),At=d.useRef(s),F=d.useRef(T),Ye=d.useRef(!1),Rt=d.useRef(!1),we=d.useRef(n?0:null),ie=d.useRef(null),I=d.useRef(null),B=d.useRef(null),Ot=d.useRef(null),re=d.useRef(!1),ze=d.useRef(null),Lt=d.useRef(async()=>{}),Xe=d.useRef(S);Xe.current=S,F.current=T;const xe=i=>{Ot.current=i,wn(i)};d.useEffect(()=>{if(ms(),n)return;const i=Ns("deck",()=>({hostIds:window.__scoutSurfaceBootstrap?.selectedHostIds??[]}));_.current=i;let o=!1,h=null,j=!1;return i.bootstrap().then(async g=>{if(o)return;window.__scoutSurfaceBootstrap=g,l(g);const b=g.selectedHostIds;if(b.length===0){x("offline"),y([]);return}const te=new Set(g.hosts.filter(P=>P.state==="connected").map(P=>P.id)),Ce=localStorage.getItem(en),ps=Ce==="all"||Ce&&te.has(Ce)?Ce:g.focusedHostId&&te.has(g.focusedHostId)?g.focusedHostId:b[0]??"all";U(ps);const Gt={hostIds:b},Yt=async()=>{if(!j){j=!0;try{const[P,zt]=await Promise.all([i.agents.list(Gt),i.tail.recent(Gt)]);if(o)return;const W=Bs(g.hosts,P,zt),nt=Ot.current,ke=nt?.receipt?W.find(D=>D.hostId===nt.receipt?.hostId&&D.id===nt.receipt?.agentId):null;if(ke){const D=st(W,ke.key);y(D),f(ke.key),F.current=ke.key,Ye.current=!0,localStorage.setItem(ce,ke.key),Ke("thread"),xe(null)}else{const D=At.current;At.current=null;const Xt=(D?W.find(q=>q.id===D):null)?.key??F.current??localStorage.getItem(ce),be=Xt?W.find(q=>q.key===Xt):null;if(be){const q=st(W,be.key);y(q),f(be.key),F.current=be.key,localStorage.setItem(ce,be.key)}else y(W),f(null),F.current=null,Rt.current||(Rt.current=!0,Rs(W,q=>i.codex.connect(q)).then(q=>{if(o||Ye.current)return;const je=q??W[0]?.key??null;je&&(y(fs=>st(fs,je)),f(je),F.current=je,localStorage.setItem(ce,je))}))}const hs=P.hosts.filter(D=>!D.ready).length+zt.hosts.filter(D=>!D.ready).length;Ue(null),x(hs>0?"partial":"ready")}catch(P){if(o)return;Ue(P instanceof Error?P.message:String(P)),x("partial")}finally{j=!1}}};await Yt(),o||(h=setInterval(()=>{Yt()},3e3))}).catch(g=>{o||(Ue(g instanceof Error?g.message:String(g)),x("error"))}),()=>{o=!0,h&&clearInterval(h),_.current=null}},[n]);const Pn=n?Ms:r?.hosts??[],$=m==="all"?k:k.filter(i=>i.hostId===m),v=$.find(i=>i.key===T)??null,Je=v?$.indexOf(v):-1,C=v?{hostId:v.hostId,agentId:v.id}:null,L=!!(v?.transport==="codex_app_server"&&(n||r?.capabilities?.includes("codex.thread.snapshot"))),ve=n||!!r?.capabilities?.includes("native.voice.snapshot"),ee=n||r?.device?.platform==="web",Vn=ee||!!r?.capabilities?.includes("native.voice.speak");d.useEffect(()=>{if(!ee||n)return;let i=!1;return vs(Q).then(o=>{if(i)return;if(Nt(o),!o.models.find(b=>b.id===Q)?.available){const b=o.models.find(te=>te.id===o.defaultModelId&&te.available)??o.models.find(te=>te.available);if(b&&b.id!==Q){It(b.id),localStorage.setItem(at,b.id);return}}if(o.voices.find(b=>b.id===me&&b.available))return;const g=o.voices.find(b=>b.isDefault&&b.available)??o.voices.find(b=>b.available);g&&(Fe(g.id),localStorage.setItem(Te,g.id))}).catch(o=>{i||M(o instanceof Error?o.message:String(o))}),()=>{i=!0}},[ee,n,Q]),d.useEffect(()=>{if(!v){R(null);return}if(ge(""),E(null),O(null),V(null),re.current=!1,Ke(v.transport==="codex_app_server"?"thread":"signal"),ie.current=null,n){R(cn(v));return}const i=_.current;if(!i)return;R(null);let o=!1,h=null;return(async()=>{if(await i.native.setLaneSelection({hostId:v.hostId,agentId:v.id,...v.conversationId?{conversationId:v.conversationId}:{},...v.sessionId?{sessionId:v.sessionId}:{}}),o)return;if(!L){R(null);return}const j=async(g=!1)=>{try{let b=await i.codex.snapshot({hostId:v.hostId,agentId:v.id});if(g&&b.state==="disconnected"&&(V({kind:"connecting",at:Date.now()}),b=await i.codex.connect({hostId:v.hostId,agentId:v.id})),o)return;R(b),E(null)}catch(b){if(o)return;E(b instanceof Error?b.message:String(b))}};await j(!0),o||(h=setInterval(()=>{j()},2e3))})().catch(j=>{o||E(j instanceof Error?j.message:String(j))}),()=>{o=!0,h&&clearInterval(h)}},[v?.key,L,n]),d.useEffect(()=>{if(n||!ve)return;const i=_.current;if(!i)return;let o=!1;const h=async()=>{try{const g=await i.native.voice.snapshot();o||(A(g),Cn(!0),M(null))}catch(g){o||M(g instanceof Error?g.message:String(g))}};h();const j=setInterval(()=>{h()},320);return()=>{o=!0,clearInterval(j)}},[n,ve]),d.useEffect(()=>{if(!wt)return;const i=S.input.finalCount;if(we.current==null){we.current=i;return}if(i<=we.current)return;we.current=i;const o=S.input.finalText.trim(),h=re.current;if(re.current=!1,!o){h&&O("Nothing was transcribed — the turn was not sent.");return}const j=Xs(fe,o);ge(j),h&&Lt.current(j)},[S.input.finalCount,S.input.finalText,wt,fe]),d.useEffect(()=>{const i=Js(w);if(i){if(ie.current==null){ie.current=i.id;return}if(ie.current!==i.id){if(!_e){ie.current=i.id;return}if(!(S.input.state==="listening"||S.input.state==="transcribing")){if(ie.current=i.id,n){A(o=>({...o,output:{speaking:!0}})),I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{A(o=>({...o,output:{speaking:!1}}))},1600);return}if(ee){Ft(i.text);return}_.current?.native.voice.speak(i.text).then(A).catch(o=>M(o instanceof Error?o.message:String(o)))}}}},[w,S.input.state,_e,n,ee,Q,me,We]),d.useEffect(()=>()=>{I.current&&clearTimeout(I.current),B.current?.abort()},[]);const Bn=d.useMemo(()=>$.filter(i=>i.state==="waiting"||i.state==="blocked"||i.state==="error"),[$]),qn=$.filter(i=>ft(i.state)).length,Un=ta(v?.events??[]),Dt=S.input.state==="listening"||S.input.state==="transcribing";d.useEffect(()=>{if(S.input.state!=="listening"){Et(Array.from({length:an},()=>0));return}let i=Xe.current.input.partialText.length,o=.45;const h=setInterval(()=>{let j;if(n)o=Math.min(1,Math.max(.08,o+(Math.random()-.48)*.42)),j=o;else{const g=Xe.current.input.partialText.length;j=Math.min(1,Math.max(0,g-i)/5),i=g}Et(g=>[...g.slice(1),j])},Ds);return()=>clearInterval(h)},[S.input.state,n]);const Mt=J&&mt-J.at<Os?J:null,Ne=he?.sourceKey===v?.key?he:null,Qe=!!(Ne&&!Ne.error),Hn=Ne?.error??null,$t=!!Ne?.receipt,N=Hs({adapterAvailable:L,startingSession:Qe,thread:w,threadError:_t,pending:Mt}),Kn=Ks(N),Fn=Gs(w),Wn=!!(ve&&!H&&(N==="ready"||N==="running")),Gn=!!(L&&w&&w.state!=="disconnected"&&!H),Yn=!!(L&&(N==="running"||N==="stopping")),zn=!!(L&&(N==="cold"||N==="failed")),Xn=!!(L&&!H),Pt=!!(he&&!he.error),Vt=L||!v?null:Qe?$t?"Codex started; Scout is locating its lane.":"Scout is starting Codex for this workspace.":Pt?`Scout is finishing the Codex launch for ${he?.sourceName??"another workspace"}.`:v.projectRoot?c!=="ready"&&c!=="partial"?"Reconnect the Scout host to start Codex.":!n&&!r?.capabilities?.includes("codex.session.start")?"This Scout host cannot start Codex from Deck.":null:"Scout does not know this lane's workspace.",Bt=!!(!L&&v&&!Vt);d.useEffect(()=>{if(!J)return;(J.kind==="sending"?w?.state==="running":J.kind==="stopping"?w?.state==="idle":w?.state==="idle"||w?.state==="running")&&V(null)},[J,w?.state]);const qt=N==="running"||N==="sending"||N==="stopping"||N==="linking"||N==="starting"||Dt;d.useEffect(()=>{if(!qt)return;const i=setInterval(()=>He(Date.now()),1e3);return He(Date.now()),()=>clearInterval(i)},[qt]);const Jn=i=>{p(i),Tt(!1),localStorage.setItem(un,i)},Ze=i=>{Ye.current=!0,F.current=i.key,f(i.key),localStorage.setItem(ce,i.key)},Qn=i=>{if($.length===0)return;const h=((Je<0?0:Je)+i+$.length)%$.length,j=$[h];j&&Ze(j)},Zn=i=>{U(i),f(null),localStorage.setItem(en,i)},et=async()=>{n||!C||!_.current||R(await _.current.codex.snapshot(C))},es=async()=>{if(!(!C||H)){if(O(null),n){R(v?cn(v):null);return}K(!0);try{await et(),E(null)}catch(i){E(i instanceof Error?i.message:String(i))}finally{K(!1)}}},Ut=async()=>{if(!(!C||H)){K(!0),E(null),O(null),V({kind:"connecting",at:Date.now()});try{n?R({...ae,agentId:C.agentId,state:"idle",turnId:null}):_.current&&R(await _.current.codex.connect(C))}catch(i){V(null),E(i instanceof Error?i.message:String(i))}finally{K(!1)}}},Ht=async()=>{if(!C||!v||Pt||!Bt)return;const i={sourceKey:v.key,sourceName:v.name,receipt:null,error:null};xe(i),O(null);try{if(n){const g=Se.find(b=>b.transport==="codex_app_server");g&&Ze(g),xe(null);return}const o=_.current,h=r?.selectedHostIds;if(!o||!h?.length)throw new Error("No connected Scout host can start Codex.");const j=await o.codex.startSession(C);xe({...i,receipt:j})}catch(o){const h=o instanceof Error?o.message:String(o);xe({...i,error:h}),F.current===i.sourceKey&&O(h)}},Ie=async i=>{const o=i.trim();if(o){if(!C||!w){O("No Codex session is connected — the transcript is still in the composer.");return}if(H){O("A turn is already being sent — the transcript is still in the composer.");return}K(!0),E(null),O(null),V({kind:"sending",at:Date.now()});try{const h=w.state==="running"?"steer":"start";n?R(qs(w,o,h)):_.current&&(h==="steer"?await _.current.codex.steer(C,o):await _.current.codex.start(C,o),await new Promise(j=>setTimeout(j,180)),await et()),ge("")}catch(h){V(null),ge(o),E(h instanceof Error?h.message:String(h))}finally{K(!1)}}};Lt.current=Ie;const ts=i=>{i?.preventDefault(),Ie(fe)},ns=async()=>{if(!(!C||!w||H)){K(!0),E(null),O(null),V({kind:"stopping",at:Date.now()});try{n?R(Us(w)):_.current&&(await _.current.codex.interrupt(C),await new Promise(i=>setTimeout(i,180)),await et())}catch(i){V(null),E(i instanceof Error?i.message:String(i))}finally{K(!1)}}},Kt=async()=>{if(ve){if(M(null),O(null),S.input.state!=="listening"&&S.input.state!=="transcribing"&&(B.current?.abort(),B.current=null,Z("idle")),S.input.state==="listening"?(re.current=Ge,ze.current=null):S.input.state==="transcribing"?re.current=!1:(re.current=!1,ze.current=Date.now(),He(Date.now())),n){if(I.current&&clearTimeout(I.current),S.input.state==="listening"){const i=S.input.partialText||"Make the voice loop feel immediate and obvious.";A(o=>({...o,input:{...o.input,state:"transcribing",partialText:""},output:{speaking:!1}})),I.current=setTimeout(()=>{A(o=>({...o,input:{...o.input,state:"idle",finalText:i,finalCount:o.input.finalCount+1}}))},520)}else S.input.state==="transcribing"?A(i=>({...i,input:{...i.input,state:"idle",partialText:""}})):A(i=>({...i,input:{...i.input,state:"listening",partialText:"Make the voice loop feel immediate and obvious.",unavailableReason:null},output:{speaking:!1}}));return}try{const i=await _.current?.native.voice.toggleInput();i&&A(i)}catch(i){M(i instanceof Error?i.message:String(i))}}};async function Ft(i){B.current?.abort();const o=new AbortController;B.current=o,Z("preparing"),M(null);try{const h=await ks(i,{modelId:Q,voiceId:me,speed:We,originAppId:"openscout-deck",utteranceId:`deck-${Date.now()}`,signal:o.signal});if(o.signal.aborted)return;On({modelId:h.modelId,voiceId:h.voiceId}),Z("speaking"),await bs(h,{signal:o.signal})}catch(h){js(h)||M(h instanceof Error?h.message:String(h))}finally{B.current===o&&(B.current=null,Z("idle"))}}const Wt=async()=>{if(I.current&&clearTimeout(I.current),B.current?.abort(),B.current=null,Z("idle"),A(i=>({...i,output:{speaking:!1}})),!n)try{const i=await _.current?.native.voice.stopOutput();i&&A(i)}catch(i){M(i instanceof Error?i.message:String(i))}},ss=async()=>{const i=!_e;Tn(i),localStorage.setItem(nn,i?"on":"off"),i||await Wt()},as=i=>{if(It(i),Nt(o=>n||o?.defaultModelId===i?o:null),n){const o=rt.voices.find(h=>h.modelId===i&&h.isDefault)??rt.voices.find(h=>h.modelId===i);o&&(Fe(o.id),localStorage.setItem(Te,o.id))}localStorage.setItem(at,i)},is=i=>{Fe(i),localStorage.setItem(Te,i)},rs=i=>{const o=Math.min(2,Math.max(.5,i));An(o),localStorage.setItem(sn,String(o))},cs=()=>{if(n){Z("speaking"),I.current&&clearTimeout(I.current),I.current=setTimeout(()=>Z("idle"),1400);return}if(ee){Ft("Scout voice out is ready on this Deck.");return}_.current?.native.voice.speak("Scout voice out is ready on this Deck.").then(A).catch(i=>M(i instanceof Error?i.message:String(i)))},os=()=>{const i=!Ge;Ln(i),localStorage.setItem(tn,i?"on":"off")},ls=i=>{i.key==="Enter"&&(i.metaKey||i.ctrlKey)&&(i.preventDefault(),Ie(fe))},tt=L?N==="cold"||N==="failed"?"connect":"talk":"start_codex",ds=()=>{if(tt==="start_codex")return void Ht();if(tt==="connect")return void Ut();Kt()},us=Ct==="idle"?S:{...S,output:{speaking:!0}};return{preview:n,treatment:u,setTreatment:Jn,hosts:Pn,hostScope:m,selectHostScope:Zn,connection:c,error:X,lanes:k,scopedLanes:$,selected:v,selectedIndex:Je,selectLane:Ze,stepLane:Qn,attention:Bn,activeCount:qn,laneActivity:Un,thread:w,threadBusy:H,threadError:_t,sessionBusy:Qe,sessionError:Hn,sessionLaunchAccepted:$t,sessionStartUnavailableReason:Vt,notice:Nn,adapterAvailable:L,voiceAvailable:ve,phase:N,phaseTone:Kn,turnStartedAt:Fn,clock:mt,livePending:Mt,listeningSince:ze.current,canTalk:Wn,canCompose:Gn,canInterrupt:Yn,canRebind:zn,canRefresh:Xn,canStartCodexSession:Bt,primaryAction:tt,onPrimary:ds,command:fe,setCommand:ge,submitTurn:Ie,onComposerSubmit:ts,onComposerKeyDown:ls,connectThread:Ut,startCodexSession:Ht,refreshSnapshot:es,interruptThread:ns,voice:us,voiceError:Dn,voiceOutEnabled:_e,voiceOutputAvailable:Vn,cloudSpeechAvailable:ee,speechCatalog:En,speechModelId:Q,speechVoiceId:me,speechSpeed:We,speechOutputPhase:Ct,speechRoute:Rn,selectSpeechModel:as,selectSpeechVoice:is,selectSpeechSpeed:rs,previewSpeechVoice:cs,toggleVoiceInput:Kt,toggleVoiceOutput:ss,stopSpeaking:Wt,autoSendOnStop:Ge,toggleAutoSend:os,inputTrace:$n,voiceInputActive:Dt,settingsOpen:Mn,setSettingsOpen:Tt,view:In,setView:Ke}}function Bs(e,n,s){const a=new Map(e.map(l=>[l.id,l.name])),r=new Map;for(const l of s.hosts)if(l.ready)for(const u of l.value.events){if(!u.agentId)continue;const p=`${l.hostId}:${u.agentId}`;r.set(p,[...r.get(p)??[],u])}return n.hosts.flatMap(l=>l.ready?l.value.agents.map(u=>({...u,key:`${l.hostId}:${u.id}`,hostId:l.hostId,hostName:a.get(l.hostId)??l.hostId,events:(r.get(`${l.hostId}:${u.id}`)??[]).sort((p,k)=>k.at-p.at)})):[])}function Ee(e,n,s,a,r,l,u,p,k){return{key:`${e}:${s}`,hostId:e,hostName:n,id:s,name:a,handle:a.toLowerCase(),harness:r,transport:r==="codex"?"codex_app_server":"claude_stream_json",model:l,state:u,projectRoot:p,conversationId:`conversation-${s}`,sessionId:`session-${s}`,updatedAt:se-Number(s)*43e3,events:k.map(([y,m,U],T)=>({id:`${s}-${T}`,at:se-T*68e3-Number(s)*12e3,agentId:s,sessionId:`session-${s}`,kind:y,text:m,detail:U}))}}function cn(e){return e.transport!=="codex_app_server"?null:e.id==="04"?{...ae,agentId:e.id,threadId:"019fa45a-release",turnId:null,state:"idle",snapshot:ae.snapshot?{...ae.snapshot,currentTurnId:null,turns:ae.snapshot.turns.slice(0,2)}:null}:ae}function qs(e,n,s){const a=s==="steer"?e.turnId??`turn_${Date.now()}`:`turn_${Date.now()}`,r=e.snapshot;if(!r)return e;const l={id:`${s}_${Date.now()}`,turnId:a,type:s==="steer"?"reasoning":"text",status:"streaming",index:99,text:s==="steer"?`Steer received: ${n}`:n},u=s==="steer"?r.turns.map(p=>p.id===a?{...p,blocks:[...p.blocks,{status:"streaming",block:l}]}:p):[...r.turns,{id:a,status:"streaming",blocks:[{status:"streaming",block:l}],startedAt:Date.now(),isUserTurn:!0}];return{...e,state:"running",turnId:a,snapshot:{...r,currentTurnId:a,turns:u}}}function Us(e){if(!e.snapshot||!e.turnId)return{...e,state:"idle",turnId:null};const n=e.snapshot.turns.map(s=>s.id===e.turnId?{...s,status:"interrupted",endedAt:Date.now(),blocks:s.blocks.map(a=>({...a,status:"completed",block:{...a.block,status:a.block.status==="streaming"?"completed":a.block.status}}))}:s);return{...e,state:"idle",turnId:null,snapshot:{...e.snapshot,currentTurnId:null,turns:n}}}function Hs({adapterAvailable:e,startingSession:n,thread:s,threadError:a,pending:r}){return!e&&n?"starting":e?a?"failed":r?.kind==="sending"?"sending":r?.kind==="stopping"?"stopping":r?.kind==="connecting"||!s?"linking":s.state==="disconnected"?"cold":s.state==="running"?"running":"ready":"unavailable"}function Ks(e){return e==="running"||e==="sending"||e==="starting"?"live":e==="ready"?"ready":e==="cold"||e==="failed"?"attention":"quiet"}function pt(e,n){return e==="unavailable"?Y(n):e==="starting"?"Starting Codex":e==="cold"?"Session offline":e==="linking"?"Linking":e==="failed"?"Connection failed":e==="sending"?"Sending":e==="stopping"?"Stopping":e==="running"?"Turn running":"Ready"}function Fs(e,n,s,a,r,l=null){if(a)return a;if(e==="unavailable")return l??"Scout sees this lane · Codex not started";if(e==="starting")return l??"Scout is starting a Codex session for this workspace…";if(e==="failed")return s??"The host did not answer.";if(e==="cold")return"Connect restores Scout's managed Codex session.";if(e==="linking")return"Connecting to Scout's managed Codex session…";if(e==="sending")return"Waiting for Codex to accept the turn…";if(e==="stopping")return"Interrupt sent; waiting for the turn to end…";if(e==="running")return Ws(n);const u=Ys(n);return u?`Idle · last turn ended ${de(u)} ago`:"Idle · no turns yet in this session"}function Ws(e){const n=hn(e);if(!n)return"Streaming…";for(let s=n.blocks.length-1;s>=0;s-=1){const a=n.blocks[s];if(!(!a||a.status!=="streaming")){if(a.block.type==="action"){const r=a.block.action?.command??a.block.action?.toolName??a.block.action?.path;return r?`Running ${r}`:"Running an action"}if(a.block.type==="reasoning")return"Thinking";if(a.block.type==="text")return"Writing a reply"}}return"Streaming…"}function hn(e){return(e?.snapshot?.turns??[]).find(s=>s.id===e?.turnId)??null}function Gs(e){return hn(e)?.startedAt??null}function Ys(e){const n=e?.snapshot?.turns??[];for(let s=n.length-1;s>=0;s-=1){const a=n[s]?.endedAt;if(a)return a}return null}function zs(e){const{phase:n,turnStartedAt:s,livePending:a,clock:r}=e;return n==="sending"&&a?lt(r-a.at):(n==="running"||n==="stopping")&&s?lt(r-s):""}function lt(e){const n=Math.max(0,Math.floor(e/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function Xs(e,n){const s=n.trim();return s?e.trim()?`${e}${/\s$/.test(e)?"":" "}${s}`:s:e}function Js(e){const n=e?.snapshot?.turns??[];for(let s=n.length-1;s>=0;s-=1){const a=n[s];if(!(!a||a.isUserTurn||a.status!=="completed"))for(let r=a.blocks.length-1;r>=0;r-=1){const l=a.blocks[r],u=l?.block.type==="text"?Oe(l.block):"";if(l?.status==="completed"&&u)return{id:l.block.id,text:u}}}return null}function fn(e,n=9){return(e.snapshot?.turns??[]).flatMap(s=>s.blocks.map(a=>({role:s.isUserTurn?"operator":"codex",at:s.startedAt,status:a.status,block:a.block}))).filter(s=>!!Oe(s.block)).slice(-n)}function Oe(e){return e.type==="action"?e.action?.command??e.action?.toolName??e.action?.path??e.action?.agentName??"Codex action":e.text?.trim()||e.message?.trim()||""}function dt(e){return e.type!=="action"?"":e.action?.output?.trim()||(e.action?.kind?`${e.action.kind.replaceAll("_"," ")} · ${e.action.status}`:"")}function Qs(e){return e==="ready"?"Host connected":e==="partial"?"Host degraded":e==="error"?"Host unavailable":e==="offline"?"Host disconnected":"Connecting to host"}function pe(e){return e?e==="codex_app_server"?"Scout app-server":e:"transport unreported"}function Zs(e){return e?e==="codex_app_server"?"App server":e:"unreported"}function ht(e){const n=e?.snapshot?.session?.name?.trim();return n||null}function ea(e){return e==="ready"?"online":e==="partial"?"degraded":e==="error"?"error":e==="offline"?"offline":"connecting"}function le(e){return e.state==="waiting"||e.state==="blocked"||e.state==="error"?"attention":ft(e.state)?"live":"quiet"}function Y(e){return ft(e)?"Agent active":e==="waiting"||e==="blocked"?"Needs attention":e==="error"?"Agent error":e==="idle"||e==="available"?"Idle":e?e.replaceAll("_"," "):"Standing by"}function ft(e){return e==="live"||e==="working"||e==="active"||e==="running"||e==="in_flight"}function de(e){if(!e)return"—";const n=Math.max(0,Math.floor((Date.now()-e)/1e3));if(n<60)return`${n}s`;const s=Math.floor(n/60);return s<60?`${s}m`:`${Math.floor(s/60)}h`}function z(e){return e.length<=12?e:`${e.slice(0,5)}…${e.slice(-5)}`}function ta(e,n=28,s=5*6e4){const a=Date.now(),r=a-s,l=Array.from({length:n},()=>0);for(const u of e){if(u.at<r||u.at>a)continue;const p=Math.min(n-1,Math.floor((u.at-r)/s*n));l[p]+=u.kind==="message"||u.kind==="ask"?2:1}return l.map(u=>Math.min(6,u))}function na(e,n,s){return e==="start_codex"?n==="starting"?"starting":"start codex":e==="connect"?n==="failed"?"retry":"connect":s==="listening"?"send":s==="transcribing"?"…":s==="preparing"?"warming":s==="unavailable"?"voice off":n==="linking"?"linking":n==="sending"?"sending":n==="stopping"?"stopping":n==="running"?"steer":"talk"}function gn(e,n,s,a=null){return e==="start_codex"?n==="starting"?a??"Scout is starting a Codex session for this workspace":a??"Start a Scout-managed Codex session for this workspace":e==="connect"?"Reconnect Scout's managed Codex session":s==="listening"?"Stop dictation and send the turn":s==="transcribing"?"Transcribing dictation":n==="running"?"Speak to steer the active turn":"Speak to start a turn"}function sa(e){const{voice:n,voiceAvailable:s,phase:a,listeningSince:r,clock:l,sessionError:u}=e;if(!s)return"Native voice becomes available inside the Scout iPad app.";if(n.input.state==="listening"){const p=r?` · ${lt(l-r)}`:"";return`${n.input.partialText||"Listening — speak naturally."}${p}`}return n.input.state==="transcribing"?"Transcribing on device, then sending…":n.input.state==="preparing"?"Warming Parakeet; Apple Speech remains available as fallback.":n.input.state==="unavailable"?n.input.unavailableReason||"Microphone access is unavailable.":u||(a==="starting"?e.sessionLaunchAccepted?"Codex started; waiting for its Scout lane.":"Scout is starting Codex.":a==="unavailable"?e.canStartCodexSession?"Voice becomes available with the Codex session.":e.sessionStartUnavailableReason??"Codex launch is unavailable for this lane.":a==="cold"||a==="failed"?"Reconnect the Codex session before talking to it.":a==="running"?"Tap to talk, tap again to steer the running turn.":"Tap to talk, tap again to send.")}function gt(e){return e==="listening"?"listening":e==="transcribing"?"processing":e==="preparing"?"warming":e==="unavailable"?"blocked":"ready"}function xn(e,n){return e==="starting"?"Composer unlocks when the Codex lane appears.":e==="unavailable"?"Composer unlocks with a Codex session.":e==="cold"||e==="failed"?"Reconnect the Codex session to enable typing.":n==="listening"?"Speaking… the transcript sends when you tap send.":n==="transcribing"?"Finishing your transcript…":e==="running"?"Or type a redirect for this active turn…":"Or type what this session should do next…"}function vn(){return t.jsxs("svg",{className:"deck-glyph deck-glyph--mic",viewBox:"0 0 32 32","aria-hidden":"true",children:[t.jsx("rect",{x:"11",y:"4",width:"10",height:"16",rx:"5"}),t.jsx("path",{d:"M7.5 15.5v.8a8.5 8.5 0 0 0 17 0v-.8M16 24.8V29M11.5 29h9"})]})}function ue(){return t.jsx("svg",{className:"deck-glyph deck-glyph--mic",viewBox:"0 0 32 32","aria-hidden":"true",children:t.jsx("path",{d:"M13 19l6-6M11.5 14.5 9 17a4.6 4.6 0 0 0 6.5 6.5l2.5-2.5M20.5 17.5 23 15a4.6 4.6 0 0 0-6.5-6.5L14 11"})})}function xt(){return t.jsx("svg",{className:"deck-glyph",viewBox:"0 0 20 20","aria-hidden":"true",children:t.jsx("path",{d:"M3.5 8h3l4-3.2v10.4L6.5 12h-3zM13.3 7.2a4 4 0 0 1 0 5.6M15.6 5a7 7 0 0 1 0 10"})})}function Le(){return t.jsx("svg",{className:"deck-glyph",viewBox:"0 0 20 20","aria-hidden":"true",children:t.jsx("rect",{x:"5.5",y:"5.5",width:"9",height:"9",rx:"1.6"})})}function kn(){return t.jsxs("svg",{className:"deck-glyph",viewBox:"0 0 20 20","aria-hidden":"true",children:[t.jsx("path",{d:"M3 6h6M13 6h4M3 14h4M11 14h6"}),t.jsx("circle",{cx:"11",cy:"6",r:"2.1"}),t.jsx("circle",{cx:"9",cy:"14",r:"2.1"})]})}function ut(){return t.jsxs("svg",{className:"deck-glyph",viewBox:"0 0 20 20","aria-hidden":"true",children:[t.jsx("path",{d:"M16.5 8.2A6.6 6.6 0 0 0 4.6 6.4M3.5 11.8a6.6 6.6 0 0 0 11.9 1.8"}),t.jsx("path",{d:"M16.8 4.2v4h-4M3.2 15.8v-4h4"})]})}function Re({dir:e}){const n={up:180,down:0,left:90,right:-90}[e];return t.jsx("svg",{className:"deck-glyph",viewBox:"0 0 20 20","aria-hidden":"true",style:{transform:`rotate(${n}deg)`},children:t.jsx("path",{d:"M5 8l5 5 5-5"})})}function aa({model:e}){return t.jsx("div",{className:"deck-switch",role:"group","aria-label":"Controller treatment",children:dn.map(n=>t.jsxs("button",{type:"button",className:"deck-switch__key","data-active":e.treatment===n||void 0,onClick:()=>e.setTreatment(n),"aria-pressed":e.treatment===n,title:ot[n].tagline,children:[ot[n].label,n==="ops"?t.jsx("em",{children:"default"}):null]},n))})}function bn({model:e,size:n="md"}){const s=ht(e.thread),a=!!e.thread?.threadId;return e.adapterAvailable?t.jsxs("div",{className:"deck-binding","data-size":n,"data-bound":a||void 0,children:[t.jsx("span",{className:"deck-binding__label",children:"Scout Codex session"}),t.jsx("strong",{title:s??void 0,children:a?s??"Untitled session":"No session connected"}),t.jsxs("span",{className:"deck-binding__id",children:[e.thread?.threadId?`id ${z(e.thread.threadId)}`:"id —",e.thread?.turnId?` · turn ${z(e.thread.turnId)}`:""]})]}):t.jsxs("div",{className:"deck-binding","data-size":n,children:[t.jsx("span",{className:"deck-binding__label",children:"Selected workspace"}),t.jsx("strong",{children:e.selected?.name??"No lane selected"}),t.jsx("span",{className:"deck-binding__id",children:e.selected?.projectRoot??e.sessionStartUnavailableReason??`${pe(e.selected?.transport)} · view only`})]})}function De({model:e,compact:n=!1}){const s=e.selected;if(!s)return null;const a=zs(e);return t.jsxs("div",{className:"deck-phase","data-tone":e.phaseTone,"data-phase":e.phase,"data-compact":n||void 0,"aria-live":"polite","aria-atomic":"true",children:[t.jsxs("span",{className:"deck-phase__state",children:[t.jsx("i",{className:"deck-lamp"}),pt(e.phase,s.state)]}),t.jsx("span",{className:"deck-phase__detail",children:Fs(e.phase,e.thread,e.threadError,e.notice,s,e.sessionStartUnavailableReason)}),a?t.jsx("span",{className:"deck-phase__clock","data-live":e.phase==="running"||void 0,children:a}):null]})}function Me({model:e,size:n="lg"}){const s=e.primaryAction==="start_codex"?e.sessionBusy?"starting":"start":e.primaryAction==="connect"?"connect":e.voice.input.state,a=gn(e.primaryAction,e.phase,e.voice.input.state,e.sessionStartUnavailableReason),r=e.primaryAction==="start_codex"?!e.canStartCodexSession:e.primaryAction==="connect"?e.threadBusy:!e.canTalk;return t.jsxs("button",{type:"button",className:"deck-primary","data-size":n,"data-action":e.primaryAction,"data-state":s,onClick:e.onPrimary,disabled:r,"aria-label":a,"aria-pressed":e.primaryAction==="talk"?e.voice.input.state==="listening":void 0,"aria-busy":e.primaryAction==="start_codex"&&e.sessionBusy?!0:void 0,title:a,children:[e.primaryAction==="talk"?t.jsx(vn,{}):t.jsx(ue,{}),t.jsx("small",{children:na(e.primaryAction,e.phase,e.voice.input.state)})]})}function jn({model:e,block:n=!1}){return e.canInterrupt?t.jsxs("button",{type:"button",className:"deck-stop","data-block":n||void 0,onClick:e.interruptThread,disabled:e.threadBusy||e.phase==="stopping",children:[t.jsx(Le,{}),t.jsx("span",{children:e.phase==="stopping"?"Stopping":"Stop turn"})]}):null}function $e({model:e}){const n=e.voice.input.state==="listening";return t.jsxs("div",{className:"deck-trace-wrap","data-live":n||void 0,children:[t.jsx("span",{className:"deck-trace__label",title:"The surface contract reports no microphone level, so the Deck plots transcript cadence instead.",children:n?"Listening · cadence":"Input cadence"}),t.jsx("div",{className:"deck-trace","data-live":n||void 0,"aria-hidden":"true",children:e.inputTrace.map((s,a)=>t.jsx("i",{style:{"--level":s}},a))})]})}function ia({model:e}){return t.jsxs("div",{className:"deck-activity","aria-label":"Lane activity over the last five minutes",children:[t.jsx("small",{children:"5m"}),t.jsx("div",{"aria-hidden":"true",children:e.laneActivity.map((n,s)=>t.jsx("i",{style:{"--level":n}},s))}),t.jsx("small",{children:"now"})]})}function Pe({model:e}){return t.jsxs("p",{className:"deck-caption","data-active":e.voiceInputActive||void 0,"data-error":!!e.voiceError||void 0,"aria-live":"polite",children:[t.jsx("i",{"aria-hidden":"true"}),t.jsx("span",{children:e.voiceError??sa(e)})]})}function vt({model:e,rows:n=2}){return t.jsxs("form",{className:"deck-composer",onSubmit:e.onComposerSubmit,"aria-busy":e.threadBusy||void 0,children:[t.jsx("textarea",{value:e.command,onChange:s=>e.setCommand(s.target.value),onKeyDown:e.onComposerKeyDown,placeholder:xn(e.phase,e.voice.input.state),disabled:!e.canCompose,rows:n,"aria-label":e.phase==="running"?"Steer the active Codex turn":"Start a Codex turn"}),t.jsxs("button",{type:"submit",className:"deck-send",disabled:!e.canCompose||!e.command.trim(),children:[e.phase==="running"?"Steer":"Send",t.jsx("em",{children:"⌘↵"})]})]})}function ye(e,n){return`${e} — ${n}`}function kt({model:e,label:n=!0}){const s=e.voice.output.speaking?"Speaking":e.voiceOutEnabled?"Voice out":"Muted",a=e.voiceOutputAvailable?e.voice.output.speaking?"spoken replies are on and playing now":e.voiceOutEnabled?"spoken replies are on":"spoken replies are off":"spoken replies unavailable on this host";return t.jsxs("button",{type:"button",className:Ve("deck-chip deck-chip--voice",n),"data-active":e.voiceOutEnabled||void 0,"data-speaking":e.voice.output.speaking||void 0,onClick:e.toggleVoiceOutput,disabled:!e.voiceOutputAvailable,"aria-pressed":e.voiceOutEnabled,"aria-label":ye(s,a),title:ye(s,a),children:[t.jsx(xt,{}),n?t.jsx("span",{children:s}):null]})}function Sn({model:e,label:n=!0}){const s=ye("Audio",e.settingsOpen?"dictation and playback settings, open":"dictation and playback settings");return t.jsxs("button",{type:"button",className:Ve("deck-chip",n),"data-active":e.settingsOpen||void 0,onClick:()=>e.setSettingsOpen(!e.settingsOpen),"aria-expanded":e.settingsOpen,"aria-label":s,title:s,children:[t.jsx(kn,{}),n?t.jsx("span",{children:"Audio"}):null]})}function yn({model:e,label:n=!0}){const s=ye("Re-read",e.canRefresh?"pull the connected session snapshot from the host again":"unavailable until a session is connected");return t.jsxs("button",{type:"button",className:Ve("deck-chip",n),onClick:e.refreshSnapshot,disabled:!e.canRefresh,"aria-label":s,title:s,children:[t.jsx(ut,{}),n?t.jsx("span",{children:"Re-read"}):null]})}function _n({model:e,label:n=!0}){if(!e.canRebind)return null;const s=e.phase==="failed"?"Retry link":"Reconnect",a=ye(s,e.phase==="failed"?"the last connection failed; reconnect Scout's managed Codex session":"connect Scout's managed Codex session");return t.jsxs("button",{type:"button",className:Ve("deck-chip deck-chip--warn",n),onClick:e.connectThread,disabled:e.threadBusy,"aria-label":a,title:a,children:[t.jsx(ue,{}),n?t.jsx("span",{children:s}):null]})}function Ve(e,n){return n?e:`${e} deck-chip--icon`}function Be({model:e}){if(!e.settingsOpen)return null;const n=e.speechCatalog?.models.find(r=>r.id===e.speechModelId),s=e.speechCatalog?.voices.find(r=>r.id===e.speechVoiceId&&r.modelId===e.speechModelId),a=e.speechOutputPhase==="preparing"?"Synthesizing through Scout…":e.voice.output.speaking?"A reply is being spoken now.":"Ready for the next completed reply.";return t.jsxs("div",{className:"deck-sheet",role:"dialog","aria-label":"Audio and dictation settings",children:[t.jsxs("header",{children:[t.jsx("strong",{children:"Audio & dictation"}),t.jsx("button",{type:"button",className:"deck-chip",onClick:()=>e.setSettingsOpen(!1),children:"Close"})]}),t.jsxs("div",{className:"deck-sheet__row",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Spoken replies"}),t.jsx("small",{children:"Speak each completed Codex reply aloud."})]}),t.jsxs("button",{type:"button",className:"deck-toggle","data-on":e.voiceOutEnabled||void 0,onClick:e.toggleVoiceOutput,disabled:!e.voiceOutputAvailable,"aria-pressed":e.voiceOutEnabled,children:[t.jsx("i",{}),e.voiceOutEnabled?"On":"Off"]})]}),t.jsxs("div",{className:"deck-sheet__voice-grid","aria-label":"Scout speech provider and voice",children:[t.jsxs("label",{children:[t.jsx("span",{children:"Provider & model"}),t.jsx("select",{className:"deck-sheet__select",value:e.speechModelId,onChange:r=>e.selectSpeechModel(r.currentTarget.value),disabled:!e.cloudSpeechAvailable||!e.speechCatalog,children:e.speechCatalog?.models.filter(r=>ra(r.provider)).map(r=>t.jsxs("option",{value:r.id,disabled:!r.available,children:[on(r.provider)," · ",r.name,r.available?"":" · unavailable"]},r.id))??t.jsx("option",{children:e.speechCatalog?"No API models":"Loading Scout voices…"})})]}),t.jsxs("label",{children:[t.jsx("span",{children:"Voice"}),t.jsx("select",{className:"deck-sheet__select",value:e.speechVoiceId,onChange:r=>e.selectSpeechVoice(r.currentTarget.value),disabled:!e.cloudSpeechAvailable||!e.speechCatalog||e.speechCatalog.voices.length===0,children:e.speechCatalog?.voices.filter(r=>r.modelId===e.speechModelId&&r.available).map(r=>t.jsxs("option",{value:r.id,children:[r.name,r.language?` · ${r.language}`:""]},r.id))??t.jsx("option",{children:"Loading…"})})]})]}),t.jsxs("div",{className:"deck-sheet__pace",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Speaking pace"}),t.jsx("small",{children:"Applied by the selected Scout TTS provider."})]}),t.jsx("div",{className:"deck-segment",role:"group","aria-label":"Speaking pace",children:[[.85,"Calm"],[1,"Natural"],[1.15,"Brisk"]].map(([r,l])=>t.jsx("button",{type:"button","data-active":e.speechSpeed===r||void 0,"aria-pressed":e.speechSpeed===r,onClick:()=>e.selectSpeechSpeed(r),disabled:!e.cloudSpeechAvailable,children:l},l))})]}),t.jsxs("div",{className:"deck-sheet__row",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Stopping dictation sends"}),t.jsx("small",{children:"Off keeps the transcript in the composer for editing."})]}),t.jsxs("button",{type:"button",className:"deck-toggle","data-on":e.autoSendOnStop||void 0,onClick:e.toggleAutoSend,"aria-pressed":e.autoSendOnStop,children:[t.jsx("i",{}),e.autoSendOnStop?"On":"Off"]})]}),t.jsxs("div",{className:"deck-sheet__row",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Playback"}),t.jsx("small",{children:a})]}),t.jsxs("div",{className:"deck-sheet__playback",children:[t.jsxs("button",{type:"button",className:"deck-chip",onClick:e.previewSpeechVoice,disabled:!e.voiceOutputAvailable||e.speechOutputPhase!=="idle",children:[t.jsx(xt,{}),t.jsx("span",{children:"Hear voice"})]}),t.jsxs("button",{type:"button",className:"deck-chip deck-chip--warn",onClick:e.stopSpeaking,disabled:!e.voice.output.speaking,children:[t.jsx(Le,{}),t.jsx("span",{children:"Stop"})]})]})]}),t.jsxs("dl",{className:"deck-sheet__facts",children:[t.jsxs("div",{children:[t.jsx("dt",{children:"Voice in"}),t.jsx("dd",{children:e.voiceAvailable?e.voice.input.engine:"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Input"}),t.jsx("dd",{children:e.voiceAvailable?gt(e.voice.input.state):"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Voice out"}),t.jsx("dd",{children:n?on(n.provider):"Scout API"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Route"}),t.jsx("dd",{children:e.speechRoute?.voiceId??s?.name??e.speechVoiceId})]})]}),t.jsx("p",{className:"deck-sheet__note",children:"Scout owns both directions: Scout dictation in; OpenAI, ElevenLabs, or NVIDIA synthesis out through the paired host API."})]})}function on(e){return e.toLowerCase()==="openai"?"OpenAI":e.toLowerCase()==="elevenlabs"?"ElevenLabs":e.toLowerCase()==="nvidia"?"NVIDIA":e.replace(/(^|[-_])([a-z])/g,(n,s,a)=>`${s?" ":""}${a.toUpperCase()}`)}function ra(e){const n=e.toLowerCase();return n==="openai"||n==="elevenlabs"||n==="nvidia"}function ca({lane:e,index:n,model:s,onSelect:a}){const r=e.key===s.selected?.key;return t.jsxs("button",{type:"button",className:"deck-lane","data-active":r||void 0,"data-tone":r&&s.phaseTone!=="quiet"?s.phaseTone:le(e),onClick:()=>{s.selectLane(e),a?.()},"aria-pressed":r,children:[t.jsx("span",{className:"deck-lane__index",children:String(n+1).padStart(2,"0")}),t.jsxs("span",{className:"deck-lane__body",children:[t.jsx("strong",{children:e.name}),t.jsxs("small",{children:[e.hostName," · ",e.harness??"agent"," · ",Y(e.state).toLowerCase()]})]}),t.jsx("i",{className:"deck-lane__signal","aria-hidden":"true"})]})}function bt({model:e}){const{hosts:n}=e;return n.length===0?null:t.jsxs("div",{className:"deck-scope",role:"group","aria-label":"Agent lane scope",children:[n.length>1?t.jsxs("button",{type:"button",className:"deck-scope__key","data-active":e.hostScope==="all"||void 0,onClick:()=>e.selectHostScope("all"),"aria-pressed":e.hostScope==="all",children:[t.jsx("i",{"data-all":"true"}),"All hosts"]}):null,n.map(s=>t.jsxs("button",{type:"button",className:"deck-scope__key","data-state":s.state,"data-active":e.hostScope===s.id||void 0,onClick:()=>e.selectHostScope(s.id),disabled:s.state!=="connected","aria-pressed":e.hostScope===s.id,children:[t.jsx("i",{}),s.name]},s.id))]})}function mn({model:e,onPick:n}){return e.attention.length===0?t.jsx("p",{className:"deck-empty-note",children:"No lanes need intervention."}):t.jsx("div",{className:"deck-attention",children:e.attention.map(s=>t.jsxs("button",{type:"button",className:"deck-attention__row",onClick:()=>{e.selectLane(s),n?.()},children:[t.jsx("i",{"aria-hidden":"true"}),t.jsxs("span",{children:[t.jsx("strong",{children:s.name}),t.jsx("small",{children:s.events[0]?.text??"Needs review"})]})]},s.key))})}function oa({model:e,limit:n=9}){const{thread:s,adapterAvailable:a,threadBusy:r,threadError:l}=e;if(!a)return t.jsx(oe,{glyph:e.sessionBusy?"···":"CX",title:e.sessionError?"Codex did not start":e.sessionBusy?"Starting Codex":"Workspace is view-only",tone:e.sessionError?"error":void 0,children:e.sessionError??(e.sessionBusy?e.sessionLaunchAccepted?"Codex accepted the launch. Scout will switch Deck when its lane appears.":"Scout is launching a broker-managed Codex session.":e.canStartCodexSession?"This lane remains intact when Scout opens its controllable Codex session.":e.sessionStartUnavailableReason??"This workspace remains view-only.")});if(l)return t.jsxs(oe,{glyph:"!",title:"Session connection failed",tone:"error",children:[l,t.jsxs("button",{type:"button",className:"deck-chip deck-chip--warn",onClick:e.connectThread,disabled:r,children:[t.jsx(ue,{}),t.jsx("span",{children:"Retry controller"})]})]});if(!s)return t.jsx(oe,{glyph:"···",title:"Reading the Codex session",children:"Nothing is shown until the host returns a snapshot."});if(s.state==="disconnected")return t.jsxs(oe,{glyph:"CX",title:"Session is disconnected",children:["No turns are readable until Deck reconnects Scout's managed Codex session on the host.",t.jsxs("button",{type:"button",className:"deck-chip deck-chip--warn",onClick:e.connectThread,disabled:r,children:[t.jsx(ue,{}),t.jsx("span",{children:"Reconnect"})]})]});const u=fn(s,n);return u.length===0?t.jsx(oe,{glyph:"●",title:"Codex ready",tone:"connected",children:s.threadId?`Session ${z(s.threadId)} is ready. Start its first turn from the console.`:"The session is connected. Start its first turn from the console."}):t.jsx("div",{className:"deck-stream",children:u.map(p=>t.jsxs("article",{className:"deck-stream__row","data-role":p.role,"data-type":p.block.type,children:[t.jsxs("div",{className:"deck-stream__meta",children:[t.jsx("span",{children:p.role==="operator"?"YOU":p.block.type==="action"?"RUN":p.block.type==="reasoning"?"THINK":"CX"}),t.jsx("time",{children:de(p.at)})]}),t.jsxs("div",{className:"deck-stream__content",children:[t.jsx("strong",{children:Oe(p.block)}),dt(p.block)?t.jsx("p",{children:dt(p.block)}):null]}),t.jsx("span",{className:"deck-stream__status","data-live":p.status==="streaming"||void 0,children:p.status==="streaming"?"live":p.status})]},p.block.id))})}function la({lane:e}){return e.events.length===0?t.jsx(oe,{glyph:"·",title:"No recent activity",children:"Nothing has been observed on this lane recently."}):t.jsx("div",{className:"deck-stream",children:e.events.slice(0,8).map(n=>t.jsxs("article",{className:"deck-stream__row","data-kind":n.kind,children:[t.jsxs("div",{className:"deck-stream__meta",children:[t.jsx("span",{children:n.kind.toUpperCase()}),t.jsx("time",{children:de(n.at)})]}),t.jsxs("div",{className:"deck-stream__content",children:[t.jsx("strong",{children:n.text}),n.detail?t.jsx("p",{children:n.detail}):null]})]},n.id))})}function oe({glyph:e,title:n,tone:s,children:a}){return t.jsxs("div",{className:"deck-stream-empty","data-tone":s,children:[t.jsx("span",{className:"deck-stream-empty__glyph",children:e}),t.jsx("strong",{children:n}),t.jsx("p",{children:a})]})}function jt({model:e}){return t.jsxs("div",{className:"deck-tabs",role:"tablist","aria-label":"Lane view",children:[t.jsx("button",{type:"button",role:"tab","aria-selected":e.view==="thread",onClick:()=>e.setView("thread"),disabled:!e.adapterAvailable,children:"Session turns"}),t.jsx("button",{type:"button",role:"tab","aria-selected":e.view==="signal",onClick:()=>e.setView("signal"),children:"Lane signal"})]})}function St({model:e,limit:n}){return e.view==="signal"&&e.selected?t.jsx(la,{lane:e.selected}):t.jsx(oa,{model:e,limit:n})}function qe({model:e}){return t.jsxs("span",{className:"deck-connection","data-connection":e.connection,children:[t.jsx("i",{className:"deck-lamp"}),Qs(e.connection)]})}function da({model:e}){const n=e.selected;return n?t.jsxs("div",{className:"deck-identity",children:[t.jsx("h2",{children:n.name}),t.jsxs("p",{children:[t.jsx("span",{children:n.projectRoot??"Project unavailable"}),t.jsxs("em",{children:[n.hostName," · ",n.model??"default model"," · ",pe(n.transport)]})]})]}):null}function yt({model:e}){return t.jsxs("div",{className:"deck-standby",children:[t.jsx("i",{className:"deck-lamp"}),t.jsx("span",{className:"deck-kicker",children:"Deck standing by"}),t.jsx("h2",{children:e.connection==="error"?"Host unavailable":"Waiting for a connected host"}),t.jsx("p",{children:e.error??"Connect a trusted Scout host to populate live lanes and enable controls."}),t.jsx(bt,{model:e})]})}function ua({model:e}){const[n,s]=d.useState(()=>e.preview&&new URLSearchParams(window.location.search).get("palette")==="open"),[a,r]=d.useState(""),[l,u]=d.useState(0),p=d.useRef(null),k=e.selected,y=d.useMemo(()=>{const f=[{id:"start-codex",group:"Session",label:e.sessionBusy?"Starting Codex for this workspace":"Start Codex for this workspace",disabled:!e.canStartCodexSession,run:()=>{e.startCodexSession()}},{id:"talk",group:"Turn",label:e.voice.input.state==="listening"?"Stop dictation and send":"Talk to this session",hint:e.phase==="running"?"steers the running turn":"starts a turn",disabled:!e.canTalk,run:()=>{e.toggleVoiceInput()}},{id:"send",group:"Turn",label:e.phase==="running"?"Steer with composer text":"Send composer text",hint:"⌘↵",disabled:!e.canCompose||!e.command.trim(),run:()=>{e.submitTurn(e.command)}},{id:"stop",group:"Turn",label:"Interrupt the running turn",disabled:!e.canInterrupt||e.threadBusy,run:()=>{e.interruptThread()}},{id:"bind",group:"Session",label:e.phase==="failed"?"Retry the Codex connection":"Reconnect the Codex session",disabled:!e.canRebind||e.threadBusy,run:()=>{e.connectThread()}},{id:"refresh",group:"Session",label:"Re-read the session snapshot",disabled:!e.canRefresh,run:()=>{e.refreshSnapshot()}},{id:"view",group:"Session",label:e.view==="thread"?"Show lane signal":"Show session turns",run:()=>e.setView(e.view==="thread"?"signal":"thread")},{id:"voice-out",group:"Audio",label:e.voiceOutEnabled?"Mute spoken replies":"Speak replies aloud",disabled:!e.voiceOutputAvailable,run:()=>{e.toggleVoiceOutput()}},{id:"stop-speaking",group:"Audio",label:"Stop speaking now",disabled:!e.voice.output.speaking,run:()=>{e.stopSpeaking()}},{id:"auto-send",group:"Audio",label:e.autoSendOnStop?"Keep transcript in composer instead of sending":"Send when dictation stops",run:e.toggleAutoSend},{id:"audio",group:"Audio",label:"Open audio and dictation settings",run:()=>e.setSettingsOpen(!0)},{id:"ops",group:"Layout",label:"Switch to Ops (routed agent controller)",run:()=>e.setTreatment("ops")},{id:"yoke",group:"Layout",label:"Switch to Yoke (two-grip cockpit)",run:()=>e.setTreatment("yoke")},{id:"console",group:"Layout",label:"Switch to Console (fleet board)",run:()=>e.setTreatment("console")}];for(const[c,x]of e.scopedLanes.entries())f.push({id:`lane-${x.key}`,group:"Lanes",label:`${String(c+1).padStart(2,"0")} · ${x.name}`,hint:`${x.hostName} · ${Y(x.state).toLowerCase()}`,run:()=>e.selectLane(x)});for(const c of e.hosts)f.push({id:`scope-${c.id}`,group:"Lanes",label:`Scope to ${c.name}`,hint:c.state,disabled:c.state!=="connected",run:()=>e.selectHostScope(c.id)});return e.hosts.length>1&&f.push({id:"scope-all",group:"Lanes",label:"Scope to all hosts",run:()=>e.selectHostScope("all")}),f},[e]),m=d.useMemo(()=>{const f=a.trim().toLowerCase(),c=y.filter(x=>!x.disabled);return f?c.filter(x=>`${x.group} ${x.label} ${x.hint??""}`.toLowerCase().includes(f)):c},[y,a]);if(d.useEffect(()=>{u(0)},[a,n]),d.useEffect(()=>{n&&p.current?.focus()},[n]),d.useEffect(()=>{const f=c=>{if((c.metaKey||c.ctrlKey)&&c.key.toLowerCase()==="k"){c.preventDefault(),r(""),s(x=>!x);return}if(n){if(c.key==="Escape"){c.preventDefault(),s(!1);return}if(c.key==="ArrowDown"||c.key==="ArrowUp"){c.preventDefault(),u(x=>m.length===0?0:(x+(c.key==="ArrowDown"?1:-1)+m.length)%m.length);return}if(c.key==="Enter"){c.preventDefault();const x=m[l];if(!x)return;x.run(),s(!1)}}};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n,m,l]),!k)return t.jsx("div",{className:"brief brief--standby",children:t.jsx(yt,{model:e})});const U=ht(e.thread),T=!!e.thread?.threadId;return t.jsxs("div",{className:"brief",children:[t.jsxs("div",{className:"brief__column",children:[t.jsxs("header",{className:"brief__head",children:[t.jsxs("div",{className:"brief__head-top",children:[t.jsx(qe,{model:e}),t.jsxs("div",{className:"brief__head-keys",children:[t.jsx(kt,{model:e}),t.jsxs("button",{type:"button",className:"brief__jump",onClick:()=>{r(""),s(!0)},children:[t.jsxs("span",{children:[String(e.selectedIndex+1).padStart(2,"0")," / ",String(e.scopedLanes.length).padStart(2,"0")," lanes"]}),t.jsx(Re,{dir:"down"})]})]})]}),t.jsxs("span",{className:"deck-kicker brief__kicker","data-bound":T||void 0,children:[e.adapterAvailable?T?"Scout Codex session":"No session connected":e.sessionBusy?"Starting Codex":"Codex session not started"," · ",k.name," · ",k.hostName]}),t.jsx("h2",{children:T?U??"Untitled session":k.name}),t.jsxs("p",{className:"brief__meta",children:[e.thread?.threadId?`id ${z(e.thread.threadId)}`:"id —",e.thread?.turnId?` · turn ${z(e.thread.turnId)}`:""," · ",k.projectRoot??"project unavailable"," · ",k.model??"default model"," · ",pe(k.transport)]}),t.jsx(De,{model:e})]}),t.jsxs("div",{className:"brief__viewport",children:[t.jsxs("div",{className:"brief__viewport-head",children:[t.jsx(jt,{model:e}),e.canInterrupt?t.jsxs("button",{type:"button",className:"deck-stop",onClick:e.interruptThread,disabled:e.threadBusy||e.phase==="stopping",children:[t.jsx(Le,{}),t.jsx("span",{children:e.phase==="stopping"?"Stopping":"Stop turn"})]}):null]}),t.jsx("div",{className:"brief__viewport-body",children:t.jsx(St,{model:e,limit:14})})]}),t.jsxs("div",{className:"brief__dock",children:[t.jsxs("div",{className:"brief__dock-voice",children:[t.jsx(Me,{model:e,size:"lg"}),t.jsxs("div",{className:"brief__dock-trace",children:[t.jsx($e,{model:e}),t.jsx(Pe,{model:e})]}),t.jsxs("button",{type:"button",className:"brief__commands",onClick:()=>{r(""),s(!0)},"aria-haspopup":"dialog",children:["Commands",t.jsx("em",{children:"⌘K"})]})]}),t.jsx(vt,{model:e,rows:2})]})]}),n?t.jsx("div",{className:"brief__palette-scrim",onClick:()=>s(!1),children:t.jsxs("div",{className:"brief__palette",role:"dialog","aria-label":"Deck commands",onClick:f=>f.stopPropagation(),children:[t.jsx("input",{ref:p,value:a,onChange:f=>r(f.target.value),placeholder:"Run a command or jump to a lane…","aria-label":"Filter commands"}),t.jsxs("div",{className:"brief__palette-list",children:[m.length===0?t.jsx("p",{className:"deck-empty-note",children:"Nothing matches, and nothing was run."}):null,m.map((f,c)=>t.jsxs("button",{type:"button","data-active":c===l||void 0,onMouseEnter:()=>u(c),onClick:()=>{f.run(),s(!1)},children:[t.jsx("span",{className:"brief__palette-group","data-tone":f.group==="Lanes"?pa(e,f.id):void 0,children:f.group}),t.jsx("strong",{children:f.label}),f.hint?t.jsx("em",{children:f.hint}):null]},f.id))]}),t.jsx("footer",{children:"↑↓ move · ↵ run · esc close"})]})}):null,t.jsx(Be,{model:e})]})}function pa(e,n){const s=n.replace(/^lane-/,""),a=e.scopedLanes.find(r=>r.key===s);return a?le(a):void 0}function ha({model:e}){const n=e.selected;return t.jsxs("div",{className:"console",children:[t.jsxs("header",{className:"console__bar",children:[t.jsxs("div",{className:"console__bar-status",children:[t.jsx(qe,{model:e}),t.jsx(bn,{model:e,size:"md"})]}),t.jsx(De,{model:e,compact:!0}),t.jsxs("div",{className:"console__bar-controls",children:[t.jsx(jn,{model:e}),t.jsx(_n,{model:e}),t.jsx(yn,{model:e}),t.jsx(kt,{model:e}),t.jsx(Sn,{model:e}),t.jsx(Me,{model:e,size:"md"})]})]}),t.jsxs("div",{className:"console__body",children:[t.jsxs("aside",{className:"console__bank","aria-label":"Agent lanes",children:[t.jsxs("div",{className:"console__panel-head",children:[t.jsx("span",{className:"deck-kicker",children:"Lanes"}),t.jsxs("span",{className:"deck-kicker",children:[e.activeCount," live / ",e.scopedLanes.length]})]}),t.jsxs("div",{className:"console__lanes",children:[e.scopedLanes.map((s,a)=>t.jsx(ca,{lane:s,index:a,model:e},s.key)),e.scopedLanes.length===0?t.jsx("p",{className:"deck-empty-note",children:"No lanes in this scope."}):null]}),t.jsx(bt,{model:e})]}),t.jsx("section",{className:"console__stage",children:n?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"console__stage-head",children:[t.jsx(da,{model:e}),t.jsxs("div",{className:"console__meter","aria-label":"Lane activity over the last five minutes",children:[t.jsx("small",{children:"5m"}),t.jsx("div",{"aria-hidden":"true",children:e.laneActivity.map((s,a)=>t.jsx("i",{style:{"--level":s}},a))}),t.jsx("small",{children:"now"})]})]}),t.jsxs("div",{className:"console__viewport",children:[t.jsxs("div",{className:"console__panel-head",children:[t.jsx(jt,{model:e}),t.jsxs("span",{className:"deck-kicker",children:[n.hostName," / ",n.id]})]}),t.jsx("div",{className:"console__viewport-body",children:t.jsx(St,{model:e,limit:12})})]}),t.jsxs("div",{className:"console__dock",children:[t.jsx($e,{model:e}),t.jsx(Pe,{model:e}),t.jsx(vt,{model:e,rows:2})]})]}):t.jsx(yt,{model:e})}),t.jsxs("aside",{className:"console__rail","aria-label":"Session readout",children:[t.jsxs("div",{className:"console__panel-head",children:[t.jsx("span",{className:"deck-kicker",children:"Readout"}),t.jsx("span",{className:"deck-kicker",children:e.preview?"Sample":e.adapterAvailable?"Native":"—"})]}),t.jsxs("dl",{className:"console__readout",children:[t.jsxs("div",{children:[t.jsx("dt",{children:"Source"}),t.jsx("dd",{children:e.preview?"sample data":"paired host"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Bridge"}),t.jsx("dd",{children:ea(e.connection)})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Session"}),t.jsx("dd",{children:e.thread?.threadId?z(e.thread.threadId):e.sessionBusy?"starting":e.adapterAvailable?"disconnected":"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Turn"}),t.jsx("dd",{children:e.thread?.turnId?z(e.thread.turnId):"none"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Voice in"}),t.jsx("dd",{children:e.voiceAvailable?gt(e.voice.input.state):"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Voice out"}),t.jsx("dd",{children:e.voiceOutputAvailable?e.voice.output.speaking?"speaking":e.voiceOutEnabled?"armed":"off":"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Queue"}),t.jsx("dd",{title:e.thread?.capabilityNotes.queue,children:e.adapterAvailable?"off":"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Approval"}),t.jsx("dd",{title:e.thread?.capabilityNotes.approvals,children:e.adapterAvailable?"off":"—"})]})]}),t.jsxs("div",{className:"console__panel-head",children:[t.jsx("span",{className:"deck-kicker",children:"Attention"}),t.jsx("span",{className:"deck-kicker",children:String(e.attention.length).padStart(2,"0")})]}),t.jsx(mn,{model:e}),t.jsxs("div",{className:"console__panel-head",children:[t.jsx("span",{className:"deck-kicker",children:"Fleet"}),t.jsx("span",{className:"deck-kicker",children:String(e.hosts.length).padStart(2,"0")})]}),t.jsx("div",{className:"console__fleet",children:e.hosts.map(s=>t.jsxs("div",{className:"console__fleet-row",children:[t.jsx("i",{"data-state":s.state}),t.jsxs("span",{children:[t.jsx("strong",{children:s.name}),t.jsxs("small",{children:[e.lanes.filter(a=>a.hostId===s.id).length," lanes"]})]}),t.jsx("em",{children:s.state})]},s.id))})]})]}),t.jsx(Be,{model:e})]})}function fa({model:e}){const n=e.selected,s=n?e.scopedLanes.findIndex(c=>c.key===n.key)+1:0,a=d.useMemo(()=>e.scopedLanes.flatMap((c,x)=>c.events.map(X=>({id:`${c.key}:${X.id}`,at:X.at,channel:x+1,lane:c,text:X.text,detail:X.detail??""}))).sort((c,x)=>x.at-c.at).slice(0,16),[e.scopedLanes]),r=d.useMemo(()=>n?e.view==="signal"||!e.thread?n.events.slice(0,5).reverse().map(c=>({id:c.id,label:c.kind.toUpperCase(),text:c.text,detail:c.detail??"",at:c.at,live:le(n)==="live"&&c.id===n.events[0]?.id})):fn(e.thread,5).map(c=>({id:c.block.id,label:c.role==="operator"?"YOU":c.block.type==="action"?"RUN":c.block.type==="reasoning"?"THINK":"CX",text:Oe(c.block),detail:dt(c.block),at:c.at,live:c.status==="streaming"})):[],[n,e.thread,e.view]),u=["all",...e.hosts.filter(c=>c.state==="connected").map(c=>c.id)],p=Math.max(0,u.indexOf(e.hostScope)),k=u[(p+1)%Math.max(1,u.length)]??"all",y=e.hostScope==="all"?"All hosts":e.hosts.find(c=>c.id===e.hostScope)?.name??e.hostScope;if(!n)return t.jsx("div",{className:"ops ops--standby",children:t.jsxs("div",{className:"ops__standby",children:[t.jsx(qe,{model:e}),t.jsx("strong",{children:"No agent channels are available"}),t.jsx("p",{children:e.error??"Waiting for a connected host to publish its Scout lanes."})]})});const m=ht(e.thread),U=e.connection==="ready"?"ONLINE":e.connection==="partial"?"DEGRADED":e.connection.toUpperCase(),T=e.preview?"SIMULATED":e.sessionBusy?"STARTING CODEX":e.adapterAvailable?e.thread?.threadId&&(e.connection==="ready"||e.connection==="partial")?"LIVE":e.connection==="ready"||e.connection==="partial"?"SESSION OFFLINE":"OFFLINE":e.canStartCodexSession?"READY TO START":"VIEW ONLY",f=e.preview?"8 SIMULATED CONTROLS":e.connection==="ready"||e.connection==="partial"?"8 HOST CONTROLS":"CONTROLS OFFLINE";return t.jsxs("div",{className:"ops",children:[t.jsx("section",{className:"ops__channels","aria-label":"Agent channels",children:e.scopedLanes.map((c,x)=>t.jsx(ga,{lane:c,index:x,active:c.key===n.key,model:e},c.key))}),t.jsxs("section",{className:"ops__voice","aria-label":"Routed voice control",children:[t.jsx(Me,{model:e,size:"md"}),t.jsx($e,{model:e}),t.jsxs("div",{className:"ops__voice-copy",children:[t.jsx("strong",{children:gn(e.primaryAction,e.phase,e.voice.input.state,e.sessionStartUnavailableReason).toUpperCase()}),t.jsx(Pe,{model:e})]}),t.jsxs("div",{className:"ops__routes",role:"group","aria-label":"Route dictation to agent channel",children:[t.jsx("span",{children:"ROUTE TO"}),t.jsx("div",{children:e.scopedLanes.map((c,x)=>t.jsxs("button",{type:"button","data-active":c.key===n.key||void 0,onClick:()=>e.selectLane(c),"aria-pressed":c.key===n.key,children:["CH ",x+1]},c.key))})]})]}),t.jsxs("section",{className:"ops__enclosure",children:[t.jsxs("header",{className:"ops__enclosure-head",children:[t.jsxs("span",{className:"ops__host",children:[t.jsx("i",{"data-tone":e.phaseTone}),n.hostName]}),t.jsxs("span",{className:"ops__binding",children:[e.adapterAvailable?"SCOUT APP-SERVER":pe(n.transport).toUpperCase(),t.jsx("i",{children:"·"}),m??n.projectRoot??"NO SESSION"]})]}),t.jsxs("div",{className:"ops__workspace",children:[t.jsxs("article",{className:"ops__console",children:[t.jsxs("header",{children:[t.jsx("span",{children:"agent console"}),t.jsx("strong",{"data-tone":e.phaseTone,children:pt(e.phase,n.state)})]}),t.jsxs("div",{className:"ops__agent-line",children:[t.jsx("h2",{children:n.name}),t.jsxs("span",{children:["CH ",String(s).padStart(2,"0")," · ",n.hostName.toUpperCase()]})]}),t.jsx("p",{className:"ops__task",title:m??void 0,children:m??(e.adapterAvailable?"No Codex session connected":e.sessionBusy?"Starting Codex for this workspace…":"Start Codex to control this workspace")}),t.jsx(De,{model:e,compact:!0}),t.jsx("div",{className:"ops__console-rows","data-view":e.view,children:r.length>0?r.map(c=>t.jsxs("div",{className:"ops__console-row","data-live":c.live||void 0,children:[t.jsx("i",{}),t.jsx("span",{children:c.label}),t.jsxs("p",{children:[t.jsx("strong",{children:c.text}),c.detail?t.jsx("small",{children:c.detail}):null]}),t.jsx("time",{children:de(c.at)})]},c.id)):t.jsxs("p",{className:"ops__empty",children:["No ",e.view==="thread"?"session turns":"lane signal"," reported yet."]})}),t.jsxs("form",{className:"ops__composer",onSubmit:e.onComposerSubmit,children:[t.jsx("span",{"aria-hidden":"true",children:"›"}),t.jsx("input",{value:e.command,onChange:c=>e.setCommand(c.target.value),placeholder:xn(e.phase,e.voice.input.state),disabled:!e.canCompose,"aria-label":e.phase==="running"?"Steer the active Codex turn":"Start a Codex turn"}),t.jsx("button",{type:"submit",disabled:!e.canCompose||!e.command.trim(),children:e.phase==="running"?"Steer":"Send"})]}),t.jsxs("div",{className:"ops__console-actions",children:[e.canRebind?t.jsxs("button",{type:"button",onClick:e.connectThread,disabled:e.threadBusy,children:[t.jsx(ue,{}),e.phase==="failed"?"Retry link":"Reconnect"]}):null,t.jsxs("button",{type:"button",onClick:e.refreshSnapshot,disabled:!e.canRefresh,children:[t.jsx(ut,{}),"Re-read"]}),e.canInterrupt?t.jsxs("button",{type:"button",className:"ops__danger",onClick:e.interruptThread,disabled:e.threadBusy,children:[t.jsx(Le,{}),e.phase==="stopping"?"Stopping":"Stop turn"]}):null]}),t.jsxs("footer",{children:[t.jsxs("span",{children:["MODEL ",t.jsx("strong",{children:n.model??"DEFAULT"})]}),t.jsxs("span",{children:["CONTROL ",t.jsx("strong",{children:T})]}),t.jsxs("span",{title:e.thread?.threadId??void 0,children:["SESSION ",t.jsx("strong",{children:e.thread?.threadId?z(e.thread.threadId):"—"})]})]})]}),t.jsxs("aside",{className:"ops__feed",children:[t.jsxs("header",{children:[t.jsx("span",{children:"fleet feed"}),t.jsxs("strong",{children:[e.hostScope==="all"?"ALL HOSTS":y.toUpperCase()," · ",a.length," EVENTS"]})]}),t.jsx("div",{className:"ops__feed-rows",children:a.length>0?a.map(c=>t.jsxs("button",{type:"button","data-active":c.lane.key===n.key||void 0,"data-tone":le(c.lane),onClick:()=>e.selectLane(c.lane),"aria-label":`Channel ${c.channel}, ${c.lane.name}: ${c.text}`,children:[t.jsx("time",{children:de(c.at)}),t.jsxs("span",{children:["CH ",c.channel]}),t.jsx("strong",{children:c.lane.name.toUpperCase()}),t.jsxs("p",{children:[c.text,c.detail?t.jsx("small",{children:c.detail}):null]})]},c.id)):t.jsx("p",{className:"ops__empty",children:"No fleet activity reported yet."})})]})]})]}),t.jsxs("section",{className:"ops__commands","aria-label":"Deck commands",children:[t.jsxs("header",{children:[t.jsx("span",{children:"COMMANDS"}),t.jsx("strong",{children:f})]}),t.jsxs("div",{className:"ops__command-grid",children:[t.jsx(G,{ordinal:"01",label:e.primaryAction==="start_codex"?"Start Codex":"Voice",meta:e.primaryAction==="start_codex"?e.sessionBusy?"Starting":"Workspace":gt(e.voice.input.state),icon:e.primaryAction==="start_codex"?t.jsx(ue,{}):t.jsx(vn,{}),active:e.voiceInputActive,disabled:e.primaryAction==="start_codex"?!e.canStartCodexSession:e.primaryAction==="connect"?e.threadBusy:!e.canTalk,onClick:e.onPrimary}),t.jsx(G,{ordinal:"02",label:"Session turns",meta:"Codex session",glyph:"◎",active:e.view==="thread",disabled:!e.adapterAvailable,onClick:()=>e.setView("thread")}),t.jsx(G,{ordinal:"03",label:"Lane signal",meta:"Scout tail",glyph:"≋",active:e.view==="signal",onClick:()=>e.setView("signal")}),t.jsx(G,{ordinal:"04",label:"Re-read",meta:"Session snapshot",icon:t.jsx(ut,{}),disabled:!e.canRefresh,onClick:()=>{e.refreshSnapshot()}}),t.jsx(G,{ordinal:"05",label:e.voiceOutEnabled?"Voice out":"Muted",meta:e.voice.output.speaking?"Speaking":e.voiceOutEnabled?"Armed":"Off",icon:t.jsx(xt,{}),active:e.voiceOutEnabled,disabled:!e.voiceOutputAvailable,onClick:()=>{e.toggleVoiceOutput()}}),t.jsx(G,{ordinal:"06",label:"Audio",meta:"Dictation",icon:t.jsx(kn,{}),active:e.settingsOpen,onClick:()=>e.setSettingsOpen(!e.settingsOpen)}),t.jsx(G,{ordinal:"07",label:"Host scope",meta:y,glyph:"⌾",disabled:u.length<2,onClick:()=>e.selectHostScope(k)}),t.jsx(G,{ordinal:"08",label:"Next lane",meta:`${s} / ${e.scopedLanes.length}`,icon:t.jsx(Re,{dir:"right"}),disabled:e.scopedLanes.length<2,onClick:()=>e.stepLane(1)})]})]}),t.jsxs("footer",{className:"ops__status",children:[t.jsxs("span",{className:"ops__status-online","data-connection":e.connection,children:[t.jsx("i",{}),U]}),t.jsx("span",{children:n.hostName}),t.jsxs("span",{children:["ROUTE ",t.jsxs("strong",{children:["CH ",s]})]}),e.attention.length>0?t.jsxs("span",{className:"ops__status-attn",children:["ATTN ",e.attention.length]}):null,t.jsxs("span",{children:["HOSTS ",t.jsx("strong",{children:e.hosts.length})]}),t.jsxs("span",{children:["LIVE ",t.jsx("strong",{children:e.activeCount})]}),t.jsxs("span",{children:["VIEW · ",t.jsx("strong",{children:"OPS"})]})]}),t.jsx(Be,{model:e})]})}function ga({lane:e,index:n,active:s,model:a}){const r=e.events[0],l=s&&a.phaseTone!=="quiet"?a.phaseTone:le(e);return t.jsxs("button",{type:"button",className:"ops-channel","data-active":s||void 0,"data-tone":l,onClick:()=>a.selectLane(e),"aria-pressed":s,"aria-label":`Channel ${n+1}, ${e.name}, ${Y(e.state)}`,children:[t.jsxs("span",{className:"ops-channel__head",children:[t.jsxs("small",{children:["CH ",String(n+1).padStart(2,"0")]}),t.jsx("em",{"aria-hidden":"true",children:"▰"}),t.jsx("strong",{children:e.hostName}),t.jsx("i",{}),t.jsx("small",{children:s?pt(a.phase,e.state):Y(e.state)})]}),t.jsx("span",{className:"ops-channel__rule"}),t.jsxs("span",{className:"ops-channel__identity",children:[t.jsx("strong",{children:e.name}),t.jsxs("small",{children:[e.harness??"agent"," · ",e.model??"default"]})]}),t.jsx("span",{className:"ops-channel__task",children:r?.text??e.projectRoot??"No recent activity"}),t.jsxs("span",{className:"ops-channel__signal",children:[t.jsx("i",{}),t.jsx("small",{children:r?.detail||(s?"controller selected":"tap to put on deck")}),t.jsx("time",{children:de(r?.at??e.updatedAt)})]}),t.jsxs("span",{className:"ops-channel__foot",children:[t.jsxs("strong",{children:[t.jsx("i",{}),s?"ON DECK":"TAP TO SWITCH"]}),t.jsx("small",{children:pe(e.transport).toUpperCase()})]})]})}function G({ordinal:e,label:n,meta:s,glyph:a,icon:r,active:l,disabled:u=!1,onClick:p}){return t.jsxs("button",{type:"button",className:"ops-command","data-active":l||void 0,disabled:u,onClick:p,"aria-pressed":l??void 0,title:`${n} · ${s}`,children:[t.jsx("span",{className:"ops-command__icon",children:r??a}),t.jsxs("span",{children:[t.jsx("strong",{children:n}),t.jsxs("small",{children:[e," · ",s.toUpperCase()]})]})]})}function xa({model:e}){const n=e.selected;if(!n)return t.jsx("div",{className:"yoke yoke--standby",children:t.jsx(yt,{model:e})});const s=e.scopedLanes.length,a=Math.max(1,e.selectedIndex+1);return t.jsxs("div",{className:"yoke",children:[t.jsxs("div",{className:"yoke__grip yoke__grip--left",children:[t.jsx(Me,{model:e,size:"xl"}),t.jsx($e,{model:e}),t.jsx(jn,{model:e,block:!0}),t.jsxs("div",{className:"yoke__stepper",role:"group","aria-label":"Lane navigation",children:[t.jsx("button",{type:"button",onClick:()=>e.stepLane(-1),disabled:s<2,"aria-label":"Previous lane",children:t.jsx(Re,{dir:"left"})}),t.jsxs("span",{children:[t.jsx("strong",{children:String(a).padStart(2,"0")}),t.jsxs("small",{children:["of ",String(s).padStart(2,"0")]})]}),t.jsx("button",{type:"button",onClick:()=>e.stepLane(1),disabled:s<2,"aria-label":"Next lane",children:t.jsx(Re,{dir:"right"})})]}),t.jsx("div",{className:"yoke__ladder",role:"group","aria-label":"Lane ladder",children:e.scopedLanes.map((r,l)=>t.jsxs("button",{type:"button","data-active":r.key===n.key||void 0,"data-tone":le(r),onClick:()=>e.selectLane(r),"aria-pressed":r.key===n.key,"aria-label":`${r.name} on ${r.hostName} — ${Y(r.state)}`,title:`${r.name} · ${r.hostName} · ${Y(r.state)}`,children:[t.jsx("span",{children:String(l+1).padStart(2,"0")}),t.jsx("i",{"aria-hidden":"true"})]},r.key))}),t.jsxs("div",{className:"yoke__grip-keys",children:[t.jsx(kt,{model:e}),t.jsx(Sn,{model:e})]}),t.jsxs("div",{className:"yoke__grip-foot",children:[t.jsx("span",{className:"deck-kicker",children:"Lane traffic"}),t.jsx(ia,{model:e})]})]}),t.jsxs("section",{className:"yoke__stage",children:[t.jsxs("header",{className:"yoke__head",children:[t.jsx("div",{className:"yoke__head-task",children:t.jsx(bn,{model:e,size:"lg"})}),t.jsxs("div",{className:"yoke__head-lane",children:[t.jsx("h2",{children:n.name}),t.jsx("p",{children:n.projectRoot??"Project unavailable"})]})]}),t.jsx(De,{model:e}),t.jsxs("div",{className:"yoke__viewport",children:[t.jsxs("div",{className:"yoke__viewport-head",children:[t.jsx(jt,{model:e}),t.jsxs("span",{className:"deck-kicker",children:[n.hostName," / ",n.id]})]}),t.jsx("div",{className:"yoke__viewport-body",children:t.jsx(St,{model:e,limit:10})})]}),t.jsxs("div",{className:"yoke__dock",children:[t.jsx(Pe,{model:e}),t.jsx(vt,{model:e,rows:2})]})]}),t.jsxs("aside",{className:"yoke__grip yoke__grip--right","aria-label":"Session status",children:[t.jsxs("div",{className:"yoke__status",children:[t.jsx(qe,{model:e}),t.jsxs("dl",{children:[t.jsxs("div",{children:[t.jsx("dt",{children:"Lane state"}),t.jsx("dd",{children:Y(n.state)})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Harness"}),t.jsx("dd",{children:n.harness??"unknown"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Model"}),t.jsx("dd",{children:n.model??"default"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Transport"}),t.jsx("dd",{title:pe(n.transport),children:Zs(n.transport)})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Live lanes"}),t.jsxs("dd",{children:[e.activeCount," of ",s]})]})]})]}),t.jsxs("div",{className:"yoke__grip-keys",children:[t.jsx(yn,{model:e}),t.jsx(_n,{model:e})]}),t.jsxs("div",{className:"yoke__attention",children:[t.jsxs("span",{className:"deck-kicker",children:["Needs you · ",String(e.attention.length).padStart(2,"0")]}),t.jsx(mn,{model:e})]}),t.jsxs("div",{className:"yoke__scope",children:[t.jsx("span",{className:"deck-kicker",children:"Host scope"}),t.jsx(bt,{model:e})]})]}),t.jsx(Be,{model:e})]})}function Sa(){const e=Vs(),n=e.hosts.find(a=>a.state==="connected"),s=e.preview?{state:"preview",label:"PREVIEW",detail:"sample lanes · controls simulate locally"}:e.connection==="ready"||e.connection==="partial"?{state:e.connection==="ready"?"live":"partial",label:e.connection==="ready"?"LIVE":"DEGRADED",detail:`${n?.name??"host"} · Scout-managed Codex control`}:{state:"offline",label:"OFFLINE",detail:"no host connected"};return t.jsxs("main",{className:"scout-deck","data-connection":e.connection,"data-treatment":e.treatment,"data-preview":e.preview||void 0,children:[t.jsxs("header",{className:"scout-deck__strip",children:[t.jsxs("div",{className:"scout-deck__brand",children:[e.treatment==="ops"?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"scout-deck__ops-brand",children:[t.jsx("strong",{children:"SCOUT"}),t.jsx("i",{children:"·"}),t.jsx("small",{children:"OPS"})]}),t.jsxs("span",{className:"scout-deck__ops-mode",children:[t.jsx("i",{}),"AGENT DECK"]})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"scout-deck__mark","aria-hidden":"true",children:"S"}),t.jsxs("span",{className:"scout-deck__wordmark",children:[t.jsx("strong",{children:"Deck"}),t.jsx("small",{children:ot[e.treatment].tagline})]})]}),t.jsxs("span",{className:"scout-deck__source","data-state":s.state,title:e.preview?"Every lane, thread, and turn on screen is local sample data. No host is attached.":s.detail,children:[t.jsx("strong",{children:s.label}),t.jsx("small",{children:s.detail})]})]}),e.treatment==="ops"?t.jsxs("span",{className:"scout-deck__ops-count",children:[e.hosts.length," HOST",e.hosts.length===1?"":"S"," · ",e.scopedLanes.length," AGENT",e.scopedLanes.length===1?"":"S"]}):null,t.jsx(aa,{model:e})]}),e.treatment==="ops"?t.jsx(fa,{model:e}):e.treatment==="console"?t.jsx(ha,{model:e}):e.treatment==="brief"?t.jsx(ua,{model:e}):t.jsx(xa,{model:e})]})}export{Sa as ScoutDeckSurface,Bs as buildDeckLanes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./index-
|
|
1
|
+
import{j as r}from"./index-DvLtl7rV.js";function o({children:e}){return r.jsx("div",{style:{background:"var(--bg)",color:"var(--ink)",minHeight:"100%",height:"100%",display:"flex",flexDirection:"column"},children:r.jsx("div",{className:"scout-surface-body",children:e})})}export{o as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as t}from"./index-
|
|
1
|
+
import{r as l,j as t}from"./index-DvLtl7rV.js";import{D as O,d as le,V as G,p as ne,a as ae}from"./fx-z37u1o2z.js";const re=[{title:"Tone (band-pass)",sliders:[{key:"lowCutHz",label:"Low cut",min:80,max:1200,step:10,format:s=>`${s.toFixed(0)} Hz`},{key:"highCutHz",label:"High cut",min:1500,max:6e3,step:50,format:s=>`${s.toFixed(0)} Hz`},{key:"bandQ",label:"Filter Q",min:.2,max:2,step:.05,format:s=>s.toFixed(2)}]},{title:"Grit (saturation + bit-crush)",sliders:[{key:"saturationAmount",label:"Saturation",min:0,max:1,step:.01,format:s=>s.toFixed(2)},{key:"bitcrushAmount",label:"Bit-crush",min:0,max:1,step:.01,format:s=>s.toFixed(2)}]},{title:"Carrier hiss",sliders:[{key:"hissGain",label:"Hiss level",min:0,max:.25,step:.005,format:s=>s.toFixed(3)},{key:"hissCutoffHz",label:"Hiss high-pass",min:300,max:4e3,step:50,format:s=>`${s.toFixed(0)} Hz`}]},{title:"Presence (mid-band peak — comm intelligibility)",sliders:[{key:"presencePeakDb",label:"Boost",min:0,max:12,step:.5,format:s=>`${s.toFixed(1)} dB`},{key:"presenceCenterHz",label:"Center",min:600,max:3e3,step:50,format:s=>`${s.toFixed(0)} Hz`},{key:"presenceQ",label:"Q (narrowness)",min:.3,max:3,step:.1,format:s=>s.toFixed(1)}]},{title:"Squelch tail (channel-drop noise)",sliders:[{key:"squelchTailGain",label:"Tail gain",min:0,max:.3,step:.005,format:s=>s.toFixed(3)},{key:"squelchTailDurationMs",label:"Tail length",min:40,max:500,step:10,format:s=>`${s.toFixed(0)} ms`}]},{title:"Compressor",sliders:[{key:"compressorThresholdDb",label:"Threshold",min:-60,max:0,step:1,format:s=>`${s.toFixed(0)} dB`},{key:"compressorRatio",label:"Ratio",min:1,max:12,step:.5,format:s=>`${s.toFixed(1)} : 1`}]},{title:"Delivery",sliders:[{key:"playbackRate",label:"Speed (pitch-shifts)",min:.75,max:1.35,step:.01,format:s=>`${s.toFixed(2)}×`}]},{title:"Kerchunk / output",sliders:[{key:"clickGain",label:"Click gain",min:0,max:1,step:.01,format:s=>s.toFixed(2)},{key:"clickDurationMs",label:"Click length",min:20,max:200,step:5,format:s=>`${s.toFixed(0)} ms`},{key:"outputGain",label:"Output gain",min:0,max:2,step:.05,format:s=>s.toFixed(2)},{key:"wetMix",label:"Wet mix",min:0,max:1,step:.01,format:s=>s.toFixed(2)}]}],B=.12,ie=s=>Math.max(.7,Math.min(1.45,s)),ce=220,w={...O,lowCutHz:160,highCutHz:5200,bandQ:.35,saturationAmount:.035,bitcrushAmount:0,hissGain:0,hissCutoffHz:1800,presencePeakDb:1.5,presenceCenterHz:1500,presenceQ:.65,compressorThresholdDb:-15,compressorRatio:2.2,clickEnabled:!0,clickGain:.24,clickDurationMs:45,squelchTailEnabled:!0,squelchTailGain:.018,squelchTailDurationMs:95,playbackRate:1,outputGain:1,wetMix:.38},de={...w,lowCutHz:190,highCutHz:5e3,saturationAmount:.055,bitcrushAmount:.01,hissGain:.006,presencePeakDb:2.5,compressorThresholdDb:-17,compressorRatio:2.8,clickGain:.28,squelchTailGain:.024,squelchTailDurationMs:105,wetMix:.44};function ue(s){return`const SCOUTBOT_VOICE_FX: Partial<VoiceFxParams> = {
|
|
2
2
|
${Object.entries(s).map(([x,u])=>` ${x}: ${typeof u=="number"?Number(u.toFixed(3)):String(u)},`).join(`
|
|
3
3
|
`)}
|
|
4
4
|
};`}function Xe(){const[s,D]=l.useState(null),[x,u]=l.useState(null),[j,X]=l.useState({}),[a,i]=l.useState(w),[U,c]=l.useState(null),[E,C]=l.useState(null),[N,F]=l.useState(null),[p,Q]=l.useState(!1),[f,K]=l.useState(!1),b=l.useRef(null),d=l.useRef(null),m=l.useRef(a),P=l.useRef(p),A=l.useRef(f);l.useEffect(()=>{m.current=a},[a]),l.useEffect(()=>{P.current=p},[p]),l.useEffect(()=>{A.current=f},[f]),l.useEffect(()=>{let e=!1;return(async()=>{try{const o=await fetch("/api/dev/scoutbot-fx/fixtures");if(!o.ok)throw new Error(`HTTP ${o.status}`);const n=await o.json();e||D(n)}catch(o){e||u(o instanceof Error?o.message:String(o))}})(),()=>{e=!0}},[]);const H=l.useCallback(async e=>{if(j[e.slug])return j[e.slug].buffer;const o=await le(`/api/dev/scoutbot-fx/audio/${encodeURIComponent(e.file)}`);return X(n=>({...n,[e.slug]:{fixture:e,buffer:o}})),o},[j]),h=l.useCallback(()=>{d.current=null,b.current?.stop(),b.current=null,C(null)},[]),Y=l.useCallback(e=>{const o=G.find(n=>n.id===e);o&&(i(o.params),c(e))},[]),J=l.useCallback(async()=>{try{await navigator.clipboard.writeText(ue(a)),F("Copied"),window.setTimeout(()=>F(null),1600)}catch(e){F(e instanceof Error?e.message:"Copy failed")}},[a]),g=l.useCallback(async(e,o)=>{h();const n=Symbol(`${o}:${e.slug}`);d.current=n;const S=`${o}:${e.slug}`;try{const r=await H(e);for(;d.current===n;){const v=A.current?{...m.current,playbackRate:ie(m.current.playbackRate+(Math.random()*2-1)*B)}:m.current,I=o==="fx"?ne(r,{params:v}):ae(r);if(b.current=I,C(S),await I.promise,d.current!==n||!P.current)break;await new Promise(M=>{const se=setTimeout(M,ce),oe=setInterval(()=>{d.current!==n&&(clearTimeout(se),clearInterval(oe),M())},40)})}}catch(r){console.error(`[scoutbot-fx] ${o} playback failed`,r)}finally{d.current===n&&(d.current=null),b.current=null,C(r=>r===S?null:r)}},[H,h]),Z=l.useCallback(e=>g(e,"fx"),[g]),ee=l.useCallback(e=>g(e,"dry"),[g]),te=l.useMemo(()=>re.map(e=>({title:e.title,rows:e.sliders.map(o=>({spec:o,value:a[o.key]}))})),[a]),$=s?.fixtures??[];return t.jsxs("div",{style:pe,children:[t.jsxs("header",{style:ye,children:[t.jsxs("div",{children:[t.jsx("h1",{style:xe,children:"Scoutbot FX Lab"}),t.jsxs("p",{style:fe,children:["Dispatcher-radio FX prototyping. Generate fixtures with"," ",t.jsx("code",{style:L,children:"node packages/web/scripts/generate-scoutbot-fx-fixtures.mjs"}),"."]})]}),t.jsxs("div",{style:be,children:[s?.generatedAt?t.jsxs("span",{children:["Fixtures generated ",new Date(s.generatedAt).toLocaleString()]}):null,s?.note?t.jsx("span",{style:me,children:s.note}):null,x?t.jsxs("span",{style:he,children:["Could not load fixtures: ",x]}):null]})]}),t.jsxs("section",{style:ge,children:[t.jsxs("div",{style:T,children:[t.jsx("h2",{style:R,children:"Presets"}),t.jsx("div",{style:Se,children:"Click to load. Tweaking any slider clears the active preset."})]}),t.jsx("div",{style:ke,children:G.map(e=>{const o=U===e.id;return t.jsxs("button",{type:"button",style:o?je:q,onClick:n=>{Y(e.id),n.currentTarget.blur()},title:e.description,children:[t.jsxs("div",{style:o?Ce:V,children:[e.label,t.jsx("span",{style:ve,children:e.family})]}),t.jsx("div",{style:o?Fe:W,children:e.description})]},e.id)})})]}),t.jsxs("section",{style:Te,children:[t.jsxs("div",{style:T,children:[t.jsx("h2",{style:R,children:"FX chain"}),t.jsxs("div",{style:{display:"flex",gap:8},children:[t.jsxs("label",{style:k,children:[t.jsx("input",{type:"checkbox",checked:a.clickEnabled,onChange:e=>{const o=e.target.checked;c(null),i(n=>({...n,clickEnabled:o}))}}),"Kerchunk click"]}),t.jsxs("label",{style:k,children:[t.jsx("input",{type:"checkbox",checked:a.squelchTailEnabled,onChange:e=>{const o=e.target.checked;c(null),i(n=>({...n,squelchTailEnabled:o}))}}),"Squelch tail"]}),t.jsx("button",{type:"button",style:y,onClick:()=>{c("scoutbot-clean-dispatch"),i(w)},children:"Scoutbot default"}),t.jsx("button",{type:"button",style:y,onClick:()=>{c("codex-clean-dispatch"),i(de)},children:"Codex take"}),t.jsx("button",{type:"button",style:y,onClick:()=>{c(null),i(O)},children:"Raw default"}),t.jsx("button",{type:"button",style:z,onClick:()=>{J()},children:N??"Copy params"})]})]}),t.jsx("div",{style:Re,children:te.map(e=>t.jsxs("div",{style:we,children:[t.jsx("div",{style:ze,children:e.title}),t.jsx("div",{style:De,children:e.rows.map(({spec:o,value:n})=>t.jsxs("label",{style:Ee,children:[t.jsxs("div",{style:Pe,children:[t.jsx("span",{children:o.label}),t.jsx("span",{style:Ae,children:o.format(n)})]}),t.jsx("input",{type:"range",min:o.min,max:o.max,step:o.step,value:n,onChange:S=>{const r=Number(S.target.value);c(null),i(v=>({...v,[o.key]:r}))}})]},o.key))})]},e.title))})]}),t.jsxs("section",{style:He,children:[t.jsxs("div",{style:T,children:[t.jsx("h2",{style:R,children:"Fixtures"}),t.jsxs("div",{style:{display:"flex",gap:16},children:[t.jsxs("label",{style:k,children:[t.jsx("input",{type:"checkbox",checked:p,onChange:e=>Q(e.target.checked)}),"Loop playback",p?" (tweaks apply next iteration)":""]}),t.jsxs("label",{style:k,children:[t.jsx("input",{type:"checkbox",checked:f,onChange:e=>K(e.target.checked)}),"Vary speed ±",Math.round(B*100),"%"]})]})]}),s?$.length===0?t.jsxs("p",{style:_,children:["No fixtures yet. Run"," ",t.jsx("code",{style:L,children:"node packages/web/scripts/generate-scoutbot-fx-fixtures.mjs"})," ","(Vox must be running) and reload."]}):t.jsx("ul",{style:$e,children:$.map(e=>{const o=E===`dry:${e.slug}`,n=E===`fx:${e.slug}`;return t.jsxs("li",{style:Ie,children:[t.jsxs("div",{style:Me,children:[t.jsx("div",{style:Ge,children:e.slug}),t.jsx("div",{style:Be,children:e.text}),t.jsxs("div",{style:Le,children:[e.voiceId?`voice ${e.voiceId}`:null,e.voiceId&&e.bytes?" · ":null,e.bytes?`${Math.round(e.bytes/1024)} KB`:null]})]}),t.jsxs("div",{style:_e,children:[t.jsx("button",{type:"button",style:o?Oe:y,onClick:()=>o?h():ee(e),children:o?"Stop":"Play dry"}),t.jsx("button",{type:"button",style:n?qe:z,onClick:()=>n?h():Z(e),children:n?"Stop":"Play with FX"})]})]},e.slug)})}):t.jsx("p",{style:_,children:"Loading…"})]})]})}const pe={minHeight:"100vh",background:"#0b0d10",color:"#e6e8eb",padding:"32px 40px 64px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},ye={display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:24,marginBottom:28},xe={fontSize:22,fontWeight:600,margin:0},fe={color:"#9aa1ab",fontSize:13,marginTop:6,marginBottom:0},be={display:"flex",flexDirection:"column",gap:4,fontSize:12,color:"#9aa1ab",alignItems:"flex-end"},me={color:"#f5b342"},he={color:"#ef6b6b"},L={fontFamily:"ui-monospace, SFMono-Regular, monospace",background:"#181b20",padding:"1px 6px",borderRadius:4,fontSize:12},ge={background:"#121519",border:"1px solid #1f242b",borderRadius:10,padding:20,marginBottom:18},Se={fontSize:11,color:"#6b727d"},ke={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:10,marginTop:12},q={textAlign:"left",background:"#0f1216",borderWidth:1,borderStyle:"solid",borderColor:"#1f242b",borderRadius:8,padding:"12px 14px",color:"#c5cad2",cursor:"pointer",display:"flex",flexDirection:"column",gap:6,fontFamily:"inherit",outline:"none",WebkitAppearance:"none",appearance:"none",transition:"border-color 80ms ease, background 80ms ease, color 80ms ease"},je={...q,background:"#1a1f26",borderColor:"#f1f3f5",color:"#ffffff",boxShadow:"0 0 0 1px rgba(241,243,245,0.18)"},V={fontSize:13,fontWeight:600,display:"flex",alignItems:"center",gap:8},Ce={...V,color:"#ffffff"},W={fontSize:11,color:"#9aa1ab",lineHeight:1.4},Fe={...W,color:"#c5cad2"},ve={fontSize:9,fontWeight:500,letterSpacing:.6,textTransform:"uppercase",padding:"2px 6px",borderRadius:4,background:"rgba(255,255,255,0.06)",color:"#9aa1ab"},Te={background:"#121519",border:"1px solid #1f242b",borderRadius:10,padding:20,marginBottom:28},T={display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},R={fontSize:14,textTransform:"uppercase",letterSpacing:.6,color:"#9aa1ab",margin:0},Re={display:"flex",flexDirection:"column",gap:18},we={display:"flex",flexDirection:"column",gap:10},ze={fontSize:11,textTransform:"uppercase",letterSpacing:.8,color:"#6b727d",fontWeight:600},De={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:16},Ee={display:"flex",flexDirection:"column",gap:6,fontSize:12},Pe={display:"flex",justifyContent:"space-between",color:"#c5cad2"},Ae={color:"#7f8693",fontFamily:"ui-monospace, SFMono-Regular, monospace"},He={background:"#121519",border:"1px solid #1f242b",borderRadius:10,padding:20},$e={listStyle:"none",padding:0,margin:"16px 0 0",display:"flex",flexDirection:"column",gap:12},Ie={display:"flex",alignItems:"center",gap:16,background:"#0f1216",border:"1px solid #1f242b",borderRadius:8,padding:"14px 16px"},Me={flex:1,display:"flex",flexDirection:"column",gap:4},Ge={fontFamily:"ui-monospace, SFMono-Regular, monospace",color:"#9aa1ab",fontSize:12},Be={color:"#e6e8eb",fontSize:14},Le={color:"#6b727d",fontSize:11},_e={display:"flex",gap:8},y={background:"#1c2128",color:"#e6e8eb",borderWidth:1,borderStyle:"solid",borderColor:"#2a3038",padding:"6px 12px",borderRadius:6,fontSize:12,cursor:"pointer"},Oe={...y,background:"#2a3038",borderColor:"#3c4350"},z={background:"#2e6cdf",color:"#fff",borderWidth:1,borderStyle:"solid",borderColor:"#2e6cdf",padding:"6px 12px",borderRadius:6,fontSize:12,cursor:"pointer"},qe={...z,background:"#1f57bf",borderColor:"#1f57bf"},k={display:"flex",alignItems:"center",gap:6,fontSize:12,color:"#c5cad2",cursor:"pointer"},_={color:"#9aa1ab",fontSize:13,margin:"12px 0 0"};export{Xe as ScoutbotFxLab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./index-
|
|
1
|
+
import{j as a}from"./index-DvLtl7rV.js";import"./secondaryNavConfig-BoQ_zYR9.js";function b({ariaLabel:r,activeRoute:l,groups:t,navigate:o,className:n=""}){return a.jsx("nav",{className:`s-secondary-nav${n?` ${n}`:""}`,"aria-label":r,children:t.map((s,i)=>a.jsxs("div",{className:"s-secondary-nav-group",children:[s.label&&a.jsx("span",{className:"s-secondary-nav-label",children:s.label}),a.jsx("div",{className:"s-secondary-nav-switch",children:s.items.map(e=>{const c=e.active(l);return a.jsx("button",{type:"button","aria-pressed":c,className:`s-secondary-nav-button${c?" s-secondary-nav-button--active":""}`,onClick:()=>o(e.route),children:e.label},e.id)})})]},s.label??i))})}export{b as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,j as r}from"./index-DvLtl7rV.js";import{a as R}from"./api-Co9aQ2Jw.js";import{d as y,S as j}from"./SessionObserve-dQDN23pP.js";import{u as x}from"./sse-CD9MMUxl.js";import{u as _}from"./tail-events-Ps8KpKah.js";import{ConversationScreen as g}from"./ConversationScreen-CR9pWB65.js";import{SessionObserveEmbedStatus as M}from"./SessionObserveEvidence-BRBGKAgd.js";import{d as w,b as N,s as p}from"./session-ref-lookup-state-SATH_jAP.js";const T=6e4,O=1e3,C=1e4;function u({children:e}){return r.jsx("div",{className:"s-observe-embed-page",children:e})}function d({title:e,detail:s}){return r.jsx(u,{children:r.jsxs("div",{className:"s-observe-embed-empty",children:[r.jsx("div",{className:"s-observe-embed-empty-title",children:e}),s&&r.jsx("div",{className:"s-observe-embed-empty-detail",children:s})]})})}function S({lookup:e}){const s=y({source:e.observe.source,fidelity:e.observe.fidelity,live:e.observe.data.live,eventCount:e.observe.data.events.length});return r.jsxs(u,{children:[r.jsx(M,{source:e.observe.source,fidelity:e.observe.fidelity,sessionId:e.observe.sessionId??e.observe.refId,evidence:s}),r.jsx(j,{data:e.observe.data,agentId:e.observe.agentId??e.session?.agentId??void 0,sessionId:e.observe.sessionId??e.observe.refId,showRail:!1,observeSource:e.observe.source,observeFidelity:e.observe.fidelity})]})}function f(){const e=typeof window>"u"?"":new URLSearchParams(window.location.search).get("ref")?.trim()??"",[s,v]=o.useState(null),[I,c]=o.useState(!0),[b,m]=o.useState(null),i=o.useRef(null),l=o.useRef(null),a=o.useCallback(async(n=!1)=>{if(!e){c(!1);return}l.current=Date.now(),n||c(!0),m(null);try{const t=await R(`/api/session-ref/${encodeURIComponent(e)}`);v(t)}catch(t){n||v(null),m(t instanceof Error?t.message:String(t))}finally{c(!1)}},[e]);o.useEffect(()=>{l.current=null,a();const n=window.setInterval(()=>{a(!0)},T);return()=>{window.clearInterval(n),i.current&&(clearTimeout(i.current),i.current=null)}},[a]);const E=o.useCallback(()=>{if(i.current)return;const n=w({nowMs:Date.now(),lastRefreshAtMs:l.current,debounceMs:O,minimumIntervalMs:C});i.current=setTimeout(()=>{i.current=null,a(!0)},n)},[a]);return x(n=>{const t=[e,s?.refId,s?.kind==="conversation"?s.conversationId:null,s?.session?.agentId,s?.kind==="observe"?s.observe.agentId:null,s?.kind==="observe"?s.observe.sessionId:null];N(n,t)&&E()}),_(n=>{[e,s?.refId,s?.kind==="observe"?s.observe.sessionId:null,s?.kind==="observe"?s.observe.data.metadata?.session?.externalSessionId:null].some(h=>p(n.sessionId,h))&&E()}),e?b&&!s?r.jsx(d,{title:"Session unavailable",detail:b}):I&&!s?r.jsx(d,{title:"Resolving session",detail:e}):s?s.kind==="conversation"?r.jsx(u,{children:r.jsx(g,{conversationId:s.conversationId,navigate:()=>{},embedded:!0,showBackNav:!1})}):r.jsx(S,{lookup:s}):r.jsx(d,{title:"Session not found",detail:"This session may have ended or its archive is not on this machine."}):r.jsx(d,{title:"No session reference",detail:"This embed needs a ?ref=<sessionId> query parameter."})}const U=Object.freeze(Object.defineProperty({__proto__:null,SessionEmbedObserveContent:S,SessionEmbedScreen:f,default:f},Symbol.toStringTag,{value:"Module"})),$=Object.freeze(Object.defineProperty({__proto__:null,SessionEmbedScreen:f},Symbol.toStringTag,{value:"Module"}));export{U as S,$ as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as h,j as t}from"./index-
|
|
1
|
+
import{r as h,j as t}from"./index-DvLtl7rV.js";import{f as je}from"./bash-format-BRV5C6Gv.js";import{j as ks,p as Ue,k as ys}from"./tail-display-DcliDVkW.js";import{l as Ns}from"./lane-edit-display-C_Aujldz.js";import{f as ws}from"./lane-tool-detail-0WhMf4Vj.js";import{useLaneToolHoverCard as Cs}from"./LaneToolHoverCard-HByf2ndx.js";import{e as Ss,L as Oe,g as Ts,h as $s,j as Ae,o as Ls,b as Ie,f as Es,k as Rs,m as ke,l as Ve,a as Ke}from"./lane-observe-vfyACHi0.js";import{b as Ps}from"./lane-ask-display-B6iCAVcd.js";import{d as Os}from"./colors-BtO5_zlx.js";import{a as ye}from"./api-Co9aQ2Jw.js";import{r as Je}from"./mentions-DG6OQrsc.js";import{a as As,g as Ye,t as Is,b as Bs,d as _s,n as Be}from"./time-Dhsh_2EG.js";import{M as Xe}from"./message-markup-C2LQDm_k.js";import{q as Fs}from"./terminal-takeover-_Jyys4me.js";import{C as Ds,D as Ms,E as Ws}from"./NewChatComposer-_Stj0fZy.js";import{u as Ne,k as Ze}from"./Provider-CtXJeLrP.js";import{o as zs}from"./openContent-C6XO6kr5.js";import{O as Hs}from"./ObservedTopologyPanel-BJUhDSuQ.js";import{M as Gs}from"./text-BP3oyl8-.js";import"./index-zvhpRHao.js";import{ObserveReasoningDisclosure as qs,ObserveStreamCursor as _e}from"./ObserveTextFlow-ZQWwrK3i.js";import{SessionObserveReceiptView as Us}from"./SessionObserveEvidence-BRBGKAgd.js";import{M as Vs}from"./message-circle-mZCv8tvB.js";import{W as Ks}from"./wrench-DjkoAOQt.js";import{E as Js}from"./external-link-Dp_a2vRZ.js";import{C as Qe}from"./chevron-down-wciXnOQz.js";import{c as Ys}from"./createLucideIcon-DezKXSG2.js";const Xs=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Zs=Ys("tag",Xs),we=new Set(["bash","shell","terminal","exec","run","command","exec_command","shell_command","local_shell","container_exec","container.exec"]);function I(e){return(e??"").trim()}function q(e){return[e.kind,I(e.tool),I(e.arg),I(e.text),I(e.detail)].join("|")}function Qs(e){if(e.kind!=="tool"||!e.tool||e.result)return!1;const s=I(e.arg).toLowerCase();return s==="started"||s.length>0&&s!=="completed"}function et(e){return e.kind!=="tool"||!e.tool?!1:I(e.arg).toLowerCase()==="completed"||!!e.result?.outcome}const es=/^permission requested · ([A-Za-z][\w-]*)$/i,ss=/^permission ([a-z_]+) · ([A-Za-z][\w-]*)$/i;function Ce(e){return e.kind==="system"&&es.test(e.text.trim())}function Se(e){return e.kind==="system"&&ss.test(e.text.trim())}function de(e){const s=e.text.trim(),n=s.match(es);if(n?.[1])return n[1];const a=s.match(ss);return a?.[2]?a[2]:null}function Zn(e){const s=new Set;for(const n of e)if(Ce(n)){const a=de(n);a&&s.add(a)}else if(Se(n)){const a=de(n);a&&s.delete(a)}return s.size>0}function st(e,s){const n=e.text.trim();return{...e,text:s>1?`${n}
|
|
2
2
|
|
|
3
3
|
(${s} reasoning updates)`:n}}function tt(e,s){const n=s.tool??e.tool,a=s.result?.outcome,r=e.arg&&e.arg!=="started"&&e.arg!=="completed"?e.arg:s.arg&&s.arg!=="completed"?s.arg:void 0,o=s.stream?.join(`
|
|
4
4
|
`)??"",l=r?o.trim()?`${n} · ${r} · ${o}`:a?`${n} · ${r} · ${a}`:`${n} · ${r}`:s.text.trim()||(a?`${n} completed · ${a}`:`${n} completed`);return{...s,tool:n,arg:r??"completed",text:l,stream:s.stream??e.stream,diff:s.diff??e.diff,detail:s.detail??e.detail,live:s.live??e.live}}function nt(e){if(e.kind!=="tool"||!e.tool)return!1;const s=I(e.tool).toLowerCase();if(!we.has(s))return!1;const n=I(e.arg);return n.length>0&&n!=="started"&&n!=="completed"}function at(e){if(e.kind!=="tool")return!1;const s=I(e.tool).toLowerCase();return s==="res"?!!(I(e.arg)||(e.stream?.length??0)>0):we.has(s)?(e.stream?.length??0)>0:!1}function rt(e){return(e.stream?.length??0)>0?e.stream.join(`
|
package/dist/client/assets/{SessionObserveEvidence-DopQYDkD.js → SessionObserveEvidence-BRBGKAgd.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-DvLtl7rV.js";function n(e){return e?e.length>18?`${e.slice(0,8)}...${e.slice(-6)}`:e:"no session"}function l({source:e,fidelity:r,sessionId:t,evidence:i}){return s.jsxs("div",{className:"s-observe-embed-status","data-tone":i.tone,children:[s.jsx("span",{className:"s-observe-embed-status-source",children:e}),s.jsx("span",{children:r}),s.jsx("span",{title:t??void 0,children:n(t)}),s.jsx("span",{children:i.eventCountLabel}),i.tone==="live"&&s.jsx("span",{className:"s-observe-embed-status-live",children:"Live"})]})}function o({events:e}){return s.jsxs("section",{className:"s-observe-receipt-view","aria-label":"Session setup receipts",children:[s.jsxs("div",{className:"s-observe-receipt-view-copy",children:[s.jsx("strong",{children:"No observed trace activity"}),s.jsx("span",{children:"These broker lifecycle records confirm setup only."})]}),e.length>0&&s.jsx("ul",{className:"s-observe-receipt-list",children:e.map(r=>s.jsxs("li",{className:"s-observe-receipt",children:[s.jsx("span",{children:r.text}),r.detail&&s.jsx("small",{children:r.detail})]},r.id))})]})}export{l as SessionObserveEmbedStatus,o as SessionObserveReceiptView};
|