@openscout/scout 0.2.97 → 0.2.98

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 (391) hide show
  1. package/README.md +0 -1
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/ActivityScreen-sfonf5SR.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-r_1tVuWk.js → AddProjectForm-fXndbzXT.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-B7c0egdP.js → AgentAvatar-Dz79iTxB.js} +1 -1
  7. package/dist/client/assets/AgentConfigurationScreen-DDc3udYM.js +1 -0
  8. package/dist/client/assets/AgentDefinitionsWorkspace-DHDS9Pgd.js +1 -0
  9. package/dist/client/assets/{AgentDetailCard-B_KLcgsP.js → AgentDetailCard-8viaEY8b.js} +1 -1
  10. package/dist/client/assets/AgentFloorView-DuyvyMMj.js +1 -0
  11. package/dist/client/assets/AgentInfoScreen-qntgg2q2.js +1 -0
  12. package/dist/client/assets/{AgentLaneCard-ajZvcfdW.js → AgentLaneCard-Cc9uyfBr.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-CTp39syR.js → AgentLaneChrome-Dv2lBFoH.js} +1 -1
  14. package/dist/client/assets/{AgentLaneDetailSheet-DRc-TpMB.js → AgentLaneDetailSheet-CGqtqSHQ.js} +1 -1
  15. package/dist/client/assets/{AgentLaneSummaryResize-VMNDo7kD.js → AgentLaneSummaryResize-Di4u6df2.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-BA6fRwkD.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-CFadSaia.js → AgentLanesPreflight-CCGBArIb.js} +1 -1
  18. package/dist/client/assets/AgentLanesView-96lHsoX7.js +2 -0
  19. package/dist/client/assets/{AgentLiveActions-CsQA3pu_.js → AgentLiveActions-DlSKL60c.js} +1 -1
  20. package/dist/client/assets/AgentMasterScreen-DHrMuQ6_.js +1 -0
  21. package/dist/client/assets/{AgentSessions-BePq5Lgc.js → AgentSessions-DV9v34aq.js} +2 -2
  22. package/dist/client/assets/AgentsConsole-DTpVhS67.js +1 -0
  23. package/dist/client/assets/AgentsScreen-hZ4o2I-e.js +1 -0
  24. package/dist/client/assets/AgentsSubnav-Ci7uWM7P.js +1 -0
  25. package/dist/client/assets/{AstronautSuit-Cjjcv6yQ.js → AstronautSuit-CwB4Dw07.js} +1 -1
  26. package/dist/client/assets/{AtopView-PxWQd-sX.js → AtopView-D7vyQDtE.js} +1 -1
  27. package/dist/client/assets/{BackToPicker-Cto0Ioz9.js → BackToPicker-BHicJyfc.js} +1 -1
  28. package/dist/client/assets/BriefingDetailScreen-B-wD_Bot.js +1 -0
  29. package/dist/client/assets/{BriefingsScreen-DNyFBrPn.js → BriefingsScreen-Cn4Mbam9.js} +1 -1
  30. package/dist/client/assets/{BrokerMetadataPanel-DbaCQlhw.js → BrokerMetadataPanel-BJSwU9XZ.js} +1 -1
  31. package/dist/client/assets/BrokerScreen-C8FQ5rlg.js +5 -0
  32. package/dist/client/assets/{CastPicker-CTBHjjGw.js → CastPicker-CkgTalIt.js} +1 -1
  33. package/dist/client/assets/{ChatCollapsedStrip-D4rc7wBQ.js → ChatCollapsedStrip-7Wrg8Ge0.js} +1 -1
  34. package/dist/client/assets/{CodeDiffPane-QvxCUzTi.js → CodeDiffPane-DfluIWmO.js} +1 -1
  35. package/dist/client/assets/{CodeProjectPicker-DplkpM7f.js → CodeProjectPicker-By_Wz9ex.js} +1 -1
  36. package/dist/client/assets/CodeScreen-cLC0tJ4S.js +1 -0
  37. package/dist/client/assets/ConversationComposer-BUIjWMBi.js +1 -0
  38. package/dist/client/assets/ConversationFeedRows-Bx0gFyG_.js +1 -0
  39. package/dist/client/assets/ConversationHeader-Bt2RBj93.js +1 -0
  40. package/dist/client/assets/{ConversationPanels-fMo6Uy1v.js → ConversationPanels-o6W-cOoU.js} +2 -2
  41. package/dist/client/assets/ConversationScreen-DIU7m_aC.js +2 -0
  42. package/dist/client/assets/{ConversationStatus-DI5GCiyW.js → ConversationStatus-CTYOywFh.js} +1 -1
  43. package/dist/client/assets/{CrewAvatar-CXJHLNVM.js → CrewAvatar-CZ_faQ_s.js} +1 -1
  44. package/dist/client/assets/CrewWorkspaces-DNX-QQ1h.js +1 -0
  45. package/dist/client/assets/{DataTable-DXIlOlVu.js → DataTable-C6aMSilS.js} +1 -1
  46. package/dist/client/assets/{DispatchAftermath-CrELgl2e.js → DispatchAftermath-ZCEB75hh.js} +1 -1
  47. package/dist/client/assets/{DocumentFocusViewer-DFFE85Tq.js → DocumentFocusViewer-D8iB6SMt.js} +1 -1
  48. package/dist/client/assets/{EmbeddableSurfacesLab-DgpewB3y.js → EmbeddableSurfacesLab-D3iZiS8o.js} +1 -1
  49. package/dist/client/assets/{EmptyState-D9X16fKq.js → EmptyState-CKPWFSjq.js} +1 -1
  50. package/dist/client/assets/{FileViewerPane-CY0RN78e.js → FileViewerPane-CxNbcTYf.js} +1 -1
  51. package/dist/client/assets/FlightObserveScreen-BTe1YRPr.js +1 -0
  52. package/dist/client/assets/{FollowScreen-wZ-z67mX.js → FollowScreen-CkR-okdL.js} +1 -1
  53. package/dist/client/assets/{HarnessMark-DAaWPiT_.js → HarnessMark-DttReffF.js} +1 -1
  54. package/dist/client/assets/HarnessesScreen-COO_Q8VY.js +1 -0
  55. package/dist/client/assets/{HerdrSession-CYKRfBad.js → HerdrSession-DsuxCtfX.js} +1 -1
  56. package/dist/client/assets/{HomeHero-DYyd3cpz.js → HomeHero-DXJo2QSO.js} +1 -1
  57. package/dist/client/assets/{HostAdvisorView-NtM0bsg8.js → HostAdvisorView-DeJ-8RZV.js} +1 -1
  58. package/dist/client/assets/{KnowledgeSearchInspector-CU6BCFcS.js → KnowledgeSearchInspector-W_zNIBRV.js} +1 -1
  59. package/dist/client/assets/KnowledgeSearchScreen-_rxJNUUh.js +1 -0
  60. package/dist/client/assets/{LaneToolHoverCard-Bo2Zl-1a.js → LaneToolHoverCard-t7-XJP-h.js} +1 -1
  61. package/dist/client/assets/LaneTraceDetailSheet-DNIECgEl.js +1 -0
  62. package/dist/client/assets/{LaneTraceEventFocus-Cek_64zR.js → LaneTraceEventFocus-BB5DhFQm.js} +1 -1
  63. package/dist/client/assets/{MeshCanvas-TvsID4fe.js → MeshCanvas-DZv2ipsy.js} +1 -1
  64. package/dist/client/assets/{MeshCanvasMinimap-CxqeVVco.js → MeshCanvasMinimap-BXHRNb7l.js} +1 -1
  65. package/dist/client/assets/MeshScreen-DuNvpDC5.js +1 -0
  66. package/dist/client/assets/{MeshTopologyView-BjprutE8.js → MeshTopologyView-Dc0GSrKa.js} +2 -2
  67. package/dist/client/assets/MessagesScreen-dNNPFwAc.js +1 -0
  68. package/dist/client/assets/{MissionContextRail-Be0uXljQ.js → MissionContextRail-DnCWPzAM.js} +1 -1
  69. package/dist/client/assets/MissionControlView-DmaThhNR.js +1 -0
  70. package/dist/client/assets/MissionFocusOverlay-K21ssTxv.js +1 -0
  71. package/dist/client/assets/MissionLeftAgentRow-CbQm4BLv.js +1 -0
  72. package/dist/client/assets/{MissionLogPane-EsM_S3ro.js → MissionLogPane-BLvSSIdT.js} +1 -1
  73. package/dist/client/assets/{NewAgentModal-Cqiq1CE1.js → NewAgentModal-B7qxjZlW.js} +1 -1
  74. package/dist/client/assets/NewChatComposer-D2Ah4T-W.js +19 -0
  75. package/dist/client/assets/{NewChatOrigin-D7hwp6dm.js → NewChatOrigin-DCn5cWPZ.js} +1 -1
  76. package/dist/client/assets/{ObserveEmbedScreen-CGHI_hb5.js → ObserveEmbedScreen-DvKGsaLv.js} +2 -2
  77. package/dist/client/assets/{ObserveTextFlow-BcrGQet8.js → ObserveTextFlow-DCJ5EmD8.js} +2 -2
  78. package/dist/client/assets/{ObservedTopologyPanel-BhVsvwkh.js → ObservedTopologyPanel-CJVqIqQ2.js} +1 -1
  79. package/dist/client/assets/{OpenScoutAppShell-BtfvMkAp.js → OpenScoutAppShell-C9TOLB7u.js} +2 -2
  80. package/dist/client/assets/OpsAgentsView-vIoY-AW1.js +1 -0
  81. package/dist/client/assets/OpsScreen-CJBwshEp.js +1 -0
  82. package/dist/client/assets/OpsSubnav-CjDTnp64.js +1 -0
  83. package/dist/client/assets/ProjectAgentProfile-Br1eTD7G.js +1 -0
  84. package/dist/client/assets/ProjectAgentProfileBar-CUzZ4Rpx.js +1 -0
  85. package/dist/client/assets/ProjectAgentProfileHero-mjxNcRvw.js +1 -0
  86. package/dist/client/assets/ProjectsInbox-Bq29DE_o.js +2 -0
  87. package/dist/client/assets/ProjectsRail-kMDA0yn4.js +1 -0
  88. package/dist/client/assets/ProjectsScreen-BDaJYhc0.js +1 -0
  89. package/dist/client/assets/ProjectsThreadAside-B940p3vW.js +1 -0
  90. package/dist/client/assets/Provider-D0bB7q6y.js +1 -0
  91. package/dist/client/assets/{RailRow-ClMmtaIE.js → RailRow-B88JVr62.js} +1 -1
  92. package/dist/client/assets/RawSessionsTable-CzGhEdiZ.js +1 -0
  93. package/dist/client/assets/RealtimeVoiceScreen-CyP1CWsX.js +1 -0
  94. package/dist/client/assets/{RepoDiffEmbedScreen-CjZ5ew3y.js → RepoDiffEmbedScreen-mexrJPhW.js} +1 -1
  95. package/dist/client/assets/{RepoDiffPageScreen-CdTFfmbk.js → RepoDiffPageScreen-DbqX4L3q.js} +1 -1
  96. package/dist/client/assets/{RepoDiffViewer-BFperHQg.js → RepoDiffViewer-Bw5yMC4A.js} +1 -1
  97. package/dist/client/assets/{RepoDiffViewerLazy-BkBmbi1Z.js → RepoDiffViewerLazy-DzfoFhbl.js} +2 -2
  98. package/dist/client/assets/{ReposScreen-C8dT4bK0.js → ReposScreen-CzbO1Fuy.js} +2 -2
  99. package/dist/client/assets/{ScoutDeckSurface-BcJsm2Kq.js → ScoutDeckSurface-DQoZofzH.js} +1 -1
  100. package/dist/client/assets/{ScoutSurface-DmzEtrx8.js → ScoutSurface-NlhDsPzg.js} +1 -1
  101. package/dist/client/assets/{ScoutbotFxLab-DU15Plja.js → ScoutbotFxLab-l2WAahCg.js} +1 -1
  102. package/dist/client/assets/{SecondaryNav-BrXMtvKE.js → SecondaryNav-Cs0_FQdj.js} +1 -1
  103. package/dist/client/assets/{SessionEmbedScreen-Bt4flmAx.js → SessionEmbedScreen-CpduQ0O9.js} +1 -1
  104. package/dist/client/assets/{SessionObserve-BCehTlO8.js → SessionObserve-BVeTkcIl.js} +1 -1
  105. package/dist/client/assets/{SessionObserveEvidence-Bb6U-dem.js → SessionObserveEvidence-BkOezTGV.js} +1 -1
  106. package/dist/client/assets/SessionRefScreen-DetLMkTT.js +1 -0
  107. package/dist/client/assets/SessionsScreen-B-McKw6d.js +1 -0
  108. package/dist/client/assets/{SettingsDrawer-BieUmb8g.js → SettingsDrawer-CPB32w0n.js} +3 -3
  109. package/dist/client/assets/SettingsScreen-BEzYFdjz.js +1 -0
  110. package/dist/client/assets/{ShikiPane-DPWsVNtn.js → ShikiPane-C0TuCATU.js} +1 -1
  111. package/dist/client/assets/{SlidePanel-BMRIR6bH.js → SlidePanel-CETQ5NTx.js} +1 -1
  112. package/dist/client/assets/{SpriteAvatar-56DTXxSV.js → SpriteAvatar-DFO4Kb4Z.js} +1 -1
  113. package/dist/client/assets/{StatusPill-BcuYUgsD.js → StatusPill-BllrY-eg.js} +1 -1
  114. package/dist/client/assets/{TailView-BDy8c2VB.js → TailView-_gKWfaQM.js} +2 -2
  115. package/dist/client/assets/Terminal-DWyZTZdY.js +1 -0
  116. package/dist/client/assets/TerminalEmbedScreen-_SSzwhWa.js +1 -0
  117. package/dist/client/assets/{TerminalHeaderMount-Cy-uxkey.js → TerminalHeaderMount-CY7uIWBg.js} +1 -1
  118. package/dist/client/assets/{TextDocumentSurface-BeSwe3Yl.js → TextDocumentSurface-2X1Gw4eA.js} +1 -1
  119. package/dist/client/assets/{TmuxPeek-B4no_aGI.js → TmuxPeek-CqTJRhkI.js} +1 -1
  120. package/dist/client/assets/{VoicePermissionsPanel-Bd16scwz.js → VoicePermissionsPanel-C4vkU-sU.js} +1 -1
  121. package/dist/client/assets/{WorkDetailScreen-DIFQufak.js → WorkDetailScreen-DqGnuK0e.js} +3 -3
  122. package/dist/client/assets/{WorkFilesViewer-CT5XEFGf.js → WorkFilesViewer-D8-4vF5l.js} +1 -1
  123. package/dist/client/assets/{activity-CqZafWfx.js → activity-CzTJ-YMX.js} +1 -1
  124. package/dist/client/assets/{addon-fit-CM6F_JRD.js → addon-fit-Zx3A7pGS.js} +1 -1
  125. package/dist/client/assets/{addon-webgl-DRTiePFC.js → addon-webgl-DitJj-N0.js} +1 -1
  126. package/dist/client/assets/{agent-autocomplete-DXUBnlkN.js → agent-autocomplete-BlK8wY06.js} +1 -1
  127. package/dist/client/assets/{agent-essentials-vytdybaX.js → agent-essentials-K9B6kbTS.js} +1 -1
  128. package/dist/client/assets/{agent-lane-card-model-CNZMPkhc.js → agent-lane-card-model-CY3OE1Xu.js} +1 -1
  129. package/dist/client/assets/{agent-lanes-model-DXqjs0OK.js → agent-lanes-model-tc-1hE6q.js} +1 -1
  130. package/dist/client/assets/{agent-master-model-DAZL92oe.js → agent-master-model-DMcHeNq3.js} +1 -1
  131. package/dist/client/assets/agent-specialization-CtF_jI34.js +1 -0
  132. package/dist/client/assets/{arc.es-Bh84oHJ7.js → arc.es-BNXJqSw7.js} +1 -1
  133. package/dist/client/assets/{arrow-down-DvTsLokL.js → arrow-down-BAGkhHA6.js} +1 -1
  134. package/dist/client/assets/{arrow-left-DHfdXJVZ.js → arrow-left-eToA6GxC.js} +1 -1
  135. package/dist/client/assets/{arrow-right-BBsrogWf.js → arrow-right-DTX42clh.js} +1 -1
  136. package/dist/client/assets/{arrow-up-right-CY0Vw_67.js → arrow-up-right-B09GPwFl.js} +1 -1
  137. package/dist/client/assets/{bot-DzkOUFBb.js → bot-WxKXYtEX.js} +1 -1
  138. package/dist/client/assets/{check-DbIkldnK.js → check-Dz2SRHft.js} +1 -1
  139. package/dist/client/assets/{chevron-down-C475vltS.js → chevron-down-D120PY4g.js} +1 -1
  140. package/dist/client/assets/{chevron-right-CnZRSd-V.js → chevron-right-CowuvuE6.js} +1 -1
  141. package/dist/client/assets/{chunk-HRAB3GC3-DLNT8aOo.js → chunk-HRAB3GC3-KjjrTLCU.js} +1 -1
  142. package/dist/client/assets/{chunk-JTPDIGGW-Ci5j4vzV.js → chunk-JTPDIGGW-COJ00z94.js} +3 -3
  143. package/dist/client/assets/{chunk-T65CQEWV-BtNvicWs.js → chunk-T65CQEWV-H2QEKfr1.js} +1 -1
  144. package/dist/client/assets/{chunk-YOZR3KYS-DN5EJulq.js → chunk-YOZR3KYS-CrCgXw9l.js} +1 -1
  145. package/dist/client/assets/{clock-DVvENUU5.js → clock-_9FDplIT.js} +1 -1
  146. package/dist/client/assets/{code-xml-CvKBY3KA.js → code-xml-CkkNdRmu.js} +1 -1
  147. package/dist/client/assets/{compass-BcRI_YXo.js → compass-BdpImt_W.js} +1 -1
  148. package/dist/client/assets/content-0RBfbCIJ.js +1 -0
  149. package/dist/client/assets/content-BTmnk2bl.js +1 -0
  150. package/dist/client/assets/content-Bk5DKhyP.js +1 -0
  151. package/dist/client/assets/{content-BNyAjpUl.js → content-Bw_8GE_S.js} +1 -1
  152. package/dist/client/assets/content-CI4gLEWi.js +1 -0
  153. package/dist/client/assets/content-CLCtp9Rb.js +1 -0
  154. package/dist/client/assets/content-C_FAGTNk.js +1 -0
  155. package/dist/client/assets/content-CnnzWOE3.js +1 -0
  156. package/dist/client/assets/content-DKlY98pO.js +1 -0
  157. package/dist/client/assets/content-Df7ndXTG.js +1 -0
  158. package/dist/client/assets/content-DkZDzzx3.js +1 -0
  159. package/dist/client/assets/content-DnGmb2L0.js +1 -0
  160. package/dist/client/assets/content-Ds-zs-Ss.js +1 -0
  161. package/dist/client/assets/content-JIWSyC0f.js +1 -0
  162. package/dist/client/assets/content-Q3TIYC8q.js +1 -0
  163. package/dist/client/assets/content-evaBfvxD.js +1 -0
  164. package/dist/client/assets/{context-budget-DX_fwUs3.js → context-budget-DqxWzalx.js} +1 -1
  165. package/dist/client/assets/{conversation-icons-CBMKBGHd.js → conversation-icons-DHGc9wbT.js} +1 -1
  166. package/dist/client/assets/conversation-model-C2KuZUXc.js +1 -0
  167. package/dist/client/assets/conversation-motion-features-BJnHs3Ul.js +1 -0
  168. package/dist/client/assets/{copy-Cj-owMb-.js → copy-BzdzWsQd.js} +1 -1
  169. package/dist/client/assets/{cpu-DuD3RFX5.js → cpu-CHFIGw87.js} +1 -1
  170. package/dist/client/assets/{createLucideIcon-DthwWQIg.js → createLucideIcon-Dv8H8m7J.js} +1 -1
  171. package/dist/client/assets/discover-DutlV0ZU.js +2 -0
  172. package/dist/client/assets/embed-entry-CJG7WEVw.js +2 -0
  173. package/dist/client/assets/{external-link-C_nxk0MJ.js → external-link-BvX5PfLh.js} +1 -1
  174. package/dist/client/assets/{eye-FnaaPfja.js → eye-C9cGk5z6.js} +1 -1
  175. package/dist/client/assets/{file-code-corner-DDPq4Cur.js → file-code-corner-jlGFdr8d.js} +1 -1
  176. package/dist/client/assets/{file-text--hfhwZH1.js → file-text-BHro8MkG.js} +1 -1
  177. package/dist/client/assets/{gauge-BVEknshP.js → gauge-DSflSery.js} +1 -1
  178. package/dist/client/assets/{gestures-3gw5VgUS.js → gestures-YA5IIwp-.js} +1 -1
  179. package/dist/client/assets/{git-branch-DJyvr0k-.js → git-branch-Bc_eDIpG.js} +1 -1
  180. package/dist/client/assets/{home-moving-signal-BPqBoNSm.js → home-moving-signal-PHSqSBu_.js} +1 -1
  181. package/dist/client/assets/home-now-card-C_qsI6C6.js +1 -0
  182. package/dist/client/assets/{home-now-card-nano-G8kMB32m.js → home-now-card-nano-Jmy7eJ6H.js} +1 -1
  183. package/dist/client/assets/{hooks-BMsQzo9j.js → hooks-ME7rmhpE.js} +1 -1
  184. package/dist/client/assets/{index-BI9AljSD.js → index-C1VaWNuD.js} +2 -2
  185. package/dist/client/assets/index-C8UCRm2W.js +1 -0
  186. package/dist/client/assets/index-Cn0I2Hgi.js +1 -0
  187. package/dist/client/assets/index-Cx6Gbr6n.js +1 -0
  188. package/dist/client/assets/{inspector-panel-CFSArQ8Y.js → inspector-panel-CwrHjRaQ.js} +2 -2
  189. package/dist/client/assets/{keyboard-nav-e6yGeorb.js → keyboard-nav-B8sQ_8IF.js} +1 -1
  190. package/dist/client/assets/{lane-roster-store-Q7pcblY5.js → lane-roster-store-DN2jxXF-.js} +1 -1
  191. package/dist/client/assets/{layers-Dz2dKOnU.js → layers-CW2-qHsG.js} +1 -1
  192. package/dist/client/assets/{layout-grid-Bvs5fdB4.js → layout-grid-BoVnPOk-.js} +1 -1
  193. package/dist/client/assets/left-BRu9pnqx.js +2 -0
  194. package/dist/client/assets/left-BjS1dKNV.js +2 -0
  195. package/dist/client/assets/left-CL-TVLJ7.js +1 -0
  196. package/dist/client/assets/left-DLpsDi55.js +1 -0
  197. package/dist/client/assets/left-DPcM9o8Y.js +1 -0
  198. package/dist/client/assets/left-MmTJf1tK.js +1 -0
  199. package/dist/client/assets/left-P80i5V8L.js +1 -0
  200. package/dist/client/assets/left-advisor-CbXVzAqS.js +1 -0
  201. package/dist/client/assets/left-agents-7mJsiNyr.js +1 -0
  202. package/dist/client/assets/left-default-COK26l3H.js +1 -0
  203. package/dist/client/assets/left-lanes-Dbdm9Veu.js +1 -0
  204. package/dist/client/assets/left-mission-DqGR5jby.js +1 -0
  205. package/dist/client/assets/library-COnWzUWv.js +1 -0
  206. package/dist/client/assets/{loader-circle-B2W9DPG5.js → loader-circle-DmUG_YC7.js} +1 -1
  207. package/dist/client/assets/{local-agents-DKr-gIDC.js → local-agents-VP1-ZlPw.js} +1 -1
  208. package/dist/client/assets/{mentions-DuLQnEcn.js → mentions-BZ5SBMtc.js} +1 -1
  209. package/dist/client/assets/mesh-buckets-CLYS8Jx8.js +1 -0
  210. package/dist/client/assets/{mesh-ops-CRR-KnCG.js → mesh-ops-CKSWgax2.js} +1 -1
  211. package/dist/client/assets/{mesh-view-store-CiET-yN8.js → mesh-view-store-CBM1za_N.js} +1 -1
  212. package/dist/client/assets/{message-circle-B2DoYKDO.js → message-circle-joGFxfj1.js} +1 -1
  213. package/dist/client/assets/{message-markup-Cc_O-WdA.js → message-markup-DC0QFEZn.js} +1 -1
  214. package/dist/client/assets/{message-square-O-Hu9Mk2.js → message-square-BLiFqpe_.js} +1 -1
  215. package/dist/client/assets/{mission-control-store-DDAgWKUl.js → mission-control-store-CM8mQGg8.js} +1 -1
  216. package/dist/client/assets/model-CBkMvT1w.js +1 -0
  217. package/dist/client/assets/{observe-Da2mRAsc.js → observe-BLmy4quB.js} +1 -1
  218. package/dist/client/assets/{page-status-Crtgjbq3.js → page-status-BE0-J1xY.js} +1 -1
  219. package/dist/client/assets/{paperclip-BudMKSyr.js → paperclip-Br7wUDFl.js} +1 -1
  220. package/dist/client/assets/{persistent-state-xJz-qAFc.js → persistent-state-BubPQ7tT.js} +1 -1
  221. package/dist/client/assets/{plus-BJ1If8vj.js → plus-BWKhylds.js} +1 -1
  222. package/dist/client/assets/profile-BCvk8jOQ.js +1 -0
  223. package/dist/client/assets/projects-inbox-BIW7nv-H.css +1 -0
  224. package/dist/client/assets/projects-inbox-DFbgVlXL.js +1 -0
  225. package/dist/client/assets/{proxy-1BABCaDb.js → proxy-DVDRhSRR.js} +1 -1
  226. package/dist/client/assets/{radio-B5OpHrrK.js → radio-CxIXS1nU.js} +1 -1
  227. package/dist/client/assets/{refresh-cw-DmNAhaH0.js → refresh-cw-Bkh7Cvnd.js} +1 -1
  228. package/dist/client/assets/resolve-panes-DhD5qmQO.js +1 -0
  229. package/dist/client/assets/resolve-sidebar-context-GqhZNRPY.js +1 -0
  230. package/dist/client/assets/right-B_08ilv6.js +1 -0
  231. package/dist/client/assets/right-Brm67HOL.js +1 -0
  232. package/dist/client/assets/right-BveAPKBW.js +1 -0
  233. package/dist/client/assets/right-CpTB_-Ya.js +1 -0
  234. package/dist/client/assets/right-CqC4Qdot.js +1 -0
  235. package/dist/client/assets/right-D91j9d5Y.js +1 -0
  236. package/dist/client/assets/{right-D8id_DWQ.js → right-DVUq5374.js} +1 -1
  237. package/dist/client/assets/right-DaLRhYl3.js +1 -0
  238. package/dist/client/assets/right-Dt1wOwA5.js +1 -0
  239. package/dist/client/assets/right-DtzqIZQF.js +1 -0
  240. package/dist/client/assets/{rocket-D3-TUJ2m.js → rocket-CnxqjX_K.js} +1 -1
  241. package/dist/client/assets/{router-DTtux5sP.js → router-kfcaYqZr.js} +1 -1
  242. package/dist/client/assets/runtime-picker-C20lTGhV.js +1 -0
  243. package/dist/client/assets/{scope-views-CPM0sBw_.js → scope-views-KPY85UUx.js} +1 -1
  244. package/dist/client/assets/{scout-voice-BZKsdquE.js → scout-voice-Cg1qfepC.js} +1 -1
  245. package/dist/client/assets/scoutbot-D7kGGyK_.js +3 -0
  246. package/dist/client/assets/{scoutbot-markdown-CQ7Y1McC.js → scoutbot-markdown-yb87JlSE.js} +1 -1
  247. package/dist/client/assets/{scroll-text-kPhYbh-M.js → scroll-text-DFcBYy5J.js} +1 -1
  248. package/dist/client/assets/{search-DmFM_9jm.js → search-FB2vVxCp.js} +1 -1
  249. package/dist/client/assets/{secondaryNavConfig-C9bQ9_IA.js → secondaryNavConfig-C0Srrmy8.js} +1 -1
  250. package/dist/client/assets/{selection-bridge-Dy2mtMyi.js → selection-bridge-qBGFCJv8.js} +1 -1
  251. package/dist/client/assets/{send-horizontal-qyjNgEaV.js → send-horizontal-CS7mxVhX.js} +1 -1
  252. package/dist/client/assets/{server-nWqndnxu.js → server-WY6gsbZz.js} +1 -1
  253. package/dist/client/assets/{session-catalog-BkmktBHI.js → session-catalog-CG4oL_yN.js} +1 -1
  254. package/dist/client/assets/{session-table-DKSF0mrS.js → session-table-uJh3v-ly.js} +1 -1
  255. package/dist/client/assets/{settings-C6h9y5XX.js → settings-DQEtqkM9.js} +1 -1
  256. package/dist/client/assets/{sliders-horizontal-BhHKxsCO.js → sliders-horizontal-57e99_qO.js} +1 -1
  257. package/dist/client/assets/{sparkles-Cf8gin88.js → sparkles-D0vWLTyC.js} +1 -1
  258. package/dist/client/assets/{sse-DDHEHUgz.js → sse-B29iGBnw.js} +1 -1
  259. package/dist/client/assets/{system-surfaces-redesign-QVXNeGYw.css → system-surfaces-redesign-kuf3wuE_.css} +1 -1
  260. package/dist/client/assets/{tail-events-BdUrO0kb.js → tail-events-LK29oCKm.js} +1 -1
  261. package/dist/client/assets/{terminal-C3YRPfyz.js → terminal-UDy4lzV1.js} +1 -1
  262. package/dist/client/assets/{terminal-relay-BFhdIstF.js → terminal-relay-CXHMdain.js} +1 -1
  263. package/dist/client/assets/{terminal-screen-BLk4PAYt.css → terminal-screen-vMICbBJh.css} +1 -1
  264. package/dist/client/assets/{terminal-sessions-BQ6t92tJ.js → terminal-sessions-Bdt2W3Y4.js} +1 -1
  265. package/dist/client/assets/{terminal-takeover-B6H4llRR.js → terminal-takeover-BMeBjBB2.js} +1 -1
  266. package/dist/client/assets/{use-conversation-list-DO5J8T1H.js → use-conversation-list-UG-tMN67.js} +1 -1
  267. package/dist/client/assets/{use-fleet-active-asks-BtgNnRgK.js → use-fleet-active-asks-CCGrll5q.js} +1 -1
  268. package/dist/client/assets/{use-mesh-ops-items-N1HHhChY.js → use-mesh-ops-items-BjyeFJTz.js} +1 -1
  269. package/dist/client/assets/{use-reduced-motion-8WuxLa5l.js → use-reduced-motion-CPoX8iV2.js} +1 -1
  270. package/dist/client/assets/{use-scout-dev-flags-B31qTy6m.js → use-scout-dev-flags-DTseRrFi.js} +1 -1
  271. package/dist/client/assets/{useAgentHoverCard-Bkv-Uz_V.js → useAgentHoverCard-BgTLNcF-.js} +1 -1
  272. package/dist/client/assets/useContentSecondaryNav-CoIoz7JU.js +1 -0
  273. package/dist/client/assets/useEmbedHeadline-DuUnwTB7.js +1 -0
  274. package/dist/client/assets/{usePierreRuntime-BfZHKAkI.js → usePierreRuntime-35AHf9RQ.js} +1 -1
  275. package/dist/client/assets/{wrench-DkxnZRlR.js → wrench-BfVeded5.js} +1 -1
  276. package/dist/client/assets/{x-DfRJbqrh.js → x-DgmmnPKt.js} +1 -1
  277. package/dist/client/assets/{xterm-CJw8Epxv.js → xterm-DnJJmrCA.js} +1 -1
  278. package/dist/client/assets/{zap-CIo8msJB.js → zap-Bcja1lHG.js} +1 -1
  279. package/dist/client/index.html +1 -1
  280. package/dist/main.mjs +5116 -9854
  281. package/dist/node/main.mjs +18 -2
  282. package/dist/pairing-runtime-controller.mjs +23 -2
  283. package/dist/runtime/broker-daemon.mjs +29 -3
  284. package/dist/scout-control-plane-web.mjs +27 -3
  285. package/package.json +2 -5
  286. package/dist/client/assets/ActivityScreen-y-5DLleY.js +0 -1
  287. package/dist/client/assets/AgentConfigurationScreen-BD7Unt2P.js +0 -1
  288. package/dist/client/assets/AgentDefinitionsWorkspace-BbcZc9Xk.js +0 -1
  289. package/dist/client/assets/AgentFloorView-DMFiHs21.js +0 -1
  290. package/dist/client/assets/AgentInfoScreen-DHGLRddI.js +0 -1
  291. package/dist/client/assets/AgentLanesEmbedScreen-C5k_dDS8.js +0 -1
  292. package/dist/client/assets/AgentLanesView-u5vpLwQf.js +0 -2
  293. package/dist/client/assets/AgentMasterScreen-C5WlWNmk.js +0 -1
  294. package/dist/client/assets/AgentsConsole-BuiZ_bDo.js +0 -1
  295. package/dist/client/assets/AgentsScreen-CRi-hG2k.js +0 -1
  296. package/dist/client/assets/AgentsSubnav-DUsya4WK.js +0 -1
  297. package/dist/client/assets/BriefingDetailScreen-C29smC5d.js +0 -1
  298. package/dist/client/assets/BrokerScreen-CS0s4Gm4.js +0 -5
  299. package/dist/client/assets/CodeScreen-CrR2JaVj.js +0 -1
  300. package/dist/client/assets/ConversationComposer-H8_hsYSc.js +0 -1
  301. package/dist/client/assets/ConversationFeedRows-hlEFlURs.js +0 -1
  302. package/dist/client/assets/ConversationHeader-B0ZBhE_E.js +0 -1
  303. package/dist/client/assets/ConversationScreen-CXAHQwQ3.js +0 -2
  304. package/dist/client/assets/CrewWorkspaces-Bz2Dcnt4.js +0 -1
  305. package/dist/client/assets/FlightObserveScreen-qyzHzxLa.js +0 -1
  306. package/dist/client/assets/HarnessesScreen-DbKkQM4o.js +0 -1
  307. package/dist/client/assets/KnowledgeSearchScreen-DvbRRPQB.js +0 -1
  308. package/dist/client/assets/LaneTraceDetailSheet-C3C8UjXv.js +0 -1
  309. package/dist/client/assets/MeshScreen-BJ-j9YXv.js +0 -1
  310. package/dist/client/assets/MessagesScreen-CyNIZ3-X.js +0 -1
  311. package/dist/client/assets/MissionControlView-Bj7cAbZd.js +0 -1
  312. package/dist/client/assets/MissionFocusOverlay-DvTw6ts5.js +0 -1
  313. package/dist/client/assets/MissionLeftAgentRow-B0QG7Gys.js +0 -1
  314. package/dist/client/assets/NewChatComposer-C_1op4dH.js +0 -19
  315. package/dist/client/assets/OpsAgentsView-DBYtmLnh.js +0 -1
  316. package/dist/client/assets/OpsScreen-CuYVgkC_.js +0 -1
  317. package/dist/client/assets/OpsSubnav-BEU4kKXm.js +0 -1
  318. package/dist/client/assets/ProjectAgentProfile-BhXAZEkW.js +0 -1
  319. package/dist/client/assets/ProjectAgentProfileBar-uJw9Wdfk.js +0 -1
  320. package/dist/client/assets/ProjectAgentProfileHero-CIMS4Dy_.js +0 -1
  321. package/dist/client/assets/ProjectsInbox-JgU0lrY8.js +0 -2
  322. package/dist/client/assets/ProjectsRail-p99BRBOa.js +0 -1
  323. package/dist/client/assets/ProjectsScreen-BB45DU53.js +0 -1
  324. package/dist/client/assets/ProjectsThreadAside-BHDTJWOz.js +0 -1
  325. package/dist/client/assets/Provider-Bu-C8Hxc.js +0 -1
  326. package/dist/client/assets/RawSessionsTable-BtKdQPiv.js +0 -1
  327. package/dist/client/assets/RealtimeVoiceScreen-KPHJgO1l.js +0 -1
  328. package/dist/client/assets/SessionRefScreen-C8BiRVPx.js +0 -1
  329. package/dist/client/assets/SessionsScreen-BNvjUflN.js +0 -1
  330. package/dist/client/assets/SettingsScreen-3JvX1WFL.js +0 -1
  331. package/dist/client/assets/Terminal-BlUQY9_Z.js +0 -1
  332. package/dist/client/assets/TerminalEmbedScreen-DTjxktyr.js +0 -1
  333. package/dist/client/assets/agent-specialization-BtxLN4UR.js +0 -1
  334. package/dist/client/assets/agents-project-model-UYiamtrU.js +0 -1
  335. package/dist/client/assets/content--T3p6akp.js +0 -1
  336. package/dist/client/assets/content-4nFMLuzF.js +0 -1
  337. package/dist/client/assets/content-BJ4nHvcu.js +0 -1
  338. package/dist/client/assets/content-BmGp9wNl.js +0 -1
  339. package/dist/client/assets/content-CBWhwaRo.js +0 -1
  340. package/dist/client/assets/content-CQlykFbe.js +0 -1
  341. package/dist/client/assets/content-CevL0DgF.js +0 -1
  342. package/dist/client/assets/content-Ch8pf2bj.js +0 -1
  343. package/dist/client/assets/content-Cpvdcm_l.js +0 -1
  344. package/dist/client/assets/content-DfS3vgAu.js +0 -1
  345. package/dist/client/assets/content-DpQdNePJ.js +0 -1
  346. package/dist/client/assets/content-Dqpibejl.js +0 -1
  347. package/dist/client/assets/content-TV0nd6-r.js +0 -1
  348. package/dist/client/assets/content-odbb5H4U.js +0 -1
  349. package/dist/client/assets/content-uXHLPHe0.js +0 -1
  350. package/dist/client/assets/conversation-model-QsJVfSeG.js +0 -1
  351. package/dist/client/assets/conversation-motion-features-BFLHX2eg.js +0 -1
  352. package/dist/client/assets/discover-B3uQlh5L.js +0 -2
  353. package/dist/client/assets/embed-entry-DkRcHKTh.js +0 -2
  354. package/dist/client/assets/home-now-card-UspVW2-2.js +0 -1
  355. package/dist/client/assets/index-C-v0Z6ZS.js +0 -1
  356. package/dist/client/assets/index-D9DzUORB.js +0 -1
  357. package/dist/client/assets/index-DfsTyYDx.js +0 -1
  358. package/dist/client/assets/left-B4Ak-Ibt.js +0 -2
  359. package/dist/client/assets/left-BMb493FZ.js +0 -1
  360. package/dist/client/assets/left-BjFLvVOC.js +0 -1
  361. package/dist/client/assets/left-CsXQ8Q3G.js +0 -1
  362. package/dist/client/assets/left-FNH7faCI.js +0 -1
  363. package/dist/client/assets/left-POkqE8gI.js +0 -2
  364. package/dist/client/assets/left-UulOTcWh.js +0 -1
  365. package/dist/client/assets/left-advisor-CJkQS2d6.js +0 -1
  366. package/dist/client/assets/left-agents-CFMxyEjT.js +0 -1
  367. package/dist/client/assets/left-default-rnX5HANc.js +0 -1
  368. package/dist/client/assets/left-lanes-BpLXT_qH.js +0 -1
  369. package/dist/client/assets/left-mission-B0bhseWw.js +0 -1
  370. package/dist/client/assets/library-D1iXfda2.js +0 -1
  371. package/dist/client/assets/mesh-buckets-6y3ZIibI.js +0 -1
  372. package/dist/client/assets/mesh-roster-Bc7T4b7z.js +0 -1
  373. package/dist/client/assets/model-IGCUEsMy.js +0 -1
  374. package/dist/client/assets/profile-B3qDSbrH.js +0 -1
  375. package/dist/client/assets/projects-inbox-CLek3QaG.js +0 -1
  376. package/dist/client/assets/projects-inbox-DRBl2N85.css +0 -1
  377. package/dist/client/assets/resolve-panes-DXw-cHaj.js +0 -1
  378. package/dist/client/assets/resolve-sidebar-context-CDdbRDEa.js +0 -1
  379. package/dist/client/assets/right-BgJ4mQLf.js +0 -1
  380. package/dist/client/assets/right-Bk6h7o-Z.js +0 -1
  381. package/dist/client/assets/right-BrICCmEt.js +0 -1
  382. package/dist/client/assets/right-C1QIbqFZ.js +0 -1
  383. package/dist/client/assets/right-CfliKiHY.js +0 -1
  384. package/dist/client/assets/right-CtOLXB9s.js +0 -1
  385. package/dist/client/assets/right-DJ34yMAi.js +0 -1
  386. package/dist/client/assets/right-DiFmtw6d.js +0 -1
  387. package/dist/client/assets/right-Lx79pxpG.js +0 -1
  388. package/dist/client/assets/scoutbot-BJIamJOH.js +0 -3
  389. package/dist/client/assets/text-Faa3ZStB.js +0 -1
  390. package/dist/client/assets/useContentSecondaryNav-Bpkc8ayb.js +0 -1
  391. /package/dist/client/assets/{text-BYAFNLNq.css → runtime-picker-BYAFNLNq.css} +0 -0
