@xenosystem/agent-interface-ui 0.1.25 → 0.1.26

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 (380) hide show
  1. package/dist/adapters/agentHostPlatformBridge.d.ts.map +1 -1
  2. package/dist/adapters/agentHostPlatformBridge.js +96 -16
  3. package/dist/adapters/agentHostPlatformBridge.js.map +1 -1
  4. package/dist/adapters/hubAgentPlatformBridge.d.ts.map +1 -1
  5. package/dist/adapters/hubAgentPlatformBridge.js +2 -0
  6. package/dist/adapters/hubAgentPlatformBridge.js.map +1 -1
  7. package/dist/adapters/scopedBackupBridge.d.ts +4 -0
  8. package/dist/adapters/scopedBackupBridge.d.ts.map +1 -0
  9. package/dist/adapters/scopedBackupBridge.js +49 -0
  10. package/dist/adapters/scopedBackupBridge.js.map +1 -0
  11. package/dist/adapters/xenoAgentCompatibilityBridge.d.ts.map +1 -1
  12. package/dist/adapters/xenoAgentCompatibilityBridge.js +9 -1
  13. package/dist/adapters/xenoAgentCompatibilityBridge.js.map +1 -1
  14. package/dist/agent.css +13227 -0
  15. package/dist/components/agent/AgentIdentityGenerator.d.ts +16 -0
  16. package/dist/components/agent/AgentIdentityGenerator.d.ts.map +1 -0
  17. package/dist/components/agent/AgentIdentityGenerator.js +80 -0
  18. package/dist/components/agent/AgentIdentityGenerator.js.map +1 -0
  19. package/dist/components/agent/AgentInterface.d.ts +1 -0
  20. package/dist/components/agent/AgentInterface.d.ts.map +1 -1
  21. package/dist/components/agent/AgentInterface.js +1816 -643
  22. package/dist/components/agent/AgentInterface.js.map +1 -1
  23. package/dist/components/agent/AgentNotificationBanner.d.ts +10 -0
  24. package/dist/components/agent/AgentNotificationBanner.d.ts.map +1 -0
  25. package/dist/components/agent/AgentNotificationBanner.js +28 -0
  26. package/dist/components/agent/AgentNotificationBanner.js.map +1 -0
  27. package/dist/components/agent/AgentOnboarding.d.ts +16 -2
  28. package/dist/components/agent/AgentOnboarding.d.ts.map +1 -1
  29. package/dist/components/agent/AgentOnboarding.js +93 -201
  30. package/dist/components/agent/AgentOnboarding.js.map +1 -1
  31. package/dist/components/agent/AgentView.d.ts.map +1 -1
  32. package/dist/components/agent/AgentView.js +533 -308
  33. package/dist/components/agent/AgentView.js.map +1 -1
  34. package/dist/components/agent/AgentWorkbenchPanel.d.ts +3 -1
  35. package/dist/components/agent/AgentWorkbenchPanel.d.ts.map +1 -1
  36. package/dist/components/agent/AgentWorkbenchPanel.js +3 -2
  37. package/dist/components/agent/AgentWorkbenchPanel.js.map +1 -1
  38. package/dist/components/agent/AgentWorkspaceBrowserPanel.d.ts +4 -1
  39. package/dist/components/agent/AgentWorkspaceBrowserPanel.d.ts.map +1 -1
  40. package/dist/components/agent/AgentWorkspaceBrowserPanel.js +23 -195
  41. package/dist/components/agent/AgentWorkspaceBrowserPanel.js.map +1 -1
  42. package/dist/components/agent/AgentsWorkspaceView.d.ts +12 -0
  43. package/dist/components/agent/AgentsWorkspaceView.d.ts.map +1 -0
  44. package/dist/components/agent/AgentsWorkspaceView.js +129 -0
  45. package/dist/components/agent/AgentsWorkspaceView.js.map +1 -0
  46. package/dist/components/agent/DevelopmentCoordinationPanel.d.ts +7 -0
  47. package/dist/components/agent/DevelopmentCoordinationPanel.d.ts.map +1 -1
  48. package/dist/components/agent/DevelopmentCoordinationPanel.js +57 -49
  49. package/dist/components/agent/DevelopmentCoordinationPanel.js.map +1 -1
  50. package/dist/components/agent/KnowledgePanel.d.ts.map +1 -1
  51. package/dist/components/agent/KnowledgePanel.js +17 -67
  52. package/dist/components/agent/KnowledgePanel.js.map +1 -1
  53. package/dist/components/agent/LiveConversationCollaboration.d.ts +27 -0
  54. package/dist/components/agent/LiveConversationCollaboration.d.ts.map +1 -0
  55. package/dist/components/agent/LiveConversationCollaboration.js +127 -0
  56. package/dist/components/agent/LiveConversationCollaboration.js.map +1 -0
  57. package/dist/components/agent/MonacoDiffWorkbenchEditor.d.ts.map +1 -1
  58. package/dist/components/agent/MonacoDiffWorkbenchEditor.js +1 -1
  59. package/dist/components/agent/MonacoDiffWorkbenchEditor.js.map +1 -1
  60. package/dist/components/agent/MonacoWorkbenchEditor.d.ts.map +1 -1
  61. package/dist/components/agent/MonacoWorkbenchEditor.js +3 -3
  62. package/dist/components/agent/MonacoWorkbenchEditor.js.map +1 -1
  63. package/dist/components/agent/OwnedBrowserController.d.ts +55 -0
  64. package/dist/components/agent/OwnedBrowserController.d.ts.map +1 -0
  65. package/dist/components/agent/OwnedBrowserController.js +166 -0
  66. package/dist/components/agent/OwnedBrowserController.js.map +1 -0
  67. package/dist/components/agent/OwnedWorkforceView.d.ts +10 -0
  68. package/dist/components/agent/OwnedWorkforceView.d.ts.map +1 -0
  69. package/dist/components/agent/OwnedWorkforceView.js +256 -0
  70. package/dist/components/agent/OwnedWorkforceView.js.map +1 -0
  71. package/dist/components/agent/PluginManager.d.ts +34 -0
  72. package/dist/components/agent/PluginManager.d.ts.map +1 -1
  73. package/dist/components/agent/PluginManager.js +187 -126
  74. package/dist/components/agent/PluginManager.js.map +1 -1
  75. package/dist/components/agent/ProjectsWorkspaceView.d.ts +14 -0
  76. package/dist/components/agent/ProjectsWorkspaceView.d.ts.map +1 -0
  77. package/dist/components/agent/ProjectsWorkspaceView.js +176 -0
  78. package/dist/components/agent/ProjectsWorkspaceView.js.map +1 -0
  79. package/dist/components/agent/RunReviewPanel.d.ts +8 -13
  80. package/dist/components/agent/RunReviewPanel.d.ts.map +1 -1
  81. package/dist/components/agent/RunReviewPanel.js +120 -106
  82. package/dist/components/agent/RunReviewPanel.js.map +1 -1
  83. package/dist/components/agent/ScheduledWorkspaceView.d.ts +19 -0
  84. package/dist/components/agent/ScheduledWorkspaceView.d.ts.map +1 -0
  85. package/dist/components/agent/ScheduledWorkspaceView.js +150 -0
  86. package/dist/components/agent/ScheduledWorkspaceView.js.map +1 -0
  87. package/dist/components/agent/SdkSessionPanel.d.ts +25 -0
  88. package/dist/components/agent/SdkSessionPanel.d.ts.map +1 -0
  89. package/dist/components/agent/SdkSessionPanel.js +15 -0
  90. package/dist/components/agent/SdkSessionPanel.js.map +1 -0
  91. package/dist/components/agent/SlashCommandAutocomplete.d.ts +12 -0
  92. package/dist/components/agent/SlashCommandAutocomplete.d.ts.map +1 -0
  93. package/dist/components/agent/SlashCommandAutocomplete.js +33 -0
  94. package/dist/components/agent/SlashCommandAutocomplete.js.map +1 -0
  95. package/dist/components/agent/TeamsWorkspaceView.d.ts +12 -0
  96. package/dist/components/agent/TeamsWorkspaceView.d.ts.map +1 -0
  97. package/dist/components/agent/TeamsWorkspaceView.js +127 -0
  98. package/dist/components/agent/TeamsWorkspaceView.js.map +1 -0
  99. package/dist/components/agent/WorkspacePersistenceNotice.d.ts +3 -0
  100. package/dist/components/agent/WorkspacePersistenceNotice.d.ts.map +1 -0
  101. package/dist/components/agent/WorkspacePersistenceNotice.js +23 -0
  102. package/dist/components/agent/WorkspacePersistenceNotice.js.map +1 -0
  103. package/dist/components/agent/acp/AcpAgentConfigForm.d.ts +1 -0
  104. package/dist/components/agent/acp/AcpAgentConfigForm.d.ts.map +1 -1
  105. package/dist/components/agent/acp/AcpAgentConfigForm.js +47 -14
  106. package/dist/components/agent/acp/AcpAgentConfigForm.js.map +1 -1
  107. package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.js +1 -1
  108. package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.js.map +1 -1
  109. package/dist/components/agent/acp/AcpAgentManager.d.ts.map +1 -1
  110. package/dist/components/agent/acp/AcpAgentManager.js +18 -18
  111. package/dist/components/agent/acp/AcpAgentManager.js.map +1 -1
  112. package/dist/components/agent/acp/AcpAgentTestResultPanel.js +1 -1
  113. package/dist/components/agent/acp/AcpAgentTestResultPanel.js.map +1 -1
  114. package/dist/components/agent/acp/AcpApprovalPanel.js +2 -2
  115. package/dist/components/agent/acp/AcpApprovalPanel.js.map +1 -1
  116. package/dist/components/agent/acp/AcpCertificationPanel.js +1 -1
  117. package/dist/components/agent/acp/AcpCertificationPanel.js.map +1 -1
  118. package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.js +1 -1
  119. package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.js.map +1 -1
  120. package/dist/components/agent/acp/AcpProviderManagerPanel.js +1 -1
  121. package/dist/components/agent/acp/AcpProviderManagerPanel.js.map +1 -1
  122. package/dist/components/agent/acp/AcpProviderModelsPanel.js +1 -1
  123. package/dist/components/agent/acp/AcpProviderModelsPanel.js.map +1 -1
  124. package/dist/components/agent/acp/AcpSupportBundlePanel.js +1 -1
  125. package/dist/components/agent/acp/AcpSupportBundlePanel.js.map +1 -1
  126. package/dist/components/agent/collaborationWindow.d.ts +11 -0
  127. package/dist/components/agent/collaborationWindow.d.ts.map +1 -0
  128. package/dist/components/agent/collaborationWindow.js +10 -0
  129. package/dist/components/agent/collaborationWindow.js.map +1 -0
  130. package/dist/components/agent/conversationCollaborationAppendJournal.d.ts +25 -0
  131. package/dist/components/agent/conversationCollaborationAppendJournal.d.ts.map +1 -0
  132. package/dist/components/agent/conversationCollaborationAppendJournal.js +118 -0
  133. package/dist/components/agent/conversationCollaborationAppendJournal.js.map +1 -0
  134. package/dist/components/agent/conversationCollaborationController.d.ts +96 -0
  135. package/dist/components/agent/conversationCollaborationController.d.ts.map +1 -0
  136. package/dist/components/agent/conversationCollaborationController.js +597 -0
  137. package/dist/components/agent/conversationCollaborationController.js.map +1 -0
  138. package/dist/components/agent/destructiveConfirmation.d.ts +76 -0
  139. package/dist/components/agent/destructiveConfirmation.d.ts.map +1 -0
  140. package/dist/components/agent/destructiveConfirmation.js +231 -0
  141. package/dist/components/agent/destructiveConfirmation.js.map +1 -0
  142. package/dist/components/agent/developmentCoordinationController.d.ts +43 -0
  143. package/dist/components/agent/developmentCoordinationController.d.ts.map +1 -0
  144. package/dist/components/agent/developmentCoordinationController.js +94 -0
  145. package/dist/components/agent/developmentCoordinationController.js.map +1 -0
  146. package/dist/components/agent/developmentCoordinationProjection.d.ts +24 -0
  147. package/dist/components/agent/developmentCoordinationProjection.d.ts.map +1 -1
  148. package/dist/components/agent/developmentCoordinationProjection.js +34 -5
  149. package/dist/components/agent/developmentCoordinationProjection.js.map +1 -1
  150. package/dist/components/agent/editorOperationAuthority.d.ts +29 -0
  151. package/dist/components/agent/editorOperationAuthority.d.ts.map +1 -0
  152. package/dist/components/agent/editorOperationAuthority.js +73 -0
  153. package/dist/components/agent/editorOperationAuthority.js.map +1 -0
  154. package/dist/components/agent/knowledgePagination.d.ts +7 -0
  155. package/dist/components/agent/knowledgePagination.d.ts.map +1 -0
  156. package/dist/components/agent/knowledgePagination.js +7 -0
  157. package/dist/components/agent/knowledgePagination.js.map +1 -0
  158. package/dist/components/agent/knowledgePanelController.d.ts +32 -0
  159. package/dist/components/agent/knowledgePanelController.d.ts.map +1 -0
  160. package/dist/components/agent/knowledgePanelController.js +119 -0
  161. package/dist/components/agent/knowledgePanelController.js.map +1 -0
  162. package/dist/components/agent/monacoWorkbenchShared.js +1 -1
  163. package/dist/components/agent/onboardingModels.d.ts +31 -0
  164. package/dist/components/agent/onboardingModels.d.ts.map +1 -0
  165. package/dist/components/agent/onboardingModels.js +107 -0
  166. package/dist/components/agent/onboardingModels.js.map +1 -0
  167. package/dist/components/agent/personalConversationScope.d.ts +26 -0
  168. package/dist/components/agent/personalConversationScope.d.ts.map +1 -0
  169. package/dist/components/agent/personalConversationScope.js +43 -0
  170. package/dist/components/agent/personalConversationScope.js.map +1 -0
  171. package/dist/components/agent/reviewRequestScope.d.ts +16 -0
  172. package/dist/components/agent/reviewRequestScope.d.ts.map +1 -0
  173. package/dist/components/agent/reviewRequestScope.js +101 -0
  174. package/dist/components/agent/reviewRequestScope.js.map +1 -0
  175. package/dist/components/agent/scheduleCreationAttempt.d.ts +12 -0
  176. package/dist/components/agent/scheduleCreationAttempt.d.ts.map +1 -0
  177. package/dist/components/agent/scheduleCreationAttempt.js +30 -0
  178. package/dist/components/agent/scheduleCreationAttempt.js.map +1 -0
  179. package/dist/components/agent/settings/EntitySettingsLayout.d.ts +1 -1
  180. package/dist/components/agent/settings/EntitySettingsLayout.d.ts.map +1 -1
  181. package/dist/components/agent/settings/EntitySettingsLayout.js +64 -44
  182. package/dist/components/agent/settings/EntitySettingsLayout.js.map +1 -1
  183. package/dist/components/agent/settings/SettingsNavigation.d.ts.map +1 -1
  184. package/dist/components/agent/settings/SettingsNavigation.js +17 -17
  185. package/dist/components/agent/settings/SettingsNavigation.js.map +1 -1
  186. package/dist/components/agent/settings/entityArchiveState.d.ts +24 -0
  187. package/dist/components/agent/settings/entityArchiveState.d.ts.map +1 -0
  188. package/dist/components/agent/settings/entityArchiveState.js +12 -0
  189. package/dist/components/agent/settings/entityArchiveState.js.map +1 -0
  190. package/dist/components/agent/settings/sections/AccessMembersSection.d.ts.map +1 -1
  191. package/dist/components/agent/settings/sections/AccessMembersSection.js +10 -25
  192. package/dist/components/agent/settings/sections/AccessMembersSection.js.map +1 -1
  193. package/dist/components/agent/settings/sections/AccountWorkspacePanel.d.ts +16 -0
  194. package/dist/components/agent/settings/sections/AccountWorkspacePanel.d.ts.map +1 -0
  195. package/dist/components/agent/settings/sections/AccountWorkspacePanel.js +265 -0
  196. package/dist/components/agent/settings/sections/AccountWorkspacePanel.js.map +1 -0
  197. package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.d.ts.map +1 -1
  198. package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.js +47 -32
  199. package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.js.map +1 -1
  200. package/dist/components/agent/settings/sections/DangerZoneSection.d.ts.map +1 -1
  201. package/dist/components/agent/settings/sections/DangerZoneSection.js +30 -6
  202. package/dist/components/agent/settings/sections/DangerZoneSection.js.map +1 -1
  203. package/dist/components/agent/settings/sections/DefaultAgentConfigSection.d.ts.map +1 -1
  204. package/dist/components/agent/settings/sections/DefaultAgentConfigSection.js +47 -37
  205. package/dist/components/agent/settings/sections/DefaultAgentConfigSection.js.map +1 -1
  206. package/dist/components/agent/settings/sections/EnvironmentSecretsSection.d.ts.map +1 -1
  207. package/dist/components/agent/settings/sections/EnvironmentSecretsSection.js +30 -43
  208. package/dist/components/agent/settings/sections/EnvironmentSecretsSection.js.map +1 -1
  209. package/dist/components/agent/settings/sections/ExportBackupSection.d.ts +3 -1
  210. package/dist/components/agent/settings/sections/ExportBackupSection.d.ts.map +1 -1
  211. package/dist/components/agent/settings/sections/ExportBackupSection.js +14 -12
  212. package/dist/components/agent/settings/sections/ExportBackupSection.js.map +1 -1
  213. package/dist/components/agent/settings/sections/GeneralSection.d.ts.map +1 -1
  214. package/dist/components/agent/settings/sections/GeneralSection.js +47 -4
  215. package/dist/components/agent/settings/sections/GeneralSection.js.map +1 -1
  216. package/dist/components/agent/settings/sections/IntegrationsSection.d.ts.map +1 -1
  217. package/dist/components/agent/settings/sections/IntegrationsSection.js +14 -21
  218. package/dist/components/agent/settings/sections/IntegrationsSection.js.map +1 -1
  219. package/dist/components/agent/settings/sections/NotificationsSection.d.ts.map +1 -1
  220. package/dist/components/agent/settings/sections/NotificationsSection.js +125 -20
  221. package/dist/components/agent/settings/sections/NotificationsSection.js.map +1 -1
  222. package/dist/components/agent/settings/sections/ResourceLimitsSection.d.ts.map +1 -1
  223. package/dist/components/agent/settings/sections/ResourceLimitsSection.js +7 -7
  224. package/dist/components/agent/settings/sections/ResourceLimitsSection.js.map +1 -1
  225. package/dist/components/agent/settings/sections/SecurityComplianceSection.d.ts.map +1 -1
  226. package/dist/components/agent/settings/sections/SecurityComplianceSection.js +5 -4
  227. package/dist/components/agent/settings/sections/SecurityComplianceSection.js.map +1 -1
  228. package/dist/components/agent/settings/sections/UsageAnalyticsSection.d.ts.map +1 -1
  229. package/dist/components/agent/settings/sections/UsageAnalyticsSection.js +2 -3
  230. package/dist/components/agent/settings/sections/UsageAnalyticsSection.js.map +1 -1
  231. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.d.ts.map +1 -1
  232. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js +39 -26
  233. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js.map +1 -1
  234. package/dist/components/agent/settings/sections/WorkspaceKeysPanel.d.ts +6 -0
  235. package/dist/components/agent/settings/sections/WorkspaceKeysPanel.d.ts.map +1 -0
  236. package/dist/components/agent/settings/sections/WorkspaceKeysPanel.js +205 -0
  237. package/dist/components/agent/settings/sections/WorkspaceKeysPanel.js.map +1 -0
  238. package/dist/components/agent/settings/sections/environmentDraftAction.d.ts +3 -0
  239. package/dist/components/agent/settings/sections/environmentDraftAction.d.ts.map +1 -0
  240. package/dist/components/agent/settings/sections/environmentDraftAction.js +6 -0
  241. package/dist/components/agent/settings/sections/environmentDraftAction.js.map +1 -0
  242. package/dist/components/agent/settings/sections/membershipOperationProjection.d.ts +3 -0
  243. package/dist/components/agent/settings/sections/membershipOperationProjection.d.ts.map +1 -0
  244. package/dist/components/agent/settings/sections/membershipOperationProjection.js +9 -0
  245. package/dist/components/agent/settings/sections/membershipOperationProjection.js.map +1 -0
  246. package/dist/components/agent/settings/sections/workspaceKeyOperationProjection.d.ts +6 -0
  247. package/dist/components/agent/settings/sections/workspaceKeyOperationProjection.d.ts.map +1 -0
  248. package/dist/components/agent/settings/sections/workspaceKeyOperationProjection.js +8 -0
  249. package/dist/components/agent/settings/sections/workspaceKeyOperationProjection.js.map +1 -0
  250. package/dist/components/agent/settings/shared/InAppConfirmationDialog.d.ts +25 -0
  251. package/dist/components/agent/settings/shared/InAppConfirmationDialog.d.ts.map +1 -0
  252. package/dist/components/agent/settings/shared/InAppConfirmationDialog.js +89 -0
  253. package/dist/components/agent/settings/shared/InAppConfirmationDialog.js.map +1 -0
  254. package/dist/components/agent/settings/shared/InputField.d.ts +1 -1
  255. package/dist/components/agent/settings/shared/InputField.d.ts.map +1 -1
  256. package/dist/components/agent/settings/shared/InputField.js +4 -3
  257. package/dist/components/agent/settings/shared/InputField.js.map +1 -1
  258. package/dist/components/agent/settings/shared/MembersTable.d.ts +3 -3
  259. package/dist/components/agent/settings/shared/MembersTable.d.ts.map +1 -1
  260. package/dist/components/agent/settings/shared/MembersTable.js +1 -1
  261. package/dist/components/agent/settings/shared/MembersTable.js.map +1 -1
  262. package/dist/components/agent/settings/shared/ScopedAuditPanel.d.ts +5 -0
  263. package/dist/components/agent/settings/shared/ScopedAuditPanel.d.ts.map +1 -0
  264. package/dist/components/agent/settings/shared/ScopedAuditPanel.js +70 -0
  265. package/dist/components/agent/settings/shared/ScopedAuditPanel.js.map +1 -0
  266. package/dist/components/agent/settings/shared/SettingsCard.d.ts +2 -1
  267. package/dist/components/agent/settings/shared/SettingsCard.d.ts.map +1 -1
  268. package/dist/components/agent/settings/shared/SettingsCard.js +2 -2
  269. package/dist/components/agent/settings/shared/SettingsCard.js.map +1 -1
  270. package/dist/components/agent/settings/shared/ToggleSwitch.d.ts.map +1 -1
  271. package/dist/components/agent/settings/shared/ToggleSwitch.js +1 -1
  272. package/dist/components/agent/settings/shared/ToggleSwitch.js.map +1 -1
  273. package/dist/components/agent/settings/shared/UsageChart.d.ts +10 -0
  274. package/dist/components/agent/settings/shared/UsageChart.d.ts.map +1 -1
  275. package/dist/components/agent/settings/shared/UsageChart.js +16 -10
  276. package/dist/components/agent/settings/shared/UsageChart.js.map +1 -1
  277. package/dist/components/agent/settings/shared/WorkspaceRulesControl.d.ts +8 -0
  278. package/dist/components/agent/settings/shared/WorkspaceRulesControl.d.ts.map +1 -0
  279. package/dist/components/agent/settings/shared/WorkspaceRulesControl.js +26 -0
  280. package/dist/components/agent/settings/shared/WorkspaceRulesControl.js.map +1 -0
  281. package/dist/components/agent/settings/shared/useScopedConfirmation.d.ts +8 -0
  282. package/dist/components/agent/settings/shared/useScopedConfirmation.d.ts.map +1 -0
  283. package/dist/components/agent/settings/shared/useScopedConfirmation.js +53 -0
  284. package/dist/components/agent/settings/shared/useScopedConfirmation.js.map +1 -0
  285. package/dist/components/agent/settings/shared/useSettingsConfirmation.d.ts +8 -0
  286. package/dist/components/agent/settings/shared/useSettingsConfirmation.d.ts.map +1 -0
  287. package/dist/components/agent/settings/shared/useSettingsConfirmation.js +51 -0
  288. package/dist/components/agent/settings/shared/useSettingsConfirmation.js.map +1 -0
  289. package/dist/components/agent/settings/shared/workspaceRulesController.d.ts +28 -0
  290. package/dist/components/agent/settings/shared/workspaceRulesController.d.ts.map +1 -0
  291. package/dist/components/agent/settings/shared/workspaceRulesController.js +82 -0
  292. package/dist/components/agent/settings/shared/workspaceRulesController.js.map +1 -0
  293. package/dist/components/agent/sidebarEntityPins.d.ts +11 -0
  294. package/dist/components/agent/sidebarEntityPins.d.ts.map +1 -0
  295. package/dist/components/agent/sidebarEntityPins.js +37 -0
  296. package/dist/components/agent/sidebarEntityPins.js.map +1 -0
  297. package/dist/components/agent/workspaceHierarchy.d.ts +24 -0
  298. package/dist/components/agent/workspaceHierarchy.d.ts.map +1 -0
  299. package/dist/components/agent/workspaceHierarchy.js +50 -0
  300. package/dist/components/agent/workspaceHierarchy.js.map +1 -0
  301. package/dist/components/product/XenoAgentProductHeader.d.ts +4 -2
  302. package/dist/components/product/XenoAgentProductHeader.d.ts.map +1 -1
  303. package/dist/components/product/XenoAgentProductHeader.js +22 -4
  304. package/dist/components/product/XenoAgentProductHeader.js.map +1 -1
  305. package/dist/components/product/XenoAgentSessionTabs.js +1 -1
  306. package/dist/components/product/XenoAgentSessionTabs.js.map +1 -1
  307. package/dist/components/product/XenoAgentWorkspaceSelector.d.ts +7 -0
  308. package/dist/components/product/XenoAgentWorkspaceSelector.d.ts.map +1 -0
  309. package/dist/components/product/XenoAgentWorkspaceSelector.js +237 -0
  310. package/dist/components/product/XenoAgentWorkspaceSelector.js.map +1 -0
  311. package/dist/components/workspace/WorkspaceCreationWizard.d.ts +6 -0
  312. package/dist/components/workspace/WorkspaceCreationWizard.d.ts.map +1 -0
  313. package/dist/components/workspace/WorkspaceCreationWizard.js +48 -0
  314. package/dist/components/workspace/WorkspaceCreationWizard.js.map +1 -0
  315. package/dist/hooks/useSidebarLayoutPreference.d.ts +29 -0
  316. package/dist/hooks/useSidebarLayoutPreference.d.ts.map +1 -0
  317. package/dist/hooks/useSidebarLayoutPreference.js +83 -0
  318. package/dist/hooks/useSidebarLayoutPreference.js.map +1 -0
  319. package/dist/hooks/useWorkspaceCreation.d.ts +8 -0
  320. package/dist/hooks/useWorkspaceCreation.d.ts.map +1 -0
  321. package/dist/hooks/useWorkspaceCreation.js +40 -0
  322. package/dist/hooks/useWorkspaceCreation.js.map +1 -0
  323. package/dist/index.d.ts +3 -0
  324. package/dist/index.d.ts.map +1 -1
  325. package/dist/index.js +3 -0
  326. package/dist/index.js.map +1 -1
  327. package/dist/platformApiTypes.d.ts +77 -36
  328. package/dist/platformApiTypes.d.ts.map +1 -1
  329. package/dist/platformBridge.d.ts +4 -0
  330. package/dist/platformBridge.d.ts.map +1 -1
  331. package/dist/platformBridge.js +10 -0
  332. package/dist/platformBridge.js.map +1 -1
  333. package/dist/stores/agentChatStore.d.ts +120 -2
  334. package/dist/stores/agentChatStore.d.ts.map +1 -1
  335. package/dist/stores/agentChatStore.js +329 -35
  336. package/dist/stores/agentChatStore.js.map +1 -1
  337. package/dist/stores/agentCreationDefaults.d.ts +25 -0
  338. package/dist/stores/agentCreationDefaults.d.ts.map +1 -0
  339. package/dist/stores/agentCreationDefaults.js +11 -0
  340. package/dist/stores/agentCreationDefaults.js.map +1 -0
  341. package/dist/stores/entitySettingsStore.d.ts +37 -12
  342. package/dist/stores/entitySettingsStore.d.ts.map +1 -1
  343. package/dist/stores/entitySettingsStore.js +558 -585
  344. package/dist/stores/entitySettingsStore.js.map +1 -1
  345. package/dist/stores/suggestionStore.d.ts +9 -2
  346. package/dist/stores/suggestionStore.d.ts.map +1 -1
  347. package/dist/stores/suggestionStore.js +51 -24
  348. package/dist/stores/suggestionStore.js.map +1 -1
  349. package/dist/stores/workspaceCreationAttempt.d.ts +14 -0
  350. package/dist/stores/workspaceCreationAttempt.d.ts.map +1 -0
  351. package/dist/stores/workspaceCreationAttempt.js +35 -0
  352. package/dist/stores/workspaceCreationAttempt.js.map +1 -0
  353. package/dist/stores/workspaceReconciliation.d.ts +6 -0
  354. package/dist/stores/workspaceReconciliation.d.ts.map +1 -0
  355. package/dist/stores/workspaceReconciliation.js +33 -0
  356. package/dist/stores/workspaceReconciliation.js.map +1 -0
  357. package/dist/stores/workspaceStore.d.ts +44 -9
  358. package/dist/stores/workspaceStore.d.ts.map +1 -1
  359. package/dist/stores/workspaceStore.js +238 -99
  360. package/dist/stores/workspaceStore.js.map +1 -1
  361. package/dist/types/agentEditor.d.ts +1 -0
  362. package/dist/types/agentEditor.d.ts.map +1 -1
  363. package/dist/utils/advertisedReasoning.d.ts +25 -0
  364. package/dist/utils/advertisedReasoning.d.ts.map +1 -0
  365. package/dist/utils/advertisedReasoning.js +62 -0
  366. package/dist/utils/advertisedReasoning.js.map +1 -0
  367. package/dist/utils/clipboardCopy.d.ts +4 -0
  368. package/dist/utils/clipboardCopy.d.ts.map +1 -0
  369. package/dist/utils/clipboardCopy.js +27 -0
  370. package/dist/utils/clipboardCopy.js.map +1 -0
  371. package/dist/utils/providerCommandArgs.d.ts +11 -0
  372. package/dist/utils/providerCommandArgs.d.ts.map +1 -0
  373. package/dist/utils/providerCommandArgs.js +18 -0
  374. package/dist/utils/providerCommandArgs.js.map +1 -0
  375. package/dist/utils/rendererTeardown.d.ts +6 -0
  376. package/dist/utils/rendererTeardown.d.ts.map +1 -0
  377. package/dist/utils/rendererTeardown.js +18 -0
  378. package/dist/utils/rendererTeardown.js.map +1 -0
  379. package/package.json +20 -8
  380. package/src/agent.css +39 -9
