Commit Graph

16 Commits

Author SHA1 Message Date
Saumya 6a7999211b fix: remove pagination for kortix templates 2025-10-07 23:42:23 +05:30
Saumya 89a4996dfd fix: fix agent trigger installation 2025-10-07 15:33:44 +05:30
Saumya 9aad9f3014 add agent usage examples to preview dialog 2025-10-06 16:43:48 +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 98e9196d41 refactor: simplify backend - fix naming conflicts and centralize DB dependencies
Backend improvements:
- Fixed duplicate TemplateService naming conflict:
  * Renamed marketplace_service.py::TemplateService → MarketplaceService
  * Eliminates confusion between two classes with same name

- Created centralized DB dependency helpers (db_helpers.py):
  * get_db() - FastAPI dependency for DB connection (singleton)
  * get_db_client() - Returns initialized Supabase client
  * get_initialized_db() - For module-level backward compatibility
  * Addresses 100+ DBConnection() instantiations across 53 files

- Applied new DB helpers to high-usage files:
  * services/api_keys_api.py - Now uses get_db() dependency
  * templates/services/marketplace_service.py - Uses get_initialized_db()

- Comprehensive simplification analysis document:
  * Identified 9 modules with duplicate initialize() patterns
  * Documented large files needing breakdown (1700-2000 lines)
  * Analyzed 35 tool files for common patterns
  * Prioritized recommendations for future work

Frontend cleanup:
- Removed unused template preview components and pages
2025-10-04 22:40:16 +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
Saumya 4908f174d6 chore: research agent v1 2025-09-30 20:53:55 +05:30
marko-kraemer 8108afe706 fix 2025-09-29 16:39:15 +02:00
marko-kraemer bc6620569f rm general tab, integrations tab default 2025-09-29 14:12:45 +02:00
Saumya 886d9f99b4 feat: remove agent descriptions 2025-09-28 00:01:17 +05:30
Saumya 733ef0b8fe Merge branch 'agent-examples' into designer-agent-new 2025-09-18 22:52:26 +05:30
Saumya 4a3d7a3a10 kortix agent examples UI 2025-09-18 22:51:58 +05:30
Saumya a931be40bc fix: remove old references of avatar & avatar_color 2025-09-18 12:53:48 +05:30
marko-kraemer 09ca1f49b8 fix credentials import 2025-09-04 17:27:31 -07:00
marko-kraemer f73d0f5db6 mv around files, update imports 2025-09-03 22:40:25 -07:00