Open source CapCut alternative.
TypeScript
Compile debug overlay only in debug builds
David Le20a763166153
diff --git a/apps/Donkey/Package.swift b/apps/Donkey/Package.swiftindex 2e0c3a98..b1217a5a 100644--- a/apps/Donkey/Package.swift+++ b/apps/Donkey/Package.swift@@ -46,6 +46,9 @@ let package = Package(.process("Resources/local-app-finder-profiles.json"),.copy("Resources/BuiltInSkills")],+ swiftSettings: [+ .define("DONKEY_DEBUG_OVERLAY", .when(configuration: .debug))+ ],linkerSettings: [.linkedLibrary("sqlite3")]@@ -55,6 +58,9 @@ let package = Package(dependencies: ["DonkeyContracts","DonkeyRuntime"+ ],+ swiftSettings: [+ .define("DONKEY_DEBUG_OVERLAY", .when(configuration: .debug))]),.target(@@ -79,6 +85,9 @@ let package = Package(.copy("Resources/donkey-app-icon.png"),.copy("Resources/google-continue-dark-rounded.png"),.copy("Resources/theme.json")+ ],+ swiftSettings: [+ .define("DONKEY_DEBUG_OVERLAY", .when(configuration: .debug))]),.executableTarget(diff --git a/apps/Donkey/Sources/Donkey/DonkeyAppDelegate.swift b/apps/Donkey/Sources/Donkey/DonkeyAppDelegate.swiftindex 3f9c4b0d..b026c7cc 100644--- a/apps/Donkey/Sources/Donkey/DonkeyAppDelegate.swift+++ b/apps/Donkey/Sources/Donkey/DonkeyAppDelegate.swift@@ -9,7 +9,9 @@ final class DonkeyAppDelegate: NSObject, NSApplicationDelegate {private var loginWindowController: DonkeyLoginWindowController?private var permissionSetupController: MacPermissionSetupWindowController?private var overlayController: UserQueryOverlayController?+ #if DONKEY_DEBUG_OVERLAYprivate var debugInspectionCoordinator: DebugUIInspectionCoordinator?+ #endifprivate var runtimeOnboardingController: LocalRuntimeOnboardingWindowController?func applicationDidFinishLaunching(_ notification: Notification) {@@ -68,7 +70,9 @@ final class DonkeyAppDelegate: NSObject, NSApplicationDelegate {andEventID: AEEventID(kAEGetURL))overlayController?.stop()+ #if DONKEY_DEBUG_OVERLAYdebugInspectionCoordinator?.stop()+ #endif}private func showLoginWindow() {@@ -114,9 +118,11 @@ final class DonkeyAppDelegate: NSObject, NSApplicationDelegate {overlayController = controllercontroller.show()+ #if DONKEY_DEBUG_OVERLAYlet debugInspectionCoordinator = DebugUIInspectionCoordinator()self.debugInspectionCoordinator = debugInspectionCoordinatordebugInspectionCoordinator.start()+ #endiflet runtimeOnboardingController = LocalRuntimeOnboardingWindowController()self.runtimeOnboardingController = runtimeOnboardingControllerdiff --git a/apps/Donkey/Sources/Donkey/LocalUIElementDetection/DebugUIInspectionCoordinator.swift b/apps/Donkey/Sources/Donkey/LocalUIElementDetection/DebugUIInspectionCoordinator.swiftindex effe3ef2..79ecfa50 100644--- a/apps/Donkey/Sources/Donkey/LocalUIElementDetection/DebugUIInspectionCoordinator.swift+++ b/apps/Donkey/Sources/Donkey/LocalUIElementDetection/DebugUIInspectionCoordinator.swift@@ -1,3 +1,5 @@+#if DONKEY_DEBUG_OVERLAY+import AppKitimport CryptoKitimport DonkeyAI@@ -884,3 +886,5 @@ private struct DebugUICompressedImage: Sendable {var contentType: Stringvar pixelSize: HotLoopSize}++#endifdiff --git a/apps/Donkey/Sources/Donkey/LocalUIElementDetection/DebugUIInspectionOverlayController.swift b/apps/Donkey/Sources/Donkey/LocalUIElementDetection/DebugUIInspectionOverlayController.swiftindex c8a263b7..924d6c38 100644--- a/apps/Donkey/Sources/Donkey/LocalUIElementDetection/DebugUIInspectionOverlayController.swift+++ b/apps/Donkey/Sources/Donkey/LocalUIElementDetection/DebugUIInspectionOverlayController.swift@@ -1,3 +1,5 @@+#if DONKEY_DEBUG_OVERLAY+import AppKitimport DonkeyContractsimport DonkeyRuntime@@ -348,3 +350,5 @@ private final class DebugUIInspectionRootView: NSView {nil}}++#endifdiff --git a/apps/Donkey/Sources/DonkeyAI/DebugUIInspectionFrameFusion.swift b/apps/Donkey/Sources/DonkeyAI/DebugUIInspectionFrameFusion.swiftindex 24756fb9..c4ee51e3 100644--- a/apps/Donkey/Sources/DonkeyAI/DebugUIInspectionFrameFusion.swift+++ b/apps/Donkey/Sources/DonkeyAI/DebugUIInspectionFrameFusion.swift@@ -1,3 +1,5 @@+#if DONKEY_DEBUG_OVERLAY+import DonkeyContractsimport Foundation@@ -127,3 +129,5 @@ public enum DebugUIInspectionFrameFusion {.joined(separator: " ")}}++#endifdiff --git a/apps/Donkey/Sources/DonkeyAI/DebugUIInspectionHostedAdapter.swift b/apps/Donkey/Sources/DonkeyAI/DebugUIInspectionHostedAdapter.swiftindex 45e6a25d..fda22656 100644--- a/apps/Donkey/Sources/DonkeyAI/DebugUIInspectionHostedAdapter.swift+++ b/apps/Donkey/Sources/DonkeyAI/DebugUIInspectionHostedAdapter.swift@@ -1,3 +1,5 @@+#if DONKEY_DEBUG_OVERLAY+import DonkeyContractsimport Foundation@@ -388,3 +390,5 @@ private struct RawDebugUICoordinateSpace: Decodable {var width: Doublevar height: Double}++#endifdiff --git a/apps/Donkey/Sources/DonkeyAI/ScreenshotParseDebugUIOverlayMapper.swift b/apps/Donkey/Sources/DonkeyAI/ScreenshotParseDebugUIOverlayMapper.swiftindex b97009bc..173859d7 100644--- a/apps/Donkey/Sources/DonkeyAI/ScreenshotParseDebugUIOverlayMapper.swift+++ b/apps/Donkey/Sources/DonkeyAI/ScreenshotParseDebugUIOverlayMapper.swift@@ -1,3 +1,5 @@+#if DONKEY_DEBUG_OVERLAY+import DonkeyContractsimport DonkeyRuntimeimport Foundation@@ -229,3 +231,5 @@ public enum ScreenshotParseDebugUIOverlayMapper {}}}++#endifdiff --git a/apps/Donkey/Sources/DonkeyRuntime/LocalUIElementDetection/DebugUIAccessibilityInspectionService.swift b/apps/Donkey/Sources/DonkeyRuntime/LocalUIElementDetection/DebugUIAccessibilityInspectionService.swiftindex 7c7bb883..5860cd76 100644--- a/apps/Donkey/Sources/DonkeyRuntime/LocalUIElementDetection/DebugUIAccessibilityInspectionService.swift+++ b/apps/Donkey/Sources/DonkeyRuntime/LocalUIElementDetection/DebugUIAccessibilityInspectionService.swift@@ -1,3 +1,5 @@+#if DONKEY_DEBUG_OVERLAY+@preconcurrency import AppKitimport CoreGraphicsimport CryptoKit@@ -1209,3 +1211,5 @@ private extension LocalUIElementDetectionTrace {return area > 0 && overlap / area >= 0.72}}++#endifdiff --git a/apps/Donkey/Sources/DonkeyRuntime/LocalUIElementDetection/DebugUIInspectionRuntime.swift b/apps/Donkey/Sources/DonkeyRuntime/LocalUIElementDetection/DebugUIInspectionRuntime.swiftindex 23662b54..950e04f5 100644--- a/apps/Donkey/Sources/DonkeyRuntime/LocalUIElementDetection/DebugUIInspectionRuntime.swift+++ b/apps/Donkey/Sources/DonkeyRuntime/LocalUIElementDetection/DebugUIInspectionRuntime.swift@@ -1,3 +1,5 @@+#if DONKEY_DEBUG_OVERLAY+@preconcurrency import AppKitimport CoreGraphicsimport CryptoKit@@ -843,3 +845,5 @@ protocol DebugUIScreenCapturing: Sendable {}extension DebugUIScreenCaptureService: DebugUIScreenCapturing {}++#endif