Files
openclaw/apps/macos/Sources/OpenClaw/AppLaunchPresentationPolicy.swift
Vincent Koc 9e0c5f94b5 fix(macos): support background-only launches (#112168)
* fix(macos): support background-only launches

* fix(macos): refresh native i18n inventory

* fix(i18n): refresh native inventory after main sync
2026-07-21 15:41:49 +08:00

27 lines
709 B
Swift

import Foundation
struct AppLaunchPresentationPolicy: Equatable {
let backgroundOnly: Bool
init(arguments: [String]) {
self.backgroundOnly = arguments.contains("--background-only")
}
static var current: Self {
Self(arguments: CommandLine.arguments)
}
var allowsAutomaticPresentation: Bool {
!self.backgroundOnly
}
func shouldAutoOpenChat(arguments: [String]) -> Bool {
self.allowsAutomaticPresentation &&
(arguments.contains("--chat") || arguments.contains("--webchat"))
}
func shouldAutoOpenDashboard(arguments: [String]) -> Bool {
self.allowsAutomaticPresentation && arguments.contains("--dashboard")
}
}