import Cocoa

let app = NSApplication.shared
let delegate = AppDelegate()

app.setActivationPolicy(.accessory)
app.delegate = delegate

// NSApplication.delegate 是 weak 引用，必须保持强引用防止 ARC 优化释放
withExtendedLifetime(delegate) {
    app.run()
}
