Skip to content

Commit 664dae3

Browse files
kochj23claude
andcommitted
fix: Resolve all build errors in AI backend extensions
- Add 6 missing AIBackend enum cases (openWebUI, openAI, googleCloud, azureCognitive, awsAI, ibmWatson) - Move stored properties from extensions to main class - Add missing availability flags and API key properties - Add OpenWebUI generation method and availability check - Add saveConfiguration() and refreshAllBackends() convenience methods - Delete duplicate AIBackendManager+Generation.swift - Replace deprecated NSUserNotification with UNUserNotificationCenter - Fix AIBackendStatusMenu missing type references - Bump version to v1.7.0 build 15 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3a4347c commit 664dae3

5 files changed

Lines changed: 172 additions & 417 deletions

File tree

RsyncGUI.xcodeproj/project.pbxproj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
1E4F73C26D4A268D3D14C625 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 474C574974A0174A24BE137E /* Assets.xcassets */; };
1414
21C7A54F29AFE39FC9E322A2 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE96445DCFA962CFEDC89752 /* SettingsView.swift */; };
1515
2899CD054C674179B69E26C5 /* DeltaReportView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41893A1D4E512F8F7C9BAC87 /* DeltaReportView.swift */; };
16-
2B5152DFEBDFCC0DB9297AD8 /* AIBackendManager+Generation.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD38DB4D58D8BCBDCB8C3571 /* AIBackendManager+Generation.swift */; };
1716
32BF2466EA616BF63BF798D7 /* ConnectionTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AB5A4475246EFD82B180AB5 /* ConnectionTest.swift */; };
1817
408EF7ED937BB7A1B936420C /* RsyncOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39336941D1E7E9FE128A0BC9 /* RsyncOptions.swift */; };
1918
40C92BF2B05D618ED2249847 /* TestProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C1BDDADDD297E7F8CAF104D /* TestProgressView.swift */; };
@@ -98,7 +97,6 @@
9897
C0524EE8D6032F69C5D3B81B /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = Info.plist; path = RsyncGUI/Info.plist; sourceTree = "<group>"; };
9998
C1300EC32CF13FEAF866BEB8 /* AdvancedExecutionService.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AdvancedExecutionService.swift; path = RsyncGUI/Services/AdvancedExecutionService.swift; sourceTree = "<group>"; };
10099
D18D90307EA5D1AAE8FC075E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; };
101-
DD38DB4D58D8BCBDCB8C3571 /* AIBackendManager+Generation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "AIBackendManager+Generation.swift"; path = "RsyncGUI/Services/AIBackendManager+Generation.swift"; sourceTree = "<group>"; };
102100
EDDE33F4C68FAC036C1E4EDE /* JobDetailView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JobDetailView.swift; path = RsyncGUI/Views/JobDetailView.swift; sourceTree = "<group>"; };
103101
EE96445DCFA962CFEDC89752 /* SettingsView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SettingsView.swift; path = RsyncGUI/Views/SettingsView.swift; sourceTree = "<group>"; };
104102
F5106288DF8535D0CCC0EB4E /* RsyncGUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RsyncGUI.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -152,7 +150,6 @@
152150
3CBDD4BB9DBB3B7410411DEA /* AIBackend */ = {
153151
isa = PBXGroup;
154152
children = (
155-
DD38DB4D58D8BCBDCB8C3571 /* AIBackendManager+Generation.swift */,
156153
A65F21CD34865F6C33A60947 /* AIBackendManager+Enhanced.swift */,
157154
525652212BC206EFC0413518 /* AIBackendStatusMenu.swift */,
158155
);
@@ -401,7 +398,6 @@
401398
9CBB5767AE7FECE6D6F329BB /* MenuBarManager.swift in Sources */,
402399
94678A6B39B29BE9B0DB924D /* ModernDesign.swift in Sources */,
403400
W1DGETDATASYNC1BLDFILE12 /* WidgetDataSync.swift in Sources */,
404-
2B5152DFEBDFCC0DB9297AD8 /* AIBackendManager+Generation.swift in Sources */,
405401
445A92C3E85B0445DD3CE0F5 /* AIBackendManager+Enhanced.swift in Sources */,
406402
A39615CCF66F3666DDCE7573 /* AIBackendStatusMenu.swift in Sources */,
407403
);
@@ -599,7 +595,7 @@
599595
CODE_SIGN_ENTITLEMENTS = "RsyncGUI Widget/RsyncGUI_Widget.entitlements";
600596
CODE_SIGN_IDENTITY = "-";
601597
CODE_SIGN_STYLE = Automatic;
602-
CURRENT_PROJECT_VERSION = 14;
598+
CURRENT_PROJECT_VERSION = 15;
603599
DEVELOPMENT_TEAM = "";
604600
GENERATE_INFOPLIST_FILE = YES;
605601
INFOPLIST_FILE = "RsyncGUI Widget/Info.plist";
@@ -611,7 +607,7 @@
611607
"@executable_path/../../../../Frameworks",
612608
);
613609
MACOSX_DEPLOYMENT_TARGET = 14.0;
614-
MARKETING_VERSION = 1.6.0;
610+
MARKETING_VERSION = 1.7.0;
615611
PRODUCT_BUNDLE_IDENTIFIER = com.jordankoch.rsyncgui.widget;
616612
PRODUCT_NAME = "$(TARGET_NAME)";
617613
SDKROOT = macosx;
@@ -629,7 +625,7 @@
629625
CODE_SIGN_ENTITLEMENTS = "RsyncGUI Widget/RsyncGUI_Widget.entitlements";
630626
CODE_SIGN_IDENTITY = "-";
631627
CODE_SIGN_STYLE = Automatic;
632-
CURRENT_PROJECT_VERSION = 14;
628+
CURRENT_PROJECT_VERSION = 15;
633629
DEVELOPMENT_TEAM = "";
634630
GENERATE_INFOPLIST_FILE = YES;
635631
INFOPLIST_FILE = "RsyncGUI Widget/Info.plist";
@@ -641,7 +637,7 @@
641637
"@executable_path/../../../../Frameworks",
642638
);
643639
MACOSX_DEPLOYMENT_TARGET = 14.0;
644-
MARKETING_VERSION = 1.6.0;
640+
MARKETING_VERSION = 1.7.0;
645641
PRODUCT_BUNDLE_IDENTIFIER = com.jordankoch.rsyncgui.widget;
646642
PRODUCT_NAME = "$(TARGET_NAME)";
647643
SDKROOT = macosx;