@@ -6,7 +6,7 @@ import { getAgentPlatformBridge } from '../../platformBridge.js';
6
6
  * State is owned by the main-process PluginMcpManagerService under ~/.xeno.
7
7
  * This renderer only manages UI state and sends scoped commands over IPC.
8
8
  */
9
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
9
+ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useState, useSyncExternalStore } from 'react';
10
10
  import { AlertTriangle, Check, Eye, Package, Pause, Play, PlugZap, Plus, RefreshCw, Search, Server, ShieldAlert, ShieldCheck, Trash2, Upload, Download, } from 'lucide-react';
11
11
  function asStringArray(value) {
12
12
  return Array.isArray(value) ? value.filter((entry) => typeof entry === 'string') : [];
@@ -268,7 +268,103 @@ function parseJsonObject(value) {
268
268
  if (!trimmed)
269
269
  return {};
270
270
  const parsed = JSON.parse(trimmed);
271
- return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {};
271
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
272
+ throw new Error('MCP input must be a JSON object.');
273
+ return parsed;
274
+ }
275
+ /** Arguments are data, not a shell command. JSON preserves spaces, empty args and backslashes. */
276
+ export function parsePluginMcpArguments(value) {
277
+ if (!value.trim())
278
+ return [];
279
+ let parsed;
280
+ try {
281
+ parsed = JSON.parse(value);
282
+ }
283
+ catch {
284
+ throw new Error('MCP arguments must be a JSON array of strings, for example ["--name", "two words"].');
285
+ }
286
+ if (!Array.isArray(parsed) || !parsed.every((arg) => typeof arg === 'string' && !arg.includes('\0'))) {
287
+ throw new Error('MCP arguments must be a JSON array of strings without NUL characters.');
288
+ }
289
+ return parsed;
290
+ }
291
+ /** Shared by the actual component: scope incarnation, latest reads, and settlement-owned singleflight. */
292
+ export class PluginManagerOperations {
293
+ generation = 0;
294
+ readVersion = 0;
295
+ active = false;
296
+ busy = null;
297
+ draftRevisions = { install: 0, mcp: 0 };
298
+ listeners = new Set();
299
+ getBusy = () => this.busy;
300
+ subscribe = (listener) => { this.listeners.add(listener); return () => { this.listeners.delete(listener); }; };
301
+ activate() { this.active = true; this.generation++; this.readVersion++; }
302
+ invalidate() { this.active = false; this.generation++; this.readVersion++; }
303
+ editDraft(key) { this.draftRevisions[key]++; }
304
+ captureDraft(key, clear) {
305
+ const current = this.capture(), revision = this.draftRevisions[key];
306
+ return () => { if (current() && this.draftRevisions[key] === revision)
307
+ clear(); };
308
+ }
309
+ capture() {
310
+ const generation = this.generation;
311
+ return () => this.active && generation === this.generation;
312
+ }
313
+ async read(request, callbacks) {
314
+ if (!this.active)
315
+ return;
316
+ const scopeCurrent = this.capture(), version = ++this.readVersion;
317
+ const current = () => scopeCurrent() && version === this.readVersion;
318
+ callbacks.start();
319
+ try {
320
+ const result = await request();
321
+ if (current())
322
+ callbacks.success(result);
323
+ }
324
+ catch (error) {
325
+ if (current())
326
+ callbacks.failure(error);
327
+ }
328
+ finally {
329
+ if (current())
330
+ callbacks.finish();
331
+ }
332
+ }
333
+ async run(label, request, callbacks) {
334
+ if (!this.active || this.busy !== null)
335
+ return false;
336
+ const current = this.capture();
337
+ if (callbacks.invalidateReads !== false)
338
+ this.readVersion++; // Pre-mutation reads cannot overwrite ACKs.
339
+ this.busy = label;
340
+ for (const notify of this.listeners)
341
+ notify();
342
+ let acknowledged = false;
343
+ try {
344
+ callbacks.start();
345
+ const result = await request();
346
+ if (!current())
347
+ return false;
348
+ if (result.success !== true)
349
+ throw new Error(result.error || `${label} failed.`);
350
+ acknowledged = true;
351
+ await callbacks.success(result);
352
+ return current();
353
+ }
354
+ catch (error) {
355
+ if (current())
356
+ callbacks.failure(`${acknowledged ? `Completed ${label}, but refreshing failed: ` : ''}${error instanceof Error ? error.message : `${label} failed.`}`);
357
+ return acknowledged && current();
358
+ }
359
+ finally {
360
+ if (current())
361
+ callbacks.finish();
362
+ // Scope changes invalidate callbacks, not ownership of an already-admitted mutation.
363
+ this.busy = null;
364
+ for (const notify of this.listeners)
365
+ notify();
366
+ }
367
+ }
272
368
  }
273
369
  function scopeLabel(scope) {
274
370
  if (scope.type === 'agent')
@@ -280,10 +376,12 @@ function scopeLabel(scope) {
280
376
  return 'global';
281
377
  }
282
378
  export function PluginManager({ className = '', caller }) {
379
+ const scopeKey = JSON.stringify([caller?.workspaceId, caller?.teamId, caller?.agentId, caller?.allowedDirectories]);
380
+ const [operations] = useState(() => new PluginManagerOperations());
283
381
  const [tab, setTab] = useState('plugins');
284
382
  const [snapshot, setSnapshot] = useState(() => asSnapshot(null));
285
383
  const [loading, setLoading] = useState(true);
286
- const [busy, setBusy] = useState(null);
384
+ const busy = useSyncExternalStore(operations.subscribe, operations.getBusy, operations.getBusy);
287
385
  const [error, setError] = useState(null);
288
386
  const [installInput, setInstallInput] = useState('');
289
387
  const [marketplaceQuery, setMarketplaceQuery] = useState('');
@@ -304,58 +402,72 @@ export function PluginManager({ className = '', caller }) {
304
402
  const [projectCwd, setProjectCwd] = useState(caller?.allowedDirectories?.[0] || '');
305
403
  const [mcpInputJson, setMcpInputJson] = useState('{}');
306
404
  const [resultPanel, setResultPanel] = useState(null);
307
- useEffect(() => {
405
+ useLayoutEffect(() => {
406
+ operations.activate();
407
+ setSnapshot(asSnapshot(null));
408
+ setLoading(true);
409
+ setError(null);
410
+ setMarketplaceResults([]);
411
+ setResultPanel(null);
308
412
  setScopeWorkspaceId(caller?.workspaceId || '');
309
413
  setScopeTeamId(caller?.teamId || '');
310
414
  setScopeAgentId(caller?.agentId || '');
311
- setProjectCwd((current) => current || caller?.allowedDirectories?.[0] || '');
312
- }, [caller?.agentId, caller?.allowedDirectories, caller?.teamId, caller?.workspaceId]);
415
+ setProjectCwd(caller?.allowedDirectories?.[0] || '');
416
+ setPolicyPluginAllow('');
417
+ setPolicyPluginDeny('');
418
+ setPolicyMcpAllow('');
419
+ setPolicyMcpDeny('');
420
+ setPolicyMcpExposure('context');
421
+ return () => operations.invalidate();
422
+ }, [operations, scopeKey]);
313
423
  const snapshotRequest = useMemo(() => ({
314
424
  includeSdkConfigured: true,
315
425
  cwd: caller?.allowedDirectories?.[0],
316
426
  workspaceId: caller?.workspaceId,
317
427
  teamId: caller?.teamId,
318
428
  agentId: caller?.agentId,
319
- allowedDirectories: caller?.allowedDirectories,
320
- }), [caller?.agentId, caller?.allowedDirectories, caller?.teamId, caller?.workspaceId]);
321
- const loadSnapshot = useCallback(async () => {
322
- setLoading(true);
323
- setError(null);
324
- try {
325
- const result = await getAgentPlatformBridge().pluginMcp.snapshot(snapshotRequest);
326
- if (!result.success)
327
- throw new Error('Failed to load plugin/MCP manager state.');
328
- setSnapshot(asSnapshot(result.snapshot));
329
- }
330
- catch (err) {
331
- setError(err instanceof Error ? err.message : 'Failed to load plugin/MCP manager state.');
332
- }
333
- finally {
334
- setLoading(false);
335
- }
336
- }, [snapshotRequest]);
429
+ allowedDirectories: caller?.allowedDirectories ? [...caller.allowedDirectories] : undefined,
430
+ }), [scopeKey]);
431
+ const loadSnapshot = useCallback(async (completedAction) => {
432
+ await operations.read(() => getAgentPlatformBridge().pluginMcp.snapshot(snapshotRequest), {
433
+ start: () => { setLoading(true); },
434
+ success: (result) => {
435
+ if (result.success !== true)
436
+ throw new Error('Failed to load plugin/MCP manager state.');
437
+ setSnapshot(asSnapshot(result.snapshot));
438
+ },
439
+ failure: (err) => setError(`${completedAction ? `Completed ${completedAction}, but refreshing failed: ` : ''}${err instanceof Error ? err.message : 'Failed to load plugin/MCP manager state.'}`),
440
+ finish: () => setLoading(false),
441
+ });
442
+ }, [operations, snapshotRequest]);
337
443
  useEffect(() => {
338
- void loadSnapshot();
339
- }, [loadSnapshot]);
340
- const runAction = useCallback(async (label, action) => {
341
- setBusy(label);
342
- setError(null);
343
- try {
344
- const result = await action();
345
- if (!result.success)
346
- throw new Error(result.error || `${label} failed.`);
347
- if (result.snapshot)
444
+ // A previous scope's pending mutation retains the lock. Reload this scope once it settles.
445
+ if (!operations.getBusy()) {
446
+ void loadSnapshot();
447
+ return;
448
+ }
449
+ const unsubscribe = operations.subscribe(() => {
450
+ if (!operations.getBusy()) {
451
+ unsubscribe();
452
+ void loadSnapshot();
453
+ }
454
+ });
455
+ return unsubscribe;
456
+ }, [loadSnapshot, operations]);
457
+ const runAction = useCallback(async (label, action, acknowledge) => operations.run(label, action, {
458
+ start: () => { setError(null); setLoading(true); },
459
+ success: async (result) => {
460
+ acknowledge?.();
461
+ if (result.snapshot) {
348
462
  setSnapshot(asSnapshot(result.snapshot));
463
+ setLoading(false);
464
+ }
349
465
  else
350
- await loadSnapshot();
351
- }
352
- catch (err) {
353
- setError(err instanceof Error ? err.message : `${label} failed.`);
354
- }
355
- finally {
356
- setBusy(null);
357
- }
358
- }, [loadSnapshot]);
466
+ await loadSnapshot(label);
467
+ },
468
+ failure: (message) => { setError(message); void loadSnapshot(); },
469
+ finish: () => { },
470
+ }), [loadSnapshot, operations]);
359
471
  const activePluginCount = useMemo(() => snapshot.plugins.filter((plugin) => plugin.status === 'active').length, [snapshot.plugins]);
