diff --git a/apps/macos/Sources/Clawdbot/GeneralSettings.swift b/apps/macos/Sources/Clawdbot/GeneralSettings.swift index 1e123faf9..b17a4b29c 100644 --- a/apps/macos/Sources/Clawdbot/GeneralSettings.swift +++ b/apps/macos/Sources/Clawdbot/GeneralSettings.swift @@ -95,7 +95,9 @@ struct GeneralSettings: View { .pickerStyle(.segmented) Text(""" - Controls remote command execution on this Mac when it is paired as a node. "Always Ask" prompts on each command; "Always Allow" runs without prompts; "Never" disables `system.run`. + Controls remote command execution on this Mac when it is paired as a node. \ + "Always Ask" prompts on each command; "Always Allow" runs without prompts; \ + "Never" disables `system.run`. """) .font(.footnote) .foregroundStyle(.tertiary) diff --git a/apps/macos/Sources/Clawdbot/NodeMode/MacNodeBridgeTLS.swift b/apps/macos/Sources/Clawdbot/NodeMode/MacNodeBridgeTLS.swift index 192214d6c..353c803e6 100644 --- a/apps/macos/Sources/Clawdbot/NodeMode/MacNodeBridgeTLS.swift +++ b/apps/macos/Sources/Clawdbot/NodeMode/MacNodeBridgeTLS.swift @@ -19,14 +19,14 @@ enum MacNodeBridgeTLSStore { } static func loadFingerprint(stableID: String) -> String? { - let key = keyPrefix + stableID - let raw = defaults.string(forKey: key)?.trimmingCharacters(in: .whitespacesAndNewlines) + let key = self.keyPrefix + stableID + let raw = self.defaults.string(forKey: key)?.trimmingCharacters(in: .whitespacesAndNewlines) return raw?.isEmpty == false ? raw : nil } static func saveFingerprint(_ value: String, stableID: String) { - let key = keyPrefix + stableID - defaults.set(value, forKey: key) + let key = self.keyPrefix + stableID + self.defaults.set(value, forKey: key) } } @@ -71,5 +71,5 @@ private func sha256Hex(_ data: Data) -> String { } private func normalizeMacNodeFingerprint(_ raw: String) -> String { - raw.lowercased().filter { $0.isHexDigit } + raw.lowercased().filter(\.isHexDigit) } diff --git a/apps/macos/Sources/Clawdbot/NodeMode/MacNodeRuntime.swift b/apps/macos/Sources/Clawdbot/NodeMode/MacNodeRuntime.swift index 723b0ae61..6d9188db6 100644 --- a/apps/macos/Sources/Clawdbot/NodeMode/MacNodeRuntime.swift +++ b/apps/macos/Sources/Clawdbot/NodeMode/MacNodeRuntime.swift @@ -586,8 +586,8 @@ actor MacNodeRuntime { let key = rawKey.trimmingCharacters(in: .whitespacesAndNewlines) guard !key.isEmpty else { continue } let upper = key.uppercased() - if blockedEnvKeys.contains(upper) { continue } - if blockedEnvPrefixes.contains(where: { upper.hasPrefix($0) }) { continue } + if self.blockedEnvKeys.contains(upper) { continue } + if self.blockedEnvPrefixes.contains(where: { upper.hasPrefix($0) }) { continue } merged[key] = value } return merged diff --git a/apps/macos/Sources/Clawdbot/SystemRunPolicy.swift b/apps/macos/Sources/Clawdbot/SystemRunPolicy.swift index aa76eb7a5..b38734bc3 100644 --- a/apps/macos/Sources/Clawdbot/SystemRunPolicy.swift +++ b/apps/macos/Sources/Clawdbot/SystemRunPolicy.swift @@ -10,11 +10,11 @@ enum SystemRunPolicy: String, CaseIterable, Identifiable { var title: String { switch self { case .never: - return "Never" + "Never" case .ask: - return "Always Ask" + "Always Ask" case .always: - return "Always Allow" + "Always Allow" } } @@ -75,13 +75,13 @@ enum SystemRunAllowlist { static func contains(_ argv: [String], defaults: UserDefaults = .standard) -> Bool { let key = key(for: argv) - return load(from: defaults).contains(key) + return self.load(from: defaults).contains(key) } static func add(_ argv: [String], defaults: UserDefaults = .standard) { let key = key(for: argv) guard !key.isEmpty else { return } - var allowlist = load(from: defaults) + var allowlist = self.load(from: defaults) if allowlist.insert(key).inserted { MacNodeConfigFile.setSystemRunAllowlist(Array(allowlist).sorted()) }