@openscout/scout 0.2.79 → 0.2.82

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 (398) hide show
  1. package/README.md +1 -1
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +4 -4
  4. package/dist/client/assets/ActivityScreen-aewI4Ul1.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-BoVtelSP.js → AddProjectForm-Czb5uwou.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-CufDA4A-.js → AgentAvatar-DMov24_o.js} +1 -1
  7. package/dist/client/assets/AgentConfigurationScreen-BjG6ECjl.js +1 -0
  8. package/dist/client/assets/AgentDefinitionsWorkspace-D4MbSMXp.js +1 -0
  9. package/dist/client/assets/{AgentDetailCard-DxxVkgT1.js → AgentDetailCard-Biq8b2gv.js} +1 -1
  10. package/dist/client/assets/AgentFloorView-h9KDJdw0.js +1 -0
  11. package/dist/client/assets/AgentInfoScreen-SjhK_SBh.js +1 -0
  12. package/dist/client/assets/{AgentLaneCard-DTUvE96I.js → AgentLaneCard-C4DMQR-c.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-BfVygkgL.js → AgentLaneChrome-D1xNNf7A.js} +1 -1
  14. package/dist/client/assets/AgentLaneDetailSheet-DnAKe4e3.js +4 -0
  15. package/dist/client/assets/{AgentLaneSummaryResize-CMgzYvAA.js → AgentLaneSummaryResize-C9loK-st.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-BNOYF16R.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-KWfLcaNB.js → AgentLanesPreflight-M7iDXdP2.js} +1 -1
  18. package/dist/client/assets/{AgentLanesView-CxfbV8Kd.js → AgentLanesView-Ct-Gz5WD.js} +1 -1
  19. package/dist/client/assets/{AgentLiveActions-CZdAInEu.js → AgentLiveActions-0iy8QZ1T.js} +1 -1
  20. package/dist/client/assets/{AgentSessions-Bkr0lyry.js → AgentSessions-CDfSfNiE.js} +2 -2
  21. package/dist/client/assets/{AgentsConsole-WtFVqaPJ.js → AgentsConsole-BVxhBqRa.js} +1 -1
  22. package/dist/client/assets/AgentsScreen-Bww6HgFs.js +1 -0
  23. package/dist/client/assets/AgentsSubnav-CiIuzxnZ.js +1 -0
  24. package/dist/client/assets/{AtopView-_OKDlZ1h.js → AtopView-h_aFoNkP.js} +1 -1
  25. package/dist/client/assets/BackToPicker-BXp5E2ck.js +1 -0
  26. package/dist/client/assets/{BriefingDetailScreen-i54EtZKW.js → BriefingDetailScreen-C83o2YfN.js} +1 -1
  27. package/dist/client/assets/{BriefingsScreen-CBrHojlQ.js → BriefingsScreen-BTsvr5fv.js} +1 -1
  28. package/dist/client/assets/{BrokerMetadataPanel-opTLuZU6.js → BrokerMetadataPanel-jg7odHQp.js} +1 -1
  29. package/dist/client/assets/BrokerScreen-DplF8d_X.js +5 -0
  30. package/dist/client/assets/Canvas-BePL08RR.js +1 -0
  31. package/dist/client/assets/{ChatCollapsedStrip-Dr2vmKXQ.js → ChatCollapsedStrip-BRljIymi.js} +1 -1
  32. package/dist/client/assets/{CodeDiffPane-CLOGjwul.js → CodeDiffPane-86odpBSt.js} +1 -1
  33. package/dist/client/assets/{CodeProjectPicker-DTV8hR6A.js → CodeProjectPicker-8svr_S_A.js} +1 -1
  34. package/dist/client/assets/CodeScreen-CJ2RgB32.js +1 -0
  35. package/dist/client/assets/{ContextMenu-BlBQhpax.js → ContextMenu-CxkmFQcN.js} +1 -1
  36. package/dist/client/assets/ConversationComposer-CWohCCmn.js +1 -0
  37. package/dist/client/assets/ConversationFeedRows-IWh0JSIL.js +1 -0
  38. package/dist/client/assets/ConversationHeader-BxTzXl8e.js +1 -0
  39. package/dist/client/assets/ConversationPanels-D9UCwNkS.js +2 -0
  40. package/dist/client/assets/ConversationScreen-oZSitVtX.js +1 -0
  41. package/dist/client/assets/ConversationScreen-yIKEsm-8.css +1 -0
  42. package/dist/client/assets/{ConversationStatus-DSgdVofa.js → ConversationStatus-B6pAbo2w.js} +1 -1
  43. package/dist/client/assets/{DataTable-0DwuXyvW.js → DataTable-CGw5CECG.js} +1 -1
  44. package/dist/client/assets/{DispatchAftermath-BrreQifA.js → DispatchAftermath-DowTb7uO.js} +1 -1
  45. package/dist/client/assets/{DocumentFocusViewer-DU_9BHsD.js → DocumentFocusViewer-DRKjNG9s.js} +1 -1
  46. package/dist/client/assets/{EmbeddableSurfacesLab-DdaswbfI.js → EmbeddableSurfacesLab-CxfJXS2g.js} +1 -1
  47. package/dist/client/assets/{EmptyState-CoL-QuUO.js → EmptyState-BUvllvA6.js} +1 -1
  48. package/dist/client/assets/{FileViewerPane-C9Ly01Ef.js → FileViewerPane-BM4AD_bo.js} +1 -1
  49. package/dist/client/assets/{FleetSearch-DlWTLl-v.js → FleetSearch-CYeWn85V.js} +1 -1
  50. package/dist/client/assets/FlightObserveScreen-DYJJ3Z2B.js +1 -0
  51. package/dist/client/assets/FollowScreen-DG0osbUp.js +1 -0
  52. package/dist/client/assets/HarnessMark-MztYnrGK.js +1 -0
  53. package/dist/client/assets/HarnessesScreen-BWqirBjK.js +1 -0
  54. package/dist/client/assets/HerdrSession-6sFln7WX.js +4 -0
  55. package/dist/client/assets/{HomeHero-Cfsow7qL.js → HomeHero-BPBArHXa.js} +1 -1
  56. package/dist/client/assets/{KnowledgeSearchInspector-DKashKoH.js → KnowledgeSearchInspector-BOIhFWd2.js} +1 -1
  57. package/dist/client/assets/KnowledgeSearchScreen-BP8tD-Bh.js +1 -0
  58. package/dist/client/assets/{LaneToolHoverCard-BzehBmdi.js → LaneToolHoverCard-CcEiQC6B.js} +1 -1
  59. package/dist/client/assets/LaneTraceDetailSheet-B4i1Ut4R.js +1 -0
  60. package/dist/client/assets/{LaneTraceEventFocus-DYvHfs_3.js → LaneTraceEventFocus-Bl9L0EYb.js} +1 -1
  61. package/dist/client/assets/{MeshCanvas-DIjlrMPU.js → MeshCanvas-ZjIuMiRo.js} +1 -1
  62. package/dist/client/assets/{MeshCanvasMinimap-DEq-PkF0.js → MeshCanvasMinimap-C-LQtiX6.js} +1 -1
  63. package/dist/client/assets/MeshScreen-Bs3soujg.js +1 -0
  64. package/dist/client/assets/{MeshTopologyView-BMHpH5BU.js → MeshTopologyView-C0LUyT3K.js} +2 -2
  65. package/dist/client/assets/{MessageComposerSuggestions-zAUUcLOv.js → MessageComposerSuggestions-Dfc3PH2y.js} +1 -1
  66. package/dist/client/assets/MessagesScreen-TgSL5KMc.js +1 -0
  67. package/dist/client/assets/MissionContextRail-CjGAEGu8.js +1 -0
  68. package/dist/client/assets/MissionControlView-D629w2A8.js +1 -0
  69. package/dist/client/assets/{MissionFocusOverlay-C7cPt6eU.js → MissionFocusOverlay-Bubrr8Gc.js} +1 -1
  70. package/dist/client/assets/{MissionLeftAgentRow-CxlH3dON.js → MissionLeftAgentRow-DokImu4Y.js} +1 -1
  71. package/dist/client/assets/MissionLogPane-Cs0LuIkn.js +1 -0
  72. package/dist/client/assets/{NewAgentModal-DprvD4EK.js → NewAgentModal-D5e0YUAo.js} +1 -1
  73. package/dist/client/assets/NewChatComposer-C5LT7MF7.css +1 -0
  74. package/dist/client/assets/NewChatComposer-S08F6_La.js +19 -0
  75. package/dist/client/assets/{NewChatOrigin--pHWUb4V.js → NewChatOrigin-BEz6jyqf.js} +1 -1
  76. package/dist/client/assets/{ObserveEmbedScreen-CfvrnOiZ.js → ObserveEmbedScreen-CHx2sEAA.js} +2 -2
  77. package/dist/client/assets/ObserveTextFlow-_ApDwRCO.js +2 -0
  78. package/dist/client/assets/{ObservedTopologyPanel-Dv6fbHzW.js → ObservedTopologyPanel-ByW7Ar7p.js} +1 -1
  79. package/dist/client/assets/OpenScoutAppShell-DTmnbG-h.js +88 -0
  80. package/dist/client/assets/OpsAgentsView-DiFuHcJs.js +1 -0
  81. package/dist/client/assets/OpsScreen-CCR3U_9P.js +1 -0
  82. package/dist/client/assets/OpsSubnav-CZs_OL2N.js +1 -0
  83. package/dist/client/assets/{PlanView-DYtt8H37.js → PlanView-C54eAzig.js} +1 -1
  84. package/dist/client/assets/ProjectAgentProfile-BEfYOaxc.js +1 -0
  85. package/dist/client/assets/{ProjectAgentProfileBar-B3IvVbqS.js → ProjectAgentProfileBar-B1VpwzGD.js} +1 -1
  86. package/dist/client/assets/{ProjectAgentProfileHero-D5E8yvDj.js → ProjectAgentProfileHero-B4f_AoCr.js} +1 -1
  87. package/dist/client/assets/ProjectsInbox-DoPZ17FC.js +2 -0
  88. package/dist/client/assets/{ProjectsRail-DEDS-M1c.js → ProjectsRail-CWOkZjsY.js} +1 -1
  89. package/dist/client/assets/ProjectsScreen-Dse0Q6p6.js +1 -0
  90. package/dist/client/assets/ProjectsThreadAside-DMnfyPLE.js +1 -0
  91. package/dist/client/assets/Provider-DKZWuzSR.js +1 -0
  92. package/dist/client/assets/{RailRow-BTlVAnHS.js → RailRow-DIGd3MMM.js} +1 -1
  93. package/dist/client/assets/RawSessionsTable-Zkl4YDvz.js +1 -0
  94. package/dist/client/assets/RealtimeVoiceScreen-B_PMJxY_.js +1 -0
  95. package/dist/client/assets/{RepoDiffEmbedScreen-CtTdlQ2A.js → RepoDiffEmbedScreen-VLg4caej.js} +1 -1
  96. package/dist/client/assets/{RepoDiffPageScreen-BRvaVYoC.js → RepoDiffPageScreen-BelnvgnP.js} +1 -1
  97. package/dist/client/assets/{RepoDiffViewer-Bo0gREMj.js → RepoDiffViewer-VrUJw33u.js} +1 -1
  98. package/dist/client/assets/RepoDiffViewerLazy-BPg_JkYW.js +2 -0
  99. package/dist/client/assets/{ReposScreen-BBkJf8xT.js → ReposScreen-IINK-CFn.js} +2 -2
  100. package/dist/client/assets/ScoutDeckSurface-MbwGp6Ab.js +1 -0
  101. package/dist/client/assets/{ScoutSurface-DEQg_7Io.js → ScoutSurface-x_QbcRyk.js} +1 -1
  102. package/dist/client/assets/ScoutbotBroadcastChip-DAKQKB25.js +2 -0
  103. package/dist/client/assets/{ScoutbotFxLab-BgsuLDjo.js → ScoutbotFxLab-7t9JVvZg.js} +1 -1
  104. package/dist/client/assets/{ScoutbotRealtimeVoiceCall-Bzyl0BCS.js → ScoutbotRealtimeVoiceCall-Br4bYVAx.js} +1 -1
  105. package/dist/client/assets/{SecondaryNav-Bks0CO2h.js → SecondaryNav-Dj30epYF.js} +1 -1
  106. package/dist/client/assets/{SessionEmbedScreen-b0Zgmfx5.js → SessionEmbedScreen-s2mJ5Fg9.js} +1 -1
  107. package/dist/client/assets/{SessionObserve-Dlx5vDaV.js → SessionObserve-DaUrJCMq.js} +1 -1
  108. package/dist/client/assets/{SessionObserveEvidence-ChBD1d4c.js → SessionObserveEvidence-ClUW8jpV.js} +1 -1
  109. package/dist/client/assets/SessionRefScreen-DLZNFZFK.js +1 -0
  110. package/dist/client/assets/SessionsScreen-D-hN1n4k.js +1 -0
  111. package/dist/client/assets/{SettingsDrawer-C587L1i1.js → SettingsDrawer-BFsnww-k.js} +3 -3
  112. package/dist/client/assets/SettingsScreen-Bc3Xtv5V.js +1 -0
  113. package/dist/client/assets/{ShikiPane-I_OTW5NO.js → ShikiPane-Dkwyx--r.js} +1 -1
  114. package/dist/client/assets/{SlidePanel-FCqT1zO3.js → SlidePanel-CuTeirnk.js} +1 -1
  115. package/dist/client/assets/{SpriteAvatar-CQs-jC-v.js → SpriteAvatar-DQ3PTb8L.js} +1 -1
  116. package/dist/client/assets/{StatusPill-CbABggnQ.js → StatusPill-BJ1ierIR.js} +1 -1
  117. package/dist/client/assets/{TailView-C_MXVSum.js → TailView-CufWcrvf.js} +2 -2
  118. package/dist/client/assets/Terminal-D_OmdFmr.js +1 -0
  119. package/dist/client/assets/TerminalEmbedScreen-D21ytNXW.js +1 -0
  120. package/dist/client/assets/TerminalRelay-rvUzI9Ek.js +46 -0
  121. package/dist/client/assets/{TextDocumentSurface-C-9EtYqt.js → TextDocumentSurface-Bc-kHPgG.js} +1 -1
  122. package/dist/client/assets/{TmuxPeek-Dz1gJ2pU.js → TmuxPeek-DLyDkq_D.js} +1 -1
  123. package/dist/client/assets/{VoicePermissionsPanel-MfICy9kk.js → VoicePermissionsPanel-CD903y9K.js} +1 -1
  124. package/dist/client/assets/{WorkDetailScreen-Cs7kdllj.js → WorkDetailScreen-D51oI0dH.js} +2 -2
  125. package/dist/client/assets/{WorkFilesViewer-CF-nhtZ4.js → WorkFilesViewer-BDMNbxE4.js} +1 -1
  126. package/dist/client/assets/{activity-WhBf3FXP.js → activity-BvGruxWG.js} +1 -1
  127. package/dist/client/assets/{addon-fit-q-x_HytU.js → addon-fit-Cfq4Ayjd.js} +1 -1
  128. package/dist/client/assets/{addon-webgl-fhhvEA9h.js → addon-webgl-B8sIf9-s.js} +1 -1
  129. package/dist/client/assets/{agent-essentials-DyJiUGpZ.js → agent-essentials-yb4wIJlX.js} +1 -1
  130. package/dist/client/assets/agent-identity-BxCsXnDp.js +1 -0
  131. package/dist/client/assets/{agent-lane-card-model-BCIwPjEh.js → agent-lane-card-model-q4cwzLX4.js} +1 -1
  132. package/dist/client/assets/agent-lane-detail-BNNm6FNu.js +2 -0
  133. package/dist/client/assets/{agent-lane-preview-BtnfNyFR.js → agent-lane-preview-C33Dwpn7.js} +1 -1
  134. package/dist/client/assets/{agent-lanes-model-Bl6xfviL.js → agent-lanes-model-VYQ5a68i.js} +2 -2
  135. package/dist/client/assets/{arc.es-DPJ0xRV6.js → arc.es-BBTfhvLE.js} +1 -1
  136. package/dist/client/assets/{arrow-left-WjQIN9J6.js → arrow-left-BOht-YQu.js} +1 -1
  137. package/dist/client/assets/{arrow-up-right-CtTDrZJr.js → arrow-up-right-hoR8_oUz.js} +1 -1
  138. package/dist/client/assets/{bot-B_Uzf4_O.js → bot-BUK7dOPS.js} +1 -1
  139. package/dist/client/assets/{check-BbgHJX8u.js → check--esHw52j.js} +1 -1
  140. package/dist/client/assets/{chevron-down-BFai6ZfE.js → chevron-down-NAhBUkFd.js} +1 -1
  141. package/dist/client/assets/{chevron-right-CyUa1zXx.js → chevron-right-C10o7t_X.js} +1 -1
  142. package/dist/client/assets/{chunk-HRAB3GC3-CvwpNg-G.js → chunk-HRAB3GC3-DF8R9rPv.js} +1 -1
  143. package/dist/client/assets/{clock-DviOalxA.js → clock-of01sAB6.js} +1 -1
  144. package/dist/client/assets/{code-xml-05TD3uOC.js → code-xml-CLn3TDWF.js} +1 -1
  145. package/dist/client/assets/content-B-SUUhXj.js +1 -0
  146. package/dist/client/assets/content-BRY2vo1_.js +1 -0
  147. package/dist/client/assets/content-BTm0mVyD.js +1 -0
  148. package/dist/client/assets/content-BTqvyb5E.js +1 -0
  149. package/dist/client/assets/content-BjDaXmSD.js +1 -0
  150. package/dist/client/assets/content-BrR6deGh.js +1 -0
  151. package/dist/client/assets/content-C5yvBEMy.js +1 -0
  152. package/dist/client/assets/content-Cgj5AWqT.js +1 -0
  153. package/dist/client/assets/content-CkhG__-v.js +1 -0
  154. package/dist/client/assets/content-CudIBsiP.js +1 -0
  155. package/dist/client/assets/content-DBb7ppd5.js +1 -0
  156. package/dist/client/assets/content-DEw_kGyK.js +1 -0
  157. package/dist/client/assets/content-DIy0DCzK.js +1 -0
  158. package/dist/client/assets/content-THl9hRAo.js +1 -0
  159. package/dist/client/assets/content-Uqt8AG-s.css +1 -0
  160. package/dist/client/assets/content-vi9FbmV9.js +1 -0
  161. package/dist/client/assets/content-wcgPMGVf.js +1 -0
  162. package/dist/client/assets/{conversation-icons-DohQL6GI.js → conversation-icons-ClBJi21l.js} +1 -1
  163. package/dist/client/assets/conversation-model-CHwHZNw-.js +1 -0
  164. package/dist/client/assets/conversation-motion-features-zU0k3Agz.js +1 -0
  165. package/dist/client/assets/{copy-CwCAivnc.js → copy-Dty8ZYsM.js} +1 -1
  166. package/dist/client/assets/{createLucideIcon-DlxlBfLC.js → createLucideIcon-Bt67PWH-.js} +1 -1
  167. package/dist/client/assets/discover-NDAqNvKt.js +2 -0
  168. package/dist/client/assets/embed-entry-BVR09F6e.js +2 -0
  169. package/dist/client/assets/{external-link-CnjcXf32.js → external-link-Dem738OJ.js} +1 -1
  170. package/dist/client/assets/{eye-So8tNNK6.js → eye-B3lBIwJZ.js} +1 -1
  171. package/dist/client/assets/{file-text-i3xTDUjJ.js → file-text-iF0hyVyU.js} +1 -1
  172. package/dist/client/assets/home-live-action-BkqGLVRY.js +1 -0
  173. package/dist/client/assets/home-moving-signal-C8dTXieA.js +1 -0
  174. package/dist/client/assets/home-now-card-BgvVcE83.js +1 -0
  175. package/dist/client/assets/{home-now-card-nano-CkLHUQ4J.js → home-now-card-nano-hZl9klbP.js} +1 -1
  176. package/dist/client/assets/hooks-DBIezYS2.js +2 -0
  177. package/dist/client/assets/index-BMwKgdz_.js +1 -0
  178. package/dist/client/assets/index-Bu-fckyR.css +1 -0
  179. package/dist/client/assets/index-BxoufAPA.js +1 -0
  180. package/dist/client/assets/index-Cj7NnSxI.js +1 -0
  181. package/dist/client/assets/{index-sUomXsrf.js → index-o4FKpU7Z.js} +2 -2
  182. package/dist/client/assets/{inspector-panel-DhXd-YbT.js → inspector-panel-Dy2cVTCi.js} +2 -2
  183. package/dist/client/assets/keyboard-nav-Chf51dns.js +1 -0
  184. package/dist/client/assets/{lane-observe-DrhKkQ3A.js → lane-observe-BA3g9aVd.js} +1 -1
  185. package/dist/client/assets/{lane-roster-store-NE15Oe6M.js → lane-roster-store-BiIVlYmG.js} +1 -1
  186. package/dist/client/assets/left-BC7p5QbT.js +1 -0
  187. package/dist/client/assets/left-BCSGqccQ.js +1 -0
  188. package/dist/client/assets/left-BSyj8PuJ.js +2 -0
  189. package/dist/client/assets/left-DDnxNUxd.js +1 -0
  190. package/dist/client/assets/left-DLoDKxT5.js +2 -0
  191. package/dist/client/assets/left-O-TBH7JB.js +1 -0
  192. package/dist/client/assets/left-agents-Dk9Y89lb.js +1 -0
  193. package/dist/client/assets/left-default-B3JBRQNJ.js +1 -0
  194. package/dist/client/assets/left-lanes-30Oe_3RM.js +1 -0
  195. package/dist/client/assets/left-mission-DEl4-7xu.js +1 -0
  196. package/dist/client/assets/left-plan-B4qdm4Gn.js +2 -0
  197. package/dist/client/assets/left-rvUOB14X.js +1 -0
  198. package/dist/client/assets/library-DDKSLFJ_.js +1 -0
  199. package/dist/client/assets/{loader-circle-lWOOKezu.js → loader-circle-4LDsy4Ke.js} +1 -1
  200. package/dist/client/assets/{local-agents-C7fDHLVC.js → local-agents-DIi2EacM.js} +1 -1
  201. package/dist/client/assets/{mentions-CY_wPZc5.js → mentions-CvDaviLJ.js} +1 -1
  202. package/dist/client/assets/{mesh-ops-Kn8pCtyJ.js → mesh-ops-JZwGuAPn.js} +1 -1
  203. package/dist/client/assets/{mesh-view-store-D14ihwkF.js → mesh-view-store-Du7VqIT_.js} +1 -1
  204. package/dist/client/assets/{message-circle-C5UZ6fO7.js → message-circle-BM3XgevU.js} +1 -1
  205. package/dist/client/assets/{message-markup-C8Nx04sP.js → message-markup-BcY1lShv.js} +1 -1
  206. package/dist/client/assets/{message-square-BD-4UUdc.js → message-square-ER1_q2pe.js} +1 -1
  207. package/dist/client/assets/mission-control-m3BTDQ9l.css +1 -0
  208. package/dist/client/assets/{mission-control-store-xQHVQdm8.js → mission-control-store-C6w5iVfg.js} +1 -1
  209. package/dist/client/assets/mission-wall-CocIM1cF.js +1 -0
  210. package/dist/client/assets/{observe-uJfIlIUV.js → observe-3-jn4SXb.js} +1 -1
  211. package/dist/client/assets/openAgent-Dbv5wfuL.js +1 -0
  212. package/dist/client/assets/{page-status-BymFEFai.js → page-status-0LPfBC8S.js} +1 -1
  213. package/dist/client/assets/{plus-C9lTjsgd.js → plus-C-2gTcPK.js} +1 -1
  214. package/dist/client/assets/profile-DW80Gn5k.js +1 -0
  215. package/dist/client/assets/{projects-inbox-DfVmGFFk.js → projects-inbox-DCeD3FfV.js} +1 -1
  216. package/dist/client/assets/provider-BvAxRQfE.js +1 -0
  217. package/dist/client/assets/{radio-DedMyP8J.js → radio-v7UAMZGh.js} +1 -1
  218. package/dist/client/assets/{refresh-cw-D8PFyhUa.js → refresh-cw-B5To7b6B.js} +1 -1
  219. package/dist/client/assets/resolve-panes-BDi9Qx4R.js +1 -0
  220. package/dist/client/assets/resolve-sidebar-context-HE-5eZYa.js +1 -0
  221. package/dist/client/assets/right-BDf_yTv6.js +1 -0
  222. package/dist/client/assets/{right-C1sIsSHR.js → right-BvoGOUKH.js} +1 -1
  223. package/dist/client/assets/right-C-bgjYg-.js +1 -0
  224. package/dist/client/assets/right-C3JdEfYQ.js +1 -0
  225. package/dist/client/assets/right-CYIs2tEe.js +1 -0
  226. package/dist/client/assets/right-CyRCv6Up.js +1 -0
  227. package/dist/client/assets/right-DBYGtoRv.js +1 -0
  228. package/dist/client/assets/right-o3LHMiKa.js +1 -0
  229. package/dist/client/assets/right-oPrcx9MX.js +1 -0
  230. package/dist/client/assets/right-sSvBUK-j.js +1 -0
  231. package/dist/client/assets/{rocket-CriBwkHM.js → rocket-BQQQv2L5.js} +1 -1
  232. package/dist/client/assets/router-C65cZYPn.js +1 -0
  233. package/dist/client/assets/{runtime-picker-DOZpZOlt.js → runtime-picker-eDEvx2Mz.js} +1 -1
  234. package/dist/client/assets/{scope-views-BF_RvGKU.js → scope-views-BOOmgmwx.js} +1 -1
  235. package/dist/client/assets/{scout-voice-BZ4KqADJ.js → scout-voice-B7kXlkcl.js} +1 -1
  236. package/dist/client/assets/{scroll-text-BIYf6g6N.js → scroll-text-BuneRiAD.js} +1 -1
  237. package/dist/client/assets/{search-DCT_EvPr.js → search-7_n7CxWl.js} +1 -1
  238. package/dist/client/assets/{secondaryNavConfig-Drb7wPG4.js → secondaryNavConfig-CSFDCQAf.js} +1 -1
  239. package/dist/client/assets/{selection-bridge-CJOTyYQs.js → selection-bridge-SlGsgHw2.js} +1 -1
  240. package/dist/client/assets/{send-horizontal-DDwOgEs3.js → send-horizontal-DP16OOIW.js} +1 -1
  241. package/dist/client/assets/{server-CHZCp3cF.js → server-pYOMFjrT.js} +1 -1
  242. package/dist/client/assets/{session-catalog-XhGxCtP-.js → session-catalog-_QfQ7fhZ.js} +1 -1
  243. package/dist/client/assets/session-table-CYN8e4s3.js +1 -0
  244. package/dist/client/assets/{sliders-horizontal-B9Nj-Y4J.js → sliders-horizontal-D2Z8gz6J.js} +1 -1
  245. package/dist/client/assets/{sparkles-up7pVlX-.js → sparkles-Bth2iK7t.js} +1 -1
  246. package/dist/client/assets/{sse-CVoGDiKW.js → sse-CL6gctHY.js} +1 -1
  247. package/dist/client/assets/synthetic-agent-routing-aduMYO7P.js +1 -0
  248. package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +1 -0
  249. package/dist/client/assets/{tail-display-BdyoLvzY.js → tail-display-BRcJltQa.js} +2 -2
  250. package/dist/client/assets/{tail-events-CTipUIli.js → tail-events-NLIWLq27.js} +1 -1
  251. package/dist/client/assets/{terminal-DXQISjZn.js → terminal-By1Lw2i2.js} +1 -1
  252. package/dist/client/assets/{terminal-relay-B5Sma7fK.js → terminal-relay-CjkI5aUy.js} +1 -1
  253. package/dist/client/assets/{terminal-screen-19jAI0Cw.css → terminal-screen-BqVnCwl0.css} +1 -1
  254. package/dist/client/assets/terminal-sessions-AmSgHklm.js +1 -0
  255. package/dist/client/assets/{terminal-takeover-X97KCSJk.js → terminal-takeover-7AvNpnkC.js} +1 -1
  256. package/dist/client/assets/{use-conversation-list-B1T6J_qE.js → use-conversation-list-BCzY032j.js} +1 -1
  257. package/dist/client/assets/{use-fleet-active-asks-DLofGhhK.js → use-fleet-active-asks-CJ6-oj5k.js} +1 -1
  258. package/dist/client/assets/{use-mesh-ops-items-ByGZk8rU.js → use-mesh-ops-items-D5L-CKe_.js} +1 -1
  259. package/dist/client/assets/use-reduced-motion-CqXpVXv-.js +1 -0
  260. package/dist/client/assets/use-scout-dev-flags-BohC8seq.js +1 -0
  261. package/dist/client/assets/{useAgentHoverCard-D5e8Qg1z.js → useAgentHoverCard-RsLUYyeh.js} +1 -1
  262. package/dist/client/assets/useContentSecondaryNav-DOr5yHbT.js +1 -0
  263. package/dist/client/assets/usePersistentState-D3M4m2Ou.js +1 -0
  264. package/dist/client/assets/{usePierreRuntime-DIVunfX0.js → usePierreRuntime-B4hbNWTz.js} +1 -1
  265. package/dist/client/assets/{wrench-pEVd8JnN.js → wrench-M4G7WtYB.js} +1 -1
  266. package/dist/client/assets/{x-0XjXwGqq.js → x-ynOfVadO.js} +1 -1
  267. package/dist/client/assets/{xterm-CRLlV1Xp.js → xterm-DZHyijPp.js} +1 -1
  268. package/dist/client/index.html +2 -2
  269. package/dist/main.mjs +1444 -381
  270. package/dist/node/main.mjs +82 -20
  271. package/dist/openscout-terminal-relay.mjs +16 -4
  272. package/dist/pairing-runtime-controller.mjs +3030 -2948
  273. package/dist/runtime/broker-daemon.mjs +358 -136
  274. package/dist/scout-control-plane-web.mjs +5646 -5184
  275. package/dist/scout-web-server.mjs +5646 -5184
  276. package/package.json +4 -4
  277. package/dist/client/assets/ActivityScreen-DnqqRSlS.js +0 -1
  278. package/dist/client/assets/AgentConfigurationScreen-CJqoMA0J.js +0 -1
  279. package/dist/client/assets/AgentDefinitionsWorkspace-FpEkb-tu.js +0 -1
  280. package/dist/client/assets/AgentFloorView-CycUn0Lv.js +0 -1
  281. package/dist/client/assets/AgentInfoScreen-CAQAxpAK.js +0 -1
  282. package/dist/client/assets/AgentLaneDetailSheet-CWs9wKWk.js +0 -5
  283. package/dist/client/assets/AgentLanesEmbedScreen-BUCW4nUj.js +0 -1
  284. package/dist/client/assets/AgentsScreen-BMXvuiA2.js +0 -1
  285. package/dist/client/assets/AgentsSubnav-BTNjPYoA.js +0 -1
  286. package/dist/client/assets/BackToPicker-CkUmHuuo.js +0 -1
  287. package/dist/client/assets/BrokerScreen-CObCQvoy.js +0 -5
  288. package/dist/client/assets/CodeScreen-BXqi72NK.js +0 -1
  289. package/dist/client/assets/ConversationComposer-BBNPa5S9.js +0 -1
  290. package/dist/client/assets/ConversationFeedRows-BuejHMCY.js +0 -1
  291. package/dist/client/assets/ConversationHeader-DXMT-YXv.js +0 -1
  292. package/dist/client/assets/ConversationPanels-DHCtilQF.js +0 -2
  293. package/dist/client/assets/ConversationScreen-DSxIt9pq.css +0 -1
  294. package/dist/client/assets/ConversationScreen-Dz2d_Z_F.js +0 -1
  295. package/dist/client/assets/FlightObserveScreen-C-9S0nA5.js +0 -1
  296. package/dist/client/assets/FollowScreen--Q04xSSE.js +0 -1
  297. package/dist/client/assets/HarnessMark-Dm_qm1Ku.js +0 -1
  298. package/dist/client/assets/HarnessesScreen-Y54viPX8.js +0 -1
  299. package/dist/client/assets/KnowledgeSearchScreen-DsdDz8wY.js +0 -1
  300. package/dist/client/assets/LaneTraceDetailSheet-CBf_aNZx.js +0 -1
  301. package/dist/client/assets/MeshScreen-TgDtz-1l.js +0 -1
  302. package/dist/client/assets/MessagesScreen-BTQL0UcE.js +0 -1
  303. package/dist/client/assets/MissionControlView-D59SPnAm.js +0 -1
  304. package/dist/client/assets/MissionLogPane-Ye3YlF9s.js +0 -1
  305. package/dist/client/assets/NewChatComposer-B5FnPyzS.js +0 -19
  306. package/dist/client/assets/NewChatComposer-W-t-L4oV.css +0 -1
  307. package/dist/client/assets/ObserveTextFlow-CBitljxi.js +0 -2
  308. package/dist/client/assets/OpenScoutAppShell-BIp0WitK.js +0 -87
  309. package/dist/client/assets/OpsAgentsView-CoBfAigH.js +0 -1
  310. package/dist/client/assets/OpsScreen-Bbo0W64T.js +0 -1
  311. package/dist/client/assets/OpsSubnav-CoN8utF8.js +0 -1
  312. package/dist/client/assets/ProjectAgentProfile-FiiIcB5R.js +0 -1
  313. package/dist/client/assets/ProjectsInbox-BWiXjGi7.js +0 -2
  314. package/dist/client/assets/ProjectsScreen-Cxk4CuYn.js +0 -1
  315. package/dist/client/assets/ProjectsThreadAside-BF66ugT5.js +0 -1
  316. package/dist/client/assets/Provider-tFc3jqZ4.js +0 -1
  317. package/dist/client/assets/RawSessionsTable-BsGVgZB3.js +0 -1
  318. package/dist/client/assets/RealtimeVoiceScreen-B0Bem5Rc.js +0 -1
  319. package/dist/client/assets/RepoDiffViewerLazy-C8UPk4oo.js +0 -2
  320. package/dist/client/assets/ScoutDeckSurface-Bi9ov9Bm.js +0 -1
  321. package/dist/client/assets/ScoutbotBroadcastChip-DJXuyn73.js +0 -2
  322. package/dist/client/assets/SessionRefScreen-D7TfPYPN.js +0 -1
  323. package/dist/client/assets/SessionsScreen-BlknOWAd.js +0 -1
  324. package/dist/client/assets/SettingsScreen-BIlYxv_a.js +0 -1
  325. package/dist/client/assets/Terminal-DwZyo8kA.js +0 -1
  326. package/dist/client/assets/TerminalEmbedScreen-Czp3tQyd.js +0 -1
  327. package/dist/client/assets/agent-chat-Bfjd9y6c.js +0 -1
  328. package/dist/client/assets/agent-identity-xQHedtLl.js +0 -1
  329. package/dist/client/assets/agent-lane-detail-Cw4QVAgH.js +0 -1
  330. package/dist/client/assets/arrow-down-DsD-dYj-.js +0 -1
  331. package/dist/client/assets/chunk-T65CQEWV-DI4NKdNq.js +0 -1
  332. package/dist/client/assets/chunk-YOZR3KYS-BW85tiCr.js +0 -47
  333. package/dist/client/assets/content-2u_eV3fX.js +0 -1
  334. package/dist/client/assets/content-5irOghrY.js +0 -1
  335. package/dist/client/assets/content-8Z_0CwtD.js +0 -1
  336. package/dist/client/assets/content-B38YRDBu.js +0 -1
  337. package/dist/client/assets/content-BE3uK0LB.js +0 -1
  338. package/dist/client/assets/content-BtIxSqVY.js +0 -1
  339. package/dist/client/assets/content-CFsPAihU.js +0 -1
  340. package/dist/client/assets/content-CHU0wwA3.css +0 -1
  341. package/dist/client/assets/content-CKj5g5tu.js +0 -1
  342. package/dist/client/assets/content-CLDWXf9Z.js +0 -1
  343. package/dist/client/assets/content-CRr73E0r.js +0 -1
  344. package/dist/client/assets/content-CVR75_Uj.js +0 -1
  345. package/dist/client/assets/content-Czdp7_JQ.js +0 -1
  346. package/dist/client/assets/content-D0_EJ6nP.js +0 -1
  347. package/dist/client/assets/content-DNmxpNhD.js +0 -1
  348. package/dist/client/assets/content-XpbI9uxd.js +0 -1
  349. package/dist/client/assets/content-cyxWdgKQ.js +0 -1
  350. package/dist/client/assets/conversation-model-C4yb6_FA.js +0 -1
  351. package/dist/client/assets/conversation-motion-features-CifSdJtm.js +0 -1
  352. package/dist/client/assets/discover-DoiAJo4Z.js +0 -2
  353. package/dist/client/assets/embed-entry-D1Or9S4d.js +0 -2
  354. package/dist/client/assets/gestures-CgvAMd6F.js +0 -1
  355. package/dist/client/assets/home-live-action-B22u89j7.js +0 -1
  356. package/dist/client/assets/home-moving-signal-BdkERL6B.js +0 -1
  357. package/dist/client/assets/home-now-card-lLkv6nQs.js +0 -1
  358. package/dist/client/assets/hooks-BPLDD9yu.js +0 -2
  359. package/dist/client/assets/index-DGoLx89y.js +0 -1
  360. package/dist/client/assets/index-DITWsjFb.css +0 -1
  361. package/dist/client/assets/index-m6dFtY5f.js +0 -1
  362. package/dist/client/assets/index-pY8-Mz7y.js +0 -1
  363. package/dist/client/assets/keyboard-nav-BhZZ5HEq.js +0 -1
  364. package/dist/client/assets/left-B6eawimv.js +0 -1
  365. package/dist/client/assets/left-BL2uBHe0.js +0 -2
  366. package/dist/client/assets/left-BNJguPDG.js +0 -1
  367. package/dist/client/assets/left-BvCtvN0f.js +0 -1
  368. package/dist/client/assets/left-CfBb6bxM.js +0 -1
  369. package/dist/client/assets/left-DTrlBF0h.js +0 -2
  370. package/dist/client/assets/left-agents-DsOHgDCY.js +0 -1
  371. package/dist/client/assets/left-d4hlBBxY.js +0 -1
  372. package/dist/client/assets/left-default-BRCwoCJr.js +0 -1
  373. package/dist/client/assets/left-lanes-DNtoRzoV.js +0 -1
  374. package/dist/client/assets/left-mission-DsTu2X5Y.js +0 -1
  375. package/dist/client/assets/left-plan-CtySjsXC.js +0 -2
  376. package/dist/client/assets/library-CLpgWNJO.js +0 -1
  377. package/dist/client/assets/mission-control-D3ikEPND.css +0 -1
  378. package/dist/client/assets/openAgent-Bjt57GdM.js +0 -1
  379. package/dist/client/assets/paperclip-DL9BXPp2.js +0 -1
  380. package/dist/client/assets/profile-BqY5tesX.js +0 -1
  381. package/dist/client/assets/resolve-panes-1xeZMuaw.js +0 -1
  382. package/dist/client/assets/resolve-sidebar-context-PLr32WHN.js +0 -1
  383. package/dist/client/assets/right-1x7HzabC.js +0 -1
  384. package/dist/client/assets/right-CFzPUzlF.js +0 -1
  385. package/dist/client/assets/right-CRKyeJDk.js +0 -1
  386. package/dist/client/assets/right-CagzkLWg.js +0 -1
  387. package/dist/client/assets/right-CsV149pN.js +0 -1
  388. package/dist/client/assets/right-DITNyG2s.js +0 -1
  389. package/dist/client/assets/right-E3nNcLE3.js +0 -1
  390. package/dist/client/assets/right-eUQvSjd7.js +0 -1
  391. package/dist/client/assets/right-ozp4nM44.js +0 -1
  392. package/dist/client/assets/router-Dja9_ygK.js +0 -1
  393. package/dist/client/assets/session-table-sAVe44a4.js +0 -1
  394. package/dist/client/assets/system-surfaces-redesign-CD26LFc0.css +0 -1
  395. package/dist/client/assets/terminal-sessions-D5CIR2OL.js +0 -1
  396. package/dist/client/assets/use-reduced-motion-Cvk-HRKg.js +0 -1
  397. package/dist/client/assets/use-scout-dev-flags-BHvg3G2c.js +0 -1
  398. package/dist/client/assets/useContentSecondaryNav-ZfBNi3d4.js +0 -1