RsyncGUI/Services/AIBackendManager+Enhanced.swift

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Foundation
22
import SwiftUI
33
import Combine
4+
import UserNotifications
45
#if os(macOS)
56
import AppKit
67
#endif
@@ -70,10 +71,10 @@ extension AIBackendManager {
7071
backends.append(active)
7172
}
7273

73-
// Add other available backends in priority order
74+
// Add other available backends in priority order (local first, cloud last)
7475
let priorityOrder: [AIBackend] = [
75-
.ollama, .openAI, .tinyChat, .tinyLLM, .openWebUI,
76-
.googleCloud, .azureCognitive, .ibmWatson, .mlx, .awsAI
76+
.ollama, .tinyChat, .tinyLLM, .openWebUI, .mlx,
77+
.openAI, .googleCloud, .azureCognitive, .awsAI, .ibmWatson
7778
]
7879

7980
for backend in priorityOrder where !backends.contains(backend) && isBackendAvailable(backend) {
@@ -95,13 +96,12 @@ extension AIBackendManager {
9596
case .azureCognitive: return isAzureAvailable
9697
case .awsAI: return isAWSAvailable
9798
case .ibmWatson: return isIBMWatsonAvailable
99+
case .auto: return false
98100
}
99101
}
100102

101103
// MARK: - Connection Testing
102104

103-
@Published var connectionTestResults: [AIBackend: ConnectionTestResult] = [:]
104-
105105
struct ConnectionTestResult {
106106
let success: Bool
107107
let responseTime: TimeInterval?
@@ -167,8 +167,6 @@ extension AIBackendManager {
167167

168168
// MARK: - Usage Tracking
169169

170-
@Published var usageStats: [AIBackend: UsageStats] = [:]
171-
172170
struct UsageStats: Codable {
173171
var totalTokens: Int = 0
174172
var totalRequests: Int = 0
@@ -208,7 +206,7 @@ extension AIBackendManager {
208206
case .azureCognitive: return 10.0
209207
case .awsAI: return 8.0
210208
case .ibmWatson: return 12.0
211-
case .ollama, .mlx, .tinyLLM, .tinyChat, .openWebUI: return 0.0 // Free/local
209+
case .ollama, .mlx, .tinyLLM, .tinyChat, .openWebUI, .auto: return 0.0 // Free/local
212210
}
213211
}()
214212

@@ -231,8 +229,6 @@ extension AIBackendManager {
231229

232230
// MARK: - Performance Metrics
233231

234-
@Published var performanceMetrics: [AIBackend: PerformanceMetrics] = [:]
235-
236232
struct PerformanceMetrics {
237233
var averageLatency: TimeInterval = 0.0
238234
var successRate: Double = 0.0
@@ -282,23 +278,29 @@ extension AIBackendManager {
282278
// MARK: - Notification System
283279

284280
private func sendNotification(title: String, message: String) {
285-
// For macOS, use NSUserNotification or UNUserNotificationCenter
286-
// This is a simplified version
287281
#if os(macOS)
288-
let notification = NSUserNotification()
289-
notification.title = title
290-
notification.informativeText = message
291-
notification.soundName = NSUserNotificationDefaultSoundName
292-
NSUserNotificationCenter.default.deliver(notification)
282+
let content = UNMutableNotificationContent()
283+
content.title = title
284+
content.body = message
285+
content.sound = .default
286+
287+
let request = UNNotificationRequest(
288+
identifier: UUID().uuidString,
289+
content: content,
290+
trigger: nil
291+
)
292+
UNUserNotificationCenter.current().add(request) { error in
293+
if let error = error {
294+
NSLog("[AIBackendManager] Failed to deliver notification: %@", error.localizedDescription)
295+
}
296+
}
293297
#endif
294298

295-
print("📢 \(title): \(message)")
299+
NSLog("[AIBackendManager] %@: %@", title, message)
296300
}
297301

298302
// MARK: - Background Monitoring
299303

300-
private var monitoringTimer: Timer?
301-
302304
func startBackgroundMonitoring(interval: TimeInterval = 60.0) {
303305
stopBackgroundMonitoring()
304306

0 commit comments

Comments
 (0)