Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
64be61b
refactor: change button to div for accessibility in DocumentNode comp…
AnishSarkar22 Mar 28, 2026
5bddde6
feat: implement Microsoft OneDrive connector with OAuth support and i…
AnishSarkar22 Mar 28, 2026
5f0a4d1
feat: add OneDrive file creation and deletion tools with connector ch…
AnishSarkar22 Mar 28, 2026
bb894ee
chore: update environment variable names for Microsoft OAuth integrat…
AnishSarkar22 Mar 28, 2026
7004e76
chore: refactor Microsoft OAuth configuration to unify client ID and …
AnishSarkar22 Mar 28, 2026
028c88b
feat: add integration and unit tests for OneDrive indexing pipeline a…
AnishSarkar22 Mar 28, 2026
1470612
feat: integrate OneDrive connector with UI components and configurati…
AnishSarkar22 Mar 28, 2026
b42b3a0
feat: enhance OneDrive integration with new file creation and deletio…
AnishSarkar22 Mar 28, 2026
40f086b
refactor: replace useAuth with authenticatedFetch in OneDriveConfig a…
AnishSarkar22 Mar 28, 2026
9160c4c
feat: add Microsoft OneDrive connector documentation and sitemap entry
AnishSarkar22 Mar 28, 2026
dd6558e
chore: update Microsoft OAuth configuration in documentation to refle…
AnishSarkar22 Mar 28, 2026
e2dd6e6
docs: update OneDrive permissions in documentation to reflect require…
AnishSarkar22 Mar 28, 2026
ea218b7
feat: implement OneDrive picker integration and enhance connector fun…
AnishSarkar22 Mar 28, 2026
101e426
fix: remove error message display for Google Drive and OneDrive authe…
AnishSarkar22 Mar 28, 2026
c876727
feat: enhance OneDrive folder management by adding mimeType handling …
AnishSarkar22 Mar 28, 2026
db49f85
feat: add ONEDRIVE_FILE mapping to connector-document-mapping and doc…
AnishSarkar22 Mar 28, 2026
9f5bdb0
refactor: update empty state message in FolderTreeView for improved c…
AnishSarkar22 Mar 28, 2026
8dadf5a
feat: integrate right panel collapse functionality in DocumentsSideba…
AnishSarkar22 Mar 28, 2026
37e018e
refactor: simplify DialogFooter component by removing unnecessary gap…
AnishSarkar22 Mar 28, 2026
838d38a
feat: implement document preview functionality in DocumentsSidebar an…
AnishSarkar22 Mar 28, 2026
65bd83b
feat: add ONEDRIVE_FILE to connector mappings and descriptions for en…
AnishSarkar22 Mar 28, 2026
dc034a9
fix: update inline code styling in markdown-text component for improv…
AnishSarkar22 Mar 28, 2026
8035eb9
feat: enhance OneDrive file creation by converting markdown to DOCX f…
AnishSarkar22 Mar 28, 2026
fd87e38
feat: implement OneDrive knowledge base synchronization after file cr…
AnishSarkar22 Mar 28, 2026
c325f53
feat: enhance delete OneDrive file tool with improved error handling …
AnishSarkar22 Mar 28, 2026
5d467cd
feat: enhance OneDrive file creation tool by adding parent folder sel…
AnishSarkar22 Mar 28, 2026
5a3eece
Merge remote-tracking branch 'upstream/dev' into feat/onedrive-connector
AnishSarkar22 Mar 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,11 @@ STT_SERVICE=local/base
# AIRTABLE_CLIENT_SECRET=
# AIRTABLE_REDIRECT_URI=http://localhost:8000/api/v1/auth/airtable/connector/callback

# -- Microsoft Teams --
# TEAMS_CLIENT_ID=
# TEAMS_CLIENT_SECRET=
# -- Microsoft OAuth (Teams & OneDrive) --
# MICROSOFT_CLIENT_ID=
# MICROSOFT_CLIENT_SECRET=
# TEAMS_REDIRECT_URI=http://localhost:8000/api/v1/auth/teams/connector/callback
# ONEDRIVE_REDIRECT_URI=http://localhost:8000/api/v1/auth/onedrive/connector/callback

# -- Composio --
# COMPOSIO_API_KEY=
Expand Down
9 changes: 5 additions & 4 deletions surfsense_backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ DISCORD_CLIENT_SECRET=your_discord_client_secret_here
DISCORD_REDIRECT_URI=http://localhost:8000/api/v1/auth/discord/connector/callback
DISCORD_BOT_TOKEN=your_bot_token_from_developer_portal

# Atlassian OAuth Configuration
# Atlassian OAuth Configuration (Jira & Confluence)
ATLASSIAN_CLIENT_ID=your_atlassian_client_id_here
ATLASSIAN_CLIENT_SECRET=your_atlassian_client_secret_here
JIRA_REDIRECT_URI=http://localhost:8000/api/v1/auth/jira/connector/callback
Expand All @@ -95,10 +95,11 @@ SLACK_CLIENT_ID=your_slack_client_id_here
SLACK_CLIENT_SECRET=your_slack_client_secret_here
SLACK_REDIRECT_URI=http://localhost:8000/api/v1/auth/slack/connector/callback

