Ultra-minimal macOS menu-bar dictation app (Superwhisper/Wispr Flow replacement). Czech-first. Swift + AppKit/SwiftUI, whisper.cpp statically linked, BYOK cloud engines. Owner: Gedeon Drapák. Built Aug 2026 with Claude; this file is for any agent continuing work.
Hlas for macOS lives at the root; Hlas for Windows (Rust) lives in windows/ with its own
AGENTS.md. One version number for both: project.yml and windows/Cargo.toml must match,
tools/publish.sh refuses otherwise. Release flow: make release (signed, notarized DMG +
Sparkle appcast.xml) -> tools/publish.sh (one GitHub release) -> the Windows workflow attaches
the Windows installer -> tools/site-downloads.sh (installers, appcast.xml and
latest.json onto hlas.dev, which the site and both update checks use). The macOS sources are the source of truth for shared text rules:
after changing them run python3 windows/tools/shared_from_mac.py . and commit the JSON.
README.md- product overview, engine comparison, architecture diagram.docs/HANDOFF.md- current state, verified-working list, prioritized backlog.docs/TRANSCRIPT.md- full session log: every decision, bug, and fix with reasoning.
make install # xcodegen → xcodebuild (Release) → /Applications/Hlas.app → launch- Requires: Xcode 26+,
brew install xcodegen, whisper.cpp static libs inVendor/lib. - If
Vendor/libis empty (fresh clone), build them first:cd ../hlas make vendor project.ymlis the source of truth;Hlas.xcodeprojis generated (gitignored). Never edit the xcodeproj.
- Signed with Apple Development, team 74N9VPV9D6, automatic signing via Xcode. This gives a stable designated requirement → Accessibility/Microphone TCC grants survive rebuilds.
- Two teams, on purpose. The
Releaseconfiguration stays on the personal Apple Development team above. TheDistributionconfiguration signs with the Developer ID Application cert of the Eden Makers account (tech@edenmakers.ai), whose team id differs.tools/release.shreads that team off the installed certificate and passes it toxcodebuild; do not hardcode it inproject.yml, or the two copies will drift. - NEVER switch to ad-hoc (
--sign -): every rebuild changes CDHash → macOS silently ignores the Accessibility grant → the Fn hotkey dies and the user must re-toggle permissions. - NEVER
codesignthe bundle manually with the dev cert outside Xcode: without an embedded provisioning profile, macOS 26 Gatekeeper moves the app to Trash on launch.
-
Fast regression tests:
make testcovers WAV encoding, hallucination filtering, cloud error mapping, and model file integrity through the standaloneHlasCorepackage. -
Debug log:
~/Library/Application Support/Hlas/debug.logcontains tap status, presses, sample counts and drops, but never transcript contents. First place to look, always. -
Synthetic dictation:
swift tools/fakefn.swiftposts an Fn down+up (1.5 s hold). Full pipeline fires without touching the keyboard. Check debug.log afterwards. -
Visual QA:
HLAS_STEP=N /Applications/Hlas.app/Contents/MacOS/Hlasopens onboarding at step N (0-4). Loop: build → launch with env →screencapture -x shot.png→ read the image → check contrast/layout - for EVERY step, on EVERY gradient. This caught real bugs twice. -
RAM check:
ps -o rss= -p $(pgrep -x Hlas)- hidden idle should stay around 60-70 MB; the whisper model (~800 MB) must appear only during transcription and unload aftermodelKeepAliveSeconds.
| File | Concern |
|---|---|
App.swift |
AppDelegate: status item, hidden Edit menu, permission retry; DictationCoordinator owns the dictation loop |
Hotkey.swift |
CGEventTap on Fn (keycode 63, flagsChanged), health-check timer re-enables dead taps |
AudioRecorder.swift |
AVCaptureSession -> 16 kHz mono Float32; Bluetooth-safe capture, serial session queue, adaptive 8/30 s keep-warm |
AudioDevices.swift |
CoreAudio HAL input enumeration + InputDevicePicker UI |
Transcriber.swift |
Engine protocol |
LocalWhisper.swift |
whisper.cpp: lazy load, beam-5, priming prompts (cs/sk/en), idle unload, model downloader |
APITranscribers.swift |
Groq (whisper-large-v3-turbo), OpenAI (gpt-transcribe), Soniox (stt-async-v5, upload/poll/delete), Fish Audio (transcribe-1-pro); shared multipart + HTTP helpers |
TextInjector.swift |
Pasteboard swap + Cmd-V (physical keycode 9), transient-tagged, changeCount-guarded restore |
Sources/HlasCore/ |
WAV encoder, hallucination filter, cloud errors and model validation |
OverlayPanel.swift |
Non-activating NSPanel pill: waveform, source badge, frosted glass |
Onboarding.swift |
4-step split layout (gradient left / content right), live permission polling |
SettingsWindow.swift |
Engine, language chips, mic picker, vocabulary, history |
HistoryWindow.swift |
Searchable full transcript history, copy, clear |
Languages.swift |
60+ whisper languages, favorite chips with hover-✕, search popover |
Settings.swift |
UserDefaults-backed observable settings |
Updater.swift |
Sparkle auto-update (no-op in the SwiftPM test build) |
Sources/HlasCore/TextCleanup.swift |
Offline clean-up: filler sounds, spoken line breaks, Labs spoken symbols, vocabulary sounds-like rules |
History.swift |
Last 50 original/edited transcripts, serial JSON persistence, optional retention |
DictationCoordinator.swift |
Session snapshots, state, cancellation and safe delivery |
SmartTextProcessor.swift |
Automatic cloud editing, no style selector |
AudioFileImporter.swift |
Bounded file decoding and resampling |
ResultWindow.swift |
Recoverable result and original copy |
HlasMark.swift |
Shared custom mark for menu bar and SwiftUI brand surfaces |
FontRegistrar.swift |
Process-scoped registration of bundled Satoshi fonts |
DesignTokens.swift |
The design system - read before any UI work |
VisualEffect.swift |
NSVisualEffectView wrapper (frosted glass) |
Log.swift |
File logger (unified log is unreliable for bare SwiftPM-style apps) |
Sources/CWhisper/ |
C shim exposing whisper.h to Swift |
- Never pure black (#000) or pure white (#FFF). Floors:
#0C0D0F/#0F0F0F; ceilings: ~93 % white. - Accent: Eden bio-digital green
hsl(153 100% 45%)(DS.brand) - recording, checkmarks, CTAs. - Hairline borders
white 6-12 %, radius 16 (cards) / 8 (inputs), uppercase tracked labels for section headers (DS.label+.tracking(3-4)). - Frosted glass everywhere:
VisualEffectBlur+ dark tint 0.45-0.5 (windows), 0.35 (pill). - Any text over gradient photos needs the scrim pattern from
Onboarding.leftPanel(uniform 0.38 + heavier bottom). Contrast on EVERY gradient, not just the dark one.
- Cmd-V inside our own windows needs the hidden Edit menu in
setupMainMenu()- LSUIElement apps have no menu bar, and paste key-equivalents route throughNSApp.mainMenu. Don't remove. scaledToFillimages in ZStack blow up layout - always use theColor.overlay(Image…)containment pattern (seeOnboarding.leftPanel).- whisper on silence hallucinates Czech/English subtitle credits - peak guard (0.01) +
Hallucinations.filter. Extend the blocklist rather than raising the peak threshold (quiet speakers get dropped otherwise). - Sub-second audio breaks whisper.cpp → padded to ≥1.2 s; leading 0.25 s silence prevents first-word clipping ("Ahoj"→"Hoj").
- Event taps die silently under load / permission changes - the 5 s health-check timer in
Hotkey.swiftre-enables; the 3 s retry loop inApp.swifthandles grant-after-launch. log showdoesn't reliably surface NSLog from this app - useLog.write→ debug.log.- Shell cwd resets between agent tool calls - use absolute paths in build commands.
- Comments: only for constraints code can't express (see existing files for density).
- Commits: imperative summary,
Co-Authored-Byfooter for AI work. - No new dependencies without strong reason - the ~4 MB app bundle is a feature.
- User-facing copy: English in-app; Gedeon communicates in Czech.