import AppKit import os import SprachmittlerCore /// Lifecycle glue: composition root, Services provider, double-copy watcher, termination. @MainActor final class AppDelegate: NSObject, NSApplicationDelegate { private let loggers = Loggers(subsystem: Bundle.main.bundleIdentifier ?? "Sprachmittler") func applicationDidFinishLaunching(_ notification: Notification) { loggers.logger(.session).notice("Sprachmittler launched") // Build AppEnvironment here (composition root): settings, Ollama services, session, // double-copy watcher and panel controller. Start the watcher only after explicit consent. // // The Services provider is wired here once SprachmittlerCapture.ServicesProvider exists: // NSApp.servicesProvider = servicesProvider // NSUpdateDynamicServices() } func applicationWillTerminate(_ notification: Notification) { // Cancel in-flight translations, stop the pasteboard watcher and close the panel. } }