@@ -1 +1 @@
1
- import{r as x,j as s}from"./index-BI9AljSD.js";import{c as v,C as y,o as w}from"./conversation-model-QsJVfSeG.js";import{C as b}from"./check-DbIkldnK.js";import{S as C}from"./sparkles-Cf8gin88.js";import{X as k}from"./x-DfRJbqrh.js";import{c as E}from"./createLucideIcon-DthwWQIg.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";const L=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],S=E("shield-alert",L);function z(e){const a=e.split(/\r?\n/).map(t=>t.trim()).find(Boolean)??"",r=110;return a.length>r?`${a.slice(0,r-1).trimEnd()}…`:a}function W({pinnedAsk:e,onAnswer:a,onApprove:r,onReject:t,onSteer:i,enableKeyboard:o=!0}){const l=e.summary?.trim()||null,d=z(e.task),p=l&&l!==e.task.trim()?l:d,N=p!==d&&d.length>0,c=/\b(?:approve|approval|permission|allow|proceed|confirm|gate)\b/i.test(p),f=c?"Approval Gate":p.includes("?")?"Question":e.statusLabel,g=e.agentName??v(e.agentId)??e.agentId,m=x.useCallback(()=>{r?r():a()},[r,a]),u=x.useCallback(()=>{i?i():a()},[i,a]);return x.useEffect(()=>{if(!o)return;const j=n=>{const h=document.activeElement;h instanceof HTMLInputElement||h instanceof HTMLTextAreaElement||h instanceof HTMLElement&&h.isContentEditable||n.metaKey||n.ctrlKey||n.altKey||(n.key==="y"||n.key==="Y"?(n.preventDefault(),m()):n.key==="s"||n.key==="S"?(n.preventDefault(),u()):(n.key==="n"||n.key==="N")&&t&&(n.preventDefault(),t()))};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[o,m,u,t]),s.jsxs("div",{className:`s-thread-pinned-ask surface-card ${c?"s-thread-pinned-ask--approval":"s-thread-pinned-ask--question"}`,role:"alert","aria-live":"assertive",children:[s.jsxs("div",{className:"s-thread-pinned-ask-header",children:[s.jsx("div",{className:"s-thread-pinned-ask-beacon","aria-hidden":"true",children:s.jsx("span",{className:"dot dot--sm dot--warning dot--pulse dot--glow"})}),s.jsxs("div",{className:"s-thread-pinned-ask-kicker",children:[s.jsx("span",{className:"label-sm s-thread-pinned-ask-eyebrow",children:"Operator Attention Required"}),s.jsx("span",{className:"chip chip--sm chip--mono chip--warning",children:f})]}),s.jsxs("div",{className:"s-thread-pinned-ask-routing",children:[s.jsxs("span",{className:"s-thread-pinned-ask-agent-name chip chip--sm chip--mono chip--neutral",children:["@",g]}),s.jsx("span",{className:"s-thread-pinned-ask-routing-arrow","aria-hidden":"true",children:"→"}),s.jsx("span",{className:"chip chip--sm chip--mono chip--working",children:"You"})]})]}),s.jsxs("div",{className:"s-thread-pinned-ask-body",children:[s.jsx("p",{className:"s-thread-pinned-ask-text",children:p}),N&&s.jsxs("p",{className:"s-thread-pinned-ask-context text-muted",children:["Re: ",d]})]}),s.jsxs("div",{className:"s-thread-pinned-ask-actions",children:[s.jsxs("button",{type:"button",className:"btn btn--primary s-thread-pinned-ask-btn",onClick:m,title:c?"Approve this gate [Y]":"Answer this question [Y]",children:[s.jsx("kbd",{className:"s-kbd",children:"[Y]"}),c?s.jsx(b,{size:13,strokeWidth:2.2}):s.jsx(y,{size:13}),s.jsx("span",{children:c?"Approve":"Answer"})]}),s.jsxs("button",{type:"button",className:"btn btn--accent s-thread-pinned-ask-btn",onClick:u,title:"Provide guidance or steer [S]",children:[s.jsx("kbd",{className:"s-kbd",children:"[S]"}),s.jsx(C,{size:13,strokeWidth:1.9}),s.jsx("span",{children:"Steer"})]}),t&&s.jsxs("button",{type:"button",className:"btn btn--danger s-thread-pinned-ask-btn",onClick:t,title:"Reject or decline [N]",children:[s.jsx("kbd",{className:"s-kbd",children:"[N]"}),s.jsx(k,{size:13,strokeWidth:2.2}),s.jsx("span",{children:"Reject"})]})]}),s.jsx("div",{className:"s-thread-pinned-ask-strip","aria-hidden":"true"})]})}function q({title:e,description:a,diff:r,command:t,risk:i="medium",onApprove:o,onReject:l,onSteer:d}){return s.jsxs("div",{className:"s-thread-approval-gate surface-card",role:"alert",children:[s.jsxs("div",{className:"s-thread-approval-gate-head",children:[s.jsxs("div",{className:"s-thread-approval-gate-title-wrap",children:[s.jsx(S,{size:16,className:"text-amber","aria-hidden":"true"}),s.jsx("span",{className:"label-sm text-amber",children:"Execution Approval Gate"}),i&&s.jsxs("span",{className:`chip chip--sm chip--mono ${i==="high"?"chip--danger":i==="medium"?"chip--warning":"chip--info"}`,children:[i.toUpperCase()," RISK"]})]}),s.jsx("h3",{className:"s-thread-approval-gate-title",children:e}),a&&s.jsx("p",{className:"s-thread-approval-gate-desc",children:a})]}),t&&s.jsxs("div",{className:"s-thread-approval-gate-command surface-card surface-card--inset",children:[s.jsx("span",{className:"label-xs text-muted",children:"Command"}),s.jsx("code",{className:"s-thread-approval-gate-code",children:t})]}),r&&s.jsxs("div",{className:"s-thread-approval-gate-diff surface-card surface-card--inset",children:[s.jsx("span",{className:"label-xs text-muted",children:"Diff Preview"}),s.jsx("pre",{className:"s-thread-approval-gate-diff-pre",children:s.jsx("code",{children:r})})]}),s.jsxs("div",{className:"s-thread-approval-gate-actions",children:[s.jsxs("button",{type:"button",className:"btn btn--primary",onClick:o,children:[s.jsx("kbd",{className:"s-kbd",children:"[Y]"}),s.jsx(b,{size:13}),s.jsx("span",{children:"Approve Action"})]}),s.jsxs("button",{type:"button",className:"btn btn--danger",onClick:l,children:[s.jsx("kbd",{className:"s-kbd",children:"[N]"}),s.jsx(k,{size:13}),s.jsx("span",{children:"Reject"})]}),d&&s.jsxs("button",{type:"button",className:"btn btn--ghost",onClick:d,children:[s.jsx("kbd",{className:"s-kbd",children:"[S]"}),s.jsx("span",{children:"Steer…"})]})]})]})}function G({presence:e,agent:a}){if(!e.showStrip)return null;const r=e.tone==="working",t=e.tone==="pending";return s.jsxs("div",{className:`s-thread-status s-thread-status--${e.tone}`,"aria-live":"polite",children:[s.jsx("span",{className:"s-thread-status-dot-wrap","aria-hidden":"true",children:s.jsx("span",{className:`dot dot--sm ${r?"dot--working dot--pulse dot--glow":t?"dot--warning dot--pulse dot--glow":"dot--neutral"}`,style:{color:w(e,a?.state??null)}})}),s.jsxs("div",{className:"s-thread-status-copy",children:[s.jsx("span",{className:"s-thread-status-label label-xs",children:e.label}),s.jsx("span",{className:"s-thread-status-detail",children:e.detail})]})]})}export{q as ApprovalGateCard,G as ConversationStatusStrip,W as PinnedAskCard};
1
+ import{r as x,j as s}from"./index-C1VaWNuD.js";import{c as v,C as y,o as w}from"./conversation-model-C2KuZUXc.js";import{C as b}from"./check-Dz2SRHft.js";import{S as C}from"./sparkles-D0vWLTyC.js";import{X as k}from"./x-DgmmnPKt.js";import{c as E}from"./createLucideIcon-Dv8H8m7J.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";const L=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],S=E("shield-alert",L);function z(e){const a=e.split(/\r?\n/).map(t=>t.trim()).find(Boolean)??"",r=110;return a.length>r?`${a.slice(0,r-1).trimEnd()}…`:a}function W({pinnedAsk:e,onAnswer:a,onApprove:r,onReject:t,onSteer:i,enableKeyboard:o=!0}){const l=e.summary?.trim()||null,d=z(e.task),p=l&&l!==e.task.trim()?l:d,N=p!==d&&d.length>0,c=/\b(?:approve|approval|permission|allow|proceed|confirm|gate)\b/i.test(p),f=c?"Approval Gate":p.includes("?")?"Question":e.statusLabel,g=e.agentName??v(e.agentId)??e.agentId,m=x.useCallback(()=>{r?r():a()},[r,a]),u=x.useCallback(()=>{i?i():a()},[i,a]);return x.useEffect(()=>{if(!o)return;const j=n=>{const h=document.activeElement;h instanceof HTMLInputElement||h instanceof HTMLTextAreaElement||h instanceof HTMLElement&&h.isContentEditable||n.metaKey||n.ctrlKey||n.altKey||(n.key==="y"||n.key==="Y"?(n.preventDefault(),m()):n.key==="s"||n.key==="S"?(n.preventDefault(),u()):(n.key==="n"||n.key==="N")&&t&&(n.preventDefault(),t()))};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[o,m,u,t]),s.jsxs("div",{className:`s-thread-pinned-ask surface-card ${c?"s-thread-pinned-ask--approval":"s-thread-pinned-ask--question"}`,role:"alert","aria-live":"assertive",children:[s.jsxs("div",{className:"s-thread-pinned-ask-header",children:[s.jsx("div",{className:"s-thread-pinned-ask-beacon","aria-hidden":"true",children:s.jsx("span",{className:"dot dot--sm dot--warning dot--pulse dot--glow"})}),s.jsxs("div",{className:"s-thread-pinned-ask-kicker",children:[s.jsx("span",{className:"label-sm s-thread-pinned-ask-eyebrow",children:"Operator Attention Required"}),s.jsx("span",{className:"chip chip--sm chip--mono chip--warning",children:f})]}),s.jsxs("div",{className:"s-thread-pinned-ask-routing",children:[s.jsxs("span",{className:"s-thread-pinned-ask-agent-name chip chip--sm chip--mono chip--neutral",children:["@",g]}),s.jsx("span",{className:"s-thread-pinned-ask-routing-arrow","aria-hidden":"true",children:"→"}),s.jsx("span",{className:"chip chip--sm chip--mono chip--working",children:"You"})]})]}),s.jsxs("div",{className:"s-thread-pinned-ask-body",children:[s.jsx("p",{className:"s-thread-pinned-ask-text",children:p}),N&&s.jsxs("p",{className:"s-thread-pinned-ask-context text-muted",children:["Re: ",d]})]}),s.jsxs("div",{className:"s-thread-pinned-ask-actions",children:[s.jsxs("button",{type:"button",className:"btn btn--primary s-thread-pinned-ask-btn",onClick:m,title:c?"Approve this gate [Y]":"Answer this question [Y]",children:[s.jsx("kbd",{className:"s-kbd",children:"[Y]"}),c?s.jsx(b,{size:13,strokeWidth:2.2}):s.jsx(y,{size:13}),s.jsx("span",{children:c?"Approve":"Answer"})]}),s.jsxs("button",{type:"button",className:"btn btn--accent s-thread-pinned-ask-btn",onClick:u,title:"Provide guidance or steer [S]",children:[s.jsx("kbd",{className:"s-kbd",children:"[S]"}),s.jsx(C,{size:13,strokeWidth:1.9}),s.jsx("span",{children:"Steer"})]}),t&&s.jsxs("button",{type:"button",className:"btn btn--danger s-thread-pinned-ask-btn",onClick:t,title:"Reject or decline [N]",children:[s.jsx("kbd",{className:"s-kbd",children:"[N]"}),s.jsx(k,{size:13,strokeWidth:2.2}),s.jsx("span",{children:"Reject"})]})]}),s.jsx("div",{className:"s-thread-pinned-ask-strip","aria-hidden":"true"})]})}function q({title:e,description:a,diff:r,command:t,risk:i="medium",onApprove:o,onReject:l,onSteer:d}){return s.jsxs("div",{className:"s-thread-approval-gate surface-card",role:"alert",children:[s.jsxs("div",{className:"s-thread-approval-gate-head",children:[s.jsxs("div",{className:"s-thread-approval-gate-title-wrap",children:[s.jsx(S,{size:16,className:"text-amber","aria-hidden":"true"}),s.jsx("span",{className:"label-sm text-amber",children:"Execution Approval Gate"}),i&&s.jsxs("span",{className:`chip chip--sm chip--mono ${i==="high"?"chip--danger":i==="medium"?"chip--warning":"chip--info"}`,children:[i.toUpperCase()," RISK"]})]}),s.jsx("h3",{className:"s-thread-approval-gate-title",children:e}),a&&s.jsx("p",{className:"s-thread-approval-gate-desc",children:a})]}),t&&s.jsxs("div",{className:"s-thread-approval-gate-command surface-card surface-card--inset",children:[s.jsx("span",{className:"label-xs text-muted",children:"Command"}),s.jsx("code",{className:"s-thread-approval-gate-code",children:t})]}),r&&s.jsxs("div",{className:"s-thread-approval-gate-diff surface-card surface-card--inset",children:[s.jsx("span",{className:"label-xs text-muted",children:"Diff Preview"}),s.jsx("pre",{className:"s-thread-approval-gate-diff-pre",children:s.jsx("code",{children:r})})]}),s.jsxs("div",{className:"s-thread-approval-gate-actions",children:[s.jsxs("button",{type:"button",className:"btn btn--primary",onClick:o,children:[s.jsx("kbd",{className:"s-kbd",children:"[Y]"}),s.jsx(b,{size:13}),s.jsx("span",{children:"Approve Action"})]}),s.jsxs("button",{type:"button",className:"btn btn--danger",onClick:l,children:[s.jsx("kbd",{className:"s-kbd",children:"[N]"}),s.jsx(k,{size:13}),s.jsx("span",{children:"Reject"})]}),d&&s.jsxs("button",{type:"button",className:"btn btn--ghost",onClick:d,children:[s.jsx("kbd",{className:"s-kbd",children:"[S]"}),s.jsx("span",{children:"Steer…"})]})]})]})}function G({presence:e,agent:a}){if(!e.showStrip)return null;const r=e.tone==="working",t=e.tone==="pending";return s.jsxs("div",{className:`s-thread-status s-thread-status--${e.tone}`,"aria-live":"polite",children:[s.jsx("span",{className:"s-thread-status-dot-wrap","aria-hidden":"true",children:s.jsx("span",{className:`dot dot--sm ${r?"dot--working dot--pulse dot--glow":t?"dot--warning dot--pulse dot--glow":"dot--neutral"}`,style:{color:w(e,a?.state??null)}})}),s.jsxs("div",{className:"s-thread-status-copy",children:[s.jsx("span",{className:"s-thread-status-label label-xs",children:e.label}),s.jsx("span",{className:"s-thread-status-detail",children:e.detail})]})]})}export{q as ApprovalGateCard,G as ConversationStatusStrip,W as PinnedAskCard};
@@ -1 +1 @@
1
- import{l as G,n as O,r as d,p as U,o as E,C as q,q as P,t as X,j as r,u as g}from"./index-BI9AljSD.js";import{H as Y}from"./HarnessMark-DAaWPiT_.js";const z={idle:{label:"Idle",colour:"var(--hud-dim, #71717a)"},thinking:{label:"Thinking",colour:"var(--info, #6fb7c7)"},working:{label:"Working",colour:"var(--hud-status-ok, #7fb069)"},needs:{label:"Needs attention",colour:"var(--hud-status-warn, #d9a441)"},error:{label:"Error",colour:"var(--hud-status-error, #c74a4a)"},offline:{label:"Offline",colour:"var(--hud-dim, #6e6e72)"}};function D(t){if(!t)return"idle";const e=t.toLowerCase();return e.includes("think")?"thinking":e.includes("work")||e.includes("turn")||e.includes("stream")||e.includes("run")||e.includes("busy")?"working":e.includes("need")||e.includes("wait")||e.includes("block")||e.includes("ask")||e.includes("prompt")?"needs":e.includes("err")||e.includes("fail")||e.includes("crash")?"error":e.includes("off")||e.includes("stop")||e.includes("down")||e.includes("dead")?"offline":"idle"}function J(t){const[e,i]=d.useState(0),s=d.useRef([]);return d.useEffect(()=>{if(t<3||typeof window>"u"||window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;const h=()=>{s.current.push(window.setTimeout(()=>{i(1),s.current.push(window.setTimeout(()=>i(2),40)),s.current.push(window.setTimeout(()=>i(1),90)),s.current.push(window.setTimeout(()=>{i(0),h()},130))},2800+Math.random()*4500))};h();const a=s.current;return()=>{a.forEach(f=>window.clearTimeout(f)),a.length=0}},[t]),t<3?0:e}function V({slug:t,name:e,project:i,harness:s,state:h,size:a,badge:f=!0,ring:C=!0,chip:x=!1,glow:S=!1,className:N,style:j,title:H}){const l=t.toLowerCase(),u=q[l],n=G[l],w=D(h),p=z[w],$=J(n?n.roles.length+1:1),b=n&&$>0?O[$]?.role:void 0,v=d.useMemo(()=>U(i),[i]),k=(x?E[l]?.ink:void 0)??u?.ink??1,M=d.useMemo(()=>P(v,k),[v,k]);if(!u)return null;const c=x?E[l]:void 0,m=a??40,[T,y,o]=X(u,m),A=`${u.w/o*100}%`,R=`${u.h/o*100}%`,F=`${-T/o*100}%`,W=`${-y/o*100}%`,_=e||t.toUpperCase(),I=H??`${_} · ${i||"openscout"} · ${s||"scout"} · ${p.label}`,L=f&&m>=28&&!!(s&&s!=="unknown"),B=a!=null?{width:a,height:a}:{width:"100%",height:"100%"};return r.jsxs("span",{className:`xc-avatar-root ${N||""}`,style:{...B,boxShadow:S?`0 0 ${Math.round(m*.3)}px ${p.colour}`:void 0,...j},title:I,children:[r.jsx("span",{className:"xc-avatar-shell",style:{background:M,opacity:w==="offline"?.55:1},children:c?r.jsx("img",{src:g(`${l}-chip-id.webp`),alt:"",className:"xc-avatar-img xc-avatar-img--pixel",style:{width:`${c.fill*100}%`,height:`${c.fill*100}%`,left:`${(.5-c.fill/2+(c.nudge?.[0]??0))*100}%`,top:`${(.5-c.fill/2+(c.nudge?.[1]??0))*100}%`}}):r.jsxs(r.Fragment,{children:[r.jsx("img",{src:g(`${t.toLowerCase()}-bust.webp`),alt:"",className:"xc-avatar-img",style:{width:A,height:R,left:F,top:W}}),n&&b&&r.jsx("img",{src:g(`${n.dir}/${b}.webp`),alt:"",className:"xc-avatar-patch",style:{width:`${n.patch[2]/o*100}%`,height:`${n.patch[3]/o*100}%`,left:`${(-T+n.patch[0])/o*100}%`,top:`${(-y+n.patch[1])/o*100}%`}})]})}),C&&r.jsx("span",{className:"xc-ring","data-ring":w,style:{"--xc-c":p.colour}}),L&&r.jsx(Y,{harness:s,size:Math.max(8,Math.round(m*.22)),className:"xc-badge-mark",style:{right:"0%",bottom:"0%",width:"32%",height:"32%",minWidth:12,minHeight:12},title:null})]})}export{V as C};
1
+ import{l as G,n as O,r as d,p as U,o as E,C as q,q as P,t as X,j as r,u as g}from"./index-C1VaWNuD.js";import{H as Y}from"./HarnessMark-DttReffF.js";const z={idle:{label:"Idle",colour:"var(--hud-dim, #71717a)"},thinking:{label:"Thinking",colour:"var(--info, #6fb7c7)"},working:{label:"Working",colour:"var(--hud-status-ok, #7fb069)"},needs:{label:"Needs attention",colour:"var(--hud-status-warn, #d9a441)"},error:{label:"Error",colour:"var(--hud-status-error, #c74a4a)"},offline:{label:"Offline",colour:"var(--hud-dim, #6e6e72)"}};function D(t){if(!t)return"idle";const e=t.toLowerCase();return e.includes("think")?"thinking":e.includes("work")||e.includes("turn")||e.includes("stream")||e.includes("run")||e.includes("busy")?"working":e.includes("need")||e.includes("wait")||e.includes("block")||e.includes("ask")||e.includes("prompt")?"needs":e.includes("err")||e.includes("fail")||e.includes("crash")?"error":e.includes("off")||e.includes("stop")||e.includes("down")||e.includes("dead")?"offline":"idle"}function J(t){const[e,i]=d.useState(0),s=d.useRef([]);return d.useEffect(()=>{if(t<3||typeof window>"u"||window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;const h=()=>{s.current.push(window.setTimeout(()=>{i(1),s.current.push(window.setTimeout(()=>i(2),40)),s.current.push(window.setTimeout(()=>i(1),90)),s.current.push(window.setTimeout(()=>{i(0),h()},130))},2800+Math.random()*4500))};h();const a=s.current;return()=>{a.forEach(f=>window.clearTimeout(f)),a.length=0}},[t]),t<3?0:e}function V({slug:t,name:e,project:i,harness:s,state:h,size:a,badge:f=!0,ring:C=!0,chip:x=!1,glow:S=!1,className:N,style:j,title:H}){const l=t.toLowerCase(),u=q[l],n=G[l],w=D(h),p=z[w],$=J(n?n.roles.length+1:1),b=n&&$>0?O[$]?.role:void 0,v=d.useMemo(()=>U(i),[i]),k=(x?E[l]?.ink:void 0)??u?.ink??1,M=d.useMemo(()=>P(v,k),[v,k]);if(!u)return null;const c=x?E[l]:void 0,m=a??40,[T,y,o]=X(u,m),A=`${u.w/o*100}%`,R=`${u.h/o*100}%`,F=`${-T/o*100}%`,W=`${-y/o*100}%`,_=e||t.toUpperCase(),I=H??`${_} · ${i||"openscout"} · ${s||"scout"} · ${p.label}`,L=f&&m>=28&&!!(s&&s!=="unknown"),B=a!=null?{width:a,height:a}:{width:"100%",height:"100%"};return r.jsxs("span",{className:`xc-avatar-root ${N||""}`,style:{...B,boxShadow:S?`0 0 ${Math.round(m*.3)}px ${p.colour}`:void 0,...j},title:I,children:[r.jsx("span",{className:"xc-avatar-shell",style:{background:M,opacity:w==="offline"?.55:1},children:c?r.jsx("img",{src:g(`${l}-chip-id.webp`),alt:"",className:"xc-avatar-img xc-avatar-img--pixel",style:{width:`${c.fill*100}%`,height:`${c.fill*100}%`,left:`${(.5-c.fill/2+(c.nudge?.[0]??0))*100}%`,top:`${(.5-c.fill/2+(c.nudge?.[1]??0))*100}%`}}):r.jsxs(r.Fragment,{children:[r.jsx("img",{src:g(`${t.toLowerCase()}-bust.webp`),alt:"",className:"xc-avatar-img",style:{width:A,height:R,left:F,top:W}}),n&&b&&r.jsx("img",{src:g(`${n.dir}/${b}.webp`),alt:"",className:"xc-avatar-patch",style:{width:`${n.patch[2]/o*100}%`,height:`${n.patch[3]/o*100}%`,left:`${(-T+n.patch[0])/o*100}%`,top:`${(-y+n.patch[1])/o*100}%`}})]})}),C&&r.jsx("span",{className:"xc-ring","data-ring":w,style:{"--xc-c":p.colour}}),L&&r.jsx(Y,{harness:s,size:Math.max(8,Math.round(m*.22)),className:"xc-badge-mark",style:{right:"0%",bottom:"0%",width:"32%",height:"32%",minWidth:12,minHeight:12},title:null})]})}export{V as C};
@@ -0,0 +1 @@
1
+ import{j as t,r as w}from"./index-C1VaWNuD.js";import{A as E}from"./AgentAvatar-Dz79iTxB.js";import{H as Q}from"./HarnessMark-DttReffF.js";import{t as F}from"./time-Dhsh_2EG.js";import{F as D,A as O}from"./AddProjectForm-fXndbzXT.js";import{i as q,J as U,K as J}from"./Provider-D0bB7q6y.js";import{a as K}from"./agent-specialization-CtF_jI34.js";import{o as G}from"./model-CBkMvT1w.js";import{s as W}from"./project-overview-helpers-BQTc_Ous.js";import{c as M}from"./createLucideIcon-Dv8H8m7J.js";import{S as V}from"./search-FB2vVxCp.js";import{S as X}from"./sliders-horizontal-57e99_qO.js";import{F as x,a as Y}from"./DocumentFocusViewer-D8iB6SMt.js";import{M as Z}from"./message-square-BLiFqpe_.js";const ee=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],te=M("rows-3",ee);const se=[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]],ne=M("telescope",se);const re=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],ie=M("users",re);function z(e){return e.needs?3:e.working?2:1}function $(e){return[...e].sort((n,s)=>z(s)-z(n)||s.lastActivityAt-n.lastActivityAt)}function S(e){return[...new Set(e.map(n=>n?.trim().toLowerCase()).filter(n=>!!n))].sort()}function _(e){const n=[...new Set(e.map(s=>s?.trim()).filter(s=>!!s))];return n.length===0?null:n.length===1?n[0]:`${n.length} branches`}function H(e){return e.needs>0?"needs":e.working>0||e.liveSessionCount>0?"working":"idle"}function oe(e){if(e.needs>0)return`${e.needs} ${e.needs===1?"item needs":"items need"} attention`;const n=Math.max(e.working,e.liveSessionCount);return n>0?`${n} active work ${n===1?"stream":"streams"}`:"No active work"}function ae(e,n){const s=$(n.filter(i=>i.projectSlug===e.slug)),r=S(s.map(i=>i.harness)),o={threadId:`project:${e.slug}`,projectSlug:e.slug,projectTitle:e.title,projectRoot:e.root,branch:_(e.branches.length>0?e.branches:s.map(i=>i.branch)),working:e.working>0||e.liveSessionCount>0,needs:e.needs>0,lastActivityAt:e.lastActivityAt,sessionCount:e.sessionCount,work:oe(e),conversationId:null};return{kind:"project",key:`project:${e.slug}`,agentId:null,name:e.title,headline:"Project agent",harnesses:r,model:null,effort:null,status:H(e),needs:o.needs,working:o.working,substrates:[o],primary:o,work:o.work,conversationId:null,lastActivityAt:e.lastActivityAt,sessionCount:e.sessionCount}}function ce(e){const n=$(e),s=n[0];return{threadId:s.id,projectSlug:s.projectSlug,projectTitle:s.projectTitle,projectRoot:s.projectRoot,branch:_(n.map(r=>r.branch)),working:n.some(r=>r.working),needs:n.some(r=>r.needs),lastActivityAt:Math.max(...n.map(r=>r.lastActivityAt)),sessionCount:n.reduce((r,o)=>r+o.sessionCount,0),work:s.work,conversationId:s.conversationId}}function le(e){const n=new Map;for(const s of e){const r=n.get(s.projectSlug)??[];r.push(s),n.set(s.projectSlug,r)}return[...n.values()].map(ce).sort((s,r)=>Number(r.needs)-Number(s.needs)||Number(r.working)-Number(s.working)||r.lastActivityAt-s.lastActivityAt)}function de(e,n){return n.some(s=>s.needs)?"needs":e.some(s=>(s.state??"").toLowerCase().includes("think"))?"thinking":n.some(s=>s.working)||e.some(s=>/work|running|in_turn/iu.test(s.state??""))?"working":"idle"}function b(e){const n=e?.trim().replace(/\/+$/u,"");return n?n.replace(/^\/(?:Users|home)\/[^/]+(?=\/)/u,"~"):null}function ue(e,n){return[n.root,...n.worktrees.map(r=>r.root)].map(b).filter(r=>!!r).some(r=>e===r||e.startsWith(`${r}/`))}function he(e,n,s){const r=new Set;for(const i of s)i.agentId===e.id&&r.add(i.projectSlug);const o=[e.projectRoot,e.cwd].map(b).filter(i=>!!i);for(const i of n){const a=[i.slug,i.title].map(l=>l.trim().toLowerCase());e.project&&a.includes(e.project.trim().toLowerCase())&&r.add(i.slug),e.workspaceQualifier&&a.includes(e.workspaceQualifier.trim().toLowerCase())&&r.add(i.slug),o.some(l=>ue(l,i))&&r.add(i.slug)}if(r.size===0){const i=b(e.projectRoot??e.cwd);i?r.add(`root:${i}`):e.project?.trim()?r.add(`project:${e.project.trim().toLowerCase()}`):e.workspaceQualifier?.trim()&&r.add(`workspace:${e.workspaceQualifier.trim().toLowerCase()}`)}return r}function pe(e,n,s){const r=new Set;for(const o of e)for(const i of he(o,n,s))r.add(i);return r.size>1?!0:e.some(o=>!J(o)&&!o.workspaceQualifier?.trim()&&!o.cwd?.trim())}function je(e,n,s){const r=e.filter(U),o=new Map;for(const i of r){const a=i.definitionId.trim()||i.id,l=o.get(a)??[];l.push(i),o.set(a,l)}return[...o.entries()].flatMap(([i,a])=>{if(!pe(a,n,s))return[];const h=[...a].sort((d,k)=>(k.updatedAt??0)-(d.updatedAt??0))[0],u=new Set(a.map(d=>d.id)),v=s.filter(d=>d.agentId&&u.has(d.agentId)),j=le(v),f=j[0]??null,p=S([...a.map(d=>d.harness),...v.map(d=>d.harness)]),y=S(a.map(d=>d.model)),A=S(a.map(d=>d.reasoningEffort)),m=de(a,j),C=Math.max(0,...a.map(d=>d.updatedAt??0),...j.map(d=>d.lastActivityAt)),g=K(h);return[{kind:"role",key:`role:${i}`,agentId:h.id,name:h.name,headline:g.headline,harnesses:p,model:y.length===1?y[0]:null,effort:A.length===1?A[0]:null,status:m,needs:m==="needs",working:m==="working"||m==="thinking",substrates:j,primary:f,work:f?.work??g.headline,conversationId:f?.conversationId??h.conversationId,lastActivityAt:C,sessionCount:j.reduce((d,k)=>d+k.sessionCount,0)}]})}function R(e){switch(e.status){case"needs":return 3;case"working":return 2;case"thinking":return 1;case"idle":return 0}}function B(e,n,s,r=null){const o=q(s,r);return[...e.map(a=>ae(a,n)),...je(o,e,n)].sort((a,l)=>R(l)-R(a)||l.lastActivityAt-a.lastActivityAt||a.name.localeCompare(l.name))}function we(e,n){switch(n){case"all":return!0;case"active":return e.status==="working"||e.status==="thinking";case"needs":return e.status==="needs";case"idle":return e.status==="idle"}}function me(e,n){const s=H(e);switch(n){case"all":return!0;case"active":return s==="working";case"needs":return s==="needs";case"idle":return s==="idle"}}function fe(e,n){const s=n.trim().toLowerCase();return!s||e.name.toLowerCase().includes(s)||e.headline.toLowerCase().includes(s)||e.work.toLowerCase().includes(s)?!0:e.substrates.some(r=>r.projectTitle.toLowerCase().includes(s)||r.projectSlug.toLowerCase().includes(s)||(r.projectRoot?.toLowerCase().includes(s)??!1))}function ge(e,n){const s=n.trim().toLowerCase();return s?e.title.toLowerCase().includes(s)||e.slug.toLowerCase().includes(s)||(e.root?.toLowerCase().includes(s)??!1):!0}function ke(e){switch(e){case"needs":return"Needs attention";case"working":return"Working";case"thinking":return"Thinking";case"idle":return"Idle"}}const xe=[{id:"all",label:"All"},{id:"active",label:"Active"},{id:"needs",label:"Needs attention"},{id:"idle",label:"Idle"}];function ve(e,n){if(n){e({view:"conversation",conversationId:n});return}e({view:"messages"})}function L(e,n){e({view:"code",project:n})}function ye(e,n,s){e(G(n,s))}function P(e,n,s){e({view:"agents-v2",projectSlug:s,...n.machineId?{machineId:n.machineId}:{},...n.showEphemeral?{showEphemeral:!0}:{}})}function Ae({model:e,agents:n,route:s,navigate:r,nowMs:o}){const[i,a]=w.useState("projects"),[l,h]=w.useState("all"),[u,v]=w.useState(""),[j,f]=w.useState(!1),p=w.useMemo(()=>B(e.projects,e.threads,n,s.machineId??null),[n,e.projects,e.threads,s.machineId]),y=w.useMemo(()=>p.filter(c=>we(c,l)&&fe(c,u)),[p,u,l]),A=w.useMemo(()=>e.projects.filter(c=>me(c,l)&&ge(c,u)),[e.projects,u,l]),m=e.projects.filter(c=>c.working>0||c.liveSessionCount>0).length,C=e.projects.filter(c=>c.needs>0).length,g=p.filter(c=>c.status==="working"||c.status==="thinking").length,d=p.filter(c=>c.status==="needs").length,k=p.filter(c=>c.kind==="project").length,N=p.filter(c=>c.kind==="role").length;return t.jsxs("main",{className:"cw-root","aria-label":"Projects and agents",children:[t.jsxs("div",{className:"cw-toolbar",children:[t.jsxs("div",{className:"cw-modeToggle",role:"group","aria-label":"Directory view",children:[t.jsxs("button",{type:"button","data-active":i==="projects"||void 0,"aria-pressed":i==="projects",onClick:()=>a("projects"),title:"Browse tracked projects",children:[t.jsx(te,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Projects"]}),t.jsxs("button",{type:"button","data-active":i==="agents"||void 0,"aria-pressed":i==="agents",onClick:()=>a("agents"),title:"Browse durable agent identities",children:[t.jsx(ie,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Agents"]})]}),t.jsxs("label",{className:"cw-search",role:"search",children:[t.jsx(V,{size:13,strokeWidth:1.8,"aria-hidden":!0}),t.jsx("input",{type:"search",value:u,placeholder:i==="projects"?"Find project":"Find agent or project","aria-label":i==="projects"?"Find project":"Find agent or project",onChange:c=>v(c.currentTarget.value)})]}),t.jsxs("div",{className:"cw-filters","aria-label":"Status filter",children:[t.jsx(X,{size:12,strokeWidth:1.9,"aria-hidden":!0,className:"cw-filtersIcon"}),xe.map(c=>t.jsx("button",{type:"button","data-active":l===c.id||void 0,"aria-pressed":l===c.id,onClick:()=>h(c.id),children:c.label},c.id))]}),t.jsxs("button",{type:"button",className:"cw-addProject","aria-expanded":j,onClick:()=>f(c=>!c),children:[t.jsx(D,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Add project"]})]}),j?t.jsx(O,{onClose:()=>f(!1)}):null,t.jsx("div",{className:"cw-digest",children:i==="projects"?t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:[e.projects.length," projects"]}),t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{"data-tone":m>0?"live":void 0,children:[m," active"]}),C>0?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{"data-tone":"needs",children:[C," need you"]})]}):null]}):t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:[k," project agents"]}),N>0?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{children:[N," role ",N===1?"agent":"agents"]})]}):null,t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{"data-tone":g>0?"live":void 0,children:[g," active"]}),d>0?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{"data-tone":"needs",children:[d," need you"]})]}):null]})}),i==="projects"?t.jsx(Se,{projects:A,route:s,navigate:r,nowMs:o,allEmpty:e.projects.length===0}):t.jsx(be,{members:y,route:s,navigate:r,nowMs:o,allEmpty:p.length===0})]})}function Ce({project:e,threads:n,route:s,navigate:r,nowMs:o}){const i=B([e],n,[])[0];return t.jsx("main",{className:"cw-root cw-root--scoped","aria-label":`${e.title} agent`,children:t.jsx(I,{title:"Project agent",members:[i],route:s,navigate:r,nowMs:o})})}const T=5;function Se({projects:e,route:n,navigate:s,nowMs:r,allEmpty:o}){const[i,a]=w.useState(!1);if(e.length===0)return t.jsx("div",{className:"cw-empty",children:o?"No projects are tracked yet.":"No projects match these filters."});const l=i?e:e.slice(0,T),h=Math.max(0,e.length-T);return t.jsxs("div",{className:"cw-workspaceList",children:[l.map(u=>t.jsx(Ne,{project:u,route:n,navigate:s,nowMs:r},u.slug)),h>0?t.jsx("button",{type:"button",className:"cw-showMore",onClick:()=>a(u=>!u),children:i?"Show fewer projects":`Show ${h} more`}):null]})}function Ne({project:e,route:n,navigate:s,nowMs:r}){const o=e.working>0||e.liveSessionCount>0;return t.jsx("article",{className:"cw-workspace","data-state":e.needs>0?"needs":o?"live":void 0,children:t.jsxs("button",{type:"button",className:"cw-workspaceHead",onClick:()=>P(s,n,e.slug),children:[t.jsxs("span",{className:"cw-workspaceTitle",children:[t.jsx(x,{size:13,strokeWidth:1.7,"aria-hidden":!0}),"/",e.title]}),t.jsx("span",{className:"cw-workspaceRoot",title:e.root??void 0,children:e.root?W(e.root):"Discovered project"}),t.jsxs("span",{className:"cw-workspaceMeta",children:[e.needs>0?t.jsx("b",{"data-tone":"needs",children:"Needs you"}):null,o?t.jsx("b",{"data-tone":"live",children:"Active"}):null,t.jsxs("span",{children:[e.worktreeCount," ",e.worktreeCount===1?"worktree":"worktrees"]}),t.jsxs("span",{children:[e.sessionCount," ",e.sessionCount===1?"session":"sessions"]}),t.jsx("time",{children:e.lastActivityAt?F(e.lastActivityAt,r):"no activity"})]})]})})}function be({members:e,route:n,navigate:s,nowMs:r,allEmpty:o}){if(e.length===0)return t.jsx("div",{className:"cw-empty",children:o?"No durable agents are registered yet.":"No agents match these filters."});const i=e.filter(l=>l.kind==="role"),a=e.filter(l=>l.kind==="project");return t.jsxs("div",{className:"cw-agentDirectory",children:[i.length>0?t.jsx(I,{title:"Role agents",members:i,route:n,navigate:s,nowMs:r}):null,a.length>0?t.jsx(I,{title:"Project agents",members:a,route:n,navigate:s,nowMs:r}):null]})}function I({title:e,members:n,route:s,navigate:r,nowMs:o}){return t.jsxs("section",{className:"cw-agentSection","aria-label":e,children:[t.jsxs("div",{className:"cw-agentSectionHead",children:[t.jsx("h2",{children:e}),t.jsx("span",{children:n.length})]}),t.jsx("div",{className:"cw-grid",children:n.map(i=>t.jsx(Ie,{member:i,route:s,navigate:r,nowMs:o},i.key))})]})}function Ie({member:e,route:n,navigate:s,nowMs:r}){const o=e.primary;return t.jsxs("article",{className:"cw-card","data-status":e.status,"data-kind":e.kind,children:[t.jsxs("header",{className:"cw-cardHead",children:[t.jsx(E,{agent:{name:e.name,state:Me(e.status)},placement:"hero",size:46,presence:!0}),t.jsxs("div",{className:"cw-cardIdentity",children:[t.jsxs("div",{className:"cw-cardNameRow",children:[e.harnesses.length>0?t.jsx("span",{className:"cw-cardHarness","data-idle":e.status==="idle"||void 0,"aria-hidden":!0,children:e.harnesses.map(i=>t.jsx(Q,{harness:i,size:13},i))}):null,t.jsx("b",{title:e.name,children:e.name}),t.jsx("span",{className:"cw-statusPill","data-status":e.status,children:ke(e.status)})]}),t.jsx("div",{className:"cw-cardSubline",children:t.jsx("span",{className:"cw-headline",children:e.headline})})]})]}),e.kind==="project"&&o?t.jsxs("div",{className:"cw-projectContext",title:o.projectRoot??void 0,children:[t.jsx(x,{size:11,strokeWidth:1.8,"aria-hidden":!0}),t.jsx("span",{children:o.projectRoot?W(o.projectRoot):`/${o.projectTitle}`}),t.jsxs("em",{children:[e.sessionCount," ",e.sessionCount===1?"session":"sessions"]})]}):e.substrates.length>0?t.jsx("div",{className:"cw-substrates",children:e.substrates.map((i,a)=>t.jsx(Pe,{substrate:i,route:n,navigate:s,primary:a===0},i.threadId))}):null,t.jsxs("div",{className:"cw-work",children:[t.jsx("p",{title:e.work,children:e.work}),t.jsx("time",{children:e.lastActivityAt?F(e.lastActivityAt,r):"—"})]}),t.jsx("footer",{className:"cw-cardActions",children:e.kind==="project"&&o?t.jsxs(t.Fragment,{children:[t.jsxs("button",{type:"button",onClick:()=>P(s,n,o.projectSlug),children:[t.jsx(Y,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Open project"]}),t.jsxs("button",{type:"button",onClick:()=>L(s,o.projectSlug),children:[t.jsx(x,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Browse code"]})]}):t.jsxs(t.Fragment,{children:[e.conversationId?t.jsxs("button",{type:"button",onClick:()=>ve(s,e.conversationId),children:[t.jsx(Z,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Chat"]}):null,o?t.jsxs("button",{type:"button",onClick:()=>L(s,o.projectSlug),children:[t.jsx(x,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Browse code"]}):null,e.agentId?t.jsxs("button",{type:"button",onClick:()=>ye(s,n,e.agentId),children:[t.jsx(ne,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Inspect"]}):null]})})]})}function Me(e){switch(e){case"needs":return"needs_attention";case"working":return"in_turn";case"thinking":return"thinking";case"idle":return"idle"}}function Pe({substrate:e,route:n,navigate:s,primary:r=!1}){return t.jsxs("button",{type:"button",className:"cw-substrateChip","data-primary":r||void 0,"data-live":e.working||void 0,title:e.projectRoot??void 0,onClick:()=>P(s,n,e.projectSlug),children:[t.jsx(x,{size:11,strokeWidth:1.8,"aria-hidden":!0}),t.jsx("span",{children:e.projectTitle}),e.branch?t.jsxs("em",{children:["git: ",e.branch]}):null]})}const qe=Object.freeze(Object.defineProperty({__proto__:null,CrewWorkspaces:Ae,ProjectAgentDirectory:Ce},Symbol.toStringTag,{value:"Module"}));export{Ae as C,Ce as P,ie as U,qe as a};
@@ -1 +1 @@
1
- import{r as m,j as o}from"./index-BI9AljSD.js";/* empty css */const $=48,I=720;function _(e){if(!e||typeof window>"u")return null;try{const n=window.localStorage.getItem(e);if(!n)return null;const a=JSON.parse(n);if(!a||typeof a!="object")return null;const f={};for(const[c,d]of Object.entries(a))typeof d=="number"&&Number.isFinite(d)&&d>0&&(f[c]=d);return f}catch{return null}}function z(e,n){if(e&&!(typeof window>"u"))try{window.localStorage.setItem(e,JSON.stringify(n))}catch{}}function H({storageKey:e,columns:n}){const a=m.useMemo(()=>{const r=_(e)??{},s={};for(const p of n)s[p.key]=r[p.key]??p.defaultWidth;return s},[e,n]),[f,c]=m.useState(a);m.useEffect(()=>{c(r=>{let s=!1;const p={...r};for(const b of n)p[b.key]==null&&(p[b.key]=b.defaultWidth,s=!0);return s?p:r})},[n]);const d=m.useMemo(()=>{const r=new Map;for(const s of n)r.set(s.key,s);return r},[n]),N=m.useRef(null),x=m.useCallback(r=>{const s=N.current;if(!s)return;const p=r.clientX-s.startX,b=Math.min(s.max,Math.max(s.min,s.startWidth+p));c(u=>u[s.key]===b?u:{...u,[s.key]:b})},[]),y=m.useCallback(()=>{N.current&&(N.current=null,document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),c(r=>(z(e,r),r)))},[x,e]);m.useEffect(()=>()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y)},[x,y]);const D=m.useCallback(r=>{const s=f[r],p=d.get(r),b=p?.minWidth??$,u=p?.maxWidth??I;return{style:{width:s,minWidth:b,maxWidth:u},"data-resize-key":r}},[f,d]),E=m.useCallback(r=>({onPointerDown:u=>{if(u.button!==0)return;u.preventDefault(),u.stopPropagation();const h=d.get(r),j=h?.minWidth??$,v=h?.maxWidth??I,S=f[r]??h?.defaultWidth??j;N.current={key:r,startX:u.clientX,startWidth:S,min:j,max:v},document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",x),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y)},onClick:u=>{u.stopPropagation()},onDoubleClick:u=>{u.preventDefault(),u.stopPropagation();const h=d.get(r);h&&c(j=>{const v={...j,[r]:h.defaultWidth};return z(e,v),v})},role:"separator","aria-orientation":"vertical","aria-label":"Resize column",className:"s-resize-handle"}),[f,d,x,y,e]),C=m.useCallback(()=>{c(()=>{const r={};for(const s of n)r[s.key]=s.defaultWidth;return z(e,r),r})},[n,e]);return{widths:f,getColumnProps:D,getResizeHandleProps:E,resetAll:C}}function J(e){return e==="number"||e==="time"?"right":"left"}function B(e){return e==="number"||e==="time"?-1:1}function T(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(n=>T(n)).join(""):""}function F(e,n){if(e.sortValue)return e.sortValue(n);const a=e.render(n),f=T(a).trim();return f||null}function R(e){if(typeof e=="number")return e;const n=Date.parse(e);return Number.isFinite(n)?n:Number.NaN}function q(e,n,a,f){const c=F(a,e),d=F(a,n);return c==null&&d==null?0:c==null?1:d==null?-1:a.kind==="number"?((Number(c)||0)-(Number(d)||0))*f:a.kind==="time"?(R(c)-R(d))*f:String(c).localeCompare(String(d),void 0,{numeric:!0,sensitivity:"base"})*f}function G(e,n){return a=>{typeof e=="function"&&e(a),a.defaultPrevented||n?.(a)}}function K(e,n){return a=>{typeof e=="function"&&e(a),a.defaultPrevented||n?.(a)}}function Z({rows:e,columns:n,rowId:a,storageKey:f,initialSort:c,sort:d,onSortChange:N,secondarySort:x,onRowClick:y,rowBindings:D,rowState:E,empty:C={title:"No rows"},loading:r=!1,rowClassName:s,density:p="comfortable",className:b,ariaLabel:u="Data table"}){const h=m.useMemo(()=>n.map(t=>{const l=t.kind??"text";return{...t,kind:l,align:t.align??J(l),sortable:t.sortable??l!=="custom",resizable:t.resizable??!0}}),[n]),j=m.useMemo(()=>new Map(h.map(t=>[t.key,t])),[h]),[v,S]=m.useState(()=>{if(!c)return null;const l=n.find(i=>i.key===c.key)?.kind??"text";return{key:c.key,dir:c.dir??B(l)}}),k=d??v,{getColumnProps:X,getResizeHandleProps:O}=H({storageKey:f,columns:h.map(t=>({key:t.key,defaultWidth:t.defaultWidth,minWidth:t.minWidth,maxWidth:t.maxWidth}))}),M=m.useMemo(()=>{const t=e.map((i,w)=>({row:i,index:w}));if(!k)return t.map(i=>i.row);const l=j.get(k.key);return l?.sortable?t.slice().sort((i,w)=>{const W=q(i.row,w.row,l,k.dir);if(W!==0)return W;const P=x?.(i.row,w.row)??0;return P!==0?P:i.index-w.index}).map(i=>i.row):t.map(i=>i.row)},[e,k,j,x]),A=t=>{d==null&&S(t),N?.(t)};return o.jsx("div",{className:`dt-wrap dt-wrap--${p}${b?` ${b}`:""}`,children:o.jsxs("table",{className:"dt-table","aria-label":u,"aria-busy":r||void 0,children:[o.jsx("thead",{children:o.jsx("tr",{children:h.map(t=>{const l=k?.key===t.key,i=l?k.dir===1?"ascending":"descending":"none",w=["dt-th",`dt-align-${t.align}`,t.cls,l?"dt-th--sorted":""].filter(Boolean).join(" ");return o.jsxs("th",{className:w,title:t.tip,"aria-sort":i,...X(t.key),children:[t.sortable?o.jsxs("button",{type:"button",className:"dt-th-sort",onClick:()=>{if(k?.key===t.key){A({key:t.key,dir:k.dir===1?-1:1});return}A({key:t.key,dir:B(t.kind)})},children:[o.jsx("span",{className:"dt-th-label",children:t.label}),o.jsx("span",{className:`dt-th-arrow${l?" dt-th-arrow--active":""}`,"aria-hidden":"true",children:l?k?.dir===1?"↑":"↓":"↕"})]}):o.jsx("div",{className:"dt-th-static",children:o.jsx("span",{className:"dt-th-label",children:t.label})}),t.resizable?o.jsx("span",{...O(t.key)}):null]},t.key)})})}),o.jsx("tbody",{children:r&&M.length===0?o.jsx("tr",{className:"dt-loading-row",children:o.jsx("td",{colSpan:h.length,children:o.jsx("div",{className:"dt-loading",role:"status","aria-label":`Loading ${u.toLowerCase()}`,children:Array.from({length:7},(t,l)=>o.jsx("div",{className:"dt-loading-line","aria-hidden":"true",children:h.map(i=>o.jsx("span",{style:{width:`${Math.min(i.defaultWidth,220)}px`}},i.key))},l))})})}):M.length===0?o.jsx("tr",{className:"dt-empty-row",children:o.jsx("td",{colSpan:h.length,children:o.jsxs("div",{className:"dt-empty",children:[o.jsx("div",{className:"dt-empty-title",children:C.title}),C.body?o.jsx("div",{children:C.body}):null]})})}):M.map(t=>{const l=a(t),i=D?.(l)??{},w=E?.(l)??{isActive:!1,isPinned:!1},W=!!(y||D),P=["dt-row",W?"dt-row--interactive":"",w.isActive?"dt-row--active":"",w.isPinned?"dt-row--pinned":"",s?.(t),typeof i.className=="string"?i.className:""].filter(Boolean).join(" "),U=y?()=>y(t):void 0,V=W?K(i.onKeyDown,g=>{y&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),y(t))}):typeof i.onKeyDown=="function"?i.onKeyDown:void 0,L={...i,className:P,onClick:G(i.onClick,U),onKeyDown:V};return W&&L.tabIndex==null&&(L.tabIndex=0),o.jsx("tr",{...L,children:h.map(g=>o.jsx("td",{className:["dt-td",`dt-align-${g.align}`,g.cls].filter(Boolean).join(" "),children:g.render(t)},g.key))},l)})})]})})}export{Z as D};
1
+ import{r as m,j as o}from"./index-C1VaWNuD.js";/* empty css */const $=48,I=720;function _(e){if(!e||typeof window>"u")return null;try{const n=window.localStorage.getItem(e);if(!n)return null;const a=JSON.parse(n);if(!a||typeof a!="object")return null;const f={};for(const[c,d]of Object.entries(a))typeof d=="number"&&Number.isFinite(d)&&d>0&&(f[c]=d);return f}catch{return null}}function z(e,n){if(e&&!(typeof window>"u"))try{window.localStorage.setItem(e,JSON.stringify(n))}catch{}}function H({storageKey:e,columns:n}){const a=m.useMemo(()=>{const r=_(e)??{},s={};for(const p of n)s[p.key]=r[p.key]??p.defaultWidth;return s},[e,n]),[f,c]=m.useState(a);m.useEffect(()=>{c(r=>{let s=!1;const p={...r};for(const b of n)p[b.key]==null&&(p[b.key]=b.defaultWidth,s=!0);return s?p:r})},[n]);const d=m.useMemo(()=>{const r=new Map;for(const s of n)r.set(s.key,s);return r},[n]),N=m.useRef(null),x=m.useCallback(r=>{const s=N.current;if(!s)return;const p=r.clientX-s.startX,b=Math.min(s.max,Math.max(s.min,s.startWidth+p));c(u=>u[s.key]===b?u:{...u,[s.key]:b})},[]),y=m.useCallback(()=>{N.current&&(N.current=null,document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),c(r=>(z(e,r),r)))},[x,e]);m.useEffect(()=>()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y)},[x,y]);const D=m.useCallback(r=>{const s=f[r],p=d.get(r),b=p?.minWidth??$,u=p?.maxWidth??I;return{style:{width:s,minWidth:b,maxWidth:u},"data-resize-key":r}},[f,d]),E=m.useCallback(r=>({onPointerDown:u=>{if(u.button!==0)return;u.preventDefault(),u.stopPropagation();const h=d.get(r),j=h?.minWidth??$,v=h?.maxWidth??I,S=f[r]??h?.defaultWidth??j;N.current={key:r,startX:u.clientX,startWidth:S,min:j,max:v},document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",x),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y)},onClick:u=>{u.stopPropagation()},onDoubleClick:u=>{u.preventDefault(),u.stopPropagation();const h=d.get(r);h&&c(j=>{const v={...j,[r]:h.defaultWidth};return z(e,v),v})},role:"separator","aria-orientation":"vertical","aria-label":"Resize column",className:"s-resize-handle"}),[f,d,x,y,e]),C=m.useCallback(()=>{c(()=>{const r={};for(const s of n)r[s.key]=s.defaultWidth;return z(e,r),r})},[n,e]);return{widths:f,getColumnProps:D,getResizeHandleProps:E,resetAll:C}}function J(e){return e==="number"||e==="time"?"right":"left"}function B(e){return e==="number"||e==="time"?-1:1}function T(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(n=>T(n)).join(""):""}function F(e,n){if(e.sortValue)return e.sortValue(n);const a=e.render(n),f=T(a).trim();return f||null}function R(e){if(typeof e=="number")return e;const n=Date.parse(e);return Number.isFinite(n)?n:Number.NaN}function q(e,n,a,f){const c=F(a,e),d=F(a,n);return c==null&&d==null?0:c==null?1:d==null?-1:a.kind==="number"?((Number(c)||0)-(Number(d)||0))*f:a.kind==="time"?(R(c)-R(d))*f:String(c).localeCompare(String(d),void 0,{numeric:!0,sensitivity:"base"})*f}function G(e,n){return a=>{typeof e=="function"&&e(a),a.defaultPrevented||n?.(a)}}function K(e,n){return a=>{typeof e=="function"&&e(a),a.defaultPrevented||n?.(a)}}function Z({rows:e,columns:n,rowId:a,storageKey:f,initialSort:c,sort:d,onSortChange:N,secondarySort:x,onRowClick:y,rowBindings:D,rowState:E,empty:C={title:"No rows"},loading:r=!1,rowClassName:s,density:p="comfortable",className:b,ariaLabel:u="Data table"}){const h=m.useMemo(()=>n.map(t=>{const l=t.kind??"text";return{...t,kind:l,align:t.align??J(l),sortable:t.sortable??l!=="custom",resizable:t.resizable??!0}}),[n]),j=m.useMemo(()=>new Map(h.map(t=>[t.key,t])),[h]),[v,S]=m.useState(()=>{if(!c)return null;const l=n.find(i=>i.key===c.key)?.kind??"text";return{key:c.key,dir:c.dir??B(l)}}),k=d??v,{getColumnProps:X,getResizeHandleProps:O}=H({storageKey:f,columns:h.map(t=>({key:t.key,defaultWidth:t.defaultWidth,minWidth:t.minWidth,maxWidth:t.maxWidth}))}),M=m.useMemo(()=>{const t=e.map((i,w)=>({row:i,index:w}));if(!k)return t.map(i=>i.row);const l=j.get(k.key);return l?.sortable?t.slice().sort((i,w)=>{const W=q(i.row,w.row,l,k.dir);if(W!==0)return W;const P=x?.(i.row,w.row)??0;return P!==0?P:i.index-w.index}).map(i=>i.row):t.map(i=>i.row)},[e,k,j,x]),A=t=>{d==null&&S(t),N?.(t)};return o.jsx("div",{className:`dt-wrap dt-wrap--${p}${b?` ${b}`:""}`,children:o.jsxs("table",{className:"dt-table","aria-label":u,"aria-busy":r||void 0,children:[o.jsx("thead",{children:o.jsx("tr",{children:h.map(t=>{const l=k?.key===t.key,i=l?k.dir===1?"ascending":"descending":"none",w=["dt-th",`dt-align-${t.align}`,t.cls,l?"dt-th--sorted":""].filter(Boolean).join(" ");return o.jsxs("th",{className:w,title:t.tip,"aria-sort":i,...X(t.key),children:[t.sortable?o.jsxs("button",{type:"button",className:"dt-th-sort",onClick:()=>{if(k?.key===t.key){A({key:t.key,dir:k.dir===1?-1:1});return}A({key:t.key,dir:B(t.kind)})},children:[o.jsx("span",{className:"dt-th-label",children:t.label}),o.jsx("span",{className:`dt-th-arrow${l?" dt-th-arrow--active":""}`,"aria-hidden":"true",children:l?k?.dir===1?"↑":"↓":"↕"})]}):o.jsx("div",{className:"dt-th-static",children:o.jsx("span",{className:"dt-th-label",children:t.label})}),t.resizable?o.jsx("span",{...O(t.key)}):null]},t.key)})})}),o.jsx("tbody",{children:r&&M.length===0?o.jsx("tr",{className:"dt-loading-row",children:o.jsx("td",{colSpan:h.length,children:o.jsx("div",{className:"dt-loading",role:"status","aria-label":`Loading ${u.toLowerCase()}`,children:Array.from({length:7},(t,l)=>o.jsx("div",{className:"dt-loading-line","aria-hidden":"true",children:h.map(i=>o.jsx("span",{style:{width:`${Math.min(i.defaultWidth,220)}px`}},i.key))},l))})})}):M.length===0?o.jsx("tr",{className:"dt-empty-row",children:o.jsx("td",{colSpan:h.length,children:o.jsxs("div",{className:"dt-empty",children:[o.jsx("div",{className:"dt-empty-title",children:C.title}),C.body?o.jsx("div",{children:C.body}):null]})})}):M.map(t=>{const l=a(t),i=D?.(l)??{},w=E?.(l)??{isActive:!1,isPinned:!1},W=!!(y||D),P=["dt-row",W?"dt-row--interactive":"",w.isActive?"dt-row--active":"",w.isPinned?"dt-row--pinned":"",s?.(t),typeof i.className=="string"?i.className:""].filter(Boolean).join(" "),U=y?()=>y(t):void 0,V=W?K(i.onKeyDown,g=>{y&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),y(t))}):typeof i.onKeyDown=="function"?i.onKeyDown:void 0,L={...i,className:P,onClick:G(i.onClick,U),onKeyDown:V};return W&&L.tabIndex==null&&(L.tabIndex=0),o.jsx("tr",{...L,children:h.map(g=>o.jsx("td",{className:["dt-td",`dt-align-${g.align}`,g.cls].filter(Boolean).join(" "),children:g.render(t)},g.key))},l)})})]})})}export{Z as D};
@@ -1 +1 @@
1
- import{r as m,j as r}from"./index-BI9AljSD.js";import{a as y}from"./api-Co9aQ2Jw.js";import{i as j}from"./scoutbot-BJIamJOH.js";import{u as S}from"./sse-DDHEHUgz.js";import{t as E}from"./time-Dhsh_2EG.js";import{o as M}from"./openContent-C6XO6kr5.js";import{e as k}from"./broker-display-Q75fupqG.js";import{r as R}from"./follow-route-BvcGtBIL.js";import{L as C}from"./loader-circle-B2W9DPG5.js";import{A as L}from"./arrow-up-right-CY0Vw_67.js";import"./perf-PX8Rx0EP.js";import"./index-BWHgHrtv.js";import"./status-tone-BM_zuRy1.js";import"./createLucideIcon-DthwWQIg.js";const _=3,$=80;function h(e){return Number(e.createdAt)||0}function F(e,s){if(!e.conversationId)return{status:"no-conversation"};const t=s.slice().sort((o,i)=>h(o)-h(i)),n=e.messageId?t.find(o=>o.id===e.messageId)??null:null;let l;if(n){const o=h(n);l=t.filter(i=>i.id!==n.id&&h(i)>=o)}else{const o=t[0];if(o&&h(o)>e.ts)return{status:"beyond-page"};l=t.filter(i=>h(i)>e.ts)}if(l.length===0)return{status:"no-reply"};const u=n?h(n):e.ts,d=l.slice(0,_).map(o=>({id:o.id,actorName:o.actorName||"Unknown",body:o.body??"",createdAt:h(o),afterMs:Math.max(0,h(o)-u),answersDispatch:!!(e.messageId&&o.replyToMessageId===e.messageId)}));return{status:"replies",replies:d,more:Math.max(0,l.length-d.length)}}function b(e,...s){const t=e.metadata??{},n=t.raw&&typeof t.raw=="object"&&!Array.isArray(t.raw)?t.raw:null;for(const l of s)for(const u of[t,n]){const d=u?.[l];if(typeof d=="string"&&d.trim())return d.trim()}return null}function D(e,s){const t=new URLSearchParams,n=e.invocationId??b(e,"invocationId"),l=b(e,"flightId"),u=b(e,"collaborationRecordId","workId","recordId");return l&&t.set("flightId",l),n&&t.set("invocationId",n),e.conversationId&&t.set("conversationId",e.conversationId),u&&t.set("workId",u),s&&t.set("targetAgentId",s),[...t.keys()].length>0?t:null}function H(e,s={}){const t=[];return e.conversationId&&t.push({key:"conversation",label:"Conversation",hint:"The thread this dispatch landed in",route:{view:"conversation",conversationId:e.conversationId}}),(e.flightId||e.sessionId)&&t.push({key:"trace",label:"Live trace",hint:"The session that ran the work",route:{view:"sessions",...e.flightId?{flightId:e.flightId}:{},...e.sessionId?{sessionId:e.sessionId}:{},...e.targetAgentId?{agentId:e.targetAgentId}:{}}}),e.workId&&!s.nativeHost&&t.push({key:"work",label:"Work item",hint:"The collaboration record it belongs to",route:{view:"work",workId:e.workId}}),e.targetAgentId&&t.push({key:"agent",label:"Recipient",hint:"The agent that received it",route:{view:"agents-v2",agentId:e.targetAgentId,tab:"observe"}}),t.length>0&&t.push({key:"tail",label:"Tail",hint:"Raw events for these ids",route:R(e,"tail")}),t}const P={queued:"Queued",dispatched:"Dispatched",running:"Running",succeeded:"Completed",completed:"Completed",failed:"Failed",errored:"Failed",cancelled:"Cancelled",canceled:"Cancelled",timed_out:"Timed out",expired:"Expired"},U=new Set(["failed","errored","timed_out","expired"]),v=new Set(["queued","dispatched","running"]),G=new Set(["succeeded","completed"]);function q(e){if(!e)return null;const s=e.state?.trim().toLowerCase()||"unknown",t=U.has(s)?"danger":v.has(s)?"working":G.has(s)?"success":"neutral",n=e.startedAt&&e.completedAt?Math.max(0,e.completedAt-e.startedAt):null;return{state:s,label:P[s]??s.replace(/_/g," "),tone:t,summary:e.summary?.trim()||null,durationMs:n,settled:!v.has(s)}}function O(e){if(e<1e3)return"instant";const s=Math.round(e/1e3);if(s<60)return`${s}s later`;const t=Math.round(s/60);if(t<60)return`${t}m later`;const n=Math.round(t/60);return n<48?`${n}h later`:`${Math.round(n/24)}d later`}function B(e){if(e<1e3)return`${e}ms`;const s=e/1e3;if(s<60)return`${s.toFixed(s<10?1:0)}s`;const t=Math.floor(s/60),n=Math.round(s%60);return t<60?n>0?`${t}m ${n}s`:`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}const w=180,Q=250,W={loading:!0,target:null,targetUnknown:!1,flight:null,aftermath:{status:"no-conversation"}};function z(e,s){const[t,n]=m.useState(W),[l,u]=m.useState(0),d=m.useRef(0),o=e.conversationId,i=m.useMemo(()=>D(e,s)?.toString()??null,[e,s]);m.useEffect(()=>{const a=++d.current;n(p=>({...p,loading:!0}));const x=i?y(`/api/follow?${i}`).catch(()=>null):Promise.resolve(null),A=o?y(`/api/messages?conversationId=${encodeURIComponent(o)}&limit=${$}`).catch(()=>null):Promise.resolve(null);return(async()=>{const[p,g]=await Promise.all([x,A]);if(a!==d.current)return;const T=p?.flightId?await y(`/api/flights?active=false&flightId=${encodeURIComponent(p.flightId)}`).then(N=>N[0]??null).catch(()=>null):null;a===d.current&&n({loading:!1,target:p,targetUnknown:!!i&&!p,flight:T,aftermath:o?g?F(e,g):{status:"unavailable"}:{status:"no-conversation"}})})(),()=>{d.current+=1}},[e,o,i,l]);const c=m.useRef(null),f=m.useCallback(()=>{c.current||(c.current=setTimeout(()=>{c.current=null,u(a=>a+1)},Q))},[]);m.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]);const I=t.flight?.id??t.target?.flightId??null;return S(a=>{switch(a.kind){case"message.posted":o&&a.payload.message.conversationId===o&&f();return;case"delivery.state.changed":e.messageId&&a.payload.delivery.messageId===e.messageId&&f();return;case"flight.updated":I&&a.payload.flight.id===I&&f();return}}),{...t,reload:f}}function le({attempt:e,targetAgentId:s,navigate:t,returnTo:n}){const{loading:l,target:u,targetUnknown:d,flight:o,aftermath:i}=z(e,s),c=q(o),f=u?H(u,{nativeHost:j()}):[],I=m.useCallback(a=>M(t,a,{returnTo:n}),[t,n]);return r.jsxs("section",{className:"sys-broker-aftermath","aria-labelledby":"dispatch-aftermath-title",children:[r.jsxs("div",{className:"sys-broker-aftermath-head",children:[r.jsx("span",{id:"dispatch-aftermath-title",className:"sys-detail-label",children:"What happened next"}),l&&r.jsx(C,{className:"sys-broker-action-spinner",size:12,"aria-hidden":"true"})]}),c&&r.jsxs("div",{className:`sys-broker-aftermath-outcome sys-broker-aftermath-outcome--${c.tone}`,children:[r.jsx("span",{className:`sys-broker-dot sys-broker-dot--${c.tone}`,"aria-hidden":"true"}),r.jsx("strong",{children:c.label}),c.durationMs!==null&&r.jsxs("span",{className:"sys-broker-aftermath-duration",children:["ran ",B(c.durationMs)]}),c.summary&&r.jsx("p",{children:k(c.summary,w)})]}),i.status==="replies"?r.jsxs("ol",{className:"sys-broker-aftermath-replies",children:[i.replies.map(a=>r.jsx("li",{children:r.jsxs("button",{type:"button",className:"sys-broker-aftermath-reply",disabled:!e.conversationId,onClick:()=>e.conversationId&&I({view:"conversation",conversationId:e.conversationId}),children:[r.jsxs("span",{className:"sys-broker-aftermath-reply-head",children:[r.jsx("strong",{children:a.actorName}),a.answersDispatch&&r.jsx("span",{className:"sys-broker-aftermath-answer",children:"reply"}),r.jsx("span",{className:"sys-broker-aftermath-gap",children:O(a.afterMs)})]}),r.jsx("span",{className:"sys-broker-aftermath-reply-body",children:k(a.body,w)})]})},a.id)),i.more>0&&r.jsxs("li",{className:"sys-broker-aftermath-more",children:["+",i.more," more in the thread"]})]}):!l&&r.jsx("p",{className:"sys-broker-aftermath-empty",children:i.status==="no-conversation"?"No conversation followed this dispatch, so there is nothing to open.":i.status==="unavailable"?"The conversation could not be read, so what followed is unknown.":i.status==="beyond-page"?"This dispatch is older than the loaded transcript. Open the conversation to read it in place.":c&&!c.settled?"Still running. Nothing has come back yet.":"Nothing followed this dispatch in its conversation."}),f.length>0?r.jsx("div",{className:"sys-broker-aftermath-links",children:f.map(a=>r.jsxs("button",{type:"button",className:"sys-broker-aftermath-link",title:a.hint,onClick:()=>I(a.route),children:[a.label,r.jsx(L,{size:11,"aria-hidden":"true"})]},a.key))}):!l&&i.status!=="no-conversation"&&r.jsx("p",{className:"sys-broker-aftermath-empty",children:d?"Where this went could not be looked up, so there is nothing to link to yet.":"No session, work item, or recipient could be resolved from this row."}),o?.completedAt&&r.jsxs("div",{className:"sys-broker-aftermath-foot",children:["Settled ",E(o.completedAt)]})]})}export{le as DispatchAftermath};
1
+ import{r as m,j as r}from"./index-C1VaWNuD.js";import{a as y}from"./api-Co9aQ2Jw.js";import{i as j}from"./scoutbot-D7kGGyK_.js";import{u as S}from"./sse-B29iGBnw.js";import{t as E}from"./time-Dhsh_2EG.js";import{o as M}from"./openContent-C6XO6kr5.js";import{e as k}from"./broker-display-Q75fupqG.js";import{r as R}from"./follow-route-BvcGtBIL.js";import{L as C}from"./loader-circle-DmUG_YC7.js";import{A as L}from"./arrow-up-right-B09GPwFl.js";import"./perf-PX8Rx0EP.js";import"./index-BWHgHrtv.js";import"./status-tone-BM_zuRy1.js";import"./createLucideIcon-Dv8H8m7J.js";const _=3,$=80;function h(e){return Number(e.createdAt)||0}function F(e,s){if(!e.conversationId)return{status:"no-conversation"};const t=s.slice().sort((o,i)=>h(o)-h(i)),n=e.messageId?t.find(o=>o.id===e.messageId)??null:null;let l;if(n){const o=h(n);l=t.filter(i=>i.id!==n.id&&h(i)>=o)}else{const o=t[0];if(o&&h(o)>e.ts)return{status:"beyond-page"};l=t.filter(i=>h(i)>e.ts)}if(l.length===0)return{status:"no-reply"};const u=n?h(n):e.ts,d=l.slice(0,_).map(o=>({id:o.id,actorName:o.actorName||"Unknown",body:o.body??"",createdAt:h(o),afterMs:Math.max(0,h(o)-u),answersDispatch:!!(e.messageId&&o.replyToMessageId===e.messageId)}));return{status:"replies",replies:d,more:Math.max(0,l.length-d.length)}}function b(e,...s){const t=e.metadata??{},n=t.raw&&typeof t.raw=="object"&&!Array.isArray(t.raw)?t.raw:null;for(const l of s)for(const u of[t,n]){const d=u?.[l];if(typeof d=="string"&&d.trim())return d.trim()}return null}function D(e,s){const t=new URLSearchParams,n=e.invocationId??b(e,"invocationId"),l=b(e,"flightId"),u=b(e,"collaborationRecordId","workId","recordId");return l&&t.set("flightId",l),n&&t.set("invocationId",n),e.conversationId&&t.set("conversationId",e.conversationId),u&&t.set("workId",u),s&&t.set("targetAgentId",s),[...t.keys()].length>0?t:null}function H(e,s={}){const t=[];return e.conversationId&&t.push({key:"conversation",label:"Conversation",hint:"The thread this dispatch landed in",route:{view:"conversation",conversationId:e.conversationId}}),(e.flightId||e.sessionId)&&t.push({key:"trace",label:"Live trace",hint:"The session that ran the work",route:{view:"sessions",...e.flightId?{flightId:e.flightId}:{},...e.sessionId?{sessionId:e.sessionId}:{},...e.targetAgentId?{agentId:e.targetAgentId}:{}}}),e.workId&&!s.nativeHost&&t.push({key:"work",label:"Work item",hint:"The collaboration record it belongs to",route:{view:"work",workId:e.workId}}),e.targetAgentId&&t.push({key:"agent",label:"Recipient",hint:"The agent that received it",route:{view:"agents-v2",agentId:e.targetAgentId,tab:"observe"}}),t.length>0&&t.push({key:"tail",label:"Tail",hint:"Raw events for these ids",route:R(e,"tail")}),t}const P={queued:"Queued",dispatched:"Dispatched",running:"Running",succeeded:"Completed",completed:"Completed",failed:"Failed",errored:"Failed",cancelled:"Cancelled",canceled:"Cancelled",timed_out:"Timed out",expired:"Expired"},U=new Set(["failed","errored","timed_out","expired"]),v=new Set(["queued","dispatched","running"]),G=new Set(["succeeded","completed"]);function q(e){if(!e)return null;const s=e.state?.trim().toLowerCase()||"unknown",t=U.has(s)?"danger":v.has(s)?"working":G.has(s)?"success":"neutral",n=e.startedAt&&e.completedAt?Math.max(0,e.completedAt-e.startedAt):null;return{state:s,label:P[s]??s.replace(/_/g," "),tone:t,summary:e.summary?.trim()||null,durationMs:n,settled:!v.has(s)}}function O(e){if(e<1e3)return"instant";const s=Math.round(e/1e3);if(s<60)return`${s}s later`;const t=Math.round(s/60);if(t<60)return`${t}m later`;const n=Math.round(t/60);return n<48?`${n}h later`:`${Math.round(n/24)}d later`}function B(e){if(e<1e3)return`${e}ms`;const s=e/1e3;if(s<60)return`${s.toFixed(s<10?1:0)}s`;const t=Math.floor(s/60),n=Math.round(s%60);return t<60?n>0?`${t}m ${n}s`:`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}const w=180,Q=250,W={loading:!0,target:null,targetUnknown:!1,flight:null,aftermath:{status:"no-conversation"}};function z(e,s){const[t,n]=m.useState(W),[l,u]=m.useState(0),d=m.useRef(0),o=e.conversationId,i=m.useMemo(()=>D(e,s)?.toString()??null,[e,s]);m.useEffect(()=>{const a=++d.current;n(p=>({...p,loading:!0}));const x=i?y(`/api/follow?${i}`).catch(()=>null):Promise.resolve(null),A=o?y(`/api/messages?conversationId=${encodeURIComponent(o)}&limit=${$}`).catch(()=>null):Promise.resolve(null);return(async()=>{const[p,g]=await Promise.all([x,A]);if(a!==d.current)return;const T=p?.flightId?await y(`/api/flights?active=false&flightId=${encodeURIComponent(p.flightId)}`).then(N=>N[0]??null).catch(()=>null):null;a===d.current&&n({loading:!1,target:p,targetUnknown:!!i&&!p,flight:T,aftermath:o?g?F(e,g):{status:"unavailable"}:{status:"no-conversation"}})})(),()=>{d.current+=1}},[e,o,i,l]);const c=m.useRef(null),f=m.useCallback(()=>{c.current||(c.current=setTimeout(()=>{c.current=null,u(a=>a+1)},Q))},[]);m.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]);const I=t.flight?.id??t.target?.flightId??null;return S(a=>{switch(a.kind){case"message.posted":o&&a.payload.message.conversationId===o&&f();return;case"delivery.state.changed":e.messageId&&a.payload.delivery.messageId===e.messageId&&f();return;case"flight.updated":I&&a.payload.flight.id===I&&f();return}}),{...t,reload:f}}function le({attempt:e,targetAgentId:s,navigate:t,returnTo:n}){const{loading:l,target:u,targetUnknown:d,flight:o,aftermath:i}=z(e,s),c=q(o),f=u?H(u,{nativeHost:j()}):[],I=m.useCallback(a=>M(t,a,{returnTo:n}),[t,n]);return r.jsxs("section",{className:"sys-broker-aftermath","aria-labelledby":"dispatch-aftermath-title",children:[r.jsxs("div",{className:"sys-broker-aftermath-head",children:[r.jsx("span",{id:"dispatch-aftermath-title",className:"sys-detail-label",children:"What happened next"}),l&&r.jsx(C,{className:"sys-broker-action-spinner",size:12,"aria-hidden":"true"})]}),c&&r.jsxs("div",{className:`sys-broker-aftermath-outcome sys-broker-aftermath-outcome--${c.tone}`,children:[r.jsx("span",{className:`sys-broker-dot sys-broker-dot--${c.tone}`,"aria-hidden":"true"}),r.jsx("strong",{children:c.label}),c.durationMs!==null&&r.jsxs("span",{className:"sys-broker-aftermath-duration",children:["ran ",B(c.durationMs)]}),c.summary&&r.jsx("p",{children:k(c.summary,w)})]}),i.status==="replies"?r.jsxs("ol",{className:"sys-broker-aftermath-replies",children:[i.replies.map(a=>r.jsx("li",{children:r.jsxs("button",{type:"button",className:"sys-broker-aftermath-reply",disabled:!e.conversationId,onClick:()=>e.conversationId&&I({view:"conversation",conversationId:e.conversationId}),children:[r.jsxs("span",{className:"sys-broker-aftermath-reply-head",children:[r.jsx("strong",{children:a.actorName}),a.answersDispatch&&r.jsx("span",{className:"sys-broker-aftermath-answer",children:"reply"}),r.jsx("span",{className:"sys-broker-aftermath-gap",children:O(a.afterMs)})]}),r.jsx("span",{className:"sys-broker-aftermath-reply-body",children:k(a.body,w)})]})},a.id)),i.more>0&&r.jsxs("li",{className:"sys-broker-aftermath-more",children:["+",i.more," more in the thread"]})]}):!l&&r.jsx("p",{className:"sys-broker-aftermath-empty",children:i.status==="no-conversation"?"No conversation followed this dispatch, so there is nothing to open.":i.status==="unavailable"?"The conversation could not be read, so what followed is unknown.":i.status==="beyond-page"?"This dispatch is older than the loaded transcript. Open the conversation to read it in place.":c&&!c.settled?"Still running. Nothing has come back yet.":"Nothing followed this dispatch in its conversation."}),f.length>0?r.jsx("div",{className:"sys-broker-aftermath-links",children:f.map(a=>r.jsxs("button",{type:"button",className:"sys-broker-aftermath-link",title:a.hint,onClick:()=>I(a.route),children:[a.label,r.jsx(L,{size:11,"aria-hidden":"true"})]},a.key))}):!l&&i.status!=="no-conversation"&&r.jsx("p",{className:"sys-broker-aftermath-empty",children:d?"Where this went could not be looked up, so there is nothing to link to yet.":"No session, work item, or recipient could be resolved from this row."}),o?.completedAt&&r.jsxs("div",{className:"sys-broker-aftermath-foot",children:["Settled ",E(o.completedAt)]})]})}export{le as DispatchAftermath};
@@ -1 +1 @@
1
- import{c as u}from"./createLucideIcon-DthwWQIg.js";import{r,j as e}from"./index-BI9AljSD.js";import{T as H}from"./TextDocumentSurface-BeSwe3Yl.js";import{F as A}from"./file-text--hfhwZH1.js";import{X as R}from"./x-DfRJbqrh.js";const S=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Z=u("folder-open",S);const W=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],G=u("folder",W);const B=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],T=u("maximize-2",B);const V=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],C=u("minimize-2",V);function J({open:a=!0,focusable:M=!0,kind:F,document:t,title:z,eyebrow:v,subtitle:w,meta:x=[],mode:$,actions:L=[],state:j,error:c,notice:p,body:d,onClose:o}){const[i,m]=r.useState(!1),[g,y]=r.useState({}),b=r.useRef(null);if(r.useEffect(()=>{a||m(!1)},[a]),r.useEffect(()=>{if(!a)return;let s=null;const l=b.current?.closest(".frame-scrollbar, .s-content")??null,N=()=>{if(!l){y({});return}const n=l.getBoundingClientRect();y({"--doc-focus-layer-top":`${Math.max(0,n.top)}px`,"--doc-focus-layer-right":`${Math.max(0,window.innerWidth-n.right)}px`,"--doc-focus-layer-bottom":`${Math.max(0,window.innerHeight-n.bottom)}px`,"--doc-focus-layer-left":`${Math.max(0,n.left)}px`})},h=()=>{s!==null&&cancelAnimationFrame(s),s=requestAnimationFrame(N)};N();const E=l?new ResizeObserver(h):null;return l&&E?.observe(l),window.addEventListener("resize",h),()=>{s!==null&&cancelAnimationFrame(s),E?.disconnect(),window.removeEventListener("resize",h)}},[a]),r.useEffect(()=>{if(!a)return;const s=f=>{f.key==="Escape"&&(f.preventDefault(),i?m(!1):o?.())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[i,o,a]),!a)return null;const k=z??t?.title??"Document",D=$??(t?.kind==="markdown"?"preview":"read"),_=M&&!!(t||d);return e.jsxs("div",{ref:b,className:`s-doc-focus-layer${i?" s-doc-focus-layer-focused":""}`,style:g,children:[o&&e.jsx("button",{type:"button",className:"s-doc-focus-scrim","aria-label":"Dismiss document viewer",tabIndex:-1,onClick:o}),e.jsxs("section",{className:`s-doc-focus-viewer s-doc-focus-viewer-${F}${i?" s-doc-focus-viewer-focused":""}`,"aria-label":k,role:"dialog","aria-modal":"true",children:[e.jsxs("div",{className:"s-doc-focus-viewer-head",children:[e.jsxs("div",{className:"s-doc-focus-viewer-title-wrap",children:[e.jsx("div",{className:"s-doc-focus-viewer-icon","aria-hidden":"true",children:e.jsx(A,{size:15,strokeWidth:1.8})}),e.jsxs("div",{className:"s-doc-focus-viewer-title-main",children:[v&&e.jsx("div",{className:"s-doc-focus-viewer-eyebrow",children:v}),e.jsx("h3",{className:"s-doc-focus-viewer-title",children:k}),w&&e.jsx("div",{className:"s-doc-focus-viewer-subtitle",children:w})]})]}),e.jsxs("div",{className:"s-doc-focus-viewer-actions",children:[x.length>0&&e.jsx("div",{className:"s-doc-focus-viewer-meta","aria-label":"Document metadata",children:x.map(s=>e.jsx("span",{children:s},s))}),L.map(s=>e.jsxs("button",{type:"button",className:`s-doc-focus-viewer-action${s.hideLabel?" s-doc-focus-viewer-action-icon":""}`,onClick:s.onClick,title:s.title??s.label,disabled:s.disabled,"aria-label":s.hideLabel?s.label:void 0,children:[s.icon,!s.hideLabel&&e.jsx("span",{children:s.label})]},s.label)),_&&e.jsx("button",{type:"button",className:"s-doc-focus-viewer-close",onClick:()=>m(s=>!s),"aria-label":i?"Exit focus mode":"Enter focus mode",title:i?"Exit focus mode":"Focus",children:i?e.jsx(C,{"aria-hidden":"true",size:14,strokeWidth:1.8}):e.jsx(T,{"aria-hidden":"true",size:14,strokeWidth:1.8})}),o&&e.jsx("button",{type:"button",className:"s-doc-focus-viewer-close",onClick:o,"aria-label":"Close document viewer",title:"Close",children:e.jsx(R,{"aria-hidden":"true",size:14,strokeWidth:1.8})})]})]}),j&&!c&&!t&&!d&&e.jsx("div",{className:"s-doc-focus-viewer-state",children:j}),c&&e.jsx("div",{className:"s-doc-focus-viewer-state s-doc-focus-viewer-error",children:c}),!c&&d&&e.jsx("div",{className:"s-doc-focus-viewer-body",children:d}),!c&&!d&&t&&e.jsx(H,{document:t,mode:D,showHeader:!1,className:"s-doc-focus-document"}),!c&&p&&e.jsx("div",{className:"s-doc-focus-viewer-notice",children:p})]})]})}export{J as D,G as F,T as M,Z as a,C as b};
1
+ import{c as u}from"./createLucideIcon-Dv8H8m7J.js";import{r,j as e}from"./index-C1VaWNuD.js";import{T as H}from"./TextDocumentSurface-2X1Gw4eA.js";import{F as A}from"./file-text-BHro8MkG.js";import{X as R}from"./x-DgmmnPKt.js";const S=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Z=u("folder-open",S);const W=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],G=u("folder",W);const B=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],T=u("maximize-2",B);const V=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],C=u("minimize-2",V);function J({open:a=!0,focusable:M=!0,kind:F,document:t,title:z,eyebrow:v,subtitle:w,meta:x=[],mode:$,actions:L=[],state:j,error:c,notice:p,body:d,onClose:o}){const[i,m]=r.useState(!1),[g,y]=r.useState({}),b=r.useRef(null);if(r.useEffect(()=>{a||m(!1)},[a]),r.useEffect(()=>{if(!a)return;let s=null;const l=b.current?.closest(".frame-scrollbar, .s-content")??null,N=()=>{if(!l){y({});return}const n=l.getBoundingClientRect();y({"--doc-focus-layer-top":`${Math.max(0,n.top)}px`,"--doc-focus-layer-right":`${Math.max(0,window.innerWidth-n.right)}px`,"--doc-focus-layer-bottom":`${Math.max(0,window.innerHeight-n.bottom)}px`,"--doc-focus-layer-left":`${Math.max(0,n.left)}px`})},h=()=>{s!==null&&cancelAnimationFrame(s),s=requestAnimationFrame(N)};N();const E=l?new ResizeObserver(h):null;return l&&E?.observe(l),window.addEventListener("resize",h),()=>{s!==null&&cancelAnimationFrame(s),E?.disconnect(),window.removeEventListener("resize",h)}},[a]),r.useEffect(()=>{if(!a)return;const s=f=>{f.key==="Escape"&&(f.preventDefault(),i?m(!1):o?.())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[i,o,a]),!a)return null;const k=z??t?.title??"Document",D=$??(t?.kind==="markdown"?"preview":"read"),_=M&&!!(t||d);return e.jsxs("div",{ref:b,className:`s-doc-focus-layer${i?" s-doc-focus-layer-focused":""}`,style:g,children:[o&&e.jsx("button",{type:"button",className:"s-doc-focus-scrim","aria-label":"Dismiss document viewer",tabIndex:-1,onClick:o}),e.jsxs("section",{className:`s-doc-focus-viewer s-doc-focus-viewer-${F}${i?" s-doc-focus-viewer-focused":""}`,"aria-label":k,role:"dialog","aria-modal":"true",children:[e.jsxs("div",{className:"s-doc-focus-viewer-head",children:[e.jsxs("div",{className:"s-doc-focus-viewer-title-wrap",children:[e.jsx("div",{className:"s-doc-focus-viewer-icon","aria-hidden":"true",children:e.jsx(A,{size:15,strokeWidth:1.8})}),e.jsxs("div",{className:"s-doc-focus-viewer-title-main",children:[v&&e.jsx("div",{className:"s-doc-focus-viewer-eyebrow",children:v}),e.jsx("h3",{className:"s-doc-focus-viewer-title",children:k}),w&&e.jsx("div",{className:"s-doc-focus-viewer-subtitle",children:w})]})]}),e.jsxs("div",{className:"s-doc-focus-viewer-actions",children:[x.length>0&&e.jsx("div",{className:"s-doc-focus-viewer-meta","aria-label":"Document metadata",children:x.map(s=>e.jsx("span",{children:s},s))}),L.map(s=>e.jsxs("button",{type:"button",className:`s-doc-focus-viewer-action${s.hideLabel?" s-doc-focus-viewer-action-icon":""}`,onClick:s.onClick,title:s.title??s.label,disabled:s.disabled,"aria-label":s.hideLabel?s.label:void 0,children:[s.icon,!s.hideLabel&&e.jsx("span",{children:s.label})]},s.label)),_&&e.jsx("button",{type:"button",className:"s-doc-focus-viewer-close",onClick:()=>m(s=>!s),"aria-label":i?"Exit focus mode":"Enter focus mode",title:i?"Exit focus mode":"Focus",children:i?e.jsx(C,{"aria-hidden":"true",size:14,strokeWidth:1.8}):e.jsx(T,{"aria-hidden":"true",size:14,strokeWidth:1.8})}),o&&e.jsx("button",{type:"button",className:"s-doc-focus-viewer-close",onClick:o,"aria-label":"Close document viewer",title:"Close",children:e.jsx(R,{"aria-hidden":"true",size:14,strokeWidth:1.8})})]})]}),j&&!c&&!t&&!d&&e.jsx("div",{className:"s-doc-focus-viewer-state",children:j}),c&&e.jsx("div",{className:"s-doc-focus-viewer-state s-doc-focus-viewer-error",children:c}),!c&&d&&e.jsx("div",{className:"s-doc-focus-viewer-body",children:d}),!c&&!d&&t&&e.jsx(H,{document:t,mode:D,showHeader:!1,className:"s-doc-focus-document"}),!c&&p&&e.jsx("div",{className:"s-doc-focus-viewer-notice",children:p})]})]})}export{J as D,G as F,T as M,Z as a,C as b};
@@ -1 +1 @@
1
- import{r as l,j as e}from"./index-BI9AljSD.js";import{l as c}from"./discover-B3uQlh5L.js";import"./types-B0PlfpKc.js";function n(){const[r,a]=l.useState([]);return l.useEffect(()=>{let s=!1;return c().then(d=>{s||a(d)}),()=>{s=!0}},[]),e.jsxs("div",{className:"s-embeddable-surfaces-lab","data-scout-theme":!0,children:[e.jsxs("header",{className:"s-embeddable-surfaces-lab__header",children:[e.jsx("h1",{children:"Embeddable surfaces"}),e.jsxs("p",{children:["Screens that exported ",e.jsx("code",{children:"scoutSurface.embed"})," and were discovered from"," ",e.jsx("code",{children:"client/screens/**"}),". No separate embed registry file — parity comes from the screen declaration."]})]}),e.jsxs("table",{className:"s-embeddable-surfaces-lab__table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"ID"}),e.jsx("th",{children:"Label"}),e.jsx("th",{children:"Web"}),e.jsx("th",{children:"Embed"}),e.jsx("th",{children:"Profile"}),e.jsx("th",{children:"Module"})]})}),e.jsx("tbody",{children:r.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("code",{children:s.id})}),e.jsx("td",{children:s.label}),e.jsx("td",{children:e.jsx("a",{href:s.webPath,children:s.webPath})}),e.jsxs("td",{children:[e.jsx("div",{children:e.jsx("a",{href:s.embedPath,children:s.embedPath})}),s.embedAliases.length>0&&e.jsx("div",{className:"s-embeddable-surfaces-lab__aliases",children:s.embedAliases.map(d=>e.jsx("a",{href:d,children:d},d))})]}),e.jsx("td",{children:e.jsx("code",{children:s.profile})}),e.jsx("td",{children:e.jsx("code",{children:s.modulePath.replace("../","")})})]},s.id))})]}),r.length===0&&e.jsx("p",{className:"s-embeddable-surfaces-lab__empty",children:"No embeddable screens discovered yet."})]})}export{n as EmbeddableSurfacesLab};
1
+ import{r as l,j as e}from"./index-C1VaWNuD.js";import{l as c}from"./discover-DutlV0ZU.js";import"./types-B0PlfpKc.js";function n(){const[r,a]=l.useState([]);return l.useEffect(()=>{let s=!1;return c().then(d=>{s||a(d)}),()=>{s=!0}},[]),e.jsxs("div",{className:"s-embeddable-surfaces-lab","data-scout-theme":!0,children:[e.jsxs("header",{className:"s-embeddable-surfaces-lab__header",children:[e.jsx("h1",{children:"Embeddable surfaces"}),e.jsxs("p",{children:["Screens that exported ",e.jsx("code",{children:"scoutSurface.embed"})," and were discovered from"," ",e.jsx("code",{children:"client/screens/**"}),". No separate embed registry file — parity comes from the screen declaration."]})]}),e.jsxs("table",{className:"s-embeddable-surfaces-lab__table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"ID"}),e.jsx("th",{children:"Label"}),e.jsx("th",{children:"Web"}),e.jsx("th",{children:"Embed"}),e.jsx("th",{children:"Profile"}),e.jsx("th",{children:"Module"})]})}),e.jsx("tbody",{children:r.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("code",{children:s.id})}),e.jsx("td",{children:s.label}),e.jsx("td",{children:e.jsx("a",{href:s.webPath,children:s.webPath})}),e.jsxs("td",{children:[e.jsx("div",{children:e.jsx("a",{href:s.embedPath,children:s.embedPath})}),s.embedAliases.length>0&&e.jsx("div",{className:"s-embeddable-surfaces-lab__aliases",children:s.embedAliases.map(d=>e.jsx("a",{href:d,children:d},d))})]}),e.jsx("td",{children:e.jsx("code",{children:s.profile})}),e.jsx("td",{children:e.jsx("code",{children:s.modulePath.replace("../","")})})]},s.id))})]}),r.length===0&&e.jsx("p",{className:"s-embeddable-surfaces-lab__empty",children:"No embeddable screens discovered yet."})]})}export{n as EmbeddableSurfacesLab};
@@ -1 +1 @@
1
- import{j as e}from"./index-BI9AljSD.js";function c({title:n,body:s,icon:i,action:t,className:a}){const l=a?`sys-panel sys-state-card ${a}`:"sys-panel sys-state-card";return e.jsxs("div",{className:l,children:[i,e.jsx("h3",{className:"sys-state-title",children:n}),s!=null&&(typeof s=="string"?e.jsx("p",{className:"sys-state-body",children:s}):s),t&&e.jsx("div",{className:"sys-inline-actions",children:t})]})}export{c as E};
1
+ import{j as e}from"./index-C1VaWNuD.js";function c({title:n,body:s,icon:i,action:t,className:a}){const l=a?`sys-panel sys-state-card ${a}`:"sys-panel sys-state-card";return e.jsxs("div",{className:l,children:[i,e.jsx("h3",{className:"sys-state-title",children:n}),s!=null&&(typeof s=="string"?e.jsx("p",{className:"sys-state-body",children:s}):s),t&&e.jsx("div",{className:"sys-inline-actions",children:t})]})}export{c as E};
@@ -1,3 +1,3 @@
1
- import{r as n,j as t}from"./index-BI9AljSD.js";import{T as b,c as j}from"./TextDocumentSurface-BeSwe3Yl.js";import{a as N}from"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";function V(e,a,u){const o=e.relativePath.endsWith(".md")||e.relativePath.endsWith(".mdx"),s=e.relativePath.endsWith(".json");return j({id:e.absolutePath,title:e.relativePath,uri:e.absolutePath,filename:e.relativePath.split("/").pop(),kind:o?"markdown":"code",language:s?"json":o?"markdown":"plain",value:u?`${a}
1
+ import{r as n,j as t}from"./index-C1VaWNuD.js";import{T as b,c as j}from"./TextDocumentSurface-2X1Gw4eA.js";import{a as N}from"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";function V(e,a,u){const o=e.relativePath.endsWith(".md")||e.relativePath.endsWith(".mdx"),s=e.relativePath.endsWith(".json");return j({id:e.absolutePath,title:e.relativePath,uri:e.absolutePath,filename:e.relativePath.split("/").pop(),kind:o?"markdown":"code",language:s?"json":o?"markdown":"plain",value:u?`${a}
2
2
 
3
3
  — excerpt —`:a,readOnly:!0})}function f({artifact:e,onOpen:a,onReveal:u,onBrowse:o}){const[s,l]=n.useState(e.excerpt),[c,i]=n.useState(!0),[w,h]=n.useState(!1),[m,p]=n.useState(null);n.useEffect(()=>{l(e.excerpt),i(!0),p(null);let d=!1;return h(!0),N(`/api/file/preview?path=${encodeURIComponent(e.absolutePath)}`).then(r=>{if(!d)if(r.kind==="file"&&r.previewable){const x=r;l(x.content),i(x.truncated)}else e.excerpt?(l(e.excerpt),i(!0)):(l(null),p("Preview not available for this file type."))}).catch(r=>{d||(e.excerpt?(l(e.excerpt),i(!0)):p(r instanceof Error?r.message:"Could not load file."))}).finally(()=>{d||h(!1)}),()=>{d=!0}},[e.absolutePath,e.excerpt]);const v=n.useMemo(()=>s?V(e,s,c):null,[e,s,c]),P=e.relativePath.endsWith(".md")||e.relativePath.endsWith(".mdx");return t.jsxs(t.Fragment,{children:[t.jsxs("header",{className:"av2-repoViewerHead",children:[t.jsxs("div",{className:"av2-repoViewerPath",children:[t.jsx("span",{className:"av2-repoViewerPathFile",children:e.relativePath}),t.jsx("span",{className:"av2-repoViewerPathAbs",title:e.absolutePath,children:e.absolutePath})]}),t.jsxs("div",{className:"av2-repoViewerActs",children:[t.jsx("button",{type:"button",className:"av2-repoViewerAct","data-primary":!0,onClick:()=>a(e.absolutePath),children:"open"}),o?t.jsx("button",{type:"button",className:"av2-repoViewerAct",onClick:()=>o(e.absolutePath),children:"browse"}):null,t.jsx("button",{type:"button",className:"av2-repoViewerAct",onClick:()=>{u(e.absolutePath)},children:"reveal"})]})]}),t.jsxs("div",{className:"av2-repoViewerBody",children:[w&&!s?t.jsx("div",{className:"av2-repoViewerState",children:"Loading file…"}):m&&!s?t.jsx("div",{className:"av2-repoViewerState av2-repoViewerState--error",children:m}):v?t.jsx(b,{document:v,mode:P?"preview":"read",className:"av2-repoViewerDoc"}):t.jsx("div",{className:"av2-repoViewerState",children:"No content."}),c?t.jsx("div",{className:"av2-repoViewerNotice",children:"Showing excerpt — use open for the full file."}):null]})]})}export{f as FileViewerPane};
@@ -0,0 +1 @@
1
+ import{r as c,j as s}from"./index-C1VaWNuD.js";import{a as k}from"./api-Co9aQ2Jw.js";import{u as R}from"./sse-B29iGBnw.js";import{d as $,t as F}from"./time-Dhsh_2EG.js";import{SessionRefScreen as j}from"./SessionRefScreen-DetLMkTT.js";/* empty css */import{c as E}from"./createLucideIcon-Dv8H8m7J.js";import{X as A}from"./x-DgmmnPKt.js";import"./perf-PX8Rx0EP.js";import"./index-BWHgHrtv.js";import"./tail-events-LK29oCKm.js";import"./BackToPicker-BHicJyfc.js";import"./router-kfcaYqZr.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./ConversationScreen-DIU7m_aC.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./conversation-model-C2KuZUXc.js";import"./colors-BtO5_zlx.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./ConversationComposer-BUIjWMBi.js";import"./AgentAvatar-Dz79iTxB.js";import"./Provider-D0bB7q6y.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D7kGGyK_.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./SpriteAvatar-DFO4Kb4Z.js";import"./CrewAvatar-CZ_faQ_s.js";import"./zap-Bcja1lHG.js";import"./message-markup-DC0QFEZn.js";import"./mentions-BZ5SBMtc.js";import"./AgentDetailCard-8viaEY8b.js";import"./AgentLiveActions-DlSKL60c.js";import"./terminal-takeover-BMeBjBB2.js";import"./openContent-C6XO6kr5.js";import"./eye-C9cGk5z6.js";import"./terminal-UDy4lzV1.js";import"./message-visibility-CGOmSSKs.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-Bt2RBj93.js";import"./AstronautSuit-CwB4Dw07.js";import"./ConversationFeedRows-Bx0gFyG_.js";import"./ConversationPanels-o6W-cOoU.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CPoX8iV2.js";import"./proxy-DVDRhSRR.js";import"./activity-CzTJ-YMX.js";import"./message-circle-joGFxfj1.js";import"./ConversationStatus-CTYOywFh.js";import"./check-Dz2SRHft.js";import"./sparkles-D0vWLTyC.js";import"./SessionObserve-BVeTkcIl.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-t7-XJP-h.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CJVqIqQ2.js";import"./ObserveTextFlow-DCJ5EmD8.js";import"./SessionObserveEvidence-BkOezTGV.js";import"./wrench-BfVeded5.js";import"./external-link-BvX5PfLh.js";import"./session-ref-lookup-state-SATH_jAP.js";/* empty css */const T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],L=E("columns-2",T);function S(t){const o=new Map;for(const r of t)o.delete(r.sessionId),o.set(r.sessionId,r);return[...o.values()]}function M(t,o){const r=S(t),p=o?.trim()||null;return r.find(n=>n.sessionId===p)?.sessionId??r.at(-1)?.sessionId??p}function O(t){return t.length<=34?t:`${t.slice(0,15)}…${t.slice(-14)}`}function q(t,o){return o===0?t.strategy||"dispatch":t.strategy?`switched via ${t.strategy}`:"session changed"}function y({label:t,sessions:o,value:r,onChange:p}){return s.jsxs("label",{className:"s-flight-observe-select-wrap",children:[s.jsx("span",{children:t}),s.jsx("select",{className:"s-flight-observe-select",value:r,onChange:n=>p(n.currentTarget.value),children:o.map(n=>s.jsxs("option",{value:n.sessionId,children:[n.harness?`${n.harness} · `:"",n.sessionId]},n.sessionId))})]})}function ue({route:t,navigate:o}){const[r,p]=c.useState(null),[n,I]=c.useState(!0),[h,N]=c.useState(null),u=c.useCallback(async()=>{try{const e=await k(`/api/flights?active=false&flightId=${encodeURIComponent(t.flightId)}`);p(e[0]??null),N(e.length===0?"This flight is not available on the connected broker.":null)}catch(e){N(e instanceof Error?e.message:String(e))}finally{I(!1)}},[t.flightId]);c.useEffect(()=>{I(!0),u()},[u]),R(()=>{u()});const v=r?.sessions??[],a=c.useMemo(()=>S(v),[v]),g=M(v,t.sessionId),i=a.find(e=>e.sessionId===g)??null,l=a.find(e=>e.sessionId===t.compareSessionId)??null,f=!!(i&&l&&i.sessionId!==l.sessionId),m=c.useCallback((e,d)=>{o({...t,sessionId:e,...d?{compareSessionId:d}:{compareSessionId:void 0}})},[o,t]),w=c.useCallback(()=>{if(!i||a.length<2)return;const e=[...a].reverse().find(d=>d.sessionId!==i.sessionId);e&&m(i.sessionId,e.sessionId)},[i,a,m]),C=c.useCallback(e=>{if(!f||!i||!l){m(e);return}m(e,e===l.sessionId?i.sessionId:l.sessionId)},[l,i,f,m]);return s.jsxs("div",{className:"s-flight-observe",children:[s.jsxs("header",{className:"s-flight-observe-header",children:[s.jsxs("div",{className:"s-flight-observe-heading",children:[s.jsx("div",{className:"s-flight-observe-eyebrow",children:"Flight observe"}),s.jsxs("div",{className:"s-flight-observe-title-row",children:[s.jsx("h2",{children:r?.agentName||r?.agentId||"Flight"}),s.jsx("span",{className:`s-flight-observe-state s-flight-observe-state--${r?.state??"loading"}`,children:r?.state??(n?"loading":"unknown")})]}),s.jsx("div",{className:"s-flight-observe-id",title:t.flightId,children:t.flightId}),r?.summary&&s.jsx("p",{children:r.summary})]}),s.jsxs("div",{className:"s-flight-observe-actions",children:[a.length>1&&!f&&s.jsxs("button",{type:"button",onClick:w,children:[s.jsx(L,{size:13})," Split view"]}),f&&i&&s.jsxs("button",{type:"button",onClick:()=>m(i.sessionId),children:[s.jsx(A,{size:13})," Close split"]})]})]}),v.length>0&&s.jsx("nav",{className:"s-flight-observe-trace","aria-label":"Flight session history",children:v.map((e,d)=>{const b=i?.sessionId===e.sessionId,x=l?.sessionId===e.sessionId;return s.jsxs("div",{className:"s-flight-observe-trace-step",children:[d>0&&s.jsx("span",{className:"s-flight-observe-trace-arrow","aria-hidden":"true",children:"→"}),s.jsxs("button",{type:"button",className:"s-flight-observe-session-chip","data-selected":b||x,"data-observe-role":b?"primary":x?"compare":"idle","aria-pressed":b||x,title:e.sessionId,onClick:()=>C(e.sessionId),children:[s.jsxs("span",{className:"s-flight-observe-session-chip-top",children:[s.jsx("span",{children:e.harness||e.transport||"session"}),s.jsx("time",{title:new Date(e.startedAt).toLocaleString(),children:$(e.startedAt)||F(e.startedAt)})]}),s.jsx("strong",{children:O(e.sessionId)}),s.jsx("small",{children:q(e,d)})]})]},`${e.sessionId}:${e.startedAt}:${d}`)})}),h&&!g&&s.jsx("div",{className:"s-flight-observe-message s-flight-observe-message--error",children:h}),h&&g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Flight record unavailable"}),s.jsx("span",{children:"Showing the concrete session captured by this link."})]}),!h&&n&&s.jsx("div",{className:"s-flight-observe-message",children:"Resolving the flight’s session trace…"}),!h&&!n&&a.length===0&&!g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Waiting for a session"}),s.jsx("span",{children:"The flight is stable here; its trace will appear as soon as a harness acknowledges dispatch."})]}),g&&!f&&s.jsx("main",{className:"s-flight-observe-single",children:s.jsx(j,{sessionRef:g,navigate:o})}),!h&&i&&l&&f&&s.jsxs("main",{className:"s-flight-observe-split",children:[s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Primary session",sessions:a,value:i.sessionId,onChange:e=>m(e,e===l.sessionId?i.sessionId:l.sessionId)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(j,{sessionRef:i.sessionId,navigate:o,showObserveRail:!1})})]}),s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Compare session",sessions:a.filter(e=>e.sessionId!==i.sessionId),value:l.sessionId,onChange:e=>m(i.sessionId,e)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(j,{sessionRef:l.sessionId,navigate:o,showObserveRail:!1})})]})]})]})}export{ue as FlightObserveScreen};
@@ -1 +1 @@
1
- import{r as o,j as r}from"./index-BI9AljSD.js";import{a as h}from"./api-Co9aQ2Jw.js";import{t as p,r as c,m as g}from"./follow-route-BvcGtBIL.js";import{s as l}from"./router-DTtux5sP.js";/* empty css */import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";function y({route:e,navigate:t}){const[d,m]=o.useState(null),i=o.useMemo(()=>p(e),[e]);return o.useEffect(()=>{let n=!1;const s=new URLSearchParams;return e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),(async()=>{try{const a=s.toString(),f=a?await h(`/api/follow?${a}`):i;if(n)return;t(l(c(g(f,i),e.preferredView),e.machineId??null))}catch(a){if(n)return;m(a instanceof Error?a.message:String(a)),t(l(c(i,e.preferredView),e.machineId??null))}})(),()=>{n=!0}},[i,t,e]),r.jsx("div",{className:"s-sessions-screen s-inbox-thread-redesign",children:r.jsx("section",{className:"s-thread-overview",children:r.jsxs("div",{className:"s-thread-overview-copy",children:[r.jsxs("div",{className:"s-sessions-header s-thread-overview-heading",children:[r.jsx("h2",{className:"s-page-title",children:"Follow"}),r.jsx("span",{className:"s-meta s-tabular",children:e.preferredView??"auto"})]}),r.jsx("p",{className:"s-thread-overview-summary",children:d?"Opening the closest available Scout view.":"Resolving Scout context..."})]})})})}export{y as FollowScreen};
1
+ import{r as o,j as r}from"./index-C1VaWNuD.js";import{a as h}from"./api-Co9aQ2Jw.js";import{t as p,r as c,m as g}from"./follow-route-BvcGtBIL.js";import{s as l}from"./router-kfcaYqZr.js";/* empty css */import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";function y({route:e,navigate:t}){const[d,m]=o.useState(null),i=o.useMemo(()=>p(e),[e]);return o.useEffect(()=>{let n=!1;const s=new URLSearchParams;return e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),(async()=>{try{const a=s.toString(),f=a?await h(`/api/follow?${a}`):i;if(n)return;t(l(c(g(f,i),e.preferredView),e.machineId??null))}catch(a){if(n)return;m(a instanceof Error?a.message:String(a)),t(l(c(i,e.preferredView),e.machineId??null))}})(),()=>{n=!0}},[i,t,e]),r.jsx("div",{className:"s-sessions-screen s-inbox-thread-redesign",children:r.jsx("section",{className:"s-thread-overview",children:r.jsxs("div",{className:"s-thread-overview-copy",children:[r.jsxs("div",{className:"s-sessions-header s-thread-overview-heading",children:[r.jsx("h2",{className:"s-page-title",children:"Follow"}),r.jsx("span",{className:"s-meta s-tabular",children:e.preferredView??"auto"})]}),r.jsx("p",{className:"s-thread-overview-summary",children:d?"Opening the closest available Scout view.":"Resolving Scout context..."})]})})})}export{y as FollowScreen};
@@ -1 +1 @@
1
- import{j as e}from"./index-BI9AljSD.js";function p(o){const i=o?.trim().toLowerCase();if(!i)return"unknown";const n=i.replace(/[\s(].*$/,"").replace(/[_-].*$/,""),l={anthropic:"claude",claude:"claude",claudecode:"claude",sonnet:"claude",opus:"claude",openai:"codex",codex:"codex",gpt:"codex",chatgpt:"codex",oai:"codex",xai:"grok",grok:"grok",kimi:"kimi",moonshot:"kimi",google:"gemini",gemini:"gemini",vertex:"gemini",cursor:"cursor",github:"github",opencode:"opencode",oc:"opencode",amp:"amp",sourcegraph:"amp",pi:"pi",inflection:"pi",omp:"pi","oh-my-pi":"pi",claw:"claw",native:"native",worker:"worker",quad:"quad"};return l[n]??l[i.replace(/[\s(].*$/,"")]??i}const m={claude:"Claude",codex:"Codex",grok:"Grok",kimi:"Kimi",gemini:"Gemini",cursor:"Cursor",github:"GitHub",opencode:"OpenCode",amp:"Amp",pi:"Pi",claw:"Claw",native:"Native",worker:"Worker",quad:"Quad"};function g(o){const i=p(o);return m[i]??(o?.trim()||"Unknown")}const c={fill:{fill:"currentColor"},line:{fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},t={claude:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",gemini:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81",cursor:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23",github:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",opencode:"M22 24H2V0h20zM17 4.8H7v14.4h10z"},r=o=>e.jsx("path",{d:o,fill:"currentColor"}),k={amp:{viewBox:"0.6 1.4 8.8 8.8",paths:["M2.37694 9.23487L4.34679 7.23716L5.06365 9.95891L6.10505 9.67408L5.06749 5.72214L1.17831 4.6688L0.901367 5.73289L3.5775 6.45984L1.61584 8.45465L2.37694 9.23487Z","M8.05742 6.91898L9.09885 6.63416L8.0613 2.68224L4.17209 1.62891L3.89515 2.693L7.17936 3.58514L8.05742 6.91898Z","M6.56226 8.43797L7.60365 8.15314L6.5661 4.20121L2.67692 3.14787L2.39998 4.21196L5.68416 5.10411L6.56226 8.43797Z"]},grok:{viewBox:"0 0 34 33",paths:["M13.2371 21.0407L24.3186 12.8506C24.8619 12.4491 25.6384 12.6057 25.8973 13.2294C27.2597 16.5185 26.651 20.4712 23.9403 23.1851C21.2297 25.8989 17.4581 26.4941 14.0108 25.1386L10.2449 26.8843C15.6463 30.5806 22.2053 29.6665 26.304 25.5601C29.5551 22.3051 30.562 17.8683 29.6205 13.8673L29.629 13.8758C28.2637 7.99809 29.9647 5.64871 33.449 0.844576C33.5314 0.730667 33.6139 0.616757 33.6964 0.5L29.1113 5.09055V5.07631L13.2343 21.0436","M10.9503 23.0313C7.07343 19.3235 7.74185 13.5853 11.0498 10.2763C13.4959 7.82722 17.5036 6.82767 21.0021 8.2971L24.7595 6.55998C24.0826 6.07017 23.215 5.54334 22.2195 5.17313C17.7198 3.31926 12.3326 4.24192 8.67479 7.90126C5.15635 11.4239 4.0499 16.8403 5.94992 21.4622C7.36924 24.9165 5.04257 27.3598 2.69884 29.826C1.86829 30.7002 1.0349 31.5745 0.36364 32.5L10.9474 23.0341"]}},C=e.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),j=e.jsxs("g",{fill:"currentColor",children:[e.jsx("path",{d:"M4.5 3h3.4v7.4L14.7 3h4.5l-7.9 8.5L19.8 21h-4.6l-7.3-8.2V21H4.5Z"}),e.jsx("circle",{cx:"20.2",cy:"3.8",r:"1.8"})]}),v=e.jsxs("g",{...c.line,strokeWidth:2,children:[e.jsx("path",{d:"M6.5 8.5h11"}),e.jsx("path",{d:"M10 8.5 9 17M14.2 8.5 15.2 17"})]}),w=e.jsxs("g",{...c.line,children:[e.jsx("path",{d:"M6.5 8 11 12l-4.5 4"}),e.jsx("path",{d:"M12.5 16.5H18",strokeWidth:1.8})]}),M=e.jsxs("g",{...c.line,strokeWidth:1.8,children:[e.jsx("path",{d:"M12 4.5 18.5 8.2v7.6L12 19.5 5.5 15.8V8.2L12 4.5Z"}),e.jsx("circle",{cx:12,cy:12,r:2.7})]}),y=e.jsxs("g",{...c.fill,children:[e.jsx("rect",{x:5.5,y:5.5,width:5.4,height:5.4,rx:1.3}),e.jsx("rect",{x:13.1,y:5.5,width:5.4,height:5.4,rx:1.3}),e.jsx("rect",{x:5.5,y:13.1,width:5.4,height:5.4,rx:1.3}),e.jsx("rect",{x:13.1,y:13.1,width:5.4,height:5.4,rx:1.3})]}),f=e.jsxs("g",{...c.line,strokeWidth:2,children:[e.jsx("path",{d:"M7.5 6Q9.5 12 8.5 18"}),e.jsx("path",{d:"M12 5.5Q14 12 13 18.5"}),e.jsx("path",{d:"M16.5 6Q18.5 12 17.5 18"})]}),b={claude:r(t.claude),codex:C,kimi:j,gemini:r(t.gemini),cursor:r(t.cursor),github:r(t.github),opencode:r(t.opencode),pi:v,native:w,worker:M,quad:y,claw:f};function G({harness:o,size:i=14,className:n,style:l,title:d}){const a=p(o),s=k[a],x=b[a],h=d===null?void 0:d??g(o);return e.jsx("span",{className:n,style:l,title:h,"aria-hidden":h?void 0:!0,children:e.jsx("svg",{viewBox:s?.viewBox??"0 0 24 24",width:i,height:i,style:{display:"block"},role:"img","aria-label":h,children:s?s.paths.map((u,L)=>e.jsx("path",{d:u,fill:"currentColor"},L)):x??e.jsx("text",{x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",fontSize:"13",fontWeight:"600",fontFamily:"var(--font-mono)",fill:"currentColor",children:(a[0]??"?").toUpperCase()})})})}export{G as H,g as h};
1
+ import{j as e}from"./index-C1VaWNuD.js";function p(o){const i=o?.trim().toLowerCase();if(!i)return"unknown";const n=i.replace(/[\s(].*$/,"").replace(/[_-].*$/,""),l={anthropic:"claude",claude:"claude",claudecode:"claude",sonnet:"claude",opus:"claude",openai:"codex",codex:"codex",gpt:"codex",chatgpt:"codex",oai:"codex",xai:"grok",grok:"grok",kimi:"kimi",moonshot:"kimi",google:"gemini",gemini:"gemini",vertex:"gemini",cursor:"cursor",github:"github",opencode:"opencode",oc:"opencode",amp:"amp",sourcegraph:"amp",pi:"pi",inflection:"pi",omp:"pi","oh-my-pi":"pi",claw:"claw",native:"native",worker:"worker",quad:"quad"};return l[n]??l[i.replace(/[\s(].*$/,"")]??i}const m={claude:"Claude",codex:"Codex",grok:"Grok",kimi:"Kimi",gemini:"Gemini",cursor:"Cursor",github:"GitHub",opencode:"OpenCode",amp:"Amp",pi:"Pi",claw:"Claw",native:"Native",worker:"Worker",quad:"Quad"};function g(o){const i=p(o);return m[i]??(o?.trim()||"Unknown")}const c={fill:{fill:"currentColor"},line:{fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},t={claude:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",gemini:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81",cursor:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23",github:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",opencode:"M22 24H2V0h20zM17 4.8H7v14.4h10z"},r=o=>e.jsx("path",{d:o,fill:"currentColor"}),k={amp:{viewBox:"0.6 1.4 8.8 8.8",paths:["M2.37694 9.23487L4.34679 7.23716L5.06365 9.95891L6.10505 9.67408L5.06749 5.72214L1.17831 4.6688L0.901367 5.73289L3.5775 6.45984L1.61584 8.45465L2.37694 9.23487Z","M8.05742 6.91898L9.09885 6.63416L8.0613 2.68224L4.17209 1.62891L3.89515 2.693L7.17936 3.58514L8.05742 6.91898Z","M6.56226 8.43797L7.60365 8.15314L6.5661 4.20121L2.67692 3.14787L2.39998 4.21196L5.68416 5.10411L6.56226 8.43797Z"]},grok:{viewBox:"0 0 34 33",paths:["M13.2371 21.0407L24.3186 12.8506C24.8619 12.4491 25.6384 12.6057 25.8973 13.2294C27.2597 16.5185 26.651 20.4712 23.9403 23.1851C21.2297 25.8989 17.4581 26.4941 14.0108 25.1386L10.2449 26.8843C15.6463 30.5806 22.2053 29.6665 26.304 25.5601C29.5551 22.3051 30.562 17.8683 29.6205 13.8673L29.629 13.8758C28.2637 7.99809 29.9647 5.64871 33.449 0.844576C33.5314 0.730667 33.6139 0.616757 33.6964 0.5L29.1113 5.09055V5.07631L13.2343 21.0436","M10.9503 23.0313C7.07343 19.3235 7.74185 13.5853 11.0498 10.2763C13.4959 7.82722 17.5036 6.82767 21.0021 8.2971L24.7595 6.55998C24.0826 6.07017 23.215 5.54334 22.2195 5.17313C17.7198 3.31926 12.3326 4.24192 8.67479 7.90126C5.15635 11.4239 4.0499 16.8403 5.94992 21.4622C7.36924 24.9165 5.04257 27.3598 2.69884 29.826C1.86829 30.7002 1.0349 31.5745 0.36364 32.5L10.9474 23.0341"]}},C=e.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),j=e.jsxs("g",{fill:"currentColor",children:[e.jsx("path",{d:"M4.5 3h3.4v7.4L14.7 3h4.5l-7.9 8.5L19.8 21h-4.6l-7.3-8.2V21H4.5Z"}),e.jsx("circle",{cx:"20.2",cy:"3.8",r:"1.8"})]}),v=e.jsxs("g",{...c.line,strokeWidth:2,children:[e.jsx("path",{d:"M6.5 8.5h11"}),e.jsx("path",{d:"M10 8.5 9 17M14.2 8.5 15.2 17"})]}),w=e.jsxs("g",{...c.line,children:[e.jsx("path",{d:"M6.5 8 11 12l-4.5 4"}),e.jsx("path",{d:"M12.5 16.5H18",strokeWidth:1.8})]}),M=e.jsxs("g",{...c.line,strokeWidth:1.8,children:[e.jsx("path",{d:"M12 4.5 18.5 8.2v7.6L12 19.5 5.5 15.8V8.2L12 4.5Z"}),e.jsx("circle",{cx:12,cy:12,r:2.7})]}),y=e.jsxs("g",{...c.fill,children:[e.jsx("rect",{x:5.5,y:5.5,width:5.4,height:5.4,rx:1.3}),e.jsx("rect",{x:13.1,y:5.5,width:5.4,height:5.4,rx:1.3}),e.jsx("rect",{x:5.5,y:13.1,width:5.4,height:5.4,rx:1.3}),e.jsx("rect",{x:13.1,y:13.1,width:5.4,height:5.4,rx:1.3})]}),f=e.jsxs("g",{...c.line,strokeWidth:2,children:[e.jsx("path",{d:"M7.5 6Q9.5 12 8.5 18"}),e.jsx("path",{d:"M12 5.5Q14 12 13 18.5"}),e.jsx("path",{d:"M16.5 6Q18.5 12 17.5 18"})]}),b={claude:r(t.claude),codex:C,kimi:j,gemini:r(t.gemini),cursor:r(t.cursor),github:r(t.github),opencode:r(t.opencode),pi:v,native:w,worker:M,quad:y,claw:f};function G({harness:o,size:i=14,className:n,style:l,title:d}){const a=p(o),s=k[a],x=b[a],h=d===null?void 0:d??g(o);return e.jsx("span",{className:n,style:l,title:h,"aria-hidden":h?void 0:!0,children:e.jsx("svg",{viewBox:s?.viewBox??"0 0 24 24",width:i,height:i,style:{display:"block"},role:"img","aria-label":h,children:s?s.paths.map((u,L)=>e.jsx("path",{d:u,fill:"currentColor"},L)):x??e.jsx("text",{x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",fontSize:"13",fontWeight:"600",fontFamily:"var(--font-mono)",fill:"currentColor",children:(a[0]??"?").toUpperCase()})})})}export{G as H,g as h};
@@ -0,0 +1 @@
1
+ import{r as m,j as e}from"./index-C1VaWNuD.js";import{H as L,h as pe}from"./HarnessMark-DttReffF.js";import{p as me,a as Z}from"./api-Co9aQ2Jw.js";import{b as fe}from"./router-kfcaYqZr.js";import{n as S,t as J,f as O}from"./time-Dhsh_2EG.js";import{u as ge}from"./Provider-D0bB7q6y.js";import{u as xe}from"./useContentSecondaryNav-CoIoz7JU.js";import{OpsSubnav as be}from"./OpsSubnav-CjDTnp64.js";/* empty css */import{R as ve}from"./refresh-cw-Bkh7Cvnd.js";import{E as Y}from"./external-link-BvX5PfLh.js";import{c as je}from"./createLucideIcon-Dv8H8m7J.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./conversation-model-C2KuZUXc.js";import"./index-Cx6Gbr6n.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./SecondaryNav-Cs0_FQdj.js";import"./secondaryNavConfig-C0Srrmy8.js";import"./message-square-BLiFqpe_.js";import"./compass-BdpImt_W.js";import"./settings-DQEtqkM9.js";import"./terminal-UDy4lzV1.js";import"./git-branch-Bc_eDIpG.js";import"./scroll-text-DFcBYy5J.js";/* empty css */const D=60*6e4,N=24*D,ke=["product_judgment","large_context_synthesis","adversarial_critique","evidence_inventory","implementation","code_review"],V={fable:j("Fable 5","claude","claude","claude-fable-5","max","Fable","Premium product taste, rapid design iterations, and premise-level critique.","Uses the premium shared Claude allowance; do not spend it on routine mechanical work."),sol:j("GPT-5.6 Sol","codex","codex","gpt-5.6-sol","xhigh",null,"Load-bearing coding, debugging, integration, and technically grounded judgment.","Highest Codex tier; reserve deep turns for work where failure is expensive."),grok:j("Grok 4.6","grok","grok","grok-4.6",null,"Grok","Independent assumption checking, deletion pressure, and adversarial critique.","Do not make it the sole implementation authority; verify conclusions against repository evidence."),kimi:j("Kimi Code","kimi","kimi",null,null,"Kimi","Dense repository and study synthesis through the native Kimi harness.","The harness owns the concrete model and quota telemetry can be stale; probe before large fan-out."),opus:j("Opus 5","claude","claude","claude-opus-5","high","Opus","Long-context synthesis, nuanced architecture, and coherent product reasoning.","Premium shared Claude quota; avoid routine scans and repetitive verification."),glm:j("GLM-5.2","opencode","opencode","opencode-go/glm-5.2",null,"OpenCode","Independent broad-context synthesis through OpenCode.","OpenCode quota is not visible in Scout; use a bounded canary before scaling."),terra:j("GPT-5.6 Terra","codex","codex","gpt-5.6-terra","high",null,"Balanced implementation, correctness review, and technical critique.","Prefer Sol for the hardest integration boundary when its additional spend is justified."),minimax:j("MiniMax M3","minimax","opencode","opencode-go/minimax-m3",null,"OpenCode","Cost-effective structured evidence collection and comparison.","Verify load-bearing conclusions with a stronger reviewer before acceptance."),luna:j("GPT-5.6 Luna","codex","codex","gpt-5.6-luna","medium",null,"Inexpensive source mapping, test enumeration, and mechanical audit work.","Keep it out of sole high-stakes product judgment and final acceptance."),haiku:j("Haiku 4.5","claude","claude","claude-haiku-4-5","low",null,"Fast narrow scans and classification inside the Claude harness.","Lighter reasoning and a smaller context window make broad synthesis a poor fit."),sonnet:j("Sonnet 4.6","claude","claude","claude-sonnet-4-6","high",null,"Strong generalist implementation with a large context window.","Shares Claude's provider allowance and can become a poor choice when that pool is guarded."),deepseek:j("DeepSeek V4 Pro","opencode","opencode","opencode-go/deepseek-v4-pro",null,"OpenCode","Code-centric review through an independent model lineage.","Quota is opaque and findings should not be the sole acceptance authority.")},ee={product_judgment:{label:"Product judgment",objective:"Strategic tradeoffs, UX prioritization, scope shaping, and high-level product decisions.",strategy:"Select models with high nuanced taste, product-level synthesis, and clear communication of architectural tradeoffs.",candidates:[b("fable",100,"Unmatched product taste, rapid design iteration synthesis, and high-fidelity UX direction."),b("sol",87,"Technically grounded product decisions with strong execution realism."),b("grok",82,"Unfiltered perspective on feature bloat and aggressive scope reduction.")]},large_context_synthesis:{label:"Large-context synthesis",objective:"Repository-wide investigations, deep architectural archaeology, and multi-file code synthesis.",strategy:"Select models with expansive effective context windows and high-density information compression.",candidates:[b("kimi",100,"Native long-context retrieval and dense codebase relationship synthesis."),b("opus",91,"Deep structural understanding across complex multi-package repositories."),b("glm",84,"Independent wide-window scanning and structural cross-referencing.")]},adversarial_critique:{label:"Adversarial critique",objective:"Challenging design assumptions, rapid design iteration critique, identifying UX/logic gaps, and applying deletion pressure.",strategy:"Select high-taste and contrarian model lineages that stress-test design iterations and probe corner cases without sycophantic approval.",candidates:[b("fable",100,"High-fidelity design critique, rapid UX/visual iteration stress-testing, and premise challenge."),b("grok",91,"Contrarian perspective, uncompromising edge-case discovery, and aggressive premise challenge."),b("terra",84,"Rigorous technical inspection of code correctness and runtime invariants.")]},evidence_inventory:{label:"Evidence inventory",objective:"Grep and AST inventory, reference tracing, log audit, and structured fact collection.",strategy:"Select fast, cost-effective models with high precision on structured evidence gathering.",candidates:[b("minimax",100,"Fast, cost-effective structured evidence indexing and pattern enumeration."),b("luna",95,"Low-latency source tracing, test inventory, and reference mapping."),b("haiku",87,"Rapid mechanical file scans and categorization.")]},implementation:{label:"Implementation",objective:"Code creation, refactoring, type checking, unit test writing, and bug fixing.",strategy:"Select code-generation champions with high instruction following and strong language typing skills.",candidates:[b("sol",100,"Deep technical accuracy, robust multi-file refactors, and complex logic execution."),b("terra",91,"Reliable structured implementation with strong type-system adherence."),b("sonnet",87,"Strong generalist coding with fast turn times and clear explanations.")]},code_review:{label:"Code review",objective:"Diff analysis, security audit, regression detection, and style conformity.",strategy:"Select models with high sensitivity to subtle bugs, invariant violations, and edge-case behaviors.",candidates:[b("terra",100,"Strict invariant checking, subtle logic flaw detection, and boundary test coverage."),b("opus",96,"High-level architectural consistency and API surface evolution review."),b("deepseek",87,"Independent second-opinion review focused on code-level edge cases.")]}};function $(s){return s.availability==="constrained"||s.availability==="guarded"||s.minimumRemainingPercent!==null&&s.minimumRemainingPercent<=20||s.pacing==="ahead"&&(s.minimumRemainingPercent??100)<=35}function se(s){return s.confidence==="fresh"&&s.minimumRemainingPercent!==null&&!$(s)}function ye(s){return $(s)?s.minimumRemainingPercent!==null&&s.minimumRemainingPercent<=15?`${s.providerLabel} is near capacity (${s.minimumRemainingPercent}% remaining). High risk of quota exhaustion.`:s.pacing==="ahead"?`${s.providerLabel} consumption rate exceeds window pace with limited buffer.`:`${s.providerLabel} quota availability is ${s.availability}. Failover recommended.`:null}function k(s){return[s.providerId,s.harness,s.model,s.effort,s.profile].join("|")}function Ne(s){return[s.profile?`profile ${s.profile}`:s.harness,s.model,s.effort].filter(Boolean).join(" / ")}function Re(s,n="<request>"){const a=s.profile?.trim().toLowerCase()??null,t=a!=="opencode"&&a!=="oc",i=s.profile&&t?["--profile",s.profile]:["--harness",s.harness,...s.model?["--model",s.model]:[]];return s.effort&&i.push("--effort",s.effort),i.push(n),i}function B(s,n="<request>"){return["scout","ask",...Re(s,n)].map(_e).join(" ")}function we(s,n={}){const a=ne(n.now)??Date.now(),t=n.bias??"balanced",i=Me(t),o=new Map(s.providers.map(h=>[h.id,qe(h,a)])),r=n.role?[n.role]:[...ke],c=r.map(h=>{const u=ee[h],d=u.candidates.map(f=>{const g=o.get(f.route.providerId)??ae(f.route.providerId);return{runtime:f,quota:g,score:f.fit+Ae(g,a)*i}}).sort((f,g)=>g.score-f.score||g.runtime.fit-f.runtime.fit),p=d[0],x=$(p.quota),v=d.slice(1);return x&&v.sort((f,g)=>{const q=K(f,p.runtime.route.providerId),T=K(g,p.runtime.route.providerId);return q-T||g.score-f.score||g.runtime.fit-f.runtime.fit}),{role:h,roleLabel:u.label,modelLabel:p.runtime.label,route:p.runtime.route,score:p.score,fit:p.runtime.fit,objective:u.objective,taskRationale:p.runtime.taskRationale,capability:p.runtime.capability,caution:p.runtime.caution,assertion:Le(p.quota),quotaRisk:x,quotaRiskMessage:ye(p.quota),quota:p.quota,alternatives:v.slice(0,2).map(({runtime:f,quota:g,score:q})=>({label:f.label,route:f.route,score:q,fit:f.fit,capability:f.capability,caution:f.caution,taskRationale:f.taskRationale,quotaRisk:$(g),quota:g}))}}),l=Se(r,o,a);return{generatedAt:s.generatedAt,generatedAtLocal:s.generatedAtLocal,evaluatedAt:a,assignments:c,models:l,bias:t}}function Se(s,n,a){const t=new Map;for(const i of s){const o=ee[i];for(const r of o.candidates){const c=k(r.route),l=t.get(c);l?l.roles.push({role:i,label:o.label}):t.set(c,{runtime:r,roles:[{role:i,label:o.label}]})}}return[...t.values()].map(({runtime:i,roles:o})=>{const r=n.get(i.route.providerId)??ae(i.route.providerId);return{modelLabel:i.label,route:i.route,roles:o,strengths:[i.capability],cautions:[i.caution],guidance:Ce(r,a),quotaRisk:$(r),quota:r}})}function qe(s,n){const a=s.windows.filter(h=>!/^video\b/iu.test(h.label)).map(h=>$e(h,n)),t=[...a].sort((h,u)=>h.percentRemaining-u.percentRemaining)[0]??null,i=a.filter(h=>h.paceRatio!==null).sort((h,u)=>u.paceRatio-h.paceRatio)[0]??null,o=a.map(h=>h.confidence),r=o.includes("stale")?"stale":o.includes("fresh")?"fresh":"unknown",c=[...a].filter(h=>h.resetAt!==null&&h.resetAt>n).sort((h,u)=>h.resetAt-u.resetAt)[0]??null,l=t?.percentRemaining??null;return{providerId:s.id,providerLabel:s.label,plan:s.plan,availability:Te(l),pacing:i?.status??"unknown",confidence:r,minimumRemainingPercent:l,bindingWindow:t?.label??null,nextResetAt:c?.resetAt??null,nextResetIn:c?.resetIn??"",windows:a}}function $e(s,n){const a=ne(s.windowMs)??Pe(s.label,s.resetAt),t=a!==null&&s.resetAt!==null?X(Ue(100-(s.resetAt-n)/a*100,0,100)):null,i=t!==null&&t>=1?De(s.usedPercent/t):null,o=i===null?null:X(i*100),r=Ie(s.usedPercent,t,i),c=a===null?N:Math.min(N,Math.max(D,a/4)),l=s.freshness.ageMs===null?"unknown":s.freshness.ageMs>c?"stale":"fresh";return{label:s.label,usedPercent:s.usedPercent,percentRemaining:s.percentRemaining,durationMs:a,elapsedPercent:t,paceRatio:i,projectedUsedPercent:o,status:r,resetAt:s.resetAt,resetIn:s.resetIn,freshness:s.freshness.label,confidence:l}}function j(s,n,a,t,i,o,r,c){return{label:s,route:{providerId:n,harness:a,model:t,effort:i,profile:o},capability:r,caution:c}}function b(s,n,a){return{...V[s],fit:n,taskRationale:a??V[s].capability}}function Ce(s,n){return $(s)?"conserve":s.confidence!=="fresh"?"probe_first":s.availability==="constrained"?"conserve":s.nextResetAt!==null&&s.nextResetAt>n&&s.nextResetAt-n<=N&&s.pacing!=="ahead"&&(s.minimumRemainingPercent??0)>=10?"use_now":s.availability==="guarded"?"conserve":s.pacing==="ahead"?"use_deliberately":s.availability==="abundant"&&s.pacing==="underused"?"use_now":"available"}function Me(s){switch(s){case"capability":return .25;case"quota":return 1.75;case"balanced":return 1}}function Ae(s,n){let a=0;switch(s.availability){case"abundant":a+=10;break;case"available":a+=5;break;case"guarded":a-=5;break;case"constrained":a-=30;break;case"unknown":a-=2;break}return s.pacing==="underused"&&(a+=5),s.pacing==="ahead"&&(a-=8),s.confidence==="stale"&&(a-=8),s.confidence==="unknown"&&(a-=3),s.pacing==="underused"&&s.nextResetAt!==null&&s.nextResetAt>n&&s.nextResetAt-n<=2*N&&(a+=3),a}function Le(s){if(s.minimumRemainingPercent===null)return`${te(s.providerId)} quota telemetry unavailable; use a bounded canary before scaling.`;const n=s.pacing==="on_track"?"usage tracks elapsed time":s.pacing==="underused"?"usage trails elapsed time":s.pacing==="ahead"?"usage exceeds elapsed time":"pace unknown",a=s.nextResetIn?` · next reset ${s.nextResetIn}`:"";return`${Oe(s.minimumRemainingPercent)} minimum remaining · ${n} · telemetry ${s.confidence}${a}.`}function ae(s){return{providerId:s,providerLabel:te(s),plan:null,availability:"unknown",pacing:"unknown",confidence:"unknown",minimumRemainingPercent:null,bindingWindow:null,nextResetAt:null,nextResetIn:"",windows:[]}}function Pe(s,n){const a=s.trim().toLowerCase(),t=a.match(/(?:^|\s)(\d+(?:\.\d+)?)([hd])$/u);if(t){const i=Number(t[1]);return t[2]==="h"?i*D:i*N}if(a==="weekly"||a==="week"||a==="7-day")return 7*N;if(a==="5-hour")return 5*D;if(a==="monthly"||a==="month"){if(n===null)return 30*N;const i=new Date(n),o=new Date(n);o.setUTCMonth(o.getUTCMonth()-1);const r=i.getTime()-o.getTime();return r>0?r:30*N}return null}function Ie(s,n,a){if(n===null||a===null)return"unknown";const t=s-n;return a>1.1&&t>3?"ahead":a<.7&&t<-10?"underused":"on_track"}function Te(s){return s===null?"unknown":s>=60?"abundant":s>=30?"available":s>=15?"guarded":"constrained"}function K(s,n){const a=se(s.quota),t=s.runtime.route.providerId!==n;return a&&t?0:a?1:t?2:3}function _e(s){return/^[A-Za-z0-9_./:@%+=,-]+$/u.test(s)?s:`'${s.replaceAll("'",`'"'"'`)}'`}function te(s){return s.split(/[-_\s]+/u).filter(Boolean).map(n=>`${n.charAt(0).toUpperCase()}${n.slice(1)}`).join(" ")||"Unknown"}function Oe(s){return`${Number.isInteger(s)?s.toFixed(0):s.toFixed(1)}%`}function ne(s){return typeof s=="number"&&Number.isFinite(s)?s:null}function X(s){return Math.round(s*10)/10}function De(s){return Math.round(s*100)/100}function Ue(s,n,a){return Math.min(a,Math.max(n,s))}const Ee=[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],Fe=je("clipboard-paste",Ee),Ge=3e4,M=[{value:"capability",label:"Capability"},{value:"balanced",label:"Balanced"},{value:"quota",label:"Quota"}],Be={codex:"Codex",claude:"Claude",kimi:"Kimi",minimax:"MiniMax",cursor:"Cursor",native:"Native",worker:"Worker",bridge:"Bridge",http:"HTTP",pi:"Pi",flue:"Flue",github:"GitHub",unknown:"Unknown"},ie=[{id:"claude",description:"Anthropic plan windows captured from Claude Code.",links:[{label:"Usage",href:"https://claude.ai/settings/usage"},{label:"Manage plan",href:"https://claude.ai/settings/billing"}]},{id:"codex",description:"OpenAI plan windows reported by local Codex sessions.",links:[{label:"Usage",href:"https://chatgpt.com/codex/settings/usage"},{label:"Open Codex",href:"https://chatgpt.com/codex"}]},{id:"kimi",description:"Kimi Code subscription windows and membership level.",links:[{label:"Kimi Code",href:"https://www.kimi.com/code"},{label:"Docs",href:"https://www.kimi.com/code/docs/en/"}]},{id:"grok",description:"SuperGrok quota reported by local Grok, with dashboard capture and local activity as fallbacks.",links:[{label:"Open Grok",href:"https://grok.com/"},{label:"Billing",href:"https://grok.com/?_s=billing"},{label:"Help",href:"https://docs.x.ai/grok/faq"}]},{id:"minimax",description:"MiniMax Token Plan 5-hour and weekly allowance.",links:[{label:"Usage",href:"https://platform.minimax.io/console/plan"},{label:"Docs",href:"https://platform.minimax.io/docs/token-plan/intro"}]},{id:"cursor",description:"Cursor membership detected locally, plus usage totals from an exported dashboard capture.",links:[{label:"Usage",href:"https://cursor.com/dashboard/usage"},{label:"Manage plan",href:"https://cursor.com/dashboard/billing"}]}],He={cloudflare:[{label:"Dashboard",href:"https://dash.cloudflare.com/"},{label:"Billing",href:"https://dash.cloudflare.com/?to=/:account/billing"}],vercel:[{label:"Dashboard",href:"https://vercel.com/dashboard"},{label:"Billing",href:"https://vercel.com/account/billing"}],exe:[{label:"VMs",href:"https://exe.dev/"},{label:"Billing",href:"https://exe.dev/user/billing"},{label:"Docs",href:"https://exe.dev/docs/what-is-exe"}]},ze={exe:{category:"Agent compute",description:"Persistent VMs for remote Scout agents and isolated workloads."},cloudflare:{category:"Edge platform",description:"Workers, networking, and edge infrastructure available for deployment."},vercel:{category:"App hosting",description:"Projects, preview environments, and production deployments."}};function Qe({provider:s}){return e.jsx("span",{className:`hs-cloud-mark hs-cloud-mark--${s}`,"aria-hidden":"true",children:s==="exe"?e.jsx("img",{src:"https://exe.dev/apple-touch-icon.png",alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer"}):e.jsx("svg",{viewBox:"0 0 24 24",focusable:"false",children:s==="cloudflare"?e.jsx("path",{d:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268Zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727"}):e.jsx("path",{d:"m12 1.608 12 20.784H0Z"})})})}function F(s){const n=(s??"").trim().toLowerCase();return n?n.includes("claude")?"claude":n.includes("codex")?"codex":n.includes("cursor")?"cursor":n.includes("kimi")||n.includes("moonshot")?"kimi":n.includes("minimax")?"minimax":n.includes("github")?"github":n.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown":"unknown"}function P(s){return Be[s]??pe(s)}function We(s){switch(s){case"weekly":return"7d";case"req/h":return"1h";default:return s||"quota"}}function I(s){return s.windows&&s.windows.length>0?s.windows:[{label:We(s.unitLabel),fill:s.fill,usedLabel:s.usedLabel,capLabel:s.capLabel,unitLabel:s.unitLabel,resetAt:s.resetAt}]}function Ve(s){return s.capLabel==="100%"&&s.usedLabel.endsWith("%")?s.usedLabel:`${s.usedLabel}/${s.capLabel}`}function re(s){return s>=.9?"err":s>=.75?"warn":"ok"}function Ke(s,n=30){const a=s??[];if(a.length<=n)return a;if(n<=1)return[a[a.length-1]];const t=(a.length-1)/(n-1);return Array.from({length:n},(i,o)=>a[Math.round(o*t)])}function H(s){const n=Math.floor((s-Date.now())/1e3),a=n<0,t=Math.abs(n);let i;if(t>=86400){const o=Math.floor(t/86400),r=Math.floor(t%86400/3600);i=r>0?`${o}d ${r}h`:`${o}d`}else if(t>=3600){const o=Math.floor(t/3600),r=Math.floor(t%3600/60);i=r>0?`${o}h ${r}m`:`${o}h`}else i=`${Math.max(1,Math.floor(t/60))}m`;return a?`stale ${i}`:i}function Xe(s){if(!s)return null;const n=S(s.capturedAt);if(n)return n;if(s.kind!=="quota")return null;const a=I(s).reduce((t,i)=>{const o=S(i.capturedAt);return Math.max(t??0,o??0)||t},null);return a||I(s).flatMap(t=>t.history??[]).reduce((t,i)=>{const o=S(i.capturedAt);return Math.max(t??0,o??0)||t},null)}function Ze({provider:s,onImported:n}){const[a,t]=m.useState(!1),[i,o]=m.useState(""),[r,c]=m.useState(!1),[l,h]=m.useState(null),u=`hs-${s}-dashboard-capture`,d=P(s);if(!a)return e.jsxs("button",{type:"button",className:"hs-dashboard-capture-trigger",onClick:()=>t(!0),children:[e.jsx(Fe,{size:12,"aria-hidden":"true"}),"Import dashboard"]});const p=async x=>{if(x.preventDefault(),!(!i.trim()||r)){c(!0),h(null);try{await Z("/api/service-budgets/dashboard-import",{method:"POST",body:JSON.stringify({provider:s,text:i})}),o(""),h("Usage snapshot imported."),await n()}catch(v){h(v instanceof Error?v.message:String(v))}finally{c(!1)}}};return e.jsxs("form",{className:"hs-dashboard-capture",onSubmit:x=>{p(x)},children:[e.jsxs("label",{htmlFor:u,children:[d," usage snapshot"]}),e.jsxs("p",{children:[s==="cursor"?"Paste the exported Usage CSV or copied usage table.":"Copy the signed-in Usage panel and paste it here."," ","Scout keeps only normalized totals, not this text."]}),e.jsx("textarea",{id:u,value:i,onChange:x=>o(x.target.value),maxLength:128*1024,rows:5,placeholder:s==="cursor"?"Date (UTC),Type,Model,Tokens,Cost…":"Weekly SuperGrok… Limit · 12% used · Resets…","aria-describedby":l?`${u}-message`:void 0}),l?e.jsx("span",{id:`${u}-message`,className:"hs-dashboard-capture-message",role:"status",children:l}):null,e.jsxs("div",{className:"hs-dashboard-capture-actions",children:[e.jsx("button",{type:"button",onClick:()=>{t(!1),h(null)},disabled:r,children:"Cancel"}),e.jsx("button",{type:"submit",disabled:!i.trim()||r,children:r?"Importing…":"Use snapshot"})]})]})}function Je(s){const n=new Map(s.map(a=>[F(a.id),a]));return ie.map(({id:a})=>({id:a,label:P(a),gauge:n.get(a)??null}))}function Ye({points:s}){const n=Ke(s);return n.length===0?e.jsx("span",{className:"hs-history hs-history-empty",children:"live"}):e.jsx("span",{className:"hs-history","aria-label":`${n.length} budget samples`,children:n.map((a,t)=>{const i=Math.max(.06,Math.min(1,a.fill));return e.jsx("span",{className:`hs-history-bar hs-history-bar--${re(a.fill)}`,style:{height:`${Math.round(i*100)}%`},title:`${O(a.capturedAt)||"unknown"} ${a.usedLabel}`},`${a.capturedAt}:${t}`)})})}function es({gauge:s,window:n}){const a=Math.max(0,Math.min(100,Math.round(n.fill*100))),t=100-a,i=re(n.fill),o=Number.isFinite(n.resetAt)?new Date(n.resetAt).toISOString():void 0;return e.jsxs("div",{className:"hs-subscription-window",children:[e.jsxs("div",{className:"hs-subscription-window-head",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"hs-subscription-window-label",children:[n.label," window"]}),e.jsxs("strong",{className:`hs-subscription-usage hs-subscription-usage--${i}`,children:[a,"% used"]})]}),e.jsxs("div",{className:"hs-subscription-remaining",children:[e.jsxs("strong",{children:[t,"%"]}),e.jsx("span",{children:"available"})]})]}),e.jsx("div",{className:"hs-subscription-meter",role:"progressbar","aria-label":`${s.label} ${n.label} usage`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,children:e.jsx("span",{className:`hs-subscription-meter-fill hs-subscription-meter-fill--${i}`,style:{width:`${a}%`}})}),e.jsxs("div",{className:"hs-subscription-window-meta",children:[e.jsxs("span",{children:[Ve(n)," ",n.unitLabel==="quota"?"quota":n.unitLabel]}),e.jsxs("span",{children:["resets in ",H(n.resetAt),o?e.jsx("time",{dateTime:o,title:O(n.resetAt)||void 0,children:` · ${O(n.resetAt)||""}`}):null]})]}),e.jsx(Ye,{points:n.history})]})}function ss(){return e.jsxs("div",{className:"hs-subscription-loading","aria-hidden":"true",children:[e.jsx("span",{className:"hs-loading-line hs-loading-line--label"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--value"}),e.jsx("span",{className:"hs-loading-meter"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--meta"}),e.jsx("span",{className:"hs-loading-history"})]})}function as(s,n,a){const t=s.flatMap(i=>{if(i.kind!=="quota")return[];const o=I(i).map(r=>{const c=S(r.capturedAt??i.capturedAt),l=Math.round(Math.max(0,Math.min(1,r.fill))*1e3)/10;return{label:r.label,usedPercent:l,percentRemaining:Math.round((100-l)*10)/10,windowMs:r.windowMs??null,resetAt:S(r.resetAt),resetIn:Number.isFinite(r.resetAt)?H(r.resetAt):"",freshness:{ageMs:c?Math.max(0,a-c):null,label:c?J(c)||"now":"unknown"}}});return[{id:F(i.id),label:P(F(i.id)),plan:i.plan??null,windows:o}]});return{generatedAt:n,generatedAtLocal:O(n)||"now",providers:t}}function U(s){switch(s){case"underused":return"usage trails elapsed time";case"on_track":return"usage tracks elapsed time";case"ahead":return"usage exceeds elapsed time";default:return"pace unknown"}}function A(s){return Ne(s)}function z({text:s,label:n="Copy rule"}){const[a,t]=m.useState("idle");m.useEffect(()=>{if(a==="idle")return;const o=window.setTimeout(()=>t("idle"),1800);return()=>window.clearTimeout(o)},[a]);const i=m.useCallback(async()=>{if(typeof navigator>"u"||!navigator.clipboard){t("failed");return}try{await navigator.clipboard.writeText(s),t("copied")}catch{t("failed")}},[s]);return e.jsx("button",{type:"button",className:"hs-advisor-dispatch-copy",onClick:()=>{i()},"aria-live":"polite","aria-atomic":"true",children:a==="copied"?"Copied!":a==="failed"?"Copy failed":n})}function G(s,n){return!!(s.quotaRisk&&n&&!n.quotaRisk&&se(n.quota)&&n.route.providerId!==s.route.providerId)}function oe(s){return s.minimumRemainingPercent===null?"quota unknown":`${s.minimumRemainingPercent}% minimum remaining`}function ts(s){switch(s){case"use_now":return"Use now";case"available":return"Available";case"use_deliberately":return"Use deliberately";case"probe_first":return"Probe first";case"conserve":return"Conserve"}}function le({providerLabel:s,quota:n}){return n.windows.length===0?e.jsxs("div",{className:"hs-advisor-no-quota",children:[e.jsx("strong",{children:"No quota telemetry"}),e.jsx("span",{children:"Use one bounded ask as a canary before scaling this route."})]}):e.jsx("div",{className:"hs-advisor-windows",children:n.windows.map(a=>{const t=Math.max(0,Math.min(100,a.usedPercent)),i=a.elapsedPercent===null?null:Math.max(0,Math.min(100,a.elapsedPercent)),o=i===null?"elapsed time unavailable":`${i}% of the window elapsed`,r=a.projectedUsedPercent===null?"projection unavailable":`${a.projectedUsedPercent}% projected at reset`;return e.jsxs("div",{className:"hs-advisor-window",children:[e.jsxs("div",{className:"hs-advisor-window-head",children:[e.jsx("strong",{children:a.label}),e.jsxs("span",{children:[a.usedPercent,"% used"]}),e.jsx("span",{children:U(a.status)})]}),e.jsxs("div",{className:"hs-advisor-window-meter",role:"progressbar","aria-label":`${s} ${a.label} usage`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(t),"aria-valuetext":`${a.usedPercent}% used; ${o}; ${r}; ${U(a.status)}`,children:[e.jsx("span",{className:`hs-advisor-window-fill hs-advisor-window-fill--${a.status}`,style:{width:`${t}%`}}),i!==null?e.jsx("span",{className:"hs-advisor-window-now",style:{left:`${i}%`},title:`${i}% of the window has elapsed`,"aria-hidden":"true"}):null]}),e.jsxs("div",{className:"hs-advisor-window-meta",children:[e.jsxs("span",{children:[a.percentRemaining,"% available"]}),e.jsx("span",{children:r}),e.jsx("span",{children:a.resetIn?`resets in ${a.resetIn}`:"reset unknown"})]})]},a.label)})})}function ce({assignment:s,selected:n,onSelect:a}){return e.jsxs("button",{type:"button",className:"hs-advisor-role","data-selected":n?"true":void 0,onClick:a,"aria-pressed":n,children:[e.jsx("span",{className:"hs-advisor-role-mark",children:e.jsx(L,{harness:s.route.harness,size:25,title:null})}),e.jsxs("span",{className:"hs-advisor-role-copy",children:[e.jsx("strong",{children:s.roleLabel}),e.jsx("span",{children:s.modelLabel}),e.jsxs("small",{children:[s.route.profile?`profile ${s.route.profile}`:s.route.harness," · Fit $",s.fit]})]}),e.jsx("span",{className:`hs-advisor-role-tag ${s.quotaRisk?"hs-advisor-role-tag--risk":""}`,children:s.quotaRisk?`⚠️ ${s.quota.minimumRemainingPercent!==null?`${s.quota.minimumRemainingPercent}%`:"Risk"}`:s.fit>=100?"Primary":`Fit ${s.fit}`})]})}function ns({map:s}){const[n,a]=m.useState("implementation"),t=s.assignments.find(r=>r.role===n)??s.assignments[0];if(!t)return null;const i=B(t.route),o=t.alternatives.find(r=>G(t,r));return e.jsxs("div",{className:"hs-advisor-layout",children:[e.jsx("nav",{className:"hs-advisor-roles","aria-label":"Work roles",children:s.assignments.map(r=>e.jsx(ce,{assignment:r,selected:r.role===t.role,onSelect:()=>a(r.role)},r.role))}),e.jsxs("article",{className:"hs-advisor-detail","aria-live":"polite",children:[e.jsxs("header",{className:"hs-advisor-detail-head",children:[e.jsxs("div",{className:"hs-advisor-model",children:[e.jsx(L,{harness:t.route.harness,size:26,title:null}),e.jsxs("div",{children:[e.jsxs("span",{children:[t.roleLabel," · Role Routing"]}),e.jsx("h4",{children:t.modelLabel}),e.jsx("code",{children:A(t.route)})]})]}),e.jsx("span",{className:`hs-advisor-fit-badge ${t.quotaRisk?"hs-advisor-role-tag--risk":""}`,children:t.quotaRisk?"⚠️ Quota Risk · Failover Active":`Primary Route · Fit ${t.fit}`})]}),t.quotaRisk?e.jsxs("div",{className:"hs-advisor-quota-alert",role:"alert",children:[e.jsxs("div",{className:"hs-advisor-quota-alert-head",children:[e.jsx("span",{className:"hs-advisor-quota-alert-badge",children:"⚠️ Quota Risk"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Quota Exhaustion Imminent · Elevated to Primary Concern"}),e.jsx("p",{children:t.quotaRiskMessage??`${t.quota.providerLabel} quota is near capacity.`})]})]}),e.jsx("div",{className:"hs-advisor-quota-alert-action",children:o?e.jsxs("span",{children:["Failover to ",e.jsx("strong",{children:o.label})," to move work off the constrained provider."]}):e.jsx("span",{children:"No quota-safe cross-provider fallback is currently available; keep the task bounded or wait for reset."})})]}):null,e.jsxs("div",{className:"hs-advisor-task-hero",children:[e.jsxs("div",{className:"hs-advisor-task-hero-head",children:[e.jsx("h5",{children:"Task Objective"}),e.jsx("span",{children:"Cognitive Strategy"})]}),e.jsx("p",{children:t.objective}),e.jsxs("small",{children:[e.jsx("strong",{children:"Execution Rationale:"})," ",t.taskRationale]})]}),e.jsxs("div",{className:"hs-advisor-assessment",children:[e.jsxs("section",{children:[e.jsx("h5",{children:"Strengths for this task"}),e.jsx("p",{children:t.capability})]}),e.jsxs("section",{children:[e.jsx("h5",{children:"Watchouts & Guardrails"}),e.jsx("p",{children:t.caution})]})]}),e.jsxs("section",{className:"hs-advisor-dispatch",children:[e.jsx("h5",{children:"Dispatch rule"}),e.jsxs("div",{className:"hs-advisor-dispatch-snippet",children:[e.jsx("code",{children:i}),e.jsx(z,{text:i,label:"Copy rule"})]})]}),e.jsxs("section",{className:"hs-advisor-ladder",children:[e.jsx("h5",{children:"Failover ladder"}),e.jsxs("div",{className:"hs-advisor-ladder-nodes",children:[e.jsxs("div",{className:`hs-advisor-ladder-node ${t.quotaRisk?"hs-advisor-ladder-node--primary hs-advisor-ladder-node--risk":"hs-advisor-ladder-node--primary"}`,children:[e.jsx("span",{className:"hs-advisor-ladder-badge",children:t.quotaRisk?"⚠️ Primary (Quota Risk)":"Primary"}),e.jsxs("div",{className:"hs-advisor-ladder-body",children:[e.jsx("strong",{children:t.modelLabel}),e.jsx("code",{children:A(t.route)}),e.jsx("small",{children:t.quotaRisk?`Exhaustion risk (${t.quota.minimumRemainingPercent}% remaining) · ${t.taskRationale}`:`Initial execution target · ${t.taskRationale}`})]})]}),t.alternatives.map((r,c)=>{const l=G(t,r);return e.jsxs("div",{className:`hs-advisor-ladder-node ${l?"hs-advisor-ladder-node--fallback-rec":""}`,children:[e.jsx("span",{className:"hs-advisor-ladder-badge",children:l?"⭐️ Quota-safe fallback":c===0?"Secondary":"Tertiary"}),e.jsxs("div",{className:"hs-advisor-ladder-body",children:[e.jsx("strong",{children:r.label}),e.jsx("code",{children:A(r.route)}),e.jsx("small",{children:l?`Moves work off ${t.quota.providerLabel} · ${r.taskRationale}`:r.quotaRisk?`Also quota constrained; use only if operationally necessary · ${r.taskRationale}`:`Fallback if ${t.modelLabel} encounters rate limits or errors · ${r.taskRationale}`})]})]},k(r.route))})]})]}),e.jsxs("section",{className:"hs-advisor-quota-secondary",children:[e.jsxs("div",{className:"hs-advisor-quota-secondary-head",children:[e.jsxs("h5",{children:["Provider Telemetry ",t.quotaRisk?"(Active Constraint)":"(Secondary)"]}),e.jsxs("span",{children:[t.quota.providerLabel,t.quota.plan?` · ${t.quota.plan}`:""]})]}),e.jsxs("div",{className:"hs-advisor-quota-compact-bar",children:[e.jsxs("span",{children:["Allowance: ",e.jsx("strong",{children:oe(t.quota)})]}),e.jsxs("span",{children:["Pacing: ",e.jsx("strong",{children:U(t.quota.pacing)})]}),e.jsxs("span",{children:["Telemetry: ",e.jsx("strong",{children:t.quota.confidence})]}),t.quota.nextResetIn?e.jsxs("span",{children:["Next reset: ",e.jsx("strong",{children:t.quota.nextResetIn})]}):null]}),t.quotaRisk?e.jsx("div",{style:{marginTop:"var(--space-sm)"},children:e.jsx(le,{providerLabel:t.quota.providerLabel,quota:t.quota})}):null]})]})]})}function is({models:s}){const n=s.find(r=>r.modelLabel==="GPT-5.6 Sol")??s[0],[a,t]=m.useState(()=>n?k(n.route):""),i=s.find(r=>k(r.route)===a)??n;if(!i)return null;const o=B(i.route);return e.jsxs("div",{className:"hs-model-guide-layout",children:[e.jsx("nav",{className:"hs-model-guide-list","aria-label":"Model Fleet",children:s.map(r=>{const c=k(r.route);return e.jsxs("button",{type:"button",className:"hs-model-guide-item","data-selected":c===k(i.route)?"true":void 0,"aria-pressed":c===k(i.route),onClick:()=>t(c),children:[e.jsx("span",{className:"hs-model-guide-mark",children:e.jsx(L,{harness:r.route.harness,size:23,title:null})}),e.jsxs("span",{className:"hs-model-guide-item-copy",children:[e.jsx("strong",{children:r.modelLabel}),e.jsxs("span",{children:[r.quota.providerLabel," · ",r.route.profile?`profile ${r.route.profile}`:r.route.harness]})]}),e.jsx("span",{className:`hs-advisor-role-tag ${r.quotaRisk?"hs-advisor-role-tag--risk":""}`,children:r.quotaRisk?"⚠️ Conserve":ts(r.guidance)})]},c)})}),e.jsxs("article",{className:"hs-model-guide-detail","aria-live":"polite",children:[e.jsxs("header",{className:"hs-advisor-detail-head",children:[e.jsxs("div",{className:"hs-advisor-model",children:[e.jsx(L,{harness:i.route.harness,size:25,title:null}),e.jsxs("div",{children:[e.jsxs("span",{children:[i.quota.providerLabel,i.quota.plan?` · ${i.quota.plan}`:""]}),e.jsx("h4",{children:i.modelLabel}),e.jsx("code",{children:A(i.route)})]})]}),e.jsx("span",{className:`hs-advisor-fit-badge ${i.quotaRisk?"hs-advisor-role-tag--risk":""}`,children:i.quotaRisk?"⚠️ Quota Risk · Conserve":i.roles.length>0?`${i.roles.length} Assigned Roles`:"Model Fleet"})]}),i.quotaRisk?e.jsx("div",{className:"hs-advisor-quota-alert",role:"alert",children:e.jsxs("div",{className:"hs-advisor-quota-alert-head",children:[e.jsx("span",{className:"hs-advisor-quota-alert-badge",children:"⚠️ Quota Risk"}),e.jsxs("div",{children:[e.jsx("strong",{children:"High Quota Depletion · Conserve Model"}),e.jsxs("p",{children:[i.quota.providerLabel," allowance is near capacity (",i.quota.minimumRemainingPercent,"% remaining). Conserve this model for essential high-fit tasks."]})]})]})}):null,e.jsxs("div",{className:"hs-model-guide-roles",children:[e.jsx("strong",{children:"Assigned task roles"}),e.jsx("div",{className:"hs-model-guide-role-chips",children:i.roles.map(r=>e.jsx("span",{className:"hs-model-guide-role-chip",children:r.label},r.role))})]}),e.jsxs("div",{className:"hs-advisor-assessment",children:[e.jsxs("section",{children:[e.jsx("h5",{children:"Strengths & Cognitive Profile"}),e.jsx("p",{children:i.strengths.join(" ")})]}),e.jsxs("section",{children:[e.jsx("h5",{children:"Watchouts & Guardrails"}),e.jsx("p",{children:i.cautions.join(" ")})]})]}),e.jsxs("section",{className:"hs-advisor-dispatch",children:[e.jsx("h5",{children:"Direct dispatch"}),e.jsxs("div",{className:"hs-advisor-dispatch-snippet",children:[e.jsx("code",{children:o}),e.jsx(z,{text:o,label:"Copy command"})]})]}),e.jsxs("section",{className:"hs-advisor-quota-secondary",children:[e.jsxs("div",{className:"hs-advisor-quota-secondary-head",children:[e.jsxs("h5",{children:["Provider Telemetry ",i.quotaRisk?"(Active Constraint)":"(Secondary)"]}),e.jsxs("span",{children:[i.quota.providerLabel,i.quota.plan?` · ${i.quota.plan}`:""]})]}),e.jsxs("div",{className:"hs-advisor-quota-compact-bar",children:[e.jsxs("span",{children:["Allowance: ",e.jsx("strong",{children:oe(i.quota)})]}),e.jsxs("span",{children:["Pacing: ",e.jsx("strong",{children:U(i.quota.pacing)})]}),e.jsxs("span",{children:["Telemetry: ",e.jsx("strong",{children:i.quota.confidence})]}),i.quota.nextResetIn?e.jsxs("span",{children:["Next reset: ",e.jsx("strong",{children:i.quota.nextResetIn})]}):null]}),i.quotaRisk?e.jsx("div",{style:{marginTop:"var(--space-sm)"},children:e.jsx(le,{providerLabel:i.quota.providerLabel,quota:i.quota})}):null]})]})]})}function rs({assignments:s}){const[n,a]=m.useState("implementation"),[t,i]=m.useState({}),o=s.find(d=>d.role===n)??s[0];if(!o)return null;const r=[{label:o.modelLabel,route:o.route,capability:o.capability,taskRationale:o.taskRationale,quota:o.quota,quotaRisk:o.quotaRisk},...o.alternatives.map(d=>({label:d.label,route:d.route,capability:d.capability,taskRationale:d.taskRationale,quota:d.quota,quotaRisk:d.quotaRisk}))],c=t[o.role],l=c?c.flatMap(d=>{const p=r.find(x=>k(x.route)===d);return p?[p]:[]}):r,h=d=>{const p=l.map(x=>k(x.route));i(x=>({...x,[o.role]:[d,...p.filter(v=>v!==d)]}))},u=B(l[0].route);return e.jsxs("div",{className:"hs-cascade-layout",children:[e.jsx("nav",{className:"hs-advisor-roles","aria-label":"Cascade roles",children:s.map(d=>e.jsx(ce,{assignment:d,selected:d.role===o.role,onSelect:()=>a(d.role)},d.role))}),e.jsxs("article",{className:"hs-cascade-editor",children:[e.jsxs("header",{children:[e.jsxs("div",{children:[e.jsxs("span",{children:[o.roleLabel," · Failover Hierarchy"]}),e.jsx("h4",{children:"Task Escalation Sequence"}),e.jsx("p",{children:"Hierarchical fallback sequence when models encounter rate limits, timeouts, or task complexity thresholds."})]}),c?e.jsx("button",{type:"button",onClick:()=>i(d=>{const p={...d};return delete p[o.role],p}),children:"Reset suggested order"}):e.jsx("span",{children:"Default policy"})]}),e.jsx("ol",{className:"hs-cascade-workflow",children:l.map((d,p)=>{const x=k(d.route),v=p>0&&G(l[0],d),f=p===0?"Primary Route":p===1?"Secondary Fallback":"Tertiary Fallback",g=p===0?d.quotaRisk?`Initial target (⚠️ Quota Risk: ${d.quota.minimumRemainingPercent}% remaining) · ${d.taskRationale}`:`Initial execution target · ${d.taskRationale}`:p===1?v?`⭐️ Quota-safe route off ${l[0].quota.providerLabel} · ${d.taskRationale}`:`Triggered if primary encounters rate limits, errors, or complexity threshold · ${d.taskRationale}`:`Emergency baseline fallback · ${d.taskRationale}`;return e.jsxs("li",{className:"hs-cascade-node",children:[e.jsx("span",{className:"hs-cascade-node-index",children:p+1}),e.jsxs("div",{className:"hs-cascade-node-main",children:[e.jsx("span",{children:f}),e.jsx("strong",{children:d.label}),e.jsx("code",{children:A(d.route)}),e.jsx("p",{children:d.capability}),e.jsx("small",{children:g})]}),e.jsxs("div",{className:"hs-cascade-node-side",children:[e.jsx("em",{className:d.quotaRisk?"hs-advisor-tone--warn":"",children:d.quota.minimumRemainingPercent===null?"quota unknown":`${d.quota.minimumRemainingPercent}% quota remaining`}),p>0?e.jsx("button",{type:"button",onClick:()=>h(x),children:"Make primary"}):null]})]},`${o.role}:${x}`)})}),e.jsxs("section",{className:"hs-advisor-dispatch",children:[e.jsx("h5",{children:"Primary dispatch command"}),e.jsxs("div",{className:"hs-advisor-dispatch-snippet",children:[e.jsx("code",{children:u}),e.jsx(z,{text:u,label:"Copy primary command"})]})]})]})]})}function os({map:s,loading:n,bias:a,onBiasChange:t}){const[i,o]=m.useState("tasks"),r={tasks:"Task-first model routing: Map each role to the optimal cognitive profile and failover ladder.",models:"Model fleet inventory: Inspect cognitive strengths, guardrails, and assigned roles across all models.",cascades:"Failover & escalation rules: Review and customize the task escalation sequence for each role."};return e.jsxs("section",{className:"hs-advisor","aria-labelledby":"hs-orchestrator-map-title","aria-busy":n,children:[e.jsxs("div",{className:"hs-section-head hs-advisor-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-orchestrator-map-title",children:"Orchestrator map"}),e.jsx("p",{children:r[i]})]}),e.jsxs("div",{className:"hs-advisor-head-tools",children:[e.jsx("span",{className:"hs-section-meta",children:n?"refreshing inputs":"advisory · no dispatch"}),e.jsxs("label",{className:"hs-routing-bias",children:[e.jsx("span",{children:"Routing bias"}),e.jsx("input",{type:"range",min:0,max:M.length-1,step:1,value:M.findIndex(c=>c.value===a),"aria-valuetext":M.find(c=>c.value===a)?.label,onChange:c=>{const l=M[Number(c.target.value)];l&&t(l.value)}}),e.jsx("small",{"aria-hidden":"true",children:M.map(c=>e.jsx("i",{"data-active":c.value===a?"true":void 0,children:c.label},c.value))})]})]})]}),e.jsx("div",{className:"hs-routing-angles",role:"group","aria-label":"Orchestrator map angle",children:[["tasks","Task map"],["models","Model fleet"],["cascades","Cascades"]].map(([c,l])=>e.jsx("button",{type:"button","aria-pressed":i===c,onClick:()=>o(c),children:l},c))}),i==="tasks"?e.jsx(ns,{map:s}):null,i==="models"?e.jsx(is,{models:s.models}):null,i==="cascades"?e.jsx(rs,{assignments:s.assignments}):null]})}function ls({rows:s,loading:n,onImported:a}){const t=ie.map(l=>({provider:l,row:s.find(h=>h.id===l.id)??null})),i=t.filter(({row:l})=>l?.gauge).length,o=t.filter(({row:l})=>l?.gauge?.kind==="quota").length,r=t.filter(({row:l})=>l?.gauge?.kind==="quota"&&l.gauge.plan||l?.gauge?.kind==="status").length,c=t.flatMap(({row:l})=>l?.gauge?.kind==="quota"?I(l.gauge):[]).map(l=>l.resetAt).filter(l=>l>Date.now()).sort((l,h)=>l-h)[0];return e.jsxs("section",{className:"hs-subscriptions","aria-labelledby":"hs-subscriptions-title","aria-busy":n,children:[e.jsxs("div",{className:"hs-section-head hs-subscriptions-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-subscriptions-title",children:"Subscriptions"}),e.jsx("p",{children:"Plans, remaining allowance, reset windows, and the fastest path to each provider dashboard."})]}),e.jsxs("div",{className:"hs-subscription-summary","aria-label":"Subscription feed summary",children:[e.jsxs("span",{children:[e.jsx("strong",{children:n?"—":i})," detected"]}),e.jsxs("span",{children:[e.jsx("strong",{children:n?"—":o})," usage feeds"]}),e.jsxs("span",{children:[e.jsx("strong",{children:n?"—":r})," plans named"]}),e.jsxs("span",{children:[e.jsx("strong",{children:n?"—":c?H(c):"-"})," next reset"]})]})]}),e.jsx("div",{className:"hs-subscription-grid",children:t.map(({provider:l,row:h})=>{const u=h?.gauge??null,d=n&&!u,p=d?"loading":u?"connected":"missing",x=u?.kind==="quota"?u.plan:u?.kind==="status"?u.statusLabel:null,v=Xe(u),f=u?.kind==="quota"?"Usage connected":u?.kind==="status"?u.detailLabel||"Subscription detected":d?"Checking":"Not detected";return e.jsxs("article",{className:`hs-subscription-card hs-subscription-card--${p}`,children:[e.jsxs("header",{className:"hs-subscription-card-head",children:[e.jsxs("div",{className:"hs-subscription-provider",children:[e.jsx(L,{harness:l.id,size:18,title:null,className:"hs-subscription-mark"}),e.jsxs("div",{children:[e.jsx("h4",{children:P(l.id)}),e.jsx("span",{children:d?"Checking local plan…":x||"Plan not reported"})]})]}),e.jsx("span",{className:`hs-subscription-state hs-subscription-state--${p}`,children:f})]}),e.jsx("p",{className:"hs-subscription-description",children:l.description}),d?e.jsx(ss,{}):u?.kind==="quota"?e.jsx("div",{className:"hs-subscription-windows",children:I(u).map(g=>e.jsx(es,{gauge:u,window:g},`${l.id}:${g.label}`))}):u?.kind==="status"?e.jsxs("div",{className:"hs-subscription-status-detail",children:[e.jsx("strong",{children:u.statusLabel}),e.jsx("span",{children:u.detailLabel||"Subscription detected locally. Open the provider dashboard for live usage."})]}):e.jsxs("div",{className:"hs-subscription-missing",children:[e.jsx("strong",{children:"No local subscription feed yet"}),e.jsx("span",{children:"Open the provider locally, then refresh Scout."})]}),l.id==="cursor"||l.id==="grok"&&u?.kind!=="quota"?e.jsx(Ze,{provider:l.id,onImported:a}):null,e.jsxs("footer",{className:"hs-subscription-footer",children:[e.jsxs("span",{children:[d?"checking local feed":v?`updated ${J(v)||"now"}`:u?"detected locally":"waiting for provider data",u?.source?` · ${u.source}`:""]}),e.jsx("nav",{"aria-label":`${P(l.id)} quick links`,children:l.links.map(g=>e.jsxs("a",{href:g.href,target:"_blank",rel:"noreferrer",children:[g.label,e.jsx(Y,{size:11,"aria-hidden":"true"})]},g.href))})]})]},l.id)})})]})}function cs({accounts:s,loading:n}){return s.length===0&&!n?null:e.jsxs("section",{className:"hs-cloud-accounts","aria-labelledby":"hs-cloud-accounts-title","aria-busy":n,children:[e.jsxs("div",{className:"hs-section-head hs-cloud-accounts-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-cloud-accounts-title",children:"Cloud accounts"}),e.jsx("p",{children:"Infrastructure available to Scout for deployment and agent compute."})]}),e.jsx("span",{className:"hs-section-meta",children:n?"checking accounts":`${s.length} connected`})]}),e.jsxs("div",{className:"hs-cloud-grid",children:[n&&s.length===0?Array.from({length:3},(a,t)=>e.jsxs("article",{className:"hs-cloud-card hs-cloud-card--loading","aria-hidden":"true",children:[e.jsxs("header",{className:"hs-cloud-card-head",children:[e.jsx("span",{className:"hs-loading-mark"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-title"})]}),e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-copy"}),e.jsxs("footer",{className:"hs-cloud-card-footer",children:[e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-meta"}),e.jsx("span",{className:"hs-loading-actions"})]})]},t)):null,s.map(a=>{const t=ze[a.id];return e.jsxs("article",{className:"hs-cloud-card",children:[e.jsxs("header",{className:"hs-cloud-card-head",children:[e.jsxs("div",{className:"hs-cloud-identity",children:[e.jsx(Qe,{provider:a.id}),e.jsxs("div",{children:[e.jsx("span",{className:"hs-cloud-category",children:t.category}),e.jsx("h4",{children:a.label})]})]}),e.jsx("span",{className:"hs-subscription-state hs-subscription-state--connected",children:a.statusLabel})]}),e.jsx("p",{className:"hs-cloud-description",children:t.description}),e.jsxs("footer",{className:"hs-cloud-card-footer",children:[e.jsxs("span",{className:"hs-cloud-connection",children:[e.jsx("span",{className:"hs-cloud-dot","aria-hidden":"true"}),a.detailLabel]}),e.jsx("nav",{"aria-label":`${a.label} quick links`,children:He[a.id].map(i=>e.jsxs("a",{href:i.href,target:"_blank",rel:"noreferrer",children:[i.label,e.jsx(Y,{size:11,"aria-hidden":"true"})]},i.href))})]})]},a.id)})]})]})}function oa({navigate:s}){const{route:n}=ge(),a=fe(n),[t]=m.useState(()=>me("/api/service-budgets",Ge)),[i,o]=m.useState(t?.gauges??[]),[r,c]=m.useState(t?.cloudAccounts??[]),[l,h]=m.useState("budget"),[u,d]=m.useState(()=>S(t?.generatedAt)??Date.now()),[p,x]=m.useState("balanced"),[v,f]=m.useState(t===null),[g,q]=m.useState(!1),[T,Q]=m.useState(null),_=m.useRef(0),W=m.useRef(t!==null),R=m.useCallback(async(y=!1,C=!1)=>{const E=++_.current;C&&!W.current&&f(!0),q(!0),Q(null);try{const w=await Z(`/api/service-budgets${y?"?refresh=1":""}`);if(E!==_.current)return;W.current=!0,o(w.gauges??[]),d(S(w.generatedAt)??Date.now()),c(w.cloudAccounts??[])}catch(w){E===_.current&&Q(w instanceof Error?w.message:String(w))}finally{E===_.current&&(f(!1),q(!1))}},[]);m.useEffect(()=>{let y=!1,C;return R(!1,!0).then(()=>{y||(C=window.setTimeout(()=>{R(!0)},600))}),()=>{y=!0,C!==void 0&&window.clearTimeout(C)}},[R]),m.useEffect(()=>{const y=window.setInterval(()=>{R(!1)},3e4);return()=>window.clearInterval(y)},[R]);const de=m.useMemo(()=>Je(i),[i]),ue=m.useMemo(()=>{const y=Date.now();return we(as(i,u,y),{now:y,bias:p})},[u,p,i]),he=xe();return e.jsxs("div",{className:"s-ops",children:[he?e.jsx("div",{className:"s-ops-header",children:e.jsx(be,{activeRoute:{view:"harnesses",...a?{machineId:a}:{}},navigate:s})}):null,e.jsx("div",{className:"s-ops-body hs-body",children:e.jsxs("div",{className:"hs-page",children:[e.jsxs("header",{className:"hs-page-head",children:[e.jsxs("div",{className:"hs-title-group",children:[e.jsx("span",{className:"hs-kicker",children:"ops / provider central"}),e.jsx("h2",{children:"Agent Providers"}),e.jsx("p",{children:l==="budget"?"See what you pay for, how much remains, and where to use it.":"Map each kind of work to a model and provider route using live quota posture."})]}),e.jsxs("div",{className:"hs-page-actions",children:[e.jsxs("div",{className:"hs-view-switch",role:"group","aria-label":"Provider view",children:[e.jsx("button",{type:"button","aria-pressed":l==="budget",onClick:()=>h("budget"),children:"Budget"}),e.jsx("button",{type:"button","aria-pressed":l==="routing",onClick:()=>h("routing"),children:"Routing"})]}),e.jsxs("button",{type:"button",className:"hs-refresh",disabled:g,onClick:()=>{R(!0)},children:[e.jsx(ve,{size:14,className:g?"hs-refresh-icon-spinning":"","aria-hidden":"true"}),e.jsx("span",{children:g?"Refreshing":"Refresh"})]})]})]}),T&&e.jsxs("div",{className:"hs-error",role:"status","aria-live":"polite",children:["refresh: ",T]}),l==="budget"?e.jsxs("div",{id:"hs-budget-view",className:"hs-provider-view",children:[e.jsx(ls,{rows:de,loading:v,onImported:()=>R(!1)}),e.jsx(cs,{accounts:r,loading:v})]}):e.jsx("div",{id:"hs-routing-view",className:"hs-provider-view",children:e.jsx(os,{map:ue,loading:v,bias:p,onBiasChange:x})})]})})]})}export{oa as HarnessesScreen};
@@ -1,4 +1,4 @@
1
- import{r as d,j as e}from"./index-BI9AljSD.js";import{L as K,u as X}from"./chunk-YOZR3KYS-DN5EJulq.js";import{c as Q}from"./clipboard-e3fSpeo7.js";import{e as A}from"./terminal-sessions-BQ6t92tJ.js";import{a as C}from"./api-Co9aQ2Jw.js";import{H as D}from"./HarnessMark-DAaWPiT_.js";import{T as H}from"./terminal-C3YRPfyz.js";import{R as V}from"./refresh-cw-DmNAhaH0.js";import{C as Z}from"./check-DbIkldnK.js";import{C as ee}from"./copy-Cj-owMb-.js";import{E as G}from"./eye-FnaaPfja.js";import{c as te}from"./createLucideIcon-DthwWQIg.js";import{X as se}from"./x-DfRJbqrh.js";const ne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],J=te("crosshair",ne);async function re(){return C("/api/terminal-hosts")}async function ae(t,s){return C(`/api/terminal-hosts/${encodeURIComponent(t)}/sessions`,{method:"POST",body:JSON.stringify(s)})}let $=null,O=null;function ie(){return $?Promise.resolve($):(O??=re().then(t=>($=t,t)).finally(()=>{O=null}),O)}function Ae(){const[t,s]=d.useState($);return d.useEffect(()=>{if(t)return;let n=!1;return ie().then(a=>{n||s(a)}).catch(()=>{}),()=>{n=!0}},[t]),{hosts:t?.hosts??[],preferredHostId:t?.preferredHostId??null,loaded:t!==null}}async function le(t){return(await C(`/api/terminal-hosts/herdr/sessions/${encodeURIComponent(t)}/topology`)).topology}async function F(t,s){await C(`/api/terminal-hosts/herdr/sessions/${encodeURIComponent(t)}/focus`,{method:"POST",body:JSON.stringify({target:s})})}async function Y(t,s,n=48){const a=new URLSearchParams({backend:"herdr",sessionName:t,paneId:s,lines:String(n)}),i=await C(`/api/terminal-sessions/peek?${a.toString()}`);return i.available?{body:i.body,reason:null}:{body:null,reason:i.reason??"No preview available."}}const oe=3e3;function ce(t,s,n={}){const a=n.enabled??!0,i=n.lines??48,c=n.pollMs??oe,[p,m]=d.useState(null),[u,o]=d.useState(0);return d.useEffect(()=>{if(!t||!s||!a)return;let l=!1;m(null);const b=()=>{Y(t,s,i).then(h=>{l||m(h)}).catch(h=>{if(l)return;const r=h instanceof Error?h.message:String(h);m(g=>({body:g?.body??null,reason:r}))})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},c);return()=>{l=!0,window.clearInterval(j)}},[t,s,i,a,c,u]),{body:p?.body??null,reason:p?.reason??null,loading:p===null,refresh:()=>o(l=>l+1)}}const de=15e3;function ue(t,s,n={}){const a=n.enabled??!0,i=n.lines??6,c=n.pollMs??de,[p,m]=d.useState({}),u=s.join(`
1
+ import{r as d,j as e}from"./index-C1VaWNuD.js";import{L as K,u as X}from"./chunk-YOZR3KYS-CrCgXw9l.js";import{c as Q}from"./clipboard-e3fSpeo7.js";import{e as A}from"./terminal-sessions-Bdt2W3Y4.js";import{a as C}from"./api-Co9aQ2Jw.js";import{H as D}from"./HarnessMark-DttReffF.js";import{T as H}from"./terminal-UDy4lzV1.js";import{R as V}from"./refresh-cw-Bkh7Cvnd.js";import{C as Z}from"./check-Dz2SRHft.js";import{C as ee}from"./copy-BzdzWsQd.js";import{E as G}from"./eye-C9cGk5z6.js";import{c as te}from"./createLucideIcon-Dv8H8m7J.js";import{X as se}from"./x-DgmmnPKt.js";const ne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],J=te("crosshair",ne);async function re(){return C("/api/terminal-hosts")}async function ae(t,s){return C(`/api/terminal-hosts/${encodeURIComponent(t)}/sessions`,{method:"POST",body:JSON.stringify(s)})}let $=null,O=null;function ie(){return $?Promise.resolve($):(O??=re().then(t=>($=t,t)).finally(()=>{O=null}),O)}function Ae(){const[t,s]=d.useState($);return d.useEffect(()=>{if(t)return;let n=!1;return ie().then(a=>{n||s(a)}).catch(()=>{}),()=>{n=!0}},[t]),{hosts:t?.hosts??[],preferredHostId:t?.preferredHostId??null,loaded:t!==null}}async function le(t){return(await C(`/api/terminal-hosts/herdr/sessions/${encodeURIComponent(t)}/topology`)).topology}async function F(t,s){await C(`/api/terminal-hosts/herdr/sessions/${encodeURIComponent(t)}/focus`,{method:"POST",body:JSON.stringify({target:s})})}async function Y(t,s,n=48){const a=new URLSearchParams({backend:"herdr",sessionName:t,paneId:s,lines:String(n)}),i=await C(`/api/terminal-sessions/peek?${a.toString()}`);return i.available?{body:i.body,reason:null}:{body:null,reason:i.reason??"No preview available."}}const oe=3e3;function ce(t,s,n={}){const a=n.enabled??!0,i=n.lines??48,c=n.pollMs??oe,[p,m]=d.useState(null),[u,o]=d.useState(0);return d.useEffect(()=>{if(!t||!s||!a)return;let l=!1;m(null);const b=()=>{Y(t,s,i).then(h=>{l||m(h)}).catch(h=>{if(l)return;const r=h instanceof Error?h.message:String(h);m(g=>({body:g?.body??null,reason:r}))})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},c);return()=>{l=!0,window.clearInterval(j)}},[t,s,i,a,c,u]),{body:p?.body??null,reason:p?.reason??null,loading:p===null,refresh:()=>o(l=>l+1)}}const de=15e3;function ue(t,s,n={}){const a=n.enabled??!0,i=n.lines??6,c=n.pollMs??de,[p,m]=d.useState({}),u=s.join(`
2
2
  `);return d.useEffect(()=>{const o=u?u.split(`
3
3
  `):[];if(!t||!a||o.length===0)return;let l=!1;const b=()=>{Promise.all(o.map(async h=>{try{const r=await Y(t,h,i);return[h,r.body]}catch{return[h,void 0]}})).then(h=>{l||m(r=>{const g={};for(const[S,k]of h)g[S]=k===void 0?r[S]??null:k;return g})})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},c);return()=>{l=!0,window.clearInterval(j)}},[t,u,i,a,c]),p}const he=3e3;function pe(t,s={}){const n=s.enabled??!0,a=s.pollMs??he,[i,c]=d.useState(null),[p,m]=d.useState(null),[u,o]=d.useState(0);return d.useEffect(()=>{if(!t||!n)return;let l=!1;const b=()=>{le(t).then(h=>{l||(c(h),m(null))}).catch(h=>{l||m(h instanceof Error?h.message:String(h))})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},a);return()=>{l=!0,window.clearInterval(j)}},[t,n,a,u]),{topology:i,error:p,refresh:()=>o(l=>l+1)}}const me={column:"status",direction:"desc"},z=[{id:"pane",label:"Pane",initialDirection:"asc"},{id:"harness",label:"Harness",initialDirection:"asc"},{id:"status",label:"Status",initialDirection:"desc"},{id:"directory",label:"Directory",initialDirection:"asc"},{id:"tab",label:"Tab",initialDirection:"asc"},{id:"drift",label:"Drift",initialDirection:"desc"},{id:"output",label:"Last output",initialDirection:"asc"}];function U(t){switch(t){case"working":return 4;case"blocked":return 3;case"idle":return 2;case"done":return 1;case"unknown":return 0}}function T(t){return t.label??t.paneId}function M(t){return t.foregroundCwd??t.cwd??""}function R(t){return t.scroll?.offsetFromBottom??null}function L(t){if(!t)return null;const n=t.replace(/\x1b\[[0-9;?]*[ -/]*[@-~]/g,"").split(`
4
4
  `);for(let a=n.length-1;a>=0;a-=1){const i=n[a].trim();if(i)return i}return null}function N(t,s){return t.localeCompare(s,void 0,{numeric:!0,sensitivity:"base"})}function be(t,s){const n=s.direction==="asc"?1:-1;return[...t].sort((a,i)=>{const c=fe(a,i,s.column);if(c!==0)return c;const p=xe(a,i,s.column)*n;return p!==0?p:N(T(a.pane),T(i.pane))})}function fe(t,s,n){const a=p=>n==="drift"?R(p.pane):n==="output"?L(p.output):!0,i=a(t),c=a(s);return i===null&&c===null?0:i===null?1:c===null?-1:0}function xe(t,s,n){switch(n){case"pane":return N(T(t.pane),T(s.pane));case"harness":return N(t.pane.agent??"",s.pane.agent??"");case"status":return U(t.pane.agentStatus)-U(s.pane.agentStatus);case"directory":return N(M(t.pane),M(s.pane));case"tab":return N(t.tabLabel,s.tabLabel);case"drift":return B(R(t.pane),R(s.pane));case"output":return B(L(t.output),L(s.output))}}function B(t,s){return t===null&&s===null?0:t===null?-1:s===null?1:typeof t=="string"&&typeof s=="string"?N(t,s):Number(t)-Number(s)}function je(t,s){if(t.column===s)return{column:s,direction:t.direction==="asc"?"desc":"asc"};const n=z.find(a=>a.id===s)?.initialDirection??"asc";return{column:s,direction:n}}const ye="openscout.herdr.pane-table-sort.v1";function W(t){return{view:"terminal",terminalBackend:"herdr",terminalAgent:"shell",terminalTabId:`herdr-${t}`,terminalSessionName:t}}function ge({sessionName:t,navigate:s}){const{topology:n,error:a,refresh:i}=pe(t),[c,p]=d.useState(null),[m,u]=d.useState(null),[o,l]=d.useState("idle"),[b,j]=d.useState(null),h=t==="default"?"herdr":`herdr session attach ${t}`,r=n?.running??!1,g=d.useCallback(()=>{l("starting"),j(null),ae("herdr",{sessionName:t}).then(()=>{l("idle"),i()}).catch(y=>{l("failed"),j(y instanceof Error?y.message:String(y))})},[t,i]),S=d.useCallback(()=>{s(W(t))},[s,t]),k=d.useCallback(y=>{F(t,y.terminalId??y.paneId).catch(()=>{}),s(W(t))},[s,t]);return e.jsxs("div",{className:"s-term s-herdr",children:[e.jsxs("header",{className:"s-herdr-header",children:[e.jsxs("div",{className:"s-herdr-title",children:[e.jsx("span",{className:"s-herdr-mark",children:e.jsx(H,{size:16,strokeWidth:1.8})}),e.jsx("strong",{children:t}),e.jsx("span",{className:`s-herdr-state ${r?"s-herdr-state--live":""}`,children:n?r?"running":"stopped":"loading"})]}),e.jsxs("div",{className:"s-herdr-actions",children:[r&&e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:S,title:"Open a live web terminal attached to this session",children:[e.jsx(K,{size:13,strokeWidth:1.8}),"Open terminal"]}),e.jsx(we,{command:h}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:i,title:"Refresh","aria-label":"Refresh",children:e.jsx(V,{size:14,strokeWidth:1.8})})]})]}),a&&e.jsx("div",{className:"s-herdr-error",children:a}),n&&!r&&e.jsxs("div",{className:"s-herdr-empty",children:[e.jsx(H,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:"This herdr session is stopped."}),e.jsx("span",{children:"The session still exists — herdr sessions are persistent. Start it and the projection fills in."}),e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:g,disabled:o==="starting",children:o==="starting"?"Starting…":"Start it"}),b&&e.jsx("code",{children:b})]}),n&&r&&n.workspaces.length===0&&e.jsxs("div",{className:"s-herdr-empty",children:[e.jsx(H,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:"No workspaces yet."}),e.jsx("span",{children:"Open this session in herdr to create one — layout is herdr's job, Scout just watches."})]}),n&&r&&n.workspaces.length>0&&(()=>{const y=n.workspaces.flatMap(f=>f.tabs.map(x=>({workspace:f,tab:x})));if(y.length===0)return null;const v=n.workspaces.find(f=>f.focused)?.activeTabId??n.workspaces[0]?.activeTabId??null,E=y.find(f=>f.tab.tabId===c)??y.find(f=>f.tab.tabId===v)??y[0],{workspace:w,tab:I}=E,q=f=>{p(f),u(null)};return e.jsxs("section",{className:"s-herdr-workspace",children:[e.jsxs("div",{className:"s-herdr-workspace-head",children:[e.jsx("span",{className:"s-herdr-workspace-label",children:w.label??w.workspaceId}),e.jsx(_,{status:w.agentStatus})]}),e.jsx("div",{className:"s-herdr-tabs",role:"tablist",children:y.map(({workspace:f,tab:x})=>e.jsxs("button",{type:"button",role:"tab","aria-selected":x.tabId===I.tabId,className:`s-herdr-tab ${x.tabId===I.tabId?"s-herdr-tab--active":""}`,title:`${f.label??f.workspaceId} · ${x.label??x.tabId}`,onClick:()=>q(x.tabId),children:[e.jsx(P,{status:x.agentStatus}),e.jsx("span",{children:x.label??`Tab ${x.number??""}`}),e.jsx(Ne,{tab:x}),e.jsx("span",{className:"s-herdr-tab-count",children:x.panes.length})]},x.tabId))}),I.layout&&e.jsx(ke,{tab:I,diveInPaneId:m,onEnterPane:k,onToggleDiveIn:f=>u(x=>x===f?null:f)}),e.jsx(ve,{sessionName:t,tab:I,onEnterPane:k}),m&&(()=>{const f=I.panes.find(x=>x.paneId===m);return f?e.jsx(Se,{sessionName:t,pane:f,onClose:()=>u(null)}):null})()]})})()]})}function ke({tab:t,diveInPaneId:s,onEnterPane:n,onToggleDiveIn:a}){const i=t.layout;if(!i)return null;const{area:c}=i,p=new Map(t.panes.map(u=>[u.paneId,u])),m=`${c.width} / ${Math.max(c.height*2,1)}`;return e.jsxs("div",{className:"s-herdr-layout-window",children:[e.jsxs("div",{className:"s-herdr-layout-titlebar",children:[e.jsxs("span",{className:"s-herdr-layout-lights","aria-hidden":"true",children:[e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsxs("span",{className:"s-herdr-layout-title",children:[t.label??`Tab ${t.number??""}`," — ",i.panes.length," ",i.panes.length===1?"pane":"panes"]}),e.jsx("span",{className:"s-herdr-layout-hint",children:"click a pane to enter"})]}),e.jsx("div",{className:"s-herdr-layout",style:{aspectRatio:m},role:"group","aria-label":`Layout of ${t.label??t.tabId}`,children:i.panes.map(u=>{const o=p.get(u.paneId),{rect:l}=u,b={left:`${(l.x-c.x)/c.width*100}%`,top:`${(l.y-c.y)/c.height*100}%`,width:`${l.width/c.width*100}%`,height:`${l.height/c.height*100}%`},j=o?.paneId===s;return e.jsxs("div",{role:"button",tabIndex:0,className:`s-herdr-layout-pane ${u.focused?"s-herdr-layout-pane--focused":""}`,style:b,onClick:()=>o&&n(o),onKeyDown:h=>{o&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),n(o))},title:o?`Enter ${o.label??o.paneId} — focus it and open the web terminal`:u.paneId,children:[e.jsxs("span",{className:"s-herdr-layout-pane-head",children:[o&&e.jsx(P,{status:o.agentStatus}),o?.agent&&e.jsx(D,{harness:o.agent,size:12,className:"s-herdr-agent-mark"}),e.jsx("strong",{className:"s-herdr-pane-label",children:o?.label??u.paneId})]}),o?.foregroundCwd&&e.jsx("span",{className:"s-herdr-cwd",children:A(o.foregroundCwd)}),o&&e.jsx("button",{type:"button",className:`s-herdr-layout-pane-peek ${j?"s-herdr-layout-pane-peek--active":""}`,onClick:h=>{h.stopPropagation(),a(o.paneId)},title:j?"Close the live view":"Watch this pane live","aria-label":j?"Close the live view":"Watch this pane live","aria-pressed":j,children:e.jsx(G,{size:13,strokeWidth:1.8})})]},u.paneId)})})]})}function ve({sessionName:t,tab:s,onEnterPane:n}){const[a,i]=X(ye,me),[c,p]=d.useState(null),[m,u]=d.useState(null),o=d.useMemo(()=>s.panes.map(r=>r.paneId),[s.panes]),l=ue(t,o,{lines:6}),b=s.label??`Tab ${s.number??""}`,j=d.useMemo(()=>be(s.panes.map(r=>({pane:r,tabLabel:b,output:l[r.paneId]??null})),a),[s.panes,b,l,a]),h=d.useCallback(r=>{u(null),F(t,r.terminalId??r.paneId).catch(g=>u(g instanceof Error?g.message:String(g)))},[t]);return e.jsxs("div",{className:"s-herdr-table-wrap",children:[e.jsxs("table",{className:"s-herdr-table","aria-label":`Panes of ${b}`,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[z.map(r=>e.jsx("th",{scope:"col","aria-sort":a.column===r.id?a.direction==="asc"?"ascending":"descending":"none",children:e.jsxs("button",{type:"button",onClick:()=>i(je(a,r.id)),children:[e.jsx("span",{children:r.label}),e.jsx("em",{"aria-hidden":"true",children:a.column===r.id?a.direction==="asc"?"▲":"▼":"·"})]})},r.id)),e.jsx("th",{scope:"col","aria-label":"Actions"})]})}),e.jsx("tbody",{children:j.map(({pane:r,tabLabel:g,output:S})=>{const k=r.paneId===c,y=L(S),v=R(r),E=M(r);return e.jsxs(d.Fragment,{children:[e.jsxs("tr",{className:r.focused?"is-focused":void 0,onClick:()=>n(r),title:`Enter ${T(r)} — focus it and open the web terminal`,children:[e.jsxs("td",{className:"s-herdr-table-pane",children:[e.jsx(P,{status:r.agentStatus}),e.jsx("strong",{title:r.paneId,children:T(r)}),r.focused&&e.jsx("span",{className:"s-herdr-focused",children:"focused in herdr"})]}),e.jsx("td",{className:"s-herdr-table-harness",children:r.agent?e.jsx("span",{title:r.agent,className:"s-herdr-table-harness-mark",children:e.jsx(D,{harness:r.agent,size:13,className:"s-herdr-agent-mark"})}):e.jsx("span",{title:"shell — no agent running",className:"s-herdr-table-harness-mark",children:e.jsx(H,{size:12,strokeWidth:1.8})})}),e.jsx("td",{children:r.agentStatus==="unknown"?"—":e.jsx(_,{status:r.agentStatus})}),e.jsx("td",{className:"s-herdr-table-dir",title:E||void 0,children:E?A(E):"—"}),e.jsx("td",{children:g}),e.jsx("td",{className:"s-herdr-table-drift",title:v===null?void 0:v===0?"Pinned to live output":`Scrolled up ${v} ${v===1?"line":"lines"} from the live edge`,children:v===null?"—":v===0?"live":`↑${v}`}),e.jsx("td",{className:"s-herdr-table-output",title:y??void 0,children:y??"—"}),e.jsxs("td",{className:"s-herdr-table-actions",children:[e.jsx("button",{type:"button",className:`s-term-icon-button${k?" is-active":""}`,onClick:w=>{w.stopPropagation(),p(I=>I===r.paneId?null:r.paneId)},title:k?"Hide the pane's last lines":"Show the pane's last lines","aria-label":k?"Hide the pane's last lines":"Show the pane's last lines","aria-pressed":k,children:e.jsx(G,{size:13,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:w=>{w.stopPropagation(),h(r)},title:"Focus this pane in the herdr client","aria-label":"Focus this pane in the herdr client",children:e.jsx(J,{size:13,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:w=>{w.stopPropagation(),n(r)},title:"Enter — focus it and open the web terminal","aria-label":"Enter — focus it and open the web terminal",children:e.jsx(K,{size:13,strokeWidth:1.8})})]})]}),k&&e.jsx("tr",{className:"s-herdr-table-expand",children:e.jsx("td",{colSpan:z.length+1,children:S?e.jsx("pre",{children:S}):e.jsx("span",{className:"s-herdr-peek-reason",children:"No output captured yet."})})})]},r.paneId)})})]}),m&&e.jsx("div",{className:"s-herdr-error",children:m})]})}function we({command:t}){const[s,n]=d.useState(!1);return e.jsxs("button",{type:"button",className:"s-herdr-attach",title:"Copy attach command — open this session in the herdr client",onClick:()=>{Q(t).then(()=>{n(!0),window.setTimeout(()=>n(!1),1500)})},children:[s?e.jsx(Z,{size:13,strokeWidth:2}):e.jsx(ee,{size:13,strokeWidth:1.8}),e.jsx("code",{children:t})]})}function Se({sessionName:t,pane:s,onClose:n}){const{body:a,reason:i,loading:c,refresh:p}=ce(t,s.paneId,{lines:48}),[m,u]=d.useState(null);d.useEffect(()=>{const l=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[n]);const o=d.useCallback(()=>{u(null),F(t,s.terminalId??s.paneId).catch(l=>u(l instanceof Error?l.message:String(l)))},[t,s.terminalId,s.paneId]);return e.jsx("div",{className:"s-herdr-lightbox",onClick:n,role:"presentation",children:e.jsxs("section",{className:"s-herdr-live","aria-label":`Live view of ${s.label??s.paneId}`,onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"s-herdr-live-head",children:[e.jsx(P,{status:s.agentStatus}),s.agent&&e.jsx(D,{harness:s.agent,size:13,className:"s-herdr-agent-mark"}),e.jsx("strong",{className:"s-herdr-pane-label",children:s.label??s.paneId}),e.jsx(_,{status:s.agentStatus}),s.foregroundCwd&&e.jsx("span",{className:"s-herdr-cwd",children:A(s.foregroundCwd)}),e.jsx("span",{className:"s-herdr-pane-spacer"}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:o,title:"Focus this pane in the herdr client","aria-label":"Focus this pane in the herdr client",children:e.jsx(J,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:p,title:"Refresh now","aria-label":"Refresh now",children:e.jsx(V,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:n,title:"Close the live view (Esc)","aria-label":"Close the live view",children:e.jsx(se,{size:14,strokeWidth:1.8})})]}),e.jsx("div",{className:"s-herdr-live-body",children:a!==null?e.jsx("pre",{children:a}):c?e.jsx("span",{className:"s-herdr-peek-reason",children:"Loading…"}):e.jsx("span",{className:"s-herdr-peek-reason",children:i??"No preview available."})}),m&&e.jsx("div",{className:"s-herdr-error",children:m})]})})}function Ie(t){return t}function P({status:t}){return e.jsx("span",{className:`s-herdr-dot s-herdr-dot--${t}`,"aria-hidden":"true"})}function _({status:t}){return t==="unknown"?null:e.jsx("span",{className:`s-herdr-badge s-herdr-badge--${t}`,children:t})}function Ne({tab:t}){const s=[...new Set(t.panes.map(n=>n.agent).filter(n=>!!n))].slice(0,4);return s.length===0?null:e.jsx("span",{className:"s-herdr-tab-marks",children:s.map(n=>e.jsx(D,{harness:n,size:11,className:"s-herdr-agent-mark"},n))})}function Te(t){return{label:t.label??`Tab ${t.number??""}`,statuses:t.panes.map(s=>s.agentStatus)}}const Fe=Object.freeze(Object.defineProperty({__proto__:null,AgentStatusBadge:_,AgentStatusDot:P,HerdrSessionScreen:ge,herdrAgentStatusLabel:Ie,herdrTabSummary:Te,herdrTerminalRoute:W},Symbol.toStringTag,{value:"Module"}));export{P as A,ge as H,pe as a,Te as b,ae as c,Fe as d,W as h,Ae as u};