From ec62328eb8503c09e6c77e7451fbacf9ac6d71cd Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 12 Jul 2026 10:17:07 -0700 Subject: [PATCH] chore(apps): remove dead code --- apps/macos/Sources/OpenClawIPC/IPC.swift | 8 -------- .../Sources/OpenClawChatUI/ChatHaptics.swift | 3 --- .../Sources/OpenClawChatUI/ChatViewModel.swift | 4 ---- .../GatewayConnectChallengeSupport.swift | 17 ----------------- .../OpenClawKit/LocalNetworkURLSupport.swift | 13 ------------- .../OpenClawProtocol/WizardHelpers.swift | 10 ---------- .../Sources/SwabbleCore/Support/Logging.swift | 8 -------- 7 files changed, 63 deletions(-) delete mode 100644 apps/shared/OpenClawKit/Sources/OpenClawKit/LocalNetworkURLSupport.swift diff --git a/apps/macos/Sources/OpenClawIPC/IPC.swift b/apps/macos/Sources/OpenClawIPC/IPC.swift index 13fbe8756ab1..93ed7f73ac2b 100644 --- a/apps/macos/Sources/OpenClawIPC/IPC.swift +++ b/apps/macos/Sources/OpenClawIPC/IPC.swift @@ -406,11 +406,3 @@ extension Request: Codable { } } } - -/// Shared transport settings -public let controlSocketPath: String = { - let home = FileManager().homeDirectoryForCurrentUser - return home - .appendingPathComponent("Library/Application Support/OpenClaw/control.sock") - .path -}() diff --git a/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatHaptics.swift b/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatHaptics.swift index 8745ad6ef43f..7a4ff80fab90 100644 --- a/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatHaptics.swift +++ b/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatHaptics.swift @@ -9,7 +9,6 @@ public struct OpenClawChatHaptics: Sendable { case messageSent case runCompleted case runFailed - case actionConfirmed } private let performer: @Sendable (Event) -> Void @@ -36,8 +35,6 @@ public struct OpenClawChatHaptics: Sendable { UINotificationFeedbackGenerator().notificationOccurred(.success) case .runFailed: UINotificationFeedbackGenerator().notificationOccurred(.error) - case .actionConfirmed: - UISelectionFeedbackGenerator().selectionChanged() } } #else diff --git a/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel.swift b/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel.swift index 8ec9f0c70bf5..72f4dc288f5c 100644 --- a/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel.swift +++ b/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel.swift @@ -618,10 +618,6 @@ public final class OpenClawChatViewModel { return !trimmed.isEmpty || !self.attachments.isEmpty } - public var canSendDraft: Bool { - !self.isSubmittingDraft && !self.isSending && self.hasDraftToSend - } - /// True while replacing this model could move an attachment across chats. public var isAttachmentOwnerPinned: Bool { self.blocksAttachmentOwnerChange diff --git a/apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayConnectChallengeSupport.swift b/apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayConnectChallengeSupport.swift index 0b88c3b71b34..866e6b544ed9 100644 --- a/apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayConnectChallengeSupport.swift +++ b/apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayConnectChallengeSupport.swift @@ -8,21 +8,4 @@ public enum GatewayConnectChallengeSupport { guard !trimmed.isEmpty else { return nil } return trimmed } - - public static func waitForNonce( - timeoutSeconds: Double, - onTimeout: @escaping @Sendable () -> some Error, - receiveNonce: @escaping @Sendable () async throws -> String?) async throws -> String - { - try await AsyncTimeout.withTimeout( - seconds: timeoutSeconds, - onTimeout: onTimeout, - operation: { - while true { - if let nonce = try await receiveNonce() { - return nonce - } - } - }) - } } diff --git a/apps/shared/OpenClawKit/Sources/OpenClawKit/LocalNetworkURLSupport.swift b/apps/shared/OpenClawKit/Sources/OpenClawKit/LocalNetworkURLSupport.swift deleted file mode 100644 index 86177b481862..000000000000 --- a/apps/shared/OpenClawKit/Sources/OpenClawKit/LocalNetworkURLSupport.swift +++ /dev/null @@ -1,13 +0,0 @@ -import Foundation - -public enum LocalNetworkURLSupport { - public static func isLocalNetworkHTTPURL(_ url: URL) -> Bool { - guard let scheme = url.scheme?.lowercased(), scheme == "http" || scheme == "https" else { - return false - } - guard let host = url.host?.trimmingCharacters(in: .whitespacesAndNewlines), !host.isEmpty else { - return false - } - return LoopbackHost.isLocalNetworkHost(host) - } -} diff --git a/apps/shared/OpenClawKit/Sources/OpenClawProtocol/WizardHelpers.swift b/apps/shared/OpenClawKit/Sources/OpenClawProtocol/WizardHelpers.swift index 050012c8525d..f8339f3dcd1f 100644 --- a/apps/shared/OpenClawKit/Sources/OpenClawProtocol/WizardHelpers.swift +++ b/apps/shared/OpenClawKit/Sources/OpenClawProtocol/WizardHelpers.swift @@ -39,16 +39,6 @@ public func parseWizardDeviceCode( message: raw?["message"]?.value as? String) } -public func decodeWizardStep(_ raw: [String: AnyCodable]?) -> WizardStep? { - guard let raw else { return nil } - do { - let data = try JSONEncoder().encode(raw) - return try JSONDecoder().decode(WizardStep.self, from: data) - } catch { - return nil - } -} - public func parseWizardOptions(_ raw: [[String: AnyCodable]]?) -> [WizardOption] { guard let raw else { return [] } return raw.map { entry in diff --git a/apps/swabble/Sources/SwabbleCore/Support/Logging.swift b/apps/swabble/Sources/SwabbleCore/Support/Logging.swift index aa5e3df1ed55..9b08f7461eeb 100644 --- a/apps/swabble/Sources/SwabbleCore/Support/Logging.swift +++ b/apps/swabble/Sources/SwabbleCore/Support/Logging.swift @@ -31,10 +31,6 @@ public struct Logger: Sendable { print("[\(level.rawValue.uppercased())] \(ts) | \(message)") } - public func trace(_ msg: String) { - self.log(.trace, msg) - } - public func debug(_ msg: String) { self.log(.debug, msg) } @@ -43,10 +39,6 @@ public struct Logger: Sendable { self.log(.info, msg) } - public func warn(_ msg: String) { - self.log(.warn, msg) - } - public func error(_ msg: String) { self.log(.error, msg) }