@openscout/scout 0.2.80 → 0.2.83

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 (358) hide show
  1. package/README.md +1 -1
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +4 -4
  4. package/dist/client/assets/ActivityScreen-aewI4Ul1.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-CtEiLQnm.js → AddProjectForm-Czb5uwou.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-CszU5eaU.js → AgentAvatar-DMov24_o.js} +1 -1
  7. package/dist/client/assets/AgentConfigurationScreen-BjG6ECjl.js +1 -0
  8. package/dist/client/assets/AgentDefinitionsWorkspace-D4MbSMXp.js +1 -0
  9. package/dist/client/assets/{AgentDetailCard-sZuHl1de.js → AgentDetailCard-Biq8b2gv.js} +1 -1
  10. package/dist/client/assets/AgentFloorView-h9KDJdw0.js +1 -0
  11. package/dist/client/assets/AgentInfoScreen-SjhK_SBh.js +1 -0
  12. package/dist/client/assets/{AgentLaneCard-nB68f2CI.js → AgentLaneCard-C4DMQR-c.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-O9Yf0uR-.js → AgentLaneChrome-D1xNNf7A.js} +1 -1
  14. package/dist/client/assets/{AgentLaneDetailSheet-BfhpaEQ3.js → AgentLaneDetailSheet-DnAKe4e3.js} +1 -1
  15. package/dist/client/assets/{AgentLaneSummaryResize-Ct3b0TQR.js → AgentLaneSummaryResize-C9loK-st.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-BNOYF16R.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-DNGvZvjd.js → AgentLanesPreflight-M7iDXdP2.js} +1 -1
  18. package/dist/client/assets/{AgentLanesView-DqRK5-d2.js → AgentLanesView-Ct-Gz5WD.js} +1 -1
  19. package/dist/client/assets/{AgentLiveActions-DI4ooSHW.js → AgentLiveActions-0iy8QZ1T.js} +1 -1
  20. package/dist/client/assets/{AgentSessions-BxWIPkWh.js → AgentSessions-CDfSfNiE.js} +2 -2
  21. package/dist/client/assets/{AgentsConsole-D6VHSCfZ.js → AgentsConsole-BVxhBqRa.js} +1 -1
  22. package/dist/client/assets/AgentsScreen-Bww6HgFs.js +1 -0
  23. package/dist/client/assets/AgentsSubnav-CiIuzxnZ.js +1 -0
  24. package/dist/client/assets/{AtopView-VZkk40v0.js → AtopView-h_aFoNkP.js} +1 -1
  25. package/dist/client/assets/BackToPicker-BXp5E2ck.js +1 -0
  26. package/dist/client/assets/{BriefingDetailScreen-BZU4qMwE.js → BriefingDetailScreen-C83o2YfN.js} +1 -1
  27. package/dist/client/assets/{BriefingsScreen-Bfc3tqPp.js → BriefingsScreen-BTsvr5fv.js} +1 -1
  28. package/dist/client/assets/{BrokerMetadataPanel-CaFe6kdh.js → BrokerMetadataPanel-jg7odHQp.js} +1 -1
  29. package/dist/client/assets/BrokerScreen-DplF8d_X.js +5 -0
  30. package/dist/client/assets/Canvas-BePL08RR.js +1 -0
  31. package/dist/client/assets/{ChatCollapsedStrip-Cov54p9V.js → ChatCollapsedStrip-BRljIymi.js} +1 -1
  32. package/dist/client/assets/{CodeDiffPane-C1ebFt-Y.js → CodeDiffPane-86odpBSt.js} +1 -1
  33. package/dist/client/assets/{CodeProjectPicker-tsCly-f3.js → CodeProjectPicker-8svr_S_A.js} +1 -1
  34. package/dist/client/assets/{CodeScreen-D0hpZNLP.js → CodeScreen-CJ2RgB32.js} +1 -1
  35. package/dist/client/assets/{ContextMenu-N-Z6X0Z1.js → ContextMenu-CxkmFQcN.js} +1 -1
  36. package/dist/client/assets/{ConversationComposer-CiEF7dhd.js → ConversationComposer-CWohCCmn.js} +1 -1
  37. package/dist/client/assets/ConversationFeedRows-IWh0JSIL.js +1 -0
  38. package/dist/client/assets/{ConversationHeader-BGgbITvr.js → ConversationHeader-BxTzXl8e.js} +1 -1
  39. package/dist/client/assets/ConversationPanels-D9UCwNkS.js +2 -0
  40. package/dist/client/assets/ConversationScreen-oZSitVtX.js +1 -0
  41. package/dist/client/assets/{ConversationStatus-COEj5loj.js → ConversationStatus-B6pAbo2w.js} +1 -1
  42. package/dist/client/assets/{DataTable-BoofV-_4.js → DataTable-CGw5CECG.js} +1 -1
  43. package/dist/client/assets/{DispatchAftermath-OXYlMbT1.js → DispatchAftermath-DowTb7uO.js} +1 -1
  44. package/dist/client/assets/{DocumentFocusViewer-BCG2kOmd.js → DocumentFocusViewer-DRKjNG9s.js} +1 -1
  45. package/dist/client/assets/{EmbeddableSurfacesLab-C2SZvrHJ.js → EmbeddableSurfacesLab-CxfJXS2g.js} +1 -1
  46. package/dist/client/assets/{EmptyState-DypEjx0V.js → EmptyState-BUvllvA6.js} +1 -1
  47. package/dist/client/assets/{FileViewerPane-CXCq-oKj.js → FileViewerPane-BM4AD_bo.js} +1 -1
  48. package/dist/client/assets/{FleetSearch-Dj7-CfNi.js → FleetSearch-CYeWn85V.js} +1 -1
  49. package/dist/client/assets/FlightObserveScreen-DYJJ3Z2B.js +1 -0
  50. package/dist/client/assets/{FollowScreen-DRgYuAvp.js → FollowScreen-DG0osbUp.js} +1 -1
  51. package/dist/client/assets/{HarnessMark-BE-YSyci.js → HarnessMark-MztYnrGK.js} +1 -1
  52. package/dist/client/assets/HarnessesScreen-BWqirBjK.js +1 -0
  53. package/dist/client/assets/{HerdrSession-DKFCJMst.js → HerdrSession-6sFln7WX.js} +1 -1
  54. package/dist/client/assets/{HomeHero-CAEg8Yg5.js → HomeHero-BPBArHXa.js} +1 -1
  55. package/dist/client/assets/{KnowledgeSearchInspector-C2EZsQ5i.js → KnowledgeSearchInspector-BOIhFWd2.js} +1 -1
  56. package/dist/client/assets/KnowledgeSearchScreen-BP8tD-Bh.js +1 -0
  57. package/dist/client/assets/{LaneToolHoverCard-DrPXYZvQ.js → LaneToolHoverCard-CcEiQC6B.js} +1 -1
  58. package/dist/client/assets/LaneTraceDetailSheet-B4i1Ut4R.js +1 -0
  59. package/dist/client/assets/{LaneTraceEventFocus-X4-DDFEo.js → LaneTraceEventFocus-Bl9L0EYb.js} +1 -1
  60. package/dist/client/assets/{MeshCanvas-rtCBD7s6.js → MeshCanvas-ZjIuMiRo.js} +1 -1
  61. package/dist/client/assets/{MeshCanvasMinimap-CuvXOkc7.js → MeshCanvasMinimap-C-LQtiX6.js} +1 -1
  62. package/dist/client/assets/MeshScreen-Bs3soujg.js +1 -0
  63. package/dist/client/assets/{MeshTopologyView-CeTShs-U.js → MeshTopologyView-C0LUyT3K.js} +2 -2
  64. package/dist/client/assets/{MessageComposerSuggestions-Cs9u-F_3.js → MessageComposerSuggestions-Dfc3PH2y.js} +1 -1
  65. package/dist/client/assets/MessagesScreen-TgSL5KMc.js +1 -0
  66. package/dist/client/assets/{MissionContextRail-0O-Zu1Tn.js → MissionContextRail-CjGAEGu8.js} +1 -1
  67. package/dist/client/assets/MissionControlView-D629w2A8.js +1 -0
  68. package/dist/client/assets/{MissionFocusOverlay-LnjmqBiW.js → MissionFocusOverlay-Bubrr8Gc.js} +1 -1
  69. package/dist/client/assets/{MissionLeftAgentRow-nc1Jyq3D.js → MissionLeftAgentRow-DokImu4Y.js} +1 -1
  70. package/dist/client/assets/{MissionLogPane-lZ9vUftY.js → MissionLogPane-Cs0LuIkn.js} +1 -1
  71. package/dist/client/assets/{NewAgentModal-K1cvdmZr.js → NewAgentModal-D5e0YUAo.js} +1 -1
  72. package/dist/client/assets/{NewChatComposer-DXDxV2Mh.js → NewChatComposer-S08F6_La.js} +1 -1
  73. package/dist/client/assets/{NewChatOrigin-CnjoswTG.js → NewChatOrigin-BEz6jyqf.js} +1 -1
  74. package/dist/client/assets/{ObserveEmbedScreen-CRpzYf0Y.js → ObserveEmbedScreen-CHx2sEAA.js} +2 -2
  75. package/dist/client/assets/ObserveTextFlow-_ApDwRCO.js +2 -0
  76. package/dist/client/assets/{ObservedTopologyPanel-C1AQM0Mq.js → ObservedTopologyPanel-ByW7Ar7p.js} +1 -1
  77. package/dist/client/assets/OpenScoutAppShell-DTmnbG-h.js +88 -0
  78. package/dist/client/assets/OpsAgentsView-DiFuHcJs.js +1 -0
  79. package/dist/client/assets/OpsScreen-CCR3U_9P.js +1 -0
  80. package/dist/client/assets/OpsSubnav-CZs_OL2N.js +1 -0
  81. package/dist/client/assets/{PlanView-DDXdC19M.js → PlanView-C54eAzig.js} +1 -1
  82. package/dist/client/assets/ProjectAgentProfile-BEfYOaxc.js +1 -0
  83. package/dist/client/assets/{ProjectAgentProfileBar-MODhG0P6.js → ProjectAgentProfileBar-B1VpwzGD.js} +1 -1
  84. package/dist/client/assets/{ProjectAgentProfileHero-C1ImgGDu.js → ProjectAgentProfileHero-B4f_AoCr.js} +1 -1
  85. package/dist/client/assets/ProjectsInbox-DoPZ17FC.js +2 -0
  86. package/dist/client/assets/{ProjectsRail-B1zrQLZe.js → ProjectsRail-CWOkZjsY.js} +1 -1
  87. package/dist/client/assets/ProjectsScreen-Dse0Q6p6.js +1 -0
  88. package/dist/client/assets/ProjectsThreadAside-DMnfyPLE.js +1 -0
  89. package/dist/client/assets/Provider-DKZWuzSR.js +1 -0
  90. package/dist/client/assets/{RailRow-DerXOXQS.js → RailRow-DIGd3MMM.js} +1 -1
  91. package/dist/client/assets/RawSessionsTable-Zkl4YDvz.js +1 -0
  92. package/dist/client/assets/RealtimeVoiceScreen-B_PMJxY_.js +1 -0
  93. package/dist/client/assets/{RepoDiffEmbedScreen-C9oLCcZX.js → RepoDiffEmbedScreen-VLg4caej.js} +1 -1
  94. package/dist/client/assets/{RepoDiffPageScreen-CGEMAv2Z.js → RepoDiffPageScreen-BelnvgnP.js} +1 -1
  95. package/dist/client/assets/{RepoDiffViewer-CB8PSVey.js → RepoDiffViewer-VrUJw33u.js} +1 -1
  96. package/dist/client/assets/RepoDiffViewerLazy-BPg_JkYW.js +2 -0
  97. package/dist/client/assets/{ReposScreen-BN1lVjOj.js → ReposScreen-IINK-CFn.js} +2 -2
  98. package/dist/client/assets/ScoutDeckSurface-MbwGp6Ab.js +1 -0
  99. package/dist/client/assets/{ScoutSurface-BEnDlynn.js → ScoutSurface-x_QbcRyk.js} +1 -1
  100. package/dist/client/assets/ScoutbotBroadcastChip-DAKQKB25.js +2 -0
  101. package/dist/client/assets/{ScoutbotFxLab-fAROyIfz.js → ScoutbotFxLab-7t9JVvZg.js} +1 -1
  102. package/dist/client/assets/{ScoutbotRealtimeVoiceCall-CDyFJX8m.js → ScoutbotRealtimeVoiceCall-Br4bYVAx.js} +1 -1
  103. package/dist/client/assets/{SecondaryNav-Hv5AJ3Fv.js → SecondaryNav-Dj30epYF.js} +1 -1
  104. package/dist/client/assets/{SessionEmbedScreen-CDRpQc3g.js → SessionEmbedScreen-s2mJ5Fg9.js} +1 -1
  105. package/dist/client/assets/{SessionObserve-BmmJ8dEh.js → SessionObserve-DaUrJCMq.js} +1 -1
  106. package/dist/client/assets/{SessionObserveEvidence-CEedIk2a.js → SessionObserveEvidence-ClUW8jpV.js} +1 -1
  107. package/dist/client/assets/SessionRefScreen-DLZNFZFK.js +1 -0
  108. package/dist/client/assets/SessionsScreen-D-hN1n4k.js +1 -0
  109. package/dist/client/assets/{SettingsDrawer-DL-SVLdd.js → SettingsDrawer-BFsnww-k.js} +3 -3
  110. package/dist/client/assets/SettingsScreen-Bc3Xtv5V.js +1 -0
  111. package/dist/client/assets/{ShikiPane-B7O4if20.js → ShikiPane-Dkwyx--r.js} +1 -1
  112. package/dist/client/assets/{SlidePanel-B3gc5HnM.js → SlidePanel-CuTeirnk.js} +1 -1
  113. package/dist/client/assets/{SpriteAvatar-BpQDpOkq.js → SpriteAvatar-DQ3PTb8L.js} +1 -1
  114. package/dist/client/assets/{StatusPill-B33sQinT.js → StatusPill-BJ1ierIR.js} +1 -1
  115. package/dist/client/assets/{TailView-DL3YZkzE.js → TailView-CufWcrvf.js} +2 -2
  116. package/dist/client/assets/Terminal-D_OmdFmr.js +1 -0
  117. package/dist/client/assets/TerminalEmbedScreen-D21ytNXW.js +1 -0
  118. package/dist/client/assets/TerminalRelay-rvUzI9Ek.js +46 -0
  119. package/dist/client/assets/{TextDocumentSurface-DRjctOIt.js → TextDocumentSurface-Bc-kHPgG.js} +1 -1
  120. package/dist/client/assets/{TmuxPeek-DNC4uWky.js → TmuxPeek-DLyDkq_D.js} +1 -1
  121. package/dist/client/assets/{VoicePermissionsPanel-WLN0V-Xv.js → VoicePermissionsPanel-CD903y9K.js} +1 -1
  122. package/dist/client/assets/{WorkDetailScreen-D2Yl0mYZ.js → WorkDetailScreen-D51oI0dH.js} +2 -2
  123. package/dist/client/assets/{WorkFilesViewer-BbVfcUN-.js → WorkFilesViewer-BDMNbxE4.js} +1 -1
  124. package/dist/client/assets/{activity-BxwKkT8z.js → activity-BvGruxWG.js} +1 -1
  125. package/dist/client/assets/{addon-fit-B9O2vJoh.js → addon-fit-Cfq4Ayjd.js} +1 -1
  126. package/dist/client/assets/{addon-webgl-BhRZFDcn.js → addon-webgl-B8sIf9-s.js} +1 -1
  127. package/dist/client/assets/{agent-essentials-SrzMYEXV.js → agent-essentials-yb4wIJlX.js} +1 -1
  128. package/dist/client/assets/{agent-lane-card-model-DSWdGu-v.js → agent-lane-card-model-q4cwzLX4.js} +1 -1
  129. package/dist/client/assets/{agent-lanes-model-CPgQRenB.js → agent-lanes-model-VYQ5a68i.js} +1 -1
  130. package/dist/client/assets/{arc.es-NlJw-19N.js → arc.es-BBTfhvLE.js} +1 -1
  131. package/dist/client/assets/{arrow-left-_vS7itsV.js → arrow-left-BOht-YQu.js} +1 -1
  132. package/dist/client/assets/{arrow-up-right-CcrWONpD.js → arrow-up-right-hoR8_oUz.js} +1 -1
  133. package/dist/client/assets/{bot-BRINYlC6.js → bot-BUK7dOPS.js} +1 -1
  134. package/dist/client/assets/{check-COxArFXG.js → check--esHw52j.js} +1 -1
  135. package/dist/client/assets/{chevron-down-DRCbnzyY.js → chevron-down-NAhBUkFd.js} +1 -1
  136. package/dist/client/assets/{chevron-right-CNE6QAVr.js → chevron-right-C10o7t_X.js} +1 -1
  137. package/dist/client/assets/{chunk-HRAB3GC3-CAeEKaf5.js → chunk-HRAB3GC3-DF8R9rPv.js} +1 -1
  138. package/dist/client/assets/{clock-CyfvRmj6.js → clock-of01sAB6.js} +1 -1
  139. package/dist/client/assets/{code-xml--LjSM4Mv.js → code-xml-CLn3TDWF.js} +1 -1
  140. package/dist/client/assets/content-B-SUUhXj.js +1 -0
  141. package/dist/client/assets/content-BRY2vo1_.js +1 -0
  142. package/dist/client/assets/content-BTm0mVyD.js +1 -0
  143. package/dist/client/assets/content-BTqvyb5E.js +1 -0
  144. package/dist/client/assets/content-BjDaXmSD.js +1 -0
  145. package/dist/client/assets/content-BrR6deGh.js +1 -0
  146. package/dist/client/assets/content-C5yvBEMy.js +1 -0
  147. package/dist/client/assets/content-Cgj5AWqT.js +1 -0
  148. package/dist/client/assets/content-CkhG__-v.js +1 -0
  149. package/dist/client/assets/content-CudIBsiP.js +1 -0
  150. package/dist/client/assets/content-DBb7ppd5.js +1 -0
  151. package/dist/client/assets/content-DEw_kGyK.js +1 -0
  152. package/dist/client/assets/content-DIy0DCzK.js +1 -0
  153. package/dist/client/assets/content-THl9hRAo.js +1 -0
  154. package/dist/client/assets/content-vi9FbmV9.js +1 -0
  155. package/dist/client/assets/content-wcgPMGVf.js +1 -0
  156. package/dist/client/assets/{conversation-icons-c-hXv7hY.js → conversation-icons-ClBJi21l.js} +1 -1
  157. package/dist/client/assets/conversation-motion-features-zU0k3Agz.js +1 -0
  158. package/dist/client/assets/{copy-4LfKIdQJ.js → copy-Dty8ZYsM.js} +1 -1
  159. package/dist/client/assets/{createLucideIcon-ClCdc3F9.js → createLucideIcon-Bt67PWH-.js} +1 -1
  160. package/dist/client/assets/discover-NDAqNvKt.js +2 -0
  161. package/dist/client/assets/embed-entry-BVR09F6e.js +2 -0
  162. package/dist/client/assets/{external-link-CnaI1QFS.js → external-link-Dem738OJ.js} +1 -1
  163. package/dist/client/assets/{eye-BFlhMzQL.js → eye-B3lBIwJZ.js} +1 -1
  164. package/dist/client/assets/{file-text-DG-pufl1.js → file-text-iF0hyVyU.js} +1 -1
  165. package/dist/client/assets/{home-moving-signal-aNJusIzL.js → home-moving-signal-C8dTXieA.js} +1 -1
  166. package/dist/client/assets/{home-now-card-BQK4EFHx.js → home-now-card-BgvVcE83.js} +1 -1
  167. package/dist/client/assets/{home-now-card-nano-CdtzqSIF.js → home-now-card-nano-hZl9klbP.js} +1 -1
  168. package/dist/client/assets/hooks-DBIezYS2.js +2 -0
  169. package/dist/client/assets/index-BMwKgdz_.js +1 -0
  170. package/dist/client/assets/index-Bu-fckyR.css +1 -0
  171. package/dist/client/assets/index-BxoufAPA.js +1 -0
  172. package/dist/client/assets/index-Cj7NnSxI.js +1 -0
  173. package/dist/client/assets/{index-CzVeWScw.js → index-o4FKpU7Z.js} +2 -2
  174. package/dist/client/assets/{inspector-panel-DgOM8nCo.js → inspector-panel-Dy2cVTCi.js} +2 -2
  175. package/dist/client/assets/{keyboard-nav-BJnFoFDP.js → keyboard-nav-Chf51dns.js} +1 -1
  176. package/dist/client/assets/{lane-roster-store-pR4ZaYQm.js → lane-roster-store-BiIVlYmG.js} +1 -1
  177. package/dist/client/assets/left-BC7p5QbT.js +1 -0
  178. package/dist/client/assets/left-BCSGqccQ.js +1 -0
  179. package/dist/client/assets/left-BSyj8PuJ.js +2 -0
  180. package/dist/client/assets/left-DDnxNUxd.js +1 -0
  181. package/dist/client/assets/left-DLoDKxT5.js +2 -0
  182. package/dist/client/assets/left-O-TBH7JB.js +1 -0
  183. package/dist/client/assets/left-agents-Dk9Y89lb.js +1 -0
  184. package/dist/client/assets/left-default-B3JBRQNJ.js +1 -0
  185. package/dist/client/assets/left-lanes-30Oe_3RM.js +1 -0
  186. package/dist/client/assets/left-mission-DEl4-7xu.js +1 -0
  187. package/dist/client/assets/left-plan-B4qdm4Gn.js +2 -0
  188. package/dist/client/assets/left-rvUOB14X.js +1 -0
  189. package/dist/client/assets/library-DDKSLFJ_.js +1 -0
  190. package/dist/client/assets/{loader-circle-Byb9kSFx.js → loader-circle-4LDsy4Ke.js} +1 -1
  191. package/dist/client/assets/{local-agents-DBaUbP-_.js → local-agents-DIi2EacM.js} +1 -1
  192. package/dist/client/assets/{mentions-fbQJ2mBI.js → mentions-CvDaviLJ.js} +1 -1
  193. package/dist/client/assets/{mesh-ops-Cnw3vwAu.js → mesh-ops-JZwGuAPn.js} +1 -1
  194. package/dist/client/assets/{mesh-view-store-Btlyc7rW.js → mesh-view-store-Du7VqIT_.js} +1 -1
  195. package/dist/client/assets/{message-circle-aGOfQWm2.js → message-circle-BM3XgevU.js} +1 -1
  196. package/dist/client/assets/{message-markup-mGF07emJ.js → message-markup-BcY1lShv.js} +1 -1
  197. package/dist/client/assets/{message-square-CIXda-Y7.js → message-square-ER1_q2pe.js} +1 -1
  198. package/dist/client/assets/{mission-control-store-CcoNeQHG.js → mission-control-store-C6w5iVfg.js} +1 -1
  199. package/dist/client/assets/{observe-BNFzh-7B.js → observe-3-jn4SXb.js} +1 -1
  200. package/dist/client/assets/{page-status-DDvNdA8s.js → page-status-0LPfBC8S.js} +1 -1
  201. package/dist/client/assets/{plus-CmFQp9Uj.js → plus-C-2gTcPK.js} +1 -1
  202. package/dist/client/assets/profile-DW80Gn5k.js +1 -0
  203. package/dist/client/assets/{projects-inbox-Diddml6e.js → projects-inbox-DCeD3FfV.js} +1 -1
  204. package/dist/client/assets/provider-BvAxRQfE.js +1 -0
  205. package/dist/client/assets/{radio-PauJIekM.js → radio-v7UAMZGh.js} +1 -1
  206. package/dist/client/assets/{refresh-cw-4oeFn1Jn.js → refresh-cw-B5To7b6B.js} +1 -1
  207. package/dist/client/assets/resolve-panes-BDi9Qx4R.js +1 -0
  208. package/dist/client/assets/resolve-sidebar-context-HE-5eZYa.js +1 -0
  209. package/dist/client/assets/right-BDf_yTv6.js +1 -0
  210. package/dist/client/assets/{right-BcFnuse9.js → right-BvoGOUKH.js} +1 -1
  211. package/dist/client/assets/right-C-bgjYg-.js +1 -0
  212. package/dist/client/assets/right-C3JdEfYQ.js +1 -0
  213. package/dist/client/assets/right-CYIs2tEe.js +1 -0
  214. package/dist/client/assets/right-CyRCv6Up.js +1 -0
  215. package/dist/client/assets/right-DBYGtoRv.js +1 -0
  216. package/dist/client/assets/right-o3LHMiKa.js +1 -0
  217. package/dist/client/assets/right-oPrcx9MX.js +1 -0
  218. package/dist/client/assets/right-sSvBUK-j.js +1 -0
  219. package/dist/client/assets/{rocket-C-AskjZH.js → rocket-BQQQv2L5.js} +1 -1
  220. package/dist/client/assets/router-C65cZYPn.js +1 -0
  221. package/dist/client/assets/{runtime-picker-BCQD7d4K.js → runtime-picker-eDEvx2Mz.js} +1 -1
  222. package/dist/client/assets/{scope-views-BhkbIFPY.js → scope-views-BOOmgmwx.js} +1 -1
  223. package/dist/client/assets/{scout-voice-S5_YZ2v8.js → scout-voice-B7kXlkcl.js} +1 -1
  224. package/dist/client/assets/{scroll-text-BV-BB7v-.js → scroll-text-BuneRiAD.js} +1 -1
  225. package/dist/client/assets/{search-C3bSJluv.js → search-7_n7CxWl.js} +1 -1
  226. package/dist/client/assets/{secondaryNavConfig-Bg4Tc0gT.js → secondaryNavConfig-CSFDCQAf.js} +1 -1
  227. package/dist/client/assets/{selection-bridge-B1dmkX3P.js → selection-bridge-SlGsgHw2.js} +1 -1
  228. package/dist/client/assets/{send-horizontal-CqogPmbY.js → send-horizontal-DP16OOIW.js} +1 -1
  229. package/dist/client/assets/{server-Brw5Y1Gh.js → server-pYOMFjrT.js} +1 -1
  230. package/dist/client/assets/{session-catalog-9FqXmjBw.js → session-catalog-_QfQ7fhZ.js} +1 -1
  231. package/dist/client/assets/{session-table-1xdSxSXq.js → session-table-CYN8e4s3.js} +1 -1
  232. package/dist/client/assets/{sliders-horizontal-CUiOH26y.js → sliders-horizontal-D2Z8gz6J.js} +1 -1
  233. package/dist/client/assets/{sparkles-BjCA3Evu.js → sparkles-Bth2iK7t.js} +1 -1
  234. package/dist/client/assets/{sse-QcU9bikk.js → sse-CL6gctHY.js} +1 -1
  235. package/dist/client/assets/{tail-events-C6K7bCWB.js → tail-events-NLIWLq27.js} +1 -1
  236. package/dist/client/assets/{terminal-DrTkVXIj.js → terminal-By1Lw2i2.js} +1 -1
  237. package/dist/client/assets/{terminal-relay-BkXjjSkq.js → terminal-relay-CjkI5aUy.js} +1 -1
  238. package/dist/client/assets/{terminal-sessions-C3qU8tnY.js → terminal-sessions-AmSgHklm.js} +1 -1
  239. package/dist/client/assets/{terminal-takeover-KvmTwABa.js → terminal-takeover-7AvNpnkC.js} +1 -1
  240. package/dist/client/assets/{use-conversation-list-C5sF6WBR.js → use-conversation-list-BCzY032j.js} +1 -1
  241. package/dist/client/assets/{use-fleet-active-asks-BOMPW0nl.js → use-fleet-active-asks-CJ6-oj5k.js} +1 -1
  242. package/dist/client/assets/{use-mesh-ops-items-Co05vcTV.js → use-mesh-ops-items-D5L-CKe_.js} +1 -1
  243. package/dist/client/assets/use-reduced-motion-CqXpVXv-.js +1 -0
  244. package/dist/client/assets/use-scout-dev-flags-BohC8seq.js +1 -0
  245. package/dist/client/assets/{useAgentHoverCard-FtCmY-b9.js → useAgentHoverCard-RsLUYyeh.js} +1 -1
  246. package/dist/client/assets/useContentSecondaryNav-DOr5yHbT.js +1 -0
  247. package/dist/client/assets/usePersistentState-D3M4m2Ou.js +1 -0
  248. package/dist/client/assets/{usePierreRuntime-Bo4lD7Ui.js → usePierreRuntime-B4hbNWTz.js} +1 -1
  249. package/dist/client/assets/{wrench-CeCdjiPF.js → wrench-M4G7WtYB.js} +1 -1
  250. package/dist/client/assets/{x-D4X_y1j_.js → x-ynOfVadO.js} +1 -1
  251. package/dist/client/assets/{xterm-D2a5wrkJ.js → xterm-DZHyijPp.js} +1 -1
  252. package/dist/client/index.html +2 -2
  253. package/dist/main.mjs +41 -26
  254. package/dist/node/main.mjs +19 -5
  255. package/dist/pairing-runtime-controller.mjs +2 -2
  256. package/dist/runtime/broker-daemon.mjs +2 -2
  257. package/dist/scout-control-plane-web.mjs +21 -7
  258. package/dist/scout-web-server.mjs +21 -7
  259. package/package.json +4 -4
  260. package/dist/client/assets/ActivityScreen-BXm6nJ6L.js +0 -1
  261. package/dist/client/assets/AgentConfigurationScreen-CfBXxrsD.js +0 -1
  262. package/dist/client/assets/AgentDefinitionsWorkspace-4Z0aN8AR.js +0 -1
  263. package/dist/client/assets/AgentFloorView-DMivAYHU.js +0 -1
  264. package/dist/client/assets/AgentInfoScreen-CPkLg1pK.js +0 -1
  265. package/dist/client/assets/AgentLanesEmbedScreen-CjHMvy3v.js +0 -1
  266. package/dist/client/assets/AgentsScreen-zR6b2bUL.js +0 -1
  267. package/dist/client/assets/AgentsSubnav-q0xcZi6C.js +0 -1
  268. package/dist/client/assets/BackToPicker-DZg_4nHL.js +0 -1
  269. package/dist/client/assets/BrokerScreen-Chh8sGen.js +0 -5
  270. package/dist/client/assets/ConversationFeedRows-5it6QNBV.js +0 -1
  271. package/dist/client/assets/ConversationPanels-vI9YuQJh.js +0 -2
  272. package/dist/client/assets/ConversationScreen-C-PrCRz1.js +0 -1
  273. package/dist/client/assets/FlightObserveScreen-Yq5NtQQJ.js +0 -1
  274. package/dist/client/assets/HarnessesScreen-L-emPcXd.js +0 -1
  275. package/dist/client/assets/KnowledgeSearchScreen-DvdOFh-b.js +0 -1
  276. package/dist/client/assets/LaneTraceDetailSheet-Dl7foF88.js +0 -1
  277. package/dist/client/assets/MeshScreen-D5zzTn0o.js +0 -1
  278. package/dist/client/assets/MessagesScreen-BhOJ7_tj.js +0 -1
  279. package/dist/client/assets/MissionControlView-D2JO9u-y.js +0 -1
  280. package/dist/client/assets/ObserveTextFlow-DJxQc2H6.js +0 -2
  281. package/dist/client/assets/OpenScoutAppShell-DrHYD_pd.js +0 -87
  282. package/dist/client/assets/OpsAgentsView-BnMX0vEY.js +0 -1
  283. package/dist/client/assets/OpsScreen-BeC0lieE.js +0 -1
  284. package/dist/client/assets/OpsSubnav-D5Bpowtk.js +0 -1
  285. package/dist/client/assets/ProjectAgentProfile-zE1cApxw.js +0 -1
  286. package/dist/client/assets/ProjectsInbox-C3Jd6JTk.js +0 -2
  287. package/dist/client/assets/ProjectsScreen-PW_NH5VK.js +0 -1
  288. package/dist/client/assets/ProjectsThreadAside-DaCEUWN1.js +0 -1
  289. package/dist/client/assets/Provider-DSsb2gLR.js +0 -1
  290. package/dist/client/assets/RawSessionsTable-LWEvXJzj.js +0 -1
  291. package/dist/client/assets/RealtimeVoiceScreen-XtxbCjOs.js +0 -1
  292. package/dist/client/assets/RepoDiffViewerLazy-DIxkiMto.js +0 -2
  293. package/dist/client/assets/ScoutDeckSurface-BCpl0QCx.js +0 -1
  294. package/dist/client/assets/ScoutbotBroadcastChip-z9R_pC_U.js +0 -2
  295. package/dist/client/assets/SessionRefScreen-Dk-O4OVt.js +0 -1
  296. package/dist/client/assets/SessionsScreen-BJEjuo2X.js +0 -1
  297. package/dist/client/assets/SettingsScreen-DJ-BhBwR.js +0 -1
  298. package/dist/client/assets/Terminal-Dp1FSGIS.js +0 -1
  299. package/dist/client/assets/TerminalEmbedScreen-DP9IM4xf.js +0 -1
  300. package/dist/client/assets/arrow-down-D3-IbArq.js +0 -1
  301. package/dist/client/assets/chunk-JTPDIGGW-s6WbxdjC.js +0 -46
  302. package/dist/client/assets/chunk-T65CQEWV-CiZ_ICHW.js +0 -1
  303. package/dist/client/assets/chunk-YOZR3KYS-DLOc92uD.js +0 -2
  304. package/dist/client/assets/content-7ZeCPAEt.js +0 -1
  305. package/dist/client/assets/content-BHUcUCH5.js +0 -1
  306. package/dist/client/assets/content-BUhvLPkv.js +0 -1
  307. package/dist/client/assets/content-BomQ5YWo.js +0 -1
  308. package/dist/client/assets/content-C39ELNgC.js +0 -1
  309. package/dist/client/assets/content-C4RYKHut.js +0 -1
  310. package/dist/client/assets/content-CCiZfG4H.js +0 -1
  311. package/dist/client/assets/content-CDpDtVI-.js +0 -1
  312. package/dist/client/assets/content-CO-9CeFd.js +0 -1
  313. package/dist/client/assets/content-CuOLxp1x.js +0 -1
  314. package/dist/client/assets/content-CvtLIjXS.js +0 -1
  315. package/dist/client/assets/content-CzwTUb9n.js +0 -1
  316. package/dist/client/assets/content-DQXbo2RO.js +0 -1
  317. package/dist/client/assets/content-DRTQ9QQb.js +0 -1
  318. package/dist/client/assets/content-LCELs6zg.js +0 -1
  319. package/dist/client/assets/content-qsDjA4Au.js +0 -1
  320. package/dist/client/assets/conversation-motion-features-T8vF9zED.js +0 -1
  321. package/dist/client/assets/discover-7Ks00w-M.js +0 -2
  322. package/dist/client/assets/embed-entry-n2ThmSSX.js +0 -2
  323. package/dist/client/assets/gestures-CxG3Dphs.js +0 -1
  324. package/dist/client/assets/hooks-Dst1TH7n.js +0 -2
  325. package/dist/client/assets/index-9as_JTUs.css +0 -1
  326. package/dist/client/assets/index-CU9dtwJk.js +0 -1
  327. package/dist/client/assets/index-Dewd56RX.js +0 -1
  328. package/dist/client/assets/index-_YQXKEhb.js +0 -1
  329. package/dist/client/assets/left-BhzPp-_E.js +0 -1
  330. package/dist/client/assets/left-CN1MABD0.js +0 -2
  331. package/dist/client/assets/left-DDgbsio7.js +0 -1
  332. package/dist/client/assets/left-Dpf2R9uD.js +0 -1
  333. package/dist/client/assets/left-HwwbMVtl.js +0 -2
  334. package/dist/client/assets/left-YfH0daht.js +0 -1
  335. package/dist/client/assets/left-agents-CYUwAy2Z.js +0 -1
  336. package/dist/client/assets/left-default-vEGZALPv.js +0 -1
  337. package/dist/client/assets/left-lanes-bphF-vlX.js +0 -1
  338. package/dist/client/assets/left-mission-B54-c3hq.js +0 -1
  339. package/dist/client/assets/left-np5USKqG.js +0 -1
  340. package/dist/client/assets/left-plan-BNBuDoPQ.js +0 -2
  341. package/dist/client/assets/library-DbCVJG_O.js +0 -1
  342. package/dist/client/assets/paperclip-DfpJkR4s.js +0 -1
  343. package/dist/client/assets/profile-s3KRbip1.js +0 -1
  344. package/dist/client/assets/resolve-panes-cp6eNewO.js +0 -1
  345. package/dist/client/assets/resolve-sidebar-context-Dbo-5PWx.js +0 -1
  346. package/dist/client/assets/right-09W2JJFg.js +0 -1
  347. package/dist/client/assets/right-B-MKhiJ6.js +0 -1
  348. package/dist/client/assets/right-B91Zl8lQ.js +0 -1
  349. package/dist/client/assets/right-BdtMzn35.js +0 -1
  350. package/dist/client/assets/right-BqmKXLtf.js +0 -1
  351. package/dist/client/assets/right-BzeB-Dpt.js +0 -1
  352. package/dist/client/assets/right-CkGOs-sq.js +0 -1
  353. package/dist/client/assets/right-CzGiNBzB.js +0 -1
  354. package/dist/client/assets/right-Dc7uqv7l.js +0 -1
  355. package/dist/client/assets/router-B-K15T7B.js +0 -1
  356. package/dist/client/assets/use-reduced-motion-Dla-G_Jz.js +0 -1
  357. package/dist/client/assets/use-scout-dev-flags-BOQF3fW2.js +0 -1
  358. package/dist/client/assets/useContentSecondaryNav-BX7Sq7vy.js +0 -1
