// // Main.swift // Zyquo Cloud // // Author: Simon-Pierre Boucher // Mail: contact@spboucher.ai // // Entry point. `--verify` runs the Phase 7 API harness headlessly (reusing // the production provider clients); `--load-vault` seeds the encrypted vault // from environment keys; otherwise the SwiftUI app launches. // // Deliberately a synchronous main: launching NSApplicationMain from an async // main() corrupts Swift concurrency's executor setup (background tasks stop // being scheduled), so the CLI modes drive their async work explicitly. // import Foundation @main enum Main { static func main() { let arguments = CommandLine.arguments if arguments.contains("--verify") { Task.detached { let status = await VerifyHarness.run(arguments: arguments) exit(status) } // Park the main thread servicing the main queue so MainActor work // can run (a blocking semaphore here deadlocks the harness). dispatchMain() } if arguments.contains("--load-vault") { VerifyHarness.loadVault() exit(0) } ZyquoCloudApp.main() } }