55import Foundation
66
77public struct AppPolicyContext : Sendable {
8+ /// Disables OpenClip entirely for the matching application (no popup, hotkeys ignored).
9+ public let disabled : Bool
10+ /// Suppresses the automatic popup on text selection; OpenClip will only trigger via explicit hotkey.
11+ public let hotkeyOnly : Bool
812 /// Force a text result to be delivered as a copy instead of a paste, even when the app lists a
913 /// Paste command. The explicit escape hatch for apps (e.g. Terminal) that advertise Paste but
1014 /// cannot reliably replace a selection.
@@ -19,11 +23,15 @@ public struct AppPolicyContext: Sendable {
1923 public static let `default` = AppPolicyContext ( )
2024
2125 public init (
26+ disabled: Bool = false ,
27+ hotkeyOnly: Bool = false ,
2228 denyPaste: Bool = false ,
2329 useMenuCopy: Bool = false ,
2430 retrievalMode: SelectionRetrievalMode = . axTextControl,
2531 gate: SelectionGatePolicy = . default
2632 ) {
33+ self . disabled = disabled
34+ self . hotkeyOnly = hotkeyOnly
2735 self . denyPaste = denyPaste
2836 self . useMenuCopy = useMenuCopy
2937 self . retrievalMode = retrievalMode
@@ -34,19 +42,25 @@ public struct AppPolicyContext: Sendable {
3442public struct AppRule : Codable , Sendable , Equatable , Identifiable {
3543 public var id : String { bundleIdentifiers. first ?? UUID ( ) . uuidString }
3644 public let bundleIdentifiers : [ String ]
45+ public let disabled : Bool ?
46+ public let hotkeyOnly : Bool ?
3747 public let useMenuCopy : Bool ?
3848 public let denyPaste : Bool ?
3949 public let retrievalMode : SelectionRetrievalMode ?
4050 public let gate : SelectionGatePolicy ?
4151
4252 public init (
4353 bundleIdentifiers: [ String ] ,
54+ disabled: Bool ? = nil ,
55+ hotkeyOnly: Bool ? = nil ,
4456 useMenuCopy: Bool ? = nil ,
4557 denyPaste: Bool ? = nil ,
4658 retrievalMode: SelectionRetrievalMode ? = nil ,
4759 gate: SelectionGatePolicy ? = nil
4860 ) {
4961 self . bundleIdentifiers = bundleIdentifiers
62+ self . disabled = disabled
63+ self . hotkeyOnly = hotkeyOnly
5064 self . useMenuCopy = useMenuCopy
5165 self . denyPaste = denyPaste
5266 self . retrievalMode = retrievalMode
@@ -55,6 +69,8 @@ public struct AppRule: Codable, Sendable, Equatable, Identifiable {
5569
5670 public enum CodingKeys : String , CodingKey {
5771 case bundleIdentifiers = " bundle-identifiers "
72+ case disabled = " disabled "
73+ case hotkeyOnly = " hotkey-only "
5874 case useMenuCopy = " use-menu-copy "
5975 case denyPaste = " deny-paste "
6076 case retrievalMode = " retrieval-mode "
0 commit comments