package/dist/main.mjs CHANGED
@@ -354,9 +354,22 @@ function candidateAliases(candidate) {
354
354
  return Array.from(new Set(aliases.map((alias) => trimIdentityPrefix(alias)).filter(Boolean)));
355
355
  }
356
356
  function explicitCandidateAliases(candidate) {
357
+ const cached = explicitAliasesCache.get(candidate);
358
+ if (cached)
359
+ return cached;
357
360
  const canonical = candidateCanonicalIdentity(candidate);
358
361
  const implicitAliases = canonical?.definitionId === OPENSCOUT_COORDINATOR_AGENT_ID ? [SCOUT_DISPATCHER_AGENT_ID] : [];
359
- return Array.from(new Set([...candidate.aliases ?? [], ...implicitAliases].map((alias) => normalizeAgentIdentitySegment(trimIdentityPrefix(alias))).filter(Boolean)));
362
+ const aliases = Array.from(new Set([...candidate.aliases ?? [], ...implicitAliases].map((alias) => normalizeAgentIdentitySegment(trimIdentityPrefix(alias))).filter(Boolean)));
363
+ explicitAliasesCache.set(candidate, aliases);
364
+ return aliases;
365
+ }
366
+ function candidateAliasKeys(candidate) {
367
+ const cached = aliasKeysCache.get(candidate);
368
+ if (cached)
369
+ return cached;
370
+ const keys = explicitCandidateAliases(candidate).map(canonicalizeAliasValue);
371
+ aliasKeysCache.set(candidate, keys);
372
+ return keys;
360
373
  }
361
374
  function canonicalizeAliasValue(value) {
362
375
  const parsed = parseAgentIdentity(value.startsWith("@") ? value : `@${value}`);
@@ -373,7 +386,10 @@ function identityAliasKeys(identity) {
373
386
  ].filter(Boolean)));
374
387
  }