360
472
  const buildScope = useCallback(() => ({
361
473
  type: scopeType,
@@ -363,51 +475,42 @@ export function PluginManager({ className = '', caller }) {
363
475
  teamId: scopeType === 'team' || scopeType === 'agent' ? scopeTeamId.trim() || undefined : undefined,
364
476
  agentId: scopeType === 'agent' ? scopeAgentId.trim() || undefined : undefined,
365
477
  }), [scopeAgentId, scopeTeamId, scopeType, scopeWorkspaceId]);
366
- const installPlugin = async (value = installInput) => {
367
- const input = value.trim();
478
+ const installPlugin = async (value) => {
479
+ const input = (value ?? installInput).trim();
368
480
  if (!input)
369
481
  return;
482
+ const acknowledge = value === undefined ? operations.captureDraft('install', () => setInstallInput('')) : undefined;
370
483
  const looksLocal = /^[a-zA-Z]:[\\/]/.test(input) || input.startsWith('\\\\') || input.startsWith('/') || input.includes('\\');
371
484
  await runAction('install plugin', async () => looksLocal
372
485
  ? getAgentPlatformBridge().pluginMcp.installLocalPlugin({ pluginPath: input, caller })
373
- : getAgentPlatformBridge().pluginMcp.installPlugin({ packageName: input, caller }));
374
- setInstallInput('');
486
+ : getAgentPlatformBridge().pluginMcp.installPlugin({ packageName: input, caller }), acknowledge);
375
487
  };
376
488
  const searchMarketplace = async () => {
377
- setBusy('search marketplace');
378
- setError(null);
379
- try {
380
- const result = await getAgentPlatformBridge().pluginMcp.searchMarketplace({ query: marketplaceQuery.trim(), limit: 24, caller });
381
- if (!result.success)
382
- throw new Error(result.error || 'Marketplace search failed.');
383
- setMarketplaceResults((Array.isArray(result.listings) ? result.listings : []).map(asMarketplaceListing).filter((listing) => !!listing));
384
- }
385
- catch (err) {
386
- setError(err instanceof Error ? err.message : 'Marketplace search failed.');
387
- }
388
- finally {
389
- setBusy(null);
390
- }
489
+ await operations.run('search marketplace', () => getAgentPlatformBridge().pluginMcp.searchMarketplace({ query: marketplaceQuery.trim(), limit: 24, caller }), {
490
+ start: () => setError(null),
491
+ success: (result) => setMarketplaceResults((Array.isArray(result.listings) ? result.listings : []).map(asMarketplaceListing).filter((listing) => !!listing)),
492
+ failure: setError,
493
+ finish: () => { },
494
+ invalidateReads: false,
495
+ });
391
496
  };
392
497
  const addMcpServer = async () => {
393
498
  const name = mcpName.trim();
394
499
  const target = mcpTarget.trim();
395
500
  if (!name || !target)
396
501
  return;
502
+ const acknowledge = operations.captureDraft('mcp', () => { setMcpName(''); setMcpTarget(''); setMcpArgs(''); });
397
503
  await runAction('add MCP server', async () => getAgentPlatformBridge().pluginMcp.upsertMcpServer({
398
504
  caller,
399
505
  server: {
400
506
  name,
401
507
  transport: mcpTransport,
402
508
  ...(mcpTransport === 'stdio'
403
- ? { command: target, args: mcpArgs.trim().split(/\s+/).filter(Boolean) }
509
+ ? { command: target, args: parsePluginMcpArguments(mcpArgs) }
404
510
  : { url: target }),
405
511
  approvalRequired: true,
406
512
  },
407
- }));
408
- setMcpName('');
409
- setMcpTarget('');
410
- setMcpArgs('');
513
+ }), acknowledge);
411
514
  };
