Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit ec1dedf

Browse files
steipeteclaude
andcommitted
Fix build warnings and add Claude monitoring features
## Build Warning Fixes - Fix DynamicLocatorDiscoverer type comparison warning by using correct property - Fix ambiguous LogCategory type lookup in SessionLoggingTests - Fix immutable value initialization warnings in test files - Remove unreachable catch block in ClaudeMonitorService - Fix integer overflow crash in ClaudeProcessDetector by safely converting pid_t to Int32 ## New Features - Add Claude monitoring service with process detection - Add Claude status extraction from terminal output - Add Claude terminal title management - Add HTTP server models and service infrastructure - Add animated loop icon for status bar - Add useDynamicMenuBarIcon preference key ## Test Improvements - Update test files to fix unused variable warnings - Use proper type annotations to resolve ambiguity 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9b82411 commit ec1dedf

26 files changed

Lines changed: 2701 additions & 1100 deletions

App/AppDelegate.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,12 @@ public final class AppDelegate: NSObject, NSApplicationDelegate, ObservableObjec
433433

434434
// Start supervision if enabled - this is the key fix!
435435
supervisionCoordinator?.startSupervisionIfEnabled()
436-
436+
437+
// Initialize HTTP server
438+
Task { @MainActor in
439+
await HTTPServerService.shared.startIfEnabled()
440+
}
441+
437442
// Observe changes to the global monitoring setting
438443
Defaults.observe(.isGlobalMonitoringEnabled) { [weak self] change in
439444
self?.logger.info("Global monitoring preference changed to: \(change.newValue)")

App/CodeLooperApp.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,20 @@ struct MenuBarIconView: View {
112112
@StateObject private var menuBarIconManager = MenuBarIconManager.shared
113113
@EnvironmentObject var appIconStateController: AppIconStateController // Keep for status display
114114
@Default(.isGlobalMonitoringEnabled) private var isGlobalMonitoringEnabled
115+
@Default(.useDynamicMenuBarIcon) private var useDynamicMenuBarIcon
115116

116117
var body: some View {
117118
HStack(spacing: 4) {
118-
// Static PNG icon
119-
Image("MenuBarTemplateIcon")
120-
.renderingMode(.template)
121-
.frame(width: 16, height: 16)
119+
// Icon based on user preference
120+
if useDynamicMenuBarIcon {
121+
// Animated SwiftUI icon
122+
AnimatedLoopIcon(size: 16)
123+
} else {
124+
// Static PNG icon
125+
Image("MenuBarTemplateIcon")
126+
.renderingMode(.template)
127+
.frame(width: 16, height: 16)
128+
}
122129

123130
// Display the status text from the manager
124131
Text(menuBarIconManager.currentIconAttributedString)

CodeLooper.xcodeproj/project.pbxproj

Lines changed: 90 additions & 9 deletions
Large diffs are not rendered by default.

Core/Accessibility/DynamicLocatorDiscoverer.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class DynamicLocatorDiscoverer {
5656
/// - axorcist: An instance of `AXorcist` to perform queries.
5757
/// - Returns: An `AXorcist.Locator` if discovery is successful, otherwise `nil`.
5858
func discover(type: LocatorType, for pid: pid_t, axorcist: AXorcist) async -> Locator? {
59-
guard let specificHeuristics = heuristicsRegistry[type], !specificHeuristics.isEmpty else {
59+
guard let specificHeuristics = heuristics[type], !specificHeuristics.isEmpty else {
6060
SessionLogger.shared.log(
6161
level: .debug,
6262
message: "No dynamic discovery heuristics registered for LocatorType: \(type.rawValue)",
@@ -104,7 +104,4 @@ class DynamicLocatorDiscoverer {
104104
// This maps a locator type to an ordered list of heuristics to try.
105105
// The order matters: heuristics are tried sequentially.
106106
private let heuristics: [LocatorType: [AXElementHeuristic]]
107-
108-
// Heuristics will be registered here, mapping LocatorType to an array of heuristic instances.
109-
private var heuristicsRegistry: [LocatorType: [AXElementHeuristic]] = [:]
110107
}

Core/Diagnostics/LogCategory.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public enum LogCategory: String, CaseIterable, Sendable {
6464
case aiAnalysis = "AIAnalysis"
6565
case networking = "Networking"
6666
case git = "Git"
67+
case automation = "Automation"
6768

6869
// MARK: Public
6970

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import Foundation
2+
3+
/// Represents a Claude instance for HTTP API
4+
struct HTTPClaudeInstanceInfo: Codable {
5+
let id: String
6+
let windowTitle: String
7+
let processId: Int32
8+
let isActive: Bool
9+
let lastSeen: Date
10+
let textContent: String?
11+
}
12+
13+
/// Represents a Cursor instance for HTTP API
14+
struct HTTPCursorInstanceInfo: Codable {
15+
let id: String
16+
let windowTitle: String
17+
let processId: Int32
18+
let isActive: Bool
19+
let lastSeen: Date
20+
let textContent: String?
21+
let status: String
22+
}
23+
24+
/// Combined instance list response
25+
struct InstancesResponse: Codable {
26+
let claudeInstances: [HTTPClaudeInstanceInfo]
27+
let cursorInstances: [HTTPCursorInstanceInfo]
28+
let timestamp: Date
29+
}

0 commit comments

Comments
 (0)