@openscout/scout 0.2.90 → 0.2.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/README.md +12 -4
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/{ActivityScreen-BUeb4ERK.js → ActivityScreen-DkUP7V7M.js} +1 -1
  5. package/dist/client/assets/{AddProjectForm-DtTfn4Zk.js → AddProjectForm-CpyytDf2.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-CneOa70z.js → AgentAvatar-D8ZtMluU.js} +1 -1
  7. package/dist/client/assets/{AgentConfigurationScreen-CkZ7EjZh.js → AgentConfigurationScreen-BlGI6fuM.js} +1 -1
  8. package/dist/client/assets/{AgentDefinitionsWorkspace-0Y3kqMtv.js → AgentDefinitionsWorkspace-CfaDVCVt.js} +1 -1
  9. package/dist/client/assets/{AgentDetailCard-Dtc02KUO.js → AgentDetailCard-BTiOmh-a.js} +1 -1
  10. package/dist/client/assets/{AgentFloorView-B5raPB_U.js → AgentFloorView-DjNLILLt.js} +1 -1
  11. package/dist/client/assets/{AgentInfoScreen-DFG4ElZD.js → AgentInfoScreen-DG5dlHb_.js} +1 -1
  12. package/dist/client/assets/{AgentLaneCard-BRAkw8YJ.js → AgentLaneCard-lfRNb7JD.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-T8QE5742.js → AgentLaneChrome-Dlwrbq3g.js} +1 -1
  14. package/dist/client/assets/{AgentLaneDetailSheet-C8RYotnv.js → AgentLaneDetailSheet-BzYzBfcW.js} +1 -1
  15. package/dist/client/assets/{AgentLaneSummaryResize-FyYweLo_.js → AgentLaneSummaryResize-6SOEWUnr.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-Crxx1srt.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-Cil3dNwu.js → AgentLanesPreflight-C3uOiOzd.js} +1 -1
  18. package/dist/client/assets/{AgentLanesView-DPfO8MOo.js → AgentLanesView-ChNlmY-F.js} +1 -1
  19. package/dist/client/assets/{AgentLiveActions-DwScaVRF.js → AgentLiveActions-BJ5dIfL3.js} +1 -1
  20. package/dist/client/assets/{AgentSessions-DKoWA0Lm.js → AgentSessions-DpY0htZV.js} +1 -1
  21. package/dist/client/assets/{AgentsConsole-DoBIWGoq.js → AgentsConsole-CHyXrjhm.js} +1 -1
  22. package/dist/client/assets/{AgentsScreen-JuUiSuwY.js → AgentsScreen-BhCjX2lD.js} +1 -1
  23. package/dist/client/assets/AgentsSubnav-az_VDkri.js +1 -0
  24. package/dist/client/assets/{AtopView-ycxMrRwp.js → AtopView-BjjPM8OX.js} +1 -1
  25. package/dist/client/assets/{BackToPicker-D6WgIDb-.js → BackToPicker-D1LV6Cqp.js} +1 -1
  26. package/dist/client/assets/{BriefingDetailScreen-Zw-taW1s.js → BriefingDetailScreen-B7qJ90Np.js} +1 -1
  27. package/dist/client/assets/{BriefingsScreen-BerYOoWS.js → BriefingsScreen-CW6N829d.js} +1 -1
  28. package/dist/client/assets/{BrokerMetadataPanel-Cu93j-Ga.js → BrokerMetadataPanel-BhjECqOK.js} +1 -1
  29. package/dist/client/assets/{BrokerScreen-CeN90URH.js → BrokerScreen-X3z50712.js} +1 -1
  30. package/dist/client/assets/{ChatCollapsedStrip-DdKyMSEM.js → ChatCollapsedStrip-DNR9osDy.js} +1 -1
  31. package/dist/client/assets/{CodeDiffPane-BjCOBLze.js → CodeDiffPane-Bx_2VAzv.js} +1 -1
  32. package/dist/client/assets/{CodeProjectPicker-NSGdCaK0.js → CodeProjectPicker-C1yOJKvs.js} +1 -1
  33. package/dist/client/assets/{CodeScreen-CA9Sq6Dx.js → CodeScreen-CIKK1LcZ.js} +1 -1
  34. package/dist/client/assets/{ContextMenu-DnFcmfMR.js → ContextMenu-CHIuVKz7.js} +1 -1
  35. package/dist/client/assets/{ConversationComposer-CjRXFkvY.js → ConversationComposer-Bf7Ga_49.js} +1 -1
  36. package/dist/client/assets/{ConversationFeedRows-CgRTIpAv.js → ConversationFeedRows-Cm1Lgo43.js} +1 -1
  37. package/dist/client/assets/{ConversationHeader-CRmdtuL7.js → ConversationHeader-B_GXrKR0.js} +1 -1
  38. package/dist/client/assets/{ConversationPanels-DCkcLIHk.js → ConversationPanels-BTBbEvrP.js} +2 -2
  39. package/dist/client/assets/{ConversationScreen-Br0QQ3xo.js → ConversationScreen-B3l2m3JI.js} +1 -1
  40. package/dist/client/assets/{ConversationStatus-BJ1CMbAv.js → ConversationStatus-BqhUHD85.js} +1 -1
  41. package/dist/client/assets/{DataTable-Dzqiaha4.js → DataTable-CJbbgBdA.js} +1 -1
  42. package/dist/client/assets/{DispatchAftermath-B0WMg_z3.js → DispatchAftermath-BDA9CrOd.js} +1 -1
  43. package/dist/client/assets/{DocumentFocusViewer-CZVVIAD5.js → DocumentFocusViewer-B9vodVmG.js} +1 -1
  44. package/dist/client/assets/{EmbeddableSurfacesLab-C3a7hJWO.js → EmbeddableSurfacesLab-BdsYRDky.js} +1 -1
  45. package/dist/client/assets/{EmptyState-CYNJZMrZ.js → EmptyState-BRY5jTpz.js} +1 -1
  46. package/dist/client/assets/{FileViewerPane-Fwt8_KmD.js → FileViewerPane-9Bveqm9c.js} +1 -1
  47. package/dist/client/assets/{FleetSearch-Dsi_l2KW.js → FleetSearch-Bj9SCl2f.js} +1 -1
  48. package/dist/client/assets/{FlightObserveScreen-g_tiGmvz.js → FlightObserveScreen-BVMdsiCC.js} +1 -1
  49. package/dist/client/assets/{FollowScreen-Bb_rcrzi.js → FollowScreen-BifwHWOV.js} +1 -1
  50. package/dist/client/assets/{HarnessMark-DrE57dUq.js → HarnessMark-BPAphNjx.js} +1 -1
  51. package/dist/client/assets/{HarnessesScreen-CAsCJ_tG.js → HarnessesScreen-fMnbnrD4.js} +1 -1
  52. package/dist/client/assets/{HerdrSession-1eVu9Owj.js → HerdrSession-BujfGzrP.js} +1 -1
  53. package/dist/client/assets/{HomeHero-W445QrG1.js → HomeHero-BgM6S39l.js} +1 -1
  54. package/dist/client/assets/{KnowledgeSearchInspector-CbPVg3fr.js → KnowledgeSearchInspector-B4ZY24xE.js} +1 -1
  55. package/dist/client/assets/{KnowledgeSearchScreen-C1lN1xJk.js → KnowledgeSearchScreen-Ch_WENUC.js} +1 -1
  56. package/dist/client/assets/{LaneToolHoverCard-BkBcDYm-.js → LaneToolHoverCard-B7KdvQvf.js} +1 -1
  57. package/dist/client/assets/{LaneTraceDetailSheet-CzTd44rf.js → LaneTraceDetailSheet-H3AnN-vN.js} +1 -1
  58. package/dist/client/assets/{LaneTraceEventFocus-BmMmPTyJ.js → LaneTraceEventFocus-mkMw2wJU.js} +1 -1
  59. package/dist/client/assets/{MeshCanvas-DwkjsiJ5.js → MeshCanvas-CpKcWxKy.js} +1 -1
  60. package/dist/client/assets/{MeshCanvasMinimap-vmCpU1sD.js → MeshCanvasMinimap-C9IoGHbe.js} +1 -1
  61. package/dist/client/assets/{MeshScreen-CkMepUpT.js → MeshScreen-48QkJSDI.js} +1 -1
  62. package/dist/client/assets/{MeshTopologyView-BD2xLE2C.js → MeshTopologyView-DFzr0IZM.js} +2 -2
  63. package/dist/client/assets/{MessageComposerSuggestions-qbalTne_.js → MessageComposerSuggestions-FdVHnT_q.js} +1 -1
  64. package/dist/client/assets/{MessagesScreen-C8UynyLC.js → MessagesScreen-BMOOfbWX.js} +1 -1
  65. package/dist/client/assets/{MissionContextRail-D5MEP2f4.js → MissionContextRail-Y8QxUZGE.js} +1 -1
  66. package/dist/client/assets/{MissionControlView-K_I7eftL.js → MissionControlView-BpsHKu1F.js} +1 -1
  67. package/dist/client/assets/{MissionFocusOverlay-CWKLdUKG.js → MissionFocusOverlay-BPnAEA3F.js} +1 -1
  68. package/dist/client/assets/{MissionLeftAgentRow-ByGrNAcs.js → MissionLeftAgentRow-iOZ6ds9L.js} +1 -1
  69. package/dist/client/assets/{MissionLogPane-ZwHJ137T.js → MissionLogPane-B0csI89E.js} +1 -1
  70. package/dist/client/assets/{NewAgentModal-Do9aVvan.js → NewAgentModal-DBHJR9Qm.js} +1 -1
  71. package/dist/client/assets/{NewChatComposer-DKlNX1UA.js → NewChatComposer-Hd7pI5Ac.js} +1 -1
  72. package/dist/client/assets/{NewChatOrigin-DXPvX-hh.js → NewChatOrigin-DmuJ32wa.js} +1 -1
  73. package/dist/client/assets/{ObserveEmbedScreen-Dghsq2on.js → ObserveEmbedScreen-DyArn7Id.js} +1 -1
  74. package/dist/client/assets/{ObserveTextFlow-DWNlmTVm.js → ObserveTextFlow-CkMrtT8s.js} +2 -2
  75. package/dist/client/assets/{ObservedTopologyPanel-BlmGoxCE.js → ObservedTopologyPanel-CaSZZP05.js} +1 -1
  76. package/dist/client/assets/{OpenScoutAppShell-DDqQi-oe.js → OpenScoutAppShell-BtlKkiuF.js} +1 -1
  77. package/dist/client/assets/{OpsAgentsView-Bn_fGBdo.js → OpsAgentsView-CnqrwbC2.js} +1 -1
  78. package/dist/client/assets/OpsScreen-DOlmlVkP.js +1 -0
  79. package/dist/client/assets/OpsSubnav-Dj3ShAKv.js +1 -0
  80. package/dist/client/assets/{PlanView-B6gKo543.js → PlanView-BLGdWDx6.js} +1 -1
  81. package/dist/client/assets/ProjectAgentProfile-Dv1sVnQl.js +1 -0
  82. package/dist/client/assets/{ProjectAgentProfileBar-C5QWwZCn.js → ProjectAgentProfileBar-BLVg5EeA.js} +1 -1
  83. package/dist/client/assets/{ProjectAgentProfileHero-DC7Dd8VL.js → ProjectAgentProfileHero-0-GDhsPT.js} +1 -1
  84. package/dist/client/assets/{ProjectsInbox-DCLrDmj1.js → ProjectsInbox-B3DpAI5b.js} +1 -1
  85. package/dist/client/assets/{ProjectsRail-C4hiXYSb.js → ProjectsRail-BDl7U9Jq.js} +1 -1
  86. package/dist/client/assets/ProjectsScreen-Dl2FcGrR.js +1 -0
  87. package/dist/client/assets/{ProjectsThreadAside-DYmL2dCY.js → ProjectsThreadAside-BcGC5mHE.js} +1 -1
  88. package/dist/client/assets/{Provider-p-xuaAoE.js → Provider-cJCdHAxu.js} +1 -1
  89. package/dist/client/assets/{RailRow-bRkkXIpR.js → RailRow-CLcVmywd.js} +1 -1
  90. package/dist/client/assets/{RawSessionsTable-B7WKmXrk.js → RawSessionsTable-DBto4Ts-.js} +1 -1
  91. package/dist/client/assets/{RealtimeVoiceScreen-BzP3BQq9.js → RealtimeVoiceScreen-DXEU5v3g.js} +1 -1
  92. package/dist/client/assets/{RepoDiffEmbedScreen-xjzjcJ_c.js → RepoDiffEmbedScreen-BCDXFE3D.js} +1 -1
  93. package/dist/client/assets/{RepoDiffPageScreen-DRzIY-dk.js → RepoDiffPageScreen-m62FiWXC.js} +1 -1
  94. package/dist/client/assets/{RepoDiffViewer-CNDp01KM.js → RepoDiffViewer-PaNeZMhJ.js} +1 -1
  95. package/dist/client/assets/RepoDiffViewerLazy-CWE5GxMP.js +2 -0
  96. package/dist/client/assets/{ReposScreen-CpaLC_NU.js → ReposScreen-Cksv1cAD.js} +1 -1
  97. package/dist/client/assets/{ScoutDeckSurface-DkpZ-0DH.js → ScoutDeckSurface-BCjPl7C4.js} +1 -1
  98. package/dist/client/assets/{ScoutSurface-BENBUt5-.js → ScoutSurface-CkgT7A-c.js} +1 -1
  99. package/dist/client/assets/{ScoutbotBroadcastChip-CGZyxS5H.js → ScoutbotBroadcastChip-DkiRCHuK.js} +1 -1
  100. package/dist/client/assets/{ScoutbotFxLab-Bk2ZsfPp.js → ScoutbotFxLab-D-kV5j4T.js} +1 -1
  101. package/dist/client/assets/{ScoutbotRealtimeVoiceCall-n63LdBZs.js → ScoutbotRealtimeVoiceCall-1ixiEn1L.js} +1 -1
  102. package/dist/client/assets/{SecondaryNav-B4IsujYh.js → SecondaryNav-_wyKjwNf.js} +1 -1
  103. package/dist/client/assets/{SessionEmbedScreen-CPfH-jqN.js → SessionEmbedScreen-CJZmIBV7.js} +1 -1
  104. package/dist/client/assets/{SessionObserve-B-SkP3tu.js → SessionObserve-yYA8Gy5s.js} +1 -1
  105. package/dist/client/assets/{SessionObserveEvidence-CF5jnH3-.js → SessionObserveEvidence-cHdjYOJe.js} +1 -1
  106. package/dist/client/assets/{SessionRefScreen-C-4jjmVG.js → SessionRefScreen-OkTY7Szg.js} +1 -1
  107. package/dist/client/assets/SessionsScreen-B-GFjxIA.js +1 -0
  108. package/dist/client/assets/{SettingsDrawer-DATxwZrn.js → SettingsDrawer-Co11RFX0.js} +1 -1
  109. package/dist/client/assets/{SettingsScreen-Bu53X7J_.js → SettingsScreen-Cn09nq5_.js} +1 -1
  110. package/dist/client/assets/{ShikiPane-DH8yYDks.js → ShikiPane-dBS9hD-z.js} +1 -1
  111. package/dist/client/assets/{SlidePanel-RFXJpfUa.js → SlidePanel-CH-3-8_2.js} +1 -1
  112. package/dist/client/assets/{SpriteAvatar-CEYdCzem.js → SpriteAvatar-DS6Tmyua.js} +1 -1
  113. package/dist/client/assets/{StatusPill-9uy70ttd.js → StatusPill-C8m9ZymF.js} +1 -1
  114. package/dist/client/assets/{TailView-6bIrgdxN.js → TailView-B0BSopPs.js} +1 -1
  115. package/dist/client/assets/{Terminal-BI6km7H4.js → Terminal-U8gjIdm3.js} +1 -1
  116. package/dist/client/assets/{TerminalEmbedScreen-D4JOWwtm.js → TerminalEmbedScreen-CTmdE7us.js} +1 -1
  117. package/dist/client/assets/{TextDocumentSurface-BcP9vvji.js → TextDocumentSurface-BWJCGBZf.js} +1 -1
  118. package/dist/client/assets/{TmuxPeek-IaWqCgyJ.js → TmuxPeek-B4QdHbGm.js} +1 -1
  119. package/dist/client/assets/{VoicePermissionsPanel-C80iZxgy.js → VoicePermissionsPanel-Dd4ITJy_.js} +1 -1
  120. package/dist/client/assets/{WorkDetailScreen-CweZ6fEd.js → WorkDetailScreen-mJs0mb99.js} +1 -1
  121. package/dist/client/assets/{WorkFilesViewer-Dy_-06iI.js → WorkFilesViewer-ODzLXKxj.js} +1 -1
  122. package/dist/client/assets/{activity-DS0u0Itf.js → activity-CC8JzJNH.js} +1 -1
  123. package/dist/client/assets/{addon-fit-CN888B3D.js → addon-fit-CaZ-uLrg.js} +1 -1
  124. package/dist/client/assets/{addon-webgl-CoAnanQS.js → addon-webgl-B8utL3bM.js} +1 -1
  125. package/dist/client/assets/{agent-essentials-CuK4G_zS.js → agent-essentials-B3wcxg_v.js} +1 -1
  126. package/dist/client/assets/{arc.es-BET9ev6q.js → arc.es-uFv9UrHn.js} +1 -1
  127. package/dist/client/assets/{arrow-down-DxxPnPwh.js → arrow-down-w1HPzDSE.js} +1 -1
  128. package/dist/client/assets/{arrow-left-CXDkJuCg.js → arrow-left-B-3GJ7ct.js} +1 -1
  129. package/dist/client/assets/{arrow-up-right-Bj8RjSqW.js → arrow-up-right-G6bJXxhK.js} +1 -1
  130. package/dist/client/assets/{bot-BSGSicKC.js → bot-DzCOGKi6.js} +1 -1
  131. package/dist/client/assets/{check-BfA0T8UD.js → check-BX8nRgop.js} +1 -1
  132. package/dist/client/assets/{chevron-down-BVg09D6U.js → chevron-down-B3VVRJcV.js} +1 -1
  133. package/dist/client/assets/{chevron-right-CaEwYkxE.js → chevron-right-BYMV1511.js} +1 -1
  134. package/dist/client/assets/{chunk-HRAB3GC3-HhKwnZCi.js → chunk-HRAB3GC3-dRd2eQMJ.js} +1 -1
  135. package/dist/client/assets/{chunk-JTPDIGGW-DX2eTIQ_.js → chunk-JTPDIGGW-BjX67kHU.js} +3 -3
  136. package/dist/client/assets/{chunk-T65CQEWV-D-bOfuCH.js → chunk-T65CQEWV-kP6nJjkU.js} +1 -1
  137. package/dist/client/assets/{chunk-YOZR3KYS-oS9dlQCI.js → chunk-YOZR3KYS-C13bZPVd.js} +1 -1
  138. package/dist/client/assets/{clock-C3TUL7D7.js → clock-B9ukVaVn.js} +1 -1
  139. package/dist/client/assets/{code-xml-Dbvjk9Kw.js → code-xml-BFc3TMSm.js} +1 -1
  140. package/dist/client/assets/{content-CiOMtgQc.js → content-B8gahuBy.js} +1 -1
  141. package/dist/client/assets/content-BIqX06OQ.js +1 -0
  142. package/dist/client/assets/content-BKDZ6Fxe.js +1 -0
  143. package/dist/client/assets/content-C15Ya-iu.js +1 -0
  144. package/dist/client/assets/content-CDE9tJDF.js +1 -0
  145. package/dist/client/assets/content-CSAfI-PX.js +1 -0
  146. package/dist/client/assets/content-CTF9D60D.js +1 -0
  147. package/dist/client/assets/{content-CJuH5cDP.js → content-CbAGkYQO.js} +1 -1
  148. package/dist/client/assets/content-CtqLJOVp.js +1 -0
  149. package/dist/client/assets/content-Dvs1KRfo.js +1 -0
  150. package/dist/client/assets/content-DyJdVZjI.js +1 -0
  151. package/dist/client/assets/{content-C2TZOKSE.js → content-Ji7ATaf7.js} +1 -1
  152. package/dist/client/assets/content-eqZXKWcP.js +1 -0
  153. package/dist/client/assets/content-iyyQKwvA.js +1 -0
  154. package/dist/client/assets/content-pDE7Fpb9.js +1 -0
  155. package/dist/client/assets/content-pPSd2dua.js +1 -0
  156. package/dist/client/assets/{conversation-icons-DmC_Ak3z.js → conversation-icons-gpsv650H.js} +1 -1
  157. package/dist/client/assets/conversation-motion-features-DXtKlmuM.js +1 -0
  158. package/dist/client/assets/{copy-C79v_7D-.js → copy-BFmOcWof.js} +1 -1
  159. package/dist/client/assets/{createLucideIcon-DCq_3fQn.js → createLucideIcon-CFBn0Sdk.js} +1 -1
  160. package/dist/client/assets/{discover-IEnbrH8_.js → discover-DKf0aTr_.js} +2 -2
  161. package/dist/client/assets/embed-entry-RlQUTtc4.js +2 -0
  162. package/dist/client/assets/{external-link-Dd8xaveL.js → external-link-B1TI5yIt.js} +1 -1
  163. package/dist/client/assets/{eye-DkU59kfl.js → eye-1J4yOUoG.js} +1 -1
  164. package/dist/client/assets/{file-text-BITQqGtF.js → file-text-DcYSrI4v.js} +1 -1
  165. package/dist/client/assets/{gestures-B5rLNRpi.js → gestures-CcEOV6Sr.js} +1 -1
  166. package/dist/client/assets/{home-moving-signal-Bs635mVw.js → home-moving-signal-Bh2FugbH.js} +1 -1
  167. package/dist/client/assets/{home-now-card-VxlLjg1A.js → home-now-card-ByRH5fFx.js} +1 -1
  168. package/dist/client/assets/{home-now-card-nano-C06GMiwD.js → home-now-card-nano-y1EhBvVL.js} +1 -1
  169. package/dist/client/assets/{hooks-BWiLxTw1.js → hooks-DUZwL3Aq.js} +1 -1
  170. package/dist/client/assets/index-BBznYVWk.css +1 -0
  171. package/dist/client/assets/{index-BTj2MguM.js → index-BTuq-8Iv.js} +1 -1
  172. package/dist/client/assets/index-CmwGCxUk.js +1 -0
  173. package/dist/client/assets/{index-BZovGpDk.js → index-DmFAhGPj.js} +2 -2
  174. package/dist/client/assets/{index-vbaJ8sin.js → index-Dtaswdsh.js} +1 -1
  175. package/dist/client/assets/{inspector-panel-C96HcyK5.js → inspector-panel-DzgS5_Mv.js} +1 -1
  176. package/dist/client/assets/{keyboard-nav-CHo_xmjw.js → keyboard-nav-h1IdakpD.js} +1 -1
  177. package/dist/client/assets/{lane-roster-store-B6ybJlHJ.js → lane-roster-store-71vFgAem.js} +1 -1
  178. package/dist/client/assets/{left-DMJkmJOF.js → left-8NITBvFX.js} +1 -1
  179. package/dist/client/assets/{left-COMAiMfB.js → left-B2HEqrTM.js} +1 -1
  180. package/dist/client/assets/{left-C6Zj3cR4.js → left-CTYUvXbe.js} +1 -1
  181. package/dist/client/assets/{left-BuJ0wJW1.js → left-CwDRT50z.js} +1 -1
  182. package/dist/client/assets/{left-l92tw5Kc.js → left-CxlDLJlw.js} +1 -1
  183. package/dist/client/assets/{left-Ce4WKYPK.js → left-XFXxNd4g.js} +1 -1
  184. package/dist/client/assets/{left-agents-BuSyVNGE.js → left-agents-Ck4Xn-R8.js} +1 -1
  185. package/dist/client/assets/{left-default-DRHywOKX.js → left-default-BeOyS0bR.js} +1 -1
  186. package/dist/client/assets/{left-lanes-4-aUyyrV.js → left-lanes-DZp3jJMo.js} +1 -1
  187. package/dist/client/assets/{left-mission-e849d_Td.js → left-mission-CuKFQ5xL.js} +1 -1
  188. package/dist/client/assets/left-p1hkO6P0.js +1 -0
  189. package/dist/client/assets/{left-plan-MchYwAB_.js → left-plan-3rrFENhp.js} +1 -1
  190. package/dist/client/assets/{library-DygjpA6u.js → library-E--gKzEZ.js} +1 -1
  191. package/dist/client/assets/{loader-circle-B-l2Wj3-.js → loader-circle-d6PKL_KD.js} +1 -1
  192. package/dist/client/assets/{local-agents-Wof5knTJ.js → local-agents-B5pq17tZ.js} +1 -1
  193. package/dist/client/assets/{mentions-BjXfeF7t.js → mentions-agCGDgyA.js} +1 -1
  194. package/dist/client/assets/{mesh-ops-C1gq8zKf.js → mesh-ops-5pZCYptW.js} +1 -1
  195. package/dist/client/assets/{mesh-view-store-B56D3f77.js → mesh-view-store-KJzABIkN.js} +1 -1
  196. package/dist/client/assets/{message-circle-BwVx5X0q.js → message-circle-CJO-pi7b.js} +1 -1
  197. package/dist/client/assets/{message-markup-DlVX-iuc.js → message-markup-CyRDLdOn.js} +1 -1
  198. package/dist/client/assets/{message-square-BnkG6tae.js → message-square-D1hMsMj_.js} +1 -1
  199. package/dist/client/assets/{mission-control-store-CMgIVjLJ.js → mission-control-store-Ce6dOvnZ.js} +1 -1
  200. package/dist/client/assets/{observe-DVHAcIrv.js → observe-BSWVM8YA.js} +1 -1
  201. package/dist/client/assets/{page-status-Bg2hd27j.js → page-status-D2FQLJOX.js} +1 -1
  202. package/dist/client/assets/{paperclip-DblaLD_N.js → paperclip-iZmDMOS5.js} +1 -1
  203. package/dist/client/assets/{plus-BAI0t5g9.js → plus-gZ0T0eBI.js} +1 -1
  204. package/dist/client/assets/{profile-3Q4sUtvJ.js → profile-Dxj3VVOM.js} +1 -1
  205. package/dist/client/assets/{projects-inbox-Da2hYEn6.js → projects-inbox-Dzt_GQDv.js} +1 -1
  206. package/dist/client/assets/{radio-BGtkyCG9.js → radio-RMLfV4EO.js} +1 -1
  207. package/dist/client/assets/{refresh-cw-DtF8xPqX.js → refresh-cw-C4x1x6b_.js} +1 -1
  208. package/dist/client/assets/resolve-panes-C9gF0w4e.js +1 -0
  209. package/dist/client/assets/resolve-sidebar-context-DxbY5RCH.js +1 -0
  210. package/dist/client/assets/{right-Dd2DscRz.js → right-5L7Tn0zG.js} +1 -1
  211. package/dist/client/assets/{right-BU_W1kSH.js → right-CYtkMmRu.js} +1 -1
  212. package/dist/client/assets/{right-CUP-NIDG.js → right-CreoQzPP.js} +1 -1
  213. package/dist/client/assets/{right-c4PAdFYZ.js → right-D-k9Z1Fe.js} +1 -1
  214. package/dist/client/assets/{right-ByptvkVX.js → right-D9xFfy2b.js} +1 -1
  215. package/dist/client/assets/{right-BlR7h0US.js → right-DI7zHADe.js} +1 -1
  216. package/dist/client/assets/{right-BwgwTGGd.js → right-DUbJ3WVc.js} +1 -1
  217. package/dist/client/assets/{right-DmVHd8Xj.js → right-DiybhsiK.js} +1 -1
  218. package/dist/client/assets/{right-Ch_jrNe2.js → right-Jh_1Q88s.js} +1 -1
  219. package/dist/client/assets/{right-B8qg3JdB.js → right-udr1qTJG.js} +1 -1
  220. package/dist/client/assets/{rocket-BWh18pt_.js → rocket-CMM-IdLy.js} +1 -1
  221. package/dist/client/assets/{router-63XV_E7f.js → router-Cn_s9IGH.js} +1 -1
  222. package/dist/client/assets/{runtime-picker-BXKJbLot.js → runtime-picker--IW3cRry.js} +1 -1
  223. package/dist/client/assets/{scope-views-Dm2_-NPi.js → scope-views-BIfMTXU4.js} +1 -1
  224. package/dist/client/assets/{scout-voice-D8Q5sZOL.js → scout-voice-CwbOz6EN.js} +1 -1
  225. package/dist/client/assets/{scroll-text-DZb3mmYo.js → scroll-text-DPPYrqB9.js} +1 -1
  226. package/dist/client/assets/{search-1QMVOxF3.js → search-DAyagUtF.js} +1 -1
  227. package/dist/client/assets/{secondaryNavConfig-c0cz3MkJ.js → secondaryNavConfig-Dw3gS1jR.js} +1 -1
  228. package/dist/client/assets/{selection-bridge-O9C4kGfF.js → selection-bridge-BXw09aRF.js} +1 -1
  229. package/dist/client/assets/{send-horizontal-DbyEkGql.js → send-horizontal-IcG46D2M.js} +1 -1
  230. package/dist/client/assets/{server-Bncn9S7r.js → server-BySujhDV.js} +1 -1
  231. package/dist/client/assets/{session-catalog-DC6BlBBC.js → session-catalog-ClS9xf6i.js} +1 -1
  232. package/dist/client/assets/{session-table-BUPq9Viy.js → session-table-BdpHs1GN.js} +1 -1
  233. package/dist/client/assets/{sliders-horizontal-CMe8Bay1.js → sliders-horizontal-R5pWUUcH.js} +1 -1
  234. package/dist/client/assets/{sparkles-_7cTZsIH.js → sparkles-DJOBD_8l.js} +1 -1
  235. package/dist/client/assets/{sse-Bb0EOcU9.js → sse-CxXt4tqI.js} +1 -1
  236. package/dist/client/assets/{tail-events-C12pfUax.js → tail-events-BdvqZHLr.js} +1 -1
  237. package/dist/client/assets/{terminal-xGf_F3y7.js → terminal-DJPUp_Qn.js} +1 -1
  238. package/dist/client/assets/{terminal-relay-BgfVJXIL.js → terminal-relay-TffuSPGs.js} +1 -1
  239. package/dist/client/assets/{terminal-takeover--05EYhJm.js → terminal-takeover-BOFPRPjR.js} +1 -1
  240. package/dist/client/assets/{use-conversation-list-DWX02INv.js → use-conversation-list-C-dPcjQe.js} +1 -1
  241. package/dist/client/assets/{use-fleet-active-asks-Cnwa4hTK.js → use-fleet-active-asks-BHzeBZSW.js} +1 -1
  242. package/dist/client/assets/{use-mesh-ops-items-BRFm37oY.js → use-mesh-ops-items-KmaauBr_.js} +1 -1
  243. package/dist/client/assets/{use-reduced-motion-C8cWvIZ3.js → use-reduced-motion-CYqhYqHO.js} +1 -1
  244. package/dist/client/assets/{use-scout-dev-flags-FkMreOOb.js → use-scout-dev-flags-BJbw87PK.js} +1 -1
  245. package/dist/client/assets/{useAgentHoverCard-DvPZSJK3.js → useAgentHoverCard-C6o0tlat.js} +1 -1
  246. package/dist/client/assets/useContentSecondaryNav-DjHBrgnS.js +1 -0
  247. package/dist/client/assets/{usePierreRuntime-C8WJ0X3F.js → usePierreRuntime-Cm7-qdm0.js} +1 -1
  248. package/dist/client/assets/{wrench-_tHBGTop.js → wrench-CvRjjByE.js} +1 -1
  249. package/dist/client/assets/{x-CrGUKNRv.js → x-C8ayPBtj.js} +1 -1
  250. package/dist/client/assets/{xterm-Ks-VlLTq.js → xterm-B0ci4Q9a.js} +1 -1
  251. package/dist/client/index.html +2 -2
  252. package/dist/main.mjs +348 -254
  253. package/dist/scout-web-server.mjs +2 -96660
  254. package/package.json +3 -3
  255. package/dist/client/assets/AgentLanesEmbedScreen-Br7cmZVO.js +0 -1
  256. package/dist/client/assets/AgentsSubnav-BV0WAgzf.js +0 -1
  257. package/dist/client/assets/OpsScreen-DHnT-Q9R.js +0 -1
  258. package/dist/client/assets/OpsSubnav-CJRD7MjM.js +0 -1
  259. package/dist/client/assets/ProjectAgentProfile-Be1VOkI4.js +0 -1
  260. package/dist/client/assets/ProjectsScreen-jruZRjgD.js +0 -1
  261. package/dist/client/assets/RepoDiffViewerLazy-b6vjYxez.js +0 -2
  262. package/dist/client/assets/SessionsScreen-HAjFvmIq.js +0 -1
  263. package/dist/client/assets/content-BQuEedeL.js +0 -1
  264. package/dist/client/assets/content-BUae-L_N.js +0 -1
  265. package/dist/client/assets/content-BfG98J1k.js +0 -1
  266. package/dist/client/assets/content-BkVTfkAC.js +0 -1
  267. package/dist/client/assets/content-BsNMos_d.js +0 -1
  268. package/dist/client/assets/content-CCn98eSk.js +0 -1
  269. package/dist/client/assets/content-CYnPp9yo.js +0 -1
  270. package/dist/client/assets/content-CcrUhm4P.js +0 -1
  271. package/dist/client/assets/content-CxuVONeQ.js +0 -1
  272. package/dist/client/assets/content-Dmq9n1_L.js +0 -1
  273. package/dist/client/assets/content-DskHP2NI.js +0 -1
  274. package/dist/client/assets/content-DvvzL2HK.js +0 -1
  275. package/dist/client/assets/content-snCAUbwv.js +0 -1
  276. package/dist/client/assets/conversation-motion-features-DPiGTO21.js +0 -1
  277. package/dist/client/assets/embed-entry-XUPb-AzL.js +0 -2
  278. package/dist/client/assets/index-9as_JTUs.css +0 -1
  279. package/dist/client/assets/index-DiiEQwdc.js +0 -1
  280. package/dist/client/assets/left-DrCbY6ja.js +0 -1
  281. package/dist/client/assets/resolve-panes-D4tlKNCT.js +0 -1
  282. package/dist/client/assets/resolve-sidebar-context-B27lj3Ci.js +0 -1
  283. package/dist/client/assets/useContentSecondaryNav-CNlrhvvx.js +0 -1
