Supervertaler - AI Agent Documentation (Compact)
Purpose: Fast, reliable handoff when context is low or chats reset. Last Updated: February 9, 2026 | Version: v1.9.246
⚡ 60-Second Resume Checklist
- Read
CHANGELOG.mdtop entry (latest release context). - Check
git status --short(do not revert unrelated user changes). - Confirm version in
pyproject.toml. - Confirm unified settings in
settings/settings.json. - If deeper context is needed, open:
docs/agent-archive/AGENTS_FULL_REFERENCE_v1.9.240_2026-02-08.md
🎯 Current State
- Current version:
v1.9.246 - Main app:
Supervertaler.py(large monolithic PyQt6 file) - Latest major completed work:
- Cross-platform support: macOS/Linux via
modules/platform_helpers.py(v1.9.246) - Native global hotkey system replacing AHK-only approach (v1.9.246)
- Unified settings system in
settings/settings.json - Inline API key editing in Settings UI
- One-time migration from legacy settings files (
.migrated) - Custom OpenAI-compatible provider (
custom_openai)
- Cross-platform support: macOS/Linux via
📁 Key Paths (Source of Truth)
- Main app:
Supervertaler.py - Modules:
modules/ - Platform helpers:
modules/platform_helpers.py - Tests:
tests/ - Changelog:
CHANGELOG.md - Version source:
pyproject.toml - Dependencies:
requirements.txt(includespynput>=1.7.6) - Website version mention:
docs/index.html - Unified settings:
settings/settings.json - AHK hotkey script (Windows fallback):
supervertaler_hotkeys.ahk - Archived full agent reference:
docs/agent-archive/AGENTS_FULL_REFERENCE_v1.9.240_2026-02-08.md
🏗️ Settings Architecture (v1.9.240+)
Primary config:
settings/settings.json
Top-level sections:
api_keysgeneraluifeatures
Satellite files under settings/:
themes.jsonshortcuts.jsonrecent_projects.jsonfind_replace_history.jsonsuperlookup_history.jsonvoice_commands.jsonmodel_version_cache.json
Migration behavior:
- Legacy settings files are migrated at startup and renamed to
.migrated.
🔑 API Keys
Primary storage:
settings/settings.jsonunderapi_keys
Compatibility:
- Legacy
api_keys.txtremains supported as fallback input.
Common key names:
openai,claude,google,gemini,custom_openai,deepl,google_translate,ollama_endpoint
Notes:
googleandgeminiare aliases.custom_openaisupports OpenAI-compatible endpoints (endpoint/model configured in Settings > AI Settings).
🌐 Cross-Platform Architecture (v1.9.246+)
Central module: modules/platform_helpers.py
Constants:
IS_WINDOWS,IS_MACOS,IS_LINUX
Utilities:
open_file(path)/open_folder(path)— replacesos.startfile()get_hidden_subprocess_flags()—CREATE_NO_WINDOWon Windows, empty dict elsewhere
Global hotkeys (GlobalHotkeyManager):
- Windows:
RegisterHotKeyAPI (background thread withGetMessageWloop) - macOS/Linux: pynput
GlobalHotKeys(requires Accessibility permission on macOS) - Callbacks do zero work in the background thread — only signal Qt main thread via
QMetaObject.invokeMethod - Main thread handles: send Cmd/Ctrl+C → wait 250ms → read clipboard → dispatch
Keystroke injection (CrossPlatformKeySender):
- Windows: AHK subprocess (
Send "^c"via temp.ahkfile), PowerShellSendKeysfallback - macOS:
osascript(tell application "System Events" to keystroke "c" using command down) - Linux: pynput
Controller
Hotkey callback flow:
pynput/WinAPI thread → QMetaObject.invokeMethod (QueuedConnection)
→ @pyqtSlot _handle_superlookup_hotkey (main thread)
→ CrossPlatformKeySender.send_copy()
→ QTimer.singleShot(250ms) → read clipboard → on_ahk_capture(text)
🍎 macOS Hotkey Status — Pending Fixes
Working:
- pynput
GlobalHotKeysregisters successfully (shows "Active via PYNPUT") - Accessibility permission grant flow works
- Crash fixed (was caused by doing pyperclip/pynput work in background thread)
Known issues:
osascriptCmd+C deletes selected text in source app (likely stray modifier keys from hotkey)- Cmd+C doesn't actually copy selections — only reads existing clipboard content
- Reliability: sometimes works, sometimes doesn't
Planned fixes:
- Debug
osascriptkeystroke injection (may need modifier release delay before sending) - Consider using
pbcopyvia AppleScript instead of keystroke simulation - Change macOS shortcuts: ⌃⌥L/M → ⌃⌘L/M (Ctrl+Cmd, user-requested — easier to reach)
🔌 LLM Providers
Supported providers:
openaiclaudegeminiollamacustom_openai
Relevant implementation files:
modules/llm_clients.pySupervertaler.py(settings UI and provider wiring)
🧪 Testing Quick Start
Run:
pytest tests/
Manual smoke test checklist:
- Import DOCX, translate, export
- Save/load
.svproj - TM and termbase behavior
- AI translation with configured keys
- SDLPPX round-trip
📦 Release Checklist
- Update version in
pyproject.toml. - Update release notes in
CHANGELOG.md. - Update version mention in
docs/index.html. - Validate main workflows.
- Build and upload:
python -m build
python -m twine upload dist/supervertaler-<version>*
Windows EXE packaging:
build_windows_release.ps1(core/full)
⚠️ High-Value Pitfalls
Supervertaler.pyis large: read/edit by line range, not full-file stream.- Qt table access: use
cellWidget()for editors anditem()for plain items. - Block signals during programmatic text updates to avoid cascades.
- Style issues can be timing-related (hidden widgets, deferred visibility).
- XML namespace formats (SDLXLIFF): always use namespace dicts.
📌 Active Priorities
- Fix macOS global hotkey Cmd+C issues (deletes selection, doesn't copy).
- Make macOS shortcuts configurable (⌃⌘L/M instead of ⌃⌥L/M).
- Test Linux global hotkeys (pynput backend, untested).
- Keep unified settings and migration stable.
- Continue reducing monolith pressure in
Supervertaler.py. - Maintain release reliability (PyPI + Windows core/full artifacts).
- Keep this file short and operationally focused.
📚 Archived Reference
The full historical/long-form agent document is preserved at:
docs/agent-archive/AGENTS_FULL_REFERENCE_v1.9.240_2026-02-08.md
When context is limited, use this compact file first and open the archive only when needed.