mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
45ce1813e4
Refactor importers to use FileService for all file operations instead of direct filesystem calls. This enables cloud environments to override file operations via dependency injection (e.g., S3FileService). Changes: - Add `to_markdown_string()` method to MarkdownProcessor for content serialization without file I/O - Update Importer base class to accept FileService and use it for: - `write_entity()` - now uses FileService.write_file() - `ensure_folder_exists()` - now async, uses FileService.ensure_directory() - Fix direct `mkdir()` calls in: - claude_projects_importer.py - memory_json_importer.py - Update deps.py to inject FileService into all importers (v1 and v2) - Update CLI commands to create and pass FileService to importers - Update tests to work with new FileService dependency This follows the pattern used by /knowledge API and SyncService, enabling cloud to override file operations by providing S3FileService via DI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>