Files
dss/dss-claude-plugin/strategies/remote/filesystem.py
Digital Production Factory 276ed71f31 Initial commit: Clean DSS implementation
Migrated from design-system-swarm with fresh git history.
Old project history preserved in /home/overbits/apps/design-system-swarm

Core components:
- MCP Server (Python FastAPI with mcp 1.23.1)
- Claude Plugin (agents, commands, skills, strategies, hooks, core)
- DSS Backend (dss-mvp1 - token translation, Figma sync)
- Admin UI (Node.js/React)
- Server (Node.js/Express)
- Storybook integration (dss-mvp1/.storybook)

Self-contained configuration:
- All paths relative or use DSS_BASE_PATH=/home/overbits/dss
- PYTHONPATH configured for dss-mvp1 and dss-claude-plugin
- .env file with all configuration
- Claude plugin uses ${CLAUDE_PLUGIN_ROOT} for portability

Migration completed: $(date)
🤖 Clean migration with full functionality preserved
2025-12-09 18:45:48 -03:00

89 lines
2.9 KiB
Python

"""
Remote Filesystem Strategy implementation.
Filesystem operations are restricted in REMOTE mode for security.
"""
import logging
from typing import List, Dict, Any
from pathlib import Path
from ..base import FilesystemStrategy
from ...core.context import DSSContext
# Configure module logger
logger = logging.getLogger(__name__)
class RemoteFilesystemStrategy(FilesystemStrategy):
"""
Implements filesystem operations via remote API calls.
Note: Direct filesystem access is restricted in REMOTE mode for security.
Most operations will raise NotImplementedError or return empty results.
Users should use LOCAL mode for filesystem operations.
"""
def __init__(self, context: DSSContext):
"""Initialize with context."""
self.context = context
async def read_file(self, path: str) -> str:
"""
Read file contents.
NOT AVAILABLE in REMOTE mode for security reasons.
Raises:
NotImplementedError: Always, as direct file access is restricted.
"""
logger.error("Filesystem read operations are not available in REMOTE mode.")
raise NotImplementedError(
"Direct filesystem access is restricted in REMOTE mode. "
"Please use LOCAL mode for file operations, or use API-based file uploads."
)
async def list_directory(self, path: str) -> List[str]:
"""
List directory contents.
NOT AVAILABLE in REMOTE mode for security reasons.
Raises:
NotImplementedError: Always, as directory listing is restricted.
"""
logger.error("Filesystem list operations are not available in REMOTE mode.")
raise NotImplementedError(
"Directory listing is restricted in REMOTE mode. "
"Please use LOCAL mode for filesystem operations."
)
async def search_files(self, pattern: str, path: str = ".") -> List[str]:
"""
Search for files matching a pattern.
NOT AVAILABLE in REMOTE mode for security reasons.
Raises:
NotImplementedError: Always, as file search is restricted.
"""
logger.error("Filesystem search operations are not available in REMOTE mode.")
raise NotImplementedError(
"File search is restricted in REMOTE mode. "
"Please use LOCAL mode for filesystem operations."
)
async def get_file_info(self, path: str) -> Dict[str, Any]:
"""
Get file metadata.
NOT AVAILABLE in REMOTE mode for security reasons.
Raises:
NotImplementedError: Always, as file info access is restricted.
"""
logger.error("Filesystem info operations are not available in REMOTE mode.")
raise NotImplementedError(
"File metadata access is restricted in REMOTE mode. "
"Please use LOCAL mode for filesystem operations."
)