feat: Onedrive connector with sensitive actions using HITL#1027
feat: Onedrive connector with sensitive actions using HITL#1027MODSetter merged 27 commits intoMODSetter:devfrom
Conversation
…ndexing capabilities
…ion in Docker and SurfSense backend
…secret for Teams and OneDrive in environment files and related code
…nd parallel downloads
…nd add OneDrive SVG icon
…ct unified client ID and secret for Teams and OneDrive
|
@AnishSarkar22 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on 947def5..dd6558e
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (50)
• docker/.env.example
• surfsense_backend/.env.example
• surfsense_backend/alembic/versions/110_add_onedrive_connector_enums.py
• surfsense_backend/app/agents/new_chat/chat_deepagent.py
• surfsense_backend/app/agents/new_chat/middleware/dedup_tool_calls.py
• surfsense_backend/app/agents/new_chat/tools/knowledge_base.py
• surfsense_backend/app/agents/new_chat/tools/onedrive/__init__.py
• surfsense_backend/app/agents/new_chat/tools/onedrive/create_file.py
• surfsense_backend/app/agents/new_chat/tools/onedrive/trash_file.py
• surfsense_backend/app/agents/new_chat/tools/registry.py
• surfsense_backend/app/config/__init__.py
• surfsense_backend/app/connectors/onedrive/__init__.py
• surfsense_backend/app/connectors/onedrive/client.py
• surfsense_backend/app/connectors/onedrive/content_extractor.py
• surfsense_backend/app/connectors/onedrive/file_types.py
• surfsense_backend/app/connectors/onedrive/folder_manager.py
• surfsense_backend/app/db.py
• surfsense_backend/app/routes/__init__.py
• surfsense_backend/app/routes/onedrive_add_connector_route.py
• surfsense_backend/app/routes/search_source_connectors_routes.py
• surfsense_backend/app/routes/teams_add_connector_route.py
• surfsense_backend/app/schemas/onedrive_auth_credentials.py
• surfsense_backend/app/tasks/celery_tasks/connector_tasks.py
• surfsense_backend/app/tasks/connector_indexers/onedrive_indexer.py
• surfsense_backend/app/utils/connector_naming.py
• surfsense_backend/tests/integration/indexing_pipeline/test_onedrive_pipeline.py
• surfsense_backend/tests/unit/connector_indexers/test_onedrive_parallel.py
• surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentTypeIcon.tsx
• surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx
• surfsense_web/app/sitemap.ts
• surfsense_web/components/assistant-ui/assistant-message.tsx
• surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/onedrive-config.tsx
• surfsense_web/components/assistant-ui/connector-popup/connector-configs/index.tsx
• surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx
• surfsense_web/components/assistant-ui/connector-popup/constants/connector-constants.ts
• surfsense_web/components/assistant-ui/connector-popup/hooks/use-connector-dialog.ts
• surfsense_web/components/assistant-ui/connector-popup/views/connector-accounts-list-view.tsx
• surfsense_web/components/assistant-ui/thread.tsx
• surfsense_web/components/documents/DocumentNode.tsx
• surfsense_web/components/tool-ui/index.ts
• surfsense_web/components/tool-ui/onedrive/create-file.tsx
• surfsense_web/components/tool-ui/onedrive/index.ts
• surfsense_web/components/tool-ui/onedrive/trash-file.tsx
• surfsense_web/content/docs/connectors/index.mdx
• surfsense_web/content/docs/connectors/meta.json
• surfsense_web/content/docs/connectors/microsoft-onedrive.mdx
• surfsense_web/content/docs/connectors/microsoft-teams.mdx
• surfsense_web/content/docs/docker-installation/docker-compose.mdx
• surfsense_web/content/docs/manual-installation.mdx
• surfsense_web/contracts/enums/connector.ts
⏭️ Files skipped (5)
| Locations |
|---|
surfsense_web/contracts/enums/connectorIcons.tsx |
surfsense_web/lib/apis/connectors-api.service.ts |
surfsense_web/lib/chat/streaming-state.ts |
surfsense_web/lib/connectors/utils.ts |
surfsense_web/public/connectors/onedrive.svg |
…d access for connector authentication
…ctionality with new API endpoints and UI updates
…ntication issues; add toast notifications for picker errors
…and integrating DriveFolderTree component for improved UI
…ument type enum for improved OneDrive integration
…larity and user guidance
…r for improved mobile experience
… classes for a cleaner layout
…d enhance mobile experience with vaul drawer
…hanced OneDrive support
…ed readability and consistency
…ormat and updating client to handle byte content
…eation to enhance document management
…and user feedback
…ection and handling expired accounts
Description
Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist
High-level PR Summary
This PR adds a new OneDrive connector with comprehensive functionality including OAuth authentication, file indexing, folder browsing, and Human-in-the-Loop (HITL) sensitive actions for creating and deleting files. The implementation mirrors the existing Google Drive connector architecture with Microsoft Graph API integration for OneDrive access. The backend introduces database migrations for OneDrive document types, a complete OneDrive client with token refresh logic, content extraction pipeline integration, parallel indexing with delta sync support, and HITL-enabled agent tools. The frontend adds a folder/file browser UI, connector configuration management, approval workflows for sensitive operations, and comprehensive documentation. Microsoft OAuth credentials (
MICROSOFT_CLIENT_IDandMICROSOFT_CLIENT_SECRET) are now shared between Teams and OneDrive connectors.⏱️ Estimated Review Time: 3+ hours
💡 Review Order Suggestion
surfsense_backend/app/db.pysurfsense_backend/alembic/versions/110_add_onedrive_connector_enums.pysurfsense_backend/app/config/__init__.pydocker/.env.examplesurfsense_backend/.env.examplesurfsense_backend/app/schemas/onedrive_auth_credentials.pysurfsense_backend/app/connectors/onedrive/file_types.pysurfsense_backend/app/connectors/onedrive/client.pysurfsense_backend/app/connectors/onedrive/content_extractor.pysurfsense_backend/app/connectors/onedrive/folder_manager.pysurfsense_backend/app/connectors/onedrive/__init__.pysurfsense_backend/app/routes/onedrive_add_connector_route.pysurfsense_backend/app/routes/__init__.pysurfsense_backend/app/tasks/connector_indexers/onedrive_indexer.pysurfsense_backend/app/tasks/celery_tasks/connector_tasks.pysurfsense_backend/app/routes/search_source_connectors_routes.pysurfsense_backend/app/agents/new_chat/tools/onedrive/create_file.pysurfsense_backend/app/agents/new_chat/tools/onedrive/trash_file.pysurfsense_backend/app/agents/new_chat/tools/onedrive/__init__.pysurfsense_backend/app/agents/new_chat/tools/registry.pysurfsense_backend/app/agents/new_chat/chat_deepagent.pysurfsense_backend/app/agents/new_chat/middleware/dedup_tool_calls.pysurfsense_backend/app/agents/new_chat/tools/knowledge_base.pysurfsense_backend/app/utils/connector_naming.pysurfsense_backend/app/routes/teams_add_connector_route.pysurfsense_backend/tests/integration/indexing_pipeline/test_onedrive_pipeline.pysurfsense_backend/tests/unit/connector_indexers/test_onedrive_parallel.pysurfsense_web/contracts/enums/connector.tssurfsense_web/contracts/enums/connectorIcons.tsxsurfsense_web/lib/connectors/utils.tssurfsense_web/public/connectors/onedrive.svgsurfsense_web/components/assistant-ui/connector-popup/constants/connector-constants.tssurfsense_web/components/assistant-ui/connector-popup/connector-configs/components/onedrive-config.tsxsurfsense_web/components/assistant-ui/connector-popup/connector-configs/index.tsxsurfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsxsurfsense_web/components/assistant-ui/connector-popup/views/connector-accounts-list-view.tsxsurfsense_web/components/assistant-ui/connector-popup/hooks/use-connector-dialog.tssurfsense_web/components/tool-ui/onedrive/create-file.tsxsurfsense_web/components/tool-ui/onedrive/trash-file.tsxsurfsense_web/components/tool-ui/onedrive/index.tssurfsense_web/components/tool-ui/index.tssurfsense_web/components/assistant-ui/assistant-message.tsxsurfsense_web/components/assistant-ui/thread.tsxsurfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsxsurfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentTypeIcon.tsxsurfsense_web/components/documents/DocumentNode.tsxsurfsense_web/lib/apis/connectors-api.service.tssurfsense_web/lib/chat/streaming-state.tssurfsense_web/content/docs/connectors/microsoft-onedrive.mdxsurfsense_web/content/docs/connectors/microsoft-teams.mdxsurfsense_web/content/docs/connectors/index.mdxsurfsense_web/content/docs/connectors/meta.jsonsurfsense_web/content/docs/docker-installation/docker-compose.mdxsurfsense_web/content/docs/manual-installation.mdxsurfsense_web/app/sitemap.ts