@openscout/scout 0.2.98 → 0.2.102

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 (622) hide show
  1. package/NOTICE +7 -0
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/ActivityScreen-DCALiEXY.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-fXndbzXT.js → AddProjectForm-DfbjlFfy.js} +1 -1
  6. package/dist/client/assets/AdventureEvidence-Dzz9VbuE.js +5 -0
  7. package/dist/client/assets/AdventureReader-ClMxT0e4.js +4 -0
  8. package/dist/client/assets/AdventureScenery-D548O0x4.js +1 -0
  9. package/dist/client/assets/AgentAdventures-NwTKeF0F.js +1 -0
  10. package/dist/client/assets/AgentAvatar-BIwg54Tj.js +1 -0
  11. package/dist/client/assets/AgentConfigurationScreen-B2Hw0ce1.js +1 -0
  12. package/dist/client/assets/AgentDefinitionsWorkspace-CwZJ833X.js +1 -0
  13. package/dist/client/assets/AgentDetailCard-CFDE8TLi.js +1 -0
  14. package/dist/client/assets/AgentFloorView-l2wNKFob.js +1 -0
  15. package/dist/client/assets/AgentFloorWorld-BDJmXl3C.js +1 -0
  16. package/dist/client/assets/AgentInfoScreen-ClZM1wQb.js +1 -0
  17. package/dist/client/assets/{AgentLaneCard-Cc9uyfBr.js → AgentLaneCard-C6YmwPxQ.js} +1 -1
  18. package/dist/client/assets/{AgentLaneChrome-Dv2lBFoH.js → AgentLaneChrome-D9uJ4QY7.js} +1 -1
  19. package/dist/client/assets/{AgentLaneDetailSheet-CGqtqSHQ.js → AgentLaneDetailSheet-KYckCBCX.js} +2 -2
  20. package/dist/client/assets/{AgentLaneSummaryResize-Di4u6df2.js → AgentLaneSummaryResize-BBYBS3DO.js} +1 -1
  21. package/dist/client/assets/AgentLanesEmbedScreen-DqHwqY0X.js +1 -0
  22. package/dist/client/assets/{AgentLanesPreflight-CCGBArIb.js → AgentLanesPreflight-pw2vMO3Q.js} +1 -1
  23. package/dist/client/assets/AgentLanesView-aAyC7lHf.js +2 -0
  24. package/dist/client/assets/AgentLiveActions-lYzicnNa.js +1 -0
  25. package/dist/client/assets/AgentMasterScreen-By6DN0jF.js +1 -0
  26. package/dist/client/assets/AgentSessions-Cox2zS-e.js +6 -0
  27. package/dist/client/assets/AgentsConsole-Dq0S_hRA.js +1 -0
  28. package/dist/client/assets/AgentsScreen-Bi9Lx47B.js +1 -0
  29. package/dist/client/assets/AgentsSubnav-BOobgtGE.js +1 -0
  30. package/dist/client/assets/{AstronautSuit-CwB4Dw07.js → AstronautSuit-C-4I5YKi.js} +1 -1
  31. package/dist/client/assets/AtopView-DKm-ERYC.js +1 -0
  32. package/dist/client/assets/BackToPicker-Bys9ColC.js +1 -0
  33. package/dist/client/assets/BriefingDetailScreen-sprFl4Nk.js +1 -0
  34. package/dist/client/assets/BriefingsScreen-D4Zf31Y6.js +1 -0
  35. package/dist/client/assets/{BrokerMetadataPanel-BJSwU9XZ.js → BrokerMetadataPanel-1GoSl2BV.js} +1 -1
  36. package/dist/client/assets/BrokerScreen-CejzhRsB.js +8 -0
  37. package/dist/client/assets/{CastPicker-CkgTalIt.js → CastPicker-BuwE_JQp.js} +1 -1
  38. package/dist/client/assets/CharacterFamilyPreview-BniL8sEL.css +1 -0
  39. package/dist/client/assets/CharacterFamilyPreview-CfO3j8Of.js +1 -0
  40. package/dist/client/assets/ChatCollapsedStrip-TV0j1xTB.js +1 -0
  41. package/dist/client/assets/{CodeDiffPane-DfluIWmO.js → CodeDiffPane-DB6-mqtX.js} +1 -1
  42. package/dist/client/assets/{CodeProjectPicker-By_Wz9ex.js → CodeProjectPicker-B_LNLpIK.js} +1 -1
  43. package/dist/client/assets/CodeScreen-C9H160XS.js +1 -0
  44. package/dist/client/assets/CommsCanvas-BR2YS76H.css +1 -0
  45. package/dist/client/assets/CommsCanvas-DOKw3Q8i.js +1 -0
  46. package/dist/client/assets/CommsDeck-C18JA7rK.js +1 -0
  47. package/dist/client/assets/CommsFlowGraph-Czg-KTS0.js +1 -0
  48. package/dist/client/assets/CommsFlowGraph-vQucylxF.css +1 -0
  49. package/dist/client/assets/CommsFlowMap-CzBWvSa5.js +1 -0
  50. package/dist/client/assets/CommsSelection-g1twA-Lb.js +1 -0
  51. package/dist/client/assets/{ConversationComposer-BUIjWMBi.js → ConversationComposer-B7RU6LKd.js} +1 -1
  52. package/dist/client/assets/ConversationFeedRows-DVqnZQH0.js +1 -0
  53. package/dist/client/assets/ConversationHeader-CCSU8uo_.js +1 -0
  54. package/dist/client/assets/ConversationPanels-C9yCAoJy.js +6 -0
  55. package/dist/client/assets/ConversationScreen-Brfas2y0.css +1 -0
  56. package/dist/client/assets/ConversationScreen-tTP6B_F-.js +2 -0
  57. package/dist/client/assets/ConversationStatus-CK-YfLpi.js +1 -0
  58. package/dist/client/assets/{CrewAvatar-CZ_faQ_s.js → CrewAvatar-CJhuqTsJ.js} +1 -1
  59. package/dist/client/assets/CrewSprite-DsQJdu3Z.css +1 -0
  60. package/dist/client/assets/CrewSprite-hgpA3SWB.js +1 -0
  61. package/dist/client/assets/CrewWorkspaces-4O8dgRUD.js +1 -0
  62. package/dist/client/assets/{DataTable-C6aMSilS.js → DataTable-BMOZ1-z8.js} +1 -1
  63. package/dist/client/assets/DispatchAftermath-DDlwqSCY.js +1 -0
  64. package/dist/client/assets/DocumentFocusViewer-f12RRQpV.js +1 -0
  65. package/dist/client/assets/{EmbeddableSurfacesLab-D3iZiS8o.js → EmbeddableSurfacesLab-DGl9EMRV.js} +1 -1
  66. package/dist/client/assets/{EmptyState-CKPWFSjq.js → EmptyState-uyYN5piI.js} +1 -1
  67. package/dist/client/assets/{FileViewerPane-CxNbcTYf.js → FileViewerPane-HtiDbj9N.js} +2 -2
  68. package/dist/client/assets/FlightObserveScreen-DDXfNbsw.js +1 -0
  69. package/dist/client/assets/FloorContextSheet-DV-SYA0K.js +1 -0
  70. package/dist/client/assets/FloorExchangePanel-B3TFhjLk.css +1 -0
  71. package/dist/client/assets/FloorExchangePanel-D59nvRCF.js +1 -0
  72. package/dist/client/assets/FloorMessagePasses-BCwsz9VS.js +1 -0
  73. package/dist/client/assets/FloorMessagePasses-nxwwiUom.css +1 -0
  74. package/dist/client/assets/FloorReplay-BHo79HCD.js +1 -0
  75. package/dist/client/assets/FloorResourcesSheet-Djrgd_ZU.js +1 -0
  76. package/dist/client/assets/FloorSavedWork-2tjBoy06.js +1 -0
  77. package/dist/client/assets/FloorTacticalHUD-Bngao6sn.js +1 -0
  78. package/dist/client/assets/FollowScreen-eHXOlK-u.js +1 -0
  79. package/dist/client/assets/{HarnessMark-DttReffF.js → HarnessMark-Bt47OeHy.js} +1 -1
  80. package/dist/client/assets/HarnessesScreen-M84sFjWY.js +1 -0
  81. package/dist/client/assets/{HerdrSession-DsuxCtfX.js → HerdrSession-CtJOUn7H.js} +3 -3
  82. package/dist/client/assets/{HomeHero-DXJo2QSO.js → HomeHero-Cvwx2H0w.js} +1 -1
  83. package/dist/client/assets/HostAdvisorView-CTJXIc1Q.js +1 -0
  84. package/dist/client/assets/KnowledgeSearchInspector-DwGMVmFL.js +1 -0
  85. package/dist/client/assets/KnowledgeSearchScreen-WC0WhFio.js +1 -0
  86. package/dist/client/assets/{LaneToolHoverCard-t7-XJP-h.js → LaneToolHoverCard-C6YehJqD.js} +1 -1
  87. package/dist/client/assets/LaneTraceDetailSheet-mAhj7MJi.js +1 -0
  88. package/dist/client/assets/{LaneTraceEventFocus-BB5DhFQm.js → LaneTraceEventFocus-WLNZZVi_.js} +1 -1
  89. package/dist/client/assets/MeshCanvas-FDDGE69h.js +3 -0
  90. package/dist/client/assets/MeshCanvasMinimap-CGRzQCac.js +1 -0
  91. package/dist/client/assets/MeshScreen-DlfiMlaR.js +1 -0
  92. package/dist/client/assets/{MeshTopologyView-Dc0GSrKa.js → MeshTopologyView-C2Cv_2gx.js} +2 -2
  93. package/dist/client/assets/MessagesScreen-BZ7yaGJx.js +1 -0
  94. package/dist/client/assets/MissionContextRail-CVSZJnvX.js +1 -0
  95. package/dist/client/assets/MissionControlView-DpGhxG4a.js +1 -0
  96. package/dist/client/assets/MissionFocusOverlay-B9SiuO-i.js +1 -0
  97. package/dist/client/assets/MissionLeftAgentRow-DhhRRim0.js +1 -0
  98. package/dist/client/assets/MissionLogPane-CMBiI29U.js +1 -0
  99. package/dist/client/assets/NativeAreaScreen-BQyHHRAM.js +1 -0
  100. package/dist/client/assets/NativeAreaScreen-Ditv-TYW.js +1 -0
  101. package/dist/client/assets/NativeAreaScreen-Dq3uPSEI.js +1 -0
  102. package/dist/client/assets/NewAgentModal-Cl4nsGhu.js +1 -0
  103. package/dist/client/assets/NewChatComposer-JjLbm3W2.js +19 -0
  104. package/dist/client/assets/{NewChatOrigin-DCn5cWPZ.js → NewChatOrigin-CyPPWTJP.js} +1 -1
  105. package/dist/client/assets/NodeDetailPanel-BUG8rOb-.js +1 -0
  106. package/dist/client/assets/NodeMenu-Fw8ATWQA.js +1 -0
  107. package/dist/client/assets/ObserveEmbedScreen-BPiSXXvm.js +2 -0
  108. package/dist/client/assets/{ObserveTextFlow-DCJ5EmD8.js → ObserveTextFlow-ET0dD1wO.js} +2 -2
  109. package/dist/client/assets/{ObservedTopologyPanel-CJVqIqQ2.js → ObservedTopologyPanel-DkEkQzo-.js} +1 -1
  110. package/dist/client/assets/OpenScoutAppShell-CzKbjwCA.js +22 -0
  111. package/dist/client/assets/OpsAgentsView-CZbtkcQH.js +1 -0
  112. package/dist/client/assets/OpsScreen-DJq-aBmX.js +1 -0
  113. package/dist/client/assets/OpsSubnav-9sURjajO.js +1 -0
  114. package/dist/client/assets/ProjectAgentProfile-q_1tMJIL.js +1 -0
  115. package/dist/client/assets/{ProjectAgentProfileBar-CUzZ4Rpx.js → ProjectAgentProfileBar-C1fR65Eh.js} +1 -1
  116. package/dist/client/assets/ProjectAgentProfileHero-DyEFyTFs.js +1 -0
  117. package/dist/client/assets/ProjectsInbox-Bs8I__my.js +2 -0
  118. package/dist/client/assets/ProjectsRail-Deb38OJ1.js +1 -0
  119. package/dist/client/assets/ProjectsScreen-CgLiYiss.js +1 -0
  120. package/dist/client/assets/ProjectsThreadAside-C0Yw3yIL.js +1 -0
  121. package/dist/client/assets/Provider-5Hotn7NQ.js +5 -0
  122. package/dist/client/assets/{RailRow-B0sRaJc6.css → RailRow-B25zKEub.css} +1 -1
  123. package/dist/client/assets/RailRow-BYguXNm4.js +1 -0
  124. package/dist/client/assets/RawSessionsTable-DIhmlvk-.js +1 -0
  125. package/dist/client/assets/RealtimeVoiceScreen-3oU7b7V5.js +1 -0
  126. package/dist/client/assets/RenderedWorkerSprite-CvdWO32C.js +1 -0
  127. package/dist/client/assets/RenderedWorkerSprite-qnTfkd_4.css +1 -0
  128. package/dist/client/assets/ReplayClock-B7JLTp8A.js +1 -0
  129. package/dist/client/assets/ReplayLog-DZTpf2CW.js +1 -0
  130. package/dist/client/assets/ReplayOutpost-CvWQa30T.js +1 -0
  131. package/dist/client/assets/ReplayOutpost-Y1DvZgeu.css +1 -0
  132. package/dist/client/assets/{RepoDiffEmbedScreen-mexrJPhW.js → RepoDiffEmbedScreen-Cbu0_PJW.js} +1 -1
  133. package/dist/client/assets/{RepoDiffPageScreen-DbqX4L3q.js → RepoDiffPageScreen-Chwm6GXL.js} +1 -1
  134. package/dist/client/assets/RepoDiffViewer-C2mb0Wj-.js +7 -0
  135. package/dist/client/assets/RepoDiffViewerLazy-BQ6ZCrsq.js +2 -0
  136. package/dist/client/assets/{ReposScreen-CzbO1Fuy.js → ReposScreen-C7JZQmyh.js} +2 -2
  137. package/dist/client/assets/RiggedWorkerCharacter-BpYECnyK.css +1 -0
  138. package/dist/client/assets/RiggedWorkerCharacter-DNe731GE.js +1 -0
  139. package/dist/client/assets/SageModelStudio-768dRQr4.css +1 -0
  140. package/dist/client/assets/SageModelStudio-BR1J2D4R.js +4108 -0
  141. package/dist/client/assets/ScoutDeckSurface-flRamdvE.js +1 -0
  142. package/dist/client/assets/{ScoutSurface-NlhDsPzg.js → ScoutSurface-BpklGmDL.js} +1 -1
  143. package/dist/client/assets/{ScoutbotFxLab-l2WAahCg.js → ScoutbotFxLab-DeK7ySWZ.js} +1 -1
  144. package/dist/client/assets/{SecondaryNav-Cs0_FQdj.js → SecondaryNav-BkTn5tkq.js} +1 -1
  145. package/dist/client/assets/SessionEmbedScreen-CcQN6xlo.js +1 -0
  146. package/dist/client/assets/{SessionObserve-CLrHfAKZ.css → SessionObserve-BOBJSfs0.css} +1 -1
  147. package/dist/client/assets/SessionObserve-DaqDhqDI.js +12 -0
  148. package/dist/client/assets/SessionObserveEvidence-Drv-D8Oh.js +1 -0
  149. package/dist/client/assets/SessionRefScreen-BOQ1_ydg.js +1 -0
  150. package/dist/client/assets/SessionsScreen-R8QKvoey.js +1 -0
  151. package/dist/client/assets/SettingsDrawer-BDapR4E9.js +3 -0
  152. package/dist/client/assets/SettingsScreen-DirtO7Z0.js +1 -0
  153. package/dist/client/assets/SharedFloorCharacter-Bi5_md4R.css +1 -0
  154. package/dist/client/assets/SharedFloorCharacter-CSYG_t9t.js +1 -0
  155. package/dist/client/assets/SharedWorkFloor-BCmdeb3Q.css +1 -0
  156. package/dist/client/assets/SharedWorkFloor-yPWFLZwX.js +2 -0
  157. package/dist/client/assets/{ShikiPane-C0TuCATU.js → ShikiPane-BudrOxNK.js} +1 -1
  158. package/dist/client/assets/{SlidePanel-CETQ5NTx.js → SlidePanel-Datu7XG4.js} +1 -1
  159. package/dist/client/assets/SpriteAvatar-BW1JzkDt.js +1 -0
  160. package/dist/client/assets/SproutActionSprite-DveCzg6l.js +1 -0
  161. package/dist/client/assets/{StatusPill-BllrY-eg.js → StatusPill-MxYClPG5.js} +1 -1
  162. package/dist/client/assets/{TailView-_gKWfaQM.js → TailView-Dn7uWmPz.js} +2 -2
  163. package/dist/client/assets/Terminal-D-DsQlmV.js +4 -0
  164. package/dist/client/assets/TerminalEmbedScreen-9Gmln759.js +1 -0
  165. package/dist/client/assets/TerminalHeaderMount-DCGstkZ4.js +1 -0
  166. package/dist/client/assets/{TextDocumentSurface-2X1Gw4eA.js → TextDocumentSurface-BhYvAB0o.js} +1 -1
  167. package/dist/client/assets/{TmuxPeek-CqTJRhkI.js → TmuxPeek-BhK0V9Qt.js} +1 -1
  168. package/dist/client/assets/{VoicePermissionsPanel-C4vkU-sU.js → VoicePermissionsPanel-CecFWzva.js} +1 -1
  169. package/dist/client/assets/{WorkDetailScreen-DqGnuK0e.js → WorkDetailScreen-CwtRCm_-.js} +4 -4
  170. package/dist/client/assets/WorkFilesViewer-DJHftsH9.js +1 -0
  171. package/dist/client/assets/WorkRunView-CxwAZ2QQ.css +1 -0
  172. package/dist/client/assets/WorkRunView-x5PH1byG.js +1 -0
  173. package/dist/client/assets/WorldActorTalk-uIH2jGqA.js +1 -0
  174. package/dist/client/assets/WorldCharacter-Dn4sIXNP.js +1 -0
  175. package/dist/client/assets/WorldMinimap-Blqg0d5r.js +1 -0
  176. package/dist/client/assets/WorldSky-DV9bpvXj.js +1 -0
  177. package/dist/client/assets/{activity-CzTJ-YMX.js → activity-CSUhvjD0.js} +1 -1
  178. package/dist/client/assets/{addon-fit-Zx3A7pGS.js → addon-fit-MR98IWES.js} +1 -1
  179. package/dist/client/assets/{addon-webgl-DitJj-N0.js → addon-webgl-CIIKXrvK.js} +1 -1
  180. package/dist/client/assets/adventure-evidence-DgQbBmfa.css +1 -0
  181. package/dist/client/assets/adventure-habitats-v1-CVMbdB_Z.png +0 -0
  182. package/dist/client/assets/adventure-habitats-v1-M1lcpTJh.js +1 -0
  183. package/dist/client/assets/adventure-playback-DTfkhIc0.js +3 -0
  184. package/dist/client/assets/adventure-reader-DM5UDDm9.css +1 -0
  185. package/dist/client/assets/agent-adventures-DZtWpj6k.css +1 -0
  186. package/dist/client/assets/agent-autocomplete-CeHQpuG9.js +10 -0
  187. package/dist/client/assets/{agent-essentials-K9B6kbTS.js → agent-essentials-8t2il7PV.js} +1 -1
  188. package/dist/client/assets/{agent-floor-CuJr1iK1.css → agent-floor-Dmr9hZHL.css} +1 -1
  189. package/dist/client/assets/agent-floor-actor-3v9drnxh.js +1 -0
  190. package/dist/client/assets/agent-floor-world-Bnd1AtwK.css +1 -0
  191. package/dist/client/assets/agent-floor-world-layout-hfMjuoui.js +1 -0
  192. package/dist/client/assets/agent-lane-card-model-l0stnU9N.js +1 -0
  193. package/dist/client/assets/{agent-lane-detail-ppJId6Jc.js → agent-lane-detail-Db7KyAlf.js} +1 -1
  194. package/dist/client/assets/{agent-lane-preview-BhplDYGf.js → agent-lane-preview-B8lsQJOQ.js} +1 -1
  195. package/dist/client/assets/{agent-lanes-DlqcEf0l.css → agent-lanes-DmgipV9D.css} +1 -1
  196. package/dist/client/assets/agent-lanes-model-CX0wTcnF.js +4 -0
  197. package/dist/client/assets/agent-master-THmq-1k8.css +1 -0
  198. package/dist/client/assets/agent-master-model-C-KdOFDK.js +1 -0
  199. package/dist/client/assets/{agent-specialization-CtF_jI34.js → agent-specialization-CiVxQsFT.js} +1 -1
  200. package/dist/client/assets/agent-state-DDhnFEEP.js +1 -0
  201. package/dist/client/assets/{api-HFH8wFyb.js → api-B9_IqFKY.js} +1 -1
  202. package/dist/client/assets/api-CaROe5_H.js +1 -0
  203. package/dist/client/assets/{arc.es-BNXJqSw7.js → arc.es-BzhWalCl.js} +1 -1
  204. package/dist/client/assets/{arrow-down-BAGkhHA6.js → arrow-down-WoVlkUmg.js} +1 -1
  205. package/dist/client/assets/{arrow-left-eToA6GxC.js → arrow-left-PuKdO3NM.js} +1 -1
  206. package/dist/client/assets/{arrow-right-DTX42clh.js → arrow-right-ldbfp4SZ.js} +1 -1
  207. package/dist/client/assets/{arrow-up-right-B09GPwFl.js → arrow-up-right-Hn754ybA.js} +1 -1
  208. package/dist/client/assets/book-open-BlJnpf2U.js +1 -0
  209. package/dist/client/assets/{bot-WxKXYtEX.js → bot-CfN9PSBF.js} +1 -1
  210. package/dist/client/assets/broker-display-BkBzyvbR.js +2 -0
  211. package/dist/client/assets/{cache-CeWH_KzJ.js → cache-DEy9E34b.js} +1 -1
  212. package/dist/client/assets/{check-Dz2SRHft.js → check-B8dMv3Is.js} +1 -1
  213. package/dist/client/assets/{chevron-down-D120PY4g.js → chevron-down-B5eMsn5c.js} +1 -1
  214. package/dist/client/assets/{chevron-right-CowuvuE6.js → chevron-right-C7UGFpkl.js} +1 -1
  215. package/dist/client/assets/chevron-up-BHOEgHcn.js +1 -0
  216. package/dist/client/assets/{chunk-HRAB3GC3-KjjrTLCU.js → chunk-HRAB3GC3-C5X-kFhb.js} +1 -1
  217. package/dist/client/assets/chunk-JTPDIGGW-ZC-98AHT.js +46 -0
  218. package/dist/client/assets/{chunk-T65CQEWV-H2QEKfr1.js → chunk-T65CQEWV-CSVUz2rY.js} +1 -1
  219. package/dist/client/assets/chunk-YOZR3KYS-B59jqwO0.js +2 -0
  220. package/dist/client/assets/{clock-_9FDplIT.js → clock-DFcRbtrl.js} +1 -1
  221. package/dist/client/assets/{code-xml-CkkNdRmu.js → code-xml-BmyLM0I2.js} +1 -1
  222. package/dist/client/assets/coffee-C_D9zooM.js +1 -0
  223. package/dist/client/assets/colors-CFlbwC25.js +1 -0
  224. package/dist/client/assets/comms-deck-C8nVeMBh.css +1 -0
  225. package/dist/client/assets/comms-deck-CBhsXnY-.js +2 -0
  226. package/dist/client/assets/comms-gesture-_aGFo6g3.js +2 -0
  227. package/dist/client/assets/{compass-BdpImt_W.js → compass-DTZdCpv9.js} +1 -1
  228. package/dist/client/assets/content-B5Q4pb9R.js +1 -0
  229. package/dist/client/assets/content-BK1IfOZs.js +1 -0
  230. package/dist/client/assets/content-BeEsWLEm.js +1 -0
  231. package/dist/client/assets/content-BkOwEknW.js +1 -0
  232. package/dist/client/assets/content-C32W5kAG.js +1 -0
  233. package/dist/client/assets/content-CoqyLs9v.js +1 -0
  234. package/dist/client/assets/content-CwpdIS5b.js +1 -0
  235. package/dist/client/assets/content-DS2OkJ3Q.js +1 -0
  236. package/dist/client/assets/content-DXKaPDfn.js +1 -0
  237. package/dist/client/assets/content-DZt5-dkI.js +1 -0
  238. package/dist/client/assets/content-DbQJH8L1.js +1 -0
  239. package/dist/client/assets/content-DetoiaHq.js +1 -0
  240. package/dist/client/assets/content-Dhu3wL7J.js +1 -0
  241. package/dist/client/assets/content-Dpv34iZu.js +1 -0
  242. package/dist/client/assets/content-TtQJb61D.js +1 -0
  243. package/dist/client/assets/content-ymNb2R7g.js +1 -0
  244. package/dist/client/assets/{context-budget-DqxWzalx.js → context-budget-DemtXu7E.js} +1 -1
  245. package/dist/client/assets/{conversation-icons-DHGc9wbT.js → conversation-icons-BQ4OeOmr.js} +1 -1
  246. package/dist/client/assets/conversation-model-BGFHoxQ0.js +1 -0
  247. package/dist/client/assets/conversation-motion-features-9x8uZpwh.js +1 -0
  248. package/dist/client/assets/conversations-Cbg9h_Af.js +1 -0
  249. package/dist/client/assets/{copy-BzdzWsQd.js → copy-D9WUpQRf.js} +1 -1
  250. package/dist/client/assets/{cpu-CHFIGw87.js → cpu-Ck_4tB_-.js} +1 -1
  251. package/dist/client/assets/{createLucideIcon-Dv8H8m7J.js → createLucideIcon-DkjnzvcJ.js} +1 -1
  252. package/dist/client/assets/{credentials-BTce3VP1.js → credentials-C4VXz2hr.js} +1 -1
  253. package/dist/client/assets/discover-C8IOY7_K.js +2 -0
  254. package/dist/client/assets/embed-entry-CG3CfCbm.js +2 -0
  255. package/dist/client/assets/embed-navigation-DayfkQau.js +1 -0
  256. package/dist/client/assets/{external-link-BvX5PfLh.js → external-link-RT4Ph-6-.js} +1 -1
  257. package/dist/client/assets/{eye-C9cGk5z6.js → eye-CtqSV8BS.js} +1 -1
  258. package/dist/client/assets/{file-code-corner-jlGFdr8d.js → file-code-corner-D_Aptal2.js} +1 -1
  259. package/dist/client/assets/{file-text-BHro8MkG.js → file-text-ChtICwub.js} +1 -1
  260. package/dist/client/assets/flag-CqdOxVkI.js +1 -0
  261. package/dist/client/assets/floor-character-name-CqJPOlXb.js +1 -0
  262. package/dist/client/assets/floor-context-model-DZBpo_oD.js +1 -0
  263. package/dist/client/assets/floor-context-sheet-BFnkFiY3.css +1 -0
  264. package/dist/client/assets/floor-memory-YMM8AlLY.js +1 -0
  265. package/dist/client/assets/floor-message-passes-CJh9f8Jp.js +1 -0
  266. package/dist/client/assets/floor-preview-text-HrORUJ7D.js +1 -0
  267. package/dist/client/assets/floor-replay-CccYqE-f.css +1 -0
  268. package/dist/client/assets/floor-tactical-hud-HL5Vja5Y.css +1 -0
  269. package/dist/client/assets/folder-0fWevPvQ.js +1 -0
  270. package/dist/client/assets/{gauge-DSflSery.js → gauge-Dgtfxf_o.js} +1 -1
  271. package/dist/client/assets/{gestures-YA5IIwp-.js → gestures-BDCZ1FRG.js} +1 -1
  272. package/dist/client/assets/{git-branch-Bc_eDIpG.js → git-branch-CA3cHKCI.js} +1 -1
  273. package/dist/client/assets/go-shortcuts-DKtw4qYx.js +1 -0
  274. package/dist/client/assets/home-moving-signal-B7m-ngb2.js +1 -0
  275. package/dist/client/assets/home-now-card-DduXkHRR.js +1 -0
  276. package/dist/client/assets/{home-now-card-nano-Jmy7eJ6H.js → home-now-card-nano-D1ScGrgv.js} +1 -1
  277. package/dist/client/assets/hooks-C6VyQTQe.js +2 -0
  278. package/dist/client/assets/{hooks-D6NI15f6.css → hooks-D787lBmm.css} +1 -1
  279. package/dist/client/assets/index-C5cX8dkl.js +1 -0
  280. package/dist/client/assets/{index-C1VaWNuD.js → index-C8uS5szO.js} +5 -5
  281. package/dist/client/assets/index-Ck1__1yL.css +1 -0
  282. package/dist/client/assets/index-ClOOrVG1.js +1 -0
  283. package/dist/client/assets/index-Crtgfc9I.js +1 -0
  284. package/dist/client/assets/index-CvsM3jm8.js +1 -0
  285. package/dist/client/assets/{inspector-panel-CwrHjRaQ.js → inspector-panel-BLhDODb3.js} +2 -2
  286. package/dist/client/assets/{keyboard-nav-B8sQ_8IF.js → keyboard-nav-CXfav14z.js} +1 -1
  287. package/dist/client/assets/knowledge-search-BNdQweGz.css +1 -0
  288. package/dist/client/assets/{lane-edit-display-C_Aujldz.js → lane-edit-display-BjdT9oZl.js} +1 -1
  289. package/dist/client/assets/{lane-observe-vfyACHi0.js → lane-observe-BD21P8BB.js} +2 -2
  290. package/dist/client/assets/lane-roster-store-DzNHP392.js +1 -0
  291. package/dist/client/assets/{lane-tool-detail-0WhMf4Vj.js → lane-tool-detail-Czggx8oM.js} +1 -1
  292. package/dist/client/assets/{layers-CW2-qHsG.js → layers-Bolb8ejU.js} +1 -1
  293. package/dist/client/assets/{layout-grid-BoVnPOk-.js → layout-grid-DI9tVJ2E.js} +1 -1
  294. package/dist/client/assets/left-B-_z_nqj.js +2 -0
  295. package/dist/client/assets/left-B1LY7rJc.js +1 -0
  296. package/dist/client/assets/{left-DH44V4I_.css → left-BV9yMiTL.css} +1 -1
  297. package/dist/client/assets/left-C6bdjWcG.js +2 -0
  298. package/dist/client/assets/left-CF4iuqlz.js +1 -0
  299. package/dist/client/assets/left-DLtNyZl1.js +1 -0
  300. package/dist/client/assets/left-Fpxoq-VY.js +1 -0
  301. package/dist/client/assets/left-N2wXfTlp.js +1 -0
  302. package/dist/client/assets/left-advisor-CeIjCKbd.js +1 -0
  303. package/dist/client/assets/left-agents-upjHVlOj.js +1 -0
  304. package/dist/client/assets/left-default-08gmdCtb.js +1 -0
  305. package/dist/client/assets/left-lanes-Cvsp73Hw.js +1 -0
  306. package/dist/client/assets/left-mission-DENnfshd.css +1 -0
  307. package/dist/client/assets/left-mission-W1LLaz74.js +1 -0
  308. package/dist/client/assets/library-DLKBVUJ6.js +1 -0
  309. package/dist/client/assets/{loader-circle-DmUG_YC7.js → loader-circle-DurUYl7E.js} +1 -1
  310. package/dist/client/assets/{local-agents-VP1-ZlPw.js → local-agents-D9fYYRyj.js} +1 -1
  311. package/dist/client/assets/machine-children-RGS4Q0r6.js +1 -0
  312. package/dist/client/assets/machine-scope-DJt9RZ2w.js +1 -0
  313. package/dist/client/assets/mentions-Ctw1ECUC.js +1 -0
  314. package/dist/client/assets/{mesh-ops-CKSWgax2.js → mesh-ops-CGpRk4ik.js} +1 -1
  315. package/dist/client/assets/{mesh-screen-D1Yvo8fU.css → mesh-screen-DjA4mOaN.css} +1 -1
  316. package/dist/client/assets/mesh-view-store-CliSYsmt.js +1 -0
  317. package/dist/client/assets/{message-circle-joGFxfj1.js → message-circle-CSiJj6yo.js} +1 -1
  318. package/dist/client/assets/{message-markup-DC0QFEZn.js → message-markup-DgFSyb3f.js} +1 -1
  319. package/dist/client/assets/{message-square-BLiFqpe_.js → message-square-NmXWtWLR.js} +1 -1
  320. package/dist/client/assets/{message-visibility-CGOmSSKs.js → message-visibility-DwxgcgYK.js} +1 -1
  321. package/dist/client/assets/mission-control-CsX3Yc58.css +1 -0
  322. package/dist/client/assets/mission-control-model-C30vU1Fe.js +1 -0
  323. package/dist/client/assets/mission-control-store-DZ29Mlj1.js +1 -0
  324. package/dist/client/assets/{mission-wall-CocIM1cF.js → mission-wall-DOuGOxQy.js} +1 -1
  325. package/dist/client/assets/nav-destinations-CyXnw9kh.js +1 -0
  326. package/dist/client/assets/observe-CkfOxYx_.js +1 -0
  327. package/dist/client/assets/{operator-attention-RqieiSY8.js → operator-attention-DGR4kOog.js} +1 -1
  328. package/dist/client/assets/ops-screen-CxYM0VOW.css +1 -0
  329. package/dist/client/assets/page-status-CkS3SZu-.js +1 -0
  330. package/dist/client/assets/panel-right-BNTJhy8M.js +1 -0
  331. package/dist/client/assets/pause-DWS7YGQ3.js +1 -0
  332. package/dist/client/assets/{persistent-state-BubPQ7tT.js → persistent-state-xsuk6Kc-.js} +1 -1
  333. package/dist/client/assets/pin-DWlD1BOF.js +1 -0
  334. package/dist/client/assets/pip-idle-v1-Tt-CZsRG.png +0 -0
  335. package/dist/client/assets/pip-thinking-v1-BoHWSEye.png +0 -0
  336. package/dist/client/assets/pip-waiting-v1-DkuvJ-dN.png +0 -0
  337. package/dist/client/assets/pip-working-v1-wWQLRS1z.png +0 -0
  338. package/dist/client/assets/play-D_Pggug4.js +1 -0
  339. package/dist/client/assets/{plus-BWKhylds.js → plus-D_wLGJGT.js} +1 -1
  340. package/dist/client/assets/profile-C3KgiZvc.js +1 -0
  341. package/dist/client/assets/{projects-inbox-DFbgVlXL.js → projects-inbox-DvbqJO3q.js} +1 -1
  342. package/dist/client/assets/{proxy-DVDRhSRR.js → proxy-DOG46ja4.js} +1 -1
  343. package/dist/client/assets/{radio-CxIXS1nU.js → radio-C_jtwbFP.js} +1 -1
  344. package/dist/client/assets/{refresh-cw-Bkh7Cvnd.js → refresh-cw-Da9DDLk2.js} +1 -1
  345. package/dist/client/assets/resolve-panes-DuowGRTk.js +1 -0
  346. package/dist/client/assets/resolve-sidebar-context-BkTbqteq.js +1 -0
  347. package/dist/client/assets/right-B9OUA6Ho.js +1 -0
  348. package/dist/client/assets/right-BDQnjetX.js +1 -0
  349. package/dist/client/assets/{right-DVUq5374.js → right-BLJsc2-p.js} +2 -2
  350. package/dist/client/assets/right-BUbKHmRH.js +1 -0
  351. package/dist/client/assets/right-Ci2IcD4s.js +1 -0
  352. package/dist/client/assets/right-CmCce3e5.js +1 -0
  353. package/dist/client/assets/right-D7w0zM5a.js +1 -0
  354. package/dist/client/assets/right-DIoON_bv.js +1 -0
  355. package/dist/client/assets/right-E0Jr3VN5.js +1 -0
  356. package/dist/client/assets/right-lCdAk9dW.js +1 -0
  357. package/dist/client/assets/{rocket-CnxqjX_K.js → rocket-DyrYDo8V.js} +1 -1
  358. package/dist/client/assets/router-BKiMcYa7.js +1 -0
  359. package/dist/client/assets/{runtime-picker-BYAFNLNq.css → runtime-picker-C3JwrDKP.css} +1 -1
  360. package/dist/client/assets/runtime-picker-DdsttHHc.js +1 -0
  361. package/dist/client/assets/{scope-views-KPY85UUx.js → scope-views-B7PZGlhY.js} +1 -1
  362. package/dist/client/assets/scout-voice-DOQ_B77g.js +1 -0
  363. package/dist/client/assets/{scoutbot-D7kGGyK_.js → scoutbot-Bk3nyrkj.js} +2 -2
  364. package/dist/client/assets/{scoutbot-markdown-yb87JlSE.js → scoutbot-markdown-Bz0Vbto2.js} +1 -1
  365. package/dist/client/assets/{scroll-text-DFcBYy5J.js → scroll-text-DwC8r2g6.js} +1 -1
  366. package/dist/client/assets/{search-FB2vVxCp.js → search-C4VlW_0l.js} +1 -1
  367. package/dist/client/assets/secondaryNavConfig-DAXIFtVd.js +1 -0
  368. package/dist/client/assets/{selection-bridge-qBGFCJv8.js → selection-bridge-B5jqyMR9.js} +1 -1
  369. package/dist/client/assets/{send-horizontal-CS7mxVhX.js → send-horizontal-pOtGI7FM.js} +1 -1
  370. package/dist/client/assets/send-to-agent-session-BZGq_ycy.js +1 -0
  371. package/dist/client/assets/{server-WY6gsbZz.js → server-ms1yxUYJ.js} +1 -1
  372. package/dist/client/assets/{session-catalog-CG4oL_yN.js → session-catalog-s-T_w41t.js} +1 -1
  373. package/dist/client/assets/{session-table-uJh3v-ly.js → session-table-CDx_16xf.js} +1 -1
  374. package/dist/client/assets/sessions-view-DzYGsKWS.js +1 -0
  375. package/dist/client/assets/{settings-DQEtqkM9.js → settings-TJIkkZ0P.js} +1 -1
  376. package/dist/client/assets/shared-work-artifacts-4IIQXQfc.js +1 -0
  377. package/dist/client/assets/{sliders-horizontal-57e99_qO.js → sliders-horizontal-CHf3ntw0.js} +1 -1
  378. package/dist/client/assets/solar-system-scope-2k-stars-points-1FwHnkj0.png +0 -0
  379. package/dist/client/assets/{sparkles-D0vWLTyC.js → sparkles-BbOFw3d0.js} +1 -1
  380. package/dist/client/assets/sprout-action-sprite-DZ8C0fTl.css +1 -0
  381. package/dist/client/assets/sprout-actions-proof-v1-BzUdc812.png +0 -0
  382. package/dist/client/assets/{sse-B29iGBnw.js → sse-v5QLsOHV.js} +1 -1
  383. package/dist/client/assets/system-surfaces-redesign-DKFg4GB5.css +1 -0
  384. package/dist/client/assets/{tail-display-DcliDVkW.js → tail-display-DHSNmvor.js} +2 -2
  385. package/dist/client/assets/{tail-events-LK29oCKm.js → tail-events-DQ46QBW1.js} +1 -1
  386. package/dist/client/assets/{terminal-UDy4lzV1.js → terminal-96JWDYDL.js} +1 -1
  387. package/dist/client/assets/{terminal-relay-CXHMdain.js → terminal-relay-Bfx8pg80.js} +1 -1
  388. package/dist/client/assets/terminal-screen-Bpb2SZrn.css +1 -0
  389. package/dist/client/assets/{terminal-sessions-Bdt2W3Y4.js → terminal-sessions-Ch9aYlgi.js} +1 -1
  390. package/dist/client/assets/{terminal-takeover-BMeBjBB2.js → terminal-takeover-BlpxpvSp.js} +1 -1
  391. package/dist/client/assets/use-beside-Df-F2Uvg.js +1 -0
  392. package/dist/client/assets/use-conversation-list-A_YUf8lo.js +1 -0
  393. package/dist/client/assets/{use-fleet-active-asks-CCGrll5q.js → use-fleet-active-asks-DFs_u-vM.js} +1 -1
  394. package/dist/client/assets/use-mesh-node-state-Ck9CYplv.js +1 -0
  395. package/dist/client/assets/{use-mesh-ops-items-BjyeFJTz.js → use-mesh-ops-items-Be1WmwCg.js} +1 -1
  396. package/dist/client/assets/{use-reduced-motion-CPoX8iV2.js → use-reduced-motion-D7n3vK8t.js} +1 -1
  397. package/dist/client/assets/use-scout-dev-flags-0TXfQcG0.js +1 -0
  398. package/dist/client/assets/{useAgentHoverCard-BgTLNcF-.js → useAgentHoverCard-Dr-OjNFF.js} +1 -1
  399. package/dist/client/assets/useContentSecondaryNav-CGvMOVGY.js +1 -0
  400. package/dist/client/assets/{useEmbedHeadline-DuUnwTB7.js → useEmbedHeadline-BL8wQawZ.js} +1 -1
  401. package/dist/client/assets/{usePierreRuntime-35AHf9RQ.js → usePierreRuntime-DJkRHMoe.js} +1 -1
  402. package/dist/client/assets/worker-rendered-v1-DmGVMlVi.png +0 -0
  403. package/dist/client/assets/worker-thinking-v1-ujakpzrK.png +0 -0
  404. package/dist/client/assets/worker-waiting-v1-DbTSsfJJ.png +0 -0
  405. package/dist/client/assets/worker-working-v1-BROAvJ_z.png +0 -0
  406. package/dist/client/assets/world-outposts-v1-DOt0i98W.png +0 -0
  407. package/dist/client/assets/{wrench-BfVeded5.js → wrench-BsMTSeji.js} +1 -1
  408. package/dist/client/assets/{x-DgmmnPKt.js → x-DI1ktCYb.js} +1 -1
  409. package/dist/client/assets/{xterm-DnJJmrCA.js → xterm-B1YBE4Gq.js} +1 -1
  410. package/dist/client/assets/{zap-Bcja1lHG.js → zap-sKPkh4sQ.js} +1 -1
  411. package/dist/client/characters/sage/sage.glb +0 -0
  412. package/dist/client/crew/brik-bust.webp +0 -0
  413. package/dist/client/crew/brik-chip-id.webp +0 -0
  414. package/dist/client/crew/fenn-bust.webp +0 -0
  415. package/dist/client/crew/fenn-chip-id.webp +0 -0
  416. package/dist/client/crew/lulu-bust.webp +0 -0
  417. package/dist/client/crew/milo-bust.webp +0 -0
  418. package/dist/client/crew/milo-chip-id.webp +0 -0
  419. package/dist/client/crew/nori-bust.webp +0 -0
  420. package/dist/client/crew/pip-bust.webp +0 -0
  421. package/dist/client/crew/pip-chip-id.webp +0 -0
  422. package/dist/client/crew/sheets/eye-plate-v1/blink-half.webp +0 -0
  423. package/dist/client/crew/sheets/eye-plate-v1/blink-shut.webp +0 -0
  424. package/dist/client/crew/sheets/eye-plate-v1/look-left.webp +0 -0
  425. package/dist/client/crew/sheets/eye-plate-v1/look-right.webp +0 -0
  426. package/dist/client/crew/sheets/eye-plate-v1/look-up.webp +0 -0
  427. package/dist/client/crew/sheets/eye-plate-v1/rest.webp +0 -0
  428. package/dist/client/crew/sheets/sprout/blink-half.webp +0 -0
  429. package/dist/client/crew/sheets/sprout/blink-shut.webp +0 -0
  430. package/dist/client/crew/sheets/sprout/look-left.webp +0 -0
  431. package/dist/client/crew/sheets/sprout/look-right.webp +0 -0
  432. package/dist/client/crew/sheets/sprout/look-up.webp +0 -0
  433. package/dist/client/crew/sprout-bust.webp +0 -0
  434. package/dist/client/crew/sprout-chip-id.webp +0 -0
  435. package/dist/client/crew/tuck-bust.webp +0 -0
  436. package/dist/client/crew/tuck-chip-id.webp +0 -0
  437. package/dist/client/crew/vex-bust.webp +0 -0
  438. package/dist/client/crew/vex-chip-id.webp +0 -0
  439. package/dist/client/crew/wrench-bust.webp +0 -0
  440. package/dist/client/crew/wrench-chip-id.webp +0 -0
  441. package/dist/client/index.html +2 -2
  442. package/dist/drizzle/0017_wise_silver_sable.sql +26 -0
  443. package/dist/drizzle/0018_message_epoch_order.sql +1 -0
  444. package/dist/drizzle/meta/0017_snapshot.json +6785 -0
  445. package/dist/drizzle/meta/0018_snapshot.json +6804 -0
  446. package/dist/drizzle/meta/_journal.json +14 -0
  447. package/dist/main.mjs +26906 -24284
  448. package/dist/node/main.mjs +7077 -6284
  449. package/dist/openscout-terminal-relay.mjs +391 -9
  450. package/dist/pairing-runtime-controller.mjs +35541 -34446
  451. package/dist/runtime/base-daemon.mjs +31 -8
  452. package/dist/runtime/broker-daemon.mjs +7864 -2578
  453. package/dist/runtime/broker-process-manager.mjs +15 -3
  454. package/dist/runtime/mesh-discover.mjs +14 -3
  455. package/dist/scout-control-plane-web.mjs +37053 -33186
  456. package/dist/statusline.mjs +1021 -35
  457. package/dist/update-helper.mjs +32169 -0
  458. package/package.json +2 -2
  459. package/dist/client/assets/ActivityScreen-sfonf5SR.js +0 -1
  460. package/dist/client/assets/AgentAvatar-Dz79iTxB.js +0 -1
  461. package/dist/client/assets/AgentConfigurationScreen-DDc3udYM.js +0 -1
  462. package/dist/client/assets/AgentDefinitionsWorkspace-DHDS9Pgd.js +0 -1
  463. package/dist/client/assets/AgentDetailCard-8viaEY8b.js +0 -1
  464. package/dist/client/assets/AgentFloorView-DuyvyMMj.js +0 -1
  465. package/dist/client/assets/AgentInfoScreen-qntgg2q2.js +0 -1
  466. package/dist/client/assets/AgentLanesEmbedScreen-BA6fRwkD.js +0 -1
  467. package/dist/client/assets/AgentLanesView-96lHsoX7.js +0 -2
  468. package/dist/client/assets/AgentLiveActions-DlSKL60c.js +0 -1
  469. package/dist/client/assets/AgentMasterScreen-DHrMuQ6_.js +0 -1
  470. package/dist/client/assets/AgentSessions-DV9v34aq.js +0 -6
  471. package/dist/client/assets/AgentsConsole-DTpVhS67.js +0 -1
  472. package/dist/client/assets/AgentsScreen-hZ4o2I-e.js +0 -1
  473. package/dist/client/assets/AgentsSubnav-Ci7uWM7P.js +0 -1
  474. package/dist/client/assets/AtopView-D7vyQDtE.js +0 -1
  475. package/dist/client/assets/BackToPicker-BHicJyfc.js +0 -1
  476. package/dist/client/assets/BriefingDetailScreen-B-wD_Bot.js +0 -1
  477. package/dist/client/assets/BriefingsScreen-Cn4Mbam9.js +0 -1
  478. package/dist/client/assets/BrokerScreen-C8FQ5rlg.js +0 -5
  479. package/dist/client/assets/ChatCollapsedStrip-7Wrg8Ge0.js +0 -1
  480. package/dist/client/assets/CodeScreen-cLC0tJ4S.js +0 -1
  481. package/dist/client/assets/ConversationFeedRows-Bx0gFyG_.js +0 -1
  482. package/dist/client/assets/ConversationHeader-Bt2RBj93.js +0 -1
  483. package/dist/client/assets/ConversationPanels-o6W-cOoU.js +0 -6
  484. package/dist/client/assets/ConversationScreen-CkWnKXt6.css +0 -1
  485. package/dist/client/assets/ConversationScreen-DIU7m_aC.js +0 -2
  486. package/dist/client/assets/ConversationStatus-CTYOywFh.js +0 -1
  487. package/dist/client/assets/CrewWorkspaces-DNX-QQ1h.js +0 -1
  488. package/dist/client/assets/DispatchAftermath-ZCEB75hh.js +0 -1
  489. package/dist/client/assets/DocumentFocusViewer-D8iB6SMt.js +0 -1
  490. package/dist/client/assets/FlightObserveScreen-BTe1YRPr.js +0 -1
  491. package/dist/client/assets/FollowScreen-CkR-okdL.js +0 -1
  492. package/dist/client/assets/HarnessesScreen-COO_Q8VY.js +0 -1
  493. package/dist/client/assets/HostAdvisorView-DeJ-8RZV.js +0 -1
  494. package/dist/client/assets/KnowledgeSearchInspector-W_zNIBRV.js +0 -1
  495. package/dist/client/assets/KnowledgeSearchScreen-_rxJNUUh.js +0 -1
  496. package/dist/client/assets/LaneTraceDetailSheet-DNIECgEl.js +0 -1
  497. package/dist/client/assets/MeshCanvas-DZv2ipsy.js +0 -3
  498. package/dist/client/assets/MeshCanvasMinimap-BXHRNb7l.js +0 -1
  499. package/dist/client/assets/MeshScreen-DuNvpDC5.js +0 -1
  500. package/dist/client/assets/MessagesScreen-dNNPFwAc.js +0 -1
  501. package/dist/client/assets/MissionContextRail-DnCWPzAM.js +0 -1
  502. package/dist/client/assets/MissionControlView-DmaThhNR.js +0 -1
  503. package/dist/client/assets/MissionFocusOverlay-K21ssTxv.js +0 -1
  504. package/dist/client/assets/MissionLeftAgentRow-CbQm4BLv.js +0 -1
  505. package/dist/client/assets/MissionLogPane-BLvSSIdT.js +0 -1
  506. package/dist/client/assets/NewAgentModal-B7qxjZlW.js +0 -1
  507. package/dist/client/assets/NewChatComposer-D2Ah4T-W.js +0 -19
  508. package/dist/client/assets/ObserveEmbedScreen-DvKGsaLv.js +0 -2
  509. package/dist/client/assets/OpenScoutAppShell-C9TOLB7u.js +0 -79
  510. package/dist/client/assets/OpsAgentsView-vIoY-AW1.js +0 -1
  511. package/dist/client/assets/OpsScreen-CJBwshEp.js +0 -1
  512. package/dist/client/assets/OpsSubnav-CjDTnp64.js +0 -1
  513. package/dist/client/assets/ProjectAgentProfile-Br1eTD7G.js +0 -1
  514. package/dist/client/assets/ProjectAgentProfileHero-mjxNcRvw.js +0 -1
  515. package/dist/client/assets/ProjectsInbox-Bq29DE_o.js +0 -2
  516. package/dist/client/assets/ProjectsRail-kMDA0yn4.js +0 -1
  517. package/dist/client/assets/ProjectsScreen-BDaJYhc0.js +0 -1
  518. package/dist/client/assets/ProjectsThreadAside-B940p3vW.js +0 -1
  519. package/dist/client/assets/Provider-D0bB7q6y.js +0 -1
  520. package/dist/client/assets/RailRow-B88JVr62.js +0 -1
  521. package/dist/client/assets/RawSessionsTable-CzGhEdiZ.js +0 -1
  522. package/dist/client/assets/RealtimeVoiceScreen-CyP1CWsX.js +0 -1
  523. package/dist/client/assets/RepoDiffViewer-Bw5yMC4A.js +0 -7
  524. package/dist/client/assets/RepoDiffViewerLazy-DzfoFhbl.js +0 -2
  525. package/dist/client/assets/ScoutDeckSurface-DQoZofzH.js +0 -1
  526. package/dist/client/assets/SessionEmbedScreen-CpduQ0O9.js +0 -1
  527. package/dist/client/assets/SessionObserve-BVeTkcIl.js +0 -12
  528. package/dist/client/assets/SessionObserveEvidence-BkOezTGV.js +0 -1
  529. package/dist/client/assets/SessionRefScreen-DetLMkTT.js +0 -1
  530. package/dist/client/assets/SessionsScreen-B-McKw6d.js +0 -1
  531. package/dist/client/assets/SettingsDrawer-CPB32w0n.js +0 -3
  532. package/dist/client/assets/SettingsScreen-BEzYFdjz.js +0 -1
  533. package/dist/client/assets/SpriteAvatar-DFO4Kb4Z.js +0 -1
  534. package/dist/client/assets/Terminal-DWyZTZdY.js +0 -1
  535. package/dist/client/assets/TerminalEmbedScreen-_SSzwhWa.js +0 -1
  536. package/dist/client/assets/TerminalHeaderMount-CY7uIWBg.js +0 -1
  537. package/dist/client/assets/WorkFilesViewer-D8-4vF5l.js +0 -1
  538. package/dist/client/assets/agent-autocomplete-BlK8wY06.js +0 -10
  539. package/dist/client/assets/agent-lane-card-model-CY3OE1Xu.js +0 -1
  540. package/dist/client/assets/agent-lanes-model-tc-1hE6q.js +0 -2
  541. package/dist/client/assets/agent-master-I1W-5d-x.css +0 -1
  542. package/dist/client/assets/agent-master-model-DMcHeNq3.js +0 -1
  543. package/dist/client/assets/api-Co9aQ2Jw.js +0 -1
  544. package/dist/client/assets/broker-display-Q75fupqG.js +0 -2
  545. package/dist/client/assets/chunk-JTPDIGGW-COJ00z94.js +0 -46
  546. package/dist/client/assets/chunk-YOZR3KYS-CrCgXw9l.js +0 -2
  547. package/dist/client/assets/colors-BtO5_zlx.js +0 -1
  548. package/dist/client/assets/content-0RBfbCIJ.js +0 -1
  549. package/dist/client/assets/content-BTmnk2bl.js +0 -1
  550. package/dist/client/assets/content-Bk5DKhyP.js +0 -1
  551. package/dist/client/assets/content-Bw_8GE_S.js +0 -1
  552. package/dist/client/assets/content-CI4gLEWi.js +0 -1
  553. package/dist/client/assets/content-CLCtp9Rb.js +0 -1
  554. package/dist/client/assets/content-C_FAGTNk.js +0 -1
  555. package/dist/client/assets/content-CnnzWOE3.js +0 -1
  556. package/dist/client/assets/content-DKlY98pO.js +0 -1
  557. package/dist/client/assets/content-Df7ndXTG.js +0 -1
  558. package/dist/client/assets/content-DkZDzzx3.js +0 -1
  559. package/dist/client/assets/content-DnGmb2L0.js +0 -1
  560. package/dist/client/assets/content-Ds-zs-Ss.js +0 -1
  561. package/dist/client/assets/content-JIWSyC0f.js +0 -1
  562. package/dist/client/assets/content-Q3TIYC8q.js +0 -1
  563. package/dist/client/assets/content-evaBfvxD.js +0 -1
  564. package/dist/client/assets/conversation-model-C2KuZUXc.js +0 -1
  565. package/dist/client/assets/conversation-motion-features-BJnHs3Ul.js +0 -1
  566. package/dist/client/assets/discover-DutlV0ZU.js +0 -2
  567. package/dist/client/assets/embed-entry-CJG7WEVw.js +0 -2
  568. package/dist/client/assets/home-moving-signal-PHSqSBu_.js +0 -1
  569. package/dist/client/assets/home-now-card-C_qsI6C6.js +0 -1
  570. package/dist/client/assets/hooks-ME7rmhpE.js +0 -2
  571. package/dist/client/assets/index-C8UCRm2W.js +0 -1
  572. package/dist/client/assets/index-Cn0I2Hgi.js +0 -1
  573. package/dist/client/assets/index-Cx6Gbr6n.js +0 -1
  574. package/dist/client/assets/index-i7TMxlwW.css +0 -1
  575. package/dist/client/assets/knowledge-search-D_bLoYtC.css +0 -1
  576. package/dist/client/assets/lane-roster-store-DN2jxXF-.js +0 -1
  577. package/dist/client/assets/left-BRu9pnqx.js +0 -2
  578. package/dist/client/assets/left-BjS1dKNV.js +0 -2
  579. package/dist/client/assets/left-CL-TVLJ7.js +0 -1
  580. package/dist/client/assets/left-DLpsDi55.js +0 -1
  581. package/dist/client/assets/left-DPcM9o8Y.js +0 -1
  582. package/dist/client/assets/left-MmTJf1tK.js +0 -1
  583. package/dist/client/assets/left-P80i5V8L.js +0 -1
  584. package/dist/client/assets/left-advisor-CbXVzAqS.js +0 -1
  585. package/dist/client/assets/left-agents-7mJsiNyr.js +0 -1
  586. package/dist/client/assets/left-default-COK26l3H.js +0 -1
  587. package/dist/client/assets/left-lanes-Dbdm9Veu.js +0 -1
  588. package/dist/client/assets/left-mission-DSenPIyb.css +0 -1
  589. package/dist/client/assets/left-mission-DqGR5jby.js +0 -1
  590. package/dist/client/assets/library-COnWzUWv.js +0 -1
  591. package/dist/client/assets/mentions-BZ5SBMtc.js +0 -1
  592. package/dist/client/assets/mesh-buckets-CLYS8Jx8.js +0 -1
  593. package/dist/client/assets/mesh-view-store-CBM1za_N.js +0 -1
  594. package/dist/client/assets/mission-control-CnU7dNt1.css +0 -1
  595. package/dist/client/assets/mission-control-model-C0fByIjm.js +0 -1
  596. package/dist/client/assets/mission-control-store-CM8mQGg8.js +0 -1
  597. package/dist/client/assets/observe-BLmy4quB.js +0 -1
  598. package/dist/client/assets/ops-screen-giu3If_N.css +0 -1
  599. package/dist/client/assets/page-status-BE0-J1xY.js +0 -1
  600. package/dist/client/assets/paperclip-Br7wUDFl.js +0 -1
  601. package/dist/client/assets/perf-PX8Rx0EP.js +0 -1
  602. package/dist/client/assets/profile-BCvk8jOQ.js +0 -1
  603. package/dist/client/assets/resolve-panes-DhD5qmQO.js +0 -1
  604. package/dist/client/assets/resolve-sidebar-context-GqhZNRPY.js +0 -1
  605. package/dist/client/assets/right-B_08ilv6.js +0 -1
  606. package/dist/client/assets/right-Brm67HOL.js +0 -1
  607. package/dist/client/assets/right-BveAPKBW.js +0 -1
  608. package/dist/client/assets/right-CpTB_-Ya.js +0 -1
  609. package/dist/client/assets/right-CqC4Qdot.js +0 -1
  610. package/dist/client/assets/right-D91j9d5Y.js +0 -1
  611. package/dist/client/assets/right-DaLRhYl3.js +0 -1
  612. package/dist/client/assets/right-Dt1wOwA5.js +0 -1
  613. package/dist/client/assets/right-DtzqIZQF.js +0 -1
  614. package/dist/client/assets/router-kfcaYqZr.js +0 -1
  615. package/dist/client/assets/runtime-picker-C20lTGhV.js +0 -1
  616. package/dist/client/assets/scout-voice-Cg1qfepC.js +0 -1
  617. package/dist/client/assets/secondaryNavConfig-C0Srrmy8.js +0 -1
  618. package/dist/client/assets/system-surfaces-redesign-kuf3wuE_.css +0 -1
  619. package/dist/client/assets/terminal-screen-vMICbBJh.css +0 -1
  620. package/dist/client/assets/use-conversation-list-UG-tMN67.js +0 -1
  621. package/dist/client/assets/use-scout-dev-flags-DTseRrFi.js +0 -1
  622. package/dist/client/assets/useContentSecondaryNav-CoIoz7JU.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as d,j as e}from"./index-C8uS5szO.js";/* empty css */import{D as ys}from"./DataTable-BMOZ1-z8.js";import{H,h as F}from"./HarnessMark-Bt47OeHy.js";import{O as vs}from"./ObservedTopologyPanel-DkEkQzo-.js";import{a as es}from"./api-CaROe5_H.js";import{o as ts,i as U}from"./surface-activity-B1rgWB1i.js";import{a as Ns,d as gs}from"./time-Dhsh_2EG.js";import{u as Is}from"./tail-events-DQ46QBW1.js";/* empty css */import"./index-BWHgHrtv.js";const ns=4e3,bs=500,Cs=5e3,Es=5e3,Ss=6e4,q={"scout-managed":"scout","hudson-managed":"hudson",unattributed:"native"},X={tool:"working",run:"active",idle:"idle"};function G(s){const n=s.split(/\s+/)[0]??"",l=n.lastIndexOf("/");return l>=0?n.slice(l+1):n}function ws(s,n=60){const l=s.split(/\s+/);if(l.length===0)return s;l[0]=G(l[0]);const c=l.join(" ");return c.length<=n?c:c.slice(0,n-1)+"…"}function Ms(s){for(const n of s){const l=G(n.command);if(l&&!(l==="sh"||l==="zsh"||l==="bash"||l==="login"))return l}return s[0]?.command?G(s[0].command):"—"}function As(s){const n=s.match(/^(?:(\d+)-)?(?:(\d+):)?(\d+):(\d+)$/);if(!n){const u=s.match(/^(\d+)$/);return u?Number.parseInt(u[1],10):0}const[,l,c,m,p]=n;let f=Number.parseInt(p,10)+Number.parseInt(m,10)*60;return c&&(f+=Number.parseInt(c,10)*3600),l&&(f+=Number.parseInt(l,10)*86400),f}function rs(s){if(s<60)return`${s}s`;if(s<3600)return`${Math.floor(s/60)}m${String(s%60).padStart(2,"0")}`;if(s<86400){const c=Math.floor(s/3600),m=Math.floor(s%3600/60);return`${c}h${String(m).padStart(2,"0")}`}const n=Math.floor(s/86400),l=Math.floor(s%86400/3600);return`${n}d${String(l).padStart(2,"0")}h`}function is(s,n){return Ns(s,n)||"—"}function $s(s){return gs(s)||"—"}function Q(s){return s?s.slice(0,8):"—"}function cs(s){return s?.trim().toLowerCase()||"unknown"}function Rs(s){return cs(s).replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Z(s){return`s-atop-chip s-atop-chip--harness s-atop-chip--harness-${Rs(s)}`}const Ts=/permission-mode/i;function as(s){return s.kind!=="system"?!1:Ts.test(s.summary)}function J(s){return s.kind==="assistant"}function Ws(s,n,l){if(!s)return[];const c=new Map,m=new Map;for(const t of n){let r=c.get(t.pid);if(r||(r={firstEventAt:t.ts,lastEventAt:t.ts,lastKind:t.kind,lastSummary:t.summary,reqCount:0,toolCount:0,permCount:0,eventCount:0,sessionId:t.sessionId||null,model:null,tokIn:null,tokOut:null,cacheReadIn:null,cacheWriteIn:null},c.set(t.pid,r)),t.ts<r.firstEventAt&&(r.firstEventAt=t.ts),t.ts>=r.lastEventAt&&(r.lastEventAt=t.ts,r.lastKind=t.kind,r.lastSummary=t.summary),r.eventCount++,t.kind==="tool"&&r.toolCount++,J(t)&&r.reqCount++,as(t)&&r.permCount++,t.sessionId&&!r.sessionId&&(r.sessionId=t.sessionId),t.sessionId){let a=m.get(t.sessionId);a||(a={firstEventAt:t.ts,lastEventAt:t.ts,lastKind:t.kind,lastSummary:t.summary,reqCount:0,toolCount:0,permCount:0,eventCount:0,sessionId:t.sessionId,model:null,tokIn:null,tokOut:null,cacheReadIn:null,cacheWriteIn:null},m.set(t.sessionId,a)),t.ts<a.firstEventAt&&(a.firstEventAt=t.ts),t.ts>=a.lastEventAt&&(a.lastEventAt=t.ts,a.lastKind=t.kind,a.lastSummary=t.summary),a.eventCount++,t.kind==="tool"&&a.toolCount++,J(t)&&a.reqCount++,as(t)&&a.permCount++}}const p=new Map;for(const t of s.processes){if(!t.cwd)continue;const r=Y(t.source,t.cwd),a=p.get(r);(!a||t.pid<a.pid)&&p.set(r,t)}const f=new Map,u=new Map;for(const t of s.transcripts??[]){const r=Y(t.source,t.cwd),a=os(t),j=u.get(r)??Number.NEGATIVE_INFINITY,N=f.get(r)??"";(t.mtimeMs>j||t.mtimeMs===j&&a>N)&&(u.set(r,t.mtimeMs),f.set(r,a))}const h=new Set,I=(t,r,a,j)=>{r&&h.add(r.pid);let N="idle";const w=Math.max(a?.lastEventAt??0,j?.mtimeMs??0);a&&l-a.lastEventAt<Es&&(N=a.lastKind==="tool"?"tool":"run"),N==="idle"&&l-w<6e4&&(N="run");const L=r?As(r.etime):0,D=a?.firstEventAt??null,V=a&&a.firstEventAt<a.lastEventAt?Math.min(Math.max(0,Math.round((a.lastEventAt-a.firstEventAt)/1e3)),L||Number.POSITIVE_INFINITY):0,_=r?.pid??Os(t),R=j?.cwd??r?.cwd??"";return{key:t,pid:_,ppid:r?.ppid??0,sessionId:j?.sessionId??a?.sessionId??null,transcriptPath:j?.transcriptPath??null,harness:cs(j?.source??r?.source),attribution:r?.harness??j?.harness??"unattributed",project:j?.project?.trim()||(R?Ps(R):"(unknown)"),cwd:R,command:r?.command??`${j?.source??"unknown"} transcript`,parentLabel:r?Ms(r.parentChain??[]):"transcript",procRuntimeSec:L,procEtime:r?.etime??"0",sessionStartAt:D,sessionRuntimeSec:V,status:N,lastEventAt:w||null,lastEventKind:a?.lastKind??null,lastSummary:a?.lastSummary??null,reqCount:a?.reqCount??0,toolCount:a?.toolCount??0,permCount:a?.permCount??0,eventCount:a?.eventCount??0,model:a?.model??null,tokIn:a?.tokIn??null,tokOut:a?.tokOut??null,cacheReadIn:a?.cacheReadIn??null,cacheWriteIn:a?.cacheWriteIn??null}},k=(s.transcripts??[]).map(t=>{const r=os(t),a=Y(t.source,t.cwd),j=f.get(a)===r?p.get(a)??null:null,N=t.sessionId?m.get(t.sessionId):void 0;return I(r,j,N,t)}),y=s.processes.filter(t=>!h.has(t.pid)).map(t=>I(Ls(t),t,c.get(t.pid),null));return[...k,...y]}function $(s){if(s.cacheReadIn==null||s.tokIn==null)return null;const n=s.cacheReadIn+s.tokIn;return n===0?null:s.cacheReadIn/n}function S(s){return s==null?"—":s===0?"0":s>=1e6?(s/1e6).toFixed(s>=1e7?0:1)+"M":s>=1e3?(s/1e3).toFixed(s>=1e4?0:1)+"k":String(s)}function us(s){return s==null?"—":`${Math.round(s*100)}%`}function Ps(s){if(!s)return"";const n=s.lastIndexOf("/");return n>=0?s.slice(n+1):s}function os(s){return`session:${s.source}:${s.sessionId??s.transcriptPath}`}function Ls(s){return`process:${s.source}:${s.pid}`}function Os(s){let n=2166136261;for(let l=0;l<s.length;l+=1)n^=s.charCodeAt(l),n=Math.imul(n,16777619);return-((n>>>0)%9e5+1e3)}function Y(s,n){return`${s}\0${n??""}`}function Ks(s,n,l){const c=l-Ss;let m=0;for(const u of n)J(u)&&u.ts>=c&&m++;const p={total:s.length,running:0,tooling:0,idle:0,harnesses:[],reqsPerMin:m},f=new Map;for(const u of s)u.status==="tool"?(p.tooling++,p.running++):u.status==="run"?p.running++:p.idle++,f.set(u.harness,(f.get(u.harness)??0)+1);return p.harnesses=[...f.entries()].map(([u,h])=>({harness:u,count:h})).sort((u,h)=>h.count-u.count||u.harness.localeCompare(h.harness)),p}const P={tool:0,run:1,idle:2};function A(s){return s??-1}function qs(s,n,l,c){switch(l){case"status":return(P[s.status]-P[n.status])*c;case"agent":{const m=s.harness.localeCompare(n.harness);return m!==0?m*c:(s.sessionId??"").localeCompare(n.sessionId??"")*c}case"project":return s.project.localeCompare(n.project)*c;case"reqs":return(s.reqCount-n.reqCount)*c;case"tokIn":return(A(s.tokIn)-A(n.tokIn))*c;case"tokOut":return(A(s.tokOut)-A(n.tokOut))*c;case"cache":return(A($(s))-A($(n)))*c;case"tools":return(s.toolCount-n.toolCount)*c;case"perms":return(s.permCount-n.permCount)*c;case"last":{const m=s.lastEventAt??0,p=n.lastEventAt??0;return(m-p)*c}case"runtime":return(s.sessionRuntimeSec-n.sessionRuntimeSec)*c}}function ls({values:s,color:n}){if(s.length<2)return e.jsx("svg",{className:"s-atop-spark",width:88,height:18,viewBox:"0 0 88 18"});const m=Math.max(1,...s),p=88/(s.length-1),f=s.map((u,h)=>`${(h*p).toFixed(1)},${(18-u/m*18).toFixed(1)}`).join(" ");return e.jsx("svg",{className:"s-atop-spark",width:88,height:18,viewBox:"0 0 88 18",children:e.jsx("polyline",{fill:"none",stroke:n,strokeWidth:"1.25",points:f})})}function ne(){const[s,n]=d.useState([]),[l,c]=d.useState(null),[m,p]=d.useState(()=>Date.now()),[f,u]=d.useState(""),[h,I]=d.useState(()=>new Set),[k,y]=d.useState(()=>new Set),[t,r]=d.useState({key:"status",dir:1}),[a,j]=d.useState(null),N=d.useRef([]),w=d.useRef([]),[L,D]=d.useState([]),[V,_]=d.useState([]),R=d.useCallback(o=>{n(i=>i.length>=ns?[...i.slice(i.length-ns+1),o]:[...i,o])},[]);Is(R),d.useEffect(()=>{let o=!1,i=!1;const x=async()=>{if(!(i||!U()))try{const O=await es(`/api/tail/recent?limit=${bs}`);o||(i=!0,n(O.events??[]))}catch{}};x();const E=ts(()=>{x()});return()=>{o=!0,E()}},[]);const T=d.useCallback(async()=>{if(U())try{const o=await es("/api/tail/discover");c(o)}catch{}},[]);d.useEffect(()=>{T();const o=setInterval(()=>{T()},Cs),i=ts(()=>{T()});return()=>{clearInterval(o),i()}},[T]),d.useEffect(()=>{const o=setInterval(()=>{U()&&p(Date.now())},1e3);return()=>clearInterval(o)},[]);const v=d.useMemo(()=>Ws(l,s,m),[l,s,m]),M=d.useMemo(()=>Ks(v,s,m),[v,s,m]);d.useEffect(()=>{N.current=[...N.current,M.running].slice(-24),w.current=[...w.current,M.tooling].slice(-24),D(N.current),_(w.current)},[M.running,M.tooling]);const ds=d.useMemo(()=>{const o=new Set;return v.forEach(i=>o.add(i.harness)),[...o]},[v]),ms=d.useMemo(()=>{const o=new Set;return v.forEach(i=>o.add(i.status)),[...o]},[v]),z=d.useMemo(()=>{const o=f.trim().toLowerCase();return v.filter(i=>{if(h.size>0&&!h.has(i.harness)||k.size>0&&!k.has(i.status))return!1;if(!o)return!0;const x=q[i.attribution];return`${i.pid} ${i.project} ${i.command} ${i.harness} ${i.attribution} ${x} ${i.sessionId??""} ${i.transcriptPath??""} ${i.lastSummary??""}`.toLowerCase().includes(o)})},[v,f,h,k]),B=d.useMemo(()=>t.key==="status"?void 0:(o,i)=>P[o.status]-P[i.status],[t.key]),C=d.useMemo(()=>z.map((o,i)=>({row:o,index:i})).sort((o,i)=>{const x=qs(o.row,i.row,t.key,t.dir);if(x!==0)return x;const E=B?.(o.row,i.row)??0;return E!==0?E:o.index-i.index}).map(o=>o.row),[z,t,B]);d.useEffect(()=>{a!=null&&(v.some(o=>o.key===a)||j(null))},[v,a]),d.useEffect(()=>{const o=i=>{const x=i.target,E=x instanceof HTMLInputElement||x instanceof HTMLTextAreaElement||(x?.isContentEditable??!1);if(i.key==="Escape"&&a!=null){i.preventDefault(),j(null);return}if(E)return;const O=i.key==="j"||i.key==="ArrowDown",js=i.key==="k"||i.key==="ArrowUp";if(O||js){if(C.length===0)return;i.preventDefault();const K=C.findIndex(ks=>ks.key===a),ss=O?C[Math.min(C.length-1,K<0?0:K+1)]:C[Math.max(0,K<0?0:K-1)];ss&&j(ss.key);return}if(i.key==="Enter"&&a!=null){i.preventDefault();return}};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[C,a]);const ps=o=>{I(i=>{const x=new Set(i);return x.has(o)?x.delete(o):x.add(o),x})},hs=o=>{y(i=>{const x=new Set(i);return x.has(o)?x.delete(o):x.add(o),x})},g=d.useMemo(()=>a!=null?v.find(o=>o.key===a)??null:null,[v,a]),fs=d.useMemo(()=>g?l?.processes.find(o=>o.pid===g.pid)??null:null,[l,g]),xs=d.useMemo(()=>g?s.filter(o=>g.sessionId?o.sessionId===g.sessionId:o.pid===g.pid).slice(-40):[],[s,g]);return e.jsxs("div",{className:"s-atop",children:[e.jsx(Hs,{summary:M,runHistory:L,toolHistory:V}),e.jsx(vs,{title:"Harness families",size:"compact",maxAgents:6,maxTasks:3,showEmpty:!0}),e.jsx(Fs,{search:f,onSearch:u,harnessOptions:ds,harnessFilter:h,onToggleHarness:ps,statusOptions:ms,statusFilter:k,onToggleStatus:hs,summary:M}),e.jsx(ys,{rows:z,columns:Ds,rowId:o=>o.key,storageKey:"openscout.atop.cols",sort:t,onSortChange:r,secondarySort:B,onRowClick:o=>j(o.key),rowClassName:o=>a===o.key?"s-atop-row--selected":void 0,empty:{title:"no agents match",body:"adjust filters or start a session to populate"},density:"compact",className:"s-atop-data-table",ariaLabel:"Agent activity inventory"}),e.jsx(_s,{shown:C.length,total:v.length,hasSelection:a!=null}),g&&e.jsx(zs,{row:g,process:fs,events:xs,now:m,onClose:()=>j(null)})]})}function Hs({summary:s,runHistory:n,toolHistory:l}){return e.jsxs("div",{className:"s-atop-summary",children:[e.jsxs("div",{className:"s-atop-summary-cell s-atop-summary-cell--primary",children:[e.jsxs("div",{className:"s-atop-summary-num",children:[e.jsx("strong",{children:s.running}),e.jsxs("span",{className:"s-atop-summary-of",children:["/ ",s.total]})]}),e.jsx("span",{className:"s-atop-summary-lbl",children:"active"}),e.jsx(ls,{values:n,color:"var(--green)"})]}),e.jsxs("div",{className:"s-atop-summary-cell",children:[e.jsx("div",{className:"s-atop-summary-num",children:e.jsx("strong",{children:s.tooling})}),e.jsx("span",{className:"s-atop-summary-lbl",children:"working"}),e.jsx(ls,{values:l,color:"var(--accent)"})]}),e.jsxs("div",{className:"s-atop-summary-cell",children:[e.jsx("div",{className:"s-atop-summary-num",children:e.jsx("strong",{children:s.idle})}),e.jsx("span",{className:"s-atop-summary-lbl",children:"idle"})]}),e.jsxs("div",{className:"s-atop-summary-cell s-atop-summary-cell--breakdown",children:[e.jsx("span",{className:"s-atop-summary-lbl",children:"harness"}),e.jsx("div",{className:"s-atop-summary-row",children:s.harnesses.length>0?s.harnesses.slice(0,4).map(c=>e.jsxs("span",{className:Z(c.harness),children:[e.jsx(H,{harness:c.harness,size:11,title:null}),F(c.harness)," ",c.count]},c.harness)):e.jsx("span",{className:"s-atop-chip s-atop-chip--mute",children:"none"})})]}),e.jsx("div",{className:"s-atop-summary-spacer"}),e.jsxs("div",{className:"s-atop-summary-cell s-atop-summary-cell--rate",children:[e.jsxs("div",{className:"s-atop-summary-num",children:[e.jsx("strong",{children:s.reqsPerMin}),e.jsx("span",{className:"s-atop-summary-of",children:"/ min"})]}),e.jsx("span",{className:"s-atop-summary-lbl",children:"requests"})]})]})}function Fs({search:s,onSearch:n,harnessOptions:l,harnessFilter:c,onToggleHarness:m,statusOptions:p,statusFilter:f,onToggleStatus:u,summary:h}){const I=t=>h.harnesses.find(r=>r.harness===t)?.count??0,k=t=>t==="tool"?h.tooling:t==="run"?h.running-h.tooling:h.idle,y=d.useRef(null);return d.useEffect(()=>{const t=r=>{if(r.key!=="/")return;const a=r.target;a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||(a?.isContentEditable??!1)||(r.preventDefault(),y.current?.focus())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]),e.jsxs("div",{className:"s-atop-fbar",children:[e.jsxs("div",{className:"s-atop-search",children:[e.jsx("span",{className:"s-atop-search-prompt",children:"▸"}),e.jsx("input",{ref:y,className:"s-atop-search-input",value:s,onChange:t=>n(t.target.value),placeholder:"filter by pid · project · command · summary",spellCheck:!1}),e.jsx("span",{className:"s-atop-search-kbd",children:"/"})]}),l.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-atop-fbar-label",children:"harness"}),l.map(t=>{const r=c.has(t);return e.jsxs("button",{className:`s-atop-pill s-atop-pill--harness${r?" s-atop-pill--on":""}`,onClick:()=>m(t),children:[e.jsx(H,{harness:t,size:11,title:null}),F(t),e.jsx("span",{className:"s-atop-pill-ct",children:I(t)})]},t)})]}),p.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-atop-fbar-label",children:"status"}),["tool","run","idle"].filter(t=>p.includes(t)).map(t=>{const r=f.has(t);return e.jsxs("button",{className:`s-atop-pill s-atop-pill--status-${t}${r?" s-atop-pill--on":""}`,onClick:()=>u(t),children:[X[t],e.jsx("span",{className:"s-atop-pill-ct",children:k(t)})]},t)})]}),e.jsx("div",{className:"s-atop-fbar-spacer"})]})}const Ds=[{key:"status",label:"Status",cls:"s-atop-col-status",kind:"text",defaultWidth:96,minWidth:70,sortValue:s=>P[s.status],render:s=>e.jsxs("span",{className:`s-atop-status s-atop-status--${s.status}`,children:[e.jsx("span",{className:"s-atop-status-dot"}),X[s.status]]})},{key:"agent",label:"Agent",cls:"s-atop-col-agent",kind:"text",tip:"Harness · short session id",defaultWidth:168,minWidth:110,sortValue:s=>`${s.harness}\0${s.sessionId??""}`,render:s=>e.jsxs("div",{className:"s-atop-agent-cell",children:[e.jsxs("span",{className:Z(s.harness),title:`origin: ${q[s.attribution]}`,children:[e.jsx(H,{harness:s.harness,size:11,title:null}),F(s.harness)]}),e.jsx("span",{className:"s-atop-agent-id",title:s.sessionId??`pid ${s.pid}`,children:Q(s.sessionId)})]})},{key:"project",label:"Project",cls:"s-atop-col-project",kind:"text",defaultWidth:200,minWidth:96,maxWidth:480,sortValue:s=>s.project,render:s=>e.jsx("span",{title:s.cwd,children:s.project})},{key:"reqs",label:"Reqs",cls:"s-atop-col-num",kind:"number",tip:"Model invocations (assistant turns) for this session",defaultWidth:64,minWidth:56,sortValue:s=>s.reqCount,render:s=>e.jsx(W,{value:s.reqCount||null})},{key:"tokIn",label:"Tok ↓",cls:"s-atop-col-num",kind:"number",tip:"Input tokens — populated when backend emits usage",defaultWidth:64,minWidth:56,sortValue:s=>s.tokIn,render:s=>e.jsx(W,{value:s.tokIn})},{key:"tokOut",label:"Tok ↑",cls:"s-atop-col-num",kind:"number",tip:"Output tokens — populated when backend emits usage",defaultWidth:64,minWidth:56,sortValue:s=>s.tokOut,render:s=>e.jsx(W,{value:s.tokOut})},{key:"cache",label:"Cache",cls:"s-atop-col-num",kind:"number",tip:"Cache hit rate — populated when backend emits usage",defaultWidth:64,minWidth:56,sortValue:s=>$(s),render:s=>e.jsx(Vs,{value:$(s)})},{key:"tools",label:"Tools",cls:"s-atop-col-num",kind:"number",defaultWidth:64,minWidth:56,sortValue:s=>s.toolCount,render:s=>e.jsx(W,{value:s.toolCount||null})},{key:"perms",label:"Perms",cls:"s-atop-col-num",kind:"number",tip:"Permission requests — heuristic count of permission-mode events",defaultWidth:64,minWidth:56,sortValue:s=>s.permCount,render:s=>e.jsx(W,{value:s.permCount||null,accent:s.permCount>0?"amber":void 0})},{key:"last",label:"Last",cls:"s-atop-col-last",kind:"time",defaultWidth:86,minWidth:64,sortValue:s=>s.lastEventAt,render:s=>is(s.lastEventAt,Date.now())},{key:"runtime",label:"Runtime",cls:"s-atop-col-runtime",kind:"number",tip:"Session duration (active period in current buffer)",defaultWidth:80,minWidth:64,sortValue:s=>s.sessionRuntimeSec,render:s=>rs(s.sessionRuntimeSec)}];function W({value:s,accent:n}){const l=s==null?"s-atop-col-num s-atop-col-num--dim":`s-atop-col-num${n?` s-atop-col-num--${n}`:""}`;return e.jsx("span",{className:l,children:S(s)})}function Vs({value:s}){const n=s==null?"s-atop-col-num s-atop-col-num--dim":"s-atop-col-num";return e.jsx("span",{className:n,children:us(s)})}function _s({shown:s,total:n,hasSelection:l}){return e.jsxs("div",{className:"s-atop-keys",children:[e.jsxs("span",{className:"s-atop-keys-count",children:[e.jsx("strong",{children:s})," / ",n," agents"]}),e.jsx("span",{className:"s-atop-keys-spacer"}),e.jsxs("span",{children:[e.jsx("kbd",{children:"/"})," filter"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"j"}),"/",e.jsx("kbd",{children:"k"})," select"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"click"})," drill in"]}),l&&e.jsxs("span",{children:[e.jsx("kbd",{children:"esc"})," close"]})]})}function zs({row:s,process:n,events:l,now:c,onClose:m}){const p=d.useMemo(()=>{const u={};for(const k of l){if(k.kind!=="tool")continue;const y=k.summary.match(/^([a-z_][a-z0-9_]*)/i),t=y?y[1]:"(tool)";u[t]=(u[t]??0)+1}const h=Object.entries(u).sort((k,y)=>y[1]-k[1]).slice(0,6),I=Math.max(1,...h.map(k=>k[1]));return h.map(([k,y])=>({name:k,count:y,frac:y/I}))},[l]),f=l.slice(-40).reverse();return e.jsxs("aside",{className:"s-atop-drawer","aria-label":`Agent ${s.key}`,children:[e.jsxs("header",{className:"s-atop-drawer-head",children:[e.jsxs("div",{className:"s-atop-drawer-head-meta",children:[e.jsxs("span",{className:`s-atop-status s-atop-status--${s.status}`,children:[e.jsx("span",{className:"s-atop-status-dot"}),X[s.status]]}),e.jsx("span",{className:"s-atop-drawer-pid",children:s.pid>0?`pid ${s.pid}`:"transcript"}),e.jsxs("span",{className:Z(s.harness),title:`origin: ${q[s.attribution]}`,children:[e.jsx(H,{harness:s.harness,size:11,title:null}),F(s.harness)]}),e.jsxs("span",{className:"s-atop-drawer-session",children:["session ",Q(s.sessionId)]})]}),e.jsx("h2",{className:"s-atop-drawer-title",children:s.project}),e.jsxs("p",{className:"s-atop-drawer-sub",children:["session ",Q(s.sessionId)," · runtime ",rs(s.sessionRuntimeSec)," · last activity ",is(s.lastEventAt,c)]}),e.jsx("button",{className:"s-atop-drawer-close",onClick:m,"aria-label":"Close (Esc)",children:"✕"})]}),e.jsxs("div",{className:"s-atop-drawer-body",children:[e.jsxs("section",{children:[e.jsx("h3",{className:"s-atop-drawer-h3",children:"Activity"}),e.jsxs("div",{className:"s-atop-metrics",children:[e.jsx(b,{label:"Requests",value:S(s.reqCount||null)}),e.jsx(b,{label:"Tools",value:S(s.toolCount||null)}),e.jsx(b,{label:"Permissions",value:S(s.permCount||null),accent:s.permCount>0?"amber":void 0}),e.jsx(b,{label:"Tok in",value:S(s.tokIn),dim:s.tokIn==null}),e.jsx(b,{label:"Tok out",value:S(s.tokOut),dim:s.tokOut==null}),e.jsx(b,{label:"Cache hit",value:us($(s)),dim:$(s)==null}),e.jsx(b,{label:"Model",value:s.model??"—",dim:s.model==null}),e.jsx(b,{label:"Events",value:S(s.eventCount||null)})]})]}),p.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"s-atop-drawer-h3",children:"Tool calls"}),e.jsx("ul",{className:"s-atop-histo",children:p.map(u=>e.jsxs("li",{children:[e.jsx("span",{className:"s-atop-histo-name",children:u.name}),e.jsx("span",{className:"s-atop-histo-bar",children:e.jsx("span",{className:"s-atop-histo-fill",style:{width:`${(u.frac*100).toFixed(1)}%`}})}),e.jsx("span",{className:"s-atop-histo-count",children:u.count})]},u.name))})]}),e.jsxs("section",{children:[e.jsxs("h3",{className:"s-atop-drawer-h3",children:["Recent activity",e.jsxs("span",{className:"s-atop-drawer-h3-aside",children:[l.length," buffered"]})]}),f.length===0?e.jsx("div",{className:"s-atop-peek-empty",children:"no events buffered for this agent yet"}):e.jsx("ol",{className:"s-atop-peek",children:f.map(u=>e.jsxs("li",{className:`s-atop-peek-row s-atop-peek-row--${u.kind}`,children:[e.jsx("span",{className:"s-atop-peek-time",children:$s(u.ts)}),e.jsx("span",{className:"s-atop-peek-kind",children:u.kind}),e.jsx("span",{className:"s-atop-peek-text",children:u.summary})]},u.id))})]}),e.jsxs("section",{className:"s-atop-drawer-section--secondary",children:[e.jsx("h3",{className:"s-atop-drawer-h3",children:"Process"}),e.jsx("code",{className:"s-atop-codeblock",children:s.command}),e.jsxs("dl",{className:"s-atop-kvs",children:[e.jsx("dt",{children:"PID"}),e.jsx("dd",{children:s.pid>0?s.pid:"transcript-only"}),e.jsx("dt",{children:"Parent"}),e.jsxs("dd",{children:[s.parentLabel," (ppid ",s.ppid,")"]}),e.jsx("dt",{children:"Process etime"}),e.jsx("dd",{children:s.procEtime}),s.transcriptPath&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Transcript"}),e.jsx("dd",{children:s.transcriptPath})]}),e.jsx("dt",{children:"Origin"}),e.jsx("dd",{children:q[s.attribution]}),e.jsx("dt",{children:"CWD"}),e.jsx("dd",{children:s.cwd||"(none)"})]}),n?.parentChain&&n.parentChain.length>0&&e.jsx("ol",{className:"s-atop-chain",children:n.parentChain.map(u=>e.jsxs("li",{children:[e.jsx("span",{className:"s-atop-chain-pid",children:u.pid}),e.jsx("span",{className:"s-atop-chain-cmd",children:ws(u.command,80)})]},u.pid))})]})]})]})}function b({label:s,value:n,dim:l,accent:c}){const m=`s-atop-metric${l?" s-atop-metric--dim":""}${c?` s-atop-metric--${c}`:""}`;return e.jsxs("div",{className:m,children:[e.jsx("span",{className:"s-atop-metric-lbl",children:s}),e.jsx("span",{className:"s-atop-metric-val",children:n})]})}export{ne as AtopView};
@@ -0,0 +1 @@
1
+ import{r as k,j as s}from"./index-C8uS5szO.js";import{u as d,e as B,n as p}from"./router-BKiMcYa7.js";function m(t){switch(t.view){case"mesh":return"Back to mesh";case"ops":return"Back to ops";case"agents-v2":return t.agentId?"Registry":"All agents";case"messages":return"Back to conversations";case"conversation":return"Back to conversation";case"inbox":return"Back to inbox";case"sessions":return"Back to sessions";case"terminal":return"Terminal Control";case"work":return"Back to work";case"broker":return"Back to broker";case"activity":return"Back to activity";default:return"Back"}}function w({slot:t,fallback:n,navigate:c,className:r,label:i}){const e=d(),o=k.useMemo(()=>B(e.state),[e.state]),a=o??n,u=i??m(a),l=p(e.state)&&!!o;return s.jsxs("button",{type:"button",className:`s-back-pill${r?` ${r}`:""}`,onClick:()=>{if(l&&typeof window<"u"&&window.history.length>1){window.history.back();return}c(a)},children:[s.jsx("span",{"aria-hidden":!0,className:"s-back-pill-glyph",children:"←"}),s.jsx("span",{children:u})]})}export{w as B};
@@ -0,0 +1 @@
1
+ import{r as o,j as e}from"./index-C8uS5szO.js";import{E as p}from"./EmptyState-uyYN5piI.js";import{a as f}from"./api-CaROe5_H.js";import{S as b}from"./scoutbot-markdown-Bz0Vbto2.js";import{b as h,t as u}from"./time-Dhsh_2EG.js";/* empty css *//* empty css */import"./Provider-5Hotn7NQ.js";import"./router-BKiMcYa7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-JjLbm3W2.js";import"./runtime-picker-DdsttHHc.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./createLucideIcon-DkjnzvcJ.js";import"./conversation-model-BGFHoxQ0.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-C5cX8dkl.js";import"./HarnessMark-Bt47OeHy.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./file-text-ChtICwub.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./external-link-RT4Ph-6-.js";const g={"fleet-home":"fleet briefing",tour:"tour briefing"};function je({briefingId:s,navigate:i}){const[r,n]=o.useState(null),[t,a]=o.useState(null),c=o.useCallback(async()=>{try{const d=await f(`/api/briefings/${encodeURIComponent(s)}`);n(d),a(null)}catch(d){a(d instanceof Error?d.message:"Failed to load briefing")}},[s]);return o.useEffect(()=>{c()},[c]),t?e.jsxs("div",{className:"sys-surface-page sys-surface-page-wide",children:[e.jsx("button",{type:"button",className:"briefing-detail-back",onClick:()=>i({view:"briefings"}),children:"← back to briefings"}),e.jsx(p,{title:"Couldn't load briefing",body:t})]}):r?e.jsxs("div",{className:"sys-surface-page sys-surface-page-wide briefing-detail",children:[e.jsx("button",{type:"button",className:"briefing-detail-back",onClick:()=>i({view:"briefings"}),children:"← back to briefings"}),e.jsxs("header",{className:"briefing-detail-header",children:[e.jsx("h2",{children:r.title}),e.jsxs("div",{className:"briefing-detail-header-meta",children:[e.jsx("span",{className:`briefing-kind briefing-kind-${r.kind}`,children:g[r.kind]}),e.jsx("span",{children:h(r.preparedAt)}),e.jsxs("span",{children:["· ",u(r.preparedAt)]})]}),e.jsx("p",{className:"briefing-detail-summary",children:r.summary}),r.recommendation?e.jsx("div",{className:"briefing-detail-recommendation",children:r.recommendation}):null]}),r.markdown?e.jsx(x,{markdown:r.markdown}):null,r.brief?.presented?e.jsx(y,{presented:r.brief.presented}):null,e.jsx(j,{call:r.call}),e.jsx(N,{brief:r.brief,navigate:i}),e.jsx(k,{observations:r.observations,navigate:i}),e.jsx(v,{snapshot:r.snapshot,call:r.call})]}):e.jsx("div",{className:"sys-surface-page sys-surface-page-wide",children:e.jsx("div",{className:"briefings-placeholder",children:"Loading briefing..."})})}function x({markdown:s}){return e.jsxs("section",{className:"briefing-layer briefing-layer-markdown",children:[e.jsx(l,{eyebrow:"Layer 0",title:"Brief (markdown)"}),e.jsx("div",{className:"briefing-markdown",children:e.jsx(b,{text:s})})]})}function j({call:s}){return!s||!s.telemetry&&!s.presenter?null:e.jsxs("section",{className:"briefing-layer briefing-layer-telemetry",children:[e.jsx(l,{eyebrow:"Telemetry",title:"Calls & usage"}),e.jsxs("dl",{className:"briefing-telemetry",children:[e.jsx(m,{label:"Analyst",model:s.model,responseId:s.responseId,telemetry:s.telemetry??null}),s.presenter?e.jsx(m,{label:"Presenter",model:s.presenter.model,responseId:s.presenter.responseId,telemetry:s.presenter,note:s.presenter.skipped==="rate-guard"?"skipped — rate-guard hit":s.presenter.skipped==="error"?`failed — ${s.presenter.errorMessage??"unknown"}`:null}):null]})]})}function m({label:s,model:i,responseId:r,telemetry:n,note:t}){const a=n?.usage??null;return e.jsxs("div",{className:"briefing-telemetry-row",children:[e.jsxs("div",{className:"briefing-telemetry-row-head",children:[e.jsx("span",{className:"briefing-telemetry-label",children:s}),e.jsx("span",{className:"briefing-telemetry-model",children:i}),t?e.jsx("span",{className:"briefing-telemetry-note",children:t}):null]}),e.jsxs("div",{className:"briefing-telemetry-stats",children:[e.jsx("span",{children:n&&n.elapsedMs>0?`${(n.elapsedMs/1e3).toFixed(2)}s`:"—"}),e.jsxs("span",{children:["in ",a?.inputTokens??"—"]}),e.jsxs("span",{children:["out ",a?.outputTokens??"—"]}),e.jsxs("span",{children:["total ",a?.totalTokens??"—"]}),r?e.jsx("span",{className:"briefing-telemetry-response",children:r}):null]})]})}function y({presented:s}){return e.jsxs("section",{className:"briefing-layer briefing-layer-presented",children:[e.jsx(l,{eyebrow:"Spoken",title:`Presented as · ${s.voiceSpec.persona}, ~${s.voiceSpec.targetWords} words`}),e.jsx("ol",{className:"briefing-presented-sentences",children:s.sentences.map((i,r)=>e.jsx("li",{className:"briefing-presented-sentence",children:i},r))}),e.jsxs("div",{className:"briefing-presented-meta",children:["model: ",s.model,s.responseId?` · response: ${s.responseId}`:""]})]})}function N({brief:s,navigate:i}){return s?e.jsxs("section",{className:"briefing-layer",children:[e.jsx(l,{eyebrow:"Layer 3",title:"Brief"}),s.steps.length>0?e.jsx("ol",{className:"briefing-steps",children:s.steps.map((r,n)=>e.jsxs("li",{className:"briefing-step",children:[e.jsxs("div",{className:"briefing-step-label",children:[n+1,". ",r.label]}),r.narration?e.jsx("p",{className:"briefing-step-narration",children:r.narration}):null]},r.id??n))}):null,s.actions.length>0?e.jsx("div",{className:"briefing-actions",children:s.actions.map((r,n)=>e.jsx("button",{type:"button",className:"s-btn",onClick:()=>{r.route&&i(r.route)},children:r.label},`${r.label}-${n}`))}):null]}):e.jsxs("section",{className:"briefing-layer",children:[e.jsx(l,{eyebrow:"Layer 3",title:"Brief & call"}),e.jsx("p",{className:"briefings-placeholder",children:"No brief body persisted."})]})}function k({observations:s,navigate:i}){return e.jsxs("section",{className:"briefing-layer",children:[e.jsx(l,{eyebrow:"Layer 2",title:`Observations (${s.length})`}),s.length===0?e.jsx("p",{className:"briefings-placeholder",children:"No observations on this brief."}):e.jsx("div",{className:"briefing-observations",children:s.map((r,n)=>{const t=r.tone==="warn"?"briefing-observation-warn":r.tone==="err"||r.tone==="error"?"briefing-observation-err":"";return e.jsxs("div",{className:`briefing-observation ${t}`.trim(),children:[e.jsx("div",{className:"briefing-observation-text",children:r.text}),r.references.length>0?e.jsx("div",{className:"briefing-observation-refs",children:r.references.map((a,c)=>e.jsx(w,{reference:a,navigate:i},`${a.label}-${c}`))}):null]},n)})})]})}function w({reference:s,navigate:i}){const r=!!s.route,n=s.detail?`${s.label} · ${s.detail}`:s.label;return r?e.jsx("button",{type:"button",className:"briefing-ref-chip",onClick:()=>i(s.route),children:n}):e.jsx("span",{className:"briefing-ref-chip briefing-ref-chip-static",children:n})}function v({snapshot:s,call:i}){const r=o.useMemo(()=>C(s),[s]),[n,t]=o.useState(!1);return e.jsxs("section",{className:"briefing-layer",children:[e.jsx(l,{eyebrow:"Layer 1",title:"Read snapshot"}),r.length>0?e.jsx("div",{className:"briefing-snapshot-counts",children:r.map(a=>e.jsxs("span",{className:"briefing-snapshot-count",children:[e.jsx("strong",{children:a.value})," ",a.label]},a.label))}):null,i?e.jsxs("details",{className:"briefing-snapshot-section",children:[e.jsx("summary",{className:"briefing-snapshot-section-head",children:"Call metadata"}),e.jsxs("dl",{className:"briefing-call-grid",children:[e.jsx("dt",{children:"Model"}),e.jsx("dd",{children:i.model}),e.jsx("dt",{children:"Response ID"}),e.jsx("dd",{children:i.responseId??"—"}),e.jsx("dt",{children:"System prompt"}),e.jsx("dd",{children:e.jsx("pre",{className:"briefing-call-prompt",children:i.systemPrompt})}),e.jsx("dt",{children:"Operator request"}),e.jsx("dd",{children:e.jsx("pre",{className:"briefing-call-prompt",children:i.operatorRequest})})]})]}):null,e.jsxs("div",{className:"briefing-snapshot-section",children:[e.jsx("button",{type:"button",className:"briefing-detail-back",onClick:()=>t(a=>!a),children:n?"Hide raw snapshot":"Show raw snapshot JSON"}),n?e.jsx("pre",{className:"briefing-snapshot-raw",children:JSON.stringify(s??{},null,2)}):null]})]})}function l({eyebrow:s,title:i}){return e.jsxs("div",{className:"briefing-layer-head",children:[e.jsx("span",{className:"briefing-layer-eyebrow",children:s}),e.jsx("span",{className:"briefing-layer-title",children:i})]})}function C(s){if(!s?.state)return[];const i=s.state,r=[],n=(t,a)=>{Array.isArray(a)&&r.push({label:t,value:a.length})};if(n("agents",i.agents),i.fleet&&typeof i.fleet=="object"){const t=i.fleet;n("active requests",t.activeAsks),n("attention",t.needsAttention),n("recent",t.recentCompleted)}if(i.broker&&typeof i.broker=="object"){const t=i.broker;n("broker msgs",t.recentMessages)}if(n("scout chatter",i.scoutChatter),n("tail events",i.agentLogMessages),i.operatorAttention&&typeof i.operatorAttention=="object"){const t=i.operatorAttention;n("operator items",t.items)}return r}export{je as BriefingDetailScreen};
@@ -0,0 +1 @@
1
+ import{r as i,j as e}from"./index-C8uS5szO.js";import{E as c}from"./EmptyState-uyYN5piI.js";import{p as g,a as m}from"./api-CaROe5_H.js";import{t as p}from"./time-Dhsh_2EG.js";/* empty css *//* empty css */const b={"fleet-home":"fleet",tour:"tour"},d="/api/briefings?limit=50",u=3e4;function E({navigate:f}){const[r,h]=i.useState(()=>g(d,u)?.briefings??null),[n,t]=i.useState(null),[l,o]=i.useState(!1),a=i.useCallback(async()=>{o(!0);try{const s=await m(d);h(s.briefings),t(null)}catch(s){t(s instanceof Error?s.message:"Failed to load briefings")}finally{o(!1)}},[]);return i.useEffect(()=>{a()},[a]),e.jsxs("div",{className:"sys-surface-page sys-surface-page-wide",children:[e.jsxs("div",{className:"sys-page-head",children:[e.jsxs("div",{className:"sys-page-title-group",children:[e.jsx("h2",{className:"sys-page-title",children:"Briefings"}),e.jsx("p",{className:"sys-page-subtitle",children:"Scoutbot's archived fleet briefs — what it told you, when, and what it saw. Rolling 100."})]}),e.jsx("div",{className:"sys-page-actions",children:e.jsx("button",{type:"button",className:"s-btn",disabled:l,onClick:()=>{a()},children:l?"Refreshing...":"Refresh"})})]}),n?e.jsx(c,{title:"Couldn't load briefings",body:n}):r===null?e.jsx("div",{className:"briefings-placeholder",children:"Loading briefings..."}):r.length===0?e.jsx(c,{title:"No briefings yet",body:"Scoutbot writes here when it generates a fleet brief — either on Home or via tour. Briefs land in this archive automatically."}):e.jsx("ul",{className:"briefings-list",children:r.map(s=>e.jsx("li",{children:e.jsxs("button",{type:"button",className:"briefing-row",onClick:()=>f({view:"briefings",briefingId:s.id}),children:[e.jsxs("div",{className:"briefing-row-head",children:[e.jsx("span",{className:`briefing-kind briefing-kind-${s.kind}`,children:b[s.kind]}),e.jsx("span",{className:"briefing-row-title",children:s.title}),e.jsx("span",{className:"briefing-row-time",children:p(s.preparedAt)})]}),e.jsx("div",{className:"briefing-row-summary",children:s.summary}),e.jsxs("div",{className:"briefing-row-meta",children:[e.jsxs("span",{children:[s.observationCount," observations"]}),s.recommendation?e.jsxs("span",{children:["· ",s.recommendation]}):null]})]})},s.id))})]})}export{E as BriefingsScreen};
@@ -1 +1 @@
1
- import{r as m,j as s}from"./index-C1VaWNuD.js";import{a as y,c as p,d as b,f as x}from"./broker-display-Q75fupqG.js";import{C as u}from"./chevron-down-D120PY4g.js";import{C as j}from"./chevron-right-CowuvuE6.js";import"./status-tone-BM_zuRy1.js";import"./createLucideIcon-Dv8H8m7J.js";function i({label:e,value:a}){return s.jsxs("div",{className:"sys-broker-metadata-row",children:[s.jsx("span",{className:"sys-broker-metadata-key",children:e}),s.jsx("code",{className:"sys-broker-metadata-value",children:a})]})}function h({label:e,value:a,depth:t=0,defaultOpen:d=!0}){const[n,l]=m.useState(d&&t<2);if(a==null)return s.jsx(i,{label:e,value:"—"});if(Array.isArray(a))return a.length===0?s.jsx(i,{label:e,value:"[]"}):a.every(r=>typeof r!="object"||r===null)?s.jsx(i,{label:e,value:a.map(r=>x(r)).join(", ")}):s.jsxs("div",{className:"sys-broker-metadata-group",style:{marginLeft:t*12},children:[s.jsxs("button",{type:"button",className:"sys-broker-metadata-group-toggle",onClick:()=>l(r=>!r),"aria-expanded":n,children:[n?s.jsx(u,{size:12,"aria-hidden":"true"}):s.jsx(j,{size:12,"aria-hidden":"true"}),s.jsx("span",{className:"sys-broker-metadata-group-label",children:e}),s.jsxs("span",{className:"sys-broker-metadata-count",children:[a.length," items"]})]}),n&&s.jsx("div",{className:"sys-broker-metadata-children",children:a.map((r,c)=>s.jsx(h,{label:`[${c}]`,value:r,depth:t+1,defaultOpen:t<1},`${e}-${c}`))})]});if(typeof a=="object"){const o=Object.entries(a);return o.length===0?s.jsx(i,{label:e,value:"{}"}):s.jsxs("div",{className:"sys-broker-metadata-group",style:{marginLeft:t*12},children:[s.jsxs("button",{type:"button",className:"sys-broker-metadata-group-toggle",onClick:()=>l(r=>!r),"aria-expanded":n,children:[n?s.jsx(u,{size:12,"aria-hidden":"true"}):s.jsx(j,{size:12,"aria-hidden":"true"}),s.jsx("span",{className:"sys-broker-metadata-group-label",children:e}),s.jsxs("span",{className:"sys-broker-metadata-count",children:[o.length," fields"]})]}),n&&s.jsx("div",{className:"sys-broker-metadata-children",children:o.map(([r,c])=>s.jsx(h,{label:r,value:c,depth:t+1,defaultOpen:t<1},`${e}-${r}`))})]})}return s.jsx(i,{label:e,value:x(a)})}function k({entries:e}){return e.length===0?null:s.jsx("div",{className:"sys-broker-inspector-rows",children:e.map(a=>s.jsxs("div",{className:"sys-broker-inspector-row",children:[s.jsx("span",{className:"sys-detail-label",children:a.key}),s.jsx("code",{className:"sys-detail-value",children:a.value})]},a.key))})}function S({metadata:e,rawJson:a}){const t=m.useMemo(()=>y(e),[e]),d=m.useMemo(()=>p(e),[e]),[n,l]=m.useState(!1);return!e||Object.keys(e).length===0?s.jsx("div",{className:"sys-broker-metadata-empty",children:"No metadata payload attached to this dispatch row."}):s.jsxs("div",{className:"sys-broker-metadata-panel",children:[t.length>0&&s.jsxs("section",{className:"sys-broker-metadata-section",children:[s.jsx("div",{className:"sys-broker-metadata-section-head",children:s.jsx("span",{className:"sys-detail-label",children:"Summary"})}),s.jsx(k,{entries:t})]}),d!==null&&s.jsxs("section",{className:"sys-broker-metadata-section",children:[s.jsx("div",{className:"sys-broker-metadata-section-head",children:s.jsx("span",{className:"sys-detail-label",children:"Payload"})}),s.jsx("div",{className:"sys-broker-metadata-tree",children:s.jsx(h,{label:"payload",value:d,defaultOpen:!0})})]}),s.jsxs("section",{className:"sys-broker-metadata-section",children:[s.jsxs("button",{type:"button",className:"sys-broker-metadata-raw-toggle",onClick:()=>l(o=>!o),"aria-expanded":n,children:[n?s.jsx(u,{size:12,"aria-hidden":"true"}):s.jsx(j,{size:12,"aria-hidden":"true"}),"Raw JSON"]}),n&&s.jsx("pre",{className:"sys-broker-metadata-raw",children:a||b(e)})]})]})}export{S as BrokerMetadataPanel};
1
+ import{r as m,j as s}from"./index-C8uS5szO.js";import{a as y,c as p,d as b,f as x}from"./broker-display-BkBzyvbR.js";import{C as u}from"./chevron-down-B5eMsn5c.js";import{C as j}from"./chevron-right-C7UGFpkl.js";import"./status-tone-BM_zuRy1.js";import"./createLucideIcon-DkjnzvcJ.js";function i({label:e,value:a}){return s.jsxs("div",{className:"sys-broker-metadata-row",children:[s.jsx("span",{className:"sys-broker-metadata-key",children:e}),s.jsx("code",{className:"sys-broker-metadata-value",children:a})]})}function h({label:e,value:a,depth:t=0,defaultOpen:d=!0}){const[n,l]=m.useState(d&&t<2);if(a==null)return s.jsx(i,{label:e,value:"—"});if(Array.isArray(a))return a.length===0?s.jsx(i,{label:e,value:"[]"}):a.every(r=>typeof r!="object"||r===null)?s.jsx(i,{label:e,value:a.map(r=>x(r)).join(", ")}):s.jsxs("div",{className:"sys-broker-metadata-group",style:{marginLeft:t*12},children:[s.jsxs("button",{type:"button",className:"sys-broker-metadata-group-toggle",onClick:()=>l(r=>!r),"aria-expanded":n,children:[n?s.jsx(u,{size:12,"aria-hidden":"true"}):s.jsx(j,{size:12,"aria-hidden":"true"}),s.jsx("span",{className:"sys-broker-metadata-group-label",children:e}),s.jsxs("span",{className:"sys-broker-metadata-count",children:[a.length," items"]})]}),n&&s.jsx("div",{className:"sys-broker-metadata-children",children:a.map((r,c)=>s.jsx(h,{label:`[${c}]`,value:r,depth:t+1,defaultOpen:t<1},`${e}-${c}`))})]});if(typeof a=="object"){const o=Object.entries(a);return o.length===0?s.jsx(i,{label:e,value:"{}"}):s.jsxs("div",{className:"sys-broker-metadata-group",style:{marginLeft:t*12},children:[s.jsxs("button",{type:"button",className:"sys-broker-metadata-group-toggle",onClick:()=>l(r=>!r),"aria-expanded":n,children:[n?s.jsx(u,{size:12,"aria-hidden":"true"}):s.jsx(j,{size:12,"aria-hidden":"true"}),s.jsx("span",{className:"sys-broker-metadata-group-label",children:e}),s.jsxs("span",{className:"sys-broker-metadata-count",children:[o.length," fields"]})]}),n&&s.jsx("div",{className:"sys-broker-metadata-children",children:o.map(([r,c])=>s.jsx(h,{label:r,value:c,depth:t+1,defaultOpen:t<1},`${e}-${r}`))})]})}return s.jsx(i,{label:e,value:x(a)})}function k({entries:e}){return e.length===0?null:s.jsx("div",{className:"sys-broker-inspector-rows",children:e.map(a=>s.jsxs("div",{className:"sys-broker-inspector-row",children:[s.jsx("span",{className:"sys-detail-label",children:a.key}),s.jsx("code",{className:"sys-detail-value",children:a.value})]},a.key))})}function S({metadata:e,rawJson:a}){const t=m.useMemo(()=>y(e),[e]),d=m.useMemo(()=>p(e),[e]),[n,l]=m.useState(!1);return!e||Object.keys(e).length===0?s.jsx("div",{className:"sys-broker-metadata-empty",children:"No metadata payload attached to this dispatch row."}):s.jsxs("div",{className:"sys-broker-metadata-panel",children:[t.length>0&&s.jsxs("section",{className:"sys-broker-metadata-section",children:[s.jsx("div",{className:"sys-broker-metadata-section-head",children:s.jsx("span",{className:"sys-detail-label",children:"Summary"})}),s.jsx(k,{entries:t})]}),d!==null&&s.jsxs("section",{className:"sys-broker-metadata-section",children:[s.jsx("div",{className:"sys-broker-metadata-section-head",children:s.jsx("span",{className:"sys-detail-label",children:"Payload"})}),s.jsx("div",{className:"sys-broker-metadata-tree",children:s.jsx(h,{label:"payload",value:d,defaultOpen:!0})})]}),s.jsxs("section",{className:"sys-broker-metadata-section",children:[s.jsxs("button",{type:"button",className:"sys-broker-metadata-raw-toggle",onClick:()=>l(o=>!o),"aria-expanded":n,children:[n?s.jsx(u,{size:12,"aria-hidden":"true"}):s.jsx(j,{size:12,"aria-hidden":"true"}),"Raw JSON"]}),n&&s.jsx("pre",{className:"sys-broker-metadata-raw",children:a||b(e)})]})]})}export{S as BrokerMetadataPanel};
@@ -0,0 +1,8 @@
1
+ import{r as t,j as e}from"./index-C8uS5szO.js";import{r as xs}from"./index-C5cX8dkl.js";import{D as js}from"./runtime-picker-DdsttHHc.js";import{E as Ee}from"./EmptyState-uyYN5piI.js";import"./router-BKiMcYa7.js";import{B as ks,j as vs,F as ws,R as Ns,G as Ss,H as Is}from"./NewChatComposer-JjLbm3W2.js";import{p as As,a as ie}from"./api-CaROe5_H.js";import{c as Rs}from"./clipboard-e3fSpeo7.js";import{u as Cs}from"./sse-v5QLsOHV.js";import{b as ze}from"./status-tone-BM_zuRy1.js";import{t as Fe,b as ns,n as ee}from"./time-Dhsh_2EG.js";import{u as os}from"./Provider-5Hotn7NQ.js";import{o as Ye}from"./openContent-C6XO6kr5.js";import{g as $s,b as le,h as is,d as Ds,i as Es,j as Fs,k as Ms}from"./broker-display-BkBzyvbR.js";import{BrokerMetadataPanel as Ts}from"./BrokerMetadataPanel-1GoSl2BV.js";import{DispatchAftermath as Ls}from"./DispatchAftermath-DDlwqSCY.js";import{i as Ps,c as Bs,n as Xe}from"./keyboard-nav-CXfav14z.js";import{ShikiPane as zs}from"./ShikiPane-BudrOxNK.js";import{d as Os}from"./types-B0PlfpKc.js";import{u as _s}from"./useEmbedHeadline-BL8wQawZ.js";/* empty css */import{L as ke}from"./loader-circle-DurUYl7E.js";import{R as qs}from"./refresh-cw-Da9DDLk2.js";import{X as Me}from"./x-DI1ktCYb.js";import{A as Us}from"./arrow-down-WoVlkUmg.js";import{E as Ze}from"./external-link-RT4Ph-6-.js";import{M as ls}from"./message-square-NmXWtWLR.js";import{A as Te}from"./arrow-right-ldbfp4SZ.js";import{c as Oe}from"./createLucideIcon-DkjnzvcJ.js";import{P as Ks}from"./plus-D_wLGJGT.js";import{C as es}from"./chevron-down-B5eMsn5c.js";import{S as Hs}from"./send-horizontal-pOtGI7FM.js";import{C as Js}from"./check-B8dMv3Is.js";import{C as Gs}from"./copy-D9WUpQRf.js";import{R as Qs}from"./radio-C_jtwbFP.js";import{M as Vs,a as Ws}from"./DocumentFocusViewer-f12RRQpV.js";const Ys=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Xs=Oe("at-sign",Ys);const Zs=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],er=Oe("hash",Zs);const sr=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],rr=Oe("paperclip",sr),ar=160;function De(s){const a=new URLSearchParams({limit:String(ar)});return s&&a.set("cursor",s),`/api/broker?${a.toString()}`}const ss={index:-1,request:0};function tr(s,a){return{index:a,request:s.request+1}}function cs(s,a){return a===s.index?s:{index:a,request:s.request}}function nr(s,a){return s.index<a?s:cs(s,a>0?a-1:-1)}function or(s,a){return s.request!==a}function ir({enabled:s,rowCount:a,onActivateRow:n,onClearSelection:o}){const[f,h]=t.useState(ss),b=f.index,p=t.useRef(new Map),j=t.useRef(ss.request),c=t.useCallback(y=>{h(u=>tr(u,typeof y=="function"?y(u.index):y))},[]),w=t.useCallback(y=>{h(u=>cs(u,typeof y=="function"?y(u.index):y))},[]);t.useEffect(()=>{if(!or(f,j.current)||(j.current=f.request,f.index<0))return;const y=p.current.get(f.index);y?.scrollIntoView({block:"nearest"}),y?.focus()},[f]),t.useEffect(()=>{h(y=>nr(y,a))},[a]);const I=t.useCallback((y,u)=>{u?p.current.set(y,u):p.current.delete(y)},[]);t.useEffect(()=>{if(!s)return;const y=u=>{if(document.querySelector(".sys-broker-page")&&!(Ps(u.target)||Bs())&&a!==0){if(u.key==="Escape"){o&&(u.preventDefault(),o(),w(-1));return}if(u.key==="ArrowDown"||u.key==="j"){u.preventDefault(),c(N=>Xe(N,a,1));return}if(u.key==="ArrowUp"||u.key==="k"){u.preventDefault(),c(N=>Xe(N,a,-1));return}if(u.key==="Home"||u.key==="g"&&!u.shiftKey){u.preventDefault(),c(0);return}if(u.key==="End"||u.key==="G"){u.preventDefault(),c(a-1);return}if(u.key==="Enter"||u.key===" "){const N=b<0?0:b;u.preventDefault(),c(N),n(N)}}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s,b,c,n,o,a,w]);const F=t.useCallback(y=>({tabIndex:b===y?0:-1,ref:u=>I(y,u),onFocus:()=>w(y)}),[b,I,w]);return{focusedIndex:b,setFocusedIndex:w,getRowFocusProps:F}}const xe=["all","delivered","failed"],lr=3e4,cr={all:"All",delivered:"Delivered",failed:"Failed"};function dr(s){switch(s){case"success":return"Success";case"failed_query":return"Query failure";case"failed_delivery":return"Delivery failure";default:return"Delivery attempt"}}function ds(s){return s.messageId??s.deliveryId??s.invocationId??s.id}function Le(s){switch(ze(s.kind,s.status)){case"success":return"Delivered";case"danger":return"Failed";case"working":return"Pending";case"warning":return"Held";default:return s.status?s.status.charAt(0).toUpperCase()+s.status.slice(1):"Queued"}}function Ae(s){if(!s)return"··";const a=s.trim().split(/\s+/).filter(Boolean);if(a.length===0)return"··";const n=a[a.length-1];return/^\d+$/.test(n)?n.slice(-2):a.length>=2?(a[0][0]+a[1][0]).toUpperCase():s.trim().slice(0,2).toUpperCase()}function ur(s){const a=ee(s)??0;return new Date(a).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Ie(s){const a=ee(s);return a===null?"—":new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Ce(s,a,n=0){if(!s||typeof s!="object"||Array.isArray(s)||n>3)return;const o=s;for(const f of a)if(o[f]!==void 0&&o[f]!==null)return o[f];for(const f of Object.values(o)){const h=Ce(f,a,n+1);if(h!==void 0)return h}}function O(s,...a){const n=Ce(s.metadata,a);return typeof n!="string"&&typeof n!="number"?null:String(n).trim()||null}function Re(s,...a){const n=Ce(s.metadata,a);return typeof n=="number"||typeof n=="string"?ee(n):null}function Pe(s){switch(s){case"dm":return"Direct · agent";case"channel":return"Channel";case"broadcast":return"Broadcast";case null:return"No route";default:return s.replaceAll("_"," ")}}function Be(s,a){if(a==="to")return s.route==="channel"?"Channel":s.route==="broadcast"?"Broadcast":s.target?.toLowerCase().includes("operator")?"Operator":"Agent lane";const n=O(s,"class","actorClass")?.toLowerCase();return n==="operator"||n==="human"?"Operator":n==="agent"?"Agent":s.actorName?.toLowerCase().includes("operator")?"Operator":"Sender"}function rs(s){const a=Ce(s.metadata,["latencyMs","durationMs"]);if(typeof a=="number"&&Number.isFinite(a)&&a>=0)return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(a<1e4?1:0)}s`;const n=Re(s,"sentAt","createdAt")??ee(s.ts),o=Re(s,"deliveredAt","completedAt");if(n===null||o===null||o<n)return"—";const f=o-n;return f<1e3?`${f}ms`:`${(f/1e3).toFixed(f<1e4?1:0)}s`}function _e({route:s}){switch(s){case"channel":return e.jsx(er,{size:12,"aria-hidden":"true"});case"broadcast":return e.jsx(Qs,{size:12,"aria-hidden":"true"});case"dm":return e.jsx(Xs,{size:12,"aria-hidden":"true"});default:return e.jsx(ls,{size:12,"aria-hidden":"true"})}}function hr(s,a){if(!a)return null;const n=a.trim().replace(/^@/,"").toLowerCase();return s.find(o=>[o.id,o.name,o.handle,o.selector,o.defaultSelector,o.conversationId,o.harnessSessionId].some(f=>f?.trim().replace(/^@/,"").toLowerCase()===n))??null}function as(s,a,n){const o=n==="from"?s.actorName:s.target,f=hr(a,o),h=f?.name??o??(n==="from"?"Unknown":"No target"),b=f?"Agent":n==="to"&&s.conversationId?"Session route":Be(s,n);return{label:h,kind:b,agent:f}}function fr(s,a,n){const o=n.agent??a.agent;return[{label:"From",value:a.kind},{label:"To",value:n.kind},{label:"Target",value:s.target??n.label},{label:"Channel",value:Pe(s.route)},{label:"Project",value:o?.project??O(s,"project","projectName")},{label:"Branch",value:o?.branch??O(s,"branch")},{label:"Runtime",value:o?[o.harness,o.model,o.reasoningEffort].filter(Boolean).join(" · ")||null:[O(s,"harness"),O(s,"model")].filter(Boolean).join(" · ")||null},{label:"Machine",value:o?.authorityNodeName??o?.homeNodeName??o?.authorityNodeId??o?.homeNodeId??O(s,"machine","machineName","nodeName")}].filter(f=>!!f.value)}function ts({party:s,route:a,side:n}){return e.jsxs("span",{className:`sys-broker-route-end sys-broker-route-end--${n}`,children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:s.agent||n==="from"?Ae(s.label):e.jsx(_e,{route:a})}),e.jsx("span",{className:"sys-broker-endpoint-name",title:s.label,children:s.label})]})}function mr({attempt:s,agents:a}){const n=as(s,a,"from"),o=as(s,a,"to"),f=fr(s,n,o),h=`dispatch-route-${s.id}`;return e.jsxs("span",{className:"sys-broker-route",tabIndex:0,"aria-describedby":h,children:[e.jsx(ts,{party:n,route:s.route,side:"from"}),e.jsx(Te,{className:"sys-broker-route-arrow",size:11,"aria-hidden":"true"}),e.jsx(ts,{party:o,route:s.route,side:"to"}),e.jsxs("span",{className:"sys-broker-endpoint-card",id:h,role:"tooltip",children:[e.jsx("span",{className:"sys-broker-endpoint-card-head",children:e.jsxs("span",{className:"sys-broker-endpoint-card-edge",children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:Ae(n.label)}),e.jsx("strong",{children:n.label}),e.jsx(Te,{className:"sys-broker-route-arrow",size:11,"aria-hidden":"true"}),e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:o.agent?Ae(o.label):e.jsx(_e,{route:s.route})}),e.jsx("strong",{children:o.label})]})}),e.jsx("span",{className:"sys-broker-endpoint-card-body",children:f.map(b=>e.jsxs("span",{className:"sys-broker-endpoint-card-field",children:[e.jsx("small",{children:b.label}),e.jsx("code",{title:b.value,children:b.value})]},b.label))})]})]})}function je(s){const a=ee(s)??0,n=new Date(a);return`${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`}function pr(s,a=Date.now()){const n=ee(s)??0,o=new Date(n),f=new Date(a),h=new Date(a);return h.setDate(h.getDate()-1),je(s)===je(f.getTime())?"Today":je(s)===je(h.getTime())?"Yesterday":o.toLocaleDateString(void 0,{month:"short",day:"numeric",year:o.getFullYear()===f.getFullYear()?void 0:"numeric"})}function br(s,a,n){return{...a,source:s.source,attempts:[...s.attempts,...a.attempts],failedQueries:s.failedQueries,failedDeliveries:s.failedDeliveries,dialogue:s.dialogue,ledger:{...a.ledger,cursors:{...s.ledger.cursors,[n]:a.ledger.cursors[n]},hasMore:{...s.ledger.hasMore,[n]:a.ledger.hasMore[n]}}}}function yr({navigate:s,embedded:a=!1,initialAttemptId:n}){_s("Dispatch",a);const{route:o,agents:f,selectedBrokerAttempt:h,inspectBrokerAttempt:b,clearBrokerAttempt:p}=os(),[j]=t.useState(()=>As(De(),lr)),[c,w]=t.useState(j),I=o.view==="broker"?o.filter??"all":"all",[F,y]=t.useState(j===null),[u,N]=t.useState(!1),[L,ce]=t.useState(!1),[_,T]=t.useState(null),J=t.useRef(j),M=t.useRef(0),q=t.useRef(null),G=t.useCallback(async(l="initial")=>{const d=++M.current;!J.current&&l!=="background"?(y(!0),T(null)):N(!0);try{const g=await ie(De());if(d!==M.current)return;J.current=g,w(g),T(null)}catch(g){if(d!==M.current)return;T(g instanceof Error?g.message:String(g))}finally{d===M.current&&(y(!1),N(!1))}},[]),de=t.useCallback(async()=>{const l=J.current;if(!l||L)return;const d="attempts",g=l.ledger.cursors[d];if(!g||!l.ledger.hasMore[d])return;const S=++M.current;ce(!0),T(null);try{const H=await ie(De(g));if(S!==M.current)return;const E=J.current,re=E?br(E,H,d):H;J.current=re,w(re)}catch(H){if(S!==M.current)return;T(H instanceof Error?H.message:String(H))}finally{S===M.current&&ce(!1)}},[L]),ne=t.useCallback(()=>{q.current||(q.current=setTimeout(()=>{q.current=null,G("background")},250))},[G]);t.useEffect(()=>(G("initial"),()=>{q.current&&clearTimeout(q.current)}),[G]),Cs(l=>{(l.kind==="message.posted"||l.kind==="delivery.planned"||l.kind==="delivery.attempted"||l.kind==="delivery.state.changed"||l.kind==="scout.dispatched")&&ne()});const v=t.useMemo(()=>{if(!c)return[];const l=new Map(c.dialogue.map(d=>[d.id,d.body]));return $s(c.attempts).map(d=>{const g=d.messageId?l.get(d.messageId):null;return g&&g!==d.detail?{...d,detail:g}:d})},[c]),R=t.useMemo(()=>{switch(I){case"delivered":return v.filter(l=>!le(l));case"failed":return v.filter(le);default:return v}},[I,v]),ue=c?.ledger.hasMore.attempts??!1,U=t.useMemo(()=>({all:v.length,delivered:v.filter(l=>!le(l)).length,failed:v.filter(le).length}),[v]),D=t.useMemo(()=>{const l=o.view==="broker"?o.attemptId:void 0;return!c||!l?null:v.find(d=>d.id===l)??c.attempts.find(d=>d.id===l)??c.failedQueries.find(d=>d.id===l)??c.failedDeliveries.find(d=>d.id===l)??null},[c,v,o]),he=D?`${D.id}\0${D.status}\0${D.ts}`:null,Q=h?`${h.id}\0${h.status}\0${h.ts}`:null;t.useEffect(()=>{D&&he!==Q&&b(D)},[Q,b,D,he]);const[C,K]=t.useState(null),$=t.useRef(!1),V=t.useCallback(l=>{if(a){$.current=!0,K(l);return}b(l)},[a,b]),A=t.useCallback(()=>{if(a){$.current=!0,K(null);return}p()},[p,a]),se=t.useCallback(l=>{const d=R[l];d&&(V(d),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}})))},[R,V]),{getRowFocusProps:W,setFocusedIndex:Y}=ir({enabled:!!c&&R.length>0,rowCount:R.length,onActivateRow:se,onClearSelection:A}),P=C?.id??null,oe=C?`${C.id} ${C.status} ${C.ts}`:null;t.useEffect(()=>{if(!a||!P)return;const l=v.find(d=>d.id===P);l&&`${l.id} ${l.status} ${l.ts}`!==oe&&K(l)},[a,P,oe,v]),t.useEffect(()=>{if(!a||!n||!c||$.current||C)return;const l=v.find(d=>d.id===n)??c.attempts.find(d=>d.id===n)??c.failedQueries.find(d=>d.id===n)??c.failedDeliveries.find(d=>d.id===n);l&&($.current=!0,K(l))},[c,a,C,v,n]),t.useEffect(()=>{const l=o.view==="broker"?o.attemptId:void 0;if(!l)return;const d=R.findIndex(g=>g.id===l);d>=0&&Y(d)},[R,I,o,Y]);const ve=t.useCallback(l=>{const g=(xe.indexOf(I)+l+xe.length)%xe.length,S=xe[g];s({view:"broker",...S==="all"?{}:{filter:S}})},[I,s]),fe=a?C:null;return e.jsx("div",{className:`s-ops${a?" s-ops--embedded":""}${fe?" s-ops--split":""}`,children:e.jsxs("div",{className:"s-ops-body",children:[e.jsxs("div",{className:"sys-surface-page sys-surface-page-wide sys-surface-page-fluid sys-broker-page",children:[e.jsxs("div",{className:"sys-ledger-toolbar","aria-label":"Dispatch controls",children:[c?e.jsx("div",{className:"sys-tab-row sys-tab-row--toolbar",role:"tablist","aria-label":"Dispatch message filters",onKeyDown:l=>{l.key==="ArrowRight"?(l.preventDefault(),ve(1)):l.key==="ArrowLeft"&&(l.preventDefault(),ve(-1))},children:xe.map(l=>e.jsxs("button",{type:"button",role:"tab","aria-selected":I===l,className:`sys-tab${I===l?" sys-tab-active":""}`,onClick:()=>s({view:"broker",...l==="all"?{}:{filter:l}}),children:[e.jsx("span",{children:cr[l]}),e.jsx("span",{className:"sys-tab-count",children:U[l]})]},l))}):e.jsx("div",{className:"sys-ledger-kicker",children:"Dispatch ledger"}),e.jsxs("div",{className:"sys-page-actions sys-ledger-actions",children:[e.jsx("div",{className:"sys-sync-note",children:F?"Loading dispatch ledger...":c?`Updated ${Fe(c.generatedAt)}${c.source?.latestMessageAt?` · latest message ${Fe(c.source.latestMessageAt)}`:""}`:"Waiting for dispatch data"}),e.jsx("button",{type:"button",className:"s-btn",disabled:F||u,onClick:()=>{G("manual")},children:u?"Refreshing...":"Refresh"})]})]}),_&&e.jsxs("div",{className:"sys-banner sys-banner-warning",children:[e.jsx("strong",{children:"Refresh failed."}),e.jsx("span",{children:_})]}),u&&c&&e.jsxs("div",{className:"sys-broker-source-note",role:"status","aria-live":"polite",children:[e.jsx(ke,{className:"sys-broker-source-spinner",size:12,"aria-hidden":"true"}),e.jsx("strong",{children:"Updating dispatches…"})]}),!u&&c?.source?.mode==="sqlite_projection"&&c.source.status==="degraded"&&c.source.detail&&e.jsxs("div",{className:"sys-broker-source-note sys-broker-source-note--warning",role:"status","aria-label":c.source.detail,title:c.source.detail,children:[e.jsx("span",{className:"sys-broker-source-dot","aria-hidden":"true"}),e.jsx("strong",{children:c.source.brokerReachable?"Dispatch history is loading":"Dispatch may be out of date"}),e.jsx("span",{children:c.source.brokerReachable?"Broker online; showing saved dispatch history while live messages load.":"Live broker unavailable; showing saved dispatch history."})]}),F&&!c&&e.jsx("div",{className:"sys-broker-empty-wrap",children:e.jsx(Ee,{className:"sys-state-card-centered",icon:e.jsx(ke,{className:"sys-broker-source-spinner",size:24,"aria-hidden":"true"}),title:"Loading dispatch",body:"Reading the dispatch database snapshot."})}),!F&&!c&&!_&&e.jsx("div",{className:"sys-broker-empty-wrap",children:e.jsx(Ee,{className:"sys-state-card-centered",title:"No dispatch data",body:"No dispatch rows are available yet."})}),c&&e.jsxs(e.Fragment,{children:[e.jsx(gr,{attempts:R,agents:f,selectedAttemptId:a?C?.id??null:h?.id??(o.view==="broker"?o.attemptId??null:null),onInspect:V,getRowFocusProps:W}),R.length>0&&ue&&e.jsx("div",{className:"sys-ledger-footer",children:e.jsx("button",{type:"button",className:"s-btn",disabled:L,onClick:()=>{de()},children:L?"Loading older...":"Load older"})})]})]}),fe&&e.jsx("div",{className:"s-broker-embed-detail",children:e.jsx(us,{attempt:fe,navigate:s,onClose:A})})]})})}function gr({attempts:s,agents:a,selectedAttemptId:n,onInspect:o,getRowFocusProps:f}){if(s.length===0)return e.jsx("div",{className:"sys-broker-empty-wrap",children:e.jsx(Ee,{className:"sys-state-card-centered",title:"No dispatch rows",body:"No dispatch rows are available yet."})});const h=s.reduce((b,p,j)=>{const c=je(p.ts),w=b[b.length-1];return w?.key===c?w.attempts.push({attempt:p,index:j}):b.push({key:c,label:pr(p.ts),attempts:[{attempt:p,index:j}]}),b},[]);return e.jsxs("div",{className:"sys-broker-wire","aria-label":"Dispatch ledger",children:[e.jsxs("div",{className:"sys-broker-wire-head","aria-hidden":"true",children:[e.jsx("span",{className:"sys-broker-col sys-broker-col--route",children:"Route"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--msg",children:"Message"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--time",children:"Time"})]}),h.map(b=>e.jsxs("section",{className:"sys-broker-day","aria-labelledby":`dispatch-day-${b.key}`,children:[e.jsxs("header",{className:"sys-broker-day-head",children:[e.jsx("h2",{id:`dispatch-day-${b.key}`,children:b.label}),e.jsxs("span",{children:[b.attempts.length," ",b.attempts.length===1?"dispatch":"dispatches"]})]}),e.jsx("div",{className:"sys-broker-wire-body",role:"list",children:b.attempts.map(({attempt:p,index:j})=>{const c=ze(p.kind,p.status),w=le(p),I=!w&&(c==="working"||c==="warning"),F=is(p),y=Le(p),u=w?F:I?y:null,N=()=>{o(p),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}}))};return e.jsxs("div",{role:"listitem",className:`sys-broker-wire-row${w?" sys-broker-wire-row--failure":I?" sys-broker-wire-row--pending":""}${n===p.id?" sys-broker-wire-row--selected":""}`,"aria-label":`${y}. Inspect ${p.detail}`,onClick:N,...f(j),children:[e.jsx("div",{className:"sys-broker-cell sys-broker-col--route",children:e.jsx(mr,{attempt:p,agents:a})}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--msg",children:[e.jsx("span",{className:"sys-broker-msg",title:p.detail,children:p.detail}),u&&e.jsx("span",{className:`sys-broker-msg-error sys-broker-msg-error--${w?"danger":"warning"}`,title:u,children:u})]}),e.jsx("div",{className:"sys-broker-cell sys-broker-col--time",children:e.jsx("time",{className:"sys-broker-time-abs",title:`${Fe(p.ts)} · ${ns(p.ts)}`,children:ur(p.ts)})})]},p.id)})})]},b.key))]})}function xr(s){const a=ds(s);return[{label:"Kind",value:dr(s.kind)},{label:"Time",value:ns(s.ts)},{label:"Actor",value:s.actorName},{label:"Target",value:s.target},{label:"Route",value:s.route},{label:"Conversation",value:s.conversationId},{label:"Reference",value:a},{label:"Message",value:s.messageId===a?null:s.messageId},{label:"Delivery",value:s.deliveryId===a?null:s.deliveryId},{label:"Invocation",value:s.invocationId===a?null:s.invocationId}].filter(n=>!!n.value)}function z({value:s,subject:a,className:n}){const[o,f]=t.useState("idle"),h=t.useRef(null);t.useEffect(()=>{f("idle")},[s]),t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const b=t.useCallback(async()=>{const c=await Rs(s);h.current&&clearTimeout(h.current),f(c?"copied":"failed"),h.current=setTimeout(()=>{f("idle"),h.current=null},1500)},[s]),p=o==="copied",j=o==="failed";return e.jsx("button",{type:"button",className:`sys-copy-btn${n?` ${n}`:""}${p?" sys-copy-btn--copied":""}${j?" sys-copy-btn--failed":""}`,onClick:()=>{b()},title:p?`Copied ${a}`:j?"Copy failed":`Copy ${a}`,"aria-label":p?`Copied ${a}`:j?`Copy ${a} failed`:`Copy ${a}`,children:p?e.jsx(Js,{size:14,"aria-hidden":"true"}):e.jsx(Gs,{size:14,"aria-hidden":"true"})})}function jr(s){const a=s.trim();if(a.startsWith("{")||a.startsWith("["))try{return{code:JSON.stringify(JSON.parse(a),null,2),path:"payload.json",language:"JSON"}}catch{}return{code:s,path:"payload.md",language:"Text · Markdown"}}function kr({payload:s}){const a=t.useMemo(()=>jr(s),[s]),[n,o]=t.useState(!1),f=t.useRef(null),h=a.code.split(`
2
+ `).length;t.useEffect(()=>{const p=f.current;!p||!n||p.open||p.showModal()},[n]),t.useEffect(()=>{o(!1)},[s]);const b=e.jsx("div",{className:"sys-broker-payload-code","data-language":a.path==="payload.json"?"json":"markdown",role:"region","aria-label":`Dispatch payload, ${a.language}`,tabIndex:0,children:e.jsx(zs,{code:a.code,path:a.path})});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sys-broker-payload-head",children:[e.jsx("span",{className:"sys-detail-label",children:"Payload"}),e.jsxs("span",{className:"sys-broker-payload-meta",children:[a.language," · ",h," ",h===1?"line":"lines"]}),e.jsx(z,{value:s,subject:"payload"}),e.jsx("button",{type:"button",className:"sys-copy-btn sys-broker-payload-expand",onClick:()=>o(!0),title:"Expand payload","aria-label":"Expand payload",children:e.jsx(Vs,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-resizer",children:b}),n&&xs.createPortal(e.jsxs("dialog",{ref:f,className:"sys-broker-payload-dialog","aria-label":"Expanded dispatch payload",onCancel:p=>{p.preventDefault(),o(!1)},onClose:()=>o(!1),children:[e.jsxs("header",{className:"sys-broker-payload-dialog-head",children:[e.jsxs("div",{children:[e.jsx("span",{className:"sys-detail-label",children:"Dispatch payload"}),e.jsxs("span",{className:"sys-broker-payload-meta",children:[a.language," · ",h," ",h===1?"line":"lines"]})]}),e.jsx(z,{value:s,subject:"payload"}),e.jsx("button",{type:"button",className:"sys-copy-btn",onClick:()=>o(!1),title:"Return payload to inspector","aria-label":"Return payload to inspector",children:e.jsx(Ws,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-dialog-body",children:b})]}),document.body)]})}function vr({attempt:s}){const a=Ms(s);return e.jsxs("div",{className:"sys-broker-route-failure",role:"status",children:[e.jsx("span",{className:"sys-broker-route-failure-mark","aria-hidden":"true",children:e.jsx(Me,{size:14})}),e.jsxs("div",{children:[e.jsx("span",{className:"sys-detail-label",children:"Routing stopped"}),e.jsx("strong",{children:a}),e.jsx("p",{children:s.detail})]}),e.jsx(z,{value:s.detail,subject:"failure detail"})]})}function us({attempt:s,navigate:a,onClose:n}){const{route:o,agents:f,scoutbotAgentId:h}=os(),b=xr(s),p=Ds(s.metadata),j=le(s),c=s.kind==="failed_query",w=is(s),I=ze(s.kind,s.status),F=Re(s,"sentAt","createdAt")??ee(s.ts),y=Re(s,"deliveredAt","completedAt")??ee(s.ts),u=ds(s),[N,L]=t.useState("idle"),[ce,_]=t.useState(null),[T,J]=t.useState(null),[M,q]=t.useState(!1),[G,de]=t.useState(!1),[ne,v]=t.useState(""),[R,ue]=t.useState(""),[U,D]=t.useState("idle"),[he,Q]=t.useState(null),[C,K]=t.useState(""),[$,V]=t.useState(""),[A,se]=t.useState(""),[W,Y]=t.useState(""),[P,oe]=t.useState("medium"),[ve,fe]=t.useState(null),[l,d]=t.useState([]),[g,S]=t.useState("idle"),[H,E]=t.useState(null),re=O(s,"harness"),we=O(s,"model"),Ne=O(s,"reasoningEffort","effort"),qe=t.useRef(null),Ue=t.useRef(null),me=t.useMemo(()=>Es(s),[s]),k=t.useMemo(()=>f.filter(r=>!r.retiredFromFleet&&!r.staleLocalRegistration).slice().sort((r,i)=>r.id===h?-1:i.id===h?1:(i.updatedAt??0)-(r.updatedAt??0)||r.name.localeCompare(i.name)),[f,h]),pe=t.useMemo(()=>Fs(s,k)?.id??"",[s,k]),be=k.find(r=>r.id!==h)?.id??k[0]?.id??"",Se=k[0]?.id??"",ae=k.find(r=>r.id===be)??null,hs=t.useMemo(()=>{const r=new Map;for(const i of k){const m=i.projectRoot?.trim()||i.cwd?.trim();if(!m)continue;const x=m.split("/").filter(Boolean).at(-1)??m;r.set(m,i.project?.trim()||x)}return[...r.entries()].map(([i,m])=>({path:i,label:m}))},[k]),Ke=t.useRef({originalTargetAgentId:pe,firstRoutableAgentId:Se,defaultForwardAgentId:be,defaultForwardAgent:ae,effort:"medium"});Ke.current={originalTargetAgentId:pe,firstRoutableAgentId:Se,defaultForwardAgentId:be,defaultForwardAgent:ae,effort:O(s,"reasoningEffort","effort")||"medium"};const ye=t.useRef(!1);t.useEffect(()=>{const r=Ke.current;ye.current=!1,L("idle"),_(null),J(null),q(!1),de(!1),v(""),ue(r.originalTargetAgentId||r.firstRoutableAgentId),D("idle"),Q(null),K(r.defaultForwardAgentId),V(r.defaultForwardAgent?.projectRoot?.trim()||r.defaultForwardAgent?.cwd?.trim()||""),se(r.defaultForwardAgent?.harness?.trim()||""),Y(r.defaultForwardAgent?.model?.trim()||""),oe(r.effort),d([]),S("idle"),E(null)},[s.id]),t.useEffect(()=>{ye.current||(ue(r=>r||pe||Se),K(r=>r||be),V(r=>r||ae?.projectRoot?.trim()||ae?.cwd?.trim()||""),se(r=>r||ae?.harness?.trim()||""),Y(r=>r||ae?.model?.trim()||""))},[ae,be,Se,pe]),t.useEffect(()=>{const r=new URLSearchParams({scope:"global+project"});$&&r.set("projectRoot",$);let i=!1;return ie(`/api/runner/options?${r.toString()}`).then(m=>{!i&&m.schemaVersion==="openscout.runtime-capabilities.v1"&&fe(m)}).catch(()=>{}),()=>{i=!0}},[$]);const fs=t.useCallback(()=>{q(!0),window.requestAnimationFrame(()=>qe.current?.focus())},[]),He=t.useCallback(()=>{q(!1),de(!1),v(""),d([]),S("idle"),E(null)},[]),ms=t.useCallback(async()=>{const r=k.find(i=>i.id===R);if(!(!r||U==="sending")){D("sending"),Q(null);try{const i=await ie("/api/ask",{method:"POST",body:JSON.stringify({body:s.detail,targetAgentId:r.id,targetLabel:r.name,...re||we||Ne?{execution:{...re?{harness:re}:{},...we?{model:we}:{},...Ne?{reasoningEffort:Ne}:{},session:"new"}}:{},metadata:{source:"scout-dispatch-redispatch",originalDispatchId:s.id,...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),m=i.flightId??i.flight?.id;D("sent"),Q(`New dispatch sent to ${r.name}${m?` · ${m}`:""}`)}catch(i){D("failed"),Q(`Retry failed. ${i instanceof Error?i.message:String(i)}`)}}},[s,R,U,Ne,re,we,k]),Je=t.useCallback(async()=>{const r=ne.trim(),i=k.find(m=>m.id===C);if(!(!r||!i||g==="sending")){S("sending"),E(l.length>0?`Uploading ${l.length} ${l.length===1?"attachment":"attachments"}…`:null);try{const m=l.length>0?await ks(l):[],x=await ie("/api/ask",{method:"POST",body:JSON.stringify({body:`${r}
3
+
4
+ Attached dispatch context:
5
+ ${me}`,targetAgentId:i.id,targetLabel:i.name,...m.length>0?{attachments:m}:{},execution:{...A?{harness:A}:{},...W?{model:W}:{},...P?{reasoningEffort:P}:{}},metadata:{source:"scout-dispatch-forward",originalDispatchId:s.id,...$?{targetProjectPath:$}:{},...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),X=x.flightId??x.flight?.id;S("sent"),E(`Request sent to ${i.name}${X?` · ${X}`:""}`),v(""),d([])}catch(m){S("failed"),E(`Request wasn't sent. ${m instanceof Error?m.message:String(m)}`)}}},[s,me,C,P,l,A,W,$,g,ne,k]),ps=t.useCallback(r=>{const i=r.filter(vs),m=r.length-i.length;i.length>0&&(d(x=>[...x,...i]),S("idle"),E(null)),m>0&&(S("failed"),E("Attach markdown, code, an image, or a video clip."))},[]),B=k.find(r=>r.id===R)??null,te=k.find(r=>r.id===C)??null,ge=k.filter(r=>$?(r.projectRoot?.trim()||r.cwd?.trim())===$:!0),Ge=ve??Ns,$e=t.useMemo(()=>{const r=ws(Ge),i=[W,te?.harness===A?te.model:null,...ge.filter(x=>x.harness===A).map(x=>x.model)].map(x=>x?.trim()).filter(x=>!!x);let m=r.harnesses;return m.some(x=>x.value===A)||(m=[{value:A,label:A||"default",models:[]},...m]),m=m.map(x=>{if(x.value!==A)return x;const X=x.models.some(Z=>Z.value==="")?x.models:[{value:"",label:"Default",note:"harness picks"},...x.models],gs=new Set(X.map(Z=>Z.value)),We=i.filter(Z=>!gs.has(Z)).map(Z=>({value:Z,label:Z,note:"observed"}));return We.length===0&&X===x.models?x:{...x,models:[...X,...We]}}),{...r,harnesses:m}},[Ge,te,A,W,ge]);t.useEffect(()=>{const r=Ss($e,A);!r||r.some(i=>i.value===P)||oe(r.find(i=>i.value==="medium")?.value??r[0]?.value??"")},[$e,A,P]);const Qe=j?"Investigate why this dispatch failed. Say what stopped it, whether anything was received, and propose a recovery: who should take it and what should happen next.":"Summarize this dispatch and what happened next. Flag anything that needs the operator.",bs=t.useCallback(async()=>{if(N==="sending")return;if(T){Ye(a,{view:"conversation",conversationId:T},{returnTo:o});return}const r=k.find(i=>i.id===h);if(!r){L("failed"),_("Scout isn't reachable right now.");return}L("sending"),_(null);try{const i=await ie("/api/ask",{method:"POST",body:JSON.stringify({body:`${Qe}
6
+
7
+ Attached dispatch context:
8
+ ${me}`,targetAgentId:r.id,targetLabel:"Scout",metadata:{source:"scout-dispatch-investigate",originalDispatchId:s.id,...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),m=i.flightId??i.flight?.id;L("sent"),J(i.conversationId??null),_(i.conversationId?"Investigation started. Open it to follow along.":`Investigation sent to Scout${m?` · ${m}`:""}.`)}catch(i){L("failed"),_(`Investigation wasn't sent. ${i instanceof Error?i.message:String(i)}`)}},[s,me,T,Qe,N,a,k,o,h]),ys=t.useMemo(()=>{const r={state:Le(s),reference:u,channel:Pe(s.route),latency:rs(s),sent:Ie(F),[j?"failed":"delivered"]:Ie(y)};for(const i of b)r[i.label.toLowerCase()]=i.value;return JSON.stringify(r,null,2)},[s,y,j,u,b,F]),Ve=e.jsxs("div",{className:"sys-broker-action-row",children:[e.jsxs("div",{className:"sys-broker-action-line",children:[e.jsx("span",{className:"sys-broker-action-label",id:"dispatch-redispatch-title",children:"Retry"}),e.jsxs("div",{className:"sys-broker-redispatch-controls",children:[e.jsx("select",{"aria-label":"Retry destination",value:R,disabled:U==="sending"||k.length===0,onChange:r=>{ue(r.target.value),D("idle"),Q(null)},children:k.length===0?e.jsx("option",{value:"",children:"No agents available"}):e.jsxs(e.Fragment,{children:[!R&&e.jsx("option",{value:"",children:"Original destination unavailable"}),k.map(r=>e.jsxs("option",{value:r.id,children:[r.id===h?"Scout":r.name,r.project?` · ${r.project}`:""]},r.id))]})}),e.jsxs("button",{type:"button",className:"sys-broker-redispatch-send",disabled:!B||U==="sending",onClick:()=>{ms()},children:[U==="sending"?e.jsx(ke,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(qs,{size:13,"aria-hidden":"true"}),U==="sending"?"Retrying…":"Retry dispatch"]})]})]}),B&&e.jsxs("div",{className:"sys-broker-action-target-meta",children:[B.harness&&e.jsx("span",{children:B.harness}),B.model&&e.jsx("span",{children:B.model}),(B.cwd??B.projectRoot)&&e.jsx("code",{children:B.cwd??B.projectRoot})]}),he&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${U}`,role:"status",children:he})]});return e.jsxs("aside",{className:"sys-panel sys-broker-inspector","aria-label":"Dispatch route inspector",children:[e.jsx("header",{className:"sys-broker-inspector-head",children:e.jsxs("div",{className:"sys-broker-inspector-status",children:[e.jsx("span",{className:`sys-broker-dot sys-broker-dot--${I}`,"aria-hidden":"true"}),e.jsx("strong",{className:`sys-broker-state sys-broker-state--${I}`,children:Le(s)}),e.jsx("code",{title:u,children:u}),e.jsx(z,{value:u,subject:"message id",className:"sys-broker-inspector-copy"}),e.jsx(z,{value:me,subject:"dispatch context",className:"sys-broker-inspector-copy"}),e.jsx("button",{type:"button",className:"sys-copy-btn sys-broker-inspector-close",onClick:n,title:"Close inspector","aria-label":"Close inspector",children:e.jsx(Me,{size:14,"aria-hidden":"true"})})]})}),e.jsxs("div",{className:"sys-broker-inspector-body",children:[e.jsxs("section",{className:"sys-broker-route-stack","aria-label":"Dispatch route",children:[e.jsxs("div",{className:"sys-broker-route-party",children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-route-avatar","aria-hidden":"true",children:Ae(s.actorName)}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["From · ",Be(s,"from")]}),e.jsx("strong",{children:s.actorName??"Unknown sender"})]}),s.actorName&&e.jsx(z,{value:s.actorName,subject:"sender"})]}),e.jsx(Us,{className:"sys-broker-route-down",size:17,"aria-hidden":"true"}),e.jsxs("div",{className:"sys-broker-route-party",children:[e.jsx("span",{className:"sys-broker-route-target-icon","aria-hidden":"true",children:e.jsx(_e,{route:s.route})}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["To · ",Be(s,"to")]}),e.jsx("code",{title:s.target??"No target",children:s.target??"No target"})]}),s.target&&e.jsx(z,{value:s.target,subject:"target"}),s.conversationId&&e.jsxs("button",{type:"button",className:"sys-broker-route-button",onClick:()=>Ye(a,{view:"conversation",conversationId:s.conversationId},{returnTo:o}),children:[e.jsx(Ze,{size:11,"aria-hidden":"true"}),"Route"]})]})]}),e.jsxs("section",{className:"sys-broker-payload",children:[c?e.jsx(vr,{attempt:s}):e.jsx(kr,{payload:s.detail}),j&&!c&&w&&e.jsxs("div",{className:"sys-broker-inspector-error",role:"status",children:[e.jsx("span",{className:"sys-broker-inspector-error-label",children:"Error"}),e.jsx("p",{children:w})]})]}),e.jsx(Ls,{attempt:s,targetAgentId:pe||null,navigate:a,returnTo:o}),e.jsxs("section",{className:"sys-broker-actions","aria-label":"Dispatch actions",children:[j&&Ve,e.jsxs("div",{className:"sys-broker-intents",children:[e.jsxs("button",{type:"button",className:`sys-broker-intent${j?"":" sys-broker-intent--primary"}`,disabled:N==="sending",onClick:()=>{bs()},children:[N==="sending"?e.jsx(ke,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):T?e.jsx(Ze,{size:13,"aria-hidden":"true"}):e.jsx(ls,{size:13,"aria-hidden":"true"}),N==="sending"?"Asking Scout…":T?"Open investigation":"Investigate with Scout"]}),e.jsxs("button",{type:"button",className:"sys-broker-intent","aria-expanded":M,onClick:()=>M?He():fs(),children:[e.jsx(Te,{size:13,"aria-hidden":"true"}),"Forward to agent…"]})]}),ce&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${N}`,role:"status",children:ce}),M&&e.jsxs("div",{className:"sys-broker-forward-draft",children:[e.jsxs("div",{className:"sys-broker-forward-draft-head",children:[e.jsx("span",{className:"sys-broker-action-label",children:"Forward to agent"}),e.jsx("button",{type:"button",className:"sys-broker-forward-discard",onClick:He,children:"Discard"})]}),e.jsxs("form",{className:"sys-broker-message-composer",onSubmit:r=>{r.preventDefault(),Je()},children:[e.jsx("textarea",{ref:qe,id:"dispatch-message-input","aria-label":"Forward message",value:ne,rows:3,placeholder:`What should ${te?.id===h?"Scout":te?.name??"this agent"} investigate or do?`,disabled:g==="sending",onChange:r=>{v(r.target.value),g!=="idle"&&(S("idle"),E(null))},onKeyDown:r=>{r.key==="Enter"&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),Je())}}),l.length>0&&e.jsx("div",{className:"sys-broker-composer-attachments","aria-label":"Attachments",children:l.map((r,i)=>e.jsxs("span",{children:[e.jsx(rr,{size:10,"aria-hidden":"true"}),e.jsx("span",{title:r.name,children:r.name}),e.jsx("button",{type:"button",onClick:()=>d(m=>m.filter((x,X)=>X!==i)),"aria-label":`Remove ${r.name}`,children:e.jsx(Me,{size:10,"aria-hidden":"true"})})]},`${r.name}:${r.size}:${i}`))}),e.jsxs("footer",{children:[e.jsxs("div",{className:"sys-broker-composer-left",children:[e.jsx("input",{ref:Ue,type:"file",multiple:!0,hidden:!0,disabled:g==="sending",onChange:r=>{ps([...r.target.files??[]]),r.target.value=""}}),e.jsx("button",{type:"button",className:"sys-broker-composer-attach",disabled:g==="sending",onClick:()=>Ue.current?.click(),"aria-label":"Attach files",title:"Attach files",children:e.jsx(Ks,{size:16,"aria-hidden":"true"})}),e.jsx("span",{className:"sys-broker-message-attachment",title:u,children:"Context + payload attached"})]}),e.jsxs("div",{className:"sys-broker-composer-targets",children:[e.jsx("span",{className:"sys-broker-composer-route-label",children:"To"}),e.jsxs("label",{title:"Forward target",children:[e.jsx("span",{children:"Agent"}),e.jsx("select",{"aria-label":"Forward target",value:C,disabled:g==="sending"||ge.length===0,onChange:r=>{const i=k.find(m=>m.id===r.target.value)??null;ye.current=!0,K(r.target.value),i&&(V(i.projectRoot?.trim()||i.cwd?.trim()||""),se(i.harness?.trim()||""),Y(i.model?.trim()||"")),S("idle"),E(null)},children:ge.length===0?e.jsx("option",{value:"",children:"No agents"}):ge.map(r=>e.jsx("option",{value:r.id,children:r.id===h?"Scout":r.name},r.id))})]}),e.jsxs("button",{type:"button",className:"sys-broker-forward-adjust-toggle","aria-expanded":G,onClick:()=>de(r=>!r),children:["Adjust",e.jsx(es,{size:11,"aria-hidden":"true"})]}),e.jsx(js,{className:"sys-broker-composer-mic",disabled:g==="sending",onAppend:r=>v(i=>i.trim()?`${i.trimEnd()} ${r}`:r),onError:r=>{S("failed"),E(r)}})]}),e.jsx("button",{type:"submit",className:"sys-broker-composer-send",disabled:!ne.trim()||!te||g==="sending","aria-label":`Ask ${te?.name??"recipient"} about this dispatch`,children:g==="sending"?e.jsx(ke,{size:14,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(Hs,{size:14,"aria-hidden":"true"})})]}),G&&e.jsxs("div",{className:"sys-broker-composer-targets sys-broker-forward-adjust",children:[e.jsxs("label",{title:"Project target",children:[e.jsx("span",{children:"Project"}),e.jsxs("select",{"aria-label":"Project target",value:$,disabled:g==="sending",onChange:r=>{const i=r.target.value,m=k.find(x=>!i||(x.projectRoot?.trim()||x.cwd?.trim())===i)??null;ye.current=!0,V(i),m&&(K(m.id),se(m.harness?.trim()||""),Y(m.model?.trim()||""))},children:[e.jsx("option",{value:"",children:"Any project"}),hs.map(r=>e.jsx("option",{value:r.path,children:r.label},r.path))]})]}),e.jsx(Is,{catalog:$e,value:{harness:A,model:W,effort:P},onChange:r=>{ye.current=!0,se(r.harness),Y(r.model),oe(r.effort)},disabled:g==="sending"})]})]}),H&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${g}`,role:"status",children:H})]})]}),e.jsxs("details",{className:"sys-broker-technical",children:[e.jsxs("summary",{children:[e.jsx("span",{children:"Technical details"}),e.jsx(es,{size:13,"aria-hidden":"true"})]}),e.jsxs("dl",{className:"sys-broker-delivery-grid",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Channel"}),e.jsx("dd",{children:Pe(s.route)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Latency"}),e.jsx("dd",{className:"sys-broker-delivery-accent",children:rs(s)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Sent"}),e.jsx("dd",{children:Ie(F)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:j?"Failed":"Delivered"}),e.jsx("dd",{children:Ie(y)})]})]}),e.jsxs("div",{className:"sys-broker-record-head",children:[e.jsx("span",{className:"sys-detail-label",children:"Record"}),e.jsx(z,{value:ys,subject:"record as JSON",className:"sys-broker-metadata-copy"})]}),e.jsx("div",{className:"sys-broker-inspector-rows",children:b.map(r=>e.jsxs("div",{className:"sys-broker-inspector-row",children:[e.jsx("span",{className:"sys-detail-label",children:r.label}),e.jsx("code",{className:"sys-detail-value",children:r.value}),e.jsx(z,{value:r.value,subject:r.label.toLowerCase()})]},r.label))}),e.jsxs("div",{className:"sys-broker-metadata",children:[e.jsxs("div",{className:"sys-broker-metadata-head",children:[e.jsx("span",{className:"sys-detail-label",children:"Metadata"}),e.jsx(z,{value:p,subject:"metadata",className:"sys-broker-metadata-copy"})]}),e.jsx(Ts,{metadata:s.metadata,rawJson:p})]}),!j&&Ve]})]})]})}const wr=Os({id:"dispatch",label:"Dispatch",route:{view:"broker"},webPath:"/dispatch",screen:"BrokerScreen",embed:{path:"/embed/dispatch",profile:"macos.dispatch",rootClassName:"s-broker-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},ownsInternalRoutes:!0,resolveEmbedProps:s=>{const a=s.get("attempt")?.trim();return a?{initialAttemptId:a}:{}},hosts:{macos:!0}}}),oa=Object.freeze(Object.defineProperty({__proto__:null,BrokerAttemptInspector:us,BrokerScreen:yr,scoutSurface:wr},Symbol.toStringTag,{value:"Module"}));export{us as B,yr as a,De as b,oa as c};
@@ -1 +1 @@
1
- import{v as n,j as a,w as o}from"./index-C1VaWNuD.js";import{C as l}from"./CrewAvatar-CZ_faQ_s.js";import{C as g}from"./check-Dz2SRHft.js";function C({selectedSlug:r,onSelect:c,size:i=44}){const e=n("crew");return a.jsxs("div",{className:"s-settings-cast-grid",role:"group","aria-label":"Character assignment",children:[o.map(s=>{const t=r?.toLowerCase()===s.slug.toLowerCase();return a.jsxs("button",{type:"button",className:"s-settings-cast-choice","data-cast-slug":s.slug,"data-active":t||void 0,"aria-pressed":t,onClick:()=>c(s.slug),children:[a.jsx(l,{slug:s.slug,size:i,ring:t,state:t?"working":"idle"}),a.jsx("span",{className:"s-settings-cast-name",children:s.name}),a.jsx("span",{className:"s-settings-cast-title",children:s.title}),t&&a.jsx(g,{className:"s-settings-cast-check",size:14,"aria-hidden":!0})]},s.slug)}),e?a.jsxs("span",{className:"s-cast-picker-coverage","aria-hidden":!0,children:[e.covered," of ",e.total," cast"]}):null]})}export{C};
1
+ import{w as n,j as a,x as o}from"./index-C8uS5szO.js";import{C as l}from"./CrewAvatar-CJhuqTsJ.js";import{C as g}from"./check-B8dMv3Is.js";function C({selectedSlug:r,onSelect:c,size:i=44}){const e=n("crew");return a.jsxs("div",{className:"s-settings-cast-grid",role:"group","aria-label":"Character assignment",children:[o.map(s=>{const t=r?.toLowerCase()===s.slug.toLowerCase();return a.jsxs("button",{type:"button",className:"s-settings-cast-choice","data-cast-slug":s.slug,"data-active":t||void 0,"aria-pressed":t,onClick:()=>c(s.slug),children:[a.jsx(l,{slug:s.slug,size:i,ring:t,state:t?"working":"idle"}),a.jsx("span",{className:"s-settings-cast-name",children:s.name}),a.jsx("span",{className:"s-settings-cast-title",children:s.title}),t&&a.jsx(g,{className:"s-settings-cast-check",size:14,"aria-hidden":!0})]},s.slug)}),e?a.jsxs("span",{className:"s-cast-picker-coverage","aria-hidden":!0,children:[e.covered," of ",e.total," cast"]}):null]})}export{C};
@@ -0,0 +1 @@
1
+ .character-family-preview{position:absolute;z-index:30;top:60px;right:20px;width:min(500px,calc(100% - 40px));max-height:calc(100% - 90px);overflow:auto;background:#141b19f7;border:1px solid #ffffff20;border-radius:18px;padding:20px;color:#e8edf4;box-shadow:0 20px 60px #0007}.character-family-preview header{display:flex;justify-content:space-between;gap:12px}.character-family-preview strong{font-size:15px}.character-family-preview p{font-size:12px;line-height:1.5;color:#9daaa4}.character-family-preview button{border:0;border-radius:6px;background:transparent;color:inherit;cursor:pointer;padding:7px 9px}.character-family-preview button:hover{background:#ffffff0c}.character-family-preview__poses{display:flex;gap:4px;flex-wrap:wrap;margin:10px 0}.character-family-preview__poses button{font-size:12px;text-transform:capitalize}.character-family-preview__poses button[aria-pressed=true]{background:#bedf9230;color:#d9edbe}.character-family-preview__cast{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.character-family-preview figure{margin:0;text-align:center}.character-family-preview figcaption{font-size:12px;margin-top:8px}.character-family-preview{width:min(760px,calc(100% - 40px))}.character-family-preview__cast{grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:20px 12px}.character-family-preview__stage{height:165px;display:grid;place-items:center;cursor:grab;touch-action:none}.character-family-preview__stage:active{cursor:grabbing}.character-family-preview__missing,.character-family-preview small{font-size:10px;color:#93a298}.character-family-preview small{display:block;margin-top:4px}.character-family-preview button:focus-visible{outline:2px solid #bedf92;outline-offset:2px}.character-family-preview{background:#141b19;top:20px;max-height:calc(100% - 40px)}.character-family-preview__stage:focus-visible{outline:2px solid #bedf92;outline-offset:2px;border-radius:12px}.character-family-preview__moving{display:inline-block;transform-origin:50% 85%;pointer-events:none}
@@ -0,0 +1 @@
1
+ import{r as u,j as e,x as w,h as E,l as N}from"./index-C8uS5szO.js";import{C as _}from"./CrewSprite-hgpA3SWB.js";const y=16,M=.05,P=.01,g=.01;function v(t,i,s,a){const x=t-s,l=i+y*x,c=Math.exp(-y*a),r=s+(x+l*a)*c,o=(i-y*l*a)*c;return Math.abs(r-s)<P&&Math.abs(o)<g?[s,0]:[r,o]}function k(t,i,s){if(!Number.isFinite(s)||s<=0)return{...t};if(!Number.isFinite(i.x)||!Number.isFinite(i.y))return{...t};if(![t.x,t.y,t.vx,t.vy].every(Number.isFinite))return{...i,vx:0,vy:0};const a=Math.min(s,M),[x,l]=v(t.x,t.vx,i.x,a),[c,r]=v(t.y,t.vy,i.y,a);return{x,y:c,vx:l,vy:r}}function S({slug:t,name:i,pixel:s,paused:a,expression:x}){const l=u.useRef(null),c=u.useRef(null),r=u.useRef({x:0,y:0,vx:0,vy:0}),o=u.useRef(null),m=u.useRef(a);m.current=a,u.useEffect(()=>{const n=window.matchMedia("(prefers-reduced-motion: reduce)");let p=0,d=performance.now();const b=j=>{const C=Math.min(.05,(j-d)/1e3);if(d=j,!document.hidden&&!o.current&&!m.current){r.current=n.matches?{x:0,y:0,vx:0,vy:0}:k(r.current,{x:0,y:0},C);const f=r.current;c.current&&(c.current.style.transform=`translate(${f.x}px, ${f.y}px) rotate(${Math.max(-6,Math.min(6,f.vx*.018))}deg)`)}p=requestAnimationFrame(b)};return p=requestAnimationFrame(b),()=>cancelAnimationFrame(p)},[]);const h=!s||E(t);return e.jsxs("figure",{children:[e.jsx("div",{className:"character-family-preview__stage",ref:l,role:"button",tabIndex:h?0:-1,"aria-label":`Nudge ${i}`,"aria-disabled":!h||a,onKeyDown:n=>{h&&!a&&(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),r.current={x:12,y:-22,vx:0,vy:0})},onPointerDown:n=>{!h||m.current||n.button!==0||(o.current={id:n.pointerId,x:n.clientX-r.current.x,y:n.clientY-r.current.y},n.currentTarget.setPointerCapture(n.pointerId))},onPointerMove:n=>{if(o.current?.id!==n.pointerId)return;const p=Math.max(-35,Math.min(35,n.clientX-o.current.x)),d=Math.max(-45,Math.min(12,n.clientY-o.current.y));r.current={x:p,y:d,vx:0,vy:0},c.current&&(c.current.style.transform=`translate(${p}px, ${d}px)`)},onPointerUp:n=>{o.current?.id===n.pointerId&&(o.current=null,n.currentTarget.releasePointerCapture(n.pointerId))},onPointerCancel:()=>{o.current=null},children:h?e.jsx("span",{ref:c,className:"character-family-preview__moving",children:e.jsx(_,{slug:t,pixel:s,size:s?88:155,paused:a,expression:x})}):e.jsx("span",{className:"character-family-preview__missing",children:"No chip artwork yet"})}),e.jsx("figcaption",{children:i}),!s&&N[t]?e.jsx("small",{children:"Eye expressions available"}):null]})}function R({onClose:t}){const[i,s]=u.useState(!1),[a,x]=u.useState(!1),[l,c]=u.useState("rest");return e.jsxs("section",{className:"character-family-preview","aria-label":"Character family preview",children:[e.jsxs("header",{children:[e.jsxs("div",{children:[e.jsx("strong",{children:"The crew"}),e.jsx("p",{children:"Original identities · expressions · shared movement"})]}),e.jsx("button",{type:"button",onClick:t,"aria-label":"Close character preview",children:"×"})]}),e.jsxs("div",{className:"character-family-preview__poses",role:"group","aria-label":"Character artwork",children:[e.jsx("button",{type:"button","aria-pressed":!i,onClick:()=>s(!1),children:"Crew"}),e.jsx("button",{type:"button","aria-pressed":i,onClick:()=>s(!0),children:"Pixel Chip"}),e.jsx("button",{type:"button",onClick:()=>x(!a),children:a?"Resume motion":"Pause motion"})]}),i?null:e.jsx("div",{className:"character-family-preview__poses",role:"group","aria-label":"Eye expression",children:["rest","look-left","look-up","look-right"].map(r=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>c(r),children:r.replace("look-","Look ")},r))}),e.jsx("div",{className:"character-family-preview__cast",children:w.map(r=>e.jsx(S,{slug:r.slug,name:r.name,pixel:i,paused:a,expression:l},r.slug))}),e.jsx("p",{children:"Drag a character gently and release. This tests shared spring motion; full-body action sprites and accessories come next."})]})}export{R as CharacterFamilyPreview};
@@ -0,0 +1 @@
1
+ import{j as e,r as j}from"./index-C8uS5szO.js";import{a as $,i as O,d as w,c as W}from"./conversations-Cbg9h_Af.js";import{l as B,i as q,a as E,p as T}from"./conversation-prefs-DNre-Lcx.js";import{m as G,c as J}from"./machine-scope-DJt9RZ2w.js";import{u as K,f as Q}from"./use-fleet-active-asks-DFs_u-vM.js";import{b as X}from"./router-BKiMcYa7.js";import{l as D,i as C,s as Y}from"./sessionRead-CvFz2RHv.js";import{u as Z}from"./use-conversation-list-A_YUf8lo.js";import{u as ee}from"./Provider-5Hotn7NQ.js";import{i as se}from"./agent-state-DDhnFEEP.js";import{A as te}from"./AgentAvatar-BIwg54Tj.js";/* empty css */function ae({children:n,count:t,tone:a="default",title:l,onClick:i}){const d=["collapsed-strip-label",a!=="default"&&`collapsed-strip-label--${a}`,t!=null&&"collapsed-strip-label--has-count",i&&"collapsed-strip-label--button"].filter(Boolean).join(" "),o=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"collapsed-strip-label-mark","aria-hidden":!0}),i?e.jsx("span",{className:"collapsed-strip-label-expand","aria-hidden":!0,children:"›"}):null,e.jsx("span",{className:"collapsed-strip-label-text",children:n}),t!=null?e.jsx("span",{className:"collapsed-strip-label-count",children:t}):null]});return i?e.jsx("button",{type:"button",className:d,title:l??n,"aria-label":l??n,onClick:i,children:o}):e.jsx("div",{className:d,title:l??n,children:o})}function ne({label:n,emptyMark:t="·",showLabel:a=!0,labelTone:l="default",labelCount:i,onLabelClick:d,children:o}){const v=!o||Array.isArray(o)&&o.length===0,p=a?e.jsx(ae,{tone:l,count:i,onClick:d,title:d?`Expand ${n}`:void 0,children:n}):null;return v?e.jsxs("div",{className:"collapsed-strip collapsed-strip--empty","aria-hidden":!0,children:[p,e.jsx("span",{className:"collapsed-strip-empty-mark",children:t})]}):e.jsxs("div",{className:"collapsed-strip",role:"list","aria-label":n,children:[p,o]})}function Ie(){return e.jsx("div",{className:"collapsed-strip-rule","aria-hidden":!0})}function le({title:n,active:t,tone:a="default",ava:l,avaColor:i,glyph:d,avatarNode:o,dot:v,pinned:p,onClick:b}){const m=["collapsed-chip",a==="channel"&&"collapsed-chip--channel",a==="neutral"&&"collapsed-chip--neutral",a==="attention"&&"collapsed-chip--attention",a==="unread"&&"collapsed-chip--unread",t&&"collapsed-chip--active",p&&"collapsed-chip--pinned"].filter(Boolean).join(" ");return e.jsxs("button",{type:"button",role:"listitem",className:m,title:n,"aria-label":n,"aria-current":t?"page":void 0,onClick:b,children:[o?e.jsx("span",{className:"collapsed-chip-avatar-wrap",children:o}):l?e.jsx("span",{className:"collapsed-chip-ava",style:i?{"--ava-color":i}:void 0,children:l}):e.jsx("span",{className:`collapsed-chip-glyph${typeof d=="string"&&d.length>1?" collapsed-chip-glyph--long":""}`,children:d}),v?e.jsx("span",{className:["collapsed-chip-dot",v==="attention"&&"collapsed-chip-dot--attention",v==="live"&&"collapsed-chip-dot--live"].filter(Boolean).join(" "),"aria-hidden":!0}):null,p?e.jsx("span",{className:"collapsed-chip-pin","aria-hidden":!0}):null]})}function we(n){const t=n.trim(),a=t.split(/[\s/_-]+/).filter(Boolean);if(a.length>=2){const l=a[a.length-1];return/^\d+$/.test(l)&&a.length>=3?(a[a.length-2][0]??"?").toUpperCase():(l[0]??"?").toUpperCase()}return(t[0]??"?").toUpperCase()}const ie=3,oe=3,re=4,ce=3;function S(n,t){return[...n].sort((a,l)=>{const i=C(a.lastMessageAt,a.id,t)?0:1,d=C(l.lastMessageAt,l.id,t)?0:1;return i!==d?i-d:(l.lastMessageAt??0)-(a.lastMessageAt??0)})}function de({onExpand:n}){const{route:t,navigate:a,agents:l}=ee(),{sessions:i}=Z(),d=K(),[o,v]=j.useState(()=>B()),[p,b]=j.useState(()=>D()),m=X(t),y=j.useMemo(()=>G(l,m),[l,m]),P=j.useMemo(()=>{const s=new Map;for(const f of l)s.set(f.id,f);return s},[l]),R=t.view==="messages"||t.view==="conversation"?t.conversationId:void 0;j.useEffect(()=>{v(B()),b(D())},[]);const r=j.useMemo(()=>{const s=J(i,y,m).filter(c=>!q(c.id,o)),f=s.filter(c=>E(c.id,o)).sort((c,x)=>T(x.id,o)-T(c.id,o)||(x.lastMessageAt??0)-(c.lastMessageAt??0)).slice(0,ie),g=new Set(f.map(c=>c.id)),h=s.filter(c=>!g.has(c.id));return{pinned:f,channels:S(h.filter(w),p).slice(0,oe),dms:S(h.filter(O),p).slice(0,re),observed:S(h.filter($),p).slice(0,ce),totals:{channels:h.filter(w).length,dms:h.filter(O).length,observed:h.filter($).length,pinned:s.filter(c=>E(c.id,o)).length}}},[i,y,m,o,p]),U=s=>{b(Y(s.id)),a({view:"messages",conversationId:s.id,...m?{machineId:m}:{}})},k=[...r.pinned,...r.channels,...r.dms,...r.observed],A=k.filter(s=>C(s.lastMessageAt,s.id,p)).length,M=(s,f=!1)=>{const g=W(s),h=w(s),c=C(s.lastMessageAt,s.id,p),x=h?void 0:he(s,g),V=x??g,I=s.agentId?P.get(s.agentId):void 0,L=Q(d,s),_=L?.status==="needs_attention",z=L?.status==="working",F=I?se(I.state):!1,H=_?"attention":c?"unread":z||F?"live":null;return e.jsx(le,{title:f?`${g} · pinned`:x?`${g} · ${x}`:g,active:s.id===R,tone:h?"channel":_?"attention":c?"unread":"default",avatarNode:h?void 0:e.jsx(te,{agent:I,name:V,size:28,tile:!0,presence:!1}),glyph:h?pe(g):void 0,dot:H,pinned:f,onClick:()=>U(s)},s.id)},u=[];return r.pinned.length&&u.push(e.jsx(N,{mark:"Pin",count:r.totals.pinned,showMark:u.length>0,children:r.pinned.map(s=>M(s,!0))},"pin")),r.channels.length&&u.push(e.jsx(N,{mark:"#",count:r.totals.channels,showMark:u.length>0,children:r.channels.map(s=>M(s))},"ch")),r.dms.length&&u.push(e.jsx(N,{mark:"DM",count:r.totals.dms,showMark:u.length>0,children:r.dms.map(s=>M(s))},"dm")),r.observed.length&&u.push(e.jsx(N,{mark:"Obs",count:r.totals.observed,showMark:u.length>0,children:r.observed.map(s=>M(s))},"obs")),e.jsx(ne,{label:"Chat",emptyMark:"#",labelTone:A>0?"accent":"default",labelCount:A>0?A:k.length||void 0,onLabelClick:n,children:u})}function pe(n){const a=n.replace(/^#+/,"").match(/[a-z0-9]/i)?.[0]?.toLowerCase()??"?";return e.jsxs("span",{className:"collapsed-chip-channel-badge",children:[e.jsx("span",{className:"collapsed-chip-channel-hash","aria-hidden":!0,children:"#"}),e.jsx("span",{className:"collapsed-chip-channel-text",children:a})]})}function he(n,t){const a=t.toLowerCase();for(const l of n.participants??[]){const i=l.displayName||l.label;if(i&&i.toLowerCase()!==a)return i}}function N({mark:n,count:t,showMark:a=!0,children:l}){return e.jsxs("div",{className:"collapsed-strip-section",role:"group","aria-label":n,children:[a?e.jsxs("div",{className:"collapsed-strip-section-mark",title:t!=null?`${n} · ${t}`:n,children:[e.jsx("span",{className:"collapsed-strip-section-mark-text",children:n}),t!=null&&t>0?e.jsx("span",{className:"collapsed-strip-section-mark-count",children:t>99?"99+":t}):null]}):null,l]})}const Se=Object.freeze(Object.defineProperty({__proto__:null,ChatCollapsedStrip:de},Symbol.toStringTag,{value:"Module"}));export{ne as C,de as a,le as b,we as c,Ie as d,Se as e};
@@ -1 +1 @@
1
- import{r as o,j as a}from"./index-C1VaWNuD.js";import{f as k}from"./cache-CeWH_KzJ.js";import{u as F,f as I,l as N,L as _,D}from"./usePierreRuntime-35AHf9RQ.js";/* empty css */const R=["unstaged","staged","branch"];function L(n){if(!n.startsWith("/"))return null;const t=[];for(const e of n.split("/"))if(!(!e||e==="."))if(e===".."){if(t.length===0)return null;t.pop()}else t.push(e);return t}function A(n,t){const e=L(n),s=L(t);return!e||!s||s.length<=e.length||e.some((c,u)=>s[u]!==c)?null:s.slice(e.length).join("/")}function y(n,t){return n.files.findIndex(e=>e.newPath===t||e.oldPath===t)}function K(n,t){return n.find(e=>y(e,t)>=0)?.kind??null}const M=()=>{},T=()=>{};function O({root:n,file:t}){const e=o.useMemo(()=>A(n,t),[t,n]),[s,c]=o.useState(null),[u,d]=o.useState("loading"),[P,m]=o.useState(null),[S,h]=o.useState(null),{pierre:j,pierrePhase:v,pierreError:C,pierreTheme:b,retryPierre:E}=F(s);o.useEffect(()=>{let r=!1;if(c(null),d("loading"),m(null),h(null),!e){d("ready");return}return k(n,R,{files:[e],tier:"patch"}).then(i=>{r||(c(i.snapshot),h(K(i.snapshot.layers,e)),d("ready"))},i=>{r||(m(i instanceof Error?i.message:String(i)),d("error"))}),()=>{r=!0}},[e,n]);const f=o.useMemo(()=>e?s?.layers.filter(r=>y(r,e)>=0)??[]:[],[e,s]),l=f.find(r=>r.kind===S)??f[0]??null,p=l&&e?y(l,e):-1,g=l&&p>=0?I(l.files[p],p):null;return u==="loading"?a.jsx("div",{className:"s-code-empty",children:"Loading file changes…"}):u==="error"?a.jsx("div",{className:"s-code-empty",children:P??"Couldn’t load this file’s changes."}):!s||!l||!g?a.jsx("div",{className:"s-code-empty",children:"No tracked patch is available. The file is clean, or it is untracked and has no Git baseline yet."}):a.jsxs("div",{className:"s-code-diff",children:[f.length>1?a.jsx("div",{className:"s-code-diffLayers",role:"tablist","aria-label":"Change layer",children:f.map(r=>{const i=N(r),x=r.kind===l.kind;return a.jsxs("button",{type:"button",role:"tab","aria-selected":x,className:"s-code-diffLayer","data-selected":x||void 0,onClick:()=>h(r.kind),children:[_[r.kind],a.jsxs("span",{children:["+",i.add," −",i.del]})]},r.kind)})}):null,a.jsx(D,{layer:l,patchLayer:l,patchPhase:"ready",patchError:null,selectedFileKey:g,renderKey:s.render.renderKey,theme:b,layout:"split",pierre:j,pierrePhase:v,pierreError:C,onRetryPierre:E,onIncludeLineContext:M,onIncludeSelectionContext:T,contextActions:!1})]})}const G=Object.freeze(Object.defineProperty({__proto__:null,CodeDiffPane:O},Symbol.toStringTag,{value:"Module"}));export{O as C,G as a,A as r};
1
+ import{r as o,j as a}from"./index-C8uS5szO.js";import{f as k}from"./cache-DEy9E34b.js";import{u as F,f as I,l as N,L as _,D}from"./usePierreRuntime-DJkRHMoe.js";/* empty css */const R=["unstaged","staged","branch"];function L(n){if(!n.startsWith("/"))return null;const t=[];for(const e of n.split("/"))if(!(!e||e==="."))if(e===".."){if(t.length===0)return null;t.pop()}else t.push(e);return t}function A(n,t){const e=L(n),s=L(t);return!e||!s||s.length<=e.length||e.some((c,u)=>s[u]!==c)?null:s.slice(e.length).join("/")}function y(n,t){return n.files.findIndex(e=>e.newPath===t||e.oldPath===t)}function K(n,t){return n.find(e=>y(e,t)>=0)?.kind??null}const M=()=>{},T=()=>{};function O({root:n,file:t}){const e=o.useMemo(()=>A(n,t),[t,n]),[s,c]=o.useState(null),[u,d]=o.useState("loading"),[P,m]=o.useState(null),[S,h]=o.useState(null),{pierre:j,pierrePhase:v,pierreError:C,pierreTheme:b,retryPierre:E}=F(s);o.useEffect(()=>{let r=!1;if(c(null),d("loading"),m(null),h(null),!e){d("ready");return}return k(n,R,{files:[e],tier:"patch"}).then(i=>{r||(c(i.snapshot),h(K(i.snapshot.layers,e)),d("ready"))},i=>{r||(m(i instanceof Error?i.message:String(i)),d("error"))}),()=>{r=!0}},[e,n]);const f=o.useMemo(()=>e?s?.layers.filter(r=>y(r,e)>=0)??[]:[],[e,s]),l=f.find(r=>r.kind===S)??f[0]??null,p=l&&e?y(l,e):-1,g=l&&p>=0?I(l.files[p],p):null;return u==="loading"?a.jsx("div",{className:"s-code-empty",children:"Loading file changes…"}):u==="error"?a.jsx("div",{className:"s-code-empty",children:P??"Couldn’t load this file’s changes."}):!s||!l||!g?a.jsx("div",{className:"s-code-empty",children:"No tracked patch is available. The file is clean, or it is untracked and has no Git baseline yet."}):a.jsxs("div",{className:"s-code-diff",children:[f.length>1?a.jsx("div",{className:"s-code-diffLayers",role:"tablist","aria-label":"Change layer",children:f.map(r=>{const i=N(r),x=r.kind===l.kind;return a.jsxs("button",{type:"button",role:"tab","aria-selected":x,className:"s-code-diffLayer","data-selected":x||void 0,onClick:()=>h(r.kind),children:[_[r.kind],a.jsxs("span",{children:["+",i.add," −",i.del]})]},r.kind)})}):null,a.jsx(D,{layer:l,patchLayer:l,patchPhase:"ready",patchError:null,selectedFileKey:g,renderKey:s.render.renderKey,theme:b,layout:"split",pierre:j,pierrePhase:v,pierreError:C,onRetryPierre:E,onIncludeLineContext:M,onIncludeSelectionContext:T,contextActions:!1})]})}const G=Object.freeze(Object.defineProperty({__proto__:null,CodeDiffPane:O},Symbol.toStringTag,{value:"Module"}));export{O as C,G as a,A as r};
@@ -1,2 +1,2 @@
1
- import{r as h,j as i}from"./index-C1VaWNuD.js";import{C as ne}from"./chevron-down-D120PY4g.js";import{S as oe}from"./search-FB2vVxCp.js";const se=new Set(["hud","tail","terminal","services","pair","osn-auth","notification","code","file"]);function L(e){const t=e?.trim();return t||void 0}function q(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isSafeInteger(t)&&t>0?t:void 0}function ce(e){return e.split("/").filter(t=>t.length>0).map(encodeURIComponent).join("/")}function R(e){return e.map(t=>{try{return decodeURIComponent(t)}catch{return t}}).join("/")}function ie(e){const t=q(e.get("line")),n=q(e.get("endLine")),r=t&&n&&n>=t?n:void 0;return{...L(e.get("wt"))?{wt:L(e.get("wt"))}:{},...t?{line:t}:{},...r?{endLine:r}:{}}}function G(e){const t=e.trim();if(!t)return null;if(t.startsWith("/")||t.startsWith("~/")){const u=t.replace(/^~/,""),d=t.startsWith("~")?t:u;return{root:d,file:d}}if(!/^scout:/i.test(t))return null;let n;try{n=new URL(t)}catch{return null}if(n.protocol.toLowerCase()!=="scout:")return null;const r=(n.hostname||n.host||"").toLowerCase(),c=n.pathname.split("/").filter(u=>u.length>0),s=ie(n.searchParams);if(!r||r==="file"){const u=c;if(u.length===0)return null;const d=`/${R(u)}`,m=L(n.searchParams.get("root")),j=L(n.searchParams.get("file"));return{root:m??d,file:j??d,...s}}if(r==="code"){if(c.length===0){const m=L(n.searchParams.get("root")),j=L(n.searchParams.get("file")),b=L(n.searchParams.get("project")),y=L(n.searchParams.get("path"));return!m&&!j&&!b?{...s}:{...m?{root:m}:{},...j?{file:j}:{},...b?{project:b}:{},...y?{path:y}:{},...s}}const u=R([c[0]]),d=c.length>1?R(c.slice(1)):void 0;return{project:u,...d?{path:d}:{},...s}}if(se.has(r))return null;const a=decodeURIComponent(r),l=c.length>0?R(c):void 0;return{project:a,...l?{path:l}:{},...s}}function ae(e){const t=new URLSearchParams;e.wt&&t.set("wt",e.wt),e.line&&e.line>0&&t.set("line",String(e.line)),e.line&&e.endLine&&e.endLine>=e.line&&t.set("endLine",String(e.endLine));const n=t.toString(),r=n?`?${n}`:"";if(e.project)return`scout://${e.path?`${encodeURIComponent(e.project)}/${ce(e.path)}`:encodeURIComponent(e.project)}${r}`;const c=e.file??e.root;return c?`scout://${c.startsWith("/")?c:`/${c}`}${r}`:`scout://code${r}`}function le(e,t){const n=e.trim();if(!n)return null;let r=null;for(const c of t)(n===c||n.startsWith(`${c}/`))&&(!r||c.length>r.length)&&(r=c);return r?{root:r,file:n===r?null:n}:null}function ue(e){const t=e.trim();return t?!!(t.startsWith("/")||t.startsWith("~/")||/^scout:/i.test(t)):!1}function B(e){return e.toLowerCase().replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function de(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function fe(e){return e.branch.detached?"detached":e.branch.name??"no branch"}function pe(e){return e.status.clean?"":`${e.status.changedFiles} changed`}function he(e){const t=[];for(const n of e)for(const[r,c]of n.worktrees.entries())t.push({root:c.path,projectId:n.id,projectName:n.name,projectSlug:B(n.name)||B(de(n.name)),worktreeName:c.name,branchLabel:fe(c),dirtyLabel:pe(c),isPrimary:r===0,changedFiles:c.status.changedFiles});return t}function v(e){return e.toLocaleLowerCase().replace(/[\s/_-]+/g," ").trim()}function me(e,t,n=0){const r=v(t);if(!r)return n;const c=r.split(" ").filter(Boolean),s=v(e.projectName),a=v(e.root),l=v(e.branchLabel),u=v(e.worktreeName),d=`${s} ${a} ${l} ${u} ${e.projectSlug}`;if(!c.every(j=>d.includes(j)))return-1;let m=n/100;return s===r||e.projectSlug===r.replace(/\s+/g,"-")?m+=120:s.startsWith(r)||e.projectSlug.startsWith(r.replace(/\s+/g,"-"))?m+=80:s.includes(r)&&(m+=48),(l.startsWith(r)||l.includes(r))&&(m+=34),u.includes(r)&&(m+=24),a.includes(r)&&(m+=20),m+=c.reduce((j,b)=>j+(s.startsWith(b)?12:0),0),m}function ge(e,t,n,r=12){const c=new Map(n.map((a,l)=>[a,n.length-l])),s=e.map(a=>({option:a,score:me(a,t,c.get(a.root)??0)})).filter(a=>a.score>=0);return t.trim()?s.sort((a,l)=>l.score-a.score||a.option.projectName.localeCompare(l.option.projectName)):s.sort((a,l)=>{const u=c.get(a.option.root)??-1,d=c.get(l.option.root)??-1;return u!==d?d-u:a.option.projectName.localeCompare(l.option.projectName)||a.option.branchLabel.localeCompare(l.option.branchLabel)}),s.slice(0,r).map(a=>a.option)}function Y(e){return e.isPrimary?e.projectName:`${e.projectName} · ${e.branchLabel}`}function D(e){return e.dirtyLabel?`${e.branchLabel} · ${e.dirtyLabel}`:e.branchLabel}function O(e){const t=typeof window<"u"?window.__OPEN_SCOUT_HOME:void 0;if(t&&e.startsWith(`${t}/`))return`~/${e.slice(t.length+1)}`;if(e.startsWith("/Users/")){const n=e.slice(7),r=n.indexOf("/");if(r>0)return`~${n.slice(r)}`}if(e.startsWith("/home/")){const n=e.slice(6),r=n.indexOf("/");if(r>0)return`~${n.slice(r)}`}return e}const Q="openscout.code.tree:",_="openscout.code.lastRoot",V="openscout.code.recentRoots",je=8;function Ce(e){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(Q+e);if(!t)return null;const n=JSON.parse(t);return!n||typeof n.entries!="object"||!Array.isArray(n.expanded)?null:n}catch{return null}}function Re(e,t){if(typeof window>"u")return;const n={};for(const r of[e,...t.expanded]){const c=t.entries.get(r);c&&(n[r]=c)}try{window.localStorage.setItem(Q+e,JSON.stringify({entries:n,expanded:[...t.expanded],selectedFile:t.selectedFile,savedAt:Date.now()}))}catch{}}function Oe(){if(typeof window>"u")return null;try{return window.localStorage.getItem(_)}catch{return null}}function M(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(V);if(!e){const n=window.localStorage.getItem(_);return n?[n]:[]}const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"&&n.length>0):[]}catch{return[]}}function Pe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(_,e);const t=M().filter(r=>r!==e),n=[e,...t].slice(0,je);window.localStorage.setItem(V,JSON.stringify(n))}catch{}}const we=6,be=12;function k(e){return e.toLowerCase().replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function W(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function X(e,t,n){const r=G(e);if(!r)return null;if(r.root||r.file){const c=t.map(u=>u.root),s=xe(r.file??r.root,c),a=le(s,c);if(a)return{root:a.root,file:a.file,line:r.line,endLine:r.endLine};const l=W(s).includes(".");return{root:l?Le(s):s,file:l?s:null,line:r.line,endLine:r.endLine}}if(r.project){const c=ke(n,r.project,r.wt??null,t);if(!c)return null;const s=r.path?`${c.root}/${r.path}`:null;return{root:c.root,file:s,project:r.project,path:r.path,wt:r.wt,line:r.line,endLine:r.endLine}}return null}function xe(e,t){if(!e.startsWith("~/")&&e!=="~")return e;for(const n of t){const r=n.match(/^(\/Users\/[^/]+)/)??n.match(/^(\/home\/[^/]+)/);if(r)return`${r[1]}${e.slice(1)}`}return e}function Le(e){const t=e.lastIndexOf("/");return t>0?e.slice(0,t):e}function ke(e,t,n,r){if(e){const a=k(t),l=e.projects.find(u=>k(u.name)===a||k(W(u.root))===a);if(l)return{root:(n?l.worktrees.find(d=>d.name===n||d.branch.name===n||k(d.name)===k(n)):l.worktrees[0])?.path??l.root}}const c=k(t),s=r.find(a=>a.projectSlug===c);return s?{root:s.root}:null}function ye(e){if(e.project)return ae({project:e.project,path:e.path,wt:e.wt,line:e.line,endLine:e.endLine});const t=e.file??e.root;return t?O(t):"Deep link"}function Ne({snapshot:e,root:t,onSelect:n}){const[r,c]=h.useState(!1),[s,a]=h.useState(""),[l,u]=h.useState(0),[d,m]=h.useState(()=>M()),j=h.useRef(null),b=h.useRef(null),y=h.useRef(null),N=h.useId().replaceAll(":",""),P=`code-project-results-${N}`,x=h.useMemo(()=>he(e?.projects??[]),[e]),I=h.useMemo(()=>{const o=new Map;for(const f of x)o.set(f.root,f);return o},[x]),C=t?I.get(t)??null:null;h.useEffect(()=>{m(M())},[t,r]);const U=h.useMemo(()=>{const o=[];for(const f of d){const $=I.get(f);if($&&o.push($),o.length>=we)break}return o},[d,I]),w=ue(s),A=w?G(s):null,p=w?X(s,x,e):null,g=h.useMemo(()=>w?[]:ge(x,s,d,be),[x,s,d,w]),Z=(p?1:0)+g.length,S=h.useMemo(()=>{if(!s.trim()||w)return"";const o=g.find(f=>f.projectName.toLocaleLowerCase().startsWith(s.toLocaleLowerCase()));return o&&o.projectName.length>s.length?o.projectName:""},[s,g,w]);h.useEffect(()=>u(0),[s,r]),h.useEffect(()=>{if(!r)return;const o=window.setTimeout(()=>b.current?.focus(),20);return()=>window.clearTimeout(o)},[r]),h.useEffect(()=>{if(!r)return;function o(f){j.current?.contains(f.target)||(c(!1),a(""))}return document.addEventListener("pointerdown",o),()=>document.removeEventListener("pointerdown",o)},[r]);const E=()=>{a(""),c(!1),window.setTimeout(()=>y.current?.focus(),0)},T=o=>{n({root:o}),E()},F=()=>{p&&(n(p),E())},ee=o=>{if(o.key==="ArrowDown")o.preventDefault(),u(f=>Math.min(f+1,Math.max(Z-1,0)));else if(o.key==="ArrowUp")o.preventDefault(),u(f=>Math.max(f-1,0));else if(o.key==="Enter"){if(o.preventDefault(),p&&(l===0||g.length===0)){F();return}const f=p?l-1:l;g[f]&&T(g[f].root)}else o.key==="ArrowRight"&&S&&o.currentTarget.selectionStart===s.length?(o.preventDefault(),a(S)):o.key==="Escape"&&(o.preventDefault(),E())},te=C?Y(C):t?O(t):"Pick a project…",z=C?D(C):null,H=!!p&&l===0,re=p&&l===0?`${N}-deeplink`:g[p?l-1:l]?`${N}-opt-${g[p?l-1:l].root}`:void 0;return i.jsxs("div",{className:"s-code-picker",ref:j,children:[i.jsxs("button",{ref:y,type:"button",className:"s-code-pickerTrigger","aria-haspopup":"listbox","aria-expanded":r,"aria-controls":r?P:void 0,"aria-label":"Project or worktree",onClick:()=>c(o=>!o),children:[i.jsx("span",{className:"s-code-pickerTriggerName",children:te}),z?i.jsx("span",{className:"s-code-pickerTriggerDetail",children:z}):null,i.jsx(ne,{size:13,"aria-hidden":!0,className:"s-code-pickerChevron","data-open":r||void 0})]}),r?i.jsxs("div",{className:"s-code-pickerPanel",role:"dialog","aria-label":"Choose a project",children:[U.length>0&&!w?i.jsx("div",{className:"s-code-pickerRecents","aria-label":"Recent projects",children:U.map(o=>i.jsx("button",{type:"button",className:"s-code-pickerChip","data-active":o.root===t||void 0,title:`${o.projectName} · ${D(o)}
1
+ import{r as h,j as i}from"./index-C8uS5szO.js";import{C as ne}from"./chevron-down-B5eMsn5c.js";import{S as oe}from"./search-C4VlW_0l.js";const se=new Set(["hud","tail","terminal","services","pair","osn-auth","notification","code","file"]);function L(e){const t=e?.trim();return t||void 0}function q(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isSafeInteger(t)&&t>0?t:void 0}function ce(e){return e.split("/").filter(t=>t.length>0).map(encodeURIComponent).join("/")}function R(e){return e.map(t=>{try{return decodeURIComponent(t)}catch{return t}}).join("/")}function ie(e){const t=q(e.get("line")),n=q(e.get("endLine")),r=t&&n&&n>=t?n:void 0;return{...L(e.get("wt"))?{wt:L(e.get("wt"))}:{},...t?{line:t}:{},...r?{endLine:r}:{}}}function G(e){const t=e.trim();if(!t)return null;if(t.startsWith("/")||t.startsWith("~/")){const u=t.replace(/^~/,""),d=t.startsWith("~")?t:u;return{root:d,file:d}}if(!/^scout:/i.test(t))return null;let n;try{n=new URL(t)}catch{return null}if(n.protocol.toLowerCase()!=="scout:")return null;const r=(n.hostname||n.host||"").toLowerCase(),c=n.pathname.split("/").filter(u=>u.length>0),s=ie(n.searchParams);if(!r||r==="file"){const u=c;if(u.length===0)return null;const d=`/${R(u)}`,m=L(n.searchParams.get("root")),j=L(n.searchParams.get("file"));return{root:m??d,file:j??d,...s}}if(r==="code"){if(c.length===0){const m=L(n.searchParams.get("root")),j=L(n.searchParams.get("file")),b=L(n.searchParams.get("project")),y=L(n.searchParams.get("path"));return!m&&!j&&!b?{...s}:{...m?{root:m}:{},...j?{file:j}:{},...b?{project:b}:{},...y?{path:y}:{},...s}}const u=R([c[0]]),d=c.length>1?R(c.slice(1)):void 0;return{project:u,...d?{path:d}:{},...s}}if(se.has(r))return null;const a=decodeURIComponent(r),l=c.length>0?R(c):void 0;return{project:a,...l?{path:l}:{},...s}}function ae(e){const t=new URLSearchParams;e.wt&&t.set("wt",e.wt),e.line&&e.line>0&&t.set("line",String(e.line)),e.line&&e.endLine&&e.endLine>=e.line&&t.set("endLine",String(e.endLine));const n=t.toString(),r=n?`?${n}`:"";if(e.project)return`scout://${e.path?`${encodeURIComponent(e.project)}/${ce(e.path)}`:encodeURIComponent(e.project)}${r}`;const c=e.file??e.root;return c?`scout://${c.startsWith("/")?c:`/${c}`}${r}`:`scout://code${r}`}function le(e,t){const n=e.trim();if(!n)return null;let r=null;for(const c of t)(n===c||n.startsWith(`${c}/`))&&(!r||c.length>r.length)&&(r=c);return r?{root:r,file:n===r?null:n}:null}function ue(e){const t=e.trim();return t?!!(t.startsWith("/")||t.startsWith("~/")||/^scout:/i.test(t)):!1}function B(e){return e.toLowerCase().replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function de(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function fe(e){return e.branch.detached?"detached":e.branch.name??"no branch"}function pe(e){return e.status.clean?"":`${e.status.changedFiles} changed`}function he(e){const t=[];for(const n of e)for(const[r,c]of n.worktrees.entries())t.push({root:c.path,projectId:n.id,projectName:n.name,projectSlug:B(n.name)||B(de(n.name)),worktreeName:c.name,branchLabel:fe(c),dirtyLabel:pe(c),isPrimary:r===0,changedFiles:c.status.changedFiles});return t}function v(e){return e.toLocaleLowerCase().replace(/[\s/_-]+/g," ").trim()}function me(e,t,n=0){const r=v(t);if(!r)return n;const c=r.split(" ").filter(Boolean),s=v(e.projectName),a=v(e.root),l=v(e.branchLabel),u=v(e.worktreeName),d=`${s} ${a} ${l} ${u} ${e.projectSlug}`;if(!c.every(j=>d.includes(j)))return-1;let m=n/100;return s===r||e.projectSlug===r.replace(/\s+/g,"-")?m+=120:s.startsWith(r)||e.projectSlug.startsWith(r.replace(/\s+/g,"-"))?m+=80:s.includes(r)&&(m+=48),(l.startsWith(r)||l.includes(r))&&(m+=34),u.includes(r)&&(m+=24),a.includes(r)&&(m+=20),m+=c.reduce((j,b)=>j+(s.startsWith(b)?12:0),0),m}function ge(e,t,n,r=12){const c=new Map(n.map((a,l)=>[a,n.length-l])),s=e.map(a=>({option:a,score:me(a,t,c.get(a.root)??0)})).filter(a=>a.score>=0);return t.trim()?s.sort((a,l)=>l.score-a.score||a.option.projectName.localeCompare(l.option.projectName)):s.sort((a,l)=>{const u=c.get(a.option.root)??-1,d=c.get(l.option.root)??-1;return u!==d?d-u:a.option.projectName.localeCompare(l.option.projectName)||a.option.branchLabel.localeCompare(l.option.branchLabel)}),s.slice(0,r).map(a=>a.option)}function Y(e){return e.isPrimary?e.projectName:`${e.projectName} · ${e.branchLabel}`}function D(e){return e.dirtyLabel?`${e.branchLabel} · ${e.dirtyLabel}`:e.branchLabel}function O(e){const t=typeof window<"u"?window.__OPEN_SCOUT_HOME:void 0;if(t&&e.startsWith(`${t}/`))return`~/${e.slice(t.length+1)}`;if(e.startsWith("/Users/")){const n=e.slice(7),r=n.indexOf("/");if(r>0)return`~${n.slice(r)}`}if(e.startsWith("/home/")){const n=e.slice(6),r=n.indexOf("/");if(r>0)return`~${n.slice(r)}`}return e}const Q="openscout.code.tree:",_="openscout.code.lastRoot",V="openscout.code.recentRoots",je=8;function Ce(e){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(Q+e);if(!t)return null;const n=JSON.parse(t);return!n||typeof n.entries!="object"||!Array.isArray(n.expanded)?null:n}catch{return null}}function Re(e,t){if(typeof window>"u")return;const n={};for(const r of[e,...t.expanded]){const c=t.entries.get(r);c&&(n[r]=c)}try{window.localStorage.setItem(Q+e,JSON.stringify({entries:n,expanded:[...t.expanded],selectedFile:t.selectedFile,savedAt:Date.now()}))}catch{}}function Oe(){if(typeof window>"u")return null;try{return window.localStorage.getItem(_)}catch{return null}}function M(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(V);if(!e){const n=window.localStorage.getItem(_);return n?[n]:[]}const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"&&n.length>0):[]}catch{return[]}}function Pe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(_,e);const t=M().filter(r=>r!==e),n=[e,...t].slice(0,je);window.localStorage.setItem(V,JSON.stringify(n))}catch{}}const we=6,be=12;function k(e){return e.toLowerCase().replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function W(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function X(e,t,n){const r=G(e);if(!r)return null;if(r.root||r.file){const c=t.map(u=>u.root),s=xe(r.file??r.root,c),a=le(s,c);if(a)return{root:a.root,file:a.file,line:r.line,endLine:r.endLine};const l=W(s).includes(".");return{root:l?Le(s):s,file:l?s:null,line:r.line,endLine:r.endLine}}if(r.project){const c=ke(n,r.project,r.wt??null,t);if(!c)return null;const s=r.path?`${c.root}/${r.path}`:null;return{root:c.root,file:s,project:r.project,path:r.path,wt:r.wt,line:r.line,endLine:r.endLine}}return null}function xe(e,t){if(!e.startsWith("~/")&&e!=="~")return e;for(const n of t){const r=n.match(/^(\/Users\/[^/]+)/)??n.match(/^(\/home\/[^/]+)/);if(r)return`${r[1]}${e.slice(1)}`}return e}function Le(e){const t=e.lastIndexOf("/");return t>0?e.slice(0,t):e}function ke(e,t,n,r){if(e){const a=k(t),l=e.projects.find(u=>k(u.name)===a||k(W(u.root))===a);if(l)return{root:(n?l.worktrees.find(d=>d.name===n||d.branch.name===n||k(d.name)===k(n)):l.worktrees[0])?.path??l.root}}const c=k(t),s=r.find(a=>a.projectSlug===c);return s?{root:s.root}:null}function ye(e){if(e.project)return ae({project:e.project,path:e.path,wt:e.wt,line:e.line,endLine:e.endLine});const t=e.file??e.root;return t?O(t):"Deep link"}function Ne({snapshot:e,root:t,onSelect:n}){const[r,c]=h.useState(!1),[s,a]=h.useState(""),[l,u]=h.useState(0),[d,m]=h.useState(()=>M()),j=h.useRef(null),b=h.useRef(null),y=h.useRef(null),N=h.useId().replaceAll(":",""),P=`code-project-results-${N}`,x=h.useMemo(()=>he(e?.projects??[]),[e]),I=h.useMemo(()=>{const o=new Map;for(const f of x)o.set(f.root,f);return o},[x]),C=t?I.get(t)??null:null;h.useEffect(()=>{m(M())},[t,r]);const U=h.useMemo(()=>{const o=[];for(const f of d){const $=I.get(f);if($&&o.push($),o.length>=we)break}return o},[d,I]),w=ue(s),A=w?G(s):null,p=w?X(s,x,e):null,g=h.useMemo(()=>w?[]:ge(x,s,d,be),[x,s,d,w]),Z=(p?1:0)+g.length,S=h.useMemo(()=>{if(!s.trim()||w)return"";const o=g.find(f=>f.projectName.toLocaleLowerCase().startsWith(s.toLocaleLowerCase()));return o&&o.projectName.length>s.length?o.projectName:""},[s,g,w]);h.useEffect(()=>u(0),[s,r]),h.useEffect(()=>{if(!r)return;const o=window.setTimeout(()=>b.current?.focus(),20);return()=>window.clearTimeout(o)},[r]),h.useEffect(()=>{if(!r)return;function o(f){j.current?.contains(f.target)||(c(!1),a(""))}return document.addEventListener("pointerdown",o),()=>document.removeEventListener("pointerdown",o)},[r]);const E=()=>{a(""),c(!1),window.setTimeout(()=>y.current?.focus(),0)},T=o=>{n({root:o}),E()},F=()=>{p&&(n(p),E())},ee=o=>{if(o.key==="ArrowDown")o.preventDefault(),u(f=>Math.min(f+1,Math.max(Z-1,0)));else if(o.key==="ArrowUp")o.preventDefault(),u(f=>Math.max(f-1,0));else if(o.key==="Enter"){if(o.preventDefault(),p&&(l===0||g.length===0)){F();return}const f=p?l-1:l;g[f]&&T(g[f].root)}else o.key==="ArrowRight"&&S&&o.currentTarget.selectionStart===s.length?(o.preventDefault(),a(S)):o.key==="Escape"&&(o.preventDefault(),E())},te=C?Y(C):t?O(t):"Pick a project…",z=C?D(C):null,H=!!p&&l===0,re=p&&l===0?`${N}-deeplink`:g[p?l-1:l]?`${N}-opt-${g[p?l-1:l].root}`:void 0;return i.jsxs("div",{className:"s-code-picker",ref:j,children:[i.jsxs("button",{ref:y,type:"button",className:"s-code-pickerTrigger","aria-haspopup":"listbox","aria-expanded":r,"aria-controls":r?P:void 0,"aria-label":"Project or worktree",onClick:()=>c(o=>!o),children:[i.jsx("span",{className:"s-code-pickerTriggerName",children:te}),z?i.jsx("span",{className:"s-code-pickerTriggerDetail",children:z}):null,i.jsx(ne,{size:13,"aria-hidden":!0,className:"s-code-pickerChevron","data-open":r||void 0})]}),r?i.jsxs("div",{className:"s-code-pickerPanel",role:"dialog","aria-label":"Choose a project",children:[U.length>0&&!w?i.jsx("div",{className:"s-code-pickerRecents","aria-label":"Recent projects",children:U.map(o=>i.jsx("button",{type:"button",className:"s-code-pickerChip","data-active":o.root===t||void 0,title:`${o.projectName} · ${D(o)}
2
2
  ${o.root}`,onClick:()=>T(o.root),children:Y(o)},o.root))}):null,i.jsxs("div",{className:"s-code-pickerSearch",children:[i.jsx(oe,{size:13,"aria-hidden":!0,className:"s-code-pickerSearchIcon"}),i.jsxs("div",{className:"s-code-pickerInputStack",children:[S?i.jsxs("div",{className:"s-code-pickerGhost","aria-hidden":!0,children:[i.jsx("span",{children:s}),S.slice(s.length)]}):null,i.jsx("input",{ref:b,className:"s-code-pickerInput",type:"search",role:"combobox",value:s,onChange:o=>a(o.currentTarget.value),onKeyDown:ee,placeholder:"Project, scout:// path, or branch…","aria-label":"Find a project","aria-autocomplete":"both","aria-expanded":"true","aria-controls":P,"aria-activedescendant":re,autoComplete:"off",spellCheck:!1})]}),S?i.jsx("kbd",{className:"s-code-pickerHint",children:"→"}):null]}),i.jsxs("div",{className:"s-code-pickerHeading",children:[i.jsx("span",{children:w?p?"Deep link":"Unrecognized link":s.trim()?g.length?"Matches":"No matches":"All projects"}),i.jsx("span",{children:w?p?"open with ↵":"no match":s.trim()?`${g.length} shown`:x.length?`${Math.min(g.length,x.length)} of ${x.length}`:e?"No repos yet":"Loading…"})]}),i.jsxs("div",{id:P,className:"s-code-pickerResults",role:"listbox","aria-label":"Projects",children:[p?i.jsxs("button",{id:`${N}-deeplink`,type:"button",role:"option","aria-selected":H,tabIndex:-1,className:"s-code-pickerOption s-code-pickerOption--deep","data-active":H||void 0,onMouseEnter:()=>u(0),onClick:F,children:[i.jsx("span",{className:"s-code-pickerOptionMain",children:i.jsx("strong",{children:"Open deep link"})}),i.jsx("span",{className:"s-code-pickerOptionPath",title:s.trim(),children:A?ye(A):s.trim()}),i.jsxs("span",{className:"s-code-pickerOptionMeta",children:[O(p.root),p.file?` · ${W(p.file)}`:""]})]}):null,g.map((o,f)=>{const $=p?f+1:f,J=$===l,K=o.root===t;return i.jsxs("button",{id:`${N}-opt-${o.root}`,type:"button",role:"option","aria-selected":J,"aria-current":K||void 0,tabIndex:-1,className:"s-code-pickerOption","data-active":J||void 0,"data-selected":K||void 0,onMouseEnter:()=>u($),onClick:()=>T(o.root),children:[i.jsxs("span",{className:"s-code-pickerOptionMain",children:[i.jsx("strong",{children:o.projectName}),o.isPrimary?null:i.jsx("span",{className:"s-code-pickerWorktree",children:"worktree"})]}),i.jsx("span",{className:"s-code-pickerOptionPath",title:o.root,children:O(o.root)}),i.jsx("span",{className:"s-code-pickerOptionMeta",children:D(o)})]},o.root)})]}),g.length===0&&s.trim()&&!p?i.jsx("div",{className:"s-code-pickerEmpty",role:"status",children:w?"Could not resolve that scout:// link. Try a project slug or absolute path.":`No project matches “${s}”. Try a folder name, branch, path, or scout:// link.`}):null,i.jsxs("div",{className:"s-code-pickerGuide",children:[i.jsxs("span",{children:[i.jsx("kbd",{children:"↑"}),i.jsx("kbd",{children:"↓"})," move"]}),i.jsxs("span",{children:[i.jsx("kbd",{children:"↵"})," open"]}),i.jsxs("span",{children:[i.jsx("kbd",{children:"esc"})," close"]})]})]}):null]})}const Ie=Object.freeze(Object.defineProperty({__proto__:null,CodeProjectPicker:Ne,resolvePickerDeepLink:X},Symbol.toStringTag,{value:"Module"}));export{Ne as C,Ce as a,Pe as b,Ie as c,ae as f,Oe as r,O as s,Re as w};
@@ -0,0 +1 @@
1
+ import{r as s,j as r}from"./index-C8uS5szO.js";import{a as V}from"./api-CaROe5_H.js";import{c as je}from"./clipboard-e3fSpeo7.js";import{f as ze}from"./scoutbot-Bk3nyrkj.js";import{g as Ae,f as Ce}from"./api-B9_IqFKY.js";import{d as Ke}from"./types-B0PlfpKc.js";import{u as Oe}from"./useEmbedHeadline-BL8wQawZ.js";import{r as He,C as qe}from"./CodeDiffPane-DB6-mqtX.js";import{r as Ge,a as Ve,w as Xe,b as Je,f as xe,C as Qe,s as Ye}from"./CodeProjectPicker-B_LNLpIK.js";import{ShikiPane as Ze}from"./ShikiPane-BudrOxNK.js";/* empty css */import{A as et}from"./arrow-left-PuKdO3NM.js";import{C as tt}from"./chevron-right-C7UGFpkl.js";import{C as nt}from"./check-B8dMv3Is.js";import{C as st}from"./copy-D9WUpQRf.js";import"./cache-DEy9E34b.js";import"./usePierreRuntime-DJkRHMoe.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";/* empty css */import"./chevron-down-B5eMsn5c.js";import"./createLucideIcon-DkjnzvcJ.js";import"./search-C4VlW_0l.js";const rt=new Set(["node_modules",".git","dist",".next",".build","DerivedData","__pycache__",".venv","target"]);function we(i){const l=i.lastIndexOf("/");return l>0?i.slice(0,l):"/"}function ce(i){const l=i.lastIndexOf("/");return l>=0?i.slice(l+1):i}function X(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function S(i){return i.toLowerCase().replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function it(i,l,k){const g=S(l),f=i.projects.find(u=>S(u.name)===g||S(ce(u.root))===g);if(!f)return null;const x=k?f.worktrees.find(u=>u.name===k||u.branch.name===k||S(u.name)===S(k)):f.worktrees[0];return{projectName:f.name,root:x?.path??f.root}}function ye(i,l){if(!l.startsWith(`${i}/`))return[];const k=l.slice(i.length+1).split("/"),g=[];let f=i;for(const x of k.slice(0,-1))f=`${f}/${x}`,g.push(f);return g}function ot(i){switch(i){case"untracked":return"U";case"conflicted":return"C";case"staged":return"S";case"unstaged":return"M";case"staged+unstaged":return"SM";default:return i.charAt(0).toUpperCase()}}function be(i,l,k,g,f){const x=k.get(i);if(!x){f.push({path:`${i}#loading`,name:"Loading…",kind:"file",depth:l,loading:!0});return}for(const u of x)u.kind==="directory"&&rt.has(u.name)||(f.push({path:u.path,name:u.name,kind:u.kind,depth:l}),u.kind==="directory"&&g.has(u.path)&&be(u.path,l+1,k,g,f))}function Et({route:i,navigate:l,root:k,file:g,project:f,path:x,wt:u,line:Le,endLine:Ne,returnConversationId:Re,embedded:I=!1}){Oe("Code",I);const B=k??i?.root??null,P=g??i?.file??null,p=f??i?.project??null,b=x??i?.path??null,U=u??i?.wt??null,j=Le??i?.line,w=Ne??i?.endLine,C=Re??i?.returnConversationId??null,[h,le]=s.useState(()=>Ae()),[o,J]=s.useState(()=>B??(p?null:Ge())),[y,Q]=s.useState(()=>new Map),[L,W]=s.useState(()=>new Set),[de,ue]=s.useState(null),[a,_]=s.useState(P),[c,z]=s.useState(null),[Ee,Y]=s.useState(!1),[fe,A]=s.useState(null),[pe,Z]=s.useState("idle"),[M,ee]=s.useState("source"),[m,te]=s.useState(()=>j&&j>0?{line:j,...w&&w>=j?{endLine:w}:{}}:null),[N,K]=s.useState(()=>p?{phase:"resolving"}:{phase:"idle"}),ne=p?`${p}\0${b??""}\0${U??""}`:null,R=s.useRef(null),se=s.useRef(null),T=s.useRef(ne);T.current!==ne&&(T.current=ne,R.current=null,se.current=null),s.useEffect(()=>{te(j&&j>0?{line:j,...w&&w>=j?{endLine:w}:{}}:null)},[w,j]),s.useEffect(()=>{if(h)return;let e=!1;return Ce("quick",!1,2e4).then(t=>{e||le(t)}).catch(()=>{}),()=>{e=!0}},[h]);const E=s.useCallback(async e=>{try{const t=await V(`/api/file/preview?path=${encodeURIComponent(e)}`);if(t.kind!=="directory")return;const n=t.entries.map(d=>({name:d.name,path:d.path,kind:d.kind}));Q(d=>new Map(d).set(e,n))}catch(t){ue(t instanceof Error?t.message:String(t))}},[]),$=s.useCallback((e,t)=>{if(!t)return;const n=ye(e,t);if(n.length!==0){W(d=>new Set([...d,...n]));for(const d of n)E(d)}},[E]);s.useEffect(()=>{if(!p)return;const e=`${p}\0${b??""}\0${U??""}`;if(R.current===e)return;const t=n=>{R.current=e;const d=b?`${n}/${b}`:null;K({phase:"idle"}),J(n),_(d),$(n,d)};if(h){const n=it(h,p,U);if(n){t(n.root);return}}se.current!==e&&(K({phase:"resolving"}),V(`/api/code/resolve-project?slug=${encodeURIComponent(p)}`).then(n=>{R.current===e||T.current!==e||t(n.root)}).catch(n=>{if(R.current===e||T.current!==e)return;se.current=e;const d=n instanceof Error?n.message:String(n);K({phase:"failed",message:d.includes(p)?d:`Can't resolve project "${p}": ${d}`})}))},[p,b,U,h,$]),s.useEffect(()=>{if(o||p||!h)return;const e=h.projects[0];e&&J(e.worktrees[0]?.path??e.root)},[o,p,h]);const he=s.useRef(a);he.current=a,s.useEffect(()=>{if(!o)return;ue(null);const e=Ve(o),t=he.current,n=t?ye(o,t):[];e?(Q(new Map(Object.entries(e.entries))),W(new Set([...e.expanded,...n])),!t&&e.selectedFile&&_(e.selectedFile)):(Q(new Map),W(new Set(n)));const d=new Set([o,...e?.expanded??[],...n]);for(const ae of d)E(ae);Ce("quick",!1,2e4).then(le).catch(()=>{})},[o,E]),s.useEffect(()=>{!o||y.size===0||(Xe(o,{entries:y,expanded:L,selectedFile:a}),Je(o))},[o,y,L,a]),s.useEffect(()=>{!B||!P||$(B,P)},[B,P,$]);const re=s.useRef(new Map),ie=s.useRef(new Set),$e=3e4,O=s.useCallback(e=>{const t=re.current.get(e);return t?Date.now()-t.at>$e?(re.current.delete(e),null):t.preview:null},[]),H=s.useCallback((e,t)=>{const n=re.current;if(n.set(e,{at:Date.now(),preview:t}),n.size>80){const d=n.keys().next().value;d&&n.delete(d)}},[]),Fe=s.useCallback(e=>{O(e)||ie.current.has(e)||(ie.current.add(e),V(`/api/file/preview?path=${encodeURIComponent(e)}`).then(t=>H(e,t)).catch(()=>{}).finally(()=>ie.current.delete(e)))},[O,H]);s.useEffect(()=>{if(Z("idle"),!a){z(null),A(null);return}const e=O(a);if(e){z(e.kind==="file"?e:null),A(null),Y(!1);return}let t=!1;return Y(!0),A(null),V(`/api/file/preview?path=${encodeURIComponent(a)}`).then(n=>{t||(H(a,n),z(n.kind==="file"?n:null))}).catch(n=>{t||(z(null),A(n instanceof Error?n.message:String(n)))}).finally(()=>{t||Y(!1)}),()=>{t=!0}},[a,O,H]);const Me=s.useMemo(()=>{if(!o)return[];const e=[];return be(o,0,y,L,e),e},[o,y,L]),me=s.useCallback((e,t)=>{const n=C?{returnConversationId:C}:{};if(h){for(const d of h.projects)for(const[ae,ge]of d.worktrees.entries())if(ge.path===e){const ve=t&&t.startsWith(`${e}/`)?t.slice(e.length+1):void 0;return{view:"code",project:S(d.name),...ve?{path:ve}:{},...ae>0?{wt:ge.name}:{},...n}}}return{view:"code",root:e,...t?{file:t}:{},...n}},[C,h]),oe=s.useCallback(()=>{if(!C)return;const e={view:"conversation",conversationId:C};ze({type:"navigate",route:e})||l?.(e)},[l,C]);s.useEffect(()=>{if(!C)return;const e=t=>{if(!t.defaultPrevented&&!(!t.metaKey||t.key!=="[")){if(t.target instanceof HTMLElement){const n=t.target.tagName;if(n==="INPUT"||n==="TEXTAREA"||t.target.isContentEditable)return}t.preventDefault(),oe()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[C,oe]);const q=s.useCallback((e,t)=>{I||!l||l(me(e,t))},[I,l,me]),Te=s.useCallback(e=>{W(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),y.has(e)||E(e)},[y,E]),De=s.useCallback(e=>{te(null),_(e),o&&q(o,e)},[o,q]),v=s.useMemo(()=>{if(!h||!o)return null;for(const e of h.projects)for(const t of e.worktrees)if(t.path===o)return{project:e,worktree:t};return null},[h,o]),F=s.useMemo(()=>{const e=new Map;if(!o||!v)return e;for(const t of v.worktree.status.files)e.set(`${o}/${t.path}`,t.status);return e},[o,v]),Ie=s.useMemo(()=>{const e=new Set;if(!o)return e;for(const t of F.keys()){let n=we(t);for(;n.startsWith(o)&&(e.add(n),n!==o);)n=we(n)}return e},[o,F]),G=!!(o&&a&&He(o,a));s.useEffect(()=>{G||ee("source")},[G]);const Be=a&&o&&a.startsWith(`${o}/`)?a.slice(o.length+1):c?.kind==="file"?c.title:a?ce(a):null,Pe=s.useCallback(async()=>{if(!c||c.kind!=="file"||!c.previewable)return;await je(c.content)&&(Z("copied"),window.setTimeout(()=>Z("idle"),1500))},[c]),[Ue,ke]=s.useState("idle"),D=s.useMemo(()=>{if(!o)return null;if(v){const e=a&&a.startsWith(`${o}/`)?a.slice(o.length+1):void 0,t=v.project.worktrees[0]?.path;return xe({project:S(v.project.name),...e?{path:e}:{},...t&&t!==o?{wt:v.worktree.name}:{},...m?.line?{line:m.line}:{},...m?.endLine?{endLine:m.endLine}:{}})}return xe({...a?{file:a}:{root:o},...m?.line?{line:m.line}:{},...m?.endLine?{endLine:m.endLine}:{}})},[o,a,v,m]),We=s.useCallback(async()=>{if(!D)return;await je(D)&&(ke("copied"),window.setTimeout(()=>ke("idle"),1500))},[D]),_e=s.useCallback(e=>{R.current=T.current,K({phase:"idle"}),te(e.line&&e.line>0?{line:e.line,...e.endLine&&e.endLine>=e.line?{endLine:e.endLine}:{}}:null),_(e.file??null),J(e.root),e.file&&$(e.root,e.file),q(e.root,e.file??null)},[$,q]);return r.jsxs("div",{className:"s-code-screen","data-embedded":I||void 0,children:[r.jsxs("div",{className:"s-code-head",children:[C?r.jsxs("button",{type:"button",className:"s-code-returnThread",onClick:oe,title:"Back to thread (⌘[)",children:[r.jsx(et,{size:13,strokeWidth:1.9,"aria-hidden":!0}),r.jsx("span",{children:"Back to thread"})]}):null,r.jsx(Qe,{snapshot:h,root:o,onSelect:_e}),v?.worktree.diff.branchShortstat?r.jsx("span",{className:"s-code-headStat",children:v.worktree.diff.branchShortstat}):null,o?r.jsx("span",{className:"s-code-headPath",title:o,children:Ye(o)}):null,D?r.jsx("button",{type:"button",className:"s-code-copyLink",title:D,onClick:()=>{We()},children:Ue==="copied"?"Copied scout://":"Copy scout://"}):null]}),r.jsxs("div",{className:"s-code-body",children:[r.jsx("div",{className:"s-code-tree",role:"tree","aria-label":"Files",children:de?r.jsx("div",{className:"s-code-treeNote",children:de}):o?Me.map(e=>e.loading?r.jsx("div",{className:"s-code-node s-code-node--loading",style:{paddingLeft:10+e.depth*14},children:e.name},e.path):r.jsxs("button",{type:"button",role:"treeitem",className:"s-code-node","data-selected":e.path===a||void 0,"data-diff":e.kind==="file"?F.get(e.path):void 0,"aria-expanded":e.kind==="directory"?L.has(e.path):void 0,style:{paddingLeft:10+e.depth*14},onClick:()=>e.kind==="directory"?Te(e.path):De(e.path),onMouseEnter:e.kind==="file"?()=>Fe(e.path):void 0,children:[e.kind==="directory"?r.jsx(tt,{size:11,strokeWidth:2,className:"s-code-nodeChevron","data-open":L.has(e.path)||void 0,"aria-hidden":!0}):r.jsx("span",{className:"s-code-nodeSpacer","aria-hidden":!0}),r.jsx("span",{className:"s-code-nodeName",children:e.name}),e.kind==="file"&&F.has(e.path)?r.jsx("span",{className:"s-code-nodeBadge","data-diff":F.get(e.path),children:ot(F.get(e.path)??"")}):null,e.kind==="directory"&&Ie.has(e.path)?r.jsx("span",{className:"s-code-nodeDot","aria-label":"Contains changes"}):null]},e.path)):N.phase==="resolving"?r.jsxs("div",{className:"s-code-treeNote",children:["Resolving “",p,"”…"]}):N.phase==="failed"?r.jsx("div",{className:"s-code-treeNote",children:N.message}):r.jsx("div",{className:"s-code-treeNote",children:"No repo selected."})}),r.jsxs("div",{className:"s-code-main",children:[a?r.jsxs("div",{className:"s-code-fileHead",children:[r.jsx("span",{className:"s-code-filePath",children:Be}),G?r.jsxs("div",{className:"s-code-fileMode",role:"tablist","aria-label":"File view",children:[r.jsx("button",{type:"button",role:"tab","aria-selected":M==="source","data-selected":M==="source"||void 0,onClick:()=>ee("source"),children:"Source"}),r.jsx("button",{type:"button",role:"tab","aria-selected":M==="changes","data-selected":M==="changes"||void 0,onClick:()=>ee("changes"),children:"Changes"})]}):null,c?.kind==="file"?r.jsxs("span",{className:"s-code-fileMeta",children:[X(c.sizeBytes),c.previewable&&c.truncated?" · truncated":"",m?` · L${m.line}${m.endLine?`–${m.endLine}`:""}`:""]}):null,c?.kind==="file"&&c.previewable?r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"s-code-fileAction",onClick:()=>{Pe()},title:"Copy file contents",children:[pe==="copied"?r.jsx(nt,{size:12,"aria-hidden":!0}):r.jsx(st,{size:12,"aria-hidden":!0}),pe==="copied"?"Copied":"Copy"]}),r.jsx("a",{className:"s-code-fileAction",href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"Raw"})]}):null]}):null,M==="changes"&&G&&o&&a?r.jsx(qe,{root:o,file:a},`${o}\0${a}`):Ee?r.jsxs("div",{className:"s-code-empty",children:["Loading ",a?ce(a):"file","…"]}):fe?r.jsx("div",{className:"s-code-empty",children:fe}):c&&c.kind==="file"&&c.previewable?r.jsxs(r.Fragment,{children:[c.truncated?r.jsxs("div",{className:"s-code-fileNote",children:["Showing the first ",X(256*1024)," of ",X(c.sizeBytes)," ·"," ",r.jsx("a",{href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"open raw"})]}):null,r.jsx(Ze,{code:c.content,path:c.path,focusLine:m?.line,endLine:m?.endLine})]}):c&&c.kind==="file"?r.jsxs("div",{className:"s-code-empty",children:[c.previewReason," · ",X(c.sizeBytes)," ·"," ",r.jsx("a",{href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"open raw"})]}):N.phase==="resolving"?r.jsxs("div",{className:"s-code-empty",children:["Opening ",b??`“${p}”`,"…"]}):N.phase==="failed"?r.jsx("div",{className:"s-code-empty",children:N.message}):r.jsx("div",{className:"s-code-empty",children:"Pick a file to read."})]})]})]})}const $t=Ke({id:"code",label:"Code Browser",route:{view:"code"},webPath:"/code",screen:"CodeContent",embed:{path:"/embed/code",profile:"macos.code",rootClassName:"s-code-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:i=>({root:i.get("root")?.trim()||void 0,file:i.get("file")?.trim()||void 0,project:i.get("project")?.trim()||void 0,path:i.get("path")?.trim()||void 0,wt:i.get("wt")?.trim()||void 0,line:Se(i.get("line")),endLine:Se(i.get("endLine")),returnConversationId:i.get("fromConversation")?.trim()||void 0})}});function Se(i){if(!i)return;const l=Number.parseInt(i,10);return Number.isSafeInteger(l)&&l>0?l:void 0}export{Et as CodeContent,$t as scoutSurface};
@@ -0,0 +1 @@
1
+ .cvs{display:flex;flex-direction:column;gap:var(--space-lg)}.cvs-controls{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-sm) var(--space-md)}.cvs-ctl-label{font-family:var(--mono, ui-monospace, SFMono-Regular, monospace);font-size:9px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--dim)}.cvs-seg{display:inline-flex;border:1px solid var(--border);border-radius:var(--radius-xs, 4px);overflow:hidden}.cvs-seg-btn{appearance:none;border:0;background:none;padding:3px 9px;font:inherit;font-size:11.5px;color:var(--dim);cursor:pointer}.cvs-seg-btn+.cvs-seg-btn{border-left:1px solid var(--border)}.cvs-seg-btn:hover{color:var(--ink)}.cvs-seg-btn.is-active{color:var(--ink);background:color-mix(in oklab,var(--ink) 8%,transparent);font-weight:550}.cvs-stage{overflow:auto;height:clamp(320px,52vh,620px);margin:0 calc(-1 * var(--space-sm));padding:0 var(--space-sm) var(--space-sm)}.cvs-svg{display:block}.cvs-lane-label{font-family:var(--mono, ui-monospace, SFMono-Regular, monospace);font-size:9px;font-weight:600;letter-spacing:.08em;fill:var(--dim)}.cvs-lane-count{font-family:var(--mono, ui-monospace, SFMono-Regular, monospace);font-size:10px;fill:var(--muted)}.cvs-edge,.cvs-trunk,.cvs-node{transition:opacity .12s ease}.cvs-edge--dim{opacity:.18}.cvs-edge-line{fill:none;stroke:color-mix(in oklab,var(--ink) 34%,transparent);stroke-linecap:round}.cvs-edge-tip{fill:color-mix(in oklab,var(--ink) 34%,transparent);stroke:none}.cvs-edge-late{fill:none;stroke:var(--red);stroke-dasharray:2 5;stroke-linecap:round;opacity:.85}.cvs-edge-hit{fill:none;stroke:transparent;stroke-width:14;cursor:pointer}.cvs-edge-hit:focus-visible{outline:none;stroke:color-mix(in oklab,var(--accent) 30%,transparent)}.cvs-bracket{fill:none;stroke:color-mix(in oklab,var(--ink) 34%,transparent);stroke-width:1.5}.cvs-trunk-label{font-family:var(--mono, ui-monospace, SFMono-Regular, monospace);font-size:11px;font-weight:600;fill:var(--ink)}.cvs-trunk-sub{font-family:var(--mono, ui-monospace, SFMono-Regular, monospace);font-size:9.5px;fill:var(--dim)}.cvs-node{cursor:pointer}.cvs-node--dim{opacity:.28}.cvs-box{fill:var(--bg);stroke:var(--border);stroke-width:1}.cvs-node--hub .cvs-box{stroke:color-mix(in oklab,var(--ink) 45%,transparent)}.cvs-node--on .cvs-box{stroke:var(--ink);stroke-width:1.5}.cvs-node:hover .cvs-box{stroke:color-mix(in oklab,var(--ink) 45%,transparent)}.cvs-node:focus-visible{outline:none}.cvs-node:focus-visible .cvs-box{stroke:var(--accent);stroke-width:2}.cvs-node--disputed .cvs-box{stroke-dasharray:3 3}.cvs-late-mark{fill:var(--red)}.cvs-name{fill:var(--ink);font-size:12.5px;font-weight:500}.cvs-meta{fill:var(--dim);font-family:var(--mono, ui-monospace, SFMono-Regular, monospace);font-size:9.5px}.cvs-ran{fill:color-mix(in oklab,var(--dim) 72%,transparent)}.cvs-inferred{fill:var(--dim);opacity:.5}.cvs-tasks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:1px}.cvs-task{display:grid;grid-template-columns:1fr auto auto;gap:14px;align-items:baseline;width:100%;padding:5px 8px;border:0;border-radius:4px;background:none;font:inherit;font-size:12px;color:var(--dim);text-align:left;cursor:pointer}.cvs-task:hover{background:color-mix(in oklab,var(--ink) 5%,transparent)}.cvs-task--on{background:color-mix(in oklab,var(--ink) 8%,transparent)}.cvs-task--on .cvs-task-title{color:var(--ink)}.cvs-task-title{color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cvs-task-who{color:var(--dim);white-space:nowrap}.cvs-task-ran{font-style:normal;font-family:var(--mono, ui-monospace, SFMono-Regular, monospace);font-size:11px;color:color-mix(in oklab,var(--dim) 72%,transparent);padding-left:6px}.cvs-task-ms{color:var(--dim);font-variant-numeric:tabular-nums;white-space:nowrap}.cvs-task-ms--late{color:var(--red)}.cvs-arrow{font-style:normal;color:var(--dim);padding:0 6px}.cvs .cf-legend{margin-top:0}.cvs-hint{margin:0 0 0 auto;font-size:11px;color:var(--muted)}
@@ -0,0 +1 @@
1
+ import{r as I,j as a}from"./index-C8uS5szO.js";import{a as Z,h as _,d as q,p as J}from"./comms-gesture-_aGFo6g3.js";import{f as Q}from"./comms-deck-CBhsXnY-.js";const U={nodeW:178,nodeH:42,rowGap:9,laneGap:124,padX:26,padY:46,shelfRows:9,colGap:20};function ee(t,x,p=new Map){const w=new Map,r=new Map;let f=0;const g=new Map,i=n=>{w.has(n.id)||w.set(n.id,n)};for(const n of t){if(i(n.from),n.from.kind==="operator"){const v=g.get(n.from.id)??{own:0,agent:0};n.message.class==="agent"?v.agent+=n.count:v.own+=n.count,g.set(n.from.id,v)}if(n.kind==="channel"){f+=n.count;for(const v of n.audience)i(v);continue}for(const v of n.audience){if(i(v),v.id===n.from.id)continue;const M=`${n.from.id}->${v.id}`,$=r.get(M);$?$.count+=n.count:r.set(M,{from:n.from.id,to:v.id,count:n.count})}}const d=new Set([...g].filter(([,n])=>n.own===0&&n.agent>0).map(([n])=>n)),b=[...g].filter(([n])=>d.has(n)).reduce((n,[,v])=>n+v.agent,0),o=[...w.values()].map(n=>({id:n.id,short:n.short,kind:n.kind,model:p.get(n.id)?.model??null,harness:p.get(n.id)?.harness??null,disputed:d.has(n.id)})),m=Z(t,x).map(n=>({id:n.id,title:n.title,ms:n.ms,abandoned:n.abandoned,waiterId:n.waiter.id,workerId:n.worker.id}));return{actors:o,tasks:m,pairs:[...r.values()],broadcasts:f,misattributed:b}}function se(t,x,p,w){const r=new Set([w]),f=new Map,g=new Map;for(const i of x)(f.get(i.waiterId)??f.set(i.waiterId,[]).get(i.waiterId)).push(i.workerId),(g.get(i.workerId)??g.set(i.workerId,[]).get(i.workerId)).push(i.waiterId);for(const i of[f,g]){const d=[w];for(let b=0;b<d.length;b+=1)for(const o of i.get(d[b])??[])r.has(o)||(r.add(o),d.push(o))}return r.size<2?{actors:[...t],tasks:[...x],pairs:[...p],setAside:0}:{actors:t.filter(i=>r.has(i.id)),tasks:x.filter(i=>r.has(i.waiterId)&&r.has(i.workerId)),pairs:p.filter(i=>r.has(i.from)&&r.has(i.to)),setAside:t.length-r.size}}function te(t,x){const p=new Map,w=new Map,r=new Map(t.map(d=>[d,0]));for(const d of x)d.from!==d.to&&((p.get(d.from)??p.set(d.from,[]).get(d.from)).push(d.to),(w.get(d.to)??w.set(d.to,[]).get(d.to)).push(d.from),r.set(d.to,(r.get(d.to)??0)+1));const f=new Map,g=t.filter(d=>(r.get(d)??0)===0);for(const d of g)f.set(d,0);const i=new Map(r);for(let d=0;d<g.length;d+=1){const b=g[d];for(const o of p.get(b)??[]){f.set(o,Math.max(f.get(o)??0,(f.get(b)??0)+1));const m=(i.get(o)??0)-1;i.set(o,m),m===0&&g.push(o)}}for(const d of t){if(f.has(d))continue;const b=(w.get(d)??[]).map(o=>f.get(o)).filter(o=>o!==void 0);f.set(d,b.length>0?Math.max(...b)+1:0)}return f}function ne(t,x){return x===0?"In this window":t===0?"Opened the work":t===x?"Did the work":"Passed it on"}function ae(t,x,p,w){const r=U,f=new Map(t.map(s=>[s.id,s])),g=new Map,i=s=>{let c=g.get(s);return c||(c={asked:0,did:0,ms:0,abandoned:0,sent:0,received:0},g.set(s,c)),c};for(const s of t)i(s.id);for(const s of x){i(s.waiterId).asked+=1;const c=i(s.workerId);c.did+=1,c.ms=Math.max(c.ms,s.ms),s.abandoned&&(c.abandoned+=1)}for(const s of p)i(s.from).sent+=s.count,i(s.to).received+=s.count;const d=x.map(s=>({from:s.waiterId,to:s.workerId})),b=t.map(s=>s.id),o=te(b,d),m=new Set;for(const s of d)m.add(s.from),m.add(s.to);const n=new Map;for(const s of p)for(const[c,l]of[[s.from,s.to],[s.to,s.from]]){const u=n.get(c);(!u||s.count>u.count)&&n.set(c,{id:l,count:s.count})}for(const s of b){if(m.has(s))continue;const c=n.get(s);o.set(s,c&&m.has(c.id)?(o.get(c.id)??0)+1:o.get(s)??0)}const v=Math.max(0,...b.map(s=>o.get(s)??0)),M=s=>{const c=i(s);switch(w.order){case"duration":return-c.ms;case"outcome":return-(c.abandoned*1e12+c.ms);case"volume":return-(c.sent+c.received);case"name":return 0}},$=new Map;for(const s of b){const c=o.get(s)??0;($.get(c)??$.set(c,[]).get(c)).push(s)}for(const[,s]of $)s.sort((c,l)=>{const u=M(c)-M(l);return u!==0?u:(f.get(c)?.short??c).localeCompare(f.get(l)?.short??l)});const E=w.mode==="shelf"?Math.max(2,w.shelfRows??r.shelfRows):Number.POSITIVE_INFINITY,A=new Map,H=new Map;let W=r.padX;for(let s=0;s<=v;s+=1){const c=$.get(s)??[],l=Math.max(1,Math.ceil(c.length/E));A.set(s,l),H.set(s,W),W+=l*r.nodeW+(l-1)*r.colGap+r.laneGap}const K=Math.max(W-r.laneGap+r.padX,640),j=[];for(let s=0;s<=v;s+=1){const c=$.get(s)??[],l=A.get(s)??1,u=Math.ceil(c.length/l);c.forEach((e,h)=>{const y=l===1?0:Math.floor(h/u),S=l===1?h:h%u,R=i(e),L=f.get(e);j.push({id:e,short:L?.short??e,kind:L?.kind??"agent",lane:s,col:y,x:(H.get(s)??r.padX)+y*(r.nodeW+r.colGap),y:r.padY+S*(r.nodeH+r.rowGap),w:r.nodeW,h:r.nodeH,asked:R.asked,did:R.did,ms:R.ms,abandoned:R.abandoned,sent:R.sent,received:R.received,model:L?.model??null,harness:L?.harness??null,disputed:L?.disputed??!1,inferred:!m.has(e)})})}const C=new Map(j.map(s=>[s.id,s])),D=Math.max(1,...[...$.entries()].map(([s,c])=>Math.ceil(c.length/(A.get(s)??1)))),N=r.padY*2+D*r.nodeH+(D-1)*r.rowGap,k=new Map;for(const s of x){const c=`${s.waiterId}>${s.workerId}`,l=k.get(c)??{tasks:0,abandoned:0};l.tasks+=1,s.abandoned&&(l.abandoned+=1),k.set(c,l)}const P=Math.max(1,...p.map(s=>s.count)),O=[],T=[],X=(s,c)=>{const l=s.x+s.w,u=s.y+s.h/2,e=c.x,h=c.y+c.h/2,y=Math.max(28,(e-l)/2);return{d:`M ${l} ${u} C ${l+y} ${u}, ${e-y} ${h}, ${e} ${h}`,tip:{x:e,y:h,angle:0}}};if(w.mode==="ladder")for(const s of p){const c=C.get(s.from),l=C.get(s.to);if(!c||!l||c.lane>=l.lane)continue;const u=k.get(`${s.from}>${s.to}`),{d:e,tip:h}=X(c,l);O.push({key:`${s.from}>${s.to}`,from:s.from,to:s.to,count:s.count,tasks:u?.tasks??0,abandoned:u?.abandoned??0,weight:1+Math.round(s.count/P*3),d:e,tip:h})}else{const s=new Map,c=(l,u)=>{const e=`${l}>L${u}`,h=s.get(e)??{from:l,lane:u,count:0,tasks:0,abandoned:0};return s.set(e,h),h};for(const l of x){const u=C.get(l.waiterId),e=C.get(l.workerId);if(!u||!e||u.lane>=e.lane)continue;const h=c(l.waiterId,e.lane);h.tasks+=1,l.abandoned&&(h.abandoned+=1)}for(const l of p){const u=C.get(l.from),e=C.get(l.to);!u||!e||u.lane>=e.lane||(c(l.from,e.lane).count+=l.count)}for(const[l,u]of s){const e=C.get(u.from);if(!e)continue;const h=j.filter(G=>G.lane===u.lane);if(h.length===0)continue;const y=Math.min(...h.map(G=>G.x))-14,S=Math.min(...h.map(G=>G.y))+r.nodeH/2,R=Math.max(...h.map(G=>G.y))+r.nodeH/2,L=e.x+e.w,Y=e.y+e.h/2,B=(S+R)/2,V=Math.max(28,(y-L)/2);T.push({key:l,from:u.from,lane:u.lane,count:u.count,tasks:u.tasks,abandoned:u.abandoned,d:`M ${L} ${Y} C ${L+V} ${Y}, ${y-V} ${B}, ${y} ${B}`,label:{x:L+9,y:Y-7+(u.lane-e.lane-1)*12},bar:{x:y,y1:S,y2:R}})}}return{nodes:j,modelsKnown:j.filter(s=>s.model).length,disputedCount:j.filter(s=>s.disputed).length,edges:O,trunks:T,lanes:[...Array(v+1).keys()].map(s=>({index:s,label:ne(s,v),x:H.get(s)??r.padX,count:($.get(s)??[]).length})),width:K,height:N}}function oe(t,x,p){if(t.length===0)return null;const w=t.find(o=>o.id===x);if(!w)return t.reduce((o,m)=>m.x<o.x||m.x===o.x&&m.y<o.y?m:o).id;const r=o=>`${o.lane}:${o.col}`,f=t.filter(o=>r(o)===r(w)).sort((o,m)=>o.y-m.y);if(p==="first")return f[0]?.id??null;if(p==="last")return f[f.length-1]?.id??null;if(p==="up"||p==="down"){const o=f.findIndex(m=>m.id===w.id);return f[o+(p==="down"?1:-1)]?.id??null}const g=new Map;for(const o of t){const m=r(o),n=g.get(m);n?(n.nodes.push(o),n.x=Math.min(n.x,o.x)):g.set(m,{x:o.x,nodes:[o]})}const i=[...g.values()].sort((o,m)=>o.x-m.x),d=i.findIndex(o=>o.nodes.some(m=>m.id===w.id)),b=i[d+(p==="right"?1:-1)];return b?b.nodes.reduce((o,m)=>Math.abs(m.y-w.y)<Math.abs(o.y-w.y)?m:o).id:null}const re=[{id:"shelf",label:"Shelf",hint:"Wrap the last lane into as many columns as fit, and bundle its edges"},{id:"ladder",label:"Ladder",hint:"One card per row, every edge drawn on its own"}],ce=[{id:"duration",label:"Longest first"},{id:"outcome",label:"Never came back"},{id:"volume",label:"Most said"},{id:"name",label:"By name"}];function ie(t){return(t.includes("/")?t.slice(t.lastIndexOf("/")+1):t).replace(/^(claude|openai|anthropic)-/i,"")}function F(t){return t.model?.trim()?ie(t.model.trim()):t.harness?.trim()||null}function z(t,x){return t.length<=x?t:`${t.slice(0,x-1).trimEnd()}…`}const de={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right",Home:"first",End:"last"};function le({node:t,dim:x,on:p,cursor:w,bind:r,onHover:f,onOpen:g,onNav:i,onFocus:d}){const b=_(g),o=F(t),m=`${t.sent+t.received} msgs`,n=t.asked>0?`${t.asked} handed out`:t.ms>0?q(t.ms):null,v=n?`${n} · ${m}`:m,M=o?n??m:v,$=t.disputed?`${t.short} — ${v} — attribution disputed`:`${t.short} — ${v}`;return a.jsxs("g",{className:["cvs-node",t.asked>0?"cvs-node--hub":"",x?"cvs-node--dim":"",p?"cvs-node--on":"",t.disputed?"cvs-node--disputed":""].filter(Boolean).join(" "),transform:`translate(${t.x} ${t.y})`,onMouseEnter:()=>f(t.id),onMouseLeave:()=>f(null),"aria-label":$,"aria-current":p?"true":void 0,ref:r,...b,tabIndex:w?0:-1,onFocus:d,onKeyDown:E=>{const A=de[E.key];if(!A){b.onKeyDown(E);return}E.preventDefault(),i(A)},children:[a.jsx("title",{children:t.disputed?`${t.short} — ${v} — every message under this name is classed as an agent's, so the name is the record's, not a person's`:$}),a.jsx("rect",{className:"cvs-box",x:0,y:0,width:t.w,height:t.h,rx:5}),t.abandoned>0?a.jsx("rect",{className:"cvs-late-mark",x:0,y:0,width:2,height:t.h}):null,a.jsx("text",{className:"cvs-name",x:11,y:17,children:z(t.short,24)}),a.jsx("text",{className:"cvs-meta",x:11,y:31,children:z(M,o?17:30)}),o?a.jsx("text",{className:"cvs-meta cvs-ran",x:t.w-11,y:31,textAnchor:"end",children:z(o,11)}):null,t.inferred?a.jsx("circle",{className:"cvs-inferred",cx:t.w-10,cy:11,r:2.5}):null]})}function fe({passes:t,flights:x,identities:p,rootId:w,focus:r,selectedId:f,onOpen:g}){const[i,d]=I.useState(null),[b,o]=I.useState(null),m=I.useRef(new Map),[n,v]=I.useState("shelf"),[M,$]=I.useState(!1),[E,A]=I.useState("duration"),H=I.useRef(null),[W,K]=I.useState(0);I.useEffect(()=>{const e=H.current;if(!e||typeof ResizeObserver>"u")return;const h=new ResizeObserver(([y])=>K(y?.contentRect.height??0));return h.observe(e),()=>h.disconnect()},[]);const j=I.useMemo(()=>ee(t,x,p),[t,x,p]),C=I.useMemo(()=>w?se(j.actors,j.tasks,j.pairs,w):null,[j,w]),D=C?.setAside??0,N=I.useMemo(()=>C&&!M?{...j,...C}:j,[j,C,M]),k=I.useMemo(()=>{const e=U,h=W>0?Math.max(2,Math.floor((W-e.padY*2+e.rowGap)/(e.nodeH+e.rowGap))):void 0;return ae(N.actors,N.tasks,N.pairs,{mode:n,order:E,shelfRows:h})},[N,n,E,W]);if(k.nodes.length===0)return a.jsx("p",{className:"cf-graph-empty",children:"Nothing has been exchanged in this window yet."});const P=e=>r?r.has(e):!1,O=e=>i!==null?i===e:r?r.has(e):!0,T=(e,h)=>i!==null?i===e||i===h:r?r.has(e)&&r.has(h):!0,X=e=>f===Q(e),s=(e,h)=>{const y=oe(k.nodes,e,h);if(!y||y===e)return;o(y);const S=m.current.get(y);S?.focus(),S?.scrollIntoView({block:"nearest",inline:"nearest"})},c=k.nodes.some(e=>e.id===b)?b:k.nodes[0]?.id??null,l=k.nodes.length-k.modelsKnown,u=N.tasks.filter(e=>e.abandoned).length;return a.jsxs("div",{className:"cvs",children:[a.jsxs("div",{className:"cvs-controls",children:[a.jsx("span",{className:"cvs-ctl-label",children:"Layout"}),a.jsx("div",{className:"cvs-seg",role:"group","aria-label":"Layout",children:re.map(e=>a.jsx("button",{type:"button",className:`cvs-seg-btn${n===e.id?" is-active":""}`,onClick:()=>v(e.id),"aria-pressed":n===e.id,title:e.hint,children:e.label},e.id))}),D>0?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"cvs-ctl-label",children:"Show"}),a.jsxs("div",{className:"cvs-seg",role:"group","aria-label":"Scope",children:[a.jsx("button",{type:"button",className:`cvs-seg-btn${M?"":" is-active"}`,onClick:()=>$(!1),"aria-pressed":!M,title:"Who asked this agent, and everyone it asked, all the way down",children:"This branch"}),a.jsx("button",{type:"button",className:`cvs-seg-btn${M?" is-active":""}`,onClick:()=>$(!0),"aria-pressed":M,title:"Every participant in this agent's window, whoever they were working for",children:"Everything"})]})]}):null,a.jsx("span",{className:"cvs-ctl-label",children:"Down the lane"}),a.jsx("div",{className:"cvs-seg",role:"group","aria-label":"Order",children:ce.map(e=>a.jsx("button",{type:"button",className:`cvs-seg-btn${E===e.id?" is-active":""}`,onClick:()=>A(e.id),"aria-pressed":E===e.id,children:e.label},e.id))}),g?a.jsx("p",{className:"cvs-hint",children:"Click to select · arrows to move · Esc to clear"}):null]}),a.jsx("div",{className:"cvs-stage",ref:H,children:a.jsxs("svg",{className:"cvs-svg",width:k.width,height:k.height,viewBox:`0 0 ${k.width} ${k.height}`,role:"img","aria-label":"Who asked whom, laid out from who opened the work to who did it",children:[k.lanes.map(e=>a.jsxs("g",{children:[a.jsx("text",{className:"cvs-lane-label",x:e.x,y:20,children:e.label.toUpperCase()}),a.jsx("text",{className:"cvs-lane-count",x:e.x,y:34,children:e.count})]},e.index)),k.edges.map(e=>a.jsxs("g",{className:`cvs-edge${T(e.from,e.to)?"":" cvs-edge--dim"}`,children:[a.jsx("path",{className:"cvs-edge-line",d:e.d,strokeWidth:e.weight}),a.jsx("path",{className:"cvs-edge-tip",d:"M 0 0 L -7 -3.2 L -7 3.2 Z",transform:`translate(${e.tip.x} ${e.tip.y}) rotate(${e.tip.angle})`}),e.abandoned>0?a.jsx("path",{className:"cvs-edge-late",d:e.d,strokeWidth:e.weight}):null,g?a.jsx("path",{className:"cvs-edge-hit",d:e.d,"aria-label":`${e.count} message${e.count===1?"":"s"} — open`,..._(()=>g({kind:"pair",from:e.from,to:e.to})),children:a.jsx("title",{children:`${e.count} message${e.count===1?"":"s"} — open`})}):null]},e.key)),k.trunks.map(e=>a.jsxs("g",{className:`cvs-trunk${O(e.from)?"":" cvs-edge--dim"}`,children:[a.jsxs("title",{children:[`${e.tasks} ask${e.tasks===1?"":"s"} · ${e.count} message${e.count===1?"":"s"}`,e.abandoned>0?` · ${e.abandoned} never came back`:""]}),a.jsx("path",{className:"cvs-edge-line",d:e.d,strokeWidth:2}),e.abandoned>0?a.jsx("path",{className:"cvs-edge-late",d:e.d,strokeWidth:2}):null,a.jsx("path",{className:"cvs-bracket",d:`M ${e.bar.x} ${e.bar.y1} L ${e.bar.x} ${e.bar.y2}`}),a.jsxs("text",{className:"cvs-trunk-label",x:e.label.x,y:e.label.y,children:[e.tasks," ask",e.tasks===1?"":"s"]})]},e.key)),k.nodes.map(e=>a.jsx(le,{node:e,dim:!O(e.id),on:P(e.id),cursor:e.id===c,bind:h=>{h?m.current.set(e.id,h):m.current.delete(e.id)},onHover:d,onOpen:()=>g?.({kind:"actor",actorId:e.id}),onNav:h=>s(e.id,h),onFocus:()=>o(e.id)},e.id))]})}),a.jsxs("div",{className:"cf-legend",children:[a.jsxs("span",{children:[a.jsx("i",{className:"cf-swatch"})," exchange, thicker with volume"]}),u>0&&a.jsxs("span",{children:[a.jsx("i",{className:"cf-swatch cf-swatch--late"})," ",u," ask",u===1?"":"s"," never came back"]}),N.broadcasts>0&&a.jsxs("span",{className:"cf-dim",children:[N.broadcasts," to the whole conversation, which is not a pair"]}),!M&&D>0&&a.jsxs("span",{className:"cf-dim",children:[D," more in this window, on work this agent is not part of"]}),k.disputedCount>0&&a.jsxs("span",{className:"cf-dim",children:[N.misattributed," message",N.misattributed===1?"":"s"," name an operator but are recorded as an agent’s — drawn with a dashed edge, because the name is the record’s and not a person’s"]}),a.jsx("span",{className:"cf-dim",children:l===0?`all ${k.nodes.length} name a model`:`${k.modelsKnown} of ${k.nodes.length} name a model; the rest show the harness that ran them`})]}),N.tasks.length>0&&a.jsx("ol",{className:"cvs-tasks",children:N.tasks.map(e=>{const h={kind:"task",askId:e.id},y=k.nodes.find(S=>S.id===e.workerId);return a.jsx("li",{children:a.jsxs("button",{type:"button",className:`cvs-task${X(h)?" cvs-task--on":""}`,...J(()=>g?.(h)),"aria-current":X(h)?"true":void 0,title:e.title,onMouseEnter:()=>d(e.workerId),onMouseLeave:()=>d(null),children:[a.jsx("span",{className:"cvs-task-title",children:e.title}),a.jsxs("span",{className:"cvs-task-who",children:[k.nodes.find(S=>S.id===e.waiterId)?.short??e.waiterId,a.jsx("i",{className:"cvs-arrow",children:"→"}),y?.short??e.workerId,y&&F(y)?a.jsx("i",{className:"cvs-task-ran",children:F(y)}):null]}),a.jsx("span",{className:`cvs-task-ms${e.abandoned?" cvs-task-ms--late":""}`,children:q(e.ms)})]})},e.id)})})]})}export{fe as CommsCanvas};
@@ -0,0 +1 @@
1
+ import{r as o,j as t}from"./index-C8uS5szO.js";/* empty css */import{c as D}from"./conversations-Cbg9h_Af.js";import{u as S}from"./use-conversation-list-A_YUf8lo.js";import{s as W}from"./agent-master-model-C-KdOFDK.js";import{A as L}from"./arrow-up-right-Hn754ybA.js";import{C as R}from"./chevron-right-C7UGFpkl.js";import{X as A}from"./x-DI1ktCYb.js";import"./time-Dhsh_2EG.js";import"./machine-scope-DJt9RZ2w.js";import"./api-CaROe5_H.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./createLucideIcon-DkjnzvcJ.js";const d=260,p=720,h=380,v="openscout.comms.deck.width";function I(){try{const a=Number(window.localStorage.getItem(v));return Number.isFinite(a)&&a>=d&&a<=p?a:h}catch{return h}}function J({ids:a,onClose:g,onStage:j,renderConversation:N}){const[C,k]=o.useState({}),[y,M]=o.useState(()=>new Set),[c,f]=o.useState(null),[x,u]=o.useState(h),m=o.useRef(new Map),{sessions:E}=S();o.useEffect(()=>u(I()),[]);const w=o.useCallback(e=>{M(r=>{const s=new Set(r);return s.has(e)?s.delete(e):s.add(e),s})},[]);return o.useEffect(()=>{if(!c)return;const e=s=>{const i=m.current.get(c);if(!i)return;const n=Math.max(d,Math.min(p,i.getBoundingClientRect().right-s.clientX));k(l=>({...l,[c]:n})),u(n)},r=()=>{f(null),u(s=>{try{window.localStorage.setItem(v,String(s))}catch{}return s})};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",r),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",r)}},[c]),a.length===0?null:t.jsx("div",{className:"cdk","aria-label":"Beside the stage",children:a.map(e=>{const r=E.find(n=>W(n,e)),s=r?D(r):e,i=r?.agentName??"Conversation";return y.has(e)?t.jsxs("button",{type:"button",className:"cdk-spine",onClick:()=>w(e),title:`Unfurl — ${s}`,"aria-label":`Unfurl ${i}: ${s}`,children:[t.jsx("span",{className:"cdk-spine-kicker",children:i}),t.jsx("span",{className:"cdk-spine-title",children:s})]},e):t.jsxs("section",{className:"cdk-col",style:{width:C[e]??x},ref:n=>{n?m.current.set(e,n):m.current.delete(e)},children:[t.jsx("div",{className:`cdk-grip${c===e?" cdk-grip--on":""}`,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${s}`,onPointerDown:n=>{n.preventDefault(),f(e)},onKeyDown:n=>{const l=n.key==="ArrowLeft"?24:n.key==="ArrowRight"?-24:0;l&&(n.preventDefault(),k(b=>({...b,[e]:Math.max(d,Math.min(p,(b[e]??x)+l))})))},tabIndex:0}),t.jsxs("header",{className:"cdk-head",children:[t.jsxs("span",{className:"cdk-ident",children:[t.jsx("span",{className:"cdk-kicker",children:i}),t.jsx("span",{className:"cdk-title",title:s,children:s})]}),t.jsx("button",{type:"button",className:"cdk-btn",title:"Move to the stage — it opens there and this column closes","aria-label":"Move to the stage",onClick:()=>j(e),children:t.jsx(L,{size:13,strokeWidth:2,"aria-hidden":!0})}),t.jsx("button",{type:"button",className:"cdk-btn",title:"Furl to a spine","aria-label":"Furl to a spine",onClick:()=>w(e),children:t.jsx(R,{size:13,strokeWidth:2,"aria-hidden":!0})}),t.jsx("button",{type:"button",className:"cdk-btn",title:"Close","aria-label":"Close",onClick:()=>g(e),children:t.jsx(A,{size:13,strokeWidth:2,"aria-hidden":!0})})]}),t.jsx("div",{className:"cdk-live",children:N(e)})]},e)})})}export{J as CommsDeck};
@@ -0,0 +1 @@
1
+ import{r as j,j as n}from"./index-C8uS5szO.js";import{e as O,a as R,d as C}from"./comms-gesture-_aGFo6g3.js";import{CommsCanvas as q}from"./CommsCanvas-DOKw3Q8i.js";import{mapIdentities as A,CommsFlowMap as Y}from"./CommsFlowMap-CzBWvSa5.js";import{CommsSelection as D}from"./CommsSelection-g1twA-Lb.js";import{k as H,f as L}from"./comms-deck-CBhsXnY-.js";/* empty css */import"./conversations-Cbg9h_Af.js";import"./time-Dhsh_2EG.js";import"./use-conversation-list-A_YUf8lo.js";import"./machine-scope-DJt9RZ2w.js";import"./api-CaROe5_H.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./agent-master-model-C-KdOFDK.js";import"./x-DI1ktCYb.js";import"./createLucideIcon-DkjnzvcJ.js";import"./panel-right-BNTJhy8M.js";const $={gutter:20,column:26,head:22,row:30,gap:22,merge:24},P=9e4,g=(t,a=$)=>a.gutter+t*a.column;function T(t,a,l,u){const d=(a+u)/2;return`M ${t} ${a} C ${t} ${d} ${l} ${d} ${l} ${u}`}function _(t,a,l=$){const u=e=>g(e,l),d=[];let r=l.head;for(const e of t)e.gap>P&&d.length&&(d.push({kind:"quiet",ms:e.gap,y:r}),r+=l.gap),d.push({kind:"pass",pass:e,y:r,column:0}),r+=l.row;const s=d.filter(e=>e.kind==="pass"),h=new Map(s.map(e=>[e.pass.id,e])),w=new Map(s.map(e=>[e.pass.message.id,e])),f=new Map;for(const e of s)f.set(e.pass.from.id,e.y);for(const e of a){const c=h.get(e.answer.id),i=f.get(e.waiter.id);c&&i!==void 0&&f.set(e.waiter.id,Math.max(i,c.y+l.merge))}const p=new Map,m=new Set,M=[],y=new Map,N=[],b=(e,c,i,x)=>{let o=0;for(;m.has(o);)o+=1;m.add(o),p.set(e.id,o);const k={key:`rail-${e.id}-${c}`,actor:e,column:o,y0:i?i.y:c,y1:c};return M.push(k),y.set(e.id,[...y.get(e.id)??[],k]),i&&i.column!==o&&N.push({key:`fork-${x}`,d:T(u(i.column),i.y,u(o),c),pass:i.pass,merge:!1}),o};for(const e of s){const c=e.pass;for(const[o,k]of[...p])(f.get(o)??0)<e.y&&(m.delete(k),p.delete(o));let i=p.get(c.from.id);if(i===void 0){const o=c.replyTo?w.get(c.replyTo):void 0,k=o?{column:o.column,y:o.y,pass:o.pass}:null;i=b(c.from,e.y,k,c.id)}e.column=i;const x=y.get(c.from.id)?.at(-1);if(x&&(x.y1=Math.max(x.y1,e.y)),c.kind!=="channel")for(const o of c.audience)o.id===c.from.id||p.has(o.id)||(f.get(o.id)??-1)<e.y||b(o,e.y,{column:i,y:e.y,pass:c},`${c.id}-${o.id}`)}const S=(e,c)=>[...y.get(e)??[]].reverse().find(i=>i.y0<=c)??null,v=[];for(const e of a){const c=h.get(e.opener.id),i=h.get(e.answer.id);if(!c||!i)continue;const x=i.y+l.merge,o=S(e.waiter.id,x);if(!o||o.column===i.column)continue;N.push({key:`merge-${e.askId}`,d:T(u(i.column),i.y,u(o.column),x),pass:e.answer,merge:!0}),o.y1=Math.max(o.y1,x);const k=e.timedOutAt===null?null:s.find(I=>I.pass.kind==="status"&&I.pass.replyTo===e.opener.message.id)?.y??null;v.push({key:`span-${e.askId}`,column:i.column,y0:c.y,y1:i.y,flight:e,timeoutY:k})}const E=s.reduce((e,c)=>Math.max(e,c.column),0)+1;return{rows:d,rails:M,edges:N,spans:v,columns:E,height:r+12}}const F=4.5,B=128;function G(t){const a=new Date(t),l=u=>String(u).padStart(2,"0");return`${l(a.getHours())}:${l(a.getMinutes())}:${l(a.getSeconds())}`}function X(t,a){return["cf-line",t.kind==="status"?"cf-line--status":"",t.kind==="channel"?"cf-line--channel":"",t.inbound?"cf-line--in":"",a?"cf-line--on":""].filter(Boolean).join(" ")}function Q({pass:t}){return n.jsxs(n.Fragment,{children:[t.askId?n.jsx("span",{className:"cf-tag",children:"answer"}):null,t.count>1?n.jsxs("span",{className:"cf-tag",children:["×",t.count]}):null,t.kind==="channel"?n.jsx("span",{className:"cf-tag",children:"to the conversation"}):null]})}function U({passes:t,flights:a,selectedId:l,onSelect:u}){const d=j.useMemo(()=>_(t,a),[t,a]),r=Math.max(B,g(d.columns-1)+22);return d.rows.length===0?n.jsx("div",{className:"cf-graph-empty",children:n.jsx("p",{children:"Nothing has passed between anyone in this window yet."})}):n.jsxs("div",{className:"cf-graph",style:{height:d.height},children:[n.jsxs("svg",{className:"cf-graph-svg",width:r,height:d.height,viewBox:`0 0 ${r} ${d.height}`,"aria-hidden":"true",children:[d.spans.map(s=>n.jsxs("g",{children:[n.jsx("rect",{className:"cf-wait",x:g(s.column)-5,y:s.y0,width:10,height:Math.max(2,s.y1-s.y0),rx:5}),s.timeoutY!==null?n.jsx("line",{className:"cf-timeout",x1:g(s.column)-7,x2:g(s.column)+7,y1:s.timeoutY,y2:s.timeoutY}):null]},s.key)),d.rails.map(s=>n.jsx("line",{className:s.actor.kind==="broker"?"cf-rail cf-rail--dim":"cf-rail",x1:g(s.column),x2:g(s.column),y1:s.y0,y2:s.y1},s.key)),d.edges.map(s=>n.jsx("path",{className:`cf-edge ${X(s.pass,s.pass.id===l)}`,d:s.d},s.key)),d.rows.map(s=>s.kind==="pass"?n.jsx("circle",{className:s.pass.kind==="status"?"cf-dot cf-dot--status":s.pass.inbound?"cf-dot cf-dot--in":s.pass.kind==="channel"?"cf-dot cf-dot--channel":"cf-dot",cx:g(s.column),cy:s.y,r:s.pass.id===l?F+1.5:F},`dot-${s.pass.id}`):null)]}),d.rows.map(s=>s.kind==="quiet"?n.jsxs("div",{className:"cf-quiet",style:{top:s.y-8,left:r},children:[C(s.ms)," quiet"]},`quiet-${s.y}`):n.jsxs("button",{type:"button",className:`cf-row${s.pass.id===l?" cf-row--on":""}`,style:{top:s.y-$.row/2+3,height:$.row-6,paddingLeft:r},onClick:()=>u?.(s.pass.id),"aria-pressed":s.pass.id===l,title:s.pass.message.body,children:[n.jsx("span",{className:"cf-time",children:G(s.pass.at)}),n.jsxs("span",{className:"cf-route",children:[s.pass.from.short,n.jsx("span",{className:"cf-dim",children:" to "}),s.pass.kind==="channel"?"the conversation":s.pass.audience.map(h=>h.short).join(", ")]}),n.jsx("span",{className:`cf-body${s.pass.kind==="status"?" cf-body--status":""}`,children:s.pass.message.body}),n.jsx(Q,{pass:s.pass})]},s.pass.id)),d.spans.map(s=>n.jsx("div",{className:"cf-merge-label",style:{top:s.y1+$.merge-7,left:g(s.column)+9},children:C(s.flight.answer.at-s.flight.opener.at)},`merge-${s.key}`))]})}function V({passes:t,flights:a,identities:l,view:u,rootId:d,selected:r,onSelect:s,onStage:h,beside:w}){const f=j.useMemo(()=>R(t,a),[t,a]),p=j.useMemo(()=>H(r,f),[r,f]),m=r?L(r):null,M=j.useCallback(()=>s(null),[s]);let y;return u==="canvas"?y=n.jsx(q,{passes:t,flights:a,identities:l,rootId:d,focus:p,selectedId:m,onOpen:s}):u==="map"?y=n.jsx(Y,{passes:t,flights:a,identities:l,focus:p,selectedId:m,onOpen:s}):y=n.jsxs(n.Fragment,{children:[n.jsx(U,{passes:t,flights:a,selectedId:r?.kind==="message"?r.passId:null,onSelect:N=>s({kind:"message",passId:N})}),t.length>0&&n.jsxs("div",{className:"cf-legend",children:[n.jsxs("span",{children:[n.jsx("i",{className:"cf-swatch"})," message"]}),n.jsxs("span",{children:[n.jsx("i",{className:"cf-swatch cf-swatch--in"})," addressed to you"]}),n.jsxs("span",{children:[n.jsx("i",{className:"cf-swatch cf-swatch--status"})," broker status"]}),n.jsxs("span",{children:[n.jsx("i",{className:"cf-swatch cf-swatch--wait"})," waiting on an answer"]}),n.jsxs("span",{children:[n.jsx("i",{className:"cf-swatch cf-swatch--fork"})," work forks and merges back"]}),a.length>0&&n.jsxs("span",{className:"cf-dim",children:[a.length," ask",a.length===1?"":"s"," answered in this window"]})]})]}),n.jsxs("div",{className:"cf-surface",children:[n.jsx("div",{className:"cf-pane",children:y}),r?n.jsx(D,{card:r,passes:t,tasks:f,onClear:M,onStage:h,beside:w}):null]})}function fs({messages:t,view:a,participants:l,onStage:u,beside:d}){const[r,s]=j.useState(null);j.useEffect(()=>s(null),[a]);const h=j.useMemo(()=>A(l),[l]),{passes:w,flights:f}=j.useMemo(()=>{const p=t.filter(m=>!!m.actorId).map(m=>({id:m.id,conversationId:m.conversationId,actorId:m.actorId,actorName:m.actorName,body:m.body,createdAt:m.createdAt,class:m.class,metadata:m.metadata??null,replyToMessageId:m.replyToMessageId??null}));return O(p)},[t]);return n.jsx(V,{passes:w,flights:f,identities:h,view:a,selected:r,onSelect:s,onStage:u,beside:d})}export{U as CommsFlowGraph,fs as CommsFlowPane,V as CommsFlowView};
@@ -0,0 +1 @@
1
+ .cf-surface{position:relative;flex:1 1 auto;min-height:0;display:flex;overflow-x:auto}.cf-pane{flex:1 1 auto;min-width:560px;min-height:0;overflow:auto;padding:var(--space-3xl) var(--space-2xl) var(--space-5xl)}.cf-graph{position:relative;width:100%;min-width:520px}.cf-graph-svg{position:absolute;top:0;left:0;z-index:2;pointer-events:none}.cf-rail{stroke:color-mix(in oklab,var(--ink) 30%,transparent);stroke-width:1.25}.cf-rail--dim{stroke:color-mix(in oklab,var(--ink) 22%,transparent);stroke-width:1;stroke-dasharray:2 3}.cf-edge{fill:none}.cf-line{stroke:var(--ink);stroke-width:1.25;fill:none}.cf-line--in{stroke:var(--accent)}.cf-line--status{stroke:var(--dim);stroke-dasharray:1.5 3}.cf-line--channel{stroke:var(--muted);stroke-dasharray:4 3}.cf-line--on{stroke-width:2.25}.cf-dot{fill:var(--ink)}.cf-dot--in{fill:var(--accent)}.cf-dot--status{fill:var(--dim)}.cf-dot--channel{fill:var(--bg);stroke:var(--muted);stroke-width:1.25}.cf-wait{fill:color-mix(in oklab,var(--accent) 32%,transparent)}.cf-timeout{stroke:var(--red);stroke-width:1.5}.cf-row{position:absolute;z-index:1;left:0;right:0;display:flex;align-items:baseline;gap:var(--space-sm);appearance:none;border:0;border-radius:var(--radius-md);padding-right:var(--space-sm);background:transparent;text-align:left;font-size:var(--text-md);line-height:18px;color:var(--ink);cursor:pointer}.cf-row:hover{background:var(--surface)}.cf-row--on,.cf-row--on:hover{background:var(--surface);box-shadow:inset 0 0 0 1px var(--border)}.cf-time{flex:none;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--dim)}.cf-route{flex:none;color:var(--muted);white-space:nowrap}.cf-dim{color:var(--dim)}.cf-body{min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cf-body--status{font-family:var(--font-mono);font-size:var(--text-sm);color:var(--muted)}.cf-quiet{position:absolute;z-index:3;font-family:var(--font-mono);font-size:var(--text-xs);line-height:16px;color:var(--dim);pointer-events:none}.cf-merge-label{position:absolute;z-index:3;padding:0 var(--space-2xs);background:var(--bg);font-family:var(--font-mono);font-size:var(--text-xs);line-height:14px;color:var(--muted);white-space:nowrap;pointer-events:none}.cf-tag{flex:none;display:inline-block;padding:0 var(--space-2xs);border:1px solid var(--border);border-radius:var(--radius-xs);font-family:var(--font-mono);font-size:var(--text-xs);line-height:14px;color:var(--dim);white-space:nowrap}.cf-legend{display:flex;flex-wrap:wrap;gap:var(--space-2xs) var(--space-3xl);margin-top:var(--space-4xl);padding-top:var(--space-lg);border-top:1px solid var(--border);font-size:var(--text-sm);color:var(--muted)}.cf-legend>span{display:inline-flex;align-items:center;gap:var(--space-xs)}.cf-swatch{display:inline-block;width:18px;border-top:1.5px solid var(--ink)}.cf-swatch--in{border-top-color:var(--accent)}.cf-swatch--status{border-top-style:dotted;border-top-color:var(--dim)}.cf-swatch--late{border-top-style:dotted;border-top-color:var(--red)}.cf-swatch--wait{width:18px;height:8px;border:0;border-radius:var(--radius-xs);background:color-mix(in oklab,var(--accent) 32%,transparent)}.cf-swatch--fork{width:18px;height:10px;border:0;border-right:1.25px solid var(--ink);border-bottom:1.25px solid var(--ink);border-bottom-right-radius:8px}.cf-graph-empty{padding:var(--space-6xl) var(--space-2xl);text-align:center;color:var(--dim);font-size:var(--text-lg)}.s-thread-view-toggle{display:inline-flex;align-items:center;border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden}.s-thread-view-option{appearance:none;border:0;padding:var(--space-3xs) var(--space-sm);background:transparent;color:var(--muted);font-size:var(--text-sm);line-height:18px;cursor:pointer}.s-thread-view-option+.s-thread-view-option{border-left:1px solid var(--border)}.s-thread-view-option:hover{color:var(--ink);background:var(--surface)}.s-thread-view-option--on,.s-thread-view-option--on:hover{color:var(--ink);background:var(--surface);font-weight:500}.cfm{display:flex;flex-direction:column;gap:18px}.cfm-svg{width:100%;max-width:860px;height:auto;align-self:center;overflow:visible}.cfm-edge-line{fill:none;stroke:color-mix(in oklab,var(--ink) 34%,transparent);stroke-linecap:round}.cfm-edge-tip{fill:color-mix(in oklab,var(--ink) 34%,transparent);stroke:none}.cfm-edge--in .cfm-edge-line{stroke:var(--accent)}.cfm-edge--in .cfm-edge-tip{fill:var(--accent)}.cfm-edge--dim{opacity:.18}.cfm-edge,.cfm-node{transition:opacity .12s ease}.cfm-box{fill:var(--bg);stroke:var(--border);stroke-width:1}.cfm-node--hub .cfm-box{stroke:color-mix(in oklab,var(--ink) 45%,transparent)}.cfm-node--dim{opacity:.35}.cfm-node--on .cfm-box{stroke:var(--ink);stroke-width:1.5}.cfm-node{cursor:pointer}.cfm-node:focus-visible{outline:none}.cfm-node:focus-visible .cfm-box{stroke:var(--accent);stroke-width:2}.cfm-edge-hit{fill:none;stroke:transparent;stroke-width:14;cursor:pointer}.cfm-edge-hit:focus-visible{outline:none;stroke:color-mix(in oklab,var(--accent) 30%,transparent)}.cfm-name{fill:var(--ink);font-size:12px;font-weight:500;text-anchor:middle;dominant-baseline:middle}.cfm-model{fill:var(--dim);font-size:10px;font-family:var(--mono, ui-monospace, SFMono-Regular, monospace);text-anchor:middle;dominant-baseline:middle}.cfm-pairs{list-style:none;margin:0;padding:0;width:100%;max-width:860px;align-self:center;display:flex;flex-direction:column;gap:1px;font-size:12px}.cfm-pairs li{display:contents}.cfm-pair{appearance:none;border:0;background:none;font:inherit;text-align:left;cursor:pointer;width:100%;display:grid;grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) auto;gap:12px;align-items:baseline;padding:4px 8px;border-radius:4px;transition:opacity .12s ease}.cfm-pair:hover{background:color-mix(in oklab,var(--ink) 5%,transparent)}.cfm-pair--on{background:color-mix(in oklab,var(--ink) 8%,transparent)}.cfm-pair--dim{opacity:.35}.cfm-pair-who{color:var(--ink)}.cfm-pair-models{color:var(--dim);font-family:var(--mono, ui-monospace, SFMono-Regular, monospace);font-size:11px}.cfm-pair-count{color:var(--dim);font-variant-numeric:tabular-nums;text-align:right}.cfm-arrow{font-style:normal;color:var(--dim);padding:0 6px}.cfm-model--harness{fill:color-mix(in oklab,var(--dim) 72%,transparent)}.cfm-tasks{list-style:none;margin:0;padding:0;width:100%;max-width:860px;align-self:center;display:flex;flex-direction:column;gap:1px}.cfm-task{display:grid;grid-template-columns:1fr auto auto;gap:14px;align-items:baseline;width:100%;padding:5px 8px;border:0;border-radius:4px;background:none;font:inherit;font-size:12px;color:var(--dim);text-align:left;cursor:pointer}.cfm-task:hover{background:color-mix(in oklab,var(--ink) 5%,transparent)}.cfm-task--on{background:color-mix(in oklab,var(--ink) 8%,transparent)}.cfm-task--on .cfm-task-title{color:var(--ink)}.cfm-task-title{color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cfm-task-who{color:var(--dim);white-space:nowrap}.cfm-task-ran{font-style:normal;font-family:var(--mono, ui-monospace, SFMono-Regular, monospace);font-size:11px;color:color-mix(in oklab,var(--dim) 72%,transparent);padding-left:6px}.cfm-task-ms{color:var(--dim);font-variant-numeric:tabular-nums;white-space:nowrap}.cfm-task-ms--late{color:var(--red)}
@@ -0,0 +1 @@
1
+ import{r as d,j as e}from"./index-C8uS5szO.js";import{f as b,a as E,c as I,b as y,h as $,d as L,p as w}from"./comms-gesture-_aGFo6g3.js";import{f as B}from"./comms-deck-CBhsXnY-.js";function F(a){return(a.includes("/")?a.slice(a.lastIndexOf("/")+1):a).replace(/^(claude|openai|anthropic)-/i,"")}function f(a){return a.model?.trim()?F(a.model.trim()):a.harness?.trim()||null}function N(a,c){return a.length<=c?a:`${a.slice(0,c-1).trimEnd()}…`}function C({node:a,dim:c,on:r,onHover:n,onOpen:l}){const i=f(a);return e.jsxs("g",{className:["cfm-node",a.hub?"cfm-node--hub":"",c?"cfm-node--dim":"",r?"cfm-node--on":""].filter(Boolean).join(" "),transform:`translate(${a.x} ${a.y})`,onMouseEnter:()=>n(a.id),onMouseLeave:()=>n(null),"aria-label":`${a.actor.short} — ${a.sent} sent, ${a.received} received`,...$(l),children:[e.jsx("title",{children:`${a.actor.short} — ${a.sent} sent, ${a.received} received`}),e.jsx("rect",{className:"cfm-box",x:-62,y:-21,width:124,height:42,rx:6}),e.jsx("text",{className:"cfm-name",x:0,y:i?-3:5,children:N(a.actor.short,17)}),i?e.jsx("text",{className:`cfm-model${a.model?"":" cfm-model--harness"}`,x:0,y:12,children:N(i,20)}):null]})}function T({passes:a,flights:c,identities:r,focus:n,selectedId:l,onOpen:i}){const[m,u]=d.useState(null),x=d.useMemo(()=>E(a,c),[a,c]),t=d.useMemo(()=>I(a,r),[a,r]),k=d.useMemo(()=>y(t),[t]),p=s=>f(r.get(s)??{model:null,harness:null});if(t.nodes.length===0)return e.jsx("p",{className:"cf-graph-empty",children:"Nothing has been exchanged in this window yet."});const v=s=>n?n.has(s):!1,g=s=>m!==null?m===s:n?n.has(s):!0,j=(s,o)=>m!==null?m===s||m===o:n?n.has(s)&&n.has(o):!0,M=t.nodes.length-t.modelsKnown,h=s=>l===B(s);return e.jsxs("div",{className:"cfm",children:[e.jsxs("svg",{className:"cfm-svg",viewBox:`0 0 ${t.width} ${t.height}`,preserveAspectRatio:"xMidYMid meet",role:"img","aria-label":"Who exchanged work with whom in this window",children:[t.edges.map(s=>e.jsxs("g",{className:`cfm-edge${s.inbound?" cfm-edge--in":""}${j(s.from,s.to)?"":" cfm-edge--dim"}`,children:[e.jsx("path",{className:"cfm-edge-line",d:s.d,strokeWidth:s.weight}),e.jsx("path",{className:"cfm-edge-tip",d:"M 0 0 L -7 -3.2 L -7 3.2 Z",transform:`translate(${s.tip.x} ${s.tip.y}) rotate(${s.tip.angle})`}),i?e.jsx("path",{className:"cfm-edge-hit",d:s.d,"aria-label":`${s.count} message${s.count===1?"":"s"} — open`,...$(()=>i({kind:"pair",from:s.from,to:s.to})),children:e.jsx("title",{children:`${s.count} message${s.count===1?"":"s"} — open`})}):null]},s.key)),t.nodes.map(s=>e.jsx(C,{node:s,dim:!g(s.id),on:v(s.id),onHover:u,onOpen:()=>i?.({kind:"actor",actorId:s.id})},s.id))]}),x.length>0&&e.jsx("ol",{className:"cfm-tasks",children:x.map(s=>{const o={kind:"task",askId:s.id};return e.jsx("li",{children:e.jsxs("button",{type:"button",className:`cfm-task${h(o)?" cfm-task--on":""}`,...w(()=>i?.(o)),"aria-current":h(o)?"true":void 0,title:s.title,children:[e.jsx("span",{className:"cfm-task-title",children:s.title}),e.jsxs("span",{className:"cfm-task-who",children:[s.waiter.short,e.jsx("i",{className:"cfm-arrow",children:"→"}),s.worker.short,p(s.worker.id)?e.jsx("i",{className:"cfm-task-ran",children:p(s.worker.id)}):null]}),e.jsx("span",{className:`cfm-task-ms${s.abandoned?" cfm-task-ms--late":""}`,children:L(s.ms)})]})},s.id)})}),e.jsx("ol",{className:"cfm-pairs",children:k.map(s=>{const o={kind:"pair",from:s.from.id,to:s.to.id};return e.jsx("li",{className:j(s.from.id,s.to.id)?"":"cfm-pair--dim",children:e.jsxs("button",{type:"button",className:`cfm-pair${h(o)?" cfm-pair--on":""}`,...w(()=>i?.(o)),"aria-current":h(o)?"true":void 0,onMouseEnter:()=>u(s.from.id),onMouseLeave:()=>u(null),children:[e.jsxs("span",{className:"cfm-pair-who",children:[s.from.actor.short,e.jsx("i",{className:"cfm-arrow",children:"→"}),s.to.actor.short]}),e.jsxs("span",{className:"cfm-pair-models",children:[f(s.from)??"not stated",e.jsx("i",{className:"cfm-arrow",children:"→"}),f(s.to)??"not stated"]}),e.jsx("span",{className:"cfm-pair-count",children:s.count})]})},s.key)})}),e.jsxs("div",{className:"cf-legend",children:[e.jsxs("span",{children:[e.jsx("i",{className:"cf-swatch"})," exchange, thicker with volume"]}),e.jsxs("span",{children:[e.jsx("i",{className:"cf-swatch cf-swatch--in"})," addressed to you"]}),t.broadcasts>0&&e.jsxs("span",{className:"cf-dim",children:[t.broadcasts," to the whole conversation, which is not a pair"]}),e.jsx("span",{className:"cf-dim",children:M===0?`all ${t.nodes.length} name a model`:`${t.modelsKnown} of ${t.nodes.length} name a model; the rest show the harness that ran them`})]})]})}function W(a){const c=new Map;for(const r of a??[]){if(!r.model&&!r.harness)continue;const n=b(r.actorId),l=c.get(n);c.set(n,{model:l?.model??r.model??null,harness:l?.harness??r.harness??null})}return c}export{T as CommsFlowMap,W as mapIdentities};