@openscout/scout 0.2.78 → 0.2.80

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 (428) hide show
  1. package/README.md +19 -0
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/ActivityScreen-BXm6nJ6L.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-DMnobKch.js → AddProjectForm-CtEiLQnm.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-D90c1Rzk.js → AgentAvatar-CszU5eaU.js} +1 -1
  7. package/dist/client/assets/AgentConfigurationScreen-CfBXxrsD.js +1 -0
  8. package/dist/client/assets/AgentDefinitionsWorkspace-4Z0aN8AR.js +1 -0
  9. package/dist/client/assets/{AgentDetailCard-BcRBRp88.js → AgentDetailCard-sZuHl1de.js} +1 -1
  10. package/dist/client/assets/AgentFloorView-DMivAYHU.js +1 -0
  11. package/dist/client/assets/AgentInfoScreen-CPkLg1pK.js +1 -0
  12. package/dist/client/assets/{AgentLaneCard-RrNnDZu8.js → AgentLaneCard-nB68f2CI.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-D9ZwUKrl.js → AgentLaneChrome-O9Yf0uR-.js} +1 -1
  14. package/dist/client/assets/AgentLaneDetailSheet-BfhpaEQ3.js +4 -0
  15. package/dist/client/assets/{AgentLaneSummaryResize-BhFmGNzT.js → AgentLaneSummaryResize-Ct3b0TQR.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-CjHMvy3v.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-eSAoDsPi.js → AgentLanesPreflight-DNGvZvjd.js} +1 -1
  18. package/dist/client/assets/AgentLanesView-DqRK5-d2.js +2 -0
  19. package/dist/client/assets/{AgentLiveActions-DBtnD0qE.js → AgentLiveActions-DI4ooSHW.js} +1 -1
  20. package/dist/client/assets/{AgentSessions-DyqOf4nG.js → AgentSessions-BxWIPkWh.js} +2 -2
  21. package/dist/client/assets/AgentsConsole-D6VHSCfZ.js +1 -0
  22. package/dist/client/assets/AgentsScreen-zR6b2bUL.js +1 -0
  23. package/dist/client/assets/AgentsSubnav-q0xcZi6C.js +1 -0
  24. package/dist/client/assets/{AtopView-BCkae3e1.js → AtopView-VZkk40v0.js} +1 -1
  25. package/dist/client/assets/BackToPicker-DZg_4nHL.js +1 -0
  26. package/dist/client/assets/{BriefingDetailScreen-BwFyysT8.js → BriefingDetailScreen-BZU4qMwE.js} +1 -1
  27. package/dist/client/assets/{BriefingsScreen-BQEevztH.js → BriefingsScreen-Bfc3tqPp.js} +1 -1
  28. package/dist/client/assets/{BrokerMetadataPanel-7UjcuNjd.js → BrokerMetadataPanel-CaFe6kdh.js} +1 -1
  29. package/dist/client/assets/BrokerScreen-Chh8sGen.js +5 -0
  30. package/dist/client/assets/{ChatCollapsedStrip-CQSYSd8s.js → ChatCollapsedStrip-Cov54p9V.js} +1 -1
  31. package/dist/client/assets/CodeDiffPane-C1ebFt-Y.js +1 -0
  32. package/dist/client/assets/{CodeProjectPicker-DqKFCpLU.js → CodeProjectPicker-tsCly-f3.js} +1 -1
  33. package/dist/client/assets/CodeScreen-D0hpZNLP.js +1 -0
  34. package/dist/client/assets/{ContextMenu-bARZqTzD.js → ContextMenu-N-Z6X0Z1.js} +1 -1
  35. package/dist/client/assets/ConversationComposer-CiEF7dhd.js +1 -0
  36. package/dist/client/assets/ConversationFeedRows-5it6QNBV.js +1 -0
  37. package/dist/client/assets/ConversationHeader-BGgbITvr.js +1 -0
  38. package/dist/client/assets/ConversationPanels-vI9YuQJh.js +2 -0
  39. package/dist/client/assets/ConversationScreen-C-PrCRz1.js +1 -0
  40. package/dist/client/assets/ConversationScreen-yIKEsm-8.css +1 -0
  41. package/dist/client/assets/ConversationStatus-COEj5loj.js +1 -0
  42. package/dist/client/assets/{DataTable-E8s_MmoA.js → DataTable-BoofV-_4.js} +1 -1
  43. package/dist/client/assets/{DispatchAftermath-Dpe88DFX.js → DispatchAftermath-OXYlMbT1.js} +1 -1
  44. package/dist/client/assets/{DocumentFocusViewer-BeVwwl26.js → DocumentFocusViewer-BCG2kOmd.js} +1 -1
  45. package/dist/client/assets/{EmbeddableSurfacesLab-BQqFQVnI.js → EmbeddableSurfacesLab-C2SZvrHJ.js} +1 -1
  46. package/dist/client/assets/{EmptyState-4F9XDFQm.js → EmptyState-DypEjx0V.js} +1 -1
  47. package/dist/client/assets/{FileViewerPane-CLgUhSm4.js → FileViewerPane-CXCq-oKj.js} +1 -1
  48. package/dist/client/assets/{FleetSearch-Dz5euQJe.js → FleetSearch-Dj7-CfNi.js} +1 -1
  49. package/dist/client/assets/FlightObserveScreen-Yq5NtQQJ.js +1 -0
  50. package/dist/client/assets/FollowScreen-DRgYuAvp.js +1 -0
  51. package/dist/client/assets/HarnessMark-BE-YSyci.js +1 -0
  52. package/dist/client/assets/HarnessesScreen-L-emPcXd.js +1 -0
  53. package/dist/client/assets/HerdrSession-DKFCJMst.js +4 -0
  54. package/dist/client/assets/{HomeHero-B3uYd-pP.js → HomeHero-CAEg8Yg5.js} +1 -1
  55. package/dist/client/assets/KnowledgeSearchInspector-C2EZsQ5i.js +1 -0
  56. package/dist/client/assets/KnowledgeSearchScreen-DvdOFh-b.js +1 -0
  57. package/dist/client/assets/{LaneToolHoverCard-Bla0gBdm.js → LaneToolHoverCard-DrPXYZvQ.js} +1 -1
  58. package/dist/client/assets/LaneTraceDetailSheet-Dl7foF88.js +1 -0
  59. package/dist/client/assets/{LaneTraceEventFocus-BF9ERP5O.js → LaneTraceEventFocus-X4-DDFEo.js} +1 -1
  60. package/dist/client/assets/{MeshCanvas-DFEPkpqY.js → MeshCanvas-rtCBD7s6.js} +2 -2
  61. package/dist/client/assets/{MeshCanvasMinimap-CyVFYixr.js → MeshCanvasMinimap-CuvXOkc7.js} +1 -1
  62. package/dist/client/assets/MeshScreen-D5zzTn0o.js +1 -0
  63. package/dist/client/assets/{MeshTopologyView-CalkZghg.js → MeshTopologyView-CeTShs-U.js} +2 -2
  64. package/dist/client/assets/{MessageComposerSuggestions-DpxN9WiB.js → MessageComposerSuggestions-Cs9u-F_3.js} +1 -1
  65. package/dist/client/assets/MessagesScreen-BhOJ7_tj.js +1 -0
  66. package/dist/client/assets/MissionContextRail-0O-Zu1Tn.js +1 -0
  67. package/dist/client/assets/MissionControlView-D2JO9u-y.js +1 -0
  68. package/dist/client/assets/{MissionFocusOverlay-wlCmWDCT.js → MissionFocusOverlay-LnjmqBiW.js} +1 -1
  69. package/dist/client/assets/MissionLeftAgentRow-nc1Jyq3D.js +1 -0
  70. package/dist/client/assets/MissionLogPane-lZ9vUftY.js +1 -0
  71. package/dist/client/assets/{NewAgentModal-Bg-eWHpY.js → NewAgentModal-K1cvdmZr.js} +1 -1
  72. package/dist/client/assets/NewChatComposer-C5LT7MF7.css +1 -0
  73. package/dist/client/assets/NewChatComposer-DXDxV2Mh.js +19 -0
  74. package/dist/client/assets/{NewChatOrigin-Bk2OyVjI.js → NewChatOrigin-CnjoswTG.js} +1 -1
  75. package/dist/client/assets/ObserveEmbedScreen-CRpzYf0Y.js +2 -0
  76. package/dist/client/assets/{ObserveTextFlow-rsFj_rVo.js → ObserveTextFlow-DJxQc2H6.js} +2 -2
  77. package/dist/client/assets/{ObservedTopologyPanel-DyUeV98H.js → ObservedTopologyPanel-C1AQM0Mq.js} +1 -1
  78. package/dist/client/assets/OpenScoutAppShell-DrHYD_pd.js +87 -0
  79. package/dist/client/assets/OpsAgentsView-BnMX0vEY.js +1 -0
  80. package/dist/client/assets/OpsScreen-BeC0lieE.js +1 -0
  81. package/dist/client/assets/OpsSubnav-D5Bpowtk.js +1 -0
  82. package/dist/client/assets/{PlanView-C1CjH3PG.js → PlanView-DDXdC19M.js} +1 -1
  83. package/dist/client/assets/ProjectAgentProfile-zE1cApxw.js +1 -0
  84. package/dist/client/assets/{ProjectAgentProfileBar-CtTpj6fU.js → ProjectAgentProfileBar-MODhG0P6.js} +1 -1
  85. package/dist/client/assets/ProjectAgentProfileHero-C1ImgGDu.js +1 -0
  86. package/dist/client/assets/ProjectsInbox-C3Jd6JTk.js +2 -0
  87. package/dist/client/assets/{ProjectsRail-BgiuV4LR.js → ProjectsRail-B1zrQLZe.js} +1 -1
  88. package/dist/client/assets/ProjectsScreen-PW_NH5VK.js +1 -0
  89. package/dist/client/assets/ProjectsThreadAside-DaCEUWN1.js +1 -0
  90. package/dist/client/assets/Provider-DSsb2gLR.js +1 -0
  91. package/dist/client/assets/{RailRow-BoGxAHNF.js → RailRow-DerXOXQS.js} +1 -1
  92. package/dist/client/assets/RawSessionsTable-LWEvXJzj.js +1 -0
  93. package/dist/client/assets/RealtimeVoiceScreen-XtxbCjOs.js +1 -0
  94. package/dist/client/assets/{RepoDiffEmbedScreen-C0rumUME.js → RepoDiffEmbedScreen-C9oLCcZX.js} +1 -1
  95. package/dist/client/assets/{RepoDiffPageScreen-DMv6DioL.js → RepoDiffPageScreen-CGEMAv2Z.js} +1 -1
  96. package/dist/client/assets/RepoDiffViewer-CB8PSVey.js +7 -0
  97. package/dist/client/assets/RepoDiffViewerLazy-DIxkiMto.js +2 -0
  98. package/dist/client/assets/{ReposScreen-CB_YBWYf.js → ReposScreen-BN1lVjOj.js} +2 -2
  99. package/dist/client/assets/{ScoutDeckSurface-CxIYFyWx.js → ScoutDeckSurface-BCpl0QCx.js} +1 -1
  100. package/dist/client/assets/{ScoutSurface-CYz_TcWC.js → ScoutSurface-BEnDlynn.js} +1 -1
  101. package/dist/client/assets/{ScoutbotBroadcastChip-L_R9atj0.js → ScoutbotBroadcastChip-z9R_pC_U.js} +1 -1
  102. package/dist/client/assets/{ScoutbotFxLab-CgiZMDMW.js → ScoutbotFxLab-fAROyIfz.js} +1 -1
  103. package/dist/client/assets/{ScoutbotRealtimeVoiceCall-FMQOr1Np.js → ScoutbotRealtimeVoiceCall-CDyFJX8m.js} +1 -1
  104. package/dist/client/assets/{SecondaryNav-B3-nh5dM.js → SecondaryNav-Hv5AJ3Fv.js} +1 -1
  105. package/dist/client/assets/SessionEmbedScreen-CDRpQc3g.js +1 -0
  106. package/dist/client/assets/SessionObserve-BmmJ8dEh.js +12 -0
  107. package/dist/client/assets/SessionObserve-CLrHfAKZ.css +1 -0
  108. package/dist/client/assets/SessionObserveEvidence-CEedIk2a.js +1 -0
  109. package/dist/client/assets/SessionRefScreen-Dk-O4OVt.js +1 -0
  110. package/dist/client/assets/SessionsScreen-BJEjuo2X.js +1 -0
  111. package/dist/client/assets/{SettingsDrawer-XfdAa_nD.js → SettingsDrawer-DL-SVLdd.js} +3 -3
  112. package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +1 -0
  113. package/dist/client/assets/SettingsScreen-DJ-BhBwR.js +1 -0
  114. package/dist/client/assets/{ShikiPane-Ap1iPxYb.js → ShikiPane-B7O4if20.js} +1 -1
  115. package/dist/client/assets/{SlidePanel-COwtoJqR.js → SlidePanel-B3gc5HnM.js} +1 -1
  116. package/dist/client/assets/SpriteAvatar-BpQDpOkq.js +1 -0
  117. package/dist/client/assets/{StatusPill-DhBL__p8.js → StatusPill-B33sQinT.js} +1 -1
  118. package/dist/client/assets/{TailView-DGj_5HA9.js → TailView-DL3YZkzE.js} +2 -2
  119. package/dist/client/assets/Terminal-Dp1FSGIS.js +1 -0
  120. package/dist/client/assets/TerminalEmbedScreen-DP9IM4xf.js +1 -0
  121. package/dist/client/assets/{TextDocumentSurface-BpAw4eQS.js → TextDocumentSurface-DRjctOIt.js} +1 -1
  122. package/dist/client/assets/{TmuxPeek-m1osv33Q.js → TmuxPeek-DNC4uWky.js} +1 -1
  123. package/dist/client/assets/{VoicePermissionsPanel-DsK53ar4.js → VoicePermissionsPanel-WLN0V-Xv.js} +1 -1
  124. package/dist/client/assets/{WorkDetailScreen-Bx0JimPC.js → WorkDetailScreen-D2Yl0mYZ.js} +3 -3
  125. package/dist/client/assets/{WorkFilesViewer-Btl6C2Q1.js → WorkFilesViewer-BbVfcUN-.js} +1 -1
  126. package/dist/client/assets/{activity-CA8qS6PI.js → activity-BxwKkT8z.js} +1 -1
  127. package/dist/client/assets/{addon-fit-BZ-kXjeN.js → addon-fit-B9O2vJoh.js} +1 -1
  128. package/dist/client/assets/{addon-webgl-D9-EQVEK.js → addon-webgl-BhRZFDcn.js} +1 -1
  129. package/dist/client/assets/{agent-essentials-BSY1o46q.js → agent-essentials-SrzMYEXV.js} +1 -1
  130. package/dist/client/assets/agent-identity-BxCsXnDp.js +1 -0
  131. package/dist/client/assets/agent-lane-card-BkWVDYM8.css +1 -0
  132. package/dist/client/assets/{agent-lane-card-model-r2frk57c.js → agent-lane-card-model-DSWdGu-v.js} +1 -1
  133. package/dist/client/assets/agent-lane-detail-BNNm6FNu.js +2 -0
  134. package/dist/client/assets/{agent-lane-preview-CmHVe3dU.js → agent-lane-preview-C33Dwpn7.js} +1 -1
  135. package/dist/client/assets/{agent-lanes-model-B4YTt4OF.js → agent-lanes-model-CPgQRenB.js} +2 -2
  136. package/dist/client/assets/{arc.es-CQBb-dVu.js → arc.es-NlJw-19N.js} +1 -1
  137. package/dist/client/assets/{arrow-down-BPLe0am9.js → arrow-down-D3-IbArq.js} +1 -1
  138. package/dist/client/assets/{arrow-left-DEZzHiPS.js → arrow-left-_vS7itsV.js} +1 -1
  139. package/dist/client/assets/{arrow-up-right-ClxBnsi7.js → arrow-up-right-CcrWONpD.js} +1 -1
  140. package/dist/client/assets/{bot-eu8pBNvI.js → bot-BRINYlC6.js} +1 -1
  141. package/dist/client/assets/{check-DjgFiBxb.js → check-COxArFXG.js} +1 -1
  142. package/dist/client/assets/{chevron-down-BGk5qoEw.js → chevron-down-DRCbnzyY.js} +1 -1
  143. package/dist/client/assets/{chevron-right-XiIHsk4m.js → chevron-right-CNE6QAVr.js} +1 -1
  144. package/dist/client/assets/chunk-HRAB3GC3-CAeEKaf5.js +1 -0
  145. package/dist/client/assets/chunk-JTPDIGGW-s6WbxdjC.js +46 -0
  146. package/dist/client/assets/{chunk-T65CQEWV-CrzwSeEt.js → chunk-T65CQEWV-CiZ_ICHW.js} +1 -1
  147. package/dist/client/assets/chunk-YOZR3KYS-DLOc92uD.js +2 -0
  148. package/dist/client/assets/clock-CyfvRmj6.js +1 -0
  149. package/dist/client/assets/{code-xml-B6jOCM4V.js → code-xml--LjSM4Mv.js} +1 -1
  150. package/dist/client/assets/content-7ZeCPAEt.js +1 -0
  151. package/dist/client/assets/content-BHUcUCH5.js +1 -0
  152. package/dist/client/assets/content-BUhvLPkv.js +1 -0
  153. package/dist/client/assets/content-BomQ5YWo.js +1 -0
  154. package/dist/client/assets/content-C39ELNgC.js +1 -0
  155. package/dist/client/assets/content-C4RYKHut.js +1 -0
  156. package/dist/client/assets/content-CCiZfG4H.js +1 -0
  157. package/dist/client/assets/content-CDpDtVI-.js +1 -0
  158. package/dist/client/assets/content-CO-9CeFd.js +1 -0
  159. package/dist/client/assets/content-CuOLxp1x.js +1 -0
  160. package/dist/client/assets/content-CvtLIjXS.js +1 -0
  161. package/dist/client/assets/content-CzwTUb9n.js +1 -0
  162. package/dist/client/assets/content-DQXbo2RO.js +1 -0
  163. package/dist/client/assets/content-DRTQ9QQb.js +1 -0
  164. package/dist/client/assets/content-LCELs6zg.js +1 -0
  165. package/dist/client/assets/content-Uqt8AG-s.css +1 -0
  166. package/dist/client/assets/content-qsDjA4Au.js +1 -0
  167. package/dist/client/assets/{context-budget-CbB4BDcO.js → context-budget-DX_fwUs3.js} +1 -1
  168. package/dist/client/assets/{conversation-icons-IIG5ha6D.js → conversation-icons-c-hXv7hY.js} +1 -1
  169. package/dist/client/assets/conversation-model-CHwHZNw-.js +1 -0
  170. package/dist/client/assets/conversation-motion-features-T8vF9zED.js +1 -0
  171. package/dist/client/assets/{copy-CQGYbxdu.js → copy-4LfKIdQJ.js} +1 -1
  172. package/dist/client/assets/{createLucideIcon-OpA4Amw5.js → createLucideIcon-ClCdc3F9.js} +1 -1
  173. package/dist/client/assets/discover-7Ks00w-M.js +2 -0
  174. package/dist/client/assets/embed-entry-n2ThmSSX.js +2 -0
  175. package/dist/client/assets/{external-link-CXBytO9o.js → external-link-CnaI1QFS.js} +1 -1
  176. package/dist/client/assets/{eye-0PvebX_a.js → eye-BFlhMzQL.js} +1 -1
  177. package/dist/client/assets/{file-text-BODxCjcz.js → file-text-DG-pufl1.js} +1 -1
  178. package/dist/client/assets/{gestures-CcwOTu8C.js → gestures-CxG3Dphs.js} +1 -1
  179. package/dist/client/assets/home-live-action-BkqGLVRY.js +1 -0
  180. package/dist/client/assets/home-moving-signal-aNJusIzL.js +1 -0
  181. package/dist/client/assets/home-now-card-BQK4EFHx.js +1 -0
  182. package/dist/client/assets/{home-now-card-nano-BcjnOU9H.js → home-now-card-nano-CdtzqSIF.js} +1 -1
  183. package/dist/client/assets/hooks-Dst1TH7n.js +2 -0
  184. package/dist/client/assets/inbox-thread-redesign-B_1ocqaX.css +1 -0
  185. package/dist/client/assets/index-9as_JTUs.css +1 -0
  186. package/dist/client/assets/index-CU9dtwJk.js +1 -0
  187. package/dist/client/assets/{index-DMiGbrBt.js → index-CzVeWScw.js} +6 -6
  188. package/dist/client/assets/index-Dewd56RX.js +1 -0
  189. package/dist/client/assets/index-_YQXKEhb.js +1 -0
  190. package/dist/client/assets/{inspector-panel-DPoCWxKs.js → inspector-panel-DgOM8nCo.js} +2 -2
  191. package/dist/client/assets/keyboard-nav-BJnFoFDP.js +1 -0
  192. package/dist/client/assets/knowledge-search-D_bLoYtC.css +1 -0
  193. package/dist/client/assets/{lane-observe-D0rfKDnU.js → lane-observe-BA3g9aVd.js} +1 -1
  194. package/dist/client/assets/{lane-roster-store-D8x1jac2.js → lane-roster-store-pR4ZaYQm.js} +1 -1
  195. package/dist/client/assets/left-BhzPp-_E.js +1 -0
  196. package/dist/client/assets/left-CN1MABD0.js +2 -0
  197. package/dist/client/assets/left-DDgbsio7.js +1 -0
  198. package/dist/client/assets/left-Dpf2R9uD.js +1 -0
  199. package/dist/client/assets/left-HwwbMVtl.js +2 -0
  200. package/dist/client/assets/left-YfH0daht.js +1 -0
  201. package/dist/client/assets/left-agents-CYUwAy2Z.js +1 -0
  202. package/dist/client/assets/left-default-vEGZALPv.js +1 -0
  203. package/dist/client/assets/left-lanes-bphF-vlX.js +1 -0
  204. package/dist/client/assets/left-mission-B54-c3hq.js +1 -0
  205. package/dist/client/assets/left-np5USKqG.js +1 -0
  206. package/dist/client/assets/left-plan-BNBuDoPQ.js +2 -0
  207. package/dist/client/assets/library-DbCVJG_O.js +1 -0
  208. package/dist/client/assets/{loader-circle-CbHjZsz1.js → loader-circle-Byb9kSFx.js} +1 -1
  209. package/dist/client/assets/{local-agents--00gLMqr.js → local-agents-DBaUbP-_.js} +1 -1
  210. package/dist/client/assets/{mentions-jSuTGeet.js → mentions-fbQJ2mBI.js} +1 -1
  211. package/dist/client/assets/mesh-ops-B1kDjizF.css +1 -0
  212. package/dist/client/assets/mesh-ops-Cnw3vwAu.js +1 -0
  213. package/dist/client/assets/{mesh-view-store-CWidRbTE.js → mesh-view-store-Btlyc7rW.js} +1 -1
  214. package/dist/client/assets/{message-circle-CG-96zts.js → message-circle-aGOfQWm2.js} +1 -1
  215. package/dist/client/assets/{message-markup-3J9pi3nx.js → message-markup-mGF07emJ.js} +1 -1
  216. package/dist/client/assets/{message-square-DSaGpjFU.js → message-square-CIXda-Y7.js} +1 -1
  217. package/dist/client/assets/mission-control-m3BTDQ9l.css +1 -0
  218. package/dist/client/assets/{mission-control-store-BlnEhiCq.js → mission-control-store-CcoNeQHG.js} +1 -1
  219. package/dist/client/assets/mission-wall-CocIM1cF.js +1 -0
  220. package/dist/client/assets/{model-CpAxGuis.js → model-IGCUEsMy.js} +1 -1
  221. package/dist/client/assets/{observe-CuLGD9Zp.js → observe-BNFzh-7B.js} +1 -1
  222. package/dist/client/assets/openAgent-Dbv5wfuL.js +1 -0
  223. package/dist/client/assets/{page-status-DpkedE1F.js → page-status-DDvNdA8s.js} +1 -1
  224. package/dist/client/assets/paperclip-DfpJkR4s.js +1 -0
  225. package/dist/client/assets/{plus--b1raV_O.js → plus-CmFQp9Uj.js} +1 -1
  226. package/dist/client/assets/profile-s3KRbip1.js +1 -0
  227. package/dist/client/assets/{projects-inbox-CHyUFQ6w.js → projects-inbox-Diddml6e.js} +1 -1
  228. package/dist/client/assets/{radio-Bz8ZePxj.js → radio-PauJIekM.js} +1 -1
  229. package/dist/client/assets/{refresh-cw-BBmAnCB7.js → refresh-cw-4oeFn1Jn.js} +1 -1
  230. package/dist/client/assets/repo-diff-DyYmQMSA.css +1 -0
  231. package/dist/client/assets/resolve-panes-cp6eNewO.js +1 -0
  232. package/dist/client/assets/resolve-sidebar-context-Dbo-5PWx.js +1 -0
  233. package/dist/client/assets/right-09W2JJFg.js +1 -0
  234. package/dist/client/assets/right-B-MKhiJ6.js +1 -0
  235. package/dist/client/assets/right-B91Zl8lQ.js +1 -0
  236. package/dist/client/assets/{right-DjRXbnRP.js → right-BcFnuse9.js} +1 -1
  237. package/dist/client/assets/right-BdtMzn35.js +1 -0
  238. package/dist/client/assets/right-BqmKXLtf.js +1 -0
  239. package/dist/client/assets/right-BzeB-Dpt.js +1 -0
  240. package/dist/client/assets/right-CkGOs-sq.js +1 -0
  241. package/dist/client/assets/right-CzGiNBzB.js +1 -0
  242. package/dist/client/assets/right-Dc7uqv7l.js +1 -0
  243. package/dist/client/assets/{rocket-BSNS_rLs.js → rocket-C-AskjZH.js} +1 -1
  244. package/dist/client/assets/router-B-K15T7B.js +1 -0
  245. package/dist/client/assets/{runtime-picker-Bcl5iIX5.js → runtime-picker-BCQD7d4K.js} +1 -1
  246. package/dist/client/assets/{scope-views-U-ucT9m0.js → scope-views-BhkbIFPY.js} +1 -1
  247. package/dist/client/assets/{scout-voice-CU5c0LGi.js → scout-voice-S5_YZ2v8.js} +1 -1
  248. package/dist/client/assets/{scroll-text-D6Pdnar7.js → scroll-text-BV-BB7v-.js} +1 -1
  249. package/dist/client/assets/{search-CWfZtOt2.js → search-C3bSJluv.js} +1 -1
  250. package/dist/client/assets/secondaryNavConfig-Bg4Tc0gT.js +1 -0
  251. package/dist/client/assets/{selection-bridge-16pk1qyG.js → selection-bridge-B1dmkX3P.js} +1 -1
  252. package/dist/client/assets/{send-horizontal-Bg5-QggH.js → send-horizontal-CqogPmbY.js} +1 -1
  253. package/dist/client/assets/{server-CPp4ZJhZ.js → server-Brw5Y1Gh.js} +1 -1
  254. package/dist/client/assets/{session-catalog-BmoyVTJ_.js → session-catalog-9FqXmjBw.js} +1 -1
  255. package/dist/client/assets/session-table-1xdSxSXq.js +1 -0
  256. package/dist/client/assets/{sliders-horizontal-1oW76Xc9.js → sliders-horizontal-CUiOH26y.js} +1 -1
  257. package/dist/client/assets/sparkles-BjCA3Evu.js +1 -0
  258. package/dist/client/assets/{sse-CjIkKo46.js → sse-QcU9bikk.js} +1 -1
  259. package/dist/client/assets/synthetic-agent-routing-aduMYO7P.js +1 -0
  260. package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +1 -0
  261. package/dist/client/assets/{tail-display-BdyoLvzY.js → tail-display-BRcJltQa.js} +2 -2
  262. package/dist/client/assets/{tail-events-D19uAGe3.js → tail-events-C6K7bCWB.js} +1 -1
  263. package/dist/client/assets/{terminal-B9AOZQKR.js → terminal-DrTkVXIj.js} +1 -1
  264. package/dist/client/assets/{terminal-relay-CWbJ1RCW.js → terminal-relay-BkXjjSkq.js} +1 -1
  265. package/dist/client/assets/{terminal-screen-19jAI0Cw.css → terminal-screen-BqVnCwl0.css} +1 -1
  266. package/dist/client/assets/terminal-sessions-C3qU8tnY.js +1 -0
  267. package/dist/client/assets/{terminal-takeover-B8UeD9OX.js → terminal-takeover-KvmTwABa.js} +1 -1
  268. package/dist/client/assets/{time-DltNTpLl.js → time-Dhsh_2EG.js} +1 -1
  269. package/dist/client/assets/{use-conversation-list-Byab41G6.js → use-conversation-list-C5sF6WBR.js} +1 -1
  270. package/dist/client/assets/{use-fleet-active-asks-BIbQx5AS.js → use-fleet-active-asks-BOMPW0nl.js} +1 -1
  271. package/dist/client/assets/use-mesh-ops-items-Co05vcTV.js +1 -0
  272. package/dist/client/assets/{use-reduced-motion-RRBkmVkk.js → use-reduced-motion-Dla-G_Jz.js} +1 -1
  273. package/dist/client/assets/use-scout-dev-flags-BOQF3fW2.js +1 -0
  274. package/dist/client/assets/{useAgentHoverCard-DMrbBif0.js → useAgentHoverCard-FtCmY-b9.js} +1 -1
  275. package/dist/client/assets/useContentSecondaryNav-BX7Sq7vy.js +1 -0
  276. package/dist/client/assets/usePierreRuntime-Bo4lD7Ui.js +50 -0
  277. package/dist/client/assets/{wrench-Bkc_0lKF.js → wrench-CeCdjiPF.js} +1 -1
  278. package/dist/client/assets/{x-D3GElQbe.js → x-D4X_y1j_.js} +1 -1
  279. package/dist/client/assets/{xterm-BKR8oAkR.js → xterm-D2a5wrkJ.js} +1 -1
  280. package/dist/client/index.html +2 -2
  281. package/dist/drizzle/0007_lean_venus.sql +26 -0
  282. package/dist/drizzle/0008_luxuriant_ted_forrester.sql +1 -0
  283. package/dist/drizzle/meta/0007_snapshot.json +5767 -0
  284. package/dist/drizzle/meta/0008_snapshot.json +5774 -0
  285. package/dist/drizzle/meta/_journal.json +14 -0
  286. package/dist/main.mjs +29271 -4824
  287. package/dist/node/main.mjs +31635 -11915
  288. package/dist/openscout-terminal-relay.mjs +16 -4
  289. package/dist/pairing-runtime-controller.mjs +37812 -16924
  290. package/dist/runtime/base-daemon.mjs +109 -18
  291. package/dist/runtime/broker-daemon.mjs +22247 -2746
  292. package/dist/runtime/broker-process-manager.mjs +122 -12
  293. package/dist/runtime/mesh-discover.mjs +90 -13
  294. package/dist/scout-control-plane-web.mjs +23083 -3481
  295. package/dist/scout-web-server.mjs +23083 -3481
  296. package/dist/statusline.mjs +2 -0
  297. package/package.json +3 -1
  298. package/dist/client/assets/ActivityScreen-Cu_1V4bq.js +0 -1
  299. package/dist/client/assets/AgentConfigurationScreen-BqfOz90D.js +0 -1
  300. package/dist/client/assets/AgentDefinitionsWorkspace-CUpUrY57.js +0 -1
  301. package/dist/client/assets/AgentFloorView-8LoAEBwS.js +0 -1
  302. package/dist/client/assets/AgentInfoScreen-DZs2_ibL.js +0 -1
  303. package/dist/client/assets/AgentLaneDetailSheet-BXbPls9N.js +0 -5
  304. package/dist/client/assets/AgentLanesEmbedScreen-W3qs022h.js +0 -1
  305. package/dist/client/assets/AgentLanesView-B9vuEEmZ.js +0 -2
  306. package/dist/client/assets/AgentsConsole-BgiYP2wR.js +0 -1
  307. package/dist/client/assets/AgentsScreen-DBi8x4MB.js +0 -1
  308. package/dist/client/assets/AgentsSubnav-DIEO4NPx.js +0 -1
  309. package/dist/client/assets/BackToPicker-BRvfostO.js +0 -1
  310. package/dist/client/assets/BrokerScreen-7ekklu88.js +0 -5
  311. package/dist/client/assets/CodeDiffPane-DDPt6KPh.js +0 -1
  312. package/dist/client/assets/CodeScreen-BxCrpRHd.js +0 -1
  313. package/dist/client/assets/ConversationComposer-Bla3DDvM.js +0 -1
  314. package/dist/client/assets/ConversationFeedRows-B_gPxcqA.js +0 -1
  315. package/dist/client/assets/ConversationHeader-DE3FC0m-.js +0 -1
  316. package/dist/client/assets/ConversationPanels-DLek4H6A.js +0 -2
  317. package/dist/client/assets/ConversationScreen-BDRhx-RU.js +0 -1
  318. package/dist/client/assets/ConversationScreen-C9yMAMYF.css +0 -1
  319. package/dist/client/assets/ConversationStatus-BwVLiiO4.js +0 -1
  320. package/dist/client/assets/FlightObserveScreen-6RpZYwVz.js +0 -1
  321. package/dist/client/assets/FollowScreen-DZ4qfYOY.js +0 -1
  322. package/dist/client/assets/HarnessMark-Cbv3Ib0c.js +0 -1
  323. package/dist/client/assets/HarnessesScreen-CznAImej.js +0 -1
  324. package/dist/client/assets/KnowledgeSearchInspector-Dgdkfvvz.js +0 -1
  325. package/dist/client/assets/KnowledgeSearchScreen-DJDGGaqC.js +0 -1
  326. package/dist/client/assets/LaneTraceDetailSheet-D1CspRbl.js +0 -1
  327. package/dist/client/assets/MeshScreen-DFgevn8N.js +0 -1
  328. package/dist/client/assets/MessagesScreen-C8YKW10Y.js +0 -1
  329. package/dist/client/assets/MissionControlView-lUeAiSVg.js +0 -1
  330. package/dist/client/assets/MissionLeftAgentRow-BpZWntfl.js +0 -1
  331. package/dist/client/assets/MissionLogPane-__MVtEl9.js +0 -1
  332. package/dist/client/assets/NewChatComposer-Cs6OsxK6.js +0 -19
  333. package/dist/client/assets/NewChatComposer-W-t-L4oV.css +0 -1
  334. package/dist/client/assets/ObserveEmbedScreen-y2EpuqRZ.js +0 -2
  335. package/dist/client/assets/OpenScoutAppShell-C_URc8sV.js +0 -87
  336. package/dist/client/assets/OpsAgentsView-UN7iOscs.js +0 -1
  337. package/dist/client/assets/OpsScreen-Buf3LKjb.js +0 -1
  338. package/dist/client/assets/OpsSubnav-DsuXzHah.js +0 -1
  339. package/dist/client/assets/ProjectAgentProfile-DJusrAV-.js +0 -1
  340. package/dist/client/assets/ProjectAgentProfileHero-BFwNJo_N.js +0 -1
  341. package/dist/client/assets/ProjectsInbox-GhVMxOhw.js +0 -2
  342. package/dist/client/assets/ProjectsScreen-eNUBy4YU.js +0 -1
  343. package/dist/client/assets/ProjectsThreadAside-CoBgnHmr.js +0 -1
  344. package/dist/client/assets/Provider-C7UKGHQy.js +0 -1
  345. package/dist/client/assets/RawSessionsTable-DL8y_eEy.js +0 -1
  346. package/dist/client/assets/RealtimeVoiceScreen-ffS-39zy.js +0 -1
  347. package/dist/client/assets/RepoDiffViewer-D_exm6xK.js +0 -7
  348. package/dist/client/assets/RepoDiffViewerLazy-BPgF92Bg.js +0 -2
  349. package/dist/client/assets/SessionEmbedScreen-BVC7yvWF.js +0 -1
  350. package/dist/client/assets/SessionObserve-BpggNO_M.css +0 -1
  351. package/dist/client/assets/SessionObserve-yfXFafp8.js +0 -12
  352. package/dist/client/assets/SessionRefScreen-DRgJu7Jo.js +0 -1
  353. package/dist/client/assets/SessionsScreen-D6XUsZfA.js +0 -1
  354. package/dist/client/assets/SettingsDrawer-CmJt72ww.css +0 -1
  355. package/dist/client/assets/SettingsScreen-Cy8z-EuR.js +0 -1
  356. package/dist/client/assets/SpriteAvatar-DyaGuhik.js +0 -1
  357. package/dist/client/assets/Terminal-CqvGbjXU.js +0 -1
  358. package/dist/client/assets/TerminalEmbedScreen-DuZZFFzW.js +0 -1
  359. package/dist/client/assets/agent-chat-Bfjd9y6c.js +0 -1
  360. package/dist/client/assets/agent-lane-card-Dm7YWoew.css +0 -1
  361. package/dist/client/assets/agent-lane-detail-Djm3YJEa.js +0 -1
  362. package/dist/client/assets/chunk-YOZR3KYS-Bet8khjg.js +0 -47
  363. package/dist/client/assets/content-BDt9VBPk.js +0 -1
  364. package/dist/client/assets/content-BIXf4cKR.js +0 -1
  365. package/dist/client/assets/content-BLm0NBJM.js +0 -1
  366. package/dist/client/assets/content-C2EwTb2y.js +0 -1
  367. package/dist/client/assets/content-C5UbLsDF.js +0 -1
  368. package/dist/client/assets/content-CHU0wwA3.css +0 -1
  369. package/dist/client/assets/content-CR3vdrYY.js +0 -1
  370. package/dist/client/assets/content-CSPVmo2s.js +0 -1
  371. package/dist/client/assets/content-C_FGqx1X.js +0 -1
  372. package/dist/client/assets/content-CvlVUOG8.js +0 -1
  373. package/dist/client/assets/content-D5kJmfgl.js +0 -1
  374. package/dist/client/assets/content-DTpQsomG.js +0 -1
  375. package/dist/client/assets/content-DikVsqLf.js +0 -1
  376. package/dist/client/assets/content-DlUe5Ono.js +0 -1
  377. package/dist/client/assets/content-GIBv_55n.js +0 -1
  378. package/dist/client/assets/content-Q2oclDzi.js +0 -1
  379. package/dist/client/assets/conversation-model-B47vYmWN.js +0 -1
  380. package/dist/client/assets/conversation-motion-features-BdAONVls.js +0 -1
  381. package/dist/client/assets/discover-C1YwpBDE.js +0 -2
  382. package/dist/client/assets/embed-entry-BAcGL3g9.js +0 -2
  383. package/dist/client/assets/home-live-action-B22u89j7.js +0 -1
  384. package/dist/client/assets/home-moving-signal-CK147hxn.js +0 -1
  385. package/dist/client/assets/home-now-card-BgvNWuea.js +0 -1
  386. package/dist/client/assets/hooks-B6y_O2FB.js +0 -2
  387. package/dist/client/assets/inbox-thread-redesign-Bz4FjWzr.css +0 -1
  388. package/dist/client/assets/index-BcuhqXLe.js +0 -1
  389. package/dist/client/assets/index-CJXzfjo9.js +0 -1
  390. package/dist/client/assets/index-DQPvraRS.js +0 -1
  391. package/dist/client/assets/index-DxGoC5l5.css +0 -1
  392. package/dist/client/assets/keyboard-nav-2kv_tGUS.js +0 -1
  393. package/dist/client/assets/knowledge-search-CVxQwxPn.js +0 -1
  394. package/dist/client/assets/knowledge-search-DjrQdiiW.css +0 -1
  395. package/dist/client/assets/left-C--GiIh8.js +0 -2
  396. package/dist/client/assets/left-Cj7Rt89X.js +0 -1
  397. package/dist/client/assets/left-CpNEtFEg.js +0 -1
  398. package/dist/client/assets/left-CzXAuK_t.js +0 -2
  399. package/dist/client/assets/left-agents-Bo9sO1by.js +0 -1
  400. package/dist/client/assets/left-bN4PCAXa.js +0 -1
  401. package/dist/client/assets/left-default-DV9GdvYi.js +0 -1
  402. package/dist/client/assets/left-jYYGAOYD.js +0 -1
  403. package/dist/client/assets/left-lanes-D0l_Co7V.js +0 -1
  404. package/dist/client/assets/left-mission-Ci7zREkQ.js +0 -1
  405. package/dist/client/assets/left-plan-D4U1uflW.js +0 -2
  406. package/dist/client/assets/library-D-RxGiCw.js +0 -1
  407. package/dist/client/assets/mission-control-D3ikEPND.css +0 -1
  408. package/dist/client/assets/openAgent-Bjt57GdM.js +0 -1
  409. package/dist/client/assets/profile-CVRziEDA.js +0 -1
  410. package/dist/client/assets/repo-diff-C9Qs-bEn.css +0 -1
  411. package/dist/client/assets/resolve-panes-r9B3mpW7.js +0 -1
  412. package/dist/client/assets/resolve-sidebar-context-DcG8xGaB.js +0 -1
  413. package/dist/client/assets/right-BHeiIaty.js +0 -1
  414. package/dist/client/assets/right-BkgKo9VT.js +0 -1
  415. package/dist/client/assets/right-BpEU5jWE.js +0 -1
  416. package/dist/client/assets/right-CRZXoy-X.js +0 -1
  417. package/dist/client/assets/right-ChF_pbPy.js +0 -1
  418. package/dist/client/assets/right-DMoUT3KN.js +0 -1
  419. package/dist/client/assets/right-T4Ue6EqM.js +0 -1
  420. package/dist/client/assets/right-wzrLXKur.js +0 -1
  421. package/dist/client/assets/router-Bq5dwf78.js +0 -1
  422. package/dist/client/assets/secondaryNavConfig-DqUIp0Es.js +0 -1
  423. package/dist/client/assets/session-table-DZcrKoIH.js +0 -1
  424. package/dist/client/assets/sparkles-ClfRJQ6w.js +0 -1
  425. package/dist/client/assets/system-surfaces-redesign-CD26LFc0.css +0 -1
  426. package/dist/client/assets/terminal-sessions-D5CIR2OL.js +0 -1
  427. package/dist/client/assets/useContentSecondaryNav-DMl1WNm7.js +0 -1
  428. package/dist/client/assets/usePierreRuntime-wC-yMtBb.js +0 -50
