@openscout/scout 0.2.79 → 0.2.82
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 +1 -1
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +4 -4
- package/dist/client/assets/ActivityScreen-aewI4Ul1.js +1 -0
- package/dist/client/assets/{AddProjectForm-BoVtelSP.js → AddProjectForm-Czb5uwou.js} +1 -1
- package/dist/client/assets/{AgentAvatar-CufDA4A-.js → AgentAvatar-DMov24_o.js} +1 -1
- package/dist/client/assets/AgentConfigurationScreen-BjG6ECjl.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-D4MbSMXp.js +1 -0
- package/dist/client/assets/{AgentDetailCard-DxxVkgT1.js → AgentDetailCard-Biq8b2gv.js} +1 -1
- package/dist/client/assets/AgentFloorView-h9KDJdw0.js +1 -0
- package/dist/client/assets/AgentInfoScreen-SjhK_SBh.js +1 -0
- package/dist/client/assets/{AgentLaneCard-DTUvE96I.js → AgentLaneCard-C4DMQR-c.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-BfVygkgL.js → AgentLaneChrome-D1xNNf7A.js} +1 -1
- package/dist/client/assets/AgentLaneDetailSheet-DnAKe4e3.js +4 -0
- package/dist/client/assets/{AgentLaneSummaryResize-CMgzYvAA.js → AgentLaneSummaryResize-C9loK-st.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-BNOYF16R.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-KWfLcaNB.js → AgentLanesPreflight-M7iDXdP2.js} +1 -1
- package/dist/client/assets/{AgentLanesView-CxfbV8Kd.js → AgentLanesView-Ct-Gz5WD.js} +1 -1
- package/dist/client/assets/{AgentLiveActions-CZdAInEu.js → AgentLiveActions-0iy8QZ1T.js} +1 -1
- package/dist/client/assets/{AgentSessions-Bkr0lyry.js → AgentSessions-CDfSfNiE.js} +2 -2
- package/dist/client/assets/{AgentsConsole-WtFVqaPJ.js → AgentsConsole-BVxhBqRa.js} +1 -1
- package/dist/client/assets/AgentsScreen-Bww6HgFs.js +1 -0
- package/dist/client/assets/AgentsSubnav-CiIuzxnZ.js +1 -0
- package/dist/client/assets/{AtopView-_OKDlZ1h.js → AtopView-h_aFoNkP.js} +1 -1
- package/dist/client/assets/BackToPicker-BXp5E2ck.js +1 -0
- package/dist/client/assets/{BriefingDetailScreen-i54EtZKW.js → BriefingDetailScreen-C83o2YfN.js} +1 -1
- package/dist/client/assets/{BriefingsScreen-CBrHojlQ.js → BriefingsScreen-BTsvr5fv.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-opTLuZU6.js → BrokerMetadataPanel-jg7odHQp.js} +1 -1
- package/dist/client/assets/BrokerScreen-DplF8d_X.js +5 -0
- package/dist/client/assets/Canvas-BePL08RR.js +1 -0
- package/dist/client/assets/{ChatCollapsedStrip-Dr2vmKXQ.js → ChatCollapsedStrip-BRljIymi.js} +1 -1
- package/dist/client/assets/{CodeDiffPane-CLOGjwul.js → CodeDiffPane-86odpBSt.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-DTV8hR6A.js → CodeProjectPicker-8svr_S_A.js} +1 -1
- package/dist/client/assets/CodeScreen-CJ2RgB32.js +1 -0
- package/dist/client/assets/{ContextMenu-BlBQhpax.js → ContextMenu-CxkmFQcN.js} +1 -1
- package/dist/client/assets/ConversationComposer-CWohCCmn.js +1 -0
- package/dist/client/assets/ConversationFeedRows-IWh0JSIL.js +1 -0
- package/dist/client/assets/ConversationHeader-BxTzXl8e.js +1 -0
- package/dist/client/assets/ConversationPanels-D9UCwNkS.js +2 -0
- package/dist/client/assets/ConversationScreen-oZSitVtX.js +1 -0
- package/dist/client/assets/ConversationScreen-yIKEsm-8.css +1 -0
- package/dist/client/assets/{ConversationStatus-DSgdVofa.js → ConversationStatus-B6pAbo2w.js} +1 -1
- package/dist/client/assets/{DataTable-0DwuXyvW.js → DataTable-CGw5CECG.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-BrreQifA.js → DispatchAftermath-DowTb7uO.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-DU_9BHsD.js → DocumentFocusViewer-DRKjNG9s.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-DdaswbfI.js → EmbeddableSurfacesLab-CxfJXS2g.js} +1 -1
- package/dist/client/assets/{EmptyState-CoL-QuUO.js → EmptyState-BUvllvA6.js} +1 -1
- package/dist/client/assets/{FileViewerPane-C9Ly01Ef.js → FileViewerPane-BM4AD_bo.js} +1 -1
- package/dist/client/assets/{FleetSearch-DlWTLl-v.js → FleetSearch-CYeWn85V.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-DYJJ3Z2B.js +1 -0
- package/dist/client/assets/FollowScreen-DG0osbUp.js +1 -0
- package/dist/client/assets/HarnessMark-MztYnrGK.js +1 -0
- package/dist/client/assets/HarnessesScreen-BWqirBjK.js +1 -0
- package/dist/client/assets/HerdrSession-6sFln7WX.js +4 -0
- package/dist/client/assets/{HomeHero-Cfsow7qL.js → HomeHero-BPBArHXa.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-DKashKoH.js → KnowledgeSearchInspector-BOIhFWd2.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-BP8tD-Bh.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-BzehBmdi.js → LaneToolHoverCard-CcEiQC6B.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-B4i1Ut4R.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-DYvHfs_3.js → LaneTraceEventFocus-Bl9L0EYb.js} +1 -1
- package/dist/client/assets/{MeshCanvas-DIjlrMPU.js → MeshCanvas-ZjIuMiRo.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-DEq-PkF0.js → MeshCanvasMinimap-C-LQtiX6.js} +1 -1
- package/dist/client/assets/MeshScreen-Bs3soujg.js +1 -0
- package/dist/client/assets/{MeshTopologyView-BMHpH5BU.js → MeshTopologyView-C0LUyT3K.js} +2 -2
- package/dist/client/assets/{MessageComposerSuggestions-zAUUcLOv.js → MessageComposerSuggestions-Dfc3PH2y.js} +1 -1
- package/dist/client/assets/MessagesScreen-TgSL5KMc.js +1 -0
- package/dist/client/assets/MissionContextRail-CjGAEGu8.js +1 -0
- package/dist/client/assets/MissionControlView-D629w2A8.js +1 -0
- package/dist/client/assets/{MissionFocusOverlay-C7cPt6eU.js → MissionFocusOverlay-Bubrr8Gc.js} +1 -1
- package/dist/client/assets/{MissionLeftAgentRow-CxlH3dON.js → MissionLeftAgentRow-DokImu4Y.js} +1 -1
- package/dist/client/assets/MissionLogPane-Cs0LuIkn.js +1 -0
- package/dist/client/assets/{NewAgentModal-DprvD4EK.js → NewAgentModal-D5e0YUAo.js} +1 -1
- package/dist/client/assets/NewChatComposer-C5LT7MF7.css +1 -0
- package/dist/client/assets/NewChatComposer-S08F6_La.js +19 -0
- package/dist/client/assets/{NewChatOrigin--pHWUb4V.js → NewChatOrigin-BEz6jyqf.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-CfvrnOiZ.js → ObserveEmbedScreen-CHx2sEAA.js} +2 -2
- package/dist/client/assets/ObserveTextFlow-_ApDwRCO.js +2 -0
- package/dist/client/assets/{ObservedTopologyPanel-Dv6fbHzW.js → ObservedTopologyPanel-ByW7Ar7p.js} +1 -1
- package/dist/client/assets/OpenScoutAppShell-DTmnbG-h.js +88 -0
- package/dist/client/assets/OpsAgentsView-DiFuHcJs.js +1 -0
- package/dist/client/assets/OpsScreen-CCR3U_9P.js +1 -0
- package/dist/client/assets/OpsSubnav-CZs_OL2N.js +1 -0
- package/dist/client/assets/{PlanView-DYtt8H37.js → PlanView-C54eAzig.js} +1 -1
- package/dist/client/assets/ProjectAgentProfile-BEfYOaxc.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-B3IvVbqS.js → ProjectAgentProfileBar-B1VpwzGD.js} +1 -1
- package/dist/client/assets/{ProjectAgentProfileHero-D5E8yvDj.js → ProjectAgentProfileHero-B4f_AoCr.js} +1 -1
- package/dist/client/assets/ProjectsInbox-DoPZ17FC.js +2 -0
- package/dist/client/assets/{ProjectsRail-DEDS-M1c.js → ProjectsRail-CWOkZjsY.js} +1 -1
- package/dist/client/assets/ProjectsScreen-Dse0Q6p6.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-DMnfyPLE.js +1 -0
- package/dist/client/assets/Provider-DKZWuzSR.js +1 -0
- package/dist/client/assets/{RailRow-BTlVAnHS.js → RailRow-DIGd3MMM.js} +1 -1
- package/dist/client/assets/RawSessionsTable-Zkl4YDvz.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-B_PMJxY_.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-CtTdlQ2A.js → RepoDiffEmbedScreen-VLg4caej.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-BRvaVYoC.js → RepoDiffPageScreen-BelnvgnP.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-Bo0gREMj.js → RepoDiffViewer-VrUJw33u.js} +1 -1
- package/dist/client/assets/RepoDiffViewerLazy-BPg_JkYW.js +2 -0
- package/dist/client/assets/{ReposScreen-BBkJf8xT.js → ReposScreen-IINK-CFn.js} +2 -2
- package/dist/client/assets/ScoutDeckSurface-MbwGp6Ab.js +1 -0
- package/dist/client/assets/{ScoutSurface-DEQg_7Io.js → ScoutSurface-x_QbcRyk.js} +1 -1
- package/dist/client/assets/ScoutbotBroadcastChip-DAKQKB25.js +2 -0
- package/dist/client/assets/{ScoutbotFxLab-BgsuLDjo.js → ScoutbotFxLab-7t9JVvZg.js} +1 -1
- package/dist/client/assets/{ScoutbotRealtimeVoiceCall-Bzyl0BCS.js → ScoutbotRealtimeVoiceCall-Br4bYVAx.js} +1 -1
- package/dist/client/assets/{SecondaryNav-Bks0CO2h.js → SecondaryNav-Dj30epYF.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-b0Zgmfx5.js → SessionEmbedScreen-s2mJ5Fg9.js} +1 -1
- package/dist/client/assets/{SessionObserve-Dlx5vDaV.js → SessionObserve-DaUrJCMq.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-ChBD1d4c.js → SessionObserveEvidence-ClUW8jpV.js} +1 -1
- package/dist/client/assets/SessionRefScreen-DLZNFZFK.js +1 -0
- package/dist/client/assets/SessionsScreen-D-hN1n4k.js +1 -0
- package/dist/client/assets/{SettingsDrawer-C587L1i1.js → SettingsDrawer-BFsnww-k.js} +3 -3
- package/dist/client/assets/SettingsScreen-Bc3Xtv5V.js +1 -0
- package/dist/client/assets/{ShikiPane-I_OTW5NO.js → ShikiPane-Dkwyx--r.js} +1 -1
- package/dist/client/assets/{SlidePanel-FCqT1zO3.js → SlidePanel-CuTeirnk.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-CQs-jC-v.js → SpriteAvatar-DQ3PTb8L.js} +1 -1
- package/dist/client/assets/{StatusPill-CbABggnQ.js → StatusPill-BJ1ierIR.js} +1 -1
- package/dist/client/assets/{TailView-C_MXVSum.js → TailView-CufWcrvf.js} +2 -2
- package/dist/client/assets/Terminal-D_OmdFmr.js +1 -0
- package/dist/client/assets/TerminalEmbedScreen-D21ytNXW.js +1 -0
- package/dist/client/assets/TerminalRelay-rvUzI9Ek.js +46 -0
- package/dist/client/assets/{TextDocumentSurface-C-9EtYqt.js → TextDocumentSurface-Bc-kHPgG.js} +1 -1
- package/dist/client/assets/{TmuxPeek-Dz1gJ2pU.js → TmuxPeek-DLyDkq_D.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-MfICy9kk.js → VoicePermissionsPanel-CD903y9K.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-Cs7kdllj.js → WorkDetailScreen-D51oI0dH.js} +2 -2
- package/dist/client/assets/{WorkFilesViewer-CF-nhtZ4.js → WorkFilesViewer-BDMNbxE4.js} +1 -1
- package/dist/client/assets/{activity-WhBf3FXP.js → activity-BvGruxWG.js} +1 -1
- package/dist/client/assets/{addon-fit-q-x_HytU.js → addon-fit-Cfq4Ayjd.js} +1 -1
- package/dist/client/assets/{addon-webgl-fhhvEA9h.js → addon-webgl-B8sIf9-s.js} +1 -1
- package/dist/client/assets/{agent-essentials-DyJiUGpZ.js → agent-essentials-yb4wIJlX.js} +1 -1
- package/dist/client/assets/agent-identity-BxCsXnDp.js +1 -0
- package/dist/client/assets/{agent-lane-card-model-BCIwPjEh.js → agent-lane-card-model-q4cwzLX4.js} +1 -1
- package/dist/client/assets/agent-lane-detail-BNNm6FNu.js +2 -0
- package/dist/client/assets/{agent-lane-preview-BtnfNyFR.js → agent-lane-preview-C33Dwpn7.js} +1 -1
- package/dist/client/assets/{agent-lanes-model-Bl6xfviL.js → agent-lanes-model-VYQ5a68i.js} +2 -2
- package/dist/client/assets/{arc.es-DPJ0xRV6.js → arc.es-BBTfhvLE.js} +1 -1
- package/dist/client/assets/{arrow-left-WjQIN9J6.js → arrow-left-BOht-YQu.js} +1 -1
- package/dist/client/assets/{arrow-up-right-CtTDrZJr.js → arrow-up-right-hoR8_oUz.js} +1 -1
- package/dist/client/assets/{bot-B_Uzf4_O.js → bot-BUK7dOPS.js} +1 -1
- package/dist/client/assets/{check-BbgHJX8u.js → check--esHw52j.js} +1 -1
- package/dist/client/assets/{chevron-down-BFai6ZfE.js → chevron-down-NAhBUkFd.js} +1 -1
- package/dist/client/assets/{chevron-right-CyUa1zXx.js → chevron-right-C10o7t_X.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-CvwpNg-G.js → chunk-HRAB3GC3-DF8R9rPv.js} +1 -1
- package/dist/client/assets/{clock-DviOalxA.js → clock-of01sAB6.js} +1 -1
- package/dist/client/assets/{code-xml-05TD3uOC.js → code-xml-CLn3TDWF.js} +1 -1
- package/dist/client/assets/content-B-SUUhXj.js +1 -0
- package/dist/client/assets/content-BRY2vo1_.js +1 -0
- package/dist/client/assets/content-BTm0mVyD.js +1 -0
- package/dist/client/assets/content-BTqvyb5E.js +1 -0
- package/dist/client/assets/content-BjDaXmSD.js +1 -0
- package/dist/client/assets/content-BrR6deGh.js +1 -0
- package/dist/client/assets/content-C5yvBEMy.js +1 -0
- package/dist/client/assets/content-Cgj5AWqT.js +1 -0
- package/dist/client/assets/content-CkhG__-v.js +1 -0
- package/dist/client/assets/content-CudIBsiP.js +1 -0
- package/dist/client/assets/content-DBb7ppd5.js +1 -0
- package/dist/client/assets/content-DEw_kGyK.js +1 -0
- package/dist/client/assets/content-DIy0DCzK.js +1 -0
- package/dist/client/assets/content-THl9hRAo.js +1 -0
- package/dist/client/assets/content-Uqt8AG-s.css +1 -0
- package/dist/client/assets/content-vi9FbmV9.js +1 -0
- package/dist/client/assets/content-wcgPMGVf.js +1 -0
- package/dist/client/assets/{conversation-icons-DohQL6GI.js → conversation-icons-ClBJi21l.js} +1 -1
- package/dist/client/assets/conversation-model-CHwHZNw-.js +1 -0
- package/dist/client/assets/conversation-motion-features-zU0k3Agz.js +1 -0
- package/dist/client/assets/{copy-CwCAivnc.js → copy-Dty8ZYsM.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DlxlBfLC.js → createLucideIcon-Bt67PWH-.js} +1 -1
- package/dist/client/assets/discover-NDAqNvKt.js +2 -0
- package/dist/client/assets/embed-entry-BVR09F6e.js +2 -0
- package/dist/client/assets/{external-link-CnjcXf32.js → external-link-Dem738OJ.js} +1 -1
- package/dist/client/assets/{eye-So8tNNK6.js → eye-B3lBIwJZ.js} +1 -1
- package/dist/client/assets/{file-text-i3xTDUjJ.js → file-text-iF0hyVyU.js} +1 -1
- package/dist/client/assets/home-live-action-BkqGLVRY.js +1 -0
- package/dist/client/assets/home-moving-signal-C8dTXieA.js +1 -0
- package/dist/client/assets/home-now-card-BgvVcE83.js +1 -0
- package/dist/client/assets/{home-now-card-nano-CkLHUQ4J.js → home-now-card-nano-hZl9klbP.js} +1 -1
- package/dist/client/assets/hooks-DBIezYS2.js +2 -0
- package/dist/client/assets/index-BMwKgdz_.js +1 -0
- package/dist/client/assets/index-Bu-fckyR.css +1 -0
- package/dist/client/assets/index-BxoufAPA.js +1 -0
- package/dist/client/assets/index-Cj7NnSxI.js +1 -0
- package/dist/client/assets/{index-sUomXsrf.js → index-o4FKpU7Z.js} +2 -2
- package/dist/client/assets/{inspector-panel-DhXd-YbT.js → inspector-panel-Dy2cVTCi.js} +2 -2
- package/dist/client/assets/keyboard-nav-Chf51dns.js +1 -0
- package/dist/client/assets/{lane-observe-DrhKkQ3A.js → lane-observe-BA3g9aVd.js} +1 -1
- package/dist/client/assets/{lane-roster-store-NE15Oe6M.js → lane-roster-store-BiIVlYmG.js} +1 -1
- package/dist/client/assets/left-BC7p5QbT.js +1 -0
- package/dist/client/assets/left-BCSGqccQ.js +1 -0
- package/dist/client/assets/left-BSyj8PuJ.js +2 -0
- package/dist/client/assets/left-DDnxNUxd.js +1 -0
- package/dist/client/assets/left-DLoDKxT5.js +2 -0
- package/dist/client/assets/left-O-TBH7JB.js +1 -0
- package/dist/client/assets/left-agents-Dk9Y89lb.js +1 -0
- package/dist/client/assets/left-default-B3JBRQNJ.js +1 -0
- package/dist/client/assets/left-lanes-30Oe_3RM.js +1 -0
- package/dist/client/assets/left-mission-DEl4-7xu.js +1 -0
- package/dist/client/assets/left-plan-B4qdm4Gn.js +2 -0
- package/dist/client/assets/left-rvUOB14X.js +1 -0
- package/dist/client/assets/library-DDKSLFJ_.js +1 -0
- package/dist/client/assets/{loader-circle-lWOOKezu.js → loader-circle-4LDsy4Ke.js} +1 -1
- package/dist/client/assets/{local-agents-C7fDHLVC.js → local-agents-DIi2EacM.js} +1 -1
- package/dist/client/assets/{mentions-CY_wPZc5.js → mentions-CvDaviLJ.js} +1 -1
- package/dist/client/assets/{mesh-ops-Kn8pCtyJ.js → mesh-ops-JZwGuAPn.js} +1 -1
- package/dist/client/assets/{mesh-view-store-D14ihwkF.js → mesh-view-store-Du7VqIT_.js} +1 -1
- package/dist/client/assets/{message-circle-C5UZ6fO7.js → message-circle-BM3XgevU.js} +1 -1
- package/dist/client/assets/{message-markup-C8Nx04sP.js → message-markup-BcY1lShv.js} +1 -1
- package/dist/client/assets/{message-square-BD-4UUdc.js → message-square-ER1_q2pe.js} +1 -1
- package/dist/client/assets/mission-control-m3BTDQ9l.css +1 -0
- package/dist/client/assets/{mission-control-store-xQHVQdm8.js → mission-control-store-C6w5iVfg.js} +1 -1
- package/dist/client/assets/mission-wall-CocIM1cF.js +1 -0
- package/dist/client/assets/{observe-uJfIlIUV.js → observe-3-jn4SXb.js} +1 -1
- package/dist/client/assets/openAgent-Dbv5wfuL.js +1 -0
- package/dist/client/assets/{page-status-BymFEFai.js → page-status-0LPfBC8S.js} +1 -1
- package/dist/client/assets/{plus-C9lTjsgd.js → plus-C-2gTcPK.js} +1 -1
- package/dist/client/assets/profile-DW80Gn5k.js +1 -0
- package/dist/client/assets/{projects-inbox-DfVmGFFk.js → projects-inbox-DCeD3FfV.js} +1 -1
- package/dist/client/assets/provider-BvAxRQfE.js +1 -0
- package/dist/client/assets/{radio-DedMyP8J.js → radio-v7UAMZGh.js} +1 -1
- package/dist/client/assets/{refresh-cw-D8PFyhUa.js → refresh-cw-B5To7b6B.js} +1 -1
- package/dist/client/assets/resolve-panes-BDi9Qx4R.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-HE-5eZYa.js +1 -0
- package/dist/client/assets/right-BDf_yTv6.js +1 -0
- package/dist/client/assets/{right-C1sIsSHR.js → right-BvoGOUKH.js} +1 -1
- package/dist/client/assets/right-C-bgjYg-.js +1 -0
- package/dist/client/assets/right-C3JdEfYQ.js +1 -0
- package/dist/client/assets/right-CYIs2tEe.js +1 -0
- package/dist/client/assets/right-CyRCv6Up.js +1 -0
- package/dist/client/assets/right-DBYGtoRv.js +1 -0
- package/dist/client/assets/right-o3LHMiKa.js +1 -0
- package/dist/client/assets/right-oPrcx9MX.js +1 -0
- package/dist/client/assets/right-sSvBUK-j.js +1 -0
- package/dist/client/assets/{rocket-CriBwkHM.js → rocket-BQQQv2L5.js} +1 -1
- package/dist/client/assets/router-C65cZYPn.js +1 -0
- package/dist/client/assets/{runtime-picker-DOZpZOlt.js → runtime-picker-eDEvx2Mz.js} +1 -1
- package/dist/client/assets/{scope-views-BF_RvGKU.js → scope-views-BOOmgmwx.js} +1 -1
- package/dist/client/assets/{scout-voice-BZ4KqADJ.js → scout-voice-B7kXlkcl.js} +1 -1
- package/dist/client/assets/{scroll-text-BIYf6g6N.js → scroll-text-BuneRiAD.js} +1 -1
- package/dist/client/assets/{search-DCT_EvPr.js → search-7_n7CxWl.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-Drb7wPG4.js → secondaryNavConfig-CSFDCQAf.js} +1 -1
- package/dist/client/assets/{selection-bridge-CJOTyYQs.js → selection-bridge-SlGsgHw2.js} +1 -1
- package/dist/client/assets/{send-horizontal-DDwOgEs3.js → send-horizontal-DP16OOIW.js} +1 -1
- package/dist/client/assets/{server-CHZCp3cF.js → server-pYOMFjrT.js} +1 -1
- package/dist/client/assets/{session-catalog-XhGxCtP-.js → session-catalog-_QfQ7fhZ.js} +1 -1
- package/dist/client/assets/session-table-CYN8e4s3.js +1 -0
- package/dist/client/assets/{sliders-horizontal-B9Nj-Y4J.js → sliders-horizontal-D2Z8gz6J.js} +1 -1
- package/dist/client/assets/{sparkles-up7pVlX-.js → sparkles-Bth2iK7t.js} +1 -1
- package/dist/client/assets/{sse-CVoGDiKW.js → sse-CL6gctHY.js} +1 -1
- package/dist/client/assets/synthetic-agent-routing-aduMYO7P.js +1 -0
- package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +1 -0
- package/dist/client/assets/{tail-display-BdyoLvzY.js → tail-display-BRcJltQa.js} +2 -2
- package/dist/client/assets/{tail-events-CTipUIli.js → tail-events-NLIWLq27.js} +1 -1
- package/dist/client/assets/{terminal-DXQISjZn.js → terminal-By1Lw2i2.js} +1 -1
- package/dist/client/assets/{terminal-relay-B5Sma7fK.js → terminal-relay-CjkI5aUy.js} +1 -1
- package/dist/client/assets/{terminal-screen-19jAI0Cw.css → terminal-screen-BqVnCwl0.css} +1 -1
- package/dist/client/assets/terminal-sessions-AmSgHklm.js +1 -0
- package/dist/client/assets/{terminal-takeover-X97KCSJk.js → terminal-takeover-7AvNpnkC.js} +1 -1
- package/dist/client/assets/{use-conversation-list-B1T6J_qE.js → use-conversation-list-BCzY032j.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-DLofGhhK.js → use-fleet-active-asks-CJ6-oj5k.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-ByGZk8rU.js → use-mesh-ops-items-D5L-CKe_.js} +1 -1
- package/dist/client/assets/use-reduced-motion-CqXpVXv-.js +1 -0
- package/dist/client/assets/use-scout-dev-flags-BohC8seq.js +1 -0
- package/dist/client/assets/{useAgentHoverCard-D5e8Qg1z.js → useAgentHoverCard-RsLUYyeh.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-DOr5yHbT.js +1 -0
- package/dist/client/assets/usePersistentState-D3M4m2Ou.js +1 -0
- package/dist/client/assets/{usePierreRuntime-DIVunfX0.js → usePierreRuntime-B4hbNWTz.js} +1 -1
- package/dist/client/assets/{wrench-pEVd8JnN.js → wrench-M4G7WtYB.js} +1 -1
- package/dist/client/assets/{x-0XjXwGqq.js → x-ynOfVadO.js} +1 -1
- package/dist/client/assets/{xterm-CRLlV1Xp.js → xterm-DZHyijPp.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/main.mjs +1444 -381
- package/dist/node/main.mjs +82 -20
- package/dist/openscout-terminal-relay.mjs +16 -4
- package/dist/pairing-runtime-controller.mjs +3030 -2948
- package/dist/runtime/broker-daemon.mjs +358 -136
- package/dist/scout-control-plane-web.mjs +5646 -5184
- package/dist/scout-web-server.mjs +5646 -5184
- package/package.json +4 -4
- package/dist/client/assets/ActivityScreen-DnqqRSlS.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-CJqoMA0J.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-FpEkb-tu.js +0 -1
- package/dist/client/assets/AgentFloorView-CycUn0Lv.js +0 -1
- package/dist/client/assets/AgentInfoScreen-CAQAxpAK.js +0 -1
- package/dist/client/assets/AgentLaneDetailSheet-CWs9wKWk.js +0 -5
- package/dist/client/assets/AgentLanesEmbedScreen-BUCW4nUj.js +0 -1
- package/dist/client/assets/AgentsScreen-BMXvuiA2.js +0 -1
- package/dist/client/assets/AgentsSubnav-BTNjPYoA.js +0 -1
- package/dist/client/assets/BackToPicker-CkUmHuuo.js +0 -1
- package/dist/client/assets/BrokerScreen-CObCQvoy.js +0 -5
- package/dist/client/assets/CodeScreen-BXqi72NK.js +0 -1
- package/dist/client/assets/ConversationComposer-BBNPa5S9.js +0 -1
- package/dist/client/assets/ConversationFeedRows-BuejHMCY.js +0 -1
- package/dist/client/assets/ConversationHeader-DXMT-YXv.js +0 -1
- package/dist/client/assets/ConversationPanels-DHCtilQF.js +0 -2
- package/dist/client/assets/ConversationScreen-DSxIt9pq.css +0 -1
- package/dist/client/assets/ConversationScreen-Dz2d_Z_F.js +0 -1
- package/dist/client/assets/FlightObserveScreen-C-9S0nA5.js +0 -1
- package/dist/client/assets/FollowScreen--Q04xSSE.js +0 -1
- package/dist/client/assets/HarnessMark-Dm_qm1Ku.js +0 -1
- package/dist/client/assets/HarnessesScreen-Y54viPX8.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-DsdDz8wY.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-CBf_aNZx.js +0 -1
- package/dist/client/assets/MeshScreen-TgDtz-1l.js +0 -1
- package/dist/client/assets/MessagesScreen-BTQL0UcE.js +0 -1
- package/dist/client/assets/MissionControlView-D59SPnAm.js +0 -1
- package/dist/client/assets/MissionLogPane-Ye3YlF9s.js +0 -1
- package/dist/client/assets/NewChatComposer-B5FnPyzS.js +0 -19
- package/dist/client/assets/NewChatComposer-W-t-L4oV.css +0 -1
- package/dist/client/assets/ObserveTextFlow-CBitljxi.js +0 -2
- package/dist/client/assets/OpenScoutAppShell-BIp0WitK.js +0 -87
- package/dist/client/assets/OpsAgentsView-CoBfAigH.js +0 -1
- package/dist/client/assets/OpsScreen-Bbo0W64T.js +0 -1
- package/dist/client/assets/OpsSubnav-CoN8utF8.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-FiiIcB5R.js +0 -1
- package/dist/client/assets/ProjectsInbox-BWiXjGi7.js +0 -2
- package/dist/client/assets/ProjectsScreen-Cxk4CuYn.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-BF66ugT5.js +0 -1
- package/dist/client/assets/Provider-tFc3jqZ4.js +0 -1
- package/dist/client/assets/RawSessionsTable-BsGVgZB3.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-B0Bem5Rc.js +0 -1
- package/dist/client/assets/RepoDiffViewerLazy-C8UPk4oo.js +0 -2
- package/dist/client/assets/ScoutDeckSurface-Bi9ov9Bm.js +0 -1
- package/dist/client/assets/ScoutbotBroadcastChip-DJXuyn73.js +0 -2
- package/dist/client/assets/SessionRefScreen-D7TfPYPN.js +0 -1
- package/dist/client/assets/SessionsScreen-BlknOWAd.js +0 -1
- package/dist/client/assets/SettingsScreen-BIlYxv_a.js +0 -1
- package/dist/client/assets/Terminal-DwZyo8kA.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-Czp3tQyd.js +0 -1
- package/dist/client/assets/agent-chat-Bfjd9y6c.js +0 -1
- package/dist/client/assets/agent-identity-xQHedtLl.js +0 -1
- package/dist/client/assets/agent-lane-detail-Cw4QVAgH.js +0 -1
- package/dist/client/assets/arrow-down-DsD-dYj-.js +0 -1
- package/dist/client/assets/chunk-T65CQEWV-DI4NKdNq.js +0 -1
- package/dist/client/assets/chunk-YOZR3KYS-BW85tiCr.js +0 -47
- package/dist/client/assets/content-2u_eV3fX.js +0 -1
- package/dist/client/assets/content-5irOghrY.js +0 -1
- package/dist/client/assets/content-8Z_0CwtD.js +0 -1
- package/dist/client/assets/content-B38YRDBu.js +0 -1
- package/dist/client/assets/content-BE3uK0LB.js +0 -1
- package/dist/client/assets/content-BtIxSqVY.js +0 -1
- package/dist/client/assets/content-CFsPAihU.js +0 -1
- package/dist/client/assets/content-CHU0wwA3.css +0 -1
- package/dist/client/assets/content-CKj5g5tu.js +0 -1
- package/dist/client/assets/content-CLDWXf9Z.js +0 -1
- package/dist/client/assets/content-CRr73E0r.js +0 -1
- package/dist/client/assets/content-CVR75_Uj.js +0 -1
- package/dist/client/assets/content-Czdp7_JQ.js +0 -1
- package/dist/client/assets/content-D0_EJ6nP.js +0 -1
- package/dist/client/assets/content-DNmxpNhD.js +0 -1
- package/dist/client/assets/content-XpbI9uxd.js +0 -1
- package/dist/client/assets/content-cyxWdgKQ.js +0 -1
- package/dist/client/assets/conversation-model-C4yb6_FA.js +0 -1
- package/dist/client/assets/conversation-motion-features-CifSdJtm.js +0 -1
- package/dist/client/assets/discover-DoiAJo4Z.js +0 -2
- package/dist/client/assets/embed-entry-D1Or9S4d.js +0 -2
- package/dist/client/assets/gestures-CgvAMd6F.js +0 -1
- package/dist/client/assets/home-live-action-B22u89j7.js +0 -1
- package/dist/client/assets/home-moving-signal-BdkERL6B.js +0 -1
- package/dist/client/assets/home-now-card-lLkv6nQs.js +0 -1
- package/dist/client/assets/hooks-BPLDD9yu.js +0 -2
- package/dist/client/assets/index-DGoLx89y.js +0 -1
- package/dist/client/assets/index-DITWsjFb.css +0 -1
- package/dist/client/assets/index-m6dFtY5f.js +0 -1
- package/dist/client/assets/index-pY8-Mz7y.js +0 -1
- package/dist/client/assets/keyboard-nav-BhZZ5HEq.js +0 -1
- package/dist/client/assets/left-B6eawimv.js +0 -1
- package/dist/client/assets/left-BL2uBHe0.js +0 -2
- package/dist/client/assets/left-BNJguPDG.js +0 -1
- package/dist/client/assets/left-BvCtvN0f.js +0 -1
- package/dist/client/assets/left-CfBb6bxM.js +0 -1
- package/dist/client/assets/left-DTrlBF0h.js +0 -2
- package/dist/client/assets/left-agents-DsOHgDCY.js +0 -1
- package/dist/client/assets/left-d4hlBBxY.js +0 -1
- package/dist/client/assets/left-default-BRCwoCJr.js +0 -1
- package/dist/client/assets/left-lanes-DNtoRzoV.js +0 -1
- package/dist/client/assets/left-mission-DsTu2X5Y.js +0 -1
- package/dist/client/assets/left-plan-CtySjsXC.js +0 -2
- package/dist/client/assets/library-CLpgWNJO.js +0 -1
- package/dist/client/assets/mission-control-D3ikEPND.css +0 -1
- package/dist/client/assets/openAgent-Bjt57GdM.js +0 -1
- package/dist/client/assets/paperclip-DL9BXPp2.js +0 -1
- package/dist/client/assets/profile-BqY5tesX.js +0 -1
- package/dist/client/assets/resolve-panes-1xeZMuaw.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-PLr32WHN.js +0 -1
- package/dist/client/assets/right-1x7HzabC.js +0 -1
- package/dist/client/assets/right-CFzPUzlF.js +0 -1
- package/dist/client/assets/right-CRKyeJDk.js +0 -1
- package/dist/client/assets/right-CagzkLWg.js +0 -1
- package/dist/client/assets/right-CsV149pN.js +0 -1
- package/dist/client/assets/right-DITNyG2s.js +0 -1
- package/dist/client/assets/right-E3nNcLE3.js +0 -1
- package/dist/client/assets/right-eUQvSjd7.js +0 -1
- package/dist/client/assets/right-ozp4nM44.js +0 -1
- package/dist/client/assets/router-Dja9_ygK.js +0 -1
- package/dist/client/assets/session-table-sAVe44a4.js +0 -1
- package/dist/client/assets/system-surfaces-redesign-CD26LFc0.css +0 -1
- package/dist/client/assets/terminal-sessions-D5CIR2OL.js +0 -1
- package/dist/client/assets/use-reduced-motion-Cvk-HRKg.js +0 -1
- package/dist/client/assets/use-scout-dev-flags-BHvg3G2c.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-ZfBNi3d4.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as e,r as c,O as Se}from"./index-sUomXsrf.js";import{a as Ne,u as ke}from"./router-Dja9_ygK.js";import{a as T}from"./api-h5zurxmi.js";import{u as me,a as Ce}from"./Provider-tFc3jqZ4.js";import{t as Ae}from"./time-Dhsh_2EG.js";import{h as Ee,j as Oe,k as Te}from"./scout-voice-BZ4KqADJ.js";import{u as Pe}from"./keyboard-nav-BhZZ5HEq.js";import{VoiceHostStatusBanner as Ie,VoicePermissionsPanel as $e}from"./VoicePermissionsPanel-MfICy9kk.js";import{u as Re}from"./chunk-HRAB3GC3-CvwpNg-G.js";import{C as R}from"./check-BbgHJX8u.js";import{c as Q}from"./createLucideIcon-DlxlBfLC.js";import{R as De}from"./refresh-cw-D8PFyhUa.js";import{C as Le}from"./copy-CwCAivnc.js";const _e=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Me=Q("monitor",_e);const Ve=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Be=Q("moon",Ve);const He=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ke=Q("sun",He);class E extends Error{code;cause;constructor(s,a,i){super(a),this.name="HudVaultError",this.code=s,this.cause=i}}function Y(t){const s=new Uint8Array(new ArrayBuffer(t.byteLength));return s.set(t),s}const M="items",H="keys",ne="master";class Ue{service;dbPromise;cryptoKeyPromise;constructor(s){this.service=s.service}async set(s,a){const i=new TextEncoder().encode(a);await this.setBytes(s,i)}async get(s){const a=await this.getBytes(s);if(!a)return null;try{return new TextDecoder().decode(a)}catch(i){throw new E("encoding_failed","value is not valid UTF-8",i)}}async delete(s){await this.idbDelete(M,s)}async setBytes(s,a){const i=await this.getOrCreateCryptoKey(),o=crypto.getRandomValues(new Uint8Array(12));let d;try{d=await crypto.subtle.encrypt({name:"AES-GCM",iv:o},i,Y(a))}catch(h){throw new E("crypto_failed","AES-GCM encrypt failed",h)}await this.idbWrite(M,s,{iv:o,ct:new Uint8Array(d)})}async getBytes(s){const a=await this.idbRead(M,s);if(!a)return null;const i=await this.getOrCreateCryptoKey();try{const o=await crypto.subtle.decrypt({name:"AES-GCM",iv:Y(a.iv)},i,Y(a.ct));return new Uint8Array(o)}catch(o){throw new E("crypto_failed","AES-GCM decrypt failed",o)}}getOrCreateCryptoKey(){return this.cryptoKeyPromise?this.cryptoKeyPromise:(this.cryptoKeyPromise=(async()=>{if(typeof crypto>"u"||!crypto.subtle)throw new E("crypto_unsupported","crypto.subtle is not available");const s=await this.idbRead(H,ne);if(s)return s;let a;try{a=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}catch(i){throw new E("crypto_failed","AES-GCM key generation failed",i)}return await this.idbWrite(H,ne,a),a})(),this.cryptoKeyPromise)}getDB(){return this.dbPromise?this.dbPromise:(this.dbPromise=new Promise((s,a)=>{if(typeof indexedDB>"u"){a(new E("idb_unsupported","IndexedDB is not available"));return}const i=indexedDB.open(`hudvault:${this.service}`,1);i.onupgradeneeded=()=>{const o=i.result;o.objectStoreNames.contains(M)||o.createObjectStore(M),o.objectStoreNames.contains(H)||o.createObjectStore(H)},i.onsuccess=()=>s(i.result),i.onerror=()=>a(new E("idb_failed",K("open",i.error),i.error))}),this.dbPromise)}async idbRead(s,a){const i=await this.getDB();return new Promise((o,d)=>{const m=i.transaction(s,"readonly").objectStore(s).get(a);m.onsuccess=()=>o(m.result),m.onerror=()=>d(new E("idb_failed",K("read",m.error),m.error))})}async idbWrite(s,a,i){const o=await this.getDB();await new Promise((d,h)=>{const m=o.transaction(s,"readwrite");m.oncomplete=()=>d(),m.onerror=()=>h(new E("idb_failed",K("write",m.error),m.error)),m.objectStore(s).put(i,a)})}async idbDelete(s,a){const i=await this.getDB();await new Promise((o,d)=>{const h=i.transaction(s,"readwrite");h.oncomplete=()=>o(),h.onerror=()=>d(new E("idb_failed",K("delete",h.error),h.error)),h.objectStore(s).delete(a)})}}function K(t,s){return`IndexedDB ${t} failed${s?.message?`: ${s.message}`:""}`}const Fe="dev.openscout.credentials",X="openai_api_key",J=new Ue({service:Fe});async function pe(){const s=(await J.get(X))?.trim();return s&&s.startsWith("sk-")?s:null}async function We(t){const s=t.trim();if(!s.startsWith("sk-"))throw new Error("OpenAI API keys should start with sk-.");await J.set(X,s)}async function ze(){await J.delete(X)}async function ge(t){return T("/api/scoutbot/credentials/openai",{method:"POST",body:JSON.stringify({apiKey:t.trim()})})}async function qe(){return T("/api/scoutbot/credentials/openai",{method:"DELETE"})}async function be(){return T("/api/scoutbot/credentials")}async function Ge(){const t=await be();if(t.openai.configured)return t;const s=await pe();return s?ge(s):null}async function Ye(){const t=await pe();return{configured:!!t,preview:t?Qe(t):null}}function Qe(t){return t.length<=10?"configured":`${t.slice(0,5)}...${t.slice(-4)}`}const Xe=[195,125,300,45,355,210];function ie(t){return`oklch(0.80 0.14 ${t})`}function Je(t){return`oklch(0.18 0.08 ${t})`}function p({label:t,right:s}){return e.jsxs("div",{className:"s-settings-section-rule",children:[e.jsx("span",{className:"s-settings-section-label",children:t}),e.jsx("span",{className:"s-settings-section-line"}),s&&e.jsx("span",{className:"s-settings-section-right",children:s})]})}function w({label:t,hint:s,children:a}){return e.jsxs("div",{className:"s-settings-field",children:[e.jsx("label",{className:"s-settings-field-label",children:t}),a,s&&e.jsx("span",{className:"s-settings-field-hint",children:s})]})}function D({value:t,onChange:s,mono:a}){return e.jsx("input",{className:`s-settings-input${a?" s-settings-input--mono":""}`,value:t,onChange:i=>s(i.target.value)})}function re({value:t,onChange:s,rows:a=3}){return e.jsx("textarea",{className:"s-settings-textarea",value:t,onChange:i=>s(i.target.value),rows:a})}function Ze({value:t,onChange:s,min:a,max:i,step:o=1,unit:d=""}){return e.jsxs("div",{className:"s-settings-slider-wrap",children:[e.jsx("input",{type:"range",min:a,max:i,step:o,value:t,onChange:h=>s(Number(h.target.value))}),e.jsxs("span",{className:"s-settings-slider-value",children:[t," ",d]})]})}function L({value:t,onChange:s,options:a,stacked:i,columns:o}){return e.jsx("div",{className:i?"s-settings-option-stacked":"s-settings-option-grid",style:i?void 0:{gridTemplateColumns:`repeat(${o??a.length}, 1fr)`},children:a.map(d=>e.jsxs("button",{className:`s-settings-option-btn${t===d.id?" s-settings-option-btn--active":""}`,onClick:()=>s(d.id),children:[e.jsx("span",{className:"s-settings-option-label",children:d.label}),e.jsx("span",{className:"s-settings-option-sub",children:d.sub})]},d.id))})}const es=[{id:"system",label:"System",sub:"Follow this device",icon:Me},{id:"light",label:"Light",sub:"Bright workspace",icon:Ke},{id:"dark",label:"Dark",sub:"Low-light workspace",icon:Be}],ss=[{id:"scout",label:"Scout",sub:"Control-room navigation"},{id:"slack",label:"Slack",sub:"Workspace rail and channel-style lists"}],le=[{id:"scout",label:"Scout",sub:"Near-neutral control room",spec:"SLATE · LIME"},{id:"graphite",label:"Graphite",sub:"Monochrome technical chassis",spec:"BLACK · SLATE"},{id:"polar",label:"Polar",sub:"Nord-inspired arctic slate",spec:"POLAR · FROST"},{id:"solar",label:"Solar",sub:"Solarized-inspired measured contrast",spec:"TEAL · PAPER"}],oe=[{id:"hudson",label:"Rounded",sub:"Soft corners and luminous chrome",spec:"8PX"},{id:"editorial",label:"Compact",sub:"Tighter corners and flatter hierarchy",spec:"4PX"},{id:"drafting",label:"Square",sub:"Zero-radius technical grid",spec:"0PX"}],ce=[{id:"soft",label:"Soft",sub:"Quiet separators"},{id:"balanced",label:"Defined",sub:"Clear structure"},{id:"strong",label:"Strong",sub:"High separation"}],de=[{id:"theme",label:"Theme"},{id:"lime",label:"Lime"},{id:"cyan",label:"Cyan"},{id:"violet",label:"Violet"},{id:"amber",label:"Amber"}];function U({className:t,theme:s,template:a,palette:i,contrast:o,accent:d,children:h}){return e.jsx("div",{className:t,"data-scout-theme":s,"data-scout-theme-mode":s,"data-scout-palette":i,"data-scout-contrast":o,"data-scout-accent":d,"data-hudson-theme":s,"data-hudson-template":a,children:h})}function ts({palette:t,theme:s,template:a}){return e.jsxs(U,{className:"s-settings-palette-sample",theme:s,template:a,palette:t,contrast:"balanced",accent:"theme",children:[e.jsxs("span",{className:"s-settings-palette-rail",children:[e.jsx("i",{}),e.jsx("i",{"data-active":!0}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsxs("span",{className:"s-settings-palette-list",children:[e.jsx("i",{}),e.jsx("i",{"data-selected":!0}),e.jsx("i",{})]}),e.jsxs("span",{className:"s-settings-palette-detail",children:[e.jsx("i",{"data-title":!0}),e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{"data-action":!0})]})]})}function as({theme:t,template:s,palette:a,contrast:i,accent:o}){return e.jsxs(U,{className:"s-settings-live-preview",theme:t,template:s,palette:a,contrast:i,accent:o,children:[e.jsxs("div",{className:"s-settings-live-preview-bar",children:[e.jsxs("span",{children:[e.jsx("i",{})," SCOUT"]}),e.jsxs("span",{className:"s-settings-live-preview-state",children:[e.jsx("i",{})," WORKING"]})]}),e.jsxs("div",{className:"s-settings-live-preview-shell",children:[e.jsxs("div",{className:"s-settings-live-preview-rail","aria-hidden":"true",children:[e.jsx("i",{"data-active":!0}),e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsxs("div",{className:"s-settings-live-preview-list",children:[e.jsx("span",{className:"s-settings-live-preview-kicker",children:"CONVERSATIONS"}),e.jsxs("span",{className:"s-settings-live-preview-row","data-selected":!0,children:[e.jsx("i",{}),e.jsx("b",{children:"Openscout"}),e.jsx("small",{children:"now"})]}),e.jsxs("span",{className:"s-settings-live-preview-row",children:[e.jsx("i",{}),e.jsx("b",{children:"Hudson"}),e.jsx("small",{children:"8m"})]}),e.jsxs("span",{className:"s-settings-live-preview-row",children:[e.jsx("i",{}),e.jsx("b",{children:"Scout"}),e.jsx("small",{children:"1h"})]})]}),e.jsxs("div",{className:"s-settings-live-preview-detail",children:[e.jsx("span",{className:"s-settings-live-preview-kicker",children:"ACTIVE FLIGHT"}),e.jsx("strong",{children:"Theme system review"}),e.jsx("p",{children:"Separating palette, interface shape, and contrast keeps every choice honest."}),e.jsxs("div",{className:"s-settings-live-preview-event",children:[e.jsx("i",{})," Agent is working · updated now"]}),e.jsx("button",{type:"button",tabIndex:-1,children:"Open trace"})]})]})]})}function ns(){const t=Re(),{appearanceDetails:s,updateAppearanceDetails:a}=me();if(!t)return e.jsx("div",{className:"s-settings-inline-note",children:"Theme controls are unavailable in this embedded surface."});const i=t.resolvedTheme??"dark",o=Se(t.template)??"hudson",d=le.find(n=>n.id===s.palette)?.label??"Scout",h=oe.find(n=>n.id===o)?.label??"Rounded",m=ce.find(n=>n.id===s.contrast)?.label??"Defined",v=de.find(n=>n.id===s.accent)?.label??"Theme";return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(p,{label:"App layout",right:`currently ${s.shell}`}),e.jsx("div",{className:"s-settings-shell-grid",role:"group","aria-label":"App layout",children:ss.map(n=>{const r=s.shell===n.id;return e.jsxs("button",{type:"button",className:"s-settings-shell-choice","data-shell":n.id,"data-active":r||void 0,"aria-pressed":r,onClick:()=>a({shell:n.id}),children:[e.jsxs("span",{className:"s-settings-shell-sample","aria-hidden":"true",children:[e.jsx("i",{"data-part":"top"}),e.jsx("i",{"data-part":"rail"}),e.jsxs("i",{"data-part":"list",children:[e.jsx("b",{}),e.jsx("b",{}),e.jsx("b",{})]}),e.jsxs("i",{"data-part":"content",children:[e.jsx("b",{}),e.jsx("b",{}),e.jsx("b",{})]})]}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:n.label}),r?e.jsx(R,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]}),e.jsx("small",{children:n.sub})]})]},n.id)})}),e.jsx(p,{label:"Color mode",right:`currently ${i}`}),e.jsx("div",{className:"s-settings-theme-mode-grid",role:"group","aria-label":"Color mode",children:es.map(n=>{const r=n.icon,x=t.theme===n.id,f=n.id==="system"?`Follow this device · resolves to ${t.resolvedTheme??"…"}`:n.sub;return e.jsxs("button",{type:"button",className:"s-settings-theme-mode","data-active":x||void 0,"aria-pressed":x,onClick:()=>t.setTheme(n.id),children:[e.jsx(r,{size:18,strokeWidth:1.7,"aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("strong",{children:n.label}),e.jsx("small",{children:f})]}),x?e.jsx(R,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]},n.id)})}),e.jsxs("div",{className:"s-settings-appearance-workbench",children:[e.jsxs("div",{className:"s-settings-appearance-controls",children:[e.jsx(p,{label:"Color theme",right:`currently ${d.toLowerCase()}`}),e.jsx("div",{className:"s-settings-palette-grid",role:"group","aria-label":"Color theme",children:le.map(n=>{const r=s.palette===n.id;return e.jsxs("button",{type:"button",className:"s-settings-palette-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>a({palette:n.id}),children:[e.jsx(ts,{palette:n.id,theme:i,template:o}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:n.label}),r?e.jsx(R,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]}),e.jsx("small",{children:n.sub}),e.jsx("span",{children:n.spec})]})]},n.id)})}),e.jsx(p,{label:"Interface shape",right:`currently ${h.toLowerCase()}`}),e.jsx("div",{className:"s-settings-interface-grid",role:"group","aria-label":"Interface shape",children:oe.map(n=>{const r=o===n.id;return e.jsxs("button",{type:"button",className:"s-settings-interface-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>t.setTemplate(n.id),children:[e.jsx(U,{className:"s-settings-shape-sample",theme:i,template:n.id,palette:s.palette,contrast:s.contrast,accent:s.accent,children:e.jsx("i",{children:e.jsx("i",{})})}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:n.label}),r?e.jsx(R,{className:"s-settings-theme-check",size:14,"aria-hidden":!0}):null]}),e.jsx("small",{children:n.sub}),e.jsx("span",{children:n.spec})]})]},n.id)})}),e.jsx(p,{label:"Separation",right:`currently ${m.toLowerCase()}`}),e.jsx("div",{className:"s-settings-contrast-grid",role:"group","aria-label":"Interface contrast",children:ce.map(n=>{const r=s.contrast===n.id;return e.jsxs("button",{type:"button",className:"s-settings-contrast-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>a({contrast:n.id}),children:[e.jsxs("span",{className:"s-settings-contrast-lines","data-level":n.id,"aria-hidden":!0,children:[e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsx("strong",{children:n.label}),e.jsx("small",{children:n.sub})]},n.id)})}),e.jsx(p,{label:"Signal accent",right:`currently ${v.toLowerCase()}`}),e.jsx("div",{className:"s-settings-accent-row",role:"group","aria-label":"Signal accent",children:de.map(n=>{const r=s.accent===n.id;return e.jsxs("button",{type:"button",className:"s-settings-accent-choice","data-accent-option":n.id,"data-active":r||void 0,"aria-pressed":r,"aria-label":`${n.label} accent`,onClick:()=>a({accent:n.id}),children:[e.jsx(U,{className:"s-settings-accent-dot",theme:i,template:o,palette:s.palette,contrast:s.contrast,accent:n.id,children:e.jsx("i",{})}),e.jsx("span",{children:n.label}),r?e.jsx(R,{size:13,"aria-hidden":!0}):null]},n.id)})}),e.jsxs("div",{className:"s-settings-appearance-note",children:[e.jsx("strong",{children:"Saved on this device"}),e.jsx("span",{children:"Layout, mode, palette, shape, separation, and accent stay in sync across tabs. URL overrides remain available for embeds and visual QA."})]})]}),e.jsxs("aside",{className:"s-settings-preview-column","aria-label":"Live appearance preview",children:[e.jsx(p,{label:"Live specimen",right:i}),e.jsx(as,{theme:i,template:o,palette:s.palette,contrast:s.contrast,accent:s.accent}),e.jsxs("dl",{className:"s-settings-theme-readout",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Palette"}),e.jsx("dd",{children:d})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Shape"}),e.jsx("dd",{children:h})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Separation"}),e.jsx("dd",{children:m})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Accent"}),e.jsx("dd",{children:v})]})]}),e.jsx("p",{className:"s-settings-preview-note",children:"Each control changes one visual axis. Success, warning, and failure colors keep their meaning."})]})]})]})}function is({profile:t,update:s}){return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(p,{label:"Identity",right:"visible to every agent"}),e.jsxs("div",{className:"s-settings-identity-card",children:[e.jsx("span",{className:"s-settings-identity-dot",style:{background:ie(t.hue),color:Je(t.hue)},children:(t.name||"?")[0].toUpperCase()}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{className:"s-settings-identity-name",children:t.name||"Unnamed"}),e.jsxs("div",{className:"s-settings-identity-meta",children:[t.handle||"@you"," · ",t.pronouns||"—"," · operator"]})]}),e.jsxs("div",{className:"s-settings-hue-wrap",children:[e.jsx("span",{className:"s-settings-field-label",children:"Identity hue"}),e.jsx("div",{className:"s-settings-hue-row",children:Xe.map(a=>e.jsx("button",{onClick:()=>s({hue:a}),className:`s-settings-hue-dot${t.hue===a?" s-settings-hue-dot--active":""}`,style:{background:ie(a)}},a))})]})]}),e.jsx(w,{label:"Display name",hint:"Shown when agents address you.",children:e.jsx(D,{value:t.name,onChange:a=>s({name:a})})}),e.jsx(w,{label:"Handle",hint:"Used in @mentions across threads.",children:e.jsx(D,{value:t.handle,onChange:a=>s({handle:a}),mono:!0})}),e.jsx(w,{label:"Pronouns",children:e.jsx(D,{value:t.pronouns,onChange:a=>s({pronouns:a})})}),e.jsx(p,{label:"How agents understand you",right:"shipped as system prompt context"}),e.jsx(w,{label:"Operator bio",hint:"How you want to be worked with. Agents read this before asking you things.",children:e.jsx(re,{value:t.bio,onChange:a=>s({bio:a}),rows:4})}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(w,{label:"Timezone",children:e.jsx(D,{value:t.timezone,onChange:a=>s({timezone:a}),mono:!0})}),e.jsx(w,{label:"Working hours",children:e.jsx(D,{value:t.workingHours,onChange:a=>s({workingHours:a}),mono:!0})})]}),e.jsx(p,{label:"Ephemeral agent names",right:"rotation pool for one-off agents"}),e.jsx(w,{label:"Name pool",hint:t.provisionalAgentNames.length>0?`${t.provisionalAgentNamesResolvedCount} names active (${t.provisionalAgentNamesSource}). Preview: ${t.provisionalAgentNamesPreview.join(", ")}${t.provisionalAgentNamesResolvedCount>t.provisionalAgentNamesPreview.length?", …":""}`:"Leave empty to use Scout's built-in rotation. One short name per line.",children:e.jsx(re,{value:t.provisionalAgentNames.join(`
|
|
2
|
-
`),onChange:a=>s({provisionalAgentNames:a.split(/\r?\n/u).map(i=>i.trim()).filter(Boolean)}),rows:6})}),e.jsx(w,{label:"Pool mode",hint:"Replace uses only your list. Add to defaults prepends yours, then Scout's built-in names.",children:e.jsx(L,{value:t.provisionalAgentNamesMode,onChange:a=>s({provisionalAgentNamesMode:a}),options:[{id:"replace",label:"Replace",sub:"your list only"},{id:"extend",label:"Add to defaults",sub:"yours first, then Scout"}],columns:2})})]})}function rs({profile:t,update:s}){return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(p,{label:"Interrupt policy"}),e.jsx(w,{label:"When agents can ping you directly",hint:"Blocking-only means only asks that truly stall work. Others get batched.",children:e.jsx(L,{value:t.interruptThreshold,onChange:a=>s({interruptThreshold:a}),options:[{id:"always",label:"Always",sub:"any ask, any time"},{id:"blocking-only",label:"Blocking only",sub:"stuck agents · default"},{id:"batched",label:"Batched",sub:"grouped every 15m"},{id:"never",label:"Never",sub:"queue only, I'll check in"}]})}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(w,{label:"Batch window (min)",children:e.jsx(Ze,{value:t.batchWindow,min:5,max:60,step:5,onChange:a=>s({batchWindow:a}),unit:"min"})}),e.jsx(w,{label:"Quiet hours",children:e.jsx(D,{value:t.quietHours,onChange:a=>s({quietHours:a}),mono:!0})})]}),e.jsx(p,{label:"Where to reach you"}),e.jsx(w,{label:"Preferred channel",children:e.jsx(L,{value:t.channel,onChange:a=>s({channel:a}),options:[{id:"here",label:"Here only",sub:"desktop app"},{id:"mobile",label:"Mobile only",sub:"paired phone"},{id:"here+mobile",label:"Both",sub:"whichever is active"}]})}),e.jsx(p,{label:"Tone calibration",right:"how agents write to you"}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(w,{label:"Verbosity",children:e.jsx(L,{stacked:!0,value:t.verbosity,onChange:a=>s({verbosity:a}),options:[{id:"terse",label:"Terse",sub:"one-liners, answers only"},{id:"normal",label:"Normal",sub:"context + answer"},{id:"detailed",label:"Detailed",sub:"show reasoning"}]})}),e.jsx(w,{label:"Tone",children:e.jsx(L,{stacked:!0,value:t.tone,onChange:a=>s({tone:a}),options:[{id:"direct",label:"Direct",sub:"no hedging"},{id:"warm",label:"Warm",sub:"friendly, conversational"},{id:"formal",label:"Formal",sub:"business-like"}]})})]})]})}function ls({clientCredentials:t,serverCredentials:s,reloadCredentials:a}){const[i,o]=c.useState(""),[d,h]=c.useState(!1),[m,v]=c.useState(null),n=s?.openai??null,r=!!n?.configured,x=n?.source==="env"?"OPENAI_API_KEY":n?.source==="local-config"?"local Scout config":n?.source==="local-store"?"local OpenScout store":"missing",f=n?.source==="local-store"&&t?.configured?"local OpenScout store + HudVault mirror":x,C=n?.preview??t?.preview??null,O=async()=>{h(!0),v(null);try{const g=i.trim();await ge(g);let j=null;try{await We(g)}catch(N){j=N instanceof Error?N.message:"HudVault save failed."}o(""),await a(),v(j?`Saved to local OpenScout store. Browser mirror failed: ${j}`:"Saved to local OpenScout store and Hudson Vault.")}catch(g){v(g instanceof Error?g.message:"Could not save key.")}finally{h(!1)}},P=async()=>{h(!0),v(null);try{const[g,j]=await Promise.allSettled([ze(),qe()]);o(""),await a(),g.status==="rejected"||j.status==="rejected"?v("Cleared what I could; one credential store did not respond."):v(n?.source==="env"||n?.source==="local-config"?"Removed saved key. Server fallback is still configured.":"Removed saved key.")}catch(g){v(g instanceof Error?g.message:"Could not clear key.")}finally{h(!1)}};return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(p,{label:"Model providers",right:r?`configured · ${f}`:"missing"}),e.jsx("div",{className:"s-settings-relay-card",children:e.jsxs("div",{children:[e.jsxs("div",{className:"s-settings-relay-title",children:["OpenAI · ",e.jsxs("span",{className:"s-settings-device-status",style:{color:r?"var(--green)":"var(--dim)"},children:["●"," ",r?"ready":"missing"]})]}),e.jsxs("div",{className:"s-settings-relay-meta",children:[C??"No key stored"," · ",f]}),e.jsx("div",{className:"s-settings-relay-desc",children:"Scout stores user-entered keys in the local OpenScout credential store and keeps a HudVault mirror for this browser profile."})]})}),e.jsx(w,{label:"OpenAI API key",hint:"Saved locally. Existing keys are never shown again.",children:e.jsx("input",{className:"s-settings-input s-settings-input--mono",type:"password",value:i,placeholder:r?"Saved key configured":"sk-...",autoComplete:"off",spellCheck:!1,onChange:g=>o(g.target.value)})}),m&&e.jsx("div",{className:"s-settings-field-hint",children:m}),e.jsxs("div",{className:"s-settings-button-row",children:[e.jsx("button",{type:"button",className:"s-btn",disabled:d||!i.trim(),onClick:()=>{O()},children:d?"Saving":"Save key"}),e.jsx("button",{type:"button",className:"s-btn",disabled:d||!(t?.configured||n?.source==="local-store"),onClick:()=>{P()},children:"Clear saved key"})]})]})}const os=[{id:"auto",label:"Auto",sub:"Parakeet when warm, Apple fallback"},{id:"parakeet",label:"Parakeet",sub:"on-device, best quality"},{id:"apple",label:"Apple Speech",sub:"instant, no model warmup"}];function cs(){const t=ke(Ce,!1),[s,a]=c.useState(null),[i,o]=c.useState([]),[d,h]=c.useState([]),[m,v]=c.useState(!0),[n,r]=c.useState(!1),[x,f]=c.useState(null),C=c.useCallback(async()=>{v(!0);try{const[l,y]=await Promise.all([Ee(),Oe(12).catch(()=>[])]);a(l.settings),o(l.devices),h(y),f(null)}catch(l){f(l instanceof Error?l.message:String(l))}finally{v(!1)}},[]);c.useEffect(()=>{C()},[C]);const O=c.useCallback(async l=>{r(!0),f(null);try{const y=await Te(l);a(y.settings),o(y.devices)}catch(y){f(y instanceof Error?y.message:String(y))}finally{r(!1)}},[]);if(m&&!s)return e.jsx("div",{className:"s-settings-field-hint",children:"Loading voice settings…"});const P=s?.inputDeviceId??i.find(l=>l.isDefault)?.id??"",g=s?.permissions?.find(l=>l.kind==="microphone")??null,j=s?.permissions?.find(l=>l.kind==="speechRecognition")??null,N=(s?.permissions?.length??0)>0||i.length>0,I=[N?null:"Scout voice host is offline. Launch Scout Menu on this Mac — the browser does not capture audio.",g?.status==="denied"||g?.status==="restricted"?g?.status==="restricted"?"Microphone access is restricted on this Mac.":"Microphone access is off for Scout Menu. Choose Retry access to reopen the macOS permission pane.":g?.canRequest?"Microphone has not been requested yet. Request access or tap the mic in chat to show the macOS prompt.":null,!j?.granted&&(j?.status==="denied"||j?.status==="restricted")?j?.status==="restricted"?"Speech recognition is restricted on this Mac.":"Speech recognition is off for Scout Menu. Open Privacy & Security → Speech Recognition to change it.":null,s?.modelReady?null:"Parakeet may download on first use. Apple Speech stays available while the model warms.","Dictation requires Scout Menu running. The browser does not capture audio.","If transcription hangs on Processing, wait up to 60 seconds or tap the mic again to cancel."].filter(l=>!!l);return e.jsxs("div",{className:"s-settings-col-gap",children:[x&&e.jsx("div",{className:"s-settings-field-hint",style:{color:"var(--amber)"},children:x}),e.jsx(p,{label:"Realtime conversation",right:"footer control"}),e.jsx("div",{className:"s-settings-realtime-voice","data-enabled":t||void 0,"data-unavailable":!t||void 0,children:e.jsxs("span",{className:"s-settings-realtime-voice-copy",children:[e.jsx("strong",{children:t?"Realtime voice enabled":"Realtime voice disabled"}),e.jsx("span",{children:"Starting a call sends microphone audio to OpenAI Realtime and bills the configured OpenAI API account. Voice may read live Scout context and navigate this app; agent requests still require confirmation."}),t?e.jsx("em",{children:"Use Voice in the footer to start or manage a call."}):e.jsx("em",{children:"Turn on Live voice in the host app's Settings → Voice."})]})}),e.jsx(Ie,{hostOnline:N,micPermission:g,speechPermission:j,modelReady:s?.modelReady}),e.jsx(p,{label:"Scout Menu permissions",right:"voice host"}),e.jsx($e,{permissions:s?.permissions,hostOnline:N,disabled:n||m,onError:l=>f(l),onRefresh:C}),e.jsx(p,{label:"Transcription"}),e.jsx(w,{label:"Engine",hint:s?.modelReady?"Parakeet is warm and ready.":s?.modelInstalled?"Parakeet is installed; first dictation may warm the model.":"Parakeet downloads on first use. Apple Speech stays available meanwhile.",children:e.jsx(L,{value:s?.preference??"auto",onChange:l=>{a(y=>y&&{...y,preference:l}),O({preference:l})},options:os,columns:3})}),e.jsx(w,{label:"Microphone input",hint:"Scout Menu uses the macOS system default input unless you pick a device here. The browser never captures audio.",children:i.length>0?e.jsx("select",{className:"s-settings-input",value:P,disabled:n,onChange:l=>{const y=l.target.value||null;a($=>$&&{...$,inputDeviceId:y,inputDeviceName:i.find(_=>_.id===y)?.name??null}),O({inputDeviceId:y})},children:i.map(l=>e.jsxs("option",{value:l.id,children:[l.name,l.isDefault?" (system default)":""]},l.id))}):e.jsx("div",{className:"s-settings-field-hint",children:"Scout Menu is not reporting microphones. Launch Scout Menu, grant mic access, then refresh."})}),e.jsx(p,{label:"Diagnostics"}),e.jsx("ul",{className:"s-settings-field-hint",style:{margin:0,paddingLeft:"1.1rem",display:"grid",gap:"0.35rem"},children:I.map(l=>e.jsx("li",{children:l},l))}),e.jsx(p,{label:"Recent sessions",right:d.length?`${d.length} shown`:"none"}),d.length===0?e.jsx("div",{className:"s-settings-field-hint",children:"No recent dictation sessions on this web server. History fills as you use the mic in chat."}):e.jsx("div",{className:"s-settings-col-gap",style:{gap:"0.35rem"},children:d.map(l=>e.jsx("div",{className:"s-settings-device-row",style:{alignItems:"flex-start"},children:e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{className:"s-settings-device-name",style:{fontFamily:"var(--mono)"},children:[l.status," · ",l.lastEvent??"started"]}),e.jsxs("div",{className:"s-settings-device-meta",children:[l.surface," · ",Ae(l.updatedAt),l.error?` · ${l.error}`:""]}),l.lastTranscript?e.jsx("div",{className:"s-settings-field-hint",style:{marginTop:"0.2rem"},children:l.lastTranscript.length>96?`${l.lastTranscript.slice(0,96)}…`:l.lastTranscript}):null]})},l.sessionId))}),e.jsx("div",{className:"s-settings-button-row",children:e.jsx("button",{type:"button",className:"s-btn",disabled:m||n,onClick:()=>{C()},children:m?"Refreshing…":"Refresh"})})]})}const ds={desktop:"◻",mobile:"▯",tablet:"▭"};function us({device:t}){const s=t.status==="this-device"?"var(--accent)":t.status==="online"?"var(--green)":"var(--dim)";return e.jsxs("div",{className:"s-settings-device-row",children:[e.jsx("span",{className:"s-settings-device-icon",children:ds[t.kind]??"□"}),e.jsxs("div",{children:[e.jsx("div",{className:"s-settings-device-name",children:t.name}),e.jsxs("div",{className:"s-settings-device-meta",children:[t.kind," · via ",t.relay," · ",t.lastSeen]})]}),e.jsxs("span",{className:"s-settings-device-status",style:{color:s},children:["●"," ",t.status==="this-device"?"this device":t.status]}),e.jsx("button",{className:"s-btn",disabled:t.status==="this-device",children:t.status==="this-device"?"—":"Unpair"})]})}function hs({pairing:t}){const s=[{id:"local",name:"This machine",kind:"desktop",status:"this-device",relay:"local",lastSeen:"now"}];if(t?.trustedPeers)for(const a of t.trustedPeers){const i=a.fingerprint===t.connectedPeerFingerprint;s.push({id:a.fingerprint,name:a.name??"Paired device",kind:"mobile",status:i?"online":"offline",relay:"tailscale",lastSeen:a.lastSeenLabel??"—"})}return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(p,{label:`Paired devices · ${s.length}`}),e.jsx("div",{className:"s-settings-col-gap",style:{gap:10},children:s.map(a=>e.jsx(us,{device:a},a.id))}),e.jsx(p,{label:"Relay"}),e.jsxs("div",{className:"s-settings-relay-card",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"s-settings-relay-title",children:["Relay · ",e.jsxs("span",{className:"s-settings-device-status",style:{color:t?.isRunning?"var(--green)":"var(--dim)"},children:["●"," ",t?.isRunning?"connected":"offline"]})]}),e.jsxs("div",{className:"s-settings-relay-meta",children:[t?.relay??"not configured"," · tailscale"]}),e.jsx("div",{className:"s-settings-relay-desc",children:"Agents route through your relay to reach mobile when the app is backgrounded. End-to-end encrypted; keys never leave your devices."})]}),e.jsx("button",{className:"s-btn",children:"Configure"})]})]})}function B(t,s,a=!1){if(!t&&!s)return"Not reported";const i=t||"detached";return s?`${i} @ ${s}${a?" (modified)":""}`:i}function ve(){return navigator.userAgentData?.platform||navigator.platform||"Unknown"}function S({label:t,value:s,detail:a}){return e.jsxs("div",{className:"s-settings-about-fact",children:[e.jsx("dt",{children:t}),e.jsxs("dd",{children:[e.jsx("code",{children:s}),a?e.jsx("span",{children:a}):null]})]})}function ue(t){const{build:s,mesh:a}=t,i=a?.health.build??null,o=a?.localNode?a.nodes[a.localNode.id]?.host:void 0,d=ve();return["OpenScout troubleshooting report",`Collected: ${t.collectedAt.toISOString()}`,"","[Web]",`Observed: ${t.buildCollectedAt?.toISOString()??"unknown"}`,`Version: ${s?.version??"unknown"}`,`Mode: ${s?.mode??"unknown"}`,`Source: ${B(s?.branch,s?.commit,s?.dirty===!0)}`,`Server: ${s?.server?`${s.server.engine} ${s.server.engineVersion}`:"unknown"}`,`Server platform: ${s?.server?`${s.server.platform}/${s.server.arch}`:"unknown"}`,"","[Broker]",`Observed: ${t.meshCollectedAt?.toISOString()??"unknown"}`,`Reachable: ${a?.health.reachable===void 0?"unknown":a.health.reachable?"yes":"no"}`,`Healthy: ${a?.health.ok===void 0?"unknown":a.health.ok?"yes":"no"}`,`Error: ${a?.health.error??"none reported"}`,`Package: ${i?.packageName??"unknown"}`,`Version: ${i?.version??"unknown"}`,`Mode: ${i?.mode??"unknown"}`,`Source: ${B(i?.branch,i?.commit)}`,`Build: ${i?.buildNumber??i?.buildId??"not reported"}`,`Node: ${a?.health.nodeId??"unknown"}`,`Broker URL: ${a?.brokerUrl??"unknown"}`,"","[Host]",`Name: ${a?.localNode?.name??"unknown"}`,`Scout version: ${o?.scoutVersion??"not reported"}`,`System: ${o?.os??"unknown"}`,`Architecture: ${o?.arch??s?.server?.arch??"unknown"}`,"","[Browser]",`Platform: ${d}`,`User agent: ${navigator.userAgent}`,`Origin: ${window.location.origin}`].join(`
|
|
3
|
-
`)}async function ms(t){if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(t);return}const s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();const a=document.execCommand("copy");if(s.remove(),!a)throw new Error("Clipboard access is unavailable")}function ps(){const[t,s]=c.useState(null),[a,i]=c.useState(!0),[o,d]=c.useState(null),[h,m]=c.useState("idle"),v=c.useCallback(async(g=!1)=>{i(!0),d(null),m("idle");const[j,N]=await Promise.allSettled([T(g?"/api/build?refresh=1":"/api/build"),T("/api/mesh")]),I=new Date;if(s(l=>({build:j.status==="fulfilled"?j.value:l?.build??null,mesh:N.status==="fulfilled"?N.value:l?.mesh??null,collectedAt:I,buildCollectedAt:j.status==="fulfilled"?I:l?.buildCollectedAt??null,meshCollectedAt:N.status==="fulfilled"?I:l?.meshCollectedAt??null})),j.status==="rejected"||N.status==="rejected"){const l=[j.status==="rejected"?"web build":null,N.status==="rejected"?"broker":null].filter(Boolean).join(" and ");d(`Could not refresh ${l} details. Last reported values are kept when available.`)}i(!1)},[]);c.useEffect(()=>{v()},[v]);const n=t?.build??null,r=t?.mesh??null,x=r?.health.build??null,f=r?.localNode?r.nodes[r.localNode.id]?.host:void 0,C=ve(),O=r===null?"not reported":r.health.reachable?r.health.ok?"healthy":"degraded":"unreachable",P=c.useCallback(()=>{t&&ms(ue(t)).then(()=>{m("copied"),setTimeout(()=>m("idle"),1800)}).catch(()=>{m("error")})},[t]);return a&&!t?e.jsx("div",{className:"s-settings-loading",children:"Collecting version details…"}):e.jsxs("div",{className:"s-settings-about",children:[e.jsxs("div",{className:"s-settings-about-summary",children:[e.jsxs("div",{children:[e.jsx("span",{className:"s-settings-about-product",children:"OpenScout Web"}),e.jsx("strong",{children:n?.version?`v${n.version}`:"Version unavailable"}),e.jsxs("span",{className:"s-settings-about-source",children:[n?.mode??"unknown mode"," · ",B(n?.branch,n?.commit,n?.dirty===!0)]}),e.jsxs("span",{className:"s-settings-about-collected",children:["Snapshot collected ",t?.collectedAt.toLocaleString()??"—"]})]}),e.jsxs("div",{className:"s-settings-about-actions",children:[e.jsxs("button",{type:"button",className:"s-btn",onClick:()=>{v(!0)},disabled:a,children:[e.jsx(De,{size:13,"aria-hidden":!0}),a?"Refreshing…":"Refresh"]}),e.jsxs("button",{type:"button",className:"s-btn s-settings-about-copy",onClick:P,disabled:!t,children:[h==="copied"?e.jsx(R,{size:13,"aria-hidden":!0}):e.jsx(Le,{size:13,"aria-hidden":!0}),h==="copied"?"Copied report":h==="error"?"Copy failed":"Copy report"]})]})]}),o?e.jsx("div",{className:"s-settings-about-warning",role:"status",children:o}):null,h==="error"&&t?e.jsxs("div",{className:"s-settings-about-copy-fallback",role:"alert",children:[e.jsx("strong",{children:"Clipboard access was denied."}),e.jsx("span",{children:"Select and copy the report below."}),e.jsx("textarea",{readOnly:!0,value:ue(t),"aria-label":"OpenScout troubleshooting report"})]}):null,e.jsx(p,{label:"Web application",right:"release and source identity"}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(S,{label:"Package version",value:n?.version??"Unknown",detail:`Observed ${t?.buildCollectedAt?.toLocaleString()??"at an unknown time"}. Use this when comparing releases.`}),e.jsx(S,{label:"Run mode",value:n?.mode??"Unknown"}),e.jsx(S,{label:"Source checkout",value:B(n?.branch,n?.commit,n?.dirty===!0),detail:"A dev SHA identifies the running checkout; it is not the release version."}),e.jsx(S,{label:"Server engine",value:n?.server?`${n.server.engine} ${n.server.engineVersion}`:"Not reported",detail:n?.server?`Node compatibility ${n.server.nodeVersion} · ${n.server.platform}/${n.server.arch}`:void 0})]}),e.jsx(p,{label:"Broker",right:O}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(S,{label:"Status",value:O,detail:[`Observed ${t?.meshCollectedAt?.toLocaleString()??"at an unknown time"}.`,r?.health.error].filter(Boolean).join(" ")}),e.jsx(S,{label:"Package",value:x?.packageName??"Not reported"}),e.jsx(S,{label:"Version",value:x?.version??"Not reported"}),e.jsx(S,{label:"Source",value:B(x?.branch,x?.commit)}),e.jsx(S,{label:"Build",value:x?.buildNumber??x?.buildId??"Not reported"}),e.jsx(S,{label:"Node",value:r?.health.nodeId??"Not reported",detail:r?.brokerUrl})]}),e.jsx(p,{label:"Host and browser",right:"troubleshooting context"}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(S,{label:"Host",value:r?.localNode?.name??"Not reported"}),e.jsx(S,{label:"Host Scout",value:f?.scoutVersion??"Not reported"}),e.jsx(S,{label:"Host system",value:[f?.os,f?.arch??n?.server?.arch].filter(Boolean).join(" · ")||"Not reported"}),e.jsx(S,{label:"Browser platform",value:C}),e.jsx(S,{label:"Browser",value:navigator.userAgent}),e.jsx(S,{label:"Page origin",value:window.location.origin})]}),e.jsx("p",{className:"s-settings-about-note",children:"Native app and CLI versions are shown only when those components report them. Scout does not infer a version from a nearby checkout."})]})}const V=[{id:"appearance",label:"Appearance",sub:"mode · workspace style"},{id:"operator",label:"Operator",sub:"identity · bio · hours"},{id:"comms",label:"Communication",sub:"how agents reach you"},{id:"voice",label:"Voice",sub:"realtime · permissions · dictation"},{id:"credentials",label:"Credentials",sub:"model provider keys"},{id:"devices",label:"Paired devices",sub:"relay · connected"},{id:"about",label:"About",sub:"versions · build · runtime"}],he={appearance:"Appearance",operator:"Operator identity",comms:"Communication",voice:"Voice",credentials:"Credentials",devices:"Paired devices",about:"About OpenScout"},gs={appearance:"Choose how Scout looks on this device. Changes apply immediately across the workspace.",operator:"Your identity, availability, and the context agents receive when they work with you.",comms:"Set interruption rules, delivery channels, response style, and quiet hours.",voice:"Configure dictation, realtime voice, permissions, and input devices.",credentials:"Manage model-provider credentials stored by this Scout installation.",devices:"Review the relay and devices currently connected to this Scout workspace.",about:"Exact release, source, broker, host, and browser details for troubleshooting."},bs={name:"",handle:"",pronouns:"",hue:195,bio:"",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,workingHours:"08:00 – 18:00",interruptThreshold:"blocking-only",batchWindow:15,channel:"here+mobile",verbosity:"terse",tone:"direct",quietHours:"22:00 – 07:00",provisionalAgentNames:[],provisionalAgentNamesMode:"replace",provisionalAgentNamesResolvedCount:0,provisionalAgentNamesPreview:[],provisionalAgentNamesSource:"default"};function xe({open:t,onClose:s,section:a,onSectionChange:i,presentation:o}){const{refreshOnboarding:d}=me(),{ref:h,onKeyDown:m}=Pe(t&&o==="drawer"),[v,n]=c.useState("appearance"),r=a??v,x=c.useCallback(u=>{i?i(u):n(u)},[i]),[f,C]=c.useState(bs),[O,P]=c.useState(null),[g,j]=c.useState(null),[N,I]=c.useState(null),[l,y]=c.useState(!1),[$,_]=c.useState("saved"),F=c.useRef(null),W=c.useRef(!0),z=c.useRef(null);c.useEffect(()=>()=>{W.current=!1},[]);const q=c.useCallback(async()=>{const[u,A]=await Promise.allSettled([Ye(),be()]),k=u.status==="fulfilled"?u.value:null;let b=A.status==="fulfilled"?A.value:null;k?.configured&&!b?.openai.configured&&(b=await Ge().catch(()=>b)),j(k),I(b)},[]),Z=c.useCallback(async()=>{try{const u=T("/api/user"),A=Promise.race([T("/api/pairing-state"),new Promise((vs,we)=>setTimeout(()=>we(new Error("timeout")),3e3))]),[k,b]=await Promise.allSettled([u,A]);k.status==="fulfilled"&&C(k.value),b.status==="fulfilled"&&P(b.value),await q()}finally{y(!0)}},[q]);c.useEffect(()=>{t&&r!=="appearance"&&r!=="about"&&!l&&Z()},[l,t,Z,r]),c.useEffect(()=>{if(!t||!window.matchMedia("(max-width: 760px)").matches)return;const u=window.requestAnimationFrame(()=>{z.current?.scrollIntoView({block:"nearest",inline:"nearest"})});return()=>window.cancelAnimationFrame(u)},[t,r]);const G=c.useCallback(u=>{const k=(V.findIndex(b=>b.id===r)+u+V.length)%V.length;x(V[k].id)},[r]),fe=c.useCallback(u=>{if(m(u),o==="drawer"&&u.key==="Escape"){u.preventDefault(),s();return}u.target?.closest(".s-settings-rail")&&(u.key==="ArrowDown"?(u.preventDefault(),G(1)):u.key==="ArrowUp"&&(u.preventDefault(),G(-1)))},[G,s,m,o]),ee=c.useCallback(u=>{F.current&&clearTimeout(F.current),_("saving"),F.current=setTimeout(()=>{T("/api/user",{method:"POST",body:JSON.stringify(u)}).then(()=>d()).then(()=>{W.current&&_("saved")}).catch(()=>{W.current&&_("error")})},400)},[d]),se=c.useCallback(u=>{C(A=>{const k={...A,...u};return ee(k),k})},[ee]),te=e.jsx("nav",{className:"s-settings-rail","aria-label":"Settings pages",children:V.map(u=>{const A=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-settings-rail-label",children:u.label}),e.jsx("span",{className:"s-settings-rail-sub",children:u.sub})]}),k=`s-settings-rail-btn${r===u.id?" s-settings-rail-btn--active":""}`;return o==="page"?e.jsx("a",{ref:r===u.id?b=>{z.current=b}:void 0,href:Ne({view:"settings",section:u.id}),"aria-current":r===u.id?"page":void 0,className:k,onClick:b=>{b.button!==0||b.metaKey||b.ctrlKey||b.shiftKey||b.altKey||(b.preventDefault(),x(u.id))},children:A},u.id):e.jsx("button",{ref:r===u.id?b=>{z.current=b}:void 0,onClick:()=>x(u.id),"aria-current":r===u.id?"page":void 0,className:k,children:A},u.id)})}),ae=e.jsx("main",{className:"s-settings-content",id:`settings-${r}`,"data-settings-section":r,tabIndex:-1,children:r==="appearance"?e.jsx(ns,{}):r==="about"?e.jsx(ps,{}):l?e.jsxs(e.Fragment,{children:[r==="operator"&&e.jsx(is,{profile:f,update:se}),r==="comms"&&e.jsx(rs,{profile:f,update:se}),r==="credentials"&&e.jsx(ls,{clientCredentials:g,serverCredentials:N,reloadCredentials:q}),r==="voice"&&e.jsx(cs,{}),r==="devices"&&e.jsx(hs,{pairing:O})]}):e.jsx("div",{className:"s-settings-loading",children:"Loading settings…"})});return o==="page"?e.jsxs("section",{className:"s-settings-page","aria-labelledby":"settings-page-title",children:[e.jsxs("header",{className:"s-settings-page-header",children:[e.jsxs("div",{children:[e.jsx("div",{className:"s-settings-page-kicker",children:"Settings"}),e.jsx("h1",{id:"settings-page-title",children:he[r]}),e.jsx("p",{children:gs[r]})]}),r==="about"?e.jsxs("div",{className:"s-settings-page-save-state","data-state":"neutral",children:[e.jsx("span",{"aria-hidden":"true"}),"Diagnostic snapshot"]}):e.jsxs("div",{className:"s-settings-page-save-state","data-state":$,role:"status","aria-live":"polite",children:[e.jsx("span",{"aria-hidden":"true"}),$==="saving"?"Saving changes…":$==="error"?"Couldn’t save changes":"Saved automatically"]})]}),e.jsxs("div",{className:"s-settings-page-layout",children:[te,ae]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`s-settings-scrim ${t?"s-settings-scrim--open":"s-settings-scrim--closed"}`,onClick:s}),e.jsxs("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":"Settings",className:`s-settings-drawer ${t?"s-settings-drawer--open":"s-settings-drawer--closed"}`,onKeyDown:fe,children:[e.jsxs("div",{className:"s-settings-header",children:[e.jsxs("div",{className:"s-settings-header-title",children:["⚙"," SETTINGS"]}),e.jsx("span",{className:"s-settings-header-sep",children:"/"}),e.jsx("span",{className:"s-settings-header-section",children:he[r]}),e.jsx("span",{style:{flex:1}}),e.jsx("span",{className:"s-settings-header-hint",children:"ESC to close"}),e.jsx("button",{className:"s-settings-close",onClick:s,children:"×"})]}),te,ae,e.jsxs("div",{className:"s-settings-footer",children:[e.jsxs("span",{className:"s-settings-footer-sync",children:["●"," synced"]}),e.jsx("span",{children:"·"}),e.jsx("span",{children:"changes apply instantly to every agent in your fleet"}),e.jsx("span",{style:{flex:1}}),e.jsx("button",{className:"s-btn",onClick:s,children:"Done"})]})]})]})}function je(t){return e.jsx(xe,{...t,presentation:"drawer"})}function ye({section:t="appearance",onSectionChange:s}){return e.jsx(xe,{open:!0,onClose:()=>{},section:t,onSectionChange:s,presentation:"page"})}const Ps=Object.freeze(Object.defineProperty({__proto__:null,SettingsDrawer:je,SettingsPage:ye},Symbol.toStringTag,{value:"Module"})),Is=Object.freeze(Object.defineProperty({__proto__:null,SettingsDrawer:je,SettingsPage:ye},Symbol.toStringTag,{value:"Module"}));export{ye as S,Ps as a,Is as b,Ge as e};
|
|
1
|
+
import{j as e,r as c,O as Se}from"./index-o4FKpU7Z.js";import{u as Ne}from"./provider-BvAxRQfE.js";import{a as T}from"./api-h5zurxmi.js";import{u as me,a as ke}from"./Provider-DKZWuzSR.js";import{t as Ce}from"./time-Dhsh_2EG.js";import{h as Ae,j as Ee,k as Oe}from"./scout-voice-B7kXlkcl.js";import{u as Te}from"./keyboard-nav-Chf51dns.js";import{a as Pe}from"./router-C65cZYPn.js";import{VoiceHostStatusBanner as Ie,VoicePermissionsPanel as $e}from"./VoicePermissionsPanel-CD903y9K.js";import{u as Re}from"./chunk-HRAB3GC3-DF8R9rPv.js";import{C as R}from"./check--esHw52j.js";import{c as Q}from"./createLucideIcon-Bt67PWH-.js";import{R as De}from"./refresh-cw-B5To7b6B.js";import{C as Le}from"./copy-Dty8ZYsM.js";const _e=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Me=Q("monitor",_e);const Ve=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Be=Q("moon",Ve);const He=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ke=Q("sun",He);class E extends Error{code;cause;constructor(s,a,i){super(a),this.name="HudVaultError",this.code=s,this.cause=i}}function Y(t){const s=new Uint8Array(new ArrayBuffer(t.byteLength));return s.set(t),s}const M="items",H="keys",ne="master";class Ue{service;dbPromise;cryptoKeyPromise;constructor(s){this.service=s.service}async set(s,a){const i=new TextEncoder().encode(a);await this.setBytes(s,i)}async get(s){const a=await this.getBytes(s);if(!a)return null;try{return new TextDecoder().decode(a)}catch(i){throw new E("encoding_failed","value is not valid UTF-8",i)}}async delete(s){await this.idbDelete(M,s)}async setBytes(s,a){const i=await this.getOrCreateCryptoKey(),o=crypto.getRandomValues(new Uint8Array(12));let d;try{d=await crypto.subtle.encrypt({name:"AES-GCM",iv:o},i,Y(a))}catch(h){throw new E("crypto_failed","AES-GCM encrypt failed",h)}await this.idbWrite(M,s,{iv:o,ct:new Uint8Array(d)})}async getBytes(s){const a=await this.idbRead(M,s);if(!a)return null;const i=await this.getOrCreateCryptoKey();try{const o=await crypto.subtle.decrypt({name:"AES-GCM",iv:Y(a.iv)},i,Y(a.ct));return new Uint8Array(o)}catch(o){throw new E("crypto_failed","AES-GCM decrypt failed",o)}}getOrCreateCryptoKey(){return this.cryptoKeyPromise?this.cryptoKeyPromise:(this.cryptoKeyPromise=(async()=>{if(typeof crypto>"u"||!crypto.subtle)throw new E("crypto_unsupported","crypto.subtle is not available");const s=await this.idbRead(H,ne);if(s)return s;let a;try{a=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}catch(i){throw new E("crypto_failed","AES-GCM key generation failed",i)}return await this.idbWrite(H,ne,a),a})(),this.cryptoKeyPromise)}getDB(){return this.dbPromise?this.dbPromise:(this.dbPromise=new Promise((s,a)=>{if(typeof indexedDB>"u"){a(new E("idb_unsupported","IndexedDB is not available"));return}const i=indexedDB.open(`hudvault:${this.service}`,1);i.onupgradeneeded=()=>{const o=i.result;o.objectStoreNames.contains(M)||o.createObjectStore(M),o.objectStoreNames.contains(H)||o.createObjectStore(H)},i.onsuccess=()=>s(i.result),i.onerror=()=>a(new E("idb_failed",K("open",i.error),i.error))}),this.dbPromise)}async idbRead(s,a){const i=await this.getDB();return new Promise((o,d)=>{const m=i.transaction(s,"readonly").objectStore(s).get(a);m.onsuccess=()=>o(m.result),m.onerror=()=>d(new E("idb_failed",K("read",m.error),m.error))})}async idbWrite(s,a,i){const o=await this.getDB();await new Promise((d,h)=>{const m=o.transaction(s,"readwrite");m.oncomplete=()=>d(),m.onerror=()=>h(new E("idb_failed",K("write",m.error),m.error)),m.objectStore(s).put(i,a)})}async idbDelete(s,a){const i=await this.getDB();await new Promise((o,d)=>{const h=i.transaction(s,"readwrite");h.oncomplete=()=>o(),h.onerror=()=>d(new E("idb_failed",K("delete",h.error),h.error)),h.objectStore(s).delete(a)})}}function K(t,s){return`IndexedDB ${t} failed${s?.message?`: ${s.message}`:""}`}const Fe="dev.openscout.credentials",X="openai_api_key",J=new Ue({service:Fe});async function pe(){const s=(await J.get(X))?.trim();return s&&s.startsWith("sk-")?s:null}async function We(t){const s=t.trim();if(!s.startsWith("sk-"))throw new Error("OpenAI API keys should start with sk-.");await J.set(X,s)}async function ze(){await J.delete(X)}async function ge(t){return T("/api/scoutbot/credentials/openai",{method:"POST",body:JSON.stringify({apiKey:t.trim()})})}async function qe(){return T("/api/scoutbot/credentials/openai",{method:"DELETE"})}async function be(){return T("/api/scoutbot/credentials")}async function Ge(){const t=await be();if(t.openai.configured)return t;const s=await pe();return s?ge(s):null}async function Ye(){const t=await pe();return{configured:!!t,preview:t?Qe(t):null}}function Qe(t){return t.length<=10?"configured":`${t.slice(0,5)}...${t.slice(-4)}`}const Xe=[195,125,300,45,355,210];function ie(t){return`oklch(0.80 0.14 ${t})`}function Je(t){return`oklch(0.18 0.08 ${t})`}function p({label:t,right:s}){return e.jsxs("div",{className:"s-settings-section-rule",children:[e.jsx("span",{className:"s-settings-section-label",children:t}),e.jsx("span",{className:"s-settings-section-line"}),s&&e.jsx("span",{className:"s-settings-section-right",children:s})]})}function w({label:t,hint:s,children:a}){return e.jsxs("div",{className:"s-settings-field",children:[e.jsx("label",{className:"s-settings-field-label",children:t}),a,s&&e.jsx("span",{className:"s-settings-field-hint",children:s})]})}function D({value:t,onChange:s,mono:a}){return e.jsx("input",{className:`s-settings-input${a?" s-settings-input--mono":""}`,value:t,onChange:i=>s(i.target.value)})}function re({value:t,onChange:s,rows:a=3}){return e.jsx("textarea",{className:"s-settings-textarea",value:t,onChange:i=>s(i.target.value),rows:a})}function Ze({value:t,onChange:s,min:a,max:i,step:o=1,unit:d=""}){return e.jsxs("div",{className:"s-settings-slider-wrap",children:[e.jsx("input",{type:"range",min:a,max:i,step:o,value:t,onChange:h=>s(Number(h.target.value))}),e.jsxs("span",{className:"s-settings-slider-value",children:[t," ",d]})]})}function L({value:t,onChange:s,options:a,stacked:i,columns:o}){return e.jsx("div",{className:i?"s-settings-option-stacked":"s-settings-option-grid",style:i?void 0:{gridTemplateColumns:`repeat(${o??a.length}, 1fr)`},children:a.map(d=>e.jsxs("button",{className:`s-settings-option-btn${t===d.id?" s-settings-option-btn--active":""}`,onClick:()=>s(d.id),children:[e.jsx("span",{className:"s-settings-option-label",children:d.label}),e.jsx("span",{className:"s-settings-option-sub",children:d.sub})]},d.id))})}const es=[{id:"system",label:"System",sub:"Follow this device",icon:Me},{id:"light",label:"Light",sub:"Bright workspace",icon:Ke},{id:"dark",label:"Dark",sub:"Low-light workspace",icon:Be}],ss=[{id:"scout",label:"Scout",sub:"Control-room navigation"},{id:"slack",label:"Slack",sub:"Workspace rail and channel-style lists"}],le=[{id:"scout",label:"Scout",sub:"Near-neutral control room",spec:"SLATE · LIME"},{id:"graphite",label:"Graphite",sub:"Monochrome technical chassis",spec:"BLACK · SLATE"},{id:"polar",label:"Polar",sub:"Nord-inspired arctic slate",spec:"POLAR · FROST"},{id:"solar",label:"Solar",sub:"Solarized-inspired measured contrast",spec:"TEAL · PAPER"}],oe=[{id:"hudson",label:"Rounded",sub:"Soft corners and luminous chrome",spec:"8PX"},{id:"editorial",label:"Compact",sub:"Tighter corners and flatter hierarchy",spec:"4PX"},{id:"drafting",label:"Square",sub:"Zero-radius technical grid",spec:"0PX"}],ce=[{id:"soft",label:"Soft",sub:"Quiet separators"},{id:"balanced",label:"Defined",sub:"Clear structure"},{id:"strong",label:"Strong",sub:"High separation"}],de=[{id:"theme",label:"Theme"},{id:"lime",label:"Lime"},{id:"cyan",label:"Cyan"},{id:"violet",label:"Violet"},{id:"amber",label:"Amber"}];function U({className:t,theme:s,template:a,palette:i,contrast:o,accent:d,children:h}){return e.jsx("div",{className:t,"data-scout-theme":s,"data-scout-theme-mode":s,"data-scout-palette":i,"data-scout-contrast":o,"data-scout-accent":d,"data-hudson-theme":s,"data-hudson-template":a,children:h})}function ts({palette:t,theme:s,template:a}){return e.jsxs(U,{className:"s-settings-palette-sample",theme:s,template:a,palette:t,contrast:"balanced",accent:"theme",children:[e.jsxs("span",{className:"s-settings-palette-rail",children:[e.jsx("i",{}),e.jsx("i",{"data-active":!0}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsxs("span",{className:"s-settings-palette-list",children:[e.jsx("i",{}),e.jsx("i",{"data-selected":!0}),e.jsx("i",{})]}),e.jsxs("span",{className:"s-settings-palette-detail",children:[e.jsx("i",{"data-title":!0}),e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{"data-action":!0})]})]})}function as({theme:t,template:s,palette:a,contrast:i,accent:o}){return e.jsxs(U,{className:"s-settings-live-preview",theme:t,template:s,palette:a,contrast:i,accent:o,children:[e.jsxs("div",{className:"s-settings-live-preview-bar",children:[e.jsxs("span",{children:[e.jsx("i",{})," SCOUT"]}),e.jsxs("span",{className:"s-settings-live-preview-state",children:[e.jsx("i",{})," WORKING"]})]}),e.jsxs("div",{className:"s-settings-live-preview-shell",children:[e.jsxs("div",{className:"s-settings-live-preview-rail","aria-hidden":"true",children:[e.jsx("i",{"data-active":!0}),e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsxs("div",{className:"s-settings-live-preview-list",children:[e.jsx("span",{className:"s-settings-live-preview-kicker",children:"CONVERSATIONS"}),e.jsxs("span",{className:"s-settings-live-preview-row","data-selected":!0,children:[e.jsx("i",{}),e.jsx("b",{children:"Openscout"}),e.jsx("small",{children:"now"})]}),e.jsxs("span",{className:"s-settings-live-preview-row",children:[e.jsx("i",{}),e.jsx("b",{children:"Hudson"}),e.jsx("small",{children:"8m"})]}),e.jsxs("span",{className:"s-settings-live-preview-row",children:[e.jsx("i",{}),e.jsx("b",{children:"Scout"}),e.jsx("small",{children:"1h"})]})]}),e.jsxs("div",{className:"s-settings-live-preview-detail",children:[e.jsx("span",{className:"s-settings-live-preview-kicker",children:"ACTIVE FLIGHT"}),e.jsx("strong",{children:"Theme system review"}),e.jsx("p",{children:"Separating palette, interface shape, and contrast keeps every choice honest."}),e.jsxs("div",{className:"s-settings-live-preview-event",children:[e.jsx("i",{})," Agent is working · updated now"]}),e.jsx("button",{type:"button",tabIndex:-1,children:"Open trace"})]})]})]})}function ns(){const t=Re(),{appearanceDetails:s,updateAppearanceDetails:a}=me();if(!t)return e.jsx("div",{className:"s-settings-inline-note",children:"Theme controls are unavailable in this embedded surface."});const i=t.resolvedTheme??"dark",o=Se(t.template)??"hudson",d=le.find(n=>n.id===s.palette)?.label??"Scout",h=oe.find(n=>n.id===o)?.label??"Rounded",m=ce.find(n=>n.id===s.contrast)?.label??"Defined",v=de.find(n=>n.id===s.accent)?.label??"Theme";return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(p,{label:"App layout",right:`currently ${s.shell}`}),e.jsx("div",{className:"s-settings-shell-grid",role:"group","aria-label":"App layout",children:ss.map(n=>{const r=s.shell===n.id;return e.jsxs("button",{type:"button",className:"s-settings-shell-choice","data-shell":n.id,"data-active":r||void 0,"aria-pressed":r,onClick:()=>a({shell:n.id}),children:[e.jsxs("span",{className:"s-settings-shell-sample","aria-hidden":"true",children:[e.jsx("i",{"data-part":"top"}),e.jsx("i",{"data-part":"rail"}),e.jsxs("i",{"data-part":"list",children:[e.jsx("b",{}),e.jsx("b",{}),e.jsx("b",{})]}),e.jsxs("i",{"data-part":"content",children:[e.jsx("b",{}),e.jsx("b",{}),e.jsx("b",{})]})]}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:n.label}),r?e.jsx(R,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]}),e.jsx("small",{children:n.sub})]})]},n.id)})}),e.jsx(p,{label:"Color mode",right:`currently ${i}`}),e.jsx("div",{className:"s-settings-theme-mode-grid",role:"group","aria-label":"Color mode",children:es.map(n=>{const r=n.icon,x=t.theme===n.id,f=n.id==="system"?`Follow this device · resolves to ${t.resolvedTheme??"…"}`:n.sub;return e.jsxs("button",{type:"button",className:"s-settings-theme-mode","data-active":x||void 0,"aria-pressed":x,onClick:()=>t.setTheme(n.id),children:[e.jsx(r,{size:18,strokeWidth:1.7,"aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("strong",{children:n.label}),e.jsx("small",{children:f})]}),x?e.jsx(R,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]},n.id)})}),e.jsxs("div",{className:"s-settings-appearance-workbench",children:[e.jsxs("div",{className:"s-settings-appearance-controls",children:[e.jsx(p,{label:"Color theme",right:`currently ${d.toLowerCase()}`}),e.jsx("div",{className:"s-settings-palette-grid",role:"group","aria-label":"Color theme",children:le.map(n=>{const r=s.palette===n.id;return e.jsxs("button",{type:"button",className:"s-settings-palette-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>a({palette:n.id}),children:[e.jsx(ts,{palette:n.id,theme:i,template:o}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:n.label}),r?e.jsx(R,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]}),e.jsx("small",{children:n.sub}),e.jsx("span",{children:n.spec})]})]},n.id)})}),e.jsx(p,{label:"Interface shape",right:`currently ${h.toLowerCase()}`}),e.jsx("div",{className:"s-settings-interface-grid",role:"group","aria-label":"Interface shape",children:oe.map(n=>{const r=o===n.id;return e.jsxs("button",{type:"button",className:"s-settings-interface-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>t.setTemplate(n.id),children:[e.jsx(U,{className:"s-settings-shape-sample",theme:i,template:n.id,palette:s.palette,contrast:s.contrast,accent:s.accent,children:e.jsx("i",{children:e.jsx("i",{})})}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:n.label}),r?e.jsx(R,{className:"s-settings-theme-check",size:14,"aria-hidden":!0}):null]}),e.jsx("small",{children:n.sub}),e.jsx("span",{children:n.spec})]})]},n.id)})}),e.jsx(p,{label:"Separation",right:`currently ${m.toLowerCase()}`}),e.jsx("div",{className:"s-settings-contrast-grid",role:"group","aria-label":"Interface contrast",children:ce.map(n=>{const r=s.contrast===n.id;return e.jsxs("button",{type:"button",className:"s-settings-contrast-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>a({contrast:n.id}),children:[e.jsxs("span",{className:"s-settings-contrast-lines","data-level":n.id,"aria-hidden":!0,children:[e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsx("strong",{children:n.label}),e.jsx("small",{children:n.sub})]},n.id)})}),e.jsx(p,{label:"Signal accent",right:`currently ${v.toLowerCase()}`}),e.jsx("div",{className:"s-settings-accent-row",role:"group","aria-label":"Signal accent",children:de.map(n=>{const r=s.accent===n.id;return e.jsxs("button",{type:"button",className:"s-settings-accent-choice","data-accent-option":n.id,"data-active":r||void 0,"aria-pressed":r,"aria-label":`${n.label} accent`,onClick:()=>a({accent:n.id}),children:[e.jsx(U,{className:"s-settings-accent-dot",theme:i,template:o,palette:s.palette,contrast:s.contrast,accent:n.id,children:e.jsx("i",{})}),e.jsx("span",{children:n.label}),r?e.jsx(R,{size:13,"aria-hidden":!0}):null]},n.id)})}),e.jsxs("div",{className:"s-settings-appearance-note",children:[e.jsx("strong",{children:"Saved on this device"}),e.jsx("span",{children:"Layout, mode, palette, shape, separation, and accent stay in sync across tabs. URL overrides remain available for embeds and visual QA."})]})]}),e.jsxs("aside",{className:"s-settings-preview-column","aria-label":"Live appearance preview",children:[e.jsx(p,{label:"Live specimen",right:i}),e.jsx(as,{theme:i,template:o,palette:s.palette,contrast:s.contrast,accent:s.accent}),e.jsxs("dl",{className:"s-settings-theme-readout",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Palette"}),e.jsx("dd",{children:d})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Shape"}),e.jsx("dd",{children:h})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Separation"}),e.jsx("dd",{children:m})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Accent"}),e.jsx("dd",{children:v})]})]}),e.jsx("p",{className:"s-settings-preview-note",children:"Each control changes one visual axis. Success, warning, and failure colors keep their meaning."})]})]})]})}function is({profile:t,update:s}){return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(p,{label:"Identity",right:"visible to every agent"}),e.jsxs("div",{className:"s-settings-identity-card",children:[e.jsx("span",{className:"s-settings-identity-dot",style:{background:ie(t.hue),color:Je(t.hue)},children:(t.name||"?")[0].toUpperCase()}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{className:"s-settings-identity-name",children:t.name||"Unnamed"}),e.jsxs("div",{className:"s-settings-identity-meta",children:[t.handle||"@you"," · ",t.pronouns||"—"," · operator"]})]}),e.jsxs("div",{className:"s-settings-hue-wrap",children:[e.jsx("span",{className:"s-settings-field-label",children:"Identity hue"}),e.jsx("div",{className:"s-settings-hue-row",children:Xe.map(a=>e.jsx("button",{onClick:()=>s({hue:a}),className:`s-settings-hue-dot${t.hue===a?" s-settings-hue-dot--active":""}`,style:{background:ie(a)}},a))})]})]}),e.jsx(w,{label:"Display name",hint:"Shown when agents address you.",children:e.jsx(D,{value:t.name,onChange:a=>s({name:a})})}),e.jsx(w,{label:"Handle",hint:"Used in @mentions across threads.",children:e.jsx(D,{value:t.handle,onChange:a=>s({handle:a}),mono:!0})}),e.jsx(w,{label:"Pronouns",children:e.jsx(D,{value:t.pronouns,onChange:a=>s({pronouns:a})})}),e.jsx(p,{label:"How agents understand you",right:"shipped as system prompt context"}),e.jsx(w,{label:"Operator bio",hint:"How you want to be worked with. Agents read this before asking you things.",children:e.jsx(re,{value:t.bio,onChange:a=>s({bio:a}),rows:4})}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(w,{label:"Timezone",children:e.jsx(D,{value:t.timezone,onChange:a=>s({timezone:a}),mono:!0})}),e.jsx(w,{label:"Working hours",children:e.jsx(D,{value:t.workingHours,onChange:a=>s({workingHours:a}),mono:!0})})]}),e.jsx(p,{label:"Ephemeral agent names",right:"rotation pool for one-off agents"}),e.jsx(w,{label:"Name pool",hint:t.provisionalAgentNames.length>0?`${t.provisionalAgentNamesResolvedCount} names active (${t.provisionalAgentNamesSource}). Preview: ${t.provisionalAgentNamesPreview.join(", ")}${t.provisionalAgentNamesResolvedCount>t.provisionalAgentNamesPreview.length?", …":""}`:"Leave empty to use Scout's built-in rotation. One short name per line.",children:e.jsx(re,{value:t.provisionalAgentNames.join(`
|
|
2
|
+
`),onChange:a=>s({provisionalAgentNames:a.split(/\r?\n/u).map(i=>i.trim()).filter(Boolean)}),rows:6})}),e.jsx(w,{label:"Pool mode",hint:"Replace uses only your list. Add to defaults prepends yours, then Scout's built-in names.",children:e.jsx(L,{value:t.provisionalAgentNamesMode,onChange:a=>s({provisionalAgentNamesMode:a}),options:[{id:"replace",label:"Replace",sub:"your list only"},{id:"extend",label:"Add to defaults",sub:"yours first, then Scout"}],columns:2})})]})}function rs({profile:t,update:s}){return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(p,{label:"Interrupt policy"}),e.jsx(w,{label:"When agents can ping you directly",hint:"Blocking-only means only asks that truly stall work. Others get batched.",children:e.jsx(L,{value:t.interruptThreshold,onChange:a=>s({interruptThreshold:a}),options:[{id:"always",label:"Always",sub:"any ask, any time"},{id:"blocking-only",label:"Blocking only",sub:"stuck agents · default"},{id:"batched",label:"Batched",sub:"grouped every 15m"},{id:"never",label:"Never",sub:"queue only, I'll check in"}]})}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(w,{label:"Batch window (min)",children:e.jsx(Ze,{value:t.batchWindow,min:5,max:60,step:5,onChange:a=>s({batchWindow:a}),unit:"min"})}),e.jsx(w,{label:"Quiet hours",children:e.jsx(D,{value:t.quietHours,onChange:a=>s({quietHours:a}),mono:!0})})]}),e.jsx(p,{label:"Where to reach you"}),e.jsx(w,{label:"Preferred channel",children:e.jsx(L,{value:t.channel,onChange:a=>s({channel:a}),options:[{id:"here",label:"Here only",sub:"desktop app"},{id:"mobile",label:"Mobile only",sub:"paired phone"},{id:"here+mobile",label:"Both",sub:"whichever is active"}]})}),e.jsx(p,{label:"Tone calibration",right:"how agents write to you"}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(w,{label:"Verbosity",children:e.jsx(L,{stacked:!0,value:t.verbosity,onChange:a=>s({verbosity:a}),options:[{id:"terse",label:"Terse",sub:"one-liners, answers only"},{id:"normal",label:"Normal",sub:"context + answer"},{id:"detailed",label:"Detailed",sub:"show reasoning"}]})}),e.jsx(w,{label:"Tone",children:e.jsx(L,{stacked:!0,value:t.tone,onChange:a=>s({tone:a}),options:[{id:"direct",label:"Direct",sub:"no hedging"},{id:"warm",label:"Warm",sub:"friendly, conversational"},{id:"formal",label:"Formal",sub:"business-like"}]})})]})]})}function ls({clientCredentials:t,serverCredentials:s,reloadCredentials:a}){const[i,o]=c.useState(""),[d,h]=c.useState(!1),[m,v]=c.useState(null),n=s?.openai??null,r=!!n?.configured,x=n?.source==="env"?"OPENAI_API_KEY":n?.source==="local-config"?"local Scout config":n?.source==="local-store"?"local OpenScout store":"missing",f=n?.source==="local-store"&&t?.configured?"local OpenScout store + HudVault mirror":x,C=n?.preview??t?.preview??null,O=async()=>{h(!0),v(null);try{const g=i.trim();await ge(g);let j=null;try{await We(g)}catch(N){j=N instanceof Error?N.message:"HudVault save failed."}o(""),await a(),v(j?`Saved to local OpenScout store. Browser mirror failed: ${j}`:"Saved to local OpenScout store and Hudson Vault.")}catch(g){v(g instanceof Error?g.message:"Could not save key.")}finally{h(!1)}},P=async()=>{h(!0),v(null);try{const[g,j]=await Promise.allSettled([ze(),qe()]);o(""),await a(),g.status==="rejected"||j.status==="rejected"?v("Cleared what I could; one credential store did not respond."):v(n?.source==="env"||n?.source==="local-config"?"Removed saved key. Server fallback is still configured.":"Removed saved key.")}catch(g){v(g instanceof Error?g.message:"Could not clear key.")}finally{h(!1)}};return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(p,{label:"Model providers",right:r?`configured · ${f}`:"missing"}),e.jsx("div",{className:"s-settings-relay-card",children:e.jsxs("div",{children:[e.jsxs("div",{className:"s-settings-relay-title",children:["OpenAI · ",e.jsxs("span",{className:"s-settings-device-status",style:{color:r?"var(--green)":"var(--dim)"},children:["●"," ",r?"ready":"missing"]})]}),e.jsxs("div",{className:"s-settings-relay-meta",children:[C??"No key stored"," · ",f]}),e.jsx("div",{className:"s-settings-relay-desc",children:"Scout stores user-entered keys in the local OpenScout credential store and keeps a HudVault mirror for this browser profile."})]})}),e.jsx(w,{label:"OpenAI API key",hint:"Saved locally. Existing keys are never shown again.",children:e.jsx("input",{className:"s-settings-input s-settings-input--mono",type:"password",value:i,placeholder:r?"Saved key configured":"sk-...",autoComplete:"off",spellCheck:!1,onChange:g=>o(g.target.value)})}),m&&e.jsx("div",{className:"s-settings-field-hint",children:m}),e.jsxs("div",{className:"s-settings-button-row",children:[e.jsx("button",{type:"button",className:"s-btn",disabled:d||!i.trim(),onClick:()=>{O()},children:d?"Saving":"Save key"}),e.jsx("button",{type:"button",className:"s-btn",disabled:d||!(t?.configured||n?.source==="local-store"),onClick:()=>{P()},children:"Clear saved key"})]})]})}const os=[{id:"auto",label:"Auto",sub:"Parakeet when warm, Apple fallback"},{id:"parakeet",label:"Parakeet",sub:"on-device, best quality"},{id:"apple",label:"Apple Speech",sub:"instant, no model warmup"}];function cs(){const t=Ne(ke,!1),[s,a]=c.useState(null),[i,o]=c.useState([]),[d,h]=c.useState([]),[m,v]=c.useState(!0),[n,r]=c.useState(!1),[x,f]=c.useState(null),C=c.useCallback(async()=>{v(!0);try{const[l,y]=await Promise.all([Ae(),Ee(12).catch(()=>[])]);a(l.settings),o(l.devices),h(y),f(null)}catch(l){f(l instanceof Error?l.message:String(l))}finally{v(!1)}},[]);c.useEffect(()=>{C()},[C]);const O=c.useCallback(async l=>{r(!0),f(null);try{const y=await Oe(l);a(y.settings),o(y.devices)}catch(y){f(y instanceof Error?y.message:String(y))}finally{r(!1)}},[]);if(m&&!s)return e.jsx("div",{className:"s-settings-field-hint",children:"Loading voice settings…"});const P=s?.inputDeviceId??i.find(l=>l.isDefault)?.id??"",g=s?.permissions?.find(l=>l.kind==="microphone")??null,j=s?.permissions?.find(l=>l.kind==="speechRecognition")??null,N=(s?.permissions?.length??0)>0||i.length>0,I=[N?null:"Scout voice host is offline. Launch Scout Menu on this Mac — the browser does not capture audio.",g?.status==="denied"||g?.status==="restricted"?g?.status==="restricted"?"Microphone access is restricted on this Mac.":"Microphone access is off for Scout Menu. Choose Retry access to reopen the macOS permission pane.":g?.canRequest?"Microphone has not been requested yet. Request access or tap the mic in chat to show the macOS prompt.":null,!j?.granted&&(j?.status==="denied"||j?.status==="restricted")?j?.status==="restricted"?"Speech recognition is restricted on this Mac.":"Speech recognition is off for Scout Menu. Open Privacy & Security → Speech Recognition to change it.":null,s?.modelReady?null:"Parakeet may download on first use. Apple Speech stays available while the model warms.","Dictation requires Scout Menu running. The browser does not capture audio.","If transcription hangs on Processing, wait up to 60 seconds or tap the mic again to cancel."].filter(l=>!!l);return e.jsxs("div",{className:"s-settings-col-gap",children:[x&&e.jsx("div",{className:"s-settings-field-hint",style:{color:"var(--amber)"},children:x}),e.jsx(p,{label:"Realtime conversation",right:"footer control"}),e.jsx("div",{className:"s-settings-realtime-voice","data-enabled":t||void 0,"data-unavailable":!t||void 0,children:e.jsxs("span",{className:"s-settings-realtime-voice-copy",children:[e.jsx("strong",{children:t?"Realtime voice enabled":"Realtime voice disabled"}),e.jsx("span",{children:"Starting a call sends microphone audio to OpenAI Realtime and bills the configured OpenAI API account. Voice may read live Scout context and navigate this app; agent requests still require confirmation."}),t?e.jsx("em",{children:"Use Voice in the footer to start or manage a call."}):e.jsx("em",{children:"Turn on Live voice in the host app's Settings → Voice."})]})}),e.jsx(Ie,{hostOnline:N,micPermission:g,speechPermission:j,modelReady:s?.modelReady}),e.jsx(p,{label:"Scout Menu permissions",right:"voice host"}),e.jsx($e,{permissions:s?.permissions,hostOnline:N,disabled:n||m,onError:l=>f(l),onRefresh:C}),e.jsx(p,{label:"Transcription"}),e.jsx(w,{label:"Engine",hint:s?.modelReady?"Parakeet is warm and ready.":s?.modelInstalled?"Parakeet is installed; first dictation may warm the model.":"Parakeet downloads on first use. Apple Speech stays available meanwhile.",children:e.jsx(L,{value:s?.preference??"auto",onChange:l=>{a(y=>y&&{...y,preference:l}),O({preference:l})},options:os,columns:3})}),e.jsx(w,{label:"Microphone input",hint:"Scout Menu uses the macOS system default input unless you pick a device here. The browser never captures audio.",children:i.length>0?e.jsx("select",{className:"s-settings-input",value:P,disabled:n,onChange:l=>{const y=l.target.value||null;a($=>$&&{...$,inputDeviceId:y,inputDeviceName:i.find(_=>_.id===y)?.name??null}),O({inputDeviceId:y})},children:i.map(l=>e.jsxs("option",{value:l.id,children:[l.name,l.isDefault?" (system default)":""]},l.id))}):e.jsx("div",{className:"s-settings-field-hint",children:"Scout Menu is not reporting microphones. Launch Scout Menu, grant mic access, then refresh."})}),e.jsx(p,{label:"Diagnostics"}),e.jsx("ul",{className:"s-settings-field-hint",style:{margin:0,paddingLeft:"1.1rem",display:"grid",gap:"0.35rem"},children:I.map(l=>e.jsx("li",{children:l},l))}),e.jsx(p,{label:"Recent sessions",right:d.length?`${d.length} shown`:"none"}),d.length===0?e.jsx("div",{className:"s-settings-field-hint",children:"No recent dictation sessions on this web server. History fills as you use the mic in chat."}):e.jsx("div",{className:"s-settings-col-gap",style:{gap:"0.35rem"},children:d.map(l=>e.jsx("div",{className:"s-settings-device-row",style:{alignItems:"flex-start"},children:e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{className:"s-settings-device-name",style:{fontFamily:"var(--mono)"},children:[l.status," · ",l.lastEvent??"started"]}),e.jsxs("div",{className:"s-settings-device-meta",children:[l.surface," · ",Ce(l.updatedAt),l.error?` · ${l.error}`:""]}),l.lastTranscript?e.jsx("div",{className:"s-settings-field-hint",style:{marginTop:"0.2rem"},children:l.lastTranscript.length>96?`${l.lastTranscript.slice(0,96)}…`:l.lastTranscript}):null]})},l.sessionId))}),e.jsx("div",{className:"s-settings-button-row",children:e.jsx("button",{type:"button",className:"s-btn",disabled:m||n,onClick:()=>{C()},children:m?"Refreshing…":"Refresh"})})]})}const ds={desktop:"◻",mobile:"▯",tablet:"▭"};function us({device:t}){const s=t.status==="this-device"?"var(--accent)":t.status==="online"?"var(--green)":"var(--dim)";return e.jsxs("div",{className:"s-settings-device-row",children:[e.jsx("span",{className:"s-settings-device-icon",children:ds[t.kind]??"□"}),e.jsxs("div",{children:[e.jsx("div",{className:"s-settings-device-name",children:t.name}),e.jsxs("div",{className:"s-settings-device-meta",children:[t.kind," · via ",t.relay," · ",t.lastSeen]})]}),e.jsxs("span",{className:"s-settings-device-status",style:{color:s},children:["●"," ",t.status==="this-device"?"this device":t.status]}),e.jsx("button",{className:"s-btn",disabled:t.status==="this-device",children:t.status==="this-device"?"—":"Unpair"})]})}function hs({pairing:t}){const s=[{id:"local",name:"This machine",kind:"desktop",status:"this-device",relay:"local",lastSeen:"now"}];if(t?.trustedPeers)for(const a of t.trustedPeers){const i=a.fingerprint===t.connectedPeerFingerprint;s.push({id:a.fingerprint,name:a.name??"Paired device",kind:"mobile",status:i?"online":"offline",relay:"tailscale",lastSeen:a.lastSeenLabel??"—"})}return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(p,{label:`Paired devices · ${s.length}`}),e.jsx("div",{className:"s-settings-col-gap",style:{gap:10},children:s.map(a=>e.jsx(us,{device:a},a.id))}),e.jsx(p,{label:"Relay"}),e.jsxs("div",{className:"s-settings-relay-card",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"s-settings-relay-title",children:["Relay · ",e.jsxs("span",{className:"s-settings-device-status",style:{color:t?.isRunning?"var(--green)":"var(--dim)"},children:["●"," ",t?.isRunning?"connected":"offline"]})]}),e.jsxs("div",{className:"s-settings-relay-meta",children:[t?.relay??"not configured"," · tailscale"]}),e.jsx("div",{className:"s-settings-relay-desc",children:"Agents route through your relay to reach mobile when the app is backgrounded. End-to-end encrypted; keys never leave your devices."})]}),e.jsx("button",{className:"s-btn",children:"Configure"})]})]})}function B(t,s,a=!1){if(!t&&!s)return"Not reported";const i=t||"detached";return s?`${i} @ ${s}${a?" (modified)":""}`:i}function ve(){return navigator.userAgentData?.platform||navigator.platform||"Unknown"}function S({label:t,value:s,detail:a}){return e.jsxs("div",{className:"s-settings-about-fact",children:[e.jsx("dt",{children:t}),e.jsxs("dd",{children:[e.jsx("code",{children:s}),a?e.jsx("span",{children:a}):null]})]})}function ue(t){const{build:s,mesh:a}=t,i=a?.health.build??null,o=a?.localNode?a.nodes[a.localNode.id]?.host:void 0,d=ve();return["OpenScout troubleshooting report",`Collected: ${t.collectedAt.toISOString()}`,"","[Web]",`Observed: ${t.buildCollectedAt?.toISOString()??"unknown"}`,`Version: ${s?.version??"unknown"}`,`Mode: ${s?.mode??"unknown"}`,`Source: ${B(s?.branch,s?.commit,s?.dirty===!0)}`,`Server: ${s?.server?`${s.server.engine} ${s.server.engineVersion}`:"unknown"}`,`Server platform: ${s?.server?`${s.server.platform}/${s.server.arch}`:"unknown"}`,"","[Broker]",`Observed: ${t.meshCollectedAt?.toISOString()??"unknown"}`,`Reachable: ${a?.health.reachable===void 0?"unknown":a.health.reachable?"yes":"no"}`,`Healthy: ${a?.health.ok===void 0?"unknown":a.health.ok?"yes":"no"}`,`Error: ${a?.health.error??"none reported"}`,`Package: ${i?.packageName??"unknown"}`,`Version: ${i?.version??"unknown"}`,`Mode: ${i?.mode??"unknown"}`,`Source: ${B(i?.branch,i?.commit)}`,`Build: ${i?.buildNumber??i?.buildId??"not reported"}`,`Node: ${a?.health.nodeId??"unknown"}`,`Broker URL: ${a?.brokerUrl??"unknown"}`,"","[Host]",`Name: ${a?.localNode?.name??"unknown"}`,`Scout version: ${o?.scoutVersion??"not reported"}`,`System: ${o?.os??"unknown"}`,`Architecture: ${o?.arch??s?.server?.arch??"unknown"}`,"","[Browser]",`Platform: ${d}`,`User agent: ${navigator.userAgent}`,`Origin: ${window.location.origin}`].join(`
|
|
3
|
+
`)}async function ms(t){if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(t);return}const s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();const a=document.execCommand("copy");if(s.remove(),!a)throw new Error("Clipboard access is unavailable")}function ps(){const[t,s]=c.useState(null),[a,i]=c.useState(!0),[o,d]=c.useState(null),[h,m]=c.useState("idle"),v=c.useCallback(async(g=!1)=>{i(!0),d(null),m("idle");const[j,N]=await Promise.allSettled([T(g?"/api/build?refresh=1":"/api/build"),T("/api/mesh")]),I=new Date;if(s(l=>({build:j.status==="fulfilled"?j.value:l?.build??null,mesh:N.status==="fulfilled"?N.value:l?.mesh??null,collectedAt:I,buildCollectedAt:j.status==="fulfilled"?I:l?.buildCollectedAt??null,meshCollectedAt:N.status==="fulfilled"?I:l?.meshCollectedAt??null})),j.status==="rejected"||N.status==="rejected"){const l=[j.status==="rejected"?"web build":null,N.status==="rejected"?"broker":null].filter(Boolean).join(" and ");d(`Could not refresh ${l} details. Last reported values are kept when available.`)}i(!1)},[]);c.useEffect(()=>{v()},[v]);const n=t?.build??null,r=t?.mesh??null,x=r?.health.build??null,f=r?.localNode?r.nodes[r.localNode.id]?.host:void 0,C=ve(),O=r===null?"not reported":r.health.reachable?r.health.ok?"healthy":"degraded":"unreachable",P=c.useCallback(()=>{t&&ms(ue(t)).then(()=>{m("copied"),setTimeout(()=>m("idle"),1800)}).catch(()=>{m("error")})},[t]);return a&&!t?e.jsx("div",{className:"s-settings-loading",children:"Collecting version details…"}):e.jsxs("div",{className:"s-settings-about",children:[e.jsxs("div",{className:"s-settings-about-summary",children:[e.jsxs("div",{children:[e.jsx("span",{className:"s-settings-about-product",children:"OpenScout Web"}),e.jsx("strong",{children:n?.version?`v${n.version}`:"Version unavailable"}),e.jsxs("span",{className:"s-settings-about-source",children:[n?.mode??"unknown mode"," · ",B(n?.branch,n?.commit,n?.dirty===!0)]}),e.jsxs("span",{className:"s-settings-about-collected",children:["Snapshot collected ",t?.collectedAt.toLocaleString()??"—"]})]}),e.jsxs("div",{className:"s-settings-about-actions",children:[e.jsxs("button",{type:"button",className:"s-btn",onClick:()=>{v(!0)},disabled:a,children:[e.jsx(De,{size:13,"aria-hidden":!0}),a?"Refreshing…":"Refresh"]}),e.jsxs("button",{type:"button",className:"s-btn s-settings-about-copy",onClick:P,disabled:!t,children:[h==="copied"?e.jsx(R,{size:13,"aria-hidden":!0}):e.jsx(Le,{size:13,"aria-hidden":!0}),h==="copied"?"Copied report":h==="error"?"Copy failed":"Copy report"]})]})]}),o?e.jsx("div",{className:"s-settings-about-warning",role:"status",children:o}):null,h==="error"&&t?e.jsxs("div",{className:"s-settings-about-copy-fallback",role:"alert",children:[e.jsx("strong",{children:"Clipboard access was denied."}),e.jsx("span",{children:"Select and copy the report below."}),e.jsx("textarea",{readOnly:!0,value:ue(t),"aria-label":"OpenScout troubleshooting report"})]}):null,e.jsx(p,{label:"Web application",right:"release and source identity"}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(S,{label:"Package version",value:n?.version??"Unknown",detail:`Observed ${t?.buildCollectedAt?.toLocaleString()??"at an unknown time"}. Use this when comparing releases.`}),e.jsx(S,{label:"Run mode",value:n?.mode??"Unknown"}),e.jsx(S,{label:"Source checkout",value:B(n?.branch,n?.commit,n?.dirty===!0),detail:"A dev SHA identifies the running checkout; it is not the release version."}),e.jsx(S,{label:"Server engine",value:n?.server?`${n.server.engine} ${n.server.engineVersion}`:"Not reported",detail:n?.server?`Node compatibility ${n.server.nodeVersion} · ${n.server.platform}/${n.server.arch}`:void 0})]}),e.jsx(p,{label:"Broker",right:O}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(S,{label:"Status",value:O,detail:[`Observed ${t?.meshCollectedAt?.toLocaleString()??"at an unknown time"}.`,r?.health.error].filter(Boolean).join(" ")}),e.jsx(S,{label:"Package",value:x?.packageName??"Not reported"}),e.jsx(S,{label:"Version",value:x?.version??"Not reported"}),e.jsx(S,{label:"Source",value:B(x?.branch,x?.commit)}),e.jsx(S,{label:"Build",value:x?.buildNumber??x?.buildId??"Not reported"}),e.jsx(S,{label:"Node",value:r?.health.nodeId??"Not reported",detail:r?.brokerUrl})]}),e.jsx(p,{label:"Host and browser",right:"troubleshooting context"}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(S,{label:"Host",value:r?.localNode?.name??"Not reported"}),e.jsx(S,{label:"Host Scout",value:f?.scoutVersion??"Not reported"}),e.jsx(S,{label:"Host system",value:[f?.os,f?.arch??n?.server?.arch].filter(Boolean).join(" · ")||"Not reported"}),e.jsx(S,{label:"Browser platform",value:C}),e.jsx(S,{label:"Browser",value:navigator.userAgent}),e.jsx(S,{label:"Page origin",value:window.location.origin})]}),e.jsx("p",{className:"s-settings-about-note",children:"Native app and CLI versions are shown only when those components report them. Scout does not infer a version from a nearby checkout."})]})}const V=[{id:"appearance",label:"Appearance",sub:"mode · workspace style"},{id:"operator",label:"Operator",sub:"identity · bio · hours"},{id:"comms",label:"Communication",sub:"how agents reach you"},{id:"voice",label:"Voice",sub:"realtime · permissions · dictation"},{id:"credentials",label:"Credentials",sub:"model provider keys"},{id:"devices",label:"Paired devices",sub:"relay · connected"},{id:"about",label:"About",sub:"versions · build · runtime"}],he={appearance:"Appearance",operator:"Operator identity",comms:"Communication",voice:"Voice",credentials:"Credentials",devices:"Paired devices",about:"About OpenScout"},gs={appearance:"Choose how Scout looks on this device. Changes apply immediately across the workspace.",operator:"Your identity, availability, and the context agents receive when they work with you.",comms:"Set interruption rules, delivery channels, response style, and quiet hours.",voice:"Configure dictation, realtime voice, permissions, and input devices.",credentials:"Manage model-provider credentials stored by this Scout installation.",devices:"Review the relay and devices currently connected to this Scout workspace.",about:"Exact release, source, broker, host, and browser details for troubleshooting."},bs={name:"",handle:"",pronouns:"",hue:195,bio:"",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,workingHours:"08:00 – 18:00",interruptThreshold:"blocking-only",batchWindow:15,channel:"here+mobile",verbosity:"terse",tone:"direct",quietHours:"22:00 – 07:00",provisionalAgentNames:[],provisionalAgentNamesMode:"replace",provisionalAgentNamesResolvedCount:0,provisionalAgentNamesPreview:[],provisionalAgentNamesSource:"default"};function xe({open:t,onClose:s,section:a,onSectionChange:i,presentation:o}){const{refreshOnboarding:d}=me(),{ref:h,onKeyDown:m}=Te(t&&o==="drawer"),[v,n]=c.useState("appearance"),r=a??v,x=c.useCallback(u=>{i?i(u):n(u)},[i]),[f,C]=c.useState(bs),[O,P]=c.useState(null),[g,j]=c.useState(null),[N,I]=c.useState(null),[l,y]=c.useState(!1),[$,_]=c.useState("saved"),F=c.useRef(null),W=c.useRef(!0),z=c.useRef(null);c.useEffect(()=>()=>{W.current=!1},[]);const q=c.useCallback(async()=>{const[u,A]=await Promise.allSettled([Ye(),be()]),k=u.status==="fulfilled"?u.value:null;let b=A.status==="fulfilled"?A.value:null;k?.configured&&!b?.openai.configured&&(b=await Ge().catch(()=>b)),j(k),I(b)},[]),Z=c.useCallback(async()=>{try{const u=T("/api/user"),A=Promise.race([T("/api/pairing-state"),new Promise((vs,we)=>setTimeout(()=>we(new Error("timeout")),3e3))]),[k,b]=await Promise.allSettled([u,A]);k.status==="fulfilled"&&C(k.value),b.status==="fulfilled"&&P(b.value),await q()}finally{y(!0)}},[q]);c.useEffect(()=>{t&&r!=="appearance"&&r!=="about"&&!l&&Z()},[l,t,Z,r]),c.useEffect(()=>{if(!t||!window.matchMedia("(max-width: 760px)").matches)return;const u=window.requestAnimationFrame(()=>{z.current?.scrollIntoView({block:"nearest",inline:"nearest"})});return()=>window.cancelAnimationFrame(u)},[t,r]);const G=c.useCallback(u=>{const k=(V.findIndex(b=>b.id===r)+u+V.length)%V.length;x(V[k].id)},[r]),fe=c.useCallback(u=>{if(m(u),o==="drawer"&&u.key==="Escape"){u.preventDefault(),s();return}u.target?.closest(".s-settings-rail")&&(u.key==="ArrowDown"?(u.preventDefault(),G(1)):u.key==="ArrowUp"&&(u.preventDefault(),G(-1)))},[G,s,m,o]),ee=c.useCallback(u=>{F.current&&clearTimeout(F.current),_("saving"),F.current=setTimeout(()=>{T("/api/user",{method:"POST",body:JSON.stringify(u)}).then(()=>d()).then(()=>{W.current&&_("saved")}).catch(()=>{W.current&&_("error")})},400)},[d]),se=c.useCallback(u=>{C(A=>{const k={...A,...u};return ee(k),k})},[ee]),te=e.jsx("nav",{className:"s-settings-rail","aria-label":"Settings pages",children:V.map(u=>{const A=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-settings-rail-label",children:u.label}),e.jsx("span",{className:"s-settings-rail-sub",children:u.sub})]}),k=`s-settings-rail-btn${r===u.id?" s-settings-rail-btn--active":""}`;return o==="page"?e.jsx("a",{ref:r===u.id?b=>{z.current=b}:void 0,href:Pe({view:"settings",section:u.id}),"aria-current":r===u.id?"page":void 0,className:k,onClick:b=>{b.button!==0||b.metaKey||b.ctrlKey||b.shiftKey||b.altKey||(b.preventDefault(),x(u.id))},children:A},u.id):e.jsx("button",{ref:r===u.id?b=>{z.current=b}:void 0,onClick:()=>x(u.id),"aria-current":r===u.id?"page":void 0,className:k,children:A},u.id)})}),ae=e.jsx("main",{className:"s-settings-content",id:`settings-${r}`,"data-settings-section":r,tabIndex:-1,children:r==="appearance"?e.jsx(ns,{}):r==="about"?e.jsx(ps,{}):l?e.jsxs(e.Fragment,{children:[r==="operator"&&e.jsx(is,{profile:f,update:se}),r==="comms"&&e.jsx(rs,{profile:f,update:se}),r==="credentials"&&e.jsx(ls,{clientCredentials:g,serverCredentials:N,reloadCredentials:q}),r==="voice"&&e.jsx(cs,{}),r==="devices"&&e.jsx(hs,{pairing:O})]}):e.jsx("div",{className:"s-settings-loading",children:"Loading settings…"})});return o==="page"?e.jsxs("section",{className:"s-settings-page","aria-labelledby":"settings-page-title",children:[e.jsxs("header",{className:"s-settings-page-header",children:[e.jsxs("div",{children:[e.jsx("div",{className:"s-settings-page-kicker",children:"Settings"}),e.jsx("h1",{id:"settings-page-title",children:he[r]}),e.jsx("p",{children:gs[r]})]}),r==="about"?e.jsxs("div",{className:"s-settings-page-save-state","data-state":"neutral",children:[e.jsx("span",{"aria-hidden":"true"}),"Diagnostic snapshot"]}):e.jsxs("div",{className:"s-settings-page-save-state","data-state":$,role:"status","aria-live":"polite",children:[e.jsx("span",{"aria-hidden":"true"}),$==="saving"?"Saving changes…":$==="error"?"Couldn’t save changes":"Saved automatically"]})]}),e.jsxs("div",{className:"s-settings-page-layout",children:[te,ae]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`s-settings-scrim ${t?"s-settings-scrim--open":"s-settings-scrim--closed"}`,onClick:s}),e.jsxs("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":"Settings",className:`s-settings-drawer ${t?"s-settings-drawer--open":"s-settings-drawer--closed"}`,onKeyDown:fe,children:[e.jsxs("div",{className:"s-settings-header",children:[e.jsxs("div",{className:"s-settings-header-title",children:["⚙"," SETTINGS"]}),e.jsx("span",{className:"s-settings-header-sep",children:"/"}),e.jsx("span",{className:"s-settings-header-section",children:he[r]}),e.jsx("span",{style:{flex:1}}),e.jsx("span",{className:"s-settings-header-hint",children:"ESC to close"}),e.jsx("button",{className:"s-settings-close",onClick:s,children:"×"})]}),te,ae,e.jsxs("div",{className:"s-settings-footer",children:[e.jsxs("span",{className:"s-settings-footer-sync",children:["●"," synced"]}),e.jsx("span",{children:"·"}),e.jsx("span",{children:"changes apply instantly to every agent in your fleet"}),e.jsx("span",{style:{flex:1}}),e.jsx("button",{className:"s-btn",onClick:s,children:"Done"})]})]})]})}function je(t){return e.jsx(xe,{...t,presentation:"drawer"})}function ye({section:t="appearance",onSectionChange:s}){return e.jsx(xe,{open:!0,onClose:()=>{},section:t,onSectionChange:s,presentation:"page"})}const Is=Object.freeze(Object.defineProperty({__proto__:null,SettingsDrawer:je,SettingsPage:ye},Symbol.toStringTag,{value:"Module"})),$s=Object.freeze(Object.defineProperty({__proto__:null,SettingsDrawer:je,SettingsPage:ye},Symbol.toStringTag,{value:"Module"}));export{ye as S,Is as a,$s as b,Ge as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i,r as d}from"./index-o4FKpU7Z.js";import{E as it}from"./EmptyState-BUvllvA6.js";import{S as B}from"./StatusPill-BJ1ierIR.js";import{a as M}from"./api-h5zurxmi.js";import{p as Rt}from"./status-tone-BM_zuRy1.js";import{t as ot}from"./time-Dhsh_2EG.js";import{AgentConfigurationScreen as Mt}from"./AgentConfigurationScreen-BjG6ECjl.js";import{S as At}from"./SettingsDrawer-BFsnww-k.js";/* empty css */import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./createLucideIcon-Bt67PWH-.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./colors-BtO5_zlx.js";import"./NewChatOrigin-BEz6jyqf.js";import"./keyboard-nav-Chf51dns.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-ynOfVadO.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./file-text-iF0hyVyU.js";import"./Provider-DKZWuzSR.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./openContent-C6XO6kr5.js";import"./AgentsSubnav-CiIuzxnZ.js";import"./SecondaryNav-Dj30epYF.js";import"./secondaryNavConfig-CSFDCQAf.js";import"./message-square-ER1_q2pe.js";import"./terminal-By1Lw2i2.js";import"./scroll-text-BuneRiAD.js";import"./refresh-cw-B5To7b6B.js";import"./bot-BUK7dOPS.js";import"./wrench-M4G7WtYB.js";import"./server-pYOMFjrT.js";import"./VoicePermissionsPanel-CD903y9K.js";import"./check--esHw52j.js";import"./copy-Dty8ZYsM.js";var k=(t=>(t[t.Border=-1]="Border",t[t.Data=0]="Data",t[t.Function=1]="Function",t[t.Position=2]="Position",t[t.Timing=3]="Timing",t[t.Alignment=4]="Alignment",t))(k||{});const Ct=[0,1],dt=[1,0],ht=[2,3],ft=[3,2],It={L:Ct,M:dt,Q:ht,H:ft},zt=/^\d*$/,Ft=/^[A-Z0-9 $%*+./:-]*$/,L="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",T=1,q=40,at=3,Bt=3,I=40,Lt=10,mt=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],pt=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class _t{constructor(e,s,n,r){if(this.version=e,this.ecc=s,e<T||e>q)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=e*4+17;const o=Array.from({length:this.size}).fill(!1);for(let c=0;c<this.size;c++)this.modules.push(o.slice()),this.types.push(o.map(()=>0));this.drawFunctionPatterns();const a=this.addEccAndInterleave(n);if(this.drawCodewords(a),r===-1){let c=1e9;for(let u=0;u<8;u++){this.applyMask(u),this.drawFormatBits(u);const h=this.getPenaltyScore();h<c&&(r=u,c=h),this.applyMask(u)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,s){return e>=0&&e<this.size&&s>=0&&s<this.size&&this.modules[s][e]}drawFunctionPatterns(){for(let n=0;n<this.size;n++)this.setFunctionModule(6,n,n%2===0,k.Timing),this.setFunctionModule(n,6,n%2===0,k.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),s=e.length;for(let n=0;n<s;n++)for(let r=0;r<s;r++)n===0&&r===0||n===0&&r===s-1||n===s-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const s=this.ecc[1]<<3|e;let n=s;for(let o=0;o<10;o++)n=n<<1^(n>>>9)*1335;const r=(s<<10|n)^21522;for(let o=0;o<=5;o++)this.setFunctionModule(8,o,x(r,o));this.setFunctionModule(8,7,x(r,6)),this.setFunctionModule(8,8,x(r,7)),this.setFunctionModule(7,8,x(r,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,x(r,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,x(r,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,x(r,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let n=0;n<12;n++)e=e<<1^(e>>>11)*7973;const s=this.version<<12|e;for(let n=0;n<18;n++){const r=x(s,n),o=this.size-11+n%3,a=Math.floor(n/3);this.setFunctionModule(o,a,r),this.setFunctionModule(a,o,r)}}drawFinderPattern(e,s){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(n)),a=e+r,c=s+n;a>=0&&a<this.size&&c>=0&&c<this.size&&this.setFunctionModule(a,c,o!==2&&o!==4,k.Position)}}drawAlignmentPattern(e,s){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,s+n,Math.max(Math.abs(r),Math.abs(n))!==1,k.Alignment)}setFunctionModule(e,s,n,r=k.Function){this.modules[s][e]=n,this.types[s][e]=r}addEccAndInterleave(e){const s=this.version,n=this.ecc;if(e.length!==z(s,n))throw new RangeError("Invalid argument");const r=pt[n[0]][s],o=mt[n[0]][s],a=Math.floor(O(s)/8),c=r-a%r,u=Math.floor(a/r),h=[],p=Yt(o);for(let f=0,b=0;f<r;f++){const g=e.slice(b,b+u-o+(f<c?0:1));b+=g.length;const E=Gt(g,p);f<c&&g.push(0),h.push(g.concat(E))}const m=[];for(let f=0;f<h[0].length;f++)h.forEach((b,g)=>{(f!==u-o||g>=c)&&m.push(b[f])});return m}drawCodewords(e){if(e.length!==Math.floor(O(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let o=0;o<2;o++){const a=n-o,u=(n+1&2)===0?this.size-1-r:r;!this.types[u][a]&&s<e.length*8&&(this.modules[u][a]=x(e[s>>>3],7-(s&7)),s++)}}}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+s)%2===0;break;case 1:r=s%2===0;break;case 2:r=n%3===0;break;case 3:r=(n+s)%3===0;break;case 4:r=(Math.floor(n/3)+Math.floor(s/2))%2===0;break;case 5:r=n*s%2+n*s%3===0;break;case 6:r=(n*s%2+n*s%3)%2===0;break;case 7:r=((n+s)%2+n*s%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[s][n]&&r&&(this.modules[s][n]=!this.modules[s][n])}}getPenaltyScore(){let e=0;for(let o=0;o<this.size;o++){let a=!1,c=0;const u=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[o][h]===a?(c++,c===5?e+=at:c>5&&e++):(this.finderPenaltyAddHistory(c,u),a||(e+=this.finderPenaltyCountPatterns(u)*I),a=this.modules[o][h],c=1);e+=this.finderPenaltyTerminateAndCount(a,c,u)*I}for(let o=0;o<this.size;o++){let a=!1,c=0;const u=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][o]===a?(c++,c===5?e+=at:c>5&&e++):(this.finderPenaltyAddHistory(c,u),a||(e+=this.finderPenaltyCountPatterns(u)*I),a=this.modules[h][o],c=1);e+=this.finderPenaltyTerminateAndCount(a,c,u)*I}for(let o=0;o<this.size-1;o++)for(let a=0;a<this.size-1;a++){const c=this.modules[o][a];c===this.modules[o][a+1]&&c===this.modules[o+1][a]&&c===this.modules[o+1][a+1]&&(e+=Bt)}let s=0;for(const o of this.modules)s=o.reduce((a,c)=>a+(c?1:0),s);const n=this.size*this.size,r=Math.ceil(Math.abs(s*20-n*10)/n)-1;return e+=r*Lt,e}getAlignmentPatternPositions(){if(this.version===1)return[];{const e=Math.floor(this.version/7)+2,s=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=s)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){const s=e[1],n=s>0&&e[2]===s&&e[3]===s*3&&e[4]===s&&e[5]===s;return(n&&e[0]>=s*4&&e[6]>=s?1:0)+(n&&e[6]>=s*4&&e[0]>=s?1:0)}finderPenaltyTerminateAndCount(e,s,n){return e&&(this.finderPenaltyAddHistory(s,n),s=0),s+=this.size,this.finderPenaltyAddHistory(s,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,s){s[0]===0&&(e+=this.size),s.pop(),s.unshift(e)}}function N(t,e,s){if(e<0||e>31||t>>>e)throw new RangeError("Value out of range");for(let n=e-1;n>=0;n--)s.push(t>>>n&1)}function x(t,e){return(t>>>e&1)!==0}class V{constructor(e,s,n){if(this.mode=e,this.numChars=s,this.bitData=n,s<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}getData(){return this.bitData.slice()}}const $t=[1,10,12,14],Ot=[2,9,11,13],Ut=[4,8,16,16];function gt(t,e){return t[Math.floor((e+7)/17)+1]}function yt(t){const e=[];for(const s of t)N(s,8,e);return new V(Ut,t.length,e)}function Dt(t){if(!bt(t))throw new RangeError("String contains non-numeric characters");const e=[];for(let s=0;s<t.length;){const n=Math.min(t.length-s,3);N(Number.parseInt(t.substring(s,s+n),10),n*3+1,e),s+=n}return new V($t,t.length,e)}function Tt(t){if(!vt(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");const e=[];let s;for(s=0;s+2<=t.length;s+=2){let n=L.indexOf(t.charAt(s))*45;n+=L.indexOf(t.charAt(s+1)),N(n,11,e)}return s<t.length&&N(L.indexOf(t.charAt(s)),6,e),new V(Ot,t.length,e)}function qt(t){return t===""?[]:bt(t)?[Dt(t)]:vt(t)?[Tt(t)]:[yt(Ht(t))]}function bt(t){return zt.test(t)}function vt(t){return Ft.test(t)}function Vt(t,e){let s=0;for(const n of t){const r=gt(n.mode,e);if(n.numChars>=1<<r)return Number.POSITIVE_INFINITY;s+=4+r+n.bitData.length}return s}function Ht(t){t=encodeURI(t);const e=[];for(let s=0;s<t.length;s++)t.charAt(s)!=="%"?e.push(t.charCodeAt(s)):(e.push(Number.parseInt(t.substring(s+1,s+3),16)),s+=2);return e}function O(t){if(t<T||t>q)throw new RangeError("Version number out of range");let e=(16*t+128)*t+64;if(t>=2){const s=Math.floor(t/7)+2;e-=(25*s-10)*s-55,t>=7&&(e-=36)}return e}function z(t,e){return Math.floor(O(t)/8)-mt[e[0]][t]*pt[e[0]][t]}function Yt(t){if(t<1||t>255)throw new RangeError("Degree out of range");const e=[];for(let n=0;n<t-1;n++)e.push(0);e.push(1);let s=1;for(let n=0;n<t;n++){for(let r=0;r<e.length;r++)e[r]=U(e[r],s),r+1<e.length&&(e[r]^=e[r+1]);s=U(s,2)}return e}function Gt(t,e){const s=e.map(n=>0);for(const n of t){const r=n^s.shift();s.push(0),e.forEach((o,a)=>s[a]^=U(o,r))}return s}function U(t,e){if(t>>>8||e>>>8)throw new RangeError("Byte out of range");let s=0;for(let n=7;n>=0;n--)s=s<<1^(s>>>7)*285,s^=(e>>>n&1)*t;return s}function Wt(t,e,s=1,n=40,r=-1,o=!0){if(!(T<=s&&s<=n&&n<=q)||r<-1||r>7)throw new RangeError("Invalid value");let a,c;for(a=s;;a++){const m=z(a,e)*8,f=Vt(t,a);if(f<=m){c=f;break}if(a>=n)throw new RangeError("Data too long")}for(const m of[dt,ht,ft])o&&c<=z(a,m)*8&&(e=m);const u=[];for(const m of t){N(m.mode[0],4,u),N(m.numChars,gt(m.mode,a),u);for(const f of m.getData())u.push(f)}const h=z(a,e)*8;N(0,Math.min(4,h-u.length),u),N(0,(8-u.length%8)%8,u);for(let m=236;u.length<h;m^=253)N(m,8,u);const p=Array.from({length:Math.ceil(u.length/8)},()=>0);return u.forEach((m,f)=>p[f>>>3]|=m<<7-(f&7)),new _t(a,e,p,r)}function Xt(t,e){const{ecc:s="L",boostEcc:n=!1,minVersion:r=1,maxVersion:o=40,maskPattern:a=-1,border:c=1}=e||{},u=typeof t=="string"?qt(t):Array.isArray(t)?[yt(t)]:void 0;if(!u)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof t}`);const h=Wt(u,It[s],r,o,a,n),p=Jt({version:h.version,maskPattern:h.mask,size:h.size,data:h.modules,types:h.types},c);return e?.invert&&(p.data=p.data.map(m=>m.map(f=>!f))),e?.onEncoded?.(p),p}function Jt(t,e=1){if(!e)return t;const{size:s}=t,n=s+e*2;t.size=n,t.data.forEach(o=>{for(let a=0;a<e;a++)o.unshift(!1),o.push(!1)});for(let o=0;o<e;o++)t.data.unshift(Array.from({length:n},a=>!1)),t.data.push(Array.from({length:n},a=>!1));const r=k.Border;t.types.forEach(o=>{for(let a=0;a<e;a++)o.unshift(r),o.push(r)});for(let o=0;o<e;o++)t.types.unshift(Array.from({length:n},a=>r)),t.types.push(Array.from({length:n},a=>r));return t}function lt(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Kt(t,e={}){const s=Xt(t,e),{pixelSize:n=10,whiteColor:r="white",blackColor:o="black"}=e,a=s.size*n,c=s.size*n;let u=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${c} ${a}">`;const h=[];for(let p=0;p<s.size;p++)for(let m=0;m<s.size;m++){const f=m*n,b=p*n;s.data[p][m]&&h.push(`M${f},${b}h${n}v${n}h-${n}z`)}return u+=`<rect fill="${lt(r)}" width="${c}" height="${a}"/>`,u+=`<path fill="${lt(o)}" d="${h.join("")}"/>`,u+="</svg>",u}const Zt="scout",Qt="pair";function _(t){const e=typeof t=="string"?t.trim():"";return e?`${Zt}://${Qt}?payload=${encodeURIComponent(e)}`:null}function te(t){const e=ee(t),s=_(t);if(!e)return{default:s,lan:null,tailnet:null};const n=xt(e.relay,e.fallbackRelays??[]),r=n.find(se),o=n.find(ne);return{default:s,lan:r?_(JSON.stringify(ct(e,r))):null,tailnet:o?_(JSON.stringify(ct(e,o))):null}}function ee(t){const e=typeof t=="string"?t.trim():"";if(!e)return null;try{const s=JSON.parse(e);return!s||typeof s!="object"||typeof s.relay!="string"?null:s}catch{return null}}function ct(t,e){const s=xt(e,[t.relay,...Array.isArray(t.fallbackRelays)?t.fallbackRelays:[]]),n={...t,relay:s[0]};return s.length>1?n.fallbackRelays=s.slice(1):delete n.fallbackRelays,n}function xt(t,e){const s=[],n=new Set;for(const r of[t,...e]){if(typeof r!="string")continue;const o=r.trim();!o||n.has(o)||(n.add(o),s.push(o))}return s}function se(t){const e=Nt(t);if(!e)return!1;if(e.endsWith(".local"))return!0;const s=wt(e);if(!s)return!1;const[n,r]=s;return n===10||n===192&&r===168||n===172&&r>=16&&r<=31||n===169&&r===254}function ne(t){const e=Nt(t);if(!e)return!1;if(e.endsWith(".ts.net"))return!0;const s=wt(e);if(!s)return!1;const[n,r]=s;return n===100&&r>=64&&r<=127}function Nt(t){try{return new URL(t).hostname.toLowerCase()}catch{return""}}function wt(t){const e=t.split(".");if(e.length!==4)return null;const s=e.map(n=>{if(!/^\d+$/.test(n))return Number.NaN;const r=Number(n);return r>=0&&r<=255?r:Number.NaN});return s.every(Number.isFinite)?s:null}function re(t){return t?t.replace(/^wss?:\/\//,"").replace(/:\d+$/,""):null}function ut(t){return t?t.length<=18?t:`${t.slice(0,10)}...${t.slice(-6)}`:null}function ie(t,e){if(!t)return null;const s=Math.max(0,Math.floor((t-e)/1e3));if(s===0)return null;if(s<60)return`${s}s`;const n=Math.floor(s/60),r=s%60;return r>0?`${n}m ${r}s`:`${n}m`}function D({value:t}){const[e,s]=d.useState(!1),n=d.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[t]);return i.jsx("button",{type:"button",className:"sys-copy-btn",onClick:n,title:"Copy",children:e?i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})}):i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),i.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}function $({label:t,value:e}){return i.jsxs("span",{className:"sys-settings-route-link",children:[i.jsx("a",{className:"sys-settings-link",href:e,title:e,"aria-label":`Open Scout ${t} pairing link`,children:i.jsx("code",{children:t})}),i.jsx(D,{value:e})]})}function oe({agentId:t,navigate:e}){return d.useEffect(()=>{e({view:"agents-v2",agentId:t,tab:"config"})},[t,e]),null}function ps({navigate:t,section:e,agentId:s}){if(e==="agents"&&s)return i.jsx(oe,{agentId:s,navigate:t});if(e==="agents")return i.jsx(Mt,{navigate:t,selectedAgentId:s});if(e===void 0||e==="appearance"||e==="operator"||e==="comms"||e==="credentials"||e==="voice"||e==="devices"||e==="about"){const n=e??"appearance";return i.jsx(At,{section:n,onSectionChange:r=>t({view:"settings",section:r})})}return i.jsx(ae,{})}function ae(){const[t,e]=d.useState(null),[s,n]=d.useState(""),[r,o]=d.useState(""),[a,c]=d.useState(!0),[u,h]=d.useState(!1),[p,m]=d.useState(!1),[f,b]=d.useState(null),[g,E]=d.useState(null),[H,A]=d.useState(null),[C,Y]=d.useState(null),[jt,G]=d.useState(()=>Date.now()),[W,X]=d.useState(null),J=d.useRef(null),w=d.useRef(0),K=d.useRef(null);d.useEffect(()=>{J.current=t},[t]),d.useEffect(()=>{K.current=f},[f]),d.useEffect(()=>{!t||window.location.hash!=="#trusted-peers"||window.requestAnimationFrame(()=>{document.getElementById("trusted-peers")?.scrollIntoView({block:"start"})})},[t]);const j=d.useCallback(async(l="initial")=>{if(l==="background"&&K.current)return;const v=++w.current;!(J.current!==null)&&l!=="background"?(c(!0),E(null)):h(!0);try{const R=await M(l==="manual"?"/api/pairing-state/refresh":"/api/pairing-state");if(v!==w.current)return;e(R),E(null),Y(Date.now())}catch(R){if(v!==w.current)return;E(R instanceof Error?R.message:String(R))}finally{v===w.current&&(c(!1),h(!1))}},[]),Z=d.useCallback(async()=>{try{const l=await M("/api/user");o(l.name),n(l.name),A(null)}catch(l){A(l instanceof Error?l.message:String(l))}},[]),Q=d.useRef(!1);d.useEffect(()=>{j("initial"),Z()},[j,Z]),d.useEffect(()=>{const l=setInterval(()=>{j("background")},1e4);return()=>clearInterval(l)},[j]),d.useEffect(()=>{if(!t?.pairing?.expiresAt)return;G(Date.now());const l=setInterval(()=>{G(Date.now())},1e3);return()=>clearInterval(l)},[t?.pairing?.expiresAt]);const tt=d.useCallback(async()=>{m(!0),A(null);try{const l=await M("/api/user",{method:"POST",body:JSON.stringify({name:s})});o(l.name),n(l.name)}catch(l){A(l instanceof Error?l.message:String(l))}finally{m(!1)}},[s]),S=d.useCallback(async l=>{const v=++w.current;b(l),E(null);try{const P=await M("/api/pairing/control",{method:"POST",body:JSON.stringify({action:l})});if(v!==w.current)return;e(P),Y(Date.now())}catch(P){if(v!==w.current)return;E(P instanceof Error?P.message:String(P))}finally{v===w.current&&b(null)}},[]);d.useEffect(()=>{!t||t.isRunning||Q.current||(Q.current=!0,S("start"))},[t,S]);const Et=d.useCallback(async l=>{X(l);try{await M(`/api/pairing/peers/${encodeURIComponent(l)}`,{method:"DELETE"}),j("manual")}catch{}finally{X(null)}},[j]),et=d.useMemo(()=>{const l=t?.pairing?.qrValue?.trim();return l?Kt(l,{border:2,ecc:"M",pixelSize:8}):null},[t?.pairing?.qrValue]),y=d.useMemo(()=>te(t?.pairing?.qrValue),[t?.pairing?.qrValue]),kt=!!(y.lan||y.tailnet||y.default),F=re(t?.pairing?.relay??t?.relay??null),st=ie(t?.pairing?.expiresAt,jt),nt=(t?.trustedPeers.find(l=>l.fingerprint===t.connectedPeerFingerprint)??null)?.name??ut(t?.connectedPeerFingerprint??null),Pt=Rt(t),rt=s.trim()!==r,St=!a&&!t&&!!g;return i.jsxs("div",{className:"sys-surface-page sys-settings-page",children:[i.jsxs("div",{className:"sys-page-head",children:[i.jsxs("div",{className:"sys-page-title-group",children:[i.jsx("h2",{className:"sys-page-title",children:"Settings"}),i.jsx("p",{className:"sys-page-subtitle",children:"Identity, pairing, and trusted devices."})]}),i.jsxs("div",{className:"sys-page-actions",children:[t&&i.jsx(B,{tone:Pt,children:t.statusLabel}),i.jsx("div",{className:"sys-sync-note",children:a?"Loading...":g&&t?`Snapshot from ${C?ot(C):"earlier"}`:C?`Updated ${ot(C)}`:""}),i.jsx("button",{type:"button",className:"s-btn",disabled:a||u||!!f,onClick:()=>{j("manual")},children:u?"Refreshing...":"Refresh"})]})]}),g&&t&&i.jsxs("div",{className:"sys-banner sys-banner-warning",children:[i.jsx("strong",{children:"Refresh failed."}),i.jsx("span",{children:g})]}),H&&i.jsxs("div",{className:"sys-banner sys-banner-warning",children:[i.jsx("strong",{children:"Identity error."}),i.jsx("span",{children:H})]}),a&&!t&&i.jsx(it,{title:"Loading settings",body:"Checking relay status and trusted peers."}),St&&i.jsx(it,{className:"sys-state-card-error",title:"Pairing unavailable",body:g,action:i.jsx("button",{type:"button",className:"s-btn",onClick:()=>{j("manual")},children:"Try again"})}),i.jsxs("div",{className:"sys-settings-hero",children:[i.jsx("div",{className:"sys-settings-qr-col",children:et?i.jsxs("div",{className:"sys-settings-qr-frame",children:[i.jsx("div",{className:"s-qr",dangerouslySetInnerHTML:{__html:et}}),st&&i.jsxs("span",{className:"sys-settings-qr-expires",children:["Expires in ",st]})]}):i.jsx("div",{className:"sys-settings-qr-empty",children:i.jsx("span",{className:"sys-settings-qr-empty-label",children:"Generating QR..."})})}),i.jsxs("div",{className:"sys-settings-info-col",children:[i.jsxs("div",{className:"sys-input-row",children:[i.jsx("input",{className:"sys-input",type:"text",placeholder:"Your name",value:s,onChange:l=>n(l.target.value),onKeyDown:l=>{l.key==="Enter"&&rt&&!p&&tt()}}),i.jsx("button",{type:"button",className:"s-btn s-btn-primary",disabled:!rt||p,onClick:()=>{tt()},children:p?"Saving...":"Save"})]}),i.jsxs("div",{className:"sys-settings-kv-list",children:[t?.identityFingerprint&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Fingerprint"}),i.jsxs("span",{className:"sys-settings-kv-value",children:[i.jsx("code",{children:t.identityFingerprint}),i.jsx(D,{value:t.identityFingerprint})]})]}),F&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Relay"}),i.jsxs("span",{className:"sys-settings-kv-value",children:[i.jsx("code",{children:F}),i.jsx(D,{value:F})]})]}),kt&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Links"}),i.jsxs("span",{className:"sys-settings-kv-value sys-settings-link-list",children:[y.lan&&i.jsx($,{label:"LAN",value:y.lan}),y.tailnet&&i.jsx($,{label:"TSN",value:y.tailnet}),!y.lan&&!y.tailnet&&y.default&&i.jsx($,{label:"PAIR",value:y.default})]})]}),t?.statusDetail&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Status"}),i.jsx("span",{className:"sys-settings-kv-value sys-settings-kv-nowrap",children:t.statusDetail})]}),nt&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Connected"}),i.jsx("span",{className:"sys-settings-kv-value",children:nt})]}),t?.secure&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Security"}),i.jsx("span",{className:"sys-settings-kv-value",children:i.jsx(B,{tone:"success",children:"Noise XX"})})]})]}),t&&i.jsx("div",{className:"sys-inline-actions sys-settings-controls",children:t.isRunning?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"s-btn",disabled:!!f,onClick:()=>{S("restart")},children:f==="restart"?"Restarting...":"Restart"}),i.jsx("button",{type:"button",className:"s-btn",disabled:!!f,onClick:()=>{S("stop")},children:f==="stop"?"Stopping...":"Stop"})]}):i.jsx("button",{type:"button",className:"s-btn s-btn-primary",disabled:!!f,onClick:()=>{S("start")},children:f==="start"?"Starting...":"Start pairing"})})]})]}),t&&i.jsxs("section",{className:"sys-settings-peers",id:"trusted-peers",children:[i.jsx("div",{className:"sys-section-head",children:i.jsxs("div",{children:[i.jsx("h3",{className:"sys-section-title",children:"Trusted peers"}),i.jsxs("p",{className:"sys-section-subtitle",children:[t.trustedPeers.length," device",t.trustedPeers.length!==1?"s":""," paired with this broker."]})]})}),t.trustedPeers.length===0?i.jsxs("div",{className:"sys-list-empty",children:[i.jsx("h3",{children:"No trusted peers"}),i.jsx("p",{children:"Devices appear here after completing pairing."})]}):i.jsxs("table",{className:"sys-peers-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Device"}),i.jsx("th",{children:"Fingerprint"}),i.jsx("th",{children:"Paired"}),i.jsx("th",{children:"Last seen"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:t.trustedPeers.map(l=>{const v=l.fingerprint===t.connectedPeerFingerprint;return i.jsxs("tr",{className:v?"sys-peers-row-connected":"",children:[i.jsx("td",{children:i.jsxs("span",{className:"sys-peers-name",children:[l.name??ut(l.fingerprint)??"Peer",v&&i.jsx(B,{tone:"success",className:"sys-peers-badge",children:"Connected"})]})}),i.jsx("td",{children:i.jsx("code",{className:"sys-peers-fp",children:l.fingerprint})}),i.jsx("td",{children:l.pairedAtLabel??"—"}),i.jsx("td",{children:l.lastSeenLabel??"—"}),i.jsx("td",{children:i.jsx("button",{type:"button",className:"sys-peers-remove",disabled:W===l.fingerprint,onClick:()=>{Et(l.fingerprint)},title:"Remove peer",children:W===l.fingerprint?"...":"Remove"})})]},l.fingerprint)})})]})]})]})}export{ps as SettingsScreen};
|