Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/TypeWhisper.Core/Interfaces/IActiveWindowService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ public interface IActiveWindowService
/// </summary>
string? GetBrowserUrl(bool allowInteractiveCapture = true);

/// <summary>
/// Best-effort bounded snippet of the focused element's text (+ nearby labels), used as
/// read-only spelling reference for LLM cleanup. Opt-in and gated by the caller. Scoped to
/// the given window (<paramref name="processName" />/<paramref name="title" />, from the
/// recording's snapshot) so a focus change can't harvest a different app's screen. Returns
/// <c>null</c> when no a11y tree is available, on a password field, or when nothing
/// readable is in focus for that window.
/// </summary>
// ReSharper disable once UnusedMemberInSuper.Global -- part of the window-inspection contract; consumed via the concrete ActiveWindowService today, kept on the interface for parity with the sibling getters
string? GetFocusedScreenContext(string? processName, string? title);

/// <summary>Returns distinct process names of all visible windows (sorted).</summary>
IReadOnlyList<string> GetRunningAppProcessNames();
}
6 changes: 6 additions & 0 deletions src/TypeWhisper.Core/Models/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ public Dictionary<string, TextInsertionStrategy> AppInsertionStrategies
// Memory extraction
public bool MemoryEnabled { get; init; }

// Reference context for LLM cleanup (opt-in, local-first, both default off).
// When enabled, a bounded snippet of the focused element's text / the clipboard
// is passed to Medium/High cleanup as read-only spelling reference.
public bool ScreenContextEnabled { get; init; }
public bool ClipboardContextEnabled { get; init; }

// UI Language (null = auto-detect from system)
public string? UiLanguage { get; init; }

Expand Down
5 changes: 5 additions & 0 deletions src/TypeWhisper.Core/Models/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public sealed record Profile
public ProfileStylePreset StylePreset { get; init; } = ProfileStylePreset.Raw;
public CleanupLevel? CleanupLevelOverride { get; init; }
public bool? DeveloperFormattingOverride { get; init; }

