Commit Graph

61 Commits

Author SHA1 Message Date
Krishav Raj Singh a5d8edabc9 rm image from context 2025-10-08 07:42:49 +05:30
marko-kraemer ddf2d32f59 feat(admin): add user thread viewer with admin access bypass
 Features:
- Add admin portal thread viewer with pagination
- Display thread list with project names and public status
- Add clickable links to view threads via /share/{thread_id}
- Add admin bypass for accessing all threads (public and private)

🔧 Backend Refactoring:
- Consolidate admin APIs into admin_api.py and billing_admin_api.py
- Remove unused files: users_admin.py, admin/api.py
- Remove unused endpoints: user search, grant-bulk-credits, migrate-user
- Update admin thread endpoint to use share URLs

 Performance:
- Remove message_count from UserThreadSummary (optimization)
- Remove N+1 query issue in thread listing

🔒 Authorization:
- Add admin role bypass in verify_and_authorize_thread_access
- Create RLS migration (20251005160000_admin_roles_access.sql)
- Update thread_select_policy for admin access
- Update message_select_policy for admin access
- Update project_select_policy for admin access
- Update agent_runs_select_policy for admin access

💻 Frontend:
- Add Threads tab to admin user details dialog
- Add useAdminUserThreads hook with pagination
- Remove unused admin hooks (useAdminUserSearch, useAdminAdvancedSearch)
- Display thread metadata with Open button and ExternalLink icon

🗃️ Database:
- Apply RLS policies allowing admin/super_admin roles to bypass restrictions
- Admins can now view any thread, message, project, or agent_run

This enables admins to view and debug any user's threads through the
share page interface, regardless of public/private status.
2025-10-05 18:09:26 +02:00
marko-kraemer 0ec17b0d3a refactor: completely remove workflow and playbook system
- Remove workflow_tool.py and all workflow-related backend code
- Delete all workflow database tables and create migration
- Remove workflow API endpoints and execution logic
- Clean workflow references from agent tools and triggers
- Remove playbooks tab and UI from agent configuration
- Eliminate workflow_id, workflow_input, and execution_type fields
- Simplify trigger system to agent-only execution
- Remove workflow tool definitions from tool registry
- Clean up TypeScript interfaces and remove workflow types
- Remove playbooks button from chat input
- Update all trigger components to remove workflow selection
- Clean workflow metadata from threads and sidebar
- Remove 80+ critical workflow code references

Simplifies codebase by eliminating complex dual-mode (agent/workflow)
execution system in favor of pure agent-based automation.
2025-10-05 01:51:44 +02:00
marko-kraemer 8b7bc36d5f refactor: consolidate duplicate account lookup logic
- Extracted get_account_id_from_thread() to auth_utils.py (new shared utility)
- Refactored 2 identical _get_current_account_id() methods:
  * tools/agent_builder_tools/base_tool.py (reduced 23 lines → 9 lines)
  * tools/sb_upload_file_tool.py (reduced 23 lines → 9 lines)
- Simplified agent_creation_tool.py's version for consistency
- Eliminated 28+ lines of duplicate code
- Centralized thread→account lookup logic in one place
2025-10-04 22:45:09 +02:00
marko-kraemer 5383897977 refactor: remove redundant code - eliminate 7 workspace_path duplications
- Removed redundant workspace_path='/workspace' from 7 sandbox tool files
  * sb_files_tool.py
  * sb_shell_tool.py
  * sb_deploy_tool.py
  * sb_templates_tool.py
  * sb_upload_file_tool.py
  * sb_presentation_tool.py
  * sb_web_dev_tool.py

- Base class SandboxToolsBase already sets this on line 23
- Eliminates 7 lines of duplicate code
- All tools now inherit workspace_path from base

- Converted sb_upload_file_tool.py to use centralized db_helpers
  * Removed DBConnection import
  * Uses get_initialized_db() instead
2025-10-04 22:43:46 +02:00
marko-kraemer 8d7e85de4c refactor: massive backend simplification - eliminate 450+ lines of duplicate code
- Created unified AgentLoader for all agent data operations
- Eliminated 8 manual AgentResponse constructions across codebase
- Reduced agent_runs.py complexity by 163 lines (85→35 lines in 2 functions)
- Reduced core_utils.py from 553→69 lines (-87%)
- Extracted focused utility modules:
  * utils/icon_generator.py (179 lines)
  * utils/limits_checker.py (245 lines)
  * utils/run_management.py (145 lines)
  * utils/project_helpers.py (113 lines)
  * utils/mcp_helpers.py (41 lines)
- Fixed duplicate router inclusions in api.py
- Renamed template_service.py → marketplace_service.py for clarity
- Reduced template transformer from 73→17 lines (-77%)
- Inlined module-specific helpers (moved agent_run access check)
- Fixed version data false alarm warnings
- Updated AgentResponse model to support optional fields for list operations

