How espanso/espanso works
High-Level Architecture Components
The system should be divided into these main components:
a) Core Components:
• Engine (espanso-engine): Central processing unit
• Config (espanso-config): Configuration management
• Match (espanso-match): Text matching system
• Render (espanso-render): Text expansion rendering
• Package (espanso-package): Package management system
b) Platform-specific Components:
• Detect (espanso-detect): Input detection layer
• Inject (espanso-inject): Text injection system
• Clipboard (espanso-clipboard): Clipboard management
• Info (espanso-info): System information gathering
• UI (espanso-ui): User interface components
Component Relationships
User Input -> Detect -> Engine -> Inject -> System Output
• ↑
• Config
• ↑
• Match
• ↑
• Render
Detailed Component Breakdown
For each major component, show internal structure:
Engine:
• Dispatch System
• Event Processing
• Middleware Chain
• Match Processing
Match System:
• Regex Matcher
• Rolling Matcher
• Match Selection
• Pattern Processing
Config System:
• YAML Parser
• Config Store
• Match Groups
• Path Resolution
Cross-Platform Architecture
Platform-specific implementations:
• Platform Layer
• ↓
[Windows] [macOS] [Linux/X11] [Wayland]
• ↓
• Core Components
Data Flow
Main data flow:
Key Integration Points
Integration with:
• System clipboard
• File system
• GUI framework (wxWidgets)
• IPC mechanisms
• Package management system