@@ -0,0 +1 @@
1
+ import{j as e,r as o,n as Ve,o as Ye}from"./index-CzVeWScw.js";/* empty css */import{u as Es}from"./ContextMenu-N-Z6X0Z1.js";import{a as me}from"./api-h5zurxmi.js";import{c as xs}from"./clipboard-e3fSpeo7.js";import{d as Ws}from"./colors-BtO5_zlx.js";import{r as Te,S as Ge,a as Je,w as Ie,s as bt,b as xt,d as yt,c as jt,e as As,f as Ce,g as gt}from"./terminal-relay-BkXjjSkq.js";import{p as Ms,g as St,f as Ls,b as Ds,s as F,d as Be,h as He,r as zs,i as Os,j as wt,k as Nt,m as Ct,t as Ps,n as vt}from"./terminal-sessions-C3qU8tnY.js";import{H as Tt,u as Xe,a as It,c as Rt,h as Et,b as Wt,A as At}from"./HerdrSession-DKFCJMst.js";import{D as Mt,c as Lt,P as Dt,s as _e,T as zt,a as Ot,d as _s}from"./session-table-1xdSxSXq.js";import{u as Qe,T as Pt}from"./chunk-JTPDIGGW-s6WbxdjC.js";import{u as $e,L as Ze}from"./chunk-YOZR3KYS-DLOc92uD.js";import{q as _t}from"./terminal-takeover-KvmTwABa.js";import{t as $t}from"./time-Dhsh_2EG.js";import{u as $s}from"./Provider-DSsb2gLR.js";import{B as ue}from"./BackToPicker-DZg_4nHL.js";import{T as Ft}from"./TmuxPeek-DNC4uWky.js";import{R as es}from"./refresh-cw-4oeFn1Jn.js";import{c as ss}from"./createLucideIcon-ClCdc3F9.js";import{P as Q}from"./plus-CmFQp9Uj.js";import{T as U}from"./terminal-DrTkVXIj.js";import{S as Kt}from"./runtime-picker-BCQD7d4K.js";import{X as pe}from"./x-D4X_y1j_.js";import{E as Ut}from"./eye-BFlhMzQL.js";import{E as Fs}from"./external-link-CnaI1QFS.js";import"./router-B-K15T7B.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./HarnessMark-BE-YSyci.js";import"./check-COxArFXG.js";import"./copy-4LfKIdQJ.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";import"./arrow-down-D3-IbArq.js";import"./sse-QcU9bikk.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-BCG2kOmd.js";import"./TextDocumentSurface-DRjctOIt.js";/* empty css */import"./file-text-DG-pufl1.js";import"./chevron-right-CNE6QAVr.js";import"./code-xml--LjSM4Mv.js";import"./arrow-left-_vS7itsV.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BJnFoFDP.js";import"./MessageComposerSuggestions-Cs9u-F_3.js";import"./NewChatComposer-DXDxV2Mh.js";import"./index-Dewd56RX.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-CnjoswTG.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-DRCbnzyY.js";import"./search-C3bSJluv.js";import"./loader-circle-Byb9kSFx.js";/* empty css */import"./voice-levels-Dcr3jglk.js";const Ks=6,Us=2;function Re(s){if(s.layout?.mode)return{mode:s.layout.mode,...s.layout.columns===void 0?{}:{columns:Bt(s.layout.columns)}};const t=s.cellCount??0,r=We(s.columns??Us);return t<=1?{mode:"solo"}:r>=t?{mode:"lanes",columns:r}:{mode:"grid",columns:r}}function Ee(s,t){const r=Math.max(1,Math.floor(t.tileCount)||1);if(s.mode==="solo")return 1;if(s.columns===void 0||s.columns==="dynamic"){const i=s.mode==="lanes"?r:Math.ceil(Math.sqrt(r));return Math.max(1,Math.min(Ks,i))}return We(s.columns)}function Bt(s){return s==="dynamic"?"dynamic":We(s)}function Ht(s){if(s.mode==="solo")return"Solo";const t=s.mode==="lanes"?"Lanes":"Grid";return s.columns===void 0||s.columns==="dynamic"?`${t} · dynamic`:`${t} · ${s.columns} column${s.columns===1?"":"s"}`}function We(s){return typeof s!="number"||!Number.isFinite(s)?Us:Math.max(1,Math.min(Ks,Math.floor(s)))}const qt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Vt=ss("ellipsis",qt);const Yt=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],de=ss("grid-2x2",Yt);const Gt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Jt=ss("zap",Gt),ts=6;function Xt(s="main",t="Main"){return{version:1,activeWorkspaceId:s,workspaces:[{id:s,name:t,tiles:[]}]}}function ns(){return{version:1,activeWorkspaceId:"",workspaces:[]}}function ys(s,t,r={}){const i=()=>r.allowEmpty?ns():Xt();if(!s||typeof s!="object")return i();const l=s;if(!Array.isArray(l.workspaces))return i();const m=[],d=new Set;for(const c of l.workspaces){if(!c||typeof c!="object")continue;const x=typeof c.id=="string"?c.id.trim():"",y=typeof c.name=="string"?c.name.trim():"";if(!x||!y||d.has(x)||!Array.isArray(c.tiles))continue;d.add(x);const S=typeof c.purpose=="string"?c.purpose.trim():"",w=Zt(c.columns),A=Qt(c.layout),M=typeof c.updatedAt=="number"&&Number.isFinite(c.updatedAt)&&c.updatedAt>=0?c.updatedAt:null;m.push({id:x,name:y,tiles:c.tiles.filter(t),...S?{purpose:S}:{},...w?{columns:w}:{},...A?{layout:A}:{},...M===null?{}:{updatedAt:M}})}return m.length===0?i():{version:1,activeWorkspaceId:typeof l.activeWorkspaceId=="string"&&d.has(l.activeWorkspaceId)?l.activeWorkspaceId:m[0].id,workspaces:m}}function Qt(s){if(!s||typeof s!="object")return null;const t=s;if(t.mode!=="solo"&&t.mode!=="lanes"&&t.mode!=="grid")return null;if(t.columns===void 0)return{mode:t.mode};if(t.columns==="dynamic")return{mode:t.mode,columns:"dynamic"};const r=We(t.columns);return{mode:t.mode,columns:r}}function Zt(s){if(typeof s!="number"||!Number.isFinite(s))return null;const t=Math.floor(s);return t<1?null:Math.min(t,ts)}function js(s,t){const r=t.id.trim();if(!r)return s;const i={...t,id:r},m=s.workspaces.some(d=>d.id===r)?s.workspaces.map(d=>d.id===r?i:d):[i,...s.workspaces];return{...s,activeWorkspaceId:r,workspaces:m}}function gs(s,t,r){const i=s.workspaces.findIndex(f=>f.id===t);if(i<0)return s;const l=s.workspaces[i],m={...l,...r};return Object.keys(r).every(f=>l[f]===m[f])?s:{...s,workspaces:s.workspaces.map((f,c)=>c===i?m:f)}}function en(s,t){return t===s.activeWorkspaceId||!s.workspaces.some(r=>r.id===t)?s:{...s,activeWorkspaceId:t}}function sn(s,t,r={}){if(s.workspaces.length<=1)return r.allowEmpty&&s.workspaces[0]?.id===t?ns():s;const i=s.workspaces.findIndex(d=>d.id===t);if(i<0)return s;const l=s.workspaces.filter(d=>d.id!==t),m=s.activeWorkspaceId===t?l[Math.min(i,l.length-1)].id:s.activeWorkspaceId;return{...s,activeWorkspaceId:m,workspaces:l}}function tn(s,t,r){return r>1?{axis:"horizontal",edge:s.x<t.left+t.width/2?"before":"after"}:{axis:"vertical",edge:s.y<t.top+t.height/2?"before":"after"}}function nn(s,t,r,i){if(t===r)return[...s];const l=s.findIndex(y=>y.id===t),m=s.findIndex(y=>y.id===r);if(l<0||m<0)return[...s];const d=[...s],[f]=d.splice(l,1);if(!f)return[...s];const c=d.findIndex(y=>y.id===r),x=i==="after"?c+1:c;return d.splice(Math.max(0,x),0,f),d}const rn="openscout.terminal.workspaces.v1",an=2,on="openscout.terminal.workspace-view.v1",Fe=2;function ve(s){const t=typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);return`${s}-${Date.now().toString(36)}-${t}`}const ln=24;function Bs(s,t,r){const i=t.replace(/[^A-Za-z0-9_-]+/gu,"-").replace(/^[^A-Za-z0-9_]+/u,"").slice(0,ln).replace(/-+$/u,""),l=cn(JSON.stringify([r,t,s]));return`scout-${s}-${i||"cell"}-${l}`}function cn(s){let t=2166136261;for(let r=0;r<s.length;r+=1)t^=s.charCodeAt(r),t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,"0")}function oe(s,t="shell"){return{id:ve("cell"),kind:"fresh",backend:s,agent:t}}function Ss(s){if(!s||typeof s!="object")return!1;const t=s;return typeof t.id!="string"||!t.id.trim()?!1:t.kind==="fresh"?typeof t.backend=="string"&&typeof t.agent=="string":t.kind==="registered"?typeof t.terminalSessionId=="string"&&typeof t.terminalSurfaceKey=="string":!1}function ws(s){return{id:s.id,name:s.name,...s.purpose?{purpose:s.purpose}:{},columns:s.columns,...s.layout?{layout:s.layout}:{},updatedAt:s.updatedAt,tiles:s.cells.map(t=>t.surfaceId&&t.terminalSessionId?{id:t.id,kind:"registered",terminalSessionId:t.terminalSessionId,terminalSurfaceKey:t.surfaceId}:{id:t.id,kind:"fresh",backend:mn(t.intent.hostId)?t.intent.hostId:"pty",agent:"shell"})}}function Ke(s,t={}){return{id:s.id,name:s.name,purpose:s.purpose??"",columns:Ee(Re({layout:s.layout,columns:s.columns,cellCount:s.tiles.length}),{tileCount:s.tiles.length}),layout:Re({layout:s.layout,columns:s.columns,cellCount:s.tiles.length}),cells:s.tiles.map(r=>r.kind==="registered"?{id:r.id,surfaceId:r.terminalSurfaceKey,terminalSessionId:r.terminalSessionId,intent:dn(r,t.sessions??[])}:{id:r.id,intent:{hostId:r.backend,sessionName:r.backend==="pty"?null:Bs(r.backend,r.id,s.id)}})}}function dn(s,t){const r=Ms(s.terminalSurfaceKey),i=t.find(l=>l.id===s.terminalSessionId||l.surfaces.some(m=>St(m,s.terminalSurfaceKey)));return{...r?{hostId:r.backend,sessionName:r.hostSession}:{},...i?.cwd?{cwd:i.cwd}:{},...i?.harness?{harness:i.harness}:{},...i?.resumeCommand?{resumeCommand:i.resumeCommand}:{}}}function mn(s){return s==="pty"||s==="tmux"||s==="zellij"||s==="herdr"}function un(s){if(!Array.isArray(s))return ys(s,Ss,{allowEmpty:!0});const t=s.flatMap(r=>{if(!r||typeof r!="object")return[];const i=r;if(typeof i.id!="string"||!i.id.trim())return[];const l=Array.isArray(i.cells)?i.cells:[];return[{id:i.id,name:typeof i.name=="string"&&i.name.trim()?i.name:i.id,purpose:i.purpose,columns:i.columns,updatedAt:i.updatedAt,tiles:l.map((m,d)=>({...m,id:`${i.id}-${d}`}))}]});return ys({activeWorkspaceId:t[0]?.id??"",workspaces:t},Ss,{allowEmpty:!0})}function pn(s,t,r){const i=s.find(l=>l.id===t);return i?i.capabilities.control.includes(r)||i.capabilities.harnessControl.includes(r):!1}function hn(s,t){return s.find(r=>r.id===t)??null}function fn(s){return[{value:"pty",label:"Shell",detail:"Disposable local shell",relayAttach:!0},...s.filter(t=>t.availability.installed&&t.capabilities.create).map(t=>({value:t.id,label:t.label,detail:t.description,relayAttach:t.capabilities.relayAttach})).sort((t,r)=>Number(r.relayAttach)-Number(t.relayAttach)||t.value.localeCompare(r.value))]}async function kn(){return me("/api/terminal-workspaces")}async function Ns(s){return(await me(`/api/terminal-workspaces/${encodeURIComponent(s.id)}`,{method:"PUT",body:JSON.stringify(s)})).workspace}async function bn(s,t){return me(`/api/terminal-workspaces/${encodeURIComponent(s)}/cells/${encodeURIComponent(t)}/revive`,{method:"POST",body:"{}"})}async function xn(s){return(await me(`/api/terminal-workspaces/${encodeURIComponent(s)}`,{method:"DELETE"})).deleted}function yn(s){const t=new Map;for(const r of s?.cells??[])t.set(r.cellId,r);return t}const Cs="scout:terminal-send-line";function jn(s){const t=s.detail;if(!t||typeof t!="object"||!("line"in t))return null;const r=t.line;return typeof r=="string"&&r.trim().length>0?r:null}const le=typeof window>"u"?o.useEffect:o.useLayoutEffect,gn="openscout.terminal.picker-view.v1",vs={mode:"grid",columns:"dynamic"},Ts=[{mode:"solo",label:"Solo",detail:"One terminal, full width",minimumCells:1},{mode:"lanes",label:"Lanes",detail:"Side by side, one row",minimumCells:2},{mode:"grid",label:"Grid",detail:"Rows and columns",minimumCells:4}],Sn=[{value:"shell",label:"Shell"},{value:"codex",label:"Codex"},{value:"claude",label:"Claude"},{value:"pi",label:"Pi"}],Ue="'JetBrainsMono Nerd Font', 'JetBrainsMonoNL Nerd Font', 'MesloLGS Nerd Font Mono', 'Hack Nerd Font Mono', 'JetBrains Mono', monospace",Is=s=>{},wn=()=>{};function Nn(){if(typeof window>"u")return{fontFamily:Ue,fontSize:13};const s=new URLSearchParams(window.location.search),t=s.get("terminalFontFamily")?.trim(),r=Number(s.get("terminalFontSize"));return{fontFamily:t?`'${t.replaceAll("'","\\'")}', ${Ue}`:Ue,fontSize:Number.isFinite(r)&&r>=9&&r<=32?r:13}}function rs(s){const t=Nn();return e.jsx(Pt,{...s,renderer:s.renderer??"dom",fontFamily:t.fontFamily,fontSize:t.fontSize})}function Cn(s,t){const[r,i]=o.useState({state:"loading",sessions:[]}),l=o.useCallback(()=>{i(d=>({state:"loading",sessions:d.sessions})),Ls({includeDiscovered:!0}).then(d=>{i({state:"ready",sessions:d})}).catch(d=>{i(f=>({state:"failed",sessions:f.sessions,error:d instanceof Error?d.message:String(d)}))})},[]);return o.useEffect(()=>{l()},[l]),{target:o.useMemo(()=>zs(r.sessions,s,t),[r.sessions,s,t]),loadState:r.state,loadSessions:l,hasSessionHint:!!s}}function vn(s,t,r){const i=bt(t,r),[l,m]=o.useState(i?{state:"preparing"}:{state:"ready"}),[d,f]=o.useState(0);return o.useEffect(()=>{if(!i||!s){m({state:"ready"});return}let c=!1;return m({state:"preparing"}),me(`/api/agents/${encodeURIComponent(s)}/session-catalog`).then(x=>{if(x.resumeCommand)return _t({command:x.resumeCommand,cwd:x.resumeCwd,agentId:s})}).then(()=>{c||m({state:"ready"})}).catch(x=>{c||m({state:"failed",error:x instanceof Error?x.message:String(x)})}),()=>{c=!0}},[s,i,d]),{ready:l.state==="ready",label:l.state==="failed"?"TAKEOVER FAILED":"PREPARING TAKEOVER",status:l.state==="failed"?l.error:"Resolving live session...",onRetry:l.state==="failed"?()=>f(c=>c+1):void 0}}function Tn(s){const{agentId:t,agent:r,mode:i,navigate:l,registeredTarget:m,showContextMenu:d}=s,{hosts:f}=Xe(),c=r?Ws(r.name):"var(--accent)",x=o.useRef(null),y=m?Ps(m.surface):Te(r),S=i==="observe",w=m?.session.cwd??r?.cwd??r?.projectRoot??void 0,A=Ve(),M=Ye(),h=xt({agentId:t,agent:r,registeredTarget:m,terminalSurface:y,relayUrl:A,harness:m?.session.harness??r?.harness,cwd:w,mode:i}),j=Qe({url:h.scopedRelayUrl,healthUrl:M,autoConnect:!0,...S?{}:{sessionKey:h.relayStorageSessionKey},...h.surfaceOptions??{},...h.orphanTTL?{orphanTTL:h.orphanTTL}:{},...h.cwd?{cwd:h.cwd}:{},...h.relayAgent?{agent:h.relayAgent}:{},controlMode:h.controlMode});le(()=>{j.resize(Ge,Je)},[j.resize]);const C=o.useMemo(()=>S?{...j,sendInput:Is,sendLine:Is,restart:wn}:j,[S,j]),v=yt({agentId:t,registeredTarget:m}),z=Ie(v,i),R=o.useCallback(()=>{const b=x.current;b?.querySelector(".xterm-helper-textarea")?.focus(),b?.querySelector(".xterm")?.focus()},[]);o.useEffect(()=>{const b=_=>{const $=_.detail?.line;return typeof $=="string"&&$.length>0?$:null},O=_=>{const $=b(_);!$||S||(C.sendInput($),R())},D=_=>{const $=b(_);!$||S||(C.sendLine($),R())};return window.addEventListener("scout:terminal-send-input",O),window.addEventListener("scout:terminal-send-line",D),()=>{window.removeEventListener("scout:terminal-send-input",O),window.removeEventListener("scout:terminal-send-line",D)}},[R,S,C]);const E=o.useCallback(b=>y?jt(y,b):null,[y]),W=o.useCallback(()=>{xs(As(z))},[z]),H=o.useCallback(()=>{S||!navigator.clipboard?.readText||navigator.clipboard.readText().then(b=>{b&&C.sendInput(b)}).catch(()=>{})},[S,C]),B=o.useCallback(()=>{Ce(h.relayStorageSessionKey);const b=E("detach");if(b){b.finally(()=>j.disconnect());return}j.disconnect()},[h.relayStorageSessionKey,j,E]),k=o.useCallback(()=>{Ce(h.relayStorageSessionKey);const b=E("force-quit-bridge");if(b){b.finally(()=>{j.connect(),window.setTimeout(R,250)});return}j.connect(),window.setTimeout(R,250)},[h.relayStorageSessionKey,R,j,E]),N=o.useCallback(()=>{if(S)return;const b=E("interrupt");b?b.catch(()=>C.sendInput("")):C.sendInput(""),R()},[R,S,E,C]),L=o.useCallback(()=>{if(S)return;const b=E("quit");b?b.catch(()=>C.sendInput("")):C.sendInput(""),R()},[R,S,E,C]),K=o.useCallback(()=>{if(S)return;const b=E("stop-job");if(b){b.finally(R);return}R()},[R,S,E]),ne=o.useCallback(()=>{if(Ce(h.relayStorageSessionKey),y&&!window.confirm(`Force quit Claude in ${He(y.sessionName)}?`))return;const b=E("force-quit");if(b){b.finally(()=>j.disconnect());return}const O=j.sessionId;if(!O){j.disconnect();return}gt(O).catch(()=>{}).finally(()=>j.disconnect())},[h.relayStorageSessionKey,j,E,y]),re=o.useCallback(()=>{if(!y||!window.confirm(`Restart Claude in ${He(y.sessionName)} and resume its latest session?`))return;Ce(h.relayStorageSessionKey);const b=E("restart-resume");b&&b.finally(()=>{j.disconnect(),window.setTimeout(()=>{j.connect(),window.setTimeout(R,250)},600)})},[h.relayStorageSessionKey,R,j,E,y]),ae=o.useCallback(b=>{l(Ie(v,b))},[l,v]),Z=o.useCallback(()=>{l(v)},[l,v]),ee=o.useMemo(()=>{const b=y?.backend??null,O=$=>pn(f,b,$),D=[];(!b||O("detach"))&&D.push({kind:"action",label:"Leave this session running",onSelect:B}),D.push({kind:"action",label:"Reconnect",onSelect:k});const _=[];return O("restart-resume")&&_.push({kind:"action",label:"Restart Claude and resume",onSelect:re}),O("force-quit")&&_.push({kind:"action",label:"Force quit Claude",onSelect:ne}),_.length>0&&D.push({kind:"separator"},..._),D},[B,ne,k,re,f,y?.backend]),he=o.useCallback(b=>{d(b,ee)},[ee,d]),se=o.useCallback(b=>{const O=typeof window>"u"?"":window.getSelection()?.toString()??"",D=[];O.trim()&&D.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{xs(O)}}),S||D.push({kind:"action",label:"Paste",shortcut:"⌘V",onSelect:H},{kind:"action",label:"Send Ctrl-C",shortcut:"⌃C",onSelect:N},{kind:"action",label:"Quit With Ctrl-D",shortcut:"⌃D",onSelect:L},{kind:"action",label:"Stop Running Job",onSelect:K}),D.length>0&&D.push({kind:"separator"}),D.push({kind:"action",label:"Focus Terminal",onSelect:R},...ee,{kind:"separator"},{kind:"action",label:S?"Open Takeover":"Open Observe",onSelect:()=>ae(S?"takeover":"observe")},{kind:"action",label:"Open Summary",onSelect:Z},{kind:"action",label:"Copy Terminal Link",onSelect:W}),d(b,D)},[W,R,N,ae,Z,H,L,S,ee,d,K]);return{color:c,terminalBodyRef:x,terminalSurface:y,readOnly:S,relay:j,terminalRelay:C,healthUrl:M,scopedRelayUrl:h.scopedRelayUrl,hasViewActions:!!(m||y),canSignalTerminal:!S&&!!(y||j.status==="connected"),canStopTerminalJob:!S&&!!y,handleSessionMenu:he,handleTerminalContextMenu:se,openMode:ae,openSummary:Z,interruptTerminal:N,quitTerminal:L,stopTerminalJob:K,terminalRouteBase:v}}function In({agent:s,agentId:t,color:r,navigate:i,label:l,status:m,onRetry:d}){return e.jsxs("div",{className:"s-term",children:[e.jsxs("div",{className:"s-term-bar",children:[e.jsx(ue,{slot:"terminal",fallback:{view:"terminal"},navigate:i,className:"s-term-back"}),s&&e.jsxs("div",{className:"s-term-agent",children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"18px",background:r},children:s.name[0]?.toUpperCase()}),e.jsx("span",{className:"s-term-agent-name",children:s.name}),s.handle&&e.jsxs("span",{className:"s-term-agent-handle",children:["@",s.handle]})]}),e.jsx("span",{className:"s-term-label",children:l}),e.jsx("div",{className:"s-term-status",children:d?"OFFLINE":"CONNECTING"})]}),e.jsx("div",{className:"s-term-body s-term-body--placeholder",children:e.jsxs("div",{className:"s-term-placeholder",children:[e.jsx("span",{children:m}),d&&e.jsx("button",{type:"button",onClick:d,children:"Retry"})]})})]})}function Rn({target:s,navigate:t}){const r=o.useMemo(()=>Ds([s.session]).find(d=>F(d.surface)===F(s.surface)),[s]),i={view:"terminal",terminalSessionId:s.session.id,terminalSurfaceKey:F(s.surface)},l=Nt(s.session,s.surface),m=Ct(s);return e.jsx("div",{className:"s-term s-term--summary",children:e.jsxs("div",{className:"s-term-summary",children:[e.jsxs("div",{className:"s-term-summary-main",children:[e.jsx(ue,{slot:"terminal",fallback:{view:"terminal"},navigate:t,className:"s-term-back"}),e.jsxs("div",{className:"s-term-summary-mark",children:[e.jsx(U,{size:18,strokeWidth:1.7}),e.jsx("span",{children:"Terminal"})]}),e.jsxs("div",{className:"s-term-summary-heading",children:[e.jsx("h1",{children:r?.title??s.surface.sessionName}),e.jsxs("p",{children:[s.surface.backend," · ",l]})]}),e.jsxs("div",{className:"s-term-summary-actions",children:[e.jsxs("button",{type:"button",className:"s-term-summary-action s-term-summary-action--primary",onClick:()=>t(Ie(i,"takeover")),children:[e.jsx(Ze,{size:14,strokeWidth:1.8}),e.jsx("span",{children:"Enter"})]}),e.jsxs("button",{type:"button",className:"s-term-summary-action",onClick:()=>t(Ie(i,"observe")),children:[e.jsx(Ut,{size:14,strokeWidth:1.8}),e.jsx("span",{children:"Observe"})]})]})]}),e.jsx("div",{className:"s-term-summary-preview",children:e.jsx(Ft,{surface:Ps(s.surface),lines:26,columns:112,pollMs:3e4,idlePollMs:3e4,className:"s-term-preview-peek"})}),e.jsx("dl",{className:"s-term-summary-details",children:m.map(([d,f])=>e.jsxs("div",{className:"s-term-summary-detail",children:[e.jsx("dt",{children:d}),e.jsx("dd",{title:f,children:f})]},d))})]})})}function as({agentId:s,agent:t,mode:r,navigate:i,registeredTarget:l,embedded:m=!1,tileActions:d}){const f=Es(),c=Tn({agentId:s,agent:t,mode:r,navigate:i,registeredTarget:l,showContextMenu:f});return e.jsxs("div",{className:`s-term${m?" s-term--embedded":""}`,children:[e.jsxs("div",{className:"s-term-bar s-term-bar--takeover",children:[e.jsxs("div",{className:"s-term-bar-left",children:[!m&&e.jsx(ue,{slot:"terminal",fallback:{view:"terminal"},navigate:i,className:"s-term-back"}),t&&e.jsxs("div",{className:"s-term-agent",children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"18px",background:c.color},children:t.name[0]?.toUpperCase()}),e.jsx("span",{className:"s-term-agent-name",children:t.name}),t.handle&&e.jsxs("span",{className:"s-term-agent-handle",children:["@",t.handle]})]}),l&&e.jsxs("div",{className:"s-term-registered-chip",children:[e.jsx(U,{size:14,strokeWidth:1.8}),e.jsx("span",{children:l.session.harness}),e.jsx("span",{children:l.session.sourceSessionId})]})]}),e.jsxs("div",{className:"s-term-bar-meta",children:[e.jsx("span",{className:"s-term-label",children:c.terminalSurface?c.readOnly?"TERMINAL OBSERVE":"TERMINAL TAKEOVER":"TAKEOVER"}),c.terminalSurface&&e.jsx("span",{className:"s-term-session",title:c.terminalSurface.sessionName,children:He(c.terminalSurface.sessionName)})]}),e.jsxs("div",{className:"s-term-bar-actions",children:[c.hasViewActions&&e.jsxs("div",{className:"s-term-action-cluster s-term-action-cluster--view","aria-label":"Terminal view actions",children:[l&&e.jsx("button",{type:"button",className:"s-term-action",onClick:c.openSummary,title:"Leave the terminal canvas and show the session summary",children:"Summary"}),c.terminalSurface&&e.jsx("button",{type:"button",className:"s-term-action",onClick:()=>c.openMode(c.readOnly?"takeover":"observe"),title:c.readOnly?"Switch to interactive takeover":"Switch to read-only terminal observe",children:c.readOnly?"Takeover":"Observe"})]}),(c.canSignalTerminal||c.canStopTerminalJob)&&e.jsxs("div",{className:"s-term-action-cluster s-term-action-cluster--signals","aria-label":"Terminal signal actions",children:[c.canSignalTerminal&&e.jsxs("button",{type:"button",className:"s-term-action s-term-action--warn",onClick:c.interruptTerminal,title:"Send Ctrl-C to the terminal",children:[e.jsx(Jt,{size:13,strokeWidth:1.8}),e.jsx("span",{children:"Ctrl-C"})]}),c.canSignalTerminal&&e.jsxs("button",{type:"button",className:"s-term-action s-term-action--warn",onClick:c.quitTerminal,title:"Send Ctrl-D / EOF to the terminal",children:[e.jsx(Dt,{size:13,strokeWidth:1.8}),e.jsx("span",{children:"Quit"})]}),c.canStopTerminalJob&&e.jsxs("button",{type:"button",className:"s-term-action s-term-action--warn",onClick:c.stopTerminalJob,title:"Stop Claude's current shell/tool job without quitting Claude",children:[e.jsx(Kt,{size:12,strokeWidth:2}),e.jsx("span",{children:"Stop Job"})]})]}),e.jsxs("button",{type:"button",className:"s-term-action s-term-session-menu",onClick:c.handleSessionMenu,title:"Open session, recovery, and external handoff actions",children:[e.jsx(Vt,{size:14,strokeWidth:1.8}),e.jsx("span",{children:"Session"})]}),e.jsx("div",{className:"s-term-status",children:c.relay.status==="connected"?"LIVE":c.relay.status==="connecting"?"CONNECTING":"OFFLINE"}),d]})]}),e.jsx("div",{ref:c.terminalBodyRef,className:"s-term-body",onContextMenuCapture:c.handleTerminalContextMenu,children:e.jsx(rs,{relay:c.terminalRelay,readOnly:c.readOnly,quiet:!0,configItems:[...c.terminalSurface?[{label:"backend",value:c.terminalSurface.backend},{label:"session",value:c.terminalSurface.sessionName},...c.terminalSurface.paneId?[{label:"pane",value:c.terminalSurface.paneId}]:[],...c.terminalSurface.socketDir?[{label:"socket",value:c.terminalSurface.socketDir}]:[],{label:"mode",value:c.readOnly?"read-only":"takeover"}]:[],{label:"ws",value:c.scopedRelayUrl},{label:"health",value:c.healthUrl}]})})]})}function En({terminalSessionId:s,terminalSurfaceKey:t,mode:r,navigate:i}){const{target:l,loadState:m,loadSessions:d,hasSessionHint:f}=Cn(s,t);return l&&r?e.jsx(as,{agent:null,mode:r,navigate:i,registeredTarget:l},`${F(l.surface)}:${r}`):l?e.jsx(Rn,{target:l,navigate:i}):e.jsx("div",{className:"s-term s-term--empty-main",children:e.jsxs("div",{className:"s-term-empty-main-mark",children:[e.jsx(U,{size:18,strokeWidth:1.6}),e.jsx("span",{children:m==="loading"?"Loading terminal":m==="failed"?"Terminal list unavailable":f?"Terminal unavailable":"Select a terminal"}),m==="failed"&&e.jsx("button",{type:"button",className:"s-term-empty-action",onClick:d,children:"Retry"})]})})}function Wn(s,t){return s.kind!=="fresh"||!s.sessionName?!1:t.some(r=>r.surfaces.some(i=>i.backend===s.backend&&i.sessionName===s.sessionName&&i.state!=="exited"))}function ce(s){return`${s.session.id}:${F(s.surface)}`}function An(s,t,r){if(s.kind==="fresh")return{id:s.id,kind:"fresh",backend:s.backend,agent:s.agent,...s.backend==="pty"?{}:{sessionName:Bs(s.backend,s.id,r)}};const i=zs(t,s.terminalSessionId,s.terminalSurfaceKey);return i?{id:s.id,kind:"registered",target:i}:{id:s.id,kind:"unavailable",terminalSessionId:s.terminalSessionId,terminalSurfaceKey:s.terminalSurfaceKey}}function G(s){return{session:s.session,surface:s.surface}}function Mn(s){const t=s.backend;return t!=="pty"&&!Os(t)?null:{view:"terminal",terminalBackend:t,terminalAgent:s.agent,terminalTabId:s.id,...s.sessionName?{terminalSessionName:s.sessionName}:{},...s.zellijSocketDir?{zellijSocketDir:s.zellijSocketDir}:{}}}function Ln(s,t="takeover"){return{view:"terminal",terminalSessionId:s.session.id,terminalSurfaceKey:F(s.surface),mode:t}}function Hs(s,t){if(typeof window>"u"){t(s);return}window.open(As(s),"_blank","noopener,noreferrer")}function Dn({navigate:s}){const{agents:t}=$s(),r=Es(),{hosts:i}=Xe(),l=o.useMemo(()=>fn(i),[i]),[m,d]=$e(rn,ns(),{version:an,migrate:un}),[f,c]=$e(on,"library"),x=o.useRef(new Map),[y,S]=o.useState(null),[w,A]=o.useState(""),[M,h]=o.useState(""),[j,C]=o.useState(vs),[v,z]=o.useState(()=>Array.from({length:4},()=>oe("pty"))),[R,E]=o.useState(0),[W,H]=o.useState({state:"loading",sessions:[]}),[B,k]=o.useState(0),[N,L]=o.useState(!0),[K,ne]=$e(gn,"list"),[re,ae]=o.useState(Mt),[Z,ee]=o.useState([]),[he,se]=o.useState(null),[b,O]=o.useState(null),[D,_]=o.useState(null),[$,os]=o.useState(!1),[fe,ls]=o.useState(null),[Vs,Ae]=o.useState(null),ke=o.useRef(null),be=o.useRef(null),xe=o.useRef("after"),ye=o.useRef(null),je=o.useRef(null),Me=o.useRef(!1),q=o.useCallback((n={})=>{n.silent||H(a=>({state:"loading",sessions:a.sessions})),Ls({includeDiscovered:!0}).then(a=>H({state:"ready",sessions:a})).catch(a=>{n.silent||H(u=>({state:"failed",sessions:u.sessions,error:a instanceof Error?a.message:String(a)}))})},[]);o.useEffect(()=>{q()},[q]),o.useEffect(()=>{const n=()=>{document.visibilityState==="visible"&&q({silent:!0})},a=window.setInterval(n,8e3);return window.addEventListener("focus",n),document.addEventListener("visibilitychange",n),()=>{window.clearInterval(a),window.removeEventListener("focus",n),document.removeEventListener("visibilitychange",n)}},[q]),o.useEffect(()=>{let n=!1;return kn().then(a=>{if(!n){ee(a.resolutions);for(const u of a.workspaces)x.current.set(u.id,JSON.stringify(Ke(ws(u),{sessions:W.sessions})));a.workspaces.length!==0&&d(u=>{let p=u;for(const g of a.workspaces)p=js(p,ws(g));return{...p,activeWorkspaceId:u.activeWorkspaceId||p.activeWorkspaceId}})}}).catch(()=>{}),()=>{n=!0}},[d]);const ge=o.useMemo(()=>Ds(W.sessions),[W.sessions]),V=o.useMemo(()=>ge.filter(n=>n.surface.state!=="exited"),[ge]),Le=o.useMemo(()=>{const n=new Set,a=[];for(const u of ge)u.surface.backend!=="herdr"||n.has(u.surface.sessionName)||(n.add(u.surface.sessionName),a.push(G(u)));return a},[ge]);o.useMemo(()=>Un(t),[t]);const cs=W.state==="failed"?W.error:null,Ys=m.workspaces,T=m.workspaces.find(n=>n.id===m.activeWorkspaceId)??null,te=Re({layout:T?.layout,columns:T?.columns,cellCount:T?.tiles.length??0}),Y=o.useMemo(()=>(T?.tiles??[]).map(n=>An(n,W.sessions,T?.id??"")),[T?.id,T?.tiles,W.sessions]),De=Ee(te,{tileCount:Y.length});o.useEffect(()=>{if(!T||!x.current.has(T.id))return;const n=Ke(T,{sessions:W.sessions}),a=JSON.stringify(n);x.current.get(T.id)!==a&&(x.current.set(T.id,a),Ns(n).catch(u=>se(u instanceof Error?u.message:String(u))))},[T,W.sessions]);const ds=f==="workspace"&&!T?"library":f,P=o.useCallback(n=>{d(a=>{const u=a.workspaces.find(g=>g.id===a.activeWorkspaceId);if(!u)return a;const p=n(u.tiles);return p===u.tiles?a:gs(a,u.id,{tiles:p,updatedAt:Date.now()})})},[d]),Se=o.useCallback(n=>{d(a=>a.activeWorkspaceId?gs(a,a.activeWorkspaceId,{layout:n,updatedAt:Date.now()}):a)},[d]),Gs=o.useCallback(n=>{d(a=>en(a,n.id)),L(!1),c("workspace")},[d,c]),Js=o.useCallback(()=>{c("library")},[c]),ie=o.useCallback(n=>{S(n?.id??null),A(n?.name??""),h(n?.purpose??""),C(n?Re({layout:n.layout,columns:n.columns,cellCount:n.tiles.length}):vs),z(n?.tiles??Array.from({length:4},()=>oe("pty"))),E(0),c("builder")},[c]),Xs=o.useCallback(n=>{C(a=>n.mode==="solo"?{mode:"solo"}:{mode:n.mode,columns:a.columns??"dynamic"}),z(a=>a.length>=n.minimumCells?a:[...a,...Array.from({length:n.minimumCells-a.length},()=>oe("pty"))]),E(a=>Math.max(0,Math.min(a,n.minimumCells-1)))},[]),Qs=o.useCallback(n=>{C(a=>a.mode==="solo"?{mode:"lanes",columns:n}:{...a,columns:n})},[]),Zs=o.useCallback(()=>{z(n=>{const a=[...n,oe("pty")];return E(a.length-1),a})},[]),et=o.useCallback(n=>{z(a=>{if(a.length<=1)return a;const u=a.filter((p,g)=>g!==n);return E(p=>Math.min(p,u.length-1)),u})},[]),st=o.useCallback(()=>{const n=w.trim();if(!n)return;const a={id:y??ve("workspace"),name:n,purpose:M.trim(),columns:Ee(j,{tileCount:v.length}),layout:j,tiles:v,updatedAt:Date.now()};d(p=>js(p,a));const u=Ke(a,{sessions:W.sessions});x.current.set(a.id,JSON.stringify(u)),Ns(u).catch(p=>se(p instanceof Error?p.message:String(p))),L(!1),c("workspace")},[y,d,c,W.sessions,v,j,w,M]),tt=o.useCallback(n=>{d(a=>sn(a,n,{allowEmpty:!0})),xn(n).catch(()=>{})},[d]),ms=o.useCallback((n,a="shell")=>{P(u=>[...u,oe(n,a)])},[P]),J=o.useCallback((n,a)=>{const u={kind:"registered",terminalSessionId:n.session.id,terminalSurfaceKey:F(n.surface)};P(p=>{const g=p.some(I=>I.kind==="registered"&&I.terminalSessionId===u.terminalSessionId&&Be(I.terminalSurfaceKey,u.terminalSurfaceKey));return a?p.some(I=>I.id===a)?p.map(I=>I.id===a?{...u,id:I.id}:I):p:g?p:[...p,{...u,id:ve("cell")}]})},[P]),nt=o.useCallback(n=>{J(n)},[J]),ze=o.useMemo(()=>new Set(Y.filter(n=>n.kind==="registered").map(n=>ce(n.target))),[Y]),rt=o.useCallback(n=>{const a=Le.length>0?Le.map(u=>{const p=ze.has(ce(u)),g=u.surface.state==="live"?"running":"detached";return{kind:"action",label:`${u.surface.sessionName} · ${g}${p?" · in grid":""}`,onSelect:()=>J(u)}}):[{kind:"action",label:"No herdr sessions discovered",onSelect:()=>{}}];r(n,a)},[Le,ze,J,r]),we=o.useCallback(n=>{n?.currentTarget.hasPointerCapture(n.pointerId)&&n.currentTarget.releasePointerCapture(n.pointerId),ye.current=null,je.current=null,Me.current=!1,O(null),_(null),os(!1)},[]),at=o.useCallback((n,a)=>{const u=n.target;n.button!==0||u instanceof Element&&u.closest("button, a")||(ye.current={pointerId:n.pointerId,target:G(a),targetId:ce(G(a)),startX:n.clientX,startY:n.clientY},n.currentTarget.setPointerCapture(n.pointerId))},[]),it=o.useCallback(n=>{const a=ye.current;if(!a||a.pointerId!==n.pointerId||Math.hypot(n.clientX-a.startX,n.clientY-a.startY)<6&&!b)return;b||O(a.targetId);const p=document.querySelector(".s-term--workspace");if(p){const bs=p.getBoundingClientRect();n.clientY<bs.top+72&&(p.scrollTop-=28),n.clientY>bs.bottom-72&&(p.scrollTop+=28)}const g=document.elementFromPoint(n.clientX,n.clientY),I=g?.closest(".s-term-workspace-cell"),X=!!(g?.closest(".s-term-workspace-add-cell")||!I&&g?.closest(".s-term--workspace")&&!g?.closest(".s-term-picker")),ks=X?null:I?.dataset.terminalTileId??null;je.current=ks,Me.current=X,_(ks),os(X)},[b]),ot=o.useCallback(n=>{const a=ye.current;!a||a.pointerId!==n.pointerId||(Me.current?J(a.target):je.current&&J(a.target,je.current),we(n))},[we,J]),lt=o.useCallback(n=>{we(n)},[we]),ct=o.useCallback(()=>{const n=V.map(G);n.length!==0&&P(a=>{const u=a.filter(g=>g.kind==="registered"),p=n.filter(g=>!u.some(I=>I.kind==="registered"&&I.terminalSessionId===g.session.id&&Be(I.terminalSurfaceKey,F(g.surface)))).map(g=>({id:ve("cell"),kind:"registered",terminalSessionId:g.session.id,terminalSurfaceKey:F(g.surface)}));return p.length===0?a:[...a,...p]})},[V,P]),Oe=o.useCallback(n=>{P(a=>{const u=a.filter(p=>p.id!==n);return u.length===a.length?a:u})},[P]),us=o.useCallback((n,a,u)=>{n!==a&&P(p=>nn(p,n,a,u))},[P]),Pe=o.useCallback((n,a)=>{P(u=>{const p=u.findIndex(X=>X.id===n),g=p+a;if(p<0||g<0||g>=u.length)return u;const I=[...u];return[I[p],I[g]]=[I[g],I[p]],I})},[P]),ps=o.useCallback((n,a)=>{P(u=>u.map(p=>p.id===n?{id:p.id,kind:"fresh",backend:a,agent:"shell"}:p))},[P]),Ne=o.useCallback(()=>[...Ts.map(n=>({kind:"action",label:n.label,onSelect:()=>Se(n.mode==="solo"?{mode:"solo"}:{mode:n.mode,columns:te.columns??"dynamic"})})),...te.mode==="solo"?[]:[{kind:"separator"},{kind:"action",label:"Dynamic columns",onSelect:()=>Se({...te,columns:"dynamic"})},...Array.from({length:ts},(n,a)=>({kind:"action",label:a===0?"One column":`${a+1} columns`,onSelect:()=>Se({...te,columns:a+1})}))],{kind:"separator"},{kind:"action",label:"Edit workspace…",onSelect:()=>T&&ie(T)}],[T,Se,ie,te]),dt=o.useCallback(n=>{r(n,Ne())},[Ne,r]),mt=o.useCallback((n,a)=>{const u=Y.findIndex(g=>g.id===a.id),p=[];u>0&&p.push({kind:"action",label:"Move left",onSelect:()=>Pe(a.id,-1)}),u>=0&&u<Y.length-1&&p.push({kind:"action",label:"Move right",onSelect:()=>Pe(a.id,1)}),p.length>0&&p.push({kind:"separator"}),p.push(...l.map(g=>({kind:"action",label:g.value==="pty"?"Replace with a disposable shell":`Replace with a session that survives (${g.label})`,onSelect:()=>ps(a.id,g.value)})),{kind:"separator"},{kind:"action",label:"Remove cell",onSelect:()=>Oe(a.id)},{kind:"separator"},...Ne()),r(n,p)},[Oe,Ne,Pe,ps,r,l,Y]),ut=o.useCallback((n,a)=>{const u=n.target;n.button===0&&u instanceof Element&&u.closest(".s-term-bar")&&!u.closest("button, a")&&(ke.current={pointerId:n.pointerId,tileId:a,startX:n.clientX,startY:n.clientY},n.currentTarget.setPointerCapture(n.pointerId))},[]),pt=o.useCallback(n=>{const a=ke.current;if(!a||a.pointerId!==n.pointerId||Math.hypot(n.clientX-a.startX,n.clientY-a.startY)<6&&!fe)return;fe||ls(a.tileId);const p=document.elementFromPoint(n.clientX,n.clientY)?.closest(".s-term-workspace-cell"),g=p?.dataset.terminalTileId??null;if(!p||!g||g===a.tileId){be.current=null,xe.current="after",Ae(null);return}const I=p.getBoundingClientRect(),X=tn({x:n.clientX,y:n.clientY},{left:I.left,top:I.top,width:I.width,height:I.height},De);be.current=g,xe.current=X.edge,Ae(g)},[fe,De]),hs=o.useCallback(n=>{const a=ke.current;if(!a||a.pointerId!==n.pointerId)return;const u=be.current;u&&us(a.tileId,u,xe.current),n.currentTarget.hasPointerCapture(n.pointerId)&&n.currentTarget.releasePointerCapture(n.pointerId),ke.current=null,be.current=null,xe.current="after",ls(null),Ae(null)},[us]),ht=o.useMemo(()=>yn(Z.find(n=>n.workspaceId===T?.id)),[T?.id,Z]),fs=o.useCallback(n=>{ae(a=>Lt(a,n))},[]),ft=o.useCallback(()=>{q(),k(n=>n+1)},[q]),kt=o.useCallback(n=>{T&&bn(T.id,n).then(()=>{se(null),q()}).catch(a=>se(a instanceof Error?a.message:String(a)))},[T,q]);return ds==="library"?e.jsx(zn,{workspaces:Ys,sessionsReady:W.state!=="loading",onOpen:Gs,onCreate:()=>ie(),onEdit:ie,onDelete:tt}):ds==="builder"?e.jsx(Pn,{editing:!!y,name:w,purpose:M,modes:Ts,layout:j,startOptions:l,cells:v,selectedSlot:R,terminalItems:V,onNameChange:A,onPurposeChange:h,onApplyMode:Xs,onColumnsChange:Qs,onSelectSlot:E,onAddCell:Zs,onRemoveCell:et,pickerView:K,pickerSort:re,onPickerView:ne,onPickerSort:fs,onAssignFresh:(n,a="shell")=>z(u=>u.map((p,g)=>g===R?{id:p.id,kind:"fresh",backend:n,agent:a}:p)),onAssignRegistered:n=>z(a=>a.map((u,p)=>p===R?{id:u.id,kind:"registered",terminalSessionId:n.session.id,terminalSurfaceKey:F(n.surface)}:u)),onCancel:()=>{c(T?"workspace":"library")},onSave:st}):e.jsx("div",{className:"s-term s-term--workspace",children:e.jsxs("div",{className:"s-term-workspace",children:[e.jsxs("header",{className:"s-term-workspace-head",children:[e.jsxs("div",{className:"s-term-workspace-title",children:[e.jsxs("span",{className:"s-term-summary-mark",children:[e.jsx(de,{size:18,strokeWidth:1.7}),e.jsxs("span",{children:["Workspaces / ",T?.name??"Workspace"]})]}),e.jsx("h1",{children:T?.name??"Workspace"}),T?.purpose&&e.jsx("p",{children:T.purpose})]}),e.jsxs("div",{className:"s-term-workspace-actions","aria-label":"Terminal workspace actions",children:[e.jsx("button",{type:"button",className:"s-term-workspace-action",onClick:Js,children:e.jsx("span",{children:"All workspaces"})}),e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:()=>T&&ie(T),children:[e.jsx(de,{size:14,strokeWidth:1.8}),e.jsx("span",{children:"Edit workspace"})]}),e.jsxs("button",{type:"button",className:"s-term-workspace-action",onClick:()=>ms("pty"),title:"Add a shell tile",children:[e.jsx(Q,{size:14,strokeWidth:1.9}),e.jsx("span",{children:"Shell"})]}),e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:()=>ms("pty","codex"),title:"Add a Codex TUI tile",children:[e.jsx(Q,{size:14,strokeWidth:1.9}),e.jsx("span",{children:"Codex"})]}),e.jsxs("button",{type:"button",className:"s-term-workspace-action",onClick:rt,title:"Add a herdr session's layout as a tile",children:[e.jsx(Q,{size:14,strokeWidth:1.9}),e.jsx("span",{children:"Herdr"})]}),e.jsxs("button",{type:"button",className:"s-term-workspace-action",onClick:()=>L(n=>!n),title:N?"Hide terminal picker":"Show terminal picker","aria-pressed":N,children:[e.jsx(U,{size:14,strokeWidth:1.8}),e.jsx("span",{children:N?"Hide picker":"Show picker"})]}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:ft,disabled:W.state==="loading",title:"Reload all terminal tiles","aria-label":"Reload all terminal tiles",children:e.jsx(es,{size:14,strokeWidth:1.8})})]})]}),cs&&e.jsxs("div",{className:"s-term-home-error",children:[e.jsx("span",{children:"Terminal registry unavailable"}),e.jsx("code",{children:cs})]}),he&&e.jsxs("div",{className:"s-term-home-error",children:[e.jsx("span",{children:"This workspace is not saved to Scout — it will not follow you to another device"}),e.jsx("code",{children:he})]}),(Y.length>0||N)&&e.jsxs("div",{className:"s-term-workspace-grid","aria-label":"Terminal tiles",style:{"--terminal-grid-columns":De},onContextMenu:dt,children:[Y.map(n=>e.jsx("div",{className:`s-term-workspace-cell${fe===n.id?" s-term-workspace-cell--dragging":""}${Vs===n.id||D===n.id?" s-term-workspace-cell--drop-target":""}`,"data-terminal-tile-id":n.id,onPointerDownCapture:a=>ut(a,n.id),onPointerMove:pt,onPointerUp:hs,onPointerCancel:hs,onContextMenu:a=>mt(a,n),children:e.jsx($n,{tile:n,navigate:s,onClose:Oe,resolution:ht.get(n.id)??null,onRevive:kt,live:Wn(n,W.sessions)})},`${n.id}:${B}`)),N&&e.jsxs("button",{type:"button",className:`s-term-workspace-add-cell${$?" s-term-workspace-add-cell--target":""}`,onClick:()=>L(!0),children:[e.jsx(Q,{size:20,strokeWidth:1.7}),e.jsx("strong",{children:"New slot"}),e.jsx("span",{children:b?"Drop to add":"Drag a terminal here"})]})]}),e.jsxs("section",{className:`s-term-picker${N?"":" s-term-picker--collapsed"}`,"aria-labelledby":"terminal-picker-title",onPointerDownCapture:n=>{const a=n.target;if(!(a instanceof Element))return;const u=a.closest("[data-picker-item-id]")?.dataset.pickerItemId,p=V.find(g=>g.id===u);p&&at(n,p)},onPointerMove:it,onPointerUp:ot,onPointerCancel:lt,children:[e.jsxs("header",{className:"s-term-picker-head",children:[e.jsxs("div",{className:"s-term-picker-title",children:[e.jsx(U,{size:14,strokeWidth:1.8}),e.jsx("h2",{id:"terminal-picker-title",children:"Terminal picker"}),e.jsx("span",{children:W.state==="loading"?"syncing":V.length})]}),e.jsxs("div",{className:"s-term-picker-actions",children:[N&&e.jsx("div",{className:"s-term-picker-views",role:"group","aria-label":"Picker view",children:["list","table"].map(n=>e.jsx("button",{type:"button",className:K===n?"is-selected":"",onClick:()=>ne(n),"aria-pressed":K===n,children:n==="list"?"List":"Table"},n))}),N&&e.jsxs("button",{type:"button",className:"s-term-workspace-action",onClick:ct,disabled:V.length===0,children:[e.jsx(Ze,{size:13,strokeWidth:1.8}),e.jsx("span",{children:"Attach all"})]}),e.jsxs("button",{type:"button",className:"s-term-picker-toggle",onClick:()=>L(n=>!n),"aria-expanded":N,children:[e.jsx("span",{children:N?"Hide":"Show terminal picker"}),e.jsx("span",{"aria-hidden":"true",children:N?"⌄":"⌃"})]})]})]}),N&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"s-term-picker-hint",children:"Drag a terminal onto a cell to place it, or onto New slot to grow the grid."}),V.length===0&&W.state!=="loading"?e.jsx("div",{className:"s-term-picker-empty",children:"No live terminals"}):e.jsx(qs,{items:V,view:K,sort:re,attachedIds:ze,draggedTargetId:b,onSort:fs,onAttach:nt,navigate:s})]})]})]})})}function zn({workspaces:s,sessionsReady:t,onOpen:r,onCreate:i,onEdit:l,onDelete:m}){return e.jsx("div",{className:"s-term s-term--workspace-library",children:e.jsxs("main",{className:"s-term-workspace-library",children:[e.jsxs("header",{className:"s-term-workspace-library-head",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"s-term-summary-mark",children:[e.jsx(de,{size:18,strokeWidth:1.7}),e.jsx("span",{children:"Terminals"})]}),e.jsx("h1",{children:"Workspaces"}),e.jsx("p",{children:"Saved terminal layouts for projects, roles, and cross-project operations."})]}),e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:i,children:[e.jsx(Q,{size:14,strokeWidth:1.9}),e.jsx("span",{children:"New workspace"})]})]}),s.length===0?e.jsxs("section",{className:"s-term-workspace-library-empty",children:[e.jsx(de,{size:24,strokeWidth:1.5}),e.jsx("h2",{children:"Create your first terminal workspace"}),e.jsx("p",{children:"Choose a layout, give it a purpose, place sessions, then enter the grid."}),e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:i,children:[e.jsx(Q,{size:14,strokeWidth:1.9}),e.jsx("span",{children:"Create workspace"})]})]}):e.jsx("div",{className:"s-term-workspace-library-grid",children:s.map(d=>e.jsxs("article",{className:"s-term-workspace-card",children:[e.jsx("div",{className:"s-term-workspace-card-preview",style:{"--terminal-grid-columns":d.columns??Fe},children:d.tiles.map(f=>e.jsx("span",{className:f.kind==="registered"?"is-session":"is-shell"},f.id))}),e.jsxs("div",{className:"s-term-workspace-card-copy",children:[e.jsxs("span",{children:[d.columns??Fe," column",(d.columns??Fe)===1?"":"s"," · ",d.tiles.length," cells"]}),e.jsx("h2",{children:d.name}),e.jsx("p",{children:d.purpose||"No purpose added yet."})]}),e.jsxs("div",{className:"s-term-workspace-card-actions",children:[e.jsx("button",{type:"button",className:"s-term-workspace-action",onClick:()=>l(d),children:"Edit"}),e.jsx("button",{type:"button",className:"s-term-workspace-action",onClick:()=>m(d.id),children:"Delete"}),e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:()=>r(d),disabled:!t,children:"Enter workspace"})]})]},d.id))})]})})}function qe(s,t){return s==="solo"?1:s==="lanes"?Math.max(2,Math.min(4,t)):Math.max(2,Math.min(3,t))}function On(s,t){return s==="solo"?1:s==="lanes"?qe(s,t):qe(s,t)*2}function Pn({editing:s,name:t,purpose:r,modes:i,layout:l,startOptions:m,cells:d,selectedSlot:f,terminalItems:c,onNameChange:x,onPurposeChange:y,onApplyMode:S,onColumnsChange:w,onSelectSlot:A,onAddCell:M,onRemoveCell:h,pickerView:j,pickerSort:C,onPickerView:v,onPickerSort:z,onAssignFresh:R,onAssignRegistered:E,onCancel:W,onSave:H}){const B=Ee(l,{tileCount:d.length});return e.jsx("div",{className:"s-term s-term--workspace-builder",children:e.jsxs("main",{className:"s-term-workspace-builder",children:[e.jsxs("header",{className:"s-term-workspace-builder-head",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"s-term-summary-mark",children:[e.jsx(de,{size:18,strokeWidth:1.7}),e.jsx("span",{children:"Workspace builder"})]}),e.jsx("h1",{children:s?"Edit workspace":"Create a workspace"}),e.jsx("p",{children:"Define the job, choose the grid, and place the sessions before entering."})]}),e.jsxs("div",{className:"s-term-workspace-builder-actions",children:[e.jsx("button",{type:"button",className:"s-term-workspace-action",onClick:W,children:"Cancel"}),e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:H,disabled:!t.trim(),children:s?"Save and enter":"Create and enter"})]})]}),e.jsxs("section",{className:"s-term-workspace-builder-identity","aria-label":"Workspace identity",children:[e.jsxs("label",{children:[e.jsx("span",{children:"Name"}),e.jsx("input",{value:t,onChange:k=>x(k.target.value),placeholder:"Release desk",autoFocus:!0})]}),e.jsxs("label",{children:[e.jsx("span",{children:"Purpose"}),e.jsx("input",{value:r,onChange:k=>y(k.target.value),placeholder:"Cross-project release monitoring"})]})]}),e.jsxs("section",{className:"s-term-workspace-builder-layout","aria-labelledby":"workspace-layout-title",children:[e.jsxs("div",{className:"s-term-workspace-builder-section-head",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Step 1"}),e.jsx("h2",{id:"workspace-layout-title",children:"Choose the layout"})]}),e.jsxs("p",{children:[Ht(l)," · ",d.length," cell",d.length===1?"":"s"]})]}),e.jsx("div",{className:"s-term-grid-presets","aria-label":"Workspace layout",children:i.map(k=>e.jsxs("button",{type:"button",className:`s-term-grid-preset${k.mode===l.mode?" s-term-grid-preset--selected":""}`,onClick:()=>S(k),"aria-pressed":k.mode===l.mode,children:[e.jsx("span",{className:"s-term-grid-preset-map",style:{"--terminal-preset-columns":qe(k.mode,B)},"aria-hidden":"true",children:Array.from({length:On(k.mode,B)},(N,L)=>e.jsx("i",{},L))}),e.jsx("span",{className:"s-term-grid-preset-label",children:k.label}),e.jsx("span",{className:"s-term-grid-preset-detail",children:k.detail})]},k.mode))}),l.mode!=="solo"&&e.jsxs("div",{className:"s-term-workspace-builder-columns",role:"group","aria-label":"Columns",children:[e.jsx("span",{children:"Columns"}),e.jsx("button",{type:"button",className:l.columns==="dynamic"||l.columns===void 0?"is-selected":"",onClick:()=>w("dynamic"),"aria-pressed":l.columns==="dynamic"||l.columns===void 0,title:"Fit the columns to the number of tiles",children:"Dynamic"}),Array.from({length:ts},(k,N)=>e.jsx("button",{type:"button",className:l.columns===N+1?"is-selected":"",onClick:()=>w(N+1),"aria-pressed":l.columns===N+1,children:N+1},N)),(l.columns==="dynamic"||l.columns===void 0)&&e.jsxs("em",{children:[B," right now"]})]})]}),e.jsxs("section",{className:"s-term-workspace-builder-placement","aria-labelledby":"workspace-placement-title",children:[e.jsxs("div",{className:"s-term-workspace-builder-section-head",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Step 2"}),e.jsx("h2",{id:"workspace-placement-title",children:"Place terminals"})]}),e.jsx("p",{children:"Select a cell, then choose a session or shell. Add as many cells as the work needs."})]}),e.jsxs("div",{className:"s-term-workspace-builder-canvas",children:[e.jsxs("div",{className:"s-term-workspace-builder-grid",style:{"--terminal-grid-columns":B},children:[d.map((k,N)=>{const L=k.kind==="registered"?c.find(K=>K.session.id===k.terminalSessionId&&Be(F(K.surface),k.terminalSurfaceKey)):null;return e.jsxs("div",{className:`s-term-workspace-builder-cell${f===N?" is-selected":""}`,children:[e.jsxs("button",{type:"button",className:"s-term-workspace-builder-cell-select",onClick:()=>A(N),"aria-pressed":f===N,children:[e.jsx("span",{children:String(N+1).padStart(2,"0")}),e.jsx(U,{size:17,strokeWidth:1.7}),e.jsx("strong",{children:k.kind==="registered"?L?.title??"Unavailable session":is(k.backend,k.agent).title}),e.jsx("small",{children:k.kind==="registered"?L?.cwdLabel||L?.detail:k.backend})]}),d.length>1&&e.jsx("button",{type:"button",className:"s-term-workspace-builder-cell-remove",onClick:()=>h(N),title:"Remove this cell","aria-label":`Remove cell ${N+1}`,children:e.jsx(pe,{size:13,strokeWidth:1.9})})]},k.id)}),e.jsxs("button",{type:"button",className:"s-term-workspace-builder-cell s-term-workspace-builder-cell--add",onClick:M,children:[e.jsx(Q,{size:18,strokeWidth:1.7}),e.jsx("strong",{children:"Add cell"})]})]}),e.jsxs("aside",{className:"s-term-workspace-builder-source",children:[e.jsxs("span",{children:["Cell ",String(f+1).padStart(2,"0")]}),e.jsx("h3",{children:"Start something new"}),e.jsxs("div",{className:"s-term-workspace-builder-source-actions",children:[Sn.map(k=>e.jsx("button",{type:"button",onClick:()=>R("pty",k.value),children:k.label},k.value)),m.filter(k=>k.value!=="pty").map(k=>e.jsxs("button",{type:"button",onClick:()=>R(k.value,"shell"),title:k.relayAttach?k.detail:`${k.detail} — Scout starts it; open it in ${k.label} to use it`,children:[k.label,!k.relayAttach&&e.jsx("sup",{"aria-label":"opens outside Scout",children:" ↗"})]},k.value))]}),e.jsxs("div",{className:"s-term-workspace-builder-source-head",children:[e.jsx("h3",{children:"Or use a live session"}),e.jsx("div",{className:"s-term-picker-views",role:"group","aria-label":"Session picker view",children:["list","table"].map(k=>e.jsx("button",{type:"button",className:j===k?"is-selected":"",onClick:()=>v(k),"aria-pressed":j===k,children:k==="list"?"List":"Table"},k))})]}),e.jsx("div",{className:"s-term-workspace-builder-sessions",children:c.length===0?e.jsx("span",{className:"s-term-workspace-builder-no-sessions",children:"No live sessions"}):e.jsx(qs,{items:c,view:j,sort:C,attachedIds:new Set,draggedTargetId:null,onSort:z,onAttach:k=>{const N=c.find(L=>L.session.id===k.session.id&&L.surface.sessionName===k.surface.sessionName);N&&E(N)}})})]})]})]})]})})}function _n({item:s,attached:t,dragging:r,onAttach:i,onOpen:l}){return e.jsxs("article",{className:`s-term-picker-item${t?" s-term-picker-item--attached":""}${r?" s-term-picker-item--dragging":""}`,"data-picker-item-id":s.id,children:[e.jsx("span",{className:"s-term-picker-grip","aria-hidden":"true",children:"⠿"}),e.jsxs("div",{className:"s-term-picker-item-main",children:[e.jsx("strong",{title:s.surface.sessionName,children:s.title}),e.jsx("span",{title:s.session.cwd??s.detail,children:s.cwdLabel||s.detail})]}),e.jsxs("div",{className:"s-term-picker-item-meta",children:[e.jsx("span",{children:s.surface.backend}),e.jsx("span",{children:_s(s)}),e.jsx("span",{title:s.session.cwd??void 0,children:s.project})]}),l&&e.jsx("button",{type:"button",className:"s-term-picker-add",onClick:l,children:"Open"}),e.jsx("button",{type:"button",className:"s-term-picker-add",onClick:()=>i(G(s)),disabled:t,children:t?"In grid":"Add"})]})}function qs({items:s,view:t,sort:r,attachedIds:i,draggedTargetId:l,onSort:m,onAttach:d,navigate:f}){const c=o.useMemo(()=>_e(s,r),[s,r]),{managed:x,regular:y}=o.useMemo(()=>wt(s),[s]),S=o.useMemo(()=>_e(x,r),[x,r]),w=o.useMemo(()=>_e(y,r),[y,r]),A=h=>{f?.({view:"terminal",terminalSessionId:h.session.id,terminalSurfaceKey:F(h.surface)})},M=(h,j)=>{const C=ce(G(h));return e.jsx(_n,{item:h,attached:i.has(C),dragging:l===C,onAttach:d,onOpen:j&&f?()=>A(h):void 0},h.id)};return t==="table"?e.jsx("div",{className:"s-term-picker-table-wrap",children:e.jsxs("table",{className:"s-term-picker-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[zt.map(h=>e.jsx("th",{scope:"col","aria-sort":r.column===h.id?r.direction==="asc"?"ascending":"descending":"none",children:e.jsxs("button",{type:"button",onClick:()=>m(h.id),children:[e.jsx("span",{children:h.label}),e.jsx("em",{"aria-hidden":"true",children:r.column===h.id?r.direction==="asc"?"▲":"▼":"·"})]})},h.id)),e.jsx("th",{scope:"col","aria-label":"Place"})]})}),e.jsx("tbody",{children:c.map(h=>{const j=ce(G(h)),C=Ot(h);return e.jsxs("tr",{"data-picker-item-id":h.id,className:i.has(j)?"is-attached":void 0,children:[e.jsx("td",{title:h.surface.sessionName,children:h.title}),e.jsx("td",{children:h.surface.backend}),e.jsx("td",{children:_s(h)}),e.jsx("td",{title:h.session.cwd??void 0,children:h.project}),e.jsx("td",{children:C?$t(C):"—"}),e.jsx("td",{children:e.jsx("button",{type:"button",className:"s-term-picker-add",onClick:()=>d(G(h)),disabled:i.has(j),children:i.has(j)?"In grid":"Add"})})]},h.id)})})]})}):e.jsxs("div",{className:"s-term-picker-list","aria-label":"Available terminals",children:[S.length>0&&e.jsxs("section",{className:"s-term-picker-group","aria-label":"Managed sessions",children:[e.jsx("h3",{className:"s-term-picker-group-title",children:"Managed sessions"}),S.map(h=>M(h,!0))]}),S.length>0&&w.length>0?e.jsxs("section",{className:"s-term-picker-group","aria-label":"Terminals",children:[e.jsx("h3",{className:"s-term-picker-group-title",children:"Terminals"}),w.map(h=>M(h,!1))]}):w.map(h=>M(h,!1))]})}function $n({tile:s,navigate:t,onClose:r,resolution:i,onRevive:l,live:m=!1}){if(s.kind==="registered")return s.target.surface.backend==="herdr"?e.jsx(Rs,{tileId:s.id,backend:"herdr",sessionName:s.target.surface.sessionName,live:s.target.surface.state==="live",onClose:r,navigate:t}):e.jsx(Kn,{tile:s,navigate:t,onClose:r});if(s.kind==="unavailable"){const d=i?.status==="revivable"&&!!l;return e.jsxs("section",{className:"s-term-workspace-tile s-term-workspace-tile--unavailable","aria-label":"Unavailable terminal session",children:[e.jsxs("div",{className:"s-term-bar",children:[e.jsxs("div",{className:"s-term-bar-left",children:[e.jsx("span",{className:"s-term-workspace-tile-mark",children:e.jsx(U,{size:14,strokeWidth:1.8})}),e.jsx("span",{className:"s-term-workspace-tile-name",children:"Not running"})]}),e.jsx("div",{className:"s-term-bar-actions",children:e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>r(s.id),title:"Remove cell","aria-label":"Remove cell",children:e.jsx(pe,{size:14,strokeWidth:1.8})})})]}),e.jsxs("div",{className:"s-term-workspace-unavailable-body",children:[e.jsx(U,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:d?"This tile is not running.":"This saved session is not currently live."}),e.jsx("span",{children:i?.detail??"Show the terminal picker to replace it, or wait for the session to reconnect."}),d&&e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:()=>l?.(s.id),children:"Start it again"})]})]})}return!Os(s.backend)&&s.backend!=="pty"?e.jsx(Rs,{tileId:s.id,backend:s.backend,sessionName:s.sessionName,live:m,onClose:r,navigate:t}):e.jsx(Fn,{tile:s,navigate:t,onClose:r})}function Rs({tileId:s,backend:t,sessionName:r,live:i,onClose:l,navigate:m}){const{hosts:d}=Xe(),f=hn(d,t),[c,x]=o.useState("idle"),[y,S]=o.useState(null),w=t==="herdr",{topology:A}=It(w?r??null:null,{enabled:w&&i}),M=o.useCallback(()=>{r&&(x("starting"),S(null),Rt(t,{sessionName:r}).then(()=>x("idle")).catch(v=>{x("failed"),S(v instanceof Error?v.message:String(v))}))},[t,r]),h=o.useCallback(()=>{if(!m||!r)return;const v=vt(t,r);v&&m({view:"terminal",terminalSurfaceKey:v})},[m,t,r]),j=o.useCallback(()=>{!m||!r||m(Et(r))},[m,r]),C=w&&A?.running?A.workspaces.flatMap(v=>v.tabs):[];return e.jsxs("section",{className:"s-term-workspace-tile s-term-workspace-tile--hosted","aria-label":`${f?.label??t} session`,children:[e.jsxs("div",{className:"s-term-bar",children:[e.jsxs("div",{className:"s-term-bar-left",children:[e.jsx("span",{className:"s-term-workspace-tile-mark",children:e.jsx(U,{size:14,strokeWidth:1.8})}),e.jsx("span",{className:"s-term-workspace-tile-name",children:f?.label??t})]}),e.jsxs("div",{className:"s-term-bar-meta",children:[e.jsx("span",{className:"s-term-label",children:i?"running":"not running"}),r&&e.jsx("span",{className:"s-term-session",title:r,children:r})]}),e.jsxs("div",{className:"s-term-bar-actions",children:[w&&i&&r&&m&&e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:j,title:"Enter — open a live web terminal attached to this session","aria-label":"Enter — open a live web terminal attached to this session",children:e.jsx(Ze,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>l(s),title:"Remove cell","aria-label":"Remove cell",children:e.jsx(pe,{size:14,strokeWidth:1.8})})]})]}),C.length>0?e.jsx("button",{type:"button",className:"s-term-workspace-hosted-body s-term-workspace-hosted-body--link",onClick:h,children:C.map(v=>{const z=Wt(v);return e.jsxs("span",{className:"s-term-workspace-hosted-tab",children:[e.jsx("span",{className:"s-term-workspace-hosted-tab-dots",children:z.statuses.map((R,E)=>e.jsx(At,{status:R},`${v.tabId}:${E}`))}),e.jsx("span",{className:"s-term-workspace-hosted-tab-label",children:z.label}),e.jsx("span",{className:"s-term-workspace-hosted-tab-count",children:z.statuses.length})]},v.tabId)})}):e.jsxs("div",{className:"s-term-workspace-unavailable-body",children:[e.jsx(U,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:i?`Running in ${f?.label??t}`:"Not running yet"}),e.jsx("span",{children:i?`Scout keeps this session for you. Open it in ${f?.label??t} to use it.`:`Scout can start a ${f?.label??t} session and keep it for you.`}),!i&&e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:M,disabled:c==="starting"||!r,children:c==="starting"?"Starting…":"Start it"}),y&&e.jsx("code",{children:y})]})]})}function Fn({tile:s,navigate:t,onClose:r}){const i=o.useRef(null),l=Ve(),m=Ye(),d=is(s.backend,s.agent),f=Mn(s),c=["scout-terminal-workspace",s.id,s.backend,s.agent,s.sessionName??"pty"].join("-"),x=Qe({url:l,healthUrl:m,autoConnect:!0,sessionKey:c,backend:s.backend,...s.sessionName?{terminalSession:s.sessionName}:{},...s.backend==="tmux"&&s.sessionName?{tmuxSession:s.sessionName}:{},...s.backend==="zellij"&&s.sessionName?{zellijSession:s.sessionName}:{},...s.backend==="zellij"&&s.zellijSocketDir?{zellijSocketDir:s.zellijSocketDir}:{},...s.backend==="herdr"&&s.sessionName?{tmuxSession:s.sessionName}:{},agent:s.agent,controlMode:"takeover"});le(()=>{x.resize(Ge,Je)},[x.resize]);const y=o.useCallback(()=>{f&&Hs(f,t)},[t,f]);return e.jsx("section",{className:"s-term-workspace-tile","aria-label":d.title,children:e.jsxs("div",{className:"s-term s-term--embedded",children:[e.jsxs("div",{className:"s-term-bar s-term-bar--fresh",children:[e.jsxs("div",{className:"s-term-bar-left",children:[e.jsx("span",{className:"s-term-workspace-tile-mark",children:e.jsx(U,{size:14,strokeWidth:1.8})}),e.jsx("span",{className:"s-term-workspace-tile-name",children:d.title})]}),e.jsxs("div",{className:"s-term-bar-meta",children:[e.jsx("span",{className:"s-term-label",children:s.backend}),e.jsx("span",{className:"s-term-session",children:d.detail})]}),e.jsxs("div",{className:"s-term-bar-actions",children:[e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:()=>x.restart(),title:"Restart terminal","aria-label":"Restart terminal",children:e.jsx(es,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:y,title:"Open terminal in a new window","aria-label":"Open terminal in a new window",children:e.jsx(Fs,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>r(s.id),title:"Close tile","aria-label":"Close tile",children:e.jsx(pe,{size:14,strokeWidth:1.8})})]})]}),e.jsx("div",{ref:i,className:"s-term-body",onMouseDown:()=>{i.current?.querySelector(".xterm-helper-textarea")?.focus(),i.current?.querySelector(".xterm")?.focus()},children:e.jsx(rs,{relay:x,quiet:!0,configItems:[{label:"backend",value:s.backend},{label:"agent",value:s.agent},...s.sessionName?[{label:"session",value:s.sessionName}]:[],...s.zellijSocketDir?[{label:"socket",value:s.zellijSocketDir}]:[],{label:"ws",value:l},{label:"health",value:m}]})})]})})}function Kn({tile:s,navigate:t,onClose:r}){const i=o.useCallback(()=>{Hs(Ln(s.target),t)},[t,s.target]);return e.jsx("section",{className:"s-term-workspace-tile","aria-label":s.target.surface.sessionName,children:e.jsx(as,{agent:null,mode:"takeover",navigate:t,registeredTarget:s.target,embedded:!0,tileActions:e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:i,title:"Open terminal in a new window","aria-label":"Open terminal in a new window",children:e.jsx(Fs,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>r(s.id),title:"Close tile","aria-label":"Close tile",children:e.jsx(pe,{size:14,strokeWidth:1.8})})]})})})}function Un(s){return[...s].filter(t=>!t.retiredFromFleet).sort((t,r)=>{const i=+!!Te(r)-+!!Te(t);if(i!==0)return i;const l=(r.updatedAt??0)-(t.updatedAt??0);return l!==0?l:t.name.localeCompare(r.name)})}function Bn({route:s,navigate:t}){const r=o.useRef(null),i=s.terminalBackend??"pty",l=s.terminalAgent??"shell",m=s.terminalTabId??"adhoc",d=i==="pty"?void 0:`scout-${i}-${m}`,f=s.terminalSessionName??d,c=Ve(),x=Ye(),y=is(i,l),S=["scout-terminal-new",i,l,f??m].join("-"),w=Qe({url:c,healthUrl:x,autoConnect:!0,sessionKey:S,backend:i,...f?{terminalSession:f}:{},...i==="tmux"&&f?{tmuxSession:f}:{},...i==="zellij"&&f?{zellijSession:f}:{},...i==="zellij"&&s.zellijSocketDir?{zellijSocketDir:s.zellijSocketDir}:{},...i==="herdr"&&f?{tmuxSession:f}:{},agent:l,controlMode:"takeover"}),A=o.useRef([]),M=o.useRef({status:w.status,sendLine:w.sendLine});return M.current={status:w.status,sendLine:w.sendLine},le(()=>{const h=j=>{const C=jn(j);if(!C)return;const v=M.current;if(v.status==="connected"){v.sendLine(C);return}A.current=[...A.current.slice(-15),C]};return window.addEventListener(Cs,h),()=>window.removeEventListener(Cs,h)},[]),le(()=>{if(w.status!=="connected"||A.current.length===0)return;const h=A.current;A.current=[];for(const j of h)w.sendLine(j)},[w.sendLine,w.status]),le(()=>{w.resize(Ge,Je)},[w.resize]),e.jsxs("div",{className:"s-term",children:[e.jsxs("div",{className:"s-term-bar",children:[e.jsx(ue,{slot:"terminal",fallback:{view:"terminal"},navigate:t,className:"s-term-back"}),e.jsx("span",{className:"s-term-label",children:y.title}),e.jsx("div",{className:"s-term-status",children:y.detail}),e.jsx("div",{className:"s-term-actions",children:e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:()=>w.restart(),title:"Restart terminal","aria-label":"Restart terminal",children:e.jsx(es,{size:14,strokeWidth:1.8})})})]}),e.jsx("div",{ref:r,className:"s-term-body",onMouseDown:()=>{r.current?.querySelector(".xterm-helper-textarea")?.focus(),r.current?.querySelector(".xterm")?.focus()},children:e.jsx(rs,{relay:w,quiet:!0,configItems:[{label:"backend",value:i},{label:"agent",value:l},...f?[{label:"session",value:f}]:[],...s.zellijSocketDir?[{label:"socket",value:s.zellijSocketDir}]:[],{label:"ws",value:c},{label:"health",value:x}]})})]})}function is(s,t){const r=t==="shell"?"Shell":t==="codex"?"Codex":t==="pi"?"Pi":"Claude";return s==="pty"?{title:r,detail:"fresh PTY tab"}:{title:`${r} ${s}`,detail:`fresh ${s} backed tab`}}function Hn({agentId:s,agent:t,mode:r,navigate:i,children:l}){const m=vn(s,t,r);return m.ready?e.jsx(e.Fragment,{children:l}):e.jsx(In,{agent:t,agentId:s,color:Ws(t.name),navigate:i,label:m.label,status:m.status,onRetry:m.onRetry})}function qn({navigate:s}){return e.jsx("div",{className:"s-term",children:e.jsxs("div",{className:"s-term-bar",children:[e.jsx(ue,{slot:"terminal",fallback:{view:"terminal"},navigate:s,className:"s-term-back"}),e.jsx("span",{className:"s-term-label",children:"Terminal"}),e.jsx("div",{className:"s-term-status",children:"Resolving agent..."})]})})}function Vn({route:s,navigate:t}){const{agentId:r,mode:i,terminalSessionId:l,terminalSurfaceKey:m}=s,{agents:d}=$s();if(s.terminalBackend)return e.jsx(Bn,{route:s,navigate:t});const f=s.terminalSurfaceKey?Ms(s.terminalSurfaceKey):null;if(!r&&f?.backend==="herdr")return e.jsx(Tt,{sessionName:f.hostSession,navigate:t});if(!r)return!l&&!m?e.jsx(Dn,{navigate:t}):e.jsx(En,{terminalSessionId:l,terminalSurfaceKey:m,mode:i,navigate:t});const c=d.find(S=>S.id===r)??null;if(!c)return e.jsx(qn,{navigate:t});const x=Te(c),y=x?`${x.backend}:${c.id}:${x.sessionName}:${i??"takeover"}`:`takeover:${r}:${i??"takeover"}`;return e.jsx(Hn,{agentId:r,agent:c,mode:i,navigate:t,children:e.jsx(as,{agentId:r,agent:c,mode:i,navigate:t})},y)}function Qr({agentId:s,mode:t,terminalSessionId:r,terminalSurfaceKey:i,navigate:l}){const m={view:"terminal",agentId:s,mode:t,terminalSessionId:r,terminalSurfaceKey:i};return e.jsx(Vn,{route:m,navigate:l})}export{Vn as TerminalContent,Qr as TerminalScreen};
@@ -0,0 +1 @@
1
+ import{r as e,j as c,a as A,b as C,S as k}from"./index-CzVeWScw.js";import{C as y}from"./ContextMenu-N-Z6X0Z1.js";import{a as T}from"./api-h5zurxmi.js";import{L,D as x,f as R,S as P}from"./Provider-DSsb2gLR.js";import{i as I}from"./colors-BtO5_zlx.js";import{r as j,a as D}from"./router-B-K15T7B.js";import{TerminalContent as H}from"./Terminal-Dp1FSGIS.js";import"./sse-QcU9bikk.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-BCG2kOmd.js";import"./createLucideIcon-ClCdc3F9.js";import"./TextDocumentSurface-DRjctOIt.js";/* empty css */import"./file-text-DG-pufl1.js";import"./x-D4X_y1j_.js";import"./chevron-right-CNE6QAVr.js";import"./code-xml--LjSM4Mv.js";import"./arrow-left-_vS7itsV.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BJnFoFDP.js";import"./MessageComposerSuggestions-Cs9u-F_3.js";import"./NewChatComposer-DXDxV2Mh.js";import"./runtime-picker-BCQD7d4K.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Byb9kSFx.js";import"./index-Dewd56RX.js";import"./HarnessMark-BE-YSyci.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-CnjoswTG.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-DRCbnzyY.js";import"./search-C3bSJluv.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-C3qU8tnY.js";/* empty css */import"./clipboard-e3fSpeo7.js";import"./terminal-relay-BkXjjSkq.js";import"./HerdrSession-DKFCJMst.js";import"./chunk-YOZR3KYS-DLOc92uD.js";import"./arrow-down-D3-IbArq.js";import"./terminal-DrTkVXIj.js";import"./refresh-cw-4oeFn1Jn.js";import"./check-COxArFXG.js";import"./copy-4LfKIdQJ.js";import"./eye-BFlhMzQL.js";import"./session-table-1xdSxSXq.js";import"./chunk-JTPDIGGW-s6WbxdjC.js";import"./terminal-takeover-KvmTwABa.js";import"./BackToPicker-DZg_4nHL.js";import"./TmuxPeek-DNC4uWky.js";/* empty css */import"./plus-CmFQp9Uj.js";import"./external-link-CnaI1QFS.js";function g(){const t=new URLSearchParams(window.location.search).get("route")?.trim()||"/terminal",s=j(t);return s.view==="terminal"?s:{view:"terminal"}}function S(o){const t=new URLSearchParams(window.location.search);return t.set("route",D(o)),t.has("profile")||t.set("profile","macos.terminal"),`${window.location.pathname}?${t.toString()}${window.location.hash}`}function Ue(){const[o,t]=e.useState(()=>g()),s=!!(o.terminalBackend||o.agentId||o.terminalSessionId||o.terminalSurfaceKey);e.useEffect(()=>{const i=()=>t(g());return window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)},[]);const n=e.useCallback(i=>{if(i.view!=="terminal"){const p={view:"terminal"},a=S(p);window.history.pushState(null,"",a),t(p);return}const l=S(i);window.history.pushState(null,"",l),t(i)},[]);return c.jsx(M,{route:o,navigate:n,children:c.jsx("div",{className:`s-terminal-embed${s?" s-terminal-embed--surface":""}`,children:c.jsx(H,{route:o,navigate:n})})})}function M({route:o,navigate:t,children:s}){const[n,i]=e.useState([]),[l,p]=e.useState({status:"checking",message:null,lastCheckedAt:null}),a=e.useRef(null),u=e.useMemo(()=>A(),[]),f=e.useMemo(()=>C(),[]),b=e.useMemo(()=>({...u==="light"?L:x,...f??{}}),[u,f]),w=e.useCallback(()=>{p({status:"online",message:null,lastCheckedAt:Date.now()})},[]),h=e.useCallback(r=>{p({status:"offline",message:R(r),lastCheckedAt:Date.now()})},[]),m=e.useCallback(async()=>{if(a.current)return a.current;const r=(async()=>{try{i(await T("/api/agents")),w()}catch(d){h(d)}})();a.current=r;try{await r}finally{a.current=null}},[h,w]);e.useEffect(()=>{m()},[m]),e.useEffect(()=>{const r=()=>{document.visibilityState!=="hidden"&&m()},d=window.setInterval(r,15e3);return window.addEventListener("focus",r),document.addEventListener("visibilitychange",r),()=>{window.clearInterval(d),window.removeEventListener("focus",r),document.removeEventListener("visibilitychange",r)}},[m]);const v=e.useMemo(()=>n.filter(r=>I(r.state)).length,[n]),E=e.useMemo(()=>({route:o,navigate:t,navigateBack:()=>{typeof window<"u"&&window.history.back()},canNavigateBack:typeof window<"u"&&window.history.length>1,agents:n,agentsLoaded:l.status!=="checking",onlineCount:v,apiConnection:l,appearanceDetails:k,updateAppearanceDetails:()=>{},reload:m,onboarding:null,refreshOnboarding:async()=>{},onboardingSkipped:!0,skipOnboarding:()=>{},settingsOpen:!1,openSettings:()=>{},closeSettings:()=>{},scoutbotAgentId:"scoutbot",scoutbotConversationId:null,applyScoutbotUiAction:()=>{},selectedBrokerAttempt:null,inspectBrokerAttempt:()=>{},clearBrokerAttempt:()=>{},selectedKnowledgeHit:null,selectedKnowledgeQuery:"",inspectKnowledgeHit:()=>{},clearKnowledgeHit:()=>{},focusedSession:null,focusSession:()=>{},openFilePreview:()=>{},closeFilePreview:()=>{},openContextCapture:()=>{},closeContextCapture:()=>{}}),[n,l,t,v,m,o]);return c.jsx(P.Provider,{value:E,children:c.jsx("div",{"data-scout-theme":u,"data-scout-theme-mode":u,style:b,children:c.jsx(y,{children:s})})})}export{Ue as TerminalEmbedScreen};
@@ -1,4 +1,4 @@
1
- import{j as i,r as I}from"./index-DMiGbrBt.js";const N={cjs:"javascript",css:"css",htm:"html",html:"html",js:"javascript",jsx:"javascript",json:"json",mjs:"javascript",md:"markdown",mdx:"markdown",sh:"shell",ts:"typescript",tsx:"typescript",txt:"plain"},L=new Set(["cjs","css","htm","html","js","jsx","json","mjs","sh","ts","tsx"]);function b(t){const s=(t.filename??t.title??t.uri??"").split(/[?#]/)[0],n=s.split("/").pop()??s,r=n.lastIndexOf(".");return r>=0?n.slice(r+1).toLowerCase():""}function S(t){const e=t.mediaType?.toLowerCase()??"";return e.includes("json")?"json":e.includes("markdown")?"markdown":e.includes("javascript")?"javascript":e.includes("typescript")?"typescript":e.includes("html")?"html":e.includes("css")?"css":e.includes("shell")||e.includes("x-sh")?"shell":N[b(t)]??"plain"}function E(t){const e=t.mediaType?.toLowerCase()??"",s=b(t);if(e.includes("markdown")||s==="md"||s==="mdx")return"markdown";if(e.includes("json")||e.includes("javascript")||e.includes("typescript")||e.includes("html")||e.includes("xml")||e.includes("css")||L.has(s))return"code";if(e.startsWith("text/")||s==="txt")return"text";const n=t.value.trim();return/^#{1,6}\s+/m.test(n)||/```[\s\S]*```/.test(n)?"markdown":"text"}function it(t){const e=t.title??t.filename??t.uri?.split("/").pop()??"Untitled",s=t.language??S(t);return{id:t.id??t.uri??e,title:e,uri:t.uri,mediaType:t.mediaType,language:s,kind:t.kind??E(t),value:t.value,readOnly:t.readOnly}}function ct({document:t,mode:e,className:s}){const n=e??(t.kind==="markdown"?"preview":"read"),r=t.kind==="markdown"&&n==="preview"?i.jsx(k,{markdown:t.value}):i.jsx(W,{document:t});return i.jsx("div",{className:`s-text-document-surface s-text-document-surface-${t.kind}${s?` ${s}`:""}`,children:r})}function W({document:t}){const e=I.useMemo(()=>_(t.value,t.language??t.kind),[t.language,t.kind,t.value]);return i.jsx("pre",{className:"s-text-document-code","data-language":t.language??t.kind,children:i.jsx("code",{children:e})})}function k({markdown:t}){const e=A(t);return i.jsx("div",{className:"s-text-document-markdown",children:e.length>0?e:i.jsx("p",{})})}function A(t){const e=t.replace(/\r\n/g,`
1
+ import{j as i,r as I}from"./index-CzVeWScw.js";const N={cjs:"javascript",css:"css",htm:"html",html:"html",js:"javascript",jsx:"javascript",json:"json",mjs:"javascript",md:"markdown",mdx:"markdown",sh:"shell",ts:"typescript",tsx:"typescript",txt:"plain"},L=new Set(["cjs","css","htm","html","js","jsx","json","mjs","sh","ts","tsx"]);function b(t){const s=(t.filename??t.title??t.uri??"").split(/[?#]/)[0],n=s.split("/").pop()??s,r=n.lastIndexOf(".");return r>=0?n.slice(r+1).toLowerCase():""}function S(t){const e=t.mediaType?.toLowerCase()??"";return e.includes("json")?"json":e.includes("markdown")?"markdown":e.includes("javascript")?"javascript":e.includes("typescript")?"typescript":e.includes("html")?"html":e.includes("css")?"css":e.includes("shell")||e.includes("x-sh")?"shell":N[b(t)]??"plain"}function E(t){const e=t.mediaType?.toLowerCase()??"",s=b(t);if(e.includes("markdown")||s==="md"||s==="mdx")return"markdown";if(e.includes("json")||e.includes("javascript")||e.includes("typescript")||e.includes("html")||e.includes("xml")||e.includes("css")||L.has(s))return"code";if(e.startsWith("text/")||s==="txt")return"text";const n=t.value.trim();return/^#{1,6}\s+/m.test(n)||/```[\s\S]*```/.test(n)?"markdown":"text"}function it(t){const e=t.title??t.filename??t.uri?.split("/").pop()??"Untitled",s=t.language??S(t);return{id:t.id??t.uri??e,title:e,uri:t.uri,mediaType:t.mediaType,language:s,kind:t.kind??E(t),value:t.value,readOnly:t.readOnly}}function ct({document:t,mode:e,className:s}){const n=e??(t.kind==="markdown"?"preview":"read"),r=t.kind==="markdown"&&n==="preview"?i.jsx(k,{markdown:t.value}):i.jsx(W,{document:t});return i.jsx("div",{className:`s-text-document-surface s-text-document-surface-${t.kind}${s?` ${s}`:""}`,children:r})}function W({document:t}){const e=I.useMemo(()=>_(t.value,t.language??t.kind),[t.language,t.kind,t.value]);return i.jsx("pre",{className:"s-text-document-code","data-language":t.language??t.kind,children:i.jsx("code",{children:e})})}function k({markdown:t}){const e=A(t);return i.jsx("div",{className:"s-text-document-markdown",children:e.length>0?e:i.jsx("p",{})})}function A(t){const e=t.replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),s=[];let n=0;for(;n<e.length;){const r=e[n]??"";if(!r.trim()){n+=1;continue}const c=/^```(\S*)\s*$/.exec(r);if(c){const l=[];for(n+=1;n<e.length&&!/^```\s*$/.test(e[n]??"");)l.push(e[n]??""),n+=1;n<e.length&&(n+=1),s.push({kind:"code",content:l.join(`
4
4
  `),language:c[1]||void 0});continue}const a=/^(#{1,6})\s+(.+)$/.exec(r);if(a){s.push({kind:"heading",depth:z(a[1].length),content:a[2].trim()}),n+=1;continue}if(/^ {0,3}([-*_])(?:\s*\1){2,}\s*$/.test(r)){s.push({kind:"hr"}),n+=1;continue}if(/^>\s?/.test(r)){const l=[];for(;n<e.length&&/^>\s?/.test(e[n]??"");)l.push((e[n]??"").replace(/^>\s?/,"")),n+=1;s.push({kind:"blockquote",content:l.join(" ")});continue}const o=/^(\s*)([-*+]|\d+[.)])\s+(.+)$/.exec(r);if(o){const l=/\d/.test(o[2]),m=[];for(;n<e.length;){const f=/^(\s*)([-*+]|\d+[.)])\s+(.+)$/.exec(e[n]??"");if(!f||/\d/.test(f[2])!==l)break;m.push(f[3]),n+=1}s.push({kind:"list",ordered:l,items:m});continue}const u=y(e,n);if(u){s.push(u.block),n=u.nextIndex;continue}const p=[];for(;n<e.length;){const l=e[n]??"";if(!l.trim()||/^```/.test(l)||/^(#{1,6})\s+/.test(l)||/^ {0,3}([-*_])(?:\s*\1){2,}\s*$/.test(l)||/^>\s?/.test(l)||/^(\s*)([-*+]|\d+[.)])\s+/.test(l)||y(e,n))break;p.push(l.trim()),n+=1}s.push({kind:"paragraph",content:p.join(" ")})}return s.map((r,c)=>C(r,c))}function z(t){return t<=1?1:t===2?2:t===3?3:t===4?4:t===5?5:6}function C(t,e){switch(t.kind){case"heading":{const n=`h${t.depth}`;return i.jsx(n,{children:d(t.content)},e)}case"paragraph":return i.jsx("p",{children:d(t.content)},e);case"blockquote":return i.jsx("blockquote",{children:d(t.content)},e);case"list":{const n=t.ordered?"ol":"ul";return i.jsx(n,{children:t.items.map((r,c)=>i.jsx("li",{children:d(r)},`${e}:${c}`))},e)}case"code":const s=$(t.language);return i.jsx("pre",{className:"s-text-document-fenced-code","data-language":s,children:i.jsx("code",{children:_(t.content,s)})},e);case"hr":return i.jsx("hr",{},e);case"table":return i.jsx("div",{className:"s-text-document-table-wrap",children:i.jsxs("table",{className:"s-text-document-table",children:[i.jsx("thead",{children:i.jsx("tr",{children:t.headers.map((n,r)=>i.jsx("th",{"data-align":t.alignments[r]??void 0,children:d(n)},`${e}:h:${r}`))})}),i.jsx("tbody",{children:t.rows.map((n,r)=>i.jsx("tr",{children:n.map((c,a)=>i.jsx("td",{"data-align":t.alignments[a]??void 0,children:d(c)},`${e}:r:${r}:${a}`))},`${e}:r:${r}`))})]})},e)}}function y(t,e){const s=w(t[e]??""),n=R(t[e+1]??"");if(!s||!n||s.length!==n.length)return null;const r=s.length,c=[];let a=e+2;for(;a<t.length;){const o=w(t[a]??"");if(!o||o.length<2)break;c.push(T(o,r)),a+=1}return{block:{kind:"table",alignments:n,headers:T(s,r),rows:c},nextIndex:a}}function w(t){const e=t.trim();if(!e.includes("|"))return null;let s=e;s.startsWith("|")&&(s=s.slice(1)),s.endsWith("|")&&!s.endsWith("\\|")&&(s=s.slice(0,-1));const n=[];let r="";for(let c=0;c<s.length;c+=1){const a=s[c];if(a==="\\"&&s[c+1]==="|"){r+="|",c+=1;continue}if(a==="|"){n.push(r.trim()),r="";continue}r+=a}return n.push(r.trim()),n.length>=2?n:null}function R(t){const e=w(t);if(!e||e.length<2)return null;const s=[];for(const n of e){const r=n.replace(/\s/g,"");if(!/^:?-{3,}:?$/u.test(r))return null;r.startsWith(":")&&r.endsWith(":")?s.push("center"):r.endsWith(":")?s.push("right"):r.startsWith(":")?s.push("left"):s.push(null)}return s}function T(t,e){const s=t.slice(0,e);for(;s.length<e;)s.push("");return s}const M=/\/\/[^\n]*|\/\*[\s\S]*?\*\/|`(?:\\[\s\S]|[^`\\])*`|'(?:\\.|[^'\\\n])*'|"(?:\\.|[^"\\\n])*"|\b\d+(?:\.\d+)?(?:e[+-]?\d+)?n?\b|\b[A-Za-z_$][\w$]*\b|=>|[{}()[\].,;:?]|[-+*/%=&|!<>~^]+/giu,D=/"(?:\\.|[^"\\])*"|-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b|\b(?:true|false|null)\b|[{}\[\]:,]/giu,O=/\/\*[\s\S]*?\*\/|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|#[0-9a-f]{3,8}\b|@[a-z-]+|--[a-z0-9-]+|[a-z-]+(?=\s*:)|\b\d+(?:\.\d+)?(?:%|px|r?em|vh|vw|vmin|vmax|s|ms|deg|fr)?\b|[{}():;,]|\.[a-z_][\w-]*|#[a-z_][\w-]*|[a-z_][\w-]*/giu,v=/<!--[\s\S]*?-->|<!doctype[^>]*>|<\/?[a-z][\w:-]*|\/?>|[a-z_:][\w:.-]*(?==)|=|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|&[a-z0-9#]+;/giu,P=/#[^\n]*|"(?:\\.|[^"\\])*"|'[^']*'|\$\{?[\w?@#$!-]+\}?|--?[A-Za-z0-9][\w-]*(?:=[^\s]+)?|\b(?:case|cd|do|done|echo|elif|else|esac|exit|export|fi|for|function|if|in|local|return|set|source|test|then|unset|while)\b|\b\d+\b|[|&;(){}<>]/giu,H=new Set(["abstract","as","async","await","break","case","catch","class","const","continue","declare","default","delete","do","else","enum","export","extends","finally","for","from","function","get","if","implements","import","in","infer","interface","is","keyof","let","new","of","private","protected","public","readonly","return","satisfies","set","static","switch","throw","try","type","typeof","var","void","while","with","yield"]),B=new Set(["false","null","super","this","true","undefined"]);function _(t,e){switch($(e)){case"css":return g(t,O,Z);case"html":return g(t,v,U);case"javascript":case"typescript":return g(t,M,K);case"json":return g(t,D,q);case"shell":return g(t,P,Y);default:return[t]}}function g(t,e,s){const n=[];let r=0,c=0;e.lastIndex=0;let a;for(;(a=e.exec(t))!==null;){const o=a[0];if(!o){e.lastIndex+=1;continue}a.index>r&&n.push(t.slice(r,a.index));const u=s(o,a.index,a.index+o.length,t);n.push(u?i.jsx("span",{className:`s-syntax s-syntax-${u}`,children:o},`syntax-${c++}`):o),r=a.index+o.length}return r<t.length&&n.push(t.slice(r)),n.length>0?n:[t]}function $(t){const e=String(t??"").toLowerCase().replace(/^\./,"");return e==="bash"||e==="sh"||e==="shell"||e==="zsh"?"shell":e==="css"||e==="scss"?"css":e==="html"||e==="htm"||e==="xml"||e==="svg"?"html":e==="js"||e==="jsx"||e==="javascript"||e==="mjs"||e==="cjs"?"javascript":e==="json"||e==="jsonc"?"json":e==="markdown"||e==="md"||e==="mdx"?"markdown":e==="ts"||e==="tsx"||e==="typescript"?"typescript":"plain"}function K(t,e,s,n){return t.startsWith("//")||t.startsWith("/*")?"comment":x(t)?"string":/^\d/u.test(t)?"number":H.has(t)?"keyword":B.has(t)?"literal":/^[A-Z][\w$]*$/u.test(t)?"type":/^[A-Za-z_$][\w$]*$/u.test(t)&&n.slice(s).trimStart().startsWith("(")?"function":/^[{}()[\].,;:?]$/u.test(t)?"punctuation":/^(?:=>|[-+*/%=&|!<>~^]+)$/u.test(t)?"operator":null}function q(t,e,s,n){return x(t)?n.slice(s).trimStart().startsWith(":")?"property":"string":/^-?\d/u.test(t)?"number":t==="true"||t==="false"||t==="null"?"literal":"punctuation"}function Z(t,e,s,n){return t.startsWith("/*")?"comment":x(t)?"string":t.startsWith("@")?"keyword":t.startsWith("#")&&/^#[0-9a-f]/iu.test(t)||/^\d/u.test(t)?"number":t.startsWith(".")||t.startsWith("#")?"tag":/^--/u.test(t)||n.slice(s).trimStart().startsWith(":")?"property":/^[{}():;,]$/u.test(t)?"punctuation":null}function U(t){return t.startsWith("<!--")?"comment":/^<!doctype/iu.test(t)||t.startsWith("&")?"meta":t.startsWith("<")?"tag":x(t)?"string":t==="="?"operator":t===">"||t==="/>"?"punctuation":"attribute"}function Y(t){return t.startsWith("#")?"comment":x(t)?"string":t.startsWith("$")?"property":t.startsWith("-")?"attribute":/^\d/u.test(t)?"number":/^[|&;(){}<>]$/u.test(t)?"operator":G.has(t)?"keyword":null}const G=new Set(["case","cd","do","done","echo","elif","else","esac","exit","export","fi","for","function","if","in","local","return","set","source","test","then","unset","while"]);function x(t){return t.startsWith('"')||t.startsWith("'")||t.startsWith("`")}const J=/`([^`]+)`/y,X=/\[([^\]]+)\]\(([^)\s]+)\)/y,F=/\*\*\*(.+?)\*\*\*/y,Q=/\*\*(.+?)\*\*/y,V=/__(.+?)__(?!\w)/y,tt=/~~(.+?)~~/y,et=/\*(?!\s)([^*]+?)\*/y,nt=/_(?!\s)([^_]+?)_(?!\w)/y;function h(t,e,s){t.lastIndex=s;const n=t.exec(e);return n&&n.index===s?n:null}function d(t){const e=[];let s="",n=0,r=0;const c=()=>{s&&(e.push(s),s="")};for(;n<t.length;){const a=n===0||/[^\w]/.test(t[n-1]??""),o=h(J,t,n);if(o){c(),e.push(i.jsx("code",{children:o[1]},r++)),n+=o[0].length;continue}const u=h(X,t,n);if(u){c();const j=st(u[2]);e.push(j?i.jsx("a",{href:j,target:"_blank",rel:"noreferrer",children:d(u[1])},r++):i.jsx("span",{children:d(u[1])},r++)),n+=u[0].length;continue}const p=h(F,t,n);if(p){c(),e.push(i.jsx("strong",{children:i.jsx("em",{children:d(p[1])})},r++)),n+=p[0].length;continue}const l=h(Q,t,n)??(a?h(V,t,n):null);if(l){c(),e.push(i.jsx("strong",{children:d(l[1])},r++)),n+=l[0].length;continue}const m=h(tt,t,n);if(m){c(),e.push(i.jsx("del",{children:d(m[1])},r++)),n+=m[0].length;continue}const f=h(et,t,n)??(a?h(nt,t,n):null);if(f){c(),e.push(i.jsx("em",{children:d(f[1])},r++)),n+=f[0].length;continue}s+=t[n],n+=1}return c(),e}function st(t){if(!t)return null;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"||e.protocol==="mailto:"?t:null}catch{return null}}export{ct as T,it as c};
@@ -1 +1 @@
1
- import{r as l,j as a}from"./index-DMiGbrBt.js";import{a as D}from"./api-h5zurxmi.js";import{f as v}from"./time-DltNTpLl.js";/* empty css */import{R as F}from"./refresh-cw-BBmAnCB7.js";const M=44,B=132,H=3500,V=7e3;function W(e,t){return!!(e&&e.available===t.available&&e.sessionId===t.sessionId&&e.body===t.body&&e.lineCount===t.lineCount&&e.columnCount===t.columnCount&&e.truncated===t.truncated&&e.reason===t.reason)}function q(e){const t=new URLSearchParams({lines:String(e.lines),cols:String(e.columns)});return e.agentId?`/api/agents/${encodeURIComponent(e.agentId)}/tmux-peek?${t.toString()}`:e.surface?(t.set("backend",e.surface.backend),t.set("sessionName",e.surface.sessionName),`/api/terminal-sessions/peek?${t.toString()}`):null}function ee({agentId:e,surface:t,enabled:x=!0,lines:E=M,columns:L=B,pollMs:h=H,idlePollMs:u=V,className:N}){const[n,T]=l.useState(null),[k,m]=l.useState(!1),[A,b]=l.useState(null),[U,K]=l.useState(0),c=q({agentId:e,surface:t,lines:E,columns:L});if(l.useEffect(()=>{T(null),b(null),m(!1)},[c]),l.useEffect(()=>{if(!x||!c){m(!1);return}let r=!1,f,y=!0;const R=d=>{window.clearTimeout(f),f=window.setTimeout(()=>{S()},d)},S=async()=>{if(r)return;if(document.visibilityState!=="visible"){R(u);return}y&&m(!0);let d=h;try{const i=await D(c);if(r)return;b(null),T(o=>o&&W(o.payload,i)?o.steady?o:{...o,steady:!0}:{payload:i,observedAt:o?.observedAt??i.capturedAt,changedAt:o?i.capturedAt:null,steady:!1}),d=i.available?h:u}catch(i){if(r)return;b(i instanceof Error?i.message:String(i)),d=u}finally{r||(y&&m(!1),y=!1,R(d))}},$=()=>{document.visibilityState==="visible"&&(window.clearTimeout(f),S())};return S(),document.addEventListener("visibilitychange",$),()=>{r=!0,window.clearTimeout(f),document.removeEventListener("visibilitychange",$)}},[x,u,c,h,U]),!x||!c)return null;const s=n?.payload??null,g=s?.body??"",p=s?.lineCount??E,j=s?.columnCount??L,w=6,I=1.32,O={"--tmux-peek-columns":String(j),"--tmux-peek-rows":String(p),"--tmux-peek-font-size":`${w}px`,"--tmux-peek-line-height":String(I),"--tmux-peek-height":`${Math.ceil(p*w*I+18)}px`},C=!!(s?.available&&g),X=A||(k&&!n?"Loading terminal peek...":s?.available===!1?s.reason??"No tmux pane is available.":C?null:s?.available?"Pane is empty.":"Loading terminal peek..."),_=n?n.changedAt&&!n.steady?"Changed":n.steady?"At rest":"Peeked":null,P=n?.changedAt??n?.observedAt??null,z=n?n.changedAt?n.steady?`No terminal content change since ${v(n.changedAt)}`:`Terminal content changed ${v(n.changedAt)}`:`First terminal peek observed ${v(n.observedAt)}`:void 0;return a.jsxs("div",{className:`ctx-panel-tmux-peek${N?` ${N}`:""}`,style:O,children:[a.jsxs("div",{className:"ctx-panel-tmux-peek-head",children:[a.jsx("span",{children:"Terminal peek"}),a.jsxs("span",{className:"ctx-panel-tmux-peek-grid",children:[j,"x",p]}),s?.sessionId&&a.jsx("span",{className:"ctx-panel-tmux-peek-session",title:s.sessionId,children:s.sessionId.length>12?s.sessionId.slice(0,10):s.sessionId}),_&&P&&a.jsx("time",{className:"ctx-panel-tmux-peek-state",dateTime:new Date(P).toISOString(),title:z,children:_}),a.jsxs("button",{type:"button",className:"ctx-panel-tmux-peek-refresh",onClick:()=>K(r=>r+1),disabled:k,title:"Refresh terminal peek","aria-label":"Refresh terminal peek",children:[a.jsx(F,{size:12,strokeWidth:1.8}),a.jsx("span",{children:k?"Refreshing":"Refresh"})]})]}),C?a.jsx("pre",{className:"ctx-panel-tmux-peek-screen",children:g}):a.jsx("div",{className:"ctx-panel-tmux-peek-empty",children:X}),s?.truncated&&g&&a.jsxs("div",{className:"ctx-panel-tmux-peek-foot",children:["Last ",p," rows from tmux pane"]})]})}export{ee as T};
1
+ import{r as l,j as a}from"./index-CzVeWScw.js";import{a as D}from"./api-h5zurxmi.js";import{f as v}from"./time-Dhsh_2EG.js";/* empty css */import{R as F}from"./refresh-cw-4oeFn1Jn.js";const M=44,B=132,H=3500,V=7e3;function W(e,t){return!!(e&&e.available===t.available&&e.sessionId===t.sessionId&&e.body===t.body&&e.lineCount===t.lineCount&&e.columnCount===t.columnCount&&e.truncated===t.truncated&&e.reason===t.reason)}function q(e){const t=new URLSearchParams({lines:String(e.lines),cols:String(e.columns)});return e.agentId?`/api/agents/${encodeURIComponent(e.agentId)}/tmux-peek?${t.toString()}`:e.surface?(t.set("backend",e.surface.backend),t.set("sessionName",e.surface.sessionName),`/api/terminal-sessions/peek?${t.toString()}`):null}function ee({agentId:e,surface:t,enabled:x=!0,lines:E=M,columns:L=B,pollMs:h=H,idlePollMs:u=V,className:N}){const[n,T]=l.useState(null),[k,m]=l.useState(!1),[A,b]=l.useState(null),[U,K]=l.useState(0),c=q({agentId:e,surface:t,lines:E,columns:L});if(l.useEffect(()=>{T(null),b(null),m(!1)},[c]),l.useEffect(()=>{if(!x||!c){m(!1);return}let r=!1,f,y=!0;const R=d=>{window.clearTimeout(f),f=window.setTimeout(()=>{S()},d)},S=async()=>{if(r)return;if(document.visibilityState!=="visible"){R(u);return}y&&m(!0);let d=h;try{const i=await D(c);if(r)return;b(null),T(o=>o&&W(o.payload,i)?o.steady?o:{...o,steady:!0}:{payload:i,observedAt:o?.observedAt??i.capturedAt,changedAt:o?i.capturedAt:null,steady:!1}),d=i.available?h:u}catch(i){if(r)return;b(i instanceof Error?i.message:String(i)),d=u}finally{r||(y&&m(!1),y=!1,R(d))}},$=()=>{document.visibilityState==="visible"&&(window.clearTimeout(f),S())};return S(),document.addEventListener("visibilitychange",$),()=>{r=!0,window.clearTimeout(f),document.removeEventListener("visibilitychange",$)}},[x,u,c,h,U]),!x||!c)return null;const s=n?.payload??null,g=s?.body??"",p=s?.lineCount??E,j=s?.columnCount??L,w=6,I=1.32,O={"--tmux-peek-columns":String(j),"--tmux-peek-rows":String(p),"--tmux-peek-font-size":`${w}px`,"--tmux-peek-line-height":String(I),"--tmux-peek-height":`${Math.ceil(p*w*I+18)}px`},C=!!(s?.available&&g),X=A||(k&&!n?"Loading terminal peek...":s?.available===!1?s.reason??"No tmux pane is available.":C?null:s?.available?"Pane is empty.":"Loading terminal peek..."),_=n?n.changedAt&&!n.steady?"Changed":n.steady?"At rest":"Peeked":null,P=n?.changedAt??n?.observedAt??null,z=n?n.changedAt?n.steady?`No terminal content change since ${v(n.changedAt)}`:`Terminal content changed ${v(n.changedAt)}`:`First terminal peek observed ${v(n.observedAt)}`:void 0;return a.jsxs("div",{className:`ctx-panel-tmux-peek${N?` ${N}`:""}`,style:O,children:[a.jsxs("div",{className:"ctx-panel-tmux-peek-head",children:[a.jsx("span",{children:"Terminal peek"}),a.jsxs("span",{className:"ctx-panel-tmux-peek-grid",children:[j,"x",p]}),s?.sessionId&&a.jsx("span",{className:"ctx-panel-tmux-peek-session",title:s.sessionId,children:s.sessionId.length>12?s.sessionId.slice(0,10):s.sessionId}),_&&P&&a.jsx("time",{className:"ctx-panel-tmux-peek-state",dateTime:new Date(P).toISOString(),title:z,children:_}),a.jsxs("button",{type:"button",className:"ctx-panel-tmux-peek-refresh",onClick:()=>K(r=>r+1),disabled:k,title:"Refresh terminal peek","aria-label":"Refresh terminal peek",children:[a.jsx(F,{size:12,strokeWidth:1.8}),a.jsx("span",{children:k?"Refreshing":"Refresh"})]})]}),C?a.jsx("pre",{className:"ctx-panel-tmux-peek-screen",children:g}):a.jsx("div",{className:"ctx-panel-tmux-peek-empty",children:X}),s?.truncated&&g&&a.jsxs("div",{className:"ctx-panel-tmux-peek-foot",children:["Last ",p," rows from tmux pane"]})]})}export{ee as T};
@@ -1 +1 @@
1
- import{j as n,r as h}from"./index-DMiGbrBt.js";import{r as w,o as g}from"./scout-voice-CU5c0LGi.js";import"./fx-z37u1o2z.js";const p={microphone:{label:"Microphone",privacyPane:"Microphone",hint:"Scout Menu captures audio for web dictation. The browser never records.",appLabel:"Scout Menu"},speechRecognition:{label:"Speech recognition",privacyPane:"Speech Recognition",hint:"Live partials and Apple Speech fallback while Parakeet warms.",appLabel:"Scout Menu"}};function x(e){return e?e.granted?"ok":e.canRequest?"warn":e.status==="denied"||e.status==="restricted"?"fail":"warn":"idle"}function y(e){if(!e)return"Unknown";if(e.granted)return"Granted";switch(e.status){case"notDetermined":return"Not requested";case"denied":return"Denied";case"restricted":return"Restricted";case"authorized":return"Granted";default:return e.status}}function M(e,s){return e?e.granted?`${p[s].appLabel} is allowed to use ${p[s].label.toLowerCase()}.`:e.canRequest?`Click Request to show the macOS permission dialog for ${p[s].appLabel}.`:e.status==="denied"?`Choose Retry access. Scout Menu will open macOS ${p[s].privacyPane} settings and detect the change automatically.`:e.status==="restricted"?`${p[s].label} access is restricted on this Mac.`:`${p[s].appLabel} needs ${p[s].label.toLowerCase()} access before dictation works.`:"Launch Scout Menu on this Mac, then refresh."}function j(e){return!!(e&&!e.granted&&!e.canRequest&&e.status!=="unknown")}function R(e){return!!(e&&!e.granted&&e.status!=="restricted"&&e.status!=="unknown")}function L({hostOnline:e,micPermission:s,speechPermission:r,modelReady:l}){const c=s?.granted??!1,d=r?.granted??!1,u=e&&c&&d;let i="fail",t="Scout Menu not connected",a="Launch Scout Menu on this Mac. Web dictation uses the Scout voice host — not the browser microphone.";return e&&!c&&(s?.status==="denied"||s?.status==="restricted")?(i="fail",t="Microphone blocked for Scout Menu",a=s?.status==="restricted"?"Microphone access is restricted on this Mac.":"Choose Retry access below. Scout will open the right macOS pane and detect the change."):e&&!c&&s?.canRequest?(i="warn",t="Microphone access needed",a="Request permission below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&c&&!d&&(r?.status==="denied"||r?.status==="restricted")?(i="warn",t="Speech recognition blocked for Scout Menu",a=r?.status==="restricted"?"Speech recognition is restricted on this Mac.":"Open Privacy & Security → Speech Recognition to change it."):e&&c&&!d?(i="warn",t="Speech recognition needed",a="Request access below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&u?(i="ok",t=l?"Dictation ready":"Dictation ready · model warming",a="Scout Menu is running as the voice host. The browser does not capture audio."):e&&(i="warn",t="Voice host connected",a="Finish permissions below to enable dictation."),n.jsxs("div",{className:`s-voice-host-banner s-voice-host-banner--${i}`,children:[n.jsx("div",{className:"s-voice-host-banner-dot","aria-hidden":!0}),n.jsxs("div",{className:"s-voice-host-banner-copy",children:[n.jsx("div",{className:"s-voice-host-banner-title",children:t}),n.jsx("div",{className:"s-voice-host-banner-detail",children:a}),n.jsxs("div",{className:"s-voice-host-banner-meta",children:[n.jsx("span",{children:"Voice host · Scout Menu"}),n.jsx("span",{children:e?"Connected":"Offline"}),n.jsx("span",{children:"Capture · native"})]})]})]})}function f({kind:e,status:s,disabled:r,onActionError:l,onRefresh:c}){const[d,u]=h.useState(!1),i=h.useRef(s),t=p[e],a=x(s);h.useEffect(()=>{i.current=s},[s]);const m=h.useCallback(async()=>{for(let o=0;o<30;o+=1)if(await new Promise(S=>window.setTimeout(S,1e3)),await c(),i.current?.granted)return},[c]),v=h.useCallback(async()=>{u(!0);try{await w(e),await m()}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l,m]),b=h.useCallback(async()=>{u(!0);try{await g(e)}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l]);return n.jsxs("div",{className:`s-voice-permission-card s-voice-permission-card--${a}`,children:[n.jsxs("div",{className:"s-voice-permission-card-head",children:[n.jsx("span",{className:"s-voice-permission-card-dot","aria-hidden":!0}),n.jsxs("div",{children:[n.jsx("div",{className:"s-voice-permission-card-label",children:t.label}),n.jsxs("div",{className:"s-voice-permission-card-app",children:["via ",t.appLabel]})]}),n.jsx("span",{className:`s-voice-permission-card-status s-voice-permission-card-status--${a}`,children:y(s)})]}),n.jsx("p",{className:"s-voice-permission-card-hint",children:t.hint}),n.jsx("p",{className:"s-voice-permission-card-detail",children:M(s,e)}),n.jsxs("div",{className:"s-voice-permission-card-actions",children:[R(s)?n.jsx("button",{type:"button",className:"s-voice-permission-btn s-voice-permission-btn--primary",disabled:r||d,onClick:()=>{v()},children:d?s?.canRequest?"Requesting…":"Waiting for macOS…":s?.canRequest?"Request access":"Retry access"}):null,j(s)?n.jsxs("button",{type:"button",className:"s-voice-permission-btn",disabled:r||d,onClick:()=>{b()},children:["Open Privacy & Security → ",t.privacyPane]}):null]})]})}function P({permissions:e,hostOnline:s,disabled:r,onError:l,onRefresh:c}){const d=e?.find(i=>i.kind==="microphone")??null,u=e?.find(i=>i.kind==="speechRecognition")??null;return n.jsxs("div",{className:"s-voice-permissions-panel",children:[n.jsx(f,{kind:"microphone",status:s?d:null,disabled:r||!s,onActionError:l,onRefresh:c}),n.jsx(f,{kind:"speechRecognition",status:s?u:null,disabled:r||!s,onActionError:l,onRefresh:c}),s?null:n.jsx("p",{className:"s-voice-permissions-offline",children:"Scout Menu is not reporting to this web server. Permissions are managed on the Mac where Scout Menu runs."})]})}export{L as VoiceHostStatusBanner,P as VoicePermissionsPanel};
1
+ import{j as n,r as h}from"./index-CzVeWScw.js";import{r as w,o as g}from"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";const p={microphone:{label:"Microphone",privacyPane:"Microphone",hint:"Scout Menu captures audio for web dictation. The browser never records.",appLabel:"Scout Menu"},speechRecognition:{label:"Speech recognition",privacyPane:"Speech Recognition",hint:"Live partials and Apple Speech fallback while Parakeet warms.",appLabel:"Scout Menu"}};function x(e){return e?e.granted?"ok":e.canRequest?"warn":e.status==="denied"||e.status==="restricted"?"fail":"warn":"idle"}function y(e){if(!e)return"Unknown";if(e.granted)return"Granted";switch(e.status){case"notDetermined":return"Not requested";case"denied":return"Denied";case"restricted":return"Restricted";case"authorized":return"Granted";default:return e.status}}function M(e,s){return e?e.granted?`${p[s].appLabel} is allowed to use ${p[s].label.toLowerCase()}.`:e.canRequest?`Click Request to show the macOS permission dialog for ${p[s].appLabel}.`:e.status==="denied"?`Choose Retry access. Scout Menu will open macOS ${p[s].privacyPane} settings and detect the change automatically.`:e.status==="restricted"?`${p[s].label} access is restricted on this Mac.`:`${p[s].appLabel} needs ${p[s].label.toLowerCase()} access before dictation works.`:"Launch Scout Menu on this Mac, then refresh."}function j(e){return!!(e&&!e.granted&&!e.canRequest&&e.status!=="unknown")}function R(e){return!!(e&&!e.granted&&e.status!=="restricted"&&e.status!=="unknown")}function L({hostOnline:e,micPermission:s,speechPermission:r,modelReady:l}){const c=s?.granted??!1,d=r?.granted??!1,u=e&&c&&d;let i="fail",t="Scout Menu not connected",a="Launch Scout Menu on this Mac. Web dictation uses the Scout voice host — not the browser microphone.";return e&&!c&&(s?.status==="denied"||s?.status==="restricted")?(i="fail",t="Microphone blocked for Scout Menu",a=s?.status==="restricted"?"Microphone access is restricted on this Mac.":"Choose Retry access below. Scout will open the right macOS pane and detect the change."):e&&!c&&s?.canRequest?(i="warn",t="Microphone access needed",a="Request permission below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&c&&!d&&(r?.status==="denied"||r?.status==="restricted")?(i="warn",t="Speech recognition blocked for Scout Menu",a=r?.status==="restricted"?"Speech recognition is restricted on this Mac.":"Open Privacy & Security → Speech Recognition to change it."):e&&c&&!d?(i="warn",t="Speech recognition needed",a="Request access below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&u?(i="ok",t=l?"Dictation ready":"Dictation ready · model warming",a="Scout Menu is running as the voice host. The browser does not capture audio."):e&&(i="warn",t="Voice host connected",a="Finish permissions below to enable dictation."),n.jsxs("div",{className:`s-voice-host-banner s-voice-host-banner--${i}`,children:[n.jsx("div",{className:"s-voice-host-banner-dot","aria-hidden":!0}),n.jsxs("div",{className:"s-voice-host-banner-copy",children:[n.jsx("div",{className:"s-voice-host-banner-title",children:t}),n.jsx("div",{className:"s-voice-host-banner-detail",children:a}),n.jsxs("div",{className:"s-voice-host-banner-meta",children:[n.jsx("span",{children:"Voice host · Scout Menu"}),n.jsx("span",{children:e?"Connected":"Offline"}),n.jsx("span",{children:"Capture · native"})]})]})]})}function f({kind:e,status:s,disabled:r,onActionError:l,onRefresh:c}){const[d,u]=h.useState(!1),i=h.useRef(s),t=p[e],a=x(s);h.useEffect(()=>{i.current=s},[s]);const m=h.useCallback(async()=>{for(let o=0;o<30;o+=1)if(await new Promise(S=>window.setTimeout(S,1e3)),await c(),i.current?.granted)return},[c]),v=h.useCallback(async()=>{u(!0);try{await w(e),await m()}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l,m]),b=h.useCallback(async()=>{u(!0);try{await g(e)}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l]);return n.jsxs("div",{className:`s-voice-permission-card s-voice-permission-card--${a}`,children:[n.jsxs("div",{className:"s-voice-permission-card-head",children:[n.jsx("span",{className:"s-voice-permission-card-dot","aria-hidden":!0}),n.jsxs("div",{children:[n.jsx("div",{className:"s-voice-permission-card-label",children:t.label}),n.jsxs("div",{className:"s-voice-permission-card-app",children:["via ",t.appLabel]})]}),n.jsx("span",{className:`s-voice-permission-card-status s-voice-permission-card-status--${a}`,children:y(s)})]}),n.jsx("p",{className:"s-voice-permission-card-hint",children:t.hint}),n.jsx("p",{className:"s-voice-permission-card-detail",children:M(s,e)}),n.jsxs("div",{className:"s-voice-permission-card-actions",children:[R(s)?n.jsx("button",{type:"button",className:"s-voice-permission-btn s-voice-permission-btn--primary",disabled:r||d,onClick:()=>{v()},children:d?s?.canRequest?"Requesting…":"Waiting for macOS…":s?.canRequest?"Request access":"Retry access"}):null,j(s)?n.jsxs("button",{type:"button",className:"s-voice-permission-btn",disabled:r||d,onClick:()=>{b()},children:["Open Privacy & Security → ",t.privacyPane]}):null]})]})}function P({permissions:e,hostOnline:s,disabled:r,onError:l,onRefresh:c}){const d=e?.find(i=>i.kind==="microphone")??null,u=e?.find(i=>i.kind==="speechRecognition")??null;return n.jsxs("div",{className:"s-voice-permissions-panel",children:[n.jsx(f,{kind:"microphone",status:s?d:null,disabled:r||!s,onActionError:l,onRefresh:c}),n.jsx(f,{kind:"speechRecognition",status:s?u:null,disabled:r||!s,onActionError:l,onRefresh:c}),s?null:n.jsx("p",{className:"s-voice-permissions-offline",children:"Scout Menu is not reporting to this web server. Permissions are managed on the Mac where Scout Menu runs."})]})}export{L as VoiceHostStatusBanner,P as VoicePermissionsPanel};
@@ -1,5 +1,5 @@
1
- import{r as h,j as e}from"./index-DMiGbrBt.js";import{D as Q}from"./DocumentFocusViewer-BeVwwl26.js";import{S as O}from"./StatusPill-DhBL__p8.js";import{c as Z}from"./TextDocumentSurface-BpAw4eQS.js";import{WorkFilesViewer as de}from"./WorkFilesViewer-Btl6C2Q1.js";import{r as M}from"./mentions-jSuTGeet.js";import{a as X}from"./api-h5zurxmi.js";import{u as T,m as le,k as ce}from"./Provider-C7UKGHQy.js";import{b as he}from"./router-Bq5dwf78.js";import{u as ue}from"./sse-CjIkKo46.js";import{w as me,c as ke}from"./status-tone-BM_zuRy1.js";import{t as $}from"./time-DltNTpLl.js";import{B as z}from"./BackToPicker-BRvfostO.js";import{o as m}from"./openContent-C6XO6kr5.js";import{TailView as fe}from"./TailView-DGj_5HA9.js";import{M as W}from"./message-square-DSaGpjFU.js";import{R as V}from"./radio-Bz8ZePxj.js";import{c as L}from"./createLucideIcon-OpA4Amw5.js";import{E as G}from"./external-link-CXBytO9o.js";import{A as J}from"./activity-CA8qS6PI.js";import{F as D}from"./file-text-BODxCjcz.js";import{C as pe}from"./code-xml-B6jOCM4V.js";/* empty css */import"./x-D3GElQbe.js";import"./chevron-right-XiIHsk4m.js";import"./chevron-down-BGk5qoEw.js";import"./colors-BtO5_zlx.js";import"./index-CJXzfjo9.js";import"./AgentDetailCard-BcRBRp88.js";import"./AgentLiveActions-DBtnD0qE.js";import"./terminal-takeover-B8UeD9OX.js";import"./eye-0PvebX_a.js";import"./terminal-B9AOZQKR.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-bARZqTzD.js";import"./arrow-left-DEZzHiPS.js";import"./scout-voice-CU5c0LGi.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-2kv_tGUS.js";import"./MessageComposerSuggestions-DpxN9WiB.js";import"./NewChatComposer-Cs6OsxK6.js";import"./runtime-picker-Bcl5iIX5.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-CbHjZsz1.js";import"./HarnessMark-Cbv3Ib0c.js";import"./conversation-model-B47vYmWN.js";import"./NewChatOrigin-Bk2OyVjI.js";import"./agent-chat-Bfjd9y6c.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./search-CWfZtOt2.js";import"./terminal-sessions-D5CIR2OL.js";import"./index-BWHgHrtv.js";import"./SlidePanel-COwtoJqR.js";import"./tail-display-BdyoLvzY.js";import"./lane-edit-display-C_Aujldz.js";import"./tail-events-D19uAGe3.js";const ve=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],xe=L("book-open",ve);const we=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],_=L("clipboard",we);const je=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],B=L("folder-tree",je);function K(s){switch(s){case"review":return"In review";case"waiting":return"Waiting";case"working":return"Working";case"done":return"Done";default:return s.replace(/_/g," ")}}function ge(s){switch(s){case"badge":return"Noteworthy";case"interrupt":return"Blocked signal";default:return null}}function Ie({detail:s,signal:t,ownerLabel:r,nextMoveLabel:n}){const i=n==="—"?r:n;return s.attention==="interrupt"?{eyebrow:"Network signal",title:`Blocker surfaced for ${i}`,body:s.conversationId?"Open the thread if you want the blocking context.":"No thread is attached; the record and timeline hold the current context.",tone:"blocked"}:t?{eyebrow:"Network signal",title:`Plan activity from ${i}`,body:s.conversationId?"A plan or spec discussion is active in the agent network. Open the thread only if you want context.":"A plan or spec discussion is active in the agent network, but no thread is attached yet.",tone:"attention"}:s.activeFlights.length>0||s.state==="in_turn"||s.state==="in_flight"?{eyebrow:"Next move",title:`${r} is working`,body:s.conversationId?"The thread has the freshest working context.":"Watch the flight list and timeline for the next update.",tone:"active"}:s.state==="waiting"||s.state==="review"?{eyebrow:"Next move",title:`Waiting on ${n}`,body:s.conversationId?"The thread has the current unblock context.":"No thread is attached; ownership and timeline are the best context.",tone:"quiet"}:s.state==="done"?{eyebrow:"Outcome",title:"Work is done",body:s.conversationId?"The thread keeps the handoff and final context.":"The record and timeline are preserved here.",tone:"quiet"}:{eyebrow:"Next move",title:n==="—"?"No next owner set":`Next move: ${n}`,body:s.conversationId?"The thread has the latest context.":"Use the record and timeline to decide where this should go next.",tone:"quiet"}}function f({children:s,icon:t,onClick:r,primary:n=!1,disabled:i=!1}){return e.jsxs("button",{type:"button",className:`s-work-action-button${n?" s-work-action-button-primary":""}`,onClick:r,disabled:i,children:[t,e.jsx("span",{children:s})]})}function Y(s){const t=s?.toLowerCase()??"";return t.includes("mcp")?"MCP request":t.includes("cli")?"CLI request":t?`${s} request`:"Scout request"}function ee(s){const t=s.primaryInvocation,r=t?.targetAgentName??t?.targetAgentId??s.ownerName??s.ownerId??"The agent";switch(t?.state??s.activeFlights[0]?.state??s.state){case"running":return`${r} is running in background. Synchronous wait may have expired, but the Run is still active.`;case"waking":return`${r} is waking up for this Run.`;case"queued":return`${r} has the Run queued.`;case"waiting":case"review":return`${r} paused and is waiting for the next move.`;case"completed":case"done":return`${r} completed this Run.`;case"failed":return`${r} reported a failure for this Run.`;case"cancelled":return"This Run was cancelled.";default:return`${r} is attached to this work item.`}}function Ne(s){const t=s.primaryInvocation;return[`Work: ${s.id}`,`State: ${s.currentPhase}`,t?`Source: ${Y(t.source)}`:null,t?.targetAgentName||t?.targetAgentId?`Resolved agent: ${t.targetAgentName??t.targetAgentId}`:null,t?.requestedHarness?`Requested harness: ${t.requestedHarness}`:null,t?.requestedModel?`Requested model: ${t.requestedModel}`:null,t?.requestedReasoningEffort?`Requested effort: ${t.requestedReasoningEffort}`:null,t?.resolvedHarness?`Resolved harness: ${t.resolvedHarness}`:null,t?.resolvedModel?`Resolved model: ${t.resolvedModel}`:null,t?.resolvedReasoningEffort?`Resolved effort: ${t.resolvedReasoningEffort}`:null,t?.observedModel?`Observed model: ${t.observedModel}`:null,t?.observedReasoningEffort?`Observed effort: ${t.observedReasoningEffort}`:null,t?.resolvedSessionId?`Session: ${t.resolvedSessionId}`:null,t?.flightId?`Flight: ${t.flightId}`:null,t?.invocationId?`Invocation: ${t.invocationId}`:null,s.conversationId?`Conversation: ${s.conversationId}`:null,ee(s)].filter(Boolean).join(`
1
+ import{r as h,j as e}from"./index-CzVeWScw.js";import{D as Q}from"./DocumentFocusViewer-BCG2kOmd.js";import{S as O}from"./StatusPill-B33sQinT.js";import{c as Z}from"./TextDocumentSurface-DRjctOIt.js";import{WorkFilesViewer as de}from"./WorkFilesViewer-BbVfcUN-.js";import{r as M}from"./mentions-fbQJ2mBI.js";import{a as X}from"./api-h5zurxmi.js";import{u as T,m as le,k as ce}from"./Provider-DSsb2gLR.js";import{b as he}from"./router-B-K15T7B.js";import{u as ue}from"./sse-QcU9bikk.js";import{w as me,c as ke}from"./status-tone-BM_zuRy1.js";import{t as $}from"./time-Dhsh_2EG.js";import{B as z}from"./BackToPicker-DZg_4nHL.js";import{o as m}from"./openContent-C6XO6kr5.js";import{TailView as pe}from"./TailView-DL3YZkzE.js";import{M as W}from"./message-square-CIXda-Y7.js";import{R as V}from"./radio-PauJIekM.js";import{c as L}from"./createLucideIcon-ClCdc3F9.js";import{E as G}from"./external-link-CnaI1QFS.js";import{A as J}from"./activity-BxwKkT8z.js";import{F as D}from"./file-text-DG-pufl1.js";import{C as fe}from"./code-xml--LjSM4Mv.js";/* empty css */import"./x-D4X_y1j_.js";import"./chevron-right-CNE6QAVr.js";import"./chevron-down-DRCbnzyY.js";import"./colors-BtO5_zlx.js";import"./index-Dewd56RX.js";import"./AgentDetailCard-sZuHl1de.js";import"./AgentLiveActions-DI4ooSHW.js";import"./terminal-takeover-KvmTwABa.js";import"./eye-BFlhMzQL.js";import"./terminal-DrTkVXIj.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-N-Z6X0Z1.js";import"./arrow-left-_vS7itsV.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BJnFoFDP.js";import"./MessageComposerSuggestions-Cs9u-F_3.js";import"./NewChatComposer-DXDxV2Mh.js";import"./runtime-picker-BCQD7d4K.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Byb9kSFx.js";import"./HarnessMark-BE-YSyci.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-CnjoswTG.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./search-C3bSJluv.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-C3qU8tnY.js";import"./index-BWHgHrtv.js";import"./SlidePanel-B3gc5HnM.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./tail-events-C6K7bCWB.js";const ve=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],xe=L("book-open",ve);const we=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],_=L("clipboard",we);const je=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],B=L("folder-tree",je);function K(s){switch(s){case"review":return"In review";case"waiting":return"Waiting";case"working":return"Working";case"done":return"Done";default:return s.replace(/_/g," ")}}function ge(s){switch(s){case"badge":return"Noteworthy";case"interrupt":return"Blocked signal";default:return null}}function Ie({detail:s,signal:t,ownerLabel:r,nextMoveLabel:n}){const i=n==="—"?r:n;return s.attention==="interrupt"?{eyebrow:"Network signal",title:`Blocker surfaced for ${i}`,body:s.conversationId?"Open the thread if you want the blocking context.":"No thread is attached; the record and timeline hold the current context.",tone:"blocked"}:t?{eyebrow:"Network signal",title:`Plan activity from ${i}`,body:s.conversationId?"A plan or spec discussion is active in the agent network. Open the thread only if you want context.":"A plan or spec discussion is active in the agent network, but no thread is attached yet.",tone:"attention"}:s.activeFlights.length>0||s.state==="in_turn"||s.state==="in_flight"?{eyebrow:"Next move",title:`${r} is working`,body:s.conversationId?"The thread has the freshest working context.":"Watch the flight list and timeline for the next update.",tone:"active"}:s.state==="waiting"||s.state==="review"?{eyebrow:"Next move",title:`Waiting on ${n}`,body:s.conversationId?"The thread has the current unblock context.":"No thread is attached; ownership and timeline are the best context.",tone:"quiet"}:s.state==="done"?{eyebrow:"Outcome",title:"Work is done",body:s.conversationId?"The thread keeps the handoff and final context.":"The record and timeline are preserved here.",tone:"quiet"}:{eyebrow:"Next move",title:n==="—"?"No next owner set":`Next move: ${n}`,body:s.conversationId?"The thread has the latest context.":"Use the record and timeline to decide where this should go next.",tone:"quiet"}}function p({children:s,icon:t,onClick:r,primary:n=!1,disabled:i=!1}){return e.jsxs("button",{type:"button",className:`s-work-action-button${n?" s-work-action-button-primary":""}`,onClick:r,disabled:i,children:[t,e.jsx("span",{children:s})]})}function Y(s){const t=s?.toLowerCase()??"";return t.includes("mcp")?"MCP request":t.includes("cli")?"CLI request":t?`${s} request`:"Scout request"}function ee(s){const t=s.primaryInvocation,r=t?.targetAgentName??t?.targetAgentId??s.ownerName??s.ownerId??"The agent";switch(t?.state??s.activeFlights[0]?.state??s.state){case"running":return`${r} is running in background. Synchronous wait may have expired, but the Run is still active.`;case"waking":return`${r} is waking up for this Run.`;case"queued":return`${r} has the Run queued.`;case"waiting":case"review":return`${r} paused and is waiting for the next move.`;case"completed":case"done":return`${r} completed this Run.`;case"failed":return`${r} reported a failure for this Run.`;case"cancelled":return"This Run was cancelled.";default:return`${r} is attached to this work item.`}}function Ne(s){const t=s.primaryInvocation;return[`Work: ${s.id}`,`State: ${s.currentPhase}`,t?`Source: ${Y(t.source)}`:null,t?.targetAgentName||t?.targetAgentId?`Resolved agent: ${t.targetAgentName??t.targetAgentId}`:null,t?.requestedHarness?`Requested harness: ${t.requestedHarness}`:null,t?.requestedModel?`Requested model: ${t.requestedModel}`:null,t?.requestedReasoningEffort?`Requested effort: ${t.requestedReasoningEffort}`:null,t?.resolvedHarness?`Resolved harness: ${t.resolvedHarness}`:null,t?.resolvedModel?`Resolved model: ${t.resolvedModel}`:null,t?.resolvedReasoningEffort?`Resolved effort: ${t.resolvedReasoningEffort}`:null,t?.observedModel?`Observed model: ${t.observedModel}`:null,t?.observedReasoningEffort?`Observed effort: ${t.observedReasoningEffort}`:null,t?.resolvedSessionId?`Session: ${t.resolvedSessionId}`:null,t?.flightId?`Flight: ${t.flightId}`:null,t?.invocationId?`Invocation: ${t.invocationId}`:null,s.conversationId?`Conversation: ${s.conversationId}`:null,ee(s)].filter(Boolean).join(`
2
2
  `)}function ye(s){const t=s.primaryInvocation;return[`workId=${s.id}`,t?.flightId?`flightId=${t.flightId}`:null,t?.invocationId?`invocationId=${t.invocationId}`:null,s.conversationId?`conversationId=${s.conversationId}`:null,t?.targetAgentId?`agentId=${t.targetAgentId}`:null,t?.resolvedSessionId?`sessionId=${t.resolvedSessionId}`:null].filter(Boolean).join(`
3
- `)}function U(s){navigator.clipboard?.writeText(s)}function be({detail:s,navigate:t}){const{route:r}=T(),n=s.primaryInvocation,i=ne(s).query,o=ye(s),u=Y(n?.source),p=n?.targetAgentName??n?.targetAgentId??s.ownerName??s.ownerId??"—",g=n?.task??se(s)??s.summary??"No original prompt captured.",k=n?.resolvedSessionId?{view:"sessions",sessionId:n.resolvedSessionId,...n.targetAgentId?{agentId:n.targetAgentId}:{}}:n?.targetAgentId?{view:"agents-v2",agentId:n.targetAgentId,tab:"observe"}:null,w=n?.resolvedSessionId?"Observe session":"Observe agent",v={view:"ops",mode:"tail",...i?{tailQuery:i}:{},workId:s.id,...n?.flightId?{flightId:n.flightId}:{},...n?.invocationId?{invocationId:n.invocationId}:{},...s.conversationId?{conversationId:s.conversationId}:{},...n?.resolvedSessionId?{sessionId:n.resolvedSessionId}:{},...n?.targetAgentId?{targetAgentId:n.targetAgentId}:{}};return e.jsxs("section",{className:"s-work-casefile-section s-work-ask-overview","data-kind":"ask","data-work-id":s.id,"data-flight-id":n?.flightId??void 0,"data-invocation-id":n?.invocationId??void 0,"data-agent-id":n?.targetAgentId??void 0,children:[e.jsx("div",{className:"s-work-ask-head",children:e.jsxs("div",{children:[e.jsxs("div",{className:"s-work-ask-badges",children:[e.jsx("span",{className:"s-work-ask-badge s-work-ask-badge-primary",children:"RUN created"}),e.jsx("span",{className:"s-work-ask-badge",children:u}),n?.state&&e.jsx("span",{className:"s-work-ask-badge",children:n.state})]}),e.jsx("h2",{className:"s-agent-section-title s-work-ask-title",children:"Message / work source of truth"}),e.jsx("p",{className:"s-work-ask-lifecycle",children:ee(s)})]})}),e.jsxs("div",{className:"s-work-ask-grid",children:[e.jsxs("div",{className:"s-work-ask-prompt",children:[e.jsx("span",{className:"s-work-ask-label",children:"Original prompt"}),e.jsx("p",{children:M(g)})]}),e.jsxs("dl",{className:"s-work-ask-facts",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Requested harness"}),e.jsx("dd",{children:n?.requestedHarness??"default"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Requested model"}),e.jsx("dd",{children:n?.requestedModel??"default"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Requested effort"}),e.jsx("dd",{children:n?.requestedReasoningEffort??"default"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved agent"}),e.jsx("dd",{children:p})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved harness"}),e.jsx("dd",{children:n?.resolvedHarness??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved model"}),e.jsx("dd",{children:n?.resolvedModel??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved effort"}),e.jsx("dd",{children:n?.resolvedReasoningEffort??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Observed model"}),e.jsx("dd",{children:n?.observedModel??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Observed effort"}),e.jsx("dd",{children:n?.observedReasoningEffort??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Session"}),e.jsx("dd",{children:n?.resolvedSessionId??n?.targetSessionId??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Flight"}),e.jsx("dd",{children:n?.flightId??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Invocation"}),e.jsx("dd",{children:n?.invocationId??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Work"}),e.jsx("dd",{children:s.id})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Conversation"}),e.jsx("dd",{children:s.conversationId??"—"})]})]})]}),e.jsxs("div",{className:"s-work-ask-actions",children:[k&&e.jsx(f,{primary:!0,icon:e.jsx(V,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,k,{returnTo:r}),children:w}),e.jsx(f,{icon:e.jsx(_,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>U(Ne(s)),children:"Copy status"}),s.conversationId&&e.jsx(f,{icon:e.jsx(W,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,{view:"conversation",conversationId:s.conversationId},{returnTo:r}),children:"Open chat"}),e.jsx(f,{icon:e.jsx(G,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,{view:"work",workId:s.id},{returnTo:r}),children:"Open work"}),n?.resolvedSessionId&&e.jsx(f,{icon:e.jsx(V,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,{view:"sessions",sessionId:n.resolvedSessionId},{returnTo:r}),children:"Open session"}),e.jsx(f,{icon:e.jsx(J,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,v,{returnTo:r}),children:"Scout tail"}),o&&e.jsx(f,{icon:e.jsx(_,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>U(o),children:"Copy MCP ids"}),s.conversationId&&e.jsx(f,{icon:e.jsx(W,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,{view:"conversation",conversationId:s.conversationId},{returnTo:r}),children:"Nudge agent"})]})]})}function Se({detail:s,navigate:t}){const r=!!s.conversationId,n=s.inventory??Ce(s),i=n.materials.filter(l=>l.kind==="plan"||l.kind==="spec"),o=n.materials.filter(l=>l.kind==="doc"),u=n.materials.filter(l=>l.kind==="code"||l.kind==="test"||l.kind==="config"||l.kind==="asset"||l.kind==="other"),p=i.length>0,g=o.length>0,k=se(s),w=i[0]?We(i[0]):k??"No plan or spec file detected yet.",v=[...i,...o,...u].filter(l=>l.status!=="deleted"),[N,j]=h.useState(!1),[a,x]=h.useState(null),[C,y]=h.useState(null),[I,b]=h.useState(null),[d,R]=h.useState(null),[re,P]=h.useState(!1),[ie,oe]=h.useState("all"),A=h.useCallback(l=>{j(!1),x(l)},[]),ae=h.useCallback(()=>{x(null),j(!0)},[]),q=h.useCallback(l=>{j(!1),x(null),oe(l),P(!0)},[]);return h.useEffect(()=>{a&&!v.some(l=>l.id===a)&&x(null)},[a,v]),h.useEffect(()=>{if(!a){y(null),b(null),R(null);return}let l=!1;return R(a),b(null),X(`/api/work/${encodeURIComponent(s.id)}/material?materialId=${encodeURIComponent(a)}`).then(S=>{l||y(S)}).catch(S=>{l||(y(null),b(S instanceof Error?S.message:String(S)))}).finally(()=>{l||R(null)}),()=>{l=!0}},[s.id,a]),e.jsxs("section",{className:"s-work-casefile-section s-work-materials-section",children:[e.jsxs("div",{className:"s-agent-section-heading",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"s-agent-section-title",children:"Work materials"}),e.jsxs("p",{className:"s-work-section-note",children:[Me(n.mode)," · ",n.source," evidence · ",n.confidence," confidence"]})]}),e.jsxs("div",{className:"s-work-inventory-meta","aria-label":"Inventory totals",children:[e.jsxs("span",{children:[n.totals.materials," files"]}),e.jsxs("span",{children:[n.totals.agents," agents"]}),e.jsxs("span",{children:[n.totals.sessions," sessions"]})]})]}),e.jsxs("div",{className:"s-work-material-grid",children:[e.jsxs("article",{className:"s-work-material-card s-work-material-card-primary",children:[e.jsxs("div",{className:"s-work-material-head",children:[e.jsx("span",{className:"s-work-material-icon","aria-hidden":"true",children:e.jsx(D,{size:15,strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("div",{className:"s-work-material-kicker",children:p?"Plans & specs":"Brief"}),e.jsx("div",{className:"s-work-material-title",children:p?`${i.length} surfaced`:k?"Original request":"No plan file yet"})]})]}),e.jsx("p",{className:"s-work-material-copy",children:w}),e.jsx(E,{materials:i.slice(0,3),empty:"No plan or spec files detected yet.",selectedId:a,onOpen:A}),e.jsxs("div",{className:"s-work-material-card-actions",children:[k&&e.jsxs("button",{type:"button",className:`s-work-material-link${N?" s-work-material-link-active":""}`,onClick:ae,children:[e.jsx(D,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View request"]}),i.length>3&&e.jsxs("button",{type:"button",className:"s-work-material-link",onClick:()=>q("plan"),children:[e.jsx(B,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View all ",i.length]})]})]}),e.jsxs("div",{className:`s-work-material-evidence-stack${g?"":" s-work-material-evidence-stack-single"}`,children:[g&&e.jsxs("article",{className:"s-work-material-card s-work-material-card-docs",children:[e.jsxs("div",{className:"s-work-material-head",children:[e.jsx("span",{className:"s-work-material-icon","aria-hidden":"true",children:e.jsx(xe,{size:15,strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("div",{className:"s-work-material-kicker",children:"Docs"}),e.jsxs("div",{className:"s-work-material-title",children:[o.length," documents"]})]})]}),e.jsx(E,{materials:o.slice(0,3),empty:"Docs from git or trace evidence will appear here.",selectedId:a,onOpen:A}),o.length>3&&e.jsx("div",{className:"s-work-material-card-actions",children:e.jsxs("button",{type:"button",className:"s-work-material-link",onClick:()=>q("doc"),children:[e.jsx(B,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View all ",o.length]})})]}),e.jsxs("article",{className:"s-work-material-card s-work-material-card-code",children:[e.jsxs("div",{className:"s-work-material-head",children:[e.jsx("span",{className:"s-work-material-icon","aria-hidden":"true",children:e.jsx(pe,{size:15,strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("div",{className:"s-work-material-kicker",children:"Code"}),e.jsx("div",{className:"s-work-material-title",children:u.length>0?`${u.length} related files`:"No code yet"})]})]}),e.jsx(E,{materials:u.slice(0,5),empty:"Changed code from git or session traces will appear here.",selectedId:a,onOpen:A}),u.length>5&&e.jsx("div",{className:"s-work-material-card-actions",children:e.jsxs("button",{type:"button",className:"s-work-material-link",onClick:()=>q("code"),children:[e.jsx(B,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View all ",u.length]})})]})]})]}),e.jsx($e,{detail:s,summary:k,open:N,hasThread:r,navigate:t,onClose:()=>j(!1)}),e.jsx(Te,{material:v.find(l=>l.id===a)??null,content:C,loading:!!d,error:I,onClose:()=>x(null)}),e.jsx(de,{workId:s.id,workTitle:s.title,materials:v,open:re,initialKind:ie,onClose:()=>P(!1)}),n.limitations.length>0&&e.jsx("div",{className:"s-work-inventory-note",children:n.limitations[0]})]})}function $e({detail:s,summary:t,open:r,hasThread:n,navigate:i,onClose:o}){const{route:u}=T();if(!r||!t)return null;const p=Z({id:`${s.id}:brief`,title:"Original request",uri:`scout://work/${s.id}/brief`,mediaType:"text/markdown",value:`# Original request
3
+ `)}function U(s){navigator.clipboard?.writeText(s)}function be({detail:s,navigate:t}){const{route:r}=T(),n=s.primaryInvocation,i=ne(s).query,o=ye(s),u=Y(n?.source),f=n?.targetAgentName??n?.targetAgentId??s.ownerName??s.ownerId??"—",g=n?.task??se(s)??s.summary??"No original prompt captured.",k=n?.resolvedSessionId?{view:"sessions",sessionId:n.resolvedSessionId,...n.targetAgentId?{agentId:n.targetAgentId}:{}}:n?.targetAgentId?{view:"agents-v2",agentId:n.targetAgentId,tab:"observe"}:null,w=n?.resolvedSessionId?"Observe session":"Observe agent",v={view:"ops",mode:"tail",...i?{tailQuery:i}:{},workId:s.id,...n?.flightId?{flightId:n.flightId}:{},...n?.invocationId?{invocationId:n.invocationId}:{},...s.conversationId?{conversationId:s.conversationId}:{},...n?.resolvedSessionId?{sessionId:n.resolvedSessionId}:{},...n?.targetAgentId?{targetAgentId:n.targetAgentId}:{}};return e.jsxs("section",{className:"s-work-casefile-section s-work-ask-overview","data-kind":"ask","data-work-id":s.id,"data-flight-id":n?.flightId??void 0,"data-invocation-id":n?.invocationId??void 0,"data-agent-id":n?.targetAgentId??void 0,children:[e.jsx("div",{className:"s-work-ask-head",children:e.jsxs("div",{children:[e.jsxs("div",{className:"s-work-ask-badges",children:[e.jsx("span",{className:"s-work-ask-badge s-work-ask-badge-primary",children:"RUN created"}),e.jsx("span",{className:"s-work-ask-badge",children:u}),n?.state&&e.jsx("span",{className:"s-work-ask-badge",children:n.state})]}),e.jsx("h2",{className:"s-agent-section-title s-work-ask-title",children:"Message / work source of truth"}),e.jsx("p",{className:"s-work-ask-lifecycle",children:ee(s)})]})}),e.jsxs("div",{className:"s-work-ask-grid",children:[e.jsxs("div",{className:"s-work-ask-prompt",children:[e.jsx("span",{className:"s-work-ask-label",children:"Original prompt"}),e.jsx("p",{children:M(g)})]}),e.jsxs("dl",{className:"s-work-ask-facts",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Requested harness"}),e.jsx("dd",{children:n?.requestedHarness??"default"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Requested model"}),e.jsx("dd",{children:n?.requestedModel??"default"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Requested effort"}),e.jsx("dd",{children:n?.requestedReasoningEffort??"default"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved agent"}),e.jsx("dd",{children:f})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved harness"}),e.jsx("dd",{children:n?.resolvedHarness??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved model"}),e.jsx("dd",{children:n?.resolvedModel??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Resolved effort"}),e.jsx("dd",{children:n?.resolvedReasoningEffort??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Observed model"}),e.jsx("dd",{children:n?.observedModel??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Observed effort"}),e.jsx("dd",{children:n?.observedReasoningEffort??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Session"}),e.jsx("dd",{children:n?.resolvedSessionId??n?.targetSessionId??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Flight"}),e.jsx("dd",{children:n?.flightId??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Invocation"}),e.jsx("dd",{children:n?.invocationId??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Work"}),e.jsx("dd",{children:s.id})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Conversation"}),e.jsx("dd",{children:s.conversationId??"—"})]})]})]}),e.jsxs("div",{className:"s-work-ask-actions",children:[k&&e.jsx(p,{primary:!0,icon:e.jsx(V,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,k,{returnTo:r}),children:w}),e.jsx(p,{icon:e.jsx(_,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>U(Ne(s)),children:"Copy status"}),s.conversationId&&e.jsx(p,{icon:e.jsx(W,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,{view:"conversation",conversationId:s.conversationId},{returnTo:r}),children:"Open chat"}),e.jsx(p,{icon:e.jsx(G,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,{view:"work",workId:s.id},{returnTo:r}),children:"Open work"}),n?.resolvedSessionId&&e.jsx(p,{icon:e.jsx(V,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,{view:"sessions",sessionId:n.resolvedSessionId},{returnTo:r}),children:"Open session"}),e.jsx(p,{icon:e.jsx(J,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,v,{returnTo:r}),children:"Scout tail"}),o&&e.jsx(p,{icon:e.jsx(_,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>U(o),children:"Copy MCP ids"}),s.conversationId&&e.jsx(p,{icon:e.jsx(W,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,{view:"conversation",conversationId:s.conversationId},{returnTo:r}),children:"Nudge agent"})]})]})}function Se({detail:s,navigate:t}){const r=!!s.conversationId,n=s.inventory??Ce(s),i=n.materials.filter(l=>l.kind==="plan"||l.kind==="spec"),o=n.materials.filter(l=>l.kind==="doc"),u=n.materials.filter(l=>l.kind==="code"||l.kind==="test"||l.kind==="config"||l.kind==="asset"||l.kind==="other"),f=i.length>0,g=o.length>0,k=se(s),w=i[0]?We(i[0]):k??"No plan or spec file detected yet.",v=[...i,...o,...u].filter(l=>l.status!=="deleted"),[N,j]=h.useState(!1),[a,x]=h.useState(null),[C,y]=h.useState(null),[I,b]=h.useState(null),[d,R]=h.useState(null),[re,P]=h.useState(!1),[ie,oe]=h.useState("all"),A=h.useCallback(l=>{j(!1),x(l)},[]),ae=h.useCallback(()=>{x(null),j(!0)},[]),q=h.useCallback(l=>{j(!1),x(null),oe(l),P(!0)},[]);return h.useEffect(()=>{a&&!v.some(l=>l.id===a)&&x(null)},[a,v]),h.useEffect(()=>{if(!a){y(null),b(null),R(null);return}let l=!1;return R(a),b(null),X(`/api/work/${encodeURIComponent(s.id)}/material?materialId=${encodeURIComponent(a)}`).then(S=>{l||y(S)}).catch(S=>{l||(y(null),b(S instanceof Error?S.message:String(S)))}).finally(()=>{l||R(null)}),()=>{l=!0}},[s.id,a]),e.jsxs("section",{className:"s-work-casefile-section s-work-materials-section",children:[e.jsxs("div",{className:"s-agent-section-heading",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"s-agent-section-title",children:"Work materials"}),e.jsxs("p",{className:"s-work-section-note",children:[Me(n.mode)," · ",n.source," evidence · ",n.confidence," confidence"]})]}),e.jsxs("div",{className:"s-work-inventory-meta","aria-label":"Inventory totals",children:[e.jsxs("span",{children:[n.totals.materials," files"]}),e.jsxs("span",{children:[n.totals.agents," agents"]}),e.jsxs("span",{children:[n.totals.sessions," sessions"]})]})]}),e.jsxs("div",{className:"s-work-material-grid",children:[e.jsxs("article",{className:"s-work-material-card s-work-material-card-primary",children:[e.jsxs("div",{className:"s-work-material-head",children:[e.jsx("span",{className:"s-work-material-icon","aria-hidden":"true",children:e.jsx(D,{size:15,strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("div",{className:"s-work-material-kicker",children:f?"Plans & specs":"Brief"}),e.jsx("div",{className:"s-work-material-title",children:f?`${i.length} surfaced`:k?"Original request":"No plan file yet"})]})]}),e.jsx("p",{className:"s-work-material-copy",children:w}),e.jsx(E,{materials:i.slice(0,3),empty:"No plan or spec files detected yet.",selectedId:a,onOpen:A}),e.jsxs("div",{className:"s-work-material-card-actions",children:[k&&e.jsxs("button",{type:"button",className:`s-work-material-link${N?" s-work-material-link-active":""}`,onClick:ae,children:[e.jsx(D,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View request"]}),i.length>3&&e.jsxs("button",{type:"button",className:"s-work-material-link",onClick:()=>q("plan"),children:[e.jsx(B,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View all ",i.length]})]})]}),e.jsxs("div",{className:`s-work-material-evidence-stack${g?"":" s-work-material-evidence-stack-single"}`,children:[g&&e.jsxs("article",{className:"s-work-material-card s-work-material-card-docs",children:[e.jsxs("div",{className:"s-work-material-head",children:[e.jsx("span",{className:"s-work-material-icon","aria-hidden":"true",children:e.jsx(xe,{size:15,strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("div",{className:"s-work-material-kicker",children:"Docs"}),e.jsxs("div",{className:"s-work-material-title",children:[o.length," documents"]})]})]}),e.jsx(E,{materials:o.slice(0,3),empty:"Docs from git or trace evidence will appear here.",selectedId:a,onOpen:A}),o.length>3&&e.jsx("div",{className:"s-work-material-card-actions",children:e.jsxs("button",{type:"button",className:"s-work-material-link",onClick:()=>q("doc"),children:[e.jsx(B,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View all ",o.length]})})]}),e.jsxs("article",{className:"s-work-material-card s-work-material-card-code",children:[e.jsxs("div",{className:"s-work-material-head",children:[e.jsx("span",{className:"s-work-material-icon","aria-hidden":"true",children:e.jsx(fe,{size:15,strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("div",{className:"s-work-material-kicker",children:"Code"}),e.jsx("div",{className:"s-work-material-title",children:u.length>0?`${u.length} related files`:"No code yet"})]})]}),e.jsx(E,{materials:u.slice(0,5),empty:"Changed code from git or session traces will appear here.",selectedId:a,onOpen:A}),u.length>5&&e.jsx("div",{className:"s-work-material-card-actions",children:e.jsxs("button",{type:"button",className:"s-work-material-link",onClick:()=>q("code"),children:[e.jsx(B,{"aria-hidden":"true",size:13,strokeWidth:1.8}),"View all ",u.length]})})]})]})]}),e.jsx($e,{detail:s,summary:k,open:N,hasThread:r,navigate:t,onClose:()=>j(!1)}),e.jsx(Te,{material:v.find(l=>l.id===a)??null,content:C,loading:!!d,error:I,onClose:()=>x(null)}),e.jsx(de,{workId:s.id,workTitle:s.title,materials:v,open:re,initialKind:ie,onClose:()=>P(!1)}),n.limitations.length>0&&e.jsx("div",{className:"s-work-inventory-note",children:n.limitations[0]})]})}function $e({detail:s,summary:t,open:r,hasThread:n,navigate:i,onClose:o}){const{route:u}=T();if(!r||!t)return null;const f=Z({id:`${s.id}:brief`,title:"Original request",uri:`scout://work/${s.id}/brief`,mediaType:"text/markdown",value:`# Original request
4
4
 
5
- ${t}`,readOnly:!0});return e.jsx(Q,{kind:"ask",document:p,title:"Original request",eyebrow:"Brief",subtitle:s.title,meta:["request",n?"thread linked":"threadless"],mode:"preview",actions:n&&s.conversationId?[{label:"Thread",icon:e.jsx(W,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(i,{view:"conversation",conversationId:s.conversationId},{returnTo:u}),title:"Open source thread"}]:[],onClose:o})}function se(s){const t=[...s.timeline].sort((i,o)=>i.at-o.at),r=t.find(i=>i.kind==="collaboration_event"&&i.detailKind==="created"&&i.summary),n=t.find(i=>i.kind==="message"&&i.summary);return r?.summary??n?.summary??null}function Ce(s){return{workId:s.id,generatedAt:Date.now(),mode:"trace-only",source:"broker",confidence:"low",agents:[],sessions:[],materials:[],totals:{materials:0,plans:0,specs:0,docs:0,code:0,tests:0,config:0,assets:0,agents:0,sessions:0},limitations:["Inventory is not available from this server yet."]}}function Me(s){switch(s){case"isolated-git-worktree":return"Isolated git worktree";case"shared-git-repo":return"Shared git repo";case"explicit-artifacts":return"Explicit artifacts";default:return"Trace-only"}}function We(s){const t=s.diffStat?`+${s.diffStat.additions} / -${s.diffStat.deletions}`:s.status;return`${s.path} · ${t} · ${s.confidence} confidence`}function E({materials:s,empty:t,selectedId:r,onOpen:n}){return s.length===0?e.jsx("div",{className:"s-work-material-empty",children:t}):e.jsx("div",{className:"s-work-material-list",children:s.map(i=>e.jsxs("button",{type:"button",className:`s-work-material-row${r===i.id?" s-work-material-row-active":""}`,title:i.path,onClick:()=>n?.(i.id),disabled:!n||i.status==="deleted",children:[e.jsx("div",{className:"s-work-material-path",children:i.path}),e.jsxs("div",{className:"s-work-material-row-meta",children:[e.jsx("span",{children:i.status}),i.diffStat&&e.jsxs("span",{children:["+",i.diffStat.additions," -",i.diffStat.deletions]}),e.jsx("span",{children:i.confidence})]})]},i.id))})}function Te({material:s,content:t,loading:r,error:n,onClose:i}){if(!s)return null;const o=t?Z({id:t.materialId,title:t.title,uri:t.uri,mediaType:t.mediaType,value:t.content,readOnly:!0}):null;return e.jsx(Q,{kind:Re(s),document:o,title:s.path,eyebrow:s.kind==="spec"?"Spec":s.kind,subtitle:t?.uri??s.worktreeRoot??void 0,meta:[s.status,s.confidence,...t?[H(t.sizeBytes)]:[]],mode:o?.kind==="markdown"?"preview":"read",state:r||!t&&!n?"Loading file...":null,error:r?null:n,notice:t?.truncated?`Preview truncated at ${H(t.content.length)}.`:null,onClose:i})}function Re(s){return s.kind==="plan"||s.kind==="spec"?"plan":s.kind==="doc"?"doc":"code"}function H(s){return s<1024?`${s} B`:s<1024*1024?`${Math.round(s/1024)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function te(s){const t=s.split(".");return t[t.length-1]||s}function c(s,t){const r=t?.trim();!r||r.length<3||s.add(r)}function F(s,t){c(s,t);const n=t?.trim().replace(/\/+$/,"")?.split("/").filter(Boolean).at(-1);n&&n.length>=3&&s.add(n)}function Ae(s){return s.replace(/^\/Users\/[^/]+/,"~")}function ne(s){const t=new Set,r=[],n=s.ownerName??s.ownerId??s.nextMoveOwnerName??s.nextMoveOwnerId;c(t,s.id),c(t,s.conversationId),c(t,s.ownerId),c(t,s.nextMoveOwnerId),c(t,s.ownerName),c(t,s.nextMoveOwnerName);for(const o of s.activeFlights)c(t,o.id),c(t,o.invocationId),c(t,o.agentId),c(t,o.agentName),c(t,o.conversationId),c(t,o.collaborationRecordId);for(const o of s.inventory?.agents??[])c(t,o.id),c(t,o.name),c(t,o.sessionId),F(t,o.cwd),F(t,o.projectRoot);const i=s.inventory?.sessions.find(o=>o.cwd)??s.inventory?.sessions[0]??null;for(const o of s.inventory?.sessions??[])c(t,o.id),c(t,o.conversationId),c(t,o.agentId),c(t,o.agentName),F(t,o.cwd);return n&&r.push(n),i?.cwd&&r.push(Ae(i.cwd)),{query:[...t].slice(0,20).join("|"),label:r.length>0?r.join(" · "):`Case ${te(s.id)}`}}function qe(s){return s.kind==="message"?s.title||(s.detailKind==="agent"?"reply":"thread update"):s.kind==="flight_started"?"agent output":s.kind==="flight_completed"?s.detailKind==="completed"?"reply":s.detailKind??"flight":s.detailKind==="created"?"request created":s.title??s.kind.replace(/_/g," ")}function Oe({detail:s}){const t=s.timeline.slice(0,18);return t.length===0?null:e.jsxs("section",{className:"s-work-casefile-section s-work-timeline-panel",children:[e.jsx("div",{className:"s-agent-section-heading",children:e.jsxs("div",{children:[e.jsx("h2",{className:"s-agent-section-title",children:"Timeline"}),e.jsx("p",{className:"s-work-section-note",children:"Run lifecycle, follow-up requirements, flight state, and replies attached to this work item."})]})}),e.jsx("div",{className:"s-work-timeline-list",children:t.map(r=>e.jsxs("article",{className:`s-work-timeline-row s-work-timeline-row-${r.kind}`,"data-kind":r.kind,"data-flight-id":r.flightId??void 0,"data-work-id":s.id,"data-conversation-id":r.conversationId??s.conversationId??void 0,children:[e.jsx("span",{className:"s-work-timeline-badge",children:qe(r)}),e.jsxs("div",{className:"s-work-timeline-body",children:[e.jsxs("div",{className:"s-work-timeline-meta",children:[e.jsx("span",{children:r.actorName??r.actorId??"system"}),e.jsx("span",{children:$(r.at)})]}),r.summary&&e.jsx("p",{children:M(r.summary)})]})]},r.id))})]})}function ze({detail:s,navigate:t}){const{route:r}=T(),n=ne(s);return e.jsxs("section",{className:"s-work-casefile-section s-work-tail-section",children:[e.jsxs("div",{className:"s-agent-section-heading s-work-tail-heading",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"s-agent-section-title s-work-tail-title",children:[e.jsx(J,{"aria-hidden":"true",size:15,strokeWidth:1.8}),"Live tail"]}),e.jsxs("p",{className:"s-work-section-note",children:["Filtered to ",n.label]})]}),e.jsx(f,{icon:e.jsx(G,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,{view:"ops",mode:"tail",tailQuery:n.query||void 0},{returnTo:r}),children:"Scout tail"})]}),e.jsx("div",{className:"s-work-tail-frame",children:e.jsx(fe,{navigate:t,initialFilter:n.query,filterLabel:n.label,filterScope:"context",chrome:"embedded"})})]})}function Ps({workId:s,navigate:t}){const{agents:r,route:n}=T(),[i,o]=h.useState(null),[u,p]=h.useState(null),[g,k]=h.useState(!1),w=h.useCallback(async()=>{p(null);try{const d=await X(`/api/work/${encodeURIComponent(s)}`);o(d)}catch(d){p(d instanceof Error?d.message:String(d)),o(null)}finally{k(!0)}},[s]);h.useEffect(()=>{k(!1),w()},[w]),ue(()=>{w()});const v=he(n),N=h.useMemo(()=>le(r,v),[r,v]),j=h.useMemo(()=>i?ce(i,N):null,[i,N]);if(!g)return e.jsxs("div",{children:[e.jsx(z,{slot:"work",fallback:{view:"inbox"},navigate:t}),e.jsx("div",{className:"s-empty",children:e.jsx("p",{children:"Loading…"})})]});if(!i||!j)return e.jsxs("div",{className:"s-work-not-found",children:[e.jsx(z,{slot:"work",fallback:{view:"inbox"},navigate:t}),e.jsxs("div",{className:"s-work-not-found-body",children:[e.jsx("div",{className:"s-work-not-found-glyph","aria-hidden":"true",children:"□"}),e.jsx("h2",{className:"s-work-not-found-title",children:i?"Work item outside this machine scope":"Work item not found"}),e.jsx("p",{className:"s-work-not-found-sub",children:i?"Clear the machine scope or switch machines to inspect this work item.":"This work item may have been removed or does not exist on this broker."}),u&&e.jsx("p",{className:"s-work-not-found-detail",children:u})]})]});const a=j,x=ge(a.attention),C=a.ownerName??a.ownerId??"Unassigned",y=a.nextMoveOwnerName??a.nextMoveOwnerId??"—",I=Ie({detail:a,signal:x,ownerLabel:C,nextMoveLabel:y}),b=a.activeFlights.length>0||a.childWork.length>0;return e.jsxs("div",{className:"s-work-detail s-work-casefile",children:[e.jsxs("div",{className:"s-work-casefile-topbar",children:[e.jsx(z,{slot:"work",fallback:{view:"inbox"},navigate:t}),e.jsxs("span",{className:"s-work-casefile-record",children:["Case ",te(a.id)]})]}),u&&e.jsx("p",{className:"s-error",children:u}),e.jsxs("section",{className:"s-work-casefile-hero",children:[e.jsxs("div",{className:"s-work-casefile-hero-main",children:[e.jsxs("div",{className:"s-work-casefile-title-row",children:[e.jsx("h1",{className:"s-work-casefile-title",children:a.title}),e.jsx(O,{tone:me(a),variant:"pill",children:a.currentPhase})]}),a.lastMeaningfulSummary&&e.jsx("div",{className:"s-work-casefile-summary",children:M(a.lastMeaningfulSummary)}),e.jsxs("div",{className:"s-work-casefile-meta",children:[e.jsxs("span",{children:["Updated ",$(a.updatedAt)]}),e.jsx("span",{children:C}),e.jsx("span",{children:K(a.state)}),x&&e.jsx("span",{children:x}),a.priority&&e.jsxs("span",{children:["Priority ",a.priority]})]})]}),e.jsxs("aside",{className:`s-work-next-move s-work-next-move-${I.tone}`,children:[e.jsx("div",{className:"s-work-next-move-kicker",children:I.eyebrow}),e.jsx("div",{className:"s-work-next-move-title",children:I.title}),e.jsx("p",{className:"s-work-next-move-copy",children:I.body}),e.jsx("div",{className:"s-work-next-move-actions",children:a.conversationId&&e.jsx(f,{primary:!0,icon:e.jsx(W,{"aria-hidden":"true",size:14,strokeWidth:1.8}),onClick:()=>m(t,{view:"conversation",conversationId:a.conversationId},{returnTo:n}),children:"Open thread"})})]})]}),e.jsxs("div",{className:"s-work-casefile-layout s-work-casefile-layout-main",children:[e.jsxs("div",{className:"s-work-casefile-main s-work-casefile-main-materials",children:[e.jsx(be,{detail:a,navigate:t}),e.jsx(Se,{detail:a,navigate:t}),e.jsx(Oe,{detail:a})]}),e.jsx(ze,{detail:a,navigate:t}),b&&e.jsxs("div",{className:"s-work-casefile-main s-work-casefile-main-lower",children:[a.activeFlights.length>0&&e.jsxs("section",{className:"s-work-casefile-section",children:[e.jsx("div",{className:"s-agent-section-heading",children:e.jsx("h2",{className:"s-agent-section-title",children:"Flights"})}),e.jsx("div",{className:"s-work-flight-list",children:a.activeFlights.map(d=>e.jsxs("button",{type:"button",className:"s-work-flight-card",onClick:d.conversationId?()=>m(t,{view:"conversation",conversationId:d.conversationId},{returnTo:n}):void 0,disabled:!d.conversationId,children:[e.jsxs("div",{className:"s-work-flight-card-header",children:[e.jsx("span",{className:"s-work-flight-card-title",children:d.agentName??d.agentId}),e.jsx(O,{tone:"working",variant:"pill",children:d.state})]}),e.jsxs("div",{className:"s-work-flight-card-meta",children:[e.jsx("span",{children:d.startedAt?`Started ${$(d.startedAt)}`:"Start time unavailable"}),d.completedAt&&e.jsxs("span",{children:["Completed ",$(d.completedAt)]})]}),d.summary&&e.jsx("div",{className:"s-work-flight-card-copy",children:d.summary})]},d.id))})]}),a.childWork.length>0&&e.jsxs("section",{className:"s-work-casefile-section",children:[e.jsx("div",{className:"s-agent-section-heading",children:e.jsx("h2",{className:"s-agent-section-title",children:"Child work"})}),e.jsx("div",{className:"s-work-related-list",children:a.childWork.map(d=>e.jsxs("button",{type:"button",className:"s-work-related-card",onClick:()=>m(t,{view:"work",workId:d.id},{returnTo:n}),children:[e.jsxs("div",{className:"s-work-related-card-header",children:[e.jsx("span",{className:"s-work-related-card-title",children:d.title}),e.jsx(O,{tone:ke(d),variant:"pill",children:d.currentPhase})]}),e.jsxs("div",{className:"s-work-related-card-meta",children:[e.jsx("span",{children:d.ownerName??d.ownerId??"Unassigned"}),e.jsx("span",{children:K(d.state)}),e.jsx("span",{children:$(d.lastMeaningfulAt)})]}),d.lastMeaningfulSummary&&e.jsx("div",{className:"s-work-related-card-copy",children:M(d.lastMeaningfulSummary)})]},d.id))})]})]})]})]})}export{Ps as WorkDetailScreen};
5
+ ${t}`,readOnly:!0});return e.jsx(Q,{kind:"ask",document:f,title:"Original request",eyebrow:"Brief",subtitle:s.title,meta:["request",n?"thread linked":"threadless"],mode:"preview",actions:n&&s.conversationId?[{label:"Thread",icon:e.jsx(W,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(i,{view:"conversation",conversationId:s.conversationId},{returnTo:u}),title:"Open source thread"}]:[],onClose:o})}function se(s){const t=[...s.timeline].sort((i,o)=>i.at-o.at),r=t.find(i=>i.kind==="collaboration_event"&&i.detailKind==="created"&&i.summary),n=t.find(i=>i.kind==="message"&&i.summary);return r?.summary??n?.summary??null}function Ce(s){return{workId:s.id,generatedAt:Date.now(),mode:"trace-only",source:"broker",confidence:"low",agents:[],sessions:[],materials:[],totals:{materials:0,plans:0,specs:0,docs:0,code:0,tests:0,config:0,assets:0,agents:0,sessions:0},limitations:["Inventory is not available from this server yet."]}}function Me(s){switch(s){case"isolated-git-worktree":return"Isolated git worktree";case"shared-git-repo":return"Shared git repo";case"explicit-artifacts":return"Explicit artifacts";default:return"Trace-only"}}function We(s){const t=s.diffStat?`+${s.diffStat.additions} / -${s.diffStat.deletions}`:s.status;return`${s.path} · ${t} · ${s.confidence} confidence`}function E({materials:s,empty:t,selectedId:r,onOpen:n}){return s.length===0?e.jsx("div",{className:"s-work-material-empty",children:t}):e.jsx("div",{className:"s-work-material-list",children:s.map(i=>e.jsxs("button",{type:"button",className:`s-work-material-row${r===i.id?" s-work-material-row-active":""}`,title:i.path,onClick:()=>n?.(i.id),disabled:!n||i.status==="deleted",children:[e.jsx("div",{className:"s-work-material-path",children:i.path}),e.jsxs("div",{className:"s-work-material-row-meta",children:[e.jsx("span",{children:i.status}),i.diffStat&&e.jsxs("span",{children:["+",i.diffStat.additions," -",i.diffStat.deletions]}),e.jsx("span",{children:i.confidence})]})]},i.id))})}function Te({material:s,content:t,loading:r,error:n,onClose:i}){if(!s)return null;const o=t?Z({id:t.materialId,title:t.title,uri:t.uri,mediaType:t.mediaType,value:t.content,readOnly:!0}):null;return e.jsx(Q,{kind:Re(s),document:o,title:s.path,eyebrow:s.kind==="spec"?"Spec":s.kind,subtitle:t?.uri??s.worktreeRoot??void 0,meta:[s.status,s.confidence,...t?[H(t.sizeBytes)]:[]],mode:o?.kind==="markdown"?"preview":"read",state:r||!t&&!n?"Loading file...":null,error:r?null:n,notice:t?.truncated?`Preview truncated at ${H(t.content.length)}.`:null,onClose:i})}function Re(s){return s.kind==="plan"||s.kind==="spec"?"plan":s.kind==="doc"?"doc":"code"}function H(s){return s<1024?`${s} B`:s<1024*1024?`${Math.round(s/1024)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function te(s){const t=s.split(".");return t[t.length-1]||s}function c(s,t){const r=t?.trim();!r||r.length<3||s.add(r)}function F(s,t){c(s,t);const n=t?.trim().replace(/\/+$/,"")?.split("/").filter(Boolean).at(-1);n&&n.length>=3&&s.add(n)}function Ae(s){return s.replace(/^\/Users\/[^/]+/,"~")}function ne(s){const t=new Set,r=[],n=s.ownerName??s.ownerId??s.nextMoveOwnerName??s.nextMoveOwnerId;c(t,s.id),c(t,s.conversationId),c(t,s.ownerId),c(t,s.nextMoveOwnerId),c(t,s.ownerName),c(t,s.nextMoveOwnerName);for(const o of s.activeFlights)c(t,o.id),c(t,o.invocationId),c(t,o.agentId),c(t,o.agentName),c(t,o.conversationId),c(t,o.collaborationRecordId);for(const o of s.inventory?.agents??[])c(t,o.id),c(t,o.name),c(t,o.sessionId),F(t,o.cwd),F(t,o.projectRoot);const i=s.inventory?.sessions.find(o=>o.cwd)??s.inventory?.sessions[0]??null;for(const o of s.inventory?.sessions??[])c(t,o.id),c(t,o.conversationId),c(t,o.agentId),c(t,o.agentName),F(t,o.cwd);return n&&r.push(n),i?.cwd&&r.push(Ae(i.cwd)),{query:[...t].slice(0,20).join("|"),label:r.length>0?r.join(" · "):`Case ${te(s.id)}`}}function qe(s){return s.kind==="message"?s.title||(s.detailKind==="agent"?"reply":"thread update"):s.kind==="flight_started"?"agent output":s.kind==="flight_completed"?s.detailKind==="completed"?"reply":s.detailKind??"flight":s.detailKind==="created"?"request created":s.title??s.kind.replace(/_/g," ")}function Oe({detail:s}){const t=s.timeline.slice(0,18);return t.length===0?null:e.jsxs("section",{className:"s-work-casefile-section s-work-timeline-panel",children:[e.jsx("div",{className:"s-agent-section-heading",children:e.jsxs("div",{children:[e.jsx("h2",{className:"s-agent-section-title",children:"Timeline"}),e.jsx("p",{className:"s-work-section-note",children:"Run lifecycle, follow-up requirements, flight state, and replies attached to this work item."})]})}),e.jsx("div",{className:"s-work-timeline-list",children:t.map(r=>e.jsxs("article",{className:`s-work-timeline-row s-work-timeline-row-${r.kind}`,"data-kind":r.kind,"data-flight-id":r.flightId??void 0,"data-work-id":s.id,"data-conversation-id":r.conversationId??s.conversationId??void 0,children:[e.jsx("span",{className:"s-work-timeline-badge",children:qe(r)}),e.jsxs("div",{className:"s-work-timeline-body",children:[e.jsxs("div",{className:"s-work-timeline-meta",children:[e.jsx("span",{children:r.actorName??r.actorId??"system"}),e.jsx("span",{children:$(r.at)})]}),r.summary&&e.jsx("p",{children:M(r.summary)})]})]},r.id))})]})}function ze({detail:s,navigate:t}){const{route:r}=T(),n=ne(s);return e.jsxs("section",{className:"s-work-casefile-section s-work-tail-section",children:[e.jsxs("div",{className:"s-agent-section-heading s-work-tail-heading",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"s-agent-section-title s-work-tail-title",children:[e.jsx(J,{"aria-hidden":"true",size:15,strokeWidth:1.8}),"Live tail"]}),e.jsxs("p",{className:"s-work-section-note",children:["Filtered to ",n.label]})]}),e.jsx(p,{icon:e.jsx(G,{"aria-hidden":"true",size:13,strokeWidth:1.8}),onClick:()=>m(t,{view:"ops",mode:"tail",tailQuery:n.query||void 0},{returnTo:r}),children:"Scout tail"})]}),e.jsx("div",{className:"s-work-tail-frame",children:e.jsx(pe,{navigate:t,initialFilter:n.query,filterLabel:n.label,filterScope:"context",chrome:"embedded"})})]})}function Vs({workId:s,navigate:t}){const{agents:r,route:n}=T(),[i,o]=h.useState(null),[u,f]=h.useState(null),[g,k]=h.useState(!1),w=h.useCallback(async()=>{f(null);try{const d=await X(`/api/work/${encodeURIComponent(s)}`);o(d)}catch(d){f(d instanceof Error?d.message:String(d)),o(null)}finally{k(!0)}},[s]);h.useEffect(()=>{k(!1),w()},[w]),ue(()=>{w()});const v=he(n),N=h.useMemo(()=>le(r,v),[r,v]),j=h.useMemo(()=>i?ce(i,N):null,[i,N]);if(!g)return e.jsxs("div",{children:[e.jsx(z,{slot:"work",fallback:{view:"inbox"},navigate:t}),e.jsx("div",{className:"s-empty",children:e.jsx("p",{children:"Loading…"})})]});if(!i||!j)return e.jsxs("div",{className:"s-work-not-found",children:[e.jsx(z,{slot:"work",fallback:{view:"inbox"},navigate:t}),e.jsxs("div",{className:"s-work-not-found-body",children:[e.jsx("div",{className:"s-work-not-found-glyph","aria-hidden":"true",children:"□"}),e.jsx("h2",{className:"s-work-not-found-title",children:i?"Work item outside this machine scope":"Work item not found"}),e.jsx("p",{className:"s-work-not-found-sub",children:i?"Clear the machine scope or switch machines to inspect this work item.":"This work item may have been removed or does not exist on this broker."}),u&&e.jsx("p",{className:"s-work-not-found-detail",children:u})]})]});const a=j,x=ge(a.attention),C=a.ownerName??a.ownerId??"Unassigned",y=a.nextMoveOwnerName??a.nextMoveOwnerId??"—",I=Ie({detail:a,signal:x,ownerLabel:C,nextMoveLabel:y}),b=a.activeFlights.length>0||a.childWork.length>0;return e.jsxs("div",{className:"s-work-detail s-work-casefile",children:[e.jsxs("div",{className:"s-work-casefile-topbar",children:[e.jsx(z,{slot:"work",fallback:{view:"inbox"},navigate:t}),e.jsxs("span",{className:"s-work-casefile-record",children:["Case ",te(a.id)]})]}),u&&e.jsx("p",{className:"s-error",children:u}),e.jsxs("section",{className:"s-work-casefile-hero",children:[e.jsxs("div",{className:"s-work-casefile-hero-main",children:[e.jsxs("div",{className:"s-work-casefile-title-row",children:[e.jsx("h1",{className:"s-work-casefile-title",children:a.title}),e.jsx(O,{tone:me(a),variant:"pill",children:a.currentPhase})]}),a.lastMeaningfulSummary&&e.jsx("div",{className:"s-work-casefile-summary",children:M(a.lastMeaningfulSummary)}),e.jsxs("div",{className:"s-work-casefile-meta",children:[e.jsxs("span",{children:["Updated ",$(a.updatedAt)]}),e.jsx("span",{children:C}),e.jsx("span",{children:K(a.state)}),x&&e.jsx("span",{children:x}),a.priority&&e.jsxs("span",{children:["Priority ",a.priority]})]})]}),e.jsxs("aside",{className:`s-work-next-move s-work-next-move-${I.tone}`,children:[e.jsx("div",{className:"s-work-next-move-kicker",children:I.eyebrow}),e.jsx("div",{className:"s-work-next-move-title",children:I.title}),e.jsx("p",{className:"s-work-next-move-copy",children:I.body}),e.jsx("div",{className:"s-work-next-move-actions",children:a.conversationId&&e.jsx(p,{primary:!0,icon:e.jsx(W,{"aria-hidden":"true",size:14,strokeWidth:1.8}),onClick:()=>m(t,{view:"conversation",conversationId:a.conversationId},{returnTo:n}),children:"Open thread"})})]})]}),e.jsxs("div",{className:"s-work-casefile-layout s-work-casefile-layout-main",children:[e.jsxs("div",{className:"s-work-casefile-main s-work-casefile-main-materials",children:[e.jsx(be,{detail:a,navigate:t}),e.jsx(Se,{detail:a,navigate:t}),e.jsx(Oe,{detail:a})]}),e.jsx(ze,{detail:a,navigate:t}),b&&e.jsxs("div",{className:"s-work-casefile-main s-work-casefile-main-lower",children:[a.activeFlights.length>0&&e.jsxs("section",{className:"s-work-casefile-section",children:[e.jsx("div",{className:"s-agent-section-heading",children:e.jsx("h2",{className:"s-agent-section-title",children:"Flights"})}),e.jsx("div",{className:"s-work-flight-list",children:a.activeFlights.map(d=>e.jsxs("button",{type:"button",className:"s-work-flight-card",onClick:d.conversationId?()=>m(t,{view:"conversation",conversationId:d.conversationId},{returnTo:n}):void 0,disabled:!d.conversationId,children:[e.jsxs("div",{className:"s-work-flight-card-header",children:[e.jsx("span",{className:"s-work-flight-card-title",children:d.agentName??d.agentId}),e.jsx(O,{tone:"working",variant:"pill",children:d.state})]}),e.jsxs("div",{className:"s-work-flight-card-meta",children:[e.jsx("span",{children:d.startedAt?`Started ${$(d.startedAt)}`:"Start time unavailable"}),d.completedAt&&e.jsxs("span",{children:["Completed ",$(d.completedAt)]})]}),d.summary&&e.jsx("div",{className:"s-work-flight-card-copy",children:d.summary})]},d.id))})]}),a.childWork.length>0&&e.jsxs("section",{className:"s-work-casefile-section",children:[e.jsx("div",{className:"s-agent-section-heading",children:e.jsx("h2",{className:"s-agent-section-title",children:"Child work"})}),e.jsx("div",{className:"s-work-related-list",children:a.childWork.map(d=>e.jsxs("button",{type:"button",className:"s-work-related-card",onClick:()=>m(t,{view:"work",workId:d.id},{returnTo:n}),children:[e.jsxs("div",{className:"s-work-related-card-header",children:[e.jsx("span",{className:"s-work-related-card-title",children:d.title}),e.jsx(O,{tone:ke(d),variant:"pill",children:d.currentPhase})]}),e.jsxs("div",{className:"s-work-related-card-meta",children:[e.jsx("span",{children:d.ownerName??d.ownerId??"Unassigned"}),e.jsx("span",{children:K(d.state)}),e.jsx("span",{children:$(d.lastMeaningfulAt)})]}),d.lastMeaningfulSummary&&e.jsx("div",{className:"s-work-related-card-copy",children:M(d.lastMeaningfulSummary)})]},d.id))})]})]})]})]})}export{Vs as WorkDetailScreen};
@@ -1 +1 @@
1
- import{r as c,j as e}from"./index-DMiGbrBt.js";import{D as F,F as T,a as E}from"./DocumentFocusViewer-BeVwwl26.js";import{c as D,T as M}from"./TextDocumentSurface-BpAw4eQS.js";import{a as R}from"./api-h5zurxmi.js";import{C as L}from"./chevron-right-XiIHsk4m.js";import{C as W}from"./chevron-down-BGk5qoEw.js";import{c as z}from"./createLucideIcon-OpA4Amw5.js";import{F as B}from"./file-text-BODxCjcz.js";/* empty css */import"./x-D3GElQbe.js";const A=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],O=z("image",A),P=new Set(["png","jpg","jpeg","gif","webp","avif","svg"]),g=[{value:"all",label:"All"},{value:"plan",label:"Plans"},{value:"doc",label:"Docs"},{value:"code",label:"Code"},{value:"test",label:"Tests"},{value:"config",label:"Config"},{value:"asset",label:"Assets"}];function U(s){const t=s.split("/").pop()??s,l=t.lastIndexOf(".");return l>=0?t.slice(l+1).toLowerCase():""}function v(s){return P.has(U(s.path))}function _(s){const t={type:"dir",children:[]};for(const l of s){const a=l.path.split("/").filter(Boolean);if(a.length===0)continue;let n=t;for(let f=0;f<a.length-1;f+=1){const i=a[f],p=a.slice(0,f+1).join("/");let o=n.children.find(d=>d.type==="dir"&&d.name===i);o||(o={type:"dir",name:i,path:p,children:[]},n.children.push(o)),n=o}n.children.push({type:"file",name:a[a.length-1],path:l.path,material:l})}return b(t),N(t.children)}function b(s){if(s.type==="dir"){s.children.sort((t,l)=>t.type!==l.type?t.type==="dir"?-1:1:t.name.localeCompare(l.name));for(const t of s.children)b(t)}}function N(s){return s.map(t=>{if(t.type!=="dir")return t;let l=t;for(;l.children.length===1&&l.children[0].type==="dir";){const a=l.children[0];l={type:"dir",name:`${l.name}/${a.name}`,path:a.path,children:a.children}}return{...l,children:N(l.children)}})}function G(s){switch(s){case"added":return"A";case"modified":return"M";case"deleted":return"D";case"renamed":return"R";case"untracked":return"?";case"observed":return null}}function y({node:s,depth:t,selectedId:l,collapsed:a,onToggle:n,onSelect:f}){if(s.type==="dir"){const u=a.has(s.path);return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"s-work-files-tree-row s-work-files-tree-dir",style:{paddingLeft:`${8+t*12}px`},onClick:()=>n(s.path),children:[e.jsx("span",{className:"s-work-files-tree-chevron","aria-hidden":"true",children:u?e.jsx(L,{size:12,strokeWidth:1.8}):e.jsx(W,{size:12,strokeWidth:1.8})}),e.jsx("span",{className:"s-work-files-tree-icon","aria-hidden":"true",children:u?e.jsx(T,{size:12,strokeWidth:1.8}):e.jsx(E,{size:12,strokeWidth:1.8})}),e.jsx("span",{className:"s-work-files-tree-name",children:s.name||"/"})]}),!u&&s.children.map(m=>e.jsx(y,{node:m,depth:t+1,selectedId:l,collapsed:a,onToggle:n,onSelect:f},m.type==="dir"?`d:${m.path}`:`f:${m.material.id}`))]})}const i=s.material.id===l,p=v(s.material),o=G(s.material.status),d=s.material.status==="deleted";return e.jsxs("button",{type:"button",className:`s-work-files-tree-row s-work-files-tree-file${i?" s-work-files-tree-file-selected":""}`,style:{paddingLeft:`${8+t*12}px`},onClick:()=>f(s.material),disabled:d,title:s.path,children:[e.jsx("span",{className:"s-work-files-tree-chevron","aria-hidden":"true"}),e.jsx("span",{className:"s-work-files-tree-icon","aria-hidden":"true",children:p?e.jsx(O,{size:12,strokeWidth:1.8}):e.jsx(B,{size:12,strokeWidth:1.8})}),e.jsx("span",{className:"s-work-files-tree-name",children:s.name}),o&&e.jsx("span",{className:`s-work-files-tree-status s-work-files-tree-status-${s.material.status}`,"aria-label":s.material.status,children:o})]})}function V({path:s}){const t=s.split("/").filter(Boolean);if(t.length===0)return e.jsx("span",{className:"s-work-files-breadcrumb",children:s});const l=t[t.length-1],a=t.slice(0,-1).join("/");return e.jsxs("span",{className:"s-work-files-breadcrumb",children:[a&&e.jsxs("span",{className:"s-work-files-breadcrumb-folder",children:[a,"/"]}),e.jsx("span",{className:"s-work-files-breadcrumb-name",children:l})]})}function K({workId:s,material:t}){const l=v(t),[a,n]=c.useState(null),[f,i]=c.useState(null),[p,o]=c.useState(!1);if(c.useEffect(()=>{if(l){n(null),i(null),o(!1);return}let u=!1;return o(!0),i(null),n(null),R(`/api/work/${encodeURIComponent(s)}/material?materialId=${encodeURIComponent(t.id)}`).then(m=>{u||n(m)}).catch(m=>{u||i(m instanceof Error?m.message:String(m))}).finally(()=>{u||o(!1)}),()=>{u=!0}},[l,t.id,s]),l){const u=`/api/work/${encodeURIComponent(s)}/material/raw?materialId=${encodeURIComponent(t.id)}`;return e.jsx("div",{className:"s-work-files-pane s-work-files-pane-image",children:e.jsx("img",{src:u,alt:t.path,className:"s-work-files-image"})})}if(p&&!a)return e.jsx("div",{className:"s-work-files-pane-state",children:"Loading file…"});if(f)return e.jsx("div",{className:"s-work-files-pane-state s-work-files-pane-error",children:f});if(!a)return e.jsx("div",{className:"s-work-files-pane-state",children:"No content."});const d=D({id:a.materialId,title:a.title,uri:a.uri,mediaType:a.mediaType,value:a.content,readOnly:!0});return e.jsxs("div",{className:"s-work-files-pane",children:[e.jsx(M,{document:d,mode:d.kind==="markdown"?"preview":"read"}),a.truncated&&e.jsxs("div",{className:"s-work-files-pane-notice",children:["Preview truncated at ",Math.round(a.content.length/1024)," KB."]})]})}function re({workId:s,workTitle:t,materials:l,open:a,initialKind:n="all",onClose:f}){const i=c.useMemo(()=>l.filter(r=>r.status!=="deleted"),[l]),[p,o]=c.useState(n),[d,u]=c.useState(null),[m,C]=c.useState(()=>new Set);c.useEffect(()=>{a&&o(n)},[n,a]);const x=c.useMemo(()=>p==="all"?i:p==="plan"?i.filter(r=>r.kind==="plan"||r.kind==="spec"):i.filter(r=>r.kind===p),[i,p]),j=c.useMemo(()=>_(x),[x]);c.useEffect(()=>{if(!d&&x.length>0){u(x[0].id);return}d&&!x.some(r=>r.id===d)&&u(x[0]?.id??null)},[x,d]);const S=c.useCallback(r=>{u(r.id)},[]),I=c.useCallback(r=>{C(k=>{const h=new Set(k);return h.has(r)?h.delete(r):h.add(r),h})},[]),w=x.find(r=>r.id===d)??null,$=c.useMemo(()=>{const r={all:i.length};for(const k of g)k.value!=="all"&&(r[k.value]=i.filter(h=>k.value==="plan"?h.kind==="plan"||h.kind==="spec":h.kind===k.value).length);return r},[i]);return e.jsx(F,{open:a,kind:"code",document:null,title:`Files · ${i.length}`,eyebrow:"Work materials",subtitle:t,focusable:!0,onClose:f,body:e.jsxs("div",{className:"s-work-files-layout",children:[e.jsxs("aside",{className:"s-work-files-tree","aria-label":"File tree",children:[e.jsx("div",{className:"s-work-files-tree-filters",role:"tablist",children:g.map(r=>{const k=$[r.value]??0;if(r.value!=="all"&&k===0)return null;const h=r.value===p;return e.jsxs("button",{type:"button",role:"tab","aria-selected":h,className:`s-work-files-tree-filter${h?" s-work-files-tree-filter-active":""}`,onClick:()=>o(r.value),children:[e.jsx("span",{children:r.label}),e.jsx("span",{className:"s-work-files-tree-filter-count",children:k})]},r.value)})}),e.jsx("div",{className:"s-work-files-tree-list",children:j.length===0?e.jsx("div",{className:"s-work-files-tree-empty",children:"No files match this filter."}):j.map(r=>e.jsx(y,{node:r,depth:0,selectedId:d,collapsed:m,onToggle:I,onSelect:S},r.type==="dir"?`d:${r.path}`:`f:${r.material.id}`))})]}),e.jsx("section",{className:"s-work-files-content","aria-label":"File preview",children:w?e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"s-work-files-content-head",children:[e.jsx(V,{path:w.path}),e.jsxs("div",{className:"s-work-files-content-meta",children:[e.jsx("span",{children:w.kind}),e.jsx("span",{children:w.status}),w.diffStat&&e.jsxs("span",{children:["+",w.diffStat.additions," -",w.diffStat.deletions]})]})]}),e.jsx(K,{workId:s,material:w})]}):e.jsx("div",{className:"s-work-files-pane-state",children:"Select a file to preview."})})]})})}export{re as WorkFilesViewer};
1
+ import{r as c,j as e}from"./index-CzVeWScw.js";import{D as F,F as T,a as E}from"./DocumentFocusViewer-BCG2kOmd.js";import{c as D,T as M}from"./TextDocumentSurface-DRjctOIt.js";import{a as R}from"./api-h5zurxmi.js";import{C as L}from"./chevron-right-CNE6QAVr.js";import{C as W}from"./chevron-down-DRCbnzyY.js";import{c as z}from"./createLucideIcon-ClCdc3F9.js";import{F as B}from"./file-text-DG-pufl1.js";/* empty css */import"./x-D4X_y1j_.js";const A=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],O=z("image",A),P=new Set(["png","jpg","jpeg","gif","webp","avif","svg"]),g=[{value:"all",label:"All"},{value:"plan",label:"Plans"},{value:"doc",label:"Docs"},{value:"code",label:"Code"},{value:"test",label:"Tests"},{value:"config",label:"Config"},{value:"asset",label:"Assets"}];function U(s){const t=s.split("/").pop()??s,l=t.lastIndexOf(".");return l>=0?t.slice(l+1).toLowerCase():""}function v(s){return P.has(U(s.path))}function _(s){const t={type:"dir",children:[]};for(const l of s){const a=l.path.split("/").filter(Boolean);if(a.length===0)continue;let n=t;for(let f=0;f<a.length-1;f+=1){const i=a[f],p=a.slice(0,f+1).join("/");let o=n.children.find(d=>d.type==="dir"&&d.name===i);o||(o={type:"dir",name:i,path:p,children:[]},n.children.push(o)),n=o}n.children.push({type:"file",name:a[a.length-1],path:l.path,material:l})}return b(t),N(t.children)}function b(s){if(s.type==="dir"){s.children.sort((t,l)=>t.type!==l.type?t.type==="dir"?-1:1:t.name.localeCompare(l.name));for(const t of s.children)b(t)}}function N(s){return s.map(t=>{if(t.type!=="dir")return t;let l=t;for(;l.children.length===1&&l.children[0].type==="dir";){const a=l.children[0];l={type:"dir",name:`${l.name}/${a.name}`,path:a.path,children:a.children}}return{...l,children:N(l.children)}})}function G(s){switch(s){case"added":return"A";case"modified":return"M";case"deleted":return"D";case"renamed":return"R";case"untracked":return"?";case"observed":return null}}function y({node:s,depth:t,selectedId:l,collapsed:a,onToggle:n,onSelect:f}){if(s.type==="dir"){const u=a.has(s.path);return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"s-work-files-tree-row s-work-files-tree-dir",style:{paddingLeft:`${8+t*12}px`},onClick:()=>n(s.path),children:[e.jsx("span",{className:"s-work-files-tree-chevron","aria-hidden":"true",children:u?e.jsx(L,{size:12,strokeWidth:1.8}):e.jsx(W,{size:12,strokeWidth:1.8})}),e.jsx("span",{className:"s-work-files-tree-icon","aria-hidden":"true",children:u?e.jsx(T,{size:12,strokeWidth:1.8}):e.jsx(E,{size:12,strokeWidth:1.8})}),e.jsx("span",{className:"s-work-files-tree-name",children:s.name||"/"})]}),!u&&s.children.map(m=>e.jsx(y,{node:m,depth:t+1,selectedId:l,collapsed:a,onToggle:n,onSelect:f},m.type==="dir"?`d:${m.path}`:`f:${m.material.id}`))]})}const i=s.material.id===l,p=v(s.material),o=G(s.material.status),d=s.material.status==="deleted";return e.jsxs("button",{type:"button",className:`s-work-files-tree-row s-work-files-tree-file${i?" s-work-files-tree-file-selected":""}`,style:{paddingLeft:`${8+t*12}px`},onClick:()=>f(s.material),disabled:d,title:s.path,children:[e.jsx("span",{className:"s-work-files-tree-chevron","aria-hidden":"true"}),e.jsx("span",{className:"s-work-files-tree-icon","aria-hidden":"true",children:p?e.jsx(O,{size:12,strokeWidth:1.8}):e.jsx(B,{size:12,strokeWidth:1.8})}),e.jsx("span",{className:"s-work-files-tree-name",children:s.name}),o&&e.jsx("span",{className:`s-work-files-tree-status s-work-files-tree-status-${s.material.status}`,"aria-label":s.material.status,children:o})]})}function V({path:s}){const t=s.split("/").filter(Boolean);if(t.length===0)return e.jsx("span",{className:"s-work-files-breadcrumb",children:s});const l=t[t.length-1],a=t.slice(0,-1).join("/");return e.jsxs("span",{className:"s-work-files-breadcrumb",children:[a&&e.jsxs("span",{className:"s-work-files-breadcrumb-folder",children:[a,"/"]}),e.jsx("span",{className:"s-work-files-breadcrumb-name",children:l})]})}function K({workId:s,material:t}){const l=v(t),[a,n]=c.useState(null),[f,i]=c.useState(null),[p,o]=c.useState(!1);if(c.useEffect(()=>{if(l){n(null),i(null),o(!1);return}let u=!1;return o(!0),i(null),n(null),R(`/api/work/${encodeURIComponent(s)}/material?materialId=${encodeURIComponent(t.id)}`).then(m=>{u||n(m)}).catch(m=>{u||i(m instanceof Error?m.message:String(m))}).finally(()=>{u||o(!1)}),()=>{u=!0}},[l,t.id,s]),l){const u=`/api/work/${encodeURIComponent(s)}/material/raw?materialId=${encodeURIComponent(t.id)}`;return e.jsx("div",{className:"s-work-files-pane s-work-files-pane-image",children:e.jsx("img",{src:u,alt:t.path,className:"s-work-files-image"})})}if(p&&!a)return e.jsx("div",{className:"s-work-files-pane-state",children:"Loading file…"});if(f)return e.jsx("div",{className:"s-work-files-pane-state s-work-files-pane-error",children:f});if(!a)return e.jsx("div",{className:"s-work-files-pane-state",children:"No content."});const d=D({id:a.materialId,title:a.title,uri:a.uri,mediaType:a.mediaType,value:a.content,readOnly:!0});return e.jsxs("div",{className:"s-work-files-pane",children:[e.jsx(M,{document:d,mode:d.kind==="markdown"?"preview":"read"}),a.truncated&&e.jsxs("div",{className:"s-work-files-pane-notice",children:["Preview truncated at ",Math.round(a.content.length/1024)," KB."]})]})}function re({workId:s,workTitle:t,materials:l,open:a,initialKind:n="all",onClose:f}){const i=c.useMemo(()=>l.filter(r=>r.status!=="deleted"),[l]),[p,o]=c.useState(n),[d,u]=c.useState(null),[m,C]=c.useState(()=>new Set);c.useEffect(()=>{a&&o(n)},[n,a]);const x=c.useMemo(()=>p==="all"?i:p==="plan"?i.filter(r=>r.kind==="plan"||r.kind==="spec"):i.filter(r=>r.kind===p),[i,p]),j=c.useMemo(()=>_(x),[x]);c.useEffect(()=>{if(!d&&x.length>0){u(x[0].id);return}d&&!x.some(r=>r.id===d)&&u(x[0]?.id??null)},[x,d]);const S=c.useCallback(r=>{u(r.id)},[]),I=c.useCallback(r=>{C(k=>{const h=new Set(k);return h.has(r)?h.delete(r):h.add(r),h})},[]),w=x.find(r=>r.id===d)??null,$=c.useMemo(()=>{const r={all:i.length};for(const k of g)k.value!=="all"&&(r[k.value]=i.filter(h=>k.value==="plan"?h.kind==="plan"||h.kind==="spec":h.kind===k.value).length);return r},[i]);return e.jsx(F,{open:a,kind:"code",document:null,title:`Files · ${i.length}`,eyebrow:"Work materials",subtitle:t,focusable:!0,onClose:f,body:e.jsxs("div",{className:"s-work-files-layout",children:[e.jsxs("aside",{className:"s-work-files-tree","aria-label":"File tree",children:[e.jsx("div",{className:"s-work-files-tree-filters",role:"tablist",children:g.map(r=>{const k=$[r.value]??0;if(r.value!=="all"&&k===0)return null;const h=r.value===p;return e.jsxs("button",{type:"button",role:"tab","aria-selected":h,className:`s-work-files-tree-filter${h?" s-work-files-tree-filter-active":""}`,onClick:()=>o(r.value),children:[e.jsx("span",{children:r.label}),e.jsx("span",{className:"s-work-files-tree-filter-count",children:k})]},r.value)})}),e.jsx("div",{className:"s-work-files-tree-list",children:j.length===0?e.jsx("div",{className:"s-work-files-tree-empty",children:"No files match this filter."}):j.map(r=>e.jsx(y,{node:r,depth:0,selectedId:d,collapsed:m,onToggle:I,onSelect:S},r.type==="dir"?`d:${r.path}`:`f:${r.material.id}`))})]}),e.jsx("section",{className:"s-work-files-content","aria-label":"File preview",children:w?e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"s-work-files-content-head",children:[e.jsx(V,{path:w.path}),e.jsxs("div",{className:"s-work-files-content-meta",children:[e.jsx("span",{children:w.kind}),e.jsx("span",{children:w.status}),w.diffStat&&e.jsxs("span",{children:["+",w.diffStat.additions," -",w.diffStat.deletions]})]})]}),e.jsx(K,{workId:s,material:w})]}):e.jsx("div",{className:"s-work-files-pane-state",children:"Select a file to preview."})})]})})}export{re as WorkFilesViewer};
@@ -1 +1 @@
1
- import{c as t}from"./createLucideIcon-OpA4Amw5.js";const c=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],o=t("activity",c);export{o as A};
1
+ import{c as t}from"./createLucideIcon-ClCdc3F9.js";const c=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],o=t("activity",c);export{o as A};
@@ -1 +1 @@
1
- import{i as f}from"./index-DMiGbrBt.js";function g(o,s){for(var r=0;r<s.length;r++){const t=s[r];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in o)){const i=Object.getOwnPropertyDescriptor(t,e);i&&Object.defineProperty(o,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var a={exports:{}},d;function _(){return d||(d=1,(function(o,s){(function(r,t){o.exports=t()})(globalThis,(()=>(()=>{var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const i=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;const i=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),m=Math.max(0,parseInt(l.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),u=c-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),h=m-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-i;return{cols:Math.max(2,Math.floor(h/e.css.cell.width)),rows:Math.max(1,Math.floor(u/e.css.cell.height))}}}})(),r})()))})(a)),a.exports}var p=_();const y=f(p),v=g({__proto__:null,default:y},[p]);export{v as a};
1
+ import{i as f}from"./index-CzVeWScw.js";function g(o,s){for(var r=0;r<s.length;r++){const t=s[r];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in o)){const i=Object.getOwnPropertyDescriptor(t,e);i&&Object.defineProperty(o,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var a={exports:{}},d;function _(){return d||(d=1,(function(o,s){(function(r,t){o.exports=t()})(globalThis,(()=>(()=>{var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const i=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;const i=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),m=Math.max(0,parseInt(l.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),u=c-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),h=m-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-i;return{cols:Math.max(2,Math.floor(h/e.css.cell.width)),rows:Math.max(1,Math.floor(u/e.css.cell.height))}}}})(),r})()))})(a)),a.exports}var p=_();const y=f(p),v=g({__proto__:null,default:y},[p]);export{v as a};