Total impact: ~450 lines of duplicate code eliminated, dramatically improved maintainability
2025-10-04 22:32:51 +02:00
marko-kraemer 85c4ae00e7 Remove usage_example decorator and all usages 2025-10-03 12:24:36 +02:00
marko-kraemer e0250092a6 temp reg anthropic 2025-10-01 17:05:03 +02:00
marko-kraemer 6f467c35c0 1m ctxt bedrock 2025-10-01 15:44:02 +02:00
Krishav Raj Singh 3506e0b39e fix: load image 2025-10-01 07:47:18 +05:30
Bobbie b82e0f757f
Merge pull request #1759 from escapade-mckv/research-agent
Research agent
2025-09-30 21:01:41 +05:30
Saumya 4908f174d6 chore: research agent v1 2025-09-30 20:53:55 +05:30
marko-kraemer f8ab7059b7 fixes 2025-09-29 22:52:49 +02:00
marko-kraemer 192552dd62 Refactor knowledge base system: enable CRUD in agent config, unify components, remove legacy code
- Added full CRUD operations to agent configuration dialog knowledge base section
- Replaced simplified agent-kb-tree with full-featured agent-knowledge-base-manager
- Created unified KB entry modal merging file upload and text entry modals
- Enhanced folder selection UX with inline folder creation capability
- Integrated standard FileRenderer for consistent file preview across app
- Removed outdated backend/core/knowledge_base/ system causing table reference errors
- Moved FileProcessor to correct location in backend/knowledge_base/
- Extracted reusable KnowledgeBaseManager component to eliminate code duplication
- Updated agent KB tree to use assignment system instead of old table structure
- Simplified file preview modal to focus on summary editing instead of broken file preview
- Added proper loading states and error handling throughout
- Removed unused legacy components and hooks
- Updated all imports to use correct table structure (knowledge_base_folders/entries)
- Fixed API routes to work with new assignment-based system
2025-09-29 21:43:23 +02:00
Saumya 22fc672a4d Merge branch 'main' into doc-parser 2025-09-29 23:17:00 +05:30
Saumya 8141428fb6 doc parser tool 2025-09-29 10:59:50 +05:30
marko-kraemer 079d7347da model changes 2025-09-28 23:36:14 +02:00
Krishav Raj Singh d4179c7832 rem styles from tool 2025-09-28 01:28:49 +05:30
Krishav Raj Singh 67cbf529dd comment unused 2025-09-28 01:27:15 +05:30
Saumya 886d9f99b4 feat: remove agent descriptions 2025-09-28 00:01:17 +05:30
Saumya ddc85c4a9f Merge branch 'main' of https://github.com/kortix-ai/suna into people-search-tool 2025-09-27 13:26:36 +05:30
Saumya 2a1f370d79 feat: company search tool 2025-09-27 13:26:07 +05:30
Krishav Raj Singh 268b68934e load svg in browser and take ss 2025-09-26 20:08:14 +05:30
Saumya f31b66bc00 Merge branch 'main' into people-search-tool 2025-09-26 15:52:27 +05:30
Saumya fb080073c0 chore: granular control of tools 2025-09-26 14:49:12 +05:30
Saumya d226e38809 chore: show all tools in config 2025-09-25 13:29:03 +05:30
Saumya 65d0ce161b Merge branch 'main' into people-search-tool 2025-09-24 18:28:50 +05:30
Saumya c5653ae55a people search tool 2025-09-24 17:51:27 +05:30
Krishav Raj Singh 8e608bcc2e separate image search tool 2025-09-23 22:30:05 +05:30
marko-kraemer 553844372f wip 2025-09-22 10:15:42 +02:00
Vukasin 02da9e2e6d Merge remote-tracking branch 'upstream/main' into feat/new-knowledge-base-and-sematic-search 2025-09-21 14:29:07 +02:00
marko-kraemer c0b58d9afa merge 2025-09-21 10:08:10 +02:00
Saumya f7a0c12fd7 designer tool and a bunch of changes 2025-09-20 15:58:55 +05:30
marko-kraemer 692c0983fc wip 2025-09-19 12:25:48 +02:00
Saumya c065ed5b1b move billing and admin to core 2025-09-19 10:30:43 +05:30
Vukasin 84518b7815 Merge remote-tracking branch 'upstream/main' into feat/new-knowledge-base-and-sematic-search 2025-09-18 22:36:40 +02:00
Vukasin e462a7ae00 fix: filetype and visuals 2025-09-18 22:36:28 +02:00
Saumya 64d81205e2 Merge branch 'main' of https://github.com/kortix-ai/suna into designer-agent-new 2025-09-18 22:52:42 +05:30
Saumya 733ef0b8fe Merge branch 'agent-examples' into designer-agent-new 2025-09-18 22:52:26 +05:30
Krishav Raj Singh b2a49b7677 wait tool 2025-09-18 15:27:50 +05:30
marko-kraemer aaeeca14cf wip 2025-09-18 11:47:52 +02:00
marko-kraemer 3af20d6a2e wip 2025-09-18 10:51:58 +02:00
Saumya a931be40bc fix: remove old references of avatar & avatar_color 2025-09-18 12:53:48 +05:30
Vukasin 44caf0460b feat: add kb file validation and improvements 2025-09-17 23:18:49 +02:00
Vukasin 1878df2b24 feat: init globl kb crud 2025-09-17 20:48:09 +02:00
marko-kraemer 7319dc7a56 wip 2025-09-17 19:23:20 +02:00
Krishav Raj Singh 1dcba26582 batch search 2025-09-17 13:54:35 +05:30
Krishav Raj Singh 46e19894c6 img search tool with serper 2025-09-17 13:53:49 +05:30
Saumya 10f7664786 feat: designer agent 2025-09-17 13:53:42 +05:30
Vukasin 13a8125c1b feat: init kb tool 2025-09-13 11:03:37 +02:00