@openscout/scout 0.2.102 → 0.2.105

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 (505) hide show
  1. package/README.md +37 -0
  2. package/bin/scout.mjs +6 -0
  3. package/bin/scoutd +0 -0
  4. package/dist/build-manifest.json +4 -4
  5. package/dist/chat.mjs +285 -0
  6. package/dist/client/assets/ActivityScreen-CcDdQTBK.js +1 -0
  7. package/dist/client/assets/{AddProjectForm-DfbjlFfy.js → AddProjectForm-CHNJ4NnS.js} +1 -1
  8. package/dist/client/assets/{AdventureEvidence-Dzz9VbuE.js → AdventureEvidence-B4mEvXeD.js} +1 -1
  9. package/dist/client/assets/{AdventureReader-ClMxT0e4.js → AdventureReader-ZsBDQITY.js} +1 -1
  10. package/dist/client/assets/{AdventureScenery-D548O0x4.js → AdventureScenery-DSxDlqG1.js} +1 -1
  11. package/dist/client/assets/AgentAdventures-BxrYq_2v.js +1 -0
  12. package/dist/client/assets/{AgentAvatar-BIwg54Tj.js → AgentAvatar-NZOqcsB2.js} +1 -1
  13. package/dist/client/assets/AgentConfigurationScreen-BhD1PEAM.js +1 -0
  14. package/dist/client/assets/AgentDefinitionsWorkspace-BqS6MXqF.js +1 -0
  15. package/dist/client/assets/{AgentDetailCard-CFDE8TLi.js → AgentDetailCard-MIEBKw_S.js} +1 -1
  16. package/dist/client/assets/AgentFloorView-A0dDRlRV.js +1 -0
  17. package/dist/client/assets/{AgentFloorWorld-BDJmXl3C.js → AgentFloorWorld-BTqwmK5G.js} +1 -1
  18. package/dist/client/assets/AgentInfoScreen-DuaN0sgE.js +1 -0
  19. package/dist/client/assets/{AgentLaneCard-C6YmwPxQ.js → AgentLaneCard-C4rKLLdT.js} +1 -1
  20. package/dist/client/assets/{AgentLaneChrome-D9uJ4QY7.js → AgentLaneChrome-fGC-ZrJS.js} +1 -1
  21. package/dist/client/assets/{AgentLaneDetailSheet-KYckCBCX.js → AgentLaneDetailSheet-BTF4_th9.js} +1 -1
  22. package/dist/client/assets/{AgentLaneSummaryResize-BBYBS3DO.js → AgentLaneSummaryResize-DgSeA_vS.js} +1 -1
  23. package/dist/client/assets/AgentLanesEmbedScreen-CeNiaZ9_.js +1 -0
  24. package/dist/client/assets/{AgentLanesPreflight-pw2vMO3Q.js → AgentLanesPreflight-CcS23wij.js} +1 -1
  25. package/dist/client/assets/{AgentLanesView-aAyC7lHf.js → AgentLanesView-WZhEDBFE.js} +1 -1
  26. package/dist/client/assets/{AgentLiveActions-lYzicnNa.js → AgentLiveActions-6Kfr1uOT.js} +1 -1
  27. package/dist/client/assets/AgentMasterScreen-DUDUTAnU.js +1 -0
  28. package/dist/client/assets/{AgentSessions-Cox2zS-e.js → AgentSessions-CO1WGa8Z.js} +2 -2
  29. package/dist/client/assets/AgentsConsole-BQOWkj35.js +1 -0
  30. package/dist/client/assets/AgentsScreen-BMNAj1PH.js +1 -0
  31. package/dist/client/assets/AgentsSubnav-CeHhuzyM.js +1 -0
  32. package/dist/client/assets/{AstronautSuit-C-4I5YKi.js → AstronautSuit-D67fIBdR.js} +1 -1
  33. package/dist/client/assets/{AtopView-DKm-ERYC.js → AtopView-Ck30FbzG.js} +1 -1
  34. package/dist/client/assets/{BackToPicker-Bys9ColC.js → BackToPicker-CkBhGRlD.js} +1 -1
  35. package/dist/client/assets/BriefingDetailScreen-yZG8_m4h.js +1 -0
  36. package/dist/client/assets/{BriefingsScreen-D4Zf31Y6.js → BriefingsScreen-DTxYMr3a.js} +1 -1
  37. package/dist/client/assets/{BrokerMetadataPanel-1GoSl2BV.js → BrokerMetadataPanel-crirZCdo.js} +1 -1
  38. package/dist/client/assets/BrokerScreen-CT37VQiL.js +8 -0
  39. package/dist/client/assets/Canvas-CRP0KjKb.js +1 -0
  40. package/dist/client/assets/{CastPicker-BuwE_JQp.js → CastPicker-ZPomvOf-.js} +1 -1
  41. package/dist/client/assets/ChannelComposer-BVItWlEz.js +1 -0
  42. package/dist/client/assets/ChannelSidebar-B-2spawY.js +1 -0
  43. package/dist/client/assets/{CharacterFamilyPreview-CfO3j8Of.js → CharacterFamilyPreview-ckVkecDO.js} +1 -1
  44. package/dist/client/assets/ChatAvatar-DKBsbOqk.js +1 -0
  45. package/dist/client/assets/ChatBits-CLJ71hTY.js +1 -0
  46. package/dist/client/assets/{ChatCollapsedStrip-TV0j1xTB.js → ChatCollapsedStrip-Co0NmqOO.js} +1 -1
  47. package/dist/client/assets/ChatRightPanel-pKQtkAgl.js +1 -0
  48. package/dist/client/assets/ChatSpaceSurface-NrLwdPkE.js +1 -0
  49. package/dist/client/assets/ChatSpaceTheme-BPMgPdVK.css +1 -0
  50. package/dist/client/assets/ChatSpaceTheme-D37Jk7bl.js +1 -0
  51. package/dist/client/assets/{CodeDiffPane-DB6-mqtX.js → CodeDiffPane-D-iv28LJ.js} +1 -1
  52. package/dist/client/assets/{CodeProjectPicker-B_LNLpIK.js → CodeProjectPicker-CZ3gDdiT.js} +1 -1
  53. package/dist/client/assets/{CodeScreen-C9H160XS.js → CodeScreen-CSC-zbP9.js} +1 -1
  54. package/dist/client/assets/{CommsCanvas-DOKw3Q8i.js → CommsCanvas-DdNAwjGW.js} +1 -1
  55. package/dist/client/assets/{CommsDeck-C18JA7rK.js → CommsDeck-mGWY7Ivi.js} +1 -1
  56. package/dist/client/assets/{CommsFlowGraph-Czg-KTS0.js → CommsFlowGraph-voDD9M5R.js} +1 -1
  57. package/dist/client/assets/{CommsFlowMap-CzBWvSa5.js → CommsFlowMap-C33sgD48.js} +1 -1
  58. package/dist/client/assets/{CommsSelection-g1twA-Lb.js → CommsSelection-BL8aYD7z.js} +1 -1
  59. package/dist/client/assets/{ConversationComposer-B7RU6LKd.js → ConversationComposer-DNcn5U6D.js} +1 -1
  60. package/dist/client/assets/ConversationFeedRows-RnYSa7Io.js +1 -0
  61. package/dist/client/assets/ConversationHeader-Y9TEJxP_.js +1 -0
  62. package/dist/client/assets/{ConversationPanels-C9yCAoJy.js → ConversationPanels-6pprBpmq.js} +2 -2
  63. package/dist/client/assets/ConversationScreen-tpj4cqWs.js +2 -0
  64. package/dist/client/assets/{ConversationStatus-CK-YfLpi.js → ConversationStatus-Cv-7hErW.js} +1 -1
  65. package/dist/client/assets/{CrewAvatar-CJhuqTsJ.js → CrewAvatar-zgzC3cbU.js} +1 -1
  66. package/dist/client/assets/{CrewSprite-hgpA3SWB.js → CrewSprite-Dp9KBBGY.js} +1 -1
  67. package/dist/client/assets/CrewWorkspaces-DDuYMByu.css +1 -0
  68. package/dist/client/assets/CrewWorkspaces-K2jcyLec.js +1 -0
  69. package/dist/client/assets/{DataTable-BMOZ1-z8.js → DataTable-av71ehJV.js} +1 -1
  70. package/dist/client/assets/{DispatchAftermath-DDlwqSCY.js → DispatchAftermath-CcYGUB10.js} +1 -1
  71. package/dist/client/assets/{DocumentFocusViewer-f12RRQpV.js → DocumentFocusViewer-DlMiEALb.js} +1 -1
  72. package/dist/client/assets/{EmbeddableSurfacesLab-DGl9EMRV.js → EmbeddableSurfacesLab-CTkO_tQR.js} +1 -1
  73. package/dist/client/assets/{EmptyState-uyYN5piI.js → EmptyState-CYUwYyAW.js} +1 -1
  74. package/dist/client/assets/{FileViewerPane-HtiDbj9N.js → FileViewerPane-Cxhixtks.js} +1 -1
  75. package/dist/client/assets/FlightObserveScreen-CvzhzuWc.js +1 -0
  76. package/dist/client/assets/{FloorContextSheet-DV-SYA0K.js → FloorContextSheet-Vj_wVZq1.js} +1 -1
  77. package/dist/client/assets/{FloorExchangePanel-D59nvRCF.js → FloorExchangePanel-CjHSDXad.js} +1 -1
  78. package/dist/client/assets/{FloorMessagePasses-BCwsz9VS.js → FloorMessagePasses-BG4ebnX5.js} +1 -1
  79. package/dist/client/assets/{FloorReplay-BHo79HCD.js → FloorReplay-BoYaGY9t.js} +1 -1
  80. package/dist/client/assets/FloorResourcesSheet-_Iy5UqgY.js +1 -0
  81. package/dist/client/assets/{FloorSavedWork-2tjBoy06.js → FloorSavedWork-jbtRs-YE.js} +1 -1
  82. package/dist/client/assets/{FloorTacticalHUD-Bngao6sn.js → FloorTacticalHUD-BhyOqlL5.js} +1 -1
  83. package/dist/client/assets/{FollowScreen-eHXOlK-u.js → FollowScreen-CupyOgt4.js} +1 -1
  84. package/dist/client/assets/HarnessMark-DSvM_H7H.js +1 -0
  85. package/dist/client/assets/HarnessesScreen-DyjqbZ4k.js +1 -0
  86. package/dist/client/assets/{HerdrSession-CtJOUn7H.js → HerdrSession-Dcm3vf9U.js} +1 -1
  87. package/dist/client/assets/{HomeHero-Cvwx2H0w.js → HomeHero-pIZtE1cC.js} +1 -1
  88. package/dist/client/assets/{HostAdvisorView-CTJXIc1Q.js → HostAdvisorView-Dv5meXo2.js} +1 -1
  89. package/dist/client/assets/InviteLandingScreen-xZQ2na1z.js +1 -0
  90. package/dist/client/assets/InviteSheet--5Zjct25.js +1 -0
  91. package/dist/client/assets/JumpPalette-BmiSOEmp.js +1 -0
  92. package/dist/client/assets/{KnowledgeSearchInspector-DwGMVmFL.js → KnowledgeSearchInspector-B8yiM524.js} +1 -1
  93. package/dist/client/assets/KnowledgeSearchScreen-BPqAjHnH.js +1 -0
  94. package/dist/client/assets/{LaneToolHoverCard-C6YehJqD.js → LaneToolHoverCard-D2cnTeUd.js} +1 -1
  95. package/dist/client/assets/LaneTraceDetailSheet-jl4XQmEx.js +1 -0
  96. package/dist/client/assets/{LaneTraceEventFocus-WLNZZVi_.js → LaneTraceEventFocus-BLhVHwff.js} +1 -1
  97. package/dist/client/assets/{MeshCanvas-FDDGE69h.js → MeshCanvas-BR25OBTJ.js} +1 -1
  98. package/dist/client/assets/{MeshCanvasMinimap-CGRzQCac.js → MeshCanvasMinimap-ClVolr4-.js} +1 -1
  99. package/dist/client/assets/MeshScreen-BW1dMFWF.js +1 -0
  100. package/dist/client/assets/{MeshTopologyView-C2Cv_2gx.js → MeshTopologyView-BT3ke2D1.js} +2 -2
  101. package/dist/client/assets/MessagesScreen-CtNMfIvC.js +1 -0
  102. package/dist/client/assets/{MissionContextRail-CVSZJnvX.js → MissionContextRail-CafjuseK.js} +1 -1
  103. package/dist/client/assets/MissionControlView-BjPOViGY.js +1 -0
  104. package/dist/client/assets/{MissionFocusOverlay-B9SiuO-i.js → MissionFocusOverlay-nhy3hkxQ.js} +1 -1
  105. package/dist/client/assets/MissionLeftAgentRow-Dms0DBjO.js +1 -0
  106. package/dist/client/assets/{MissionLogPane-CMBiI29U.js → MissionLogPane-DiUf3vWW.js} +1 -1
  107. package/dist/client/assets/NativeAreaScreen-BQSTo8As.js +1 -0
  108. package/dist/client/assets/NativeAreaScreen-Brix6xDB.js +1 -0
  109. package/dist/client/assets/NativeAreaScreen-D7HyQNlM.js +1 -0
  110. package/dist/client/assets/{NewAgentModal-Cl4nsGhu.js → NewAgentModal-BQ2wQ5gp.js} +1 -1
  111. package/dist/client/assets/NewChatComposer-BEXS8vV6.js +19 -0
  112. package/dist/client/assets/{NewChatOrigin-CyPPWTJP.js → NewChatOrigin-C8ROO4ps.js} +1 -1
  113. package/dist/client/assets/{NodeDetailPanel-BUG8rOb-.js → NodeDetailPanel-BNTqYC7m.js} +1 -1
  114. package/dist/client/assets/{NodeMenu-Fw8ATWQA.js → NodeMenu-CcOeFRCB.js} +1 -1
  115. package/dist/client/assets/{ObserveEmbedScreen-BPiSXXvm.js → ObserveEmbedScreen-Dh30EjAQ.js} +2 -2
  116. package/dist/client/assets/{ObserveTextFlow-ET0dD1wO.js → ObserveTextFlow-CC5mnngm.js} +2 -2
  117. package/dist/client/assets/{ObservedTopologyPanel-DkEkQzo-.js → ObservedTopologyPanel-DF6tRZL_.js} +1 -1
  118. package/dist/client/assets/OpenScoutAppShell-D9pgw36i.js +31 -0
  119. package/dist/client/assets/OpsAgentsView-D3rM0udq.js +1 -0
  120. package/dist/client/assets/OpsScreen-DySeNQ1V.js +1 -0
  121. package/dist/client/assets/OpsSubnav-C9E0r3GZ.js +1 -0
  122. package/dist/client/assets/ProjectAgentProfile-FUav75j2.js +1 -0
  123. package/dist/client/assets/{ProjectAgentProfileBar-C1fR65Eh.js → ProjectAgentProfileBar-C8z22pJ2.js} +1 -1
  124. package/dist/client/assets/ProjectAgentProfileHero-BLK0EwMg.js +1 -0
  125. package/dist/client/assets/ProjectsInbox-DfCXReZK.js +2 -0
  126. package/dist/client/assets/ProjectsRail-CELVubfJ.js +1 -0
  127. package/dist/client/assets/ProjectsScreen-DMw4TLKy.js +1 -0
  128. package/dist/client/assets/ProjectsThreadAside-D1Sh4fnX.js +1 -0
  129. package/dist/client/assets/{Provider-5Hotn7NQ.js → Provider-CNZluAZb.js} +2 -2
  130. package/dist/client/assets/{RailRow-BYguXNm4.js → RailRow-DUPqXMZh.js} +1 -1
  131. package/dist/client/assets/RailToggle-BwmY70B8.js +1 -0
  132. package/dist/client/assets/RawSessionsTable-6OVJq0JZ.js +1 -0
  133. package/dist/client/assets/RealtimeVoiceScreen-D41TYY0x.js +9 -0
  134. package/dist/client/assets/{RenderedWorkerSprite-CvdWO32C.js → RenderedWorkerSprite-C8fxndAh.js} +1 -1
  135. package/dist/client/assets/{ReplayClock-B7JLTp8A.js → ReplayClock-DUVJjrIu.js} +1 -1
  136. package/dist/client/assets/{ReplayLog-DZTpf2CW.js → ReplayLog-Bek1Vc4W.js} +1 -1
  137. package/dist/client/assets/{ReplayOutpost-CvWQa30T.js → ReplayOutpost-DlRg3172.js} +1 -1
  138. package/dist/client/assets/{RepoDiffEmbedScreen-Cbu0_PJW.js → RepoDiffEmbedScreen-CVUMnt6A.js} +1 -1
  139. package/dist/client/assets/{RepoDiffPageScreen-Chwm6GXL.js → RepoDiffPageScreen-D9-s5PyB.js} +1 -1
  140. package/dist/client/assets/{RepoDiffViewer-C2mb0Wj-.js → RepoDiffViewer-D7FN-oyY.js} +1 -1
  141. package/dist/client/assets/RepoDiffViewerLazy-BpMR7tlx.js +2 -0
  142. package/dist/client/assets/{ReposScreen-C7JZQmyh.js → ReposScreen-BQ7HO1om.js} +2 -2
  143. package/dist/client/assets/{RiggedWorkerCharacter-DNe731GE.js → RiggedWorkerCharacter-CJMWlvV-.js} +1 -1
  144. package/dist/client/assets/{SageModelStudio-BR1J2D4R.js → SageModelStudio-B526NSnw.js} +1 -1
  145. package/dist/client/assets/{ScoutDeckSurface-flRamdvE.js → ScoutDeckSurface-ChkvGyEW.js} +1 -1
  146. package/dist/client/assets/{ScoutSurface-BpklGmDL.js → ScoutSurface-6g1f5chk.js} +1 -1
  147. package/dist/client/assets/{ScoutbotFxLab-DeK7ySWZ.js → ScoutbotFxLab-BuwBdnPf.js} +1 -1
  148. package/dist/client/assets/{SecondaryNav-BkTn5tkq.js → SecondaryNav-Bs-_VwTC.js} +1 -1
  149. package/dist/client/assets/{SessionEmbedScreen-CcQN6xlo.js → SessionEmbedScreen-C2wf35-P.js} +1 -1
  150. package/dist/client/assets/{SessionObserve-DaqDhqDI.js → SessionObserve-B64YsYhy.js} +9 -9
  151. package/dist/client/assets/{SessionObserve-BOBJSfs0.css → SessionObserve-CDdJ7fAE.css} +1 -1
  152. package/dist/client/assets/{SessionObserveEvidence-Drv-D8Oh.js → SessionObserveEvidence-CS1aQBpQ.js} +1 -1
  153. package/dist/client/assets/SessionRefScreen-DURV0MpF.js +1 -0
  154. package/dist/client/assets/SessionsScreen-D71ZR-8t.js +1 -0
  155. package/dist/client/assets/{SettingsDrawer-BDapR4E9.js → SettingsDrawer-Nz98oBVl.js} +3 -3
  156. package/dist/client/assets/SettingsScreen-CYBHal6y.js +1 -0
  157. package/dist/client/assets/{SharedFloorCharacter-CSYG_t9t.js → SharedFloorCharacter-V04kD5T9.js} +1 -1
  158. package/dist/client/assets/SharedWorkFloor-C0xxW4SN.js +2 -0
  159. package/dist/client/assets/{ShikiPane-BudrOxNK.js → ShikiPane-XwFI-pCp.js} +1 -1
  160. package/dist/client/assets/{SlidePanel-Datu7XG4.js → SlidePanel-BMpkXai_.js} +1 -1
  161. package/dist/client/assets/SpaceSwitcher-BfeIf-ad.js +1 -0
  162. package/dist/client/assets/{SpriteAvatar-BW1JzkDt.js → SpriteAvatar-aHeF4ZQZ.js} +1 -1
  163. package/dist/client/assets/{SproutActionSprite-DveCzg6l.js → SproutActionSprite-DI5N3gOj.js} +1 -1
  164. package/dist/client/assets/{StatusPill-MxYClPG5.js → StatusPill-Dw4LP7wu.js} +1 -1
  165. package/dist/client/assets/{TailView-Dn7uWmPz.js → TailView-BofjmUMJ.js} +2 -2
  166. package/dist/client/assets/Terminal-jIqnIZZ6.js +4 -0
  167. package/dist/client/assets/TerminalEmbedScreen-3XsjuySR.js +1 -0
  168. package/dist/client/assets/{TerminalHeaderMount-DCGstkZ4.js → TerminalHeaderMount-CwbQhXcI.js} +1 -1
  169. package/dist/client/assets/TerminalRelay--qOBwnbR.js +46 -0
  170. package/dist/client/assets/{TextDocumentSurface-BhYvAB0o.js → TextDocumentSurface-BK6Qy41F.js} +1 -1
  171. package/dist/client/assets/{TmuxPeek-BhK0V9Qt.js → TmuxPeek-DpUT9Tpc.js} +1 -1
  172. package/dist/client/assets/{VoicePermissionsPanel-CecFWzva.js → VoicePermissionsPanel-D35fOnQj.js} +1 -1
  173. package/dist/client/assets/{WorkDetailScreen-CwtRCm_-.js → WorkDetailScreen-Bcf_yHhU.js} +2 -2
  174. package/dist/client/assets/{WorkFilesViewer-DJHftsH9.js → WorkFilesViewer-t8AEyx3Q.js} +1 -1
  175. package/dist/client/assets/{WorkRunView-x5PH1byG.js → WorkRunView-_mhG_FR2.js} +1 -1
  176. package/dist/client/assets/WorldActorTalk-CKerDikx.js +1 -0
  177. package/dist/client/assets/{WorldCharacter-Dn4sIXNP.js → WorldCharacter-BRrj3MQN.js} +1 -1
  178. package/dist/client/assets/{WorldMinimap-Blqg0d5r.js → WorldMinimap-DOptgrc4.js} +1 -1
  179. package/dist/client/assets/{WorldSky-DV9bpvXj.js → WorldSky-D-RJzSa6.js} +1 -1
  180. package/dist/client/assets/{activity-CSUhvjD0.js → activity-BJqFrZyB.js} +1 -1
  181. package/dist/client/assets/{addon-fit-MR98IWES.js → addon-fit-CHohcvS3.js} +1 -1
  182. package/dist/client/assets/{addon-webgl-CIIKXrvK.js → addon-webgl-CaRy2x2b.js} +1 -1
  183. package/dist/client/assets/agent-autocomplete-_u9o5EZu.js +2 -0
  184. package/dist/client/assets/{agent-essentials-8t2il7PV.js → agent-essentials-bKWYOZaH.js} +1 -1
  185. package/dist/client/assets/{agent-floor-actor-3v9drnxh.js → agent-floor-actor-DW8zLht0.js} +1 -1
  186. package/dist/client/assets/{agent-lane-card-model-l0stnU9N.js → agent-lane-card-model-CeqQGp-8.js} +1 -1
  187. package/dist/client/assets/{agent-lane-detail-Db7KyAlf.js → agent-lane-detail-Ti3trpfH.js} +1 -1
  188. package/dist/client/assets/{agent-lane-preview-B8lsQJOQ.js → agent-lane-preview-Dpa3DuOn.js} +1 -1
  189. package/dist/client/assets/{agent-lanes-model-CX0wTcnF.js → agent-lanes-model-DMAdqCmK.js} +1 -1
  190. package/dist/client/assets/{agent-specialization-CiVxQsFT.js → agent-specialization-BplZUa_0.js} +1 -1
  191. package/dist/client/assets/{api-B9_IqFKY.js → api-BQYTwoz6.js} +1 -1
  192. package/dist/client/assets/{api-CaROe5_H.js → api-DSqpVKC7.js} +1 -1
  193. package/dist/client/assets/{arc.es-BzhWalCl.js → arc.es-CubLvQ4W.js} +1 -1
  194. package/dist/client/assets/{arrow-left-PuKdO3NM.js → arrow-left-DFfKAq0d.js} +1 -1
  195. package/dist/client/assets/{arrow-right-ldbfp4SZ.js → arrow-right-DmAWnyAH.js} +1 -1
  196. package/dist/client/assets/{arrow-up-right-Hn754ybA.js → arrow-up-right-B0aLKiyF.js} +1 -1
  197. package/dist/client/assets/at-sign-DM7xeppo.js +1 -0
  198. package/dist/client/assets/{book-open-BlJnpf2U.js → book-open-BL9qvhEI.js} +1 -1
  199. package/dist/client/assets/{bot-CfN9PSBF.js → bot-BhAVbcCA.js} +1 -1
  200. package/dist/client/assets/{cache-DEy9E34b.js → cache-DGBo3vIf.js} +1 -1
  201. package/dist/client/assets/chat-api-BPVC0asu.js +1 -0
  202. package/dist/client/assets/chat-space-model-B6Jg2CY4.js +4 -0
  203. package/dist/client/assets/{check-B8dMv3Is.js → check-g7D7-c1J.js} +1 -1
  204. package/dist/client/assets/{chevron-down-B5eMsn5c.js → chevron-down-CDzRQQGl.js} +1 -1
  205. package/dist/client/assets/{chevron-right-C7UGFpkl.js → chevron-right-DKGTLiqc.js} +1 -1
  206. package/dist/client/assets/{chevron-up-BHOEgHcn.js → chevron-up-DX7R6KY2.js} +1 -1
  207. package/dist/client/assets/{chunk-HRAB3GC3-C5X-kFhb.js → chunk-HRAB3GC3-Dvk_QpRq.js} +1 -1
  208. package/dist/client/assets/{clock-DFcRbtrl.js → clock-CQb4FeMf.js} +1 -1
  209. package/dist/client/assets/{code-xml-BmyLM0I2.js → code-xml-Cmadr3pQ.js} +1 -1
  210. package/dist/client/assets/{coffee-C_D9zooM.js → coffee-ljG1_krY.js} +1 -1
  211. package/dist/client/assets/{compass-DTZdCpv9.js → compass-CvzkzkIh.js} +1 -1
  212. package/dist/client/assets/content-0AXa0klu.js +1 -0
  213. package/dist/client/assets/content-BEyJ19Lx.js +1 -0
  214. package/dist/client/assets/content-BN5weWKW.js +1 -0
  215. package/dist/client/assets/content-BNokkm7C.js +1 -0
  216. package/dist/client/assets/content-BV4PUM9q.js +1 -0
  217. package/dist/client/assets/content-BxUPlcx5.js +1 -0
  218. package/dist/client/assets/content-CIC5sku8.js +1 -0
  219. package/dist/client/assets/content-CKJ9zb7Z.js +1 -0
  220. package/dist/client/assets/content-CdkTyxqk.js +1 -0
  221. package/dist/client/assets/content-CnhhSCZq.js +1 -0
  222. package/dist/client/assets/content-D1Ze_FG9.js +1 -0
  223. package/dist/client/assets/content-DY3F9Vfr.js +1 -0
  224. package/dist/client/assets/content-DrKBYpcb.js +1 -0
  225. package/dist/client/assets/content-LSStQYj5.js +1 -0
  226. package/dist/client/assets/content-YvU-D0hF.js +1 -0
  227. package/dist/client/assets/content-oKQMyVnH.js +1 -0
  228. package/dist/client/assets/{context-budget-DemtXu7E.js → context-budget-8qFKqM-j.js} +1 -1
  229. package/dist/client/assets/{conversation-icons-BQ4OeOmr.js → conversation-icons-CIRaxmid.js} +1 -1
  230. package/dist/client/assets/{conversation-model-BGFHoxQ0.js → conversation-model-m8HhzroS.js} +1 -1
  231. package/dist/client/assets/conversation-motion-features-D9PxLoDt.js +1 -0
  232. package/dist/client/assets/{copy-D9WUpQRf.js → copy-BGOC1tJB.js} +1 -1
  233. package/dist/client/assets/{cpu-Ck_4tB_-.js → cpu-Q6nrHFTN.js} +1 -1
  234. package/dist/client/assets/{createLucideIcon-DkjnzvcJ.js → createLucideIcon-ChvMq-zl.js} +1 -1
  235. package/dist/client/assets/{credentials-C4VXz2hr.js → credentials-OeoF-VKJ.js} +1 -1
  236. package/dist/client/assets/discover-DlwbftpC.js +2 -0
  237. package/dist/client/assets/embed-entry-c0lwtjBG.js +2 -0
  238. package/dist/client/assets/{external-link-RT4Ph-6-.js → external-link-BVccgH0n.js} +1 -1
  239. package/dist/client/assets/{eye-CtqSV8BS.js → eye-CsGfEVR6.js} +1 -1
  240. package/dist/client/assets/{file-code-corner-D_Aptal2.js → file-code-corner-Be6da5l3.js} +1 -1
  241. package/dist/client/assets/{file-text-ChtICwub.js → file-text-DP6txVW-.js} +1 -1
  242. package/dist/client/assets/{flag-CqdOxVkI.js → flag-DAFE2wZ5.js} +1 -1
  243. package/dist/client/assets/{floor-context-model-DZBpo_oD.js → floor-context-model-rWKqaKmV.js} +1 -1
  244. package/dist/client/assets/{floor-message-passes-CJh9f8Jp.js → floor-message-passes-CO3Ix_wR.js} +1 -1
  245. package/dist/client/assets/{folder-0fWevPvQ.js → folder-B_S7gBVr.js} +1 -1
  246. package/dist/client/assets/{gauge-Dgtfxf_o.js → gauge-DQCGlE3o.js} +1 -1
  247. package/dist/client/assets/{gestures-BDCZ1FRG.js → gestures-CofqY4Km.js} +1 -1
  248. package/dist/client/assets/{git-branch-CA3cHKCI.js → git-branch-DcUCsWdJ.js} +1 -1
  249. package/dist/client/assets/{go-shortcuts-DKtw4qYx.js → go-shortcuts-KQy-ZOpV.js} +1 -1
  250. package/dist/client/assets/{home-moving-signal-B7m-ngb2.js → home-moving-signal-BIHUGNfI.js} +1 -1
  251. package/dist/client/assets/home-now-card-CaLgZze2.js +1 -0
  252. package/dist/client/assets/{home-now-card-nano-D1ScGrgv.js → home-now-card-nano-CvU8B61b.js} +1 -1
  253. package/dist/client/assets/hooks-DaUOREpP.js +2 -0
  254. package/dist/client/assets/index-CGbs0SBm.css +1 -0
  255. package/dist/client/assets/index-CbqBwfIW.js +1 -0
  256. package/dist/client/assets/index-CyPMl7Up.js +1 -0
  257. package/dist/client/assets/index-DReVb7jZ.js +10 -0
  258. package/dist/client/assets/index-PQpJveGO.js +1 -0
  259. package/dist/client/assets/{index-CvsM3jm8.js → index-kkXUq-zf.js} +1 -1
  260. package/dist/client/assets/{inspector-panel-BLhDODb3.js → inspector-panel-CLU7wjnT.js} +2 -2
  261. package/dist/client/assets/{keyboard-nav-CXfav14z.js → keyboard-nav-CJXPaHXj.js} +1 -1
  262. package/dist/client/assets/lane-ask-display-BTVSakyo.js +18 -0
  263. package/dist/client/assets/{lane-observe-BD21P8BB.js → lane-observe-CteDwdD-.js} +3 -3
  264. package/dist/client/assets/{lane-roster-store-DzNHP392.js → lane-roster-store-Ch9t6lb0.js} +1 -1
  265. package/dist/client/assets/{layers-Bolb8ejU.js → layers-BOwyWodP.js} +1 -1
  266. package/dist/client/assets/{layout-grid-DI9tVJ2E.js → layout-grid-B36Qsh0y.js} +1 -1
  267. package/dist/client/assets/left-0vBrvrBG.js +2 -0
  268. package/dist/client/assets/left-C6SyaqlJ.js +1 -0
  269. package/dist/client/assets/left-CTuXysZR.js +2 -0
  270. package/dist/client/assets/left-Cc6s4DT2.js +1 -0
  271. package/dist/client/assets/left-DF5caiyh.js +1 -0
  272. package/dist/client/assets/left-DgT4tWCx.js +1 -0
  273. package/dist/client/assets/left-R0wppTTr.js +1 -0
  274. package/dist/client/assets/left-advisor-C-kt8V28.js +1 -0
  275. package/dist/client/assets/left-agents-thnBO156.js +1 -0
  276. package/dist/client/assets/left-default-CT42fnpF.js +1 -0
  277. package/dist/client/assets/left-lanes-CSmZgciK.js +1 -0
  278. package/dist/client/assets/left-mission-C86x6i9h.js +1 -0
  279. package/dist/client/assets/library-DdhYL_9v.js +1 -0
  280. package/dist/client/assets/{loader-circle-DurUYl7E.js → loader-circle-DNUsuPWz.js} +1 -1
  281. package/dist/client/assets/{local-agents-D9fYYRyj.js → local-agents-I40PawYA.js} +1 -1
  282. package/dist/client/assets/{machine-children-RGS4Q0r6.js → machine-children-CdhNzDF0.js} +1 -1
  283. package/dist/client/assets/{mentions-Ctw1ECUC.js → mentions-Ck_Vjnyp.js} +1 -1
  284. package/dist/client/assets/{mesh-ops-CGpRk4ik.js → mesh-ops-DSlvHp-D.js} +1 -1
  285. package/dist/client/assets/{mesh-view-store-CliSYsmt.js → mesh-view-store-C1-mdP3P.js} +1 -1
  286. package/dist/client/assets/{message-circle-CSiJj6yo.js → message-circle-cI5_A5mj.js} +1 -1
  287. package/dist/client/assets/{message-markup-DgFSyb3f.js → message-markup-6Tgo4qFJ.js} +1 -1
  288. package/dist/client/assets/{message-square-NmXWtWLR.js → message-square-CJW4WRlo.js} +1 -1
  289. package/dist/client/assets/{mission-control-store-DZ29Mlj1.js → mission-control-store-p_cboAm4.js} +1 -1
  290. package/dist/client/assets/monitor-C7_cHlkC.js +1 -0
  291. package/dist/client/assets/{nav-destinations-CyXnw9kh.js → nav-destinations-CU_euC-Q.js} +1 -1
  292. package/dist/client/assets/{observe-CkfOxYx_.js → observe-CtS0l3zu.js} +1 -1
  293. package/dist/client/assets/{operator-attention-DGR4kOog.js → operator-attention-DBaRg5ep.js} +1 -1
  294. package/dist/client/assets/{page-status-CkS3SZu-.js → page-status-DwFR4wSw.js} +1 -1
  295. package/dist/client/assets/{panel-right-BNTJhy8M.js → panel-right-qP17MwMl.js} +1 -1
  296. package/dist/client/assets/{pause-DWS7YGQ3.js → pause-B_hliKuR.js} +1 -1
  297. package/dist/client/assets/{persistent-state-xsuk6Kc-.js → persistent-state-BUsTTZFE.js} +1 -1
  298. package/dist/client/assets/{pin-DWlD1BOF.js → pin-Oi4qHR6M.js} +1 -1
  299. package/dist/client/assets/{play-D_Pggug4.js → play-CVeRmqLH.js} +1 -1
  300. package/dist/client/assets/{plus-D_wLGJGT.js → plus-D5NLH_fM.js} +1 -1
  301. package/dist/client/assets/profile-BegEUmB7.js +1 -0
  302. package/dist/client/assets/projects-inbox-CKPLZN8s.css +1 -0
  303. package/dist/client/assets/{projects-inbox-DvbqJO3q.js → projects-inbox-CfwxCTdN.js} +1 -1
  304. package/dist/client/assets/provider-DwmCoSlc.js +1 -0
  305. package/dist/client/assets/{proxy-DOG46ja4.js → proxy-DgzP27W8.js} +1 -1
  306. package/dist/client/assets/{radio-C_jtwbFP.js → radio-Cas2qg1D.js} +1 -1
  307. package/dist/client/assets/{refresh-cw-Da9DDLk2.js → refresh-cw-IcD2lPoT.js} +1 -1
  308. package/dist/client/assets/resolve-panes-pfZTezKo.js +1 -0
  309. package/dist/client/assets/resolve-sidebar-context-D5ksvrb_.js +1 -0
  310. package/dist/client/assets/right-BDaCJ0CF.js +1 -0
  311. package/dist/client/assets/right-BP6lXRFS.js +1 -0
  312. package/dist/client/assets/right-Cb1VCrdj.js +1 -0
  313. package/dist/client/assets/right-CeFaxfBo.js +1 -0
  314. package/dist/client/assets/right-Ck2SrYCj.js +1 -0
  315. package/dist/client/assets/right-D-uv5YfF.js +1 -0
  316. package/dist/client/assets/right-DJMSICky.js +1 -0
  317. package/dist/client/assets/right-Dnljs8ah.js +1 -0
  318. package/dist/client/assets/right-SdCSF8PP.js +1 -0
  319. package/dist/client/assets/{right-BLJsc2-p.js → right-cjPTwPXS.js} +1 -1
  320. package/dist/client/assets/{rocket-DyrYDo8V.js → rocket-DAqYvu8I.js} +1 -1
  321. package/dist/client/assets/router-C-MF5-mb.js +1 -0
  322. package/dist/client/assets/{runtime-picker-DdsttHHc.js → runtime-picker-C_AVYF63.js} +1 -1
  323. package/dist/client/assets/{scope-views-B7PZGlhY.js → scope-views-Dl3ml9OZ.js} +1 -1
  324. package/dist/client/assets/{scout-voice-DOQ_B77g.js → scout-voice-CqAyfblr.js} +1 -1
  325. package/dist/client/assets/{scoutbot-markdown-Bz0Vbto2.js → scoutbot-markdown-DwvGQOWo.js} +1 -1
  326. package/dist/client/assets/{scroll-text-DwC8r2g6.js → scroll-text-B0tKI9Sg.js} +1 -1
  327. package/dist/client/assets/{search-C4VlW_0l.js → search-UsM-9-_W.js} +1 -1
  328. package/dist/client/assets/secondaryNavConfig-D15P1Y9k.css +1 -0
  329. package/dist/client/assets/secondaryNavConfig-DzNHk6IH.js +1 -0
  330. package/dist/client/assets/{selection-bridge-B5jqyMR9.js → selection-bridge-OTS2iFkt.js} +1 -1
  331. package/dist/client/assets/{send-horizontal-pOtGI7FM.js → send-horizontal-BlQsRK6C.js} +1 -1
  332. package/dist/client/assets/{send-to-agent-session-BZGq_ycy.js → send-to-agent-session-C1mgqdow.js} +1 -1
  333. package/dist/client/assets/{server-ms1yxUYJ.js → server-DBlPW0Mp.js} +1 -1
  334. package/dist/client/assets/{session-catalog-s-T_w41t.js → session-catalog-CnpZMB7C.js} +1 -1
  335. package/dist/client/assets/{session-table-CDx_16xf.js → session-table-CGkfG5Yd.js} +1 -1
  336. package/dist/client/assets/{sessions-view-DzYGsKWS.js → sessions-view-Bge4XZ4I.js} +1 -1
  337. package/dist/client/assets/{settings-TJIkkZ0P.js → settings-C69Zjrpq.js} +1 -1
  338. package/dist/client/assets/{shared-work-artifacts-4IIQXQfc.js → shared-work-artifacts-DfNl9KTo.js} +1 -1
  339. package/dist/client/assets/{sliders-horizontal-CHf3ntw0.js → sliders-horizontal-6bzeod7c.js} +1 -1
  340. package/dist/client/assets/{sparkles-BbOFw3d0.js → sparkles-Cc5lPZRv.js} +1 -1
  341. package/dist/client/assets/{sse-v5QLsOHV.js → sse-A8AyLH0g.js} +1 -1
  342. package/dist/client/assets/{tail-events-DQ46QBW1.js → tail-events-C4WdhVeK.js} +1 -1
  343. package/dist/client/assets/{terminal-96JWDYDL.js → terminal-DMZjX1es.js} +1 -1
  344. package/dist/client/assets/{terminal-relay-Bfx8pg80.js → terminal-relay-mO89dX-Y.js} +1 -1
  345. package/dist/client/assets/{terminal-sessions-Ch9aYlgi.js → terminal-sessions-3RfJpen8.js} +1 -1
  346. package/dist/client/assets/{terminal-takeover-BlpxpvSp.js → terminal-takeover-CZZsnPzj.js} +1 -1
  347. package/dist/client/assets/use-beside-D3cJpA5p.js +1 -0
  348. package/dist/client/assets/{use-conversation-list-A_YUf8lo.js → use-conversation-list-D5EnpVba.js} +1 -1
  349. package/dist/client/assets/{use-fleet-active-asks-DFs_u-vM.js → use-fleet-active-asks-D_QOmjg5.js} +1 -1
  350. package/dist/client/assets/{use-mesh-node-state-Ck9CYplv.js → use-mesh-node-state-3V3ADQ-G.js} +1 -1
  351. package/dist/client/assets/{use-mesh-ops-items-Be1WmwCg.js → use-mesh-ops-items-DI9GKWlF.js} +1 -1
  352. package/dist/client/assets/{use-reduced-motion-D7n3vK8t.js → use-reduced-motion-CiaZHMnk.js} +1 -1
  353. package/dist/client/assets/use-scout-dev-flags-CkdAHlDR.js +1 -0
  354. package/dist/client/assets/{useAgentHoverCard-Dr-OjNFF.js → useAgentHoverCard-A3QGXqIy.js} +1 -1
  355. package/dist/client/assets/useContentSecondaryNav-DrL_nkCZ.js +1 -0
  356. package/dist/client/assets/{useEmbedHeadline-BL8wQawZ.js → useEmbedHeadline-atkQVfGw.js} +1 -1
  357. package/dist/client/assets/usePersistentState-Y8XwSTg-.js +1 -0
  358. package/dist/client/assets/{usePierreRuntime-DJkRHMoe.js → usePierreRuntime-DTvcwISe.js} +1 -1
  359. package/dist/client/assets/users-RLK3P5U4.js +1 -0
  360. package/dist/client/assets/{wrench-BsMTSeji.js → wrench-B4maQJai.js} +1 -1
  361. package/dist/client/assets/{x-DI1ktCYb.js → x-rlMdRqJF.js} +1 -1
  362. package/dist/client/assets/{xterm-B1YBE4Gq.js → xterm-B1zHHOLQ.js} +1 -1
  363. package/dist/client/assets/{zap-sKPkh4sQ.js → zap-B4X0OrEw.js} +1 -1
  364. package/dist/client/index.html +15 -3
  365. package/dist/drizzle/0019_session_actor_targets.sql +227 -0
  366. package/dist/drizzle/README.md +19 -0
  367. package/dist/drizzle/meta/0019_snapshot.json +6804 -0
  368. package/dist/drizzle/meta/_journal.json +7 -0
  369. package/dist/highlights-eq9cgrbb.scm +604 -0
  370. package/dist/highlights-ghv9g403.scm +205 -0
  371. package/dist/highlights-hk7bwhj4.scm +284 -0
  372. package/dist/highlights-r812a2qc.scm +150 -0
  373. package/dist/highlights-x6tmsnaa.scm +115 -0
  374. package/dist/injections-73j83es3.scm +27 -0
  375. package/dist/main.mjs +1214 -722
  376. package/dist/node/main.mjs +133 -22
  377. package/dist/pairing-runtime-controller.mjs +715 -492
  378. package/dist/runtime/base-daemon.mjs +14176 -58
  379. package/dist/runtime/broker-daemon.mjs +15520 -445
  380. package/dist/runtime/broker-process-manager.mjs +5 -3
  381. package/dist/runtime/mesh-discover.mjs +5 -3
  382. package/dist/scout-control-plane-web.mjs +21065 -3387
  383. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  384. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  385. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  386. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  387. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  388. package/dist/update-helper.mjs +83 -17
  389. package/package.json +2 -2
  390. package/dist/client/assets/ActivityScreen-DCALiEXY.js +0 -1
  391. package/dist/client/assets/AgentAdventures-NwTKeF0F.js +0 -1
  392. package/dist/client/assets/AgentConfigurationScreen-B2Hw0ce1.js +0 -1
  393. package/dist/client/assets/AgentDefinitionsWorkspace-CwZJ833X.js +0 -1
  394. package/dist/client/assets/AgentFloorView-l2wNKFob.js +0 -1
  395. package/dist/client/assets/AgentInfoScreen-ClZM1wQb.js +0 -1
  396. package/dist/client/assets/AgentLanesEmbedScreen-DqHwqY0X.js +0 -1
  397. package/dist/client/assets/AgentMasterScreen-By6DN0jF.js +0 -1
  398. package/dist/client/assets/AgentsConsole-Dq0S_hRA.js +0 -1
  399. package/dist/client/assets/AgentsScreen-Bi9Lx47B.js +0 -1
  400. package/dist/client/assets/AgentsSubnav-BOobgtGE.js +0 -1
  401. package/dist/client/assets/BriefingDetailScreen-sprFl4Nk.js +0 -1
  402. package/dist/client/assets/BrokerScreen-CejzhRsB.js +0 -8
  403. package/dist/client/assets/ConversationFeedRows-DVqnZQH0.js +0 -1
  404. package/dist/client/assets/ConversationHeader-CCSU8uo_.js +0 -1
  405. package/dist/client/assets/ConversationScreen-tTP6B_F-.js +0 -2
  406. package/dist/client/assets/CrewWorkspaces-4O8dgRUD.js +0 -1
  407. package/dist/client/assets/CrewWorkspaces-Diq11KDq.css +0 -1
  408. package/dist/client/assets/FlightObserveScreen-DDXfNbsw.js +0 -1
  409. package/dist/client/assets/FloorResourcesSheet-Djrgd_ZU.js +0 -1
  410. package/dist/client/assets/HarnessMark-Bt47OeHy.js +0 -1
  411. package/dist/client/assets/HarnessesScreen-M84sFjWY.js +0 -1
  412. package/dist/client/assets/KnowledgeSearchScreen-WC0WhFio.js +0 -1
  413. package/dist/client/assets/LaneTraceDetailSheet-mAhj7MJi.js +0 -1
  414. package/dist/client/assets/MeshScreen-DlfiMlaR.js +0 -1
  415. package/dist/client/assets/MessagesScreen-BZ7yaGJx.js +0 -1
  416. package/dist/client/assets/MissionControlView-DpGhxG4a.js +0 -1
  417. package/dist/client/assets/MissionLeftAgentRow-DhhRRim0.js +0 -1
  418. package/dist/client/assets/NativeAreaScreen-BQyHHRAM.js +0 -1
  419. package/dist/client/assets/NativeAreaScreen-Ditv-TYW.js +0 -1
  420. package/dist/client/assets/NativeAreaScreen-Dq3uPSEI.js +0 -1
  421. package/dist/client/assets/NewChatComposer-JjLbm3W2.js +0 -19
  422. package/dist/client/assets/OpenScoutAppShell-CzKbjwCA.js +0 -22
  423. package/dist/client/assets/OpsAgentsView-CZbtkcQH.js +0 -1
  424. package/dist/client/assets/OpsScreen-DJq-aBmX.js +0 -1
  425. package/dist/client/assets/OpsSubnav-9sURjajO.js +0 -1
  426. package/dist/client/assets/ProjectAgentProfile-q_1tMJIL.js +0 -1
  427. package/dist/client/assets/ProjectAgentProfileHero-DyEFyTFs.js +0 -1
  428. package/dist/client/assets/ProjectsInbox-Bs8I__my.js +0 -2
  429. package/dist/client/assets/ProjectsRail-Deb38OJ1.js +0 -1
  430. package/dist/client/assets/ProjectsScreen-CgLiYiss.js +0 -1
  431. package/dist/client/assets/ProjectsThreadAside-C0Yw3yIL.js +0 -1
  432. package/dist/client/assets/RawSessionsTable-DIhmlvk-.js +0 -1
  433. package/dist/client/assets/RealtimeVoiceScreen-3oU7b7V5.js +0 -1
  434. package/dist/client/assets/RepoDiffViewerLazy-BQ6ZCrsq.js +0 -2
  435. package/dist/client/assets/SessionRefScreen-BOQ1_ydg.js +0 -1
  436. package/dist/client/assets/SessionsScreen-R8QKvoey.js +0 -1
  437. package/dist/client/assets/SettingsScreen-DirtO7Z0.js +0 -1
  438. package/dist/client/assets/SharedWorkFloor-yPWFLZwX.js +0 -2
  439. package/dist/client/assets/Terminal-D-DsQlmV.js +0 -4
  440. package/dist/client/assets/TerminalEmbedScreen-9Gmln759.js +0 -1
  441. package/dist/client/assets/WorldActorTalk-uIH2jGqA.js +0 -1
  442. package/dist/client/assets/agent-autocomplete-CeHQpuG9.js +0 -10
  443. package/dist/client/assets/arrow-down-WoVlkUmg.js +0 -1
  444. package/dist/client/assets/chunk-JTPDIGGW-ZC-98AHT.js +0 -46
  445. package/dist/client/assets/chunk-T65CQEWV-CSVUz2rY.js +0 -1
  446. package/dist/client/assets/chunk-YOZR3KYS-B59jqwO0.js +0 -2
  447. package/dist/client/assets/content-B5Q4pb9R.js +0 -1
  448. package/dist/client/assets/content-BK1IfOZs.js +0 -1
  449. package/dist/client/assets/content-BeEsWLEm.js +0 -1
  450. package/dist/client/assets/content-BkOwEknW.js +0 -1
  451. package/dist/client/assets/content-C32W5kAG.js +0 -1
  452. package/dist/client/assets/content-CoqyLs9v.js +0 -1
  453. package/dist/client/assets/content-CwpdIS5b.js +0 -1
  454. package/dist/client/assets/content-DS2OkJ3Q.js +0 -1
  455. package/dist/client/assets/content-DXKaPDfn.js +0 -1
  456. package/dist/client/assets/content-DZt5-dkI.js +0 -1
  457. package/dist/client/assets/content-DbQJH8L1.js +0 -1
  458. package/dist/client/assets/content-DetoiaHq.js +0 -1
  459. package/dist/client/assets/content-Dhu3wL7J.js +0 -1
  460. package/dist/client/assets/content-Dpv34iZu.js +0 -1
  461. package/dist/client/assets/content-TtQJb61D.js +0 -1
  462. package/dist/client/assets/content-ymNb2R7g.js +0 -1
  463. package/dist/client/assets/conversation-motion-features-9x8uZpwh.js +0 -1
  464. package/dist/client/assets/discover-C8IOY7_K.js +0 -2
  465. package/dist/client/assets/embed-entry-CG3CfCbm.js +0 -2
  466. package/dist/client/assets/home-now-card-DduXkHRR.js +0 -1
  467. package/dist/client/assets/hooks-C6VyQTQe.js +0 -2
  468. package/dist/client/assets/index-C5cX8dkl.js +0 -1
  469. package/dist/client/assets/index-C8uS5szO.js +0 -10
  470. package/dist/client/assets/index-Ck1__1yL.css +0 -1
  471. package/dist/client/assets/index-ClOOrVG1.js +0 -1
  472. package/dist/client/assets/index-Crtgfc9I.js +0 -1
  473. package/dist/client/assets/lane-ask-display-B6iCAVcd.js +0 -18
  474. package/dist/client/assets/left-B-_z_nqj.js +0 -2
  475. package/dist/client/assets/left-B1LY7rJc.js +0 -1
  476. package/dist/client/assets/left-C6bdjWcG.js +0 -2
  477. package/dist/client/assets/left-CF4iuqlz.js +0 -1
  478. package/dist/client/assets/left-DLtNyZl1.js +0 -1
  479. package/dist/client/assets/left-Fpxoq-VY.js +0 -1
  480. package/dist/client/assets/left-N2wXfTlp.js +0 -1
  481. package/dist/client/assets/left-advisor-CeIjCKbd.js +0 -1
  482. package/dist/client/assets/left-agents-upjHVlOj.js +0 -1
  483. package/dist/client/assets/left-default-08gmdCtb.js +0 -1
  484. package/dist/client/assets/left-lanes-Cvsp73Hw.js +0 -1
  485. package/dist/client/assets/left-mission-W1LLaz74.js +0 -1
  486. package/dist/client/assets/library-DLKBVUJ6.js +0 -1
  487. package/dist/client/assets/profile-C3KgiZvc.js +0 -1
  488. package/dist/client/assets/projects-inbox-BIW7nv-H.css +0 -1
  489. package/dist/client/assets/resolve-panes-DuowGRTk.js +0 -1
  490. package/dist/client/assets/resolve-sidebar-context-BkTbqteq.js +0 -1
  491. package/dist/client/assets/right-B9OUA6Ho.js +0 -1
  492. package/dist/client/assets/right-BDQnjetX.js +0 -1
  493. package/dist/client/assets/right-BUbKHmRH.js +0 -1
  494. package/dist/client/assets/right-Ci2IcD4s.js +0 -1
  495. package/dist/client/assets/right-CmCce3e5.js +0 -1
  496. package/dist/client/assets/right-D7w0zM5a.js +0 -1
  497. package/dist/client/assets/right-DIoON_bv.js +0 -1
  498. package/dist/client/assets/right-E0Jr3VN5.js +0 -1
  499. package/dist/client/assets/right-lCdAk9dW.js +0 -1
  500. package/dist/client/assets/router-BKiMcYa7.js +0 -1
  501. package/dist/client/assets/secondaryNavConfig-DAXIFtVd.js +0 -1
  502. package/dist/client/assets/secondaryNavConfig-xssF_ubT.css +0 -1
  503. package/dist/client/assets/use-beside-Df-F2Uvg.js +0 -1
  504. package/dist/client/assets/use-scout-dev-flags-0TXfQcG0.js +0 -1
  505. package/dist/client/assets/useContentSecondaryNav-CGvMOVGY.js +0 -1
