diff --git a/backend/agent/suna/config.py b/backend/agent/suna/config.py index 6817e5d3..75db8bd6 100644 --- a/backend/agent/suna/config.py +++ b/backend/agent/suna/config.py @@ -11,6 +11,7 @@ class SunaConfig: DEFAULT_TOOLS = { "sb_shell_tool": True, + "sb_files_tool": True, "sb_browser_tool": True, "sb_deploy_tool": True, "sb_expose_tool": True, diff --git a/frontend/src/components/agents/mcp/mcp-configuration-new.tsx b/frontend/src/components/agents/mcp/mcp-configuration-new.tsx index ddde3c19..829a93e6 100644 --- a/frontend/src/components/agents/mcp/mcp-configuration-new.tsx +++ b/frontend/src/components/agents/mcp/mcp-configuration-new.tsx @@ -90,8 +90,6 @@ export const MCPConfigurationNew: React.FC = ({ const handleToolsSelected = (profileId: string, selectedTools: string[], appName: string, appSlug: string) => { console.log('Tools selected:', { profileId, selectedTools, appName, appSlug }); setShowRegistryDialog(false); - // ComposioRegistry handles all the actual configuration internally - // We need to refresh the agent data to show updated configuration queryClient.invalidateQueries({ queryKey: ['agents'] }); queryClient.invalidateQueries({ queryKey: ['agent', selectedAgentId] }); queryClient.invalidateQueries({ queryKey: ['composio', 'profiles'] }); diff --git a/frontend/src/components/workflows/workflow-builder.tsx b/frontend/src/components/workflows/workflow-builder.tsx index b779c659..3cdc5a6c 100644 --- a/frontend/src/components/workflows/workflow-builder.tsx +++ b/frontend/src/components/workflows/workflow-builder.tsx @@ -152,10 +152,9 @@ export function WorkflowBuilder({
{editableSteps.length === 0 ? ( - // Empty state
-
+

@@ -165,13 +164,12 @@ export function WorkflowBuilder({ Add steps to create a workflow that guides your agent through tasks.

) : ( - // Steps list - uses the children array from root node
{ if (stepType.id === 'credentials_profile') { - setShowPipedreamRegistry(true); + setShowComposioRegistry(true); } else if (stepType.id === 'mcp_configuration') { setShowCustomMCPDialog(true); } else { @@ -113,88 +117,25 @@ export function WorkflowSidePanel({ } }; - const handlePipedreamToolsSelected = async (profileId: string, selectedTools: string[], appName: string, appSlug: string) => { - try { - const pipedreamMCP = { - name: appName, - qualifiedName: `pipedream_${appSlug}_${profileId}`, - config: { - url: 'https://remote.mcp.pipedream.net', - headers: { - 'x-pd-app-slug': appSlug, - }, - profile_id: profileId - }, - enabledTools: selectedTools, - selectedProfileId: profileId - }; - - // Update agent with new MCP - const existingCustomMCPs = agent?.custom_mcps || []; - const nonPipedreamMCPs = existingCustomMCPs.filter((mcp: any) => - mcp.type !== 'pipedream' || mcp.config?.profile_id !== profileId - ); - - await updateAgentMutation.mutateAsync({ - agentId: agentId!, - custom_mcps: [ - ...nonPipedreamMCPs, - { - name: appName, - type: 'pipedream', - config: pipedreamMCP.config, - enabledTools: selectedTools - } as any - ] - }); - - // Create a step for the credentials profile - const credentialsStep: ConditionalStep = { - id: `credentials-${Date.now()}`, - name: `${appName} Credentials`, - description: `Credentials profile for ${appName} integration`, - type: 'instruction', - config: { - step_type: 'credentials_profile', - tool_name: selectedTools[0] || `${appName} Profile`, - profile_id: profileId, - app_name: appName, - app_slug: appSlug - }, - order: 0, - enabled: true, - children: [] - }; - - onCreateStep({ - id: 'credentials_profile', - name: credentialsStep.name, - description: credentialsStep.description, - icon: 'Key', - category: 'configuration', - config: credentialsStep.config - }); - - // Invalidate queries to refresh tools - queryClient.invalidateQueries({ queryKey: ['agent', agentId] }); - queryClient.invalidateQueries({ queryKey: ['agent-tools', agentId] }); - - // Trigger parent tools update - if (onToolsUpdate) { - onToolsUpdate(); - } - - setShowPipedreamRegistry(false); - toast.success(`Added ${appName} credentials profile!`); - } catch (error) { - toast.error('Failed to add integration'); + const handleComposioToolsSelected = (profileId: string, selectedTools: string[], appName: string, appSlug: string) => { + console.log('Tools selected:', { profileId, selectedTools, appName, appSlug }); + setShowComposioRegistry(false); + // ComposioRegistry handles all the actual configuration internally + // We need to refresh the agent data to show updated configuration + queryClient.invalidateQueries({ queryKey: ['agents'] }); + queryClient.invalidateQueries({ queryKey: ['agent', agentId] }); + queryClient.invalidateQueries({ queryKey: ['composio', 'profiles'] }); + + if (onToolsUpdate) { + onToolsUpdate(); } + + toast.success(`Connected ${appName} integration!`); }; const handleCustomMCPSave = async (customConfig: any) => { try { const existingCustomMCPs = agent?.custom_mcps || []; - await updateAgentMutation.mutateAsync({ agentId: agentId!, custom_mcps: [ @@ -208,7 +149,6 @@ export function WorkflowSidePanel({ ] }); - // Create a step for the MCP configuration const mcpStep: ConditionalStep = { id: `mcp-${Date.now()}`, name: `${customConfig.name} MCP`, @@ -302,7 +242,7 @@ export function WorkflowSidePanel({ onClick={() => handleStepTypeClick(stepType)} className="w-full p-3 text-left border border-border rounded-2xl hover:bg-muted/50 transition-colors" > -
+
@@ -472,30 +412,18 @@ export function WorkflowSidePanel({ {renderContent()} - - {/* Pipedream Registry Dialog */} - - - - + + + + App Integrations - { }} - onToolsSelected={handlePipedreamToolsSelected} - versionData={versionData ? { - configured_mcps: versionData.configured_mcps || [], - custom_mcps: versionData.custom_mcps || [], - system_prompt: versionData.system_prompt || '', - agentpress_tools: versionData.agentpress_tools || {} - } : undefined} - versionId={versionData?.version_id || 'current'} + onClose={() => setShowComposioRegistry(false)} + onToolsSelected={handleComposioToolsSelected} /> - - {/* Custom MCP Dialog */}