375
388
  function candidateCanonicalIdentity(candidate) {
376
- return constructAgentIdentity({
389
+ if (canonicalIdentityCache.has(candidate)) {
390
+ return canonicalIdentityCache.get(candidate) ?? null;
391
+ }
392
+ const canonical = constructAgentIdentity({
377
393
  definitionId: candidate.definitionId || candidate.agentId,
378
394
  nodeQualifier: candidate.nodeQualifier,
379
395
  workspaceQualifier: candidate.workspaceQualifier,
@@ -381,6 +397,8 @@ function candidateCanonicalIdentity(candidate) {
381
397
  harness: candidate.harness,
382
398
  model: candidate.model
383
399
  });
400
+ canonicalIdentityCache.set(candidate, canonical);
401
+ return canonical;
384
402
  }
385
403
  function candidateDimensionValue(candidate, dimension) {
386
404
  const canonical = candidateCanonicalIdentity(candidate);
@@ -477,8 +495,8 @@ function definitionMatchesIdentity(identityDefinitionId, candidateDefinitionId)
477
495
  }
478
496
  function agentIdentityMatches(identity, candidate) {
479
497
  const aliasKeys = identityAliasKeys(identity);
480
- const candidateAliasKeys = explicitCandidateAliases(candidate).map(canonicalizeAliasValue);
481
- if (aliasKeys.some((key) => candidateAliasKeys.includes(key))) {
498
+ const candidateAliasKeys2 = explicitCandidateAliases(candidate).map(canonicalizeAliasValue);
499
+ if (aliasKeys.some((key) => candidateAliasKeys2.includes(key))) {
482
500
  return true;
483
501
  }
484
502
  const canonical = canonicalizeIdentity({
@@ -516,8 +534,8 @@ function resolveAgentIdentity(identity, candidates) {
516
534
  function diagnoseAgentIdentity(identity, candidates) {
517
535
  const aliasKeys = identityAliasKeys(identity);
518
536
  const exactAliasMatches = candidates.filter((candidate) => {
519
- const candidateAliasKeys = explicitCandidateAliases(candidate).map(canonicalizeAliasValue);
520
- return aliasKeys.some((key) => candidateAliasKeys.includes(key));
537
+ const keys = candidateAliasKeys(candidate);
538
+ return keys.length > 0 && aliasKeys.some((key) => keys.includes(key));
521
539
  });
522
540
  if (exactAliasMatches.length === 1) {
523
541
  return { kind: "resolved", match: exactAliasMatches[0] };
@@ -558,15 +576,31 @@ function buildIdentitySubset(candidate, dimensions) {
558
576
  ...dimensions.includes("node") && canonical.nodeQualifier ? { nodeQualifier: canonical.nodeQualifier } : {}
559
577
  });
560
578
  }
579
+ function peersByDefinitionId(candidates) {
580
+ const cached = peersByDefinitionCache.get(candidates);
581
+ if (cached)
582
+ return cached;
583
+ const groups = new Map;
584
+ for (const candidate of candidates) {
585
+ const canonical = candidateCanonicalIdentity(candidate);
586
+ if (!canonical)
587
+ continue;
588
+ const group = groups.get(canonical.definitionId);
589
+ if (group) {
590
+ group.push(candidate);
591
+ } else {
592
+ groups.set(canonical.definitionId, [candidate]);
593
+ }
594
+ }
595
+ peersByDefinitionCache.set(candidates, groups);
596
+ return groups;
597
+ }
561
598
  function formatMinimalAgentIdentity(candidate, candidates, options = {}) {
562
599
  const canonical = candidateCanonicalIdentity(candidate);
563
600
  if (!canonical) {
564
601
  return options.includeSigil === false ? "" : "@";
565
602
  }
566
- const peers = candidates.filter((peer) => {
567
- const peerCanonical = candidateCanonicalIdentity(peer);
568
- return peerCanonical && peerCanonical.definitionId === canonical.definitionId;
569
- });
603
+ const peers = peersByDefinitionId(candidates).get(canonical.definitionId) ?? [];
570
604
  const aliasMatches = explicitCandidateAliases(candidate).map((alias) => ({ alias, identity: parseAgentIdentity(`@${alias}`) })).filter((entry) => Boolean(entry.identity)).filter((entry) => resolveAgentIdentity(entry.identity, candidates) === candidate).sort((left, right) => left.alias.length - right.alias.length || left.alias.localeCompare(right.alias));
571
605
  if (aliasMatches.length > 0) {
572
606
  return formatAgentIdentity({ definitionId: aliasMatches[0].alias }, options);
@@ -595,7 +629,7 @@ function formatMinimalAgentIdentity(candidate, candidates, options = {}) {
595
629
  }
596
630
  return formatAgentIdentity(canonical, options);
597
631
  }
598
- var DIMENSION_ALIASES, normalizeAgentSelectorSegment, SCOUT_DISPATCHER_AGENT_ID = "scout", OPENSCOUT_COORDINATOR_AGENT_ID = "openscout", BUILT_IN_AGENT_DEFINITION_IDS, RESERVED_AGENT_DEFINITION_IDS, parseAgentSelector, formatAgentSelector, extractAgentSelectors, resolveAgentSelector;
632
+ var DIMENSION_ALIASES, normalizeAgentSelectorSegment, SCOUT_DISPATCHER_AGENT_ID = "scout", OPENSCOUT_COORDINATOR_AGENT_ID = "openscout", BUILT_IN_AGENT_DEFINITION_IDS, RESERVED_AGENT_DEFINITION_IDS, explicitAliasesCache, aliasKeysCache, canonicalIdentityCache, peersByDefinitionCache, parseAgentSelector, formatAgentSelector, extractAgentSelectors, resolveAgentSelector;
599
633
  var init_agent_identity = __esm(() => {
600
634
  DIMENSION_ALIASES = {
601
635
  workspace: "workspace",
@@ -619,6 +653,10 @@ var init_agent_identity = __esm(() => {
619
653
  RESERVED_AGENT_DEFINITION_IDS = new Set([
620
654
  SCOUT_DISPATCHER_AGENT_ID
621
655
  ]);
656
+ explicitAliasesCache = new WeakMap;
657
+ aliasKeysCache = new WeakMap;
658
+ canonicalIdentityCache = new WeakMap;
659
+ peersByDefinitionCache = new WeakMap;
622
660
  parseAgentSelector = parseAgentIdentity;
623
661
  formatAgentSelector = formatAgentIdentity;
624
662
  extractAgentSelectors = extractAgentIdentities;
@@ -1089,7 +1127,7 @@ var SCOUT_RUNTIME_CATALOG_DATA;
1089
1127
  var init_runtime_catalog_generated = __esm(() => {
1090
1128
  SCOUT_RUNTIME_CATALOG_DATA = {
1091
1129
  schemaVersion: "openscout.runtime-catalog.v1",
1092
- revision: "2026-08-12.1",
1130
+ revision: "2026-08-18.1",
1093
1131
  harnesses: [
1094
1132
  {
1095
1133
  id: "claude",
@@ -1218,6 +1256,7 @@ var init_runtime_catalog_generated = __esm(() => {
1218
1256
  id: "grok",
1219
1257
  label: "Grok CLI",
1220
1258
  enabled: true,
1259
+ listed: false,
1221
1260
  reasoningEfforts: [
1222
1261
  "low",
1223
1262
  "medium",
@@ -1253,7 +1292,7 @@ var init_runtime_catalog_generated = __esm(() => {
1253
1292
  },
1254
1293
  {
1255
1294
  id: "grok-acp",
1256
- label: "Grok ACP",
1295
+ label: "Grok",
1257
1296
  enabled: true,
1258
1297
  reasoningEfforts: null,
1259
1298
  models: [
@@ -2075,7 +2114,7 @@ function validateScoutRendezvousCodename(codename) {
2075
2114
  }
2076
2115
  var SCOUT_RENDEZVOUS_GENERATED_CODENAME_LENGTH = 6, SCOUT_RENDEZVOUS_CODENAME_MAX_LENGTH = 32, SCOUT_RENDEZVOUS_INVITE_TTL_MS, SCOUT_RENDEZVOUS_MAX_WAIT_MS;
2077
2116
  var init_rendezvous = __esm(() => {
2078
- SCOUT_RENDEZVOUS_INVITE_TTL_MS = 10 * 60000;
2117
+ SCOUT_RENDEZVOUS_INVITE_TTL_MS = 4 * 60 * 60000;
2079
2118
  SCOUT_RENDEZVOUS_MAX_WAIT_MS = 10 * 60000;
2080
2119
  });
2081
2120
 
@@ -13762,14 +13801,20 @@ function herdrProbeTarget(env) {
13762
13801
  return {
13763
13802
  bin: herdrBin(env),
13764
13803
  path: env.PATH ?? "",
13765
- home: env.XDG_CONFIG_HOME?.trim() || env.HOME?.trim() || homedir10()
13804
+ home: env.HOME?.trim() || homedir10(),
13805
+ xdgConfigHome: env.XDG_CONFIG_HOME?.trim() || null
13766
13806
  };
13767
13807
  }
13768
13808
  function parseHerdrProbeKey(key) {
13769
13809
  try {
13770
13810
  const parsed = JSON.parse(key);
13771
13811
  if (typeof parsed?.bin === "string" && typeof parsed.path === "string" && typeof parsed.home === "string") {
13772
- return { bin: parsed.bin, path: parsed.path, home: parsed.home };
13812
+ return {
13813
+ bin: parsed.bin,
13814
+ path: parsed.path,
13815
+ home: parsed.home,
13816
+ xdgConfigHome: typeof parsed.xdgConfigHome === "string" && parsed.xdgConfigHome.trim() ? parsed.xdgConfigHome.trim() : null
13817
+ };
13773
13818
  }
13774
13819
  } catch {}
13775
13820
  return herdrProbeTarget(process.env);
@@ -13811,8 +13856,13 @@ function parseHerdrSessionListJson(output) {
13811
13856
  async function readHerdrSessionsLocal(key, ctx) {
13812
13857
  const target = parseHerdrProbeKey(key);
13813
13858
  try {
13859
+ const env = { ...process.env, PATH: target.path, HOME: target.home };
13860
+ if (target.xdgConfigHome)
13861
+ env.XDG_CONFIG_HOME = target.xdgConfigHome;
13862
+ else
13863
+ delete env.XDG_CONFIG_HOME;
13814
13864
  const { stdout } = await execProbeFile(ctx, target.bin, ["session", "list", "--json"], {
13815
- env: { ...process.env, PATH: target.path, HOME: target.home, XDG_CONFIG_HOME: target.home },
13865
+ env,
13816
13866
  maxStdoutBytes: 512 * 1024,
13817
13867
  maxStderrBytes: 64 * 1024
13818
13868
  });
@@ -13823,7 +13873,7 @@ async function readHerdrSessionsLocal(key, ctx) {
13823
13873
  throw error;
13824
13874
  }
13825
13875
  }
13826
- var HERDR_TTL_MS = 5000, HERDR_TIMEOUT_MS = 2000, herdrSessionsProbe;
13876
+ var HERDR_TTL_MS = 5000, HERDR_TIMEOUT_MS = 2000, herdrSessionsProbe, herdrTopologyCache;
13827
13877
  var init_herdr = __esm(() => {
13828
13878
  init_registry();
13829
13879
  init_exec();
@@ -13848,6 +13898,7 @@ var init_herdr = __esm(() => {
13848
13898
  });
13849
13899
  }
13850
13900
  });
13901
+ herdrTopologyCache = new Map;
13851
13902
  });
13852
13903
 
13853
13904
  // ../runtime/src/system-probes/sessions.ts
@@ -28892,7 +28943,7 @@ function buildCollaborationContractPrompt(agentId) {
28892
28943
  }
28893
28944
 
28894
28945
  // ../runtime/src/pi-rpc.ts
28895
- import { existsSync as existsSync23 } from "fs";
28946
+ import { existsSync as existsSync23, readFileSync as readFileSync10, statSync as statSync6 } from "fs";
28896
28947
  import { mkdir as mkdir9, writeFile as writeFile8 } from "fs/promises";
28897
28948
  import { execFileSync as execFileSync5 } from "child_process";
28898
28949
  import { homedir as homedir22 } from "os";
@@ -28950,7 +29001,37 @@ function inferPiProvider(launch) {
28950
29001
  }
28951
29002
  return;
28952
29003
  }
28953
- function readSecretValue(name, commandOverride) {
29004
+ function readPiRpcCredentialFile(name, options = {}) {
29005
+ if (!/^[A-Z0-9_]+$/.test(name)) {
29006
+ return;
29007
+ }
29008
+ const env = options.env ?? process.env;
29009
+ const platform = options.platform ?? process.platform;
29010
+ const directory = normalizeOptionalString2(env.CREDENTIALS_DIRECTORY) ?? normalizeOptionalString2(env.OPENSCOUT_CREDENTIALS_DIRECTORY) ?? (platform === "linux" ? join27(normalizeOptionalString2(env.XDG_CONFIG_HOME) ?? join27(options.homedir ?? homedir22(), ".config"), "openscout", "credentials") : undefined);
29011
+ if (!directory) {
29012
+ return;
29013
+ }
29014
+ try {
29015
+ const directoryStat = statSync6(directory);
29016
+ if (!directoryStat.isDirectory() || (directoryStat.mode & 63) !== 0) {
29017
+ return;
29018
+ }
29019
+ const path = join27(directory, name);
29020
+ const stat5 = statSync6(path);
29021
+ if (!stat5.isFile() || (stat5.mode & 63) !== 0 || stat5.size > 16 * 1024) {
29022
+ return;
29023
+ }
29024
+ const value = readFileSync10(path, "utf8").trim();
29025
+ return value || undefined;
29026
+ } catch {
29027
+ return;
29028
+ }
29029
+ }
29030
+ function readSecretValue(name, commandOverride, env = process.env) {
29031
+ const credentialFile = readPiRpcCredentialFile(name, { env });
29032
+ if (credentialFile) {
29033
+ return credentialFile;
29034
+ }
28954
29035
  try {
28955
29036
  const output = execFileSync5(commandOverride || "secret", ["get", name], {
28956
29037
  encoding: "utf8",
@@ -28984,7 +29065,7 @@ function buildPiRpcCredentialEnv(launch, sources = {}) {
28984
29065
  }
28985
29066
  const env = {};
28986
29067
  const sourceEnv = sources.env ?? process.env;
28987
- const readSecret = sources.readSecret ?? ((name) => readSecretValue(name, sources.secretCommand));
29068
+ const readSecret = sources.readSecret ?? ((name) => readSecretValue(name, sources.secretCommand, sourceEnv));
28988
29069
  for (const mapping of mappings) {
28989
29070
  const value = readMappedCredentialValue(mapping, sourceEnv, readSecret);
28990
29071
  if (value) {
@@ -29361,7 +29442,7 @@ var init_local_agent_template = __esm(() => {
29361
29442
  });
29362
29443
 
29363
29444
  // ../runtime/src/relay-agent-process-leases.ts
29364
- import { existsSync as existsSync24, mkdirSync as mkdirSync5, readdirSync as readdirSync4, readFileSync as readFileSync10, rmSync as rmSync3, writeFileSync as writeFileSync5 } from "fs";
29445
+ import { existsSync as existsSync24, mkdirSync as mkdirSync5, readdirSync as readdirSync4, readFileSync as readFileSync11, rmSync as rmSync3, writeFileSync as writeFileSync5 } from "fs";
29365
29446
  import { join as join28 } from "path";
29366
29447
  function processLeasesDirectory() {
29367
29448
  return join28(resolveOpenScoutSupportPaths().runtimeDirectory, "process-leases");
@@ -29513,7 +29594,7 @@ var init_permission_policy2 = __esm(() => {
29513
29594
  });
29514
29595
 
29515
29596
  // ../runtime/src/user-config.ts
29516
- import { existsSync as existsSync25, readFileSync as readFileSync11, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6 } from "fs";
29597
+ import { existsSync as existsSync25, readFileSync as readFileSync12, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6 } from "fs";
29517
29598
  import { homedir as homedir23 } from "os";
29518
29599
  import { dirname as dirname16, join as join30 } from "path";
29519
29600
  function userConfigPath() {
@@ -29524,7 +29605,7 @@ function loadUserConfig() {
29524
29605
  if (!existsSync25(configPath))
29525
29606
  return {};
29526
29607
  try {
29527
- return JSON.parse(readFileSync11(configPath, "utf8"));
29608
+ return JSON.parse(readFileSync12(configPath, "utf8"));
29528
29609
  } catch {
29529
29610
  return {};
29530
29611
  }
@@ -29540,7 +29621,7 @@ function readSettingsOperatorName() {
29540
29621
  if (!existsSync25(settingsPath))
29541
29622
  return "";
29542
29623
  try {
29543
- const settings = JSON.parse(readFileSync11(settingsPath, "utf8"));
29624
+ const settings = JSON.parse(readFileSync12(settingsPath, "utf8"));
29544
29625
  const candidate = typeof settings.profile?.operatorName === "string" ? settings.profile.operatorName : typeof settings.operatorName === "string" ? settings.operatorName : "";
29545
29626
  return candidate.trim();
29546
29627
  } catch {
@@ -29563,7 +29644,7 @@ var init_user_config = __esm(() => {
29563
29644
  });
29564
29645
 
29565
29646
  // ../runtime/src/local-agents.ts
29566
- import { existsSync as existsSync26, readFileSync as readFileSync12 } from "fs";
29647
+ import { existsSync as existsSync26, readFileSync as readFileSync13 } from "fs";
29567
29648
  import { mkdir as mkdir10, readFile as readFile13, rm as rm4, stat as stat5, writeFile as writeFile9 } from "fs/promises";
29568
29649
  import { basename as basename9, dirname as dirname17, join as join31, resolve as resolve13 } from "path";
29569
29650
  import { fileURLToPath as fileURLToPath6 } from "url";
@@ -29579,7 +29660,7 @@ function resolveProjectsRoot(projectPath) {
29579
29660
  if (!existsSync26(supportPaths.settingsPath)) {
29580
29661
  return dirname17(projectPath);
29581
29662
  }
29582
- const raw = JSON.parse(readFileSync12(supportPaths.settingsPath, "utf8"));
29663
+ const raw = JSON.parse(readFileSync13(supportPaths.settingsPath, "utf8"));
29583
29664
  const workspaceRoot = raw.discovery?.workspaceRoots?.find((entry) => typeof entry === "string" && entry.trim().length > 0);
29584
29665
  return workspaceRoot ? resolve13(workspaceRoot) : dirname17(projectPath);
29585
29666
  } catch {
@@ -31408,7 +31489,7 @@ async function ensureLocalAgentOnlineOnce(agentName, record2) {
31408
31489
  }
31409
31490
  }
31410
31491
  if (!sessionOnline) {
31411
- const stderrTail = existsSync26(stderrLogFile) ? readFileSync12(stderrLogFile, "utf8").trim().split(/\r?\n/).slice(-10).join(`
31492
+ const stderrTail = existsSync26(stderrLogFile) ? readFileSync13(stderrLogFile, "utf8").trim().split(/\r?\n/).slice(-10).join(`
31412
31493
  `).trim() : "";
31413
31494
  throw new Error(stderrTail ? `Relay agent ${agentName} failed to stay online:
31414
31495
  ${redactSecrets(stderrTail)}` : `Relay agent ${agentName} failed to stay online.`);
@@ -31927,7 +32008,7 @@ function readPersistedSessionCatalogId(runtimeDir) {
31927
32008
  try {
31928
32009
  const catalogPath = join31(runtimeDir, "session-catalog.json");
31929
32010
  if (existsSync26(catalogPath)) {
31930
- const raw = readFileSync12(catalogPath, "utf8").trim();
32011
+ const raw = readFileSync13(catalogPath, "utf8").trim();
31931
32012
  if (raw) {
31932
32013
  const catalog = JSON.parse(raw);
31933
32014
  if (typeof catalog.activeSessionId === "string" && catalog.activeSessionId.trim()) {
@@ -31944,7 +32025,7 @@ function readPersistedLegacySessionId(runtimeDir, filename) {
31944
32025
  try {
31945
32026
  const legacyPath = join31(runtimeDir, filename);
31946
32027
  if (existsSync26(legacyPath)) {
31947
- const value = readFileSync12(legacyPath, "utf8").trim();
32028
+ const value = readFileSync13(legacyPath, "utf8").trim();
31948
32029
  return value || null;
31949
32030
  }
31950
32031
  return null;
@@ -32040,6 +32121,7 @@ function buildLocalAgentBinding(agentId, record2, alive, nodeId, source) {
32040
32121
  labels: ["relay", "project", "agent", "local-agent"],
32041
32122
  metadata: {
32042
32123
  source,
32124
+ brokerRegistered: true,
32043
32125
  ...normalizedRecord.registrationSource ? { registrationSource: normalizedRecord.registrationSource } : {},
32044
32126
  project: normalizedRecord.project,
32045
32127
  projectRoot,
@@ -42214,15 +42296,6 @@ var init_sqlite_store = __esm(() => {
42214
42296
  { key: "pairingSessionId", kind: "pairing" }
42215
42297
  ];
42216
42298
  });
42217
- // ../runtime/src/mesh-discovery.ts
42218
- var init_mesh_discovery = __esm(() => {
42219
- init_tailscale();
42220
- });
42221
-
42222
- // ../runtime/src/iroh-bridge.ts
42223
- var init_iroh_bridge = __esm(() => {
42224
- init_support_paths();
42225
- });
42226
42299
 
42227
42300
  // ../runtime/src/mesh-peer-auth.ts
42228
42301
  import { createHash as createHash5, randomBytes as randomBytes2 } from "crypto";
@@ -57862,6 +57935,17 @@ var init_mesh_peer_client = __esm(() => {
57862
57935
  meshPeerFetch = createMeshPeerFetch();
57863
57936
  });
57864
57937
 
57938
+ // ../runtime/src/mesh-discovery.ts
57939
+ var init_mesh_discovery = __esm(() => {
57940
+ init_mesh_peer_client();
57941
+ init_tailscale();
57942
+ });
57943
+
57944
+ // ../runtime/src/iroh-bridge.ts
57945
+ var init_iroh_bridge = __esm(() => {
57946
+ init_support_paths();
57947
+ });
57948
+
57865
57949
  // ../runtime/src/mesh-forwarding.ts
57866
57950
  var init_mesh_forwarding = __esm(() => {
57867
57951
  init_iroh_bridge();
@@ -59803,10 +59887,7 @@ class BrokerRendezvousService {
59803
59887
  suggestion: "choose_another_codename"
59804
59888
  };
59805
59889
  }
59806
- const expiredInvite = this.expiredInvites.get(key);
59807
- if (expiredInvite) {
59808
- return expiredResponse(expiredInvite, participantId);
59809
- }
59890
+ this.expiredInvites.delete(key);
59810
59891
  return this.createPresence(projectRoot, participantId, requestedCodename, normalizedCodename, now);
59811
59892
  }
59812
59893
  for (let attempt = 0;attempt < MAX_CODENAME_GENERATION_ATTEMPTS; attempt += 1) {
@@ -60084,7 +60165,7 @@ var init_broker_rendezvous_service = __esm(() => {
60084
60165
  });
60085
60166
 
60086
60167
  // ../runtime/src/provisional-agent-names-config.ts
60087
- import { existsSync as existsSync28, readFileSync as readFileSync13, writeFileSync as writeFileSync7, mkdirSync as mkdirSync8 } from "fs";
60168
+ import { existsSync as existsSync28, readFileSync as readFileSync14, writeFileSync as writeFileSync7, mkdirSync as mkdirSync8 } from "fs";
60088
60169
  import { homedir as homedir24 } from "os";
60089
60170
  import { isAbsolute as isAbsolute4, join as join33, resolve as resolve15 } from "path";
60090
60171
  function openScoutHome() {
@@ -60120,7 +60201,7 @@ function resolvePoolFilePath(filePath) {
60120
60201
  return isAbsolute4(trimmed) ? trimmed : resolve15(openScoutHome(), trimmed);
60121
60202
  }
60122
60203
  function readProvisionalAgentNamesJsonFile(filePath) {
60123
- return parseProvisionalAgentNamesJson(readFileSync13(filePath, "utf8"));
60204
+ return parseProvisionalAgentNamesJson(readFileSync14(filePath, "utf8"));
60124
60205
  }
60125
60206
  function loadInlineProvisionalAgentNames(config) {
60126
60207
  const customNames = normalizeProvisionalAgentNamesSetting(config.provisionalAgentNames);
@@ -61031,8 +61112,10 @@ async function loadOpenScoutOnboardingState(options = {}) {
61031
61112
  const operatorNameSource = explicitUserName ? "user-config" : envOperatorName ? "env" : settingsOperatorName || answeredSettingsOperatorName ? "settings" : "default";
61032
61113
  const contextRoot = settings.discovery.contextRoot ?? null;
61033
61114
  const project = await resolveProjectConfig({ currentDirectory, contextRoot });
61034
- const broker = options.broker ?? await brokerServiceStatus().catch(() => null);
61035
- const catalog = options.catalog ?? await loadHarnessCatalogSnapshot().catch(() => null);
61115
+ const [broker, catalog] = await Promise.all([
61116
+ options.broker ?? brokerServiceStatus().catch(() => null),
61117
+ options.catalog ?? loadHarnessCatalogSnapshot().catch(() => null)
61118
+ ]);
61036
61119
  const readyRuntimeCount = catalog?.entries.filter((entry) => entry.readinessReport.ready).length ?? 0;
61037
61120
  const hasReadyRuntime = readyRuntimeCount > 0;
61038
61121
  const hasLocalConfig = localConfigExists();
@@ -61099,7 +61182,11 @@ async function ensureOpenScoutOnboardingLocalConfig(options = {}) {
61099
61182
  }, {
61100
61183
  currentDirectory: options.currentDirectory
61101
61184
  });
61102
- return loadOpenScoutOnboardingState({ currentDirectory: options.currentDirectory });
61185
+ return loadOpenScoutOnboardingState({
61186
+ currentDirectory: options.currentDirectory,
61187
+ broker: options.broker,
61188
+ catalog: options.catalog
61189
+ });
61103
61190
  }
61104
61191
  async function saveOpenScoutOnboardingIdentity(input) {
61105
61192
  const name2 = input.name.trim();
@@ -61119,7 +61206,11 @@ async function saveOpenScoutOnboardingIdentity(input) {
61119
61206
  }, {
61120
61207
  currentDirectory: input.currentDirectory
61121
61208
  });
61122
- return loadOpenScoutOnboardingState({ currentDirectory: input.currentDirectory });
61209
+ return loadOpenScoutOnboardingState({
61210
+ currentDirectory: input.currentDirectory,
61211
+ broker: input.broker,
61212
+ catalog: input.catalog
61213
+ });
61123
61214
  }
61124
61215
  async function saveOpenScoutOnboardingProject(input) {
61125
61216
  const contextRoot = normalizePath2(input.contextRoot);
@@ -61147,7 +61238,11 @@ async function saveOpenScoutOnboardingProject(input) {
61147
61238
  }, {
61148
61239
  currentDirectory: input.currentDirectory ?? contextRoot
61149
61240
  });
61150
- return loadOpenScoutOnboardingState({ currentDirectory: contextRoot });
61241
+ return loadOpenScoutOnboardingState({
61242
+ currentDirectory: contextRoot,
61243
+ broker: input.broker,
61244
+ catalog: input.catalog
61245
+ });
61151
61246
  }
61152
61247
  async function triggerMeshDiscovery(broker) {
61153
61248
  if (!broker.reachable || !broker.brokerUrl)
@@ -61880,7 +61975,7 @@ var init_thread_events = __esm(() => {
61880
61975
 
61881
61976
  // ../runtime/src/mobile-push.ts
61882
61977
  import { Database as Database2 } from "bun:sqlite";
61883
- import { mkdirSync as mkdirSync9, readFileSync as readFileSync14 } from "fs";
61978
+ import { mkdirSync as mkdirSync9, readFileSync as readFileSync15 } from "fs";
61884
61979
  import { connect as connectHttp2 } from "http2";
61885
61980
  import { createPrivateKey as createPrivateKey3, sign as signWithKey } from "crypto";
61886
61981
  import { dirname as dirname20, join as join36 } from "path";
@@ -62199,7 +62294,7 @@ function loadApnsCredentials() {
62199
62294
  privateKeyPem = Buffer.from(inlineBase64, "base64").toString("utf8");
62200
62295
  }
62201
62296
  if (!privateKeyPem && path) {
62202
- privateKeyPem = readFileSync14(path, "utf8");
62297
+ privateKeyPem = readFileSync15(path, "utf8");
62203
62298
  }
62204
62299
  if (!teamId || !keyId || !privateKeyPem) {
62205
62300
  return null;
@@ -62902,7 +62997,7 @@ var init_paths2 = __esm(() => {
62902
62997
  });
62903
62998
 
62904
62999
  // ../runtime/src/knowledge/store.ts
62905
- import { existsSync as existsSync31, mkdirSync as mkdirSync10, statSync as statSync6 } from "fs";
63000
+ import { existsSync as existsSync31, mkdirSync as mkdirSync10, statSync as statSync7 } from "fs";
62906
63001
  import { createHash as createHash8, randomUUID as randomUUID4 } from "crypto";
62907
63002
  import { dirname as dirname21 } from "path";
62908
63003
  import { Database as Database3 } from "bun:sqlite";
@@ -63561,7 +63656,7 @@ class SQLiteKnowledgeStore {
63561
63656
  const chunkCounts = this.db.query("SELECT COUNT(*) AS total FROM chunks").get();
63562
63657
  let sqliteBytes = 0;
63563
63658
  try {
63564
- sqliteBytes = statSync6(this.paths.sqlitePath).size;
63659
+ sqliteBytes = statSync7(this.paths.sqlitePath).size;
63565
63660
  } catch {
63566
63661
  sqliteBytes = 0;
63567
63662
  }
@@ -63706,11 +63801,11 @@ import {
63706
63801
  createReadStream as createReadStream2,
63707
63802
  existsSync as existsSync32,
63708
63803
  mkdirSync as mkdirSync11,
63709
- readFileSync as readFileSync15,
63804
+ readFileSync as readFileSync16,
63710
63805
  readdirSync as readdirSync5,
63711
63806
  renameSync as renameSync4,
63712
63807
  rmSync as rmSync4,
63713
- statSync as statSync7,
63808
+ statSync as statSync8,
63714
63809
  writeFileSync as writeFileSync8
63715
63810
  } from "fs";
63716
63811
  import { homedir as homedir27 } from "os";
@@ -63796,7 +63891,7 @@ function discoverRecentSessionFiles(cutoffMs, limit, harnessFilter) {
63796
63891
  const path = join38(dir, entry);
63797
63892
  let stats;
63798
63893
  try {
63799
- stats = statSync7(path);
63894
+ stats = statSync8(path);
63800
63895
  } catch {
63801
63896
  continue;
63802
63897
  }
@@ -64093,8 +64188,8 @@ function readKimiSessionState(wirePath) {
64093
64188
  let cwd = null;
64094
64189
  let title = null;
64095
64190
  try {
64096
- const state = recordValue2(JSON.parse(readFileSync15(join38(sessionDirectory, "state.json"), "utf8")));
64097
- cwd = stringValue15(state?.workDir) ?? null;
64191
+ const state = recordValue2(JSON.parse(readFileSync16(join38(sessionDirectory, "state.json"), "utf8")));
64192
+ cwd = stringValue15(state?.cwd) ?? stringValue15(state?.workDir) ?? null;
64098
64193
  title = stringValue15(state?.title) ?? null;
64099
64194
  } catch {}
64100
64195
  return { cwd, sessionId, title };
@@ -64850,6 +64945,7 @@ var init_src3 = __esm(() => {
64850
64945
  init_sqlite_store();
64851
64946
  init_mesh_discovery();
64852
64947
  init_mesh_forwarding();
64948
+ init_mesh_peer_client();
64853
64949
  init_mesh_rendezvous();
64854
64950
  init_node_identity();
64855
64951
  init_node_tls_identity();
@@ -65997,6 +66093,7 @@ function scoutBrokerAgentRegistrationFromConfig(config, nodeId) {
65997
66093
  labels: ["relay", "project", "agent", "local-agent"],
65998
66094
  metadata: {
65999
66095
  ...metadata,
66096
+ brokerRegistered: true,
66000
66097
  summary: `${config.displayName} agent for ${config.projectName}.`,
66001
66098
  role: "Agent"
66002
66099
  },
@@ -66097,9 +66194,12 @@ async function resolveConversationActorId(baseUrl, snapshot, nodeId, actorId, cu
66097
66194
  await syncBrokerAgentRegistration(baseUrl, snapshot, scoutBrokerAgentRegistrationFromConfig(configured, nodeId));
66098
66195
  return configured.agentId;
66099
66196
  }
66197
+ function isReusableBrokerRegisteredTargetAgent(agent) {
66198
+ return Boolean(agent && !metadataBoolean(agent.metadata, "staleLocalRegistration") && (metadataString5(agent.metadata, "source") !== "relay-agent-registry" || metadataBoolean(agent.metadata, "brokerRegistered")));
66199
+ }
66100
66200
  async function ensureTargetRelayAgentRegistered(baseUrl, snapshot, nodeId, agentId, currentDirectory) {
66101
66201
  const existingAgent = snapshot.agents[agentId];
66102
- if (existingAgent && !metadataBoolean(existingAgent.metadata, "staleLocalRegistration")) {
66202
+ if (isReusableBrokerRegisteredTargetAgent(existingAgent)) {
66103
66203
  return true;
66104
66204
  }
66105
66205
  const configured = await ensureRelayAgentConfigured(agentId, {
@@ -68682,7 +68782,7 @@ var init_ask2 = __esm(() => {
68682
68782
 
68683
68783
  // ../../apps/desktop/src/cli/app-lifecycle.ts
68684
68784
  import { spawnSync as spawnSync4 } from "child_process";
68685
- import { existsSync as existsSync33, statSync as statSync8 } from "fs";
68785
+ import { existsSync as existsSync33, statSync as statSync9 } from "fs";
68686
68786
  import { join as join40, resolve as resolve19 } from "path";
68687
68787
  function resolveLaunchdLabel(env = process.env) {
68688
68788
  const explicit = (env.OPENSCOUT_SERVICE_LABEL ?? "").trim() || (env.OPENSCOUT_BROKER_SERVICE_LABEL ?? "").trim();
@@ -68767,7 +68867,7 @@ function isSuperseded(record2, binaryPath, now = Date.now()) {
68767
68867
  return false;
68768
68868
  let modifiedAt;
68769
68869
  try {
68770
- modifiedAt = statSync8(binaryPath).mtimeMs;
68870
+ modifiedAt = statSync9(binaryPath).mtimeMs;
68771
68871
  } catch {
68772
68872
  return false;
68773
68873
  }
@@ -70370,7 +70470,7 @@ function renderAliasCommandHelp() {
70370
70470
  "Bare native agent names keep precedence; use alias:<name> for explicit alias routing.",
70371
70471
  "",
70372
70472
  "Examples:",
70373
- " scout alias set review --to scope.main.arts-mac-mini-local",
70473
+ " scout alias set review --to scope.main.dev-mac-mini-local",
70374
70474
  " scout alias set patch --to session:019eff52-9347-7470-ba5c-6bfe99d8dd83",
70375
70475
  " scout alias repoint patch --to session:<new-id> --if-revision 4",
70376
70476
  ' scout ask --to alias:review "take a fresh pass"'
@@ -85782,7 +85882,7 @@ function finalize(ctx, schema2) {
85782
85882
  result.$schema = "http://json-schema.org/draft-07/schema#";
85783
85883
  } else if (ctx.target === "draft-04") {
85784
85884
  result.$schema = "http://json-schema.org/draft-04/schema#";
85785
- } else if (ctx.target === "openapi-3.0") {} else {}
85885
+ } else if (ctx.target === "openapi-3.0") {}
85786
85886
  if (ctx.external?.uri) {
85787
85887
  const id = ctx.external.registry.get(schema2)?.id;
85788
85888
  if (!id)
@@ -86047,7 +86147,7 @@ var formatMap, stringProcessor = (schema2, ctx, _json, _params) => {
86047
86147
  if (val === undefined) {
86048
86148
  if (ctx.unrepresentable === "throw") {
86049
86149
  throw new Error("Literal `undefined` cannot be represented in JSON Schema");
86050
- } else {}
86150
+ }
86051
86151
  } else if (typeof val === "bigint") {
86052
86152
  if (ctx.unrepresentable === "throw") {
86053
86153
  throw new Error("BigInt literals cannot be represented in JSON Schema");
@@ -99389,7 +99489,7 @@ var init_stdio2 = __esm(() => {
99389
99489
  // ../../apps/desktop/src/shared/product.ts
99390
99490
  var SCOUT_APP_VERSION;
99391
99491
  var init_product = __esm(() => {
99392
- SCOUT_APP_VERSION = process.env.SCOUT_APP_VERSION?.trim() || "0.2.79";
99492
+ SCOUT_APP_VERSION = process.env.SCOUT_APP_VERSION?.trim() || "0.2.82";
99393
99493
  });
99394
99494
 
99395
99495
  // ../../apps/desktop/src/core/mcp/stdio-server-lifecycle.ts
@@ -101731,7 +101831,7 @@ async function loadScoutRuntimesReport(currentDirectory) {
101731
101831
  reasoningEffort: scoutRuntimeDefaultReasoningEffort(defaultHarness ?? "", defaultModel, runtimeCatalog)
101732
101832
  },
101733
101833
  defaultsByHarness: scoutRuntimeDefaultsByHarness(runtimeCatalog),
101734
- harnesses: runtimeCatalog.harnesses.filter((entry) => entry.enabled).map((entry) => {
101834
+ harnesses: runtimeCatalog.harnesses.filter((entry) => entry.enabled && entry.listed !== false).map((entry) => {
101735
101835
  const readiness = catalog.entries.find((candidate) => candidate.harness === entry.id);
101736
101836
  return {
101737
101837
  id: entry.id,
@@ -101771,7 +101871,7 @@ var init_service5 = __esm(() => {
101771
101871
  });
101772
101872
 
101773
101873
  // ../../apps/desktop/src/shared/paths.ts
101774
- import { existsSync as existsSync37, readFileSync as readFileSync16 } from "fs";
101874
+ import { existsSync as existsSync37, readFileSync as readFileSync17 } from "fs";
101775
101875
  import { dirname as dirname27, join as join46, resolve as resolve26 } from "path";
101776
101876
  import { fileURLToPath as fileURLToPath10 } from "url";
101777
101877
  function looksLikeWorkspaceRoot(candidate) {
@@ -101780,7 +101880,7 @@ function looksLikeWorkspaceRoot(candidate) {
101780
101880
  return false;
101781
101881
  }
101782
101882
  try {
101783
- const parsed = JSON.parse(readFileSync16(packageJsonPath, "utf8"));
101883
+ const parsed = JSON.parse(readFileSync17(packageJsonPath, "utf8"));
101784
101884
  return Array.isArray(parsed.workspaces);
101785
101885
  } catch {
101786
101886
  return false;
@@ -101792,7 +101892,7 @@ function looksLikePackagedAppRoot(candidate) {
101792
101892
  return false;
101793
101893
  }
101794
101894
  try {
101795
- const parsed = JSON.parse(readFileSync16(packageJsonPath, "utf8"));
101895
+ const parsed = JSON.parse(readFileSync17(packageJsonPath, "utf8"));
101796
101896
  return parsed.name === "@openscout/scout" || parsed.name === "@openscout/cli";
101797
101897
  } catch {
101798
101898
  return false;
@@ -103735,7 +103835,7 @@ async function runInstallCommand(context, args) {
103735
103835
  message: `${verb} OpenScout ${installedAfter} \u2192 ${APP_PATH}${relaunchNote}`
103736
103836
  }, renderInstallResult);
103737
103837
  }
103738
- var GITHUB_OWNER = "arach", GITHUB_REPO = "openscout", APP_NAME = "OpenScout.app", APP_PATH, INFO_PLIST_PATH, APP_BUNDLE_ID = "app.openscout.scout", APP_PROCESS_NAME = "Scout", USER_AGENT = "scout-cli", HELP_FLAGS9;
103838
+ var GITHUB_OWNER = "oscout", GITHUB_REPO = "scout", APP_NAME = "OpenScout.app", APP_PATH, INFO_PLIST_PATH, APP_BUNDLE_ID = "app.openscout.scout", APP_PROCESS_NAME = "Scout", USER_AGENT = "scout-cli", HELP_FLAGS9;
103739
103839
  var init_install = __esm(() => {
103740
103840
  init_errors();
103741
103841
  APP_PATH = `/Applications/${APP_NAME}`;
@@ -104175,7 +104275,7 @@ function renderMatchCommandHelp() {
104175
104275
  "The facilitator chooses a memorable codename, gives it to both sessions, and",
104176
104276
  "runs `scout match new <codename>`. The other session runs",
104177
104277
  "`scout match <codename>`. Codenames match case-insensitively within one project,",
104178
- "expire after 10 minutes, and match exactly two live sessions. With --message,",
104278
+ "expire after 4 hours, and match exactly two live sessions. With --message,",
104179
104279
  "the creator sends one exact-session message only after the broker confirms the match.",
104180
104280
  "",
104181
104281
  "Examples:",
@@ -104428,7 +104528,7 @@ function renderMatchResponse(response) {
104428
104528
  return `No active match ${response.codename} exists in ${projectName2}. Check the codename or create it with scout match new ${response.codename}.`;
104429
104529
  }
104430
104530
  if (response.status === "expired") {
104431
- return `Match ${response.codename} expired in ${projectName2}. Choose another codename.`;
104531
+ return `Match ${response.codename} expired in ${projectName2}. Recreate it with scout match new ${response.codename}.`;
104432
104532
  }
104433
104533
  if (response.status === "consumed") {
104434
104534
  return `Match ${response.codename} was already used in ${projectName2}. Choose another codename.`;
@@ -107772,7 +107872,7 @@ var init_service6 = __esm(() => {
107772
107872
  });
107773
107873
 
107774
107874
  // ../../apps/desktop/src/core/mcp/scout-mcp.ts
107775
- import { readFileSync as readFileSync17 } from "fs";
107875
+ import { readFileSync as readFileSync18 } from "fs";
107776
107876
  import { basename as basename17, resolve as resolve28 } from "path";
107777
107877
  function normalizeSearchableAgentState(state, fallback2) {
107778
107878
  if (!state || state === "registered") {
@@ -107832,7 +107932,7 @@ function parseScoutReplyContextFromEnv(env) {
107832
107932
  const contextFile = env.OPENSCOUT_REPLY_CONTEXT_FILE?.trim();
107833
107933
  if (contextFile) {
107834
107934
  try {
107835
- const rawFileJson = readFileSync17(contextFile, "utf8").trim();
107935
+ const rawFileJson = readFileSync18(contextFile, "utf8").trim();
107836
107936
  if (rawFileJson) {
107837
107937
  const parsed = JSON.parse(rawFileJson);
107838
107938
  if (isScoutReplyContext(parsed)) {
@@ -108221,7 +108321,17 @@ function sendScoutReplyNotification(server, params) {
108221
108321
  function scheduleScoutReplyNotification(input) {
108222
108322
  (async () => {
108223
108323
  try {
108224
- const completedFlight = await input.deps.waitForFlight(input.brokerUrl, input.flight.id);
108324
+ let completedFlight;
108325
+ for (let attempt = 0;; attempt += 1) {
108326
+ try {
108327
+ completedFlight = await input.deps.waitForFlight(input.brokerUrl, input.flight.id);
108328
+ break;
108329
+ } catch (error48) {
108330
+ if (attempt >= 2)
108331
+ throw error48;
108332
+ await new Promise((resolve29) => setTimeout(resolve29, 2000));
108333
+ }
108334
+ }
108225
108335
  await sendScoutReplyNotification(input.server, {
108226
108336
  ...input.context,
108227
108337
  status: "completed",
@@ -108508,15 +108618,14 @@ function buildIdentityCandidate(entry) {
108508
108618
  aliases
108509
108619
  };
108510
108620
  }
108511
- function decorateAgentLabels(entries) {
108621
+ function buildAgentCandidateDirectory(entries) {
108512
108622
  const identityCandidates = entries.map((entry) => buildIdentityCandidate(entry));
108513
- return entries.map((entry) => {
108514
- const identityCandidate = buildIdentityCandidate(entry);
108515
- const label = formatMinimalAgentIdentity(identityCandidate, identityCandidates);
108623
+ const identityByCandidate = new Map;
108624
+ const candidates = entries.map((entry, index2) => {
108516
108625
  const defaultLabel = entry.defaultSelector ? `@${entry.defaultSelector}` : null;
108517
- return {
108626
+ const candidate = {
108518
108627
  agentId: entry.agentId,
108519
- label,
108628
+ label: defaultLabel ?? `@${entry.agentId}`,
108520
108629
  defaultLabel,
108521
108630
  displayName: entry.displayName,
108522
108631
  handle: entry.handle,
@@ -108533,7 +108642,22 @@ function decorateAgentLabels(entries) {
108533
108642
  transport: entry.transport,
108534
108643
  sessionId: entry.sessionId
108535
108644
  };
108645
+ identityByCandidate.set(candidate, identityCandidates[index2]);
108646
+ return candidate;
108536
108647
  });
108648
+ return { candidates, identityCandidates, identityByCandidate };
108649
+ }
108650
+ function withMinimalLabel(candidate, directory) {
108651
+ const identity2 = directory.identityByCandidate.get(candidate);
108652
+ if (!identity2)
108653
+ return candidate;
108654
+ return {
108655
+ ...candidate,
108656
+ label: formatMinimalAgentIdentity(identity2, directory.identityCandidates)
108657
+ };
108658
+ }
108659
+ function withMinimalLabels(candidates, directory) {
108660
+ return candidates.map((candidate, index2) => index2 < MAX_DECORATED_CANDIDATES ? withMinimalLabel(candidate, directory) : candidate);
108537
108661
  }
108538
108662
  function isOpenScoutNamedCandidate(candidate) {
108539
108663
  const agentIdHead = normalizeSearchValue(candidate.agentId).split(".")[0] ?? "";
@@ -108713,11 +108837,24 @@ async function loadScoutAgentDirectory(currentDirectory) {
108713
108837
  });
108714
108838
  }
108715
108839
  async function searchScoutAgentsForMcp(input) {
108716
- const candidates = decorateAgentLabels(await loadScoutAgentDirectory(input.currentDirectory));
108840
+ const debugTiming = process.env.OPENSCOUT_MCP_DEBUG_TIMING === "1";
108841
+ let mark = performance.now();
108842
+ const lap = (label) => {
108843
+ if (!debugTiming)
108844
+ return;
108845
+ console.error(`searchScoutAgentsForMcp ${label} ${Math.round(performance.now() - mark)}ms`);
108846
+ mark = performance.now();
108847
+ };
108848
+ const entries = await loadScoutAgentDirectory(input.currentDirectory);
108849
+ lap("load");
108850
+ const directory = buildAgentCandidateDirectory(entries);
108851
+ const candidates = directory.candidates;
108852
+ lap("candidates");
108717
108853
  const normalizedQuery = normalizeSearchValue(input.query);
108718
108854
  const currentProjectRoot = await findNearestProjectRoot(input.currentDirectory) ?? input.currentDirectory;
108855
+ lap("projectRoot");
108719
108856
  const limit = Math.max(1, Math.min(input.limit ?? 10, 50));
108720
- return candidates.map((candidate) => ({
108857
+ const result = candidates.map((candidate) => ({
108721
108858
  candidate,
108722
108859
  score: scoreAgentCandidate(candidate, normalizedQuery) + Math.max(0, scoreProjectLocalCandidate(candidate, currentProjectRoot, normalizedQuery))
108723
108860
  })).filter((entry) => normalizedQuery.length === 0 || entry.score >= 0).sort((left, right) => {
@@ -108728,7 +108865,9 @@ async function searchScoutAgentsForMcp(input) {
108728
108865
  if (stateDelta !== 0)
108729
108866
  return stateDelta;
108730
108867
  return left.candidate.displayName.localeCompare(right.candidate.displayName);
108731
- }).slice(0, limit).map((entry) => entry.candidate);
108868
+ }).slice(0, limit).map((entry) => withMinimalLabel(entry.candidate, directory));
108869
+ lap("score+sort+decorate");
108870
+ return result;
108732
108871
  }
108733
108872
  async function resolveScoutAgentForMcp(input) {
108734
108873
  const rawLabel = input.label.trim();
@@ -108736,43 +108875,51 @@ async function resolveScoutAgentForMcp(input) {
108736
108875
  return { kind: "unresolved", candidate: null, candidates: [] };
108737
108876
  }
108738
108877
  const entries = await loadScoutAgentDirectory(input.currentDirectory);
108739
- const candidates = decorateAgentLabels(entries);
108878
+ const directory = buildAgentCandidateDirectory(entries);
108879
+ const candidates = directory.candidates;
108740
108880
  const exactMatches = candidates.filter((candidate) => exactCandidateMatches(candidate, rawLabel));
108741
108881
  if (["scout", "openscout"].includes(normalizeSearchValue(rawLabel))) {
108742
108882
  const preferredStableScoutCandidate = findPreferredStableScoutCandidate(candidates);
108743
108883
  if (preferredStableScoutCandidate) {
108744
108884
  return {
108745
108885
  kind: "resolved",
108746
- candidate: preferredStableScoutCandidate,
108886
+ candidate: withMinimalLabel(preferredStableScoutCandidate, directory),
108747
108887
  candidates: []
108748
108888
  };
108749
108889
  }
108750
108890
  }
108751
108891
  if (exactMatches.length === 1) {
108752
- return { kind: "resolved", candidate: exactMatches[0], candidates: [] };
108892
+ return {
108893
+ kind: "resolved",
108894
+ candidate: withMinimalLabel(exactMatches[0], directory),
108895
+ candidates: []
108896
+ };
108753
108897
  }
108754
108898
  const preferredProjectLocalCandidate = await findPreferredProjectLocalCandidate(candidates, rawLabel, input.currentDirectory);
108755
108899
  if (preferredProjectLocalCandidate) {
108756
108900
  return {
108757
108901
  kind: "resolved",
108758
- candidate: preferredProjectLocalCandidate,
108902
+ candidate: withMinimalLabel(preferredProjectLocalCandidate, directory),
108759
108903
  candidates: []
108760
108904
  };
108761
108905
  }
108762
108906
  if (exactMatches.length > 1) {
108763
- return { kind: "ambiguous", candidate: null, candidates: exactMatches };
108907
+ return {
108908
+ kind: "ambiguous",
108909
+ candidate: null,
108910
+ candidates: withMinimalLabels(exactMatches, directory)
108911
+ };
108764
108912
  }
108765
108913
  const selector = parseAgentIdentity(rawLabel.startsWith("@") ? rawLabel : `@${rawLabel}`);
108766
108914
  if (!selector) {
108767
108915
  return { kind: "unresolved", candidate: null, candidates: [] };
108768
108916
  }
108769
- const identityCandidates = entries.map((entry) => buildIdentityCandidate(entry));
108770
- const diagnosis = diagnoseAgentIdentity(selector, identityCandidates);
108917
+ const diagnosis = diagnoseAgentIdentity(selector, directory.identityCandidates);
108771
108918
  if (diagnosis.kind === "resolved") {
108772
108919
  const match = candidates.find((candidate) => candidate.agentId === diagnosis.match.agentId) ?? null;
108773
108920
  return {
108774
108921
  kind: match ? "resolved" : "unresolved",
108775
- candidate: match,
108922
+ candidate: match ? withMinimalLabel(match, directory) : null,
108776
108923
  candidates: []
108777
108924
  };
108778
108925
  }
@@ -108782,11 +108929,15 @@ async function resolveScoutAgentForMcp(input) {
108782
108929
  if (preferredAmbiguousCandidate) {
108783
108930
  return {
108784
108931
  kind: "resolved",
108785
- candidate: preferredAmbiguousCandidate,
108932
+ candidate: withMinimalLabel(preferredAmbiguousCandidate, directory),
108786
108933
  candidates: []
108787
108934
  };
108788
108935
  }
108789
- return { kind: "ambiguous", candidate: null, candidates: ambiguous };
108936
+ return {
108937
+ kind: "ambiguous",
108938
+ candidate: null,
108939
+ candidates: withMinimalLabels(ambiguous, directory)
108940
+ };
108790
108941
  }
108791
108942
  return { kind: "unresolved", candidate: null, candidates: [] };
108792
108943
  }
@@ -109019,6 +109170,15 @@ function createScoutMcpServer(options) {
109019
109170
  name: "openscout",
109020
109171
  version: SCOUT_APP_VERSION
109021
109172
  });
109173
+ const toolFilter = options.toolFilter;
109174
+ if (toolFilter) {
109175
+ const registerTool = server.registerTool.bind(server);
109176
+ server.registerTool = (name2, ...rest) => {
109177
+ if (!toolFilter(name2))
109178
+ return;
109179
+ return registerTool(name2, ...rest);
109180
+ };
109181
+ }
109022
109182
  const aliasBrokerRequest = async (path, init) => {
109023
109183
  const response = await fetch(new URL(path, deps.resolveBrokerUrl()), {
109024
109184
  ...init,
@@ -109929,44 +110089,42 @@ function createScoutMcpServer(options) {
109929
110089
  } catch {}
109930
110090
  } else if (resolvedReplyMode === "notify" && replyNotificationsEnabled && structuredContent.ids.flightId) {
109931
110091
  const flight = await deps.getFlight(deps.resolveBrokerUrl(), structuredContent.ids.flightId).catch(() => null);
109932
- if (flight) {
109933
- const followArtifacts = buildScoutFollowArtifacts({
109934
- flight,
110092
+ const followArtifacts = buildScoutFollowArtifacts({
110093
+ flight,
110094
+ conversationId: structuredContent.ids.conversationId ?? null,
110095
+ workItem: null,
110096
+ targetAgentId: structuredContent.ids.targetAgentId ?? flight?.targetAgentId ?? null
110097
+ }, env);
110098
+ scheduleScoutReplyNotification({
110099
+ server,
110100
+ deps,
110101
+ brokerUrl: deps.resolveBrokerUrl(),
110102
+ flight: flight ?? { id: structuredContent.ids.flightId },
110103
+ context: {
110104
+ currentDirectory: resolvedCurrentDirectory,
110105
+ senderId: resolvedSenderId,
110106
+ targetAgentId: structuredContent.ids.targetAgentId ?? flight?.targetAgentId ?? null,
110107
+ targetLabel: targetTo ?? targetProjectPath ?? null,
109935
110108
  conversationId: structuredContent.ids.conversationId ?? null,
110109
+ messageId: structuredContent.ids.messageId ?? null,
110110
+ bindingRef: structuredContent.ids.bindingRef ? `ref:${structuredContent.ids.bindingRef}` : null,
110111
+ flightId: structuredContent.ids.flightId,
109936
110112
  workItem: null,
109937
- targetAgentId: structuredContent.ids.targetAgentId ?? flight.targetAgentId ?? null
109938
- }, env);
109939
- scheduleScoutReplyNotification({
109940
- server,
109941
- deps,
109942
- brokerUrl: deps.resolveBrokerUrl(),
109943
- flight,
109944
- context: {
109945
- currentDirectory: resolvedCurrentDirectory,
109946
- senderId: resolvedSenderId,
109947
- targetAgentId: structuredContent.ids.targetAgentId ?? flight.targetAgentId ?? null,
109948
- targetLabel: targetTo ?? targetProjectPath ?? null,
109949
- conversationId: structuredContent.ids.conversationId ?? null,
109950
- messageId: structuredContent.ids.messageId ?? null,
109951
- bindingRef: structuredContent.ids.bindingRef ? `ref:${structuredContent.ids.bindingRef}` : null,
109952
- flightId: flight.id,
109953
- workItem: null,
109954
- workId: structuredContent.ids.workId ?? null,
109955
- workUrl: null,
109956
- ids: followArtifacts.ids,
109957
- links: followArtifacts.links,
109958
- followUrl: followArtifacts.followUrl
109959
- }
109960
- });
109961
- structuredContent = {
109962
- ...structuredContent,
109963
- delivery: "mcp_notification",
109964
- notification: {
109965
- method: "notifications/scout/reply",
109966
- status: "scheduled"
109967
- }
109968
- };
109969
- }
110113
+ workId: structuredContent.ids.workId ?? null,
110114
+ workUrl: null,
110115
+ ids: followArtifacts.ids,
110116
+ links: followArtifacts.links,
110117
+ followUrl: followArtifacts.followUrl
110118
+ }
110119
+ });
110120
+ structuredContent = {
110121
+ ...structuredContent,
110122
+ delivery: "mcp_notification",
110123
+ notification: {
110124
+ method: "notifications/scout/reply",
110125
+ status: "scheduled"
110126
+ }
110127
+ };
109970
110128
  }
109971
110129
  if (structuredContent.ok && !structuredContent.delivery) {
109972
110130
  structuredContent = {
@@ -110970,7 +111128,7 @@ async function runScoutMcpServer(options) {
110970
111128
  await server.connect(transport);
110971
111129
  await waitForStdioServerClosure({ server, transport });
110972
111130
  }
110973
- var AGENT_STATE_VALUES, REGISTRATION_KIND_VALUES, RESOLVE_KIND_VALUES, MESSAGE_ROUTE_KIND_VALUES, MESSAGE_ROUTING_ERROR_VALUES, REPLY_MODE_VALUES, REPLY_DELIVERY_VALUES, LOCAL_AGENT_HARNESS_VALUES, TAIL_EVENT_KIND_VALUES, DEFAULT_ASK_ACK_TIMEOUT_SECONDS2 = 30, SCOUT_MCP_UI_META_KEY = "openscout/ui", scoutAgentNameInputSchema, scoutAgentToolIconMeta, scoutAgentAvatarMeta, targetLabelInputSchema, targetAgentIdInputSchema, targetSessionIdInputSchema, projectPathInputSchema, mentionAgentIdsInputSchema, attachmentsInputSchema, flightSchema, invocationLifecycleSchema, labelBriefFlightSchema, labelBriefWorkItemSchema, labelBriefSchema, labelFeedEventSchema, labelFeedSchema, trackedWorkItemSchema, workItemInputSchema, waitingOnSchema, progressSchema, workItemUpdateSchema, agentCandidateSchema, scoutReturnAddressSchema, scoutAgentCardLifecycleSchema, scoutAgentCardSchema, localAgentStatusSchema, whoAmISchema, brokerMessageSchema, messagesInboxResultSchema, messagesChannelResultSchema, brokerFeedRecordSchema, brokerFeedItemSchema, brokerFeedSchema, tailEventSchema, tailEventsResultSchema, searchResultSchema, resolveResultSchema, startSuggestionSchema, followIdsSchema, followLinksSchema, sendRoutingAdviceSchema, sendResultSchema, operatorSignalResultSchema, nonBlankToolStringSchema, replyContextSchema, currentReplyContextResultSchema, replyResultSchema, cardCreateResultSchema, agentStartResultSchema, currentSessionAttachResultSchema, askResultSchema, askReceiptSchema, invocationLookupResultSchema, workUpdateResultSchema;
111131
+ var AGENT_STATE_VALUES, REGISTRATION_KIND_VALUES, RESOLVE_KIND_VALUES, MESSAGE_ROUTE_KIND_VALUES, MESSAGE_ROUTING_ERROR_VALUES, REPLY_MODE_VALUES, REPLY_DELIVERY_VALUES, LOCAL_AGENT_HARNESS_VALUES, TAIL_EVENT_KIND_VALUES, DEFAULT_ASK_ACK_TIMEOUT_SECONDS2 = 30, SCOUT_MCP_UI_META_KEY = "openscout/ui", scoutAgentNameInputSchema, scoutAgentToolIconMeta, scoutAgentAvatarMeta, targetLabelInputSchema, targetAgentIdInputSchema, targetSessionIdInputSchema, projectPathInputSchema, mentionAgentIdsInputSchema, attachmentsInputSchema, flightSchema, invocationLifecycleSchema, labelBriefFlightSchema, labelBriefWorkItemSchema, labelBriefSchema, labelFeedEventSchema, labelFeedSchema, trackedWorkItemSchema, workItemInputSchema, waitingOnSchema, progressSchema, workItemUpdateSchema, agentCandidateSchema, scoutReturnAddressSchema, scoutAgentCardLifecycleSchema, scoutAgentCardSchema, localAgentStatusSchema, whoAmISchema, brokerMessageSchema, messagesInboxResultSchema, messagesChannelResultSchema, brokerFeedRecordSchema, brokerFeedItemSchema, brokerFeedSchema, tailEventSchema, tailEventsResultSchema, searchResultSchema, resolveResultSchema, startSuggestionSchema, followIdsSchema, followLinksSchema, sendRoutingAdviceSchema, sendResultSchema, operatorSignalResultSchema, nonBlankToolStringSchema, replyContextSchema, currentReplyContextResultSchema, replyResultSchema, cardCreateResultSchema, agentStartResultSchema, currentSessionAttachResultSchema, askResultSchema, askReceiptSchema, invocationLookupResultSchema, workUpdateResultSchema, MAX_DECORATED_CANDIDATES = 50;
110974
111132
  var init_scout_mcp = __esm(() => {
110975
111133
  init_mcp();
110976
111134
  init_stdio2();
@@ -112731,7 +112889,7 @@ async function runMeshPing(target2) {
112731
112889
  try {
112732
112890
  const controller = new AbortController;
112733
112891
  const timeout = setTimeout(() => controller.abort(), 3000);
112734
- const response = await fetch(new URL("/v1/node", probeUrl), {
112892
+ const response = await meshPeerFetch(probeUrl, "/v1/node", {
112735
112893
  signal: controller.signal,
112736
112894
  headers: { accept: "application/json" }
112737
112895
  });
@@ -112783,6 +112941,7 @@ async function loadMeshNodes() {
112783
112941
  };
112784
112942
  }
112785
112943
  var init_service7 = __esm(() => {
112944
+ init_src3();
112786
112945
  init_system_probes();
112787
112946
  init_service3();
112788
112947
  init_trust_service();
@@ -113107,7 +113266,7 @@ function renderMeshNodes(input) {
113107
113266
  var init_mesh = () => {};
113108
113267
 
113109
113268
  // ../../apps/desktop/src/core/mesh/enroll-pending.ts
113110
- import { existsSync as existsSync42, mkdirSync as mkdirSync12, readFileSync as readFileSync18, rmSync as rmSync6, writeFileSync as writeFileSync10 } from "fs";
113269
+ import { existsSync as existsSync42, mkdirSync as mkdirSync12, readFileSync as readFileSync19, rmSync as rmSync6, writeFileSync as writeFileSync10 } from "fs";
113111
113270
  import { dirname as dirname29, join as join51 } from "path";
113112
113271
  function pendingMeshEnrollmentPath(supportDirectory) {
113113
113272
  const dir = supportDirectory ?? resolveOpenScoutSupportPaths().supportDirectory;
@@ -113129,7 +113288,7 @@ function loadPendingMeshEnrollment(supportDirectory) {
113129
113288
  }
113130
113289
  let parsed;
113131
113290
  try {
113132
- parsed = JSON.parse(readFileSync18(path, "utf8"));
113291
+ parsed = JSON.parse(readFileSync19(path, "utf8"));
113133
113292
  } catch {
113134
113293
  throw new Error(`Corrupt pending mesh enrollment at ${path}; remove it and start over.`);
113135
113294
  }
@@ -113151,7 +113310,7 @@ var init_enroll_pending = __esm(() => {
113151
113310
 
113152
113311
  // ../../apps/desktop/src/cli/commands/mesh-trust.ts
113153
113312
  import { createInterface as createInterface3 } from "readline";
113154
- import { readFileSync as readFileSync19 } from "fs";
113313
+ import { readFileSync as readFileSync20 } from "fs";
113155
113314
  function normalizeMeshKeyIdInput(value) {
113156
113315
  const trimmed = value.trim().toLowerCase();
113157
113316
  if (!KEY_ID_PATTERN.test(trimmed)) {
@@ -113497,9 +113656,9 @@ function parseMeshTrustInstallGrantArgs(args) {
113497
113656
  }
113498
113657
  function readCardSource(source) {
113499
113658
  if (source === "-") {
113500
- return readFileSync19(0, "utf8");
113659
+ return readFileSync20(0, "utf8");
113501
113660
  }
113502
- return readFileSync19(source, "utf8");
113661
+ return readFileSync20(source, "utf8");
113503
113662
  }
113504
113663
  function parseCardPayload(text3) {
113505
113664
  const trimmed = text3.trim();
@@ -113575,6 +113734,551 @@ var init_mesh_trust = __esm(() => {
113575
113734
  FINGERPRINT_PATTERN = /^osc1:[0-9a-z]{4}-[0-9a-z]{4}$/;
113576
113735
  });
113577
113736
 
113737
+ // ../../apps/desktop/src/core/mcp/mesh-bridge.ts
113738
+ function parseBridgeBoundEnvelope(data) {
113739
+ if (typeof data !== "string")
113740
+ return null;
113741
+ try {
113742
+ const parsed = JSON.parse(data);
113743
+ if (parsed.v !== 1 || typeof parsed.id !== "string")
113744
+ return null;
113745
+ if (parsed.kind !== "mcp_request" && parsed.kind !== "mcp_cancel")
113746
+ return null;
113747
+ return {
113748
+ v: 1,
113749
+ kind: parsed.kind,
113750
+ id: parsed.id,
113751
+ agent: typeof parsed.agent === "string" ? parsed.agent : undefined,
113752
+ payload: typeof parsed.payload === "string" ? parsed.payload : undefined
113753
+ };
113754
+ } catch {
113755
+ return null;
113756
+ }
113757
+ }
113758
+
113759
+ class MeshRelayServerTransport {
113760
+ onclose;
113761
+ onerror;
113762
+ onmessage;
113763
+ emitEnvelope = () => {};
113764
+ envelopeIdByRequestId = new Map;
113765
+ bindEmitter(emit) {
113766
+ this.emitEnvelope = emit;
113767
+ }
113768
+ async start() {}
113769
+ deliver(envelope) {
113770
+ if (envelope.kind === "mcp_cancel") {
113771
+ for (const [requestId, envelopeId] of this.envelopeIdByRequestId) {
113772
+ if (envelopeId === envelope.id) {
113773
+ this.envelopeIdByRequestId.delete(requestId);
113774
+ }
113775
+ }
113776
+ return;
113777
+ }
113778
+ if (!envelope.payload) {
113779
+ this.emitEnvelope({ v: 1, kind: "mcp_error", id: envelope.id, status: 400, message: "empty payload" });
113780
+ return;
113781
+ }
113782
+ let message;
113783
+ try {
113784
+ message = JSON.parse(envelope.payload);
113785
+ } catch {
113786
+ this.emitEnvelope({ v: 1, kind: "mcp_error", id: envelope.id, status: 400, message: "invalid JSON-RPC payload" });
113787
+ return;
113788
+ }
113789
+ const record4 = message;
113790
+ const isRequest2 = record4.method !== undefined && record4.id !== undefined;
113791
+ if (isRequest2 && record4.id !== undefined) {
113792
+ this.envelopeIdByRequestId.set(record4.id, envelope.id);
113793
+ } else {
113794
+ this.emitEnvelope({ v: 1, kind: "mcp_accepted", id: envelope.id });
113795
+ }
113796
+ try {
113797
+ this.onmessage?.(message);
113798
+ } catch (error48) {
113799
+ if (isRequest2 && record4.id !== undefined) {
113800
+ this.envelopeIdByRequestId.delete(record4.id);
113801
+ }
113802
+ this.emitEnvelope({
113803
+ v: 1,
113804
+ kind: "mcp_error",
113805
+ id: envelope.id,
113806
+ status: 500,
113807
+ message: error48 instanceof Error ? error48.message : "handler failure"
113808
+ });
113809
+ }
113810
+ }
113811
+ async send(message) {
113812
+ const record4 = message;
113813
+ if (record4.id === undefined) {
113814
+ this.emitEnvelope({
113815
+ v: 1,
113816
+ kind: "mcp_notify",
113817
+ id: crypto.randomUUID(),
113818
+ payload: JSON.stringify(message)
113819
+ });
113820
+ return;
113821
+ }
113822
+ const envelopeId = this.envelopeIdByRequestId.get(record4.id);
113823
+ if (!envelopeId) {
113824
+ if (record4.method !== undefined) {
113825
+ this.onerror?.(new Error(`mesh bridge cannot deliver server-initiated request ${String(record4.method)}`));
113826
+ }
113827
+ return;
113828
+ }
113829
+ this.envelopeIdByRequestId.delete(record4.id);
113830
+ this.emitEnvelope({
113831
+ v: 1,
113832
+ kind: "mcp_response",
113833
+ id: envelopeId,
113834
+ payload: JSON.stringify(message)
113835
+ });
113836
+ }
113837
+ async close() {
113838
+ this.envelopeIdByRequestId.clear();
113839
+ this.onclose?.();
113840
+ }
113841
+ }
113842
+ function readKeychainSecret(service3) {
113843
+ const result = Bun.spawnSync(["security", "find-generic-password", "-s", service3, "-w"]);
113844
+ if (result.exitCode !== 0)
113845
+ return null;
113846
+ const value = result.stdout.toString().trim();
113847
+ return value || null;
113848
+ }
113849
+ function resolveBridgeTokenFromConfig(config2) {
113850
+ if (config2.token?.trim())
113851
+ return config2.token.trim();
113852
+ if (config2.tokenKeychainService?.trim()) {
113853
+ return readKeychainSecret(config2.tokenKeychainService.trim());
113854
+ }
113855
+ return null;
113856
+ }
113857
+ function resolveBridgeWebSocketUrl(relayUrl, token) {
113858
+ const url2 = new URL(relayUrl);
113859
+ if (url2.protocol === "https:")
113860
+ url2.protocol = "wss:";
113861
+ if (url2.protocol === "http:")
113862
+ url2.protocol = "ws:";
113863
+ if (!url2.pathname.endsWith("/bridge")) {
113864
+ url2.pathname = `${url2.pathname.replace(/\/$/, "")}/bridge`;
113865
+ }
113866
+ if (!url2.searchParams.get("access_token")) {
113867
+ url2.searchParams.set("access_token", token);
113868
+ }
113869
+ return url2.toString();
113870
+ }
113871
+ async function startScoutMeshMcpBridge(options) {
113872
+ const log = options.log ?? (() => {});
113873
+ const allowedTools = new Set(options.toolNames);
113874
+ let socket = null;
113875
+ let closed = false;
113876
+ let reconnectTimer = null;
113877
+ let attempt = 0;
113878
+ const sendRaw = (envelope) => {
113879
+ if (socket && socket.readyState === WebSocket.OPEN) {
113880
+ socket.send(JSON.stringify(envelope));
113881
+ } else {
113882
+ log(`bridge: dropped ${envelope.kind} for ${envelope.id} (socket not open)`);
113883
+ }
113884
+ };
113885
+ const instances = new Map;
113886
+ const getOrCreateInstance = async (agent) => {
113887
+ const existing = instances.get(agent);
113888
+ if (existing)
113889
+ return existing;
113890
+ if (instances.size >= MAX_IDENTITY_INSTANCES) {
113891
+ return null;
113892
+ }
113893
+ const transport = new MeshRelayServerTransport;
113894
+ transport.bindEmitter((envelope) => {
113895
+ sendRaw(envelope.kind === "mcp_notify" ? { ...envelope, agent } : envelope);
113896
+ });
113897
+ const server = createScoutMcpServer({
113898
+ defaultCurrentDirectory: options.currentDirectory,
113899
+ env: {
113900
+ ...options.env ?? process.env,
113901
+ OPENSCOUT_MCP_ENABLE_NOTIFICATIONS: "1"
113902
+ },
113903
+ dependencies: {
113904
+ resolveSenderId: async () => agent
113905
+ },
113906
+ toolFilter: (name2) => allowedTools.has(name2)
113907
+ });
113908
+ await server.connect(transport);
113909
+ const instance2 = { server, transport };
113910
+ instances.set(agent, instance2);
113911
+ log(`bridge: serving identity ${agent} (${instances.size} active)`);
113912
+ return instance2;
113913
+ };
113914
+ const wsUrl = resolveBridgeWebSocketUrl(options.relayUrl, options.token);
113915
+ const scheduleReconnect = () => {
113916
+ const delay7 = Math.min(RECONNECT_MAX_DELAY_MS, 1000 * 2 ** attempt) + Math.floor(Math.random() * 500);
113917
+ attempt += 1;
113918
+ reconnectTimer = setTimeout(connect, delay7);
113919
+ return delay7;
113920
+ };
113921
+ const connect = () => {
113922
+ if (closed)
113923
+ return;
113924
+ const ws = new WebSocket(wsUrl, {
113925
+ headers: { authorization: `Bearer ${options.token}` }
113926
+ });
113927
+ socket = ws;
113928
+ let lastFrameAt = Date.now();
113929
+ let openedAt = Date.now();
113930
+ let abandoned = false;
113931
+ let pingCount = 0;
113932
+ const forceReconnect = (reason) => {
113933
+ if (closed || abandoned)
113934
+ return;
113935
+ abandoned = true;
113936
+ clearInterval(heartbeat);
113937
+ if (socket === ws)
113938
+ socket = null;
113939
+ try {
113940
+ ws.close(4002, "bridge reconnect");
113941
+ } catch {}
113942
+ const delay7 = scheduleReconnect();
113943
+ log(`bridge: ${reason}; reconnecting in ${Math.round(delay7 / 1000)}s`);
113944
+ };
113945
+ const heartbeat = setInterval(() => {
113946
+ if (closed || abandoned || socket !== ws) {
113947
+ clearInterval(heartbeat);
113948
+ return;
113949
+ }
113950
+ if (Date.now() - lastFrameAt > BRIDGE_STALE_MS) {
113951
+ forceReconnect(`relay silent for ${Math.round(BRIDGE_STALE_MS / 1000)}s`);
113952
+ return;
113953
+ }
113954
+ if (ws.readyState !== WebSocket.OPEN)
113955
+ return;
113956
+ ws.send('{"v":1,"kind":"bridge_ping","id":"hb"}');
113957
+ pingCount += 1;
113958
+ if (pingCount % 3 === 0 && Date.now() - openedAt > 45000) {
113959
+ fetch(`${new URL(options.relayUrl).origin}/healthz`, {
113960
+ headers: { authorization: `Bearer ${options.token}` }
113961
+ }).then(async (res) => {
113962
+ if (!res.ok || closed || abandoned || socket !== ws)
113963
+ return;
113964
+ const health = await res.json();
113965
+ if (health.bridgeConnected === false) {
113966
+ forceReconnect("relay no longer routes to this bridge socket");
113967
+ }
113968
+ }).catch(() => {});
113969
+ }
113970
+ }, BRIDGE_PING_INTERVAL_MS);
113971
+ ws.addEventListener("open", () => {
113972
+ attempt = 0;
113973
+ lastFrameAt = Date.now();
113974
+ openedAt = Date.now();
113975
+ log(`bridge: connected to relay (tools: ${options.toolNames.join(", ")}; fallback identity ${options.senderId})`);
113976
+ });
113977
+ ws.addEventListener("message", (event) => {
113978
+ lastFrameAt = Date.now();
113979
+ const envelope = parseBridgeBoundEnvelope(typeof event.data === "string" ? event.data : "");
113980
+ if (!envelope)
113981
+ return;
113982
+ const agent = envelope.agent?.trim() || options.senderId;
113983
+ getOrCreateInstance(agent).then((instance2) => {
113984
+ if (!instance2) {
113985
+ if (envelope.kind === "mcp_request") {
113986
+ sendRaw({
113987
+ v: 1,
113988
+ kind: "mcp_error",
113989
+ id: envelope.id,
113990
+ status: 503,
113991
+ message: "bridge identity capacity reached"
113992
+ });
113993
+ }
113994
+ return;
113995
+ }
113996
+ instance2.transport.deliver(envelope);
113997
+ }).catch((error48) => {
113998
+ if (envelope.kind === "mcp_request") {
113999
+ sendRaw({
114000
+ v: 1,
114001
+ kind: "mcp_error",
114002
+ id: envelope.id,
114003
+ status: 500,
114004
+ message: error48 instanceof Error ? error48.message : "instance failure"
114005
+ });
114006
+ }
114007
+ });
114008
+ });
114009
+ ws.addEventListener("close", (event) => {
114010
+ clearInterval(heartbeat);
114011
+ if (abandoned || socket !== ws)
114012
+ return;
114013
+ socket = null;
114014
+ if (closed)
114015
+ return;
114016
+ const delay7 = scheduleReconnect();
114017
+ log(`bridge: relay connection closed (${event.code}); reconnecting in ${Math.round(delay7 / 1000)}s`);
114018
+ });
114019
+ ws.addEventListener("error", () => {});
114020
+ };
114021
+ connect();
114022
+ return {
114023
+ close: async () => {
114024
+ closed = true;
114025
+ if (reconnectTimer)
114026
+ clearTimeout(reconnectTimer);
114027
+ socket?.close(1000, "bridge shutting down");
114028
+ socket = null;
114029
+ for (const [, instance2] of instances) {
114030
+ await instance2.server.close().catch(() => {});
114031
+ }
114032
+ instances.clear();
114033
+ }
114034
+ };
114035
+ }
114036
+ var SCOUT_MCP_CORE_TOOLS, RECONNECT_MAX_DELAY_MS = 30000, MAX_IDENTITY_INSTANCES = 16, BRIDGE_PING_INTERVAL_MS = 20000, BRIDGE_STALE_MS = 60000;
114037
+ var init_mesh_bridge = __esm(() => {
114038
+ init_scout_mcp();
114039
+ SCOUT_MCP_CORE_TOOLS = [
114040
+ "whoami",
114041
+ "ask",
114042
+ "messages_send",
114043
+ "messages_reply",
114044
+ "messages_inbox",
114045
+ "messages_channel",
114046
+ "broker_feed",
114047
+ "tail_events",
114048
+ "work_update",
114049
+ "notify_operator",
114050
+ "consult_operator",
114051
+ "current_reply_context",
114052
+ "invocations_get",
114053
+ "invocations_wait",
114054
+ "labels_brief",
114055
+ "labels_feed",
114056
+ "agents_search",
114057
+ "agents_resolve"
114058
+ ];
114059
+ });
114060
+
114061
+ // ../../apps/desktop/src/cli/commands/mesh-bridge.ts
114062
+ var exports_mesh_bridge = {};
114063
+ __export(exports_mesh_bridge, {
114064
+ runMeshBridgeCommand: () => runMeshBridgeCommand
114065
+ });
114066
+ import { existsSync as existsSync43, mkdirSync as mkdirSync13, readFileSync as readFileSync21, unlinkSync, writeFileSync as writeFileSync11, chmodSync as chmodSync2 } from "fs";
114067
+ import { homedir as homedir33 } from "os";
114068
+ import { join as join52 } from "path";
114069
+ function supportDirectory() {
114070
+ return join52(homedir33(), "Library", "Application Support", "OpenScout");
114071
+ }
114072
+ function defaultConfigPath() {
114073
+ return join52(supportDirectory(), "mcp-bridge.json");
114074
+ }
114075
+ function launchAgentPlistPath2() {
114076
+ return join52(homedir33(), "Library", "LaunchAgents", `${LAUNCH_AGENT_LABEL}.plist`);
114077
+ }
114078
+ function readFlag(args, name2) {
114079
+ const index2 = args.indexOf(name2);
114080
+ if (index2 === -1)
114081
+ return;
114082
+ return args[index2 + 1]?.trim() || undefined;
114083
+ }
114084
+ function loadConfigFile(path) {
114085
+ if (!existsSync43(path))
114086
+ return null;
114087
+ return JSON.parse(readFileSync21(path, "utf8"));
114088
+ }
114089
+ function resolveRunOptions(context, args) {
114090
+ const configPath = readFlag(args, "--config") ?? defaultConfigPath();
114091
+ const fromFile = loadConfigFile(configPath) ?? { relayUrl: "https://mcp.oscout.net" };
114092
+ const config2 = {
114093
+ relayUrl: readFlag(args, "--relay") ?? fromFile.relayUrl ?? "https://mcp.oscout.net",
114094
+ token: readFlag(args, "--token") ?? fromFile.token,
114095
+ tokenKeychainService: readFlag(args, "--token-keychain") ?? fromFile.tokenKeychainService ?? (readFlag(args, "--token") || fromFile.token ? undefined : "OPENSCOUT_MCP_BRIDGE_TOKEN"),
114096
+ sender: readFlag(args, "--sender") ?? fromFile.sender ?? "grokbot.spike",
114097
+ node: readFlag(args, "--node") ?? fromFile.node ?? "default",
114098
+ tools: (() => {
114099
+ const flag = readFlag(args, "--tools");
114100
+ if (!flag)
114101
+ return fromFile.tools ?? "core";
114102
+ return flag === "core" ? "core" : flag.split(",").map((name2) => name2.trim()).filter(Boolean);
114103
+ })(),
114104
+ dir: readFlag(args, "--dir") ?? fromFile.dir
114105
+ };
114106
+ if (!config2.relayUrl) {
114107
+ return { error: "Missing relay URL: pass --relay or set relayUrl in the config file." };
114108
+ }
114109
+ return { config: config2, configPath };
114110
+ }
114111
+ async function runBridge(context, args) {
114112
+ const resolved = resolveRunOptions(context, args);
114113
+ if ("error" in resolved) {
114114
+ context.stderr(resolved.error);
114115
+ process.exitCode = 1;
114116
+ return;
114117
+ }
114118
+ const { config: config2 } = resolved;
114119
+ const token = resolveBridgeTokenFromConfig(config2) ?? context.env.OPENSCOUT_MCP_RELAY_TOKEN?.trim() ?? context.env.OPENSCOUT_MESH_RENDEZVOUS_TOKEN?.trim();
114120
+ if (!token) {
114121
+ context.stderr("No relay token found (flag, config, keychain, or env). See: scout mesh bridge --help");
114122
+ process.exitCode = 1;
114123
+ return;
114124
+ }
114125
+ const relayUrl = new URL(config2.relayUrl);
114126
+ if (config2.node && !relayUrl.searchParams.get("node")) {
114127
+ relayUrl.searchParams.set("node", config2.node);
114128
+ }
114129
+ const toolNames = config2.tools === "core" || !config2.tools ? [...SCOUT_MCP_CORE_TOOLS] : config2.tools;
114130
+ const handle = await startScoutMeshMcpBridge({
114131
+ relayUrl: relayUrl.toString(),
114132
+ token,
114133
+ senderId: config2.sender ?? "grokbot.spike",
114134
+ currentDirectory: config2.dir ?? defaultScoutContextDirectory(context),
114135
+ toolNames,
114136
+ env: context.env,
114137
+ log: (line) => context.stderr(line)
114138
+ });
114139
+ context.stderr(`bridge: node=${config2.node} relay=${config2.relayUrl}`);
114140
+ context.stderr("bridge: running \u2014 Ctrl-C to stop");
114141
+ await new Promise((resolve31) => {
114142
+ const stop2 = () => {
114143
+ const force = setTimeout(() => process.exit(0), 5000);
114144
+ handle.close().finally(() => {
114145
+ clearTimeout(force);
114146
+ resolve31();
114147
+ });
114148
+ };
114149
+ process.once("SIGINT", stop2);
114150
+ process.once("SIGTERM", stop2);
114151
+ });
114152
+ process.exit(process.exitCode ?? 0);
114153
+ }
114154
+ function launchctl(context, args) {
114155
+ const result = Bun.spawnSync(["launchctl", ...args]);
114156
+ const output = `${result.stdout.toString()}${result.stderr.toString()}`.trim();
114157
+ return { ok: result.exitCode === 0, output };
114158
+ }
114159
+ async function installBridge(context, args) {
114160
+ const resolved = resolveRunOptions(context, args);
114161
+ if ("error" in resolved) {
114162
+ context.stderr(resolved.error);
114163
+ process.exitCode = 1;
114164
+ return;
114165
+ }
114166
+ const { config: config2, configPath } = resolved;
114167
+ if (!resolveBridgeTokenFromConfig(config2)) {
114168
+ context.stderr(`No token reachable at install time (keychain service: ${config2.tokenKeychainService ?? "none"}). ` + "Add it first: security add-generic-password -a openscout -s OPENSCOUT_MCP_BRIDGE_TOKEN -w <token>");
114169
+ process.exitCode = 1;
114170
+ return;
114171
+ }
114172
+ mkdirSync13(supportDirectory(), { recursive: true });
114173
+ writeFileSync11(configPath, `${JSON.stringify(config2, null, 2)}
114174
+ `);
114175
+ chmodSync2(configPath, 384);
114176
+ const logDirectory = join52(supportDirectory(), "logs");
114177
+ mkdirSync13(logDirectory, { recursive: true });
114178
+ const logPath = join52(logDirectory, "mcp-bridge.log");
114179
+ const entry = Bun.main;
114180
+ const plist = `<?xml version="1.0" encoding="UTF-8"?>
114181
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
114182
+ <plist version="1.0">
114183
+ <dict>
114184
+ <key>Label</key><string>${LAUNCH_AGENT_LABEL}</string>
114185
+ <key>ProgramArguments</key>
114186
+ <array>
114187
+ <string>${process.execPath}</string>
114188
+ <string>${entry}</string>
114189
+ <string>mesh</string>
114190
+ <string>bridge</string>
114191
+ <string>--config</string>
114192
+ <string>${configPath}</string>
114193
+ </array>
114194
+ <key>RunAtLoad</key><true/>
114195
+ <key>KeepAlive</key><true/>
114196
+ <key>StandardOutPath</key><string>${logPath}</string>
114197
+ <key>StandardErrorPath</key><string>${logPath}</string>
114198
+ </dict>
114199
+ </plist>
114200
+ `;
114201
+ writeFileSync11(launchAgentPlistPath2(), plist);
114202
+ const domain2 = `gui/${process.getuid?.() ?? 501}`;
114203
+ launchctl(context, ["bootout", `${domain2}/${LAUNCH_AGENT_LABEL}`]);
114204
+ const bootstrap = launchctl(context, ["bootstrap", domain2, launchAgentPlistPath2()]);
114205
+ if (!bootstrap.ok) {
114206
+ context.stderr(`launchctl bootstrap failed: ${bootstrap.output}`);
114207
+ process.exitCode = 1;
114208
+ return;
114209
+ }
114210
+ context.stdout(`Installed ${LAUNCH_AGENT_LABEL}`);
114211
+ context.stdout(` config: ${configPath}`);
114212
+ context.stdout(` logs: ${logPath}`);
114213
+ context.stdout(` runner: ${process.execPath} ${entry}`);
114214
+ }
114215
+ async function uninstallBridge(context) {
114216
+ const domain2 = `gui/${process.getuid?.() ?? 501}`;
114217
+ launchctl(context, ["bootout", `${domain2}/${LAUNCH_AGENT_LABEL}`]);
114218
+ if (existsSync43(launchAgentPlistPath2())) {
114219
+ unlinkSync(launchAgentPlistPath2());
114220
+ }
114221
+ context.stdout(`Removed ${LAUNCH_AGENT_LABEL} (config file kept).`);
114222
+ }
114223
+ async function bridgeStatus(context) {
114224
+ const domain2 = `gui/${process.getuid?.() ?? 501}`;
114225
+ const result = launchctl(context, ["print", `${domain2}/${LAUNCH_AGENT_LABEL}`]);
114226
+ if (!result.ok) {
114227
+ context.stdout("mcp-bridge service: not installed");
114228
+ return;
114229
+ }
114230
+ const state = result.output.match(/state = (.+)/)?.[1] ?? "unknown";
114231
+ const pid = result.output.match(/pid = (\d+)/)?.[1];
114232
+ context.stdout(`mcp-bridge service: ${state}${pid ? ` (pid ${pid})` : ""}`);
114233
+ context.stdout(` logs: ${join52(supportDirectory(), "logs", "mcp-bridge.log")}`);
114234
+ }
114235
+ async function runMeshBridgeCommand(context, args) {
114236
+ const subcommand = args[0];
114237
+ if (subcommand === "--help" || subcommand === "-h" || subcommand === "help") {
114238
+ context.stdout(MESH_BRIDGE_HELP);
114239
+ return;
114240
+ }
114241
+ if (subcommand === "install") {
114242
+ return installBridge(context, args.slice(1));
114243
+ }
114244
+ if (subcommand === "uninstall") {
114245
+ return uninstallBridge(context);
114246
+ }
114247
+ if (subcommand === "status") {
114248
+ return bridgeStatus(context);
114249
+ }
114250
+ return runBridge(context, args);
114251
+ }
114252
+ var MESH_BRIDGE_HELP = `scout mesh bridge \u2014 Hold the outbound MCP relay connection for this node
114253
+
114254
+ Serves the Scout MCP tool surface to remote MCP clients via a mesh-front-door
114255
+ relay. Caller identity comes from the relay's agent tokens; each identity gets
114256
+ its own pinned server instance. Spec: docs/eng/sco-095-remote-mcp-gateway.md.
114257
+
114258
+ Usage:
114259
+ scout mesh bridge [--config <path>] [options] Run in the foreground
114260
+ scout mesh bridge install [options] Install as a LaunchAgent
114261
+ scout mesh bridge uninstall Remove the LaunchAgent
114262
+ scout mesh bridge status Show service state
114263
+
114264
+ Options (run + install):
114265
+ --relay <url> MCP relay base URL (default: https://mcp.oscout.net)
114266
+ --token <bearer> Relay infra token; prefer --token-keychain
114267
+ --token-keychain <service>
114268
+ Read the token from the macOS keychain (default:
114269
+ OPENSCOUT_MCP_BRIDGE_TOKEN)
114270
+ --sender <id> Fallback identity for tokenless envelopes
114271
+ (default: grokbot.spike)
114272
+ --node <id> Node name in the relay (default: default)
114273
+ --tools <csv> "core" (default) or explicit tool list
114274
+ --dir <path> currentDirectory for tool resolution
114275
+ --config <path> JSON config file; flags override its values
114276
+ `, LAUNCH_AGENT_LABEL = "app.openscout.mcp-bridge";
114277
+ var init_mesh_bridge2 = __esm(() => {
114278
+ init_context();
114279
+ init_mesh_bridge();
114280
+ });
114281
+
113578
114282
  // ../../apps/desktop/src/cli/commands/mesh.ts
113579
114283
  var exports_mesh = {};
113580
114284
  __export(exports_mesh, {
@@ -113655,6 +114359,11 @@ async function runMeshCommand(context, args) {
113655
114359
  });
113656
114360
  return;
113657
114361
  }
114362
+ case "bridge": {
114363
+ const { runMeshBridgeCommand: runMeshBridgeCommand2 } = await Promise.resolve().then(() => (init_mesh_bridge2(), exports_mesh_bridge));
114364
+ await runMeshBridgeCommand2(context, args.slice(1));
114365
+ return;
114366
+ }
113658
114367
  case "peers":
113659
114368
  await runMeshPeersCommand(context, args.slice(1));
113660
114369
  return;
@@ -113699,6 +114408,9 @@ Presence (docs/proposals/mesh-trust-cone.md \xA711.5):
113699
114408
  scout mesh bind mesh Same as announce
113700
114409
  scout mesh bind local Withdraw mesh announcement (TLS/mDNS stand down)
113701
114410
 
114411
+ MCP gateway (docs/eng/sco-095-remote-mcp-gateway.md):
114412
+ scout mesh bridge Hold the outbound MCP relay connection (spike harness)
114413
+
113702
114414
  Trust cone (docs/proposals/mesh-trust-cone.md):
113703
114415
  scout mesh peers List trusted peers
113704
114416
  scout mesh grant Adjust a peer's tier
@@ -113714,11 +114426,11 @@ var init_mesh2 = __esm(() => {
113714
114426
  });
113715
114427
 
113716
114428
  // ../../apps/desktop/src/core/pairing/runtime/config.ts
113717
- import { existsSync as existsSync43, mkdirSync as mkdirSync13, readFileSync as readFileSync20, writeFileSync as writeFileSync11 } from "fs";
113718
- import { homedir as homedir33 } from "os";
114429
+ import { existsSync as existsSync44, mkdirSync as mkdirSync14, readFileSync as readFileSync22, writeFileSync as writeFileSync12 } from "fs";
114430
+ import { homedir as homedir34 } from "os";
113719
114431
  import path from "path";
113720
114432
  function pairingPaths() {
113721
- const rootDir = path.join(homedir33(), ".scout/pairing");
114433
+ const rootDir = path.join(homedir34(), ".scout/pairing");
113722
114434
  return {
113723
114435
  rootDir,
113724
114436
  configPath: path.join(rootDir, "config.json"),
@@ -113731,11 +114443,11 @@ function pairingPaths() {
113731
114443
  }
113732
114444
  function loadPairingConfig() {
113733
114445
  const { configPath } = pairingPaths();
113734
- if (!existsSync43(configPath)) {
114446
+ if (!existsSync44(configPath)) {
113735
114447
  return {};
113736
114448
  }
113737
114449
  try {
113738
- const payload = JSON.parse(readFileSync20(configPath, "utf8"));
114450
+ const payload = JSON.parse(readFileSync22(configPath, "utf8"));
113739
114451
  return typeof payload === "object" && payload ? payload : {};
113740
114452
  } catch {
113741
114453
  return {};
@@ -115835,17 +116547,17 @@ var init_noise = __esm(() => {
115835
116547
  });
115836
116548
 
115837
116549
  // ../../apps/desktop/src/core/pairing/runtime/security/identity.ts
115838
- import { existsSync as existsSync44, mkdirSync as mkdirSync14, readFileSync as readFileSync21, writeFileSync as writeFileSync12 } from "fs";
115839
- import { join as join52 } from "path";
115840
- import { homedir as homedir34 } from "os";
116550
+ import { existsSync as existsSync45, mkdirSync as mkdirSync15, readFileSync as readFileSync23, writeFileSync as writeFileSync13 } from "fs";
116551
+ import { join as join53 } from "path";
116552
+ import { homedir as homedir35 } from "os";
115841
116553
  function loadOrCreateIdentity() {
115842
- if (existsSync44(IDENTITY_FILE)) {
116554
+ if (existsSync45(IDENTITY_FILE)) {
115843
116555
  return loadIdentity();
115844
116556
  }
115845
116557
  return createAndSaveIdentity();
115846
116558
  }
115847
116559
  function loadIdentity() {
115848
- const data = JSON.parse(readFileSync21(IDENTITY_FILE, "utf8"));
116560
+ const data = JSON.parse(readFileSync23(IDENTITY_FILE, "utf8"));
115849
116561
  return {
115850
116562
  publicKey: hexToBytes2(data.publicKey),
115851
116563
  privateKey: hexToBytes2(data.privateKey)
@@ -115853,26 +116565,26 @@ function loadIdentity() {
115853
116565
  }
115854
116566
  function createAndSaveIdentity() {
115855
116567
  const keyPair = generateKeyPair();
115856
- mkdirSync14(PAIRING_DIR, { recursive: true });
116568
+ mkdirSync15(PAIRING_DIR, { recursive: true });
115857
116569
  const data = {
115858
116570
  publicKey: bytesToHex2(keyPair.publicKey),
115859
116571
  privateKey: bytesToHex2(keyPair.privateKey),
115860
116572
  createdAt: new Date().toISOString()
115861
116573
  };
115862
- writeFileSync12(IDENTITY_FILE, JSON.stringify(data, null, 2), { mode: 384 });
116574
+ writeFileSync13(IDENTITY_FILE, JSON.stringify(data, null, 2), { mode: 384 });
115863
116575
  return keyPair;
115864
116576
  }
115865
116577
  function loadTrustedPeers() {
115866
- if (!existsSync44(TRUSTED_PEERS_FILE))
116578
+ if (!existsSync45(TRUSTED_PEERS_FILE))
115867
116579
  return new Map;
115868
- const data = JSON.parse(readFileSync21(TRUSTED_PEERS_FILE, "utf8"));
116580
+ const data = JSON.parse(readFileSync23(TRUSTED_PEERS_FILE, "utf8"));
115869
116581
  return new Map(data.map((p) => [p.publicKey, p]));
115870
116582
  }
115871
116583
  function saveTrustedPeer(peer) {
115872
116584
  const peers = loadTrustedPeers();
115873
116585
  peers.set(peer.publicKey, peer);
115874
- mkdirSync14(PAIRING_DIR, { recursive: true });
115875
- writeFileSync12(TRUSTED_PEERS_FILE, JSON.stringify([...peers.values()], null, 2), { mode: 384 });
116586
+ mkdirSync15(PAIRING_DIR, { recursive: true });
116587
+ writeFileSync13(TRUSTED_PEERS_FILE, JSON.stringify([...peers.values()], null, 2), { mode: 384 });
115876
116588
  }
115877
116589
  function isTrustedPeer(publicKeyHex) {
115878
116590
  return loadTrustedPeers().has(publicKeyHex);
@@ -115914,9 +116626,9 @@ function hexToBytes2(hex4) {
115914
116626
  var PAIRING_DIR, IDENTITY_FILE, TRUSTED_PEERS_FILE, QR_VERSION = 1, QR_EXPIRY_MS;
115915
116627
  var init_identity = __esm(() => {
115916
116628
  init_noise();
115917
- PAIRING_DIR = join52(homedir34(), ".scout/pairing");
115918
- IDENTITY_FILE = join52(PAIRING_DIR, "identity.json");
115919
- TRUSTED_PEERS_FILE = join52(PAIRING_DIR, "trusted-peers.json");
116629
+ PAIRING_DIR = join53(homedir35(), ".scout/pairing");
116630
+ IDENTITY_FILE = join53(PAIRING_DIR, "identity.json");
116631
+ TRUSTED_PEERS_FILE = join53(PAIRING_DIR, "trusted-peers.json");
115920
116632
  QR_EXPIRY_MS = 5 * 60 * 1000;
115921
116633
  });
115922
116634
 
@@ -116077,14 +116789,14 @@ var init_security2 = __esm(() => {
116077
116789
  });
116078
116790
 
116079
116791
  // ../../apps/desktop/src/core/pairing/runtime/runtime-state.ts
116080
- import { existsSync as existsSync45, mkdirSync as mkdirSync15, readFileSync as readFileSync22, renameSync as renameSync5, unlinkSync, writeFileSync as writeFileSync13 } from "fs";
116792
+ import { existsSync as existsSync46, mkdirSync as mkdirSync16, readFileSync as readFileSync24, renameSync as renameSync5, unlinkSync as unlinkSync2, writeFileSync as writeFileSync14 } from "fs";
116081
116793
  function readPairingRuntimeSnapshot() {
116082
116794
  const { runtimeStatePath } = pairingPaths();
116083
- if (!existsSync45(runtimeStatePath)) {
116795
+ if (!existsSync46(runtimeStatePath)) {
116084
116796
  return null;
116085
116797
  }
116086
116798
  try {
116087
- const parsed = JSON.parse(readFileSync22(runtimeStatePath, "utf8"));
116799
+ const parsed = JSON.parse(readFileSync24(runtimeStatePath, "utf8"));
116088
116800
  return parsed?.version === 1 ? { ...parsed, lanDiscoveryAdvertised: parsed.lanDiscoveryAdvertised === true } : null;
116089
116801
  } catch {
116090
116802
  return null;
@@ -116107,9 +116819,9 @@ var init_runtime_state = __esm(() => {
116107
116819
  });
116108
116820
 
116109
116821
  // ../../apps/desktop/src/core/pairing/runtime/bridge/log.ts
116110
- import { appendFileSync, mkdirSync as mkdirSync16 } from "fs";
116111
- import { join as join53 } from "path";
116112
- import { homedir as homedir35 } from "os";
116822
+ import { appendFileSync, mkdirSync as mkdirSync17 } from "fs";
116823
+ import { join as join54 } from "path";
116824
+ import { homedir as homedir36 } from "os";
116113
116825
  function write(level, category, message, data) {
116114
116826
  const ts = new Date().toISOString().slice(11, 23);
116115
116827
  const lvl = level.toUpperCase().padEnd(5);
@@ -116125,9 +116837,9 @@ function write(level, category, message, data) {
116125
116837
  }
116126
116838
  var LOG_DIR, LOG_FILE, log;
116127
116839
  var init_log = __esm(() => {
116128
- LOG_DIR = join53(homedir35(), ".scout/pairing");
116129
- LOG_FILE = join53(LOG_DIR, "bridge.log");
116130
- mkdirSync16(LOG_DIR, { recursive: true });
116840
+ LOG_DIR = join54(homedir36(), ".scout/pairing");
116841
+ LOG_FILE = join54(LOG_DIR, "bridge.log");
116842
+ mkdirSync17(LOG_DIR, { recursive: true });
116131
116843
  log = {
116132
116844
  debug: (cat, msg, data) => write("debug", cat, msg, data),
116133
116845
  info: (cat, msg, data) => write("info", cat, msg, data),
@@ -116202,15 +116914,15 @@ var init_bridge = __esm(() => {
116202
116914
  });
116203
116915
 
116204
116916
  // ../../apps/desktop/src/core/pairing/runtime/bridge/config.ts
116205
- import { existsSync as existsSync46, readFileSync as readFileSync23 } from "fs";
116206
- import { join as join54 } from "path";
116207
- import { homedir as homedir36 } from "os";
116208
- function loadConfigFile() {
116209
- if (!existsSync46(CONFIG_FILE)) {
116917
+ import { existsSync as existsSync47, readFileSync as readFileSync25 } from "fs";
116918
+ import { join as join55 } from "path";
116919
+ import { homedir as homedir37 } from "os";
116920
+ function loadConfigFile2() {
116921
+ if (!existsSync47(CONFIG_FILE)) {
116210
116922
  return {};
116211
116923
  }
116212
116924
  try {
116213
- const raw = readFileSync23(CONFIG_FILE, "utf8");
116925
+ const raw = readFileSync25(CONFIG_FILE, "utf8");
116214
116926
  const parsed = JSON.parse(raw);
116215
116927
  return parsed;
116216
116928
  } catch (err) {
@@ -116269,7 +116981,7 @@ function isValidPort3(value) {
116269
116981
  return typeof value === "number" && Number.isInteger(value) && value > 0 && value < 65536;
116270
116982
  }
116271
116983
  function resolveConfig() {
116272
- const file2 = loadConfigFile();
116984
+ const file2 = loadConfigFile2();
116273
116985
  const cli = parseCLIFlags();
116274
116986
  return resolveConfigLayers(file2, cli);
116275
116987
  }
@@ -116280,8 +116992,8 @@ var init_config3 = __esm(() => {
116280
116992
  port: 43130,
116281
116993
  secure: true
116282
116994
  };
116283
- CONFIG_DIR = join54(homedir36(), ".scout/pairing");
116284
- CONFIG_FILE = join54(CONFIG_DIR, "config.json");
116995
+ CONFIG_DIR = join55(homedir37(), ".scout/pairing");
116996
+ CONFIG_FILE = join55(CONFIG_DIR, "config.json");
116285
116997
  });
116286
116998
 
116287
116999
  // ../../apps/desktop/src/core/pairing/runtime/bridge/web-handoff.ts
@@ -116349,7 +117061,7 @@ var init_web_handoff = __esm(() => {
116349
117061
 
116350
117062
  // ../../apps/desktop/src/core/pairing/runtime/bridge/artifact-presentation.ts
116351
117063
  import { randomBytes as randomBytes8 } from "crypto";
116352
- import { realpathSync as realpathSync3, statSync as statSync9 } from "fs";
117064
+ import { realpathSync as realpathSync3, statSync as statSync10 } from "fs";
116353
117065
  import { basename as basename18, dirname as dirname30, isAbsolute as isAbsolute5, relative as relative5, resolve as resolve31, sep as sep3 } from "path";
116354
117066
  function createArtifactPresentation(input, options) {
116355
117067
  const now = options.now ?? Date.now();
@@ -116362,14 +117074,14 @@ function createArtifactPresentation(input, options) {
116362
117074
  if (!isPathInside2(allowedRoot, sourcePath)) {
116363
117075
  throw new Error("sourcePath is outside the session workspace");
116364
117076
  }
116365
- const source = statSync9(sourcePath);
117077
+ const source = statSync10(sourcePath);
116366
117078
  const rootPath = source.isDirectory() ? sourcePath : dirname30(sourcePath);
116367
117079
  const entryPath = normalizeRelativeEntry(source.isDirectory() ? input.entryPath?.trim() || "index.html" : basename18(sourcePath));
116368
117080
  const entryTarget = requiredRealPath(resolve31(rootPath, entryPath), "entryPath");
116369
117081
  if (!isPathInside2(rootPath, entryTarget)) {
116370
117082
  throw new Error("entryPath leaves the presentation root");
116371
117083
  }
116372
- if (!statSync9(entryTarget).isFile()) {
117084
+ if (!statSync10(entryTarget).isFile()) {
116373
117085
  throw new Error("entryPath must name a file");
116374
117086
  }
116375
117087
  const id = `present-${randomBytes8(24).toString("base64url")}`;
@@ -116413,14 +117125,14 @@ function serveArtifactPresentation(req, url2, now = Date.now()) {
116413
117125
  if (!isPathInside2(grant.rootPath, target2)) {
116414
117126
  return presentationResponse("Forbidden", 403);
116415
117127
  }
116416
- const targetStat = statSync9(target2);
117128
+ const targetStat = statSync10(target2);
116417
117129
  if (targetStat.isDirectory()) {
116418
117130
  try {
116419
117131
  target2 = requiredRealPath(resolve31(target2, "index.html"), "artifact index");
116420
117132
  } catch {
116421
117133
  return presentationResponse("Not found", 404);
116422
117134
  }
116423
- if (!isPathInside2(grant.rootPath, target2) || !statSync9(target2).isFile()) {
117135
+ if (!isPathInside2(grant.rootPath, target2) || !statSync10(target2).isFile()) {
116424
117136
  return presentationResponse("Not found", 404);
116425
117137
  }
116426
117138
  } else if (!targetStat.isFile()) {
@@ -116480,7 +117192,7 @@ function normalizeRelativeEntry(value) {
116480
117192
  }
116481
117193
  function requiredRealDirectory(path2, label) {
116482
117194
  const real3 = requiredRealPath(path2, label);
116483
- if (!statSync9(real3).isDirectory()) {
117195
+ if (!statSync10(real3).isDirectory()) {
116484
117196
  throw new Error(`${label} must be a directory`);
116485
117197
  }
116486
117198
  return real3;
@@ -116538,10 +117250,10 @@ var init_artifact_presentation = __esm(() => {
116538
117250
 
116539
117251
  // ../../apps/desktop/src/core/pairing/runtime/bridge/fileserver.ts
116540
117252
  import { randomUUID as randomUUID6 } from "crypto";
116541
- import { existsSync as existsSync47, mkdirSync as mkdirSync17, readFileSync as readFileSync24, realpathSync as realpathSync4, statSync as statSync10, unlinkSync as unlinkSync2, writeFileSync as writeFileSync14 } from "fs";
117253
+ import { existsSync as existsSync48, mkdirSync as mkdirSync18, readFileSync as readFileSync26, realpathSync as realpathSync4, statSync as statSync11, unlinkSync as unlinkSync3, writeFileSync as writeFileSync15 } from "fs";
116542
117254
  import { BlockList, isIP } from "net";
116543
- import { isAbsolute as isAbsolute6, join as join55, relative as relative6, sep as sep4 } from "path";
116544
- import { homedir as homedir37 } from "os";
117255
+ import { isAbsolute as isAbsolute6, join as join56, relative as relative6, sep as sep4 } from "path";
117256
+ import { homedir as homedir38 } from "os";
116545
117257
  function pairingFileServerOrigin(port, host = "127.0.0.1") {
116546
117258
  return `http://${host}:${port}`;
116547
117259
  }
@@ -116557,11 +117269,11 @@ function storePairingAttachmentBlob(input, options) {
116557
117269
  if (data.length > PAIRING_ATTACHMENT_MAX_BYTES) {
116558
117270
  throw new Error(`attachment exceeds ${PAIRING_ATTACHMENT_MAX_BYTES} bytes`);
116559
117271
  }
116560
- mkdirSync17(PAIRING_ATTACHMENT_ROOT, { recursive: true, mode: 448 });
117272
+ mkdirSync18(PAIRING_ATTACHMENT_ROOT, { recursive: true, mode: 448 });
116561
117273
  purgeExpiredPairingAttachments(options.now);
116562
117274
  const id = `att-${randomUUID6()}`;
116563
- const path2 = join55(PAIRING_ATTACHMENT_ROOT, id);
116564
- writeFileSync14(path2, data, { mode: 384 });
117275
+ const path2 = join56(PAIRING_ATTACHMENT_ROOT, id);
117276
+ writeFileSync15(path2, data, { mode: 384 });
116565
117277
  const now = options.now ?? Date.now();
116566
117278
  const entry = {
116567
117279
  id,
@@ -116590,7 +117302,7 @@ function readPairingAttachmentBlob(id, now = Date.now()) {
116590
117302
  }
116591
117303
  let data;
116592
117304
  try {
116593
- data = readFileSync24(entry.path);
117305
+ data = readFileSync26(entry.path);
116594
117306
  } catch {
116595
117307
  forgetPairingAttachment(entry.id);
116596
117308
  return null;
@@ -116609,25 +117321,25 @@ function resolvePairingAttachment(id, now) {
116609
117321
  }
116610
117322
  const known = attachmentBlobs.get(id);
116611
117323
  if (known) {
116612
- if (known.expiresAt <= now || !existsSync47(known.path)) {
117324
+ if (known.expiresAt <= now || !existsSync48(known.path)) {
116613
117325
  forgetPairingAttachment(id);
116614
117326
  return null;
116615
117327
  }
116616
117328
  return known;
116617
117329
  }
116618
117330
  const rehydrated = readAttachmentSidecar(id);
116619
- if (!rehydrated || rehydrated.expiresAt <= now || !existsSync47(rehydrated.path)) {
117331
+ if (!rehydrated || rehydrated.expiresAt <= now || !existsSync48(rehydrated.path)) {
116620
117332
  return null;
116621
117333
  }
116622
117334
  attachmentBlobs.set(id, rehydrated);
116623
117335
  return rehydrated;
116624
117336
  }
116625
117337
  function attachmentSidecarPath(id) {
116626
- return join55(PAIRING_ATTACHMENT_ROOT, `${id}.json`);
117338
+ return join56(PAIRING_ATTACHMENT_ROOT, `${id}.json`);
116627
117339
  }
116628
117340
  function writeAttachmentSidecar(entry) {
116629
117341
  try {
116630
- writeFileSync14(attachmentSidecarPath(entry.id), JSON.stringify({
117342
+ writeFileSync15(attachmentSidecarPath(entry.id), JSON.stringify({
116631
117343
  id: entry.id,
116632
117344
  mediaType: entry.mediaType,
116633
117345
  fileName: entry.fileName,
@@ -116638,14 +117350,14 @@ function writeAttachmentSidecar(entry) {
116638
117350
  }
116639
117351
  function readAttachmentSidecar(id) {
116640
117352
  try {
116641
- const raw = JSON.parse(readFileSync24(attachmentSidecarPath(id), "utf8"));
117353
+ const raw = JSON.parse(readFileSync26(attachmentSidecarPath(id), "utf8"));
116642
117354
  const mediaType = normalizeMediaType(raw.mediaType);
116643
117355
  if (raw.id !== id || !mediaType || typeof raw.expiresAt !== "number") {
116644
117356
  return null;
116645
117357
  }
116646
117358
  return {
116647
117359
  id,
116648
- path: join55(PAIRING_ATTACHMENT_ROOT, id),
117360
+ path: join56(PAIRING_ATTACHMENT_ROOT, id),
116649
117361
  mediaType,
116650
117362
  fileName: sanitizeAttachmentFileName(raw.fileName),
116651
117363
  size: typeof raw.size === "number" ? raw.size : 0,
@@ -116657,9 +117369,9 @@ function readAttachmentSidecar(id) {
116657
117369
  }
116658
117370
  function forgetPairingAttachment(id) {
116659
117371
  attachmentBlobs.delete(id);
116660
- for (const path2 of [join55(PAIRING_ATTACHMENT_ROOT, id), attachmentSidecarPath(id)]) {
117372
+ for (const path2 of [join56(PAIRING_ATTACHMENT_ROOT, id), attachmentSidecarPath(id)]) {
116661
117373
  try {
116662
- unlinkSync2(path2);
117374
+ unlinkSync3(path2);
116663
117375
  } catch {}
116664
117376
  }
116665
117377
  }
@@ -116709,7 +117421,7 @@ function isInsideRoot(root, candidate) {
116709
117421
  function isAllowedHomeRelativePath(rel) {
116710
117422
  if (!rel.startsWith("."))
116711
117423
  return true;
116712
- return rel === ".claude" || rel.startsWith(`.claude${sep4}`) || rel === join55(".scout", "pairing") || rel.startsWith(`${join55(".scout", "pairing")}${sep4}`);
117424
+ return rel === ".claude" || rel.startsWith(`.claude${sep4}`) || rel === join56(".scout", "pairing") || rel.startsWith(`${join56(".scout", "pairing")}${sep4}`);
116713
117425
  }
116714
117426
  function resolveAllowedFile(filePath) {
116715
117427
  if (!isAbsolute6(filePath))
@@ -116720,7 +117432,7 @@ function resolveAllowedFile(filePath) {
116720
117432
  } catch {
116721
117433
  return { status: "missing" };
116722
117434
  }
116723
- const canonicalHome = realpathSync4(homedir37());
117435
+ const canonicalHome = realpathSync4(homedir38());
116724
117436
  for (const configuredRoot of ALLOWED_ROOTS) {
116725
117437
  const root = realpathSync4(configuredRoot);
116726
117438
  if (!isInsideRoot(root, candidate))
@@ -116729,7 +117441,7 @@ function resolveAllowedFile(filePath) {
116729
117441
  return { status: "forbidden" };
116730
117442
  }
116731
117443
  try {
116732
- return statSync10(candidate).isFile() ? { status: "allowed", path: candidate } : { status: "missing" };
117444
+ return statSync11(candidate).isFile() ? { status: "allowed", path: candidate } : { status: "missing" };
116733
117445
  } catch {
116734
117446
  return { status: "missing" };
116735
117447
  }
@@ -117363,21 +118075,21 @@ var ALLOWED_ROOTS, LOOPBACK_PEERS, PAIRING_ATTACHMENT_ROOT, PAIRING_ATTACHMENT_T
117363
118075
  var init_fileserver = __esm(() => {
117364
118076
  init_web_handoff();
117365
118077
  init_artifact_presentation();
117366
- ALLOWED_ROOTS = [homedir37(), "/tmp"];
118078
+ ALLOWED_ROOTS = [homedir38(), "/tmp"];
117367
118079
  LOOPBACK_PEERS = new BlockList;
117368
118080
  LOOPBACK_PEERS.addSubnet("127.0.0.0", 8, "ipv4");
117369
118081
  LOOPBACK_PEERS.addAddress("::1", "ipv6");
117370
118082
  LOOPBACK_PEERS.addSubnet("::ffff:127.0.0.0", 104, "ipv6");
117371
- PAIRING_ATTACHMENT_ROOT = join55(homedir37(), ".scout", "pairing", "attachments");
118083
+ PAIRING_ATTACHMENT_ROOT = join56(homedir38(), ".scout", "pairing", "attachments");
117372
118084
  PAIRING_ATTACHMENT_TTL_MS = 6 * 60 * 60 * 1000;
117373
118085
  PAIRING_ATTACHMENT_MAX_BYTES = 25 * 1024 * 1024;
117374
118086
  attachmentBlobs = new Map;
117375
118087
  });
117376
118088
 
117377
118089
  // ../runtime/src/agent-workspace.ts
117378
- import { existsSync as existsSync48 } from "fs";
118090
+ import { existsSync as existsSync49 } from "fs";
117379
118091
  import { mkdir as mkdir13 } from "fs/promises";
117380
- import { join as join56 } from "path";
118092
+ import { join as join57 } from "path";
117381
118093
  async function isGitRepo(projectRoot) {
117382
118094
  try {
117383
118095
  await execSystemFile("git", ["rev-parse", "--git-dir"], { cwd: projectRoot, timeoutMs: 2000 });
@@ -117397,9 +118109,9 @@ async function createAgentWorkspace(projectRoot, agentName, requestedBranch) {
117397
118109
  }
117398
118110
  const branch = requestedBranch?.trim() || `scout/${agentName}`;
117399
118111
  validateWorktreeBranch(branch);
117400
- const workspaceDir = join56(projectRoot, SCOUT_WORKSPACES_DIRNAME);
117401
- const workspacePath = join56(workspaceDir, agentName);
117402
- if (existsSync48(workspacePath)) {
118112
+ const workspaceDir = join57(projectRoot, SCOUT_WORKSPACES_DIRNAME);
118113
+ const workspacePath = join57(workspaceDir, agentName);
118114
+ if (existsSync49(workspacePath)) {
117403
118115
  return { path: workspacePath, branch };
117404
118116
  }
117405
118117
  await mkdir13(workspaceDir, { recursive: true });
@@ -117422,11 +118134,11 @@ var init_agent_workspace = __esm(() => {
117422
118134
 
117423
118135
  // ../../apps/desktop/src/server/db-queries.ts
117424
118136
  import { Database as Database4 } from "bun:sqlite";
117425
- import { homedir as homedir38 } from "os";
117426
- import { join as join57 } from "path";
118137
+ import { homedir as homedir39 } from "os";
118138
+ import { join as join58 } from "path";
117427
118139
  function resolveDbPath() {
117428
- const controlHome = process.env.OPENSCOUT_CONTROL_HOME ?? join57(homedir38(), ".openscout", "control-plane");
117429
- return join57(controlHome, "control-plane.sqlite");
118140
+ const controlHome = process.env.OPENSCOUT_CONTROL_HOME ?? join58(homedir39(), ".openscout", "control-plane");
118141
+ return join58(controlHome, "control-plane.sqlite");
117430
118142
  }
117431
118143
  function db2() {
117432
118144
  if (!_db) {
@@ -117915,7 +118627,7 @@ var _db = null, HOME, LATEST_AGENT_ENDPOINT_JOIN = `LEFT JOIN agent_endpoints ep
117915
118627
  )`, ACTIVE_FLIGHT_STATES_SQL, ACTIVE_FLIGHT_MAX_AGE_MS, ACTIVE_WORK_STATES_SQL;
117916
118628
  var init_db_queries = __esm(() => {
117917
118629
  init_src();
117918
- HOME = homedir38();
118630
+ HOME = homedir39();
117919
118631
  ACTIVE_FLIGHT_STATES_SQL = sqlStringList(["running", "waking", "waiting", "queued"]);
117920
118632
  ACTIVE_FLIGHT_MAX_AGE_MS = 24 * 60 * 60 * 1000;
117921
118633
  ACTIVE_WORK_STATES_SQL = sqlStringList(["open", "working", "waiting", "review"]);
@@ -117923,7 +118635,7 @@ var init_db_queries = __esm(() => {
117923
118635
 
117924
118636
  // ../../apps/desktop/src/core/mobile/service.ts
117925
118637
  import { basename as basename19, resolve as resolve32 } from "path";
117926
- import { statSync as statSync11 } from "fs";
118638
+ import { statSync as statSync12 } from "fs";
117927
118639
  async function getScoutMobileRuntimeCapabilities(projectRoot) {
117928
118640
  const normalizedProjectRoot = projectRoot?.trim() ? resolve32(projectRoot) : null;
117929
118641
  const liveCatalog = await readScoutRuntimeCatalog();
@@ -117947,7 +118659,7 @@ async function getScoutMobileRuntimeCapabilities(projectRoot) {
117947
118659
  reasoningEffort: scoutRuntimeDefaultReasoningEffort(defaultHarness ?? "", defaultModel, runtimeCatalog)
117948
118660
  },
117949
118661
  defaultsByHarness: scoutRuntimeDefaultsByHarness(runtimeCatalog),
117950
- harnesses: runtimeCatalog.harnesses.filter((entry) => entry.enabled).map((entry) => ({ id: entry.id, label: entry.label })),
118662
+ harnesses: runtimeCatalog.harnesses.filter((entry) => entry.enabled && entry.listed !== false).map((entry) => ({ id: entry.id, label: entry.label })),
117951
118663
  models,
117952
118664
  efforts: scoutRuntimeEffortCatalog(runtimeCatalog).map((effort) => ({
117953
118665
  ...effort,
@@ -118080,7 +118792,7 @@ async function loadMobileWorkspaceInventory(currentDirectory) {
118080
118792
  }
118081
118793
  function isDirectory2(path2) {
118082
118794
  try {
118083
- return statSync11(path2).isDirectory();
118795
+ return statSync12(path2).isDirectory();
118084
118796
  } catch {
118085
118797
  return false;
118086
118798
  }
@@ -119242,21 +119954,21 @@ var init_mobile_terminal_session = __esm(() => {
119242
119954
  // ../../apps/desktop/src/core/pairing/runtime/bridge/mobile-terminal-provision.ts
119243
119955
  import { createHash as createHash13 } from "crypto";
119244
119956
  import {
119245
- chmodSync as chmodSync2,
119957
+ chmodSync as chmodSync3,
119246
119958
  closeSync,
119247
- existsSync as existsSync49,
119248
- mkdirSync as mkdirSync18,
119959
+ existsSync as existsSync50,
119960
+ mkdirSync as mkdirSync19,
119249
119961
  openSync,
119250
- readFileSync as readFileSync25,
119962
+ readFileSync as readFileSync27,
119251
119963
  renameSync as renameSync6,
119252
- unlinkSync as unlinkSync3,
119253
- writeFileSync as writeFileSync15
119964
+ unlinkSync as unlinkSync4,
119965
+ writeFileSync as writeFileSync16
119254
119966
  } from "fs";
119255
- import { homedir as homedir39, hostname as hostname5, userInfo as userInfo2 } from "os";
119256
- import { join as join58 } from "path";
119967
+ import { homedir as homedir40, hostname as hostname5, userInfo as userInfo2 } from "os";
119968
+ import { join as join59 } from "path";
119257
119969
  async function readMobileTerminalStatus(requestedSessionName, deviceId) {
119258
- const authorizedKeysPath = join58(homedir39(), ".ssh", "authorized_keys");
119259
- const authorizedKeys = existsSync49(authorizedKeysPath) ? readFileSync25(authorizedKeysPath, "utf8") : "";
119970
+ const authorizedKeysPath = join59(homedir40(), ".ssh", "authorized_keys");
119971
+ const authorizedKeys = existsSync50(authorizedKeysPath) ? readFileSync27(authorizedKeysPath, "utf8") : "";
119260
119972
  const provisionedSessionName = findSshTerminalSessionForDevice(authorizedKeys, deviceId);
119261
119973
  const sessionName = authorizedMobileTerminalSessionName(requestedSessionName, provisionedSessionName);
119262
119974
  const base = {
@@ -119328,17 +120040,17 @@ async function readMobileTerminalStatus(requestedSessionName, deviceId) {
119328
120040
  async function provisionMobileTerminalAccess(sshPublicKey, deviceId, deviceClass = undefined) {
119329
120041
  const id = deviceId?.trim() || "scout-ios-device";
119330
120042
  const sessionName = provisionedMobileTerminalSessionName(sshPublicKey, deviceClass);
119331
- const sshDir = join58(homedir39(), ".ssh");
119332
- const authorizedKeysPath = join58(sshDir, "authorized_keys");
120043
+ const sshDir = join59(homedir40(), ".ssh");
120044
+ const authorizedKeysPath = join59(sshDir, "authorized_keys");
119333
120045
  const hostKeyFingerprint = readRequiredHostKeyFingerprint();
119334
120046
  const result = withAuthorizedKeysLock(sshDir, () => {
119335
- if (!existsSync49(sshDir)) {
119336
- mkdirSync18(sshDir, { recursive: true, mode: 448 });
120047
+ if (!existsSync50(sshDir)) {
120048
+ mkdirSync19(sshDir, { recursive: true, mode: 448 });
119337
120049
  }
119338
120050
  try {
119339
- chmodSync2(sshDir, 448);
120051
+ chmodSync3(sshDir, 448);
119340
120052
  } catch {}
119341
- const existing = existsSync49(authorizedKeysPath) ? readFileSync25(authorizedKeysPath, "utf8") : "";
120053
+ const existing = existsSync50(authorizedKeysPath) ? readFileSync27(authorizedKeysPath, "utf8") : "";
119342
120054
  const result2 = provisionSshTerminalAccess({
119343
120055
  authorizedKeys: existing,
119344
120056
  deviceId: id,
@@ -119352,7 +120064,7 @@ async function provisionMobileTerminalAccess(sshPublicKey, deviceId, deviceClass
119352
120064
  log.info("terminal", `SSH key already authorized for device ${id}`);
119353
120065
  }
119354
120066
  try {
119355
- chmodSync2(authorizedKeysPath, 384);
120067
+ chmodSync3(authorizedKeysPath, 384);
119356
120068
  } catch {}
119357
120069
  return result2;
119358
120070
  });
@@ -119386,7 +120098,7 @@ function resolveReachableHost() {
119386
120098
  }
119387
120099
  function readRequiredHostKeyFingerprint() {
119388
120100
  try {
119389
- const pub = readFileSync25("/etc/ssh/ssh_host_ed25519_key.pub", "utf8");
120101
+ const pub = readFileSync27("/etc/ssh/ssh_host_ed25519_key.pub", "utf8");
119390
120102
  const keyData = pub.trim().split(/\s+/)[1];
119391
120103
  if (!keyData)
119392
120104
  throw new Error("missing key data");
@@ -119400,20 +120112,20 @@ function readRequiredHostKeyFingerprint() {
119400
120112
  function writeAuthorizedKeysAtomically(path2, contents) {
119401
120113
  const tmpPath = `${path2}.scout-${process.pid}-${Date.now()}.tmp`;
119402
120114
  try {
119403
- writeFileSync15(tmpPath, contents, { mode: 384, flag: "wx" });
120115
+ writeFileSync16(tmpPath, contents, { mode: 384, flag: "wx" });
119404
120116
  renameSync6(tmpPath, path2);
119405
120117
  } catch (error48) {
119406
120118
  try {
119407
- unlinkSync3(tmpPath);
120119
+ unlinkSync4(tmpPath);
119408
120120
  } catch {}
119409
120121
  throw error48;
119410
120122
  }
119411
120123
  }
119412
120124
  function withAuthorizedKeysLock(sshDir, action) {
119413
- if (!existsSync49(sshDir)) {
119414
- mkdirSync18(sshDir, { recursive: true, mode: 448 });
120125
+ if (!existsSync50(sshDir)) {
120126
+ mkdirSync19(sshDir, { recursive: true, mode: 448 });
119415
120127
  }
119416
- const lockPath = join58(sshDir, ".scout-authorized-keys.lock");
120128
+ const lockPath = join59(sshDir, ".scout-authorized-keys.lock");
119417
120129
  const deadline = Date.now() + 5000;
119418
120130
  let fd = null;
119419
120131
  while (fd === null) {
@@ -119438,7 +120150,7 @@ function withAuthorizedKeysLock(sshDir, action) {
119438
120150
  closeSync(lockFd);
119439
120151
  } finally {
119440
120152
  try {
119441
- unlinkSync3(lockPath);
120153
+ unlinkSync4(lockPath);
119442
120154
  } catch {}
119443
120155
  }
119444
120156
  }
@@ -119455,9 +120167,9 @@ var init_mobile_terminal_provision = __esm(() => {
119455
120167
  });
119456
120168
 
119457
120169
  // ../../apps/desktop/src/core/pairing/runtime/bridge/server.ts
119458
- import { readdirSync as readdirSync6, readFileSync as readFileSync26, realpathSync as realpathSync5, statSync as statSync12 } from "fs";
119459
- import { basename as basename20, isAbsolute as isAbsolute7, join as join59, relative as relative7, resolve as resolve33 } from "path";
119460
- import { homedir as homedir40 } from "os";
120170
+ import { readdirSync as readdirSync6, readFileSync as readFileSync28, realpathSync as realpathSync5, statSync as statSync13 } from "fs";
120171
+ import { basename as basename20, isAbsolute as isAbsolute7, join as join60, relative as relative7, resolve as resolve33 } from "path";
120172
+ import { homedir as homedir41 } from "os";
119461
120173
  function replaySyncEvents(bridge, sessionId, lastSeq) {
119462
120174
  return bridge.replay(sessionId, lastSeq);
119463
120175
  }
@@ -119644,7 +120356,7 @@ async function handleRPCInner(bridge, req, rpcContext = {}) {
119644
120356
  if (dirName.startsWith("-")) {
119645
120357
  const candidate = "/" + dirName.slice(1).replace(/-/g, "/");
119646
120358
  try {
119647
- statSync12(candidate);
120359
+ statSync13(candidate);
119648
120360
  cwd = candidate;
119649
120361
  } catch {
119650
120362
  const config2 = resolveConfig();
@@ -119701,7 +120413,7 @@ async function handleRPCInner(bridge, req, rpcContext = {}) {
119701
120413
  }
119702
120414
  const root = resolveWorkspaceRoot(configuredRoot);
119703
120415
  const projectPath = resolveWorkspacePath(root, p.path);
119704
- const stat6 = statSync12(projectPath);
120416
+ const stat6 = statSync13(projectPath);
119705
120417
  if (!stat6.isDirectory()) {
119706
120418
  return { id: req.id, error: { code: -32000, message: "Workspace target is not a directory" } };
119707
120419
  }
@@ -119973,7 +120685,7 @@ async function handleRPCInner(bridge, req, rpcContext = {}) {
119973
120685
  const config2 = resolveConfig();
119974
120686
  const workspaceRoot = config2.workspace?.root ? resolveWorkspaceRoot(config2.workspace.root) : null;
119975
120687
  const matches = await readSessionSearch({
119976
- home: homedir40(),
120688
+ home: homedir41(),
119977
120689
  workspaceRoot,
119978
120690
  maxAgeDays: maxAge,
119979
120691
  limit,
@@ -119988,7 +120700,7 @@ async function handleRPCInner(bridge, req, rpcContext = {}) {
119988
120700
  return { id: req.id, error: { code: -32000, message: "Only .jsonl files can be read" } };
119989
120701
  }
119990
120702
  try {
119991
- const content = readFileSync26(p.path, "utf-8");
120703
+ const content = readFileSync28(p.path, "utf-8");
119992
120704
  const lines = content.split(`
119993
120705
  `).filter((l) => l.trim().length > 0);
119994
120706
  const trimmed = lines.length > 500 ? lines.slice(-500) : lines;
@@ -120109,13 +120821,13 @@ function resolveMobileCurrentDirectory() {
120109
120821
  }
120110
120822
  }
120111
120823
  function resolveWorkspaceRoot(root) {
120112
- const expandedRoot = root.replace(/^~/, homedir40());
120824
+ const expandedRoot = root.replace(/^~/, homedir41());
120113
120825
  return realpathSync5(expandedRoot);
120114
120826
  }
120115
120827
  function resolveWorkspacePath(root, requestedPath) {
120116
120828
  const normalizedRoot = resolveWorkspaceRoot(root);
120117
- const expandedPath = requestedPath?.replace(/^~/, homedir40());
120118
- const candidate = expandedPath ? isAbsolute7(expandedPath) ? expandedPath : join59(normalizedRoot, expandedPath) : normalizedRoot;
120829
+ const expandedPath = requestedPath?.replace(/^~/, homedir41());
120830
+ const candidate = expandedPath ? isAbsolute7(expandedPath) ? expandedPath : join60(normalizedRoot, expandedPath) : normalizedRoot;
120119
120831
  const resolvedCandidate = realpathSync5(candidate);
120120
120832
  const rel = relative7(normalizedRoot, resolvedCandidate);
120121
120833
  if (rel === "" || !rel.startsWith("..") && !isAbsolute7(rel)) {
@@ -120130,9 +120842,9 @@ function listDirectories(dirPath) {
120130
120842
  continue;
120131
120843
  if (name2 === "node_modules" || name2 === ".build" || name2 === "target")
120132
120844
  continue;
120133
- const fullPath = join59(dirPath, name2);
120845
+ const fullPath = join60(dirPath, name2);
120134
120846
  try {
120135
- const stat6 = statSync12(fullPath);
120847
+ const stat6 = statSync13(fullPath);
120136
120848
  if (!stat6.isDirectory())
120137
120849
  continue;
120138
120850
  const children = new Set(readdirSync6(fullPath));
@@ -120156,7 +120868,7 @@ async function discoverSessionFiles(maxAgeDays, limit) {
120156
120868
  const config2 = resolveConfig();
120157
120869
  const workspaceRoot = config2.workspace?.root ? resolveWorkspaceRoot(config2.workspace.root) : null;
120158
120870
  const sessions4 = await readSessionFileScan({
120159
- home: homedir40(),
120871
+ home: homedir41(),
120160
120872
  workspaceRoot,
120161
120873
  maxAgeDays,
120162
120874
  limit
@@ -120270,9 +120982,9 @@ var init_tail_fanout = __esm(() => {
120270
120982
  });
120271
120983
 
120272
120984
  // ../../apps/desktop/src/core/pairing/runtime/bridge/router.ts
120273
- import { readFileSync as readFileSync27, readdirSync as readdirSync7, realpathSync as realpathSync6, statSync as statSync13 } from "fs";
120274
- import { basename as basename21, isAbsolute as isAbsolute8, join as join60, relative as relative8, resolve as resolve34 } from "path";
120275
- import { homedir as homedir41 } from "os";
120985
+ import { readFileSync as readFileSync29, readdirSync as readdirSync7, realpathSync as realpathSync6, statSync as statSync14 } from "fs";
120986
+ import { basename as basename21, isAbsolute as isAbsolute8, join as join61, relative as relative8, resolve as resolve34 } from "path";
120987
+ import { homedir as homedir42 } from "os";
120276
120988
  function resolveMobileCurrentDirectory2() {
120277
120989
  const config2 = resolveConfig();
120278
120990
  const configuredRoot = config2.workspace?.root;
@@ -120285,13 +120997,13 @@ function resolveMobileCurrentDirectory2() {
120285
120997
  }
120286
120998
  }
120287
120999
  function resolveWorkspaceRoot2(root) {
120288
- const expandedRoot = root.replace(/^~/, homedir41());
121000
+ const expandedRoot = root.replace(/^~/, homedir42());
120289
121001
  return realpathSync6(expandedRoot);
120290
121002
  }
120291
121003
  function resolveWorkspacePath2(root, requestedPath) {
120292
121004
  const normalizedRoot = resolveWorkspaceRoot2(root);
120293
- const expandedPath = requestedPath?.replace(/^~/, homedir41());
120294
- const candidate = expandedPath ? isAbsolute8(expandedPath) ? expandedPath : join60(normalizedRoot, expandedPath) : normalizedRoot;
121005
+ const expandedPath = requestedPath?.replace(/^~/, homedir42());
121006
+ const candidate = expandedPath ? isAbsolute8(expandedPath) ? expandedPath : join61(normalizedRoot, expandedPath) : normalizedRoot;
120295
121007
  const resolvedCandidate = realpathSync6(candidate);
120296
121008
  const rel = relative8(normalizedRoot, resolvedCandidate);
120297
121009
  if (rel === "" || !rel.startsWith("..") && !isAbsolute8(rel)) {
@@ -120306,9 +121018,9 @@ function listDirectories2(dirPath) {
120306
121018
  continue;
120307
121019
  if (name2 === "node_modules" || name2 === ".build" || name2 === "target")
120308
121020
  continue;
120309
- const fullPath = join60(dirPath, name2);
121021
+ const fullPath = join61(dirPath, name2);
120310
121022
  try {
120311
- const stat6 = statSync13(fullPath);
121023
+ const stat6 = statSync14(fullPath);
120312
121024
  if (!stat6.isDirectory())
120313
121025
  continue;
120314
121026
  const children = new Set(readdirSync7(fullPath));
@@ -120339,7 +121051,7 @@ async function discoverSessionFiles2(maxAgeDays, limit) {
120339
121051
  const config2 = resolveConfig();
120340
121052
  const workspaceRoot = config2.workspace?.root ? resolveWorkspaceRoot2(config2.workspace.root) : null;
120341
121053
  const sessions4 = await readSessionFileScan({
120342
- home: homedir41(),
121054
+ home: homedir42(),
120343
121055
  workspaceRoot,
120344
121056
  maxAgeDays,
120345
121057
  limit
@@ -120725,7 +121437,7 @@ var init_router = __esm(() => {
120725
121437
  if (dirName.startsWith("-")) {
120726
121438
  const candidate = "/" + dirName.slice(1).replace(/-/g, "/");
120727
121439
  try {
120728
- statSync13(candidate);
121440
+ statSync14(candidate);
120729
121441
  cwd = candidate;
120730
121442
  } catch {
120731
121443
  const config2 = resolveConfig();
@@ -121121,7 +121833,7 @@ var init_router = __esm(() => {
121121
121833
  }
121122
121834
  const root = resolveWorkspaceRoot2(configuredRoot);
121123
121835
  const projectPath = resolveWorkspacePath2(root, input.path);
121124
- const stat6 = statSync13(projectPath);
121836
+ const stat6 = statSync14(projectPath);
121125
121837
  if (!stat6.isDirectory()) {
121126
121838
  throw new TRPCError({
121127
121839
  code: "BAD_REQUEST",
@@ -121163,7 +121875,7 @@ var init_router = __esm(() => {
121163
121875
  const config2 = resolveConfig();
121164
121876
  const workspaceRoot = config2.workspace?.root ? resolveWorkspaceRoot2(config2.workspace.root) : null;
121165
121877
  const matches = await readSessionSearch({
121166
- home: homedir41(),
121878
+ home: homedir42(),
121167
121879
  workspaceRoot,
121168
121880
  maxAgeDays: maxAge,
121169
121881
  limit,
@@ -121180,7 +121892,7 @@ var init_router = __esm(() => {
121180
121892
  });
121181
121893
  }
121182
121894
  try {
121183
- const content = readFileSync27(input.path, "utf-8");
121895
+ const content = readFileSync29(input.path, "utf-8");
121184
121896
  const lines = content.split(`
121185
121897
  `).filter((l) => l.trim().length > 0);
121186
121898
  const trimmed = lines.length > 500 ? lines.slice(-500) : lines;
@@ -123427,14 +124139,14 @@ var init_dist4 = __esm(() => {
123427
124139
 
123428
124140
  // ../../apps/desktop/src/core/pairing/runtime/bridge/server-trpc.ts
123429
124141
  import { realpathSync as realpathSync7 } from "fs";
123430
- import { homedir as homedir42 } from "os";
124142
+ import { homedir as homedir43 } from "os";
123431
124143
  function resolveCurrentDirectory() {
123432
124144
  try {
123433
124145
  const config2 = resolveConfig();
123434
124146
  const configuredRoot = config2.workspace?.root;
123435
124147
  if (!configuredRoot)
123436
124148
  return process.cwd();
123437
- const expanded = configuredRoot.replace(/^~/, homedir42());
124149
+ const expanded = configuredRoot.replace(/^~/, homedir43());
123438
124150
  return realpathSync7(expanded);
123439
124151
  } catch {
123440
124152
  return process.cwd();
@@ -123957,7 +124669,7 @@ var init_server_trpc = __esm(() => {
123957
124669
  });
123958
124670
 
123959
124671
  // ../../apps/desktop/src/core/pairing/runtime/runtime.ts
123960
- import { homedir as homedir43 } from "os";
124672
+ import { homedir as homedir44 } from "os";
123961
124673
  function createPairingAdapterRegistry(configAdapters) {
123962
124674
  const adapters = {
123963
124675
  "claude-code": createAdapter6,
@@ -124112,7 +124824,7 @@ async function autoStartConfiguredSessions(bridge, sessions4) {
124112
124824
  try {
124113
124825
  const session3 = await bridge.createSession(entry.adapter, {
124114
124826
  name: entry.name,
124115
- cwd: entry.cwd?.replace(/^~/, homedir43()),
124827
+ cwd: entry.cwd?.replace(/^~/, homedir44()),
124116
124828
  options: entry.options
124117
124829
  });
124118
124830
  console.log(`[bridge] session started: ${session3.name} (${entry.adapter})`);
@@ -124133,10 +124845,10 @@ var init_runtime = __esm(() => {
124133
124845
  });
124134
124846
 
124135
124847
  // ../../apps/desktop/src/core/pairing/runtime/log.ts
124136
- import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync19 } from "fs";
124848
+ import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync20 } from "fs";
124137
124849
  function write2(level, category, message, data) {
124138
124850
  const { rootDir, logPath } = pairingPaths();
124139
- mkdirSync19(rootDir, { recursive: true });
124851
+ mkdirSync20(rootDir, { recursive: true });
124140
124852
  const prefix = `${new Date().toISOString()} [${level.toUpperCase()}] [${category}]`;
124141
124853
  const line = data === undefined ? `${prefix} ${message}
124142
124854
  ` : `${prefix} ${message} ${JSON.stringify(data)}
@@ -124381,16 +125093,16 @@ function parseRelayEnvelope2(data) {
124381
125093
  var BRIDGE_ABSENCE_GRACE_MS = 30000, ROOM_IDLE_TIMEOUT_MS = 60000;
124382
125094
 
124383
125095
  // ../../apps/desktop/src/core/pairing/runtime/relay-runtime.ts
124384
- import { existsSync as existsSync50, mkdirSync as mkdirSync20 } from "fs";
124385
- import { homedir as homedir44, networkInterfaces as networkInterfaces2 } from "os";
124386
- import { join as join61 } from "path";
125096
+ import { existsSync as existsSync51, mkdirSync as mkdirSync21 } from "fs";
125097
+ import { homedir as homedir45, networkInterfaces as networkInterfaces2 } from "os";
125098
+ import { join as join62 } from "path";
124387
125099
  async function findStoredTailscaleCert(hostname6) {
124388
- if (!existsSync50(PAIRING_DIR2)) {
125100
+ if (!existsSync51(PAIRING_DIR2)) {
124389
125101
  return null;
124390
125102
  }
124391
- const certPath = join61(PAIRING_DIR2, `${hostname6}.crt`);
124392
- const keyPath = join61(PAIRING_DIR2, `${hostname6}.key`);
124393
- if (!existsSync50(certPath) || !existsSync50(keyPath)) {
125103
+ const certPath = join62(PAIRING_DIR2, `${hostname6}.crt`);
125104
+ const keyPath = join62(PAIRING_DIR2, `${hostname6}.key`);
125105
+ if (!existsSync51(certPath) || !existsSync51(keyPath)) {
124394
125106
  return null;
124395
125107
  }
124396
125108
  if (!await storedCertificateLooksPubliclyTrusted(certPath)) {
@@ -124473,9 +125185,9 @@ function resolveRelayEndpointForTailscaleStatus(port, tailscale2, options = {})
124473
125185
  };
124474
125186
  }
124475
125187
  async function generateTailscaleCerts(hostname6) {
124476
- mkdirSync20(PAIRING_DIR2, { recursive: true });
124477
- const certPath = join61(PAIRING_DIR2, `${hostname6}.crt`);
124478
- const keyPath = join61(PAIRING_DIR2, `${hostname6}.key`);
125188
+ mkdirSync21(PAIRING_DIR2, { recursive: true });
125189
+ const certPath = join62(PAIRING_DIR2, `${hostname6}.crt`);
125190
+ const keyPath = join62(PAIRING_DIR2, `${hostname6}.key`);
124479
125191
  try {
124480
125192
  pairingLog.info("relay", "generating tailscale TLS cert", { hostname: hostname6 });
124481
125193
  await execSystemFile("tailscale", ["cert", "--cert-file", certPath, "--key-file", keyPath, hostname6], {
@@ -124602,7 +125314,7 @@ var PAIRING_DIR2;
124602
125314
  var init_relay_runtime = __esm(() => {
124603
125315
  init_system_probes();
124604
125316
  init_log2();
124605
- PAIRING_DIR2 = join61(homedir44(), ".scout/pairing");
125317
+ PAIRING_DIR2 = join62(homedir45(), ".scout/pairing");
124606
125318
  });
124607
125319
 
124608
125320
  // ../../node_modules/.bun/uqr@0.1.3/node_modules/uqr/dist/index.mjs
@@ -126741,9 +127453,9 @@ __export(exports_session, {
126741
127453
  });
126742
127454
  import { spawnSync as spawnSync11 } from "child_process";
126743
127455
  import { createHash as createHash14 } from "crypto";
126744
- import { mkdirSync as mkdirSync21 } from "fs";
126745
- import { homedir as homedir45 } from "os";
126746
- import { basename as basename22, join as join62, resolve as resolve35 } from "path";
127456
+ import { mkdirSync as mkdirSync22 } from "fs";
127457
+ import { homedir as homedir46 } from "os";
127458
+ import { basename as basename22, join as join63, resolve as resolve35 } from "path";
126747
127459
  async function runSessionCommand(context, args) {
126748
127460
  const action = args[0];
126749
127461
  if (!action || action === "help" || action === "--help" || action === "-h") {
@@ -127035,7 +127747,7 @@ function readOptionValue(args, index2, flag) {
127035
127747
  }
127036
127748
  function resolveProjectPath2(context, projectPath) {
127037
127749
  const rawPath = projectPath?.trim() || context.cwd;
127038
- const expanded = rawPath === "~" ? context.env.HOME?.trim() || homedir45() : rawPath.startsWith("~/") ? resolve35(context.env.HOME?.trim() || homedir45(), rawPath.slice(2)) : rawPath;
127750
+ const expanded = rawPath === "~" ? context.env.HOME?.trim() || homedir46() : rawPath.startsWith("~/") ? resolve35(context.env.HOME?.trim() || homedir46(), rawPath.slice(2)) : rawPath;
127039
127751
  return resolve35(context.cwd, expanded);
127040
127752
  }
127041
127753
  function resolveControlPlaneDbPath2(context) {
@@ -127043,8 +127755,8 @@ function resolveControlPlaneDbPath2(context) {
127043
127755
  if (explicitPath) {
127044
127756
  return explicitPath;
127045
127757
  }
127046
- const controlHome = context.env.OPENSCOUT_CONTROL_HOME?.trim() || join62(context.env.HOME?.trim() || homedir45(), ".openscout", "control-plane");
127047
- return join62(controlHome, "control-plane.sqlite");
127758
+ const controlHome = context.env.OPENSCOUT_CONTROL_HOME?.trim() || join63(context.env.HOME?.trim() || homedir46(), ".openscout", "control-plane");
127759
+ return join63(controlHome, "control-plane.sqlite");
127048
127760
  }
127049
127761
  function openTerminalSessionStore(context) {
127050
127762
  return new SQLiteControlPlaneStore(resolveControlPlaneDbPath2(context));
@@ -127168,12 +127880,12 @@ function assertZellijAvailable(context) {
127168
127880
  }
127169
127881
  function resolveZellijSocketDir(context) {
127170
127882
  const configured = context.env.ZELLIJ_SOCKET_DIR?.trim() || context.env.OPENSCOUT_ZELLIJ_SOCKET_DIR?.trim();
127171
- return configured || join62(context.env.HOME?.trim() || homedir45(), ".openscout", "zellij-sockets");
127883
+ return configured || join63(context.env.HOME?.trim() || homedir46(), ".openscout", "zellij-sockets");
127172
127884
  }
127173
127885
  function zellijEnv(context) {
127174
127886
  const socketDir = resolveZellijSocketDir(context);
127175
127887
  try {
127176
- mkdirSync21(socketDir, { recursive: true });
127888
+ mkdirSync22(socketDir, { recursive: true });
127177
127889
  } catch {
127178
127890
  return context.env;
127179
127891
  }
@@ -127474,9 +128186,9 @@ __export(exports_server, {
127474
128186
  normalizeServerOpenPath: () => normalizeServerOpenPath
127475
128187
  });
127476
128188
  import { spawn as spawn10 } from "child_process";
127477
- import { existsSync as existsSync51, mkdirSync as mkdirSync22, openSync as openSync2, writeFileSync as writeFileSync16 } from "fs";
127478
- import { homedir as homedir46 } from "os";
127479
- import { dirname as dirname31, join as join63, resolve as resolve36 } from "path";
128189
+ import { existsSync as existsSync52, mkdirSync as mkdirSync23, openSync as openSync2, writeFileSync as writeFileSync17 } from "fs";
128190
+ import { homedir as homedir47 } from "os";
128191
+ import { dirname as dirname31, join as join64, resolve as resolve36 } from "path";
127480
128192
  import { fileURLToPath as fileURLToPath12 } from "url";
127481
128193
  function renderServerCommandHelp() {
127482
128194
  return [
@@ -127889,9 +128601,9 @@ async function openBrowser(url2) {
127889
128601
  });
127890
128602
  }
127891
128603
  function resolveScoutLocalEdgeCaddyfilePath() {
127892
- const dir = join63(homedir46(), ".scout", "local-edge");
127893
- mkdirSync22(dir, { recursive: true });
127894
- return join63(dir, "Caddyfile");
128604
+ const dir = join64(homedir47(), ".scout", "local-edge");
128605
+ mkdirSync23(dir, { recursive: true });
128606
+ return join64(dir, "Caddyfile");
127895
128607
  }
127896
128608
  function resolveCaddyExecutable2(env) {
127897
128609
  return env.OPENSCOUT_CADDY_BIN?.trim() || "caddy";
@@ -127914,7 +128626,7 @@ async function runScoutLocalEdge(env) {
127914
128626
  const config3 = resolveServerLocalEdgeConfig(env);
127915
128627
  const schemes = config3.scheme === "both" ? ["http", "https"] : [config3.scheme];
127916
128628
  const caddyfilePath = resolveScoutLocalEdgeCaddyfilePath();
127917
- writeFileSync16(caddyfilePath, renderOpenScoutCaddyfile(config3), "utf8");
128629
+ writeFileSync17(caddyfilePath, renderOpenScoutCaddyfile(config3), "utf8");
127918
128630
  const mdnsProcesses = schemes.flatMap((scheme) => {
127919
128631
  const edgePort = scheme === "https" ? 443 : 80;
127920
128632
  const suffix = scheme.toUpperCase();
@@ -128056,14 +128768,14 @@ __export(exports_setup, {
128056
128768
  runSetupCommand: () => runSetupCommand,
128057
128769
  resolveSetupSourceRoots: () => resolveSetupSourceRoots
128058
128770
  });
128059
- import { existsSync as existsSync52 } from "fs";
128060
- import { homedir as homedir47 } from "os";
128061
- import { dirname as dirname32, join as join64, resolve as resolve37 } from "path";
128771
+ import { existsSync as existsSync53 } from "fs";
128772
+ import { homedir as homedir48 } from "os";
128773
+ import { dirname as dirname32, join as join65, resolve as resolve37 } from "path";
128062
128774
  import { createInterface as createInterface4 } from "readline/promises";
128063
128775
  function findGitRoot2(startDirectory) {
128064
128776
  let current = resolve37(startDirectory);
128065
128777
  while (true) {
128066
- if (existsSync52(join64(current, ".git")))
128778
+ if (existsSync53(join65(current, ".git")))
128067
128779
  return current;
128068
128780
  const parent = dirname32(current);
128069
128781
  if (parent === current)
@@ -128071,25 +128783,25 @@ function findGitRoot2(startDirectory) {
128071
128783
  current = parent;
128072
128784
  }
128073
128785
  }
128074
- function suggestProjectSourceRoot(currentDirectory, homeDirectory = homedir47()) {
128786
+ function suggestProjectSourceRoot(currentDirectory, homeDirectory = homedir48()) {
128075
128787
  const gitRoot = findGitRoot2(currentDirectory);
128076
128788
  if (gitRoot && resolve37(gitRoot) !== resolve37(homeDirectory))
128077
128789
  return dirname32(gitRoot);
128078
128790
  for (const candidate of [
128079
- join64(homeDirectory, "dev"),
128080
- join64(homeDirectory, "Developer"),
128081
- join64(homeDirectory, "Projects")
128791
+ join65(homeDirectory, "dev"),
128792
+ join65(homeDirectory, "Developer"),
128793
+ join65(homeDirectory, "Projects")
128082
128794
  ]) {
128083
- if (existsSync52(candidate))
128795
+ if (existsSync53(candidate))
128084
128796
  return candidate;
128085
128797
  }
128086
128798
  return resolve37(currentDirectory);
128087
128799
  }
128088
- function expandHome(value, homeDirectory = homedir47()) {
128800
+ function expandHome(value, homeDirectory = homedir48()) {
128089
128801
  if (value === "~")
128090
128802
  return homeDirectory;
128091
128803
  if (value.startsWith("~/"))
128092
- return join64(homeDirectory, value.slice(2));
128804
+ return join65(homeDirectory, value.slice(2));
128093
128805
  return value;
128094
128806
  }
128095
128807
  async function promptForSourceRoot(suggestedRoot, additionalRootCount) {
@@ -128117,7 +128829,7 @@ async function resolveSetupSourceRoots(context, currentDirectory, sourceRoots, e
128117
128829
  async function runSetupCommand(context, args) {
128118
128830
  const options = parseSetupCommandOptions(args, defaultScoutContextDirectory(context));
128119
128831
  const settings = await readOpenScoutSettings({ currentDirectory: options.currentDirectory });
128120
- const hasSavedSettings = existsSync52(resolveOpenScoutSupportPaths().settingsPath);
128832
+ const hasSavedSettings = existsSync53(resolveOpenScoutSupportPaths().settingsPath);
128121
128833
  options.sourceRoots = await resolveSetupSourceRoots({ ...context, isTty: context.isTty && Boolean(process.stdin.isTTY) }, options.currentDirectory, options.sourceRoots, {
128122
128834
  roots: hasSavedSettings ? settings.discovery.workspaceRoots : [],
128123
128835
  answeredAt: hasSavedSettings ? settings.onboarding.sourceRootsAnsweredAt : null
@@ -128273,6 +128985,206 @@ var init_statusline = __esm(() => {
128273
128985
  MAX_DELEGATE_OUTPUT_BYTES = 64 * 1024;
128274
128986
  });
128275
128987
 
128988
+ // ../runtime/src/tail/discover.ts
128989
+ function readNonNegativeIntEnv(name2, fallback2) {
128990
+ const raw2 = Number.parseInt(process.env[name2] ?? "", 10);
128991
+ return Number.isFinite(raw2) && raw2 >= 0 ? raw2 : fallback2;
128992
+ }
128993
+ var PROCESS_LIST_CACHE_MS;
128994
+ var init_discover = __esm(() => {
128995
+ init_ps();
128996
+ PROCESS_LIST_CACHE_MS = readNonNegativeIntEnv("OPENSCOUT_TAIL_PROCESS_CACHE_MS", 1000);
128997
+ });
128998
+
128999
+ // ../runtime/src/tail/tool-format.ts
129000
+ var init_tool_format = () => {};
129001
+
129002
+ // ../runtime/src/tail/claude-source.ts
129003
+ var DEFAULT_HOT_DISCOVERY_WINDOW_MS, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS, DEFAULT_DEEP_DISCOVERY_WINDOW_MS, HEAD_READ_BYTES, TAIL_READ_BYTES, metadataCache;
129004
+ var init_claude_source = __esm(() => {
129005
+ init_user_config();
129006
+ init_discover();
129007
+ init_tool_format();
129008
+ DEFAULT_HOT_DISCOVERY_WINDOW_MS = 10 * 60 * 1000;
129009
+ DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS = 24 * 60 * 60 * 1000;
129010
+ DEFAULT_DEEP_DISCOVERY_WINDOW_MS = 24 * 60 * 60 * 1000;
129011
+ HEAD_READ_BYTES = 256 * 1024;
129012
+ TAIL_READ_BYTES = 512 * 1024;
129013
+ metadataCache = new Map;
129014
+ });
129015
+
129016
+ // ../runtime/src/tail/codex-source.ts
129017
+ var DEFAULT_HOT_DISCOVERY_WINDOW_MS2, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS2, DEFAULT_DEEP_DISCOVERY_WINDOW_MS2, HEAD_READ_BYTES2, metadataCache2;
129018
+ var init_codex_source = __esm(() => {
129019
+ init_discover();
129020
+ init_tool_format();
129021
+ DEFAULT_HOT_DISCOVERY_WINDOW_MS2 = 10 * 60 * 1000;
129022
+ DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS2 = 24 * 60 * 60 * 1000;
129023
+ DEFAULT_DEEP_DISCOVERY_WINDOW_MS2 = 24 * 60 * 60 * 1000;
129024
+ HEAD_READ_BYTES2 = 512 * 1024;
129025
+ metadataCache2 = new Map;
129026
+ });
129027
+
129028
+ // ../runtime/src/tail/cursor-source.ts
129029
+ var DEFAULT_HOT_DISCOVERY_WINDOW_MS3, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS3, DEFAULT_DEEP_DISCOVERY_WINDOW_MS3, HEAD_READ_BYTES3;
129030
+ var init_cursor_source = __esm(() => {
129031
+ init_discover();
129032
+ DEFAULT_HOT_DISCOVERY_WINDOW_MS3 = 10 * 60 * 1000;
129033
+ DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS3 = 24 * 60 * 60 * 1000;
129034
+ DEFAULT_DEEP_DISCOVERY_WINDOW_MS3 = 24 * 60 * 60 * 1000;
129035
+ HEAD_READ_BYTES3 = 512 * 1024;
129036
+ });
129037
+
129038
+ // ../runtime/src/tail/grok-source.ts
129039
+ var DEFAULT_HOT_DISCOVERY_WINDOW_MS4, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS4, DEFAULT_DEEP_DISCOVERY_WINDOW_MS4, HEAD_READ_BYTES4, grokToolCallMatchers, metadataCache3;
129040
+ var init_grok_source = __esm(() => {
129041
+ init_discover();
129042
+ init_tool_format();
129043
+ DEFAULT_HOT_DISCOVERY_WINDOW_MS4 = 10 * 60 * 1000;
129044
+ DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS4 = 24 * 60 * 60 * 1000;
129045
+ DEFAULT_DEEP_DISCOVERY_WINDOW_MS4 = 24 * 60 * 60 * 1000;
129046
+ HEAD_READ_BYTES4 = 256 * 1024;
129047
+ grokToolCallMatchers = new Map;
129048
+ metadataCache3 = new Map;
129049
+ });
129050
+
129051
+ // ../runtime/src/tail/kimi-source.ts
129052
+ var DEFAULT_HOT_DISCOVERY_WINDOW_MS5, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS5, DEFAULT_DEEP_DISCOVERY_WINDOW_MS5, metadataCache4;
129053
+ var init_kimi_source = __esm(() => {
129054
+ init_discover();
129055
+ init_tool_format();
129056
+ DEFAULT_HOT_DISCOVERY_WINDOW_MS5 = 10 * 60 * 1000;
129057
+ DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS5 = 24 * 60 * 60 * 1000;
129058
+ DEFAULT_DEEP_DISCOVERY_WINDOW_MS5 = 24 * 60 * 60 * 1000;
129059
+ metadataCache4 = new Map;
129060
+ });
129061
+
129062
+ // ../runtime/src/tail/opencode-source.ts
129063
+ var DEFAULT_HOT_DISCOVERY_WINDOW_MS6, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS6, DEFAULT_DEEP_DISCOVERY_WINDOW_MS6, HEAD_READ_BYTES5;
129064
+ var init_opencode_source = __esm(() => {
129065
+ init_discover();
129066
+ DEFAULT_HOT_DISCOVERY_WINDOW_MS6 = 10 * 60 * 1000;
129067
+ DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS6 = 24 * 60 * 60 * 1000;
129068
+ DEFAULT_DEEP_DISCOVERY_WINDOW_MS6 = 24 * 60 * 60 * 1000;
129069
+ HEAD_READ_BYTES5 = 128 * 1024;
129070
+ });
129071
+
129072
+ // ../runtime/src/tail/pi-source.ts
129073
+ var DEFAULT_HOT_DISCOVERY_WINDOW_MS7, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS7, DEFAULT_DEEP_DISCOVERY_WINDOW_MS7, HEAD_READ_BYTES6, metadataCache5;
129074
+ var init_pi_source = __esm(() => {
129075
+ init_discover();
129076
+ init_tool_format();
129077
+ DEFAULT_HOT_DISCOVERY_WINDOW_MS7 = 10 * 60 * 1000;
129078
+ DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS7 = 24 * 60 * 60 * 1000;
129079
+ DEFAULT_DEEP_DISCOVERY_WINDOW_MS7 = 24 * 60 * 60 * 1000;
129080
+ HEAD_READ_BYTES6 = 256 * 1024;
129081
+ metadataCache5 = new Map;
129082
+ });
129083
+ // ../runtime/src/tail/service.ts
129084
+ function readPositiveIntEnv(name2, fallback2) {
129085
+ const raw2 = Number.parseInt(process.env[name2] ?? "", 10);
129086
+ return Number.isFinite(raw2) && raw2 > 0 ? raw2 : fallback2;
129087
+ }
129088
+ var TAIL_POLL_INTERVAL_MS, HOT_DISCOVERY_INTERVAL_MS, DISCOVERY_CACHE_MAX_AGE_MS, SHALLOW_DISCOVERY_INTERVAL_MS, DEEP_DISCOVERY_INTERVAL_MS, QUIET_EVENT_COALESCE_WINDOW_MS, QUIET_EVENT_COALESCE_MAX_KEYS, RECENT_TRANSCRIPT_READ_BYTES, SESSION_TRANSCRIPT_READ_BYTES, RECENT_TRANSCRIPT_MAX_FILES, NATIVE_TAIL_SOURCES, watchers, perSessionBuffer, subscribers, knownTranscripts, quietEventLastSeen, GROK_QUIET_PHASES;
129089
+ var init_service10 = __esm(() => {
129090
+ init_claude_source();
129091
+ init_codex_source();
129092
+ init_cursor_source();
129093
+ init_grok_source();
129094
+ init_kimi_source();
129095
+ init_opencode_source();
129096
+ init_pi_source();
129097
+ TAIL_POLL_INTERVAL_MS = readPositiveIntEnv("OPENSCOUT_TAIL_POLL_INTERVAL_MS", 500);
129098
+ HOT_DISCOVERY_INTERVAL_MS = readPositiveIntEnv("OPENSCOUT_TAIL_HOT_DISCOVERY_INTERVAL_MS", 30000);
129099
+ DISCOVERY_CACHE_MAX_AGE_MS = readPositiveIntEnv("OPENSCOUT_TAIL_DISCOVERY_CACHE_MAX_AGE_MS", HOT_DISCOVERY_INTERVAL_MS);
129100
+ SHALLOW_DISCOVERY_INTERVAL_MS = readPositiveIntEnv("OPENSCOUT_TAIL_SHALLOW_DISCOVERY_INTERVAL_MS", 10 * 60000);
129101
+ DEEP_DISCOVERY_INTERVAL_MS = readPositiveIntEnv("OPENSCOUT_TAIL_DEEP_DISCOVERY_INTERVAL_MS", 60 * 60000);
129102
+ QUIET_EVENT_COALESCE_WINDOW_MS = readPositiveIntEnv("OPENSCOUT_TAIL_QUIET_EVENT_COALESCE_WINDOW_MS", 5000);
129103
+ QUIET_EVENT_COALESCE_MAX_KEYS = readPositiveIntEnv("OPENSCOUT_TAIL_QUIET_EVENT_COALESCE_MAX_KEYS", 2000);
129104
+ RECENT_TRANSCRIPT_READ_BYTES = 512 * 1024;
129105
+ SESSION_TRANSCRIPT_READ_BYTES = 8 * 1024 * 1024;
129106
+ RECENT_TRANSCRIPT_MAX_FILES = readPositiveIntEnv("OPENSCOUT_TAIL_RECENT_TRANSCRIPT_MAX_FILES", 24);
129107
+ NATIVE_TAIL_SOURCES = new Set(["grok", "kimi", "opencode", "cursor"]);
129108
+ watchers = new Map;
129109
+ perSessionBuffer = new Map;
129110
+ subscribers = new Set;
129111
+ knownTranscripts = new Map;
129112
+ quietEventLastSeen = new Map;
129113
+ GROK_QUIET_PHASES = new Set([
129114
+ "streaming_reasoning",
129115
+ "streaming_text",
129116
+ "tool_execution",
129117
+ "permission_prompt"
129118
+ ]);
129119
+ });
129120
+
129121
+ // ../runtime/src/tail/display.ts
129122
+ function isCodexChunkToolResult(summary) {
129123
+ const trimmed = summary.trim();
129124
+ return trimmed.startsWith("-> Chunk ID:") || /^->\s+Wall time:/u.test(trimmed);
129125
+ }
129126
+ function isCursorProcessSample(event) {
129127
+ if (event.source !== "cursor" || event.kind !== "system")
129128
+ return false;
129129
+ const summary = event.summary.trim().toLowerCase();
129130
+ return summary === "process sample" || summary.startsWith("process sample \xB7");
129131
+ }
129132
+ function isTailNoiseEvent(event) {
129133
+ if (isCursorProcessSample(event))
129134
+ return true;
129135
+ if (event.source === "grok") {
129136
+ const summary2 = event.summary.trim().toLowerCase();
129137
+ if (summary2 === "first token" || summary2.startsWith("loop ")) {
129138
+ return true;
129139
+ }
129140
+ if (!summary2.startsWith("phase \xB7"))
129141
+ return false;
129142
+ const phase = summary2.slice("phase \xB7".length).trim();
129143
+ return GROK_STREAMING_PHASES.has(phase);
129144
+ }
129145
+ if (event.source !== "codex")
129146
+ return false;
129147
+ if (event.kind === "tool-result") {
129148
+ const summary2 = event.summary.trim();
129149
+ if (isCodexChunkToolResult(summary2))
129150
+ return true;
129151
+ if (/_end \u00B7/u.test(summary2))
129152
+ return true;
129153
+ if (summary2.startsWith("->"))
129154
+ return true;
129155
+ }
129156
+ if (event.kind !== "system")
129157
+ return false;
129158
+ const summary = event.summary.trim().toLowerCase();
129159
+ if (summary === "user_message" || summary === "agent_message")
129160
+ return true;
129161
+ if (summary === "[reasoning]")
129162
+ return true;
129163
+ if (summary.startsWith("turn context"))
129164
+ return true;
129165
+ if (summary.startsWith("tokens \xB7"))
129166
+ return true;
129167
+ if (summary.startsWith("session "))
129168
+ return true;
129169
+ return false;
129170
+ }
129171
+ var GROK_STREAMING_PHASES;
129172
+ var init_display = __esm(() => {
129173
+ GROK_STREAMING_PHASES = new Set([
129174
+ "streaming_reasoning",
129175
+ "streaming_text",
129176
+ "tool_execution",
129177
+ "permission_prompt",
129178
+ "waiting_for_model"
129179
+ ]);
129180
+ });
129181
+
129182
+ // ../runtime/src/tail/index.ts
129183
+ var init_tail = __esm(() => {
129184
+ init_service10();
129185
+ init_display();
129186
+ });
129187
+
128276
129188
  // ../../apps/desktop/src/cli/commands/tail.ts
128277
129189
  var exports_tail = {};
128278
129190
  __export(exports_tail, {
@@ -128287,6 +129199,7 @@ function renderTailCommandHelp() {
128287
129199
  "Usage: scout tail [options]",
128288
129200
  "",
128289
129201
  "Stream observed harness events from the broker tail firehose.",
129202
+ "Plain output hides harness lifecycle noise; --json stays complete.",
128290
129203
  "",
128291
129204
  "Filters:",
128292
129205
  " --source <name> Runtime source such as claude or codex; repeatable",
@@ -128301,11 +129214,13 @@ function renderTailCommandHelp() {
128301
129214
  " --since <event-id> Resume live streaming after a TailEvent id cursor",
128302
129215
  " --once Print the backlog and exit",
128303
129216
  " --transcripts Include recent file-backed transcript events in the initial backlog",
128304
- " --raw Show bounded raw payload JSON in plain output",
128305
- " --json Emit JSON (streaming mode uses NDJSON)",
129217
+ " --verbose, --debug Show the full firehose including lifecycle noise",
129218
+ " --raw Unfiltered plain output plus bounded raw payload JSON",
129219
+ " --json Emit JSON (streaming mode uses NDJSON); complete events",
128306
129220
  "",
128307
129221
  "Examples:",
128308
129222
  " scout tail",
129223
+ " scout tail --verbose",
128309
129224
  " scout tail --source codex --kind tool-result",
128310
129225
  " scout tail --project openscout --query permission --once",
128311
129226
  " scout tail --transcripts --limit 200 --json"
@@ -128324,6 +129239,7 @@ function parseTailCommandOptions(args) {
128324
129239
  let once2 = false;
128325
129240
  let transcripts = false;
128326
129241
  let raw2 = false;
129242
+ let verbose = false;
128327
129243
  for (let index2 = 0;index2 < args.length; index2 += 1) {
128328
129244
  const arg = args[index2] ?? "";
128329
129245
  if (arg === "--once") {
@@ -128346,6 +129262,10 @@ function parseTailCommandOptions(args) {
128346
129262
  raw2 = true;
128347
129263
  continue;
128348
129264
  }
129265
+ if (arg === "--verbose" || arg === "--debug") {
129266
+ verbose = true;
129267
+ continue;
129268
+ }
128349
129269
  if (arg === "--source") {
128350
129270
  sources.push(...parseCsvFlag(args[++index2], "--source"));
128351
129271
  continue;
@@ -128430,7 +129350,8 @@ function parseTailCommandOptions(args) {
128430
129350
  ...since ? { since } : {},
128431
129351
  once: once2,
128432
129352
  transcripts,
128433
- raw: raw2
129353
+ raw: raw2,
129354
+ verbose
128434
129355
  };
128435
129356
  }
128436
129357
  async function runTailCommand(context, args) {
@@ -128449,8 +129370,18 @@ async function runTailCommand(context, args) {
128449
129370
  query: options.query,
128450
129371
  transcripts: options.transcripts
128451
129372
  });
129373
+ const renderOptions = {
129374
+ raw: options.raw,
129375
+ verbose: options.verbose,
129376
+ color: process.stdout.isTTY === true
129377
+ };
128452
129378
  if (options.once) {
128453
- context.output.writeValue(initial, (value) => value.events.length === 0 ? "No tail events found." : renderTailEvents(value.events, { raw: options.raw }));
129379
+ context.output.writeValue(initial, (value) => {
129380
+ if (value.events.length === 0)
129381
+ return "No tail events found.";
129382
+ const rendered = renderTailEvents(value.events, renderOptions);
129383
+ return rendered || "No tail events found.";
129384
+ });
128454
129385
  return;
128455
129386
  }
128456
129387
  const emitEvent = (event) => {
@@ -128460,7 +129391,9 @@ async function runTailCommand(context, args) {
128460
129391
  context.stdout(JSON.stringify(event));
128461
129392
  return;
128462
129393
  }
128463
- context.stdout(renderTailEvent(event, { raw: options.raw }));
129394
+ if (!includeTailEvent(event, renderOptions))
129395
+ return;
129396
+ context.stdout(renderTailEvent(event, renderOptions));
128464
129397
  };
128465
129398
  for (const event of initial.events) {
128466
129399
  emitEvent(event);
@@ -128469,10 +129402,6 @@ async function runTailCommand(context, args) {
128469
129402
  const shutdown = () => controller.abort();
128470
129403
  process.on("SIGINT", shutdown);
128471
129404
  try {
128472
- if (context.output.mode === "plain") {
128473
- const sourceText = options.sources?.length ? options.sources.join(",") : "all sources";
128474
- context.stderr(`Following tail (${sourceText})`);
128475
- }
128476
129405
  await watchScoutTailEvents({
128477
129406
  since: options.since ?? initial.cursor ?? undefined,
128478
129407
  sources: options.sources,
@@ -128484,24 +129413,38 @@ async function runTailCommand(context, args) {
128484
129413
  }
128485
129414
  }
128486
129415
  function renderTailEvents(events2, options = {}) {
128487
- return events2.map((event) => renderTailEvent(event, options)).join(`
129416
+ const visible = events2.filter((event) => includeTailEvent(event, options));
129417
+ return visible.map((event) => renderTailEvent(event, options)).join(`
128488
129418
  `);
128489
129419
  }
128490
129420
  function renderTailEvent(event, options = {}) {
128491
- const parts = [
128492
- formatClock(event.ts),
128493
- event.source.padEnd(6, " ").slice(0, 6),
128494
- event.kind.padEnd(11, " ").slice(0, 11),
128495
- compact2(event.project || shortCwd(event.cwd), 18).padEnd(18, " "),
128496
- compact2(event.summary, 140)
128497
- ];
128498
- const line = parts.join(" ");
129421
+ const columns2 = resolveColumns(options.columns);
129422
+ const color = options.color ?? false;
129423
+ const clock = formatClock(event.ts);
129424
+ const name2 = event.source.slice(0, 6);
129425
+ const source = name2.padEnd(6, " ");
129426
+ const rest = options.verbose || options.raw ? compactTailSummary(event.summary, Math.max(8, columns2 - 16)) : sceneRest(event, Math.max(8, columns2 - 14));
129427
+ const painted = color ? `${dim(clock)} ${paint(sourceColor(event.source), name2)}${" ".repeat(Math.max(0, 6 - name2.length))} ${rest}` : `${clock} ${source} ${rest}`;
129428
+ const line = clipVisible(painted, columns2);
128499
129429
  if (!options.raw || event.raw === undefined) {
128500
129430
  return line;
128501
129431
  }
128502
129432
  return `${line}
128503
129433
  ${JSON.stringify(event.raw, null, 2)}`;
128504
129434
  }
129435
+ function includeTailEvent(event, options) {
129436
+ if (options.verbose || options.raw)
129437
+ return true;
129438
+ if (isTailNoiseEvent(event))
129439
+ return false;
129440
+ const summary = event.summary.trim().toLowerCase();
129441
+ if (summary.startsWith("permission requested") || summary.startsWith("permission allow")) {
129442
+ return false;
129443
+ }
129444
+ if (event.kind === "tool")
129445
+ return false;
129446
+ return true;
129447
+ }
128505
129448
  function tailEventMatches(event, options) {
128506
129449
  if (options.sources?.length && !options.sources.includes(event.source))
128507
129450
  return false;
@@ -128564,22 +129507,122 @@ function formatClock(ts) {
128564
129507
  return new Date(ts).toLocaleTimeString("en-US", {
128565
129508
  hour12: false,
128566
129509
  hour: "2-digit",
128567
- minute: "2-digit",
128568
- second: "2-digit"
129510
+ minute: "2-digit"
128569
129511
  });
128570
129512
  }
129513
+ function resolveColumns(explicit) {
129514
+ if (typeof explicit === "number" && Number.isFinite(explicit) && explicit > 0) {
129515
+ return Math.floor(explicit);
129516
+ }
129517
+ const detected = process.stdout.columns;
129518
+ if (typeof detected === "number" && Number.isFinite(detected) && detected > 0) {
129519
+ return detected;
129520
+ }
129521
+ return FALLBACK_COLUMNS;
129522
+ }
129523
+ function compactTailSummary(summary, maxLength) {
129524
+ const normalized = flatten(summary).replace(/\/Users\/[^/\s]+\//g, "~/");
129525
+ const shortened = normalized.replace(/(?:~|\/)[^\s]+/g, shortenPathToken);
129526
+ return compact2(shortened, maxLength);
129527
+ }
129528
+ function sceneRest(event, maxLength) {
129529
+ if (event.kind === "assistant" || event.kind === "user") {
129530
+ return compact2(flatten(event.summary), maxLength);
129531
+ }
129532
+ const { verb, noun } = sceneWork(event.summary);
129533
+ if (!noun)
129534
+ return compact2(verb, maxLength);
129535
+ return compact2(`${verb} ${noun}`, maxLength);
129536
+ }
129537
+ function sceneWork(summary) {
129538
+ const normalized = flatten(summary).replace(/\s+\u00B7\s+(success|error|failed)$/i, "").replace(/\/Users\/[^/\s]+\//g, "~/");
129539
+ const [head = "", ...tail2] = normalized.split(/\s+\u00B7\s+/);
129540
+ const rawVerb = head.trim();
129541
+ const rest = tail2.join(" \xB7 ").trim();
129542
+ let verb = rawVerb.toLowerCase();
129543
+ for (const [pattern, name2] of WORK_VERBS) {
129544
+ if (pattern.test(rawVerb)) {
129545
+ verb = name2;
129546
+ break;
129547
+ }
129548
+ }
129549
+ return { verb, noun: sceneNoun(verb, rest || rawVerb) };
129550
+ }
129551
+ function sceneNoun(verb, rest) {
129552
+ const pathMatch = rest.match(/(\S+\.\w+)\b/);
129553
+ if (pathMatch?.[1]) {
129554
+ const parts = pathMatch[1].split(/[\\/]/);
129555
+ return parts.at(-1) ?? pathMatch[1];
129556
+ }
129557
+ if (verb === "run") {
129558
+ const tokens = rest.split(/\s+/).filter((token) => token.length > 0 && !token.includes("="));
129559
+ const cmd = tokens.find((token) => !token.startsWith("-")) ?? tokens[0];
129560
+ if (cmd && cmd !== "run" && cmd !== "run_terminal_command") {
129561
+ return cmd.replace(/^.*\//, "");
129562
+ }
129563
+ return "";
129564
+ }
129565
+ const shortened = rest.replace(/(?:~|\/)[^\s]+/g, shortenPathToken);
129566
+ if (shortened === verb)
129567
+ return "";
129568
+ return shortened;
129569
+ }
129570
+ function shortenPathToken(token) {
129571
+ const folded = token.replace(/\/Users\/[^/\s]+\//g, "~/");
129572
+ const segments = folded.split(/[\\/]/).filter(Boolean);
129573
+ if (segments.length <= 2)
129574
+ return folded;
129575
+ if (!folded.startsWith("~/") && !folded.startsWith("/"))
129576
+ return folded;
129577
+ return segments.slice(-2).join("/");
129578
+ }
129579
+ function flatten(value) {
129580
+ return value.replace(/\s+/g, " ").trim();
129581
+ }
129582
+ function sourceColor(source) {
129583
+ return SOURCE_COLOR[source.toLowerCase()] ?? "38;5;245";
129584
+ }
129585
+ function paint(code, text3) {
129586
+ return `\x1B[${code}m${text3}\x1B[0m`;
129587
+ }
129588
+ function dim(text3) {
129589
+ return paint("2", text3);
129590
+ }
129591
+ function visibleWidth(value) {
129592
+ return value.replace(ANSI_RE, "").length;
129593
+ }
129594
+ function clipVisible(line, columns2) {
129595
+ const budget2 = Math.max(1, columns2);
129596
+ if (visibleWidth(line) <= budget2)
129597
+ return line;
129598
+ const limit = Math.max(0, budget2 - 1);
129599
+ let width = 0;
129600
+ let out = "";
129601
+ let i = 0;
129602
+ while (i < line.length && width < limit) {
129603
+ if (line[i] === "\x1B") {
129604
+ const match2 = line.slice(i).match(/^\x1b\[[0-9;]*m/);
129605
+ if (match2) {
129606
+ out += match2[0];
129607
+ i += match2[0].length;
129608
+ continue;
129609
+ }
129610
+ }
129611
+ out += line[i];
129612
+ width += 1;
129613
+ i += 1;
129614
+ }
129615
+ return `${out}\u2026${out.includes("\x1B[") ? "\x1B[0m" : ""}`;
129616
+ }
128571
129617
  function compact2(value, maxLength) {
128572
- const normalized = value.replace(/\s+/g, " ").trim();
129618
+ const normalized = flatten(value);
128573
129619
  if (normalized.length <= maxLength)
128574
129620
  return normalized;
128575
129621
  return `${normalized.slice(0, Math.max(0, maxLength - 1))}\u2026`;
128576
129622
  }
128577
- function shortCwd(cwd) {
128578
- const parts = cwd.split("/").filter(Boolean);
128579
- return parts.at(-1) ?? cwd;
128580
- }
128581
- var HELP_FLAGS20, TAIL_EVENT_KINDS;
128582
- var init_tail = __esm(() => {
129623
+ var HELP_FLAGS20, TAIL_EVENT_KINDS, FALLBACK_COLUMNS = 80, ANSI_RE, SOURCE_COLOR, WORK_VERBS;
129624
+ var init_tail2 = __esm(() => {
129625
+ init_tail();
128583
129626
  init_errors();
128584
129627
  init_service6();
128585
129628
  HELP_FLAGS20 = new Set(["--help", "-h"]);
@@ -128591,6 +129634,25 @@ var init_tail = __esm(() => {
128591
129634
  "system",
128592
129635
  "other"
128593
129636
  ]);
129637
+ ANSI_RE = /\x1b\[[0-9;]*m/g;
129638
+ SOURCE_COLOR = {
129639
+ grok: "38;5;216",
129640
+ claude: "38;5;173",
129641
+ kimi: "38;5;140",
129642
+ omp: "38;5;73",
129643
+ codex: "38;5;110",
129644
+ cursor: "38;5;108"
129645
+ };
129646
+ WORK_VERBS = [
129647
+ [/^(read_file|read)\b/i, "read"],
129648
+ [/^(search_replace|strreplace|edit)\b/i, "edit"],
129649
+ [/^(write_file|write)\b/i, "write"],
129650
+ [/^(run_terminal_command|bash|shell)\b/i, "run"],
129651
+ [/^(grep)\b/i, "grep"],
129652
+ [/^(glob|find)\b/i, "find"],
129653
+ [/^(web_search|websearch)\b/i, "search"],
129654
+ [/^(web_fetch|webfetch|open_page|open_page_with_find)\b/i, "fetch"]
129655
+ ];
128594
129656
  });
128595
129657
 
128596
129658
  // ../../node_modules/.bun/@opentui+core@0.1.96+a7e4efcb39f2fc50/node_modules/@opentui/core/assets/javascript/highlights.scm
@@ -128645,8 +129707,8 @@ import { EventEmitter as EventEmitter2 } from "events";
128645
129707
  import { resolve as resolve38, dirname as dirname33 } from "path";
128646
129708
  import { fileURLToPath as fileURLToPath13 } from "url";
128647
129709
  import { resolve as resolve210, isAbsolute as isAbsolute9, parse as parse8 } from "path";
128648
- import { existsSync as existsSync53 } from "fs";
128649
- import { basename as basename23, join as join65 } from "path";
129710
+ import { existsSync as existsSync54 } from "fs";
129711
+ import { basename as basename23, join as join66 } from "path";
128650
129712
  import os from "os";
128651
129713
  import path2 from "path";
128652
129714
  import { EventEmitter as EventEmitter3 } from "events";
@@ -128657,7 +129719,7 @@ import { mkdir as mkdir14, readFile as readFile17, writeFile as writeFile11 } fr
128657
129719
  import * as path3 from "path";
128658
129720
  import { readdir as readdir4 } from "fs/promises";
128659
129721
  import { dlopen, toArrayBuffer as toArrayBuffer4, JSCallback, ptr as ptr4 } from "bun:ffi";
128660
- import { existsSync as existsSync210, writeFileSync as writeFileSync17 } from "fs";
129722
+ import { existsSync as existsSync210, writeFileSync as writeFileSync18 } from "fs";
128661
129723
  import { EventEmitter as EventEmitter4 } from "events";
128662
129724
  import { toArrayBuffer as toArrayBuffer2, ptr } from "bun:ffi";
128663
129725
  import { ptr as ptr2, toArrayBuffer as toArrayBuffer22 } from "bun:ffi";
@@ -129252,7 +130314,7 @@ function createTextAttributes({
129252
130314
  bold = false,
129253
130315
  italic = false,
129254
130316
  underline = false,
129255
- dim = false,
130317
+ dim: dim2 = false,
129256
130318
  blink = false,
129257
130319
  inverse = false,
129258
130320
  hidden = false,
@@ -129265,7 +130327,7 @@ function createTextAttributes({
129265
130327
  attributes3 |= TextAttributes.ITALIC;
129266
130328
  if (underline)
129267
130329
  attributes3 |= TextAttributes.UNDERLINE;
129268
- if (dim)
130330
+ if (dim2)
129269
130331
  attributes3 |= TextAttributes.DIM;
129270
130332
  if (blink)
129271
130333
  attributes3 |= TextAttributes.BLINK;
@@ -131937,7 +132999,7 @@ function getBunfsRootPath() {
131937
132999
  return process.platform === "win32" ? "B:\\~BUN\\root" : "/$bunfs/root";
131938
133000
  }
131939
133001
  function normalizeBunfsPath(fileName) {
131940
- return join65(getBunfsRootPath(), basename23(fileName));
133002
+ return join66(getBunfsRootPath(), basename23(fileName));
131941
133003
  }
131942
133004
  function addDefaultParsers(parsers) {
131943
133005
  for (const parser of parsers) {
@@ -135265,7 +136327,7 @@ function convertToDebugSymbols(symbols) {
135265
136327
  if (env.OTUI_DEBUG_FFI && globalFFILogPath) {
135266
136328
  const logPath = globalFFILogPath;
135267
136329
  const writeSync = (msg) => {
135268
- writeFileSync17(logPath, msg + `
136330
+ writeFileSync18(logPath, msg + `
135269
136331
  `, { flag: "a" });
135270
136332
  };
135271
136333
  Object.entries(symbols).forEach(([key, value]) => {
@@ -137691,7 +138753,7 @@ var __defProp4, __returnValue2 = (v) => v, __export2 = (target2, all) => {
137691
138753
  configurable: true,
137692
138754
  set: __exportSetter2.bind(all, name2)
137693
138755
  });
137694
- }, exports_src, loadYoga, yoga_wasm_base64_esm_default, Align, BoxSizing, Dimension, Direction, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, LogLevel, MeasureMode, NodeType, Overflow, PositionType, Unit, Wrap, constants5, YGEnums_default, Yoga, src_default, VALID_BORDER_STYLES, BorderChars, BorderCharArrays, KeyHandler, InternalKeyHandler, CSS_COLOR_NAMES, block_default, shade_default, slick_default, tiny_default, huge_default, grid_default, pallet_default, fonts, parsedFonts, TextAttributes, ATTRIBUTE_BASE_BITS = 8, ATTRIBUTE_BASE_MASK = 255, DebugOverlayCorner, TargetChannel, ATTRIBUTE_BASE_MASK2 = 255, LINK_ID_SHIFT = 8, LINK_ID_PAYLOAD_MASK = 16777215, BrandedStyledText, StyledText, black = (input) => applyStyle(input, { fg: "black" }), red = (input) => applyStyle(input, { fg: "red" }), green = (input) => applyStyle(input, { fg: "green" }), yellow = (input) => applyStyle(input, { fg: "yellow" }), blue = (input) => applyStyle(input, { fg: "blue" }), magenta = (input) => applyStyle(input, { fg: "magenta" }), cyan = (input) => applyStyle(input, { fg: "cyan" }), white = (input) => applyStyle(input, { fg: "white" }), brightBlack = (input) => applyStyle(input, { fg: "brightBlack" }), brightRed = (input) => applyStyle(input, { fg: "brightRed" }), brightGreen = (input) => applyStyle(input, { fg: "brightGreen" }), brightYellow = (input) => applyStyle(input, { fg: "brightYellow" }), brightBlue = (input) => applyStyle(input, { fg: "brightBlue" }), brightMagenta = (input) => applyStyle(input, { fg: "brightMagenta" }), brightCyan = (input) => applyStyle(input, { fg: "brightCyan" }), brightWhite = (input) => applyStyle(input, { fg: "brightWhite" }), bgBlack = (input) => applyStyle(input, { bg: "black" }), bgRed = (input) => applyStyle(input, { bg: "red" }), bgGreen = (input) => applyStyle(input, { bg: "green" }), bgYellow = (input) => applyStyle(input, { bg: "yellow" }), bgBlue = (input) => applyStyle(input, { bg: "blue" }), bgMagenta = (input) => applyStyle(input, { bg: "magenta" }), bgCyan = (input) => applyStyle(input, { bg: "cyan" }), bgWhite = (input) => applyStyle(input, { bg: "white" }), bold = (input) => applyStyle(input, { bold: true }), italic = (input) => applyStyle(input, { italic: true }), underline = (input) => applyStyle(input, { underline: true }), strikethrough = (input) => applyStyle(input, { strikethrough: true }), dim = (input) => applyStyle(input, { dim: true }), reverse = (input) => applyStyle(input, { reverse: true }), blink = (input) => applyStyle(input, { blink: true }), fg = (color) => (input) => applyStyle(input, { fg: color }), bg = (color) => (input) => applyStyle(input, { bg: color }), link = (url2) => (input) => {
138756
+ }, exports_src, loadYoga, yoga_wasm_base64_esm_default, Align, BoxSizing, Dimension, Direction, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, LogLevel, MeasureMode, NodeType, Overflow, PositionType, Unit, Wrap, constants5, YGEnums_default, Yoga, src_default, VALID_BORDER_STYLES, BorderChars, BorderCharArrays, KeyHandler, InternalKeyHandler, CSS_COLOR_NAMES, block_default, shade_default, slick_default, tiny_default, huge_default, grid_default, pallet_default, fonts, parsedFonts, TextAttributes, ATTRIBUTE_BASE_BITS = 8, ATTRIBUTE_BASE_MASK = 255, DebugOverlayCorner, TargetChannel, ATTRIBUTE_BASE_MASK2 = 255, LINK_ID_SHIFT = 8, LINK_ID_PAYLOAD_MASK = 16777215, BrandedStyledText, StyledText, black = (input) => applyStyle(input, { fg: "black" }), red = (input) => applyStyle(input, { fg: "red" }), green = (input) => applyStyle(input, { fg: "green" }), yellow = (input) => applyStyle(input, { fg: "yellow" }), blue = (input) => applyStyle(input, { fg: "blue" }), magenta = (input) => applyStyle(input, { fg: "magenta" }), cyan = (input) => applyStyle(input, { fg: "cyan" }), white = (input) => applyStyle(input, { fg: "white" }), brightBlack = (input) => applyStyle(input, { fg: "brightBlack" }), brightRed = (input) => applyStyle(input, { fg: "brightRed" }), brightGreen = (input) => applyStyle(input, { fg: "brightGreen" }), brightYellow = (input) => applyStyle(input, { fg: "brightYellow" }), brightBlue = (input) => applyStyle(input, { fg: "brightBlue" }), brightMagenta = (input) => applyStyle(input, { fg: "brightMagenta" }), brightCyan = (input) => applyStyle(input, { fg: "brightCyan" }), brightWhite = (input) => applyStyle(input, { fg: "brightWhite" }), bgBlack = (input) => applyStyle(input, { bg: "black" }), bgRed = (input) => applyStyle(input, { bg: "red" }), bgGreen = (input) => applyStyle(input, { bg: "green" }), bgYellow = (input) => applyStyle(input, { bg: "yellow" }), bgBlue = (input) => applyStyle(input, { bg: "blue" }), bgMagenta = (input) => applyStyle(input, { bg: "magenta" }), bgCyan = (input) => applyStyle(input, { bg: "cyan" }), bgWhite = (input) => applyStyle(input, { bg: "white" }), bold = (input) => applyStyle(input, { bold: true }), italic = (input) => applyStyle(input, { italic: true }), underline = (input) => applyStyle(input, { underline: true }), strikethrough = (input) => applyStyle(input, { strikethrough: true }), dim2 = (input) => applyStyle(input, { dim: true }), reverse = (input) => applyStyle(input, { reverse: true }), blink = (input) => applyStyle(input, { blink: true }), fg = (color) => (input) => applyStyle(input, { fg: color }), bg = (color) => (input) => applyStyle(input, { bg: color }), link = (url2) => (input) => {
137695
138757
  const chunk = typeof input === "object" && "__isChunk" in input ? input : {
137696
138758
  __isChunk: true,
137697
138759
  text: String(input)
@@ -142859,7 +143921,7 @@ var init_index_vy1rm1x3 = __esm(async () => {
142859
143921
  worker_path = this.options.workerPath;
142860
143922
  } else {
142861
143923
  worker_path = new URL("./parser.worker.js", import.meta.url).href;
142862
- if (!existsSync53(resolve210(import.meta.dirname, "parser.worker.js"))) {
143924
+ if (!existsSync54(resolve210(import.meta.dirname, "parser.worker.js"))) {
142863
143925
  worker_path = new URL("./parser.worker.ts", import.meta.url).href;
142864
143926
  }
142865
143927
  }
@@ -152734,7 +153796,7 @@ var init_index_dg6qsc3m = __esm(async () => {
152734
153796
  envRegistry: () => envRegistry,
152735
153797
  env: () => env,
152736
153798
  engine: () => engine,
152737
- dim: () => dim,
153799
+ dim: () => dim2,
152738
153800
  detectLinks: () => detectLinks,
152739
153801
  delegate: () => delegate,
152740
153802
  decodePasteBytes: () => decodePasteBytes,
@@ -167978,7 +169040,7 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet
167978
169040
  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
167979
169041
  offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
167980
169042
  commitReconciliationEffects(finishedWork);
167981
- if (flags & 8192 && (root = finishedWork.stateNode, root._visibility = hoistableRoot ? root._visibility & -2 : root._visibility | 1, hoistableRoot && (current2 === null || wasHidden || offscreenSubtreeIsHidden || offscreenSubtreeWasHidden || recursivelyTraverseDisappearLayoutEffects(finishedWork)), supportsMutation))
169043
+ if (flags & 8192 && (root = finishedWork.stateNode, root._visibility = hoistableRoot ? root._visibility & -2 : root._visibility | 1, hoistableRoot && (current2 === null || wasHidden || offscreenSubtreeIsHidden || offscreenSubtreeWasHidden || recursivelyTraverseDisappearLayoutEffects(finishedWork)), supportsMutation)) {
167982
169044
  a:
167983
169045
  if (current2 = null, supportsMutation)
167984
169046
  for (root = finishedWork;; ) {
@@ -168018,6 +169080,7 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet
168018
169080
  root.sibling.return = root.return;
168019
169081
  root = root.sibling;
168020
169082
  }
169083
+ }
168021
169084
  flags & 4 && (flags = finishedWork.updateQueue, flags !== null && (current2 = flags.retryQueue, current2 !== null && (flags.retryQueue = null, attachSuspenseRetryListeners(finishedWork, current2))));
168022
169085
  break;
168023
169086
  case 19:
@@ -172313,7 +173376,7 @@ var require_backend = __commonJS((exports, module2) => {
172313
173376
  987: (module3, __unused_webpack_exports, __webpack_require__2) => {
172314
173377
  if (true) {
172315
173378
  module3.exports = __webpack_require__2(786);
172316
- } else {}
173379
+ }
172317
173380
  },
172318
173381
  126: (__unused_webpack_module, exports2, __webpack_require__2) => {
172319
173382
  var process4 = __webpack_require__2(169);
@@ -172763,7 +173826,7 @@ var require_backend = __commonJS((exports, module2) => {
172763
173826
  189: (module3, __unused_webpack_exports, __webpack_require__2) => {
172764
173827
  if (true) {
172765
173828
  module3.exports = __webpack_require__2(126);
172766
- } else {}
173829
+ }
172767
173830
  },
172768
173831
  206: function(module3, exports2, __webpack_require__2) {
172769
173832
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
@@ -172778,7 +173841,7 @@ var require_backend = __commonJS((exports, module2) => {
172778
173841
  (function(root, factory) {
172779
173842
  if (true) {
172780
173843
  __WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__2(430)], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module3.exports = __WEBPACK_AMD_DEFINE_RESULT__);
172781
- } else {}
173844
+ }
172782
173845
  })(this, function ErrorStackParser(StackFrame) {
172783
173846
  var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
172784
173847
  var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
@@ -173474,7 +174537,7 @@ var require_backend = __commonJS((exports, module2) => {
173474
174537
  (function(root, factory) {
173475
174538
  if (true) {
173476
174539
  __WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module3.exports = __WEBPACK_AMD_DEFINE_RESULT__);
173477
- } else {}
174540
+ }
173478
174541
  })(this, function() {
173479
174542
  function _isNumber(n) {
173480
174543
  return !isNaN(parseFloat(n)) && isFinite(n);
@@ -178848,7 +179911,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
178848
179911
  var suffix = "";
178849
179912
  if (true) {
178850
179913
  suffix = " (<anonymous>)";
178851
- } else {}
179914
+ }
178852
179915
  return `
178853
179916
  ` + prefix + name2 + suffix;
178854
179917
  }
@@ -181577,7 +182640,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
181577
182640
  hasChanges = true;
181578
182641
  updateMostRecentlyInspectedElementIfNecessary(devtoolsInstance.id);
181579
182642
  }
181580
- } else {}
182643
+ }
181581
182644
  }
181582
182645
  } catch (err) {
181583
182646
  _iterator2.e(err);
@@ -183356,7 +184419,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
183356
184419
  if (contentFiber === null) {
183357
184420
  throw new Error("There should always be an Offscreen Fiber child in a hydrated Suspense boundary.");
183358
184421
  }
183359
- } else {}
184422
+ }
183360
184423
  var _isTimedOut = fiber.memoizedState !== null;
183361
184424
  if (!_isTimedOut) {
183362
184425
  newSuspenseNode.rects = measureInstance(newInstance);
@@ -183390,7 +184453,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
183390
184453
  if (_contentFiber === null) {
183391
184454
  throw new Error("There should always be an Offscreen Fiber child in a hydrated Suspense boundary.");
183392
184455
  }
183393
- } else {}
184456
+ }
183394
184457
  var suspenseState = fiber.memoizedState;
183395
184458
  var _isTimedOut3 = suspenseState !== null;
183396
184459
  if (!_isTimedOut3) {
@@ -183490,7 +184553,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
183490
184553
  trackThrownPromisesFromRetryCache(newSuspenseNode, fiber.stateNode);
183491
184554
  mountSuspenseChildrenRecursively(_contentFiber2, traceNearestHostComponentUpdate, stashedSuspenseParent, stashedSuspensePrevious, stashedSuspenseRemaining);
183492
184555
  shouldPopSuspenseNode = false;
183493
- } else {}
184556
+ }
183494
184557
  } else {
183495
184558
  if (fiber.child !== null) {
183496
184559
  mountChildrenRecursively(fiber.child, traceNearestHostComponentUpdate);
@@ -184076,7 +185139,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
184076
185139
  shouldPopSuspenseNode = false;
184077
185140
  } else if (previousHydrated && !nextHydrated) {
184078
185141
  throw new Error("Encountered a dehydrated Suspense boundary that was previously hydrated.");
184079
- } else {}
185142
+ }
184080
185143
  } else {
184081
185144
  if (nextFiber.child !== prevFiber.child) {
184082
185145
  updateFlags |= updateChildrenRecursively(nextFiber.child, prevFiber.child, traceNearestHostComponentUpdate);
@@ -184122,8 +185185,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
184122
185185
  recordResetChildren(fiberInstance);
184123
185186
  }
184124
185187
  updateFlags &= ~ShouldResetChildren;
184125
- } else {}
184126
- } else {}
185188
+ }
185189
+ }
184127
185190
  if ((updateFlags & ShouldResetSuspenseChildren) !== NoUpdate) {
184128
185191
  if (fiberInstance !== null && fiberInstance.kind === FIBER_INSTANCE) {
184129
185192
  var _suspenseNode3 = fiberInstance.suspenseNode;
@@ -184131,7 +185194,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
184131
185194
  recordResetSuspenseChildren(_suspenseNode3);
184132
185195
  updateFlags &= ~ShouldResetSuspenseChildren;
184133
185196
  }
184134
- } else {}
185197
+ }
184135
185198
  }
184136
185199
  if ((updateFlags & ShouldResetParentSuspenseChildren) !== NoUpdate) {
184137
185200
  if (fiberInstance !== null && fiberInstance.kind === FIBER_INSTANCE) {
@@ -184140,7 +185203,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
184140
185203
  updateFlags &= ~ShouldResetParentSuspenseChildren;
184141
185204
  updateFlags |= ShouldResetSuspenseChildren;
184142
185205
  }
184143
- } else {}
185206
+ }
184144
185207
  }
184145
185208
  return updateFlags;
184146
185209
  } finally {
@@ -187204,7 +188267,7 @@ The error thrown in the component is:
187204
188267
  rendererInterface = renderer_attach(hook, id, renderer, global2, shouldStartProfilingNow, profilingSettings);
187205
188268
  } else if (renderer.ComponentTree) {
187206
188269
  rendererInterface = legacy_renderer_attach(hook, id, renderer, global2);
187207
- } else {}
188270
+ }
187208
188271
  }
187209
188272
  return rendererInterface;
187210
188273
  }
@@ -189142,7 +190205,7 @@ function offlineBrokerHealth(baseUrl, error48) {
189142
190205
  };
189143
190206
  }
189144
190207
  var DEFAULT_MONITOR_CHANNEL = "shared", DEFAULT_MONITOR_MESSAGE_LIMIT = 64, SCOUT_MONITOR_ASSISTANT_ID = "scoutbot";
189145
- var init_service10 = __esm(() => {
190208
+ var init_service11 = __esm(() => {
189146
190209
  init_service3();
189147
190210
  init_service8();
189148
190211
  init_service5();
@@ -192007,7 +193070,7 @@ var import_react13, C2, MONITOR_TABS, operatorName, MESSAGE_COMPOSER_KEY_BINDING
192007
193070
  var init_app2 = __esm(async () => {
192008
193071
  init_src();
192009
193072
  init_user_config();
192010
- init_service10();
193073
+ init_service11();
192011
193074
  init_service3();
192012
193075
  init_paths();
192013
193076
  init_view2();
@@ -192223,7 +193286,7 @@ var exports_up = {};
192223
193286
  __export(exports_up, {
192224
193287
  runUpCommand: () => runUpCommand
192225
193288
  });
192226
- import { existsSync as existsSync54 } from "fs";
193289
+ import { existsSync as existsSync55 } from "fs";
192227
193290
  import { resolve as resolve40 } from "path";
192228
193291
  function looksLikePath(value) {
192229
193292
  return value.includes("/") || value.startsWith(".") || value.startsWith("~");
@@ -192332,7 +193395,7 @@ async function runUpCommand(context, args) {
192332
193395
  throw new ScoutCliError(`usage: scout up <name|path> [--name <alias>] [--harness <${SUPPORTED_LOCAL_AGENT_HARNESSES.join("|")}>] [--provider <provider>] [--model <model>] [--reasoning-effort <effort>] [--permission-profile <${formatScoutPermissionProfiles()}>]`);
192333
193396
  }
192334
193397
  let projectPath;
192335
- if (looksLikePath(target2) || existsSync54(resolve40(target2))) {
193398
+ if (looksLikePath(target2) || existsSync55(resolve40(target2))) {
192336
193399
  projectPath = resolve40(target2);
192337
193400
  } else {
192338
193401
  const resolved = await resolveLocalAgentByName(target2);
@@ -192656,13 +193719,13 @@ __export(exports_whoami, {
192656
193719
  renderWhoAmICommandHelp: () => renderWhoAmICommandHelp
192657
193720
  });
192658
193721
  import { access as access2 } from "fs/promises";
192659
- import { join as join68 } from "path";
193722
+ import { join as join69 } from "path";
192660
193723
  async function resolveProjectAgentsMd(projectRoot) {
192661
193724
  if (!projectRoot) {
192662
193725
  return null;
192663
193726
  }
192664
193727
  for (const candidate of PROJECT_AGENT_INSTRUCTION_CANDIDATES) {
192665
- const path6 = join68(projectRoot, candidate);
193728
+ const path6 = join69(projectRoot, candidate);
192666
193729
  try {
192667
193730
  await access2(path6);
192668
193731
  return path6;
@@ -192742,10 +193805,10 @@ var init_whoami = __esm(() => {
192742
193805
  });
192743
193806
 
192744
193807
  // ../../apps/desktop/src/cli/main.ts
192745
- import { existsSync as existsSync55, statSync as statSync14 } from "fs";
192746
- import { join as join70 } from "path";
193808
+ import { existsSync as existsSync56, statSync as statSync15 } from "fs";
193809
+ import { join as join71 } from "path";
192747
193810
  import { spawnSync as spawnSync12 } from "child_process";
192748
- import { homedir as homedir48 } from "os";
193811
+ import { homedir as homedir49 } from "os";
192749
193812
 
192750
193813
  // ../../apps/desktop/src/cli/argv.ts
192751
193814
  function parseScoutArgv(argv) {
@@ -192863,7 +193926,7 @@ async function loadScoutCommandHandler(name2) {
192863
193926
  case "statusline":
192864
193927
  return (await Promise.resolve().then(() => (init_statusline(), exports_statusline))).runStatuslineCommand;
192865
193928
  case "tail":
192866
- return (await Promise.resolve().then(() => (init_tail(), exports_tail))).runTailCommand;
193929
+ return (await Promise.resolve().then(() => (init_tail2(), exports_tail))).runTailCommand;
192867
193930
  case "tui":
192868
193931
  return (await init_tui().then(() => exports_tui)).runTuiCommand;
192869
193932
  case "up":
@@ -193087,7 +194150,7 @@ init_options();
193087
194150
  // ../../apps/desktop/src/cli/broker-update.ts
193088
194151
  import { randomUUID as randomUUID7 } from "crypto";
193089
194152
  import { mkdir as mkdir15, readFile as readFile18, rename, rm as rm6, stat as stat6, writeFile as writeFile12 } from "fs/promises";
193090
- import { basename as basename26, dirname as dirname36, join as join69 } from "path";
194153
+ import { basename as basename26, dirname as dirname36, join as join70 } from "path";
193091
194154
 
193092
194155
  // ../../apps/desktop/src/cli/runtime-freshness.ts
193093
194156
  function isRecord16(value) {
@@ -193159,7 +194222,7 @@ function lockPayloadsMatch(left, right) {
193159
194222
  }
193160
194223
  async function readLockPayload2(lockPath) {
193161
194224
  try {
193162
- const raw2 = JSON.parse(await readFile18(join69(lockPath, "owner.json"), "utf8"));
194225
+ const raw2 = JSON.parse(await readFile18(join70(lockPath, "owner.json"), "utf8"));
193163
194226
  if (Number.isInteger(raw2.pid) && typeof raw2.startedAt === "number" && Number.isFinite(raw2.startedAt) && typeof raw2.token === "string" && raw2.token.length > 0) {
193164
194227
  return {
193165
194228
  pid: raw2.pid,
@@ -193203,7 +194266,7 @@ async function tryCreateOwnedLock(lockPath) {
193203
194266
  try {
193204
194267
  await mkdir15(lockPath, { mode: 448 });
193205
194268
  created = true;
193206
- await writeFile12(join69(lockPath, "owner.json"), `${JSON.stringify(owner)}
194269
+ await writeFile12(join70(lockPath, "owner.json"), `${JSON.stringify(owner)}
193207
194270
  `, { encoding: "utf8", flag: "wx", mode: 384 });
193208
194271
  } catch (error48) {
193209
194272
  if (created) {
@@ -193227,7 +194290,7 @@ async function tryCreateOwnedLock(lockPath) {
193227
194290
  };
193228
194291
  }
193229
194292
  async function tryReclaimDeadLock(lockPath, observedOwner) {
193230
- const reclaimPath = join69(dirname36(lockPath), BROKER_UPDATE_RECLAIM_DIRECTORY);
194293
+ const reclaimPath = join70(dirname36(lockPath), BROKER_UPDATE_RECLAIM_DIRECTORY);
193231
194294
  const reclaimGuard = await tryCreateOwnedLock(reclaimPath);
193232
194295
  if (!reclaimGuard.acquired) {
193233
194296
  return false;
@@ -193298,7 +194361,7 @@ async function acquireBrokerUpdateLock(lockPath, waitTimeoutMs) {
193298
194361
  async function writeCliMtimeCheckpointAtomically(checkpointPath, mtime) {
193299
194362
  const checkpointDirectory = dirname36(checkpointPath);
193300
194363
  await mkdir15(checkpointDirectory, { recursive: true });
193301
- const temporaryPath = join69(checkpointDirectory, `.${basename26(checkpointPath)}.${process.pid}.${randomUUID7()}.tmp`);
194364
+ const temporaryPath = join70(checkpointDirectory, `.${basename26(checkpointPath)}.${process.pid}.${randomUUID7()}.tmp`);
193302
194365
  try {
193303
194366
  await writeFile12(temporaryPath, String(mtime), {
193304
194367
  encoding: "utf8",
@@ -193333,7 +194396,7 @@ async function ensureBrokerUptodate(options) {
193333
194396
  const report = options.report ?? (() => {
193334
194397
  return;
193335
194398
  });
193336
- const lockPath = join69(dirname36(options.checkpointPath), BROKER_UPDATE_LOCK_DIRECTORY);
194399
+ const lockPath = join70(dirname36(options.checkpointPath), BROKER_UPDATE_LOCK_DIRECTORY);
193337
194400
  let lock;
193338
194401
  try {
193339
194402
  lock = await acquireBrokerUpdateLock(lockPath, options.lockWaitTimeoutMs ?? BROKER_UPDATE_LOCK_WAIT_MS);
@@ -193447,21 +194510,21 @@ var _scoutBinPath = null;
193447
194510
  function getScoutBinPath() {
193448
194511
  if (_scoutBinPath)
193449
194512
  return _scoutBinPath;
193450
- _scoutBinPath = join70(homedir48(), ".bun", "bin", "scout");
193451
- if (!existsSync55(_scoutBinPath)) {
194513
+ _scoutBinPath = join71(homedir49(), ".bun", "bin", "scout");
194514
+ if (!existsSync56(_scoutBinPath)) {
193452
194515
  _scoutBinPath = spawnSync12("which", ["scout"], { encoding: "utf8" }).stdout.trim();
193453
194516
  }
193454
194517
  return _scoutBinPath;
193455
194518
  }
193456
194519
  function readCurrentCliMtime() {
193457
194520
  try {
193458
- return normalizeCliBinaryMtimeMs(statSync14(getScoutBinPath()).mtimeMs);
194521
+ return normalizeCliBinaryMtimeMs(statSync15(getScoutBinPath()).mtimeMs);
193459
194522
  } catch {
193460
194523
  return null;
193461
194524
  }
193462
194525
  }
193463
194526
  function cliMtimeCheckpointPath() {
193464
- return join70(homedir48(), ".scout", "cli-mtime");
194527
+ return join71(homedir49(), ".scout", "cli-mtime");
193465
194528
  }
193466
194529
  try {
193467
194530
  await main3();