# vorssaintapp/vorssaint-utils architecture

> Architecture diagram of the GitHub repository vorssaintapp/vorssaint-utils, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vorssaintapp/vorssaint-utils
- Repository: https://github.com/vorssaintapp/vorssaint-utils

## Overview

#### Purpose and Runtime
Vorssaint is a local-first macOS 14+ Apple Silicon utility suite centered on one menu-bar application. It combines system monitoring, window/input automation, capture/media workflows, file utilities, and app management; features can be installed/uninstalled so inactive capabilities do not load. The primary Swift executable enters at `Sources/Vorssaint/main.swift`, with app lifecycle and runtime feature activation in `Sources/Vorssaint/App/AppDelegate.swift` and `Sources/Vorssaint/App/FeatureRuntime.swift`.

#### Application Shell and Presentation
The AppKit/SwiftUI shell owns the status-item lifecycle, menu-bar rendering, panel visibility, appearance, onboarding, and settings navigation. `MenuBarRenderer`/`StatusItemController` connect runtime state and services to the persistent user entry point; UI is organized by feature area rather than a separate frontend backend.
- `Sources/Vorssaint/App/MenuBarRenderer.swift`
- `Sources/Vorssaint/App/StatusItemController.swift`
- `Sources/Vorssaint/UI/MenuPanel/MenuPanelView.swift`

#### Feature Catalog, Persistence, and Permissions
A central feature catalog and presets determine what is installed, visible, and started. Defaults/backups preserve settings when a feature is removed and later reinstalled. Permissions are modeled centrally so onboarding and feature activation can request only required macOS access.
- `Sources/Vorssaint/Core/FeatureCatalog.swift`
- `Sources/Vorssaint/Core/FeaturePresets.swift`
- `Sources/Vorssaint/Core/Defaults.swift`
- `Sources/Vorssaint/Core/Permissions.swift`

Control flow is broadly: launch → load persisted feature state → construct enabled services → render menu/panel/settings → react to shortcuts, OS events, timers, and user actions. Feature services must tolerate missing permissions and disabled peers.

#### System Integration and Automation Boundary
Services are the operational layer over macOS APIs, Accessibility, event taps, WindowServer behavior, pasteboard, shell processes, and system settings. Window/switcher, mouse/keyboard, Finder, and quick-tool features are separate service families but share permission and shortcut infrastructure. This is the main privilege-sensitive boundary: Accessibility, Screen Recording, Automation, Full Disk Access, microphone/audio capture, notifications, and optional administrator access.
- `Sources/Vorssaint/Services/Switcher/AppSwitcher.swift`
- `Sources/Vorssaint/Services/WindowLayout/WindowLayoutService.swift`
- `Sources/Vorssaint/Services/ShortcutRecordingTap.swift`
- `Sources/Vorssaint/Services/BoundedProcessRunner.swift`

#### Monitoring, Audio, and Hardware Control
Sampling and control services collect CPU/memory/disk/network/power/temperature data and drive menu-panel metrics, alerts, display controls, and audio routing/mixing. Hardware-facing fan control crosses into a dedicated XPC helper, isolating privileged fan operations from the app process.
- `Sources/Vorssaint/Services/SystemMonitor/SystemMonitor.swift`
- `Sources/Vorssaint/Services/Metrics/NetworkSampler.swift`
- `Sources/Vorssaint/Services/Audio/AppVolumeMixer.swift`
- `Sources/Vorssaint/Services/FanControl/FanControlXPC.swift`
- `Sources/FanControlHelper/main.swift`

Native interoperability modules expose HID event-system and VM-statistics interfaces to Swift:
- `Sources/HIDEventSystem/include/HIDEventSystem.h`
- `Sources/VMStatisticsCompat/include/VMStatisticsCompat.h`

#### Capture, Recording, and Local Content Workflows
Screen capture is a shared selector/capture pipeline feeding screenshots, OCR, color sampling, and recordings. Screenshot services manage selection, rendering, editing, pinning, local storage, and optional sharing; recorder services separately manage capture, timeline/edit documents, composition, and export. Clipboard, shelf, snippets, scratchpad, media, cleaner, and uninstaller similarly operate on local user data/files.
- `Sources/Vorssaint/Services/QuickTools/ScreenCaptureService.swift`
- `Sources/Vorssaint/Services/QuickTools/ScreenshotCaptureEngine.swift`
- `Sources/Vorssaint/Services/Recorder/ScreenRecorderService.swift`
- `Sources/Vorssaint/Services/Recorder/RecorderExporter.swift`

#### External Services, Distribution, and Updates
The product has no account, telemetry, or required cloud backend. Network use is user-visible and feature-specific: app/update catalog checks, speed tests, Homebrew actions, explicit feedback, and temporary capture-sharing links. Update services coordinate app updates, while Homebrew is mediated through local process execution. Swift Package Manager defines build targets; release scripts build, sign, notarize, package, and publish macOS artifacts.
- `Package.swift`
- `Sources/Vorssaint/Services/AppUpdates/AppUpdatesService.swift`
- `Sources/Vorssaint/Services/Homebrew/HomebrewManager.swift`
- `Tools/notarize.sh`
- `.github/workflows/release.yml`

