mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-08 20:25:19 +02:00
refactor(agents): move filesystem_selection to app/agents/shared (slice 3a)
Promote the filesystem mode contracts (FilesystemMode, FilesystemSelection, ClientPlatform, LocalFilesystemMount) out of `new_chat` into the cross-agent `app/agents/shared` kernel. Pure leaf consumed across the whole multi-agent filesystem middleware/tool tree, the chat flows/monolith, routes and tests. git mv (content unchanged) + flipped all ~48 importers. A re-export shim remains at new_chat/filesystem_selection.py only for the not-yet-retired single-agent (chat_deepagent). Also updated the stream parity test's annotation normalizer to strip the new app.agents.shared.filesystem_selection. prefix (the dataclasses' __module__ changed with the move), keeping monolith<->flows signature parity intact. Behavior-preserving: only import paths change. 1326 tests green.
This commit is contained in:
parent
a975754e7d
commit
1b536b8aee
51 changed files with 110 additions and 86 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
from app.agents.new_chat.middleware import AnonymousDocumentMiddleware
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
from app.agents.new_chat.middleware import KnowledgeBasePersistenceMiddleware
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
from app.agents.new_chat.middleware import KnowledgePriorityMiddleware
|
||||
from app.services.llm_service import get_planner_llm
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
from app.agents.new_chat.middleware import KnowledgeTreeMiddleware
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import logging
|
|||
from deepagents.middleware.skills import SkillsMiddleware
|
||||
|
||||
from app.agents.shared.feature_flags import AgentFeatureFlags
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
from app.agents.new_chat.middleware import (
|
||||
build_skills_backend_factory,
|
||||
default_skills_sources,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import Any
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
from .middleware import SurfSenseFilesystemMiddleware
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from typing import Any
|
|||
from deepagents import FilesystemMiddleware
|
||||
from langchain_core.tools import BaseTool
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
from app.agents.new_chat.filesystem_state import SurfSenseFilesystemState
|
||||
from app.agents.new_chat.sandbox import is_sandbox_enabled
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
from app.agents.new_chat.path_resolver import DOCUMENTS_ROOT
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from typing import TYPE_CHECKING
|
|||
|
||||
from langchain.tools import ToolRuntime
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
from app.agents.new_chat.filesystem_state import SurfSenseFilesystemState
|
||||
from app.agents.new_chat.middleware.multi_root_local_folder_backend import (
|
||||
MultiRootLocalFolderBackend,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
from .cloud import BODY as CLOUD_BODY
|
||||
from .common import HEADER, SANDBOX_ADDENDUM
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_DESCRIPTION = """Changes the current working directory (cwd).
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_CLOUD_DESCRIPTION = """Performs exact string replacements in files.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_DESCRIPTION = """Executes Python code in an isolated sandbox environment.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_DESCRIPTION = """Find files matching a glob pattern.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_CLOUD_DESCRIPTION = """Search for a literal text pattern across files.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_CLOUD_DESCRIPTION = """Lists files/folders recursively in a single bounded call.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_CLOUD_DESCRIPTION = """Lists files and directories at the given path.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_CLOUD_DESCRIPTION = """Creates a directory under `/documents/`.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_CLOUD_DESCRIPTION = """Moves or renames a file or folder.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_DESCRIPTION = """Prints the current working directory."""
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_DESCRIPTION = """Reads a file from the filesystem.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_CLOUD_DESCRIPTION = """Deletes a single file under `/documents/`.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_CLOUD_DESCRIPTION = """Deletes an empty directory under `/documents/`.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
|
||||
_CLOUD_DESCRIPTION = """Writes a new text file to the workspace.
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ from app.agents.multi_agent_chat.subagents.builtins.knowledge_base.ask_knowledge
|
|||
build_ask_knowledge_base_tool,
|
||||
)
|
||||
from app.agents.shared.feature_flags import AgentFeatureFlags
|
||||
from app.agents.new_chat.filesystem_selection import FilesystemMode
|
||||
from app.agents.shared.filesystem_selection import FilesystemMode
|
||||
from app.db import ChatVisibility
|
||||
|
||||
from .main_agent.action_log import build_action_log_mw
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue