From 23947035935ec847d02a9451339675d0dec58d4b Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 20 Jan 2026 16:02:44 +0000 Subject: [PATCH] fix(macos): disambiguate AnyCodable usage --- apps/macos/Sources/Clawdbot/ControlChannel.swift | 10 +++++----- apps/macos/Sources/Clawdbot/CronJobsStore.swift | 2 ++ .../Clawdbot/ExecApprovalsGatewayPrompter.swift | 2 ++ apps/macos/Sources/Clawdbot/GatewayConnection.swift | 2 ++ apps/macos/Sources/Clawdbot/OnboardingWizard.swift | 1 + apps/macos/Sources/Clawdbot/WebChatSwiftUI.swift | 2 ++ 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/apps/macos/Sources/Clawdbot/ControlChannel.swift b/apps/macos/Sources/Clawdbot/ControlChannel.swift index 83f342e81a..5c0f45597c 100644 --- a/apps/macos/Sources/Clawdbot/ControlChannel.swift +++ b/apps/macos/Sources/Clawdbot/ControlChannel.swift @@ -20,7 +20,7 @@ struct ControlAgentEvent: Codable, Sendable, Identifiable { let seq: Int let stream: String let ts: Double - let data: [String: AnyCodable] + let data: [String: ClawdbotProtocol.AnyCodable] let summary: String? } @@ -156,8 +156,8 @@ final class ControlChannel { timeoutMs: Double? = nil) async throws -> Data { do { - let rawParams = params?.reduce(into: [String: AnyCodable]()) { - $0[$1.key] = AnyCodable($1.value.base) + let rawParams = params?.reduce(into: [String: ClawdbotKit.AnyCodable]()) { + $0[$1.key] = ClawdbotKit.AnyCodable($1.value.base) } let data = try await GatewayConnection.shared.request( method: method, @@ -359,13 +359,13 @@ final class ControlChannel { } private static func bridgeToProtocolArgs( - _ value: AnyCodable?) -> [String: ClawdbotProtocol.AnyCodable]? + _ value: ClawdbotProtocol.AnyCodable?) -> [String: ClawdbotProtocol.AnyCodable]? { guard let value else { return nil } if let dict = value.value as? [String: ClawdbotProtocol.AnyCodable] { return dict } - if let dict = value.value as? [String: AnyCodable], + if let dict = value.value as? [String: ClawdbotKit.AnyCodable], let data = try? JSONEncoder().encode(dict), let decoded = try? JSONDecoder().decode([String: ClawdbotProtocol.AnyCodable].self, from: data) { diff --git a/apps/macos/Sources/Clawdbot/CronJobsStore.swift b/apps/macos/Sources/Clawdbot/CronJobsStore.swift index b44f9cb3ab..ced5869156 100644 --- a/apps/macos/Sources/Clawdbot/CronJobsStore.swift +++ b/apps/macos/Sources/Clawdbot/CronJobsStore.swift @@ -4,6 +4,8 @@ import Foundation import Observation import OSLog +private typealias AnyCodable = ClawdbotKit.AnyCodable + @MainActor @Observable final class CronJobsStore { diff --git a/apps/macos/Sources/Clawdbot/ExecApprovalsGatewayPrompter.swift b/apps/macos/Sources/Clawdbot/ExecApprovalsGatewayPrompter.swift index 4cd79d5f69..06b213342b 100644 --- a/apps/macos/Sources/Clawdbot/ExecApprovalsGatewayPrompter.swift +++ b/apps/macos/Sources/Clawdbot/ExecApprovalsGatewayPrompter.swift @@ -3,6 +3,8 @@ import ClawdbotProtocol import Foundation import OSLog +private typealias AnyCodable = ClawdbotKit.AnyCodable + @MainActor final class ExecApprovalsGatewayPrompter { static let shared = ExecApprovalsGatewayPrompter() diff --git a/apps/macos/Sources/Clawdbot/GatewayConnection.swift b/apps/macos/Sources/Clawdbot/GatewayConnection.swift index 32e04db105..0b077ad5d7 100644 --- a/apps/macos/Sources/Clawdbot/GatewayConnection.swift +++ b/apps/macos/Sources/Clawdbot/GatewayConnection.swift @@ -4,6 +4,8 @@ import ClawdbotProtocol import Foundation import OSLog +private typealias AnyCodable = ClawdbotKit.AnyCodable + private let gatewayConnectionLogger = Logger(subsystem: "com.clawdbot", category: "gateway.connection") enum GatewayAgentChannel: String, Codable, CaseIterable, Sendable { diff --git a/apps/macos/Sources/Clawdbot/OnboardingWizard.swift b/apps/macos/Sources/Clawdbot/OnboardingWizard.swift index 34e153233e..e5ea0a7635 100644 --- a/apps/macos/Sources/Clawdbot/OnboardingWizard.swift +++ b/apps/macos/Sources/Clawdbot/OnboardingWizard.swift @@ -12,6 +12,7 @@ private let onboardingWizardLogger = Logger(subsystem: "com.clawdbot", category: // Bridge between ClawdbotProtocol.AnyCodable and the local module to avoid // Swift 6 strict concurrency type conflicts. +private typealias AnyCodable = ClawdbotKit.AnyCodable private typealias ProtocolAnyCodable = ClawdbotProtocol.AnyCodable private func bridgeToLocal(_ value: ProtocolAnyCodable) -> AnyCodable { diff --git a/apps/macos/Sources/Clawdbot/WebChatSwiftUI.swift b/apps/macos/Sources/Clawdbot/WebChatSwiftUI.swift index 665416d31a..118fbb048f 100644 --- a/apps/macos/Sources/Clawdbot/WebChatSwiftUI.swift +++ b/apps/macos/Sources/Clawdbot/WebChatSwiftUI.swift @@ -9,6 +9,8 @@ import SwiftUI private let webChatSwiftLogger = Logger(subsystem: "com.clawdbot", category: "WebChatSwiftUI") +private typealias AnyCodable = ClawdbotKit.AnyCodable + private enum WebChatSwiftUILayout { static let windowSize = NSSize(width: 500, height: 840) static let panelSize = NSSize(width: 480, height: 640)