412
515
  const saveScopedPolicy = async () => {
413
516
  await runAction('save scoped policy', async () => getAgentPlatformBridge().pluginMcp.setScopedPolicy({
@@ -430,68 +533,26 @@ export function PluginManager({ className = '', caller }) {
430
533
  caller,
431
534
  }));
432
535
  };
433
- const previewTool = async (tool) => {
434
- setBusy(`call ${tool.name}`);
435
- setResultPanel(null);
436
- setError(null);
437
- try {
438
- const input = parseJsonObject(mcpInputJson);
439
- const result = await getAgentPlatformBridge().pluginMcp.callMcpTool({ serverName: tool.server, toolName: tool.name, input, caller });
440
- if (!result.success) {
441
- setResultPanel({ title: `tool:${tool.server}/${tool.name}`, status: 'error', body: formatMcpError(result, `MCP tool ${tool.name} failed.`) });
442
- return;
443
- }
444
- setResultPanel({ title: `tool:${tool.server}/${tool.name}`, status: 'success', body: formatMcpResponse(result) });
445
- }
446
- catch (err) {
447
- setResultPanel({ title: `tool:${tool.server}/${tool.name}`, status: 'error', body: err instanceof Error ? err.message : 'Tool call failed.' });
448
- }
449
- finally {
450
- setBusy(null);
451
- }
452
- };
453
- const previewPrompt = async (prompt) => {
454
- setBusy(`prompt ${prompt.name}`);
455
- setResultPanel(null);
456
- setError(null);
457
- try {
458
- const input = parseJsonObject(mcpInputJson);
459
- const result = await getAgentPlatformBridge().pluginMcp.getMcpPrompt({ serverName: prompt.server, promptName: prompt.name, input, caller });
460
- if (!result.success) {
461
- setResultPanel({ title: `prompt:${prompt.server}/${prompt.name}`, status: 'error', body: formatMcpError(result, `MCP prompt ${prompt.name} failed.`) });
462
- return;
463
- }
464
- setResultPanel({ title: `prompt:${prompt.server}/${prompt.name}`, status: 'success', body: formatMcpResponse(result) });
465
- }
466
- catch (err) {
467
- setResultPanel({ title: `prompt:${prompt.server}/${prompt.name}`, status: 'error', body: err instanceof Error ? err.message : 'Prompt preview failed.' });
468
- }
469
- finally {
470
- setBusy(null);
471
- }
472
- };
473
- const previewResource = async (resource) => {
474
- setBusy(`resource ${resource.name || resource.uri}`);
475
- setResultPanel(null);
476
- setError(null);
477
- try {
478
- const result = await getAgentPlatformBridge().pluginMcp.readMcpResource({ serverName: resource.server, uri: resource.uri, caller });
479
- if (!result.success) {
480
- setResultPanel({ title: `resource:${resource.server}/${resource.name || resource.uri}`, status: 'error', body: formatMcpError(result, `MCP resource ${resource.uri} failed.`) });
481
- return;
482
- }
483
- setResultPanel({ title: `resource:${resource.server}/${resource.name || resource.uri}`, status: 'success', body: formatMcpResponse(result) });
484
- }
485
- catch (err) {
486
- setResultPanel({ title: `resource:${resource.server}/${resource.name || resource.uri}`, status: 'error', body: err instanceof Error ? err.message : 'Resource preview failed.' });
487
- }
488
- finally {
489
- setBusy(null);
490
- }
536
+ const preview = async (title, request) => {
537
+ await operations.run(title, async () => {
538
+ const result = await request();
539
+ if (result.success !== true)
540
+ throw new Error(formatMcpError(result, `${title} failed.`));
541
+ return result;
542
+ }, {
543
+ start: () => { setResultPanel(null); setError(null); },
544
+ success: (result) => setResultPanel({ title, status: 'success', body: formatMcpResponse(result) }),
545
+ failure: (body) => setResultPanel({ title, status: 'error', body }),
546
+ finish: () => { },
547
+ invalidateReads: false,
548
+ });
491
549
  };
550
+ const previewTool = (tool) => preview(`tool:${tool.server}/${tool.name}`, () => getAgentPlatformBridge().pluginMcp.callMcpTool({ serverName: tool.server, toolName: tool.name, input: parseJsonObject(mcpInputJson), caller }));
551
+ const previewPrompt = (prompt) => preview(`prompt:${prompt.server}/${prompt.name}`, () => getAgentPlatformBridge().pluginMcp.getMcpPrompt({ serverName: prompt.server, promptName: prompt.name, input: parseJsonObject(mcpInputJson), caller }));
552
+ const previewResource = (resource) => preview(`resource:${resource.server}/${resource.name || resource.uri}`, () => getAgentPlatformBridge().pluginMcp.readMcpResource({ serverName: resource.server, uri: resource.uri, caller }));
492
553
  return (_jsxs("div", { className: `flex flex-col h-full bg-[#151515] ${className}`, children: [_jsxs("div", { className: "px-4 py-3 border-b border-white/[0.06] flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Package, { className: "w-4 h-4 text-white/45", strokeWidth: 1.5 }), _jsx("span", { className: "text-[13px] font-medium text-white/75", children: "PluginHost / MCP" }), _jsxs(Pill, { children: [snapshot.stats.pluginCount, " plugins"] }), _jsxs(Pill, { children: [snapshot.stats.mcpServerCount, " mcp"] }), _jsxs(Pill, { tone: statusTone('info'), children: [snapshot.effectivePolicy.matchedPolicyIds.length, " scoped policies"] })] }), _jsx("button", { onClick: () => void loadSnapshot(), disabled: loading || !!busy, className: "p-1 text-white/35 hover:text-white/70 disabled:opacity-30 transition-colors", "aria-label": "Refresh plugin and MCP state", children: _jsx(RefreshCw, { className: `w-3.5 h-3.5 ${loading ? 'animate-spin' : ''}`, strokeWidth: 1.5 }) })] }), _jsxs("div", { className: "px-4 py-2 border-b border-white/[0.06] flex items-center gap-2", children: [['marketplace', 'plugins', 'mcp'].map((item) => (_jsx("button", { onClick: () => setTab(item), className: `px-2 py-1 text-[11px] border rounded-sm transition-colors ${tab === item ? 'text-white/80 bg-white/[0.08] border-white/[0.14]' : 'text-white/35 border-white/[0.06] hover:text-white/60'}`, children: item === 'mcp' ? 'MCP Servers' : item[0].toUpperCase() + item.slice(1) }, item))), _jsx("span", { className: "ml-auto text-[10px] text-white/25", children: busy ? `Working: ${busy}` : `${activePluginCount} active plugins, ${snapshot.stats.connectedMcpServerCount} connected MCP servers` })] }), error && (_jsxs("div", { className: "mx-4 mt-3 px-3 py-2 border border-red-300/[0.12] bg-red-400/[0.06] text-[11px] text-red-200/80 flex items-center gap-2", children: [_jsx(AlertTriangle, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }), error] })), tab === 'marketplace' && (_jsxs("div", { className: "flex-1 min-h-0 flex flex-col", children: [_jsxs("div", { className: "px-4 py-3 border-b border-white/[0.06] flex gap-2", children: [_jsx("input", { value: marketplaceQuery, onChange: (event) => setMarketplaceQuery(event.target.value), onKeyDown: (event) => { if (event.key === 'Enter')
493
- void searchMarketplace(); }, placeholder: "Search SDK marketplace packages...", className: "flex-1 px-2.5 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 focus:outline-none focus:border-white/[0.18]" }), _jsxs("button", { onClick: () => void searchMarketplace(), disabled: !!busy, className: "px-2.5 py-1.5 text-[11px] text-white/65 bg-white/[0.08] border border-white/[0.10] rounded-sm hover:bg-white/[0.14] disabled:opacity-30 flex items-center gap-1", children: [_jsx(Search, { className: "w-3 h-3", strokeWidth: 1.5 }), "Search"] })] }), _jsx("div", { className: "flex-1 overflow-auto divide-y divide-white/[0.05]", children: marketplaceResults.length === 0 ? (_jsxs("div", { className: "px-4 py-10 text-center", children: [_jsx(Package, { className: "w-9 h-9 text-white/10 mx-auto mb-3", strokeWidth: 1.5 }), _jsx("p", { className: "text-[12px] text-white/35", children: "Search the SDK marketplace" }), _jsx("p", { className: "text-[11px] text-white/20 mt-1", children: "Install verified or internal plugin packages into the durable Hub PluginHost." })] })) : marketplaceResults.map((listing) => (_jsx("div", { className: "px-4 py-3 hover:bg-white/[0.02]", children: _jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(PlugZap, { className: "w-3.5 h-3.5 text-white/35", strokeWidth: 1.5 }), _jsx("span", { className: "text-[12px] text-white/80 font-mono truncate", children: listing.name }), _jsxs(Pill, { children: ["v", listing.version] }), listing.verified && _jsx(Pill, { tone: statusTone('success'), children: "verified" })] }), _jsx("p", { className: "text-[11px] text-white/40 mt-1", children: listing.description || 'No description provided.' }), _jsxs("div", { className: "flex flex-wrap gap-1 mt-2", children: [(listing.keywords || []).slice(0, 8).map((keyword) => _jsx(Pill, { children: keyword }, keyword)), typeof listing.downloads === 'number' && _jsxs(Pill, { children: [listing.downloads.toLocaleString(), " downloads"] })] })] }), _jsx("button", { onClick: () => void installPlugin(listing.name), disabled: !!busy, className: "px-2.5 py-1.5 text-[11px] text-white/65 bg-white/[0.08] border border-white/[0.10] rounded-sm hover:bg-white/[0.14] disabled:opacity-30 shrink-0", children: "Install" })] }) }, listing.name))) })] })), tab === 'plugins' && (_jsxs("div", { className: "flex-1 min-h-0 flex flex-col", children: [_jsx("div", { className: "px-4 py-3 border-b border-white/[0.06]", children: _jsxs("div", { className: "flex gap-2", children: [_jsx("input", { value: installInput, onChange: (event) => setInstallInput(event.target.value), onKeyDown: (event) => { if (event.key === 'Enter')
494
- void installPlugin(); }, placeholder: "npm package or local plugin path...", className: "flex-1 px-2.5 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 focus:outline-none focus:border-white/[0.18]", disabled: !!busy }), _jsxs("button", { onClick: () => void installPlugin(), disabled: !!busy || !installInput.trim(), className: "px-2.5 py-1.5 text-[11px] text-white/65 bg-white/[0.08] border border-white/[0.10] rounded-sm hover:bg-white/[0.14] disabled:opacity-30 flex items-center gap-1", children: [_jsx(Plus, { className: "w-3 h-3", strokeWidth: 1.5 }), "Install"] })] }) }), _jsx("div", { className: "flex-1 overflow-auto", children: loading ? (_jsx("div", { className: "px-4 py-8 text-center text-[12px] text-white/30", children: "Loading PluginHost state..." })) : snapshot.plugins.length === 0 ? (_jsxs("div", { className: "px-4 py-10 text-center", children: [_jsx(Package, { className: "w-9 h-9 text-white/10 mx-auto mb-3", strokeWidth: 1.5 }), _jsx("p", { className: "text-[12px] text-white/35", children: "No SDK plugins installed" }), _jsx("p", { className: "text-[11px] text-white/20 mt-1", children: "Install a local plugin path or npm package to extend agent capabilities." })] })) : (_jsx("div", { className: "divide-y divide-white/[0.05]", children: snapshot.plugins.map((plugin) => (_jsx("div", { className: "px-4 py-3 hover:bg-white/[0.02]", children: _jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(PlugZap, { className: "w-3.5 h-3.5 text-white/35", strokeWidth: 1.5 }), _jsx("span", { className: "text-[12px] text-white/80 font-mono truncate", children: plugin.name }), _jsxs(Pill, { children: ["v", plugin.version] }), _jsx(Pill, { tone: statusTone(plugin.status), children: plugin.status }), _jsx(Pill, { tone: statusTone(plugin.trust.state), children: plugin.trust.state }), _jsxs(Pill, { tone: statusTone(plugin.trust.riskLevel), children: ["risk:", plugin.trust.riskLevel] }), snapshot.effectivePolicy.pluginDenylist.includes(plugin.name) && _jsx(Pill, { tone: statusTone('error'), children: "denied in scope" })] }), _jsx("p", { className: "text-[11px] text-white/40 mt-1 truncate", children: plugin.description || plugin.path }), plugin.trust.reasons.length > 0 && (_jsx("p", { className: "text-[10px] text-white/28 mt-1 truncate", children: plugin.trust.reasons.join(' ') })), _jsxs("div", { className: "flex flex-wrap gap-1 mt-2", children: [plugin.capabilities.map((capability) => _jsx(Pill, { children: capability }, capability)), plugin.tools.slice(0, 8).map((tool) => _jsx(Pill, { tone: "text-cyan-200/70 bg-cyan-400/[0.07] border-cyan-300/[0.10]", children: tool }, tool))] }), plugin.error && _jsx("p", { className: "text-[11px] text-red-300/70 mt-2", children: plugin.error })] }), _jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [plugin.trust.state !== 'trusted' && (_jsx("button", { onClick: () => void runAction(`trust ${plugin.name}`, () => getAgentPlatformBridge().pluginMcp.setPluginTrust({ name: plugin.name, decision: 'approved', caller })), className: "p-1.5 text-white/30 hover:text-emerald-200/80", "aria-label": `Trust ${plugin.name}`, children: _jsx(ShieldCheck, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) })), plugin.trust.state !== 'blocked' && (_jsx("button", { onClick: () => void runAction(`block ${plugin.name}`, () => getAgentPlatformBridge().pluginMcp.setPluginTrust({ name: plugin.name, decision: 'denied', caller })), className: "p-1.5 text-white/25 hover:text-amber-200/80", "aria-label": `Block ${plugin.name}`, children: _jsx(ShieldAlert, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) })), plugin.status === 'active' ? (_jsx("button", { onClick: () => void runAction(`deactivate ${plugin.name}`, () => getAgentPlatformBridge().pluginMcp.deactivatePlugin({ name: plugin.name, caller })), className: "p-1.5 text-white/35 hover:text-amber-200/80", "aria-label": `Deactivate ${plugin.name}`, children: _jsx(Pause, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) })) : (_jsx("button", { onClick: () => void runAction(`activate ${plugin.name}`, () => getAgentPlatformBridge().pluginMcp.activatePlugin({ name: plugin.name, caller })), disabled: plugin.trust.state !== 'trusted', className: "p-1.5 text-white/35 hover:text-emerald-200/80 disabled:opacity-25 disabled:hover:text-white/35", "aria-label": `Activate ${plugin.name}`, children: _jsx(Play, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) })), _jsx("button", { onClick: () => void runAction(`remove ${plugin.name}`, () => getAgentPlatformBridge().pluginMcp.uninstallPlugin({ name: plugin.name, removeFiles: false, caller })), className: "p-1.5 text-white/25 hover:text-red-300/80", "aria-label": `Remove ${plugin.name}`, children: _jsx(Trash2, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) })] })] }) }, plugin.name))) })) })] })), tab === 'mcp' && (_jsxs("div", { className: "flex-1 min-h-0 flex", children: [_jsxs("div", { className: "w-[58%] min-w-0 border-r border-white/[0.06] flex flex-col", children: [_jsxs("div", { className: "px-4 py-3 border-b border-white/[0.06] grid grid-cols-[120px_95px_1fr_1fr_auto] gap-2", children: [_jsx("input", { value: mcpName, onChange: (event) => setMcpName(event.target.value), placeholder: "server-name", className: "px-2.5 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 focus:outline-none focus:border-white/[0.18]" }), _jsxs("select", { value: mcpTransport, onChange: (event) => setMcpTransport(event.target.value === 'sse' ? 'sse' : 'stdio'), className: "px-2 py-1.5 text-[12px] text-white/70 bg-[#232323] border border-white/[0.08] rounded-sm focus:outline-none", children: [_jsx("option", { value: "stdio", children: "stdio" }), _jsx("option", { value: "sse", children: "sse" })] }), _jsx("input", { value: mcpTarget, onChange: (event) => setMcpTarget(event.target.value), placeholder: mcpTransport === 'stdio' ? 'command, e.g. npx' : 'https://server/sse', className: "px-2.5 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 focus:outline-none focus:border-white/[0.18]" }), _jsx("input", { value: mcpArgs, onChange: (event) => setMcpArgs(event.target.value), placeholder: "args for stdio...", disabled: mcpTransport === 'sse', className: "px-2.5 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 focus:outline-none focus:border-white/[0.18] disabled:opacity-30" }), _jsxs("button", { onClick: () => void addMcpServer(), disabled: !!busy || !mcpName.trim() || !mcpTarget.trim(), className: "px-2.5 py-1.5 text-[11px] text-white/65 bg-white/[0.08] border border-white/[0.10] rounded-sm hover:bg-white/[0.14] disabled:opacity-30 flex items-center gap-1", children: [_jsx(Plus, { className: "w-3 h-3", strokeWidth: 1.5 }), "Add"] })] }), _jsxs("div", { className: "px-4 py-2 border-b border-white/[0.06] flex items-center gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.18em] text-white/25", children: "Global exposure" }), ['none', 'prompts', 'resources', 'context', 'all'].map((policy) => (_jsx("button", { onClick: () => void runAction(`set MCP policy ${policy}`, () => getAgentPlatformBridge().pluginMcp.setMcpRegistryPolicy({ policy, caller })), className: `px-1.5 py-0.5 border rounded-sm text-[10px] ${snapshot.mcpRegistryPolicy === policy ? 'text-white/80 bg-white/[0.08] border-white/[0.14]' : 'text-white/35 border-white/[0.06]'}`, children: policy }, policy))), _jsx("button", { onClick: () => void runAction('reload MCP', () => getAgentPlatformBridge().pluginMcp.reloadMcp({ connect: true, ...snapshotRequest })), disabled: !!busy, className: "ml-auto px-2 py-1 text-[11px] text-white/55 bg-white/[0.06] border border-white/[0.08] rounded-sm hover:bg-white/[0.12] disabled:opacity-30", children: "Reload approved" })] }), _jsx("div", { className: "flex-1 overflow-auto", children: loading ? (_jsx("div", { className: "px-4 py-8 text-center text-[12px] text-white/30", children: "Loading MCP registry..." })) : snapshot.mcpServers.length === 0 ? (_jsxs("div", { className: "px-4 py-10 text-center", children: [_jsx(Server, { className: "w-9 h-9 text-white/10 mx-auto mb-3", strokeWidth: 1.5 }), _jsx("p", { className: "text-[12px] text-white/35", children: "No MCP servers configured" }), _jsx("p", { className: "text-[11px] text-white/20 mt-1", children: "Add a stdio or SSE server, approve it, then reload to discover tools." })] })) : (_jsx("div", { className: "divide-y divide-white/[0.05]", children: snapshot.mcpServers.map((server) => (_jsx("div", { className: "px-4 py-3 hover:bg-white/[0.02]", children: _jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Server, { className: "w-3.5 h-3.5 text-white/35", strokeWidth: 1.5 }), _jsx("span", { className: "text-[12px] text-white/80 font-mono truncate", children: server.name }), _jsx(Pill, { children: server.transport }), _jsx(Pill, { tone: statusTone(server.status), children: server.status }), _jsx(Pill, { tone: statusTone(server.approvalState || 'pending'), children: server.approvalState || 'pending' }), _jsx(Pill, { tone: statusTone(server.trust.state), children: server.trust.state }), _jsxs(Pill, { tone: statusTone(server.trust.riskLevel), children: ["risk:", server.trust.riskLevel] }), server.trust.configDrift && _jsx(Pill, { tone: statusTone('error'), children: "config drift" }), _jsx(Pill, { children: server.scope })] }), _jsx("p", { className: "text-[11px] text-white/38 mt-1 font-mono truncate", children: server.transport === 'stdio' ? [server.command, ...server.args].filter(Boolean).join(' ') : server.url }), server.trust.reasons.length > 0 && (_jsx("p", { className: "text-[10px] text-white/28 mt-1 truncate", children: server.trust.reasons.join(' ') })), _jsxs("div", { className: "flex flex-wrap gap-1 mt-2", children: [server.tools.slice(0, 8).map((tool) => (_jsx("button", { onClick: () => void previewTool(tool), className: "hover:opacity-80", children: _jsxs(Pill, { tone: "text-cyan-200/70 bg-cyan-400/[0.07] border-cyan-300/[0.10]", children: ["tool:", tool.name] }) }, `tool:${tool.name}`))), server.prompts.slice(0, 5).map((prompt) => (_jsx("button", { onClick: () => void previewPrompt(prompt), className: "hover:opacity-80", children: _jsxs(Pill, { children: ["prompt:", prompt.name] }) }, `prompt:${prompt.name}`))), server.resources.slice(0, 5).map((resource) => (_jsx("button", { onClick: () => void previewResource(resource), className: "hover:opacity-80", children: _jsxs(Pill, { children: ["resource:", resource.name || resource.uri] }) }, `resource:${resource.uri}`)))] }), server.error && _jsx("p", { className: "text-[11px] text-red-300/70 mt-2", children: server.error })] }), _jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [_jsx("button", { onClick: () => void runAction(`approve ${server.name}`, () => getAgentPlatformBridge().pluginMcp.setMcpApproval({ name: server.name, decision: 'approved', caller })), className: "p-1.5 text-white/30 hover:text-emerald-200/80", "aria-label": `Approve ${server.name}`, children: _jsx(ShieldCheck, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) }), _jsx("button", { onClick: () => void runAction(`deny ${server.name}`, () => getAgentPlatformBridge().pluginMcp.setMcpApproval({ name: server.name, decision: 'denied', caller })), className: "p-1.5 text-white/30 hover:text-amber-200/80", "aria-label": `Deny ${server.name}`, children: _jsx(ShieldAlert, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) }), _jsx("button", { onClick: () => void runAction(`connect ${server.name}`, () => getAgentPlatformBridge().pluginMcp.reloadMcp({ connect: true, ...snapshotRequest })), className: "p-1.5 text-white/30 hover:text-cyan-200/80", "aria-label": `Connect ${server.name}`, children: _jsx(Check, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) }), server.source === 'hub' && (_jsx("button", { onClick: () => void runAction(`remove ${server.name}`, () => getAgentPlatformBridge().pluginMcp.removeMcpServer({ name: server.name, caller })), className: "p-1.5 text-white/25 hover:text-red-300/80", "aria-label": `Remove ${server.name}`, children: _jsx(Trash2, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) }))] })] }) }, `${server.source}:${server.name}`))) })) })] }), _jsxs("div", { className: "flex-1 min-w-0 flex flex-col", children: [_jsxs("div", { className: "px-4 py-3 border-b border-white/[0.06] space-y-3", children: [_jsxs("div", { children: [_jsx("div", { className: "text-[10px] uppercase tracking-[0.18em] text-white/25 mb-2", children: "Scoped policy" }), _jsxs("div", { className: "grid grid-cols-4 gap-2", children: [_jsxs("select", { value: scopeType, onChange: (event) => setScopeType(event.target.value), className: "px-2 py-1.5 text-[12px] text-white/70 bg-[#232323] border border-white/[0.08] rounded-sm focus:outline-none", children: [_jsx("option", { value: "global", children: "global" }), _jsx("option", { value: "workspace", children: "workspace" }), _jsx("option", { value: "team", children: "team" }), _jsx("option", { value: "agent", children: "agent" })] }), _jsx("input", { value: scopeWorkspaceId, onChange: (event) => setScopeWorkspaceId(event.target.value), placeholder: "workspace id", disabled: scopeType === 'global', className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 disabled:opacity-30" }), _jsx("input", { value: scopeTeamId, onChange: (event) => setScopeTeamId(event.target.value), placeholder: "team id", disabled: scopeType === 'global' || scopeType === 'workspace', className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 disabled:opacity-30" }), _jsx("input", { value: scopeAgentId, onChange: (event) => setScopeAgentId(event.target.value), placeholder: "agent id", disabled: scopeType !== 'agent', className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 disabled:opacity-30" })] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsx("input", { value: policyPluginAllow, onChange: (event) => setPolicyPluginAllow(event.target.value), placeholder: "plugin allowlist, comma separated", className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20" }), _jsx("input", { value: policyPluginDeny, onChange: (event) => setPolicyPluginDeny(event.target.value), placeholder: "plugin denylist, comma separated", className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20" }), _jsx("input", { value: policyMcpAllow, onChange: (event) => setPolicyMcpAllow(event.target.value), placeholder: "MCP allowlist, comma separated", className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20" }), _jsx("input", { value: policyMcpDeny, onChange: (event) => setPolicyMcpDeny(event.target.value), placeholder: "MCP denylist, comma separated", className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20" })] }), _jsxs("div", { className: "flex gap-2 items-center", children: [_jsx("select", { value: policyMcpExposure, onChange: (event) => setPolicyMcpExposure(asPolicy(event.target.value)), className: "px-2 py-1.5 text-[12px] text-white/70 bg-[#232323] border border-white/[0.08] rounded-sm focus:outline-none", children: ['none', 'prompts', 'resources', 'context', 'all'].map((policy) => _jsx("option", { value: policy, children: policy }, policy)) }), _jsx("button", { onClick: () => void saveScopedPolicy(), disabled: !!busy, className: "px-2.5 py-1.5 text-[11px] text-white/65 bg-white/[0.08] border border-white/[0.10] rounded-sm hover:bg-white/[0.14] disabled:opacity-30", children: "Save scope" }), _jsx("button", { onClick: () => void runAction('delete scoped policy', () => getAgentPlatformBridge().pluginMcp.deleteScopedPolicy({ scope: buildScope(), caller })), disabled: !!busy, className: "px-2.5 py-1.5 text-[11px] text-white/45 border border-white/[0.08] rounded-sm hover:text-red-300/80 disabled:opacity-30", children: "Delete scope" })] }), _jsxs("div", { className: "text-[10px] text-white/30", children: ["Effective: ", snapshot.effectivePolicy.mcpRegistryPolicy, ". Matched: ", snapshot.effectivePolicy.matchedPolicyIds.join(', ') || 'global defaults', "."] })] }), _jsxs("div", { className: "px-4 py-3 border-b border-white/[0.06] space-y-2", children: [_jsx("div", { className: "text-[10px] uppercase tracking-[0.18em] text-white/25", children: "Project MCP sync" }), _jsxs("div", { className: "flex gap-2", children: [_jsx("input", { value: projectCwd, onChange: (event) => setProjectCwd(event.target.value), placeholder: "workspace root for .xeno/mcp.json", className: "flex-1 px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20" }), _jsxs("button", { onClick: () => void syncProjectMcp('import'), disabled: !!busy || !projectCwd.trim(), className: "px-2 py-1 text-[11px] text-white/55 bg-white/[0.06] border border-white/[0.08] rounded-sm hover:bg-white/[0.12] disabled:opacity-30 flex items-center gap-1", children: [_jsx(Download, { className: "w-3 h-3", strokeWidth: 1.5 }), "Import"] }), _jsxs("button", { onClick: () => void syncProjectMcp('export'), disabled: !!busy || !projectCwd.trim(), className: "px-2 py-1 text-[11px] text-white/55 bg-white/[0.06] border border-white/[0.08] rounded-sm hover:bg-white/[0.12] disabled:opacity-30 flex items-center gap-1", children: [_jsx(Upload, { className: "w-3 h-3", strokeWidth: 1.5 }), "Export"] })] })] }), _jsxs("div", { className: "px-4 py-3 border-b border-white/[0.06] space-y-2", children: [_jsx("div", { className: "text-[10px] uppercase tracking-[0.18em] text-white/25", children: "MCP preview input" }), _jsx("textarea", { value: mcpInputJson, onChange: (event) => setMcpInputJson(event.target.value), className: "w-full h-20 px-2 py-1.5 text-[11px] font-mono text-white/70 bg-[#111] border border-white/[0.08] rounded-sm focus:outline-none focus:border-white/[0.18]" }), _jsx("div", { className: "text-[10px] text-white/25", children: "Click a tool, prompt, or resource pill on the left. Tool/prompt calls use this JSON object as input." })] }), _jsx("div", { className: "flex-1 min-h-0 overflow-auto", children: resultPanel ? (_jsxs("div", { className: "p-4", children: [_jsxs("div", { className: "flex items-center gap-2 mb-2", children: [_jsx(Eye, { className: "w-3.5 h-3.5 text-white/35", strokeWidth: 1.5 }), _jsx("span", { className: "text-[12px] text-white/75 font-mono", children: resultPanel.title }), _jsx(Pill, { tone: statusTone(resultPanel.status), children: resultPanel.status })] }), _jsx("pre", { className: "p-3 bg-[#0f0f0f] border border-white/[0.07] rounded-sm text-[11px] text-white/62 whitespace-pre-wrap break-words overflow-auto", children: resultPanel.body })] })) : (_jsx("div", { className: "p-4 space-y-3", children: _jsxs("div", { children: [_jsx("div", { className: "text-[10px] uppercase tracking-[0.18em] text-white/25 mb-2", children: "Configured scoped policies" }), snapshot.scopedPolicies.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/30", children: "No workspace/team/agent plugin policies saved yet." })) : (_jsx("div", { className: "space-y-2", children: snapshot.scopedPolicies.map((policy) => (_jsxs("button", { onClick: () => {
554
+ void searchMarketplace(); }, placeholder: "Search SDK marketplace packages...", className: "flex-1 px-2.5 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 focus:outline-none focus:border-white/[0.18]" }), _jsxs("button", { onClick: () => void searchMarketplace(), disabled: !!busy, className: "px-2.5 py-1.5 text-[11px] text-white/65 bg-white/[0.08] border border-white/[0.10] rounded-sm hover:bg-white/[0.14] disabled:opacity-30 flex items-center gap-1", children: [_jsx(Search, { className: "w-3 h-3", strokeWidth: 1.5 }), "Search"] })] }), _jsx("div", { className: "flex-1 overflow-auto divide-y divide-white/[0.05]", children: marketplaceResults.length === 0 ? (_jsxs("div", { className: "px-4 py-10 text-center", children: [_jsx(Package, { className: "w-9 h-9 text-white/10 mx-auto mb-3", strokeWidth: 1.5 }), _jsx("p", { className: "text-[12px] text-white/35", children: "Search the SDK marketplace" }), _jsx("p", { className: "text-[11px] text-white/20 mt-1", children: "Install verified or internal plugin packages into the durable Hub PluginHost." })] })) : marketplaceResults.map((listing) => (_jsx("div", { className: "px-4 py-3 hover:bg-white/[0.02]", children: _jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(PlugZap, { className: "w-3.5 h-3.5 text-white/35", strokeWidth: 1.5 }), _jsx("span", { className: "text-[12px] text-white/80 font-mono truncate", children: listing.name }), _jsxs(Pill, { children: ["v", listing.version] }), listing.verified && _jsx(Pill, { tone: statusTone('success'), children: "verified" })] }), _jsx("p", { className: "text-[11px] text-white/40 mt-1", children: listing.description || 'No description provided.' }), _jsxs("div", { className: "flex flex-wrap gap-1 mt-2", children: [(listing.keywords || []).slice(0, 8).map((keyword) => _jsx(Pill, { children: keyword }, keyword)), typeof listing.downloads === 'number' && _jsxs(Pill, { children: [listing.downloads.toLocaleString(), " downloads"] })] })] }), _jsx("button", { onClick: () => void installPlugin(listing.name), disabled: !!busy, className: "px-2.5 py-1.5 text-[11px] text-white/65 bg-white/[0.08] border border-white/[0.10] rounded-sm hover:bg-white/[0.14] disabled:opacity-30 shrink-0", children: "Install" })] }) }, listing.name))) })] })), tab === 'plugins' && (_jsxs("div", { className: "flex-1 min-h-0 flex flex-col", children: [_jsx("div", { className: "px-4 py-3 border-b border-white/[0.06]", children: _jsxs("div", { className: "flex gap-2", children: [_jsx("input", { value: installInput, onChange: (event) => { operations.editDraft('install'); setInstallInput(event.target.value); }, onKeyDown: (event) => { if (event.key === 'Enter')
555
+ void installPlugin(); }, placeholder: "npm package or local plugin path...", className: "flex-1 px-2.5 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 focus:outline-none focus:border-white/[0.18]" }), _jsxs("button", { onClick: () => void installPlugin(), disabled: !!busy || !installInput.trim(), className: "px-2.5 py-1.5 text-[11px] text-white/65 bg-white/[0.08] border border-white/[0.10] rounded-sm hover:bg-white/[0.14] disabled:opacity-30 flex items-center gap-1", children: [_jsx(Plus, { className: "w-3 h-3", strokeWidth: 1.5 }), "Install"] })] }) }), _jsx("div", { className: "flex-1 overflow-auto", children: loading ? (_jsx("div", { className: "px-4 py-8 text-center text-[12px] text-white/30", children: "Loading PluginHost state..." })) : snapshot.plugins.length === 0 ? (_jsxs("div", { className: "px-4 py-10 text-center", children: [_jsx(Package, { className: "w-9 h-9 text-white/10 mx-auto mb-3", strokeWidth: 1.5 }), _jsx("p", { className: "text-[12px] text-white/35", children: "No SDK plugins installed" }), _jsx("p", { className: "text-[11px] text-white/20 mt-1", children: "Install a local plugin path or npm package to extend agent capabilities." })] })) : (_jsx("div", { className: "divide-y divide-white/[0.05]", children: snapshot.plugins.map((plugin) => (_jsx("div", { className: "px-4 py-3 hover:bg-white/[0.02]", children: _jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(PlugZap, { className: "w-3.5 h-3.5 text-white/35", strokeWidth: 1.5 }), _jsx("span", { className: "text-[12px] text-white/80 font-mono truncate", children: plugin.name }), _jsxs(Pill, { children: ["v", plugin.version] }), _jsx(Pill, { tone: statusTone(plugin.status), children: plugin.status }), _jsx(Pill, { tone: statusTone(plugin.trust.state), children: plugin.trust.state }), _jsxs(Pill, { tone: statusTone(plugin.trust.riskLevel), children: ["risk:", plugin.trust.riskLevel] }), snapshot.effectivePolicy.pluginDenylist.includes(plugin.name) && _jsx(Pill, { tone: statusTone('error'), children: "denied in scope" })] }), _jsx("p", { className: "text-[11px] text-white/40 mt-1 truncate", children: plugin.description || plugin.path }), plugin.trust.reasons.length > 0 && (_jsx("p", { className: "text-[10px] text-white/28 mt-1 truncate", children: plugin.trust.reasons.join(' ') })), _jsxs("div", { className: "flex flex-wrap gap-1 mt-2", children: [plugin.capabilities.map((capability) => _jsx(Pill, { children: capability }, capability)), plugin.tools.slice(0, 8).map((tool) => _jsx(Pill, { tone: "text-cyan-200/70 bg-cyan-400/[0.07] border-cyan-300/[0.10]", children: tool }, tool))] }), plugin.error && _jsx("p", { className: "text-[11px] text-red-300/70 mt-2", children: plugin.error })] }), _jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [plugin.trust.state !== 'trusted' && (_jsx("button", { onClick: () => void runAction(`trust ${plugin.name}`, () => getAgentPlatformBridge().pluginMcp.setPluginTrust({ name: plugin.name, decision: 'approved', caller })), className: "p-1.5 text-white/30 hover:text-emerald-200/80", "aria-label": `Trust ${plugin.name}`, children: _jsx(ShieldCheck, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) })), plugin.trust.state !== 'blocked' && (_jsx("button", { onClick: () => void runAction(`block ${plugin.name}`, () => getAgentPlatformBridge().pluginMcp.setPluginTrust({ name: plugin.name, decision: 'denied', caller })), className: "p-1.5 text-white/25 hover:text-amber-200/80", "aria-label": `Block ${plugin.name}`, children: _jsx(ShieldAlert, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) })), plugin.status === 'active' ? (_jsx("button", { onClick: () => void runAction(`deactivate ${plugin.name}`, () => getAgentPlatformBridge().pluginMcp.deactivatePlugin({ name: plugin.name, caller })), className: "p-1.5 text-white/35 hover:text-amber-200/80", "aria-label": `Deactivate ${plugin.name}`, children: _jsx(Pause, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) })) : (_jsx("button", { onClick: () => void runAction(`activate ${plugin.name}`, () => getAgentPlatformBridge().pluginMcp.activatePlugin({ name: plugin.name, caller })), disabled: plugin.trust.state !== 'trusted', className: "p-1.5 text-white/35 hover:text-emerald-200/80 disabled:opacity-25 disabled:hover:text-white/35", "aria-label": `Activate ${plugin.name}`, children: _jsx(Play, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) })), _jsx("button", { onClick: () => void runAction(`remove ${plugin.name}`, () => getAgentPlatformBridge().pluginMcp.uninstallPlugin({ name: plugin.name, removeFiles: false, caller })), className: "p-1.5 text-white/25 hover:text-red-300/80", "aria-label": `Remove ${plugin.name}`, children: _jsx(Trash2, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) })] })] }) }, plugin.name))) })) })] })), tab === 'mcp' && (_jsxs("div", { className: "flex-1 min-h-0 flex", children: [_jsxs("div", { className: "w-[58%] min-w-0 border-r border-white/[0.06] flex flex-col", children: [_jsxs("div", { className: "px-4 py-3 border-b border-white/[0.06] grid grid-cols-[120px_95px_1fr_1fr_auto] gap-2", children: [_jsx("input", { value: mcpName, onChange: (event) => { operations.editDraft('mcp'); setMcpName(event.target.value); }, placeholder: "server-name", className: "px-2.5 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 focus:outline-none focus:border-white/[0.18]" }), _jsxs("select", { "aria-label": "MCP transport", value: mcpTransport, onChange: (event) => { operations.editDraft('mcp'); setMcpTransport(event.target.value === 'sse' ? 'sse' : 'stdio'); }, className: "px-2 py-1.5 text-[12px] text-white/70 bg-[#232323] border border-white/[0.08] rounded-sm focus:outline-none", children: [_jsx("option", { value: "stdio", children: "stdio" }), _jsx("option", { value: "sse", children: "sse" })] }), _jsx("input", { value: mcpTarget, onChange: (event) => { operations.editDraft('mcp'); setMcpTarget(event.target.value); }, placeholder: mcpTransport === 'stdio' ? 'command, e.g. npx' : 'https://server/sse', className: "px-2.5 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 focus:outline-none focus:border-white/[0.18]" }), _jsx("input", { value: mcpArgs, onChange: (event) => { operations.editDraft('mcp'); setMcpArgs(event.target.value); }, "aria-label": "MCP arguments (JSON string array)", title: 'JSON string array, e.g. ["--name", "two words"]. Escape backslashes as \\\\ in JSON.', placeholder: '["-y", "package-name"]', disabled: mcpTransport === 'sse', className: "px-2.5 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 focus:outline-none focus:border-white/[0.18] disabled:opacity-30" }), _jsxs("button", { onClick: () => void addMcpServer(), disabled: !!busy || !mcpName.trim() || !mcpTarget.trim(), className: "px-2.5 py-1.5 text-[11px] text-white/65 bg-white/[0.08] border border-white/[0.10] rounded-sm hover:bg-white/[0.14] disabled:opacity-30 flex items-center gap-1", children: [_jsx(Plus, { className: "w-3 h-3", strokeWidth: 1.5 }), "Add"] })] }), _jsxs("div", { className: "px-4 py-2 border-b border-white/[0.06] flex items-center gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.18em] text-white/25", children: "Global exposure" }), ['none', 'prompts', 'resources', 'context', 'all'].map((policy) => (_jsx("button", { onClick: () => void runAction(`set MCP policy ${policy}`, () => getAgentPlatformBridge().pluginMcp.setMcpRegistryPolicy({ policy, caller })), className: `px-1.5 py-0.5 border rounded-sm text-[10px] ${snapshot.mcpRegistryPolicy === policy ? 'text-white/80 bg-white/[0.08] border-white/[0.14]' : 'text-white/35 border-white/[0.06]'}`, children: policy }, policy))), _jsx("button", { onClick: () => void runAction('reload MCP', () => getAgentPlatformBridge().pluginMcp.reloadMcp({ connect: true, ...snapshotRequest })), disabled: !!busy, className: "ml-auto px-2 py-1 text-[11px] text-white/55 bg-white/[0.06] border border-white/[0.08] rounded-sm hover:bg-white/[0.12] disabled:opacity-30", children: "Reload approved" })] }), _jsx("div", { className: "flex-1 overflow-auto", children: loading ? (_jsx("div", { className: "px-4 py-8 text-center text-[12px] text-white/30", children: "Loading MCP registry..." })) : snapshot.mcpServers.length === 0 ? (_jsxs("div", { className: "px-4 py-10 text-center", children: [_jsx(Server, { className: "w-9 h-9 text-white/10 mx-auto mb-3", strokeWidth: 1.5 }), _jsx("p", { className: "text-[12px] text-white/35", children: "No MCP servers configured" }), _jsx("p", { className: "text-[11px] text-white/20 mt-1", children: "Add a stdio or SSE server, approve it, then reload to discover tools." })] })) : (_jsx("div", { className: "divide-y divide-white/[0.05]", children: snapshot.mcpServers.map((server) => (_jsx("div", { className: "px-4 py-3 hover:bg-white/[0.02]", children: _jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Server, { className: "w-3.5 h-3.5 text-white/35", strokeWidth: 1.5 }), _jsx("span", { className: "text-[12px] text-white/80 font-mono truncate", children: server.name }), _jsx(Pill, { children: server.transport }), _jsx(Pill, { tone: statusTone(server.status), children: server.status }), _jsx(Pill, { tone: statusTone(server.approvalState || 'pending'), children: server.approvalState || 'pending' }), _jsx(Pill, { tone: statusTone(server.trust.state), children: server.trust.state }), _jsxs(Pill, { tone: statusTone(server.trust.riskLevel), children: ["risk:", server.trust.riskLevel] }), server.trust.configDrift && _jsx(Pill, { tone: statusTone('error'), children: "config drift" }), _jsx(Pill, { children: server.scope })] }), _jsx("p", { className: "text-[11px] text-white/38 mt-1 font-mono truncate", children: server.transport === 'stdio' ? [server.command, ...server.args].filter(Boolean).join(' ') : server.url }), server.trust.reasons.length > 0 && (_jsx("p", { className: "text-[10px] text-white/28 mt-1 truncate", children: server.trust.reasons.join(' ') })), _jsxs("div", { className: "flex flex-wrap gap-1 mt-2", children: [server.tools.slice(0, 8).map((tool) => (_jsx("button", { onClick: () => void previewTool(tool), className: "hover:opacity-80", children: _jsxs(Pill, { tone: "text-cyan-200/70 bg-cyan-400/[0.07] border-cyan-300/[0.10]", children: ["tool:", tool.name] }) }, `tool:${tool.name}`))), server.prompts.slice(0, 5).map((prompt) => (_jsx("button", { onClick: () => void previewPrompt(prompt), className: "hover:opacity-80", children: _jsxs(Pill, { children: ["prompt:", prompt.name] }) }, `prompt:${prompt.name}`))), server.resources.slice(0, 5).map((resource) => (_jsx("button", { onClick: () => void previewResource(resource), className: "hover:opacity-80", children: _jsxs(Pill, { children: ["resource:", resource.name || resource.uri] }) }, `resource:${resource.uri}`)))] }), server.error && _jsx("p", { className: "text-[11px] text-red-300/70 mt-2", children: server.error })] }), _jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [_jsx("button", { onClick: () => void runAction(`approve ${server.name}`, () => getAgentPlatformBridge().pluginMcp.setMcpApproval({ name: server.name, decision: 'approved', caller })), className: "p-1.5 text-white/30 hover:text-emerald-200/80", "aria-label": `Approve ${server.name}`, children: _jsx(ShieldCheck, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) }), _jsx("button", { onClick: () => void runAction(`deny ${server.name}`, () => getAgentPlatformBridge().pluginMcp.setMcpApproval({ name: server.name, decision: 'denied', caller })), className: "p-1.5 text-white/30 hover:text-amber-200/80", "aria-label": `Deny ${server.name}`, children: _jsx(ShieldAlert, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) }), _jsx("button", { onClick: () => void runAction(`connect ${server.name}`, () => getAgentPlatformBridge().pluginMcp.reloadMcp({ connect: true, ...snapshotRequest })), className: "p-1.5 text-white/30 hover:text-cyan-200/80", "aria-label": `Connect ${server.name}`, children: _jsx(Check, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) }), server.source === 'hub' && (_jsx("button", { onClick: () => void runAction(`remove ${server.name}`, () => getAgentPlatformBridge().pluginMcp.removeMcpServer({ name: server.name, caller })), className: "p-1.5 text-white/25 hover:text-red-300/80", "aria-label": `Remove ${server.name}`, children: _jsx(Trash2, { className: "w-3.5 h-3.5", strokeWidth: 1.5 }) }))] })] }) }, `${server.source}:${server.name}`))) })) })] }), _jsxs("div", { className: "flex-1 min-w-0 flex flex-col", children: [_jsxs("div", { className: "px-4 py-3 border-b border-white/[0.06] space-y-3", children: [_jsxs("div", { children: [_jsx("div", { className: "text-[10px] uppercase tracking-[0.18em] text-white/25 mb-2", children: "Scoped policy" }), _jsxs("div", { className: "grid grid-cols-4 gap-2", children: [_jsxs("select", { value: scopeType, onChange: (event) => setScopeType(event.target.value), className: "px-2 py-1.5 text-[12px] text-white/70 bg-[#232323] border border-white/[0.08] rounded-sm focus:outline-none", children: [_jsx("option", { value: "global", children: "global" }), _jsx("option", { value: "workspace", children: "workspace" }), _jsx("option", { value: "team", children: "team" }), _jsx("option", { value: "agent", children: "agent" })] }), _jsx("input", { value: scopeWorkspaceId, onChange: (event) => setScopeWorkspaceId(event.target.value), placeholder: "workspace id", disabled: scopeType === 'global', className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 disabled:opacity-30" }), _jsx("input", { value: scopeTeamId, onChange: (event) => setScopeTeamId(event.target.value), placeholder: "team id", disabled: scopeType === 'global' || scopeType === 'workspace', className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 disabled:opacity-30" }), _jsx("input", { value: scopeAgentId, onChange: (event) => setScopeAgentId(event.target.value), placeholder: "agent id", disabled: scopeType !== 'agent', className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20 disabled:opacity-30" })] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsx("input", { value: policyPluginAllow, onChange: (event) => setPolicyPluginAllow(event.target.value), placeholder: "plugin allowlist, comma separated", className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20" }), _jsx("input", { value: policyPluginDeny, onChange: (event) => setPolicyPluginDeny(event.target.value), placeholder: "plugin denylist, comma separated", className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20" }), _jsx("input", { value: policyMcpAllow, onChange: (event) => setPolicyMcpAllow(event.target.value), placeholder: "MCP allowlist, comma separated", className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20" }), _jsx("input", { value: policyMcpDeny, onChange: (event) => setPolicyMcpDeny(event.target.value), placeholder: "MCP denylist, comma separated", className: "px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20" })] }), _jsxs("div", { className: "flex gap-2 items-center", children: [_jsx("select", { value: policyMcpExposure, onChange: (event) => setPolicyMcpExposure(asPolicy(event.target.value)), className: "px-2 py-1.5 text-[12px] text-white/70 bg-[#232323] border border-white/[0.08] rounded-sm focus:outline-none", children: ['none', 'prompts', 'resources', 'context', 'all'].map((policy) => _jsx("option", { value: policy, children: policy }, policy)) }), _jsx("button", { onClick: () => void saveScopedPolicy(), disabled: !!busy, className: "px-2.5 py-1.5 text-[11px] text-white/65 bg-white/[0.08] border border-white/[0.10] rounded-sm hover:bg-white/[0.14] disabled:opacity-30", children: "Save scope" }), _jsx("button", { onClick: () => void runAction('delete scoped policy', () => getAgentPlatformBridge().pluginMcp.deleteScopedPolicy({ scope: buildScope(), caller })), disabled: !!busy, className: "px-2.5 py-1.5 text-[11px] text-white/45 border border-white/[0.08] rounded-sm hover:text-red-300/80 disabled:opacity-30", children: "Delete scope" })] }), _jsxs("div", { className: "text-[10px] text-white/30", children: ["Effective: ", snapshot.effectivePolicy.mcpRegistryPolicy, ". Matched: ", snapshot.effectivePolicy.matchedPolicyIds.join(', ') || 'global defaults', "."] })] }), _jsxs("div", { className: "px-4 py-3 border-b border-white/[0.06] space-y-2", children: [_jsx("div", { className: "text-[10px] uppercase tracking-[0.18em] text-white/25", children: "Project MCP sync" }), _jsxs("div", { className: "flex gap-2", children: [_jsx("input", { value: projectCwd, onChange: (event) => setProjectCwd(event.target.value), placeholder: "workspace root for .xeno/mcp.json", className: "flex-1 px-2 py-1.5 text-[12px] text-white/80 bg-[#232323] border border-white/[0.08] rounded-sm placeholder-white/20" }), _jsxs("button", { onClick: () => void syncProjectMcp('import'), disabled: !!busy || !projectCwd.trim(), className: "px-2 py-1 text-[11px] text-white/55 bg-white/[0.06] border border-white/[0.08] rounded-sm hover:bg-white/[0.12] disabled:opacity-30 flex items-center gap-1", children: [_jsx(Download, { className: "w-3 h-3", strokeWidth: 1.5 }), "Import"] }), _jsxs("button", { onClick: () => void syncProjectMcp('export'), disabled: !!busy || !projectCwd.trim(), className: "px-2 py-1 text-[11px] text-white/55 bg-white/[0.06] border border-white/[0.08] rounded-sm hover:bg-white/[0.12] disabled:opacity-30 flex items-center gap-1", children: [_jsx(Upload, { className: "w-3 h-3", strokeWidth: 1.5 }), "Export"] })] })] }), _jsxs("div", { className: "px-4 py-3 border-b border-white/[0.06] space-y-2", children: [_jsx("div", { className: "text-[10px] uppercase tracking-[0.18em] text-white/25", children: "MCP preview input" }), _jsx("textarea", { value: mcpInputJson, onChange: (event) => setMcpInputJson(event.target.value), className: "w-full h-20 px-2 py-1.5 text-[11px] font-mono text-white/70 bg-[#111] border border-white/[0.08] rounded-sm focus:outline-none focus:border-white/[0.18]" }), _jsx("div", { className: "text-[10px] text-white/25", children: "Click a tool, prompt, or resource pill on the left. Tool/prompt calls use this JSON object as input." })] }), _jsx("div", { className: "flex-1 min-h-0 overflow-auto", children: resultPanel ? (_jsxs("div", { className: "p-4", children: [_jsxs("div", { className: "flex items-center gap-2 mb-2", children: [_jsx(Eye, { className: "w-3.5 h-3.5 text-white/35", strokeWidth: 1.5 }), _jsx("span", { className: "text-[12px] text-white/75 font-mono", children: resultPanel.title }), _jsx(Pill, { tone: statusTone(resultPanel.status), children: resultPanel.status })] }), _jsx("pre", { className: "p-3 bg-[#0f0f0f] border border-white/[0.07] rounded-sm text-[11px] text-white/62 whitespace-pre-wrap break-words overflow-auto", children: resultPanel.body })] })) : (_jsx("div", { className: "p-4 space-y-3", children: _jsxs("div", { children: [_jsx("div", { className: "text-[10px] uppercase tracking-[0.18em] text-white/25 mb-2", children: "Configured scoped policies" }), snapshot.scopedPolicies.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/30", children: "No workspace/team/agent plugin policies saved yet." })) : (_jsx("div", { className: "space-y-2", children: snapshot.scopedPolicies.map((policy) => (_jsxs("button", { onClick: () => {
495
556
  setScopeType(policy.scope.type);
496
557
  setScopeWorkspaceId(policy.scope.workspaceId || '');
497
558
  setScopeTeamId(policy.scope.teamId || '');