from .manifest import ManifestParser
from .scanners import FileScanner
from .detector import OrphanDetector, OrphanReport

class ScoutManager:
    """Orchestrates the scanning and detection process."""
    
    def __init__(self, manifest_path: str, scan_path: str):
        self.manifest_parser = ManifestParser(manifest_path)
        self.file_scanner = FileScanner(scan_path)

    def run(self) -> OrphanReport:
        # 1. Load Manifest
        self.manifest_parser.load()
        authorized = self.manifest_parser.get_authorized_paths()
        
        # 2. Scan Filesystem
        detected = self.file_scanner.scan()
        
        # 3. Detect Orphans
        detector = OrphanDetector(authorized, detected)
        return detector.detect()