@@ -1 +1 @@
1
- import{j as e,r as o}from"./index-BZovGpDk.js";import{b as D}from"./Provider-p-xuaAoE.js";import{L as h}from"./loader-circle-B-l2Wj3-.js";import{R as z}from"./radio-BGtkyCG9.js";import{M as B,b as H}from"./DocumentFocusViewer-CZVVIAD5.js";import{C as q}from"./chevron-down-BVg09D6U.js";import{c as u}from"./createLucideIcon-DCq_3fQn.js";import{P as I}from"./plus-BAI0t5g9.js";import{S as K}from"./runtime-picker-BXKJbLot.js";const U=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],F=u("history",U);const Q=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],Y=u("list-tree",Q);const G=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],J=u("play",G);const X=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Z=u("settings-2",X),x="rounded-lg bg-[color-mix(in_srgb,var(--hud-ink)_4.5%,transparent)]",$="rounded-md border border-[color-mix(in_srgb,var(--hud-ink)_10%,transparent)] bg-[color-mix(in_srgb,var(--hud-bg)_70%,transparent)] text-[var(--scout-chrome-ink-strong)] outline-none transition-colors focus:border-lime-300/45",y="rounded-md border border-[color-mix(in_srgb,var(--hud-ink)_8%,transparent)] text-[var(--scout-chrome-ink)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink-strong)] disabled:cursor-not-allowed disabled:opacity-40",N="font-mono text-xs uppercase tracking-[0.11em] text-[var(--scout-chrome-ink-ghost)]";function ee(r){return r==="live"?{label:"Live",detail:"Listening — speak naturally",chip:"border-lime-300/35 bg-lime-300/[0.10] text-lime-100",iconWrap:"border-lime-300/40 bg-lime-300/[0.10] text-lime-200"}:r==="connecting"?{label:"Connecting",detail:"Opening secure audio…",chip:"border-amber-300/30 bg-amber-300/[0.09] text-amber-100/90",iconWrap:"border-amber-300/35 bg-amber-300/[0.09] text-amber-100"}:r==="error"?{label:"Error",detail:"Could not hold the call",chip:"border-red-400/35 bg-red-400/[0.10] text-red-100",iconWrap:"border-red-400/35 bg-red-400/[0.10] text-red-100"}:r==="ended"?{label:"Ended",detail:"Call closed — start again anytime",chip:"border-[color-mix(in_srgb,var(--hud-ink)_12%,transparent)] text-[var(--scout-chrome-ink-faint)]",iconWrap:"border-[color-mix(in_srgb,var(--hud-ink)_10%,transparent)] bg-[color-mix(in_srgb,var(--hud-ink)_4%,transparent)] text-[var(--scout-chrome-ink-faint)]"}:{label:"Ready",detail:"Talk continuously with Scoutbot",chip:"border-transparent bg-[color-mix(in_srgb,var(--hud-ink)_6%,transparent)] text-[var(--scout-chrome-ink-faint)]",iconWrap:"border-transparent bg-[color-mix(in_srgb,var(--hud-ink)_5%,transparent)] text-[var(--scout-chrome-ink-faint)]"}}function ue({state:r,onMinimize:a,onExpand:n,layout:p="compact"}){const i=ee(r),s=p==="page";return e.jsxs("header",{className:`flex items-start ${s?"gap-3.5 px-5 py-4":"gap-2.5 px-3.5 py-3"}`,children:[e.jsx("div",{className:`${s?"size-9":"size-7"} mt-px flex shrink-0 items-center justify-center rounded-md border ${i.iconWrap}`,children:r==="connecting"?e.jsx(h,{size:s?14:12,className:"animate-spin"}):r==="live"?e.jsxs("span",{className:"relative flex size-2",children:[e.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-lime-300/35"}),e.jsx("span",{className:"relative inline-flex size-2 rounded-full bg-lime-300/90"})]}):e.jsx(z,{size:s?14:12})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("h2",{className:`truncate font-medium text-[var(--scout-chrome-ink-strong)] ${s?"text-2xl":"text-base"}`,children:"Live voice"}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsx("span",{className:`rounded border px-1.5 py-px font-mono text-xs uppercase tracking-[0.1em] ${i.chip}`,children:i.label}),n&&e.jsx("button",{type:"button",onClick:n,title:s?"Return to compact live voice view":"Open full live voice view","aria-label":s?"Return to compact live voice view":"Open full live voice view",className:"flex size-6 items-center justify-center rounded-md text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink-strong)]",children:s?e.jsx(B,{size:12}):e.jsx(H,{size:12})}),a&&e.jsx("button",{type:"button",onClick:a,title:"Collapse live voice into the status bar","aria-label":"Collapse live voice into the status bar",className:"flex size-6 items-center justify-center rounded-md text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink-strong)]",children:e.jsx(q,{size:12})})]})]}),e.jsx("p",{className:`mt-0.5 leading-snug text-[var(--scout-chrome-ink-faint)] ${s?"text-base":"text-sm"}`,children:i.detail})]})]})}function pe({dictationActive:r,layout:a="compact"}){const{state:n,error:p,trace:i,chatState:s,sessionAction:v,startCall:M,endCall:L,startNewChat:E,switchChat:T,updatePreferredModel:R,clearTrace:O,openVoiceSettings:P}=D(),b=n==="connecting"||n==="live",[g,V]=o.useState("controls"),w=se(p),m=a==="page",[c,f]=o.useState(""),[k,W]=o.useState(!1),[l,C]=o.useState(!1),[S,d]=o.useState(null);o.useEffect(()=>{!l&&s?.config.model&&f(s.config.model)},[s?.config.model,l]);const _=async()=>{if(!(!c.trim()||l)){C(!0),d(null);try{const t=await R(c);f(t),d("Saved")}catch(t){d(t instanceof Error?t.message:"Could not save model.")}finally{C(!1)}}},j=n==="connecting"?{label:"Cancel connection",icon:e.jsx(h,{size:11,className:"animate-spin"}),tone:"border-amber-300/35 bg-amber-300/[0.10] text-amber-100 hover:bg-amber-300/[0.16]"}:n==="live"?{label:"End live voice",icon:e.jsx(K,{size:9,className:"fill-current"}),tone:"border-red-400/35 bg-red-400/[0.10] text-red-100 hover:bg-red-400/[0.16]"}:{label:"Start live voice",icon:e.jsx(J,{size:10,className:"fill-current"}),tone:"border-lime-300/40 bg-lime-300/[0.12] text-lime-100 hover:bg-lime-300/[0.18]"};return e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[e.jsx("nav",{className:`grid shrink-0 grid-cols-2 border-b border-[var(--scout-chrome-border-soft)] ${m?"px-5":"px-3.5"}`,"aria-label":"Live voice views",children:[{id:"controls",label:"Controls",icon:e.jsx(z,{size:11})},{id:"activity",label:"Activity",icon:e.jsx(Y,{size:11})}].map(t=>e.jsxs("button",{type:"button",onClick:()=>V(t.id),"aria-current":g===t.id,className:`-mb-px flex items-center justify-center gap-1.5 border-b-2 font-mono uppercase tracking-[0.1em] transition-colors ${m?"h-11 text-sm":"h-9 text-xs"} ${g===t.id?"border-lime-300/80 text-[var(--scout-chrome-ink-strong)]":"border-transparent text-[var(--scout-chrome-ink-faint)] hover:text-[var(--scout-chrome-ink-strong)]"}`,children:[t.icon,t.label,t.id==="activity"&&i.length>0&&e.jsx("span",{className:"rounded-full bg-[color-mix(in_srgb,var(--hud-ink)_10%,transparent)] px-1.5 py-px font-mono text-xs text-[var(--scout-chrome-ink-faint)]",children:i.length})]},t.id))}),g==="activity"?e.jsxs("div",{className:`flex min-h-0 flex-1 flex-col ${m?"p-5":"p-3.5"}`,children:[e.jsxs("div",{className:"mb-2 flex shrink-0 items-center justify-between",children:[e.jsx("p",{className:N,children:"Session activity"}),i.length>0&&e.jsx("button",{type:"button",onClick:O,className:"font-mono text-xs uppercase tracking-[0.09em] text-[var(--scout-chrome-ink-ghost)] transition-colors hover:text-[var(--scout-chrome-ink-strong)]",children:"Clear"})]}),i.length===0?e.jsx("div",{className:"flex flex-1 items-center justify-center rounded-lg border border-dashed border-[color-mix(in_srgb,var(--hud-ink)_10%,transparent)] px-6 text-center text-sm leading-relaxed text-[var(--scout-chrome-ink-faint)]",children:"Start a call to record requests, replies, navigation attempts, and delivery results."}):e.jsx("ol",{className:`min-h-0 flex-1 overflow-y-auto ${x}`,children:i.map((t,A)=>e.jsxs("li",{className:`px-2.5 py-2 ${A>0?"border-t border-[var(--scout-chrome-border-soft)]":""}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-1.5",children:[e.jsx("span",{className:`mt-px shrink-0 rounded border px-1 py-px font-mono text-xs uppercase tracking-[0.08em] ${ie(t.kind)}`,children:re(t.kind)}),e.jsx("span",{className:"min-w-0 text-sm leading-snug text-[var(--scout-chrome-ink-strong)]",children:t.label})]}),e.jsx("time",{className:"shrink-0 font-mono text-xs text-[var(--scout-chrome-ink-ghost)]",children:te(t.at)})]}),t.detail&&e.jsx("span",{className:"mt-1 block whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-[var(--scout-chrome-ink-faint)]",children:t.detail})]},t.id))})]}):e.jsxs("div",{className:`flex min-h-0 w-full flex-1 flex-col overflow-y-auto ${m?"mx-auto max-w-2xl gap-4 p-5":"gap-2.5 p-3.5"}`,children:[e.jsxs("section",{className:`${x} shrink-0 p-3`,children:[e.jsx("p",{className:"text-base font-medium text-[var(--scout-chrome-ink-strong)]",children:"Live conversation"}),e.jsx("p",{className:"mt-0.5 text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:n==="live"?"Microphone and spoken replies are active.":n==="connecting"?"Opening the audio connection…":"Start when you are ready to speak."}),e.jsxs("button",{type:"button",disabled:r&&!b,onClick:()=>{b?L():M()},className:`mt-3 flex h-9 w-full items-center justify-center gap-2 rounded-md border font-mono text-sm uppercase tracking-[0.1em] transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${j.tone}`,children:[j.icon,j.label]}),r&&!b&&e.jsx("p",{className:"mt-2 text-xs leading-relaxed text-amber-200/80",children:"Finish dictation before starting a live call."}),w&&e.jsx("p",{className:"mt-2 rounded-md border border-red-400/30 bg-red-400/[0.08] px-2 py-1.5 text-sm leading-relaxed text-red-100",children:w})]}),e.jsxs("section",{className:`${x} shrink-0 p-3`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(F,{size:11,className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]"}),e.jsx("p",{className:N,children:"Live chat"})]}),e.jsx("p",{className:"mt-1.5 truncate text-base text-[var(--scout-chrome-ink-strong)]",title:s?.session.id,children:s?.session.title||"Loading chat…"}),e.jsx("p",{className:"mt-0.5 text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Context stays with this chat when voice stops or the panel closes."}),e.jsxs("div",{className:"mt-2.5 flex min-w-0 items-center gap-1.5",children:[s&&s.sessions.length>1&&e.jsxs("label",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"sr-only",children:"Switch live chat"}),e.jsx("select",{value:s.session.id,disabled:!!v,onChange:t=>{T(t.target.value)},className:`h-8 w-full min-w-0 px-2 font-mono text-sm disabled:cursor-wait disabled:opacity-50 ${$}`,title:"Switch live chat; an active voice connection will end",children:s.sessions.map(t=>e.jsxs("option",{value:t.id,children:[t.title||`Chat ${t.id.slice(0,8)}`," · ",t.messageCount," msg"]},t.id))})]}),e.jsxs("button",{type:"button",onClick:()=>{E()},disabled:!s||!!v,title:"Start a new chat; an active voice connection will end",className:`flex h-8 shrink-0 items-center justify-center gap-1.5 px-2.5 font-mono text-xs uppercase tracking-[0.09em] disabled:cursor-wait ${y}`,children:[v==="new"?e.jsx(h,{size:10,className:"animate-spin"}):e.jsx(I,{size:10}),"New chat"]})]})]}),e.jsxs("section",{className:`${x} shrink-0 p-3`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:N,children:"Scoutbot reply model"}),e.jsx("p",{className:"mt-1 truncate font-mono text-base text-[var(--scout-chrome-ink-strong)]",children:s?.config.model||"—"})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[s?.config.provider&&e.jsx("span",{className:"font-mono text-xs uppercase tracking-[0.08em] text-[var(--scout-chrome-ink-ghost)]",children:s.config.provider}),e.jsx("button",{type:"button",onClick:()=>{d(null),W(t=>!t)},"aria-expanded":k,className:`flex h-7 items-center px-2 font-mono text-xs uppercase tracking-[0.09em] ${y}`,children:k?"Close":"Change"})]})]}),k&&e.jsxs("div",{className:"mt-2.5 border-t border-[var(--scout-chrome-border-soft)] pt-2.5",children:[e.jsx("p",{className:"text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Used for typed and live Scoutbot replies."}),e.jsxs("div",{className:"mt-2 flex gap-1.5",children:[e.jsx("input",{value:c,onChange:t=>{f(t.target.value),d(null)},onKeyDown:t=>{t.key==="Enter"&&_()},placeholder:"gpt-4.1-mini","aria-label":"Preferred Scoutbot model",className:`h-8 min-w-0 flex-1 px-2 font-mono text-sm ${$}`}),e.jsx("button",{type:"button",onClick:()=>{_()},disabled:l||!c.trim()||c.trim()===s?.config.model,className:`flex h-8 min-w-14 items-center justify-center px-2 font-mono text-xs uppercase tracking-[0.09em] ${y}`,children:l?e.jsx(h,{size:10,className:"animate-spin"}):"Apply"})]}),S&&e.jsx("p",{className:"mt-1.5 font-mono text-xs text-[var(--scout-chrome-ink-faint)]",children:S})]})]}),e.jsxs("button",{type:"button",onClick:P,className:"mt-auto flex h-8 w-full shrink-0 items-center justify-center gap-1.5 rounded-md font-mono text-xs uppercase tracking-[0.09em] text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink-strong)]",children:[e.jsx(Z,{size:11}),"Voice settings"]})]})]})}function te(r){return new Date(r).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function se(r){if(!r)return null;const a=r.toLowerCase();return a.includes("active response in progress")||a.includes("conversation already has an active response")?null:a.includes("realtime voice call is already active")?"Live voice is still running on this Scout host. Stop it from the footer, or wait a moment for it to finish closing.":r}function re(r){switch(r){case"navigation":return"Navigate";case"scoutbot":return"Scoutbot";case"agent":return"Agent ask";case"error":return"Error";default:return"Voice"}}function ie(r){switch(r){case"navigation":return"border-sky-300/25 bg-sky-300/[0.06] text-sky-100/80";case"scoutbot":return"border-violet-300/25 bg-violet-300/[0.06] text-violet-100/80";case"agent":return"border-amber-300/25 bg-amber-300/[0.06] text-amber-100/80";case"error":return"border-red-300/25 bg-red-300/[0.06] text-red-100/80";default:return"border-lime-300/20 bg-lime-300/[0.05] text-lime-100/70"}}export{F as H,J as P,ue as S,pe as a};
1
+ import{j as e,r as o}from"./index-DmFAhGPj.js";import{b as D}from"./Provider-cJCdHAxu.js";import{L as h}from"./loader-circle-d6PKL_KD.js";import{R as z}from"./radio-RMLfV4EO.js";import{M as B,b as H}from"./DocumentFocusViewer-B9vodVmG.js";import{C as q}from"./chevron-down-B3VVRJcV.js";import{c as u}from"./createLucideIcon-CFBn0Sdk.js";import{P as I}from"./plus-gZ0T0eBI.js";import{S as K}from"./runtime-picker--IW3cRry.js";const U=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],F=u("history",U);const Q=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],Y=u("list-tree",Q);const G=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],J=u("play",G);const X=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Z=u("settings-2",X),x="rounded-lg bg-[color-mix(in_srgb,var(--hud-ink)_4.5%,transparent)]",$="rounded-md border border-[color-mix(in_srgb,var(--hud-ink)_10%,transparent)] bg-[color-mix(in_srgb,var(--hud-bg)_70%,transparent)] text-[var(--scout-chrome-ink-strong)] outline-none transition-colors focus:border-lime-300/45",y="rounded-md border border-[color-mix(in_srgb,var(--hud-ink)_8%,transparent)] text-[var(--scout-chrome-ink)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink-strong)] disabled:cursor-not-allowed disabled:opacity-40",N="font-mono text-xs uppercase tracking-[0.11em] text-[var(--scout-chrome-ink-ghost)]";function ee(r){return r==="live"?{label:"Live",detail:"Listening — speak naturally",chip:"border-lime-300/35 bg-lime-300/[0.10] text-lime-100",iconWrap:"border-lime-300/40 bg-lime-300/[0.10] text-lime-200"}:r==="connecting"?{label:"Connecting",detail:"Opening secure audio…",chip:"border-amber-300/30 bg-amber-300/[0.09] text-amber-100/90",iconWrap:"border-amber-300/35 bg-amber-300/[0.09] text-amber-100"}:r==="error"?{label:"Error",detail:"Could not hold the call",chip:"border-red-400/35 bg-red-400/[0.10] text-red-100",iconWrap:"border-red-400/35 bg-red-400/[0.10] text-red-100"}:r==="ended"?{label:"Ended",detail:"Call closed — start again anytime",chip:"border-[color-mix(in_srgb,var(--hud-ink)_12%,transparent)] text-[var(--scout-chrome-ink-faint)]",iconWrap:"border-[color-mix(in_srgb,var(--hud-ink)_10%,transparent)] bg-[color-mix(in_srgb,var(--hud-ink)_4%,transparent)] text-[var(--scout-chrome-ink-faint)]"}:{label:"Ready",detail:"Talk continuously with Scoutbot",chip:"border-transparent bg-[color-mix(in_srgb,var(--hud-ink)_6%,transparent)] text-[var(--scout-chrome-ink-faint)]",iconWrap:"border-transparent bg-[color-mix(in_srgb,var(--hud-ink)_5%,transparent)] text-[var(--scout-chrome-ink-faint)]"}}function ue({state:r,onMinimize:a,onExpand:n,layout:p="compact"}){const i=ee(r),s=p==="page";return e.jsxs("header",{className:`flex items-start ${s?"gap-3.5 px-5 py-4":"gap-2.5 px-3.5 py-3"}`,children:[e.jsx("div",{className:`${s?"size-9":"size-7"} mt-px flex shrink-0 items-center justify-center rounded-md border ${i.iconWrap}`,children:r==="connecting"?e.jsx(h,{size:s?14:12,className:"animate-spin"}):r==="live"?e.jsxs("span",{className:"relative flex size-2",children:[e.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-lime-300/35"}),e.jsx("span",{className:"relative inline-flex size-2 rounded-full bg-lime-300/90"})]}):e.jsx(z,{size:s?14:12})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("h2",{className:`truncate font-medium text-[var(--scout-chrome-ink-strong)] ${s?"text-2xl":"text-base"}`,children:"Live voice"}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsx("span",{className:`rounded border px-1.5 py-px font-mono text-xs uppercase tracking-[0.1em] ${i.chip}`,children:i.label}),n&&e.jsx("button",{type:"button",onClick:n,title:s?"Return to compact live voice view":"Open full live voice view","aria-label":s?"Return to compact live voice view":"Open full live voice view",className:"flex size-6 items-center justify-center rounded-md text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink-strong)]",children:s?e.jsx(B,{size:12}):e.jsx(H,{size:12})}),a&&e.jsx("button",{type:"button",onClick:a,title:"Collapse live voice into the status bar","aria-label":"Collapse live voice into the status bar",className:"flex size-6 items-center justify-center rounded-md text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink-strong)]",children:e.jsx(q,{size:12})})]})]}),e.jsx("p",{className:`mt-0.5 leading-snug text-[var(--scout-chrome-ink-faint)] ${s?"text-base":"text-sm"}`,children:i.detail})]})]})}function pe({dictationActive:r,layout:a="compact"}){const{state:n,error:p,trace:i,chatState:s,sessionAction:v,startCall:M,endCall:L,startNewChat:E,switchChat:T,updatePreferredModel:R,clearTrace:O,openVoiceSettings:P}=D(),b=n==="connecting"||n==="live",[g,V]=o.useState("controls"),w=se(p),m=a==="page",[c,f]=o.useState(""),[k,W]=o.useState(!1),[l,C]=o.useState(!1),[S,d]=o.useState(null);o.useEffect(()=>{!l&&s?.config.model&&f(s.config.model)},[s?.config.model,l]);const _=async()=>{if(!(!c.trim()||l)){C(!0),d(null);try{const t=await R(c);f(t),d("Saved")}catch(t){d(t instanceof Error?t.message:"Could not save model.")}finally{C(!1)}}},j=n==="connecting"?{label:"Cancel connection",icon:e.jsx(h,{size:11,className:"animate-spin"}),tone:"border-amber-300/35 bg-amber-300/[0.10] text-amber-100 hover:bg-amber-300/[0.16]"}:n==="live"?{label:"End live voice",icon:e.jsx(K,{size:9,className:"fill-current"}),tone:"border-red-400/35 bg-red-400/[0.10] text-red-100 hover:bg-red-400/[0.16]"}:{label:"Start live voice",icon:e.jsx(J,{size:10,className:"fill-current"}),tone:"border-lime-300/40 bg-lime-300/[0.12] text-lime-100 hover:bg-lime-300/[0.18]"};return e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[e.jsx("nav",{className:`grid shrink-0 grid-cols-2 border-b border-[var(--scout-chrome-border-soft)] ${m?"px-5":"px-3.5"}`,"aria-label":"Live voice views",children:[{id:"controls",label:"Controls",icon:e.jsx(z,{size:11})},{id:"activity",label:"Activity",icon:e.jsx(Y,{size:11})}].map(t=>e.jsxs("button",{type:"button",onClick:()=>V(t.id),"aria-current":g===t.id,className:`-mb-px flex items-center justify-center gap-1.5 border-b-2 font-mono uppercase tracking-[0.1em] transition-colors ${m?"h-11 text-sm":"h-9 text-xs"} ${g===t.id?"border-lime-300/80 text-[var(--scout-chrome-ink-strong)]":"border-transparent text-[var(--scout-chrome-ink-faint)] hover:text-[var(--scout-chrome-ink-strong)]"}`,children:[t.icon,t.label,t.id==="activity"&&i.length>0&&e.jsx("span",{className:"rounded-full bg-[color-mix(in_srgb,var(--hud-ink)_10%,transparent)] px-1.5 py-px font-mono text-xs text-[var(--scout-chrome-ink-faint)]",children:i.length})]},t.id))}),g==="activity"?e.jsxs("div",{className:`flex min-h-0 flex-1 flex-col ${m?"p-5":"p-3.5"}`,children:[e.jsxs("div",{className:"mb-2 flex shrink-0 items-center justify-between",children:[e.jsx("p",{className:N,children:"Session activity"}),i.length>0&&e.jsx("button",{type:"button",onClick:O,className:"font-mono text-xs uppercase tracking-[0.09em] text-[var(--scout-chrome-ink-ghost)] transition-colors hover:text-[var(--scout-chrome-ink-strong)]",children:"Clear"})]}),i.length===0?e.jsx("div",{className:"flex flex-1 items-center justify-center rounded-lg border border-dashed border-[color-mix(in_srgb,var(--hud-ink)_10%,transparent)] px-6 text-center text-sm leading-relaxed text-[var(--scout-chrome-ink-faint)]",children:"Start a call to record requests, replies, navigation attempts, and delivery results."}):e.jsx("ol",{className:`min-h-0 flex-1 overflow-y-auto ${x}`,children:i.map((t,A)=>e.jsxs("li",{className:`px-2.5 py-2 ${A>0?"border-t border-[var(--scout-chrome-border-soft)]":""}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-1.5",children:[e.jsx("span",{className:`mt-px shrink-0 rounded border px-1 py-px font-mono text-xs uppercase tracking-[0.08em] ${ie(t.kind)}`,children:re(t.kind)}),e.jsx("span",{className:"min-w-0 text-sm leading-snug text-[var(--scout-chrome-ink-strong)]",children:t.label})]}),e.jsx("time",{className:"shrink-0 font-mono text-xs text-[var(--scout-chrome-ink-ghost)]",children:te(t.at)})]}),t.detail&&e.jsx("span",{className:"mt-1 block whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-[var(--scout-chrome-ink-faint)]",children:t.detail})]},t.id))})]}):e.jsxs("div",{className:`flex min-h-0 w-full flex-1 flex-col overflow-y-auto ${m?"mx-auto max-w-2xl gap-4 p-5":"gap-2.5 p-3.5"}`,children:[e.jsxs("section",{className:`${x} shrink-0 p-3`,children:[e.jsx("p",{className:"text-base font-medium text-[var(--scout-chrome-ink-strong)]",children:"Live conversation"}),e.jsx("p",{className:"mt-0.5 text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:n==="live"?"Microphone and spoken replies are active.":n==="connecting"?"Opening the audio connection…":"Start when you are ready to speak."}),e.jsxs("button",{type:"button",disabled:r&&!b,onClick:()=>{b?L():M()},className:`mt-3 flex h-9 w-full items-center justify-center gap-2 rounded-md border font-mono text-sm uppercase tracking-[0.1em] transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${j.tone}`,children:[j.icon,j.label]}),r&&!b&&e.jsx("p",{className:"mt-2 text-xs leading-relaxed text-amber-200/80",children:"Finish dictation before starting a live call."}),w&&e.jsx("p",{className:"mt-2 rounded-md border border-red-400/30 bg-red-400/[0.08] px-2 py-1.5 text-sm leading-relaxed text-red-100",children:w})]}),e.jsxs("section",{className:`${x} shrink-0 p-3`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(F,{size:11,className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]"}),e.jsx("p",{className:N,children:"Live chat"})]}),e.jsx("p",{className:"mt-1.5 truncate text-base text-[var(--scout-chrome-ink-strong)]",title:s?.session.id,children:s?.session.title||"Loading chat…"}),e.jsx("p",{className:"mt-0.5 text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Context stays with this chat when voice stops or the panel closes."}),e.jsxs("div",{className:"mt-2.5 flex min-w-0 items-center gap-1.5",children:[s&&s.sessions.length>1&&e.jsxs("label",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"sr-only",children:"Switch live chat"}),e.jsx("select",{value:s.session.id,disabled:!!v,onChange:t=>{T(t.target.value)},className:`h-8 w-full min-w-0 px-2 font-mono text-sm disabled:cursor-wait disabled:opacity-50 ${$}`,title:"Switch live chat; an active voice connection will end",children:s.sessions.map(t=>e.jsxs("option",{value:t.id,children:[t.title||`Chat ${t.id.slice(0,8)}`," · ",t.messageCount," msg"]},t.id))})]}),e.jsxs("button",{type:"button",onClick:()=>{E()},disabled:!s||!!v,title:"Start a new chat; an active voice connection will end",className:`flex h-8 shrink-0 items-center justify-center gap-1.5 px-2.5 font-mono text-xs uppercase tracking-[0.09em] disabled:cursor-wait ${y}`,children:[v==="new"?e.jsx(h,{size:10,className:"animate-spin"}):e.jsx(I,{size:10}),"New chat"]})]})]}),e.jsxs("section",{className:`${x} shrink-0 p-3`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:N,children:"Scoutbot reply model"}),e.jsx("p",{className:"mt-1 truncate font-mono text-base text-[var(--scout-chrome-ink-strong)]",children:s?.config.model||"—"})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[s?.config.provider&&e.jsx("span",{className:"font-mono text-xs uppercase tracking-[0.08em] text-[var(--scout-chrome-ink-ghost)]",children:s.config.provider}),e.jsx("button",{type:"button",onClick:()=>{d(null),W(t=>!t)},"aria-expanded":k,className:`flex h-7 items-center px-2 font-mono text-xs uppercase tracking-[0.09em] ${y}`,children:k?"Close":"Change"})]})]}),k&&e.jsxs("div",{className:"mt-2.5 border-t border-[var(--scout-chrome-border-soft)] pt-2.5",children:[e.jsx("p",{className:"text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Used for typed and live Scoutbot replies."}),e.jsxs("div",{className:"mt-2 flex gap-1.5",children:[e.jsx("input",{value:c,onChange:t=>{f(t.target.value),d(null)},onKeyDown:t=>{t.key==="Enter"&&_()},placeholder:"gpt-4.1-mini","aria-label":"Preferred Scoutbot model",className:`h-8 min-w-0 flex-1 px-2 font-mono text-sm ${$}`}),e.jsx("button",{type:"button",onClick:()=>{_()},disabled:l||!c.trim()||c.trim()===s?.config.model,className:`flex h-8 min-w-14 items-center justify-center px-2 font-mono text-xs uppercase tracking-[0.09em] ${y}`,children:l?e.jsx(h,{size:10,className:"animate-spin"}):"Apply"})]}),S&&e.jsx("p",{className:"mt-1.5 font-mono text-xs text-[var(--scout-chrome-ink-faint)]",children:S})]})]}),e.jsxs("button",{type:"button",onClick:P,className:"mt-auto flex h-8 w-full shrink-0 items-center justify-center gap-1.5 rounded-md font-mono text-xs uppercase tracking-[0.09em] text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink-strong)]",children:[e.jsx(Z,{size:11}),"Voice settings"]})]})]})}function te(r){return new Date(r).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function se(r){if(!r)return null;const a=r.toLowerCase();return a.includes("active response in progress")||a.includes("conversation already has an active response")?null:a.includes("realtime voice call is already active")?"Live voice is still running on this Scout host. Stop it from the footer, or wait a moment for it to finish closing.":r}function re(r){switch(r){case"navigation":return"Navigate";case"scoutbot":return"Scoutbot";case"agent":return"Agent ask";case"error":return"Error";default:return"Voice"}}function ie(r){switch(r){case"navigation":return"border-sky-300/25 bg-sky-300/[0.06] text-sky-100/80";case"scoutbot":return"border-violet-300/25 bg-violet-300/[0.06] text-violet-100/80";case"agent":return"border-amber-300/25 bg-amber-300/[0.06] text-amber-100/80";case"error":return"border-red-300/25 bg-red-300/[0.06] text-red-100/80";default:return"border-lime-300/20 bg-lime-300/[0.05] text-lime-100/70"}}export{F as H,J as P,ue as S,pe as a};
@@ -1 +1 @@
1
- import{j as a}from"./index-BZovGpDk.js";import"./secondaryNavConfig-c0cz3MkJ.js";function b({ariaLabel:r,activeRoute:l,groups:t,navigate:o,className:n=""}){return a.jsx("nav",{className:`s-secondary-nav${n?` ${n}`:""}`,"aria-label":r,children:t.map((s,i)=>a.jsxs("div",{className:"s-secondary-nav-group",children:[s.label&&a.jsx("span",{className:"s-secondary-nav-label",children:s.label}),a.jsx("div",{className:"s-secondary-nav-switch",children:s.items.map(e=>{const c=e.active(l);return a.jsx("button",{type:"button","aria-pressed":c,className:`s-secondary-nav-button${c?" s-secondary-nav-button--active":""}`,onClick:()=>o(e.route),children:e.label},e.id)})})]},s.label??i))})}export{b as S};
1
+ import{j as a}from"./index-DmFAhGPj.js";import"./secondaryNavConfig-Dw3gS1jR.js";function b({ariaLabel:r,activeRoute:l,groups:t,navigate:o,className:n=""}){return a.jsx("nav",{className:`s-secondary-nav${n?` ${n}`:""}`,"aria-label":r,children:t.map((s,i)=>a.jsxs("div",{className:"s-secondary-nav-group",children:[s.label&&a.jsx("span",{className:"s-secondary-nav-label",children:s.label}),a.jsx("div",{className:"s-secondary-nav-switch",children:s.items.map(e=>{const c=e.active(l);return a.jsx("button",{type:"button","aria-pressed":c,className:`s-secondary-nav-button${c?" s-secondary-nav-button--active":""}`,onClick:()=>o(e.route),children:e.label},e.id)})})]},s.label??i))})}export{b as S};
@@ -1 +1 @@
1
- import{r as n,j as s}from"./index-BZovGpDk.js";import{a as S}from"./api-h5zurxmi.js";import{d as j,S as E}from"./SessionObserve-B-SkP3tu.js";import{u as h}from"./sse-Bb0EOcU9.js";import{ConversationScreen as x}from"./ConversationScreen-Br0QQ3xo.js";import{SessionObserveEmbedStatus as y}from"./SessionObserveEvidence-CF5jnH3-.js";const I=2500;function l({children:e}){return s.jsx("div",{className:"s-observe-embed-page",children:e})}function a({title:e,detail:r}){return s.jsx(l,{children:s.jsxs("div",{className:"s-observe-embed-empty",children:[s.jsx("div",{className:"s-observe-embed-empty-title",children:e}),r&&s.jsx("div",{className:"s-observe-embed-empty-detail",children:r})]})})}function m({lookup:e}){const r=j({source:e.observe.source,fidelity:e.observe.fidelity,live:e.observe.data.live,eventCount:e.observe.data.events.length});return s.jsxs(l,{children:[s.jsx(y,{source:e.observe.source,fidelity:e.observe.fidelity,sessionId:e.observe.sessionId??e.observe.refId,evidence:r}),s.jsx(E,{data:e.observe.data,agentId:e.observe.agentId??e.session?.agentId??void 0,sessionId:e.observe.sessionId??e.observe.refId,showRail:!1,observeSource:e.observe.source,observeFidelity:e.observe.fidelity})]})}function c(){const e=typeof window>"u"?"":new URLSearchParams(window.location.search).get("ref")?.trim()??"",[r,v]=n.useState(null),[u,d]=n.useState(!0),[b,f]=n.useState(null),i=n.useCallback(async(o=!1)=>{if(!e){d(!1);return}o||d(!0),f(null);try{const t=await S(`/api/session-ref/${encodeURIComponent(e)}`);v(t)}catch(t){o||v(null),f(t instanceof Error?t.message:String(t))}finally{d(!1)}},[e]);return n.useEffect(()=>{i();const o=window.setInterval(()=>{i(!0)},I);return()=>window.clearInterval(o)},[i]),h(()=>{i(!0)}),e?b&&!r?s.jsx(a,{title:"Session unavailable",detail:b}):u&&!r?s.jsx(a,{title:"Resolving session",detail:e}):r?r.kind==="conversation"?s.jsx(l,{children:s.jsx(x,{conversationId:r.conversationId,navigate:()=>{},embedded:!0,showBackNav:!1})}):s.jsx(m,{lookup:r}):s.jsx(a,{title:"Session not found",detail:"This session may have ended or its archive is not on this machine."}):s.jsx(a,{title:"No session reference",detail:"This embed needs a ?ref=<sessionId> query parameter."})}const R=Object.freeze(Object.defineProperty({__proto__:null,SessionEmbedObserveContent:m,SessionEmbedScreen:c,default:c},Symbol.toStringTag,{value:"Module"})),C=Object.freeze(Object.defineProperty({__proto__:null,SessionEmbedScreen:c},Symbol.toStringTag,{value:"Module"}));export{R as S,C as a};
1
+ import{r as n,j as s}from"./index-DmFAhGPj.js";import{a as S}from"./api-h5zurxmi.js";import{d as j,S as E}from"./SessionObserve-yYA8Gy5s.js";import{u as h}from"./sse-CxXt4tqI.js";import{ConversationScreen as x}from"./ConversationScreen-B3l2m3JI.js";import{SessionObserveEmbedStatus as y}from"./SessionObserveEvidence-cHdjYOJe.js";const I=2500;function l({children:e}){return s.jsx("div",{className:"s-observe-embed-page",children:e})}function a({title:e,detail:r}){return s.jsx(l,{children:s.jsxs("div",{className:"s-observe-embed-empty",children:[s.jsx("div",{className:"s-observe-embed-empty-title",children:e}),r&&s.jsx("div",{className:"s-observe-embed-empty-detail",children:r})]})})}function m({lookup:e}){const r=j({source:e.observe.source,fidelity:e.observe.fidelity,live:e.observe.data.live,eventCount:e.observe.data.events.length});return s.jsxs(l,{children:[s.jsx(y,{source:e.observe.source,fidelity:e.observe.fidelity,sessionId:e.observe.sessionId??e.observe.refId,evidence:r}),s.jsx(E,{data:e.observe.data,agentId:e.observe.agentId??e.session?.agentId??void 0,sessionId:e.observe.sessionId??e.observe.refId,showRail:!1,observeSource:e.observe.source,observeFidelity:e.observe.fidelity})]})}function c(){const e=typeof window>"u"?"":new URLSearchParams(window.location.search).get("ref")?.trim()??"",[r,v]=n.useState(null),[u,d]=n.useState(!0),[b,f]=n.useState(null),i=n.useCallback(async(o=!1)=>{if(!e){d(!1);return}o||d(!0),f(null);try{const t=await S(`/api/session-ref/${encodeURIComponent(e)}`);v(t)}catch(t){o||v(null),f(t instanceof Error?t.message:String(t))}finally{d(!1)}},[e]);return n.useEffect(()=>{i();const o=window.setInterval(()=>{i(!0)},I);return()=>window.clearInterval(o)},[i]),h(()=>{i(!0)}),e?b&&!r?s.jsx(a,{title:"Session unavailable",detail:b}):u&&!r?s.jsx(a,{title:"Resolving session",detail:e}):r?r.kind==="conversation"?s.jsx(l,{children:s.jsx(x,{conversationId:r.conversationId,navigate:()=>{},embedded:!0,showBackNav:!1})}):s.jsx(m,{lookup:r}):s.jsx(a,{title:"Session not found",detail:"This session may have ended or its archive is not on this machine."}):s.jsx(a,{title:"No session reference",detail:"This embed needs a ?ref=<sessionId> query parameter."})}const R=Object.freeze(Object.defineProperty({__proto__:null,SessionEmbedObserveContent:m,SessionEmbedScreen:c,default:c},Symbol.toStringTag,{value:"Module"})),C=Object.freeze(Object.defineProperty({__proto__:null,SessionEmbedScreen:c},Symbol.toStringTag,{value:"Module"}));export{R as S,C as a};
@@ -1,4 +1,4 @@
1
- import{r as h,j as t}from"./index-BZovGpDk.js";import{f as ge}from"./bash-format-BRV5C6Gv.js";import{j as js,p as He,k as ks}from"./tail-display-BRcJltQa.js";import{l as ys}from"./lane-edit-display-C_Aujldz.js";import{f as Ns}from"./lane-tool-detail-0WhMf4Vj.js";import{useLaneToolHoverCard as ws}from"./LaneToolHoverCard-BkBcDYm-.js";import{e as Cs,L as Le,g as Ss,h as Ts,j as Ee,o as $s,b as Re,f as Ls,k as Es,m as je,l as Ge,a as qe}from"./lane-observe-BA3g9aVd.js";import{b as Rs}from"./lane-ask-display-B6iCAVcd.js";import{d as Ps}from"./colors-BtO5_zlx.js";import{a as ke}from"./api-h5zurxmi.js";import{r as Ue}from"./mentions-BjXfeF7t.js";import{a as Os,g as Ve,t as As,b as Is,d as Bs,n as Pe}from"./time-Dhsh_2EG.js";import{M as Ke}from"./message-markup-DlVX-iuc.js";import{q as _s}from"./terminal-takeover--05EYhJm.js";import{k as Fs,m as Ds,n as Ms}from"./NewChatComposer-DKlNX1UA.js";import{u as ye,C as Je}from"./Provider-p-xuaAoE.js";import{o as Ws}from"./openContent-C6XO6kr5.js";import{O as zs}from"./ObservedTopologyPanel-BlmGoxCE.js";import{M as Hs}from"./runtime-picker-BXKJbLot.js";import"./index-DiiEQwdc.js";import{ObserveReasoningDisclosure as Gs,ObserveStreamCursor as Oe}from"./ObserveTextFlow-DWNlmTVm.js";import{SessionObserveReceiptView as qs}from"./SessionObserveEvidence-CF5jnH3-.js";import{M as Us}from"./message-circle-BwVx5X0q.js";import{W as Vs}from"./wrench-_tHBGTop.js";import{E as Ks}from"./external-link-Dd8xaveL.js";import{C as Ye}from"./chevron-down-BVg09D6U.js";import{c as Js}from"./createLucideIcon-DCq_3fQn.js";const Ys=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Xs=Js("tag",Ys),Ne=new Set(["bash","shell","terminal","exec","run","command","exec_command","shell_command","local_shell","container_exec","container.exec"]);function I(e){return(e??"").trim()}function q(e){return[e.kind,I(e.tool),I(e.arg),I(e.text),I(e.detail)].join("|")}function Zs(e){if(e.kind!=="tool"||!e.tool||e.result)return!1;const s=I(e.arg).toLowerCase();return s==="started"||s.length>0&&s!=="completed"}function Qs(e){return e.kind!=="tool"||!e.tool?!1:I(e.arg).toLowerCase()==="completed"||!!e.result?.outcome}const Xe=/^permission requested · ([A-Za-z][\w-]*)$/i,Ze=/^permission ([a-z_]+) · ([A-Za-z][\w-]*)$/i;function Qe(e){return e.kind==="system"&&Xe.test(e.text.trim())}function es(e){return e.kind==="system"&&Ze.test(e.text.trim())}function Ae(e){const s=e.text.trim(),n=s.match(Xe);if(n?.[1])return n[1];const a=s.match(Ze);return a?.[2]?a[2]:null}function et(e,s){const n=e.text.trim();return{...e,text:s>1?`${n}
1
+ import{r as h,j as t}from"./index-DmFAhGPj.js";import{f as ge}from"./bash-format-BRV5C6Gv.js";import{j as js,p as He,k as ks}from"./tail-display-BRcJltQa.js";import{l as ys}from"./lane-edit-display-C_Aujldz.js";import{f as Ns}from"./lane-tool-detail-0WhMf4Vj.js";import{useLaneToolHoverCard as ws}from"./LaneToolHoverCard-B7KdvQvf.js";import{e as Cs,L as Le,g as Ss,h as Ts,j as Ee,o as $s,b as Re,f as Ls,k as Es,m as je,l as Ge,a as qe}from"./lane-observe-BA3g9aVd.js";import{b as Rs}from"./lane-ask-display-B6iCAVcd.js";import{d as Ps}from"./colors-BtO5_zlx.js";import{a as ke}from"./api-h5zurxmi.js";import{r as Ue}from"./mentions-agCGDgyA.js";import{a as Os,g as Ve,t as As,b as Is,d as Bs,n as Pe}from"./time-Dhsh_2EG.js";import{M as Ke}from"./message-markup-CyRDLdOn.js";import{q as _s}from"./terminal-takeover-BOFPRPjR.js";import{k as Fs,m as Ds,n as Ms}from"./NewChatComposer-Hd7pI5Ac.js";import{u as ye,C as Je}from"./Provider-cJCdHAxu.js";import{o as Ws}from"./openContent-C6XO6kr5.js";import{O as zs}from"./ObservedTopologyPanel-CaSZZP05.js";import{M as Hs}from"./runtime-picker--IW3cRry.js";import"./index-CmwGCxUk.js";import{ObserveReasoningDisclosure as Gs,ObserveStreamCursor as Oe}from"./ObserveTextFlow-CkMrtT8s.js";import{SessionObserveReceiptView as qs}from"./SessionObserveEvidence-cHdjYOJe.js";import{M as Us}from"./message-circle-CJO-pi7b.js";import{W as Vs}from"./wrench-CvRjjByE.js";import{E as Ks}from"./external-link-B1TI5yIt.js";import{C as Ye}from"./chevron-down-B3VVRJcV.js";import{c as Js}from"./createLucideIcon-CFBn0Sdk.js";const Ys=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Xs=Js("tag",Ys),Ne=new Set(["bash","shell","terminal","exec","run","command","exec_command","shell_command","local_shell","container_exec","container.exec"]);function I(e){return(e??"").trim()}function q(e){return[e.kind,I(e.tool),I(e.arg),I(e.text),I(e.detail)].join("|")}function Zs(e){if(e.kind!=="tool"||!e.tool||e.result)return!1;const s=I(e.arg).toLowerCase();return s==="started"||s.length>0&&s!=="completed"}function Qs(e){return e.kind!=="tool"||!e.tool?!1:I(e.arg).toLowerCase()==="completed"||!!e.result?.outcome}const Xe=/^permission requested · ([A-Za-z][\w-]*)$/i,Ze=/^permission ([a-z_]+) · ([A-Za-z][\w-]*)$/i;function Qe(e){return e.kind==="system"&&Xe.test(e.text.trim())}function es(e){return e.kind==="system"&&Ze.test(e.text.trim())}function Ae(e){const s=e.text.trim(),n=s.match(Xe);if(n?.[1])return n[1];const a=s.match(Ze);return a?.[2]?a[2]:null}function et(e,s){const n=e.text.trim();return{...e,text:s>1?`${n}
2
2
 
3
3
  (${s} reasoning updates)`:n}}function st(e,s){const n=s.tool??e.tool,a=s.result?.outcome,r=e.arg&&e.arg!=="started"&&e.arg!=="completed"?e.arg:s.arg&&s.arg!=="completed"?s.arg:void 0,o=s.stream?.join(`
4
4
  `)??"",l=r?o.trim()?`${n} · ${r} · ${o}`:a?`${n} · ${r} · ${a}`:`${n} · ${r}`:s.text.trim()||(a?`${n} completed · ${a}`:`${n} completed`);return{...s,tool:n,arg:r??"completed",text:l,stream:s.stream??e.stream,diff:s.diff??e.diff,detail:s.detail??e.detail,live:s.live??e.live}}function tt(e){if(e.kind!=="tool"||!e.tool)return!1;const s=I(e.tool).toLowerCase();if(!Ne.has(s))return!1;const n=I(e.arg);return n.length>0&&n!=="started"&&n!=="completed"}function nt(e){if(e.kind!=="tool")return!1;const s=I(e.tool).toLowerCase();return s==="res"?!!(I(e.arg)||(e.stream?.length??0)>0):Ne.has(s)?(e.stream?.length??0)>0:!1}function at(e){return(e.stream?.length??0)>0?e.stream.join(`
@@ -1 +1 @@
1
- import{j as s}from"./index-BZovGpDk.js";function n(e){return e?e.length>18?`${e.slice(0,8)}...${e.slice(-6)}`:e:"no session"}function l({source:e,fidelity:r,sessionId:t,evidence:i}){return s.jsxs("div",{className:"s-observe-embed-status","data-tone":i.tone,children:[s.jsx("span",{className:"s-observe-embed-status-source",children:e}),s.jsx("span",{children:r}),s.jsx("span",{title:t??void 0,children:n(t)}),s.jsx("span",{children:i.eventCountLabel}),i.tone==="live"&&s.jsx("span",{className:"s-observe-embed-status-live",children:"Live"})]})}function o({events:e}){return s.jsxs("section",{className:"s-observe-receipt-view","aria-label":"Session setup receipts",children:[s.jsxs("div",{className:"s-observe-receipt-view-copy",children:[s.jsx("strong",{children:"No observed trace activity"}),s.jsx("span",{children:"These broker lifecycle records confirm setup only."})]}),e.length>0&&s.jsx("ul",{className:"s-observe-receipt-list",children:e.map(r=>s.jsxs("li",{className:"s-observe-receipt",children:[s.jsx("span",{children:r.text}),r.detail&&s.jsx("small",{children:r.detail})]},r.id))})]})}export{l as SessionObserveEmbedStatus,o as SessionObserveReceiptView};
1
+ import{j as s}from"./index-DmFAhGPj.js";function n(e){return e?e.length>18?`${e.slice(0,8)}...${e.slice(-6)}`:e:"no session"}function l({source:e,fidelity:r,sessionId:t,evidence:i}){return s.jsxs("div",{className:"s-observe-embed-status","data-tone":i.tone,children:[s.jsx("span",{className:"s-observe-embed-status-source",children:e}),s.jsx("span",{children:r}),s.jsx("span",{title:t??void 0,children:n(t)}),s.jsx("span",{children:i.eventCountLabel}),i.tone==="live"&&s.jsx("span",{className:"s-observe-embed-status-live",children:"Live"})]})}function o({events:e}){return s.jsxs("section",{className:"s-observe-receipt-view","aria-label":"Session setup receipts",children:[s.jsxs("div",{className:"s-observe-receipt-view-copy",children:[s.jsx("strong",{children:"No observed trace activity"}),s.jsx("span",{children:"These broker lifecycle records confirm setup only."})]}),e.length>0&&s.jsx("ul",{className:"s-observe-receipt-list",children:e.map(r=>s.jsxs("li",{className:"s-observe-receipt",children:[s.jsx("span",{children:r.text}),r.detail&&s.jsx("small",{children:r.detail})]},r.id))})]})}export{l as SessionObserveEmbedStatus,o as SessionObserveReceiptView};
@@ -1 +1 @@
1
- import{r as n,j as e}from"./index-BZovGpDk.js";import{a as j}from"./api-h5zurxmi.js";import{u as g}from"./sse-Bb0EOcU9.js";import{u as N}from"./tail-events-C12pfUax.js";import{B as I}from"./BackToPicker-D6WgIDb-.js";import{ConversationScreen as S}from"./ConversationScreen-Br0QQ3xo.js";import{S as k,a as y}from"./SessionObserve-B-SkP3tu.js";/* empty css */import"./index-BWHgHrtv.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./createLucideIcon-DCq_3fQn.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./keyboard-nav-CHo_xmjw.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-CrGUKNRv.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./file-text-BITQqGtF.js";import"./ConversationComposer-CjRXFkvY.js";import"./Provider-p-xuaAoE.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./message-markup-DlVX-iuc.js";import"./mentions-BjXfeF7t.js";import"./AgentDetailCard-Dtc02KUO.js";import"./AgentLiveActions-DwScaVRF.js";import"./terminal-takeover--05EYhJm.js";import"./openContent-C6XO6kr5.js";import"./eye-DkU59kfl.js";import"./terminal-xGf_F3y7.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./AgentAvatar-CneOa70z.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-CRmdtuL7.js";import"./ConversationFeedRows-CgRTIpAv.js";import"./ConversationPanels-DCkcLIHk.js";import"./use-reduced-motion-C8cWvIZ3.js";import"./activity-DS0u0Itf.js";import"./message-circle-BwVx5X0q.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./ConversationStatus-BJ1CMbAv.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-BkBcDYm-.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-BlmGoxCE.js";import"./ObserveTextFlow-DWNlmTVm.js";import"./SessionObserveEvidence-CF5jnH3-.js";import"./wrench-_tHBGTop.js";import"./external-link-Dd8xaveL.js";function p(o){const s=o?.trim()??"",i=s.split(/[\\/]/).filter(Boolean).at(-1)??s;return i.endsWith(".jsonl")?i.slice(0,-6):i}function R(o){return o.startsWith("native:process:")}function x(o){const[s,i]=n.useState(null),[c,l]=n.useState(!0),[r,d]=n.useState(null),t=n.useRef(null),a=n.useCallback(async()=>{d(null);try{const m=await j(`/api/session-ref/${encodeURIComponent(o)}`);i(m)}catch(m){i(null),d(m instanceof Error?m.message:String(m))}finally{l(!1)}},[o]);n.useEffect(()=>{l(!0),a()},[a]);const u=n.useCallback(()=>{t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,a()},150)},[a]);return g(u),N(m=>{const v=p(m.sessionId),b=p(o),h=s?.kind==="observe"?p(s.observe.sessionId??s.observe.refId):"",f=s?.kind==="observe"?p(s.observe.data.metadata?.session?.externalSessionId):"";v!==b&&(!h||v!==h)&&(!f||v!==f)||u()}),n.useEffect(()=>()=>{t.current&&clearTimeout(t.current)},[]),{lookup:s,loading:c,error:r}}function _e({sessionRef:o}){const{lookup:s,loading:i,error:c}=x(o);return s?.kind==="observe"?e.jsx(y,{data:s.observe.data,agentId:s.observe.agentId??s.session?.agentId??void 0,sessionId:s.observe.sessionId??s.observe.refId,surface:"context",observeSource:s.observe.source,observeFidelity:s.observe.fidelity}):e.jsx("aside",{className:"s-observe-rail s-observe-rail--context",children:e.jsxs("div",{children:[e.jsx("div",{className:"s-observe-rail-label",children:s?.kind==="conversation"?"Conversation":"Session context"}),e.jsx("div",{className:"s-observe-empty",children:i?"Resolving session reference":c?"Session context unavailable":"No observe context captured for this session"})]})})}function es({sessionRef:o,navigate:s,renderBeforeContent:i,showObserveRail:c=!0,onLookup:l}){const{lookup:r,loading:d,error:t}=x(o);if(n.useEffect(()=>{r&&l?.(r)},[r,l]),r?.kind==="conversation")return e.jsxs(e.Fragment,{children:[i?.(r),e.jsx(S,{conversationId:r.conversationId,navigate:s})]});if(r?.kind==="observe")return e.jsxs(e.Fragment,{children:[i?.(r),e.jsx(k,{data:r.observe.data,agentId:r.observe.agentId??r.session?.agentId??void 0,sessionId:r.observe.sessionId??r.observe.refId,conversationId:r.session?.id??null,showRail:c,observeSource:r.observe.source,observeFidelity:r.observe.fidelity})]});if(d)return e.jsx("div",{className:"s-sessions-screen s-inbox-thread-redesign",children:e.jsx("section",{className:"s-thread-overview",children:e.jsxs("div",{className:"s-thread-overview-copy",children:[e.jsxs("div",{className:"s-sessions-header s-thread-overview-heading",children:[e.jsx("h2",{className:"s-page-title",children:"Session"}),e.jsx("span",{className:"s-meta s-tabular",children:o.slice(0,8)})]}),e.jsxs("p",{className:"s-thread-overview-summary s-session-ref-loading",children:[e.jsx("span",{className:"s-session-ref-loading-dot"}),e.jsx("span",{className:"s-session-ref-loading-dot"}),e.jsx("span",{className:"s-session-ref-loading-dot"}),"Resolving session reference"]})]})})});const a=R(o);return e.jsx("div",{className:"s-sessions-screen s-inbox-thread-redesign",children:e.jsx("section",{className:"s-thread-overview",children:e.jsxs("div",{className:"s-thread-overview-copy",children:[e.jsxs("div",{className:"s-sessions-header s-thread-overview-heading",children:[e.jsx("h2",{className:"s-page-title",children:a?"Process trace unavailable":"Session not found"}),e.jsx("span",{className:"s-meta s-tabular",children:o.slice(0,8)})]}),e.jsx("p",{className:"s-thread-overview-summary",children:a?"This is a live process handle, not a transcript session. No replayable session archive is attached yet.":"This session may have ended or the archive is not available on this machine."}),t&&e.jsx("p",{className:"s-session-ref-error-detail",children:t}),e.jsx("div",{className:"s-session-ref-nav-hint",children:e.jsx(I,{slot:"sessions",fallback:{view:"sessions"},navigate:s})})]})})})}export{_e as SessionRefContextRail,es as SessionRefScreen};
1
+ import{r as n,j as e}from"./index-DmFAhGPj.js";import{a as j}from"./api-h5zurxmi.js";import{u as g}from"./sse-CxXt4tqI.js";import{u as N}from"./tail-events-BdvqZHLr.js";import{B as I}from"./BackToPicker-D1LV6Cqp.js";import{ConversationScreen as S}from"./ConversationScreen-B3l2m3JI.js";import{S as k,a as y}from"./SessionObserve-yYA8Gy5s.js";/* empty css */import"./index-BWHgHrtv.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./createLucideIcon-CFBn0Sdk.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DmuJ32wa.js";import"./keyboard-nav-h1IdakpD.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-C8ayPBtj.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./file-text-DcYSrI4v.js";import"./ConversationComposer-Bf7Ga_49.js";import"./Provider-cJCdHAxu.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./message-markup-CyRDLdOn.js";import"./mentions-agCGDgyA.js";import"./AgentDetailCard-BTiOmh-a.js";import"./AgentLiveActions-BJ5dIfL3.js";import"./terminal-takeover-BOFPRPjR.js";import"./openContent-C6XO6kr5.js";import"./eye-1J4yOUoG.js";import"./terminal-DJPUp_Qn.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./AgentAvatar-D8ZtMluU.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-B_GXrKR0.js";import"./ConversationFeedRows-Cm1Lgo43.js";import"./ConversationPanels-BTBbEvrP.js";import"./use-reduced-motion-CYqhYqHO.js";import"./activity-CC8JzJNH.js";import"./message-circle-CJO-pi7b.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./ConversationStatus-BqhUHD85.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-B7KdvQvf.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CaSZZP05.js";import"./ObserveTextFlow-CkMrtT8s.js";import"./SessionObserveEvidence-cHdjYOJe.js";import"./wrench-CvRjjByE.js";import"./external-link-B1TI5yIt.js";function p(o){const s=o?.trim()??"",i=s.split(/[\\/]/).filter(Boolean).at(-1)??s;return i.endsWith(".jsonl")?i.slice(0,-6):i}function R(o){return o.startsWith("native:process:")}function x(o){const[s,i]=n.useState(null),[c,l]=n.useState(!0),[r,d]=n.useState(null),t=n.useRef(null),a=n.useCallback(async()=>{d(null);try{const m=await j(`/api/session-ref/${encodeURIComponent(o)}`);i(m)}catch(m){i(null),d(m instanceof Error?m.message:String(m))}finally{l(!1)}},[o]);n.useEffect(()=>{l(!0),a()},[a]);const u=n.useCallback(()=>{t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,a()},150)},[a]);return g(u),N(m=>{const v=p(m.sessionId),b=p(o),h=s?.kind==="observe"?p(s.observe.sessionId??s.observe.refId):"",f=s?.kind==="observe"?p(s.observe.data.metadata?.session?.externalSessionId):"";v!==b&&(!h||v!==h)&&(!f||v!==f)||u()}),n.useEffect(()=>()=>{t.current&&clearTimeout(t.current)},[]),{lookup:s,loading:c,error:r}}function _e({sessionRef:o}){const{lookup:s,loading:i,error:c}=x(o);return s?.kind==="observe"?e.jsx(y,{data:s.observe.data,agentId:s.observe.agentId??s.session?.agentId??void 0,sessionId:s.observe.sessionId??s.observe.refId,surface:"context",observeSource:s.observe.source,observeFidelity:s.observe.fidelity}):e.jsx("aside",{className:"s-observe-rail s-observe-rail--context",children:e.jsxs("div",{children:[e.jsx("div",{className:"s-observe-rail-label",children:s?.kind==="conversation"?"Conversation":"Session context"}),e.jsx("div",{className:"s-observe-empty",children:i?"Resolving session reference":c?"Session context unavailable":"No observe context captured for this session"})]})})}function es({sessionRef:o,navigate:s,renderBeforeContent:i,showObserveRail:c=!0,onLookup:l}){const{lookup:r,loading:d,error:t}=x(o);if(n.useEffect(()=>{r&&l?.(r)},[r,l]),r?.kind==="conversation")return e.jsxs(e.Fragment,{children:[i?.(r),e.jsx(S,{conversationId:r.conversationId,navigate:s})]});if(r?.kind==="observe")return e.jsxs(e.Fragment,{children:[i?.(r),e.jsx(k,{data:r.observe.data,agentId:r.observe.agentId??r.session?.agentId??void 0,sessionId:r.observe.sessionId??r.observe.refId,conversationId:r.session?.id??null,showRail:c,observeSource:r.observe.source,observeFidelity:r.observe.fidelity})]});if(d)return e.jsx("div",{className:"s-sessions-screen s-inbox-thread-redesign",children:e.jsx("section",{className:"s-thread-overview",children:e.jsxs("div",{className:"s-thread-overview-copy",children:[e.jsxs("div",{className:"s-sessions-header s-thread-overview-heading",children:[e.jsx("h2",{className:"s-page-title",children:"Session"}),e.jsx("span",{className:"s-meta s-tabular",children:o.slice(0,8)})]}),e.jsxs("p",{className:"s-thread-overview-summary s-session-ref-loading",children:[e.jsx("span",{className:"s-session-ref-loading-dot"}),e.jsx("span",{className:"s-session-ref-loading-dot"}),e.jsx("span",{className:"s-session-ref-loading-dot"}),"Resolving session reference"]})]})})});const a=R(o);return e.jsx("div",{className:"s-sessions-screen s-inbox-thread-redesign",children:e.jsx("section",{className:"s-thread-overview",children:e.jsxs("div",{className:"s-thread-overview-copy",children:[e.jsxs("div",{className:"s-sessions-header s-thread-overview-heading",children:[e.jsx("h2",{className:"s-page-title",children:a?"Process trace unavailable":"Session not found"}),e.jsx("span",{className:"s-meta s-tabular",children:o.slice(0,8)})]}),e.jsx("p",{className:"s-thread-overview-summary",children:a?"This is a live process handle, not a transcript session. No replayable session archive is attached yet.":"This session may have ended or the archive is not available on this machine."}),t&&e.jsx("p",{className:"s-session-ref-error-detail",children:t}),e.jsx("div",{className:"s-session-ref-nav-hint",children:e.jsx(I,{slot:"sessions",fallback:{view:"sessions"},navigate:s})})]})})})}export{_e as SessionRefContextRail,es as SessionRefScreen};
@@ -0,0 +1 @@
1
+ import{j as r}from"./index-DmFAhGPj.js";import{RawSessionsTable as t}from"./RawSessionsTable-DBto4Ts-.js";/* empty css */import"./DataTable-CJbbgBdA.js";/* empty css */import"./api-h5zurxmi.js";import"./time-Dhsh_2EG.js";import"./tail-events-BdvqZHLr.js";import"./index-BWHgHrtv.js";import"./openContent-C6XO6kr5.js";import"./Provider-cJCdHAxu.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CxXt4tqI.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";function W({navigate:o}){return r.jsx(t,{navigate:o})}export{W as SessionsScreen};
@@ -1,3 +1,3 @@
1
- import{j as e,r as c,O as Se}from"./index-BZovGpDk.js";import{a as Ne,u as ke}from"./router-63XV_E7f.js";import{a as T}from"./api-h5zurxmi.js";import{u as me,a as Ce}from"./Provider-p-xuaAoE.js";import{t as Ae}from"./time-Dhsh_2EG.js";import{h as Ee,j as Oe,k as Te}from"./scout-voice-D8Q5sZOL.js";import{u as Pe}from"./keyboard-nav-CHo_xmjw.js";import{VoiceHostStatusBanner as Ie,VoicePermissionsPanel as $e}from"./VoicePermissionsPanel-C80iZxgy.js";import{u as Re}from"./chunk-HRAB3GC3-HhKwnZCi.js";import{C as R}from"./check-BfA0T8UD.js";import{c as Q}from"./createLucideIcon-DCq_3fQn.js";import{R as De}from"./refresh-cw-DtF8xPqX.js";import{C as Le}from"./copy-C79v_7D-.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(`
1
+ import{j as e,r as c,O as Se}from"./index-DmFAhGPj.js";import{a as Ne,u as ke}from"./router-Cn_s9IGH.js";import{a as T}from"./api-h5zurxmi.js";import{u as me,a as Ce}from"./Provider-cJCdHAxu.js";import{t as Ae}from"./time-Dhsh_2EG.js";import{h as Ee,j as Oe,k as Te}from"./scout-voice-CwbOz6EN.js";import{u as Pe}from"./keyboard-nav-h1IdakpD.js";import{VoiceHostStatusBanner as Ie,VoicePermissionsPanel as $e}from"./VoicePermissionsPanel-Dd4ITJy_.js";import{u as Re}from"./chunk-HRAB3GC3-dRd2eQMJ.js";import{C as R}from"./check-BX8nRgop.js";import{c as Q}from"./createLucideIcon-CFBn0Sdk.js";import{R as De}from"./refresh-cw-C4x1x6b_.js";import{C as Le}from"./copy-BFmOcWof.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
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
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 +1 @@
1
- import{j as i,r as d}from"./index-BZovGpDk.js";import{E as it}from"./EmptyState-CYNJZMrZ.js";import{S as B}from"./StatusPill-9uy70ttd.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-CkZ7EjZh.js";import{S as At}from"./SettingsDrawer-DATxwZrn.js";/* empty css */import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./createLucideIcon-DCq_3fQn.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./colors-BtO5_zlx.js";import"./NewChatOrigin-DXPvX-hh.js";import"./keyboard-nav-CHo_xmjw.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-CrGUKNRv.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./file-text-BITQqGtF.js";import"./Provider-p-xuaAoE.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./openContent-C6XO6kr5.js";import"./AgentsSubnav-BV0WAgzf.js";import"./SecondaryNav-B4IsujYh.js";import"./secondaryNavConfig-c0cz3MkJ.js";import"./message-square-BnkG6tae.js";import"./terminal-xGf_F3y7.js";import"./scroll-text-DZb3mmYo.js";import"./refresh-cw-DtF8xPqX.js";import"./bot-BSGSicKC.js";import"./wrench-_tHBGTop.js";import"./server-Bncn9S7r.js";import"./VoicePermissionsPanel-C80iZxgy.js";import"./check-BfA0T8UD.js";import"./copy-C79v_7D-.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,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}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 ms({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{ms as SettingsScreen};
1
+ import{j as i,r as d}from"./index-DmFAhGPj.js";import{E as it}from"./EmptyState-BRY5jTpz.js";import{S as B}from"./StatusPill-C8m9ZymF.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-BlGI6fuM.js";import{S as At}from"./SettingsDrawer-Co11RFX0.js";/* empty css */import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./createLucideIcon-CFBn0Sdk.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./colors-BtO5_zlx.js";import"./NewChatOrigin-DmuJ32wa.js";import"./keyboard-nav-h1IdakpD.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-C8ayPBtj.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./file-text-DcYSrI4v.js";import"./Provider-cJCdHAxu.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./openContent-C6XO6kr5.js";import"./AgentsSubnav-az_VDkri.js";import"./SecondaryNav-_wyKjwNf.js";import"./secondaryNavConfig-Dw3gS1jR.js";import"./message-square-D1hMsMj_.js";import"./terminal-DJPUp_Qn.js";import"./scroll-text-DPPYrqB9.js";import"./refresh-cw-C4x1x6b_.js";import"./bot-DzCOGKi6.js";import"./wrench-CvRjjByE.js";import"./server-BySujhDV.js";import"./VoicePermissionsPanel-Dd4ITJy_.js";import"./check-BX8nRgop.js";import"./copy-BFmOcWof.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,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}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 ms({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{ms as SettingsScreen};