Introduces a new `markitect/proxy/` module with pluggable extractors that convert non-markdown sources (PDF, HTML) into tracked markdown proxy files. Proxy files preserve origin metadata (path, checksum, timestamp) so they can be kept in sync when the original changes. CLI commands: `proxy create`, `proxy update`, `proxy status`, `proxy extractors`. Built-in extractors: PDF (pymupdf4llm), HTML (markdownify), Markdown (built-in). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
41 lines
1.0 KiB
Python
41 lines
1.0 KiB
Python
"""
|
|
Proxy-specific exceptions.
|
|
|
|
Extends the MarkitectError hierarchy for proxy file operations.
|
|
"""
|
|
|
|
from typing import Optional, Dict, Any
|
|
|
|
from markitect.exceptions import MarkitectError
|
|
|
|
|
|
class ProxyError(MarkitectError):
|
|
"""Base exception for all proxy operations."""
|
|
pass
|
|
|
|
|
|
class ExtractorNotFoundError(ProxyError):
|
|
"""No extractor registered for the given file extension."""
|
|
pass
|
|
|
|
|
|
class DependencyMissingError(ProxyError):
|
|
"""An extractor's optional dependency is not installed.
|
|
|
|
Attributes:
|
|
package: The missing Python package name.
|
|
install_hint: Suggested pip install command.
|
|
"""
|
|
|
|
def __init__(
|
|
self,
|
|
message: str,
|
|
package: str = "",
|
|
install_hint: str = "",
|
|
cause: Optional[Exception] = None,
|
|
context: Optional[Dict[str, Any]] = None,
|
|
):
|
|
super().__init__(message, cause=cause, context=context)
|
|
self.package = package
|
|
self.install_hint = install_hint
|