// Per-profile overrides for the two global reference-context toggles. Null =
// inherit the global AppSettings value (same shape as WhisperModeOverride).
public bool? ScreenContextOverride { get; init; }
public bool? ClipboardContextOverride { get; init; }
public DateTime CreatedAt { get; init; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; init; } = DateTime.UtcNow;
}
2 changes: 2 additions & 0 deletions src/TypeWhisper.Core/Models/TranscriptionRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public sealed record TranscriptionRecord
public bool SnippetApplied { get; init; }
public bool DictionaryCorrectionApplied { get; init; }
public bool PromptActionApplied { get; init; }
public bool ScreenContextApplied { get; init; }
public bool ClipboardContextApplied { get; init; }
public bool TranslationApplied { get; init; }
public IReadOnlyList<CorrectionSuggestion> PendingCorrectionSuggestions { get; init; } = [];
public DateTime CreatedAt { get; init; } = DateTime.UtcNow;
Expand Down
9 changes: 9 additions & 0 deletions src/TypeWhisper.Linux/Resources/Localization/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"Advanced.Memory": "Speicher",
"Advanced.MemoryHint": "Sendet jede geeignete Transkription an den konfigurierten LLM-Anbieter, um dauerhafte Fakten zu extrahieren. Bei Cloud-Anbietern wird der Transkriptionstext extern hochgeladen und als Speicher abgelegt.",
"Advanced.MemoryUnavailable": "Nicht verfügbar: Aktivieren Sie ein Speicher-Plugin und konfigurieren Sie einen LLM-Anbieter.",
"Advanced.ReferenceContext": "Referenzkontext",
"Advanced.UseScreenContext": "Bildschirmtext verwenden",
"Advanced.UseScreenContextHint": "Liest vor der mittleren/hohen Bereinigung einen kleinen Ausschnitt des fokussierten Feldes und benachbarter Beschriftungen, damit das Modell sichtbare Namen, Bezeichner und Begriffe übernehmen kann. Passwortfelder werden nie gelesen. Bei Cloud-LLM-Anbietern wird dieser Text an den Anbieter gesendet.",
"Advanced.UseClipboardContext": "Zwischenablage-Text verwenden",
"Advanced.UseClipboardContextHint": "Fügt vor der mittleren/hohen Bereinigung den aktuellen Text der Zwischenablage als schreibgeschützte Schreibreferenz hinzu. Bei Cloud-LLM-Anbietern wird dieser Text an den Anbieter gesendet.",
"Advanced.Recording": "Aufnahme",
"Advanced.Retention1Day": "1 Tag",
"Advanced.Retention30Days": "30 Tage",
Expand Down Expand Up @@ -461,6 +466,10 @@
"Profiles.CleanupUseStylePreset": "Stil-Preset verwenden",
"Profiles.DeveloperFormattingOverride": "Entwickler-Formatierungs-Override",
"Profiles.DeveloperFormattingOverrideHint": "Symbol- und Groß-/Kleinschreibungsformatierung für dieses Profil erzwingen oder deaktivieren.",
"Profiles.ScreenContextOverride": "Bildschirmkontext-Override",
"Profiles.ScreenContextOverrideHint": "Bildschirmtext als Bereinigungsreferenz für dieses Profil verwenden und die globale Einstellung überschreiben.",
"Profiles.ClipboardContextOverride": "Zwischenablage-Kontext-Override",
"Profiles.ClipboardContextOverrideHint": "Text der Zwischenablage als Bereinigungsreferenz für dieses Profil verwenden und die globale Einstellung überschreiben.",
"Profiles.EnableBrowserUrlDetection": "Browser-URL-Erkennung aktivieren",
"Profiles.Enabled": "Aktiv",
"Profiles.HotkeyBehaviorProcessSelectedText": "Markierten Text verarbeiten",
Expand Down
9 changes: 9 additions & 0 deletions src/TypeWhisper.Linux/Resources/Localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"Advanced.Memory": "Memory",
"Advanced.MemoryHint": "Sends each eligible transcription to the configured LLM provider to extract lasting facts. With cloud providers, transcript text is uploaded off-device and stored as memory.",
"Advanced.MemoryUnavailable": "Unavailable: enable a memory storage plugin and configure an LLM provider.",
"Advanced.ReferenceContext": "Reference context",
"Advanced.UseScreenContext": "Use on-screen text",
"Advanced.UseScreenContextHint": "Before Medium/High cleanup, reads a small snippet of the focused field and nearby labels so the model can match names, identifiers, and terms you can see. Password fields are never read. With cloud LLM providers, this text is sent to the provider.",
"Advanced.UseClipboardContext": "Use clipboard text",
"Advanced.UseClipboardContextHint": "Before Medium/High cleanup, includes the current clipboard text as read-only spelling reference. With cloud LLM providers, this text is sent to the provider.",
"Advanced.Recording": "Recording",
"Advanced.Retention1Day": "1 day",
"Advanced.Retention30Days": "30 days",
Expand Down Expand Up @@ -461,6 +466,10 @@
"Profiles.CleanupUseStylePreset": "Use style preset",
"Profiles.DeveloperFormattingOverride": "Developer Formatting Override",
"Profiles.DeveloperFormattingOverrideHint": "Force symbol and casing formatting on or off for this profile.",
"Profiles.ScreenContextOverride": "On-screen Context Override",
"Profiles.ScreenContextOverrideHint": "Use on-screen text as cleanup reference for this profile, overriding the global setting.",
"Profiles.ClipboardContextOverride": "Clipboard Context Override",
"Profiles.ClipboardContextOverrideHint": "Use clipboard text as cleanup reference for this profile, overriding the global setting.",
"Profiles.EnableBrowserUrlDetection": "Enable browser URL detection",
"Profiles.Enabled": "Enabled",
"Profiles.HotkeyBehaviorProcessSelectedText": "Process selected text",
Expand Down
9 changes: 9 additions & 0 deletions src/TypeWhisper.Linux/Resources/Localization/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"Advanced.Memory": "Memoria",
"Advanced.MemoryHint": "Envía cada transcripción válida al proveedor de LLM configurado para extraer datos duraderos. Con proveedores en la nube, el texto de la transcripción se sube fuera del dispositivo y se almacena como memoria.",
"Advanced.MemoryUnavailable": "No disponible: activa un plugin de almacenamiento de memoria y configura un proveedor de LLM.",
"Advanced.ReferenceContext": "Contexto de referencia",
"Advanced.UseScreenContext": "Usar texto en pantalla",
"Advanced.UseScreenContextHint": "Antes de la limpieza media/alta, lee un pequeño fragmento del campo enfocado y las etiquetas cercanas para que el modelo pueda coincidir con nombres, identificadores y términos que ves. Los campos de contraseña nunca se leen. Con proveedores de LLM en la nube, este texto se envía al proveedor.",
"Advanced.UseClipboardContext": "Usar texto del portapapeles",
"Advanced.UseClipboardContextHint": "Antes de la limpieza media/alta, incluye el texto actual del portapapeles como referencia ortográfica de solo lectura. Con proveedores de LLM en la nube, este texto se envía al proveedor.",
"Advanced.Recording": "Grabación",
"Advanced.Retention1Day": "1 día",
"Advanced.Retention30Days": "30 días",
Expand Down Expand Up @@ -461,6 +466,10 @@
"Profiles.CleanupUseStylePreset": "Usar preset de estilo",
"Profiles.DeveloperFormattingOverride": "Anulación de formato para desarrolladores",
"Profiles.DeveloperFormattingOverrideHint": "Fuerza el formato de símbolos y mayúsculas/minúsculas a activado o desactivado para este perfil.",
"Profiles.ScreenContextOverride": "Anulación de contexto en pantalla",
"Profiles.ScreenContextOverrideHint": "Usa el texto en pantalla como referencia de limpieza para este perfil, anulando el ajuste global.",
"Profiles.ClipboardContextOverride": "Anulación de contexto del portapapeles",
"Profiles.ClipboardContextOverrideHint": "Usa el texto del portapapeles como referencia de limpieza para este perfil, anulando el ajuste global.",
"Profiles.EnableBrowserUrlDetection": "Habilitar detección de URL del navegador",
"Profiles.Enabled": "Activado",
"Profiles.HotkeyBehaviorProcessSelectedText": "Procesar el texto seleccionado",
Expand Down
9 changes: 9 additions & 0 deletions src/TypeWhisper.Linux/Resources/Localization/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"Advanced.Memory": "Память",
"Advanced.MemoryHint": "Отправляет каждую подходящую транскрипцию настроенному LLM-провайдеру для извлечения устойчивых фактов. При использовании облачных провайдеров текст транскрипции выгружается за пределы устройства и сохраняется в памяти.",
"Advanced.MemoryUnavailable": "Недоступно: включите плагин хранения памяти и настройте LLM-провайдера.",
"Advanced.ReferenceContext": "Справочный контекст",
"Advanced.UseScreenContext": "Использовать текст с экрана",
"Advanced.UseScreenContextHint": "Перед средней/высокой очисткой считывает небольшой фрагмент активного поля и соседних подписей, чтобы модель могла сопоставить видимые имена, идентификаторы и термины. Поля паролей никогда не читаются. При использовании облачных LLM-провайдеров этот текст отправляется провайдеру.",
"Advanced.UseClipboardContext": "Использовать текст из буфера обмена",
"Advanced.UseClipboardContextHint": "Перед средней/высокой очисткой добавляет текущий текст буфера обмена как справочник по написанию (только для чтения). При использовании облачных LLM-провайдеров этот текст отправляется провайдеру.",
"Advanced.Recording": "Запись",
"Advanced.Retention1Day": "1 день",
"Advanced.Retention30Days": "30 дней",
Expand Down Expand Up @@ -461,6 +466,10 @@
"Profiles.CleanupUseStylePreset": "Использовать стилевой пресет",
"Profiles.DeveloperFormattingOverride": "Переопределение форматирования для разработчиков",
"Profiles.DeveloperFormattingOverrideHint": "Принудительно включить или отключить форматирование символов и регистра для этого профиля.",
"Profiles.ScreenContextOverride": "Переопределение экранного контекста",
"Profiles.ScreenContextOverrideHint": "Использовать текст с экрана как справочник очистки для этого профиля, переопределяя глобальную настройку.",
"Profiles.ClipboardContextOverride": "Переопределение контекста буфера обмена",
"Profiles.ClipboardContextOverrideHint": "Использовать текст из буфера обмена как справочник очистки для этого профиля, переопределяя глобальную настройку.",
"Profiles.EnableBrowserUrlDetection": "Включить определение URL браузера",
"Profiles.Enabled": "Включено",
"Profiles.HotkeyBehaviorProcessSelectedText": "Обработать выделенный текст",
Expand Down
Loading
Loading