@openscout/scout 0.2.105 → 0.2.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/chat.mjs +23 -1
- package/dist/client/assets/ActivityScreen-CZmGwQ2U.js +1 -0
- package/dist/client/assets/{AddProjectForm-CHNJ4NnS.js → AddProjectForm-CusDRiVO.js} +1 -1
- package/dist/client/assets/{AdventureEvidence-B4mEvXeD.js → AdventureEvidence-CyegKk1V.js} +1 -1
- package/dist/client/assets/{AdventureReader-ZsBDQITY.js → AdventureReader-X-hbTOi0.js} +1 -1
- package/dist/client/assets/{AdventureScenery-DSxDlqG1.js → AdventureScenery-LPXSVP67.js} +1 -1
- package/dist/client/assets/AgentAdventures-BAgxdOF8.js +1 -0
- package/dist/client/assets/AgentAvatar-CrP1eXxk.js +1 -0
- package/dist/client/assets/AgentConfigurationScreen-1L0IQm2w.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-DguGs7jZ.js +1 -0
- package/dist/client/assets/{AgentDetailCard-MIEBKw_S.js → AgentDetailCard-DtHT3sCo.js} +1 -1
- package/dist/client/assets/AgentFloorView-DH4jiDgw.js +1 -0
- package/dist/client/assets/{AgentFloorWorld-BTqwmK5G.js → AgentFloorWorld-CjoIa6jA.js} +1 -1
- package/dist/client/assets/AgentInfoScreen-DYtmKkeE.js +1 -0
- package/dist/client/assets/{AgentLaneCard-C4rKLLdT.js → AgentLaneCard-BaZ2g-f8.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-fGC-ZrJS.js → AgentLaneChrome-TF1SlJSc.js} +1 -1
- package/dist/client/assets/{AgentLaneDetailSheet-BTF4_th9.js → AgentLaneDetailSheet-EzEPsn3g.js} +1 -1
- package/dist/client/assets/{AgentLaneSummaryResize-DgSeA_vS.js → AgentLaneSummaryResize-dpp7YvrX.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-BlSof_6S.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-CcS23wij.js → AgentLanesPreflight-Ry-aqDTr.js} +1 -1
- package/dist/client/assets/AgentLanesView-BJi9xXz6.js +2 -0
- package/dist/client/assets/{AgentLiveActions-6Kfr1uOT.js → AgentLiveActions-CfTupTEl.js} +1 -1
- package/dist/client/assets/AgentMasterScreen-EJhmuKgl.js +1 -0
- package/dist/client/assets/AgentSessions-B1gOhDBf.js +6 -0
- package/dist/client/assets/AgentsConsole-RXGqRvcb.js +1 -0
- package/dist/client/assets/AgentsScreen-ChwMBs11.js +1 -0
- package/dist/client/assets/AgentsSubnav-DwNX4yy0.js +1 -0
- package/dist/client/assets/{AstronautSuit-D67fIBdR.js → AstronautSuit-Cchnc4Ug.js} +1 -1
- package/dist/client/assets/{AtopView-Ck30FbzG.js → AtopView-gkEp4y__.js} +1 -1
- package/dist/client/assets/{BackToPicker-CkBhGRlD.js → BackToPicker-CUkjnoVk.js} +1 -1
- package/dist/client/assets/BriefingDetailScreen-DrlC3qkm.js +1 -0
- package/dist/client/assets/{BriefingsScreen-DTxYMr3a.js → BriefingsScreen-B1HlBMGZ.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-crirZCdo.js → BrokerMetadataPanel-Dk242Yh_.js} +1 -1
- package/dist/client/assets/BrokerScreen-DwOF6bMA.js +8 -0
- package/dist/client/assets/{Canvas-CRP0KjKb.js → Canvas-X9pVSkw3.js} +1 -1
- package/dist/client/assets/{CastPicker-ZPomvOf-.js → CastPicker-BXUtPAGC.js} +1 -1
- package/dist/client/assets/ChannelComposer-DoK7IDGa.js +1 -0
- package/dist/client/assets/ChannelSidebar-e9DOPulb.js +1 -0
- package/dist/client/assets/{CharacterFamilyPreview-ckVkecDO.js → CharacterFamilyPreview-DMfw7UM_.js} +1 -1
- package/dist/client/assets/{ChatAvatar-DKBsbOqk.js → ChatAvatar-C3a_o5Hj.js} +1 -1
- package/dist/client/assets/ChatBits-CsvxbToF.js +1 -0
- package/dist/client/assets/{ChatCollapsedStrip-Co0NmqOO.js → ChatCollapsedStrip-FEmQ_G9J.js} +1 -1
- package/dist/client/assets/ChatRichInput-DhtwFxQE.js +31 -0
- package/dist/client/assets/ChatRightPanel-C1h_aIkn.js +1 -0
- package/dist/client/assets/ChatSpaceSurface-BXyLYKHn.js +1 -0
- package/dist/client/assets/ChatSpaceTheme-3wLZGsvT.css +1 -0
- package/dist/client/assets/ChatSpaceTheme-CUH8bTZc.js +1 -0
- package/dist/client/assets/{CodeDiffPane-D-iv28LJ.js → CodeDiffPane-DuQRwpgK.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-CZ3gDdiT.js → CodeProjectPicker-ZQ6gSBpg.js} +1 -1
- package/dist/client/assets/{CodeScreen-CSC-zbP9.js → CodeScreen-BXyKeL5T.js} +1 -1
- package/dist/client/assets/{CommsCanvas-DdNAwjGW.js → CommsCanvas-THp0r_U8.js} +1 -1
- package/dist/client/assets/{CommsDeck-mGWY7Ivi.js → CommsDeck-BVmSMV2V.js} +1 -1
- package/dist/client/assets/{CommsFlowGraph-voDD9M5R.js → CommsFlowGraph-DxoOaLF_.js} +1 -1
- package/dist/client/assets/{CommsFlowMap-C33sgD48.js → CommsFlowMap-Vi8ziCPg.js} +1 -1
- package/dist/client/assets/{CommsSelection-BL8aYD7z.js → CommsSelection-BUoRbu9o.js} +1 -1
- package/dist/client/assets/ComposerAttachments-DW0AIb8k.js +1 -0
- package/dist/client/assets/ConversationComposer-CUQyArlk.js +1 -0
- package/dist/client/assets/ConversationFeedRows-DWiOfT-y.js +1 -0
- package/dist/client/assets/ConversationHeader-C-ZWscKj.js +1 -0
- package/dist/client/assets/{ConversationPanels-6pprBpmq.js → ConversationPanels-D9oC0xG5.js} +2 -2
- package/dist/client/assets/ConversationScreen-9MlMnEo4.css +1 -0
- package/dist/client/assets/ConversationScreen-CUfsQ4MR.js +2 -0
- package/dist/client/assets/ConversationStatus--IPm2nGh.js +1 -0
- package/dist/client/assets/{CrewAvatar-D0c9z5Qr.css → CrewAvatar-BnIPIn_Z.css} +1 -1
- package/dist/client/assets/CrewAvatar-kTznzqcO.js +1 -0
- package/dist/client/assets/{CrewSprite-Dp9KBBGY.js → CrewSprite-Dhryjx2c.js} +1 -1
- package/dist/client/assets/CrewStage-vdO0qm3D.js +1 -0
- package/dist/client/assets/CrewWorkspaces-DCBzAAS4.js +1 -0
- package/dist/client/assets/{DataTable-av71ehJV.js → DataTable-aH-jCyDq.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-CcYGUB10.js → DispatchAftermath-66uQAorV.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-DlMiEALb.js → DocumentFocusViewer-DJr0v0D_.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-CTkO_tQR.js → EmbeddableSurfacesLab-BBa70EhJ.js} +1 -1
- package/dist/client/assets/{EmptyState-CYUwYyAW.js → EmptyState-CZlrHXy-.js} +1 -1
- package/dist/client/assets/{FileViewerPane-Cxhixtks.js → FileViewerPane-BAO6mtjD.js} +1 -1
- package/dist/client/assets/FleetRollCallHud-C5q2567n.js +1 -0
- package/dist/client/assets/FlightObserveScreen-DZ2mrw91.js +1 -0
- package/dist/client/assets/{FloorContextSheet-Vj_wVZq1.js → FloorContextSheet-2_NVPQor.js} +1 -1
- package/dist/client/assets/{FloorExchangePanel-CjHSDXad.js → FloorExchangePanel-BU1pPu8K.js} +1 -1
- package/dist/client/assets/{FloorMessagePasses-BG4ebnX5.js → FloorMessagePasses-cLW2UGNP.js} +1 -1
- package/dist/client/assets/{FloorReplay-BoYaGY9t.js → FloorReplay-VFzA6Kxc.js} +1 -1
- package/dist/client/assets/FloorResourcesSheet-C-kQ6Ren.js +1 -0
- package/dist/client/assets/{FloorSavedWork-jbtRs-YE.js → FloorSavedWork-BeHDejWz.js} +1 -1
- package/dist/client/assets/FloorTacticalHUD-CO-iiFpb.js +1 -0
- package/dist/client/assets/{FollowScreen-CupyOgt4.js → FollowScreen-CFfkIbc6.js} +1 -1
- package/dist/client/assets/HarnessMark-C4naWc16.js +1 -0
- package/dist/client/assets/HarnessesScreen-DX3NLcDG.js +1 -0
- package/dist/client/assets/{HerdrSession-Dcm3vf9U.js → HerdrSession-_t7yM8vX.js} +2 -2
- package/dist/client/assets/{HomeHero-pIZtE1cC.js → HomeHero-DouPyNmz.js} +1 -1
- package/dist/client/assets/{HostAdvisorView-Dv5meXo2.js → HostAdvisorView-CnM1i8hW.js} +1 -1
- package/dist/client/assets/InviteLandingScreen-CEjG2E34.js +1 -0
- package/dist/client/assets/InviteSheet-CwxZtWCl.js +1 -0
- package/dist/client/assets/{JumpPalette-BmiSOEmp.js → JumpPalette-O1aJE9gR.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-B8yiM524.js → KnowledgeSearchInspector-32n9baT-.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-Dd6jrQ0A.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-D2cnTeUd.js → LaneToolHoverCard-CJa110yk.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-DYrd0BIf.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-BLhVHwff.js → LaneTraceEventFocus-TbrNHRj_.js} +1 -1
- package/dist/client/assets/{MeshCanvas-BR25OBTJ.js → MeshCanvas-DWZHYh1A.js} +2 -2
- package/dist/client/assets/{MeshCanvasMinimap-ClVolr4-.js → MeshCanvasMinimap-iswYFpIb.js} +1 -1
- package/dist/client/assets/MeshScreen-8nAzQVbm.js +1 -0
- package/dist/client/assets/{MeshTopologyView-BT3ke2D1.js → MeshTopologyView-BVvtqI8q.js} +2 -2
- package/dist/client/assets/MessageEmbeds-ksPazAKH.js +1 -0
- package/dist/client/assets/MessagesScreen-C3WB4T21.js +1 -0
- package/dist/client/assets/{MissionContextRail-CafjuseK.js → MissionContextRail-D62-Wis8.js} +1 -1
- package/dist/client/assets/MissionControlView-B9cNPXvl.js +1 -0
- package/dist/client/assets/{MissionFocusOverlay-nhy3hkxQ.js → MissionFocusOverlay-C1zys3Jv.js} +1 -1
- package/dist/client/assets/MissionLeftAgentRow-vycMV77n.js +1 -0
- package/dist/client/assets/{MissionLogPane-DiUf3vWW.js → MissionLogPane-B19lYSY9.js} +1 -1
- package/dist/client/assets/NativeAreaScreen-B1RLa85C.js +1 -0
- package/dist/client/assets/NativeAreaScreen-CV0OhGra.js +1 -0
- package/dist/client/assets/NativeAreaScreen-CzuZt6o1.js +1 -0
- package/dist/client/assets/{NewAgentModal-BQ2wQ5gp.js → NewAgentModal-Bh-L-emz.js} +1 -1
- package/dist/client/assets/NewChatComposer-C97-iTMK.js +19 -0
- package/dist/client/assets/{NewChatOrigin-C8ROO4ps.js → NewChatOrigin-DFbF_XvR.js} +1 -1
- package/dist/client/assets/{NodeDetailPanel-BNTqYC7m.js → NodeDetailPanel-CElOEpCh.js} +1 -1
- package/dist/client/assets/{NodeMenu-CcOeFRCB.js → NodeMenu-B-jjHf1c.js} +1 -1
- package/dist/client/assets/ObserveEmbedScreen-B7Qt69Ms.js +2 -0
- package/dist/client/assets/{ObserveTextFlow-CC5mnngm.js → ObserveTextFlow-PFnG_10h.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-DF6tRZL_.js → ObservedTopologyPanel-CUTIoLZJ.js} +1 -1
- package/dist/client/assets/OpenScoutAppShell-37PDFfA4.js +31 -0
- package/dist/client/assets/OpsAgentsView-DajlX8LO.js +1 -0
- package/dist/client/assets/OpsScreen-jVcaBKGi.js +1 -0
- package/dist/client/assets/OpsSubnav-BOOYShHE.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-D_wlW4sQ.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-C8z22pJ2.js → ProjectAgentProfileBar-DHuMKJj-.js} +1 -1
- package/dist/client/assets/ProjectAgentProfileHero-Dbebtug1.js +1 -0
- package/dist/client/assets/ProjectsInbox-B8zYE4vP.css +1 -0
- package/dist/client/assets/ProjectsInbox-Cgu7B4--.js +2 -0
- package/dist/client/assets/ProjectsRail-CDWocin_.js +1 -0
- package/dist/client/assets/ProjectsScreen-B_CJycqW.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-1MMl_qUD.js +1 -0
- package/dist/client/assets/Provider-C35yu29I.js +5 -0
- package/dist/client/assets/{RailRow-DUPqXMZh.js → RailRow-BjmWK420.js} +1 -1
- package/dist/client/assets/RawSessionsTable-DzT90hWu.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-B6ylX3WQ.js +16 -0
- package/dist/client/assets/{RenderedWorkerSprite-C8fxndAh.js → RenderedWorkerSprite-Dhlyg89J.js} +1 -1
- package/dist/client/assets/{ReplayClock-DUVJjrIu.js → ReplayClock-348f17bW.js} +1 -1
- package/dist/client/assets/{ReplayLog-Bek1Vc4W.js → ReplayLog-CBnAM3ui.js} +1 -1
- package/dist/client/assets/{ReplayOutpost-DlRg3172.js → ReplayOutpost-DyRPfNFx.js} +1 -1
- package/dist/client/assets/{RepoDiffEmbedScreen-CVUMnt6A.js → RepoDiffEmbedScreen-BWxvRDrS.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-D9-s5PyB.js → RepoDiffPageScreen-DN94irmY.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-D7FN-oyY.js → RepoDiffViewer-_4JVXBIW.js} +1 -1
- package/dist/client/assets/RepoDiffViewerLazy-XGVC3WXv.js +2 -0
- package/dist/client/assets/{ReposScreen-BQ7HO1om.js → ReposScreen-uMCpt0e9.js} +2 -2
- package/dist/client/assets/{RiggedWorkerCharacter-CJMWlvV-.js → RiggedWorkerCharacter-q6QRc7_o.js} +1 -1
- package/dist/client/assets/{SageModelStudio-B526NSnw.js → SageModelStudio-CNDhZhgD.js} +1 -1
- package/dist/client/assets/{ScoutDeckSurface-ChkvGyEW.js → ScoutDeckSurface-CUaU4R6T.js} +1 -1
- package/dist/client/assets/{ScoutSurface-6g1f5chk.js → ScoutSurface-3_25USO_.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-BuwBdnPf.js → ScoutbotFxLab-CRqhYe0a.js} +1 -1
- package/dist/client/assets/{SecondaryNav-Bs-_VwTC.js → SecondaryNav-D7dbV2qo.js} +1 -1
- package/dist/client/assets/SessionContextStrip-CXfs9hUD.js +1 -0
- package/dist/client/assets/SessionContextStrip-DAIXwtHd.css +1 -0
- package/dist/client/assets/{SessionEmbedScreen-C2wf35-P.js → SessionEmbedScreen-D0zFmou-.js} +1 -1
- package/dist/client/assets/SessionHopMenu-E6VJZrE0.js +1 -0
- package/dist/client/assets/{SessionObserve-B64YsYhy.js → SessionObserve-DXxBvejJ.js} +9 -9
- package/dist/client/assets/SessionObserveEvidence-Cuj_KHxR.js +1 -0
- package/dist/client/assets/SessionRefScreen-DqLSUlCE.js +1 -0
- package/dist/client/assets/SessionsScreen-BLIRkohT.js +1 -0
- package/dist/client/assets/SettingsDrawer-juCpnbH6.js +3 -0
- package/dist/client/assets/SettingsScreen-BtGzE2-O.js +1 -0
- package/dist/client/assets/{SharedFloorCharacter-V04kD5T9.js → SharedFloorCharacter-DNEiaOUh.js} +1 -1
- package/dist/client/assets/SharedWorkFloor-0rqtdF-n.css +1 -0
- package/dist/client/assets/SharedWorkFloor-D9mf9KSg.js +2 -0
- package/dist/client/assets/{ShikiPane-XwFI-pCp.js → ShikiPane-CRtTYkMj.js} +1 -1
- package/dist/client/assets/{SlidePanel-BMpkXai_.js → SlidePanel-_CHAQdOa.js} +1 -1
- package/dist/client/assets/SpaceSwitcher-BLgSCf_T.js +1 -0
- package/dist/client/assets/{SpriteAvatar-aHeF4ZQZ.js → SpriteAvatar-CpZWf54-.js} +1 -1
- package/dist/client/assets/{SproutActionSprite-DI5N3gOj.js → SproutActionSprite-BSiTS4en.js} +1 -1
- package/dist/client/assets/{StatusPill-Dw4LP7wu.js → StatusPill-2gCP6H7A.js} +1 -1
- package/dist/client/assets/{TailView-BofjmUMJ.js → TailView-CYSijNTy.js} +2 -2
- package/dist/client/assets/Terminal-Bi97yb5s.js +4 -0
- package/dist/client/assets/TerminalEmbedScreen-Bqop67Bq.js +1 -0
- package/dist/client/assets/{TerminalHeaderMount-CwbQhXcI.js → TerminalHeaderMount-Cq4OD_xN.js} +1 -1
- package/dist/client/assets/{TerminalRelay--qOBwnbR.js → TerminalRelay-DrikpUSJ.js} +3 -3
- package/dist/client/assets/{TextDocumentSurface-BK6Qy41F.js → TextDocumentSurface-D52m7Vd8.js} +1 -1
- package/dist/client/assets/{TmuxPeek-DpUT9Tpc.js → TmuxPeek-CXFeweMg.js} +1 -1
- package/dist/client/assets/VoiceControlWell-DF3bjcYA.js +1 -0
- package/dist/client/assets/VoicePathDiagram-CmpHWfO-.js +1 -0
- package/dist/client/assets/{VoicePermissionsPanel-D35fOnQj.js → VoicePermissionsPanel-Ok2nfxHw.js} +1 -1
- package/dist/client/assets/VoiceTurnDetails-wAByRaNB.js +8 -0
- package/dist/client/assets/VoiceTurnStage-edoJalLV.js +1 -0
- package/dist/client/assets/VoiceTurnView-D-8g5E4r.js +1 -0
- package/dist/client/assets/WorkDetailScreen-zQkNVy2F.js +5 -0
- package/dist/client/assets/{WorkFilesViewer-t8AEyx3Q.js → WorkFilesViewer-vNt01sDd.js} +1 -1
- package/dist/client/assets/{WorkRunView-_mhG_FR2.js → WorkRunView-BDkR7Edq.js} +1 -1
- package/dist/client/assets/WorldActorTalk-BvSg_b1y.js +1 -0
- package/dist/client/assets/{WorldCharacter-BRrj3MQN.js → WorldCharacter-CIIlutQq.js} +1 -1
- package/dist/client/assets/WorldMinimap-B6HNgcDe.js +1 -0
- package/dist/client/assets/{WorldSky-D-RJzSa6.js → WorldSky-Jm2Z6dfW.js} +1 -1
- package/dist/client/assets/{activity-BJqFrZyB.js → activity-CIlFrfPJ.js} +1 -1
- package/dist/client/assets/{addon-fit-CHohcvS3.js → addon-fit-dFpj9Kfq.js} +1 -1
- package/dist/client/assets/{addon-webgl-CaRy2x2b.js → addon-webgl-BFCGRtGh.js} +1 -1
- package/dist/client/assets/{agent-essentials-bKWYOZaH.js → agent-essentials-BGGvT5G6.js} +1 -1
- package/dist/client/assets/{agent-master-model-C-KdOFDK.js → agent-master-model-Bk_yuUXJ.js} +1 -1
- package/dist/client/assets/{agent-specialization-BplZUa_0.js → agent-specialization-DDc7mLCW.js} +1 -1
- package/dist/client/assets/agents-screen-BYakbO50.css +1 -0
- package/dist/client/assets/{arc.es-CubLvQ4W.js → arc.es-C1SQHJ3k.js} +1 -1
- package/dist/client/assets/{arrow-left-DFfKAq0d.js → arrow-left-MVUKauwQ.js} +1 -1
- package/dist/client/assets/{arrow-right-DmAWnyAH.js → arrow-right-Bp-FpE5V.js} +1 -1
- package/dist/client/assets/{arrow-up-right-B0aLKiyF.js → arrow-up-right-BPedAgxO.js} +1 -1
- package/dist/client/assets/{book-open-BL9qvhEI.js → book-open-CV98WMSp.js} +1 -1
- package/dist/client/assets/{bot-BhAVbcCA.js → bot-B4zLQ4IN.js} +1 -1
- package/dist/client/assets/chat-api-DSJMBYoT.js +2 -0
- package/dist/client/assets/chat-message-markup-91DIry6R.js +1 -0
- package/dist/client/assets/chat-space-model-aW3Fd8_U.js +4 -0
- package/dist/client/assets/chat-transport-DNS5CB2I.js +1 -0
- package/dist/client/assets/{check-g7D7-c1J.js → check-lrJ3a73a.js} +1 -1
- package/dist/client/assets/{chevron-down-CDzRQQGl.js → chevron-down-l1mrh5S9.js} +1 -1
- package/dist/client/assets/{chevron-right-DKGTLiqc.js → chevron-right-DrfqcerI.js} +1 -1
- package/dist/client/assets/{chevron-up-DX7R6KY2.js → chevron-up-CETZJzjV.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-Dvk_QpRq.js → chunk-HRAB3GC3-DbVLgbWX.js} +1 -1
- package/dist/client/assets/{clock-CQb4FeMf.js → clock-BV1aqPkK.js} +1 -1
- package/dist/client/assets/{code-xml-Cmadr3pQ.js → code-xml-BhcNbLWU.js} +1 -1
- package/dist/client/assets/{coffee-ljG1_krY.js → coffee-D7EAOdCk.js} +1 -1
- package/dist/client/assets/{compass-CvzkzkIh.js → compass-63TUaz5_.js} +1 -1
- package/dist/client/assets/content-B1lgE8qr.js +1 -0
- package/dist/client/assets/content-B5l11YyQ.js +1 -0
- package/dist/client/assets/content-BNZOZEpX.js +1 -0
- package/dist/client/assets/content-BRIxP155.js +1 -0
- package/dist/client/assets/content-BWd8gt8L.js +1 -0
- package/dist/client/assets/content-BfwS2jAK.js +1 -0
- package/dist/client/assets/content-C4p43_eT.js +1 -0
- package/dist/client/assets/content-CdYfaoDV.js +1 -0
- package/dist/client/assets/content-CzldLxw0.js +1 -0
- package/dist/client/assets/content-D-olnc4U.js +1 -0
- package/dist/client/assets/content-DTioimq4.js +1 -0
- package/dist/client/assets/content-LOebm3_d.js +1 -0
- package/dist/client/assets/{content-CKJ9zb7Z.js → content-nGlEZhUI.js} +1 -1
- package/dist/client/assets/{content-D1Ze_FG9.js → content-oyzDM-LK.js} +1 -1
- package/dist/client/assets/content-x1PHxED7.js +1 -0
- package/dist/client/assets/content-zX3ZY3T9.js +1 -0
- package/dist/client/assets/{conversation-icons-CIRaxmid.js → conversation-icons-Tqba2d56.js} +1 -1
- package/dist/client/assets/conversation-model-FxDeWlle.js +1 -0
- package/dist/client/assets/conversation-motion-features-C5zjuNwE.js +1 -0
- package/dist/client/assets/conversations-DoAAO6kA.js +1 -0
- package/dist/client/assets/{copy-BGOC1tJB.js → copy-xKeM5ZtU.js} +1 -1
- package/dist/client/assets/{cpu-Q6nrHFTN.js → cpu-BOTa_WLr.js} +1 -1
- package/dist/client/assets/{createLucideIcon-ChvMq-zl.js → createLucideIcon-zZ8Hx7er.js} +1 -1
- package/dist/client/assets/ctx-panel-BC8fpcWJ.css +1 -0
- package/dist/client/assets/direct-voice-BbLPuJ04.js +2 -0
- package/dist/client/assets/direct-voice-DbO7CSv_.css +1 -0
- package/dist/client/assets/discover-DJFxyV1k.js +2 -0
- package/dist/client/assets/embed-entry-Lyvu0Kfc.js +2 -0
- package/dist/client/assets/{external-link-BVccgH0n.js → external-link-CUObqmgX.js} +1 -1
- package/dist/client/assets/{eye-CsGfEVR6.js → eye-LrO-cXQt.js} +1 -1
- package/dist/client/assets/{file-code-corner-Be6da5l3.js → file-code-corner-CsU7jJpu.js} +1 -1
- package/dist/client/assets/{file-text-DP6txVW-.js → file-text-CnISiiw6.js} +1 -1
- package/dist/client/assets/{flag-DAFE2wZ5.js → flag-C4wl8z2-.js} +1 -1
- package/dist/client/assets/fleet-roll-call-BUgf7w-V.css +1 -0
- package/dist/client/assets/{folder-B_S7gBVr.js → folder-D5prSkzz.js} +1 -1
- package/dist/client/assets/{gauge-DQCGlE3o.js → gauge-D9_5iJEm.js} +1 -1
- package/dist/client/assets/{gestures-CofqY4Km.js → gestures-QZub3Ot9.js} +1 -1
- package/dist/client/assets/{git-branch-DcUCsWdJ.js → git-branch-B0_fPLO7.js} +1 -1
- package/dist/client/assets/{go-shortcuts-KQy-ZOpV.js → go-shortcuts-DicR7sUf.js} +1 -1
- package/dist/client/assets/home-moving-signal-rpMhsOJB.js +1 -0
- package/dist/client/assets/home-now-card-ByE6Umcx.js +1 -0
- package/dist/client/assets/{home-now-card-nano-CvU8B61b.js → home-now-card-nano-B5Dv3-pb.js} +1 -1
- package/dist/client/assets/hooks-_eCZZPsR.js +2 -0
- package/dist/client/assets/index-724SdE6r.js +1 -0
- package/dist/client/assets/{index-kkXUq-zf.js → index-CHD0qcfL.js} +1 -1
- package/dist/client/assets/index-CN4rBB_s.css +1 -0
- package/dist/client/assets/index-D1d98iYf.js +1 -0
- package/dist/client/assets/{index-DReVb7jZ.js → index-EsrkGBcv.js} +8 -8
- package/dist/client/assets/index-gGHPA-By.js +1 -0
- package/dist/client/assets/{inspector-panel-CLU7wjnT.js → inspector-panel-BkgUDn6G.js} +2 -2
- package/dist/client/assets/{keyboard-nav-CJXPaHXj.js → keyboard-nav-DDHegDbx.js} +1 -1
- package/dist/client/assets/{lane-roster-store-Ch9t6lb0.js → lane-roster-store-D-RSWjb-.js} +1 -1
- package/dist/client/assets/{layers-BOwyWodP.js → layers-C8PDiMul.js} +1 -1
- package/dist/client/assets/{layout-grid-B36Qsh0y.js → layout-grid-Cor2frzj.js} +1 -1
- package/dist/client/assets/left-Bn5X7x2o.js +2 -0
- package/dist/client/assets/left-BqS0fYX1.js +1 -0
- package/dist/client/assets/left-CTCeeeD3.js +1 -0
- package/dist/client/assets/left-DhtVPVux.js +1 -0
- package/dist/client/assets/left-K39b-Wvx.js +2 -0
- package/dist/client/assets/left-KGmueNPt.js +1 -0
- package/dist/client/assets/left-P_GOYB-s.js +1 -0
- package/dist/client/assets/left-advisor-B0N47De2.js +1 -0
- package/dist/client/assets/left-agents-CsSNc51Y.js +1 -0
- package/dist/client/assets/left-default-BlO5LP2T.js +1 -0
- package/dist/client/assets/left-lanes-C4PhaJE6.js +1 -0
- package/dist/client/assets/left-mission-BjTE5vPa.js +1 -0
- package/dist/client/assets/library-CkWNPHRp.js +1 -0
- package/dist/client/assets/{loader-circle-DNUsuPWz.js → loader-circle-OvccU82H.js} +1 -1
- package/dist/client/assets/{local-agents-I40PawYA.js → local-agents-BqnoxJrq.js} +1 -1
- package/dist/client/assets/log-in-7SnYqW5w.js +1 -0
- package/dist/client/assets/{machine-children-CdhNzDF0.js → machine-children-DxcqCLmd.js} +1 -1
- package/dist/client/assets/media-blobs-Bi8pxr1u.js +1 -0
- package/dist/client/assets/{mentions-Ck_Vjnyp.js → mentions-ByUvhS-v.js} +1 -1
- package/dist/client/assets/{mesh-ops-DSlvHp-D.js → mesh-ops-CiZ8xSAx.js} +1 -1
- package/dist/client/assets/{mesh-view-store-C1-mdP3P.js → mesh-view-store-DZvJC4KU.js} +1 -1
- package/dist/client/assets/{message-circle-cI5_A5mj.js → message-circle-CxRVKNE-.js} +1 -1
- package/dist/client/assets/message-markup-BQW5jdJw.js +15 -0
- package/dist/client/assets/message-markup-Zwo3t4cI.js +1 -0
- package/dist/client/assets/{message-square-CJW4WRlo.js → message-square-BxesYglW.js} +1 -1
- package/dist/client/assets/mission-control-model-BpJHDV5D.js +1 -0
- package/dist/client/assets/{mission-control-store-p_cboAm4.js → mission-control-store-elEEsIvb.js} +1 -1
- package/dist/client/assets/{mission-wall-DOuGOxQy.js → mission-wall-CAo4BKfa.js} +1 -1
- package/dist/client/assets/{monitor-C7_cHlkC.js → monitor-DTTYEb73.js} +1 -1
- package/dist/client/assets/{nav-destinations-CU_euC-Q.js → nav-destinations-uorRqFxf.js} +1 -1
- package/dist/client/assets/{observe-CtS0l3zu.js → observe-BJqERJVj.js} +1 -1
- package/dist/client/assets/{page-status-DwFR4wSw.js → page-status-BswZLqvA.js} +1 -1
- package/dist/client/assets/{panel-right-qP17MwMl.js → panel-right-Bv7sP_fc.js} +1 -1
- package/dist/client/assets/paperclip-BjcuP_Hx.js +1 -0
- package/dist/client/assets/{pause-B_hliKuR.js → pause-C2XTlkjs.js} +1 -1
- package/dist/client/assets/{persistent-state-BUsTTZFE.js → persistent-state-KRk_yb0q.js} +1 -1
- package/dist/client/assets/{pin-Oi4qHR6M.js → pin-C2mFOV1l.js} +1 -1
- package/dist/client/assets/{play-CVeRmqLH.js → play-FT6K3It1.js} +1 -1
- package/dist/client/assets/{plus-D5NLH_fM.js → plus-DFDDeGKu.js} +1 -1
- package/dist/client/assets/profile-DTmzN16I.js +1 -0
- package/dist/client/assets/{projects-inbox-CfwxCTdN.js → projects-inbox-C0FUCv_p.js} +1 -1
- package/dist/client/assets/projects-inbox-ColX6lpx.css +1 -0
- package/dist/client/assets/{provider-DwmCoSlc.js → provider-Dojd8quC.js} +1 -1
- package/dist/client/assets/{proxy-DgzP27W8.js → proxy-AJsmwA6h.js} +1 -1
- package/dist/client/assets/{radio-Cas2qg1D.js → radio-DRoOZsws.js} +1 -1
- package/dist/client/assets/{refresh-cw-IcD2lPoT.js → refresh-cw-BmVr7sCD.js} +1 -1
- package/dist/client/assets/resolve-panes-pbY1fCWi.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-YWkZTq1t.js +1 -0
- package/dist/client/assets/right-49kO-6nD.js +1 -0
- package/dist/client/assets/right-APtItA8A.js +1 -0
- package/dist/client/assets/right-BJwhPqtn.js +1 -0
- package/dist/client/assets/right-BPqrf4ek.js +1 -0
- package/dist/client/assets/right-D7djOy6K.js +1 -0
- package/dist/client/assets/right-DKOUCRob.js +1 -0
- package/dist/client/assets/right-DMNrVzg7.js +1 -0
- package/dist/client/assets/{right-cjPTwPXS.js → right-DWPVB-nK.js} +1 -1
- package/dist/client/assets/right-DppeMCy4.js +1 -0
- package/dist/client/assets/right-GAL5Mw1v.js +1 -0
- package/dist/client/assets/{rocket-DAqYvu8I.js → rocket-CGl4RTV7.js} +1 -1
- package/dist/client/assets/router-DCtl8wqb.js +1 -0
- package/dist/client/assets/runtime-picker-DXu2bOTh.js +1 -0
- package/dist/client/assets/{scope-views-Dl3ml9OZ.js → scope-views-RUWwCVAr.js} +1 -1
- package/dist/client/assets/scout-voice-CZx60X6E.js +1 -0
- package/dist/client/assets/{scoutbot-markdown-DwvGQOWo.js → scoutbot-markdown-BKEBSbG0.js} +1 -1
- package/dist/client/assets/{scroll-text-B0tKI9Sg.js → scroll-text-DNjxhyO2.js} +1 -1
- package/dist/client/assets/{search-UsM-9-_W.js → search-DT42oyRW.js} +1 -1
- package/dist/client/assets/secondaryNavConfig-CS1svh6n.js +1 -0
- package/dist/client/assets/{selection-bridge-OTS2iFkt.js → selection-bridge-x3wFUjxj.js} +1 -1
- package/dist/client/assets/{send-horizontal-BlQsRK6C.js → send-horizontal-CH0-fbZE.js} +1 -1
- package/dist/client/assets/{send-to-agent-session-C1mgqdow.js → send-to-agent-session-DoKCDBJ4.js} +1 -1
- package/dist/client/assets/{server-DBlPW0Mp.js → server-QfsgMLk1.js} +1 -1
- package/dist/client/assets/{session-catalog-CnpZMB7C.js → session-catalog-CvSdPHPe.js} +1 -1
- package/dist/client/assets/session-recap-lanes-D-eVJnpY.js +1 -0
- package/dist/client/assets/session-recap-queue-41l2XVkI.js +1 -0
- package/dist/client/assets/{session-table-CGkfG5Yd.js → session-table-L-pns6Zl.js} +1 -1
- package/dist/client/assets/{sessions-view-Bge4XZ4I.js → sessions-view-Dc-QAa7O.js} +1 -1
- package/dist/client/assets/{settings-C69Zjrpq.js → settings-BVh7kldq.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-6bzeod7c.js → sliders-horizontal-782VC_yy.js} +1 -1
- package/dist/client/assets/{sparkles-Cc5lPZRv.js → sparkles-BjHq_DNK.js} +1 -1
- package/dist/client/assets/{sse-A8AyLH0g.js → sse-BCPRocpq.js} +1 -1
- package/dist/client/assets/system-surfaces-redesign-q2BmCB7e.css +1 -0
- package/dist/client/assets/{tail-events-C4WdhVeK.js → tail-events-d0yAYxR0.js} +1 -1
- package/dist/client/assets/{terminal-DMZjX1es.js → terminal-hQKQygcf.js} +1 -1
- package/dist/client/assets/{terminal-relay-mO89dX-Y.js → terminal-relay-Bxs1hp-j.js} +1 -1
- package/dist/client/assets/{terminal-takeover-CZZsnPzj.js → terminal-takeover-Ay5C2c-M.js} +1 -1
- package/dist/client/assets/theme-vars-DNK0nn3k.js +1 -0
- package/dist/client/assets/triangle-alert-CHoRGdVO.js +1 -0
- package/dist/client/assets/{use-beside-D3cJpA5p.js → use-beside-DoRC1nt0.js} +1 -1
- package/dist/client/assets/{use-conversation-list-D5EnpVba.js → use-conversation-list-CY4JciOV.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-D_QOmjg5.js → use-fleet-active-asks-CymmXWH4.js} +1 -1
- package/dist/client/assets/{use-mesh-node-state-3V3ADQ-G.js → use-mesh-node-state-BvaqtODo.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-DI9GKWlF.js → use-mesh-ops-items-BSYaqH_0.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-CiaZHMnk.js → use-reduced-motion-3gMYZNIp.js} +1 -1
- package/dist/client/assets/{use-scout-dev-flags-CkdAHlDR.js → use-scout-dev-flags-DS_pYYQd.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-A3QGXqIy.js → useAgentHoverCard-BANmpjMh.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-C6OBu-3_.js +1 -0
- package/dist/client/assets/{useEmbedHeadline-atkQVfGw.js → useEmbedHeadline-D6pJRxUg.js} +1 -1
- package/dist/client/assets/usePersistentState-B8lP7TRb.js +1 -0
- package/dist/client/assets/{usePierreRuntime-DTvcwISe.js → usePierreRuntime-BAQdiN0L.js} +1 -1
- package/dist/client/assets/useSidebarCollapse-OL_8J5cL.js +1 -0
- package/dist/client/assets/{users-RLK3P5U4.js → users-BUjx36gx.js} +1 -1
- package/dist/client/assets/voice-paths-CJUuBPh3.css +1 -0
- package/dist/client/assets/voice-turn-DftA0iIb.css +1 -0
- package/dist/client/assets/voice-turn-ledger-BMZxlSjg.js +1 -0
- package/dist/client/assets/{wrench-B4maQJai.js → wrench-DR0i5BU7.js} +1 -1
- package/dist/client/assets/{x-rlMdRqJF.js → x-DAehov0E.js} +1 -1
- package/dist/client/assets/{xterm-B1zHHOLQ.js → xterm-BXQiLVnI.js} +1 -1
- package/dist/client/assets/{zap-B4X0OrEw.js → zap-CEjZNZbI.js} +1 -1
- package/dist/client/crew/sheets/eye-plate-v1/look-down-left.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/look-down-right.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/look-down.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/look-up-left.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/look-up-right.webp +0 -0
- package/dist/client/crew/sheets/eye-plate-v1/look-up.webp +0 -0
- package/dist/client/crew/sheets/sprout/blink-half.webp +0 -0
- package/dist/client/crew/sheets/sprout/blink-shut.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-down-left.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-down-right.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-down.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-left.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-right.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-up-left.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-up-right.webp +0 -0
- package/dist/client/crew/sheets/sprout/look-up.webp +0 -0
- package/dist/client/index.html +2 -2
- package/dist/drizzle/0020_message_reactions.sql +11 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/main.mjs +542 -150
- package/dist/node/main.mjs +131 -17
- package/dist/pairing-runtime-controller.mjs +375 -78
- package/dist/runtime/base-daemon.mjs +98 -5
- package/dist/runtime/broker-daemon.mjs +1879 -1198
- package/dist/runtime/broker-process-manager.mjs +96 -3
- package/dist/runtime/mesh-discover.mjs +96 -3
- package/dist/scout-control-plane-web.mjs +4817 -1616
- package/dist/update-helper.mjs +211 -39
- package/package.json +5 -3
- package/server.json +31 -0
- package/dist/client/assets/ActivityScreen-CcDdQTBK.js +0 -1
- package/dist/client/assets/AgentAdventures-BxrYq_2v.js +0 -1
- package/dist/client/assets/AgentAvatar-NZOqcsB2.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-BhD1PEAM.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-BqS6MXqF.js +0 -1
- package/dist/client/assets/AgentFloorView-A0dDRlRV.js +0 -1
- package/dist/client/assets/AgentInfoScreen-DuaN0sgE.js +0 -1
- package/dist/client/assets/AgentLanesEmbedScreen-CeNiaZ9_.js +0 -1
- package/dist/client/assets/AgentLanesView-WZhEDBFE.js +0 -2
- package/dist/client/assets/AgentMasterScreen-DUDUTAnU.js +0 -1
- package/dist/client/assets/AgentSessions-CO1WGa8Z.js +0 -6
- package/dist/client/assets/AgentsConsole-BQOWkj35.js +0 -1
- package/dist/client/assets/AgentsScreen-BMNAj1PH.js +0 -1
- package/dist/client/assets/AgentsSubnav-CeHhuzyM.js +0 -1
- package/dist/client/assets/BriefingDetailScreen-yZG8_m4h.js +0 -1
- package/dist/client/assets/BrokerScreen-CT37VQiL.js +0 -8
- package/dist/client/assets/ChannelComposer-BVItWlEz.js +0 -1
- package/dist/client/assets/ChannelSidebar-B-2spawY.js +0 -1
- package/dist/client/assets/ChatBits-CLJ71hTY.js +0 -1
- package/dist/client/assets/ChatRightPanel-pKQtkAgl.js +0 -1
- package/dist/client/assets/ChatSpaceSurface-NrLwdPkE.js +0 -1
- package/dist/client/assets/ChatSpaceTheme-BPMgPdVK.css +0 -1
- package/dist/client/assets/ChatSpaceTheme-D37Jk7bl.js +0 -1
- package/dist/client/assets/ConversationComposer-DNcn5U6D.js +0 -1
- package/dist/client/assets/ConversationFeedRows-RnYSa7Io.js +0 -1
- package/dist/client/assets/ConversationHeader-Y9TEJxP_.js +0 -1
- package/dist/client/assets/ConversationScreen-Brfas2y0.css +0 -1
- package/dist/client/assets/ConversationScreen-tpj4cqWs.js +0 -2
- package/dist/client/assets/ConversationStatus-Cv-7hErW.js +0 -1
- package/dist/client/assets/CrewAvatar-zgzC3cbU.js +0 -1
- package/dist/client/assets/CrewWorkspaces-K2jcyLec.js +0 -1
- package/dist/client/assets/FlightObserveScreen-CvzhzuWc.js +0 -1
- package/dist/client/assets/FloorResourcesSheet-_Iy5UqgY.js +0 -1
- package/dist/client/assets/FloorTacticalHUD-BhyOqlL5.js +0 -1
- package/dist/client/assets/HarnessMark-DSvM_H7H.js +0 -1
- package/dist/client/assets/HarnessesScreen-DyjqbZ4k.js +0 -1
- package/dist/client/assets/InviteLandingScreen-xZQ2na1z.js +0 -1
- package/dist/client/assets/InviteSheet--5Zjct25.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-BPqAjHnH.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-jl4XQmEx.js +0 -1
- package/dist/client/assets/MeshScreen-BW1dMFWF.js +0 -1
- package/dist/client/assets/MessagesScreen-CtNMfIvC.js +0 -1
- package/dist/client/assets/MissionControlView-BjPOViGY.js +0 -1
- package/dist/client/assets/MissionLeftAgentRow-Dms0DBjO.js +0 -1
- package/dist/client/assets/NativeAreaScreen-BQSTo8As.js +0 -1
- package/dist/client/assets/NativeAreaScreen-Brix6xDB.js +0 -1
- package/dist/client/assets/NativeAreaScreen-D7HyQNlM.js +0 -1
- package/dist/client/assets/NewChatComposer-BEXS8vV6.js +0 -19
- package/dist/client/assets/ObserveEmbedScreen-Dh30EjAQ.js +0 -2
- package/dist/client/assets/OpenScoutAppShell-D9pgw36i.js +0 -31
- package/dist/client/assets/OpsAgentsView-D3rM0udq.js +0 -1
- package/dist/client/assets/OpsScreen-DySeNQ1V.js +0 -1
- package/dist/client/assets/OpsSubnav-C9E0r3GZ.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-FUav75j2.js +0 -1
- package/dist/client/assets/ProjectAgentProfileHero-BLK0EwMg.js +0 -1
- package/dist/client/assets/ProjectsInbox-DfCXReZK.js +0 -2
- package/dist/client/assets/ProjectsRail-CELVubfJ.js +0 -1
- package/dist/client/assets/ProjectsScreen-DMw4TLKy.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-D1Sh4fnX.js +0 -1
- package/dist/client/assets/Provider-CNZluAZb.js +0 -5
- package/dist/client/assets/RailToggle-BwmY70B8.js +0 -1
- package/dist/client/assets/RawSessionsTable-6OVJq0JZ.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-D41TYY0x.js +0 -9
- package/dist/client/assets/RepoDiffViewerLazy-BpMR7tlx.js +0 -2
- package/dist/client/assets/SessionObserveEvidence-CS1aQBpQ.js +0 -1
- package/dist/client/assets/SessionRefScreen-DURV0MpF.js +0 -1
- package/dist/client/assets/SessionsScreen-D71ZR-8t.js +0 -1
- package/dist/client/assets/SettingsDrawer-Nz98oBVl.js +0 -3
- package/dist/client/assets/SettingsScreen-CYBHal6y.js +0 -1
- package/dist/client/assets/SharedWorkFloor-BCmdeb3Q.css +0 -1
- package/dist/client/assets/SharedWorkFloor-C0xxW4SN.js +0 -2
- package/dist/client/assets/SpaceSwitcher-BfeIf-ad.js +0 -1
- package/dist/client/assets/Terminal-jIqnIZZ6.js +0 -4
- package/dist/client/assets/TerminalEmbedScreen-3XsjuySR.js +0 -1
- package/dist/client/assets/WorkDetailScreen-Bcf_yHhU.js +0 -5
- package/dist/client/assets/WorldActorTalk-CKerDikx.js +0 -1
- package/dist/client/assets/WorldMinimap-DOptgrc4.js +0 -1
- package/dist/client/assets/agent-autocomplete-C7xwIcwd.css +0 -1
- package/dist/client/assets/agent-autocomplete-_u9o5EZu.js +0 -2
- package/dist/client/assets/agents-screen-BMu6PpRY.css +0 -1
- package/dist/client/assets/at-sign-DM7xeppo.js +0 -1
- package/dist/client/assets/chat-api-BPVC0asu.js +0 -1
- package/dist/client/assets/chat-space-model-B6Jg2CY4.js +0 -4
- package/dist/client/assets/content-0AXa0klu.js +0 -1
- package/dist/client/assets/content-BEyJ19Lx.js +0 -1
- package/dist/client/assets/content-BN5weWKW.js +0 -1
- package/dist/client/assets/content-BNokkm7C.js +0 -1
- package/dist/client/assets/content-BV4PUM9q.js +0 -1
- package/dist/client/assets/content-BxUPlcx5.js +0 -1
- package/dist/client/assets/content-CIC5sku8.js +0 -1
- package/dist/client/assets/content-CdkTyxqk.js +0 -1
- package/dist/client/assets/content-CnhhSCZq.js +0 -1
- package/dist/client/assets/content-DY3F9Vfr.js +0 -1
- package/dist/client/assets/content-DrKBYpcb.js +0 -1
- package/dist/client/assets/content-LSStQYj5.js +0 -1
- package/dist/client/assets/content-YvU-D0hF.js +0 -1
- package/dist/client/assets/content-oKQMyVnH.js +0 -1
- package/dist/client/assets/conversation-model-m8HhzroS.js +0 -1
- package/dist/client/assets/conversation-motion-features-D9PxLoDt.js +0 -1
- package/dist/client/assets/conversations-Cbg9h_Af.js +0 -1
- package/dist/client/assets/ctx-panel-F05jXK4Q.css +0 -1
- package/dist/client/assets/discover-DlwbftpC.js +0 -2
- package/dist/client/assets/embed-entry-c0lwtjBG.js +0 -2
- package/dist/client/assets/home-moving-signal-BIHUGNfI.js +0 -1
- package/dist/client/assets/home-now-card-CaLgZze2.js +0 -1
- package/dist/client/assets/hooks-DaUOREpP.js +0 -2
- package/dist/client/assets/index-CGbs0SBm.css +0 -1
- package/dist/client/assets/index-CbqBwfIW.js +0 -1
- package/dist/client/assets/index-CyPMl7Up.js +0 -1
- package/dist/client/assets/index-PQpJveGO.js +0 -1
- package/dist/client/assets/left-0vBrvrBG.js +0 -2
- package/dist/client/assets/left-C6SyaqlJ.js +0 -1
- package/dist/client/assets/left-CTuXysZR.js +0 -2
- package/dist/client/assets/left-Cc6s4DT2.js +0 -1
- package/dist/client/assets/left-DF5caiyh.js +0 -1
- package/dist/client/assets/left-DgT4tWCx.js +0 -1
- package/dist/client/assets/left-R0wppTTr.js +0 -1
- package/dist/client/assets/left-advisor-C-kt8V28.js +0 -1
- package/dist/client/assets/left-agents-thnBO156.js +0 -1
- package/dist/client/assets/left-default-CT42fnpF.js +0 -1
- package/dist/client/assets/left-lanes-CSmZgciK.js +0 -1
- package/dist/client/assets/left-mission-C86x6i9h.js +0 -1
- package/dist/client/assets/library-DdhYL_9v.js +0 -1
- package/dist/client/assets/message-markup-6Tgo4qFJ.js +0 -15
- package/dist/client/assets/mission-control-model-C30vU1Fe.js +0 -1
- package/dist/client/assets/profile-BegEUmB7.js +0 -1
- package/dist/client/assets/projects-inbox-CKPLZN8s.css +0 -1
- package/dist/client/assets/resolve-panes-pfZTezKo.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-D5ksvrb_.js +0 -1
- package/dist/client/assets/right-BDaCJ0CF.js +0 -1
- package/dist/client/assets/right-BP6lXRFS.js +0 -1
- package/dist/client/assets/right-Cb1VCrdj.js +0 -1
- package/dist/client/assets/right-CeFaxfBo.js +0 -1
- package/dist/client/assets/right-Ck2SrYCj.js +0 -1
- package/dist/client/assets/right-D-uv5YfF.js +0 -1
- package/dist/client/assets/right-DJMSICky.js +0 -1
- package/dist/client/assets/right-Dnljs8ah.js +0 -1
- package/dist/client/assets/right-SdCSF8PP.js +0 -1
- package/dist/client/assets/router-C-MF5-mb.js +0 -1
- package/dist/client/assets/runtime-picker-C_AVYF63.js +0 -1
- package/dist/client/assets/scout-voice-CqAyfblr.js +0 -1
- package/dist/client/assets/secondaryNavConfig-DzNHk6IH.js +0 -1
- package/dist/client/assets/system-surfaces-redesign-DKFg4GB5.css +0 -1
- package/dist/client/assets/useContentSecondaryNav-DrL_nkCZ.js +0 -1
- package/dist/client/assets/usePersistentState-Y8XwSTg-.js +0 -1
- package/dist/drizzle/meta/0000_snapshot.json +0 -4575
- package/dist/drizzle/meta/0001_snapshot.json +0 -4624
- package/dist/drizzle/meta/0002_snapshot.json +0 -4631
- package/dist/drizzle/meta/0003_snapshot.json +0 -4952
- package/dist/drizzle/meta/0004_snapshot.json +0 -5235
- package/dist/drizzle/meta/0005_snapshot.json +0 -5599
- package/dist/drizzle/meta/0006_snapshot.json +0 -5606
- package/dist/drizzle/meta/0007_snapshot.json +0 -5767
- package/dist/drizzle/meta/0008_snapshot.json +0 -5774
- package/dist/drizzle/meta/0009_snapshot.json +0 -6262
- package/dist/drizzle/meta/0010_snapshot.json +0 -6286
- package/dist/drizzle/meta/0011_snapshot.json +0 -6337
- package/dist/drizzle/meta/0012_snapshot.json +0 -6458
- package/dist/drizzle/meta/0013_snapshot.json +0 -6465
- package/dist/drizzle/meta/0014_snapshot.json +0 -6503
- package/dist/drizzle/meta/0015_snapshot.json +0 -6596
- package/dist/drizzle/meta/0016_snapshot.json +0 -6611
- package/dist/drizzle/meta/0017_snapshot.json +0 -6785
- package/dist/drizzle/meta/0018_snapshot.json +0 -6804
- package/dist/drizzle/meta/0019_snapshot.json +0 -6804
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,j as t}from"./index-DReVb7jZ.js";import{b as zt,f as xs,g as vs,d as ks,h as bs,p as js,i as Ss,j as ys}from"./scout-voice-CqAyfblr.js";import"./fx-z37u1o2z.js";const Ee=1,it="scout:surface-push";class _s{constructor(n,s,a=ms()){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=Xt("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=Xt("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=ws(),o={v:Ee,id:r,surface:this.surface,method:n,params:s,...a?{hostIds:a.hostIds}:{}},u=await this.handler.postMessage(o);if(u.v!==Ee||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 ms(){const e=window.webkit?.messageHandlers?.scoutSurface;if(!e)throw new Error("Scout native surface bridge is unavailable");return e}function ws(){return globalThis.crypto?.randomUUID?.()??`surface-${Date.now()}-${Math.random().toString(16).slice(2)}`}function Xt(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(it,s),()=>window.removeEventListener(it,s)}function Ns(){window.__scoutSurface={onPush(e){window.dispatchEvent(new CustomEvent(it,{detail:e}))}}}const Is="/api/surfaces/deck",ln="scout.surface.preferences.v1";function Cs(e,n){return window.webkit?.messageHandlers?.scoutSurface?new _s(e,n):new Ts(e,n)}class Ts{constructor(n,s,a=Is){this.surface=n,this.currentScope=s,this.endpoint=a}surface;currentScope;endpoint;pending=new Map;voice=new Es;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:As()}}}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 v=p.value.events.filter(S=>!a.has(S.id));a=new Set(p.value.events.map(S=>S.id)),v.length>0&&s({hostId:p.hostId,cursor:p.value.cursor,events:v})}}catch{}};r();const o=window.setInterval(()=>{r()},2e3);return()=>{window.clearInterval(o)}}};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:Jt().filter(a=>n.includes(a.key))}),setPreferences:async n=>{const s=new Map(Jt().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=Os(),o=new AbortController;this.pending.set(r,o);const u={v:Ee,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:o.signal});if(!p.ok){const S=await p.json().catch(()=>null);throw new Error(S?.error||`Scout Deck web bridge returned HTTP ${p.status}.`)}const v=await p.json();if(v.v!==Ee||v.id!==r||v.method!==n)throw new Error("Scout Deck web bridge returned a mismatched reply.");if("error"in v)throw new Error(`${v.error.code}: ${v.error.message}`);return v.result}finally{this.pending.delete(r)}}}class Es{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 zt({surface:"scout-deck",requestPermissions:!0});if(n!==this.inputRun)return;if(!s.ready&&s.issue?.code==="microphone_not_requested"){if(await Rs(1800),n!==this.inputRun)return;s=await zt({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:xs(s.issue)}};return}const r=vs();if(await r.probe({force:!0}).catch(()=>!1),n!==this.inputRun)return;const o=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 o.cancel().catch(()=>{});return}this.live=o,this.state={...this.state,input:{...this.state.input,state:"listening",engine:s.settings.preference==="apple"?"apple":"parakeet",modelReady:!!s.settings.modelReady,unavailableReason:null}},o.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 Jt(){try{const e=JSON.parse(localStorage.getItem(ln)??"[]");return Array.isArray(e)?e:[]}catch{return[]}}function As(){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 Rs(e){return new Promise(n=>window.setTimeout(n,e))}function Os(){return globalThis.crypto?.randomUUID?.()??`surface-${Date.now()}-${Math.random().toString(16).slice(2)}`}function nt(e,n){const s=e.find(a=>a.key===n);return s?[s,...e.filter(a=>a.key!==n)]:[...e]}async function Ls(e,n){const s=e.filter(o=>o.transport==="codex_app_server"),r=(await Promise.allSettled(s.map(async o=>({lane:o,snapshot:await n({hostId:o.hostId,agentId:o.id})})))).flatMap(o=>o.status==="fulfilled"?[o.value]:[]);return r.find(({snapshot:o})=>o.state==="running")?.lane.key??r.find(({snapshot:o})=>o.state==="idle")?.lane.key??null}const dn=["ops","yoke","console","brief"],rt={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"}},Ds=9e3,Qt="scout.deck.hostScope",re="scout.deck.lane.v1",un="scout.deck.treatment.v2",Zt="scout.deck.autoSend",en="scout.deck.voiceOut",tn="scout.deck.voiceModel",Ce="scout.deck.voiceId",nn="scout.deck.voiceSpeed",ee="gpt-4o-mini-tts",pn="alloy",Ms=1,sn=44,$s=160,Ps=[{id:"air",name:"MacBook Air",state:"connected"},{id:"studio",name:"Studio",state:"connected"}],te=Date.now(),Se=[Te("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."]]),Te("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."]]),Te("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."]]),Te("studio","Studio","04","Release","codex","gpt-5.4","idle","~/dev/openscout",[["system","Last run completed","Checks passed 18 minutes ago."]])],ne={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:te-214e3,endedAt:te-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:te-164e3,endedAt:te-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:te-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…"}}}]}]}},st={input:{state:"idle",partialText:"",finalText:"",finalCount:0,engine:"parakeet",modelReady:!0,unavailableReason:null},output:{speaking:!1}},at={defaultModelId:ee,defaultVoiceId:pn,source:"fallback",models:[{id:ee,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:ee,available:!0,isDefault:!0},{id:"coral",name:"Coral",provider:"openai",modelId:ee,available:!0,isDefault:!1},{id:"fable",name:"Fable",provider:"openai",modelId:ee,available:!0,isDefault:!1},{id:"nova",name:"Nova",provider:"openai",modelId:ee,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 Vs(e){const n=e.get("treatment");if(an(n))return n;const s=localStorage.getItem(un);return an(s)?s:"ops"}function an(e){return e!=null&&dn.includes(e)}function Bs(e){const n=Number(e.get("lane"));return Number.isInteger(n)?Math.min(Math.max(n-1,0),Se.length-1):0}function qs(){const e=new URLSearchParams(window.location.search),n=e.get("preview")==="1",s=e.get("agent")?.trim()||null,a=n&&e.get("voice")==="listening"?{...st,input:{...st.input,state:"listening",partialText:"Make voice the fastest path into this active turn."}}:st,[r,o]=d.useState(()=>window.__scoutSurfaceBootstrap??null),[u,p]=d.useState(()=>Vs(e)),[v,S]=d.useState(n?Se:[]),[_,U]=d.useState("all"),[T,f]=d.useState(n?Se[Bs(e)]?.key??Se[0]?.key??null:localStorage.getItem(re)),[c,g]=d.useState(n?"ready":"waiting"),[X,qe]=d.useState(null),[m,R]=d.useState(n?ne:null),[H,K]=d.useState(!1),[St,E]=d.useState(null),[pe,wn]=d.useState(null),[he,fe]=d.useState(""),[Nn,O]=d.useState(null),[J,V]=d.useState(null),[yt,Ue]=d.useState(()=>Date.now()),[In,He]=d.useState("thread"),[j,A]=d.useState(a),[_t,Cn]=d.useState(n),[_e,Tn]=d.useState(()=>localStorage.getItem(en)!=="off"),[En,mt]=d.useState(n?at:null),[se,An]=d.useState(()=>localStorage.getItem(tn)||ee),[ge,Ke]=d.useState(()=>localStorage.getItem(Ce)||pn),[Fe,Rn]=d.useState(()=>{const i=Number(localStorage.getItem(nn));return Number.isFinite(i)&&i>=.5&&i<=2?i:Ms}),[wt,Q]=d.useState("idle"),[On,Ln]=d.useState(null),[We,Dn]=d.useState(()=>localStorage.getItem(Zt)!=="off"),[Mn,M]=d.useState(null),[$n,Nt]=d.useState(n&&e.get("audio")==="open"),[Pn,It]=d.useState(()=>Array.from({length:sn},()=>0)),y=d.useRef(null),Ct=d.useRef(s),F=d.useRef(T),Ge=d.useRef(!1),Tt=d.useRef(!1),me=d.useRef(n?0:null),ae=d.useRef(null),N=d.useRef(null),B=d.useRef(null),Et=d.useRef(null),ie=d.useRef(!1),Ye=d.useRef(null),At=d.useRef(async()=>{}),ze=d.useRef(j);ze.current=j,F.current=T;const xe=i=>{Et.current=i,wn(i)};d.useEffect(()=>{if(Ns(),n)return;const i=Cs("deck",()=>({hostIds:window.__scoutSurfaceBootstrap?.selectedHostIds??[]}));y.current=i;let l=!1,h=null,b=!1;return i.bootstrap().then(async k=>{if(l)return;window.__scoutSurfaceBootstrap=k,o(k);const C=k.selectedHostIds;if(C.length===0){g("offline"),S([]);return}const Kt=new Set(k.hosts.filter(P=>P.state==="connected").map(P=>P.id)),Ie=localStorage.getItem(Qt),hs=Ie==="all"||Ie&&Kt.has(Ie)?Ie:k.focusedHostId&&Kt.has(k.focusedHostId)?k.focusedHostId:C[0]??"all";U(hs);const Ft={hostIds:C},Wt=async()=>{if(!b){b=!0;try{const[P,Gt]=await Promise.all([i.agents.list(Ft),i.tail.recent(Ft)]);if(l)return;const W=Us(k.hosts,P,Gt),tt=Et.current,ke=tt?.receipt?W.find(D=>D.hostId===tt.receipt?.hostId&&D.id===tt.receipt?.agentId):null;if(ke){const D=nt(W,ke.key);S(D),f(ke.key),F.current=ke.key,Ge.current=!0,localStorage.setItem(re,ke.key),He("thread"),xe(null)}else{const D=Ct.current;Ct.current=null;const Yt=(D?W.find(q=>q.id===D):null)?.key??F.current??localStorage.getItem(re),be=Yt?W.find(q=>q.key===Yt):null;if(be){const q=nt(W,be.key);S(q),f(be.key),F.current=be.key,localStorage.setItem(re,be.key)}else S(W),f(null),F.current=null,Tt.current||(Tt.current=!0,Ls(W,q=>i.codex.connect(q)).then(q=>{if(l||Ge.current)return;const je=q??W[0]?.key??null;je&&(S(gs=>nt(gs,je)),f(je),F.current=je,localStorage.setItem(re,je))}))}const fs=P.hosts.filter(D=>!D.ready).length+Gt.hosts.filter(D=>!D.ready).length;qe(null),g(fs>0?"partial":"ready")}catch(P){if(l)return;qe(P instanceof Error?P.message:String(P)),g("partial")}finally{b=!1}}};await Wt(),l||(h=setInterval(()=>{Wt()},3e3))}).catch(k=>{l||(qe(k instanceof Error?k.message:String(k)),g("error"))}),()=>{l=!0,h&&clearInterval(h),y.current=null}},[n]);const Vn=n?Ps:r?.hosts??[],$=_==="all"?v:v.filter(i=>i.hostId===_),x=$.find(i=>i.key===T)??null,Xe=x?$.indexOf(x):-1,I=x?{hostId:x.hostId,agentId:x.id}:null,L=!!(x?.transport==="codex_app_server"&&(n||r?.capabilities?.includes("codex.thread.snapshot"))),ve=n||!!r?.capabilities?.includes("native.voice.snapshot"),Z=n||r?.device?.platform==="web",Bn=Z||!!r?.capabilities?.includes("native.voice.speak");d.useEffect(()=>{if(!Z||n)return;let i=!1;return ks(se).then(l=>{if(i)return;mt(l);const h=bs(l,se,ge);h.voiceId!==ge&&(Ke(h.voiceId),localStorage.setItem(Ce,h.voiceId))}).catch(l=>{i||M(l instanceof Error?l.message:String(l))}),()=>{i=!0}},[Z,n,se]),d.useEffect(()=>{if(!x){R(null);return}if(fe(""),E(null),O(null),V(null),ie.current=!1,He(x.transport==="codex_app_server"?"thread":"signal"),ae.current=null,n){R(rn(x));return}const i=y.current;if(!i)return;R(null);let l=!1,h=null;return(async()=>{if(await i.native.setLaneSelection({hostId:x.hostId,agentId:x.id,...x.conversationId?{conversationId:x.conversationId}:{},...x.sessionId?{sessionId:x.sessionId}:{}}),l)return;if(!L){R(null);return}const b=async(k=!1)=>{try{let C=await i.codex.snapshot({hostId:x.hostId,agentId:x.id});if(k&&C.state==="disconnected"&&(V({kind:"connecting",at:Date.now()}),C=await i.codex.connect({hostId:x.hostId,agentId:x.id})),l)return;R(C),E(null)}catch(C){if(l)return;E(C instanceof Error?C.message:String(C))}};await b(!0),l||(h=setInterval(()=>{b()},2e3))})().catch(b=>{l||E(b instanceof Error?b.message:String(b))}),()=>{l=!0,h&&clearInterval(h)}},[x?.key,L,n]),d.useEffect(()=>{if(n||!ve)return;const i=y.current;if(!i)return;let l=!1;const h=async()=>{try{const k=await i.native.voice.snapshot();l||(A(k),Cn(!0),M(null))}catch(k){l||M(k instanceof Error?k.message:String(k))}};h();const b=setInterval(()=>{h()},320);return()=>{l=!0,clearInterval(b)}},[n,ve]),d.useEffect(()=>{if(!_t)return;const i=j.input.finalCount;if(me.current==null){me.current=i;return}if(i<=me.current)return;me.current=i;const l=j.input.finalText.trim(),h=ie.current;if(ie.current=!1,!l){h&&O("Nothing was transcribed — the turn was not sent.");return}const b=Qs(he,l);fe(b),h&&At.current(b)},[j.input.finalCount,j.input.finalText,_t,he]),d.useEffect(()=>{const i=Zs(m);if(i){if(ae.current==null){ae.current=i.id;return}if(ae.current!==i.id){if(!_e){ae.current=i.id;return}if(!(j.input.state==="listening"||j.input.state==="transcribing")){if(ae.current=i.id,n){A(l=>({...l,output:{speaking:!0}})),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{A(l=>({...l,output:{speaking:!1}}))},1600);return}if(Z){Ut(i.text);return}y.current?.native.voice.speak(i.text).then(A).catch(l=>M(l instanceof Error?l.message:String(l)))}}}},[m,j.input.state,_e,n,Z,se,ge,Fe]),d.useEffect(()=>()=>{N.current&&clearTimeout(N.current),B.current?.abort()},[]);const qn=d.useMemo(()=>$.filter(i=>i.state==="waiting"||i.state==="blocked"||i.state==="error"),[$]),Un=$.filter(i=>pt(i.state)).length,Hn=sa(x?.events??[]),Rt=j.input.state==="listening"||j.input.state==="transcribing";d.useEffect(()=>{if(j.input.state!=="listening"){It(Array.from({length:sn},()=>0));return}let i=ze.current.input.partialText.length,l=.45;const h=setInterval(()=>{let b;if(n)l=Math.min(1,Math.max(.08,l+(Math.random()-.48)*.42)),b=l;else{const k=ze.current.input.partialText.length;b=Math.min(1,Math.max(0,k-i)/5),i=k}It(k=>[...k.slice(1),b])},$s);return()=>clearInterval(h)},[j.input.state,n]);const Ot=J&&yt-J.at<Ds?J:null,we=pe?.sourceKey===x?.key?pe:null,Je=!!(we&&!we.error),Kn=we?.error??null,Lt=!!we?.receipt,w=Fs({adapterAvailable:L,startingSession:Je,thread:m,threadError:St,pending:Ot}),Fn=Ws(w),Wn=zs(m),Gn=!!(ve&&!H&&(w==="ready"||w==="running")),Yn=!!(L&&m&&m.state!=="disconnected"&&!H),zn=!!(L&&(w==="running"||w==="stopping")),Xn=!!(L&&(w==="cold"||w==="failed")),Jn=!!(L&&!H),Dt=!!(pe&&!pe.error),Mt=L||!x?null:Je?Lt?"Codex started; Scout is locating its lane.":"Scout is starting Codex for this workspace.":Dt?`Scout is finishing the Codex launch for ${pe?.sourceName??"another workspace"}.`:x.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.",$t=!!(!L&&x&&!Mt);d.useEffect(()=>{if(!J)return;(J.kind==="sending"?m?.state==="running":J.kind==="stopping"?m?.state==="idle":m?.state==="idle"||m?.state==="running")&&V(null)},[J,m?.state]);const Pt=w==="running"||w==="sending"||w==="stopping"||w==="linking"||w==="starting"||Rt;d.useEffect(()=>{if(!Pt)return;const i=setInterval(()=>Ue(Date.now()),1e3);return Ue(Date.now()),()=>clearInterval(i)},[Pt]);const Qn=i=>{p(i),Nt(!1),localStorage.setItem(un,i)},Qe=i=>{Ge.current=!0,F.current=i.key,f(i.key),localStorage.setItem(re,i.key)},Zn=i=>{if($.length===0)return;const h=((Xe<0?0:Xe)+i+$.length)%$.length,b=$[h];b&&Qe(b)},es=i=>{U(i),f(null),localStorage.setItem(Qt,i)},Ze=async()=>{n||!I||!y.current||R(await y.current.codex.snapshot(I))},ts=async()=>{if(!(!I||H)){if(O(null),n){R(x?rn(x):null);return}K(!0);try{await Ze(),E(null)}catch(i){E(i instanceof Error?i.message:String(i))}finally{K(!1)}}},Vt=async()=>{if(!(!I||H)){K(!0),E(null),O(null),V({kind:"connecting",at:Date.now()});try{n?R({...ne,agentId:I.agentId,state:"idle",turnId:null}):y.current&&R(await y.current.codex.connect(I))}catch(i){V(null),E(i instanceof Error?i.message:String(i))}finally{K(!1)}}},Bt=async()=>{if(!I||!x||Dt||!$t)return;const i={sourceKey:x.key,sourceName:x.name,receipt:null,error:null};xe(i),O(null);try{if(n){const k=Se.find(C=>C.transport==="codex_app_server");k&&Qe(k),xe(null);return}const l=y.current,h=r?.selectedHostIds;if(!l||!h?.length)throw new Error("No connected Scout host can start Codex.");const b=await l.codex.startSession(I);xe({...i,receipt:b})}catch(l){const h=l instanceof Error?l.message:String(l);xe({...i,error:h}),F.current===i.sourceKey&&O(h)}},Ne=async i=>{const l=i.trim();if(l){if(!I||!m){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=m.state==="running"?"steer":"start";n?R(Hs(m,l,h)):y.current&&(h==="steer"?await y.current.codex.steer(I,l):await y.current.codex.start(I,l),await new Promise(b=>setTimeout(b,180)),await Ze()),fe("")}catch(h){V(null),fe(l),E(h instanceof Error?h.message:String(h))}finally{K(!1)}}};At.current=Ne;const ns=i=>{i?.preventDefault(),Ne(he)},ss=async()=>{if(!(!I||!m||H)){K(!0),E(null),O(null),V({kind:"stopping",at:Date.now()});try{n?R(Ks(m)):y.current&&(await y.current.codex.interrupt(I),await new Promise(i=>setTimeout(i,180)),await Ze())}catch(i){V(null),E(i instanceof Error?i.message:String(i))}finally{K(!1)}}},qt=async()=>{if(ve){if(M(null),O(null),j.input.state!=="listening"&&j.input.state!=="transcribing"&&(B.current?.abort(),B.current=null,Q("idle")),j.input.state==="listening"?(ie.current=We,Ye.current=null):j.input.state==="transcribing"?ie.current=!1:(ie.current=!1,Ye.current=Date.now(),Ue(Date.now())),n){if(N.current&&clearTimeout(N.current),j.input.state==="listening"){const i=j.input.partialText||"Make the voice loop feel immediate and obvious.";A(l=>({...l,input:{...l.input,state:"transcribing",partialText:""},output:{speaking:!1}})),N.current=setTimeout(()=>{A(l=>({...l,input:{...l.input,state:"idle",finalText:i,finalCount:l.input.finalCount+1}}))},520)}else j.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 y.current?.native.voice.toggleInput();i&&A(i)}catch(i){M(i instanceof Error?i.message:String(i))}}};async function Ut(i){B.current?.abort();const l=new AbortController;B.current=l,Q("preparing"),M(null);try{const h=await js(i,{modelId:se,voiceId:ge,speed:Fe,originAppId:"openscout-deck",utteranceId:`deck-${Date.now()}`,signal:l.signal});if(l.signal.aborted)return;Ln({modelId:h.modelId,voiceId:h.voiceId}),Q("speaking"),await Ss(h,{signal:l.signal})}catch(h){ys(h)||M(h instanceof Error?h.message:String(h))}finally{B.current===l&&(B.current=null,Q("idle"))}}const Ht=async()=>{if(N.current&&clearTimeout(N.current),B.current?.abort(),B.current=null,Q("idle"),A(i=>({...i,output:{speaking:!1}})),!n)try{const i=await y.current?.native.voice.stopOutput();i&&A(i)}catch(i){M(i instanceof Error?i.message:String(i))}},as=async()=>{const i=!_e;Tn(i),localStorage.setItem(en,i?"on":"off"),i||await Ht()},is=i=>{if(An(i),mt(l=>n||l?.defaultModelId===i?l:null),n){const l=at.voices.find(h=>h.modelId===i&&h.isDefault)??at.voices.find(h=>h.modelId===i);l&&(Ke(l.id),localStorage.setItem(Ce,l.id))}localStorage.setItem(tn,i)},rs=i=>{Ke(i),localStorage.setItem(Ce,i)},cs=i=>{const l=Math.min(2,Math.max(.5,i));Rn(l),localStorage.setItem(nn,String(l))},os=()=>{if(n){Q("speaking"),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>Q("idle"),1400);return}if(Z){Ut("Scout voice out is ready on this Deck.");return}y.current?.native.voice.speak("Scout voice out is ready on this Deck.").then(A).catch(i=>M(i instanceof Error?i.message:String(i)))},ls=()=>{const i=!We;Dn(i),localStorage.setItem(Zt,i?"on":"off")},ds=i=>{i.key==="Enter"&&(i.metaKey||i.ctrlKey)&&(i.preventDefault(),Ne(he))},et=L?w==="cold"||w==="failed"?"connect":"talk":"start_codex",us=()=>{if(et==="start_codex")return void Bt();if(et==="connect")return void Vt();qt()},ps=wt==="idle"?j:{...j,output:{speaking:!0}};return{preview:n,treatment:u,setTreatment:Qn,hosts:Vn,hostScope:_,selectHostScope:es,connection:c,error:X,lanes:v,scopedLanes:$,selected:x,selectedIndex:Xe,selectLane:Qe,stepLane:Zn,attention:qn,activeCount:Un,laneActivity:Hn,thread:m,threadBusy:H,threadError:St,sessionBusy:Je,sessionError:Kn,sessionLaunchAccepted:Lt,sessionStartUnavailableReason:Mt,notice:Nn,adapterAvailable:L,voiceAvailable:ve,phase:w,phaseTone:Fn,turnStartedAt:Wn,clock:yt,livePending:Ot,listeningSince:Ye.current,canTalk:Gn,canCompose:Yn,canInterrupt:zn,canRebind:Xn,canRefresh:Jn,canStartCodexSession:$t,primaryAction:et,onPrimary:us,command:he,setCommand:fe,submitTurn:Ne,onComposerSubmit:ns,onComposerKeyDown:ds,connectThread:Vt,startCodexSession:Bt,refreshSnapshot:ts,interruptThread:ss,voice:ps,voiceError:Mn,voiceOutEnabled:_e,voiceOutputAvailable:Bn,cloudSpeechAvailable:Z,speechCatalog:En,speechModelId:se,speechVoiceId:ge,speechSpeed:Fe,speechOutputPhase:wt,speechRoute:On,selectSpeechModel:is,selectSpeechVoice:rs,selectSpeechSpeed:cs,previewSpeechVoice:os,toggleVoiceInput:qt,toggleVoiceOutput:as,stopSpeaking:Ht,autoSendOnStop:We,toggleAutoSend:ls,inputTrace:Pn,voiceInputActive:Rt,settingsOpen:$n,setSettingsOpen:Nt,view:In,setView:He}}function Us(e,n,s){const a=new Map(e.map(o=>[o.id,o.name])),r=new Map;for(const o of s.hosts)if(o.ready)for(const u of o.value.events){if(!u.agentId)continue;const p=`${o.hostId}:${u.agentId}`;r.set(p,[...r.get(p)??[],u])}return n.hosts.flatMap(o=>o.ready?o.value.agents.map(u=>({...u,key:`${o.hostId}:${u.id}`,hostId:o.hostId,hostName:a.get(o.hostId)??o.hostId,events:(r.get(`${o.hostId}:${u.id}`)??[]).sort((p,v)=>v.at-p.at)})):[])}function Te(e,n,s,a,r,o,u,p,v){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:o,state:u,projectRoot:p,conversationId:`conversation-${s}`,sessionId:`session-${s}`,updatedAt:te-Number(s)*43e3,events:v.map(([S,_,U],T)=>({id:`${s}-${T}`,at:te-T*68e3-Number(s)*12e3,agentId:s,sessionId:`session-${s}`,kind:S,text:_,detail:U}))}}function rn(e){return e.transport!=="codex_app_server"?null:e.id==="04"?{...ne,agentId:e.id,threadId:"019fa45a-release",turnId:null,state:"idle",snapshot:ne.snapshot?{...ne.snapshot,currentTurnId:null,turns:ne.snapshot.turns.slice(0,2)}:null}:ne}function Hs(e,n,s){const a=s==="steer"?e.turnId??`turn_${Date.now()}`:`turn_${Date.now()}`,r=e.snapshot;if(!r)return e;const o={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:o}]}:p):[...r.turns,{id:a,status:"streaming",blocks:[{status:"streaming",block:o}],startedAt:Date.now(),isUserTurn:!0}];return{...e,state:"running",turnId:a,snapshot:{...r,currentTurnId:a,turns:u}}}function Ks(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 Fs({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 Ws(e){return e==="running"||e==="sending"||e==="starting"?"live":e==="ready"?"ready":e==="cold"||e==="failed"?"attention":"quiet"}function dt(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 Gs(e,n,s,a,r,o=null){if(a)return a;if(e==="unavailable")return o??"Scout sees this lane · Codex not started";if(e==="starting")return o??"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 Ys(n);const u=Xs(n);return u?`Idle · last turn ended ${le(u)} ago`:"Idle · no turns yet in this session"}function Ys(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 zs(e){return hn(e)?.startedAt??null}function Xs(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 Js(e){const{phase:n,turnStartedAt:s,livePending:a,clock:r}=e;return n==="sending"&&a?ct(r-a.at):(n==="running"||n==="stopping")&&s?ct(r-s):""}function ct(e){const n=Math.max(0,Math.floor(e/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function Qs(e,n){const s=n.trim();return s?e.trim()?`${e}${/\s$/.test(e)?"":" "}${s}`:s:e}function Zs(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 o=a.blocks[r],u=o?.block.type==="text"?Re(o.block):"";if(o?.status==="completed"&&u)return{id:o.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=>!!Re(s.block)).slice(-n)}function Re(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 ot(e){return e.type!=="action"?"":e.action?.output?.trim()||(e.action?.kind?`${e.action.kind.replaceAll("_"," ")} · ${e.action.status}`:"")}function ea(e){return e==="ready"?"Host connected":e==="partial"?"Host degraded":e==="error"?"Host unavailable":e==="offline"?"Host disconnected":"Connecting to host"}function ue(e){return e?e==="codex_app_server"?"Scout app-server":e:"transport unreported"}function ta(e){return e?e==="codex_app_server"?"App server":e:"unreported"}function ut(e){const n=e?.snapshot?.session?.name?.trim();return n||null}function na(e){return e==="ready"?"online":e==="partial"?"degraded":e==="error"?"error":e==="offline"?"offline":"connecting"}function oe(e){return e.state==="waiting"||e.state==="blocked"||e.state==="error"?"attention":pt(e.state)?"live":"quiet"}function Y(e){return pt(e)?"Agent active":e==="waiting"||e==="blocked"?"Needs attention":e==="error"?"Agent error":e==="idle"||e==="available"?"Idle":e?e.replaceAll("_"," "):"Standing by"}function pt(e){return e==="live"||e==="working"||e==="active"||e==="running"||e==="in_flight"}function le(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 sa(e,n=28,s=5*6e4){const a=Date.now(),r=a-s,o=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));o[p]+=u.kind==="message"||u.kind==="ask"?2:1}return o.map(u=>Math.min(6,u))}function aa(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 ia(e){const{voice:n,voiceAvailable:s,phase:a,listeningSince:r,clock:o,sessionError:u}=e;if(!s)return"Native voice becomes available inside the Scout iPad app.";if(n.input.state==="listening"){const p=r?` · ${ct(o-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 ht(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 de(){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 ft(){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 Oe(){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 lt(){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 Ae({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 ra({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:rt[n].tagline,children:[rt[n].label,n==="ops"?t.jsx("em",{children:"default"}):null]},n))})}function bn({model:e,size:n="md"}){const s=ut(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??`${ue(e.selected?.transport)} · view only`})]})}function Le({model:e,compact:n=!1}){const s=e.selected;if(!s)return null;const a=Js(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"}),dt(e.phase,s.state)]}),t.jsx("span",{className:"deck-phase__detail",children:Gs(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 De({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(de,{}),t.jsx("small",{children:aa(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(Oe,{}),t.jsx("span",{children:e.phase==="stopping"?"Stopping":"Stop turn"})]}):null}function Me({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 ca({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 $e({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??ia(e)})]})}function gt({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 xt({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:Pe("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(ft,{}),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:Pe("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:Pe("deck-chip",n),onClick:e.refreshSnapshot,disabled:!e.canRefresh,"aria-label":s,title:s,children:[t.jsx(lt,{}),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:Pe("deck-chip deck-chip--warn",n),onClick:e.connectThread,disabled:e.threadBusy,"aria-label":a,title:a,children:[t.jsx(de,{}),n?t.jsx("span",{children:s}):null]})}function Pe(e,n){return n?e:`${e} deck-chip--icon`}function Ve({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=>oa(r.provider)).map(r=>t.jsxs("option",{value:r.id,disabled:r.available===!1,children:[cn(r.provider)," · ",r.name,on(r.available)]},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.some(r=>r.modelId===e.speechModelId),children:e.speechCatalog?.voices.filter(r=>r.modelId===e.speechModelId).map(r=>t.jsxs("option",{value:r.id,disabled:r.available===!1,children:[r.name,r.language?` · ${r.language}`:"",on(r.available)]},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,o])=>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:o},o))})]}),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(ft,{}),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(Oe,{}),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?ht(e.voice.input.state):"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Voice out"}),t.jsx("dd",{children:n?cn(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 cn(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 oa(e){const n=e.toLowerCase();return n==="openai"||n==="elevenlabs"||n==="nvidia"}function on(e){return e===!1?" · unavailable":e===null?" · availability not checked":""}function la({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:oe(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 vt({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 da({model:e,limit:n=9}){const{thread:s,adapterAvailable:a,threadBusy:r,threadError:o}=e;if(!a)return t.jsx(ce,{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(o)return t.jsxs(ce,{glyph:"!",title:"Session connection failed",tone:"error",children:[o,t.jsxs("button",{type:"button",className:"deck-chip deck-chip--warn",onClick:e.connectThread,disabled:r,children:[t.jsx(de,{}),t.jsx("span",{children:"Retry controller"})]})]});if(!s)return t.jsx(ce,{glyph:"···",title:"Reading the Codex session",children:"Nothing is shown until the host returns a snapshot."});if(s.state==="disconnected")return t.jsxs(ce,{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(de,{}),t.jsx("span",{children:"Reconnect"})]})]});const u=fn(s,n);return u.length===0?t.jsx(ce,{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:le(p.at)})]}),t.jsxs("div",{className:"deck-stream__content",children:[t.jsx("strong",{children:Re(p.block)}),ot(p.block)?t.jsx("p",{children:ot(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 ua({lane:e}){return e.events.length===0?t.jsx(ce,{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:le(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 ce({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 kt({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 bt({model:e,limit:n}){return e.view==="signal"&&e.selected?t.jsx(ua,{lane:e.selected}):t.jsx(da,{model:e,limit:n})}function Be({model:e}){return t.jsxs("span",{className:"deck-connection","data-connection":e.connection,children:[t.jsx("i",{className:"deck-lamp"}),ea(e.connection)]})}function pa({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"," · ",ue(n.transport)]})]})]}):null}function jt({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(vt,{model:e})]})}function ha({model:e}){const[n,s]=d.useState(()=>e.preview&&new URLSearchParams(window.location.search).get("palette")==="open"),[a,r]=d.useState(""),[o,u]=d.useState(0),p=d.useRef(null),v=e.selected,S=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,g]of e.scopedLanes.entries())f.push({id:`lane-${g.key}`,group:"Lanes",label:`${String(c+1).padStart(2,"0")} · ${g.name}`,hint:`${g.hostName} · ${Y(g.state).toLowerCase()}`,run:()=>e.selectLane(g)});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]),_=d.useMemo(()=>{const f=a.trim().toLowerCase(),c=S.filter(g=>!g.disabled);return f?c.filter(g=>`${g.group} ${g.label} ${g.hint??""}`.toLowerCase().includes(f)):c},[S,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(g=>!g);return}if(n){if(c.key==="Escape"){c.preventDefault(),s(!1);return}if(c.key==="ArrowDown"||c.key==="ArrowUp"){c.preventDefault(),u(g=>_.length===0?0:(g+(c.key==="ArrowDown"?1:-1)+_.length)%_.length);return}if(c.key==="Enter"){c.preventDefault();const g=_[o];if(!g)return;g.run(),s(!1)}}};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n,_,o]),!v)return t.jsx("div",{className:"brief brief--standby",children:t.jsx(jt,{model:e})});const U=ut(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(Be,{model:e}),t.jsxs("div",{className:"brief__head-keys",children:[t.jsx(xt,{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(Ae,{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"," · ",v.name," · ",v.hostName]}),t.jsx("h2",{children:T?U??"Untitled session":v.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)}`:""," · ",v.projectRoot??"project unavailable"," · ",v.model??"default model"," · ",ue(v.transport)]}),t.jsx(Le,{model:e})]}),t.jsxs("div",{className:"brief__viewport",children:[t.jsxs("div",{className:"brief__viewport-head",children:[t.jsx(kt,{model:e}),e.canInterrupt?t.jsxs("button",{type:"button",className:"deck-stop",onClick:e.interruptThread,disabled:e.threadBusy||e.phase==="stopping",children:[t.jsx(Oe,{}),t.jsx("span",{children:e.phase==="stopping"?"Stopping":"Stop turn"})]}):null]}),t.jsx("div",{className:"brief__viewport-body",children:t.jsx(bt,{model:e,limit:14})})]}),t.jsxs("div",{className:"brief__dock",children:[t.jsxs("div",{className:"brief__dock-voice",children:[t.jsx(De,{model:e,size:"lg"}),t.jsxs("div",{className:"brief__dock-trace",children:[t.jsx(Me,{model:e}),t.jsx($e,{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(gt,{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:[_.length===0?t.jsx("p",{className:"deck-empty-note",children:"Nothing matches, and nothing was run."}):null,_.map((f,c)=>t.jsxs("button",{type:"button","data-active":c===o||void 0,onMouseEnter:()=>u(c),onClick:()=>{f.run(),s(!1)},children:[t.jsx("span",{className:"brief__palette-group","data-tone":f.group==="Lanes"?fa(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(Ve,{model:e})]})}function fa(e,n){const s=n.replace(/^lane-/,""),a=e.scopedLanes.find(r=>r.key===s);return a?oe(a):void 0}function ga({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(Be,{model:e}),t.jsx(bn,{model:e,size:"md"})]}),t.jsx(Le,{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(xt,{model:e}),t.jsx(Sn,{model:e}),t.jsx(De,{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(la,{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(vt,{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(pa,{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(kt,{model:e}),t.jsxs("span",{className:"deck-kicker",children:[n.hostName," / ",n.id]})]}),t.jsx("div",{className:"console__viewport-body",children:t.jsx(bt,{model:e,limit:12})})]}),t.jsxs("div",{className:"console__dock",children:[t.jsx(Me,{model:e}),t.jsx($e,{model:e}),t.jsx(gt,{model:e,rows:2})]})]}):t.jsx(jt,{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:na(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?ht(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(Ve,{model:e})]})}function xa({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,g)=>c.events.map(X=>({id:`${c.key}:${X.id}`,at:X.at,channel:g+1,lane:c,text:X.text,detail:X.detail??""}))).sort((c,g)=>g.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:oe(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:Re(c.block),detail:ot(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)),v=u[(p+1)%Math.max(1,u.length)]??"all",S=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(Be,{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 _=ut(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,g)=>t.jsx(va,{lane:c,index:g,active:c.key===n.key,model:e},c.key))}),t.jsxs("section",{className:"ops__voice","aria-label":"Routed voice control",children:[t.jsx(De,{model:e,size:"md"}),t.jsx(Me,{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($e,{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,g)=>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 ",g+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":ue(n.transport).toUpperCase(),t.jsx("i",{children:"·"}),_??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:dt(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:_??void 0,children:_??(e.adapterAvailable?"No Codex session connected":e.sessionBusy?"Starting Codex for this workspace…":"Start Codex to control this workspace")}),t.jsx(Le,{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:le(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(de,{}),e.phase==="failed"?"Retry link":"Reconnect"]}):null,t.jsxs("button",{type:"button",onClick:e.refreshSnapshot,disabled:!e.canRefresh,children:[t.jsx(lt,{}),"Re-read"]}),e.canInterrupt?t.jsxs("button",{type:"button",className:"ops__danger",onClick:e.interruptThread,disabled:e.threadBusy,children:[t.jsx(Oe,{}),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":S.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":oe(c.lane),onClick:()=>e.selectLane(c.lane),"aria-label":`Channel ${c.channel}, ${c.lane.name}: ${c.text}`,children:[t.jsx("time",{children:le(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":ht(e.voice.input.state),icon:e.primaryAction==="start_codex"?t.jsx(de,{}):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(lt,{}),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(ft,{}),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:S,glyph:"⌾",disabled:u.length<2,onClick:()=>e.selectHostScope(v)}),t.jsx(G,{ordinal:"08",label:"Next lane",meta:`${s} / ${e.scopedLanes.length}`,icon:t.jsx(Ae,{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(Ve,{model:e})]})}function va({lane:e,index:n,active:s,model:a}){const r=e.events[0],o=s&&a.phaseTone!=="quiet"?a.phaseTone:oe(e);return t.jsxs("button",{type:"button",className:"ops-channel","data-active":s||void 0,"data-tone":o,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?dt(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:le(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:ue(e.transport).toUpperCase()})]})]})}function G({ordinal:e,label:n,meta:s,glyph:a,icon:r,active:o,disabled:u=!1,onClick:p}){return t.jsxs("button",{type:"button",className:"ops-command","data-active":o||void 0,disabled:u,onClick:p,"aria-pressed":o??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 ka({model:e}){const n=e.selected;if(!n)return t.jsx("div",{className:"yoke yoke--standby",children:t.jsx(jt,{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(De,{model:e,size:"xl"}),t.jsx(Me,{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(Ae,{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(Ae,{dir:"right"})})]}),t.jsx("div",{className:"yoke__ladder",role:"group","aria-label":"Lane ladder",children:e.scopedLanes.map((r,o)=>t.jsxs("button",{type:"button","data-active":r.key===n.key||void 0,"data-tone":oe(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(o+1).padStart(2,"0")}),t.jsx("i",{"aria-hidden":"true"})]},r.key))}),t.jsxs("div",{className:"yoke__grip-keys",children:[t.jsx(xt,{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(ca,{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(Le,{model:e}),t.jsxs("div",{className:"yoke__viewport",children:[t.jsxs("div",{className:"yoke__viewport-head",children:[t.jsx(kt,{model:e}),t.jsxs("span",{className:"deck-kicker",children:[n.hostName," / ",n.id]})]}),t.jsx("div",{className:"yoke__viewport-body",children:t.jsx(bt,{model:e,limit:10})})]}),t.jsxs("div",{className:"yoke__dock",children:[t.jsx($e,{model:e}),t.jsx(gt,{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(Be,{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:ue(n.transport),children:ta(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(vt,{model:e})]})]}),t.jsx(Ve,{model:e})]})}function _a(){const e=qs(),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:rt[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(ra,{model:e})]}),e.treatment==="ops"?t.jsx(xa,{model:e}):e.treatment==="console"?t.jsx(ga,{model:e}):e.treatment==="brief"?t.jsx(ha,{model:e}):t.jsx(ka,{model:e})]})}export{_a as ScoutDeckSurface,Us as buildDeckLanes};
|
|
1
|
+
import{r as d,j as t}from"./index-EsrkGBcv.js";import{c as zt,d as xs,g as vs,f as ks,i as bs,p as js,j as Ss,k as ys}from"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";const Ee=1,it="scout:surface-push";class _s{constructor(n,s,a=ms()){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=Xt("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=Xt("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=ws(),o={v:Ee,id:r,surface:this.surface,method:n,params:s,...a?{hostIds:a.hostIds}:{}},u=await this.handler.postMessage(o);if(u.v!==Ee||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 ms(){const e=window.webkit?.messageHandlers?.scoutSurface;if(!e)throw new Error("Scout native surface bridge is unavailable");return e}function ws(){return globalThis.crypto?.randomUUID?.()??`surface-${Date.now()}-${Math.random().toString(16).slice(2)}`}function Xt(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(it,s),()=>window.removeEventListener(it,s)}function Ns(){window.__scoutSurface={onPush(e){window.dispatchEvent(new CustomEvent(it,{detail:e}))}}}const Is="/api/surfaces/deck",ln="scout.surface.preferences.v1";function Cs(e,n){return window.webkit?.messageHandlers?.scoutSurface?new _s(e,n):new Ts(e,n)}class Ts{constructor(n,s,a=Is){this.surface=n,this.currentScope=s,this.endpoint=a}surface;currentScope;endpoint;pending=new Map;voice=new Es;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:As()}}}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 v=p.value.events.filter(S=>!a.has(S.id));a=new Set(p.value.events.map(S=>S.id)),v.length>0&&s({hostId:p.hostId,cursor:p.value.cursor,events:v})}}catch{}};r();const o=window.setInterval(()=>{r()},2e3);return()=>{window.clearInterval(o)}}};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:Jt().filter(a=>n.includes(a.key))}),setPreferences:async n=>{const s=new Map(Jt().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=Os(),o=new AbortController;this.pending.set(r,o);const u={v:Ee,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:o.signal});if(!p.ok){const S=await p.json().catch(()=>null);throw new Error(S?.error||`Scout Deck web bridge returned HTTP ${p.status}.`)}const v=await p.json();if(v.v!==Ee||v.id!==r||v.method!==n)throw new Error("Scout Deck web bridge returned a mismatched reply.");if("error"in v)throw new Error(`${v.error.code}: ${v.error.message}`);return v.result}finally{this.pending.delete(r)}}}class Es{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 zt({surface:"scout-deck",requestPermissions:!0});if(n!==this.inputRun)return;if(!s.ready&&s.issue?.code==="microphone_not_requested"){if(await Rs(1800),n!==this.inputRun)return;s=await zt({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:xs(s.issue)}};return}const r=vs();if(await r.probe({force:!0}).catch(()=>!1),n!==this.inputRun)return;const o=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 o.cancel().catch(()=>{});return}this.live=o,this.state={...this.state,input:{...this.state.input,state:"listening",engine:s.settings.preference==="apple"?"apple":"parakeet",modelReady:!!s.settings.modelReady,unavailableReason:null}},o.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 Jt(){try{const e=JSON.parse(localStorage.getItem(ln)??"[]");return Array.isArray(e)?e:[]}catch{return[]}}function As(){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 Rs(e){return new Promise(n=>window.setTimeout(n,e))}function Os(){return globalThis.crypto?.randomUUID?.()??`surface-${Date.now()}-${Math.random().toString(16).slice(2)}`}function nt(e,n){const s=e.find(a=>a.key===n);return s?[s,...e.filter(a=>a.key!==n)]:[...e]}async function Ls(e,n){const s=e.filter(o=>o.transport==="codex_app_server"),r=(await Promise.allSettled(s.map(async o=>({lane:o,snapshot:await n({hostId:o.hostId,agentId:o.id})})))).flatMap(o=>o.status==="fulfilled"?[o.value]:[]);return r.find(({snapshot:o})=>o.state==="running")?.lane.key??r.find(({snapshot:o})=>o.state==="idle")?.lane.key??null}const dn=["ops","yoke","console","brief"],rt={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"}},Ds=9e3,Qt="scout.deck.hostScope",re="scout.deck.lane.v1",un="scout.deck.treatment.v2",Zt="scout.deck.autoSend",en="scout.deck.voiceOut",tn="scout.deck.voiceModel",Ce="scout.deck.voiceId",nn="scout.deck.voiceSpeed",ee="gpt-4o-mini-tts",pn="alloy",Ms=1,sn=44,$s=160,Ps=[{id:"air",name:"MacBook Air",state:"connected"},{id:"studio",name:"Studio",state:"connected"}],te=Date.now(),Se=[Te("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."]]),Te("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."]]),Te("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."]]),Te("studio","Studio","04","Release","codex","gpt-5.4","idle","~/dev/openscout",[["system","Last run completed","Checks passed 18 minutes ago."]])],ne={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:te-214e3,endedAt:te-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:te-164e3,endedAt:te-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:te-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…"}}}]}]}},st={input:{state:"idle",partialText:"",finalText:"",finalCount:0,engine:"parakeet",modelReady:!0,unavailableReason:null},output:{speaking:!1}},at={defaultModelId:ee,defaultVoiceId:pn,source:"fallback",models:[{id:ee,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:ee,available:!0,isDefault:!0},{id:"coral",name:"Coral",provider:"openai",modelId:ee,available:!0,isDefault:!1},{id:"fable",name:"Fable",provider:"openai",modelId:ee,available:!0,isDefault:!1},{id:"nova",name:"Nova",provider:"openai",modelId:ee,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 Vs(e){const n=e.get("treatment");if(an(n))return n;const s=localStorage.getItem(un);return an(s)?s:"ops"}function an(e){return e!=null&&dn.includes(e)}function Bs(e){const n=Number(e.get("lane"));return Number.isInteger(n)?Math.min(Math.max(n-1,0),Se.length-1):0}function qs(){const e=new URLSearchParams(window.location.search),n=e.get("preview")==="1",s=e.get("agent")?.trim()||null,a=n&&e.get("voice")==="listening"?{...st,input:{...st.input,state:"listening",partialText:"Make voice the fastest path into this active turn."}}:st,[r,o]=d.useState(()=>window.__scoutSurfaceBootstrap??null),[u,p]=d.useState(()=>Vs(e)),[v,S]=d.useState(n?Se:[]),[_,U]=d.useState("all"),[T,f]=d.useState(n?Se[Bs(e)]?.key??Se[0]?.key??null:localStorage.getItem(re)),[c,g]=d.useState(n?"ready":"waiting"),[X,qe]=d.useState(null),[m,R]=d.useState(n?ne:null),[H,K]=d.useState(!1),[St,E]=d.useState(null),[pe,wn]=d.useState(null),[he,fe]=d.useState(""),[Nn,O]=d.useState(null),[J,V]=d.useState(null),[yt,Ue]=d.useState(()=>Date.now()),[In,He]=d.useState("thread"),[j,A]=d.useState(a),[_t,Cn]=d.useState(n),[_e,Tn]=d.useState(()=>localStorage.getItem(en)!=="off"),[En,mt]=d.useState(n?at:null),[se,An]=d.useState(()=>localStorage.getItem(tn)||ee),[ge,Ke]=d.useState(()=>localStorage.getItem(Ce)||pn),[Fe,Rn]=d.useState(()=>{const i=Number(localStorage.getItem(nn));return Number.isFinite(i)&&i>=.5&&i<=2?i:Ms}),[wt,Q]=d.useState("idle"),[On,Ln]=d.useState(null),[We,Dn]=d.useState(()=>localStorage.getItem(Zt)!=="off"),[Mn,M]=d.useState(null),[$n,Nt]=d.useState(n&&e.get("audio")==="open"),[Pn,It]=d.useState(()=>Array.from({length:sn},()=>0)),y=d.useRef(null),Ct=d.useRef(s),F=d.useRef(T),Ge=d.useRef(!1),Tt=d.useRef(!1),me=d.useRef(n?0:null),ae=d.useRef(null),N=d.useRef(null),B=d.useRef(null),Et=d.useRef(null),ie=d.useRef(!1),Ye=d.useRef(null),At=d.useRef(async()=>{}),ze=d.useRef(j);ze.current=j,F.current=T;const xe=i=>{Et.current=i,wn(i)};d.useEffect(()=>{if(Ns(),n)return;const i=Cs("deck",()=>({hostIds:window.__scoutSurfaceBootstrap?.selectedHostIds??[]}));y.current=i;let l=!1,h=null,b=!1;return i.bootstrap().then(async k=>{if(l)return;window.__scoutSurfaceBootstrap=k,o(k);const C=k.selectedHostIds;if(C.length===0){g("offline"),S([]);return}const Kt=new Set(k.hosts.filter(P=>P.state==="connected").map(P=>P.id)),Ie=localStorage.getItem(Qt),hs=Ie==="all"||Ie&&Kt.has(Ie)?Ie:k.focusedHostId&&Kt.has(k.focusedHostId)?k.focusedHostId:C[0]??"all";U(hs);const Ft={hostIds:C},Wt=async()=>{if(!b){b=!0;try{const[P,Gt]=await Promise.all([i.agents.list(Ft),i.tail.recent(Ft)]);if(l)return;const W=Us(k.hosts,P,Gt),tt=Et.current,ke=tt?.receipt?W.find(D=>D.hostId===tt.receipt?.hostId&&D.id===tt.receipt?.agentId):null;if(ke){const D=nt(W,ke.key);S(D),f(ke.key),F.current=ke.key,Ge.current=!0,localStorage.setItem(re,ke.key),He("thread"),xe(null)}else{const D=Ct.current;Ct.current=null;const Yt=(D?W.find(q=>q.id===D):null)?.key??F.current??localStorage.getItem(re),be=Yt?W.find(q=>q.key===Yt):null;if(be){const q=nt(W,be.key);S(q),f(be.key),F.current=be.key,localStorage.setItem(re,be.key)}else S(W),f(null),F.current=null,Tt.current||(Tt.current=!0,Ls(W,q=>i.codex.connect(q)).then(q=>{if(l||Ge.current)return;const je=q??W[0]?.key??null;je&&(S(gs=>nt(gs,je)),f(je),F.current=je,localStorage.setItem(re,je))}))}const fs=P.hosts.filter(D=>!D.ready).length+Gt.hosts.filter(D=>!D.ready).length;qe(null),g(fs>0?"partial":"ready")}catch(P){if(l)return;qe(P instanceof Error?P.message:String(P)),g("partial")}finally{b=!1}}};await Wt(),l||(h=setInterval(()=>{Wt()},3e3))}).catch(k=>{l||(qe(k instanceof Error?k.message:String(k)),g("error"))}),()=>{l=!0,h&&clearInterval(h),y.current=null}},[n]);const Vn=n?Ps:r?.hosts??[],$=_==="all"?v:v.filter(i=>i.hostId===_),x=$.find(i=>i.key===T)??null,Xe=x?$.indexOf(x):-1,I=x?{hostId:x.hostId,agentId:x.id}:null,L=!!(x?.transport==="codex_app_server"&&(n||r?.capabilities?.includes("codex.thread.snapshot"))),ve=n||!!r?.capabilities?.includes("native.voice.snapshot"),Z=n||r?.device?.platform==="web",Bn=Z||!!r?.capabilities?.includes("native.voice.speak");d.useEffect(()=>{if(!Z||n)return;let i=!1;return ks(se).then(l=>{if(i)return;mt(l);const h=bs(l,se,ge);h.voiceId!==ge&&(Ke(h.voiceId),localStorage.setItem(Ce,h.voiceId))}).catch(l=>{i||M(l instanceof Error?l.message:String(l))}),()=>{i=!0}},[Z,n,se]),d.useEffect(()=>{if(!x){R(null);return}if(fe(""),E(null),O(null),V(null),ie.current=!1,He(x.transport==="codex_app_server"?"thread":"signal"),ae.current=null,n){R(rn(x));return}const i=y.current;if(!i)return;R(null);let l=!1,h=null;return(async()=>{if(await i.native.setLaneSelection({hostId:x.hostId,agentId:x.id,...x.conversationId?{conversationId:x.conversationId}:{},...x.sessionId?{sessionId:x.sessionId}:{}}),l)return;if(!L){R(null);return}const b=async(k=!1)=>{try{let C=await i.codex.snapshot({hostId:x.hostId,agentId:x.id});if(k&&C.state==="disconnected"&&(V({kind:"connecting",at:Date.now()}),C=await i.codex.connect({hostId:x.hostId,agentId:x.id})),l)return;R(C),E(null)}catch(C){if(l)return;E(C instanceof Error?C.message:String(C))}};await b(!0),l||(h=setInterval(()=>{b()},2e3))})().catch(b=>{l||E(b instanceof Error?b.message:String(b))}),()=>{l=!0,h&&clearInterval(h)}},[x?.key,L,n]),d.useEffect(()=>{if(n||!ve)return;const i=y.current;if(!i)return;let l=!1;const h=async()=>{try{const k=await i.native.voice.snapshot();l||(A(k),Cn(!0),M(null))}catch(k){l||M(k instanceof Error?k.message:String(k))}};h();const b=setInterval(()=>{h()},320);return()=>{l=!0,clearInterval(b)}},[n,ve]),d.useEffect(()=>{if(!_t)return;const i=j.input.finalCount;if(me.current==null){me.current=i;return}if(i<=me.current)return;me.current=i;const l=j.input.finalText.trim(),h=ie.current;if(ie.current=!1,!l){h&&O("Nothing was transcribed — the turn was not sent.");return}const b=Qs(he,l);fe(b),h&&At.current(b)},[j.input.finalCount,j.input.finalText,_t,he]),d.useEffect(()=>{const i=Zs(m);if(i){if(ae.current==null){ae.current=i.id;return}if(ae.current!==i.id){if(!_e){ae.current=i.id;return}if(!(j.input.state==="listening"||j.input.state==="transcribing")){if(ae.current=i.id,n){A(l=>({...l,output:{speaking:!0}})),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{A(l=>({...l,output:{speaking:!1}}))},1600);return}if(Z){Ut(i.text);return}y.current?.native.voice.speak(i.text).then(A).catch(l=>M(l instanceof Error?l.message:String(l)))}}}},[m,j.input.state,_e,n,Z,se,ge,Fe]),d.useEffect(()=>()=>{N.current&&clearTimeout(N.current),B.current?.abort()},[]);const qn=d.useMemo(()=>$.filter(i=>i.state==="waiting"||i.state==="blocked"||i.state==="error"),[$]),Un=$.filter(i=>pt(i.state)).length,Hn=sa(x?.events??[]),Rt=j.input.state==="listening"||j.input.state==="transcribing";d.useEffect(()=>{if(j.input.state!=="listening"){It(Array.from({length:sn},()=>0));return}let i=ze.current.input.partialText.length,l=.45;const h=setInterval(()=>{let b;if(n)l=Math.min(1,Math.max(.08,l+(Math.random()-.48)*.42)),b=l;else{const k=ze.current.input.partialText.length;b=Math.min(1,Math.max(0,k-i)/5),i=k}It(k=>[...k.slice(1),b])},$s);return()=>clearInterval(h)},[j.input.state,n]);const Ot=J&&yt-J.at<Ds?J:null,we=pe?.sourceKey===x?.key?pe:null,Je=!!(we&&!we.error),Kn=we?.error??null,Lt=!!we?.receipt,w=Fs({adapterAvailable:L,startingSession:Je,thread:m,threadError:St,pending:Ot}),Fn=Ws(w),Wn=zs(m),Gn=!!(ve&&!H&&(w==="ready"||w==="running")),Yn=!!(L&&m&&m.state!=="disconnected"&&!H),zn=!!(L&&(w==="running"||w==="stopping")),Xn=!!(L&&(w==="cold"||w==="failed")),Jn=!!(L&&!H),Dt=!!(pe&&!pe.error),Mt=L||!x?null:Je?Lt?"Codex started; Scout is locating its lane.":"Scout is starting Codex for this workspace.":Dt?`Scout is finishing the Codex launch for ${pe?.sourceName??"another workspace"}.`:x.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.",$t=!!(!L&&x&&!Mt);d.useEffect(()=>{if(!J)return;(J.kind==="sending"?m?.state==="running":J.kind==="stopping"?m?.state==="idle":m?.state==="idle"||m?.state==="running")&&V(null)},[J,m?.state]);const Pt=w==="running"||w==="sending"||w==="stopping"||w==="linking"||w==="starting"||Rt;d.useEffect(()=>{if(!Pt)return;const i=setInterval(()=>Ue(Date.now()),1e3);return Ue(Date.now()),()=>clearInterval(i)},[Pt]);const Qn=i=>{p(i),Nt(!1),localStorage.setItem(un,i)},Qe=i=>{Ge.current=!0,F.current=i.key,f(i.key),localStorage.setItem(re,i.key)},Zn=i=>{if($.length===0)return;const h=((Xe<0?0:Xe)+i+$.length)%$.length,b=$[h];b&&Qe(b)},es=i=>{U(i),f(null),localStorage.setItem(Qt,i)},Ze=async()=>{n||!I||!y.current||R(await y.current.codex.snapshot(I))},ts=async()=>{if(!(!I||H)){if(O(null),n){R(x?rn(x):null);return}K(!0);try{await Ze(),E(null)}catch(i){E(i instanceof Error?i.message:String(i))}finally{K(!1)}}},Vt=async()=>{if(!(!I||H)){K(!0),E(null),O(null),V({kind:"connecting",at:Date.now()});try{n?R({...ne,agentId:I.agentId,state:"idle",turnId:null}):y.current&&R(await y.current.codex.connect(I))}catch(i){V(null),E(i instanceof Error?i.message:String(i))}finally{K(!1)}}},Bt=async()=>{if(!I||!x||Dt||!$t)return;const i={sourceKey:x.key,sourceName:x.name,receipt:null,error:null};xe(i),O(null);try{if(n){const k=Se.find(C=>C.transport==="codex_app_server");k&&Qe(k),xe(null);return}const l=y.current,h=r?.selectedHostIds;if(!l||!h?.length)throw new Error("No connected Scout host can start Codex.");const b=await l.codex.startSession(I);xe({...i,receipt:b})}catch(l){const h=l instanceof Error?l.message:String(l);xe({...i,error:h}),F.current===i.sourceKey&&O(h)}},Ne=async i=>{const l=i.trim();if(l){if(!I||!m){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=m.state==="running"?"steer":"start";n?R(Hs(m,l,h)):y.current&&(h==="steer"?await y.current.codex.steer(I,l):await y.current.codex.start(I,l),await new Promise(b=>setTimeout(b,180)),await Ze()),fe("")}catch(h){V(null),fe(l),E(h instanceof Error?h.message:String(h))}finally{K(!1)}}};At.current=Ne;const ns=i=>{i?.preventDefault(),Ne(he)},ss=async()=>{if(!(!I||!m||H)){K(!0),E(null),O(null),V({kind:"stopping",at:Date.now()});try{n?R(Ks(m)):y.current&&(await y.current.codex.interrupt(I),await new Promise(i=>setTimeout(i,180)),await Ze())}catch(i){V(null),E(i instanceof Error?i.message:String(i))}finally{K(!1)}}},qt=async()=>{if(ve){if(M(null),O(null),j.input.state!=="listening"&&j.input.state!=="transcribing"&&(B.current?.abort(),B.current=null,Q("idle")),j.input.state==="listening"?(ie.current=We,Ye.current=null):j.input.state==="transcribing"?ie.current=!1:(ie.current=!1,Ye.current=Date.now(),Ue(Date.now())),n){if(N.current&&clearTimeout(N.current),j.input.state==="listening"){const i=j.input.partialText||"Make the voice loop feel immediate and obvious.";A(l=>({...l,input:{...l.input,state:"transcribing",partialText:""},output:{speaking:!1}})),N.current=setTimeout(()=>{A(l=>({...l,input:{...l.input,state:"idle",finalText:i,finalCount:l.input.finalCount+1}}))},520)}else j.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 y.current?.native.voice.toggleInput();i&&A(i)}catch(i){M(i instanceof Error?i.message:String(i))}}};async function Ut(i){B.current?.abort();const l=new AbortController;B.current=l,Q("preparing"),M(null);try{const h=await js(i,{modelId:se,voiceId:ge,speed:Fe,originAppId:"openscout-deck",utteranceId:`deck-${Date.now()}`,signal:l.signal});if(l.signal.aborted)return;Ln({modelId:h.modelId,voiceId:h.voiceId}),Q("speaking"),await Ss(h,{signal:l.signal})}catch(h){ys(h)||M(h instanceof Error?h.message:String(h))}finally{B.current===l&&(B.current=null,Q("idle"))}}const Ht=async()=>{if(N.current&&clearTimeout(N.current),B.current?.abort(),B.current=null,Q("idle"),A(i=>({...i,output:{speaking:!1}})),!n)try{const i=await y.current?.native.voice.stopOutput();i&&A(i)}catch(i){M(i instanceof Error?i.message:String(i))}},as=async()=>{const i=!_e;Tn(i),localStorage.setItem(en,i?"on":"off"),i||await Ht()},is=i=>{if(An(i),mt(l=>n||l?.defaultModelId===i?l:null),n){const l=at.voices.find(h=>h.modelId===i&&h.isDefault)??at.voices.find(h=>h.modelId===i);l&&(Ke(l.id),localStorage.setItem(Ce,l.id))}localStorage.setItem(tn,i)},rs=i=>{Ke(i),localStorage.setItem(Ce,i)},cs=i=>{const l=Math.min(2,Math.max(.5,i));Rn(l),localStorage.setItem(nn,String(l))},os=()=>{if(n){Q("speaking"),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>Q("idle"),1400);return}if(Z){Ut("Scout voice out is ready on this Deck.");return}y.current?.native.voice.speak("Scout voice out is ready on this Deck.").then(A).catch(i=>M(i instanceof Error?i.message:String(i)))},ls=()=>{const i=!We;Dn(i),localStorage.setItem(Zt,i?"on":"off")},ds=i=>{i.key==="Enter"&&(i.metaKey||i.ctrlKey)&&(i.preventDefault(),Ne(he))},et=L?w==="cold"||w==="failed"?"connect":"talk":"start_codex",us=()=>{if(et==="start_codex")return void Bt();if(et==="connect")return void Vt();qt()},ps=wt==="idle"?j:{...j,output:{speaking:!0}};return{preview:n,treatment:u,setTreatment:Qn,hosts:Vn,hostScope:_,selectHostScope:es,connection:c,error:X,lanes:v,scopedLanes:$,selected:x,selectedIndex:Xe,selectLane:Qe,stepLane:Zn,attention:qn,activeCount:Un,laneActivity:Hn,thread:m,threadBusy:H,threadError:St,sessionBusy:Je,sessionError:Kn,sessionLaunchAccepted:Lt,sessionStartUnavailableReason:Mt,notice:Nn,adapterAvailable:L,voiceAvailable:ve,phase:w,phaseTone:Fn,turnStartedAt:Wn,clock:yt,livePending:Ot,listeningSince:Ye.current,canTalk:Gn,canCompose:Yn,canInterrupt:zn,canRebind:Xn,canRefresh:Jn,canStartCodexSession:$t,primaryAction:et,onPrimary:us,command:he,setCommand:fe,submitTurn:Ne,onComposerSubmit:ns,onComposerKeyDown:ds,connectThread:Vt,startCodexSession:Bt,refreshSnapshot:ts,interruptThread:ss,voice:ps,voiceError:Mn,voiceOutEnabled:_e,voiceOutputAvailable:Bn,cloudSpeechAvailable:Z,speechCatalog:En,speechModelId:se,speechVoiceId:ge,speechSpeed:Fe,speechOutputPhase:wt,speechRoute:On,selectSpeechModel:is,selectSpeechVoice:rs,selectSpeechSpeed:cs,previewSpeechVoice:os,toggleVoiceInput:qt,toggleVoiceOutput:as,stopSpeaking:Ht,autoSendOnStop:We,toggleAutoSend:ls,inputTrace:Pn,voiceInputActive:Rt,settingsOpen:$n,setSettingsOpen:Nt,view:In,setView:He}}function Us(e,n,s){const a=new Map(e.map(o=>[o.id,o.name])),r=new Map;for(const o of s.hosts)if(o.ready)for(const u of o.value.events){if(!u.agentId)continue;const p=`${o.hostId}:${u.agentId}`;r.set(p,[...r.get(p)??[],u])}return n.hosts.flatMap(o=>o.ready?o.value.agents.map(u=>({...u,key:`${o.hostId}:${u.id}`,hostId:o.hostId,hostName:a.get(o.hostId)??o.hostId,events:(r.get(`${o.hostId}:${u.id}`)??[]).sort((p,v)=>v.at-p.at)})):[])}function Te(e,n,s,a,r,o,u,p,v){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:o,state:u,projectRoot:p,conversationId:`conversation-${s}`,sessionId:`session-${s}`,updatedAt:te-Number(s)*43e3,events:v.map(([S,_,U],T)=>({id:`${s}-${T}`,at:te-T*68e3-Number(s)*12e3,agentId:s,sessionId:`session-${s}`,kind:S,text:_,detail:U}))}}function rn(e){return e.transport!=="codex_app_server"?null:e.id==="04"?{...ne,agentId:e.id,threadId:"019fa45a-release",turnId:null,state:"idle",snapshot:ne.snapshot?{...ne.snapshot,currentTurnId:null,turns:ne.snapshot.turns.slice(0,2)}:null}:ne}function Hs(e,n,s){const a=s==="steer"?e.turnId??`turn_${Date.now()}`:`turn_${Date.now()}`,r=e.snapshot;if(!r)return e;const o={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:o}]}:p):[...r.turns,{id:a,status:"streaming",blocks:[{status:"streaming",block:o}],startedAt:Date.now(),isUserTurn:!0}];return{...e,state:"running",turnId:a,snapshot:{...r,currentTurnId:a,turns:u}}}function Ks(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 Fs({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 Ws(e){return e==="running"||e==="sending"||e==="starting"?"live":e==="ready"?"ready":e==="cold"||e==="failed"?"attention":"quiet"}function dt(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 Gs(e,n,s,a,r,o=null){if(a)return a;if(e==="unavailable")return o??"Scout sees this lane · Codex not started";if(e==="starting")return o??"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 Ys(n);const u=Xs(n);return u?`Idle · last turn ended ${le(u)} ago`:"Idle · no turns yet in this session"}function Ys(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 zs(e){return hn(e)?.startedAt??null}function Xs(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 Js(e){const{phase:n,turnStartedAt:s,livePending:a,clock:r}=e;return n==="sending"&&a?ct(r-a.at):(n==="running"||n==="stopping")&&s?ct(r-s):""}function ct(e){const n=Math.max(0,Math.floor(e/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function Qs(e,n){const s=n.trim();return s?e.trim()?`${e}${/\s$/.test(e)?"":" "}${s}`:s:e}function Zs(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 o=a.blocks[r],u=o?.block.type==="text"?Re(o.block):"";if(o?.status==="completed"&&u)return{id:o.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=>!!Re(s.block)).slice(-n)}function Re(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 ot(e){return e.type!=="action"?"":e.action?.output?.trim()||(e.action?.kind?`${e.action.kind.replaceAll("_"," ")} · ${e.action.status}`:"")}function ea(e){return e==="ready"?"Host connected":e==="partial"?"Host degraded":e==="error"?"Host unavailable":e==="offline"?"Host disconnected":"Connecting to host"}function ue(e){return e?e==="codex_app_server"?"Scout app-server":e:"transport unreported"}function ta(e){return e?e==="codex_app_server"?"App server":e:"unreported"}function ut(e){const n=e?.snapshot?.session?.name?.trim();return n||null}function na(e){return e==="ready"?"online":e==="partial"?"degraded":e==="error"?"error":e==="offline"?"offline":"connecting"}function oe(e){return e.state==="waiting"||e.state==="blocked"||e.state==="error"?"attention":pt(e.state)?"live":"quiet"}function Y(e){return pt(e)?"Agent active":e==="waiting"||e==="blocked"?"Needs attention":e==="error"?"Agent error":e==="idle"||e==="available"?"Idle":e?e.replaceAll("_"," "):"Standing by"}function pt(e){return e==="live"||e==="working"||e==="active"||e==="running"||e==="in_flight"}function le(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 sa(e,n=28,s=5*6e4){const a=Date.now(),r=a-s,o=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));o[p]+=u.kind==="message"||u.kind==="ask"?2:1}return o.map(u=>Math.min(6,u))}function aa(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 ia(e){const{voice:n,voiceAvailable:s,phase:a,listeningSince:r,clock:o,sessionError:u}=e;if(!s)return"Native voice becomes available inside the Scout iPad app.";if(n.input.state==="listening"){const p=r?` · ${ct(o-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 ht(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 de(){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 ft(){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 Oe(){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 lt(){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 Ae({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 ra({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:rt[n].tagline,children:[rt[n].label,n==="ops"?t.jsx("em",{children:"default"}):null]},n))})}function bn({model:e,size:n="md"}){const s=ut(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??`${ue(e.selected?.transport)} · view only`})]})}function Le({model:e,compact:n=!1}){const s=e.selected;if(!s)return null;const a=Js(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"}),dt(e.phase,s.state)]}),t.jsx("span",{className:"deck-phase__detail",children:Gs(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 De({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(de,{}),t.jsx("small",{children:aa(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(Oe,{}),t.jsx("span",{children:e.phase==="stopping"?"Stopping":"Stop turn"})]}):null}function Me({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 ca({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 $e({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??ia(e)})]})}function gt({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 xt({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:Pe("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(ft,{}),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:Pe("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:Pe("deck-chip",n),onClick:e.refreshSnapshot,disabled:!e.canRefresh,"aria-label":s,title:s,children:[t.jsx(lt,{}),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:Pe("deck-chip deck-chip--warn",n),onClick:e.connectThread,disabled:e.threadBusy,"aria-label":a,title:a,children:[t.jsx(de,{}),n?t.jsx("span",{children:s}):null]})}function Pe(e,n){return n?e:`${e} deck-chip--icon`}function Ve({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=>oa(r.provider)).map(r=>t.jsxs("option",{value:r.id,disabled:r.available===!1,children:[cn(r.provider)," · ",r.name,on(r.available)]},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.some(r=>r.modelId===e.speechModelId),children:e.speechCatalog?.voices.filter(r=>r.modelId===e.speechModelId).map(r=>t.jsxs("option",{value:r.id,disabled:r.available===!1,children:[r.name,r.language?` · ${r.language}`:"",on(r.available)]},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,o])=>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:o},o))})]}),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(ft,{}),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(Oe,{}),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?ht(e.voice.input.state):"—"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Voice out"}),t.jsx("dd",{children:n?cn(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 cn(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 oa(e){const n=e.toLowerCase();return n==="openai"||n==="elevenlabs"||n==="nvidia"}function on(e){return e===!1?" · unavailable":e===null?" · availability not checked":""}function la({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:oe(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 vt({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 da({model:e,limit:n=9}){const{thread:s,adapterAvailable:a,threadBusy:r,threadError:o}=e;if(!a)return t.jsx(ce,{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(o)return t.jsxs(ce,{glyph:"!",title:"Session connection failed",tone:"error",children:[o,t.jsxs("button",{type:"button",className:"deck-chip deck-chip--warn",onClick:e.connectThread,disabled:r,children:[t.jsx(de,{}),t.jsx("span",{children:"Retry controller"})]})]});if(!s)return t.jsx(ce,{glyph:"···",title:"Reading the Codex session",children:"Nothing is shown until the host returns a snapshot."});if(s.state==="disconnected")return t.jsxs(ce,{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(de,{}),t.jsx("span",{children:"Reconnect"})]})]});const u=fn(s,n);return u.length===0?t.jsx(ce,{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:le(p.at)})]}),t.jsxs("div",{className:"deck-stream__content",children:[t.jsx("strong",{children:Re(p.block)}),ot(p.block)?t.jsx("p",{children:ot(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 ua({lane:e}){return e.events.length===0?t.jsx(ce,{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:le(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 ce({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 kt({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 bt({model:e,limit:n}){return e.view==="signal"&&e.selected?t.jsx(ua,{lane:e.selected}):t.jsx(da,{model:e,limit:n})}function Be({model:e}){return t.jsxs("span",{className:"deck-connection","data-connection":e.connection,children:[t.jsx("i",{className:"deck-lamp"}),ea(e.connection)]})}function pa({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"," · ",ue(n.transport)]})]})]}):null}function jt({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(vt,{model:e})]})}function ha({model:e}){const[n,s]=d.useState(()=>e.preview&&new URLSearchParams(window.location.search).get("palette")==="open"),[a,r]=d.useState(""),[o,u]=d.useState(0),p=d.useRef(null),v=e.selected,S=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,g]of e.scopedLanes.entries())f.push({id:`lane-${g.key}`,group:"Lanes",label:`${String(c+1).padStart(2,"0")} · ${g.name}`,hint:`${g.hostName} · ${Y(g.state).toLowerCase()}`,run:()=>e.selectLane(g)});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]),_=d.useMemo(()=>{const f=a.trim().toLowerCase(),c=S.filter(g=>!g.disabled);return f?c.filter(g=>`${g.group} ${g.label} ${g.hint??""}`.toLowerCase().includes(f)):c},[S,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(g=>!g);return}if(n){if(c.key==="Escape"){c.preventDefault(),s(!1);return}if(c.key==="ArrowDown"||c.key==="ArrowUp"){c.preventDefault(),u(g=>_.length===0?0:(g+(c.key==="ArrowDown"?1:-1)+_.length)%_.length);return}if(c.key==="Enter"){c.preventDefault();const g=_[o];if(!g)return;g.run(),s(!1)}}};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n,_,o]),!v)return t.jsx("div",{className:"brief brief--standby",children:t.jsx(jt,{model:e})});const U=ut(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(Be,{model:e}),t.jsxs("div",{className:"brief__head-keys",children:[t.jsx(xt,{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(Ae,{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"," · ",v.name," · ",v.hostName]}),t.jsx("h2",{children:T?U??"Untitled session":v.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)}`:""," · ",v.projectRoot??"project unavailable"," · ",v.model??"default model"," · ",ue(v.transport)]}),t.jsx(Le,{model:e})]}),t.jsxs("div",{className:"brief__viewport",children:[t.jsxs("div",{className:"brief__viewport-head",children:[t.jsx(kt,{model:e}),e.canInterrupt?t.jsxs("button",{type:"button",className:"deck-stop",onClick:e.interruptThread,disabled:e.threadBusy||e.phase==="stopping",children:[t.jsx(Oe,{}),t.jsx("span",{children:e.phase==="stopping"?"Stopping":"Stop turn"})]}):null]}),t.jsx("div",{className:"brief__viewport-body",children:t.jsx(bt,{model:e,limit:14})})]}),t.jsxs("div",{className:"brief__dock",children:[t.jsxs("div",{className:"brief__dock-voice",children:[t.jsx(De,{model:e,size:"lg"}),t.jsxs("div",{className:"brief__dock-trace",children:[t.jsx(Me,{model:e}),t.jsx($e,{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(gt,{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:[_.length===0?t.jsx("p",{className:"deck-empty-note",children:"Nothing matches, and nothing was run."}):null,_.map((f,c)=>t.jsxs("button",{type:"button","data-active":c===o||void 0,onMouseEnter:()=>u(c),onClick:()=>{f.run(),s(!1)},children:[t.jsx("span",{className:"brief__palette-group","data-tone":f.group==="Lanes"?fa(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(Ve,{model:e})]})}function fa(e,n){const s=n.replace(/^lane-/,""),a=e.scopedLanes.find(r=>r.key===s);return a?oe(a):void 0}function ga({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(Be,{model:e}),t.jsx(bn,{model:e,size:"md"})]}),t.jsx(Le,{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(xt,{model:e}),t.jsx(Sn,{model:e}),t.jsx(De,{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(la,{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(vt,{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(pa,{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(kt,{model:e}),t.jsxs("span",{className:"deck-kicker",children:[n.hostName," / ",n.id]})]}),t.jsx("div",{className:"console__viewport-body",children:t.jsx(bt,{model:e,limit:12})})]}),t.jsxs("div",{className:"console__dock",children:[t.jsx(Me,{model:e}),t.jsx($e,{model:e}),t.jsx(gt,{model:e,rows:2})]})]}):t.jsx(jt,{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:na(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?ht(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(Ve,{model:e})]})}function xa({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,g)=>c.events.map(X=>({id:`${c.key}:${X.id}`,at:X.at,channel:g+1,lane:c,text:X.text,detail:X.detail??""}))).sort((c,g)=>g.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:oe(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:Re(c.block),detail:ot(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)),v=u[(p+1)%Math.max(1,u.length)]??"all",S=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(Be,{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 _=ut(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,g)=>t.jsx(va,{lane:c,index:g,active:c.key===n.key,model:e},c.key))}),t.jsxs("section",{className:"ops__voice","aria-label":"Routed voice control",children:[t.jsx(De,{model:e,size:"md"}),t.jsx(Me,{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($e,{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,g)=>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 ",g+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":ue(n.transport).toUpperCase(),t.jsx("i",{children:"·"}),_??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:dt(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:_??void 0,children:_??(e.adapterAvailable?"No Codex session connected":e.sessionBusy?"Starting Codex for this workspace…":"Start Codex to control this workspace")}),t.jsx(Le,{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:le(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(de,{}),e.phase==="failed"?"Retry link":"Reconnect"]}):null,t.jsxs("button",{type:"button",onClick:e.refreshSnapshot,disabled:!e.canRefresh,children:[t.jsx(lt,{}),"Re-read"]}),e.canInterrupt?t.jsxs("button",{type:"button",className:"ops__danger",onClick:e.interruptThread,disabled:e.threadBusy,children:[t.jsx(Oe,{}),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":S.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":oe(c.lane),onClick:()=>e.selectLane(c.lane),"aria-label":`Channel ${c.channel}, ${c.lane.name}: ${c.text}`,children:[t.jsx("time",{children:le(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":ht(e.voice.input.state),icon:e.primaryAction==="start_codex"?t.jsx(de,{}):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(lt,{}),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(ft,{}),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:S,glyph:"⌾",disabled:u.length<2,onClick:()=>e.selectHostScope(v)}),t.jsx(G,{ordinal:"08",label:"Next lane",meta:`${s} / ${e.scopedLanes.length}`,icon:t.jsx(Ae,{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(Ve,{model:e})]})}function va({lane:e,index:n,active:s,model:a}){const r=e.events[0],o=s&&a.phaseTone!=="quiet"?a.phaseTone:oe(e);return t.jsxs("button",{type:"button",className:"ops-channel","data-active":s||void 0,"data-tone":o,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?dt(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:le(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:ue(e.transport).toUpperCase()})]})]})}function G({ordinal:e,label:n,meta:s,glyph:a,icon:r,active:o,disabled:u=!1,onClick:p}){return t.jsxs("button",{type:"button",className:"ops-command","data-active":o||void 0,disabled:u,onClick:p,"aria-pressed":o??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 ka({model:e}){const n=e.selected;if(!n)return t.jsx("div",{className:"yoke yoke--standby",children:t.jsx(jt,{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(De,{model:e,size:"xl"}),t.jsx(Me,{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(Ae,{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(Ae,{dir:"right"})})]}),t.jsx("div",{className:"yoke__ladder",role:"group","aria-label":"Lane ladder",children:e.scopedLanes.map((r,o)=>t.jsxs("button",{type:"button","data-active":r.key===n.key||void 0,"data-tone":oe(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(o+1).padStart(2,"0")}),t.jsx("i",{"aria-hidden":"true"})]},r.key))}),t.jsxs("div",{className:"yoke__grip-keys",children:[t.jsx(xt,{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(ca,{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(Le,{model:e}),t.jsxs("div",{className:"yoke__viewport",children:[t.jsxs("div",{className:"yoke__viewport-head",children:[t.jsx(kt,{model:e}),t.jsxs("span",{className:"deck-kicker",children:[n.hostName," / ",n.id]})]}),t.jsx("div",{className:"yoke__viewport-body",children:t.jsx(bt,{model:e,limit:10})})]}),t.jsxs("div",{className:"yoke__dock",children:[t.jsx($e,{model:e}),t.jsx(gt,{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(Be,{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:ue(n.transport),children:ta(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(vt,{model:e})]})]}),t.jsx(Ve,{model:e})]})}function _a(){const e=qs(),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:rt[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(ra,{model:e})]}),e.treatment==="ops"?t.jsx(xa,{model:e}):e.treatment==="console"?t.jsx(ga,{model:e}):e.treatment==="brief"?t.jsx(ha,{model:e}):t.jsx(ka,{model:e})]})}export{_a as ScoutDeckSurface,Us as buildDeckLanes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./index-
|
|
1
|
+
import{j as r}from"./index-EsrkGBcv.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-EsrkGBcv.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-EsrkGBcv.js";import"./secondaryNavConfig-CS1svh6n.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 l,j as s}from"./index-EsrkGBcv.js";import{a as k}from"./conversation-model-FxDeWlle.js";import{h as C}from"./HarnessMark-C4naWc16.js";function R(t){const i=t.conversationId?.trim()||null,r=t.machineId?.trim()||null;return{sessionRoute:k({sessionId:t.sessionId,machineId:r}),conversationRoute:i?{view:"conversation",conversationId:i,...r?{machineId:r}:{}}:null}}function E({title:t,harness:i,model:r,hostName:v,workspaceRoot:b,sessionId:f,machineId:j,conversationId:w,showSessionAction:u=!0,navigate:p}){const[d,c]=l.useState("idle"),e=l.useRef(null),n=b?.trim()||null,o=f?.trim()||null,m=w?.trim()||null,y=j?.trim()||null,{sessionRoute:x,conversationRoute:h}=R({sessionId:o,conversationId:m,machineId:y});l.useEffect(()=>{c("idle")},[n]),l.useEffect(()=>()=>{e.current!==null&&window.clearTimeout(e.current)},[]);const I=()=>{if(!n)return;const a=typeof navigator<"u"?navigator.clipboard:void 0;if(!a?.writeText){c("unavailable");return}a.writeText(n).then(()=>{c("copied"),e.current!==null&&window.clearTimeout(e.current),e.current=window.setTimeout(()=>{e.current=null,c("idle")},1500)}).catch(()=>{c("unavailable")})},N=[i?.trim()?C(i):null,r?.trim()||null,v?.trim()||"Host not reported"].filter(a=>!!a);return s.jsxs("div",{className:"s-session-context-strip",children:[s.jsxs("div",{className:"s-session-context-strip-main",children:[t?.trim()?s.jsx("span",{className:"s-session-context-strip-title",children:t.trim()}):null,s.jsx("span",{className:"s-session-context-strip-facts",children:N.join(" · ")}),o&&!u?s.jsx("code",{className:"s-session-context-strip-identity",title:o,children:o}):null,n?s.jsxs("span",{className:"s-session-context-strip-workspace","aria-live":"polite",children:[s.jsx("code",{className:"s-session-context-strip-path",title:n,children:n}),s.jsx("button",{type:"button",className:"btn btn--ghost s-session-context-strip-copy",onClick:I,children:d==="copied"?"Copied":d==="unavailable"?"Copy unavailable":"Copy path"})]}):s.jsx("span",{className:"s-session-context-strip-workspace s-session-context-strip-workspace--missing",children:"Workspace not reported"})]}),s.jsxs("div",{className:"s-session-context-strip-actions",children:[x&&u?s.jsx("button",{type:"button",className:"btn btn--ghost s-session-context-strip-session","aria-label":`Open session ${o}`,title:o??void 0,onClick:()=>p(x),children:"Open session"}):null,h?s.jsx("button",{type:"button",className:"btn btn--ghost s-session-context-strip-back","aria-label":`Return to conversation ${m}`,onClick:()=>p(h),children:"Back to conversation"}):null]})]})}export{E as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.s-session-context-strip{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-md);padding:var(--space-2xs) 0 var(--space-sm);font-size:var(--text-sm);color:var(--dim);flex-wrap:wrap}.s-session-context-strip-main{display:flex;align-items:baseline;gap:var(--space-sm);flex-wrap:wrap;min-width:0}.s-session-context-strip-title{color:var(--ink);font-weight:600}.s-session-context-strip-workspace{display:inline-flex;align-items:baseline;gap:var(--space-2xs);min-width:0}.s-session-context-strip-identity,.s-session-context-strip-path{font-family:var(--font-mono);font-size:var(--text-xs);-webkit-user-select:all;user-select:all;overflow-wrap:anywhere}.s-session-context-strip-workspace--missing{font-style:normal}.s-session-context-strip-copy{flex-shrink:0}.s-session-context-strip-actions{display:inline-flex;align-items:center;gap:var(--space-2xs);flex-shrink:0}
|