Skip to content

Commit c7a22d9

Browse files
Merge pull request #1237 from escapade-mckv/sheets-agent
Sheets agent
2 parents 2975772 + 2281ac7 commit c7a22d9

File tree

12 files changed

+1721
-33
lines changed

12 files changed

+1721
-33
lines changed

backend/agent/run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from agent.tools.mcp_tool_wrapper import MCPToolWrapper
3333
from agent.tools.task_list_tool import TaskListTool
3434
from agentpress.tool import SchemaType
35+
from agent.tools.sb_sheets_tool import SandboxSheetsTool
3536

3637
load_dotenv()
3738

@@ -72,6 +73,7 @@ def register_all_tools(self):
7273
self.thread_manager.add_tool(SandboxVisionTool, project_id=self.project_id, thread_id=self.thread_id, thread_manager=self.thread_manager)
7374
self.thread_manager.add_tool(SandboxImageEditTool, project_id=self.project_id, thread_id=self.thread_id, thread_manager=self.thread_manager)
7475
self.thread_manager.add_tool(TaskListTool, project_id=self.project_id, thread_manager=self.thread_manager, thread_id=self.thread_id)
76+
self.thread_manager.add_tool(SandboxSheetsTool, project_id=self.project_id, thread_manager=self.thread_manager)
7577
if config.RAPID_API_KEY:
7678
self.thread_manager.add_tool(DataProvidersTool)
7779

@@ -120,6 +122,8 @@ def safe_tool_check(tool_name: str) -> bool:
120122
self.thread_manager.add_tool(SandboxWebSearchTool, project_id=self.project_id, thread_manager=self.thread_manager)
121123
if safe_tool_check('sb_vision_tool'):
122124
self.thread_manager.add_tool(SandboxVisionTool, project_id=self.project_id, thread_id=self.thread_id, thread_manager=self.thread_manager)
125+
if safe_tool_check('sb_sheets_tool'):
126+
self.thread_manager.add_tool(SandboxSheetsTool, project_id=self.project_id, thread_manager=self.thread_manager)
123127
if config.RAPID_API_KEY and safe_tool_check('data_providers_tool'):
124128
self.thread_manager.add_tool(DataProvidersTool)
125129

backend/agent/suna/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class SunaConfig:
1818
"web_search_tool": True,
1919
"sb_vision_tool": True,
2020
"sb_image_edit_tool": True,
21-
"data_providers_tool": True
21+
"data_providers_tool": True,
22+
"sb_sheets_tool": True
2223
}
2324

2425
DEFAULT_MCPS = []

backend/agent/tools/sb_sheets_tool.py

Lines changed: 900 additions & 0 deletions
Large diffs are not rendered by default.

frontend/src/components/agents/tools.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const AGENTPRESS_TOOL_DEFINITIONS: Record<string, { enabled: boolean; des
77
'web_search_tool': { enabled: true, description: 'Search the web using Tavily API and scrape webpages with Firecrawl for research', icon: '🔍', color: 'bg-yellow-100 dark:bg-yellow-800/50' },
88
'sb_vision_tool': { enabled: true, description: 'Vision and image processing capabilities for visual content analysis', icon: '👁️', color: 'bg-pink-100 dark:bg-pink-800/50' },
99
'data_providers_tool': { enabled: true, description: 'Access to data providers and external APIs (requires RapidAPI key)', icon: '🔗', color: 'bg-cyan-100 dark:bg-cyan-800/50' },
10+
'sb_sheets_tool': { enabled: true, description: 'Create, view, update, analyze, visualize, and format spreadsheets (XLSX/CSV) with Luckysheet viewer', icon: '📊', color: 'bg-purple-100 dark:bg-purple-800/50' },
1011
};
1112

1213
export const DEFAULT_AGENTPRESS_TOOLS: Record<string, boolean> = Object.entries(AGENTPRESS_TOOL_DEFINITIONS).reduce((acc, [key, value]) => {
@@ -24,6 +25,7 @@ export const getToolDisplayName = (toolName: string): string => {
2425
'web_search_tool': 'Web Search',
2526
'sb_vision_tool': 'Image Processing',
2627
'data_providers_tool': 'Data Providers',
28+
'sb_sheets_tool': 'Sheets Tool',
2729
};
2830

2931
return displayNames[toolName] || toolName.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase());

frontend/src/components/agents/workflows/conditional-workflow-builder.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const normalizeToolName = (toolName: string, toolType: 'agentpress' | 'mcp') =>
5656
'web_search_tool': 'Web Search',
5757
'sb_vision_tool': 'Vision Tool',
5858
'data_providers_tool': 'Data Providers',
59+
'sb_sheets_tool': 'Sheets Tool',
5960
};
6061
return agentPressMapping[toolName] || toolName;
6162
} else {

frontend/src/components/file-renderers/binary-renderer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ export function BinaryRenderer({
6868
disabled={isDownloading}
6969
>
7070
{isDownloading ? (
71-
<Loader className="h-4 w-4 mr-2 animate-spin" />
71+
<Loader className="h-4 w-4 animate-spin" />
7272
) : (
73-
<Download className="h-4 w-4 mr-2" />
73+
<Download className="h-4 w-4" />
7474
)}
7575
Download
7676
</Button>

0 commit comments

Comments
 (0)