@xenosystem/agent-interface-ui 0.1.25 → 0.1.27
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.
- package/dist/adapters/agentHostPlatformBridge.d.ts.map +1 -1
- package/dist/adapters/agentHostPlatformBridge.js +96 -16
- package/dist/adapters/agentHostPlatformBridge.js.map +1 -1
- package/dist/adapters/hubAgentPlatformBridge.d.ts.map +1 -1
- package/dist/adapters/hubAgentPlatformBridge.js +2 -0
- package/dist/adapters/hubAgentPlatformBridge.js.map +1 -1
- package/dist/adapters/scopedBackupBridge.d.ts +4 -0
- package/dist/adapters/scopedBackupBridge.d.ts.map +1 -0
- package/dist/adapters/scopedBackupBridge.js +49 -0
- package/dist/adapters/scopedBackupBridge.js.map +1 -0
- package/dist/adapters/xenoAgentCompatibilityBridge.d.ts.map +1 -1
- package/dist/adapters/xenoAgentCompatibilityBridge.js +9 -1
- package/dist/adapters/xenoAgentCompatibilityBridge.js.map +1 -1
- package/dist/agent.css +13227 -0
- package/dist/components/agent/AgentIdentityGenerator.d.ts +16 -0
- package/dist/components/agent/AgentIdentityGenerator.d.ts.map +1 -0
- package/dist/components/agent/AgentIdentityGenerator.js +80 -0
- package/dist/components/agent/AgentIdentityGenerator.js.map +1 -0
- package/dist/components/agent/AgentInterface.d.ts +1 -0
- package/dist/components/agent/AgentInterface.d.ts.map +1 -1
- package/dist/components/agent/AgentInterface.js +1816 -643
- package/dist/components/agent/AgentInterface.js.map +1 -1
- package/dist/components/agent/AgentNotificationBanner.d.ts +10 -0
- package/dist/components/agent/AgentNotificationBanner.d.ts.map +1 -0
- package/dist/components/agent/AgentNotificationBanner.js +28 -0
- package/dist/components/agent/AgentNotificationBanner.js.map +1 -0
- package/dist/components/agent/AgentOnboarding.d.ts +16 -2
- package/dist/components/agent/AgentOnboarding.d.ts.map +1 -1
- package/dist/components/agent/AgentOnboarding.js +93 -201
- package/dist/components/agent/AgentOnboarding.js.map +1 -1
- package/dist/components/agent/AgentView.d.ts.map +1 -1
- package/dist/components/agent/AgentView.js +533 -308
- package/dist/components/agent/AgentView.js.map +1 -1
- package/dist/components/agent/AgentWorkbenchPanel.d.ts +3 -1
- package/dist/components/agent/AgentWorkbenchPanel.d.ts.map +1 -1
- package/dist/components/agent/AgentWorkbenchPanel.js +3 -2
- package/dist/components/agent/AgentWorkbenchPanel.js.map +1 -1
- package/dist/components/agent/AgentWorkspaceBrowserPanel.d.ts +4 -1
- package/dist/components/agent/AgentWorkspaceBrowserPanel.d.ts.map +1 -1
- package/dist/components/agent/AgentWorkspaceBrowserPanel.js +23 -195
- package/dist/components/agent/AgentWorkspaceBrowserPanel.js.map +1 -1
- package/dist/components/agent/AgentsWorkspaceView.d.ts +12 -0
- package/dist/components/agent/AgentsWorkspaceView.d.ts.map +1 -0
- package/dist/components/agent/AgentsWorkspaceView.js +129 -0
- package/dist/components/agent/AgentsWorkspaceView.js.map +1 -0
- package/dist/components/agent/DevelopmentCoordinationPanel.d.ts +7 -0
- package/dist/components/agent/DevelopmentCoordinationPanel.d.ts.map +1 -1
- package/dist/components/agent/DevelopmentCoordinationPanel.js +57 -49
- package/dist/components/agent/DevelopmentCoordinationPanel.js.map +1 -1
- package/dist/components/agent/KnowledgePanel.d.ts.map +1 -1
- package/dist/components/agent/KnowledgePanel.js +17 -67
- package/dist/components/agent/KnowledgePanel.js.map +1 -1
- package/dist/components/agent/LiveConversationCollaboration.d.ts +27 -0
- package/dist/components/agent/LiveConversationCollaboration.d.ts.map +1 -0
- package/dist/components/agent/LiveConversationCollaboration.js +127 -0
- package/dist/components/agent/LiveConversationCollaboration.js.map +1 -0
- package/dist/components/agent/MonacoDiffWorkbenchEditor.d.ts.map +1 -1
- package/dist/components/agent/MonacoDiffWorkbenchEditor.js +1 -1
- package/dist/components/agent/MonacoDiffWorkbenchEditor.js.map +1 -1
- package/dist/components/agent/MonacoWorkbenchEditor.d.ts.map +1 -1
- package/dist/components/agent/MonacoWorkbenchEditor.js +3 -3
- package/dist/components/agent/MonacoWorkbenchEditor.js.map +1 -1
- package/dist/components/agent/OwnedBrowserController.d.ts +55 -0
- package/dist/components/agent/OwnedBrowserController.d.ts.map +1 -0
- package/dist/components/agent/OwnedBrowserController.js +166 -0
- package/dist/components/agent/OwnedBrowserController.js.map +1 -0
- package/dist/components/agent/OwnedWorkforceView.d.ts +10 -0
- package/dist/components/agent/OwnedWorkforceView.d.ts.map +1 -0
- package/dist/components/agent/OwnedWorkforceView.js +256 -0
- package/dist/components/agent/OwnedWorkforceView.js.map +1 -0
- package/dist/components/agent/PluginManager.d.ts +34 -0
- package/dist/components/agent/PluginManager.d.ts.map +1 -1
- package/dist/components/agent/PluginManager.js +187 -126
- package/dist/components/agent/PluginManager.js.map +1 -1
- package/dist/components/agent/ProjectsWorkspaceView.d.ts +14 -0
- package/dist/components/agent/ProjectsWorkspaceView.d.ts.map +1 -0
- package/dist/components/agent/ProjectsWorkspaceView.js +176 -0
- package/dist/components/agent/ProjectsWorkspaceView.js.map +1 -0
- package/dist/components/agent/RunReviewPanel.d.ts +8 -13
- package/dist/components/agent/RunReviewPanel.d.ts.map +1 -1
- package/dist/components/agent/RunReviewPanel.js +120 -106
- package/dist/components/agent/RunReviewPanel.js.map +1 -1
- package/dist/components/agent/ScheduledWorkspaceView.d.ts +19 -0
- package/dist/components/agent/ScheduledWorkspaceView.d.ts.map +1 -0
- package/dist/components/agent/ScheduledWorkspaceView.js +150 -0
- package/dist/components/agent/ScheduledWorkspaceView.js.map +1 -0
- package/dist/components/agent/SdkSessionPanel.d.ts +25 -0
- package/dist/components/agent/SdkSessionPanel.d.ts.map +1 -0
- package/dist/components/agent/SdkSessionPanel.js +15 -0
- package/dist/components/agent/SdkSessionPanel.js.map +1 -0
- package/dist/components/agent/SlashCommandAutocomplete.d.ts +12 -0
- package/dist/components/agent/SlashCommandAutocomplete.d.ts.map +1 -0
- package/dist/components/agent/SlashCommandAutocomplete.js +33 -0
- package/dist/components/agent/SlashCommandAutocomplete.js.map +1 -0
- package/dist/components/agent/TeamsWorkspaceView.d.ts +12 -0
- package/dist/components/agent/TeamsWorkspaceView.d.ts.map +1 -0
- package/dist/components/agent/TeamsWorkspaceView.js +127 -0
- package/dist/components/agent/TeamsWorkspaceView.js.map +1 -0
- package/dist/components/agent/WorkspacePersistenceNotice.d.ts +3 -0
- package/dist/components/agent/WorkspacePersistenceNotice.d.ts.map +1 -0
- package/dist/components/agent/WorkspacePersistenceNotice.js +23 -0
- package/dist/components/agent/WorkspacePersistenceNotice.js.map +1 -0
- package/dist/components/agent/acp/AcpAgentConfigForm.d.ts +1 -0
- package/dist/components/agent/acp/AcpAgentConfigForm.d.ts.map +1 -1
- package/dist/components/agent/acp/AcpAgentConfigForm.js +47 -14
- package/dist/components/agent/acp/AcpAgentConfigForm.js.map +1 -1
- package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.js +1 -1
- package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.js.map +1 -1
- package/dist/components/agent/acp/AcpAgentManager.d.ts.map +1 -1
- package/dist/components/agent/acp/AcpAgentManager.js +18 -18
- package/dist/components/agent/acp/AcpAgentManager.js.map +1 -1
- package/dist/components/agent/acp/AcpAgentTestResultPanel.js +1 -1
- package/dist/components/agent/acp/AcpAgentTestResultPanel.js.map +1 -1
- package/dist/components/agent/acp/AcpApprovalPanel.js +2 -2
- package/dist/components/agent/acp/AcpApprovalPanel.js.map +1 -1
- package/dist/components/agent/acp/AcpCertificationPanel.js +1 -1
- package/dist/components/agent/acp/AcpCertificationPanel.js.map +1 -1
- package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.js +1 -1
- package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.js.map +1 -1
- package/dist/components/agent/acp/AcpProviderManagerPanel.js +1 -1
- package/dist/components/agent/acp/AcpProviderManagerPanel.js.map +1 -1
- package/dist/components/agent/acp/AcpProviderModelsPanel.js +1 -1
- package/dist/components/agent/acp/AcpProviderModelsPanel.js.map +1 -1
- package/dist/components/agent/acp/AcpSupportBundlePanel.js +1 -1
- package/dist/components/agent/acp/AcpSupportBundlePanel.js.map +1 -1
- package/dist/components/agent/collaborationWindow.d.ts +11 -0
- package/dist/components/agent/collaborationWindow.d.ts.map +1 -0
- package/dist/components/agent/collaborationWindow.js +10 -0
- package/dist/components/agent/collaborationWindow.js.map +1 -0
- package/dist/components/agent/conversationCollaborationAppendJournal.d.ts +25 -0
- package/dist/components/agent/conversationCollaborationAppendJournal.d.ts.map +1 -0
- package/dist/components/agent/conversationCollaborationAppendJournal.js +118 -0
- package/dist/components/agent/conversationCollaborationAppendJournal.js.map +1 -0
- package/dist/components/agent/conversationCollaborationController.d.ts +96 -0
- package/dist/components/agent/conversationCollaborationController.d.ts.map +1 -0
- package/dist/components/agent/conversationCollaborationController.js +597 -0
- package/dist/components/agent/conversationCollaborationController.js.map +1 -0
- package/dist/components/agent/destructiveConfirmation.d.ts +76 -0
- package/dist/components/agent/destructiveConfirmation.d.ts.map +1 -0
- package/dist/components/agent/destructiveConfirmation.js +231 -0
- package/dist/components/agent/destructiveConfirmation.js.map +1 -0
- package/dist/components/agent/developmentCoordinationController.d.ts +43 -0
- package/dist/components/agent/developmentCoordinationController.d.ts.map +1 -0
- package/dist/components/agent/developmentCoordinationController.js +94 -0
- package/dist/components/agent/developmentCoordinationController.js.map +1 -0
- package/dist/components/agent/developmentCoordinationProjection.d.ts +24 -0
- package/dist/components/agent/developmentCoordinationProjection.d.ts.map +1 -1
- package/dist/components/agent/developmentCoordinationProjection.js +34 -5
- package/dist/components/agent/developmentCoordinationProjection.js.map +1 -1
- package/dist/components/agent/editorOperationAuthority.d.ts +29 -0
- package/dist/components/agent/editorOperationAuthority.d.ts.map +1 -0
- package/dist/components/agent/editorOperationAuthority.js +73 -0
- package/dist/components/agent/editorOperationAuthority.js.map +1 -0
- package/dist/components/agent/knowledgePagination.d.ts +7 -0
- package/dist/components/agent/knowledgePagination.d.ts.map +1 -0
- package/dist/components/agent/knowledgePagination.js +7 -0
- package/dist/components/agent/knowledgePagination.js.map +1 -0
- package/dist/components/agent/knowledgePanelController.d.ts +32 -0
- package/dist/components/agent/knowledgePanelController.d.ts.map +1 -0
- package/dist/components/agent/knowledgePanelController.js +119 -0
- package/dist/components/agent/knowledgePanelController.js.map +1 -0
- package/dist/components/agent/monacoWorkbenchShared.js +1 -1
- package/dist/components/agent/onboardingModels.d.ts +31 -0
- package/dist/components/agent/onboardingModels.d.ts.map +1 -0
- package/dist/components/agent/onboardingModels.js +107 -0
- package/dist/components/agent/onboardingModels.js.map +1 -0
- package/dist/components/agent/personalConversationScope.d.ts +26 -0
- package/dist/components/agent/personalConversationScope.d.ts.map +1 -0
- package/dist/components/agent/personalConversationScope.js +43 -0
- package/dist/components/agent/personalConversationScope.js.map +1 -0
- package/dist/components/agent/reviewRequestScope.d.ts +16 -0
- package/dist/components/agent/reviewRequestScope.d.ts.map +1 -0
- package/dist/components/agent/reviewRequestScope.js +101 -0
- package/dist/components/agent/reviewRequestScope.js.map +1 -0
- package/dist/components/agent/scheduleCreationAttempt.d.ts +12 -0
- package/dist/components/agent/scheduleCreationAttempt.d.ts.map +1 -0
- package/dist/components/agent/scheduleCreationAttempt.js +30 -0
- package/dist/components/agent/scheduleCreationAttempt.js.map +1 -0
- package/dist/components/agent/settings/EntitySettingsLayout.d.ts +1 -1
- package/dist/components/agent/settings/EntitySettingsLayout.d.ts.map +1 -1
- package/dist/components/agent/settings/EntitySettingsLayout.js +64 -44
- package/dist/components/agent/settings/EntitySettingsLayout.js.map +1 -1
- package/dist/components/agent/settings/SettingsNavigation.d.ts.map +1 -1
- package/dist/components/agent/settings/SettingsNavigation.js +17 -17
- package/dist/components/agent/settings/SettingsNavigation.js.map +1 -1
- package/dist/components/agent/settings/entityArchiveState.d.ts +24 -0
- package/dist/components/agent/settings/entityArchiveState.d.ts.map +1 -0
- package/dist/components/agent/settings/entityArchiveState.js +12 -0
- package/dist/components/agent/settings/entityArchiveState.js.map +1 -0
- package/dist/components/agent/settings/sections/AccessMembersSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/AccessMembersSection.js +10 -25
- package/dist/components/agent/settings/sections/AccessMembersSection.js.map +1 -1
- package/dist/components/agent/settings/sections/AccountWorkspacePanel.d.ts +16 -0
- package/dist/components/agent/settings/sections/AccountWorkspacePanel.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/AccountWorkspacePanel.js +265 -0
- package/dist/components/agent/settings/sections/AccountWorkspacePanel.js.map +1 -0
- package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.js +47 -32
- package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.js.map +1 -1
- package/dist/components/agent/settings/sections/DangerZoneSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/DangerZoneSection.js +30 -6
- package/dist/components/agent/settings/sections/DangerZoneSection.js.map +1 -1
- package/dist/components/agent/settings/sections/DefaultAgentConfigSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/DefaultAgentConfigSection.js +47 -37
- package/dist/components/agent/settings/sections/DefaultAgentConfigSection.js.map +1 -1
- package/dist/components/agent/settings/sections/EnvironmentSecretsSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/EnvironmentSecretsSection.js +30 -43
- package/dist/components/agent/settings/sections/EnvironmentSecretsSection.js.map +1 -1
- package/dist/components/agent/settings/sections/ExportBackupSection.d.ts +3 -1
- package/dist/components/agent/settings/sections/ExportBackupSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/ExportBackupSection.js +14 -12
- package/dist/components/agent/settings/sections/ExportBackupSection.js.map +1 -1
- package/dist/components/agent/settings/sections/GeneralSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/GeneralSection.js +47 -4
- package/dist/components/agent/settings/sections/GeneralSection.js.map +1 -1
- package/dist/components/agent/settings/sections/IntegrationsSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/IntegrationsSection.js +14 -21
- package/dist/components/agent/settings/sections/IntegrationsSection.js.map +1 -1
- package/dist/components/agent/settings/sections/NotificationsSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/NotificationsSection.js +125 -20
- package/dist/components/agent/settings/sections/NotificationsSection.js.map +1 -1
- package/dist/components/agent/settings/sections/ResourceLimitsSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/ResourceLimitsSection.js +7 -7
- package/dist/components/agent/settings/sections/ResourceLimitsSection.js.map +1 -1
- package/dist/components/agent/settings/sections/SecurityComplianceSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/SecurityComplianceSection.js +5 -4
- package/dist/components/agent/settings/sections/SecurityComplianceSection.js.map +1 -1
- package/dist/components/agent/settings/sections/UsageAnalyticsSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/UsageAnalyticsSection.js +2 -3
- package/dist/components/agent/settings/sections/UsageAnalyticsSection.js.map +1 -1
- package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js +39 -26
- package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js.map +1 -1
- package/dist/components/agent/settings/sections/WorkspaceKeysPanel.d.ts +6 -0
- package/dist/components/agent/settings/sections/WorkspaceKeysPanel.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/WorkspaceKeysPanel.js +205 -0
- package/dist/components/agent/settings/sections/WorkspaceKeysPanel.js.map +1 -0
- package/dist/components/agent/settings/sections/environmentDraftAction.d.ts +3 -0
- package/dist/components/agent/settings/sections/environmentDraftAction.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/environmentDraftAction.js +6 -0
- package/dist/components/agent/settings/sections/environmentDraftAction.js.map +1 -0
- package/dist/components/agent/settings/sections/membershipOperationProjection.d.ts +3 -0
- package/dist/components/agent/settings/sections/membershipOperationProjection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/membershipOperationProjection.js +9 -0
- package/dist/components/agent/settings/sections/membershipOperationProjection.js.map +1 -0
- package/dist/components/agent/settings/sections/workspaceKeyOperationProjection.d.ts +6 -0
- package/dist/components/agent/settings/sections/workspaceKeyOperationProjection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/workspaceKeyOperationProjection.js +8 -0
- package/dist/components/agent/settings/sections/workspaceKeyOperationProjection.js.map +1 -0
- package/dist/components/agent/settings/shared/InAppConfirmationDialog.d.ts +25 -0
- package/dist/components/agent/settings/shared/InAppConfirmationDialog.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/InAppConfirmationDialog.js +89 -0
- package/dist/components/agent/settings/shared/InAppConfirmationDialog.js.map +1 -0
- package/dist/components/agent/settings/shared/InputField.d.ts +1 -1
- package/dist/components/agent/settings/shared/InputField.d.ts.map +1 -1
- package/dist/components/agent/settings/shared/InputField.js +4 -3
- package/dist/components/agent/settings/shared/InputField.js.map +1 -1
- package/dist/components/agent/settings/shared/MembersTable.d.ts +3 -3
- package/dist/components/agent/settings/shared/MembersTable.d.ts.map +1 -1
- package/dist/components/agent/settings/shared/MembersTable.js +1 -1
- package/dist/components/agent/settings/shared/MembersTable.js.map +1 -1
- package/dist/components/agent/settings/shared/ScopedAuditPanel.d.ts +5 -0
- package/dist/components/agent/settings/shared/ScopedAuditPanel.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/ScopedAuditPanel.js +70 -0
- package/dist/components/agent/settings/shared/ScopedAuditPanel.js.map +1 -0
- package/dist/components/agent/settings/shared/SettingsCard.d.ts +2 -1
- package/dist/components/agent/settings/shared/SettingsCard.d.ts.map +1 -1
- package/dist/components/agent/settings/shared/SettingsCard.js +2 -2
- package/dist/components/agent/settings/shared/SettingsCard.js.map +1 -1
- package/dist/components/agent/settings/shared/ToggleSwitch.d.ts.map +1 -1
- package/dist/components/agent/settings/shared/ToggleSwitch.js +1 -1
- package/dist/components/agent/settings/shared/ToggleSwitch.js.map +1 -1
- package/dist/components/agent/settings/shared/UsageChart.d.ts +10 -0
- package/dist/components/agent/settings/shared/UsageChart.d.ts.map +1 -1
- package/dist/components/agent/settings/shared/UsageChart.js +16 -10
- package/dist/components/agent/settings/shared/UsageChart.js.map +1 -1
- package/dist/components/agent/settings/shared/WorkspaceRulesControl.d.ts +8 -0
- package/dist/components/agent/settings/shared/WorkspaceRulesControl.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/WorkspaceRulesControl.js +26 -0
- package/dist/components/agent/settings/shared/WorkspaceRulesControl.js.map +1 -0
- package/dist/components/agent/settings/shared/useScopedConfirmation.d.ts +8 -0
- package/dist/components/agent/settings/shared/useScopedConfirmation.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/useScopedConfirmation.js +53 -0
- package/dist/components/agent/settings/shared/useScopedConfirmation.js.map +1 -0
- package/dist/components/agent/settings/shared/useSettingsConfirmation.d.ts +8 -0
- package/dist/components/agent/settings/shared/useSettingsConfirmation.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/useSettingsConfirmation.js +51 -0
- package/dist/components/agent/settings/shared/useSettingsConfirmation.js.map +1 -0
- package/dist/components/agent/settings/shared/workspaceRulesController.d.ts +28 -0
- package/dist/components/agent/settings/shared/workspaceRulesController.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/workspaceRulesController.js +82 -0
- package/dist/components/agent/settings/shared/workspaceRulesController.js.map +1 -0
- package/dist/components/agent/sidebarEntityPins.d.ts +11 -0
- package/dist/components/agent/sidebarEntityPins.d.ts.map +1 -0
- package/dist/components/agent/sidebarEntityPins.js +37 -0
- package/dist/components/agent/sidebarEntityPins.js.map +1 -0
- package/dist/components/agent/workspaceHierarchy.d.ts +24 -0
- package/dist/components/agent/workspaceHierarchy.d.ts.map +1 -0
- package/dist/components/agent/workspaceHierarchy.js +50 -0
- package/dist/components/agent/workspaceHierarchy.js.map +1 -0
- package/dist/components/product/XenoAgentProductHeader.d.ts +4 -2
- package/dist/components/product/XenoAgentProductHeader.d.ts.map +1 -1
- package/dist/components/product/XenoAgentProductHeader.js +22 -4
- package/dist/components/product/XenoAgentProductHeader.js.map +1 -1
- package/dist/components/product/XenoAgentSessionTabs.js +1 -1
- package/dist/components/product/XenoAgentSessionTabs.js.map +1 -1
- package/dist/components/product/XenoAgentWorkspaceSelector.d.ts +7 -0
- package/dist/components/product/XenoAgentWorkspaceSelector.d.ts.map +1 -0
- package/dist/components/product/XenoAgentWorkspaceSelector.js +237 -0
- package/dist/components/product/XenoAgentWorkspaceSelector.js.map +1 -0
- package/dist/components/workspace/WorkspaceCreationWizard.d.ts +6 -0
- package/dist/components/workspace/WorkspaceCreationWizard.d.ts.map +1 -0
- package/dist/components/workspace/WorkspaceCreationWizard.js +48 -0
- package/dist/components/workspace/WorkspaceCreationWizard.js.map +1 -0
- package/dist/hooks/useSidebarLayoutPreference.d.ts +29 -0
- package/dist/hooks/useSidebarLayoutPreference.d.ts.map +1 -0
- package/dist/hooks/useSidebarLayoutPreference.js +83 -0
- package/dist/hooks/useSidebarLayoutPreference.js.map +1 -0
- package/dist/hooks/useWorkspaceCreation.d.ts +8 -0
- package/dist/hooks/useWorkspaceCreation.d.ts.map +1 -0
- package/dist/hooks/useWorkspaceCreation.js +40 -0
- package/dist/hooks/useWorkspaceCreation.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/platformApiTypes.d.ts +77 -36
- package/dist/platformApiTypes.d.ts.map +1 -1
- package/dist/platformBridge.d.ts +4 -0
- package/dist/platformBridge.d.ts.map +1 -1
- package/dist/platformBridge.js +10 -0
- package/dist/platformBridge.js.map +1 -1
- package/dist/stores/agentChatStore.d.ts +120 -2
- package/dist/stores/agentChatStore.d.ts.map +1 -1
- package/dist/stores/agentChatStore.js +329 -35
- package/dist/stores/agentChatStore.js.map +1 -1
- package/dist/stores/agentCreationDefaults.d.ts +25 -0
- package/dist/stores/agentCreationDefaults.d.ts.map +1 -0
- package/dist/stores/agentCreationDefaults.js +11 -0
- package/dist/stores/agentCreationDefaults.js.map +1 -0
- package/dist/stores/entitySettingsStore.d.ts +37 -12
- package/dist/stores/entitySettingsStore.d.ts.map +1 -1
- package/dist/stores/entitySettingsStore.js +558 -585
- package/dist/stores/entitySettingsStore.js.map +1 -1
- package/dist/stores/suggestionStore.d.ts +9 -2
- package/dist/stores/suggestionStore.d.ts.map +1 -1
- package/dist/stores/suggestionStore.js +51 -24
- package/dist/stores/suggestionStore.js.map +1 -1
- package/dist/stores/workspaceCreationAttempt.d.ts +14 -0
- package/dist/stores/workspaceCreationAttempt.d.ts.map +1 -0
- package/dist/stores/workspaceCreationAttempt.js +35 -0
- package/dist/stores/workspaceCreationAttempt.js.map +1 -0
- package/dist/stores/workspaceReconciliation.d.ts +6 -0
- package/dist/stores/workspaceReconciliation.d.ts.map +1 -0
- package/dist/stores/workspaceReconciliation.js +33 -0
- package/dist/stores/workspaceReconciliation.js.map +1 -0
- package/dist/stores/workspaceStore.d.ts +44 -9
- package/dist/stores/workspaceStore.d.ts.map +1 -1
- package/dist/stores/workspaceStore.js +238 -99
- package/dist/stores/workspaceStore.js.map +1 -1
- package/dist/types/agentEditor.d.ts +1 -0
- package/dist/types/agentEditor.d.ts.map +1 -1
- package/dist/utils/advertisedReasoning.d.ts +25 -0
- package/dist/utils/advertisedReasoning.d.ts.map +1 -0
- package/dist/utils/advertisedReasoning.js +62 -0
- package/dist/utils/advertisedReasoning.js.map +1 -0
- package/dist/utils/clipboardCopy.d.ts +4 -0
- package/dist/utils/clipboardCopy.d.ts.map +1 -0
- package/dist/utils/clipboardCopy.js +27 -0
- package/dist/utils/clipboardCopy.js.map +1 -0
- package/dist/utils/providerCommandArgs.d.ts +11 -0
- package/dist/utils/providerCommandArgs.d.ts.map +1 -0
- package/dist/utils/providerCommandArgs.js +18 -0
- package/dist/utils/providerCommandArgs.js.map +1 -0
- package/dist/utils/rendererTeardown.d.ts +6 -0
- package/dist/utils/rendererTeardown.d.ts.map +1 -0
- package/dist/utils/rendererTeardown.js +18 -0
- package/dist/utils/rendererTeardown.js.map +1 -0
- package/package.json +20 -8
- 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
|
-
|
|
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
|
|
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
|
-
|
|
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(
|
|
312
|
-
|
|
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
|
-
}), [
|
|
321
|
-
const loadSnapshot = useCallback(async () => {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
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
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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
|
-
|
|
353
|
-
|
|
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
|
|
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
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
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
|
|
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
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}
|
|
444
|
-
|
|
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 || '');
|