Main entry points: [`Sources/Vorssaint/App/FeatureRuntime.swift`](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/App/FeatureRuntime.swift) (Feature runtime), [`Sources/Vorssaint/Services/QuickTools/ScreenCaptureService.swift`](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/QuickTools/ScreenCaptureService.swift) (Screen capture pipeline), [`Sources/Vorssaint/Core/Permissions.swift`](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Core/Permissions.swift) (Permissions), [`Sources/Vorssaint/main.swift`](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/main.swift) (App executable)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_main["App executable<br/>Swift entry point<br/>[main.swift]"]
  node_delegate["App lifecycle<br/>App delegate<br/>[AppDelegate.swift]"]
  node_menu["Menu-bar UI<br/>renderer and status item"]
  node_panel["Menu panel<br/>SwiftUI view"]
end

subgraph group_core["Feature runtime"]
  node_runtime["Feature runtime<br/>activation manager"]
  node_catalog["Feature catalog<br/>catalog and presets"]
  node_defaults[("Feature state<br/>defaults and backups<br/>[Defaults.swift]")]
  node_permissions["Permissions<br/>access policy<br/>[Permissions.swift]"]
end

subgraph group_services["macOS services"]
  node_automation["Automation services<br/>window, input, Finder"]
  node_processes["Local process runner<br/>shell execution"]
  node_monitor["System monitoring<br/>metrics and alerts"]
  node_audio["Audio mixing<br/>audio routing"]
  node_fanxpc["Fan-control client<br/>XPC client"]
  node_fanhelper{{"Fan-control helper<br/>privileged XPC helper<br/>[main.swift]"}}
  node_updates["Updates and Homebrew<br/>user-visible network actions"]
end

subgraph group_content["Local content workflows"]
  node_capture["Screen capture pipeline<br/>selection and capture"]
  node_screenshots["Screenshot workflow<br/>render, edit, store, share"]
  node_recorder["Screen recorder<br/>recording and export"]
end

subgraph group_delivery["Build and delivery"]
  node_package["Swift package<br/>build targets<br/>[Package.swift]"]
  node_release["Release pipeline<br/>sign, notarize, publish<br/>[release.yml]"]
end

node_main -->|"starts"| node_delegate
node_delegate -->|"activates"| node_runtime
node_runtime -->|"reads enabled features"| node_catalog
node_runtime -->|"loads state"| node_defaults
node_runtime -->|"checks access"| node_permissions
node_runtime -->|"provides active services"| node_menu
node_menu -->|"presents"| node_panel
node_runtime -->|"starts when enabled"| node_automation
node_runtime -->|"starts when enabled"| node_monitor
node_runtime -->|"starts when enabled"| node_audio
node_runtime -->|"starts when enabled"| node_fanxpc
node_fanxpc -->|"XPC requests"| node_fanhelper
node_runtime -->|"starts when enabled"| node_capture
node_capture -->|"feeds"| node_screenshots
node_capture -->|"feeds"| node_recorder
node_runtime -->|"starts when enabled"| node_updates
node_updates -->|"runs Homebrew"| node_processes
node_automation -.->|"requires macOS access"| node_permissions
node_capture -.->|"requires screen recording"| node_permissions
node_package -->|"builds target"| node_main
node_release -->|"builds and packages"| node_package