@@ -1 +1 @@
1
- import{r as m,j as s}from"./index-CzVeWScw.js";import{a as y,c as p,d as b,f as x}from"./broker-display-pp33bLsu.js";import{C as u}from"./chevron-down-DRCbnzyY.js";import{C as j}from"./chevron-right-CNE6QAVr.js";import"./status-tone-BM_zuRy1.js";import"./createLucideIcon-ClCdc3F9.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-o4FKpU7Z.js";import{a as y,c as p,d as b,f as x}from"./broker-display-pp33bLsu.js";import{C as u}from"./chevron-down-NAhBUkFd.js";import{C as j}from"./chevron-right-C10o7t_X.js";import"./status-tone-BM_zuRy1.js";import"./createLucideIcon-Bt67PWH-.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,5 @@
1
+ import{r as n,j as e}from"./index-o4FKpU7Z.js";import{r as cs}from"./index-BMwKgdz_.js";import{D as ds}from"./runtime-picker-eDEvx2Mz.js";import{E as Ie}from"./EmptyState-BUvllvA6.js";import{u as us,i as hs}from"./MessageComposerSuggestions-Dfc3PH2y.js";import{r as fs,R as ms,a as ps,b as bs}from"./NewChatComposer-S08F6_La.js";import{a as ne}from"./api-h5zurxmi.js";import{c as ys}from"./clipboard-e3fSpeo7.js";import{u as gs}from"./sse-CL6gctHY.js";import{b as Fe}from"./status-tone-BM_zuRy1.js";import{t as Ce,b as Qe,n as V}from"./time-Dhsh_2EG.js";import{u as Ve,A as xs}from"./Provider-DKZWuzSR.js";import{o as Oe}from"./openContent-C6XO6kr5.js";import{g as js,b as oe,h as Ye,e as ks,i as vs,d as ws,j as Ns,k as Ss,l as Rs,m as As}from"./broker-display-pp33bLsu.js";import{BrokerMetadataPanel as Is}from"./BrokerMetadataPanel-jg7odHQp.js";import{DispatchAftermath as Cs}from"./DispatchAftermath-DowTb7uO.js";import{i as $s,c as Ds,n as _e}from"./keyboard-nav-Chf51dns.js";import{ShikiPane as Es}from"./ShikiPane-Dkwyx--r.js";import{d as Fs}from"./types-B0PlfpKc.js";/* empty css */import{L as ke}from"./loader-circle-4LDsy4Ke.js";import{R as Ms}from"./refresh-cw-B5To7b6B.js";import{X as $e}from"./x-ynOfVadO.js";import{c as Ne}from"./createLucideIcon-Bt67PWH-.js";import{E as Ke}from"./external-link-Dem738OJ.js";import{C as Ls}from"./chevron-down-NAhBUkFd.js";import{S as Ts}from"./sparkles-Bth2iK7t.js";import{P as Ps}from"./plus-C-2gTcPK.js";import{S as Bs}from"./send-horizontal-DP16OOIW.js";import{C as zs}from"./check--esHw52j.js";import{C as qs}from"./copy-Dty8ZYsM.js";import{M as Os}from"./message-square-ER1_q2pe.js";import{R as _s}from"./radio-v7UAMZGh.js";import{b as Ks,M as Us}from"./DocumentFocusViewer-DRKjNG9s.js";import{B as Hs}from"./bot-BUK7dOPS.js";const Js=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Ws=Ne("arrow-down",Js);const Qs=[["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"}]],Vs=Ne("at-sign",Qs);const Ys=[["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"}]],Gs=Ne("hash",Ys);const Xs=[["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"}]],Zs=Ne("paperclip",Xs),er=160;function Ue(s){const a=new URLSearchParams({limit:String(er)});return s&&a.set("cursor",s),`/api/broker?${a.toString()}`}const He={index:-1,request:0};function sr(s,a){return{index:a,request:s.request+1}}function Ge(s,a){return a===s.index?s:{index:a,request:s.request}}function rr(s,a){return s.index<a?s:Ge(s,a>0?a-1:-1)}function ar(s,a){return s.request!==a}function tr({enabled:s,rowCount:a,onActivateRow:t,onClearSelection:i}){const[f,d]=n.useState(He),b=f.index,u=n.useRef(new Map),c=n.useRef(He.request),j=n.useCallback(y=>{d(m=>sr(m,typeof y=="function"?y(m.index):y))},[]),k=n.useCallback(y=>{d(m=>Ge(m,typeof y=="function"?y(m.index):y))},[]);n.useEffect(()=>{if(!ar(f,c.current)||(c.current=f.request,f.index<0))return;const y=u.current.get(f.index);y?.scrollIntoView({block:"nearest"}),y?.focus()},[f]),n.useEffect(()=>{d(y=>rr(y,a))},[a]);const A=n.useCallback((y,m)=>{m?u.current.set(y,m):u.current.delete(y)},[]);n.useEffect(()=>{if(!s)return;const y=m=>{if(document.querySelector(".sys-broker-page")&&!($s(m.target)||Ds())&&a!==0){if(m.key==="Escape"){i&&(m.preventDefault(),i(),k(-1));return}if(m.key==="ArrowDown"||m.key==="j"){m.preventDefault(),j(S=>_e(S,a,1));return}if(m.key==="ArrowUp"||m.key==="k"){m.preventDefault(),j(S=>_e(S,a,-1));return}if(m.key==="Home"||m.key==="g"&&!m.shiftKey){m.preventDefault(),j(0);return}if(m.key==="End"||m.key==="G"){m.preventDefault(),j(a-1);return}if(m.key==="Enter"||m.key===" "){const S=b<0?0:b;m.preventDefault(),j(S),t(S)}}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s,b,j,t,i,a,k]);const U=n.useCallback(y=>({tabIndex:b===y?0:-1,ref:m=>A(y,m),onFocus:()=>k(y)}),[b,A,k]);return{focusedIndex:b,setFocusedIndex:k,getRowFocusProps:U}}const be=["all","delivered","failed"],nr={all:"All",delivered:"Delivered",failed:"Failed"};function or(s){switch(s){case"success":return"Success";case"failed_query":return"Query failure";case"failed_delivery":return"Delivery failure";default:return"Delivery attempt"}}function Xe(s){return s.messageId??s.deliveryId??s.invocationId??s.id}function Ze(s){switch(Fe(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 De(s){if(!s)return"··";const a=s.trim().split(/\s+/).filter(Boolean);if(a.length===0)return"··";const t=a[a.length-1];return/^\d+$/.test(t)?t.slice(-2):a.length>=2?(a[0][0]+a[1][0]).toUpperCase():s.trim().slice(0,2).toUpperCase()}function ir(s){const a=V(s)??0;return new Date(a).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Je(s){const a=V(s);return a===null?"—":new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Se(s,a,t=0){if(!s||typeof s!="object"||Array.isArray(s)||t>3)return;const i=s;for(const f of a)if(i[f]!==void 0&&i[f]!==null)return i[f];for(const f of Object.values(i)){const d=Se(f,a,t+1);if(d!==void 0)return d}}function B(s,...a){const t=Se(s.metadata,a);return typeof t!="string"&&typeof t!="number"?null:String(t).trim()||null}function ve(s,...a){const t=Se(s.metadata,a);return typeof t=="number"||typeof t=="string"?V(t):null}function es(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 we(s,a){if(a==="to")return s.route==="channel"?"Channel":s.route==="broadcast"?"Broadcast":s.target?.toLowerCase().includes("operator")?"Operator":"Agent lane";const t=B(s,"class","actorClass")?.toLowerCase();return t==="operator"||t==="human"?"Operator":t==="agent"?"Agent":s.actorName?.toLowerCase().includes("operator")?"Operator":"Sender"}function lr(s){const a=Se(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 t=ve(s,"sentAt","createdAt")??V(s.ts),i=ve(s,"deliveredAt","completedAt");if(t===null||i===null||i<t)return"—";const f=i-t;return f<1e3?`${f}ms`:`${(f/1e3).toFixed(f<1e4?1:0)}s`}function Ee({route:s}){switch(s){case"channel":return e.jsx(Gs,{size:12,"aria-hidden":"true"});case"broadcast":return e.jsx(_s,{size:12,"aria-hidden":"true"});case"dm":return e.jsx(Vs,{size:12,"aria-hidden":"true"});default:return e.jsx(Os,{size:12,"aria-hidden":"true"})}}function cr(s,a){if(!a)return null;const t=a.trim().replace(/^@/,"").toLowerCase();return s.find(i=>[i.id,i.name,i.handle,i.selector,i.defaultSelector,i.conversationId,i.harnessSessionId].some(f=>f?.trim().replace(/^@/,"").toLowerCase()===t))??null}function dr(s,a,t){const i=t?.authorityNodeName??t?.homeNodeName??t?.authorityNodeId??t?.homeNodeId??B(s,"machine","machineName","nodeName");return(t?[{label:"Status",value:t.state},{label:"Handle",value:t.handle?`@${t.handle.replace(/^@/,"")}`:null},{label:"Project",value:t.project},{label:"Branch",value:t.branch},{label:"Runtime",value:[t.harness,t.model,t.reasoningEffort].filter(Boolean).join(" · ")||null},{label:"Machine",value:i},{label:"Working dir",value:t.cwd??t.projectRoot},{label:"Session",value:t.harnessSessionId},{label:"Conversation",value:t.conversationId??s.conversationId}]:[{label:"Kind",value:a==="to"&&s.conversationId?"Session route":we(s,a)},{label:"Channel",value:es(s.route)},{label:"Session",value:a==="to"?s.target:B(s,"sessionId","harnessSessionId")},{label:"Conversation",value:s.conversationId},{label:"Harness",value:B(s,"harness")},{label:"Model",value:B(s,"model")},{label:"Project",value:B(s,"project","projectName")},{label:"Branch",value:B(s,"branch")},{label:"Machine",value:i}]).filter(d=>!!d.value)}function We({attempt:s,agents:a,side:t}){const i=t==="from"?s.actorName:s.target,f=cr(a,i),d=f?.name??i??(t==="from"?"Unknown":"No target"),b=f?"Agent":t==="to"&&s.conversationId?"Session":we(s,t),u=dr(s,t,f),c=`dispatch-endpoint-${s.id}-${t}`;return e.jsxs("span",{className:`sys-broker-endpoint sys-broker-endpoint--${t}`,tabIndex:0,"aria-describedby":c,children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:f||t==="from"?De(d):e.jsx(Ee,{route:s.route})}),e.jsx("span",{className:"sys-broker-endpoint-name",title:d,children:d}),e.jsxs("span",{className:"sys-broker-endpoint-card",id:c,role:"tooltip",children:[e.jsxs("span",{className:"sys-broker-endpoint-card-head",children:[e.jsx("span",{className:"sys-broker-avatar","aria-hidden":"true",children:f||t==="from"?De(d):e.jsx(Ee,{route:s.route})}),e.jsxs("span",{children:[e.jsx("strong",{children:d}),e.jsx("small",{children:b})]})]}),e.jsx("span",{className:"sys-broker-endpoint-card-body",children:u.map(j=>e.jsxs("span",{className:"sys-broker-endpoint-card-field",children:[e.jsx("small",{children:j.label}),e.jsx("code",{title:j.value,children:j.value})]},j.label))})]})]})}function ye(s){const a=V(s)??0,t=new Date(a);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function ur(s,a=Date.now()){const t=V(s)??0,i=new Date(t),f=new Date(a),d=new Date(a);return d.setDate(d.getDate()-1),ye(s)===ye(f.getTime())?"Today":ye(s)===ye(d.getTime())?"Yesterday":i.toLocaleDateString(void 0,{month:"short",day:"numeric",year:i.getFullYear()===f.getFullYear()?void 0:"numeric"})}function hr(s,a,t){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,[t]:a.ledger.cursors[t]},hasMore:{...s.ledger.hasMore,[t]:a.ledger.hasMore[t]}}}}function fr({navigate:s,embedded:a=!1,initialAttemptId:t}){const{route:i,agents:f,selectedBrokerAttempt:d,inspectBrokerAttempt:b,clearBrokerAttempt:u}=Ve(),[c,j]=n.useState(null),k=i.view==="broker"?i.filter??"all":"all",[A,U]=n.useState(!0),[y,m]=n.useState(!1),[S,Y]=n.useState(!1),[te,z]=n.useState(null),E=n.useRef(null),F=n.useRef(0),q=n.useRef(null),M=n.useCallback(async(o="initial")=>{const h=++F.current;!E.current&&o!=="background"?(U(!0),z(null)):m(!0);try{const x=await ne(Ue());if(h!==F.current)return;E.current=x,j(x),z(null)}catch(x){if(h!==F.current)return;z(x instanceof Error?x.message:String(x))}finally{h===F.current&&(U(!1),m(!1))}},[]),G=n.useCallback(async()=>{const o=E.current;if(!o||S)return;const h="attempts",x=o.ledger.cursors[h];if(!x||!o.ledger.hasMore[h])return;const T=++F.current;Y(!0),z(null);try{const P=await ne(Ue(x));if(T!==F.current)return;const se=E.current,ue=se?hr(se,P,h):P;E.current=ue,j(ue)}catch(P){if(T!==F.current)return;z(P instanceof Error?P.message:String(P))}finally{T===F.current&&Y(!1)}},[S]),le=n.useCallback(()=>{q.current||(q.current=setTimeout(()=>{q.current=null,M("background")},250))},[M]);n.useEffect(()=>(M("initial"),()=>{q.current&&clearTimeout(q.current)}),[M]),gs(o=>{(o.kind==="message.posted"||o.kind==="delivery.planned"||o.kind==="delivery.attempted"||o.kind==="delivery.state.changed"||o.kind==="scout.dispatched")&&le()});const v=n.useMemo(()=>{if(!c)return[];const o=new Map(c.dialogue.map(h=>[h.id,h.body]));return js(c.attempts).map(h=>{const x=h.messageId?o.get(h.messageId):null;return x&&x!==h.detail?{...h,detail:x}:h})},[c]),I=n.useMemo(()=>{switch(k){case"delivered":return v.filter(o=>!oe(o));case"failed":return v.filter(oe);default:return v}},[k,v]),ge=c?.ledger.hasMore.attempts??!1,X=n.useMemo(()=>({all:v.length,delivered:v.filter(o=>!oe(o)).length,failed:v.filter(oe).length}),[v]),$=n.useMemo(()=>{const o=i.view==="broker"?i.attemptId:void 0;return!c||!o?null:v.find(h=>h.id===o)??c.attempts.find(h=>h.id===o)??c.failedQueries.find(h=>h.id===o)??c.failedDeliveries.find(h=>h.id===o)??null},[c,v,i]),Z=$?`${$.id}\0${$.status}\0${$.ts}`:null,D=d?`${d.id}\0${d.status}\0${d.ts}`:null;n.useEffect(()=>{$&&Z!==D&&b($)},[D,b,$,Z]);const[C,N]=n.useState(null),O=n.useRef(!1),_=n.useCallback(o=>{if(a){O.current=!0,N(o);return}b(o)},[a,b]),H=n.useCallback(()=>{if(a){O.current=!0,N(null);return}u()},[u,a]),J=n.useCallback(o=>{const h=I[o];h&&(_(h),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}})))},[I,_]),{getRowFocusProps:ce,setFocusedIndex:xe}=tr({enabled:!!c&&I.length>0,rowCount:I.length,onActivateRow:J,onClearSelection:H}),de=C?.id??null,L=C?`${C.id} ${C.status} ${C.ts}`:null;n.useEffect(()=>{if(!a||!de)return;const o=v.find(h=>h.id===de);o&&`${o.id} ${o.status} ${o.ts}`!==L&&N(o)},[a,de,L,v]),n.useEffect(()=>{if(!a||!t||!c||O.current||C)return;const o=v.find(h=>h.id===t)??c.attempts.find(h=>h.id===t)??c.failedQueries.find(h=>h.id===t)??c.failedDeliveries.find(h=>h.id===t);o&&(O.current=!0,N(o))},[c,a,C,v,t]),n.useEffect(()=>{const o=i.view==="broker"?i.attemptId:void 0;if(!o)return;const h=I.findIndex(x=>x.id===o);h>=0&&xe(h)},[I,k,i,xe]);const ee=n.useCallback(o=>{const x=(be.indexOf(k)+o+be.length)%be.length,T=be[x];s({view:"broker",...T==="all"?{}:{filter:T}})},[k,s]),R=a?C:null;return e.jsx("div",{className:`s-ops${a?" s-ops--embedded":""}${R?" 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:o=>{o.key==="ArrowRight"?(o.preventDefault(),ee(1)):o.key==="ArrowLeft"&&(o.preventDefault(),ee(-1))},children:be.map(o=>e.jsxs("button",{type:"button",role:"tab","aria-selected":k===o,className:`sys-tab${k===o?" sys-tab-active":""}`,onClick:()=>s({view:"broker",...o==="all"?{}:{filter:o}}),children:[e.jsx("span",{children:nr[o]}),e.jsx("span",{className:"sys-tab-count",children:X[o]})]},o))}):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:A?"Loading dispatch ledger...":c?`Updated ${Ce(c.generatedAt)}${c.source?.latestMessageAt?` · latest message ${Ce(c.source.latestMessageAt)}`:""}`:"Waiting for dispatch data"}),e.jsx("button",{type:"button",className:"s-btn",disabled:A||y,onClick:()=>{M("manual")},children:y?"Refreshing...":"Refresh"})]})]}),te&&e.jsxs("div",{className:"sys-banner sys-banner-warning",children:[e.jsx("strong",{children:"Refresh failed."}),e.jsx("span",{children:te})]}),y&&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…"})]}),!y&&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:"Dispatch may be out of date"}),e.jsx("span",{children:"Live broker unavailable; showing saved dispatch history."})]}),A&&!c&&e.jsx(Ie,{title:"Loading dispatch",body:"Reading the dispatch database snapshot."}),!A&&!c&&!te&&e.jsx(Ie,{title:"No dispatch data",body:"No dispatch rows are available yet."}),c&&e.jsxs(e.Fragment,{children:[e.jsx(mr,{attempts:I,agents:f,selectedAttemptId:a?C?.id??null:d?.id??(i.view==="broker"?i.attemptId??null:null),onInspect:_,getRowFocusProps:ce}),I.length>0&&ge&&e.jsx("div",{className:"sys-ledger-footer",children:e.jsx("button",{type:"button",className:"s-btn",disabled:S,onClick:()=>{G()},children:S?"Loading older...":"Load older"})})]})]}),R&&e.jsx("div",{className:"s-broker-embed-detail",children:e.jsx(ss,{attempt:R,navigate:s,onClose:H})})]})})}function mr({attempts:s,agents:a,selectedAttemptId:t,onInspect:i,getRowFocusProps:f}){if(s.length===0)return e.jsx(Ie,{title:"No dispatch rows",body:"No dispatch rows are available yet."});const d=s.reduce((b,u,c)=>{const j=ye(u.ts),k=b[b.length-1];return k?.key===j?k.attempts.push({attempt:u,index:c}):b.push({key:j,label:ur(u.ts),attempts:[{attempt:u,index:c}]}),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--status",children:"Status"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--from",children:"From"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--to",children:"To"}),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"})]}),d.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:u,index:c})=>{const j=Fe(u.kind,u.status),k=oe(u),A=Ye(u),U=ks(u.detail,vs(u)),y=Ze(u),m=()=>{i(u),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}}))};return e.jsxs("div",{role:"listitem",className:`sys-broker-wire-row${k?" sys-broker-wire-row--failure":""}${t===u.id?" sys-broker-wire-row--selected":""}`,"aria-label":`Inspect ${u.detail}`,onClick:m,...f(c),children:[e.jsxs("div",{className:"sys-broker-cell sys-broker-col--status",children:[e.jsx("span",{className:`sys-broker-dot sys-broker-dot--${j}`,"aria-hidden":"true"}),e.jsx("span",{className:`sys-broker-state sys-broker-state--${j}`,children:y})]}),e.jsx("div",{className:"sys-broker-cell sys-broker-col--from",children:e.jsx(We,{attempt:u,agents:a,side:"from"})}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--to",children:[e.jsx(xs,{className:"sys-broker-route-arrow",size:13,"aria-hidden":"true"}),e.jsx(We,{attempt:u,agents:a,side:"to"})]}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--msg",children:[e.jsx("span",{className:"sys-broker-msg",title:u.detail,children:U}),k&&A&&e.jsx("span",{className:"sys-broker-msg-error",title:A,children:A})]}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--time",children:[e.jsx("time",{className:"sys-broker-time-rel",title:Qe(u.ts),children:Ce(u.ts)}),e.jsx("span",{className:"sys-broker-time-abs",children:ir(u.ts)})]})]},u.id)})})]},b.key))]})}function pr(s){const a=Xe(s);return[{label:"Kind",value:or(s.kind)},{label:"Time",value:Qe(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(t=>!!t.value)}function ie({value:s,subject:a,className:t}){const[i,f]=n.useState("idle"),d=n.useRef(null);n.useEffect(()=>{f("idle")},[s]),n.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const b=n.useCallback(async()=>{const j=await ys(s);d.current&&clearTimeout(d.current),f(j?"copied":"failed"),d.current=setTimeout(()=>{f("idle"),d.current=null},1500)},[s]),u=i==="copied",c=i==="failed";return e.jsx("button",{type:"button",className:`sys-copy-btn${t?` ${t}`:""}${u?" sys-copy-btn--copied":""}${c?" sys-copy-btn--failed":""}`,onClick:()=>{b()},title:u?`Copied ${a}`:c?"Copy failed":`Copy ${a}`,"aria-label":u?`Copied ${a}`:c?`Copy ${a} failed`:`Copy ${a}`,children:u?e.jsx(zs,{size:14,"aria-hidden":"true"}):e.jsx(qs,{size:14,"aria-hidden":"true"})})}function br(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 yr({payload:s}){const a=n.useMemo(()=>br(s),[s]),[t,i]=n.useState(!1),f=n.useRef(null),d=a.code.split(`
2
+ `).length;n.useEffect(()=>{const u=f.current;!u||!t||u.open||u.showModal()},[t]),n.useEffect(()=>{i(!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(Es,{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," · ",d," ",d===1?"line":"lines"]}),e.jsx(ie,{value:s,subject:"payload"}),e.jsx("button",{type:"button",className:"sys-copy-btn sys-broker-payload-expand",onClick:()=>i(!0),title:"Expand payload","aria-label":"Expand payload",children:e.jsx(Ks,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-resizer",children:b}),t&&cs.createPortal(e.jsxs("dialog",{ref:f,className:"sys-broker-payload-dialog","aria-label":"Expanded dispatch payload",onCancel:u=>{u.preventDefault(),i(!1)},onClose:()=>i(!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," · ",d," ",d===1?"line":"lines"]})]}),e.jsx(ie,{value:s,subject:"payload"}),e.jsx("button",{type:"button",className:"sys-copy-btn",onClick:()=>i(!1),title:"Return payload to inspector","aria-label":"Return payload to inspector",children:e.jsx(Us,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-dialog-body",children:b})]}),document.body)]})}function gr({attempt:s}){const a=As(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($e,{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(ie,{value:s.detail,subject:"failure detail"})]})}function ss({attempt:s,navigate:a,onClose:t}){const{route:i,agents:f,scoutbotAgentId:d}=Ve(),b=pr(s),u=ws(s.metadata),c=oe(s),j=s.kind==="failed_query",k=Ye(s),A=Fe(s.kind,s.status),U=ve(s,"sentAt","createdAt")??V(s.ts),y=ve(s,"deliveredAt","completedAt")??V(s.ts),m=Xe(s),[S,Y]=n.useState("idle"),[te,z]=n.useState(null),[E,F]=n.useState(null),[q,M]=n.useState(""),[G,le]=n.useState(""),[v,I]=n.useState("idle"),[ge,X]=n.useState(null),[$,Z]=n.useState(""),[D,C]=n.useState(""),[N,O]=n.useState(""),[_,H]=n.useState(""),[J,ce]=n.useState("medium"),[xe,de]=n.useState(null),[L,ee]=n.useState([]),[R,o]=n.useState("idle"),[h,x]=n.useState(null),T=B(s,"harness"),P=B(s,"model"),se=B(s,"reasoningEffort","effort"),ue=n.useRef(null),Me=n.useRef(null),Re=n.useMemo(()=>Ns(s),[s]),w=n.useMemo(()=>f.filter(r=>!r.retiredFromFleet&&!r.staleLocalRegistration).slice().sort((r,l)=>r.id===d?-1:l.id===d?1:(l.updatedAt??0)-(r.updatedAt??0)||r.name.localeCompare(l.name)),[f,d]),he=n.useMemo(()=>Ss(s,w)?.id??"",[s,w]),fe=w.some(r=>r.id===d)?d:w[0]?.id??"",je=w[0]?.id??"",re=w.find(r=>r.id===fe)??null,rs=n.useMemo(()=>{const r=new Map;for(const l of w){const p=l.projectRoot?.trim()||l.cwd?.trim();if(!p)continue;const g=p.split("/").filter(Boolean).at(-1)??p;r.set(p,l.project?.trim()||g)}return[...r.entries()].map(([l,p])=>({path:l,label:p}))},[w]),Le=n.useRef({originalTargetAgentId:he,firstRoutableAgentId:je,defaultForwardAgentId:fe,defaultForwardAgent:re,effort:"medium"});Le.current={originalTargetAgentId:he,firstRoutableAgentId:je,defaultForwardAgentId:fe,defaultForwardAgent:re,effort:B(s,"reasoningEffort","effort")||"medium"};const me=n.useRef(!1);n.useEffect(()=>{const r=Le.current;me.current=!1,Y("idle"),z(null),F(null),M(""),le(r.originalTargetAgentId||r.firstRoutableAgentId),I("idle"),X(null),Z(r.defaultForwardAgentId),C(r.defaultForwardAgent?.projectRoot?.trim()||r.defaultForwardAgent?.cwd?.trim()||""),O(r.defaultForwardAgent?.harness?.trim()||""),H(r.defaultForwardAgent?.model?.trim()||""),ce(r.effort),ee([]),o("idle"),x(null)},[s.id]),n.useEffect(()=>{me.current||(le(r=>r||he||je),Z(r=>r||fe),C(r=>r||re?.projectRoot?.trim()||re?.cwd?.trim()||""),O(r=>r||re?.harness?.trim()||""),H(r=>r||re?.model?.trim()||""))},[re,fe,je,he]),n.useEffect(()=>{const r=new URLSearchParams({scope:"global+project"});D&&r.set("projectRoot",D);let l=!1;return ne(`/api/runner/options?${r.toString()}`).then(p=>{!l&&p.schemaVersion==="openscout.runtime-capabilities.v1"&&de(p)}).catch(()=>{}),()=>{l=!0}},[D]);const as=n.useCallback(r=>{M(r),window.requestAnimationFrame(()=>ue.current?.focus())},[]),ts=n.useCallback(async()=>{const r=w.find(l=>l.id===G);if(!(!r||v==="sending")){I("sending"),X(null);try{const l=await ne("/api/ask",{method:"POST",body:JSON.stringify({body:s.detail,targetAgentId:r.id,targetLabel:r.name,...T||P||se?{execution:{...T?{harness:T}:{},...P?{model:P}:{},...se?{reasoningEffort:se}:{},session:"new"}}:{},metadata:{source:"scout-dispatch-redispatch",originalDispatchId:s.id,...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),p=l.flightId??l.flight?.id;I("sent"),X(`New dispatch sent to ${r.name}${p?` · ${p}`:""}`)}catch(l){I("failed"),X(`Retry failed. ${l instanceof Error?l.message:String(l)}`)}}},[s,G,v,se,T,P,w]),Te=n.useCallback(async()=>{const r=q.trim(),l=w.find(p=>p.id===$);if(!(!r||!l||R==="sending")){o("sending"),x(L.length>0?`Uploading ${L.length} ${L.length===1?"attachment":"attachments"}…`:null);try{const p=L.length>0?await us(L):[],g=await ne("/api/ask",{method:"POST",body:JSON.stringify({body:`${r}
3
+
4
+ Attached dispatch context:
5
+ ${Re}`,targetAgentId:l.id,targetLabel:l.name,...p.length>0?{attachments:p}:{},execution:{...N?{harness:N}:{},..._?{model:_}:{},...J?{reasoningEffort:J}:{}},metadata:{source:"scout-dispatch-forward",originalDispatchId:s.id,...D?{targetProjectPath:D}:{},...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),W=g.flightId??g.flight?.id;o("sent"),x(`Request sent to ${l.name}${W?` · ${W}`:""}`),M(""),ee([])}catch(p){o("failed"),x(`Request wasn't sent. ${p instanceof Error?p.message:String(p)}`)}}},[s,Re,$,J,L,N,_,D,R,q,w]),ns=n.useCallback(r=>{const l=r.filter(hs),p=r.length-l.length;l.length>0&&(ee(g=>[...g,...l]),o("idle"),x(null)),p>0&&(o("failed"),x("Attach markdown, code, an image, or a video clip."))},[]),os=c?["Get a second opinion","Propose a recovery plan","Draft a follow-up"]:["Summarize this dispatch","Draft a follow-up","What changed?"],K=w.find(r=>r.id===G)??null,ae=w.find(r=>r.id===$)??null,pe=w.filter(r=>D?(r.projectRoot?.trim()||r.cwd?.trim())===D:!0),Pe=xe??ms,Ae=n.useMemo(()=>{const r=fs(Pe),l=[_,ae?.harness===N?ae.model:null,...pe.filter(g=>g.harness===N).map(g=>g.model)].map(g=>g?.trim()).filter(g=>!!g);let p=r.harnesses;return p.some(g=>g.value===N)||(p=[{value:N,label:N||"default",models:[]},...p]),p=p.map(g=>{if(g.value!==N)return g;const W=g.models.some(Q=>Q.value==="")?g.models:[{value:"",label:"Default",note:"harness picks"},...g.models],ls=new Set(W.map(Q=>Q.value)),qe=l.filter(Q=>!ls.has(Q)).map(Q=>({value:Q,label:Q,note:"observed"}));return qe.length===0&&W===g.models?g:{...g,models:[...W,...qe]}}),{...r,harnesses:p}},[Pe,ae,N,_,pe]);n.useEffect(()=>{const r=ps(Ae,N);!r||r.some(l=>l.value===J)||ce(r.find(l=>l.value==="medium")?.value??r[0]?.value??"")},[Ae,N,J]);const is=n.useCallback(async()=>{Y("running"),z(null);try{const r=await ne("/api/broker/dispatch-review",{method:"POST",body:JSON.stringify(Rs(s))});Y("sent"),F(r.conversationId),z(r.conversationId?`Report started${r.targetLabel?` with ${r.targetLabel}`:""}. Open the conversation to follow it.`:`Report started${r.targetLabel?` with ${r.targetLabel}`:""}${r.flightId?` · ${r.flightId}`:""}.`)}catch(r){Y("failed"),z(`Couldn't start the report. ${r instanceof Error?r.message:String(r)}`)}},[s]),Be=c?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-report-title",children:"Failure report"}),e.jsxs("button",{type:"button",className:"sys-broker-report-button",disabled:S==="running"||S==="sent"&&!E,onClick:()=>{if(E){Oe(a,{view:"conversation",conversationId:E},{returnTo:i});return}is()},children:[S==="running"?e.jsx(ke,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):E?e.jsx(Ke,{size:13,"aria-hidden":"true"}):e.jsx(Hs,{size:13,"aria-hidden":"true"}),S==="running"?"Starting report…":E?"Open report conversation":"Start failure report"]})]}),te&&e.jsx("div",{className:`sys-broker-review-status sys-broker-review-status--${S}`,role:"status",children:te})]}):null,ze=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:G,disabled:v==="sending"||w.length===0,onChange:r=>{le(r.target.value),I("idle"),X(null)},children:w.length===0?e.jsx("option",{value:"",children:"No agents available"}):e.jsxs(e.Fragment,{children:[!G&&e.jsx("option",{value:"",children:"Original destination unavailable"}),w.map(r=>e.jsxs("option",{value:r.id,children:[r.id===d?"Scout":r.name,r.project?` · ${r.project}`:""]},r.id))]})}),e.jsxs("button",{type:"button",className:"sys-broker-redispatch-send",disabled:!K||v==="sending",onClick:()=>{ts()},children:[v==="sending"?e.jsx(ke,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(Ms,{size:13,"aria-hidden":"true"}),v==="sending"?"Retrying…":"Retry dispatch"]})]})]}),K&&e.jsxs("div",{className:"sys-broker-action-target-meta",children:[K.harness&&e.jsx("span",{children:K.harness}),K.model&&e.jsx("span",{children:K.model}),(K.cwd??K.projectRoot)&&e.jsx("code",{children:K.cwd??K.projectRoot})]}),ge&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${v}`,role:"status",children:ge})]});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--${A}`,"aria-hidden":"true"}),e.jsx("strong",{className:`sys-broker-state sys-broker-state--${A}`,children:Ze(s)}),e.jsx("code",{title:m,children:m}),e.jsx(ie,{value:Re,subject:"dispatch context",className:"sys-broker-inspector-copy"}),e.jsx("button",{type:"button",className:"sys-copy-btn sys-broker-inspector-close",onClick:t,title:"Close inspector","aria-label":"Close inspector",children:e.jsx($e,{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:De(s.actorName)}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["From · ",we(s,"from")]}),e.jsx("strong",{children:s.actorName??"Unknown sender"})]})]}),e.jsx(Ws,{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(Ee,{route:s.route})}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["To · ",we(s,"to")]}),e.jsx("code",{title:s.target??"No target",children:s.target??"No target"})]}),s.conversationId&&e.jsxs("button",{type:"button",className:"sys-broker-route-button",onClick:()=>Oe(a,{view:"conversation",conversationId:s.conversationId},{returnTo:i}),children:[e.jsx(Ke,{size:11,"aria-hidden":"true"}),"Route"]})]})]}),e.jsxs("dl",{className:"sys-broker-delivery-grid",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Channel"}),e.jsx("dd",{children:es(s.route)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Latency"}),e.jsx("dd",{className:"sys-broker-delivery-accent",children:lr(s)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Sent"}),e.jsx("dd",{children:Je(U)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:c?"Failed":"Delivered"}),e.jsx("dd",{children:Je(y)})]})]}),e.jsxs("section",{className:"sys-broker-payload",children:[j?e.jsx(gr,{attempt:s}):e.jsx(yr,{payload:s.detail}),c&&!j&&k&&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:k})]})]}),e.jsx(Cs,{attempt:s,targetAgentId:he||null,navigate:a,returnTo:i}),e.jsx("section",{className:"sys-broker-actions","aria-label":"Dispatch actions",children:j?e.jsxs(e.Fragment,{children:[Be,ze]}):e.jsxs(e.Fragment,{children:[ze,Be]})}),e.jsxs("details",{className:"sys-broker-technical",children:[e.jsxs("summary",{children:[e.jsx("span",{children:"Technical details"}),e.jsx(Ls,{size:13,"aria-hidden":"true"})]}),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(ie,{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(ie,{value:u,subject:"metadata",className:"sys-broker-metadata-copy"})]}),e.jsx(Is,{metadata:s.metadata,rawJson:u})]})]})]}),e.jsxs("section",{className:"sys-broker-forward","aria-labelledby":"dispatch-forward-title",children:[e.jsx("div",{className:"sys-broker-forward-head",children:e.jsx("span",{id:"dispatch-forward-title",className:"sys-broker-action-label",children:"Follow up"})}),e.jsxs("div",{id:"dispatch-forward-content",children:[e.jsx("div",{className:"sys-broker-forward-intro",children:e.jsx("div",{className:"sys-broker-ask-prompts","aria-label":"Suggested requests",children:os.map(r=>e.jsxs("button",{type:"button",onClick:()=>as(r),children:[e.jsx(Ts,{size:11,"aria-hidden":"true"}),r]},r))})}),e.jsxs("form",{className:"sys-broker-message-composer",onSubmit:r=>{r.preventDefault(),Te()},children:[e.jsx("label",{htmlFor:"dispatch-message-input",children:"Request"}),e.jsx("textarea",{ref:ue,id:"dispatch-message-input",value:q,rows:3,placeholder:`What should ${ae?.id===d?"Scout":ae?.name??"this agent"} investigate or do?`,disabled:R==="sending",onChange:r=>{M(r.target.value),R!=="idle"&&(o("idle"),x(null))},onKeyDown:r=>{r.key==="Enter"&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),Te())}}),L.length>0&&e.jsx("div",{className:"sys-broker-composer-attachments","aria-label":"Attachments",children:L.map((r,l)=>e.jsxs("span",{children:[e.jsx(Zs,{size:10,"aria-hidden":"true"}),e.jsx("span",{title:r.name,children:r.name}),e.jsx("button",{type:"button",onClick:()=>ee(p=>p.filter((g,W)=>W!==l)),"aria-label":`Remove ${r.name}`,children:e.jsx($e,{size:10,"aria-hidden":"true"})})]},`${r.name}:${r.size}:${l}`))}),e.jsxs("footer",{children:[e.jsxs("div",{className:"sys-broker-composer-left",children:[e.jsx("input",{ref:Me,type:"file",multiple:!0,hidden:!0,disabled:R==="sending",onChange:r=>{ns([...r.target.files??[]]),r.target.value=""}}),e.jsx("button",{type:"button",className:"sys-broker-composer-attach",disabled:R==="sending",onClick:()=>Me.current?.click(),"aria-label":"Attach files",title:"Attach files",children:e.jsx(Ps,{size:16,"aria-hidden":"true"})}),e.jsx("span",{className:"sys-broker-message-attachment",title:m,children:"Dispatch context included"})]}),e.jsxs("div",{className:"sys-broker-composer-targets",children:[e.jsx("span",{className:"sys-broker-composer-route-label",children:"Send to"}),e.jsxs("label",{title:"Project target",children:[e.jsx("span",{children:"Project"}),e.jsxs("select",{"aria-label":"Project target",value:D,disabled:R==="sending",onChange:r=>{const l=r.target.value,p=w.find(g=>!l||(g.projectRoot?.trim()||g.cwd?.trim())===l)??null;me.current=!0,C(l),p&&(Z(p.id),O(p.harness?.trim()||""),H(p.model?.trim()||""))},children:[e.jsx("option",{value:"",children:"Any project"}),rs.map(r=>e.jsx("option",{value:r.path,children:r.label},r.path))]})]}),e.jsxs("label",{title:"Agent target",children:[e.jsx("span",{children:"Agent"}),e.jsx("select",{"aria-label":"Agent target",value:$,disabled:R==="sending"||pe.length===0,onChange:r=>{const l=w.find(p=>p.id===r.target.value)??null;me.current=!0,Z(r.target.value),l&&(C(l.projectRoot?.trim()||l.cwd?.trim()||""),O(l.harness?.trim()||""),H(l.model?.trim()||"")),o("idle"),x(null)},children:pe.length===0?e.jsx("option",{value:"",children:"No agents"}):pe.map(r=>e.jsx("option",{value:r.id,children:r.id===d?"Scout":r.name},r.id))})]}),e.jsx(bs,{catalog:Ae,value:{harness:N,model:_,effort:J},onChange:r=>{me.current=!0,O(r.harness),H(r.model),ce(r.effort)},disabled:R==="sending"}),e.jsx(ds,{className:"sys-broker-composer-mic",disabled:R==="sending",onAppend:r=>M(l=>l.trim()?`${l.trimEnd()} ${r}`:r),onError:r=>{o("failed"),x(r)}})]}),e.jsx("button",{type:"submit",className:"sys-broker-composer-send",disabled:!q.trim()||!ae||R==="sending","aria-label":`Ask ${ae?.name??"recipient"} about this dispatch`,children:R==="sending"?e.jsx(ke,{size:14,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(Bs,{size:14,"aria-hidden":"true"})})]})]}),h&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${R}`,role:"status",children:h})]})]})]})}const xr=Fs({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}}}),sa=Object.freeze(Object.defineProperty({__proto__:null,BrokerAttemptInspector:ss,BrokerScreen:fr,scoutSurface:xr},Symbol.toStringTag,{value:"Module"}));export{ss as B,fr as a,Ue as b,sa as c};
@@ -0,0 +1 @@
1
+ import{r as n,j as i}from"./index-o4FKpU7Z.js";const _=({panOffset:h,scale:a,onPan:R,onPanStart:E,onPanEnd:u,isPanLocked:d=!1,onClick:k,showGuides:g=!1,onGuidesChange:$,gridOpacity:C=1})=>{const[B,X]=n.useState(g),[G,K]=n.useState(!1),o=n.useRef(!1),v=n.useRef({x:0,y:0}),r=n.useRef({active:!1,startX:0,startY:0}),j=n.useRef(null),x=n.useRef(null),y=n.useRef(null),A=4,H=n.useRef({x:0,y:0}),w=n.useRef(0),b=n.useRef(!1);n.useEffect(()=>{X(g)},[g]);const Y=n.useCallback(e=>{const s=e;return s?s.tagName==="INPUT"||s.tagName==="TEXTAREA"||s.isContentEditable:!1},[]),z=n.useCallback(e=>{const s=e;return s?!!s.closest('button, [role="button"], a, input, textarea, select, [data-interactive="true"]'):!1},[]),c=n.useCallback(e=>{o.current=e,K(e)},[]);n.useEffect(()=>{const e=t=>{if(w.current=t.buttons,r.current.active&&(t.buttons&1)!==1&&(r.current.active=!1),o.current&&(t.buttons&1)!==1){c(!1),r.current.active=!1,u?.(),document.body.style.cursor="";return}if(d&&o.current){c(!1),r.current.active=!1,u?.(),document.body.style.cursor="";return}const l=j.current?.getBoundingClientRect(),f=l?t.clientX-l.left:t.clientX,V=l?t.clientY-l.top:t.clientY;if(H.current={x:f,y:V},x.current&&(x.current.style.left=`${f}px`),y.current&&(y.current.style.top=`${V}px`),r.current.active&&!o.current){const P=t.clientX-r.current.startX,Q=t.clientY-r.current.startY;Math.hypot(P,Q)>=A&&(r.current.active=!1,c(!0),b.current=!0,E?.(),v.current={x:t.clientX,y:t.clientY},document.body.style.cursor="grabbing")}o.current&&(R({x:(t.clientX-v.current.x)/a,y:(t.clientY-v.current.y)/a}),v.current={x:t.clientX,y:t.clientY})},s=t=>{w.current=t.buttons,r.current.active=!1,o.current&&(c(!1),u?.(),document.body.style.cursor="")},I=t=>{(t.metaKey||t.ctrlKey)&&t.key==="\\"&&(t.preventDefault(),X(l=>{const f=!l;return $?.(f),f}))},m=()=>{r.current.active=!1,s(new MouseEvent("mouseup"))};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",s),window.addEventListener("keydown",I),window.addEventListener("blur",m),document.addEventListener("visibilitychange",m),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",s),window.removeEventListener("keydown",I),window.removeEventListener("blur",m),document.removeEventListener("visibilitychange",m)}},[R,u,E,a,Y,z,d,c,$]),n.useEffect(()=>{!d||!o.current||(c(!1),u?.(),document.body.style.cursor="")},[d,u,c]);const U=e=>{b.current=!1,!(d||e.button!==0)&&(Y(e.target)||z(e.target)||(w.current=e.buttons,r.current={active:!0,startX:e.clientX,startY:e.clientY},e.preventDefault()))},F=e=>{!b.current&&k&&k(e),b.current=!1},[M,W]=n.useState({w:0,h:0});n.useEffect(()=>{const e=()=>W({w:window.innerWidth,h:window.innerHeight});return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const S=Math.max(.4,Math.min(2,a)),p=100*S,L=20*S,q="var(--hud-canvas-dot-minor)",J="var(--hud-canvas-dot-major)",N="color-mix(in srgb, oklch(var(--accent)) 18%, transparent)",T=(M.w/2+h.x*a)%p,D=(M.h/2+h.y*a)%p;return i.jsxs("div",{ref:j,className:`absolute inset-0 z-0 overflow-hidden bg-background ${G?"cursor-grabbing":"cursor-grab"}`,onMouseDown:U,onClick:F,children:[i.jsx("div",{className:"absolute pointer-events-none",style:{inset:"-100px",opacity:.8*C,transition:"opacity 1s ease",backgroundImage:`radial-gradient(circle, ${q} 1px, transparent 1px)`,backgroundSize:`${L}px ${L}px`,backgroundPosition:`${T+100}px ${D+100}px`}}),i.jsx("div",{className:"absolute pointer-events-none",style:{inset:"-100px",opacity:.45*C,transition:"opacity 1s ease",backgroundImage:`radial-gradient(circle, ${J} 1.5px, transparent 1.5px)`,backgroundSize:`${p}px ${p}px`,backgroundPosition:`${T+100}px ${D+100}px`}}),B&&i.jsxs(i.Fragment,{children:[i.jsx("div",{ref:x,className:"absolute top-0 bottom-0 w-px pointer-events-none",style:{left:0,backgroundColor:N}}),i.jsx("div",{ref:y,className:"absolute left-0 right-0 h-px pointer-events-none",style:{top:0,backgroundColor:N}})]})]})};export{_ as C};
@@ -1 +1 @@
1
- import{j as t,r as g}from"./index-CzVeWScw.js";import{i as A,k,l as N,a as D}from"./conversation-model-CHwHZNw-.js";import{l as L,i as E,a as _,p as w}from"./conversation-prefs-DNre-Lcx.js";import{u as O,m as P,g as R}from"./Provider-DSsb2gLR.js";import{b as U}from"./router-B-K15T7B.js";import{l as T,i as C,s as V}from"./sessionRead-CvFz2RHv.js";import{u as z}from"./use-conversation-list-C5sF6WBR.js";import{d as H}from"./colors-BtO5_zlx.js";/* empty css */function q({children:a,count:l,tone:s="default",title:n}){return t.jsxs("div",{className:["collapsed-strip-label",s!=="default"&&`collapsed-strip-label--${s}`,l!=null&&"collapsed-strip-label--has-count"].filter(Boolean).join(" "),title:n??a,children:[t.jsx("span",{className:"collapsed-strip-label-mark","aria-hidden":!0}),t.jsx("span",{className:"collapsed-strip-label-text",children:a}),l!=null?t.jsx("span",{className:"collapsed-strip-label-count",children:l}):null]})}function F({label:a,emptyMark:l="·",showLabel:s=!0,labelTone:n="default",labelCount:r,children:d}){const c=!d||Array.isArray(d)&&d.length===0,u=s?t.jsx(q,{tone:n,count:r,children:a}):null;return c?t.jsxs("div",{className:"collapsed-strip collapsed-strip--empty","aria-hidden":!0,children:[u,t.jsx("span",{className:"collapsed-strip-empty-mark",children:l})]}):t.jsxs("div",{className:"collapsed-strip",role:"list","aria-label":a,children:[u,d]})}function G(){return t.jsx("div",{className:"collapsed-strip-rule","aria-hidden":!0})}function J({title:a,active:l,tone:s="default",ava:n,avaColor:r,glyph:d,dot:c,pinned:u,onClick:h}){const j=["collapsed-chip",s==="channel"&&"collapsed-chip--channel",s==="neutral"&&"collapsed-chip--neutral",s==="attention"&&"collapsed-chip--attention",s==="unread"&&"collapsed-chip--unread",l&&"collapsed-chip--active",u&&"collapsed-chip--pinned"].filter(Boolean).join(" ");return t.jsxs("button",{type:"button",role:"listitem",className:j,title:a,"aria-label":a,"aria-current":l?"page":void 0,onClick:h,children:[n?t.jsx("span",{className:"collapsed-chip-ava",style:r?{background:r}:void 0,children:n}):t.jsx("span",{className:"collapsed-chip-glyph",children:d}),c?t.jsx("span",{className:["collapsed-chip-dot",c==="attention"&&"collapsed-chip-dot--attention",c==="live"&&"collapsed-chip-dot--live"].filter(Boolean).join(" "),"aria-hidden":!0}):null,u?t.jsx("span",{className:"collapsed-chip-pin","aria-hidden":!0}):null]})}function K(a){const l=a.trim(),s=l.split(/[\s/_-]+/).filter(Boolean);if(s.length>=2){const n=s[s.length-1];return/^\d+$/.test(n)&&s.length>=3?(s[s.length-2][0]??"?").toUpperCase():(n[0]??"?").toUpperCase()}return(l[0]??"?").toUpperCase()}const Q=3,W=3,X=4,Y=3;function I(a,l){return[...a].sort((s,n)=>{const r=C(s.lastMessageAt,s.id,l)?0:1,d=C(n.lastMessageAt,n.id,l)?0:1;return r!==d?r-d:(n.lastMessageAt??0)-(s.lastMessageAt??0)})}function Z(){const{route:a,navigate:l,agents:s}=O(),{sessions:n}=z(),[r,d]=g.useState(()=>L()),[c,u]=g.useState(()=>T()),h=U(a),j=g.useMemo(()=>P(s,h),[s,h]),$=a.view==="messages"||a.view==="conversation"?a.conversationId:void 0;g.useEffect(()=>{d(L()),u(T())},[]);const i=g.useMemo(()=>{const e=R(n,j,h).filter(o=>!E(o.id,r)),m=e.filter(o=>_(o.id,r)).sort((o,y)=>w(y.id,r)-w(o.id,r)||(y.lastMessageAt??0)-(o.lastMessageAt??0)).slice(0,Q),f=new Set(m.map(o=>o.id)),p=e.filter(o=>!f.has(o.id));return{pinned:m,channels:I(p.filter(N),c).slice(0,W),dms:I(p.filter(k),c).slice(0,X),observed:I(p.filter(A),c).slice(0,Y),totals:{channels:p.filter(N).length,dms:p.filter(k).length,observed:p.filter(A).length,pinned:e.filter(o=>_(o.id,r)).length}}},[n,j,h,r,c]),B=e=>{u(V(e.id)),l({view:"messages",conversationId:e.id,...h?{machineId:h}:{}})},S=[...i.pinned,...i.channels,...i.dms,...i.observed],M=S.filter(e=>C(e.lastMessageAt,e.id,c)).length,x=(e,m=!1)=>{const f=D(e),p=N(e),o=C(e.lastMessageAt,e.id,c);return t.jsx(J,{title:m?`${f} · pinned`:f,active:e.id===$,tone:p?"channel":o?"unread":"default",ava:p?void 0:K(e.agentName??f),avaColor:p?void 0:H(e.agentName??f),glyph:p?"#":void 0,dot:o?"unread":null,pinned:m,onClick:()=>B(e)},e.id)},v=[];return i.pinned.length&&v.push(t.jsx(b,{mark:"Pin",count:i.totals.pinned,children:i.pinned.map(e=>x(e,!0))},"pin")),i.channels.length&&v.push(t.jsx(b,{mark:"#",count:i.totals.channels,children:i.channels.map(e=>x(e))},"ch")),i.dms.length&&v.push(t.jsx(b,{mark:"DM",count:i.totals.dms,children:i.dms.map(e=>x(e))},"dm")),i.observed.length&&v.push(t.jsx(b,{mark:"Obs",count:i.totals.observed,children:i.observed.map(e=>x(e))},"obs")),t.jsx(F,{label:"Chat",emptyMark:"#",labelTone:M>0?"accent":"default",labelCount:M>0?M:S.length||void 0,children:v.flatMap((e,m)=>m===0?[e]:[t.jsx(G,{},`rule-${m}`),e])})}function b({mark:a,count:l,children:s}){return t.jsxs("div",{className:"collapsed-strip-section",role:"group","aria-label":a,children:[t.jsxs("div",{className:"collapsed-strip-section-mark",title:l!=null?`${a} · ${l}`:a,children:[t.jsx("span",{className:"collapsed-strip-section-mark-text",children:a}),l!=null&&l>0?t.jsx("span",{className:"collapsed-strip-section-mark-count",children:l>99?"99+":l}):null]}),s]})}const ce=Object.freeze(Object.defineProperty({__proto__:null,ChatCollapsedStrip:Z},Symbol.toStringTag,{value:"Module"}));export{F as C,Z as a,J as b,K as c,G as d,ce as e};
1
+ import{j as t,r as g}from"./index-o4FKpU7Z.js";import{i as A,k,l as N,a as D}from"./conversation-model-CHwHZNw-.js";import{l as L,i as E,a as _,p as w}from"./conversation-prefs-DNre-Lcx.js";import{u as O,m as P,g as R}from"./Provider-DKZWuzSR.js";import{d as U}from"./router-C65cZYPn.js";import{l as T,i as C,s as V}from"./sessionRead-CvFz2RHv.js";import{u as z}from"./use-conversation-list-BCzY032j.js";import{d as H}from"./colors-BtO5_zlx.js";/* empty css */function q({children:a,count:l,tone:s="default",title:n}){return t.jsxs("div",{className:["collapsed-strip-label",s!=="default"&&`collapsed-strip-label--${s}`,l!=null&&"collapsed-strip-label--has-count"].filter(Boolean).join(" "),title:n??a,children:[t.jsx("span",{className:"collapsed-strip-label-mark","aria-hidden":!0}),t.jsx("span",{className:"collapsed-strip-label-text",children:a}),l!=null?t.jsx("span",{className:"collapsed-strip-label-count",children:l}):null]})}function F({label:a,emptyMark:l="·",showLabel:s=!0,labelTone:n="default",labelCount:r,children:d}){const c=!d||Array.isArray(d)&&d.length===0,u=s?t.jsx(q,{tone:n,count:r,children:a}):null;return c?t.jsxs("div",{className:"collapsed-strip collapsed-strip--empty","aria-hidden":!0,children:[u,t.jsx("span",{className:"collapsed-strip-empty-mark",children:l})]}):t.jsxs("div",{className:"collapsed-strip",role:"list","aria-label":a,children:[u,d]})}function G(){return t.jsx("div",{className:"collapsed-strip-rule","aria-hidden":!0})}function J({title:a,active:l,tone:s="default",ava:n,avaColor:r,glyph:d,dot:c,pinned:u,onClick:h}){const j=["collapsed-chip",s==="channel"&&"collapsed-chip--channel",s==="neutral"&&"collapsed-chip--neutral",s==="attention"&&"collapsed-chip--attention",s==="unread"&&"collapsed-chip--unread",l&&"collapsed-chip--active",u&&"collapsed-chip--pinned"].filter(Boolean).join(" ");return t.jsxs("button",{type:"button",role:"listitem",className:j,title:a,"aria-label":a,"aria-current":l?"page":void 0,onClick:h,children:[n?t.jsx("span",{className:"collapsed-chip-ava",style:r?{background:r}:void 0,children:n}):t.jsx("span",{className:"collapsed-chip-glyph",children:d}),c?t.jsx("span",{className:["collapsed-chip-dot",c==="attention"&&"collapsed-chip-dot--attention",c==="live"&&"collapsed-chip-dot--live"].filter(Boolean).join(" "),"aria-hidden":!0}):null,u?t.jsx("span",{className:"collapsed-chip-pin","aria-hidden":!0}):null]})}function K(a){const l=a.trim(),s=l.split(/[\s/_-]+/).filter(Boolean);if(s.length>=2){const n=s[s.length-1];return/^\d+$/.test(n)&&s.length>=3?(s[s.length-2][0]??"?").toUpperCase():(n[0]??"?").toUpperCase()}return(l[0]??"?").toUpperCase()}const Q=3,W=3,X=4,Y=3;function I(a,l){return[...a].sort((s,n)=>{const r=C(s.lastMessageAt,s.id,l)?0:1,d=C(n.lastMessageAt,n.id,l)?0:1;return r!==d?r-d:(n.lastMessageAt??0)-(s.lastMessageAt??0)})}function Z(){const{route:a,navigate:l,agents:s}=O(),{sessions:n}=z(),[r,d]=g.useState(()=>L()),[c,u]=g.useState(()=>T()),h=U(a),j=g.useMemo(()=>P(s,h),[s,h]),$=a.view==="messages"||a.view==="conversation"?a.conversationId:void 0;g.useEffect(()=>{d(L()),u(T())},[]);const i=g.useMemo(()=>{const e=R(n,j,h).filter(o=>!E(o.id,r)),m=e.filter(o=>_(o.id,r)).sort((o,y)=>w(y.id,r)-w(o.id,r)||(y.lastMessageAt??0)-(o.lastMessageAt??0)).slice(0,Q),f=new Set(m.map(o=>o.id)),p=e.filter(o=>!f.has(o.id));return{pinned:m,channels:I(p.filter(N),c).slice(0,W),dms:I(p.filter(k),c).slice(0,X),observed:I(p.filter(A),c).slice(0,Y),totals:{channels:p.filter(N).length,dms:p.filter(k).length,observed:p.filter(A).length,pinned:e.filter(o=>_(o.id,r)).length}}},[n,j,h,r,c]),B=e=>{u(V(e.id)),l({view:"messages",conversationId:e.id,...h?{machineId:h}:{}})},S=[...i.pinned,...i.channels,...i.dms,...i.observed],M=S.filter(e=>C(e.lastMessageAt,e.id,c)).length,x=(e,m=!1)=>{const f=D(e),p=N(e),o=C(e.lastMessageAt,e.id,c);return t.jsx(J,{title:m?`${f} · pinned`:f,active:e.id===$,tone:p?"channel":o?"unread":"default",ava:p?void 0:K(e.agentName??f),avaColor:p?void 0:H(e.agentName??f),glyph:p?"#":void 0,dot:o?"unread":null,pinned:m,onClick:()=>B(e)},e.id)},v=[];return i.pinned.length&&v.push(t.jsx(b,{mark:"Pin",count:i.totals.pinned,children:i.pinned.map(e=>x(e,!0))},"pin")),i.channels.length&&v.push(t.jsx(b,{mark:"#",count:i.totals.channels,children:i.channels.map(e=>x(e))},"ch")),i.dms.length&&v.push(t.jsx(b,{mark:"DM",count:i.totals.dms,children:i.dms.map(e=>x(e))},"dm")),i.observed.length&&v.push(t.jsx(b,{mark:"Obs",count:i.totals.observed,children:i.observed.map(e=>x(e))},"obs")),t.jsx(F,{label:"Chat",emptyMark:"#",labelTone:M>0?"accent":"default",labelCount:M>0?M:S.length||void 0,children:v.flatMap((e,m)=>m===0?[e]:[t.jsx(G,{},`rule-${m}`),e])})}function b({mark:a,count:l,children:s}){return t.jsxs("div",{className:"collapsed-strip-section",role:"group","aria-label":a,children:[t.jsxs("div",{className:"collapsed-strip-section-mark",title:l!=null?`${a} · ${l}`:a,children:[t.jsx("span",{className:"collapsed-strip-section-mark-text",children:a}),l!=null&&l>0?t.jsx("span",{className:"collapsed-strip-section-mark-count",children:l>99?"99+":l}):null]}),s]})}const ce=Object.freeze(Object.defineProperty({__proto__:null,ChatCollapsedStrip:Z},Symbol.toStringTag,{value:"Module"}));export{F as C,Z as a,J as b,K as c,G as d,ce as e};
@@ -1 +1 @@
1
- import{r as o,j as a}from"./index-CzVeWScw.js";import{f as k}from"./cache-Dr0why2k.js";import{u as F,f as I,l as N,L as _,D}from"./usePierreRuntime-Bo4lD7Ui.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-o4FKpU7Z.js";import{f as k}from"./cache-Dr0why2k.js";import{u as F,f as I,l as N,L as _,D}from"./usePierreRuntime-B4hbNWTz.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-CzVeWScw.js";import{C as ne}from"./chevron-down-DRCbnzyY.js";import{S as oe}from"./search-C3bSJluv.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-o4FKpU7Z.js";import{C as ne}from"./chevron-down-NAhBUkFd.js";import{S as oe}from"./search-7_n7CxWl.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};
@@ -1 +1 @@
1
- import{r as s,j as r}from"./index-CzVeWScw.js";import{a as G}from"./api-h5zurxmi.js";import{c as je}from"./clipboard-e3fSpeo7.js";import{f as ze}from"./scoutbot-BTIErYHo.js";import{g as Ae,f as Ce}from"./api-BkjHJfgJ.js";import{d as Ke}from"./types-B0PlfpKc.js";import{r as Oe,C as He}from"./CodeDiffPane-C1ebFt-Y.js";import{r as qe,a as Ge,w as Ve,b as Xe,f as xe,C as Je,s as Qe}from"./CodeProjectPicker-tsCly-f3.js";import{ShikiPane as Ye}from"./ShikiPane-B7O4if20.js";/* empty css */import{A as Ze}from"./arrow-left-_vS7itsV.js";import{C as et}from"./chevron-right-CNE6QAVr.js";import{C as tt}from"./check-COxArFXG.js";import{C as nt}from"./copy-4LfKIdQJ.js";import"./cache-Dr0why2k.js";import"./usePierreRuntime-Bo4lD7Ui.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";/* empty css */import"./chevron-down-DRCbnzyY.js";import"./createLucideIcon-ClCdc3F9.js";import"./search-C3bSJluv.js";const st=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 V(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 rt(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 it(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"&&st.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 Nt({route:i,navigate:l,root:k,file:g,project:f,path:x,wt:u,line:Le,endLine:Ne,returnConversationId:Re,embedded:X=!1}){const I=k??i?.root??null,B=g??i?.file??null,p=f??i?.project??null,b=x??i?.path??null,P=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(()=>I??(p?null:qe())),[y,Q]=s.useState(()=>new Map),[L,U]=s.useState(()=>new Set),[de,ue]=s.useState(null),[a,W]=s.useState(B),[c,_]=s.useState(null),[Ee,Y]=s.useState(!1),[fe,z]=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,A]=s.useState(()=>p?{phase:"resolving"}:{phase:"idle"}),ne=p?`${p}\0${b??""}\0${P??""}`: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 G(`/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){U(d=>new Set([...d,...n]));for(const d of n)E(d)}},[E]);s.useEffect(()=>{if(!p)return;const e=`${p}\0${b??""}\0${P??""}`;if(R.current===e)return;const t=n=>{R.current=e;const d=b?`${n}/${b}`:null;A({phase:"idle"}),J(n),W(d),$(n,d)};if(h){const n=rt(h,p,P);if(n){t(n.root);return}}se.current!==e&&(A({phase:"resolving"}),G(`/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);A({phase:"failed",message:d.includes(p)?d:`Can't resolve project "${p}": ${d}`})}))},[p,b,P,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=Ge(o),t=he.current,n=t?ye(o,t):[];e?(Q(new Map(Object.entries(e.entries))),U(new Set([...e.expanded,...n])),!t&&e.selectedFile&&W(e.selectedFile)):(Q(new Map),U(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||(Ve(o,{entries:y,expanded:L,selectedFile:a}),Xe(o))},[o,y,L,a]),s.useEffect(()=>{!I||!B||$(I,B)},[I,B,$]);const re=s.useRef(new Map),ie=s.useRef(new Set),$e=3e4,K=s.useCallback(e=>{const t=re.current.get(e);return t?Date.now()-t.at>$e?(re.current.delete(e),null):t.preview:null},[]),O=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=>{K(e)||ie.current.has(e)||(ie.current.add(e),G(`/api/file/preview?path=${encodeURIComponent(e)}`).then(t=>O(e,t)).catch(()=>{}).finally(()=>ie.current.delete(e)))},[K,O]);s.useEffect(()=>{if(Z("idle"),!a){_(null),z(null);return}const e=K(a);if(e){_(e.kind==="file"?e:null),z(null),Y(!1);return}let t=!1;return Y(!0),z(null),G(`/api/file/preview?path=${encodeURIComponent(a)}`).then(n=>{t||(O(a,n),_(n.kind==="file"?n:null))}).catch(n=>{t||(_(null),z(n instanceof Error?n.message:String(n)))}).finally(()=>{t||Y(!1)}),()=>{t=!0}},[a,K,O]);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 H=s.useCallback((e,t)=>{X||!l||l(me(e,t))},[X,l,me]),Te=s.useCallback(e=>{U(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),W(e),o&&H(o,e)},[o,H]),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]),q=!!(o&&a&&Oe(o,a));s.useEffect(()=>{q||ee("source")},[q]);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,A({phase:"idle"}),te(e.line&&e.line>0?{line:e.line,...e.endLine&&e.endLine>=e.line?{endLine:e.endLine}:{}}:null),W(e.file??null),J(e.root),e.file&&$(e.root,e.file),H(e.root,e.file??null)},[$,H]);return r.jsxs("div",{className:"s-code-screen","data-embedded":X||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(Ze,{size:13,strokeWidth:1.9,"aria-hidden":!0}),r.jsx("span",{children:"Back to thread"})]}):null,r.jsx(Je,{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:Qe(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(et,{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:it(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}),q?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:[V(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(tt,{size:12,"aria-hidden":!0}):r.jsx(nt,{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"&&q&&o&&a?r.jsx(He,{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 ",V(256*1024)," of ",V(c.sizeBytes)," ·"," ",r.jsx("a",{href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"open raw"})]}):null,r.jsx(Ye,{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," · ",V(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 Rt=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{Nt as CodeContent,Rt as scoutSurface};
1
+ import{r as s,j as r}from"./index-o4FKpU7Z.js";import{a as G}from"./api-h5zurxmi.js";import{c as je}from"./clipboard-e3fSpeo7.js";import{f as ze}from"./scoutbot-BTIErYHo.js";import{g as Ae,f as Ce}from"./api-BkjHJfgJ.js";import{d as Ke}from"./types-B0PlfpKc.js";import{r as Oe,C as He}from"./CodeDiffPane-86odpBSt.js";import{r as qe,a as Ge,w as Ve,b as Xe,f as xe,C as Je,s as Qe}from"./CodeProjectPicker-8svr_S_A.js";import{ShikiPane as Ye}from"./ShikiPane-Dkwyx--r.js";/* empty css */import{A as Ze}from"./arrow-left-BOht-YQu.js";import{C as et}from"./chevron-right-C10o7t_X.js";import{C as tt}from"./check--esHw52j.js";import{C as nt}from"./copy-Dty8ZYsM.js";import"./cache-Dr0why2k.js";import"./usePierreRuntime-B4hbNWTz.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";/* empty css */import"./chevron-down-NAhBUkFd.js";import"./createLucideIcon-Bt67PWH-.js";import"./search-7_n7CxWl.js";const st=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 V(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 rt(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 it(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"&&st.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 Nt({route:i,navigate:l,root:k,file:g,project:f,path:x,wt:u,line:Le,endLine:Ne,returnConversationId:Re,embedded:X=!1}){const I=k??i?.root??null,B=g??i?.file??null,p=f??i?.project??null,b=x??i?.path??null,P=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(()=>I??(p?null:qe())),[y,Q]=s.useState(()=>new Map),[L,U]=s.useState(()=>new Set),[de,ue]=s.useState(null),[a,W]=s.useState(B),[c,_]=s.useState(null),[Ee,Y]=s.useState(!1),[fe,z]=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,A]=s.useState(()=>p?{phase:"resolving"}:{phase:"idle"}),ne=p?`${p}\0${b??""}\0${P??""}`: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 G(`/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){U(d=>new Set([...d,...n]));for(const d of n)E(d)}},[E]);s.useEffect(()=>{if(!p)return;const e=`${p}\0${b??""}\0${P??""}`;if(R.current===e)return;const t=n=>{R.current=e;const d=b?`${n}/${b}`:null;A({phase:"idle"}),J(n),W(d),$(n,d)};if(h){const n=rt(h,p,P);if(n){t(n.root);return}}se.current!==e&&(A({phase:"resolving"}),G(`/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);A({phase:"failed",message:d.includes(p)?d:`Can't resolve project "${p}": ${d}`})}))},[p,b,P,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=Ge(o),t=he.current,n=t?ye(o,t):[];e?(Q(new Map(Object.entries(e.entries))),U(new Set([...e.expanded,...n])),!t&&e.selectedFile&&W(e.selectedFile)):(Q(new Map),U(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||(Ve(o,{entries:y,expanded:L,selectedFile:a}),Xe(o))},[o,y,L,a]),s.useEffect(()=>{!I||!B||$(I,B)},[I,B,$]);const re=s.useRef(new Map),ie=s.useRef(new Set),$e=3e4,K=s.useCallback(e=>{const t=re.current.get(e);return t?Date.now()-t.at>$e?(re.current.delete(e),null):t.preview:null},[]),O=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=>{K(e)||ie.current.has(e)||(ie.current.add(e),G(`/api/file/preview?path=${encodeURIComponent(e)}`).then(t=>O(e,t)).catch(()=>{}).finally(()=>ie.current.delete(e)))},[K,O]);s.useEffect(()=>{if(Z("idle"),!a){_(null),z(null);return}const e=K(a);if(e){_(e.kind==="file"?e:null),z(null),Y(!1);return}let t=!1;return Y(!0),z(null),G(`/api/file/preview?path=${encodeURIComponent(a)}`).then(n=>{t||(O(a,n),_(n.kind==="file"?n:null))}).catch(n=>{t||(_(null),z(n instanceof Error?n.message:String(n)))}).finally(()=>{t||Y(!1)}),()=>{t=!0}},[a,K,O]);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 H=s.useCallback((e,t)=>{X||!l||l(me(e,t))},[X,l,me]),Te=s.useCallback(e=>{U(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),W(e),o&&H(o,e)},[o,H]),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]),q=!!(o&&a&&Oe(o,a));s.useEffect(()=>{q||ee("source")},[q]);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,A({phase:"idle"}),te(e.line&&e.line>0?{line:e.line,...e.endLine&&e.endLine>=e.line?{endLine:e.endLine}:{}}:null),W(e.file??null),J(e.root),e.file&&$(e.root,e.file),H(e.root,e.file??null)},[$,H]);return r.jsxs("div",{className:"s-code-screen","data-embedded":X||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(Ze,{size:13,strokeWidth:1.9,"aria-hidden":!0}),r.jsx("span",{children:"Back to thread"})]}):null,r.jsx(Je,{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:Qe(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(et,{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:it(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}),q?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:[V(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(tt,{size:12,"aria-hidden":!0}):r.jsx(nt,{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"&&q&&o&&a?r.jsx(He,{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 ",V(256*1024)," of ",V(c.sizeBytes)," ·"," ",r.jsx("a",{href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"open raw"})]}):null,r.jsx(Ye,{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," · ",V(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 Rt=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{Nt as CodeContent,Rt as scoutSurface};
@@ -1 +1 @@
1
- import{r as u,j as s}from"./index-CzVeWScw.js";const x={current:null,setMenu:null};function p(){return u.useCallback((i,t)=>{i.preventDefault(),i.stopPropagation(),x.setMenu?.({position:{x:i.clientX,y:i.clientY},items:t})},[])}function f({children:i}){const[t,w]=u.useState(null),d=u.useRef(null);x.setMenu=w;const r=u.useCallback(()=>{w(null)},[]);return u.useEffect(()=>{if(!t)return;const e=n=>{n.target instanceof Node&&d.current?.contains(n.target)||r()},o=n=>{n.key==="Escape"&&r()},l=()=>r(),c=n=>{n.defaultPrevented||r()};return window.addEventListener("mousedown",e,!0),window.addEventListener("keydown",o),window.addEventListener("wheel",l,!0),window.addEventListener("contextmenu",c),()=>{window.removeEventListener("mousedown",e,!0),window.removeEventListener("keydown",o),window.removeEventListener("wheel",l,!0),window.removeEventListener("contextmenu",c)}},[t,r]),u.useLayoutEffect(()=>{if(!t||!d.current)return;const e=d.current,o=e.getBoundingClientRect(),l=window.innerWidth,c=window.innerHeight;let n=t.position.x,a=t.position.y;n+o.width>l-8&&(n=l-o.width-8),a+o.height>c-8&&(a=c-o.height-8),n<8&&(n=8),a<8&&(a=8),e.style.left=`${n}px`,e.style.top=`${a}px`,e.style.visibility="visible"},[t]),s.jsxs(s.Fragment,{children:[i,t&&s.jsx("div",{ref:d,className:"s-context-menu",style:{left:t.position.x,top:t.position.y,visibility:"hidden"},role:"menu",onMouseDown:e=>e.stopPropagation(),children:t.items.map((e,o)=>e.kind==="separator"?s.jsx("div",{className:"s-context-menu-sep",role:"separator"},o):s.jsxs("button",{type:"button",className:"s-context-menu-item",role:"menuitem",onClick:()=>{e.onSelect(),r()},children:[s.jsx("span",{className:"s-context-menu-label",children:e.label}),e.shortcut&&s.jsx("span",{className:"s-context-menu-shortcut",children:e.shortcut})]},o))})]})}export{f as C,p as u};
1
+ import{r as u,j as s}from"./index-o4FKpU7Z.js";const x={current:null,setMenu:null};function p(){return u.useCallback((i,t)=>{i.preventDefault(),i.stopPropagation(),x.setMenu?.({position:{x:i.clientX,y:i.clientY},items:t})},[])}function f({children:i}){const[t,w]=u.useState(null),d=u.useRef(null);x.setMenu=w;const r=u.useCallback(()=>{w(null)},[]);return u.useEffect(()=>{if(!t)return;const e=n=>{n.target instanceof Node&&d.current?.contains(n.target)||r()},o=n=>{n.key==="Escape"&&r()},l=()=>r(),c=n=>{n.defaultPrevented||r()};return window.addEventListener("mousedown",e,!0),window.addEventListener("keydown",o),window.addEventListener("wheel",l,!0),window.addEventListener("contextmenu",c),()=>{window.removeEventListener("mousedown",e,!0),window.removeEventListener("keydown",o),window.removeEventListener("wheel",l,!0),window.removeEventListener("contextmenu",c)}},[t,r]),u.useLayoutEffect(()=>{if(!t||!d.current)return;const e=d.current,o=e.getBoundingClientRect(),l=window.innerWidth,c=window.innerHeight;let n=t.position.x,a=t.position.y;n+o.width>l-8&&(n=l-o.width-8),a+o.height>c-8&&(a=c-o.height-8),n<8&&(n=8),a<8&&(a=8),e.style.left=`${n}px`,e.style.top=`${a}px`,e.style.visibility="visible"},[t]),s.jsxs(s.Fragment,{children:[i,t&&s.jsx("div",{ref:d,className:"s-context-menu",style:{left:t.position.x,top:t.position.y,visibility:"hidden"},role:"menu",onMouseDown:e=>e.stopPropagation(),children:t.items.map((e,o)=>e.kind==="separator"?s.jsx("div",{className:"s-context-menu-sep",role:"separator"},o):s.jsxs("button",{type:"button",className:"s-context-menu-item",role:"menuitem",onClick:()=>{e.onSelect(),r()},children:[s.jsx("span",{className:"s-context-menu-label",children:e.label}),e.shortcut&&s.jsx("span",{className:"s-context-menu-shortcut",children:e.shortcut})]},o))})]})}export{f as C,p as u};
@@ -1 +1 @@
1
- import{r as u,j as e}from"./index-CzVeWScw.js";import{d as G}from"./colors-BtO5_zlx.js";import{M as J}from"./runtime-picker-BCQD7d4K.js";import{i as Y,r as Z,d as z,a as ee,M}from"./MessageComposerSuggestions-Cs9u-F_3.js";import{F as se}from"./file-text-DG-pufl1.js";import"./index-Dewd56RX.js";import{c as te}from"./createLucideIcon-ClCdc3F9.js";import{X as ae}from"./x-D4X_y1j_.js";const ne=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],re=te("reply",ne),_="Only markdown, code, images, and video clips can be attached.";function be(){const[o,g]=u.useState([]),[p,x]=u.useState(null),[c,h]=u.useState(null),[m,j]=u.useState(0),a=u.useRef(null),k=u.useCallback((n,l="Attached")=>{const i=n.filter(Y);return i.length===0?(n.length>0&&h(_),0):(h(null),g(N=>{const F=new Set(N.map(d=>`${d.name}:${d.size}:${d.lastModified}`)),q=i.filter(d=>!F.has(`${d.name}:${d.size}:${d.lastModified}`));return q.length>0?[...N,...q]:N}),x(i.length===1?`${l} ${i[0]?.name??"1 attachment"}.`:`${l} ${i.length} attachments.`),i.length)},[]),b=u.useCallback(n=>{g(l=>l.filter(i=>i!==n)),x(null)},[]),y=u.useCallback(()=>{g([]),x(null),h(null),j(0)},[]),$=u.useCallback(()=>{a.current?.click()},[]),R=u.useCallback(n=>{const l=Z(n.clipboardData);l.length!==0&&(n.preventDefault(),k(l,"Pasted"))},[k]),f=u.useMemo(()=>({onDragOver:n=>{z(n.dataTransfer)&&(n.preventDefault(),j(l=>l===0?1:l))},onDragLeave:n=>{n.currentTarget.contains(n.relatedTarget)||j(0)},onDrop:n=>{if(!z(n.dataTransfer))return;n.preventDefault(),j(0);const l=ee(n.dataTransfer);if(l.length===0){h(_);return}k(l,"Dropped")}}),[k]);return{files:o,hasFiles:o.length>0,feedback:p,error:c,dragActive:m>0,stage:k,remove:b,clear:y,setError:h,openPicker:$,dropHandlers:f,onPaste:R,inputRef:a}}function oe({file:o,onRemove:g}){const p=u.useMemo(()=>URL.createObjectURL(o),[o]);u.useEffect(()=>()=>URL.revokeObjectURL(p),[p]);const x=o.type.startsWith("video/"),c=o.type.startsWith("image/");return e.jsxs("div",{className:"s-msg-compose-attachment",children:[x?e.jsx("video",{src:p,muted:!0,playsInline:!0}):c?e.jsx("img",{src:p,alt:o.name}):e.jsxs("div",{className:"s-msg-compose-attachment-file",title:o.name,children:[e.jsx(se,{size:18,"aria-hidden":"true"}),e.jsx("span",{children:o.name})]}),e.jsx("button",{type:"button",className:"s-msg-compose-attachment-remove","aria-label":`Remove ${o.name}`,onClick:g,children:"×"})]})}function le({attachments:o,accept:g="image/*,video/*,text/markdown,.md,.markdown,text/plain,.txt"}){const{files:p,feedback:x,error:c,remove:h,stage:m,inputRef:j}=o;return e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:j,type:"file",multiple:!0,accept:g,className:"s-msg-compose-file-input",onChange:a=>{m([...a.target.files??[]]),a.target.value=""}}),p.length>0?e.jsx("div",{className:"s-msg-compose-attachments","aria-label":"Staged attachments",children:p.map(a=>e.jsx(oe,{file:a,onRemove:()=>h(a)},`${a.name}:${a.size}:${a.lastModified}`))}):null,c?e.jsx("div",{className:"s-msg-compose-attach-note","data-tone":"error",role:"alert",children:c}):x?e.jsx("div",{className:"s-msg-compose-attach-note","data-tone":"muted",role:"status",children:x}):null]})}function ce({composeRef:o,draft:g,setDraft:p,composePlaceholder:x,slashState:c,setSlashState:h,filteredSlashCommands:m,applySlashCommand:j,mentionState:a,setMentionState:k,filteredMentions:b,applyMention:y,updateTriggersFromDraft:$,closeSuggestions:R,replyTarget:f,onCancelReply:n,isStopMode:l,sending:i,composeAction:N,onSend:F,onInterrupt:q,attachments:d,isAgentBusy:H,busyIntent:P,onBusyIntentChange:T,queued:v,queueNote:I,onEditQueued:K,editingQueuedId:C,editingAttachmentCount:E,onCancelEdit:W,onUnqueue:S,onSendQueuedNow:Q}){const B=e.jsxs(e.Fragment,{children:[c.open?e.jsx(M,{label:"Slash commands",items:m.map(s=>({id:s.command,token:s.label,description:s.description})),activeIndex:c.index,onPick:s=>{const t=m[s];t&&j(t)},onActiveIndexChange:s=>h(t=>({...t,index:s}))}):null,a.open?e.jsx(M,{label:"Mention agent",items:b.map(s=>({id:s.id,token:`@${s.handle}`,description:s.name,avatar:{label:s.name[0]?.toUpperCase()??"?",color:G(s.name)}})),activeIndex:a.index,onPick:s=>{const t=b[s];t&&y(t)},onActiveIndexChange:s=>k(t=>({...t,index:s}))}):null]}),V=g.trim().length>0,A=C!==null,L=V||d.hasFiles||E>0,D=H&&L,w=D&&P==="steer",O=A?v.findIndex(s=>s.id===C)+1:0,U=D?e.jsxs("div",{className:"s-msg-compose-mode",role:"group","aria-label":"What Send does while this turn is running",children:[e.jsx("button",{type:"button",className:"s-msg-compose-mode-btn","data-mode":"queue","aria-pressed":P==="queue",title:"Hold this draft until the running turn lands",disabled:i,onClick:()=>T("queue"),children:"Queue"}),e.jsx("button",{type:"button",className:"s-msg-compose-mode-btn","data-mode":"steer","aria-pressed":P==="steer",title:"Interrupt the running turn and deliver this now",disabled:i,onClick:()=>T("steer"),children:"Steer"})]}):null,X=v.length>0||U?e.jsxs("div",{className:"s-msg-compose-queue",role:"group","aria-label":"Queued messages",children:[e.jsxs("div",{className:"s-msg-compose-queue-head",children:[e.jsx("span",{className:"s-msg-compose-queue-kicker",children:v.length>0?`Queue · ${v.length}`:"Queues next"}),e.jsx("span",{className:"s-msg-compose-queue-hint",children:A?w?`Rewriting ${O} — send interrupts this turn`:`Rewriting ${O} — send returns it to its place`:v.length>0?w?"Send interrupts this turn":I??"":w?"Interrupts this turn on send":"Sends when this turn lands"}),U]}),v.map((s,t)=>e.jsxs("div",{className:"s-msg-compose-queue-row","data-editing":s.id===C?"true":void 0,children:[e.jsx("span",{className:"s-msg-compose-queue-index",children:t+1}),e.jsx("span",{className:"s-msg-compose-queue-body",children:s.body.trim()||"Attachments only"}),s.attachments.length>0?e.jsxs("span",{className:"s-msg-compose-queue-clip",children:[s.attachments.length," file",s.attachments.length===1?"":"s"]}):null,s.id===C?e.jsx("button",{type:"button",className:"s-msg-compose-queue-edit",title:"Stop rewriting — leave this row as it was","aria-label":`Cancel rewriting queued message ${t+1}`,onClick:W,children:"Cancel edit"}):e.jsx("button",{type:"button",className:"s-msg-compose-queue-edit",title:"Pull this back into the input box to rewrite it","aria-label":`Edit queued message ${t+1}`,disabled:i||A,onClick:()=>K(s.id),children:"Edit"}),e.jsx("button",{type:"button",className:"s-msg-compose-queue-now",title:"Interrupt this turn and send this now","aria-label":`Send queued message ${t+1} now`,disabled:i||s.id===C,onClick:()=>Q(s.id),children:"Send now"}),e.jsx("button",{type:"button",className:"s-msg-compose-queue-drop",title:"Cancel — drop this from the queue","aria-label":`Cancel queued message ${t+1}`,onClick:()=>S(s.id),children:"×"})]},s.id))]}):null;return e.jsx(J,{density:"thread",value:g,onChange:(s,t)=>{p(s),$(s,t?.caret??s.length)},onSend:F,placeholder:x,sending:i,stopMode:l,onStop:q,canSend:L,sendTitle:w?"Steer — interrupt this turn and send now (Cmd+Enter)":D?"Queue for the next turn (Cmd+Enter)":"Send (Cmd+Enter)",sendAriaLabel:w?"Steer — interrupt this turn and send now (Cmd+Enter)":D?"Queue message for the next turn (Cmd+Enter)":N==="steer"?"Send follow-up (Cmd+Enter)":"Send message (Cmd+Enter)",showAttach:!0,onAttach:d.openPicker,onPaste:d.onPaste,dropHandlers:d.dropHandlers,dragActive:d.dragActive,textareaRef:o,overlay:B,above:X,aboveAttached:!0,header:e.jsxs(e.Fragment,{children:[f?e.jsxs("div",{className:"s-thread-compose-reply",role:"status",children:[e.jsx(re,{className:"s-thread-compose-reply-icon",size:13,strokeWidth:1.8,"aria-hidden":"true"}),e.jsx("span",{className:"s-thread-compose-reply-label",children:"Replying to"}),e.jsx("span",{className:"s-thread-compose-reply-actor",children:f.actorLabel}),e.jsx("span",{className:"s-thread-compose-reply-preview",title:f.preview,children:f.preview}),e.jsx("button",{type:"button",className:"s-thread-compose-reply-cancel","aria-label":"Cancel reply",title:"Cancel reply",onClick:n,children:e.jsx(ae,{size:13,strokeWidth:1.8,"aria-hidden":"true"})})]}):null,A&&E>0?e.jsxs("div",{className:"s-msg-compose-carried",role:"status",children:[E," file",E===1?"":"s"," stay attached to this draft"]}):null,e.jsx(le,{attachments:d})]}),tools:e.jsxs("span",{className:"s-thread-compose-hint s-msg-compose-tools-hint",children:[e.jsx("kbd",{className:"s-kbd",children:"/"})," commands"," · ",e.jsx("kbd",{className:"s-kbd",children:"@"})," agents"]}),onSelect:s=>{const t=s.currentTarget;$(t.value,t.selectionStart)},onBlur:()=>{setTimeout(R,120)},onKeyDown:s=>{if(!(c.open&&m.length>0||a.open&&b.length>0))return!1;if(s.key==="ArrowDown")return c.open?h(r=>({...r,index:(r.index+1)%m.length})):a.open&&k(r=>({...r,index:(r.index+1)%b.length})),!0;if(s.key==="ArrowUp")return c.open?h(r=>({...r,index:(r.index-1+m.length)%m.length})):a.open&&k(r=>({...r,index:(r.index-1+b.length)%b.length})),!0;if(s.key==="Escape")return R(),!0;if((s.key==="Enter"||s.key==="Tab")&&!s.shiftKey&&!s.metaKey&&!s.ctrlKey&&!s.altKey){if(c.open){const r=m[c.index]??m[0];r&&j(r)}else if(a.open){const r=b[a.index]??b[0];r&&y(r)}return!0}return!1}})}const je=Object.freeze(Object.defineProperty({__proto__:null,ConversationComposer:ce},Symbol.toStringTag,{value:"Module"}));export{ce as C,je as a,be as u};
1
+ import{r as u,j as e}from"./index-o4FKpU7Z.js";import{d as G}from"./colors-BtO5_zlx.js";import{M as J}from"./runtime-picker-eDEvx2Mz.js";import{i as Y,r as Z,d as z,a as ee,M}from"./MessageComposerSuggestions-Dfc3PH2y.js";import{F as se}from"./file-text-iF0hyVyU.js";import"./index-BMwKgdz_.js";import{c as te}from"./createLucideIcon-Bt67PWH-.js";import{X as ae}from"./x-ynOfVadO.js";const ne=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],re=te("reply",ne),_="Only markdown, code, images, and video clips can be attached.";function be(){const[o,g]=u.useState([]),[p,x]=u.useState(null),[c,h]=u.useState(null),[m,j]=u.useState(0),a=u.useRef(null),k=u.useCallback((n,l="Attached")=>{const i=n.filter(Y);return i.length===0?(n.length>0&&h(_),0):(h(null),g(N=>{const F=new Set(N.map(d=>`${d.name}:${d.size}:${d.lastModified}`)),q=i.filter(d=>!F.has(`${d.name}:${d.size}:${d.lastModified}`));return q.length>0?[...N,...q]:N}),x(i.length===1?`${l} ${i[0]?.name??"1 attachment"}.`:`${l} ${i.length} attachments.`),i.length)},[]),b=u.useCallback(n=>{g(l=>l.filter(i=>i!==n)),x(null)},[]),y=u.useCallback(()=>{g([]),x(null),h(null),j(0)},[]),$=u.useCallback(()=>{a.current?.click()},[]),R=u.useCallback(n=>{const l=Z(n.clipboardData);l.length!==0&&(n.preventDefault(),k(l,"Pasted"))},[k]),f=u.useMemo(()=>({onDragOver:n=>{z(n.dataTransfer)&&(n.preventDefault(),j(l=>l===0?1:l))},onDragLeave:n=>{n.currentTarget.contains(n.relatedTarget)||j(0)},onDrop:n=>{if(!z(n.dataTransfer))return;n.preventDefault(),j(0);const l=ee(n.dataTransfer);if(l.length===0){h(_);return}k(l,"Dropped")}}),[k]);return{files:o,hasFiles:o.length>0,feedback:p,error:c,dragActive:m>0,stage:k,remove:b,clear:y,setError:h,openPicker:$,dropHandlers:f,onPaste:R,inputRef:a}}function oe({file:o,onRemove:g}){const p=u.useMemo(()=>URL.createObjectURL(o),[o]);u.useEffect(()=>()=>URL.revokeObjectURL(p),[p]);const x=o.type.startsWith("video/"),c=o.type.startsWith("image/");return e.jsxs("div",{className:"s-msg-compose-attachment",children:[x?e.jsx("video",{src:p,muted:!0,playsInline:!0}):c?e.jsx("img",{src:p,alt:o.name}):e.jsxs("div",{className:"s-msg-compose-attachment-file",title:o.name,children:[e.jsx(se,{size:18,"aria-hidden":"true"}),e.jsx("span",{children:o.name})]}),e.jsx("button",{type:"button",className:"s-msg-compose-attachment-remove","aria-label":`Remove ${o.name}`,onClick:g,children:"×"})]})}function le({attachments:o,accept:g="image/*,video/*,text/markdown,.md,.markdown,text/plain,.txt"}){const{files:p,feedback:x,error:c,remove:h,stage:m,inputRef:j}=o;return e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:j,type:"file",multiple:!0,accept:g,className:"s-msg-compose-file-input",onChange:a=>{m([...a.target.files??[]]),a.target.value=""}}),p.length>0?e.jsx("div",{className:"s-msg-compose-attachments","aria-label":"Staged attachments",children:p.map(a=>e.jsx(oe,{file:a,onRemove:()=>h(a)},`${a.name}:${a.size}:${a.lastModified}`))}):null,c?e.jsx("div",{className:"s-msg-compose-attach-note","data-tone":"error",role:"alert",children:c}):x?e.jsx("div",{className:"s-msg-compose-attach-note","data-tone":"muted",role:"status",children:x}):null]})}function ce({composeRef:o,draft:g,setDraft:p,composePlaceholder:x,slashState:c,setSlashState:h,filteredSlashCommands:m,applySlashCommand:j,mentionState:a,setMentionState:k,filteredMentions:b,applyMention:y,updateTriggersFromDraft:$,closeSuggestions:R,replyTarget:f,onCancelReply:n,isStopMode:l,sending:i,composeAction:N,onSend:F,onInterrupt:q,attachments:d,isAgentBusy:H,busyIntent:P,onBusyIntentChange:T,queued:v,queueNote:I,onEditQueued:K,editingQueuedId:C,editingAttachmentCount:E,onCancelEdit:W,onUnqueue:S,onSendQueuedNow:Q}){const B=e.jsxs(e.Fragment,{children:[c.open?e.jsx(M,{label:"Slash commands",items:m.map(s=>({id:s.command,token:s.label,description:s.description})),activeIndex:c.index,onPick:s=>{const t=m[s];t&&j(t)},onActiveIndexChange:s=>h(t=>({...t,index:s}))}):null,a.open?e.jsx(M,{label:"Mention agent",items:b.map(s=>({id:s.id,token:`@${s.handle}`,description:s.name,avatar:{label:s.name[0]?.toUpperCase()??"?",color:G(s.name)}})),activeIndex:a.index,onPick:s=>{const t=b[s];t&&y(t)},onActiveIndexChange:s=>k(t=>({...t,index:s}))}):null]}),V=g.trim().length>0,A=C!==null,L=V||d.hasFiles||E>0,D=H&&L,w=D&&P==="steer",O=A?v.findIndex(s=>s.id===C)+1:0,U=D?e.jsxs("div",{className:"s-msg-compose-mode",role:"group","aria-label":"What Send does while this turn is running",children:[e.jsx("button",{type:"button",className:"s-msg-compose-mode-btn","data-mode":"queue","aria-pressed":P==="queue",title:"Hold this draft until the running turn lands",disabled:i,onClick:()=>T("queue"),children:"Queue"}),e.jsx("button",{type:"button",className:"s-msg-compose-mode-btn","data-mode":"steer","aria-pressed":P==="steer",title:"Interrupt the running turn and deliver this now",disabled:i,onClick:()=>T("steer"),children:"Steer"})]}):null,X=v.length>0||U?e.jsxs("div",{className:"s-msg-compose-queue",role:"group","aria-label":"Queued messages",children:[e.jsxs("div",{className:"s-msg-compose-queue-head",children:[e.jsx("span",{className:"s-msg-compose-queue-kicker",children:v.length>0?`Queue · ${v.length}`:"Queues next"}),e.jsx("span",{className:"s-msg-compose-queue-hint",children:A?w?`Rewriting ${O} — send interrupts this turn`:`Rewriting ${O} — send returns it to its place`:v.length>0?w?"Send interrupts this turn":I??"":w?"Interrupts this turn on send":"Sends when this turn lands"}),U]}),v.map((s,t)=>e.jsxs("div",{className:"s-msg-compose-queue-row","data-editing":s.id===C?"true":void 0,children:[e.jsx("span",{className:"s-msg-compose-queue-index",children:t+1}),e.jsx("span",{className:"s-msg-compose-queue-body",children:s.body.trim()||"Attachments only"}),s.attachments.length>0?e.jsxs("span",{className:"s-msg-compose-queue-clip",children:[s.attachments.length," file",s.attachments.length===1?"":"s"]}):null,s.id===C?e.jsx("button",{type:"button",className:"s-msg-compose-queue-edit",title:"Stop rewriting — leave this row as it was","aria-label":`Cancel rewriting queued message ${t+1}`,onClick:W,children:"Cancel edit"}):e.jsx("button",{type:"button",className:"s-msg-compose-queue-edit",title:"Pull this back into the input box to rewrite it","aria-label":`Edit queued message ${t+1}`,disabled:i||A,onClick:()=>K(s.id),children:"Edit"}),e.jsx("button",{type:"button",className:"s-msg-compose-queue-now",title:"Interrupt this turn and send this now","aria-label":`Send queued message ${t+1} now`,disabled:i||s.id===C,onClick:()=>Q(s.id),children:"Send now"}),e.jsx("button",{type:"button",className:"s-msg-compose-queue-drop",title:"Cancel — drop this from the queue","aria-label":`Cancel queued message ${t+1}`,onClick:()=>S(s.id),children:"×"})]},s.id))]}):null;return e.jsx(J,{density:"thread",value:g,onChange:(s,t)=>{p(s),$(s,t?.caret??s.length)},onSend:F,placeholder:x,sending:i,stopMode:l,onStop:q,canSend:L,sendTitle:w?"Steer — interrupt this turn and send now (Cmd+Enter)":D?"Queue for the next turn (Cmd+Enter)":"Send (Cmd+Enter)",sendAriaLabel:w?"Steer — interrupt this turn and send now (Cmd+Enter)":D?"Queue message for the next turn (Cmd+Enter)":N==="steer"?"Send follow-up (Cmd+Enter)":"Send message (Cmd+Enter)",showAttach:!0,onAttach:d.openPicker,onPaste:d.onPaste,dropHandlers:d.dropHandlers,dragActive:d.dragActive,textareaRef:o,overlay:B,above:X,aboveAttached:!0,header:e.jsxs(e.Fragment,{children:[f?e.jsxs("div",{className:"s-thread-compose-reply",role:"status",children:[e.jsx(re,{className:"s-thread-compose-reply-icon",size:13,strokeWidth:1.8,"aria-hidden":"true"}),e.jsx("span",{className:"s-thread-compose-reply-label",children:"Replying to"}),e.jsx("span",{className:"s-thread-compose-reply-actor",children:f.actorLabel}),e.jsx("span",{className:"s-thread-compose-reply-preview",title:f.preview,children:f.preview}),e.jsx("button",{type:"button",className:"s-thread-compose-reply-cancel","aria-label":"Cancel reply",title:"Cancel reply",onClick:n,children:e.jsx(ae,{size:13,strokeWidth:1.8,"aria-hidden":"true"})})]}):null,A&&E>0?e.jsxs("div",{className:"s-msg-compose-carried",role:"status",children:[E," file",E===1?"":"s"," stay attached to this draft"]}):null,e.jsx(le,{attachments:d})]}),tools:e.jsxs("span",{className:"s-thread-compose-hint s-msg-compose-tools-hint",children:[e.jsx("kbd",{className:"s-kbd",children:"/"})," commands"," · ",e.jsx("kbd",{className:"s-kbd",children:"@"})," agents"]}),onSelect:s=>{const t=s.currentTarget;$(t.value,t.selectionStart)},onBlur:()=>{setTimeout(R,120)},onKeyDown:s=>{if(!(c.open&&m.length>0||a.open&&b.length>0))return!1;if(s.key==="ArrowDown")return c.open?h(r=>({...r,index:(r.index+1)%m.length})):a.open&&k(r=>({...r,index:(r.index+1)%b.length})),!0;if(s.key==="ArrowUp")return c.open?h(r=>({...r,index:(r.index-1+m.length)%m.length})):a.open&&k(r=>({...r,index:(r.index-1+b.length)%b.length})),!0;if(s.key==="Escape")return R(),!0;if((s.key==="Enter"||s.key==="Tab")&&!s.shiftKey&&!s.metaKey&&!s.ctrlKey&&!s.altKey){if(c.open){const r=m[c.index]??m[0];r&&j(r)}else if(a.open){const r=b[a.index]??b[0];r&&y(r)}return!0}return!1}})}const je=Object.freeze(Object.defineProperty({__proto__:null,ConversationComposer:ce},Symbol.toStringTag,{value:"Module"}));export{ce as C,je as a,be as u};
@@ -0,0 +1 @@
1
+ import{j as t}from"./index-o4FKpU7Z.js";import{M as p}from"./message-markup-BcY1lShv.js";import{f as d}from"./conversation-model-CHwHZNw-.js";import{t as n}from"./time-Dhsh_2EG.js";import"./mentions-CvDaviLJ.js";import"./colors-BtO5_zlx.js";import"./index-BMwKgdz_.js";import"./api-h5zurxmi.js";import"./Provider-DKZWuzSR.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./HarnessMark-MztYnrGK.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./AgentDetailCard-Biq8b2gv.js";import"./AgentLiveActions-0iy8QZ1T.js";import"./terminal-takeover-7AvNpnkC.js";import"./openContent-C6XO6kr5.js";import"./eye-B3lBIwJZ.js";import"./terminal-By1Lw2i2.js";function l({at:i}){const r=d(i);return t.jsxs("div",{className:"s-thread-day-divider","aria-label":r,children:[t.jsx("span",{className:"s-thread-day-line","aria-hidden":"true"}),t.jsx("span",{className:"s-thread-day-label",children:r}),t.jsx("span",{className:"s-thread-day-line","aria-hidden":"true"})]})}function mt({row:i,expanded:r,showDayDivider:e,onToggle:s}){const m=`${i.recipients.length} recipients`;return t.jsxs("div",{className:["s-thread-feed-block","s-thread-fanout",e&&"s-thread-feed-block--full-width"].filter(Boolean).join(" "),children:[e&&t.jsx(l,{at:i.createdAt}),i.messages.map(a=>t.jsx("span",{id:`msg-${a.id}`,className:"s-thread-fanout-anchor","aria-hidden":"true"},a.id)),t.jsxs("button",{type:"button",className:"s-thread-fanout-summary","aria-expanded":r,onClick:s,title:i.recipients.join(", "),children:[t.jsx("span",{className:"s-thread-fanout-caret","aria-hidden":"true",children:r?"▾":"▸"}),t.jsx("span",{className:"s-thread-fanout-label",children:m}),t.jsx("span",{className:"s-thread-fanout-time",children:n(i.createdAt)})]}),r&&t.jsxs("div",{className:"s-thread-fanout-detail",children:[t.jsx("ul",{className:"s-thread-fanout-recipients",children:i.messages.map((a,o)=>t.jsx("li",{className:"s-thread-fanout-recipient",children:i.recipients[o]},a.id))}),t.jsx("div",{className:"s-thread-fanout-body",children:t.jsx(p,{text:i.messages[0].body})})]})]})}export{mt as FanOutRow,l as ThreadDayDivider};
@@ -1 +1 @@
1
- import{j as e}from"./index-CzVeWScw.js";import{c as p}from"./clipboard-e3fSpeo7.js";import{b as A}from"./router-B-K15T7B.js";import{A as f}from"./AgentAvatar-CszU5eaU.js";import{u as $}from"./ContextMenu-N-Z6X0Z1.js";import{B as I}from"./BackToPicker-DZg_4nHL.js";import{o as j}from"./openContent-C6XO6kr5.js";import{v as S,w as L}from"./conversation-model-CHwHZNw-.js";import{E as M}from"./eye-BFlhMzQL.js";import{c as T}from"./createLucideIcon-ClCdc3F9.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-C3qU8tnY.js";import"./api-h5zurxmi.js";import"./SpriteAvatar-BpQDpOkq.js";import"./agent-identity-BxCsXnDp.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";const B=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],F=T("user-plus",B);function R({showBackNav:r,isDm:t,navigate:l,route:n,canonicalConversationId:x,threadTitle:d,agentId:c,sessionId:a,detailRoute:h,visibleParticipants:b,hiddenParticipantCount:v,operator:m,canAddParticipants:k,onToggleAddParticipant:g}){const C=$(),u=A(n);return e.jsxs("div",{className:"s-thread-center-header",onClick:s=>{s.target?.closest("button,a,input,select,textarea")||!t||!h||j(l,h,{returnTo:n})},style:t&&h?{cursor:"pointer"}:void 0,onContextMenu:s=>{const o=[{kind:"action",label:"Copy Title",onSelect:()=>{p(d)}}];c&&o.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{p(c)}}),!c&&a&&o.push({kind:"action",label:"Copy Session ID",onSelect:()=>{p(a)}}),o.push({kind:"action",label:"Copy Conversation ID",onSelect:()=>{p(x)}}),C(s,o)},children:[r&&e.jsx(I,{slot:"conversation",fallback:{view:"inbox"},navigate:l,label:"Back",className:"s-thread-header-back"}),e.jsx("div",{className:"s-thread-center-header-info",children:t&&h?e.jsx("button",{type:"button",className:"s-thread-center-header-name",title:`Open ${d} details`,onClick:()=>j(l,h,{returnTo:n}),children:d}):e.jsx("span",{className:"s-thread-center-header-name",children:d})}),e.jsxs("div",{className:"s-thread-center-header-right",children:[b.length>0&&e.jsxs("div",{className:"s-thread-participants","aria-label":"Conversation participants",children:[b.map(s=>{const i=[s.model??(s.harness?"model unknown":null),s.reasoningEffort].filter(Boolean).join(" · ")||null,w=i?`${s.name} · ${i}`:s.title,y=e.jsxs(e.Fragment,{children:[e.jsx(f,{agent:s.agent??void 0,name:s.name,placement:"turn",className:"s-thread-participant-avatar",title:s.name}),e.jsxs("span",{className:"s-thread-participant-identity",children:[e.jsx("span",{className:"s-thread-participant-name",children:s.name}),i&&e.jsx("span",{className:"s-thread-participant-model",title:i,children:i})]})]}),N=s.agent?{view:"agents-v2",agentId:s.agent.id,...u?{machineId:u}:{}}:s.sessionId?{view:"sessions",sessionId:s.sessionId,...u?{machineId:u}:{}}:null;return N?e.jsx("button",{type:"button",className:"s-thread-participant-pill s-thread-participant-pill--button",title:`Open ${s.name} ${s.agent?"profile":"session"}${i?` · ${i}`:""}`,onClick:()=>j(l,N,{returnTo:n}),children:y},s.id):e.jsx("span",{className:"s-thread-participant-pill",title:w,children:y},s.id)}),v>0&&e.jsxs("span",{className:"s-thread-participant-overflow",children:["+",v]}),m.active?e.jsxs("span",{className:"s-thread-participant-pill s-thread-participant-pill--operator",title:`${m.name} · in this conversation`,children:[e.jsx(f,{name:m.name,placement:"turn",className:"s-thread-participant-avatar s-thread-participant-avatar--operator",title:m.name}),e.jsx("span",{className:"s-thread-participant-identity",children:e.jsx("span",{className:"s-thread-participant-name",children:"You"})})]}):e.jsxs("span",{className:"s-thread-participant-observer",title:`${m.name} · observing (not in thread)`,children:[e.jsx(M,{size:12,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Observing"})]})]}),k&&e.jsx("button",{type:"button",className:"s-thread-add-participant-trigger",onClick:g,title:"Add participant","aria-label":"Add participant",children:e.jsx(F,{size:14,strokeWidth:1.9,"aria-hidden":"true"})})]})]})}function P({canonicalConversationId:r,conversationAlias:t}){return e.jsxs("div",{className:"s-thread-identity-row",children:[e.jsxs("button",{type:"button",className:"s-thread-identity-chip",title:r,onClick:()=>{p(r)},children:[e.jsx("span",{children:S()}),e.jsx("strong",{children:L(r)})]}),t&&e.jsxs("span",{className:"s-thread-identity-chip",title:t,children:[e.jsx("span",{children:"Alias"}),e.jsx("strong",{children:t})]})]})}function ee({agents:r,addParticipantId:t,setAddParticipantId:l,addingParticipant:n,addParticipantError:x,onCancel:d,onSubmit:c}){return e.jsxs("form",{className:"s-thread-add-participant",onSubmit:a=>{a.preventDefault(),c()},children:[e.jsxs("div",{className:"s-thread-add-participant-row",children:[e.jsxs("div",{className:"s-thread-add-participant-field",children:[e.jsx("label",{className:"s-thread-add-participant-label",htmlFor:"thread-add-participant-select",children:"Agent"}),e.jsx("select",{id:"thread-add-participant-select",className:"s-thread-add-participant-select",value:t,onChange:a=>l(a.target.value),autoFocus:!0,children:r.map(a=>e.jsx("option",{value:a.id,children:a.name},a.id))})]}),e.jsxs("div",{className:"s-thread-add-participant-actions",children:[e.jsx("button",{type:"button",className:"s-btn s-btn-sm",onClick:d,disabled:n,children:"Cancel"}),e.jsx("button",{type:"submit",className:"s-btn s-btn-primary s-btn-sm",disabled:n||t.trim().length===0,children:n?"Adding...":"Add"})]})]}),x&&e.jsx("div",{className:"s-thread-add-participant-error",children:x})]})}export{ee as AddParticipantForm,R as ConversationHeader,P as ConversationIdentityRow};
1
+ import{j as e}from"./index-o4FKpU7Z.js";import{c as p}from"./clipboard-e3fSpeo7.js";import{d as A}from"./router-C65cZYPn.js";import{A as f}from"./AgentAvatar-DMov24_o.js";import{u as $}from"./ContextMenu-CxkmFQcN.js";import{B as I}from"./BackToPicker-BXp5E2ck.js";import{o as j}from"./openContent-C6XO6kr5.js";import{v as S,w as L}from"./conversation-model-CHwHZNw-.js";import{E as M}from"./eye-B3lBIwJZ.js";import{c as T}from"./createLucideIcon-Bt67PWH-.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";const B=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],F=T("user-plus",B);function R({showBackNav:r,isDm:t,navigate:l,route:n,canonicalConversationId:x,threadTitle:d,agentId:c,sessionId:a,detailRoute:h,visibleParticipants:b,hiddenParticipantCount:v,operator:m,canAddParticipants:k,onToggleAddParticipant:g}){const C=$(),u=A(n);return e.jsxs("div",{className:"s-thread-center-header",onClick:s=>{s.target?.closest("button,a,input,select,textarea")||!t||!h||j(l,h,{returnTo:n})},style:t&&h?{cursor:"pointer"}:void 0,onContextMenu:s=>{const o=[{kind:"action",label:"Copy Title",onSelect:()=>{p(d)}}];c&&o.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{p(c)}}),!c&&a&&o.push({kind:"action",label:"Copy Session ID",onSelect:()=>{p(a)}}),o.push({kind:"action",label:"Copy Conversation ID",onSelect:()=>{p(x)}}),C(s,o)},children:[r&&e.jsx(I,{slot:"conversation",fallback:{view:"inbox"},navigate:l,label:"Back",className:"s-thread-header-back"}),e.jsx("div",{className:"s-thread-center-header-info",children:t&&h?e.jsx("button",{type:"button",className:"s-thread-center-header-name",title:`Open ${d} details`,onClick:()=>j(l,h,{returnTo:n}),children:d}):e.jsx("span",{className:"s-thread-center-header-name",children:d})}),e.jsxs("div",{className:"s-thread-center-header-right",children:[b.length>0&&e.jsxs("div",{className:"s-thread-participants","aria-label":"Conversation participants",children:[b.map(s=>{const i=[s.model??(s.harness?"model unknown":null),s.reasoningEffort].filter(Boolean).join(" · ")||null,w=i?`${s.name} · ${i}`:s.title,y=e.jsxs(e.Fragment,{children:[e.jsx(f,{agent:s.agent??void 0,name:s.name,placement:"turn",className:"s-thread-participant-avatar",title:s.name}),e.jsxs("span",{className:"s-thread-participant-identity",children:[e.jsx("span",{className:"s-thread-participant-name",children:s.name}),i&&e.jsx("span",{className:"s-thread-participant-model",title:i,children:i})]})]}),N=s.agent?{view:"agents-v2",agentId:s.agent.id,...u?{machineId:u}:{}}:s.sessionId?{view:"sessions",sessionId:s.sessionId,...u?{machineId:u}:{}}:null;return N?e.jsx("button",{type:"button",className:"s-thread-participant-pill s-thread-participant-pill--button",title:`Open ${s.name} ${s.agent?"profile":"session"}${i?` · ${i}`:""}`,onClick:()=>j(l,N,{returnTo:n}),children:y},s.id):e.jsx("span",{className:"s-thread-participant-pill",title:w,children:y},s.id)}),v>0&&e.jsxs("span",{className:"s-thread-participant-overflow",children:["+",v]}),m.active?e.jsxs("span",{className:"s-thread-participant-pill s-thread-participant-pill--operator",title:`${m.name} · in this conversation`,children:[e.jsx(f,{name:m.name,placement:"turn",className:"s-thread-participant-avatar s-thread-participant-avatar--operator",title:m.name}),e.jsx("span",{className:"s-thread-participant-identity",children:e.jsx("span",{className:"s-thread-participant-name",children:"You"})})]}):e.jsxs("span",{className:"s-thread-participant-observer",title:`${m.name} · observing (not in thread)`,children:[e.jsx(M,{size:12,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Observing"})]})]}),k&&e.jsx("button",{type:"button",className:"s-thread-add-participant-trigger",onClick:g,title:"Add participant","aria-label":"Add participant",children:e.jsx(F,{size:14,strokeWidth:1.9,"aria-hidden":"true"})})]})]})}function P({canonicalConversationId:r,conversationAlias:t}){return e.jsxs("div",{className:"s-thread-identity-row",children:[e.jsxs("button",{type:"button",className:"s-thread-identity-chip",title:r,onClick:()=>{p(r)},children:[e.jsx("span",{children:S()}),e.jsx("strong",{children:L(r)})]}),t&&e.jsxs("span",{className:"s-thread-identity-chip",title:t,children:[e.jsx("span",{children:"Alias"}),e.jsx("strong",{children:t})]})]})}function ee({agents:r,addParticipantId:t,setAddParticipantId:l,addingParticipant:n,addParticipantError:x,onCancel:d,onSubmit:c}){return e.jsxs("form",{className:"s-thread-add-participant",onSubmit:a=>{a.preventDefault(),c()},children:[e.jsxs("div",{className:"s-thread-add-participant-row",children:[e.jsxs("div",{className:"s-thread-add-participant-field",children:[e.jsx("label",{className:"s-thread-add-participant-label",htmlFor:"thread-add-participant-select",children:"Agent"}),e.jsx("select",{id:"thread-add-participant-select",className:"s-thread-add-participant-select",value:t,onChange:a=>l(a.target.value),autoFocus:!0,children:r.map(a=>e.jsx("option",{value:a.id,children:a.name},a.id))})]}),e.jsxs("div",{className:"s-thread-add-participant-actions",children:[e.jsx("button",{type:"button",className:"s-btn s-btn-sm",onClick:d,disabled:n,children:"Cancel"}),e.jsx("button",{type:"submit",className:"s-btn s-btn-primary s-btn-sm",disabled:n||t.trim().length===0,children:n?"Adding...":"Add"})]})]}),x&&e.jsx("div",{className:"s-thread-add-participant-error",children:x})]})}export{ee as AddParticipantForm,R as ConversationHeader,P as ConversationIdentityRow};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/conversation-motion-features-zU0k3Agz.js","assets/use-reduced-motion-CqXpVXv-.js","assets/index-o4FKpU7Z.js","assets/index-Bu-fckyR.css"])))=>i.map(i=>d[i]);
2
+ import{j as e,_ as M,r as x}from"./index-o4FKpU7Z.js";import{b as L,t as _,g as S,r as R,d as $,m as w,c as E,e as I,p as P}from"./conversation-model-CHwHZNw-.js";import{n as W,d as b,f as B,s as z}from"./colors-BtO5_zlx.js";import{i as y}from"./sessionRead-CvFz2RHv.js";import{t as j,f as k}from"./time-Dhsh_2EG.js";import{u as U}from"./Provider-DKZWuzSR.js";import{o as f}from"./openContent-C6XO6kr5.js";import{u as D,L as F,m as p}from"./use-reduced-motion-CqXpVXv-.js";import{A as O}from"./activity-BvGruxWG.js";import{T as H}from"./terminal-By1Lw2i2.js";import{M as K}from"./message-circle-BM3XgevU.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";const G=[{head:"30%",body:"88%",short:"62%"},{head:"22%",body:"76%",short:"48%"},{head:"34%",body:"82%",short:"68%"}],J=()=>M(()=>import("./conversation-motion-features-zU0k3Agz.js"),__vite__mapDeps([0,1,2,3])).then(a=>a.default);function Y({onOpenTrace:a,onOpenTerminal:i,onSteer:d,compact:r=!1}){return!a&&!i&&!d?null:e.jsxs("nav",{className:`s-thread-working-actions${r?" s-thread-working-actions--compact":""}`,"aria-label":"Working turn actions",children:[a&&e.jsxs("button",{type:"button",className:"s-thread-working-action s-thread-working-action--primary",onClick:a,title:"Watch this run's live trace",children:[e.jsx(O,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Live trace"})]}),i&&e.jsxs("button",{type:"button",className:"s-thread-working-action",onClick:i,title:"Jump into this agent's terminal",children:[e.jsx(H,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Terminal"})]}),d&&e.jsxs("button",{type:"button",className:"s-thread-working-action",onClick:d,title:"Write an interrupting message to steer this turn",children:[e.jsx(K,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Steer…"})]})]})}const q={think:"Thinking",tool:"Tool",ask:"Prompt",message:"Says",note:"Note",system:"System",boot:"Boot"};function N({steps:a,phase:i,limit:d=5,compact:r=!1}){const l=a.slice(-d),o=a.length-l.length;return l.length===0?i?e.jsxs("div",{className:"s-thread-steps-phase",children:[e.jsx("span",{children:i.label}),e.jsx("strong",{children:i.detail})]}):null:e.jsxs("div",{className:`s-thread-steps${r?" s-thread-steps--compact":""}`,children:[o>0&&e.jsxs("div",{className:"s-thread-steps-elided",children:[o," earlier step",o===1?"":"s"]}),e.jsx("ol",{"aria-label":"Live steps in this turn",children:l.map(s=>e.jsxs("li",{"data-kind":s.kind,children:[e.jsx("span",{className:"s-thread-step-mark","aria-hidden":"true"}),e.jsx("span",{className:"s-thread-step-kind",children:q[s.kind]}),e.jsxs("span",{className:"s-thread-step-body",children:[s.tool?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-thread-step-tool",children:s.tool}),s.arg&&e.jsx("span",{className:"s-thread-step-arg",children:s.arg})]}):e.jsx("span",{className:"s-thread-step-text",children:s.text}),s.repeatCount>1&&e.jsxs("span",{className:"s-thread-step-repeat",children:["×",s.repeatCount]}),s.outcome&&e.jsx("span",{className:"s-thread-step-outcome",children:s.outcome})]}),e.jsx("time",{title:k(s.ts),children:j(s.ts)})]},s.id))})]})}function Q({events:a,limit:i=3,compact:d=!1}){const r=a.slice(0,i);return r.length===0?null:e.jsx("ol",{className:`s-thread-motion-events${d?" s-thread-motion-events--compact":""}`,"aria-label":"Latest run activity",children:r.map(l=>e.jsxs("li",{children:[e.jsx("span",{className:"s-thread-motion-event-kind",children:L(l.kind)}),e.jsx("span",{className:"s-thread-motion-event-summary",children:_(l)??"Activity recorded"}),e.jsx("time",{title:k(l.ts),children:j(l.ts)})]},l.id))})}function Ke(){const a=D();return e.jsx(F,{features:J,strict:!0,children:e.jsxs(p.section,{className:"s-thread-skeleton","aria-busy":"true","aria-live":"polite",initial:a?!1:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:[.2,.7,.3,1]},children:[e.jsxs("div",{className:"s-thread-skeleton-intro",role:"status",children:[e.jsxs("div",{className:"s-thread-loader-mark","aria-hidden":"true",children:[e.jsx(p.span,{className:"s-thread-loader-orbit",animate:a?void 0:{rotate:360},transition:{duration:3.2,ease:"linear",repeat:1/0},children:e.jsx("span",{})}),e.jsx(p.span,{className:"s-thread-loader-core",animate:a?void 0:{scale:[.88,1,.88],opacity:[.58,1,.58]},transition:{duration:1.8,ease:"easeInOut",repeat:1/0}})]}),e.jsxs("span",{className:"s-thread-skeleton-copy",children:[e.jsx("strong",{children:"Composer ready"}),e.jsx("span",{children:"Gathering the conversation…"})]})]}),e.jsx("div",{className:"s-thread-skeleton-turns","aria-hidden":"true",children:G.map((i,d)=>e.jsxs(p.div,{className:"s-thread-skeleton-turn",initial:a?!1:{opacity:0,y:7},animate:{opacity:1,y:0},transition:{delay:a?0:.05+d*.055,duration:.24,ease:[.2,.7,.3,1]},children:[e.jsx("span",{className:"s-thread-skeleton-avatar"}),e.jsxs("div",{className:"s-thread-skeleton-lines",children:[e.jsx("span",{className:"s-thread-skeleton-line s-thread-skeleton-line--head",style:{width:i.head}}),e.jsx("span",{className:"s-thread-skeleton-line",style:{width:i.body}}),e.jsx("span",{className:"s-thread-skeleton-line s-thread-skeleton-line--short",style:{width:i.short}})]})]},`${i.head}-${i.body}`))})]})})}function Ge({sessions:a,activeConversationId:i,needsYouIds:d,lastViewed:r,navigate:l}){const o=a.filter(n=>d.has(n.id)||n.agentId&&d.has(n.agentId)),s=x.useMemo(()=>S(a),[a]);return e.jsx("aside",{className:"s-thread-rail",children:e.jsxs("div",{className:"s-thread-rail-scroll",children:[o.length>0&&e.jsxs("div",{className:"s-thread-rail-section s-thread-rail-section--needs-you",children:[e.jsx("div",{className:"s-thread-rail-section-label",children:"Needs you"}),o.map(n=>e.jsx(g,{session:n,active:n.id===i,unread:y(n.lastMessageAt,n.id,r),needsYou:!0,navigate:l},`needs-${n.id}`))]}),s.map(n=>e.jsxs("div",{className:"s-thread-rail-section",children:[e.jsx("div",{className:"s-thread-rail-section-label",children:n.workspace}),n.sessions.map(c=>e.jsx(g,{session:c,active:c.id===i,unread:y(c.lastMessageAt,c.id,r),needsYou:!1,navigate:l},c.id))]},n.workspace))]})})}function Je({sessionMeta:a,agents:i,flights:d,conversationId:r,navigate:l,route:o}){const s=x.useMemo(()=>a?a.participantIds.filter(t=>t!=="operator").map(t=>R(i,[t])).filter(t=>t!==null):[],[a,i]),n={id:"operator",name:"You",handle:"operator",activity:null,state:"ready",agent:null},c=x.useMemo(()=>s.map(t=>({id:t.id,name:t.name,handle:w(t)??E(t.id)??t.id,activity:$(t,d,r),state:W(t.state),agent:t})),[s,d,r]),h=[n,...c];return e.jsxs("aside",{className:"s-thread-sidebar",children:[e.jsxs("div",{className:"s-thread-sidebar-section",children:[e.jsx("div",{className:"s-thread-sidebar-label",children:"In this conversation"}),h.map(t=>{const m=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"28px",background:b(t.name)},children:t.name[0]?.toUpperCase()??"?"}),e.jsxs("div",{className:"s-thread-sidebar-participant-info",children:[e.jsx("span",{className:"s-thread-sidebar-participant-name",children:t.name}),e.jsxs("span",{className:"s-thread-sidebar-participant-handle",children:["@",t.handle]})]}),e.jsx("div",{className:"s-thread-sidebar-participant-activity",children:t.activity?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-thread-sidebar-activity-dot s-thread-sidebar-activity-dot--pulse",style:{background:"var(--green)"}}),e.jsx("span",{className:"s-thread-sidebar-activity-label",children:t.activity})]}):B(t.state)||t.id==="operator"?e.jsx("span",{className:"s-thread-sidebar-activity-dot",style:{background:z(t.state)}}):e.jsx("span",{className:"s-thread-sidebar-activity-dot",style:{background:"var(--dim)"}})})]});return t.agent?e.jsx("button",{type:"button",className:"s-thread-sidebar-participant s-thread-sidebar-participant--clickable",onClick:()=>f(l,{view:"agents-v2",agentId:t.agent.id},{returnTo:o}),title:`Open ${t.name} profile`,children:m},t.id):e.jsx("div",{className:"s-thread-sidebar-participant",children:m},t.id)})]}),c.length>0&&e.jsxs("div",{className:"s-thread-sidebar-section",children:[e.jsx("div",{className:"s-thread-sidebar-label",children:"Conversation mesh"}),e.jsx(V,{participants:c})]})]})}function Ye({agentName:a,title:i,detail:d,snapshot:r,events:l,steps:o,phase:s,tone:n,workspaceName:c,branch:h,startedAt:t,onOpenTrace:m,onOpenTerminal:A,onSteer:C}){const T=t?j(t):"now";return e.jsxs("section",{className:`s-thread-motion-panel s-thread-motion-panel--${n}`,"aria-live":"polite",children:[e.jsxs("div",{className:"s-thread-motion-head",children:[e.jsx("div",{className:"s-thread-motion-beacon","aria-hidden":"true",children:e.jsx("span",{})}),e.jsxs("div",{className:"s-thread-motion-title-block",children:[e.jsx("div",{className:"s-thread-motion-kicker",children:"Currently working"}),e.jsx("h2",{children:i}),e.jsx("p",{children:d})]})]}),e.jsx("div",{className:"s-thread-motion-meter","aria-hidden":"true",children:X.map((u,v)=>e.jsx("span",{style:{"--bar-height":`${u}%`,"--bar-delay":`${v*74}ms`}},`${u}-${v}`))}),e.jsxs("dl",{className:"s-thread-motion-stats",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Session"}),e.jsx("dd",{children:T})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Activity"}),e.jsx("dd",{children:r.activityLabel})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Last"}),e.jsx("dd",{children:r.lastActivityLabel})]})]}),e.jsxs("div",{className:"s-thread-motion-latest",children:[e.jsx("span",{children:a}),e.jsx("strong",{children:r.latest})]}),o.length>0?e.jsx(N,{steps:o,phase:null,limit:6}):l.length>0?e.jsx(Q,{events:l,limit:4}):s?e.jsx(N,{steps:o,phase:s,limit:6}):e.jsxs("div",{className:"s-thread-motion-waiting",children:[e.jsx("span",{children:"Session created"}),e.jsx("strong",{children:"waiting for the first trace event"})]}),(c||h)&&e.jsxs("div",{className:"s-thread-motion-chips",children:[c&&e.jsx("span",{children:c}),h&&e.jsx("span",{children:h})]}),e.jsx(Y,{onOpenTrace:m,onOpenTerminal:A,onSteer:C})]})}function g({session:a,active:i,unread:d,needsYou:r,navigate:l}){const{route:o}=U(),s=I(a),n=(a.agentName??s)[0]?.toUpperCase()??"?",c=a.kind==="direct",h=P(a.workspaceRoot)??a.kind;return e.jsxs("button",{type:"button",className:["s-thread-rail-item",i&&"s-thread-rail-item--active",r&&"s-thread-rail-item--needs-you"].filter(Boolean).join(" "),onClick:()=>f(l,{view:"conversation",conversationId:a.id},{returnTo:o}),children:[c?e.jsx("div",{className:"s-thread-rail-avatar",style:{background:b(a.agentName??s)},children:n}):e.jsx("div",{className:"s-thread-rail-avatar s-thread-rail-avatar--channel",children:"#"}),e.jsxs("div",{className:"s-thread-rail-body",children:[e.jsx("span",{className:"s-thread-rail-name",children:s}),e.jsx("span",{className:"s-thread-rail-sub",children:h})]}),e.jsxs("div",{className:"s-thread-rail-trailing",children:[d&&!r&&e.jsx("span",{className:"s-thread-rail-presence-dot",style:{background:"var(--accent)"}}),r&&e.jsx("span",{className:"s-thread-rail-badge s-thread-rail-badge--amber",children:"!"})]})]})}function V({participants:a}){const o=a.map((s,n)=>{const c=2*Math.PI*n/a.length-Math.PI/2;return{...s,x:130+55*Math.cos(c),y:80+55*Math.sin(c)}});return e.jsx("div",{className:"s-thread-mini-mesh",children:e.jsxs("svg",{viewBox:"0 0 260 160","aria-label":"Conversation participant mesh",children:[o.map(s=>e.jsx("line",{x1:130,y1:80,x2:s.x,y2:s.y,className:"s-thread-mini-mesh-edge"},`edge-${s.id}`)),e.jsx("circle",{cx:130,cy:80,r:16,className:"s-thread-mini-mesh-node s-thread-mini-mesh-node--center"}),e.jsx("text",{x:130,y:80,className:"s-thread-mini-mesh-label s-thread-mini-mesh-label--center",children:"OP"}),o.map(s=>e.jsxs("g",{children:[e.jsx("circle",{cx:s.x,cy:s.y,r:16,className:"s-thread-mini-mesh-node",style:s.state==="in_turn"||s.state==="in_flight"?{stroke:"var(--green)"}:void 0}),e.jsx("text",{x:s.x,y:s.y,className:"s-thread-mini-mesh-label",children:s.name.slice(0,3).toUpperCase()})]},`node-${s.id}`))]})})}const X=[42,76,54,88,34,66,92,48,72,38,84,58];export{Ge as ChannelRail,Je as PresenceSidebar,Ke as ThreadLoadingSkeleton,Ye as ThreadMotionPanel,Y as WorkingTurnActions,Q as WorkingTurnActivityPreview,N as WorkingTurnSteps};