@xenosystem/agent-interface-ui 0.1.3
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/LICENSE +67 -0
- package/dist/adapters/agentHostPlatformBridge.d.ts +24 -0
- package/dist/adapters/agentHostPlatformBridge.d.ts.map +1 -0
- package/dist/adapters/agentHostPlatformBridge.js +1244 -0
- package/dist/adapters/agentHostPlatformBridge.js.map +1 -0
- package/dist/adapters/hubAgentPlatformBridge.d.ts +17 -0
- package/dist/adapters/hubAgentPlatformBridge.d.ts.map +1 -0
- package/dist/adapters/hubAgentPlatformBridge.js +109 -0
- package/dist/adapters/hubAgentPlatformBridge.js.map +1 -0
- package/dist/adapters/xenoAgentCompatibilityBridge.d.ts +14 -0
- package/dist/adapters/xenoAgentCompatibilityBridge.d.ts.map +1 -0
- package/dist/adapters/xenoAgentCompatibilityBridge.js +237 -0
- package/dist/adapters/xenoAgentCompatibilityBridge.js.map +1 -0
- package/dist/adapters/xenoAgentHostCatalog.d.ts +40 -0
- package/dist/adapters/xenoAgentHostCatalog.d.ts.map +1 -0
- package/dist/adapters/xenoAgentHostCatalog.js +228 -0
- package/dist/adapters/xenoAgentHostCatalog.js.map +1 -0
- package/dist/components/agent/AIStatusIndicator.d.ts +25 -0
- package/dist/components/agent/AIStatusIndicator.d.ts.map +1 -0
- package/dist/components/agent/AIStatusIndicator.js +85 -0
- package/dist/components/agent/AIStatusIndicator.js.map +1 -0
- package/dist/components/agent/AgentInterface.d.ts +21 -0
- package/dist/components/agent/AgentInterface.d.ts.map +1 -0
- package/dist/components/agent/AgentInterface.js +7586 -0
- package/dist/components/agent/AgentInterface.js.map +1 -0
- package/dist/components/agent/AgentOnboarding.d.ts +16 -0
- package/dist/components/agent/AgentOnboarding.d.ts.map +1 -0
- package/dist/components/agent/AgentOnboarding.js +423 -0
- package/dist/components/agent/AgentOnboarding.js.map +1 -0
- package/dist/components/agent/AgentPtyTerminalPanel.d.ts +13 -0
- package/dist/components/agent/AgentPtyTerminalPanel.d.ts.map +1 -0
- package/dist/components/agent/AgentPtyTerminalPanel.js +129 -0
- package/dist/components/agent/AgentPtyTerminalPanel.js.map +1 -0
- package/dist/components/agent/AgentView.d.ts +143 -0
- package/dist/components/agent/AgentView.d.ts.map +1 -0
- package/dist/components/agent/AgentView.js +7250 -0
- package/dist/components/agent/AgentView.js.map +1 -0
- package/dist/components/agent/AgentWorkbenchCliPanel.d.ts +15 -0
- package/dist/components/agent/AgentWorkbenchCliPanel.d.ts.map +1 -0
- package/dist/components/agent/AgentWorkbenchCliPanel.js +275 -0
- package/dist/components/agent/AgentWorkbenchCliPanel.js.map +1 -0
- package/dist/components/agent/AgentWorkbenchPanel.d.ts +791 -0
- package/dist/components/agent/AgentWorkbenchPanel.d.ts.map +1 -0
- package/dist/components/agent/AgentWorkbenchPanel.js +584 -0
- package/dist/components/agent/AgentWorkbenchPanel.js.map +1 -0
- package/dist/components/agent/AgentWorkspaceBrowserPanel.d.ts +11 -0
- package/dist/components/agent/AgentWorkspaceBrowserPanel.d.ts.map +1 -0
- package/dist/components/agent/AgentWorkspaceBrowserPanel.js +198 -0
- package/dist/components/agent/AgentWorkspaceBrowserPanel.js.map +1 -0
- package/dist/components/agent/AssistantTurnStatusNotice.d.ts +16 -0
- package/dist/components/agent/AssistantTurnStatusNotice.d.ts.map +1 -0
- package/dist/components/agent/AssistantTurnStatusNotice.js +54 -0
- package/dist/components/agent/AssistantTurnStatusNotice.js.map +1 -0
- package/dist/components/agent/CommandToolCard.d.ts +11 -0
- package/dist/components/agent/CommandToolCard.d.ts.map +1 -0
- package/dist/components/agent/CommandToolCard.js +29 -0
- package/dist/components/agent/CommandToolCard.js.map +1 -0
- package/dist/components/agent/FleetPanel.d.ts +28 -0
- package/dist/components/agent/FleetPanel.d.ts.map +1 -0
- package/dist/components/agent/FleetPanel.js +175 -0
- package/dist/components/agent/FleetPanel.js.map +1 -0
- package/dist/components/agent/GhostTextArea.d.ts +13 -0
- package/dist/components/agent/GhostTextArea.d.ts.map +1 -0
- package/dist/components/agent/GhostTextArea.js +21 -0
- package/dist/components/agent/GhostTextArea.js.map +1 -0
- package/dist/components/agent/IntakePanel.d.ts +29 -0
- package/dist/components/agent/IntakePanel.d.ts.map +1 -0
- package/dist/components/agent/IntakePanel.js +81 -0
- package/dist/components/agent/IntakePanel.js.map +1 -0
- package/dist/components/agent/KnowledgePanel.d.ts +25 -0
- package/dist/components/agent/KnowledgePanel.d.ts.map +1 -0
- package/dist/components/agent/KnowledgePanel.js +99 -0
- package/dist/components/agent/KnowledgePanel.js.map +1 -0
- package/dist/components/agent/MonacoDiffWorkbenchEditor.d.ts +9 -0
- package/dist/components/agent/MonacoDiffWorkbenchEditor.d.ts.map +1 -0
- package/dist/components/agent/MonacoDiffWorkbenchEditor.js +204 -0
- package/dist/components/agent/MonacoDiffWorkbenchEditor.js.map +1 -0
- package/dist/components/agent/MonacoWorkbenchEditor.d.ts +15 -0
- package/dist/components/agent/MonacoWorkbenchEditor.d.ts.map +1 -0
- package/dist/components/agent/MonacoWorkbenchEditor.js +380 -0
- package/dist/components/agent/MonacoWorkbenchEditor.js.map +1 -0
- package/dist/components/agent/PermissionDialog.d.ts +34 -0
- package/dist/components/agent/PermissionDialog.d.ts.map +1 -0
- package/dist/components/agent/PermissionDialog.js +67 -0
- package/dist/components/agent/PermissionDialog.js.map +1 -0
- package/dist/components/agent/PluginManager.d.ts +20 -0
- package/dist/components/agent/PluginManager.d.ts.map +1 -0
- package/dist/components/agent/PluginManager.js +506 -0
- package/dist/components/agent/PluginManager.js.map +1 -0
- package/dist/components/agent/RunReviewPanel.d.ts +52 -0
- package/dist/components/agent/RunReviewPanel.d.ts.map +1 -0
- package/dist/components/agent/RunReviewPanel.js +236 -0
- package/dist/components/agent/RunReviewPanel.js.map +1 -0
- package/dist/components/agent/SessionsPanel.d.ts +30 -0
- package/dist/components/agent/SessionsPanel.d.ts.map +1 -0
- package/dist/components/agent/SessionsPanel.js +247 -0
- package/dist/components/agent/SessionsPanel.js.map +1 -0
- package/dist/components/agent/acp/AcpAgentConfigForm.d.ts +19 -0
- package/dist/components/agent/acp/AcpAgentConfigForm.d.ts.map +1 -0
- package/dist/components/agent/acp/AcpAgentConfigForm.js +85 -0
- package/dist/components/agent/acp/AcpAgentConfigForm.js.map +1 -0
- package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.d.ts +10 -0
- package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.d.ts.map +1 -0
- package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.js +80 -0
- package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.js.map +1 -0
- package/dist/components/agent/acp/AcpAgentManager.d.ts +3 -0
- package/dist/components/agent/acp/AcpAgentManager.d.ts.map +1 -0
- package/dist/components/agent/acp/AcpAgentManager.js +152 -0
- package/dist/components/agent/acp/AcpAgentManager.js.map +1 -0
- package/dist/components/agent/acp/AcpAgentTestResultPanel.d.ts +9 -0
- package/dist/components/agent/acp/AcpAgentTestResultPanel.d.ts.map +1 -0
- package/dist/components/agent/acp/AcpAgentTestResultPanel.js +24 -0
- package/dist/components/agent/acp/AcpAgentTestResultPanel.js.map +1 -0
- package/dist/components/agent/acp/AcpApprovalPanel.d.ts +29 -0
- package/dist/components/agent/acp/AcpApprovalPanel.d.ts.map +1 -0
- package/dist/components/agent/acp/AcpApprovalPanel.js +37 -0
- package/dist/components/agent/acp/AcpApprovalPanel.js.map +1 -0
- package/dist/components/agent/acp/AcpCertificationPanel.d.ts +10 -0
- package/dist/components/agent/acp/AcpCertificationPanel.d.ts.map +1 -0
- package/dist/components/agent/acp/AcpCertificationPanel.js +41 -0
- package/dist/components/agent/acp/AcpCertificationPanel.js.map +1 -0
- package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.d.ts +11 -0
- package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.d.ts.map +1 -0
- package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.js +32 -0
- package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.js.map +1 -0
- package/dist/components/agent/acp/AcpProviderManagerPanel.d.ts +7 -0
- package/dist/components/agent/acp/AcpProviderManagerPanel.d.ts.map +1 -0
- package/dist/components/agent/acp/AcpProviderManagerPanel.js +69 -0
- package/dist/components/agent/acp/AcpProviderManagerPanel.js.map +1 -0
- package/dist/components/agent/acp/AcpProviderModelsPanel.d.ts +7 -0
- package/dist/components/agent/acp/AcpProviderModelsPanel.d.ts.map +1 -0
- package/dist/components/agent/acp/AcpProviderModelsPanel.js +108 -0
- package/dist/components/agent/acp/AcpProviderModelsPanel.js.map +1 -0
- package/dist/components/agent/acp/AcpSupportBundlePanel.d.ts +8 -0
- package/dist/components/agent/acp/AcpSupportBundlePanel.d.ts.map +1 -0
- package/dist/components/agent/acp/AcpSupportBundlePanel.js +56 -0
- package/dist/components/agent/acp/AcpSupportBundlePanel.js.map +1 -0
- package/dist/components/agent/compactionSummary.d.ts +28 -0
- package/dist/components/agent/compactionSummary.d.ts.map +1 -0
- package/dist/components/agent/compactionSummary.js +41 -0
- package/dist/components/agent/compactionSummary.js.map +1 -0
- package/dist/components/agent/monacoWorkbenchShared.d.ts +13 -0
- package/dist/components/agent/monacoWorkbenchShared.d.ts.map +1 -0
- package/dist/components/agent/monacoWorkbenchShared.js +226 -0
- package/dist/components/agent/monacoWorkbenchShared.js.map +1 -0
- package/dist/components/agent/settings/EntitySettingsLayout.d.ts +61 -0
- package/dist/components/agent/settings/EntitySettingsLayout.d.ts.map +1 -0
- package/dist/components/agent/settings/EntitySettingsLayout.js +72 -0
- package/dist/components/agent/settings/EntitySettingsLayout.js.map +1 -0
- package/dist/components/agent/settings/SettingsNavigation.d.ts +8 -0
- package/dist/components/agent/settings/SettingsNavigation.d.ts.map +1 -0
- package/dist/components/agent/settings/SettingsNavigation.js +39 -0
- package/dist/components/agent/settings/SettingsNavigation.js.map +1 -0
- package/dist/components/agent/settings/sections/AccessMembersSection.d.ts +3 -0
- package/dist/components/agent/settings/sections/AccessMembersSection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/AccessMembersSection.js +31 -0
- package/dist/components/agent/settings/sections/AccessMembersSection.js.map +1 -0
- package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.d.ts +25 -0
- package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.js +56 -0
- package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.js.map +1 -0
- package/dist/components/agent/settings/sections/DangerZoneSection.d.ts +3 -0
- package/dist/components/agent/settings/sections/DangerZoneSection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/DangerZoneSection.js +19 -0
- package/dist/components/agent/settings/sections/DangerZoneSection.js.map +1 -0
- package/dist/components/agent/settings/sections/DefaultAgentConfigSection.d.ts +3 -0
- package/dist/components/agent/settings/sections/DefaultAgentConfigSection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/DefaultAgentConfigSection.js +66 -0
- package/dist/components/agent/settings/sections/DefaultAgentConfigSection.js.map +1 -0
- package/dist/components/agent/settings/sections/EnvironmentSecretsSection.d.ts +3 -0
- package/dist/components/agent/settings/sections/EnvironmentSecretsSection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/EnvironmentSecretsSection.js +87 -0
- package/dist/components/agent/settings/sections/EnvironmentSecretsSection.js.map +1 -0
- package/dist/components/agent/settings/sections/ExportBackupSection.d.ts +3 -0
- package/dist/components/agent/settings/sections/ExportBackupSection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/ExportBackupSection.js +23 -0
- package/dist/components/agent/settings/sections/ExportBackupSection.js.map +1 -0
- package/dist/components/agent/settings/sections/GeneralSection.d.ts +3 -0
- package/dist/components/agent/settings/sections/GeneralSection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/GeneralSection.js +15 -0
- package/dist/components/agent/settings/sections/GeneralSection.js.map +1 -0
- package/dist/components/agent/settings/sections/IntegrationsSection.d.ts +3 -0
- package/dist/components/agent/settings/sections/IntegrationsSection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/IntegrationsSection.js +40 -0
- package/dist/components/agent/settings/sections/IntegrationsSection.js.map +1 -0
- package/dist/components/agent/settings/sections/NotificationsSection.d.ts +3 -0
- package/dist/components/agent/settings/sections/NotificationsSection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/NotificationsSection.js +28 -0
- package/dist/components/agent/settings/sections/NotificationsSection.js.map +1 -0
- package/dist/components/agent/settings/sections/ResourceLimitsSection.d.ts +3 -0
- package/dist/components/agent/settings/sections/ResourceLimitsSection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/ResourceLimitsSection.js +17 -0
- package/dist/components/agent/settings/sections/ResourceLimitsSection.js.map +1 -0
- package/dist/components/agent/settings/sections/SecurityComplianceSection.d.ts +3 -0
- package/dist/components/agent/settings/sections/SecurityComplianceSection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/SecurityComplianceSection.js +28 -0
- package/dist/components/agent/settings/sections/SecurityComplianceSection.js.map +1 -0
- package/dist/components/agent/settings/sections/UsageAnalyticsSection.d.ts +3 -0
- package/dist/components/agent/settings/sections/UsageAnalyticsSection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/UsageAnalyticsSection.js +17 -0
- package/dist/components/agent/settings/sections/UsageAnalyticsSection.js.map +1 -0
- package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.d.ts +54 -0
- package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.d.ts.map +1 -0
- package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js +333 -0
- package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js.map +1 -0
- package/dist/components/agent/settings/shared/CheckboxField.d.ts +13 -0
- package/dist/components/agent/settings/shared/CheckboxField.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/CheckboxField.js +8 -0
- package/dist/components/agent/settings/shared/CheckboxField.js.map +1 -0
- package/dist/components/agent/settings/shared/InputField.d.ts +15 -0
- package/dist/components/agent/settings/shared/InputField.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/InputField.js +7 -0
- package/dist/components/agent/settings/shared/InputField.js.map +1 -0
- package/dist/components/agent/settings/shared/MembersTable.d.ts +11 -0
- package/dist/components/agent/settings/shared/MembersTable.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/MembersTable.js +7 -0
- package/dist/components/agent/settings/shared/MembersTable.js.map +1 -0
- package/dist/components/agent/settings/shared/SettingRow.d.ts +11 -0
- package/dist/components/agent/settings/shared/SettingRow.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/SettingRow.js +6 -0
- package/dist/components/agent/settings/shared/SettingRow.js.map +1 -0
- package/dist/components/agent/settings/shared/SettingsCard.d.ts +11 -0
- package/dist/components/agent/settings/shared/SettingsCard.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/SettingsCard.js +8 -0
- package/dist/components/agent/settings/shared/SettingsCard.js.map +1 -0
- package/dist/components/agent/settings/shared/ToggleSwitch.d.ts +8 -0
- package/dist/components/agent/settings/shared/ToggleSwitch.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/ToggleSwitch.js +6 -0
- package/dist/components/agent/settings/shared/ToggleSwitch.js.map +1 -0
- package/dist/components/agent/settings/shared/UsageChart.d.ts +12 -0
- package/dist/components/agent/settings/shared/UsageChart.d.ts.map +1 -0
- package/dist/components/agent/settings/shared/UsageChart.js +16 -0
- package/dist/components/agent/settings/shared/UsageChart.js.map +1 -0
- package/dist/components/agent/toolCardDisplay.d.ts +24 -0
- package/dist/components/agent/toolCardDisplay.d.ts.map +1 -0
- package/dist/components/agent/toolCardDisplay.js +85 -0
- package/dist/components/agent/toolCardDisplay.js.map +1 -0
- package/dist/components/product/XenoAgentProductHeader.d.ts +18 -0
- package/dist/components/product/XenoAgentProductHeader.d.ts.map +1 -0
- package/dist/components/product/XenoAgentProductHeader.js +25 -0
- package/dist/components/product/XenoAgentProductHeader.js.map +1 -0
- package/dist/components/product/XenoAgentSessionTabs.d.ts +18 -0
- package/dist/components/product/XenoAgentSessionTabs.d.ts.map +1 -0
- package/dist/components/product/XenoAgentSessionTabs.js +103 -0
- package/dist/components/product/XenoAgentSessionTabs.js.map +1 -0
- package/dist/components/ui/CodeBlock.d.ts +8 -0
- package/dist/components/ui/CodeBlock.d.ts.map +1 -0
- package/dist/components/ui/CodeBlock.js +89 -0
- package/dist/components/ui/CodeBlock.js.map +1 -0
- package/dist/components/ui/XenoLogo.d.ts +11 -0
- package/dist/components/ui/XenoLogo.d.ts.map +1 -0
- package/dist/components/ui/XenoLogo.js +9 -0
- package/dist/components/ui/XenoLogo.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +127 -0
- package/dist/index.js.map +1 -0
- package/dist/platformApiTypes.d.ts +3992 -0
- package/dist/platformApiTypes.d.ts.map +1 -0
- package/dist/platformApiTypes.js +2 -0
- package/dist/platformApiTypes.js.map +1 -0
- package/dist/platformBridge.d.ts +9 -0
- package/dist/platformBridge.d.ts.map +1 -0
- package/dist/platformBridge.js +19 -0
- package/dist/platformBridge.js.map +1 -0
- package/dist/providerSelector.d.ts +28 -0
- package/dist/providerSelector.d.ts.map +1 -0
- package/dist/providerSelector.js +104 -0
- package/dist/providerSelector.js.map +1 -0
- package/dist/services/connectionMode.d.ts +13 -0
- package/dist/services/connectionMode.d.ts.map +1 -0
- package/dist/services/connectionMode.js +31 -0
- package/dist/services/connectionMode.js.map +1 -0
- package/dist/sessionTabs.d.ts +48 -0
- package/dist/sessionTabs.d.ts.map +1 -0
- package/dist/sessionTabs.js +106 -0
- package/dist/sessionTabs.js.map +1 -0
- package/dist/stores/acpAgentStore.d.ts +264 -0
- package/dist/stores/acpAgentStore.d.ts.map +1 -0
- package/dist/stores/acpAgentStore.js +825 -0
- package/dist/stores/acpAgentStore.js.map +1 -0
- package/dist/stores/agentChatStore.d.ts +529 -0
- package/dist/stores/agentChatStore.d.ts.map +1 -0
- package/dist/stores/agentChatStore.js +5309 -0
- package/dist/stores/agentChatStore.js.map +1 -0
- package/dist/stores/agentIdeStore.d.ts +9 -0
- package/dist/stores/agentIdeStore.d.ts.map +1 -0
- package/dist/stores/agentIdeStore.js +8 -0
- package/dist/stores/agentIdeStore.js.map +1 -0
- package/dist/stores/agentSearchStore.d.ts +174 -0
- package/dist/stores/agentSearchStore.d.ts.map +1 -0
- package/dist/stores/agentSearchStore.js +305 -0
- package/dist/stores/agentSearchStore.js.map +1 -0
- package/dist/stores/authStore.d.ts +26 -0
- package/dist/stores/authStore.d.ts.map +1 -0
- package/dist/stores/authStore.js +163 -0
- package/dist/stores/authStore.js.map +1 -0
- package/dist/stores/entitySettingsStore.d.ts +236 -0
- package/dist/stores/entitySettingsStore.d.ts.map +1 -0
- package/dist/stores/entitySettingsStore.js +916 -0
- package/dist/stores/entitySettingsStore.js.map +1 -0
- package/dist/stores/permissionStore.d.ts +25 -0
- package/dist/stores/permissionStore.d.ts.map +1 -0
- package/dist/stores/permissionStore.js +58 -0
- package/dist/stores/permissionStore.js.map +1 -0
- package/dist/stores/suggestionStore.d.ts +29 -0
- package/dist/stores/suggestionStore.d.ts.map +1 -0
- package/dist/stores/suggestionStore.js +160 -0
- package/dist/stores/suggestionStore.js.map +1 -0
- package/dist/stores/tabStore.d.ts +30 -0
- package/dist/stores/tabStore.d.ts.map +1 -0
- package/dist/stores/tabStore.js +252 -0
- package/dist/stores/tabStore.js.map +1 -0
- package/dist/stores/themeStore.d.ts +13 -0
- package/dist/stores/themeStore.d.ts.map +1 -0
- package/dist/stores/themeStore.js +77 -0
- package/dist/stores/themeStore.js.map +1 -0
- package/dist/stores/workspaceStore.d.ts +175 -0
- package/dist/stores/workspaceStore.d.ts.map +1 -0
- package/dist/stores/workspaceStore.js +694 -0
- package/dist/stores/workspaceStore.js.map +1 -0
- package/dist/stores/xenoChatStore.d.ts +88 -0
- package/dist/stores/xenoChatStore.d.ts.map +1 -0
- package/dist/stores/xenoChatStore.js +572 -0
- package/dist/stores/xenoChatStore.js.map +1 -0
- package/dist/toolCardProjection.d.ts +33 -0
- package/dist/toolCardProjection.d.ts.map +1 -0
- package/dist/toolCardProjection.js +62 -0
- package/dist/toolCardProjection.js.map +1 -0
- package/dist/types/agentEditor.d.ts +39 -0
- package/dist/types/agentEditor.d.ts.map +1 -0
- package/dist/types/agentEditor.js +2 -0
- package/dist/types/agentEditor.js.map +1 -0
- package/dist/types/agentRuntimeProvider.d.ts +2 -0
- package/dist/types/agentRuntimeProvider.d.ts.map +1 -0
- package/dist/types/agentRuntimeProvider.js +2 -0
- package/dist/types/agentRuntimeProvider.js.map +1 -0
- package/dist/utils/acpExecutionAuthority.d.ts +18 -0
- package/dist/utils/acpExecutionAuthority.d.ts.map +1 -0
- package/dist/utils/acpExecutionAuthority.js +22 -0
- package/dist/utils/acpExecutionAuthority.js.map +1 -0
- package/dist/utils/agentAttachedContextPrompt.d.ts +2 -0
- package/dist/utils/agentAttachedContextPrompt.d.ts.map +1 -0
- package/dist/utils/agentAttachedContextPrompt.js +2 -0
- package/dist/utils/agentAttachedContextPrompt.js.map +1 -0
- package/dist/utils/agentModelContext.d.ts +2 -0
- package/dist/utils/agentModelContext.d.ts.map +1 -0
- package/dist/utils/agentModelContext.js +2 -0
- package/dist/utils/agentModelContext.js.map +1 -0
- package/dist/utils/agentReasoningEffort.d.ts +3 -0
- package/dist/utils/agentReasoningEffort.d.ts.map +1 -0
- package/dist/utils/agentReasoningEffort.js +2 -0
- package/dist/utils/agentReasoningEffort.js.map +1 -0
- package/dist/utils/agentRuntimeProvider.d.ts +3 -0
- package/dist/utils/agentRuntimeProvider.d.ts.map +1 -0
- package/dist/utils/agentRuntimeProvider.js +2 -0
- package/dist/utils/agentRuntimeProvider.js.map +1 -0
- package/dist/utils/cloudModels.d.ts +3 -0
- package/dist/utils/cloudModels.d.ts.map +1 -0
- package/dist/utils/cloudModels.js +181 -0
- package/dist/utils/cloudModels.js.map +1 -0
- package/dist/utils/conversationRuntime.d.ts +3 -0
- package/dist/utils/conversationRuntime.d.ts.map +1 -0
- package/dist/utils/conversationRuntime.js +2 -0
- package/dist/utils/conversationRuntime.js.map +1 -0
- package/dist/utils/fileCreateIntent.d.ts +16 -0
- package/dist/utils/fileCreateIntent.d.ts.map +1 -0
- package/dist/utils/fileCreateIntent.js +123 -0
- package/dist/utils/fileCreateIntent.js.map +1 -0
- package/dist/utils/legacyAgentRuntimeEvents.d.ts +2 -0
- package/dist/utils/legacyAgentRuntimeEvents.d.ts.map +1 -0
- package/dist/utils/legacyAgentRuntimeEvents.js +2 -0
- package/dist/utils/legacyAgentRuntimeEvents.js.map +1 -0
- package/dist/utils/markdownWindowsPaths.d.ts +2 -0
- package/dist/utils/markdownWindowsPaths.d.ts.map +1 -0
- package/dist/utils/markdownWindowsPaths.js +2 -0
- package/dist/utils/markdownWindowsPaths.js.map +1 -0
- package/dist/utils/workspaceSelectionContinuation.d.ts +2 -0
- package/dist/utils/workspaceSelectionContinuation.d.ts.map +1 -0
- package/dist/utils/workspaceSelectionContinuation.js +2 -0
- package/dist/utils/workspaceSelectionContinuation.js.map +1 -0
- package/package.json +53 -0
- package/src/agent.css +1156 -0
- package/src/foundation.css +62 -0
|
@@ -0,0 +1,694 @@
|
|
|
1
|
+
import { getAgentPlatformBridge } from '../platformBridge';
|
|
2
|
+
/**
|
|
3
|
+
* Workspace Store — Zustand store with file-backed persistence
|
|
4
|
+
*
|
|
5
|
+
* Manages the workspace → team → agent hierarchy.
|
|
6
|
+
* Persists to ~/.xeno/workspaces.json via Electron IPC.
|
|
7
|
+
* Conversations are NOT stored here — they live in agentChatStore.
|
|
8
|
+
*/
|
|
9
|
+
import { create } from 'zustand';
|
|
10
|
+
import { useAgentChatStore } from './agentChatStore';
|
|
11
|
+
import { DEFAULT_HUB_AGENT_RUNTIME_SELECTION, normalizeHubAgentRuntimeSelection, } from '../utils/agentRuntimeProvider';
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// HELPERS
|
|
14
|
+
// =============================================================================
|
|
15
|
+
function generateId() {
|
|
16
|
+
return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
17
|
+
}
|
|
18
|
+
const DEFAULT_CAPABILITIES = {
|
|
19
|
+
terminal: true,
|
|
20
|
+
fileRead: true,
|
|
21
|
+
fileWrite: false,
|
|
22
|
+
appLaunch: true,
|
|
23
|
+
};
|
|
24
|
+
const DEFAULT_PERMISSION_PROFILE = 'standard';
|
|
25
|
+
const VALID_PERMISSION_PROFILES = new Set([
|
|
26
|
+
'standard',
|
|
27
|
+
'read-only',
|
|
28
|
+
'edit-with-approval',
|
|
29
|
+
'trusted-workspace',
|
|
30
|
+
'plan',
|
|
31
|
+
]);
|
|
32
|
+
function normalizePermissionProfile(value) {
|
|
33
|
+
if (typeof value !== 'string')
|
|
34
|
+
return DEFAULT_PERMISSION_PROFILE;
|
|
35
|
+
const normalized = value.trim().toLowerCase();
|
|
36
|
+
return VALID_PERMISSION_PROFILES.has(normalized) ? normalized : DEFAULT_PERMISSION_PROFILE;
|
|
37
|
+
}
|
|
38
|
+
function normalizeTeamAgentCallPolicy(value) {
|
|
39
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
40
|
+
return undefined;
|
|
41
|
+
const record = value;
|
|
42
|
+
const stringArray = (entry) => Array.isArray(entry)
|
|
43
|
+
? Array.from(new Set(entry.filter((item) => typeof item === 'string' && !!item.trim()).map(item => item.trim())))
|
|
44
|
+
: undefined;
|
|
45
|
+
const positiveNumber = (entry) => (typeof entry === 'number' && Number.isFinite(entry) && entry > 0 ? Math.floor(entry) : undefined);
|
|
46
|
+
const allowedExpectedArtifacts = Array.isArray(record.allowedExpectedArtifacts)
|
|
47
|
+
? record.allowedExpectedArtifacts.filter((entry) => (entry === 'answer' || entry === 'file' || entry === 'diff' || entry === 'diagnostic' || entry === 'report'))
|
|
48
|
+
: undefined;
|
|
49
|
+
const policy = {
|
|
50
|
+
callableAgentIds: stringArray(record.callableAgentIds),
|
|
51
|
+
deniedAgentIds: stringArray(record.deniedAgentIds),
|
|
52
|
+
maxConcurrentChildRuns: positiveNumber(record.maxConcurrentChildRuns),
|
|
53
|
+
maxChildDepth: positiveNumber(record.maxChildDepth),
|
|
54
|
+
maxTokens: positiveNumber(record.maxTokens),
|
|
55
|
+
maxCredits: positiveNumber(record.maxCredits),
|
|
56
|
+
maxRuntimeMs: positiveNumber(record.maxRuntimeMs),
|
|
57
|
+
contextAttachmentLimit: positiveNumber(record.contextAttachmentLimit),
|
|
58
|
+
allowedExpectedArtifacts,
|
|
59
|
+
allowFurtherDelegation: typeof record.allowFurtherDelegation === 'boolean' ? record.allowFurtherDelegation : undefined,
|
|
60
|
+
cancellationPropagation: typeof record.cancellationPropagation === 'boolean' ? record.cancellationPropagation : undefined,
|
|
61
|
+
};
|
|
62
|
+
return Object.values(policy).some((entry) => entry !== undefined) ? policy : undefined;
|
|
63
|
+
}
|
|
64
|
+
function normalizeLoadedAgent(agent) {
|
|
65
|
+
return {
|
|
66
|
+
...agent,
|
|
67
|
+
capabilities: agent.capabilities || DEFAULT_CAPABILITIES,
|
|
68
|
+
permissionProfile: normalizePermissionProfile(agent.permissionProfile),
|
|
69
|
+
runtimeSelection: normalizeHubAgentRuntimeSelection(agent.runtimeSelection),
|
|
70
|
+
allowedDirectories: Array.isArray(agent.allowedDirectories) ? agent.allowedDirectories : [],
|
|
71
|
+
allowedApps: Array.isArray(agent.allowedApps) ? agent.allowedApps : [],
|
|
72
|
+
approvalRules: Array.isArray(agent.approvalRules) ? agent.approvalRules : [],
|
|
73
|
+
conversations: Array.isArray(agent.conversations) ? agent.conversations : [],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function normalizeLoadedWorkspaces(workspaces) {
|
|
77
|
+
return workspaces.map((workspace) => ({
|
|
78
|
+
...workspace,
|
|
79
|
+
directories: Array.isArray(workspace.directories) ? workspace.directories : [],
|
|
80
|
+
apps: Array.isArray(workspace.apps) ? workspace.apps : [],
|
|
81
|
+
teams: (Array.isArray(workspace.teams) ? workspace.teams : []).map((team) => ({
|
|
82
|
+
...team,
|
|
83
|
+
allowedDirectories: Array.isArray(team.allowedDirectories) ? team.allowedDirectories : [],
|
|
84
|
+
allowedApps: Array.isArray(team.allowedApps) ? team.allowedApps : [],
|
|
85
|
+
teamAgentPolicy: normalizeTeamAgentCallPolicy(team.teamAgentPolicy),
|
|
86
|
+
agents: (Array.isArray(team.agents) ? team.agents : []).map(normalizeLoadedAgent),
|
|
87
|
+
})),
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
// Debounced persist
|
|
91
|
+
let persistTimer = null;
|
|
92
|
+
function schedulePersist(workspaces) {
|
|
93
|
+
if (persistTimer)
|
|
94
|
+
clearTimeout(persistTimer);
|
|
95
|
+
persistTimer = setTimeout(() => {
|
|
96
|
+
persistTimer = null;
|
|
97
|
+
const teamCount = workspaces.reduce((sum, w) => sum + w.teams.length, 0);
|
|
98
|
+
const agentCount = workspaces.reduce((sum, w) => sum + w.teams.reduce((s, t) => s + t.agents.length, 0), 0);
|
|
99
|
+
console.warn(`[WorkspaceStore] Saving ${workspaces.length} workspaces, ${teamCount} teams, ${agentCount} agents`);
|
|
100
|
+
getAgentPlatformBridge()?.workspaceStorage?.save(workspaces).catch((err) => {
|
|
101
|
+
console.warn('[WorkspaceStore] Save failed:', err);
|
|
102
|
+
});
|
|
103
|
+
}, 300);
|
|
104
|
+
}
|
|
105
|
+
function flushPersist(workspaces) {
|
|
106
|
+
if (persistTimer)
|
|
107
|
+
clearTimeout(persistTimer);
|
|
108
|
+
persistTimer = null;
|
|
109
|
+
console.warn(`[WorkspaceStore] Flush-saving (delete operation)`);
|
|
110
|
+
getAgentPlatformBridge()?.workspaceStorage?.save(workspaces).catch((err) => {
|
|
111
|
+
console.warn('[WorkspaceStore] Save failed:', err);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
let workspaceStorageChangedListenerRegistered = false;
|
|
115
|
+
let workspaceStorageChangedUnsupportedReported = false;
|
|
116
|
+
/**
|
|
117
|
+
* Registers the cross-surface workspace-change listener when the active platform
|
|
118
|
+
* bridge actually provides one.
|
|
119
|
+
*
|
|
120
|
+
* The presence of `onChanged` is NOT proof the capability works, so the
|
|
121
|
+
* "registered" latch is only set once registration has actually completed. When the
|
|
122
|
+
* surface does not deliver change notifications the absence is reported once and the
|
|
123
|
+
* latch stays open, so a later bridge that does support it can still register.
|
|
124
|
+
*/
|
|
125
|
+
function ensureWorkspaceStorageChangedListener() {
|
|
126
|
+
if (workspaceStorageChangedListenerRegistered)
|
|
127
|
+
return;
|
|
128
|
+
const storage = getAgentPlatformBridge()?.workspaceStorage;
|
|
129
|
+
if (typeof storage?.onChanged !== 'function') {
|
|
130
|
+
if (!workspaceStorageChangedUnsupportedReported) {
|
|
131
|
+
workspaceStorageChangedUnsupportedReported = true;
|
|
132
|
+
console.warn('[WorkspaceStore] This surface does not deliver workspace-storage change notifications — '
|
|
133
|
+
+ 'workspaces edited in another window or surface will not reload automatically.');
|
|
134
|
+
}
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
storage.onChanged(() => {
|
|
139
|
+
void useWorkspaceStore.getState().loadWorkspaces();
|
|
140
|
+
});
|
|
141
|
+
workspaceStorageChangedListenerRegistered = true;
|
|
142
|
+
}
|
|
143
|
+
catch (err) {
|
|
144
|
+
console.warn('[WorkspaceStore] Failed to register the workspace-storage change listener:', err);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// Cascade: collect all agent IDs from a workspace
|
|
148
|
+
function collectAgentIds(workspace) {
|
|
149
|
+
return workspace.teams.flatMap(t => t.agents.map(a => a.id));
|
|
150
|
+
}
|
|
151
|
+
// Cascade: delete conversations for a list of agent IDs
|
|
152
|
+
function cascadeDeleteConversations(agentIds) {
|
|
153
|
+
const store = useAgentChatStore.getState();
|
|
154
|
+
const conversations = store.conversations;
|
|
155
|
+
for (const conv of Object.values(conversations)) {
|
|
156
|
+
if (agentIds.includes(conv.agentId)) {
|
|
157
|
+
store.deleteConversation(conv.id);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
export const useWorkspaceStore = create((set, get) => ({
|
|
162
|
+
workspaces: [],
|
|
163
|
+
isLoaded: false,
|
|
164
|
+
// ── Lifecycle ────────────────────────────────────────────────────────────
|
|
165
|
+
loadWorkspaces: async () => {
|
|
166
|
+
try {
|
|
167
|
+
ensureWorkspaceStorageChangedListener();
|
|
168
|
+
const result = await getAgentPlatformBridge()?.workspaceStorage?.load();
|
|
169
|
+
if (result?.success && Array.isArray(result.workspaces)) {
|
|
170
|
+
const ws = normalizeLoadedWorkspaces(result.workspaces);
|
|
171
|
+
const teamCount = ws.reduce((sum, w) => sum + w.teams.length, 0);
|
|
172
|
+
const agentCount = ws.reduce((sum, w) => sum + w.teams.reduce((s, t) => s + t.agents.length, 0), 0);
|
|
173
|
+
console.warn(`[WorkspaceStore] Loaded ${ws.length} workspaces, ${teamCount} teams, ${agentCount} agents`);
|
|
174
|
+
set({ workspaces: ws, isLoaded: true });
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
console.warn('[WorkspaceStore] No saved workspaces found — starting fresh');
|
|
178
|
+
set({ isLoaded: true });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
catch (err) {
|
|
182
|
+
console.warn('[WorkspaceStore] Failed to load workspaces:', err);
|
|
183
|
+
set({ isLoaded: true });
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
// ── Workspace CRUD ───────────────────────────────────────────────────────
|
|
187
|
+
addWorkspace: (name) => {
|
|
188
|
+
const id = generateId();
|
|
189
|
+
const workspace = {
|
|
190
|
+
id,
|
|
191
|
+
name: name.trim(),
|
|
192
|
+
directories: [],
|
|
193
|
+
apps: [],
|
|
194
|
+
teams: [],
|
|
195
|
+
isExpanded: true,
|
|
196
|
+
createdAt: Date.now(),
|
|
197
|
+
};
|
|
198
|
+
set(state => {
|
|
199
|
+
const next = [...state.workspaces, workspace];
|
|
200
|
+
schedulePersist(next);
|
|
201
|
+
return { workspaces: next };
|
|
202
|
+
});
|
|
203
|
+
return id;
|
|
204
|
+
},
|
|
205
|
+
renameWorkspace: (id, name) => {
|
|
206
|
+
set(state => {
|
|
207
|
+
const next = state.workspaces.map(w => w.id === id ? { ...w, name: name.trim() } : w);
|
|
208
|
+
schedulePersist(next);
|
|
209
|
+
return { workspaces: next };
|
|
210
|
+
});
|
|
211
|
+
},
|
|
212
|
+
deleteWorkspace: (id) => {
|
|
213
|
+
const ws = get().workspaces.find(w => w.id === id);
|
|
214
|
+
if (ws)
|
|
215
|
+
cascadeDeleteConversations(collectAgentIds(ws));
|
|
216
|
+
set(state => {
|
|
217
|
+
const next = state.workspaces.filter(w => w.id !== id);
|
|
218
|
+
flushPersist(next);
|
|
219
|
+
return { workspaces: next };
|
|
220
|
+
});
|
|
221
|
+
},
|
|
222
|
+
duplicateWorkspace: (id) => {
|
|
223
|
+
set(state => {
|
|
224
|
+
const source = state.workspaces.find(w => w.id === id);
|
|
225
|
+
if (!source)
|
|
226
|
+
return state;
|
|
227
|
+
const clone = {
|
|
228
|
+
...source,
|
|
229
|
+
id: generateId(),
|
|
230
|
+
name: `${source.name} (copy)`,
|
|
231
|
+
teams: source.teams.map(t => ({
|
|
232
|
+
...t,
|
|
233
|
+
id: generateId(),
|
|
234
|
+
agents: t.agents.map(a => ({
|
|
235
|
+
...a,
|
|
236
|
+
id: generateId(),
|
|
237
|
+
conversations: [],
|
|
238
|
+
})),
|
|
239
|
+
})),
|
|
240
|
+
};
|
|
241
|
+
const next = [...state.workspaces, clone];
|
|
242
|
+
schedulePersist(next);
|
|
243
|
+
return { workspaces: next };
|
|
244
|
+
});
|
|
245
|
+
},
|
|
246
|
+
toggleWorkspaceExpanded: (id) => {
|
|
247
|
+
set(state => {
|
|
248
|
+
const next = state.workspaces.map(w => w.id === id ? { ...w, isExpanded: !w.isExpanded } : w);
|
|
249
|
+
schedulePersist(next);
|
|
250
|
+
return { workspaces: next };
|
|
251
|
+
});
|
|
252
|
+
},
|
|
253
|
+
addDirectoryToWorkspace: (workspaceId, path) => {
|
|
254
|
+
set(state => {
|
|
255
|
+
const next = state.workspaces.map(w => w.id === workspaceId && !w.directories.includes(path)
|
|
256
|
+
? { ...w, directories: [...w.directories, path] }
|
|
257
|
+
: w);
|
|
258
|
+
schedulePersist(next);
|
|
259
|
+
return { workspaces: next };
|
|
260
|
+
});
|
|
261
|
+
},
|
|
262
|
+
removeDirectoryFromWorkspace: (workspaceId, directory) => {
|
|
263
|
+
set(state => {
|
|
264
|
+
const next = state.workspaces.map(w => {
|
|
265
|
+
if (w.id !== workspaceId)
|
|
266
|
+
return w;
|
|
267
|
+
return {
|
|
268
|
+
...w,
|
|
269
|
+
directories: w.directories.filter(d => d !== directory),
|
|
270
|
+
teams: w.teams.map(t => ({
|
|
271
|
+
...t,
|
|
272
|
+
allowedDirectories: t.allowedDirectories.filter(d => d !== directory),
|
|
273
|
+
agents: t.agents.map(a => ({
|
|
274
|
+
...a,
|
|
275
|
+
allowedDirectories: a.allowedDirectories.filter(d => d !== directory),
|
|
276
|
+
})),
|
|
277
|
+
})),
|
|
278
|
+
};
|
|
279
|
+
});
|
|
280
|
+
schedulePersist(next);
|
|
281
|
+
return { workspaces: next };
|
|
282
|
+
});
|
|
283
|
+
},
|
|
284
|
+
addAppToWorkspace: (workspaceId, app) => {
|
|
285
|
+
set(state => {
|
|
286
|
+
const next = state.workspaces.map(w => w.id === workspaceId ? { ...w, apps: [...w.apps, app] } : w);
|
|
287
|
+
schedulePersist(next);
|
|
288
|
+
return { workspaces: next };
|
|
289
|
+
});
|
|
290
|
+
},
|
|
291
|
+
removeAppFromWorkspace: (workspaceId, appId) => {
|
|
292
|
+
set(state => {
|
|
293
|
+
const next = state.workspaces.map(w => {
|
|
294
|
+
if (w.id !== workspaceId)
|
|
295
|
+
return w;
|
|
296
|
+
return {
|
|
297
|
+
...w,
|
|
298
|
+
apps: w.apps.filter(a => a.id !== appId),
|
|
299
|
+
teams: w.teams.map(t => ({
|
|
300
|
+
...t,
|
|
301
|
+
allowedApps: t.allowedApps.filter(id => id !== appId),
|
|
302
|
+
agents: t.agents.map(a => ({
|
|
303
|
+
...a,
|
|
304
|
+
allowedApps: a.allowedApps.filter(id => id !== appId),
|
|
305
|
+
})),
|
|
306
|
+
})),
|
|
307
|
+
};
|
|
308
|
+
});
|
|
309
|
+
schedulePersist(next);
|
|
310
|
+
return { workspaces: next };
|
|
311
|
+
});
|
|
312
|
+
},
|
|
313
|
+
// ── Team CRUD ────────────────────────────────────────────────────────────
|
|
314
|
+
addTeam: (workspaceId, name) => {
|
|
315
|
+
const id = generateId();
|
|
316
|
+
const team = {
|
|
317
|
+
id,
|
|
318
|
+
name: name.trim(),
|
|
319
|
+
allowedDirectories: [],
|
|
320
|
+
allowedApps: [],
|
|
321
|
+
agents: [],
|
|
322
|
+
isExpanded: true,
|
|
323
|
+
};
|
|
324
|
+
set(state => {
|
|
325
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
326
|
+
? { ...w, isExpanded: true, teams: [...w.teams, team] }
|
|
327
|
+
: w);
|
|
328
|
+
schedulePersist(next);
|
|
329
|
+
return { workspaces: next };
|
|
330
|
+
});
|
|
331
|
+
return id;
|
|
332
|
+
},
|
|
333
|
+
renameTeam: (workspaceId, teamId, name) => {
|
|
334
|
+
set(state => {
|
|
335
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
336
|
+
? { ...w, teams: w.teams.map(t => t.id === teamId ? { ...t, name: name.trim() } : t) }
|
|
337
|
+
: w);
|
|
338
|
+
schedulePersist(next);
|
|
339
|
+
return { workspaces: next };
|
|
340
|
+
});
|
|
341
|
+
},
|
|
342
|
+
deleteTeam: (workspaceId, teamId) => {
|
|
343
|
+
const ws = get().workspaces.find(w => w.id === workspaceId);
|
|
344
|
+
const team = ws?.teams.find(t => t.id === teamId);
|
|
345
|
+
if (team)
|
|
346
|
+
cascadeDeleteConversations(team.agents.map(a => a.id));
|
|
347
|
+
set(state => {
|
|
348
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
349
|
+
? { ...w, teams: w.teams.filter(t => t.id !== teamId) }
|
|
350
|
+
: w);
|
|
351
|
+
flushPersist(next);
|
|
352
|
+
return { workspaces: next };
|
|
353
|
+
});
|
|
354
|
+
},
|
|
355
|
+
duplicateTeam: (workspaceId, teamId) => {
|
|
356
|
+
set(state => {
|
|
357
|
+
const next = state.workspaces.map(w => {
|
|
358
|
+
if (w.id !== workspaceId)
|
|
359
|
+
return w;
|
|
360
|
+
const source = w.teams.find(t => t.id === teamId);
|
|
361
|
+
if (!source)
|
|
362
|
+
return w;
|
|
363
|
+
const clone = {
|
|
364
|
+
...source,
|
|
365
|
+
id: generateId(),
|
|
366
|
+
name: `${source.name} (copy)`,
|
|
367
|
+
agents: source.agents.map(a => ({ ...a, id: generateId(), conversations: [] })),
|
|
368
|
+
};
|
|
369
|
+
return { ...w, teams: [...w.teams, clone] };
|
|
370
|
+
});
|
|
371
|
+
schedulePersist(next);
|
|
372
|
+
return { workspaces: next };
|
|
373
|
+
});
|
|
374
|
+
},
|
|
375
|
+
moveTeam: (sourceWsId, teamId, targetWsId) => {
|
|
376
|
+
if (sourceWsId === targetWsId)
|
|
377
|
+
return;
|
|
378
|
+
set(state => {
|
|
379
|
+
const sourceWs = state.workspaces.find(w => w.id === sourceWsId);
|
|
380
|
+
const targetWs = state.workspaces.find(w => w.id === targetWsId);
|
|
381
|
+
const team = sourceWs?.teams.find(t => t.id === teamId);
|
|
382
|
+
if (!sourceWs || !targetWs || !team)
|
|
383
|
+
return state;
|
|
384
|
+
// Sanitize: remove directories/apps not in target workspace
|
|
385
|
+
const movedTeam = {
|
|
386
|
+
...team,
|
|
387
|
+
allowedDirectories: team.allowedDirectories.filter(d => targetWs.directories.includes(d)),
|
|
388
|
+
allowedApps: team.allowedApps.filter(id => targetWs.apps.some(a => a.id === id)),
|
|
389
|
+
agents: team.agents.map(a => ({
|
|
390
|
+
...a,
|
|
391
|
+
allowedDirectories: a.allowedDirectories.filter(d => targetWs.directories.includes(d)),
|
|
392
|
+
allowedApps: a.allowedApps.filter(id => targetWs.apps.some(app => app.id === id)),
|
|
393
|
+
workspaceName: targetWs.name,
|
|
394
|
+
})),
|
|
395
|
+
};
|
|
396
|
+
const next = state.workspaces.map(w => {
|
|
397
|
+
if (w.id === sourceWsId)
|
|
398
|
+
return { ...w, teams: w.teams.filter(t => t.id !== teamId) };
|
|
399
|
+
if (w.id === targetWsId)
|
|
400
|
+
return { ...w, teams: [...w.teams, movedTeam] };
|
|
401
|
+
return w;
|
|
402
|
+
});
|
|
403
|
+
schedulePersist(next);
|
|
404
|
+
return { workspaces: next };
|
|
405
|
+
});
|
|
406
|
+
},
|
|
407
|
+
toggleTeamExpanded: (workspaceId, teamId) => {
|
|
408
|
+
set(state => {
|
|
409
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
410
|
+
? { ...w, teams: w.teams.map(t => t.id === teamId ? { ...t, isExpanded: !t.isExpanded } : t) }
|
|
411
|
+
: w);
|
|
412
|
+
schedulePersist(next);
|
|
413
|
+
return { workspaces: next };
|
|
414
|
+
});
|
|
415
|
+
},
|
|
416
|
+
// ── Agent CRUD ───────────────────────────────────────────────────────────
|
|
417
|
+
addAgent: (workspaceId, teamId, name, model, systemPrompt, capabilities) => {
|
|
418
|
+
const id = generateId();
|
|
419
|
+
const ws = get().workspaces.find(w => w.id === workspaceId);
|
|
420
|
+
const team = ws?.teams.find(t => t.id === teamId);
|
|
421
|
+
const isFirst = !team?.agents.length || !team.agents.some(a => a.isMainAssistant);
|
|
422
|
+
const agent = {
|
|
423
|
+
id,
|
|
424
|
+
name: name.trim(),
|
|
425
|
+
isMainAssistant: isFirst,
|
|
426
|
+
model: model || 'claude-sonnet-4-6',
|
|
427
|
+
systemPrompt: systemPrompt || `You are ${name.trim()}, an assistant in ${ws?.name || 'Workspace'}/${team?.name || 'Team'}.`,
|
|
428
|
+
templateName: 'Custom',
|
|
429
|
+
capabilities: capabilities || DEFAULT_CAPABILITIES,
|
|
430
|
+
permissionProfile: DEFAULT_PERMISSION_PROFILE,
|
|
431
|
+
runtimeSelection: {
|
|
432
|
+
...DEFAULT_HUB_AGENT_RUNTIME_SELECTION,
|
|
433
|
+
selectedAt: Date.now(),
|
|
434
|
+
},
|
|
435
|
+
allowedDirectories: [...(team?.allowedDirectories || [])],
|
|
436
|
+
allowedApps: [...(team?.allowedApps || [])],
|
|
437
|
+
approvalRules: [],
|
|
438
|
+
conversations: [],
|
|
439
|
+
isExpanded: false,
|
|
440
|
+
workspaceName: ws?.name,
|
|
441
|
+
teamName: team?.name,
|
|
442
|
+
};
|
|
443
|
+
set(state => {
|
|
444
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
445
|
+
? {
|
|
446
|
+
...w,
|
|
447
|
+
teams: w.teams.map(t => t.id === teamId
|
|
448
|
+
? { ...t, isExpanded: true, agents: [...t.agents, agent] }
|
|
449
|
+
: t),
|
|
450
|
+
}
|
|
451
|
+
: w);
|
|
452
|
+
schedulePersist(next);
|
|
453
|
+
return { workspaces: next };
|
|
454
|
+
});
|
|
455
|
+
return id;
|
|
456
|
+
},
|
|
457
|
+
renameAgent: (workspaceId, teamId, agentId, name) => {
|
|
458
|
+
set(state => {
|
|
459
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
460
|
+
? {
|
|
461
|
+
...w,
|
|
462
|
+
teams: w.teams.map(t => t.id === teamId
|
|
463
|
+
? { ...t, agents: t.agents.map(a => a.id === agentId ? { ...a, name: name.trim() } : a) }
|
|
464
|
+
: t),
|
|
465
|
+
}
|
|
466
|
+
: w);
|
|
467
|
+
schedulePersist(next);
|
|
468
|
+
return { workspaces: next };
|
|
469
|
+
});
|
|
470
|
+
},
|
|
471
|
+
deleteAgent: (workspaceId, teamId, agentId) => {
|
|
472
|
+
cascadeDeleteConversations([agentId]);
|
|
473
|
+
set(state => {
|
|
474
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
475
|
+
? {
|
|
476
|
+
...w,
|
|
477
|
+
teams: w.teams.map(t => t.id === teamId
|
|
478
|
+
? { ...t, agents: t.agents.filter(a => a.id !== agentId) }
|
|
479
|
+
: t),
|
|
480
|
+
}
|
|
481
|
+
: w);
|
|
482
|
+
flushPersist(next);
|
|
483
|
+
return { workspaces: next };
|
|
484
|
+
});
|
|
485
|
+
},
|
|
486
|
+
duplicateAgent: (workspaceId, teamId, agentId) => {
|
|
487
|
+
set(state => {
|
|
488
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
489
|
+
? {
|
|
490
|
+
...w,
|
|
491
|
+
teams: w.teams.map(t => {
|
|
492
|
+
if (t.id !== teamId)
|
|
493
|
+
return t;
|
|
494
|
+
const source = t.agents.find(a => a.id === agentId);
|
|
495
|
+
if (!source)
|
|
496
|
+
return t;
|
|
497
|
+
const clone = {
|
|
498
|
+
...source,
|
|
499
|
+
id: generateId(),
|
|
500
|
+
name: `${source.name} (copy)`,
|
|
501
|
+
conversations: [],
|
|
502
|
+
};
|
|
503
|
+
return { ...t, agents: [...t.agents, clone] };
|
|
504
|
+
}),
|
|
505
|
+
}
|
|
506
|
+
: w);
|
|
507
|
+
schedulePersist(next);
|
|
508
|
+
return { workspaces: next };
|
|
509
|
+
});
|
|
510
|
+
},
|
|
511
|
+
moveAgent: (srcWsId, srcTeamId, agentId, dstWsId, dstTeamId) => {
|
|
512
|
+
if (srcWsId === dstWsId && srcTeamId === dstTeamId)
|
|
513
|
+
return;
|
|
514
|
+
set(state => {
|
|
515
|
+
const srcWs = state.workspaces.find(w => w.id === srcWsId);
|
|
516
|
+
const srcTeam = srcWs?.teams.find(t => t.id === srcTeamId);
|
|
517
|
+
const agent = srcTeam?.agents.find(a => a.id === agentId);
|
|
518
|
+
if (!agent)
|
|
519
|
+
return state;
|
|
520
|
+
const dstWs = state.workspaces.find(w => w.id === dstWsId);
|
|
521
|
+
const dstTeam = dstWs?.teams.find(t => t.id === dstTeamId);
|
|
522
|
+
if (!dstWs || !dstTeam)
|
|
523
|
+
return state;
|
|
524
|
+
// Sanitize permissions for new workspace
|
|
525
|
+
const movedAgent = {
|
|
526
|
+
...agent,
|
|
527
|
+
allowedDirectories: agent.allowedDirectories.filter(d => dstWs.directories.includes(d)),
|
|
528
|
+
allowedApps: agent.allowedApps.filter(id => dstWs.apps.some(a => a.id === id)),
|
|
529
|
+
workspaceName: dstWs.name,
|
|
530
|
+
teamName: dstTeam.name,
|
|
531
|
+
};
|
|
532
|
+
const next = state.workspaces.map(w => {
|
|
533
|
+
if (w.id === srcWsId) {
|
|
534
|
+
return {
|
|
535
|
+
...w,
|
|
536
|
+
teams: w.teams.map(t => t.id === srcTeamId
|
|
537
|
+
? { ...t, agents: t.agents.filter(a => a.id !== agentId) }
|
|
538
|
+
: t),
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
if (w.id === dstWsId) {
|
|
542
|
+
return {
|
|
543
|
+
...w,
|
|
544
|
+
teams: w.teams.map(t => t.id === dstTeamId
|
|
545
|
+
? { ...t, agents: [...t.agents, movedAgent] }
|
|
546
|
+
: t),
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
return w;
|
|
550
|
+
});
|
|
551
|
+
schedulePersist(next);
|
|
552
|
+
return { workspaces: next };
|
|
553
|
+
});
|
|
554
|
+
},
|
|
555
|
+
toggleAgentExpanded: (workspaceId, teamId, agentId) => {
|
|
556
|
+
set(state => {
|
|
557
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
558
|
+
? {
|
|
559
|
+
...w,
|
|
560
|
+
teams: w.teams.map(t => t.id === teamId
|
|
561
|
+
? { ...t, agents: t.agents.map(a => a.id === agentId ? { ...a, isExpanded: !a.isExpanded } : a) }
|
|
562
|
+
: t),
|
|
563
|
+
}
|
|
564
|
+
: w);
|
|
565
|
+
schedulePersist(next);
|
|
566
|
+
return { workspaces: next };
|
|
567
|
+
});
|
|
568
|
+
},
|
|
569
|
+
updateAgent: (workspaceId, teamId, agentId, updates) => {
|
|
570
|
+
const safeUpdates = updates.runtimeSelection === undefined
|
|
571
|
+
? updates
|
|
572
|
+
: { ...updates, runtimeSelection: normalizeHubAgentRuntimeSelection(updates.runtimeSelection) };
|
|
573
|
+
set(state => {
|
|
574
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
575
|
+
? {
|
|
576
|
+
...w,
|
|
577
|
+
teams: w.teams.map(t => t.id === teamId
|
|
578
|
+
? { ...t, agents: t.agents.map(a => a.id === agentId ? { ...a, ...safeUpdates } : a) }
|
|
579
|
+
: t),
|
|
580
|
+
}
|
|
581
|
+
: w);
|
|
582
|
+
schedulePersist(next);
|
|
583
|
+
return { workspaces: next };
|
|
584
|
+
});
|
|
585
|
+
},
|
|
586
|
+
addAgentApprovalRule: (workspaceId, teamId, agentId, rule) => {
|
|
587
|
+
set(state => {
|
|
588
|
+
const nextRule = {
|
|
589
|
+
...rule,
|
|
590
|
+
id: rule.id || generateId(),
|
|
591
|
+
createdAt: rule.createdAt || Date.now(),
|
|
592
|
+
};
|
|
593
|
+
const sameRule = (existing) => (existing.surface === nextRule.surface
|
|
594
|
+
&& existing.action === nextRule.action
|
|
595
|
+
&& existing.matcher === nextRule.matcher
|
|
596
|
+
&& (existing.browserOrigin || '') === (nextRule.browserOrigin || ''));
|
|
597
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
598
|
+
? {
|
|
599
|
+
...w,
|
|
600
|
+
teams: w.teams.map(t => t.id === teamId
|
|
601
|
+
? {
|
|
602
|
+
...t,
|
|
603
|
+
agents: t.agents.map(a => {
|
|
604
|
+
if (a.id !== agentId)
|
|
605
|
+
return a;
|
|
606
|
+
const current = a.approvalRules || [];
|
|
607
|
+
const deduped = current.filter(existing => !sameRule(existing));
|
|
608
|
+
return { ...a, approvalRules: [...deduped, nextRule].slice(-200) };
|
|
609
|
+
})
|
|
610
|
+
}
|
|
611
|
+
: t),
|
|
612
|
+
}
|
|
613
|
+
: w);
|
|
614
|
+
schedulePersist(next);
|
|
615
|
+
return { workspaces: next };
|
|
616
|
+
});
|
|
617
|
+
},
|
|
618
|
+
removeAgentApprovalRule: (workspaceId, teamId, agentId, ruleId) => {
|
|
619
|
+
set(state => {
|
|
620
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
621
|
+
? {
|
|
622
|
+
...w,
|
|
623
|
+
teams: w.teams.map(t => t.id === teamId
|
|
624
|
+
? {
|
|
625
|
+
...t,
|
|
626
|
+
agents: t.agents.map(a => a.id === agentId
|
|
627
|
+
? { ...a, approvalRules: (a.approvalRules || []).filter(rule => rule.id !== ruleId) }
|
|
628
|
+
: a)
|
|
629
|
+
}
|
|
630
|
+
: t),
|
|
631
|
+
}
|
|
632
|
+
: w);
|
|
633
|
+
schedulePersist(next);
|
|
634
|
+
return { workspaces: next };
|
|
635
|
+
});
|
|
636
|
+
},
|
|
637
|
+
// ── General settings ──────────────────────────────────────────────────────
|
|
638
|
+
updateWorkspace: (id, updates) => {
|
|
639
|
+
set(state => {
|
|
640
|
+
const next = state.workspaces.map(w => w.id === id ? { ...w, ...updates, name: updates.name?.trim() || w.name, updatedAt: Date.now() } : w);
|
|
641
|
+
schedulePersist(next);
|
|
642
|
+
return { workspaces: next };
|
|
643
|
+
});
|
|
644
|
+
},
|
|
645
|
+
updateTeam: (workspaceId, teamId, updates) => {
|
|
646
|
+
set(state => {
|
|
647
|
+
const next = state.workspaces.map(w => w.id === workspaceId
|
|
648
|
+
? {
|
|
649
|
+
...w,
|
|
650
|
+
teams: w.teams.map(t => t.id === teamId ? { ...t, ...updates, name: updates.name?.trim() || t.name } : t),
|
|
651
|
+
}
|
|
652
|
+
: w);
|
|
653
|
+
schedulePersist(next);
|
|
654
|
+
return { workspaces: next };
|
|
655
|
+
});
|
|
656
|
+
},
|
|
657
|
+
archiveWorkspace: (id) => {
|
|
658
|
+
set(state => {
|
|
659
|
+
const next = state.workspaces.map(w => w.id === id ? { ...w, isArchived: true } : w);
|
|
660
|
+
flushPersist(next);
|
|
661
|
+
return { workspaces: next };
|
|
662
|
+
});
|
|
663
|
+
},
|
|
664
|
+
unarchiveWorkspace: (id) => {
|
|
665
|
+
set(state => {
|
|
666
|
+
const next = state.workspaces.map(w => w.id === id ? { ...w, isArchived: false } : w);
|
|
667
|
+
flushPersist(next);
|
|
668
|
+
return { workspaces: next };
|
|
669
|
+
});
|
|
670
|
+
},
|
|
671
|
+
// ── Bulk setter (backward compat) ────────────────────────────────────────
|
|
672
|
+
setWorkspaces: (workspacesOrFn) => {
|
|
673
|
+
set(state => {
|
|
674
|
+
const next = typeof workspacesOrFn === 'function'
|
|
675
|
+
? workspacesOrFn(state.workspaces)
|
|
676
|
+
: workspacesOrFn;
|
|
677
|
+
const normalized = normalizeLoadedWorkspaces(next);
|
|
678
|
+
schedulePersist(normalized);
|
|
679
|
+
return { workspaces: normalized };
|
|
680
|
+
});
|
|
681
|
+
},
|
|
682
|
+
// ── Lookups ──────────────────────────────────────────────────────────────
|
|
683
|
+
findAgentById: (agentId) => {
|
|
684
|
+
for (const workspace of get().workspaces) {
|
|
685
|
+
for (const team of workspace.teams) {
|
|
686
|
+
const agent = team.agents.find(a => a.id === agentId);
|
|
687
|
+
if (agent)
|
|
688
|
+
return { workspace, team, agent };
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
return null;
|
|
692
|
+
},
|
|
693
|
+
}));
|
|
694
|
+
//# sourceMappingURL=workspaceStore.js.map
|