click node_main "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/main.swift"
click node_delegate "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/App/AppDelegate.swift"
click node_runtime "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/App/FeatureRuntime.swift"
click node_menu "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/App/MenuBarRenderer.swift"
click node_panel "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/UI/MenuPanel/MenuPanelView.swift"
click node_catalog "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Core/FeatureCatalog.swift"
click node_defaults "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Core/Defaults.swift"
click node_permissions "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Core/Permissions.swift"
click node_automation "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/WindowLayout/WindowLayoutService.swift"
click node_processes "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/BoundedProcessRunner.swift"
click node_monitor "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/SystemMonitor/SystemMonitor.swift"
click node_audio "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/Audio/AppVolumeMixer.swift"
click node_fanxpc "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/FanControl/FanControlXPC.swift"
click node_fanhelper "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/FanControlHelper/main.swift"
click node_capture "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/QuickTools/ScreenCaptureService.swift"
click node_screenshots "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/QuickTools/ScreenshotCaptureEngine.swift"
click node_recorder "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/Recorder/ScreenRecorderService.swift"
click node_updates "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/AppUpdates/AppUpdatesService.swift"
click node_package "https://github.com/vorssaintapp/vorssaint-utils/blob/main/Package.swift"
click node_release "https://github.com/vorssaintapp/vorssaint-utils/blob/main/.github/workflows/release.yml"

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_main,node_delegate,node_menu,node_panel toneBlue
class node_runtime,node_catalog,node_defaults,node_permissions toneAmber
class node_automation,node_processes,node_monitor,node_audio,node_fanxpc,node_fanhelper,node_updates toneMint
class node_capture,node_screenshots,node_recorder toneRose
class node_package,node_release toneIndigo
```

## Components

### Application shell

- [App executable](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/main.swift): Swift entry point · `Sources/Vorssaint/main.swift`
- [App lifecycle](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/App/AppDelegate.swift): App delegate · `Sources/Vorssaint/App/AppDelegate.swift`
- [Menu-bar UI](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/App/MenuBarRenderer.swift): renderer and status item · `Sources/Vorssaint/App/MenuBarRenderer.swift`
- [Menu panel](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/UI/MenuPanel/MenuPanelView.swift): SwiftUI view · `Sources/Vorssaint/UI/MenuPanel/MenuPanelView.swift`

### Feature runtime

- [Feature runtime](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/App/FeatureRuntime.swift): activation manager · Constructs only enabled feature services. · `Sources/Vorssaint/App/FeatureRuntime.swift`
- [Feature catalog](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Core/FeatureCatalog.swift): catalog and presets · `Sources/Vorssaint/Core/FeatureCatalog.swift`
- [Feature state](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Core/Defaults.swift): defaults and backups · Preserves settings across feature removal and reinstall. · `Sources/Vorssaint/Core/Defaults.swift`
- [Permissions](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Core/Permissions.swift): access policy · `Sources/Vorssaint/Core/Permissions.swift`

### macOS services

Permission-sensitive operational boundary.

- [Automation services](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/WindowLayout/WindowLayoutService.swift): window, input, Finder · Uses Accessibility, event taps, WindowServer, pasteboard, and shell processes. · `Sources/Vorssaint/Services/WindowLayout/WindowLayoutService.swift`
- [Local process runner](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/BoundedProcessRunner.swift): shell execution · `Sources/Vorssaint/Services/BoundedProcessRunner.swift`
- [System monitoring](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/SystemMonitor/SystemMonitor.swift): metrics and alerts · `Sources/Vorssaint/Services/SystemMonitor/SystemMonitor.swift`
- [Audio mixing](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/Audio/AppVolumeMixer.swift): audio routing · `Sources/Vorssaint/Services/Audio/AppVolumeMixer.swift`
- [Fan-control client](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/FanControl/FanControlXPC.swift): XPC client · Isolates privileged fan operations from the app process. · `Sources/Vorssaint/Services/FanControl/FanControlXPC.swift`
- [Fan-control helper](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/FanControlHelper/main.swift): privileged XPC helper · `Sources/FanControlHelper/main.swift`
- [Updates and Homebrew](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/AppUpdates/AppUpdatesService.swift): user-visible network actions · Checks updates and mediates Homebrew through local processes. · `Sources/Vorssaint/Services/AppUpdates/AppUpdatesService.swift`

### Local content workflows

- [Screen capture pipeline](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/QuickTools/ScreenCaptureService.swift): selection and capture · Shared input for screenshots, OCR, color sampling, and recording. · `Sources/Vorssaint/Services/QuickTools/ScreenCaptureService.swift`
- [Screenshot workflow](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/QuickTools/ScreenshotCaptureEngine.swift): render, edit, store, share · `Sources/Vorssaint/Services/QuickTools/ScreenshotCaptureEngine.swift`
- [Screen recorder](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Sources/Vorssaint/Services/Recorder/ScreenRecorderService.swift): recording and export · `Sources/Vorssaint/Services/Recorder/ScreenRecorderService.swift`

### Build and delivery

- [Swift package](https://github.com/vorssaintapp/vorssaint-utils/blob/main/Package.swift): build targets · `Package.swift`
- [Release pipeline](https://github.com/vorssaintapp/vorssaint-utils/blob/main/.github/workflows/release.yml): sign, notarize, publish · `.github/workflows/release.yml`

## Connections

- App executable → App lifecycle: starts
- App lifecycle → Feature runtime: activates
- Feature runtime → Feature catalog: reads enabled features
- Feature runtime → Feature state: loads state
- Feature runtime → Permissions: checks access
- Feature runtime → Menu-bar UI: provides active services
- Menu-bar UI → Menu panel: presents
- Feature runtime → Automation services: starts when enabled
- Feature runtime → System monitoring: starts when enabled
- Feature runtime → Audio mixing: starts when enabled
- Feature runtime → Fan-control client: starts when enabled
- Fan-control client → Fan-control helper: XPC requests
- Feature runtime → Screen capture pipeline: starts when enabled
- Screen capture pipeline → Screenshot workflow: feeds
- Screen capture pipeline → Screen recorder: feeds
- Feature runtime → Updates and Homebrew: starts when enabled
- Updates and Homebrew → Local process runner: runs Homebrew
- Automation services → Permissions: requires macOS access
- Screen capture pipeline → Permissions: requires screen recording
- Swift package → App executable: builds target
- Release pipeline → Swift package: builds and packages
