fix(macos): disambiguate AnyCodable usage

This commit is contained in:
Peter Steinberger
2026-01-20 16:02:44 +00:00
parent 404470853a
commit 2394703593
6 changed files with 14 additions and 5 deletions

View File

@@ -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)
{

View File

@@ -4,6 +4,8 @@ import Foundation
import Observation
import OSLog
private typealias AnyCodable = ClawdbotKit.AnyCodable
@MainActor
@Observable
final class CronJobsStore {

View File

@@ -3,6 +3,8 @@ import ClawdbotProtocol
import Foundation
import OSLog
private typealias AnyCodable = ClawdbotKit.AnyCodable
@MainActor
final class ExecApprovalsGatewayPrompter {
static let shared = ExecApprovalsGatewayPrompter()

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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)