# Teams OAuth Configuration
TEAMS_CLIENT_ID=your_teams_client_id_here
TEAMS_CLIENT_SECRET=your_teams_client_secret_here
# Microsoft OAuth (Teams & OneDrive)
MICROSOFT_CLIENT_ID=your_microsoft_client_id_here
MICROSOFT_CLIENT_SECRET=your_microsoft_client_secret_here
TEAMS_REDIRECT_URI=http://localhost:8000/api/v1/auth/teams/connector/callback
ONEDRIVE_REDIRECT_URI=http://localhost:8000/api/v1/auth/onedrive/connector/callback

# Composio Connector
# NOTE: Disable "Mask Connected Account Secrets" in Composio dashboard (Settings → Project Settings) for Google indexing to work.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""Add OneDrive connector enums
Revision ID: 110
Revises: 109
Create Date: 2026-03-28 00:00:00.000000
"""

from collections.abc import Sequence

from alembic import op

revision: str = "110"
down_revision: str | None = "109"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade() -> None:
op.execute(
"""
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_type t
JOIN pg_enum e ON t.oid = e.enumtypid
WHERE t.typname = 'searchsourceconnectortype' AND e.enumlabel = 'ONEDRIVE_CONNECTOR'
) THEN
ALTER TYPE searchsourceconnectortype ADD VALUE 'ONEDRIVE_CONNECTOR';
END IF;
END
$$;
"""
)

op.execute(
"""
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_type t
JOIN pg_enum e ON t.oid = e.enumtypid
WHERE t.typname = 'documenttype' AND e.enumlabel = 'ONEDRIVE_FILE'
) THEN
ALTER TYPE documenttype ADD VALUE 'ONEDRIVE_FILE';
END IF;
END
$$;
"""
)


def downgrade() -> None:
pass
7 changes: 7 additions & 0 deletions surfsense_backend/app/agents/new_chat/chat_deepagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"BOOKSTACK_CONNECTOR": "BOOKSTACK_CONNECTOR",
"CIRCLEBACK_CONNECTOR": "CIRCLEBACK", # Connector type differs from document type
"OBSIDIAN_CONNECTOR": "OBSIDIAN_CONNECTOR",
"ONEDRIVE_CONNECTOR": "ONEDRIVE_FILE", # Connector type differs from document type
# Composio connectors (unified to native document types).
# Reverse of NATIVE_TO_LEGACY_DOCTYPE in app.db.
"COMPOSIO_GOOGLE_DRIVE_CONNECTOR": "GOOGLE_DRIVE_FILE",
Expand Down Expand Up @@ -316,6 +317,12 @@ async def create_surfsense_deep_agent(
]
modified_disabled_tools.extend(google_drive_tools)

has_onedrive_connector = (
available_connectors is not None and "ONEDRIVE_FILE" in available_connectors
)
if not has_onedrive_connector:
modified_disabled_tools.extend(["create_onedrive_file", "delete_onedrive_file"])

# Disable Google Calendar action tools if no Google Calendar connector is configured
has_google_calendar_connector = (
available_connectors is not None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"trash_gmail_email": "email_subject_or_id",
"update_gmail_draft": "draft_subject_or_id",
"delete_google_drive_file": "file_name",
"delete_onedrive_file": "file_name",
"delete_notion_page": "page_title",
"update_notion_page": "page_title",
"delete_linear_issue": "issue_ref",
Expand Down
3 changes: 3 additions & 0 deletions surfsense_backend/app/agents/new_chat/tools/knowledge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ async def _browse_recent_documents(
"CRAWLED_URL",
"CIRCLEBACK",
"OBSIDIAN_CONNECTOR",
"ONEDRIVE_FILE",
]

# Human-readable descriptions for each connector type
Expand Down Expand Up @@ -230,6 +231,7 @@ async def _browse_recent_documents(
"BOOKSTACK_CONNECTOR": "BookStack pages (personal documentation)",
"CIRCLEBACK": "Circleback meeting notes, transcripts, and action items",
"OBSIDIAN_CONNECTOR": "Obsidian vault notes and markdown files (personal notes)",
"ONEDRIVE_FILE": "Microsoft OneDrive files and documents (personal cloud storage)",
}


Expand Down Expand Up @@ -357,6 +359,7 @@ def _compute_tool_output_budget(max_input_tokens: int | None) -> int:
"event_id",
"calendar_id",
"google_drive_file_id",
"onedrive_file_id",
"page_id",
"issue_id",
"connector_id",
Expand Down
11 changes: 11 additions & 0 deletions surfsense_backend/app/agents/new_chat/tools/onedrive/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from app.agents.new_chat.tools.onedrive.create_file import (
create_create_onedrive_file_tool,
)
from app.agents.new_chat.tools.onedrive.trash_file import (
create_delete_onedrive_file_tool,
)

__all__ = [
"create_create_onedrive_file_tool",
"create_delete_onedrive_file_tool",
]
Loading
Loading