M4: TranslationSession actor with epochs/one-in-flight streaming, PanelViewModel, non-activating NSPanel, streaming panel UI, searchable/recent target languages, warnings/errors and Copy/Retry/Replace actions. M5: InsertionCoordinator with target capture, AX direct replacement, secure-field/own-PID refusal, frontmost and selected-text verification, snapshot/⌘V/restore fallback, cancellation-safe restore and blocking-warning gate. M6: versioned AppSettings/SettingsStore, onboarding for Ollama/model/target/Accessibility, General/Model/Translation/Privacy/Diagnostics settings, launch-at-login via SMAppService, status menu (target, copy/replace last, setup, diagnostics, about), text-free diagnostics and first-run setup. Docs: PROGRESS M4–M6, ARCHITECTURE §10–§12, ADR-019/020, SELECTION_AND_CLIPBOARD and TESTING. Manual 10-app matrices, real AX/paste delivery, VoiceOver and focus checks remain open. Verified: make verify green (format, strict lint, scripts, privacy, Debug+Release signatures, 217 package tests); app launches and a two-copy clipboard smoke test opens the panel.
20 lines
760 B
Swift
20 lines
760 B
Swift
/// Accessibility is optional and used only for Replace (SEE: docs/SELECTION_AND_CLIPBOARD.md).
|
|
@MainActor
|
|
public protocol AccessibilityPermissionChecking: AnyObject {
|
|
/// Whether the app is currently trusted for Accessibility.
|
|
var isTrusted: Bool { get }
|
|
/// Shows the system prompt. Call only from onboarding or an explicit Replace click.
|
|
func requestTrust()
|
|
/// Opens System Settings ▸ Privacy & Security ▸ Accessibility.
|
|
func openSettings()
|
|
}
|
|
|
|
/// The login-item seam; production uses `SMAppService.mainApp`.
|
|
@MainActor
|
|
public protocol LaunchAtLoginControlling: AnyObject {
|
|
/// The current system state.
|
|
var isEnabled: Bool { get }
|
|
/// Registers or unregisters the app.
|
|
func setEnabled(_ enabled: Bool) throws
|
|
}
|