# junoh-bg/kestrel architecture

> Architecture diagram of the GitHub repository junoh-bg/kestrel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/junoh-bg/kestrel
- Repository: https://github.com/junoh-bg/kestrel

## Overview

Kestrel is a native macOS launcher whose main workflow starts at Option–Space, opens the launcher, searches apps or files (or handles calculator, Google, clipboard, and snippet queries), then opens or copies a selected result. Settings manage themes, snippets, optional clipboard history, and file-search permissions; updates are user-approved. The graph combines sampled source with README capabilities; some implementation details are unsampled, so undocumented links are omitted.

Main entry points: [`Sources/Kestrel/LauncherWindow.swift`](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/LauncherWindow.swift) (Launcher window), [`Sources/Kestrel/AppDelegate.swift`](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/AppDelegate.swift) (App coordinator), [`Sources/Kestrel/NativeServices.swift`](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/NativeServices.swift) (Clipboard capture), [`Sources/Kestrel/SettingsWindow.swift`](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/SettingsWindow.swift) (Settings and snippets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launch and Search"]
  node_entry["App startup<br/>[main.swift]"]
  node_delegate["App coordinator<br/>[AppDelegate.swift]"]
  node_hotkey["Global shortcut<br/>[HotKey.swift]"]
  node_launcher["Launcher window"]
  node_apps["App catalog"]
  node_files["Spotlight file search"]
  node_folders["Folder candidates"]
  node_core["Search and utility logic<br/>[KestrelCore.swift]"]
end

subgraph group_daily["Daily Tools"]
  node_clipboard["Clipboard capture"]
  node_capturepolicy["Capture policy"]
  node_localstate[("Local saved state<br/>[KestrelCore.swift]")]
end

subgraph group_settings["Settings and Access"]
  node_settings["Settings and snippets"]
  node_folderaccess["Search folder access"]
  node_accessreport["Access diagnostics"]
end

subgraph group_updates["Software Updates"]
  node_updates["Update controls"]
end

node_user(("Mac user"))
node_github["GitHub release feed"]

node_user -->|"starts app"| node_entry
node_entry -->|"installs delegate"| node_delegate
node_delegate -->|"registers shortcut"| node_hotkey
node_hotkey -.->|"opens launcher"| node_launcher
node_delegate -->|"shows window"| node_launcher
node_launcher -.->|"searches apps"| node_apps
node_launcher -->|"searches files"| node_files
node_launcher -->|"adds folder results"| node_folders
node_launcher -->|"ranks and calculates"| node_core
node_user -->|"enters query"| node_launcher
node_launcher -->|"opens or copies"| node_user
node_delegate -->|"opens settings"| node_settings
node_settings -->|"manages snippets"| node_localstate
node_settings -->|"controls history"| node_clipboard
node_clipboard -->|"checks policy"| node_capturepolicy
node_clipboard -.->|"persists history"| node_localstate
node_delegate -->|"adds search folders"| node_folderaccess
node_folderaccess -->|"checks access"| node_accessreport
node_folderaccess -.->|"supplies scopes"| node_files
node_delegate -->|"starts updates"| node_updates
node_user -->|"requests update check"| node_updates
node_updates -->|"checks releases"| node_github

click node_entry "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/main.swift"
click node_delegate "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/AppDelegate.swift"
click node_hotkey "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/HotKey.swift"
click node_launcher "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/LauncherWindow.swift"
click node_apps "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/NativeServices.swift"
click node_files "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/NativeServices.swift"
click node_folders "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/FolderCatalog.swift"
click node_core "https://github.com/junoh-bg/kestrel/blob/main/Sources/KestrelCore/KestrelCore.swift"
click node_clipboard "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/NativeServices.swift"
click node_capturepolicy "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/CapturePolicy.swift"
click node_localstate "https://github.com/junoh-bg/kestrel/blob/main/Sources/KestrelCore/KestrelCore.swift"
click node_settings "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/SettingsWindow.swift"
click node_folderaccess "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/SearchFolderAccess.swift"
click node_accessreport "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/SearchAccessReport.swift"
click node_updates "https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/SoftwareUpdates.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_delegate,node_hotkey,node_launcher,node_apps,node_files,node_folders,node_core,node_user toneBlue
class node_clipboard,node_capturepolicy,node_localstate toneAmber
class node_settings,node_folderaccess,node_accessreport toneMint
class node_updates toneRose
class node_github toneIndigo
```

## Components

### Launch and Search

- [App startup](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/main.swift): `Sources/Kestrel/main.swift`
- [App coordinator](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/AppDelegate.swift): `Sources/Kestrel/AppDelegate.swift`
- [Global shortcut](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/HotKey.swift): `Sources/Kestrel/HotKey.swift`
- [Launcher window](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/LauncherWindow.swift): `Sources/Kestrel/LauncherWindow.swift`
- [App catalog](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/NativeServices.swift): `Sources/Kestrel/NativeServices.swift`
- [Spotlight file search](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/NativeServices.swift): `Sources/Kestrel/NativeServices.swift`
- [Folder candidates](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/FolderCatalog.swift): `Sources/Kestrel/FolderCatalog.swift`
- [Search and utility logic](https://github.com/junoh-bg/kestrel/blob/main/Sources/KestrelCore/KestrelCore.swift): `Sources/KestrelCore/KestrelCore.swift`

### Daily Tools

- [Clipboard capture](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/NativeServices.swift): `Sources/Kestrel/NativeServices.swift`
- [Capture policy](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/CapturePolicy.swift): `Sources/Kestrel/CapturePolicy.swift`
- [Local saved state](https://github.com/junoh-bg/kestrel/blob/main/Sources/KestrelCore/KestrelCore.swift): `Sources/KestrelCore/KestrelCore.swift`

### Settings and Access

- [Settings and snippets](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/SettingsWindow.swift): `Sources/Kestrel/SettingsWindow.swift`
- [Search folder access](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/SearchFolderAccess.swift): `Sources/Kestrel/SearchFolderAccess.swift`
- [Access diagnostics](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/SearchAccessReport.swift): `Sources/Kestrel/SearchAccessReport.swift`

### Software Updates

- [Update controls](https://github.com/junoh-bg/kestrel/blob/main/Sources/Kestrel/SoftwareUpdates.swift): `Sources/Kestrel/SoftwareUpdates.swift`

### Other components

- **Mac user**
- **GitHub release feed**

## Connections

- Mac user → App startup: starts app (evidence: `README.md`)
- App startup → App coordinator: installs delegate (evidence: `Sources/Kestrel/main.swift`)
- App coordinator → Global shortcut: registers shortcut (evidence: `Sources/Kestrel/AppDelegate.swift`)
- Global shortcut → Launcher window: opens launcher
- App coordinator → Launcher window: shows window (evidence: `Sources/Kestrel/AppDelegate.swift`)
- Launcher window → App catalog: searches apps
- Launcher window → Spotlight file search: searches files (evidence: `README.md`)
- Launcher window → Folder candidates: adds folder results (evidence: `Sources/Kestrel/LauncherWindow.swift`)
- Launcher window → Search and utility logic: ranks and calculates (evidence: `Sources/Kestrel/LauncherWindow.swift`)
- Mac user → Launcher window: enters query (evidence: `README.md`)
- Launcher window → Mac user: opens or copies (evidence: `README.md`)
- App coordinator → Settings and snippets: opens settings (evidence: `Sources/Kestrel/AppDelegate.swift`)
- Settings and snippets → Local saved state: manages snippets (evidence: `README.md`)
- Settings and snippets → Clipboard capture: controls history (evidence: `README.md`)
- Clipboard capture → Capture policy: checks policy (evidence: `Sources/Kestrel/NativeServices.swift`)
- Clipboard capture → Local saved state: persists history (evidence: `Sources/Kestrel/NativeServices.swift`)
- App coordinator → Search folder access: adds search folders (evidence: `Sources/Kestrel/AppDelegate.swift`)
- Search folder access → Access diagnostics: checks access (evidence: `Sources/Kestrel/SearchFolderAccess.swift`)
- Search folder access → Spotlight file search: supplies scopes
- App coordinator → Update controls: starts updates (evidence: `Sources/Kestrel/AppDelegate.swift`)
- Mac user → Update controls: requests update check (evidence: `README.md`)
- Update controls → GitHub release feed: checks releases (evidence: `README.md`)