@@ -1,3 +1,3 @@
1
- import{x as Z,l as fe,n as Se,C as te,r as o,q as Ne,j as e,u as ae,a6 as we,w as ke}from"./index-C8uS5szO.js";import{a as Ce,k as Ae}from"./router-BKiMcYa7.js";import{a as B}from"./api-CaROe5_H.js";import{g as Ee,a as Te,e as Oe,s as Re,b as Pe,d as Ie,c as $e}from"./credentials-C4VXz2hr.js";import{u as ee,B as Le,K as Me,M as _e,N as De}from"./Provider-5Hotn7NQ.js";import{t as Ve}from"./time-Dhsh_2EG.js";import{l as He,m as ze,n as Be}from"./scout-voice-DOQ_B77g.js";import{u as Fe}from"./keyboard-nav-CXfav14z.js";import{C as J}from"./CrewAvatar-CJhuqTsJ.js";import{C as Ue}from"./CastPicker-BuwE_JQp.js";import{p as ne}from"./AgentAvatar-BIwg54Tj.js";import{S as ie}from"./SpriteAvatar-BW1JzkDt.js";import{VoiceHostStatusBanner as Ke,VoicePermissionsPanel as We}from"./VoicePermissionsPanel-CecFWzva.js";import{u as Ge}from"./chunk-HRAB3GC3-C5X-kFhb.js";import{C as D}from"./check-B8dMv3Is.js";import{c as se}from"./createLucideIcon-DkjnzvcJ.js";import{R as qe}from"./refresh-cw-Da9DDLk2.js";import{C as Ye}from"./copy-D9WUpQRf.js";import{a as Xe}from"./DocumentFocusViewer-f12RRQpV.js";import{S as Ze}from"./sparkles-BbOFw3d0.js";const Qe=[["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"}]],Je=se("monitor",Qe);const es=[["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"}]],ss=se("moon",es);const ts=[["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"}]],as=se("sun",ts);function ns(t){const[s,n]=o.useState(0),i=o.useRef([]);return o.useEffect(()=>{if(t<3||typeof window>"u"||window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;const h=()=>{i.current.push(window.setTimeout(()=>{n(1),i.current.push(window.setTimeout(()=>n(2),40)),i.current.push(window.setTimeout(()=>n(1),90)),i.current.push(window.setTimeout(()=>{n(0),h()},130))},2600+Math.random()*4200))};h();const m=i.current;return()=>{m.forEach(x=>window.clearTimeout(x)),m.length=0}},[t]),t<3?0:s}function is({slug:t,open:s=!1,onToggle:n,coin:i=56,figure:h=240,hue:m,state:x="idle",interactive:b=!0,className:f,style:d,children:c}){const a=t.toLowerCase(),r=te[a]??te.milo,p=fe[a],N=Z.find(M=>M.slug===a)??Z[0],I=ns(p?p.roles.length+1:1),S=p&&I>0?Se[I]?.role:void 0,[w,A,$]=r.coin,v=i/$,_=h*r.w/r.h,O=h/r.h,V=s?_:i,H=s?h:i,z=s?_:r.w*v,R=s?h:r.h*v,E=s?0:-w*v,L=s?0:-A*v,T=o.useMemo(()=>Ne(m??null,r.ink),[m,r.ink]),G=p?p.patch[2]*(s?O:v):0,F=p?p.patch[3]*(s?O:v):0,P=p?(s?0:E)+p.patch[0]*(s?O:v):0,U=p?(s?0:L)+p.patch[1]*(s?O:v):0;return e.jsxs("div",{className:`xc-stage-wrapper ${f||""}`,style:d,"data-open":s?"true":"false",children:[e.jsxs("div",{className:"xc-stage",role:b?"button":void 0,tabIndex:b?0:void 0,"aria-label":`${N.name} (${s?"Full body breakout":"Coin disc"})`,onClick:b?n:void 0,onKeyDown:b&&n?M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),n())}:void 0,style:{width:V,height:H,borderRadius:s?"16px":"50%"},children:[e.jsx("span",{className:"xc-stage-ground",style:{background:T,opacity:s?.92:1,borderRadius:s?"16px":"50%"}}),e.jsx("img",{src:ae(`${a}-bust.webp`),alt:N.name,className:"xc-stage-img",style:{width:z,height:R,left:E,top:L}}),p&&S&&e.jsx("img",{src:ae(`${p.dir}/${S}.webp`),alt:"",className:"xc-stage-patch",style:{width:G,height:F,left:P,top:U}})]}),c]})}const pe="/api/voice/playback/settings",ls="scout:voice-playback-settings",rs="OPENSCOUT_VOICE_PLAYBACK",os="openscout.voice-playback-settings";function cs(t){return B(pe,{signal:t,cache:"no-store"})}function ds(t){return B(pe,{method:"PUT",body:JSON.stringify({playback:t})})}function us(t){if(window.dispatchEvent(new CustomEvent(ls,{detail:t})),!("BroadcastChannel"in window))return;const s=new BroadcastChannel(os);s.postMessage(t),s.close()}const hs=[195,125,300,45,355,210];function ms(t){return`oklch(0.80 0.14 ${t})`}function j({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 k({label:t,hint:s,children:n}){return e.jsxs("div",{className:"s-settings-field",children:[e.jsx("label",{className:"s-settings-field-label",children:t}),n,s&&e.jsx("span",{className:"s-settings-field-hint",children:s})]})}function K({value:t,onChange:s,mono:n}){return e.jsx("input",{className:`s-settings-input${n?" s-settings-input--mono":""}`,value:t,onChange:i=>s(i.target.value)})}function le({value:t,onChange:s,rows:n=3}){return e.jsx("textarea",{className:"s-settings-textarea",value:t,onChange:i=>s(i.target.value),rows:n})}function gs({value:t,onChange:s,min:n,max:i,step:h=1,unit:m=""}){return e.jsxs("div",{className:"s-settings-slider-wrap",children:[e.jsx("input",{type:"range",min:n,max:i,step:h,value:t,onChange:x=>s(Number(x.target.value))}),e.jsxs("span",{className:"s-settings-slider-value",children:[t," ",m]})]})}function W({value:t,onChange:s,options:n,stacked:i,columns:h}){return e.jsx("div",{className:i?"s-settings-option-stacked":"s-settings-option-grid",style:i?void 0:{gridTemplateColumns:`repeat(${h??n.length}, 1fr)`},children:n.map(m=>e.jsxs("button",{className:`s-settings-option-btn${t===m.id?" s-settings-option-btn--active":""}`,onClick:()=>s(m.id),children:[e.jsx("span",{className:"s-settings-option-label",children:m.label}),e.jsx("span",{className:"s-settings-option-sub",children:m.sub})]},m.id))})}const ps=[{id:"system",label:"System",sub:"Follow this device",icon:Je},{id:"light",label:"Light",sub:"Bright workspace",icon:as},{id:"dark",label:"Dark",sub:"Low-light workspace",icon:ss}],bs=[{id:"scout",label:"Scout",sub:"Control-room navigation"},{id:"slack",label:"Slack",sub:"Workspace rail and channel-style lists"}],re=[{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"}],vs=[{id:"crew",label:"Crew Cast",sub:"Rendered character art with 4-slot status ring & eye animation",spec:"4-SLOT CAST"},{id:"sprite",label:"Generative",sub:"Deterministic 7×7 creatures from name hashes",spec:"PRNG VECTOR"},{id:"chip",label:"Pixel Chip",sub:"Pixel portraits of the chip cast; everyone else stays generative",spec:"PIXEL ART"}],ue=vs,he=[{id:"compact",label:"Compact",sub:"More rows per screen; the name carries"},{id:"regular",label:"Regular",sub:"Scout's default balance"},{id:"large",label:"Large",sub:"Faces legible at a glance"}],xs=["milo","vex","sprout"];function Q({className:t,theme:s,template:n,palette:i,contrast:h,accent:m,children:x}){return e.jsx("div",{className:t,"data-scout-theme":s,"data-scout-theme-mode":s,"data-scout-palette":i,"data-scout-contrast":h,"data-scout-accent":m,"data-hudson-theme":s,"data-hudson-template":n,children:x})}function js({palette:t,theme:s,template:n}){return e.jsxs(Q,{className:"s-settings-palette-sample",theme:s,template:n,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 ys({theme:t,template:s,palette:n,contrast:i,accent:h}){return e.jsxs(Q,{className:"s-settings-live-preview",theme:t,template:s,palette:n,contrast:i,accent:h,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 fs(){const t=Ge(),{appearanceDetails:s,updateAppearanceDetails:n}=ee();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",h=we(t.template)??"hudson",m=re.find(a=>a.id===s.palette)?.label??"Scout",x=oe.find(a=>a.id===h)?.label??"Rounded",b=ce.find(a=>a.id===s.contrast)?.label??"Defined",f=de.find(a=>a.id===s.accent)?.label??"Theme",d=ue.find(a=>a.id===s.avatarStyle)?.label??"Generative",c=he.find(a=>a.id===s.avatarSize)?.label??"Regular";return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:"App layout",right:`currently ${s.shell}`}),e.jsx("div",{className:"s-settings-shell-grid",role:"group","aria-label":"App layout",children:bs.map(a=>{const r=s.shell===a.id;return e.jsxs("button",{type:"button",className:"s-settings-shell-choice","data-shell":a.id,"data-active":r||void 0,"aria-pressed":r,onClick:()=>n({shell:a.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:a.label}),r?e.jsx(D,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub})]})]},a.id)})}),e.jsx(j,{label:"Color mode",right:`currently ${i}`}),e.jsx("div",{className:"s-settings-theme-mode-grid",role:"group","aria-label":"Color mode",children:ps.map(a=>{const r=a.icon,p=t.theme===a.id,N=a.id==="system"?`Follow this device · resolves to ${t.resolvedTheme??"…"}`:a.sub;return e.jsxs("button",{type:"button",className:"s-settings-theme-mode","data-active":p||void 0,"aria-pressed":p,onClick:()=>t.setTheme(a.id),children:[e.jsx(r,{size:18,strokeWidth:1.7,"aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("strong",{children:a.label}),e.jsx("small",{children:N})]}),p?e.jsx(D,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]},a.id)})}),e.jsxs("div",{className:"s-settings-appearance-workbench",children:[e.jsxs("div",{className:"s-settings-appearance-controls",children:[e.jsx(j,{label:"Color theme",right:`currently ${m.toLowerCase()}`}),e.jsx("div",{className:"s-settings-palette-grid",role:"group","aria-label":"Color theme",children:re.map(a=>{const r=s.palette===a.id;return e.jsxs("button",{type:"button",className:"s-settings-palette-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>n({palette:a.id}),children:[e.jsx(js,{palette:a.id,theme:i,template:h}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:a.label}),r?e.jsx(D,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub}),e.jsx("span",{children:a.spec})]})]},a.id)})}),e.jsx(j,{label:"Interface shape",right:`currently ${x.toLowerCase()}`}),e.jsx("div",{className:"s-settings-interface-grid",role:"group","aria-label":"Interface shape",children:oe.map(a=>{const r=h===a.id;return e.jsxs("button",{type:"button",className:"s-settings-interface-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>t.setTemplate(a.id),children:[e.jsx(Q,{className:"s-settings-shape-sample",theme:i,template:a.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:a.label}),r?e.jsx(D,{className:"s-settings-theme-check",size:14,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub}),e.jsx("span",{children:a.spec})]})]},a.id)})}),e.jsx(j,{label:"Separation",right:`currently ${b.toLowerCase()}`}),e.jsx("div",{className:"s-settings-contrast-grid",role:"group","aria-label":"Interface contrast",children:ce.map(a=>{const r=s.contrast===a.id;return e.jsxs("button",{type:"button",className:"s-settings-contrast-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>n({contrast:a.id}),children:[e.jsxs("span",{className:"s-settings-contrast-lines","data-level":a.id,"aria-hidden":!0,children:[e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsx("strong",{children:a.label}),e.jsx("small",{children:a.sub})]},a.id)})}),e.jsx(j,{label:"Signal accent",right:`currently ${f.toLowerCase()}`}),e.jsx("div",{className:"s-settings-accent-row",role:"group","aria-label":"Signal accent",children:de.map(a=>{const r=s.accent===a.id;return e.jsxs("button",{type:"button",className:"s-settings-accent-choice","data-accent-option":a.id,"data-active":r||void 0,"aria-pressed":r,"aria-label":`${a.label} accent`,onClick:()=>n({accent:a.id}),children:[e.jsx(Q,{className:"s-settings-accent-dot",theme:i,template:h,palette:s.palette,contrast:s.contrast,accent:a.id,children:e.jsx("i",{})}),e.jsx("span",{children:a.label}),r?e.jsx(D,{size:13,"aria-hidden":!0}):null]},a.id)})}),e.jsx(j,{label:"Avatar system",right:`currently ${d.toLowerCase()}`}),e.jsx("div",{className:"s-settings-avatar-grid",role:"group","aria-label":"Avatar system",children:ue.map(a=>{const r=s.avatarStyle===a.id;return e.jsxs("button",{type:"button",className:"s-settings-palette-choice s-settings-avatar-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>n({avatarStyle:a.id}),children:[e.jsx("div",{className:"s-settings-avatar-preview",children:a.id==="crew"?e.jsx(J,{slug:"milo",size:38,ring:!1,badge:!1}):a.id==="chip"?e.jsx(J,{slug:"milo",size:38,chip:!0,ring:!1,badge:!1}):e.jsx(ie,{name:"Milo",size:38})}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:a.label}),r?e.jsx(D,{className:"s-settings-theme-check",size:14,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub}),e.jsxs("span",{children:[a.spec,(()=>{const p=ke(a.id);return p?` · ${p.covered} of ${p.total} cast`:" · every agent"})()]})]})]},a.id)})}),e.jsx(j,{label:"Avatar size",right:`currently ${c.toLowerCase()}`}),e.jsx("div",{className:"s-settings-avatar-size-row",role:"group","aria-label":"Avatar size",children:he.map(a=>{const r=s.avatarSize===a.id,p=ne("row",a.id)??24;return e.jsxs("button",{type:"button",className:"s-settings-avatar-size-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>n({avatarSize:a.id}),children:[e.jsx("span",{className:"s-settings-avatar-size-sample","aria-hidden":!0,children:xs.map(N=>s.avatarStyle==="sprite"?e.jsx(ie,{name:N,size:p},N):e.jsx(J,{slug:N,size:p,chip:s.avatarStyle==="chip",ring:!1,badge:!1},N))}),e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:a.label}),r?e.jsx(D,{className:"s-settings-theme-check",size:14,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub}),e.jsx("span",{className:"s-settings-avatar-size-spec",children:`${p}PX ROW · ${ne("inspector",a.id)}PX TILE`})]},a.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(j,{label:"Live specimen",right:i}),e.jsx(ys,{theme:i,template:h,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:m})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Shape"}),e.jsx("dd",{children:x})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Separation"}),e.jsx("dd",{children:b})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Accent"}),e.jsx("dd",{children:f})]})]}),e.jsx("p",{className:"s-settings-preview-note",children:"Each control changes one visual axis. Success, warning, and failure colors keep their meaning."})]})]})]})}function Ss({profile:t,update:s}){const{appearanceDetails:n,updateAppearanceDetails:i}=ee(),[h,m]=o.useState(n.operatorCharacter||"milo"),x=h,[b,f]=o.useState(!0),d=Z.find(a=>a.slug.toLowerCase()===x.toLowerCase())??Z[0],c=a=>{m(a),i({operatorCharacter:a})};return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:"Operator Character Stage",right:"cast mascot & identity"}),e.jsxs("div",{className:"s-settings-stage-hero-card","data-open":b?"true":"false",children:[e.jsxs("div",{className:"s-settings-stage-hero-header",children:[e.jsxs("div",{className:"s-settings-stage-hero-badge",children:[e.jsx("span",{className:"s-settings-stage-live-dot"}),e.jsx("span",{className:"s-settings-stage-badge-text",children:b?"FULL FIGURE BREAKOUT":"COIN DISC FRAMING"})]}),e.jsx("button",{type:"button",className:"s-settings-stage-toggle-btn",onClick:()=>f(a=>!a),title:b?"Collapse to coin framing":"Break out to full body figure",children:b?e.jsxs(e.Fragment,{children:[e.jsx(Xe,{size:13,"aria-hidden":!0}),e.jsx("span",{children:"Coin Framing"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ze,{size:13,"aria-hidden":!0}),e.jsx("span",{children:"Breakout Figure"})]})})]}),e.jsxs("div",{className:"s-settings-stage-hero-body",children:[e.jsxs("div",{className:"s-settings-stage-art-col",children:[e.jsx(is,{slug:x,open:b,onToggle:()=>f(a=>!a),coin:64,figure:256,state:"working"}),e.jsx("span",{className:"s-settings-stage-click-hint",children:b?"Click avatar to collapse":"Click avatar to break out"})]}),e.jsxs("div",{className:"s-settings-stage-meta-col",children:[e.jsxs("div",{className:"s-settings-stage-title-row",children:[e.jsx("span",{className:"s-settings-stage-char-name",children:d.name}),e.jsx("span",{className:"s-settings-stage-char-title",children:d.title})]}),e.jsx("div",{className:"s-settings-stage-kernel-pill",children:e.jsx("code",{children:d.kernel})}),e.jsx("p",{className:"s-settings-stage-blurb",children:d.blurb}),e.jsxs("div",{className:"s-settings-stage-identity-group",children:[e.jsxs("div",{className:"s-settings-stage-operator-id",children:[e.jsx("strong",{children:t.name||"Operator"}),e.jsxs("span",{children:[t.handle||"@you"," · ",t.pronouns||"—"]})]}),e.jsxs("div",{className:"s-settings-hue-wrap",children:[e.jsx("span",{className:"s-settings-field-label",children:"Stage & Identity Hue"}),e.jsx("div",{className:"s-settings-hue-row",children:hs.map(a=>e.jsx("button",{type:"button",onClick:()=>s({hue:a}),className:`s-settings-hue-dot${t.hue===a?" s-settings-hue-dot--active":""}`,style:{background:ms(a)},title:`Hue ${a}°`},a))})]})]})]})]})]}),e.jsxs(e.Fragment,{children:[e.jsx(j,{label:"Your character mascot",right:`currently ${d.name.toLowerCase()}`}),e.jsx("div",{className:"s-settings-cast-grid-wrap",children:e.jsx(Ue,{selectedSlug:x,onSelect:c})})]}),e.jsx(k,{label:"Display name",hint:"Shown when agents address you.",children:e.jsx(K,{value:t.name,onChange:a=>s({name:a})})}),e.jsx(k,{label:"Handle",hint:"Used in @mentions across threads.",children:e.jsx(K,{value:t.handle,onChange:a=>s({handle:a}),mono:!0})}),e.jsx(k,{label:"Pronouns",children:e.jsx(K,{value:t.pronouns,onChange:a=>s({pronouns:a})})}),e.jsx(j,{label:"How agents understand you",right:"shipped as system prompt context"}),e.jsx(k,{label:"Operator bio",hint:"How you want to be worked with. Agents read this before asking you things.",children:e.jsx(le,{value:t.bio,onChange:a=>s({bio:a}),rows:4})}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(k,{label:"Timezone",children:e.jsx(K,{value:t.timezone,onChange:a=>s({timezone:a}),mono:!0})}),e.jsx(k,{label:"Working hours",children:e.jsx(K,{value:t.workingHours,onChange:a=>s({workingHours:a}),mono:!0})})]}),e.jsx(j,{label:"Ephemeral agent names",right:"rotation pool for one-off agents"}),e.jsx(k,{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(le,{value:t.provisionalAgentNames.join(`
2
- `),onChange:a=>s({provisionalAgentNames:a.split(/\r?\n/u).map(r=>r.trim()).filter(Boolean)}),rows:6})}),e.jsx(k,{label:"Pool mode",hint:"Replace uses only your list. Add to defaults prepends yours, then Scout's built-in names.",children:e.jsx(W,{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 Ns({profile:t,update:s}){return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:"Interrupt policy"}),e.jsx(k,{label:"When agents can ping you directly",hint:"Blocking-only means only asks that truly stall work. Others get batched.",children:e.jsx(W,{value:t.interruptThreshold,onChange:n=>s({interruptThreshold:n}),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(k,{label:"Batch window (min)",children:e.jsx(gs,{value:t.batchWindow,min:5,max:60,step:5,onChange:n=>s({batchWindow:n}),unit:"min"})}),e.jsx(k,{label:"Quiet hours",children:e.jsx(K,{value:t.quietHours,onChange:n=>s({quietHours:n}),mono:!0})})]}),e.jsx(j,{label:"Where to reach you"}),e.jsx(k,{label:"Preferred channel",children:e.jsx(W,{value:t.channel,onChange:n=>s({channel:n}),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(j,{label:"Tone calibration",right:"how agents write to you"}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(k,{label:"Verbosity",children:e.jsx(W,{stacked:!0,value:t.verbosity,onChange:n=>s({verbosity:n}),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(k,{label:"Tone",children:e.jsx(W,{stacked:!0,value:t.tone,onChange:n=>s({tone:n}),options:[{id:"direct",label:"Direct",sub:"no hedging"},{id:"warm",label:"Warm",sub:"friendly, conversational"},{id:"formal",label:"Formal",sub:"business-like"}]})})]})]})}function ws({clientCredentials:t,serverCredentials:s,reloadCredentials:n}){const[i,h]=o.useState(""),[m,x]=o.useState(!1),[b,f]=o.useState(null),d=s?.openai??null,c=!!d?.configured,a=d?.source==="env"?"OPENAI_API_KEY":d?.source==="local-config"?"local Scout config":d?.source==="local-store"?"local OpenScout store":"missing",r=d?.source==="local-store"&&t?.configured?"local OpenScout store + HudVault mirror":a,p=d?.preview??t?.preview??null,N=async()=>{x(!0),f(null);try{const S=i.trim();await Re(S);let w=null;try{await Pe(S)}catch(A){w=A instanceof Error?A.message:"HudVault save failed."}h(""),await n(),f(w?`Saved to local OpenScout store. Browser mirror failed: ${w}`:"Saved to local OpenScout store and Hudson Vault.")}catch(S){f(S instanceof Error?S.message:"Could not save key.")}finally{x(!1)}},I=async()=>{x(!0),f(null);try{const[S,w]=await Promise.allSettled([Ie(),$e()]);h(""),await n(),S.status==="rejected"||w.status==="rejected"?f("Cleared what I could; one credential store did not respond."):f(d?.source==="env"||d?.source==="local-config"?"Removed saved key. Server fallback is still configured.":"Removed saved key.")}catch(S){f(S instanceof Error?S.message:"Could not clear key.")}finally{x(!1)}};return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:"Model providers",right:c?`configured · ${r}`:"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:c?"var(--green)":"var(--dim)"},children:["●"," ",c?"ready":"missing"]})]}),e.jsxs("div",{className:"s-settings-relay-meta",children:[p??"No key stored"," · ",r]}),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(k,{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:c?"Saved key configured":"sk-...",autoComplete:"off",spellCheck:!1,onChange:S=>h(S.target.value)})}),b&&e.jsx("div",{className:"s-settings-field-hint",children:b}),e.jsxs("div",{className:"s-settings-button-row",children:[e.jsx("button",{type:"button",className:"s-btn",disabled:m||!i.trim(),onClick:()=>{N()},children:m?"Saving":"Save key"}),e.jsx("button",{type:"button",className:"s-btn",disabled:m||!(t?.configured||d?.source==="local-store"),onClick:()=>{I()},children:"Clear saved key"})]})]})}const ks=[{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=Ae(Le,!0),[s,n]=o.useState(null),[i,h]=o.useState(null),[m,x]=o.useState(null),[b,f]=o.useState([]),[d,c]=o.useState([]),[a,r]=o.useState(!0),[p,N]=o.useState(!1),[I,S]=o.useState(!1),[w,A]=o.useState(!1),[$,v]=o.useState(null),_=o.useCallback(async()=>{r(!0);try{const[l,u,y,X]=await Promise.all([He(),ze(12).catch(()=>[]),Me().catch(()=>null),cs().catch(()=>null)]);n(l.settings),f(l.devices),c(u),h(y),x(X),v(null)}catch(l){v(l instanceof Error?l.message:String(l))}finally{r(!1)}},[]);o.useEffect(()=>{_()},[_]);const O=o.useCallback(async l=>{N(!0),v(null);try{const u=await Be(l);n(u.settings),f(u.devices)}catch(u){v(u instanceof Error?u.message:String(u))}finally{N(!1)}},[]),V=o.useCallback(async l=>{S(!0),v(null);try{const u=await _e(l);h(u),De(u)}catch(u){v(u instanceof Error?u.message:String(u))}finally{S(!1)}},[]),H=o.useCallback(async l=>{A(!0),v(null);try{const u=await ds(l?"host":"browser");x(u),us(u)}catch(u){v(u instanceof Error?u.message:String(u))}finally{A(!1)}},[]);if(a&&!s)return e.jsx("div",{className:"s-settings-field-hint",children:"Loading voice settings…"});const z=s?.inputDeviceId??b.find(l=>l.isDefault)?.id??"",R=s?.permissions?.find(l=>l.kind==="microphone")??null,E=s?.permissions?.find(l=>l.kind==="speechRecognition")??null,L=(s?.permissions?.length??0)>0||b.length>0,T=t&&i?.enabled===!0,G=I||!t||!i||i.locked,F=t?i?i.locked?`Controlled by OPENSCOUT_REALTIME_VOICE_ENABLED · ${i.enabled?"on":"off"}`:T?"Ready. Use Voice in the footer to start a call.":"Off. No microphone or OpenAI connection runs in the background.":"Live voice settings are temporarily unavailable.":"Unavailable in this build.",P=m?.playback==="host",U=w||!m||m.locked,M=m?m.locked?`Controlled by ${rs} · ${m.playback}`:P?L?"On. Scout Menu speaks replies on this Mac in its own voice.":"On, but Scout Menu is offline. Launch it on this Mac to hear replies.":"Off. Replies play in this browser.":"Playback settings are temporarily unavailable.",g=[L?null:"Scout voice host is offline. Launch Scout Menu on this Mac — the browser does not capture audio.",R?.status==="denied"||R?.status==="restricted"?R?.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.":R?.canRequest?"Microphone has not been requested yet. Request access or tap the mic in chat to show the macOS prompt.":null,!E?.granted&&(E?.status==="denied"||E?.status==="restricted")?E?.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:[$&&e.jsx("div",{className:"s-settings-field-hint",style:{color:"var(--amber)"},children:$}),e.jsx(j,{label:"Realtime conversation",right:"operator control"}),e.jsxs("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:"Enable live voice on this Scout"}),e.jsx("span",{children:"Allows live conversations with Scoutbot. Microphone audio and OpenAI usage begin only when you explicitly start a call."}),e.jsx("em",{children:F})]}),e.jsxs("button",{type:"button",role:"switch","aria-checked":T,"aria-label":"Enable live voice on this Scout",disabled:G,"data-checked":T||void 0,className:"s-settings-switch",onClick:()=>{V(!T)},children:[e.jsx("span",{className:"s-settings-switch-thumb","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:T?"On":"Off"})]})]}),e.jsx(j,{label:"Spoken replies",right:"where they play"}),e.jsxs("div",{className:"s-settings-realtime-voice","data-enabled":P||void 0,children:[e.jsxs("span",{className:"s-settings-realtime-voice-copy",children:[e.jsx("strong",{children:"Speak on this Mac"}),e.jsx("span",{children:"Spoken replies and briefs play through Scout Menu on the Mac instead of this browser tab, in the voice chosen in Scout Menu › Voice. Installed voices such as Kokoro work only this way. A surface or agent can still name the browser for one utterance."}),e.jsx("em",{children:M})]}),e.jsxs("button",{type:"button",role:"switch","aria-checked":P,"aria-label":"Speak on this Mac",disabled:U,"data-checked":P||void 0,className:"s-settings-switch",onClick:()=>{H(!P)},children:[e.jsx("span",{className:"s-settings-switch-thumb","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:P?"On":"Off"})]})]}),e.jsx(Ke,{hostOnline:L,micPermission:R,speechPermission:E,modelReady:s?.modelReady}),e.jsx(j,{label:"Scout Menu permissions",right:"voice host"}),e.jsx(We,{permissions:s?.permissions,hostOnline:L,disabled:p||a,onError:l=>v(l),onRefresh:_}),e.jsx(j,{label:"Transcription"}),e.jsx(k,{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(W,{value:s?.preference??"auto",onChange:l=>{n(u=>u&&{...u,preference:l}),O({preference:l})},options:ks,columns:3})}),e.jsx(k,{label:"Microphone input",hint:"Scout Menu uses the macOS system default input unless you pick a device here. The browser never captures audio.",children:b.length>0?e.jsx("select",{className:"s-settings-input",value:z,disabled:p,onChange:l=>{const u=l.target.value||null;n(y=>y&&{...y,inputDeviceId:u,inputDeviceName:b.find(X=>X.id===u)?.name??null}),O({inputDeviceId:u})},children:b.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(j,{label:"Diagnostics"}),e.jsx("ul",{className:"s-settings-field-hint",style:{margin:0,paddingLeft:"1.1rem",display:"grid",gap:"0.35rem"},children:g.map(l=>e.jsx("li",{children:l},l))}),e.jsx(j,{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," · ",Ve(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:a||p,onClick:()=>{_()},children:a?"Refreshing…":"Refresh"})})]})}const As={desktop:"◻",mobile:"▯",tablet:"▭"};function Es({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:As[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 Ts({pairing:t}){const s=[{id:"local",name:"This machine",kind:"desktop",status:"this-device",relay:"local",lastSeen:"now"}];if(t?.trustedPeers)for(const n of t.trustedPeers){const i=n.fingerprint===t.connectedPeerFingerprint;s.push({id:n.fingerprint,name:n.name??"Paired device",kind:"mobile",status:i?"online":"offline",relay:"tailscale",lastSeen:n.lastSeenLabel??"—"})}return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:`Paired devices · ${s.length}`}),e.jsx("div",{className:"s-settings-col-gap",style:{gap:10},children:s.map(n=>e.jsx(Es,{device:n},n.id))}),e.jsx(j,{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 Y(t,s,n=!1){if(!t&&!s)return"Not reported";const i=t||"detached";return s?`${i} @ ${s}${n?" (modified)":""}`:i}function be(){return navigator.userAgentData?.platform||navigator.platform||"Unknown"}function C({label:t,value:s,detail:n}){return e.jsxs("div",{className:"s-settings-about-fact",children:[e.jsx("dt",{children:t}),e.jsxs("dd",{children:[e.jsx("code",{children:s}),n?e.jsx("span",{children:n}):null]})]})}function me(t){const{build:s,mesh:n}=t,i=n?.health.build??null,h=n?.localNode?n.nodes[n.localNode.id]?.host:void 0,m=be();return["OpenScout troubleshooting report",`Collected: ${t.collectedAt.toISOString()}`,"","[Web]",`Observed: ${t.buildCollectedAt?.toISOString()??"unknown"}`,`Version: ${s?.version??"unknown"}`,`Mode: ${s?.mode??"unknown"}`,`Source: ${Y(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: ${n?.health.reachable===void 0?"unknown":n.health.reachable?"yes":"no"}`,`Healthy: ${n?.health.ok===void 0?"unknown":n.health.ok?"yes":"no"}`,`Error: ${n?.health.error??"none reported"}`,`Package: ${i?.packageName??"unknown"}`,`Version: ${i?.version??"unknown"}`,`Mode: ${i?.mode??"unknown"}`,`Source: ${Y(i?.branch,i?.commit)}`,`Build: ${i?.buildNumber??i?.buildId??"not reported"}`,`Node: ${n?.health.nodeId??"unknown"}`,`Broker URL: ${n?.brokerUrl??"unknown"}`,"","[Host]",`Name: ${n?.localNode?.name??"unknown"}`,`Scout version: ${h?.scoutVersion??"not reported"}`,`System: ${h?.os??"unknown"}`,`Architecture: ${h?.arch??s?.server?.arch??"unknown"}`,"","[Browser]",`Platform: ${m}`,`User agent: ${navigator.userAgent}`,`Origin: ${window.location.origin}`].join(`
3
- `)}async function Os(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 n=document.execCommand("copy");if(s.remove(),!n)throw new Error("Clipboard access is unavailable")}function Rs(){const[t,s]=o.useState(null),[n,i]=o.useState(!0),[h,m]=o.useState(null),[x,b]=o.useState("idle"),f=o.useCallback(async(S=!1)=>{i(!0),m(null),b("idle");const[w,A]=await Promise.allSettled([B(S?"/api/build?refresh=1":"/api/build"),B("/api/mesh")]),$=new Date;if(s(v=>({build:w.status==="fulfilled"?w.value:v?.build??null,mesh:A.status==="fulfilled"?A.value:v?.mesh??null,collectedAt:$,buildCollectedAt:w.status==="fulfilled"?$:v?.buildCollectedAt??null,meshCollectedAt:A.status==="fulfilled"?$:v?.meshCollectedAt??null})),w.status==="rejected"||A.status==="rejected"){const v=[w.status==="rejected"?"web build":null,A.status==="rejected"?"broker":null].filter(Boolean).join(" and ");m(`Could not refresh ${v} details. Last reported values are kept when available.`)}i(!1)},[]);o.useEffect(()=>{f()},[f]);const d=t?.build??null,c=t?.mesh??null,a=c?.health.build??null,r=c?.localNode?c.nodes[c.localNode.id]?.host:void 0,p=be(),N=c===null?"not reported":c.health.reachable?c.health.ok?"healthy":"degraded":"unreachable",I=o.useCallback(()=>{t&&Os(me(t)).then(()=>{b("copied"),setTimeout(()=>b("idle"),1800)}).catch(()=>{b("error")})},[t]);return n&&!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:d?.version?`v${d.version}`:"Version unavailable"}),e.jsxs("span",{className:"s-settings-about-source",children:[d?.mode??"unknown mode"," · ",Y(d?.branch,d?.commit,d?.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:()=>{f(!0)},disabled:n,children:[e.jsx(qe,{size:13,"aria-hidden":!0}),n?"Refreshing…":"Refresh"]}),e.jsxs("button",{type:"button",className:"s-btn s-settings-about-copy",onClick:I,disabled:!t,children:[x==="copied"?e.jsx(D,{size:13,"aria-hidden":!0}):e.jsx(Ye,{size:13,"aria-hidden":!0}),x==="copied"?"Copied report":x==="error"?"Copy failed":"Copy report"]})]})]}),h?e.jsx("div",{className:"s-settings-about-warning",role:"status",children:h}):null,x==="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:me(t),"aria-label":"OpenScout troubleshooting report"})]}):null,e.jsx(j,{label:"Web application",right:"release and source identity"}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(C,{label:"Package version",value:d?.version??"Unknown",detail:`Observed ${t?.buildCollectedAt?.toLocaleString()??"at an unknown time"}. Use this when comparing releases.`}),e.jsx(C,{label:"Run mode",value:d?.mode??"Unknown"}),e.jsx(C,{label:"Source checkout",value:Y(d?.branch,d?.commit,d?.dirty===!0),detail:"A dev SHA identifies the running checkout; it is not the release version."}),e.jsx(C,{label:"Server engine",value:d?.server?`${d.server.engine} ${d.server.engineVersion}`:"Not reported",detail:d?.server?`Node compatibility ${d.server.nodeVersion} · ${d.server.platform}/${d.server.arch}`:void 0})]}),e.jsx(j,{label:"Broker",right:N}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(C,{label:"Status",value:N,detail:[`Observed ${t?.meshCollectedAt?.toLocaleString()??"at an unknown time"}.`,c?.health.error].filter(Boolean).join(" ")}),e.jsx(C,{label:"Package",value:a?.packageName??"Not reported"}),e.jsx(C,{label:"Version",value:a?.version??"Not reported"}),e.jsx(C,{label:"Source",value:Y(a?.branch,a?.commit)}),e.jsx(C,{label:"Build",value:a?.buildNumber??a?.buildId??"Not reported"}),e.jsx(C,{label:"Node",value:c?.health.nodeId??"Not reported",detail:c?.brokerUrl})]}),e.jsx(j,{label:"Host and browser",right:"troubleshooting context"}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(C,{label:"Host",value:c?.localNode?.name??"Not reported"}),e.jsx(C,{label:"Host Scout",value:r?.scoutVersion??"Not reported"}),e.jsx(C,{label:"Host system",value:[r?.os,r?.arch??d?.server?.arch].filter(Boolean).join(" · ")||"Not reported"}),e.jsx(C,{label:"Browser platform",value:p}),e.jsx(C,{label:"Browser",value:navigator.userAgent}),e.jsx(C,{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 q=[{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 · playback · 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"}],ge={appearance:"Appearance",operator:"Operator identity",comms:"Communication",voice:"Voice",credentials:"Credentials",devices:"Paired devices",about:"About OpenScout"},Ps={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."},Is={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 ve({open:t,onClose:s,section:n,onSectionChange:i,presentation:h}){const{refreshOnboarding:m}=ee(),{ref:x,onKeyDown:b}=Fe(t&&h==="drawer"),[f,d]=o.useState("appearance"),c=n??f,a=o.useCallback(g=>{i?i(g):d(g)},[i]),[r,p]=o.useState(Is),[N,I]=o.useState(null),[S,w]=o.useState(null),[A,$]=o.useState(null),[v,_]=o.useState(!1),[O,V]=o.useState("saved"),H=o.useRef(null),z=o.useRef(!0),R=o.useRef(null);o.useEffect(()=>()=>{z.current=!1},[]);const E=o.useCallback(async()=>{const[g,l]=await Promise.allSettled([Ee(),Te()]),u=g.status==="fulfilled"?g.value:null;let y=l.status==="fulfilled"?l.value:null;u?.configured&&!y?.openai.configured&&(y=await Oe().catch(()=>y)),w(u),$(y)},[]),L=o.useCallback(async()=>{try{const g=B("/api/user"),l=Promise.race([B("/api/pairing-state"),new Promise((X,ye)=>setTimeout(()=>ye(new Error("timeout")),3e3))]),[u,y]=await Promise.allSettled([g,l]);u.status==="fulfilled"&&p(u.value),y.status==="fulfilled"&&I(y.value),await E()}finally{_(!0)}},[E]);o.useEffect(()=>{t&&c!=="appearance"&&c!=="about"&&!v&&L()},[v,t,L,c]),o.useEffect(()=>{if(!t||!window.matchMedia("(max-width: 760px)").matches)return;const g=window.requestAnimationFrame(()=>{R.current?.scrollIntoView({block:"nearest",inline:"nearest"})});return()=>window.cancelAnimationFrame(g)},[t,c]);const T=o.useCallback(g=>{const u=(q.findIndex(y=>y.id===c)+g+q.length)%q.length;a(q[u].id)},[c]),G=o.useCallback(g=>{if(b(g),h==="drawer"&&g.key==="Escape"){g.preventDefault(),s();return}g.target?.closest(".s-settings-rail")&&(g.key==="ArrowDown"?(g.preventDefault(),T(1)):g.key==="ArrowUp"&&(g.preventDefault(),T(-1)))},[T,s,b,h]),F=o.useCallback(g=>{H.current&&clearTimeout(H.current),V("saving"),H.current=setTimeout(()=>{B("/api/user",{method:"POST",body:JSON.stringify(g)}).then(()=>m()).then(()=>{z.current&&V("saved")}).catch(()=>{z.current&&V("error")})},400)},[m]),P=o.useCallback(g=>{p(l=>{const u={...l,...g};return F(u),u})},[F]),U=e.jsx("nav",{className:"s-settings-rail","aria-label":"Settings pages",children:q.map(g=>{const l=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-settings-rail-label",children:g.label}),e.jsx("span",{className:"s-settings-rail-sub",children:g.sub})]}),u=`s-settings-rail-btn${c===g.id?" s-settings-rail-btn--active":""}`;return h==="page"?e.jsx("a",{ref:c===g.id?y=>{R.current=y}:void 0,href:Ce({view:"settings",section:g.id}),"aria-current":c===g.id?"page":void 0,className:u,onClick:y=>{y.button!==0||y.metaKey||y.ctrlKey||y.shiftKey||y.altKey||(y.preventDefault(),a(g.id))},children:l},g.id):e.jsx("button",{ref:c===g.id?y=>{R.current=y}:void 0,onClick:()=>a(g.id),"aria-current":c===g.id?"page":void 0,className:u,children:l},g.id)})}),M=e.jsx("main",{className:"s-settings-content",id:`settings-${c}`,"data-settings-section":c,tabIndex:-1,children:c==="appearance"?e.jsx(fs,{}):c==="about"?e.jsx(Rs,{}):v?e.jsxs(e.Fragment,{children:[c==="operator"&&e.jsx(Ss,{profile:r,update:P}),c==="comms"&&e.jsx(Ns,{profile:r,update:P}),c==="credentials"&&e.jsx(ws,{clientCredentials:S,serverCredentials:A,reloadCredentials:E}),c==="voice"&&e.jsx(Cs,{}),c==="devices"&&e.jsx(Ts,{pairing:N})]}):e.jsx("div",{className:"s-settings-loading",children:"Loading settings…"})});return h==="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:ge[c]}),e.jsx("p",{children:Ps[c]})]}),c==="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":O,role:"status","aria-live":"polite",children:[e.jsx("span",{"aria-hidden":"true"}),O==="saving"?"Saving changes…":O==="error"?"Couldn’t save changes":"Saved automatically"]})]}),e.jsxs("div",{className:"s-settings-page-layout",children:[U,M]})]}):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:x,role:"dialog","aria-modal":"true","aria-label":"Settings",className:`s-settings-drawer ${t?"s-settings-drawer--open":"s-settings-drawer--closed"}`,onKeyDown:G,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:ge[c]}),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:"×"})]}),U,M,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 xe(t){return e.jsx(ve,{...t,presentation:"drawer"})}function je({section:t="appearance",onSectionChange:s}){return e.jsx(ve,{open:!0,onClose:()=>{},section:t,onSectionChange:s,presentation:"page"})}const et=Object.freeze(Object.defineProperty({__proto__:null,SettingsDrawer:xe,SettingsPage:je},Symbol.toStringTag,{value:"Module"})),st=Object.freeze(Object.defineProperty({__proto__:null,SettingsDrawer:xe,SettingsPage:je},Symbol.toStringTag,{value:"Module"}));export{je as S,et as a,st as b};
1
+ import{E as Z,t as fe,u as Se,C as se,r as o,y as Ne,j as e,A as te,a9 as we,D as ke}from"./index-DReVb7jZ.js";import{a as Ce}from"./provider-DwmCoSlc.js";import{a as B}from"./api-DSqpVKC7.js";import{g as Ae,a as Ee,e as Te,s as Oe,b as Re,d as Pe,c as Ie}from"./credentials-OeoF-VKJ.js";import{u as ee,F as $e,K as Le,M as Me,N as De}from"./Provider-CNZluAZb.js";import{t as _e}from"./time-Dhsh_2EG.js";import{k as Ve,m as He,n as ze}from"./scout-voice-CqAyfblr.js";import{u as Be}from"./keyboard-nav-CJXPaHXj.js";import{a as Fe}from"./router-C-MF5-mb.js";import{C as J}from"./CrewAvatar-zgzC3cbU.js";import{C as Ue}from"./CastPicker-ZPomvOf-.js";import{p as ae}from"./AgentAvatar-NZOqcsB2.js";import{S as ne}from"./SpriteAvatar-aHeF4ZQZ.js";import{VoiceHostStatusBanner as Ke,VoicePermissionsPanel as We}from"./VoicePermissionsPanel-D35fOnQj.js";import{u as Ge}from"./chunk-HRAB3GC3-Dvk_QpRq.js";import{C as _}from"./check-g7D7-c1J.js";import{M as qe}from"./monitor-C7_cHlkC.js";import{c as ge}from"./createLucideIcon-ChvMq-zl.js";import{R as Ye}from"./refresh-cw-IcD2lPoT.js";import{C as Xe}from"./copy-BGOC1tJB.js";import{a as Ze}from"./DocumentFocusViewer-DlMiEALb.js";import{S as Qe}from"./sparkles-Cc5lPZRv.js";const Je=[["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"}]],es=ge("moon",Je);const ss=[["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"}]],ts=ge("sun",ss);function as(t){const[s,n]=o.useState(0),i=o.useRef([]);return o.useEffect(()=>{if(t<3||typeof window>"u"||window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;const h=()=>{i.current.push(window.setTimeout(()=>{n(1),i.current.push(window.setTimeout(()=>n(2),40)),i.current.push(window.setTimeout(()=>n(1),90)),i.current.push(window.setTimeout(()=>{n(0),h()},130))},2600+Math.random()*4200))};h();const m=i.current;return()=>{m.forEach(x=>window.clearTimeout(x)),m.length=0}},[t]),t<3?0:s}function ns({slug:t,open:s=!1,onToggle:n,coin:i=56,figure:h=240,hue:m,state:x="idle",interactive:b=!0,className:f,style:d,children:c}){const a=t.toLowerCase(),r=se[a]??se.milo,p=fe[a],N=Z.find(M=>M.slug===a)??Z[0],I=as(p?p.roles.length+1:1),S=p&&I>0?Se[I]?.role:void 0,[w,A,$]=r.coin,v=i/$,D=h*r.w/r.h,O=h/r.h,V=s?D:i,H=s?h:i,z=s?D:r.w*v,R=s?h:r.h*v,E=s?0:-w*v,L=s?0:-A*v,T=o.useMemo(()=>Ne(m??null,r.ink),[m,r.ink]),G=p?p.patch[2]*(s?O:v):0,F=p?p.patch[3]*(s?O:v):0,P=p?(s?0:E)+p.patch[0]*(s?O:v):0,U=p?(s?0:L)+p.patch[1]*(s?O:v):0;return e.jsxs("div",{className:`xc-stage-wrapper ${f||""}`,style:d,"data-open":s?"true":"false",children:[e.jsxs("div",{className:"xc-stage",role:b?"button":void 0,tabIndex:b?0:void 0,"aria-label":`${N.name} (${s?"Full body breakout":"Coin disc"})`,onClick:b?n:void 0,onKeyDown:b&&n?M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),n())}:void 0,style:{width:V,height:H,borderRadius:s?"16px":"50%"},children:[e.jsx("span",{className:"xc-stage-ground",style:{background:T,opacity:s?.92:1,borderRadius:s?"16px":"50%"}}),e.jsx("img",{src:te(`${a}-bust.webp`),alt:N.name,className:"xc-stage-img",style:{width:z,height:R,left:E,top:L}}),p&&S&&e.jsx("img",{src:te(`${p.dir}/${S}.webp`),alt:"",className:"xc-stage-patch",style:{width:G,height:F,left:P,top:U}})]}),c]})}const pe="/api/voice/playback/settings",is="scout:voice-playback-settings",ls="OPENSCOUT_VOICE_PLAYBACK",rs="openscout.voice-playback-settings";function os(t){return B(pe,{signal:t,cache:"no-store"})}function cs(t){return B(pe,{method:"PUT",body:JSON.stringify({playback:t})})}function ds(t){if(window.dispatchEvent(new CustomEvent(is,{detail:t})),!("BroadcastChannel"in window))return;const s=new BroadcastChannel(rs);s.postMessage(t),s.close()}const us=[195,125,300,45,355,210];function hs(t){return`oklch(0.80 0.14 ${t})`}function j({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 k({label:t,hint:s,children:n}){return e.jsxs("div",{className:"s-settings-field",children:[e.jsx("label",{className:"s-settings-field-label",children:t}),n,s&&e.jsx("span",{className:"s-settings-field-hint",children:s})]})}function K({value:t,onChange:s,mono:n}){return e.jsx("input",{className:`s-settings-input${n?" s-settings-input--mono":""}`,value:t,onChange:i=>s(i.target.value)})}function ie({value:t,onChange:s,rows:n=3}){return e.jsx("textarea",{className:"s-settings-textarea",value:t,onChange:i=>s(i.target.value),rows:n})}function ms({value:t,onChange:s,min:n,max:i,step:h=1,unit:m=""}){return e.jsxs("div",{className:"s-settings-slider-wrap",children:[e.jsx("input",{type:"range",min:n,max:i,step:h,value:t,onChange:x=>s(Number(x.target.value))}),e.jsxs("span",{className:"s-settings-slider-value",children:[t," ",m]})]})}function W({value:t,onChange:s,options:n,stacked:i,columns:h}){return e.jsx("div",{className:i?"s-settings-option-stacked":"s-settings-option-grid",style:i?void 0:{gridTemplateColumns:`repeat(${h??n.length}, 1fr)`},children:n.map(m=>e.jsxs("button",{className:`s-settings-option-btn${t===m.id?" s-settings-option-btn--active":""}`,onClick:()=>s(m.id),children:[e.jsx("span",{className:"s-settings-option-label",children:m.label}),e.jsx("span",{className:"s-settings-option-sub",children:m.sub})]},m.id))})}const gs=[{id:"system",label:"System",sub:"Follow this device",icon:qe},{id:"light",label:"Light",sub:"Bright workspace",icon:ts},{id:"dark",label:"Dark",sub:"Low-light workspace",icon:es}],ps=[{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"}],re=[{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"}],oe=[{id:"soft",label:"Soft",sub:"Quiet separators"},{id:"balanced",label:"Defined",sub:"Clear structure"},{id:"strong",label:"Strong",sub:"High separation"}],ce=[{id:"theme",label:"Theme"},{id:"lime",label:"Lime"},{id:"cyan",label:"Cyan"},{id:"violet",label:"Violet"},{id:"amber",label:"Amber"}],bs=[{id:"crew",label:"Crew Cast",sub:"Rendered character art with 4-slot status ring & eye animation",spec:"4-SLOT CAST"},{id:"sprite",label:"Generative",sub:"Deterministic 7×7 creatures from name hashes",spec:"PRNG VECTOR"},{id:"chip",label:"Pixel Chip",sub:"Pixel portraits of the chip cast; everyone else stays generative",spec:"PIXEL ART"}],de=bs,ue=[{id:"compact",label:"Compact",sub:"More rows per screen; the name carries"},{id:"regular",label:"Regular",sub:"Scout's default balance"},{id:"large",label:"Large",sub:"Faces legible at a glance"}],vs=["milo","vex","sprout"];function Q({className:t,theme:s,template:n,palette:i,contrast:h,accent:m,children:x}){return e.jsx("div",{className:t,"data-scout-theme":s,"data-scout-theme-mode":s,"data-scout-palette":i,"data-scout-contrast":h,"data-scout-accent":m,"data-hudson-theme":s,"data-hudson-template":n,children:x})}function xs({palette:t,theme:s,template:n}){return e.jsxs(Q,{className:"s-settings-palette-sample",theme:s,template:n,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 js({theme:t,template:s,palette:n,contrast:i,accent:h}){return e.jsxs(Q,{className:"s-settings-live-preview",theme:t,template:s,palette:n,contrast:i,accent:h,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 ys(){const t=Ge(),{appearanceDetails:s,updateAppearanceDetails:n}=ee();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",h=we(t.template)??"hudson",m=le.find(a=>a.id===s.palette)?.label??"Scout",x=re.find(a=>a.id===h)?.label??"Rounded",b=oe.find(a=>a.id===s.contrast)?.label??"Defined",f=ce.find(a=>a.id===s.accent)?.label??"Theme",d=de.find(a=>a.id===s.avatarStyle)?.label??"Generative",c=ue.find(a=>a.id===s.avatarSize)?.label??"Regular";return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:"App layout",right:`currently ${s.shell}`}),e.jsx("div",{className:"s-settings-shell-grid",role:"group","aria-label":"App layout",children:ps.map(a=>{const r=s.shell===a.id;return e.jsxs("button",{type:"button",className:"s-settings-shell-choice","data-shell":a.id,"data-active":r||void 0,"aria-pressed":r,onClick:()=>n({shell:a.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:a.label}),r?e.jsx(_,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub})]})]},a.id)})}),e.jsx(j,{label:"Color mode",right:`currently ${i}`}),e.jsx("div",{className:"s-settings-theme-mode-grid",role:"group","aria-label":"Color mode",children:gs.map(a=>{const r=a.icon,p=t.theme===a.id,N=a.id==="system"?`Follow this device · resolves to ${t.resolvedTheme??"…"}`:a.sub;return e.jsxs("button",{type:"button",className:"s-settings-theme-mode","data-active":p||void 0,"aria-pressed":p,onClick:()=>t.setTheme(a.id),children:[e.jsx(r,{size:18,strokeWidth:1.7,"aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("strong",{children:a.label}),e.jsx("small",{children:N})]}),p?e.jsx(_,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]},a.id)})}),e.jsxs("div",{className:"s-settings-appearance-workbench",children:[e.jsxs("div",{className:"s-settings-appearance-controls",children:[e.jsx(j,{label:"Color theme",right:`currently ${m.toLowerCase()}`}),e.jsx("div",{className:"s-settings-palette-grid",role:"group","aria-label":"Color theme",children:le.map(a=>{const r=s.palette===a.id;return e.jsxs("button",{type:"button",className:"s-settings-palette-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>n({palette:a.id}),children:[e.jsx(xs,{palette:a.id,theme:i,template:h}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:a.label}),r?e.jsx(_,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub}),e.jsx("span",{children:a.spec})]})]},a.id)})}),e.jsx(j,{label:"Interface shape",right:`currently ${x.toLowerCase()}`}),e.jsx("div",{className:"s-settings-interface-grid",role:"group","aria-label":"Interface shape",children:re.map(a=>{const r=h===a.id;return e.jsxs("button",{type:"button",className:"s-settings-interface-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>t.setTemplate(a.id),children:[e.jsx(Q,{className:"s-settings-shape-sample",theme:i,template:a.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:a.label}),r?e.jsx(_,{className:"s-settings-theme-check",size:14,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub}),e.jsx("span",{children:a.spec})]})]},a.id)})}),e.jsx(j,{label:"Separation",right:`currently ${b.toLowerCase()}`}),e.jsx("div",{className:"s-settings-contrast-grid",role:"group","aria-label":"Interface contrast",children:oe.map(a=>{const r=s.contrast===a.id;return e.jsxs("button",{type:"button",className:"s-settings-contrast-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>n({contrast:a.id}),children:[e.jsxs("span",{className:"s-settings-contrast-lines","data-level":a.id,"aria-hidden":!0,children:[e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsx("strong",{children:a.label}),e.jsx("small",{children:a.sub})]},a.id)})}),e.jsx(j,{label:"Signal accent",right:`currently ${f.toLowerCase()}`}),e.jsx("div",{className:"s-settings-accent-row",role:"group","aria-label":"Signal accent",children:ce.map(a=>{const r=s.accent===a.id;return e.jsxs("button",{type:"button",className:"s-settings-accent-choice","data-accent-option":a.id,"data-active":r||void 0,"aria-pressed":r,"aria-label":`${a.label} accent`,onClick:()=>n({accent:a.id}),children:[e.jsx(Q,{className:"s-settings-accent-dot",theme:i,template:h,palette:s.palette,contrast:s.contrast,accent:a.id,children:e.jsx("i",{})}),e.jsx("span",{children:a.label}),r?e.jsx(_,{size:13,"aria-hidden":!0}):null]},a.id)})}),e.jsx(j,{label:"Avatar system",right:`currently ${d.toLowerCase()}`}),e.jsx("div",{className:"s-settings-avatar-grid",role:"group","aria-label":"Avatar system",children:de.map(a=>{const r=s.avatarStyle===a.id;return e.jsxs("button",{type:"button",className:"s-settings-palette-choice s-settings-avatar-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>n({avatarStyle:a.id}),children:[e.jsx("div",{className:"s-settings-avatar-preview",children:a.id==="crew"?e.jsx(J,{slug:"milo",size:38,ring:!1,badge:!1}):a.id==="chip"?e.jsx(J,{slug:"milo",size:38,chip:!0,ring:!1,badge:!1}):e.jsx(ne,{name:"Milo",size:38})}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:a.label}),r?e.jsx(_,{className:"s-settings-theme-check",size:14,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub}),e.jsxs("span",{children:[a.spec,(()=>{const p=ke(a.id);return p?` · ${p.covered} of ${p.total} cast`:" · every agent"})()]})]})]},a.id)})}),e.jsx(j,{label:"Avatar size",right:`currently ${c.toLowerCase()}`}),e.jsx("div",{className:"s-settings-avatar-size-row",role:"group","aria-label":"Avatar size",children:ue.map(a=>{const r=s.avatarSize===a.id,p=ae("row",a.id)??24;return e.jsxs("button",{type:"button",className:"s-settings-avatar-size-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>n({avatarSize:a.id}),children:[e.jsx("span",{className:"s-settings-avatar-size-sample","aria-hidden":!0,children:vs.map(N=>s.avatarStyle==="sprite"?e.jsx(ne,{name:N,size:p},N):e.jsx(J,{slug:N,size:p,chip:s.avatarStyle==="chip",ring:!1,badge:!1},N))}),e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:a.label}),r?e.jsx(_,{className:"s-settings-theme-check",size:14,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub}),e.jsx("span",{className:"s-settings-avatar-size-spec",children:`${p}PX ROW · ${ae("inspector",a.id)}PX TILE`})]},a.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(j,{label:"Live specimen",right:i}),e.jsx(js,{theme:i,template:h,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:m})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Shape"}),e.jsx("dd",{children:x})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Separation"}),e.jsx("dd",{children:b})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Accent"}),e.jsx("dd",{children:f})]})]}),e.jsx("p",{className:"s-settings-preview-note",children:"Each control changes one visual axis. Success, warning, and failure colors keep their meaning."})]})]})]})}function fs({profile:t,update:s}){const{appearanceDetails:n,updateAppearanceDetails:i}=ee(),[h,m]=o.useState(n.operatorCharacter||"milo"),x=h,[b,f]=o.useState(!0),d=Z.find(a=>a.slug.toLowerCase()===x.toLowerCase())??Z[0],c=a=>{m(a),i({operatorCharacter:a})};return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:"Operator Character Stage",right:"cast mascot & identity"}),e.jsxs("div",{className:"s-settings-stage-hero-card","data-open":b?"true":"false",children:[e.jsxs("div",{className:"s-settings-stage-hero-header",children:[e.jsxs("div",{className:"s-settings-stage-hero-badge",children:[e.jsx("span",{className:"s-settings-stage-live-dot"}),e.jsx("span",{className:"s-settings-stage-badge-text",children:b?"FULL FIGURE BREAKOUT":"COIN DISC FRAMING"})]}),e.jsx("button",{type:"button",className:"s-settings-stage-toggle-btn",onClick:()=>f(a=>!a),title:b?"Collapse to coin framing":"Break out to full body figure",children:b?e.jsxs(e.Fragment,{children:[e.jsx(Ze,{size:13,"aria-hidden":!0}),e.jsx("span",{children:"Coin Framing"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Qe,{size:13,"aria-hidden":!0}),e.jsx("span",{children:"Breakout Figure"})]})})]}),e.jsxs("div",{className:"s-settings-stage-hero-body",children:[e.jsxs("div",{className:"s-settings-stage-art-col",children:[e.jsx(ns,{slug:x,open:b,onToggle:()=>f(a=>!a),coin:64,figure:256,state:"working"}),e.jsx("span",{className:"s-settings-stage-click-hint",children:b?"Click avatar to collapse":"Click avatar to break out"})]}),e.jsxs("div",{className:"s-settings-stage-meta-col",children:[e.jsxs("div",{className:"s-settings-stage-title-row",children:[e.jsx("span",{className:"s-settings-stage-char-name",children:d.name}),e.jsx("span",{className:"s-settings-stage-char-title",children:d.title})]}),e.jsx("div",{className:"s-settings-stage-kernel-pill",children:e.jsx("code",{children:d.kernel})}),e.jsx("p",{className:"s-settings-stage-blurb",children:d.blurb}),e.jsxs("div",{className:"s-settings-stage-identity-group",children:[e.jsxs("div",{className:"s-settings-stage-operator-id",children:[e.jsx("strong",{children:t.name||"Operator"}),e.jsxs("span",{children:[t.handle||"@you"," · ",t.pronouns||"—"]})]}),e.jsxs("div",{className:"s-settings-hue-wrap",children:[e.jsx("span",{className:"s-settings-field-label",children:"Stage & Identity Hue"}),e.jsx("div",{className:"s-settings-hue-row",children:us.map(a=>e.jsx("button",{type:"button",onClick:()=>s({hue:a}),className:`s-settings-hue-dot${t.hue===a?" s-settings-hue-dot--active":""}`,style:{background:hs(a)},title:`Hue ${a}°`},a))})]})]})]})]})]}),e.jsxs(e.Fragment,{children:[e.jsx(j,{label:"Your character mascot",right:`currently ${d.name.toLowerCase()}`}),e.jsx("div",{className:"s-settings-cast-grid-wrap",children:e.jsx(Ue,{selectedSlug:x,onSelect:c})})]}),e.jsx(k,{label:"Display name",hint:"Shown when agents address you.",children:e.jsx(K,{value:t.name,onChange:a=>s({name:a})})}),e.jsx(k,{label:"Handle",hint:"Used in @mentions across threads.",children:e.jsx(K,{value:t.handle,onChange:a=>s({handle:a}),mono:!0})}),e.jsx(k,{label:"Pronouns",children:e.jsx(K,{value:t.pronouns,onChange:a=>s({pronouns:a})})}),e.jsx(j,{label:"How agents understand you",right:"shipped as system prompt context"}),e.jsx(k,{label:"Operator bio",hint:"How you want to be worked with. Agents read this before asking you things.",children:e.jsx(ie,{value:t.bio,onChange:a=>s({bio:a}),rows:4})}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(k,{label:"Timezone",children:e.jsx(K,{value:t.timezone,onChange:a=>s({timezone:a}),mono:!0})}),e.jsx(k,{label:"Working hours",children:e.jsx(K,{value:t.workingHours,onChange:a=>s({workingHours:a}),mono:!0})})]}),e.jsx(j,{label:"Ephemeral agent names",right:"rotation pool for one-off agents"}),e.jsx(k,{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(ie,{value:t.provisionalAgentNames.join(`
2
+ `),onChange:a=>s({provisionalAgentNames:a.split(/\r?\n/u).map(r=>r.trim()).filter(Boolean)}),rows:6})}),e.jsx(k,{label:"Pool mode",hint:"Replace uses only your list. Add to defaults prepends yours, then Scout's built-in names.",children:e.jsx(W,{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 Ss({profile:t,update:s}){return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:"Interrupt policy"}),e.jsx(k,{label:"When agents can ping you directly",hint:"Blocking-only means only asks that truly stall work. Others get batched.",children:e.jsx(W,{value:t.interruptThreshold,onChange:n=>s({interruptThreshold:n}),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(k,{label:"Batch window (min)",children:e.jsx(ms,{value:t.batchWindow,min:5,max:60,step:5,onChange:n=>s({batchWindow:n}),unit:"min"})}),e.jsx(k,{label:"Quiet hours",children:e.jsx(K,{value:t.quietHours,onChange:n=>s({quietHours:n}),mono:!0})})]}),e.jsx(j,{label:"Where to reach you"}),e.jsx(k,{label:"Preferred channel",children:e.jsx(W,{value:t.channel,onChange:n=>s({channel:n}),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(j,{label:"Tone calibration",right:"how agents write to you"}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(k,{label:"Verbosity",children:e.jsx(W,{stacked:!0,value:t.verbosity,onChange:n=>s({verbosity:n}),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(k,{label:"Tone",children:e.jsx(W,{stacked:!0,value:t.tone,onChange:n=>s({tone:n}),options:[{id:"direct",label:"Direct",sub:"no hedging"},{id:"warm",label:"Warm",sub:"friendly, conversational"},{id:"formal",label:"Formal",sub:"business-like"}]})})]})]})}function Ns({clientCredentials:t,serverCredentials:s,reloadCredentials:n}){const[i,h]=o.useState(""),[m,x]=o.useState(!1),[b,f]=o.useState(null),d=s?.openai??null,c=!!d?.configured,a=d?.source==="env"?"OPENAI_API_KEY":d?.source==="local-config"?"local Scout config":d?.source==="local-store"?"local OpenScout store":"missing",r=d?.source==="local-store"&&t?.configured?"local OpenScout store + HudVault mirror":a,p=d?.preview??t?.preview??null,N=async()=>{x(!0),f(null);try{const S=i.trim();await Oe(S);let w=null;try{await Re(S)}catch(A){w=A instanceof Error?A.message:"HudVault save failed."}h(""),await n(),f(w?`Saved to local OpenScout store. Browser mirror failed: ${w}`:"Saved to local OpenScout store and Hudson Vault.")}catch(S){f(S instanceof Error?S.message:"Could not save key.")}finally{x(!1)}},I=async()=>{x(!0),f(null);try{const[S,w]=await Promise.allSettled([Pe(),Ie()]);h(""),await n(),S.status==="rejected"||w.status==="rejected"?f("Cleared what I could; one credential store did not respond."):f(d?.source==="env"||d?.source==="local-config"?"Removed saved key. Server fallback is still configured.":"Removed saved key.")}catch(S){f(S instanceof Error?S.message:"Could not clear key.")}finally{x(!1)}};return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:"Model providers",right:c?`configured · ${r}`:"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:c?"var(--green)":"var(--dim)"},children:["●"," ",c?"ready":"missing"]})]}),e.jsxs("div",{className:"s-settings-relay-meta",children:[p??"No key stored"," · ",r]}),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(k,{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:c?"Saved key configured":"sk-...",autoComplete:"off",spellCheck:!1,onChange:S=>h(S.target.value)})}),b&&e.jsx("div",{className:"s-settings-field-hint",children:b}),e.jsxs("div",{className:"s-settings-button-row",children:[e.jsx("button",{type:"button",className:"s-btn",disabled:m||!i.trim(),onClick:()=>{N()},children:m?"Saving":"Save key"}),e.jsx("button",{type:"button",className:"s-btn",disabled:m||!(t?.configured||d?.source==="local-store"),onClick:()=>{I()},children:"Clear saved key"})]})]})}const ws=[{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 ks(){const t=Ce($e,!0),[s,n]=o.useState(null),[i,h]=o.useState(null),[m,x]=o.useState(null),[b,f]=o.useState([]),[d,c]=o.useState([]),[a,r]=o.useState(!0),[p,N]=o.useState(!1),[I,S]=o.useState(!1),[w,A]=o.useState(!1),[$,v]=o.useState(null),D=o.useCallback(async()=>{r(!0);try{const[l,u,y,X]=await Promise.all([Ve(),He(12).catch(()=>[]),Le().catch(()=>null),os().catch(()=>null)]);n(l.settings),f(l.devices),c(u),h(y),x(X),v(null)}catch(l){v(l instanceof Error?l.message:String(l))}finally{r(!1)}},[]);o.useEffect(()=>{D()},[D]);const O=o.useCallback(async l=>{N(!0),v(null);try{const u=await ze(l);n(u.settings),f(u.devices)}catch(u){v(u instanceof Error?u.message:String(u))}finally{N(!1)}},[]),V=o.useCallback(async l=>{S(!0),v(null);try{const u=await Me(l);h(u),De(u)}catch(u){v(u instanceof Error?u.message:String(u))}finally{S(!1)}},[]),H=o.useCallback(async l=>{A(!0),v(null);try{const u=await cs(l?"host":"browser");x(u),ds(u)}catch(u){v(u instanceof Error?u.message:String(u))}finally{A(!1)}},[]);if(a&&!s)return e.jsx("div",{className:"s-settings-field-hint",children:"Loading voice settings…"});const z=s?.inputDeviceId??b.find(l=>l.isDefault)?.id??"",R=s?.permissions?.find(l=>l.kind==="microphone")??null,E=s?.permissions?.find(l=>l.kind==="speechRecognition")??null,L=(s?.permissions?.length??0)>0||b.length>0,T=t&&i?.enabled===!0,G=I||!t||!i||i.locked,F=t?i?i.locked?`Controlled by OPENSCOUT_REALTIME_VOICE_ENABLED · ${i.enabled?"on":"off"}`:T?"Ready. Use Voice in the footer to start a call.":"Off. No microphone or OpenAI connection runs in the background.":"Live voice settings are temporarily unavailable.":"Unavailable in this build.",P=m?.playback==="host",U=w||!m||m.locked,M=m?m.locked?`Controlled by ${ls} · ${m.playback}`:P?L?"On. Scout Menu speaks replies on this Mac in its own voice.":"On, but Scout Menu is offline. Launch it on this Mac to hear replies.":"Off. Replies play in this browser.":"Playback settings are temporarily unavailable.",g=[L?null:"Scout voice host is offline. Launch Scout Menu on this Mac — the browser does not capture audio.",R?.status==="denied"||R?.status==="restricted"?R?.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.":R?.canRequest?"Microphone has not been requested yet. Request access or tap the mic in chat to show the macOS prompt.":null,!E?.granted&&(E?.status==="denied"||E?.status==="restricted")?E?.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:[$&&e.jsx("div",{className:"s-settings-field-hint",style:{color:"var(--amber)"},children:$}),e.jsx(j,{label:"Realtime conversation",right:"operator control"}),e.jsxs("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:"Enable live voice on this Scout"}),e.jsx("span",{children:"Allows live conversations with Scoutbot. Microphone audio and OpenAI usage begin only when you explicitly start a call."}),e.jsx("em",{children:F})]}),e.jsxs("button",{type:"button",role:"switch","aria-checked":T,"aria-label":"Enable live voice on this Scout",disabled:G,"data-checked":T||void 0,className:"s-settings-switch",onClick:()=>{V(!T)},children:[e.jsx("span",{className:"s-settings-switch-thumb","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:T?"On":"Off"})]})]}),e.jsx(j,{label:"Spoken replies",right:"where they play"}),e.jsxs("div",{className:"s-settings-realtime-voice","data-enabled":P||void 0,children:[e.jsxs("span",{className:"s-settings-realtime-voice-copy",children:[e.jsx("strong",{children:"Speak on this Mac"}),e.jsx("span",{children:"Spoken replies and briefs play through Scout Menu on the Mac instead of this browser tab, in the voice chosen in Scout Menu › Voice. Installed voices such as Kokoro work only this way. A surface or agent can still name the browser for one utterance."}),e.jsx("em",{children:M})]}),e.jsxs("button",{type:"button",role:"switch","aria-checked":P,"aria-label":"Speak on this Mac",disabled:U,"data-checked":P||void 0,className:"s-settings-switch",onClick:()=>{H(!P)},children:[e.jsx("span",{className:"s-settings-switch-thumb","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:P?"On":"Off"})]})]}),e.jsx(Ke,{hostOnline:L,micPermission:R,speechPermission:E,modelReady:s?.modelReady}),e.jsx(j,{label:"Scout Menu permissions",right:"voice host"}),e.jsx(We,{permissions:s?.permissions,hostOnline:L,disabled:p||a,onError:l=>v(l),onRefresh:D}),e.jsx(j,{label:"Transcription"}),e.jsx(k,{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(W,{value:s?.preference??"auto",onChange:l=>{n(u=>u&&{...u,preference:l}),O({preference:l})},options:ws,columns:3})}),e.jsx(k,{label:"Microphone input",hint:"Scout Menu uses the macOS system default input unless you pick a device here. The browser never captures audio.",children:b.length>0?e.jsx("select",{className:"s-settings-input",value:z,disabled:p,onChange:l=>{const u=l.target.value||null;n(y=>y&&{...y,inputDeviceId:u,inputDeviceName:b.find(X=>X.id===u)?.name??null}),O({inputDeviceId:u})},children:b.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(j,{label:"Diagnostics"}),e.jsx("ul",{className:"s-settings-field-hint",style:{margin:0,paddingLeft:"1.1rem",display:"grid",gap:"0.35rem"},children:g.map(l=>e.jsx("li",{children:l},l))}),e.jsx(j,{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," · ",_e(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:a||p,onClick:()=>{D()},children:a?"Refreshing…":"Refresh"})})]})}const Cs={desktop:"◻",mobile:"▯",tablet:"▭"};function As({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:Cs[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 Es({pairing:t}){const s=[{id:"local",name:"This machine",kind:"desktop",status:"this-device",relay:"local",lastSeen:"now"}];if(t?.trustedPeers)for(const n of t.trustedPeers){const i=n.fingerprint===t.connectedPeerFingerprint;s.push({id:n.fingerprint,name:n.name??"Paired device",kind:"mobile",status:i?"online":"offline",relay:"tailscale",lastSeen:n.lastSeenLabel??"—"})}return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:`Paired devices · ${s.length}`}),e.jsx("div",{className:"s-settings-col-gap",style:{gap:10},children:s.map(n=>e.jsx(As,{device:n},n.id))}),e.jsx(j,{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 Y(t,s,n=!1){if(!t&&!s)return"Not reported";const i=t||"detached";return s?`${i} @ ${s}${n?" (modified)":""}`:i}function be(){return navigator.userAgentData?.platform||navigator.platform||"Unknown"}function C({label:t,value:s,detail:n}){return e.jsxs("div",{className:"s-settings-about-fact",children:[e.jsx("dt",{children:t}),e.jsxs("dd",{children:[e.jsx("code",{children:s}),n?e.jsx("span",{children:n}):null]})]})}function he(t){const{build:s,mesh:n}=t,i=n?.health.build??null,h=n?.localNode?n.nodes[n.localNode.id]?.host:void 0,m=be();return["OpenScout troubleshooting report",`Collected: ${t.collectedAt.toISOString()}`,"","[Web]",`Observed: ${t.buildCollectedAt?.toISOString()??"unknown"}`,`Version: ${s?.version??"unknown"}`,`Mode: ${s?.mode??"unknown"}`,`Source: ${Y(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: ${n?.health.reachable===void 0?"unknown":n.health.reachable?"yes":"no"}`,`Healthy: ${n?.health.ok===void 0?"unknown":n.health.ok?"yes":"no"}`,`Error: ${n?.health.error??"none reported"}`,`Package: ${i?.packageName??"unknown"}`,`Version: ${i?.version??"unknown"}`,`Mode: ${i?.mode??"unknown"}`,`Source: ${Y(i?.branch,i?.commit)}`,`Build: ${i?.buildNumber??i?.buildId??"not reported"}`,`Node: ${n?.health.nodeId??"unknown"}`,`Broker URL: ${n?.brokerUrl??"unknown"}`,"","[Host]",`Name: ${n?.localNode?.name??"unknown"}`,`Scout version: ${h?.scoutVersion??"not reported"}`,`System: ${h?.os??"unknown"}`,`Architecture: ${h?.arch??s?.server?.arch??"unknown"}`,"","[Browser]",`Platform: ${m}`,`User agent: ${navigator.userAgent}`,`Origin: ${window.location.origin}`].join(`
3
+ `)}async function Ts(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 n=document.execCommand("copy");if(s.remove(),!n)throw new Error("Clipboard access is unavailable")}function Os(){const[t,s]=o.useState(null),[n,i]=o.useState(!0),[h,m]=o.useState(null),[x,b]=o.useState("idle"),f=o.useCallback(async(S=!1)=>{i(!0),m(null),b("idle");const[w,A]=await Promise.allSettled([B(S?"/api/build?refresh=1":"/api/build"),B("/api/mesh")]),$=new Date;if(s(v=>({build:w.status==="fulfilled"?w.value:v?.build??null,mesh:A.status==="fulfilled"?A.value:v?.mesh??null,collectedAt:$,buildCollectedAt:w.status==="fulfilled"?$:v?.buildCollectedAt??null,meshCollectedAt:A.status==="fulfilled"?$:v?.meshCollectedAt??null})),w.status==="rejected"||A.status==="rejected"){const v=[w.status==="rejected"?"web build":null,A.status==="rejected"?"broker":null].filter(Boolean).join(" and ");m(`Could not refresh ${v} details. Last reported values are kept when available.`)}i(!1)},[]);o.useEffect(()=>{f()},[f]);const d=t?.build??null,c=t?.mesh??null,a=c?.health.build??null,r=c?.localNode?c.nodes[c.localNode.id]?.host:void 0,p=be(),N=c===null?"not reported":c.health.reachable?c.health.ok?"healthy":"degraded":"unreachable",I=o.useCallback(()=>{t&&Ts(he(t)).then(()=>{b("copied"),setTimeout(()=>b("idle"),1800)}).catch(()=>{b("error")})},[t]);return n&&!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:d?.version?`v${d.version}`:"Version unavailable"}),e.jsxs("span",{className:"s-settings-about-source",children:[d?.mode??"unknown mode"," · ",Y(d?.branch,d?.commit,d?.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:()=>{f(!0)},disabled:n,children:[e.jsx(Ye,{size:13,"aria-hidden":!0}),n?"Refreshing…":"Refresh"]}),e.jsxs("button",{type:"button",className:"s-btn s-settings-about-copy",onClick:I,disabled:!t,children:[x==="copied"?e.jsx(_,{size:13,"aria-hidden":!0}):e.jsx(Xe,{size:13,"aria-hidden":!0}),x==="copied"?"Copied report":x==="error"?"Copy failed":"Copy report"]})]})]}),h?e.jsx("div",{className:"s-settings-about-warning",role:"status",children:h}):null,x==="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:he(t),"aria-label":"OpenScout troubleshooting report"})]}):null,e.jsx(j,{label:"Web application",right:"release and source identity"}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(C,{label:"Package version",value:d?.version??"Unknown",detail:`Observed ${t?.buildCollectedAt?.toLocaleString()??"at an unknown time"}. Use this when comparing releases.`}),e.jsx(C,{label:"Run mode",value:d?.mode??"Unknown"}),e.jsx(C,{label:"Source checkout",value:Y(d?.branch,d?.commit,d?.dirty===!0),detail:"A dev SHA identifies the running checkout; it is not the release version."}),e.jsx(C,{label:"Server engine",value:d?.server?`${d.server.engine} ${d.server.engineVersion}`:"Not reported",detail:d?.server?`Node compatibility ${d.server.nodeVersion} · ${d.server.platform}/${d.server.arch}`:void 0})]}),e.jsx(j,{label:"Broker",right:N}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(C,{label:"Status",value:N,detail:[`Observed ${t?.meshCollectedAt?.toLocaleString()??"at an unknown time"}.`,c?.health.error].filter(Boolean).join(" ")}),e.jsx(C,{label:"Package",value:a?.packageName??"Not reported"}),e.jsx(C,{label:"Version",value:a?.version??"Not reported"}),e.jsx(C,{label:"Source",value:Y(a?.branch,a?.commit)}),e.jsx(C,{label:"Build",value:a?.buildNumber??a?.buildId??"Not reported"}),e.jsx(C,{label:"Node",value:c?.health.nodeId??"Not reported",detail:c?.brokerUrl})]}),e.jsx(j,{label:"Host and browser",right:"troubleshooting context"}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(C,{label:"Host",value:c?.localNode?.name??"Not reported"}),e.jsx(C,{label:"Host Scout",value:r?.scoutVersion??"Not reported"}),e.jsx(C,{label:"Host system",value:[r?.os,r?.arch??d?.server?.arch].filter(Boolean).join(" · ")||"Not reported"}),e.jsx(C,{label:"Browser platform",value:p}),e.jsx(C,{label:"Browser",value:navigator.userAgent}),e.jsx(C,{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 q=[{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 · playback · 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"}],me={appearance:"Appearance",operator:"Operator identity",comms:"Communication",voice:"Voice",credentials:"Credentials",devices:"Paired devices",about:"About OpenScout"},Rs={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."},Ps={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 ve({open:t,onClose:s,section:n,onSectionChange:i,presentation:h}){const{refreshOnboarding:m}=ee(),{ref:x,onKeyDown:b}=Be(t&&h==="drawer"),[f,d]=o.useState("appearance"),c=n??f,a=o.useCallback(g=>{i?i(g):d(g)},[i]),[r,p]=o.useState(Ps),[N,I]=o.useState(null),[S,w]=o.useState(null),[A,$]=o.useState(null),[v,D]=o.useState(!1),[O,V]=o.useState("saved"),H=o.useRef(null),z=o.useRef(!0),R=o.useRef(null);o.useEffect(()=>()=>{z.current=!1},[]);const E=o.useCallback(async()=>{const[g,l]=await Promise.allSettled([Ae(),Ee()]),u=g.status==="fulfilled"?g.value:null;let y=l.status==="fulfilled"?l.value:null;u?.configured&&!y?.openai.configured&&(y=await Te().catch(()=>y)),w(u),$(y)},[]),L=o.useCallback(async()=>{try{const g=B("/api/user"),l=Promise.race([B("/api/pairing-state"),new Promise((X,ye)=>setTimeout(()=>ye(new Error("timeout")),3e3))]),[u,y]=await Promise.allSettled([g,l]);u.status==="fulfilled"&&p(u.value),y.status==="fulfilled"&&I(y.value),await E()}finally{D(!0)}},[E]);o.useEffect(()=>{t&&c!=="appearance"&&c!=="about"&&!v&&L()},[v,t,L,c]),o.useEffect(()=>{if(!t||!window.matchMedia("(max-width: 760px)").matches)return;const g=window.requestAnimationFrame(()=>{R.current?.scrollIntoView({block:"nearest",inline:"nearest"})});return()=>window.cancelAnimationFrame(g)},[t,c]);const T=o.useCallback(g=>{const u=(q.findIndex(y=>y.id===c)+g+q.length)%q.length;a(q[u].id)},[c]),G=o.useCallback(g=>{if(b(g),h==="drawer"&&g.key==="Escape"){g.preventDefault(),s();return}g.target?.closest(".s-settings-rail")&&(g.key==="ArrowDown"?(g.preventDefault(),T(1)):g.key==="ArrowUp"&&(g.preventDefault(),T(-1)))},[T,s,b,h]),F=o.useCallback(g=>{H.current&&clearTimeout(H.current),V("saving"),H.current=setTimeout(()=>{B("/api/user",{method:"POST",body:JSON.stringify(g)}).then(()=>m()).then(()=>{z.current&&V("saved")}).catch(()=>{z.current&&V("error")})},400)},[m]),P=o.useCallback(g=>{p(l=>{const u={...l,...g};return F(u),u})},[F]),U=e.jsx("nav",{className:"s-settings-rail","aria-label":"Settings pages",children:q.map(g=>{const l=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-settings-rail-label",children:g.label}),e.jsx("span",{className:"s-settings-rail-sub",children:g.sub})]}),u=`s-settings-rail-btn${c===g.id?" s-settings-rail-btn--active":""}`;return h==="page"?e.jsx("a",{ref:c===g.id?y=>{R.current=y}:void 0,href:Fe({view:"settings",section:g.id}),"aria-current":c===g.id?"page":void 0,className:u,onClick:y=>{y.button!==0||y.metaKey||y.ctrlKey||y.shiftKey||y.altKey||(y.preventDefault(),a(g.id))},children:l},g.id):e.jsx("button",{ref:c===g.id?y=>{R.current=y}:void 0,onClick:()=>a(g.id),"aria-current":c===g.id?"page":void 0,className:u,children:l},g.id)})}),M=e.jsx("main",{className:"s-settings-content",id:`settings-${c}`,"data-settings-section":c,tabIndex:-1,children:c==="appearance"?e.jsx(ys,{}):c==="about"?e.jsx(Os,{}):v?e.jsxs(e.Fragment,{children:[c==="operator"&&e.jsx(fs,{profile:r,update:P}),c==="comms"&&e.jsx(Ss,{profile:r,update:P}),c==="credentials"&&e.jsx(Ns,{clientCredentials:S,serverCredentials:A,reloadCredentials:E}),c==="voice"&&e.jsx(ks,{}),c==="devices"&&e.jsx(Es,{pairing:N})]}):e.jsx("div",{className:"s-settings-loading",children:"Loading settings…"})});return h==="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:me[c]}),e.jsx("p",{children:Rs[c]})]}),c==="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":O,role:"status","aria-live":"polite",children:[e.jsx("span",{"aria-hidden":"true"}),O==="saving"?"Saving changes…":O==="error"?"Couldn’t save changes":"Saved automatically"]})]}),e.jsxs("div",{className:"s-settings-page-layout",children:[U,M]})]}):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:x,role:"dialog","aria-modal":"true","aria-label":"Settings",className:`s-settings-drawer ${t?"s-settings-drawer--open":"s-settings-drawer--closed"}`,onKeyDown:G,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:me[c]}),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:"×"})]}),U,M,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 xe(t){return e.jsx(ve,{...t,presentation:"drawer"})}function je({section:t="appearance",onSectionChange:s}){return e.jsx(ve,{open:!0,onClose:()=>{},section:t,onSectionChange:s,presentation:"page"})}const st=Object.freeze(Object.defineProperty({__proto__:null,SettingsDrawer:xe,SettingsPage:je},Symbol.toStringTag,{value:"Module"})),tt=Object.freeze(Object.defineProperty({__proto__:null,SettingsDrawer:xe,SettingsPage:je},Symbol.toStringTag,{value:"Module"}));export{je as S,st as a,tt as b};
@@ -0,0 +1 @@
1
+ import{j as i,r as d}from"./index-DReVb7jZ.js";import{E as it}from"./EmptyState-CYUwYyAW.js";import{S as B}from"./StatusPill-Dw4LP7wu.js";import{a as M}from"./api-DSqpVKC7.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-BhD1PEAM.js";import{S as At}from"./SettingsDrawer-Nz98oBVl.js";/* empty css */import"./CastPicker-ZPomvOf-.js";import"./CrewAvatar-zgzC3cbU.js";import"./HarnessMark-DSvM_H7H.js";import"./check-g7D7-c1J.js";import"./createLucideIcon-ChvMq-zl.js";import"./NewChatComposer-BEXS8vV6.js";import"./runtime-picker-C_AVYF63.js";import"./scout-voice-CqAyfblr.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DNUsuPWz.js";import"./router-C-MF5-mb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./conversation-model-m8HhzroS.js";import"./agent-state-DDhnFEEP.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-CbqBwfIW.js";import"./NewChatOrigin-C8ROO4ps.js";import"./keyboard-nav-CJXPaHXj.js";import"./x-rlMdRqJF.js";import"./chevron-down-CDzRQQGl.js";import"./search-UsM-9-_W.js";import"./file-text-DP6txVW-.js";import"./Provider-CNZluAZb.js";import"./provider-DwmCoSlc.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-A8AyLH0g.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DlMiEALb.js";import"./TextDocumentSurface-BK6Qy41F.js";import"./index-kkXUq-zf.js";import"./chevron-right-DKGTLiqc.js";import"./folder-B_S7gBVr.js";import"./chevron-up-DX7R6KY2.js";import"./code-xml-Cmadr3pQ.js";import"./arrow-left-DFfKAq0d.js";import"./arrow-right-DmAWnyAH.js";import"./chunk-HRAB3GC3-Dvk_QpRq.js";import"./openContent-C6XO6kr5.js";import"./AgentsSubnav-CeHhuzyM.js";import"./SecondaryNav-Bs-_VwTC.js";import"./secondaryNavConfig-DzNHk6IH.js";import"./nav-destinations-CU_euC-Q.js";import"./message-square-CJW4WRlo.js";import"./terminal-DMZjX1es.js";import"./compass-CvzkzkIh.js";import"./settings-C69Zjrpq.js";import"./git-branch-DcUCsWdJ.js";import"./scroll-text-B0tKI9Sg.js";import"./refresh-cw-IcD2lPoT.js";import"./bot-BhAVbcCA.js";import"./wrench-B4maQJai.js";import"./server-DBlPW0Mp.js";import"./cpu-Q6nrHFTN.js";import"./credentials-OeoF-VKJ.js";import"./AgentAvatar-NZOqcsB2.js";import"./SpriteAvatar-aHeF4ZQZ.js";import"./VoicePermissionsPanel-D35fOnQj.js";import"./monitor-C7_cHlkC.js";import"./copy-BGOC1tJB.js";import"./sparkles-Cc5lPZRv.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 As({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{As as SettingsScreen};
@@ -1 +1 @@
1
- import{C as B,r as h,j as s,h as D}from"./index-C8uS5szO.js";import{h as J,H as I}from"./HarnessMark-Bt47OeHy.js";import{C as Q}from"./CrewSprite-hgpA3SWB.js";import{WorldCharacter as X}from"./WorldCharacter-Dn4sIXNP.js";import{a as Y,S as w}from"./SpriteAvatar-BW1JzkDt.js";import{o as Z}from"./lane-observe-BD21P8BB.js";import{f as A}from"./agent-floor-actor-3v9drnxh.js";import{f as tt}from"./floor-character-name-CqJPOlXb.js";import{f as et}from"./floor-preview-text-HrORUJ7D.js";import{f as P}from"./floor-context-model-DZBpo_oD.js";import{R as st}from"./RenderedWorkerSprite-CvdWO32C.js";import"./RiggedWorkerCharacter-DNe731GE.js";import"./agent-state-DDhnFEEP.js";import"./time-Dhsh_2EG.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";function b(t,r){const e=et(t,r);return!e||/<realtime_|^\s*(?:\{|\[|```|text\(|const |await )/.test(e)?"":e.length>r?`${e.slice(0,r-1).trimEnd()}…`:e}function rt(t,r){const e=A(t,r),c=P([t],r,["tool","message","ask"],1)[0],a=b(t.facts?.currentTask,220);let o="";if(c){const d=c.event;if(d.kind==="tool"){const i=d.tool||"tool";o=/read|open|view/i.test(i)?"Reading context":/edit|write|patch/i.test(i)?"Updating files":/search|grep|find/i.test(i)?"Searching the workspace":/bash|exec|terminal/i.test(i)?"Running a command":`Using ${i}`;const m=b(d.arg,120);m&&/read|open|view|edit|write|search|grep|find/i.test(i)&&(o+=` · ${m}`)}else o=b(d.text,180)||(d.kind==="ask"?"Asking for input":"Sharing an update")}const n=e.posture==="quiet",v=e.posture==="attention"||e.posture==="blocked"?`${e.label}${a?` · ${a}`:""}`:n?a?`Last task · ${a}`:o?`Last activity · ${o}`:"No recent updates":o||a||e.label;return{summary:b(v,76),task:a,activity:o,at:c?.at,state:e.label}}function ot(t,r){if(A(t,r).posture!=="working")return null;const e=new Map;for(const o of t.observe?.events??[]){if(o.kind!=="tool"&&o.kind!=="message")continue;const n=Z(o,t.observe?.metadata?.session?.sessionStart);n===null||n>r||r-n>12e4||(o.kind==="tool"||!e.has(n))&&e.set(n,o.kind)}const c=[...e.keys()].sort((o,n)=>o-n),a=c.at(-1);return a===void 0||r-a>15e3?null:c.length>=3&&a-c[0]>=3e4?"run":e.get(a)==="tool"?"hop":null}function $t({lane:t,now:r,paused:e,playful:c=!1,character:a,rigged:o=!1,pinned:n=!1,onActor:v,displayName:d,crewSlug:i,pixelCrew:m=!1}){const u=A(t,r),l=rt(t,r),$=t.agent.harness||t.facts?.attribution,H=t.facts?.model||t.agent.model,E=i&&!m?B[i.toLowerCase()]?.runtimeAnchor??[.82,.94]:[.82,.94],j=`${J($)} · ${H||"Model not reported"}`,R=h.useId(),M=P([t],r,["think","tool","message","ask"],1)[0],z=M?.event.kind==="think"&&r-M.at<9e4&&t.facts?.turn?.phase!=="complete",p=u.posture==="attention"||u.posture==="blocked"?"waiting":z?"thinking":u.posture==="working"?"working":"idle",L=c?ot(t,r):null,k=Y(t.agent),f=tt(t),y=f.named?f.name:d||f.name,O=f.named?y:`${y} · ${t.id.slice(-4)}`,S=h.useRef(null),[_,T]=h.useState(!0),[N,V]=h.useState(()=>typeof document>"u"||!document.hidden),C=u.posture==="working",[U,q]=h.useState(C);h.useEffect(()=>{e||q(C)},[C,e]),h.useEffect(()=>{const x=S.current;if(!x)return;const g=new IntersectionObserver(([K])=>T(K.isIntersecting));g.observe(x);const W=()=>V(!document.hidden);return document.addEventListener("visibilitychange",W),()=>{g.disconnect(),document.removeEventListener("visibilitychange",W)}},[]);const F=[...t.id].reduce((x,g)=>(x+g.charCodeAt(0))%37,0),G=u.posture==="attention"||u.posture==="blocked";return s.jsxs("button",{ref:S,type:"button",className:`shared-floor-character is-${u.posture}${L?` has-${L}`:""}${U?" is-at-work":""}${n?" is-pinned":""}${e||!_||!N?" is-still":""}`,style:{"--character-delay":`${-F/10}s`},onClick:()=>v(t),"aria-describedby":R,"aria-pressed":n,"aria-label":`${y} ${t.id.slice(-5)}, ${l.summary}. ${j}. ${n?"Release this actor's card":"Inspect actor and keep its card open"}`,children:[s.jsx("span",{className:"shared-floor-character__shadow","aria-hidden":"true"}),s.jsxs("span",{className:`shared-floor-character__sprite${i||a||o?" is-rendered":""}`,"aria-hidden":"true",children:[i&&(!m||D(i))?s.jsx(Q,{slug:i,pixel:m,size:86,paused:e||!_||!N,expression:z?"look-up":"rest"}):i&&m?s.jsx(w,{name:t.agent.name,size:76,hue:k.hue,tone:k.tone}):o?s.jsx(X,{identity:f.named?f.name:t.id,state:{mood:p==="waiting"?"concerned":p==="thinking"?"curious":p==="working"?"focused":"neutral",action:p==="waiting"?"idle":p,interaction:{}},motion:e||!_||!N?"paused":"normal",size:76}):a?s.jsx(st,{character:a,posture:p,paused:e,size:76}):s.jsx(w,{name:t.agent.name,size:76,hue:k.hue,tone:k.tone}),s.jsx("span",{className:"shared-floor-character__runtime-mark",style:{left:`${E[0]*100}%`,top:`${E[1]*100}%`},title:j,children:s.jsx(I,{harness:$,size:16,title:null})})]}),G?s.jsx("span",{className:"shared-floor-character__attention","aria-hidden":"true",children:"!"}):null,s.jsxs("span",{className:"shared-floor-character__label","aria-hidden":"true",children:[s.jsx("strong",{className:"shared-floor-character__identity",children:s.jsx("span",{children:O})}),s.jsx("small",{children:l.summary})]}),s.jsxs("span",{id:R,className:"shared-floor-character__context",role:"tooltip",children:[s.jsx("strong",{children:l.state}),s.jsxs("span",{className:"shared-floor-character__runtime",children:[s.jsx(I,{harness:$,size:14,title:null}),j]}),s.jsx("span",{children:l.task||"No task summary reported."}),l.activity?s.jsx("span",{className:"shared-floor-character__context-activity",children:l.activity}):null,s.jsxs("small",{children:[l.at?`Observed ${Math.max(0,Math.floor((r-l.at)/6e4))<1?"just now":`${Math.floor((r-l.at)/6e4)}m ago`}`:"No recent observation"," · ",n?"Kept open · click to release":"Click to keep open"]})]})]})}export{$t as SharedFloorCharacter,ot as sharedCharacterGesture};
1
+ import{C as B,r as h,j as s,h as D}from"./index-DReVb7jZ.js";import{h as J,H as I}from"./HarnessMark-DSvM_H7H.js";import{C as Q}from"./CrewSprite-Dp9KBBGY.js";import{WorldCharacter as X}from"./WorldCharacter-BRrj3MQN.js";import{a as Y,S as w}from"./SpriteAvatar-aHeF4ZQZ.js";import{o as Z}from"./lane-observe-CteDwdD-.js";import{f as A}from"./agent-floor-actor-DW8zLht0.js";import{f as tt}from"./floor-character-name-CqJPOlXb.js";import{f as et}from"./floor-preview-text-HrORUJ7D.js";import{f as P}from"./floor-context-model-rWKqaKmV.js";import{R as st}from"./RenderedWorkerSprite-C8fxndAh.js";import"./RiggedWorkerCharacter-CJMWlvV-.js";import"./agent-state-DDhnFEEP.js";import"./time-Dhsh_2EG.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";function b(t,r){const e=et(t,r);return!e||/<realtime_|^\s*(?:\{|\[|```|text\(|const |await )/.test(e)?"":e.length>r?`${e.slice(0,r-1).trimEnd()}…`:e}function rt(t,r){const e=A(t,r),c=P([t],r,["tool","message","ask"],1)[0],a=b(t.facts?.currentTask,220);let o="";if(c){const d=c.event;if(d.kind==="tool"){const i=d.tool||"tool";o=/read|open|view/i.test(i)?"Reading context":/edit|write|patch/i.test(i)?"Updating files":/search|grep|find/i.test(i)?"Searching the workspace":/bash|exec|terminal/i.test(i)?"Running a command":`Using ${i}`;const m=b(d.arg,120);m&&/read|open|view|edit|write|search|grep|find/i.test(i)&&(o+=` · ${m}`)}else o=b(d.text,180)||(d.kind==="ask"?"Asking for input":"Sharing an update")}const n=e.posture==="quiet",v=e.posture==="attention"||e.posture==="blocked"?`${e.label}${a?` · ${a}`:""}`:n?a?`Last task · ${a}`:o?`Last activity · ${o}`:"No recent updates":o||a||e.label;return{summary:b(v,76),task:a,activity:o,at:c?.at,state:e.label}}function ot(t,r){if(A(t,r).posture!=="working")return null;const e=new Map;for(const o of t.observe?.events??[]){if(o.kind!=="tool"&&o.kind!=="message")continue;const n=Z(o,t.observe?.metadata?.session?.sessionStart);n===null||n>r||r-n>12e4||(o.kind==="tool"||!e.has(n))&&e.set(n,o.kind)}const c=[...e.keys()].sort((o,n)=>o-n),a=c.at(-1);return a===void 0||r-a>15e3?null:c.length>=3&&a-c[0]>=3e4?"run":e.get(a)==="tool"?"hop":null}function $t({lane:t,now:r,paused:e,playful:c=!1,character:a,rigged:o=!1,pinned:n=!1,onActor:v,displayName:d,crewSlug:i,pixelCrew:m=!1}){const u=A(t,r),l=rt(t,r),$=t.agent.harness||t.facts?.attribution,H=t.facts?.model||t.agent.model,E=i&&!m?B[i.toLowerCase()]?.runtimeAnchor??[.82,.94]:[.82,.94],j=`${J($)} · ${H||"Model not reported"}`,R=h.useId(),M=P([t],r,["think","tool","message","ask"],1)[0],z=M?.event.kind==="think"&&r-M.at<9e4&&t.facts?.turn?.phase!=="complete",p=u.posture==="attention"||u.posture==="blocked"?"waiting":z?"thinking":u.posture==="working"?"working":"idle",L=c?ot(t,r):null,k=Y(t.agent),f=tt(t),y=f.named?f.name:d||f.name,O=f.named?y:`${y} · ${t.id.slice(-4)}`,S=h.useRef(null),[_,T]=h.useState(!0),[N,V]=h.useState(()=>typeof document>"u"||!document.hidden),C=u.posture==="working",[U,q]=h.useState(C);h.useEffect(()=>{e||q(C)},[C,e]),h.useEffect(()=>{const x=S.current;if(!x)return;const g=new IntersectionObserver(([K])=>T(K.isIntersecting));g.observe(x);const W=()=>V(!document.hidden);return document.addEventListener("visibilitychange",W),()=>{g.disconnect(),document.removeEventListener("visibilitychange",W)}},[]);const F=[...t.id].reduce((x,g)=>(x+g.charCodeAt(0))%37,0),G=u.posture==="attention"||u.posture==="blocked";return s.jsxs("button",{ref:S,type:"button",className:`shared-floor-character is-${u.posture}${L?` has-${L}`:""}${U?" is-at-work":""}${n?" is-pinned":""}${e||!_||!N?" is-still":""}`,style:{"--character-delay":`${-F/10}s`},onClick:()=>v(t),"aria-describedby":R,"aria-pressed":n,"aria-label":`${y} ${t.id.slice(-5)}, ${l.summary}. ${j}. ${n?"Release this actor's card":"Inspect actor and keep its card open"}`,children:[s.jsx("span",{className:"shared-floor-character__shadow","aria-hidden":"true"}),s.jsxs("span",{className:`shared-floor-character__sprite${i||a||o?" is-rendered":""}`,"aria-hidden":"true",children:[i&&(!m||D(i))?s.jsx(Q,{slug:i,pixel:m,size:86,paused:e||!_||!N,expression:z?"look-up":"rest"}):i&&m?s.jsx(w,{name:t.agent.name,size:76,hue:k.hue,tone:k.tone}):o?s.jsx(X,{identity:f.named?f.name:t.id,state:{mood:p==="waiting"?"concerned":p==="thinking"?"curious":p==="working"?"focused":"neutral",action:p==="waiting"?"idle":p,interaction:{}},motion:e||!_||!N?"paused":"normal",size:76}):a?s.jsx(st,{character:a,posture:p,paused:e,size:76}):s.jsx(w,{name:t.agent.name,size:76,hue:k.hue,tone:k.tone}),s.jsx("span",{className:"shared-floor-character__runtime-mark",style:{left:`${E[0]*100}%`,top:`${E[1]*100}%`},title:j,children:s.jsx(I,{harness:$,size:16,title:null})})]}),G?s.jsx("span",{className:"shared-floor-character__attention","aria-hidden":"true",children:"!"}):null,s.jsxs("span",{className:"shared-floor-character__label","aria-hidden":"true",children:[s.jsx("strong",{className:"shared-floor-character__identity",children:s.jsx("span",{children:O})}),s.jsx("small",{children:l.summary})]}),s.jsxs("span",{id:R,className:"shared-floor-character__context",role:"tooltip",children:[s.jsx("strong",{children:l.state}),s.jsxs("span",{className:"shared-floor-character__runtime",children:[s.jsx(I,{harness:$,size:14,title:null}),j]}),s.jsx("span",{children:l.task||"No task summary reported."}),l.activity?s.jsx("span",{className:"shared-floor-character__context-activity",children:l.activity}):null,s.jsxs("small",{children:[l.at?`Observed ${Math.max(0,Math.floor((r-l.at)/6e4))<1?"just now":`${Math.floor((r-l.at)/6e4)}m ago`}`:"No recent observation"," · ",n?"Kept open · click to release":"Click to keep open"]})]})]})}export{$t as SharedFloorCharacter,ot as sharedCharacterGesture};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SageModelStudio-B526NSnw.js","assets/index-DReVb7jZ.js","assets/index-CGbs0SBm.css","assets/SageModelStudio-768dRQr4.css"])))=>i.map(i=>d[i]);
2
+ import{r,E as Ce,m as xt,j as t,_ as yt}from"./index-DReVb7jZ.js";import{a as bt}from"./api-DSqpVKC7.js";import{p as jt,W as wt,w as kt,z as _t,c as Pt,a as Ct,u as Mt,Z as Xe}from"./WorldMinimap-DOptgrc4.js";import{WorldSky as St}from"./WorldSky-D-RJzSa6.js";import{WorldActorTalk as vt}from"./WorldActorTalk-CKerDikx.js";import{f as Nt,F as Et}from"./FloorExchangePanel-CjHSDXad.js";import{CharacterFamilyPreview as At}from"./CharacterFamilyPreview-ckVkecDO.js";import{w as ze}from"./RenderedWorkerSprite-C8fxndAh.js";import{f as Tt}from"./floor-preview-text-HrORUJ7D.js";import{FloorMessagePasses as $t}from"./FloorMessagePasses-BG4ebnX5.js";import{f as Rt}from"./floor-character-name-CqJPOlXb.js";import{WorkRunView as It}from"./WorkRunView-_mhG_FR2.js";import{b as me}from"./agent-lane-detail-Ti3trpfH.js";import{f as Ot}from"./floor-memory-YMM8AlLY.js";import{f as Dt}from"./floor-context-model-rWKqaKmV.js";import{f as pe}from"./agent-floor-actor-DW8zLht0.js";import{b as Ze}from"./shared-work-artifacts-DfNl9KTo.js";import{u as Wt}from"./Provider-CNZluAZb.js";import{SharedFloorCharacter as Ft}from"./SharedFloorCharacter-V04kD5T9.js";import{j as Lt}from"./agent-lanes-model-DMAdqCmK.js";import{F as Ht}from"./file-code-corner-Be6da5l3.js";import"./runtime-picker-C_AVYF63.js";import"./scout-voice-CqAyfblr.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DNUsuPWz.js";import"./createLucideIcon-ChvMq-zl.js";import"./router-C-MF5-mb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./index-CbqBwfIW.js";import"./NewChatComposer-BEXS8vV6.js";import"./conversation-model-m8HhzroS.js";import"./agent-state-DDhnFEEP.js";import"./colors-CFlbwC25.js";import"./time-Dhsh_2EG.js";import"./conversations-Cbg9h_Af.js";import"./HarnessMark-DSvM_H7H.js";import"./NewChatOrigin-C8ROO4ps.js";import"./keyboard-nav-CJXPaHXj.js";import"./x-rlMdRqJF.js";import"./chevron-down-CDzRQQGl.js";import"./search-UsM-9-_W.js";import"./file-text-DP6txVW-.js";import"./send-to-agent-session-C1mgqdow.js";import"./provider-DwmCoSlc.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-A8AyLH0g.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DlMiEALb.js";import"./TextDocumentSurface-BK6Qy41F.js";import"./index-kkXUq-zf.js";import"./chevron-right-DKGTLiqc.js";import"./folder-B_S7gBVr.js";import"./chevron-up-DX7R6KY2.js";import"./code-xml-Cmadr3pQ.js";import"./arrow-left-DFfKAq0d.js";import"./arrow-right-DmAWnyAH.js";import"./chunk-HRAB3GC3-Dvk_QpRq.js";import"./floor-message-passes-CO3Ix_wR.js";import"./lane-observe-CteDwdD-.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./CrewSprite-Dp9KBBGY.js";import"./SpriteAvatar-aHeF4ZQZ.js";import"./lane-ask-display-BTVSakyo.js";import"./context-budget-8qFKqM-j.js";import"./WorldCharacter-BRrj3MQN.js";import"./RiggedWorkerCharacter-CJMWlvV-.js";function Bt(){const[a,c]=r.useState([]);return r.useEffect(()=>{let h=!1,d;const j=async()=>{try{const w=await bt("/api/world/messages");h||c(w)}catch{}h||(d=setTimeout(j,3e3))};return j(),()=>{h=!0,clearTimeout(d)}},[]),a}const ve=715,fe=Math.round(ve*809/647),Kt=647/809,Me=.22,qe=.78,Se=.36,et=.58,Yt=.16,Xt=.981,zt=64,tt=84,Zt=84,Gt=132,Ut=95,Ge=.12,Jt=.85,Qt=.5,Ue=[6,-5,3,-3,5],Je=205,Qe=60,q=30;function st(a){const c=a<=6?3:a<=12?4:5;return{columns:c,rows:Math.max(1,Math.ceil(Math.max(a,1)/c))}}function Vt(a){const{columns:c,rows:h}=st(a),d=(qe-Me)*ve,j=(et-Se)*fe,w=Math.max(1,c*Gt/d,h*Ut/j);return Math.round(fe*w)}function qt(a,c,h){const{columns:d,rows:j}=st(a),w=Me*c,$=(qe-Me)*c,u=Se*h,f=(et-Se)*h;return Array.from({length:a},(g,x)=>{const y=Math.floor(x/d),m=x%d,b=Math.min(d,a-y*d),S=j===1?Qt:Ge+(Jt-Ge)*(y/(j-1)),p=(1-S)*Yt*$,k=$-p*2-tt,O=d>1?k*(b-1)/(d-1):0,D=b>1?O/(b-1):0;return{x:Math.round(w+p+(k-O)/2+m*D),y:Math.round(u+S*f-Zt+Ue[m%Ue.length])}})}function es(a){const c=(a.facts?.cwd||me(a).cwd||"").trim();if(!c.startsWith("/"))return"";const h=[];for(const d of c.split("/"))d===".."?h.pop():d&&d!=="."&&h.push(d);return`/${h.join("/")}`}function ts(a,c){const h=new Map;for(const u of a){const f=es(u),g=JSON.stringify(f?["workspace",f]:["lane",u.id]),x=h.get(g)??{cwd:f,lanes:new Map};x.lanes.set(u.id,u),h.set(g,x)}const d={groups:c?.groups.map(u=>({...u,laneIds:[...u.laneIds]}))??[]};for(const[u,f]of h){let g=d.groups.find(x=>x.key===u);g||(g={key:u,laneIds:[],height:fe},d.groups.push(g));for(const x of f.lanes.keys())g.laneIds.includes(x)||g.laneIds.push(x);g.height=Math.max(g.height,Vt(g.laneIds.length))}const j=[];let w=q,$=q*2+ve;for(let u=0;u<d.groups.length;u+=2){const f=d.groups.slice(u,u+2),g=Math.max(...f.map(m=>m.height),fe),x=w;let y=q;for(const m of f){const b=h.get(m.key),S=Math.round(m.height*Kt);if(b){const p=qt(m.laneIds.length,S,m.height),k=y,O=m.laneIds.flatMap((D,ee)=>{const te=b.lanes.get(D);if(!te)return[];const{x:Y,y:se}=p[ee];return[{lane:te,x:Y,y:se,centerX:k+Y+tt/2,centerY:x+se+70}]});j.push({key:m.key,cwd:b.cwd,lanes:O.map(D=>D.lane),x:k,y:x,width:S,height:m.height,actors:O})}y+=S+Je}$=Math.max($,y-Je+q),w=x+Math.round(g*Xt)+zt+Qe}return{memory:d,groups:j,worldWidth:$,worldHeight:Math.max(320,d.groups.length?w-Qe+q:w)}}const ss="/assets/world-outposts-v1-DOt0i98W.png",os="/assets/solar-system-scope-2k-stars-points-1FwHnkj0.png",rs=r.lazy(()=>yt(()=>import("./SageModelStudio-B526NSnw.js"),__vite__mapDeps([0,1,2,3])));function Ve(a){return a>=1?`${Number(a.toFixed(a<10?1:0))}:1`:`1:${Math.round(1/a).toLocaleString()}`}function ns(a){let c=0;for(const h of a)c=c*31+h.charCodeAt(0)>>>0;return{outpostPosition:`${c%3*50}% center`,skyPosition:`${c%100}% ${18+c%58}%`}}function Co({lanes:a,now:c,onActor:h}){const{openFilePreview:d}=Wt(),j=Bt(),[w,$]=r.useState(null),[u,f]=r.useState(null),[g,x]=r.useState(!1),[y,m]=r.useState(null),[b,S]=r.useState([]),[p,k]=r.useState(null),[O,D]=r.useState(null),[ee,te]=r.useState(!1),[Y,se]=r.useState(!0),[X,ot]=r.useState("crew"),oe=r.useRef({});for(const e of[...a].sort((s,n)=>s.id.localeCompare(n.id)))if(!oe.current[e.id]){const s=Object.values(oe.current);oe.current[e.id]=xt(e.agent.name)??Ce.find(n=>!s.includes(n.slug))?.slug??Ce[s.length%Ce.length].slug}const[rt,Ne]=r.useState(!1),[nt,Ee]=r.useState(!1),[Ae,at]=r.useState(!0),re=r.useRef([]);for(const e of a){if(re.current.length>=ze.length)break;re.current.includes(e.id)||re.current.push(e.id)}const[ge,it]=r.useState(!1),[Te,ct]=r.useState(!1),[xe,lt]=r.useState(!1),[ye,ne]=r.useState(!1),[F,dt]=r.useState(!1),ae=r.useRef(null),[ie,ut]=r.useState({width:900,height:500}),[N,$e]=r.useState(null),[E,ht]=r.useState("flat"),[v,be]=r.useState(1),[_,ce]=r.useState({x:0,y:0}),[z,pt]=r.useState({}),[je,we]=r.useState(null),L=r.useRef(null),H=r.useRef(!1),P=r.useRef(null);r.useEffect(()=>{if(!ae.current)return;const e=new ResizeObserver(([s])=>ut({width:s.contentRect.width,height:s.contentRect.height}));return e.observe(ae.current),()=>e.disconnect()},[g]);const Re=r.useRef(void 0),R=r.useMemo(()=>ts(a,Re.current),[a]);r.useEffect(()=>{Re.current=R.memory},[R]);const A=new Map(R.groups.map(e=>[e.key,e]));[...A];const le=A,W=a.find(e=>e.id===y)??null,mt=W?Ze(a).filter(e=>e.owners.some(s=>s.id===W.id)):[],Z=new Map;for(const e of mt)for(const s of e.owners)s.id!==y&&Z.set(s.id,{lane:s,reason:"Shared file activity"});const B=Ot(a),Ie=[...new Map(B.map(({parent:e})=>[e.id,e])).values()],de=e=>Rt(e).label;for(const e of B)e.child.id===y&&Z.set(e.parent.id,{lane:e.parent,reason:"Parent session"}),e.parent.id===y&&Z.set(e.child.id,{lane:e.child,reason:"Child session"});const Oe=new Set(Z.keys());p&&p.forEach(e=>Oe.add(e));const De=Nt(a,c,j),G=new Map;for(const e of De)G.set([e.from,e.to].sort().join(":"),[e.from,e.to]);for(const{parent:e,child:s}of B){const n=[e.id,s.id].sort().join(":");G.has(n)||G.set(n,[e.id,s.id])}const We=!!p&&[...G.values()].some(e=>e.every(s=>p.includes(s)));r.useEffect(()=>{p&&!We&&k(null)},[We,p]);const Fe=e=>{m(null),k(e)},U=new Map(R.groups.flatMap(e=>e.actors.map(s=>[s.lane.id,{x:s.centerX+(z[s.lane.id]?.x??0),y:s.centerY+(z[s.lane.id]?.y??0)}]))),J=y?U.get(y):null;W&&Dt([W],c,["tool","message","ask"]).slice(0,3),W&&pe(W,c);const C=R.worldWidth,M=R.worldHeight,Le=E==="iso"?Math.sqrt(3)/2*(C+M):C,He=E==="iso"?(C+M)/2:M,Be=Math.min((ie.width-36)/Le,(ie.height-70)/He),I=Math.max(.12,Be)*v,ue=r.useRef({zoom:v,pan:_});ue.current={zoom:v,pan:_};const ke=(e,s)=>{const n=Math.max(.12,Be)*s;return Pt(e,{width:Le*n,height:He*n},ie)},_e=(e,s)=>{const n=_t(ue.current.zoom,ue.current.pan,e,s);n.pan=ke(n.pan,n.zoom),ue.current=n,be(n.zoom),ce(n.pan)};r.useEffect(()=>{const e=ae.current;if(!e)return;const s=n=>{if(n.target.closest(".shared-floor__inspect"))return;n.preventDefault();const o=e.getBoundingClientRect();_e(kt(n.deltaY,n.deltaMode),{x:n.clientX-o.left-o.width/2,y:n.clientY-o.top-o.height/2})};return e.addEventListener("wheel",s,{passive:!1}),()=>e.removeEventListener("wheel",s)});const Pe=Ct(v),ft=r.useMemo(()=>R.groups.map(e=>{const s=jt(e.x+e.width/2-C/2,e.y+e.height/2-M/2,E);return{x:s.x*I+_.x,y:s.y*I+_.y,spread:e.width*I}}),[R.groups,E,I,_,C,M]),Q=e=>{k(null),m(e.id),h(e)},Ke=e=>{S(s=>s.includes(e.id)?s.filter(n=>n!==e.id):[...s,e.id]),Q(e)};return r.useEffect(()=>{S(e=>{const s=e.filter(n=>a.some(o=>o.id===n));return s.length===e.length?e:s})},[a]),r.useEffect(()=>{if(!y&&!p&&b.length===0)return;const e=s=>{s.key==="Escape"&&(m(null),k(null),S([]))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[y,p,b.length]),g?t.jsxs("div",{className:"shared-floor shared-floor__experiment",children:[t.jsx("button",{className:"shared-floor__back",type:"button",onClick:()=>x(!1),children:"← Back to world"}),t.jsx(It,{lanes:a,now:c,onActor:h})]}):t.jsxs("div",{className:`shared-floor is-map is-${E}${W||p?" has-selection":""}${Te?" has-boundaries":""}${F?" is-paused":""}`,children:[u?t.jsx(vt,{...u,onSent:()=>{$(u.lane.id),m(u.lane.id)},onTalk:()=>f({...u,compose:!0,voice:!1}),onDictate:()=>f({...u,compose:!0,voice:!0}),onProfile:()=>{Q(u.lane),f(null)},onClose:()=>f(null)},u.lane.id):null,nt?t.jsx(r.Suspense,{fallback:t.jsx("div",{role:"status",children:"Loading 3D studio…"}),children:t.jsx(rs,{onClose:()=>Ee(!1)})}):null,p?t.jsx(Et,{pair:p,lanes:a,now:c,onClose:()=>k(null),onFile:d,onSpeaker:D},p.join(":")):null,rt?t.jsx(At,{onClose:()=>Ne(!1)}):null,t.jsxs("div",{className:"shared-floor__teams",children:[t.jsxs("button",{type:"button","aria-expanded":xe,onClick:()=>lt(!xe),children:["Agent teams",B.length?` · ${B.length}`:""]}),xe?t.jsxs("section",{"aria-label":"Agent families",children:[t.jsx("strong",{children:"Parent → subagents"}),Ie.length?Ie.map(e=>t.jsxs("div",{children:[t.jsx("button",{type:"button",onClick:()=>Q(e),children:de(e)}),B.filter(s=>s.parent.id===e.id).map(({child:s})=>t.jsxs("button",{className:"shared-floor__team-child",type:"button",onClick:()=>Q(s),children:["↳ ",de(s),t.jsx("small",{children:pe(s,c).label})]},s.id))]},e.id)):t.jsx("p",{children:"No parent links reported in this roster yet."})]}):null]}),t.jsxs("div",{className:"shared-floor__layers",children:[t.jsx("button",{type:"button","aria-expanded":ye,onClick:()=>ne(!ye),children:"Layers"}),ye?t.jsxs("div",{children:[t.jsxs("label",{children:[t.jsx("input",{type:"checkbox","aria-label":"Work surfaces",checked:ge,onChange:e=>it(e.target.checked)}),"Work surfaces"]}),t.jsxs("label",{children:[t.jsx("input",{type:"checkbox","aria-label":"Boundaries",checked:Te,onChange:e=>ct(e.target.checked)}),"Boundaries"]}),t.jsxs("label",{children:[t.jsx("input",{type:"checkbox","aria-label":"Playful motion",checked:ee,onChange:e=>te(e.target.checked)}),"Playful motion"]}),t.jsxs("label",{children:["Characters",t.jsxs("select",{"aria-label":"Map character style",value:X,onChange:e=>ot(e.target.value),children:[t.jsx("option",{value:"crew",children:"Crew"}),t.jsx("option",{value:"chip",children:"Pixel Chip"}),t.jsx("option",{value:"prototype",children:"Prototype rigs"})]})]}),X==="prototype"?t.jsxs("label",{children:[t.jsx("input",{type:"checkbox","aria-label":"Character rig",checked:Y,onChange:e=>se(e.target.checked)}),"Character rig"]}):null,t.jsx("button",{type:"button",onClick:()=>{Ne(!0),ne(!1)},children:"Preview character family →"}),t.jsx("button",{type:"button",onClick:()=>{Ee(!0),ne(!1)},children:"3D character studio →"}),X==="prototype"?t.jsxs("label",{children:[t.jsx("input",{type:"checkbox","aria-label":"Rendered characters",checked:Ae,onChange:e=>at(e.target.checked)}),"Rendered characters"]}):null,t.jsx("button",{type:"button",className:"shared-floor__run-link",onClick:()=>{ne(!1),x(!0)},children:"Try Work run →"})]}):null]}),t.jsxs("div",{className:"shared-floor__camera","aria-label":"Map camera",children:[t.jsx("button",{type:"button","aria-pressed":F,onClick:()=>dt(!F),children:F?"Resume":"Pause"}),t.jsx("div",{role:"group","aria-label":"Map projection",children:["flat","iso"].map(e=>t.jsx("button",{type:"button","aria-pressed":E===e,onClick:()=>ht(e),children:e==="iso"?"Iso":"Flat"},e))}),t.jsx("button",{type:"button","aria-label":"Zoom shared map out",onClick:()=>_e(1/Xe),children:"−"}),t.jsx("button",{type:"button",onClick:()=>{be(1),ce({x:0,y:0})},children:"Fit"}),t.jsx("button",{type:"button","aria-label":"Zoom shared map in",onClick:()=>_e(Xe),children:"+"}),t.jsx("output",{className:"shared-floor__zoom-readout","aria-label":`Zoom ${Ve(v)}`,children:Ve(v)})]}),t.jsx(wt,{width:C,height:M,projection:E,size:ie,scale:I,zoom:v,pan:_,onPan:e=>ce(ke(e,v)),onZoom:be,workspaces:[...A].map(([e,s])=>({id:e,label:`Locate workspace ${s.cwd||"unknown"}, ${s.lanes.length} actors`,x:s.x+s.width/2,y:s.y+s.height/2}))}),N&&A.has(N)?t.jsxs("aside",{className:"shared-floor__workspace-panel","aria-label":"Workspace details",children:[t.jsxs("header",{children:[t.jsx("strong",{children:A.get(N).cwd.split("/").filter(Boolean).at(-1)||"Workspace"}),t.jsx("button",{type:"button","aria-label":"Close workspace details",onClick:()=>$e(null),children:"×"})]}),t.jsx("p",{children:A.get(N).cwd}),t.jsx("h4",{children:"Reported branches"}),t.jsx("small",{children:[...new Set(A.get(N).lanes.map(e=>e.facts?.branch||me(e).branch).filter(Boolean))].join(" · ")||"Branch not reported"}),t.jsx("h4",{children:"Actors in this workspace"}),A.get(N).lanes.map(e=>t.jsxs("button",{className:"shared-floor__workspace-actor",type:"button",onClick:()=>Q(e),children:[t.jsxs("span",{className:"shared-floor__workspace-actor-heading",children:[t.jsx("strong",{children:de(e)}),t.jsx("small",{children:pe(e,c).label})]}),t.jsx("span",{className:"shared-floor__workspace-runtime",children:[e.agent.harness,e.facts?.model||me(e).model].filter(Boolean).join(" · ")||"Runtime not reported"}),t.jsx("span",{className:"shared-floor__workspace-task",children:Tt(e.facts?.currentTask)||"No task reported"}),t.jsxs("span",{className:"shared-floor__workspace-runtime",children:[e.facts?.branch||me(e).branch||"Branch not reported"," · ",e.id.slice(-5)]})]},e.id))]}):null,t.jsxs("div",{className:"shared-floor__viewport",ref:ae,onPointerDown:e=>{e.button!==0||e.target.closest("button")||(P.current={x:e.clientX,y:e.clientY,px:_.x,py:_.y},e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{P.current&&ce(ke({x:P.current.px+e.clientX-P.current.x,y:P.current.py+e.clientY-P.current.y},v))},onPointerUp:e=>{P.current&&Math.hypot(e.clientX-P.current.x,e.clientY-P.current.y)<4&&(m(null),k(null)),P.current=null},onPointerCancel:()=>{P.current=null},children:[t.jsx(St,{zoom:v,pan:_,beacons:ft,beaconStrength:Pe.beacons}),t.jsxs("div",{className:"shared-floor__benches",style:{opacity:Pe.world,visibility:Pe.world>0?void 0:"hidden",width:C,height:M,transform:`translate(${_.x}px, ${_.y}px) scale(${I})${E==="iso"?" matrix(0.8660254, 0.5, -0.8660254, 0.5, 0, 0)":""}`,marginLeft:-C/2,marginTop:-M/2},children:[t.jsx("svg",{className:"floor-exchange-links",width:C,height:M,"aria-label":"Agent exchange links",children:[...G].map(([e,s])=>{const n=U.get(s[0]),o=U.get(s[1]);if(!n||!o)return null;const V=s.map(l=>{const T=a.find(he=>he.id===l);return T?de(T):"Actor"}).join(" and "),K=De.some(l=>s.includes(l.from)&&s.includes(l.to)),i=`M ${n.x} ${n.y} Q ${(n.x+o.x)/2} ${Math.min(n.y,o.y)-30} ${o.x} ${o.y}`;return t.jsxs("g",{role:"button",tabIndex:0,"aria-label":`${K?"Open exchanges":"Inspect relationship"} between ${V}`,className:`${K?"is-exchange":"is-family"}${p?.includes(s[0])&&p.includes(s[1])?" is-active":""}`,onPointerDown:l=>l.stopPropagation(),onClick:l=>{l.stopPropagation(),Fe(s)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),Fe(s))},children:[t.jsxs("title",{children:[K?"Recent exchanges":"Parent relationship"," · ",V]}),t.jsx("path",{className:"exchange-line",d:i}),t.jsx("path",{className:"exchange-hit",d:i})]},e)})}),t.jsx($t,{broker:j,lanes:a,now:c,positions:U,paused:F}),J?t.jsx("svg",{className:"shared-floor__connections",width:C,height:M,"aria-hidden":"true",children:[...Z].map(([e,s])=>{const n=U.get(e);return n?t.jsx("path",{className:s.reason==="Shared file activity"?"is-shared":"is-lineage",d:`M ${J.x} ${J.y} Q ${(J.x+n.x)/2} ${Math.min(J.y,n.y)-35} ${n.x} ${n.y}`},e):null})}):null,[...A].map(([e,s])=>{const n=ns(e);return t.jsxs("section",{className:`shared-floor__island${s.actors.length>1||ge?" has-place":""}${N===e?" is-open":""}`,"aria-label":s.cwd||"Agent gathering",style:{left:le.get(e).x,top:le.get(e).y,height:le.get(e).height,width:le.get(e).width},children:[t.jsxs("div",{className:"shared-floor__place-presentation",children:[t.jsx("div",{className:"shared-floor__sky","aria-hidden":"true",style:{backgroundImage:`url(${os})`,backgroundPosition:n.skyPosition}}),t.jsx("div",{className:"shared-floor__outpost","aria-hidden":"true",style:{backgroundImage:`url(${ss})`,backgroundPosition:n.outpostPosition}}),t.jsx("span",{className:"shared-floor__label-anchor","aria-hidden":"true"}),t.jsxs("button",{type:"button",className:"shared-floor__gathering-label","aria-expanded":N===e,onPointerDown:o=>o.stopPropagation(),onClick:()=>$e(N===e?null:e),children:[t.jsx("strong",{children:s.cwd==="~"?"Home":s.cwd.split("/").filter(Boolean).at(-1)||"Unassigned"}),t.jsx("small",{children:s.cwd||"Workspace not reported"})]})]}),ge?t.jsxs("div",{className:"shared-floor__optional-table",children:[t.jsx("span",{children:s.cwd.split("/").filter(Boolean).at(-1)||"Workspace"}),t.jsx("div",{children:Ze(s.lanes).slice(0,4).map(o=>t.jsxs("button",{type:"button",title:o.path,"aria-label":`Preview ${o.path}`,disabled:!o.resolvedPath,onClick:()=>o.resolvedPath&&d(o.resolvedPath),children:[t.jsx(Ht,{size:25}),t.jsx("small",{children:o.path.split("/").at(-1)})]},o.id))})]}):null,t.jsx("div",{className:"shared-floor__crew",children:s.actors.map(({lane:o,x:V,y:K})=>t.jsxs("div",{className:`shared-floor__wanderer${y===o.id?" is-selected":""}${b.includes(o.id)?" is-pinned":""}${Oe.has(o.id)?" is-connected":""}${O===o.id?" is-speaking":""}`,style:{left:V+(z[o.id]?.x??0),top:K+(z[o.id]?.y??0),zIndex:je===o.id?10:b.includes(o.id)?7+b.indexOf(o.id):void 0},"data-dragging":je===o.id||void 0,onPointerDown:i=>{if(i.button!==0)return;if(i.shiftKey||i.altKey||i.metaKey||i.ctrlKey){i.stopPropagation(),H.current=!0;const T=i.currentTarget.getBoundingClientRect();f({lane:o,x:T.left+T.width/2,y:T.bottom+32,compose:!0,voice:i.shiftKey});return}i.stopPropagation(),H.current=!1;const l=z[o.id]??{x:0,y:0};L.current={id:o.id,sx:i.clientX,sy:i.clientY,...l,baseX:s.x+V,baseY:s.y+K,moved:!1},i.currentTarget.setPointerCapture(i.pointerId)},onPointerMove:i=>{const l=L.current;if(!l||l.id!==o.id)return;i.stopPropagation();const T=i.clientX-l.sx,he=i.clientY-l.sy;if(!l.moved&&Math.hypot(T,he)<5)return;l.moved=!0,we(o.id);const Ye=Mt(T/I,he/I,E);pt(gt=>({...gt,[o.id]:{x:Math.max(0,Math.min(C-84,l.baseX+l.x+Ye.x))-l.baseX,y:Math.max(20,Math.min(M-120,l.baseY+l.y+Ye.y))-l.baseY}}))},onPointerUp:i=>{L.current?.id===o.id&&(i.stopPropagation(),L.current.moved||Ke(o),H.current=!0,L.current=null,we(null),i.currentTarget.hasPointerCapture(i.pointerId)&&i.currentTarget.releasePointerCapture(i.pointerId))},onContextMenu:i=>{i.preventDefault(),i.stopPropagation();const l=i.currentTarget.getBoundingClientRect();f({lane:o,x:l.left+l.width/2,y:l.bottom+32,compose:!1})},onPointerCancel:()=>{L.current=null,H.current=!0,we(null)},onClickCapture:i=>{H.current&&(i.stopPropagation(),H.current=!1)},children:[w===o.id?t.jsxs("span",{className:"shared-floor__talk-follow",title:"Message accepted · following observed agent status",children:["↗ You ",t.jsx("span",{children:pe(o,c).label})]}):null,t.jsx(Ft,{crewSlug:X!=="prototype"?oe.current[o.id]:void 0,pixelCrew:X==="chip",rigged:Y,lane:o,now:c,paused:F||je===o.id,playful:ee,character:Ae?ze[re.current.indexOf(o.id)]:void 0,displayName:Lt(o.agent)?o.agent.harness||"Agent":void 0,pinned:b.includes(o.id),onActor:Ke})]},o.id))})]},e)})]})]})]})}export{Co as SharedWorkFloor};