--- title: k-launcher — Clean Architecture --- graph TB subgraph Main["Main (Composition Root)"] BIN["k-launcher
DI wiring, logging,
signal handling, --version
"] BIN_EGUI["k-launcher-egui
Optional egui binary"] end subgraph Application["Application Layer"] KERNEL["kernel
Kernel orchestrator
Fan-out search, sort by score,
truncate to max_results,
catch_unwind per plugin"] end subgraph Domain["Domain Layer (0 external deps)"] direction TB subgraph Types["Value Types"] VT_ID["ResultId(String)"] VT_TITLE["ResultTitle(String)"] VT_SCORE["Score(u32)"] VT_ACTION["LaunchAction
SpawnProcess, SpawnInTerminal,
OpenPath, CopyToClipboard
"] VT_RESULT["SearchResult
id, title, description,
icon, score, action
"] end subgraph Ports["Port Traits"] P_PLUGIN["Plugin
name, search, on_selected,
shutdown
"] P_LAUNCHER["AppLauncher
execute(LaunchAction)"] end CONSTANTS["constants
APP_NAME, APP_TITLE,
CONFIG_FILENAME, LOG_*,
FRECENCY_SNAPSHOT_FILENAME
"] end subgraph Infrastructure["Infrastructure Layer"] direction TB subgraph UI["UI"] UI_CORE["ui-core
LauncherState, Action, Effect
Framework-agnostic state machine"] UI_ICED["ui (iced)
style, view, update
Rendering adapter"] UI_EGUI["ui-egui
style, input, render
Rendering adapter"] end subgraph Plugins["Plugins (implement Plugin trait)"] PL_APPS["plugin-apps
XDG .desktop search
Frecency, nucleo fuzzy,
bincode cache"] PL_CALC["plugin-calc
evalexpr math
sqrt, sin, cos, ln, pi, e"] PL_CMD["plugin-cmd
Shell commands
> prefix → terminal"] PL_FILES["plugin-files
Filesystem browser
/ and ~/ paths"] PL_URL["plugin-url
URL detection
External binary (JSON protocol)"] end subgraph Platform["Platform"] OS_BRIDGE["os-bridge
UnixAppLauncher
shell, terminal, spawn"] PLUGIN_HOST["plugin-host
ExternalPlugin
JSON stdin/stdout protocol"] CONFIG["config
TOML loading
ConfigError, try_load"] end end %% Dependency arrows BIN -->|"wires"| Application BIN -->|"wires"| Infrastructure BIN_EGUI -->|"wires"| Application BIN_EGUI -->|"wires"| Infrastructure Application -->|"depends on"| Domain UI_ICED -->|"delegates to"| UI_CORE UI_EGUI -->|"delegates to"| UI_CORE UI_CORE -->|"uses"| KERNEL Plugins -.->|"implements"| P_PLUGIN OS_BRIDGE -.->|"implements"| P_LAUNCHER PLUGIN_HOST -.->|"implements"| P_PLUGIN KERNEL -->|"fan-out"| P_PLUGIN %% Key data flows UI_CORE ===|"Action → Effect"| KERNEL PL_APPS ===|"frecency log"| CONSTANTS classDef domain fill:#1a1a2e,stroke:#e94560,color:#fff classDef app fill:#16213e,stroke:#0f3460,color:#fff classDef infra fill:#0f3460,stroke:#533483,color:#fff classDef binary fill:#533483,stroke:#e94560,color:#fff class Domain domain class Application app class Infrastructure infra class Main binary