ReMe/reme2/component/file_watcher/light_file_watcher.py
Sen Huang 2396e4a854
feat(file-watcher): enhance base file watcher with file graph persistence (#217)
- replace watch_paths parameter with single watch_path string
- add FileGraph integration for tracking file relationships
- implement persistent graph storage in .reme directory
- add load/build graph functionality on start
- refactor file change handling with separate methods for add/modify/delete
- update scan_existing_files to work with single path
- add file filter to exclude meta directory from watching
- remove abstract method requirement and implement concrete change handlers

BREAKING CHANGE: watch_paths parameter changed to watch_path (single path)
2026-04-27 18:03:47 +08:00

16 lines
487 B
Python

"""Lightweight file watcher for Markdown files only."""
from pathlib import Path
from .base_file_watcher import BaseFileWatcher
from ..component_registry import R
_MD_SUFFIXES = {".md", ".markdown"}
@R.register("light")
class LightFileWatcher(BaseFileWatcher):
"""Watches only Markdown files and delegates parsing to registered parsers."""
def _watch_filter(self, path: str) -> bool:
return super()._watch_filter(path) and Path(path).suffix.lower() in _MD_SUFFIXES