native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Embed Ghostty and add release_fast build tooling

khoi ea0c6bd4

+1028
+64
.gitignore
··· 1 + # Xcode 2 + # 3 + # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 + 5 + ## User settings 6 + xcuserdata/ 7 + 8 + ## Obj-C/Swift specific 9 + *.hmap 10 + 11 + ## App packaging 12 + *.ipa 13 + *.dSYM.zip 14 + *.dSYM 15 + 16 + ## Playgrounds 17 + timeline.xctimeline 18 + playground.xcworkspace 19 + 20 + # Swift Package Manager 21 + # 22 + # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 23 + # Packages/ 24 + # Package.pins 25 + # Package.resolved 26 + # *.xcodeproj 27 + # 28 + # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 29 + # hence it is not needed unless you have added a package configuration file to your project 30 + # .swiftpm 31 + 32 + .build/ 33 + 34 + # CocoaPods 35 + # 36 + # We recommend against adding the Pods directory to your .gitignore. However 37 + # you should judge for yourself, the pros and cons are mentioned at: 38 + # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 39 + # 40 + # Pods/ 41 + # 42 + # Add this line if you want to avoid checking in source code from the Xcode workspace 43 + # *.xcworkspace 44 + 45 + # Carthage 46 + # 47 + # Add this line if you want to avoid checking in source code from Carthage dependencies. 48 + # Carthage/Checkouts 49 + 50 + Carthage/Build/ 51 + 52 + # fastlane 53 + # 54 + # It is recommended to not store the screenshots in the git repo. 55 + # Instead, use fastlane to re-generate the screenshots whenever they are needed. 56 + # For more information about the recommended setup visit: 57 + # https://docs.fastlane.tools/best-practices/source-control/#source-control 58 + 59 + fastlane/report.xml 60 + fastlane/Preview.html 61 + fastlane/screenshots/**/*.png 62 + fastlane/test_output 63 + 64 + Frameworks/GhosttyKit.xcframework
+3
.gitmodules
··· 1 + [submodule "ThirdParty/ghostty"] 2 + path = ThirdParty/ghostty 3 + url = https://github.com/ghostty-org/ghostty
+1
.tool-versions
··· 1 + zig 0.15.2
Frameworks/.keep

This is a binary file and will not be displayed.

+17
Makefile
··· 1 + # Derived values (DO NOT TOUCH). 2 + CURRENT_MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) 3 + CURRENT_MAKEFILE_DIR := $(patsubst %/,%,$(dir $(CURRENT_MAKEFILE_PATH))) 4 + 5 + .DEFAULT_GOAL := help 6 + .PHONY: serve build-ghostty-xcframework 7 + 8 + help: # Display this help. 9 + @-+echo "Run make with one of the following targets:" 10 + @-+echo 11 + @-+grep -Eh "^[a-z-]+:.*#" $(CURRENT_MAKEFILE_PATH) | sed -E 's/^(.*:)(.*#+)(.*)/ \1 @@@ \3 /' | column -t -s "@@@" 12 + 13 + build-ghostty-xcframework: # Build ghostty framework 14 + @cd $(CURRENT_MAKEFILE_DIR) && git submodule update --init --recursive 15 + @cd $(CURRENT_MAKEFILE_DIR) && mise install 16 + @cd $(CURRENT_MAKEFILE_DIR)/ThirdParty/ghostty && mise exec -- zig build -Doptimize=ReleaseFast -Demit-xcframework=true -Dsentry=false 17 + @cd $(CURRENT_MAKEFILE_DIR) && rsync -a ThirdParty/ghostty/macos/GhosttyKit.xcframework Frameworks
+387
supacode.xcodeproj/project.pbxproj
··· 1 + // !$*UTF8*$! 2 + { 3 + archiveVersion = 1; 4 + classes = { 5 + }; 6 + objectVersion = 77; 7 + objects = { 8 + 9 + /* Begin PBXBuildFile section */ 10 + D6A1CB312F1F4ABF004FDABD /* GhosttyKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6A1CB2F2F1F4A48004FDABD /* GhosttyKit.xcframework */; }; 11 + D6A1CB362F1F4ACB004FDABD /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6A1CB342F1F4AC2004FDABD /* Carbon.framework */; }; 12 + /* End PBXBuildFile section */ 13 + 14 + /* Begin PBXFileReference section */ 15 + D69CE04A2F1F378200584C57 /* supacode.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = supacode.app; sourceTree = BUILT_PRODUCTS_DIR; }; 16 + D6A1CB2F2F1F4A48004FDABD /* GhosttyKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = GhosttyKit.xcframework; sourceTree = "<group>"; }; 17 + D6A1CB342F1F4AC2004FDABD /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; 18 + /* End PBXFileReference section */ 19 + 20 + /* Begin PBXFileSystemSynchronizedRootGroup section */ 21 + D69CE04C2F1F378200584C57 /* supacode */ = { 22 + isa = PBXFileSystemSynchronizedRootGroup; 23 + path = supacode; 24 + sourceTree = "<group>"; 25 + }; 26 + /* End PBXFileSystemSynchronizedRootGroup section */ 27 + 28 + /* Begin PBXFrameworksBuildPhase section */ 29 + D69CE0472F1F378200584C57 /* Frameworks */ = { 30 + isa = PBXFrameworksBuildPhase; 31 + buildActionMask = 2147483647; 32 + files = ( 33 + D6A1CB312F1F4ABF004FDABD /* GhosttyKit.xcframework in Frameworks */, 34 + D6A1CB362F1F4ACB004FDABD /* Carbon.framework in Frameworks */, 35 + ); 36 + runOnlyForDeploymentPostprocessing = 0; 37 + }; 38 + /* End PBXFrameworksBuildPhase section */ 39 + 40 + /* Begin PBXGroup section */ 41 + D69CE0412F1F378200584C57 = { 42 + isa = PBXGroup; 43 + children = ( 44 + D69CE04C2F1F378200584C57 /* supacode */, 45 + D69CE04B2F1F378200584C57 /* Products */, 46 + D6A1CB2E2F1F4A36004FDABD /* Frameworks */, 47 + ); 48 + sourceTree = "<group>"; 49 + }; 50 + D69CE04B2F1F378200584C57 /* Products */ = { 51 + isa = PBXGroup; 52 + children = ( 53 + D69CE04A2F1F378200584C57 /* supacode.app */, 54 + ); 55 + name = Products; 56 + sourceTree = "<group>"; 57 + }; 58 + D6A1CB2E2F1F4A36004FDABD /* Frameworks */ = { 59 + isa = PBXGroup; 60 + children = ( 61 + D6A1CB342F1F4AC2004FDABD /* Carbon.framework */, 62 + D6A1CB2F2F1F4A48004FDABD /* GhosttyKit.xcframework */, 63 + ); 64 + path = Frameworks; 65 + sourceTree = "<group>"; 66 + }; 67 + /* End PBXGroup section */ 68 + 69 + /* Begin PBXNativeTarget section */ 70 + D69CE0492F1F378200584C57 /* supacode */ = { 71 + isa = PBXNativeTarget; 72 + buildConfigurationList = D69CE0552F1F378200584C57 /* Build configuration list for PBXNativeTarget "supacode" */; 73 + buildPhases = ( 74 + D69CE0462F1F378200584C57 /* Sources */, 75 + D69CE0472F1F378200584C57 /* Frameworks */, 76 + D69CE0482F1F378200584C57 /* Resources */, 77 + ); 78 + buildRules = ( 79 + ); 80 + dependencies = ( 81 + ); 82 + fileSystemSynchronizedGroups = ( 83 + D69CE04C2F1F378200584C57 /* supacode */, 84 + ); 85 + name = supacode; 86 + packageProductDependencies = ( 87 + ); 88 + productName = supacode; 89 + productReference = D69CE04A2F1F378200584C57 /* supacode.app */; 90 + productType = "com.apple.product-type.application"; 91 + }; 92 + /* End PBXNativeTarget section */ 93 + 94 + /* Begin PBXProject section */ 95 + D69CE0422F1F378200584C57 /* Project object */ = { 96 + isa = PBXProject; 97 + attributes = { 98 + BuildIndependentTargetsInParallel = 1; 99 + LastSwiftUpdateCheck = 2600; 100 + LastUpgradeCheck = 2600; 101 + TargetAttributes = { 102 + D69CE0492F1F378200584C57 = { 103 + CreatedOnToolsVersion = 26.0; 104 + }; 105 + }; 106 + }; 107 + buildConfigurationList = D69CE0452F1F378200584C57 /* Build configuration list for PBXProject "supacode" */; 108 + developmentRegion = en; 109 + hasScannedForEncodings = 0; 110 + knownRegions = ( 111 + en, 112 + Base, 113 + ); 114 + mainGroup = D69CE0412F1F378200584C57; 115 + minimizedProjectReferenceProxies = 1; 116 + preferredProjectObjectVersion = 77; 117 + productRefGroup = D69CE04B2F1F378200584C57 /* Products */; 118 + projectDirPath = ""; 119 + projectRoot = ""; 120 + targets = ( 121 + D69CE0492F1F378200584C57 /* supacode */, 122 + ); 123 + }; 124 + /* End PBXProject section */ 125 + 126 + /* Begin PBXResourcesBuildPhase section */ 127 + D69CE0482F1F378200584C57 /* Resources */ = { 128 + isa = PBXResourcesBuildPhase; 129 + buildActionMask = 2147483647; 130 + files = ( 131 + ); 132 + runOnlyForDeploymentPostprocessing = 0; 133 + }; 134 + /* End PBXResourcesBuildPhase section */ 135 + 136 + /* Begin PBXSourcesBuildPhase section */ 137 + D69CE0462F1F378200584C57 /* Sources */ = { 138 + isa = PBXSourcesBuildPhase; 139 + buildActionMask = 2147483647; 140 + files = ( 141 + ); 142 + runOnlyForDeploymentPostprocessing = 0; 143 + }; 144 + /* End PBXSourcesBuildPhase section */ 145 + 146 + /* Begin XCBuildConfiguration section */ 147 + D69CE0532F1F378200584C57 /* Debug */ = { 148 + isa = XCBuildConfiguration; 149 + buildSettings = { 150 + ALWAYS_SEARCH_USER_PATHS = NO; 151 + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 152 + CLANG_ANALYZER_NONNULL = YES; 153 + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 154 + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 155 + CLANG_ENABLE_MODULES = YES; 156 + CLANG_ENABLE_OBJC_ARC = YES; 157 + CLANG_ENABLE_OBJC_WEAK = YES; 158 + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 159 + CLANG_WARN_BOOL_CONVERSION = YES; 160 + CLANG_WARN_COMMA = YES; 161 + CLANG_WARN_CONSTANT_CONVERSION = YES; 162 + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 163 + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 164 + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 165 + CLANG_WARN_EMPTY_BODY = YES; 166 + CLANG_WARN_ENUM_CONVERSION = YES; 167 + CLANG_WARN_INFINITE_RECURSION = YES; 168 + CLANG_WARN_INT_CONVERSION = YES; 169 + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 170 + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 171 + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 172 + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 173 + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 174 + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 175 + CLANG_WARN_STRICT_PROTOTYPES = YES; 176 + CLANG_WARN_SUSPICIOUS_MOVE = YES; 177 + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 178 + CLANG_WARN_UNREACHABLE_CODE = YES; 179 + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 180 + COPY_PHASE_STRIP = NO; 181 + DEBUG_INFORMATION_FORMAT = dwarf; 182 + DEVELOPMENT_TEAM = 9ZLSJ2GN2B; 183 + ENABLE_STRICT_OBJC_MSGSEND = YES; 184 + ENABLE_TESTABILITY = YES; 185 + ENABLE_USER_SCRIPT_SANDBOXING = YES; 186 + GCC_C_LANGUAGE_STANDARD = gnu17; 187 + GCC_DYNAMIC_NO_PIC = NO; 188 + GCC_NO_COMMON_BLOCKS = YES; 189 + GCC_OPTIMIZATION_LEVEL = 0; 190 + GCC_PREPROCESSOR_DEFINITIONS = ( 191 + "DEBUG=1", 192 + "$(inherited)", 193 + ); 194 + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 195 + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 196 + GCC_WARN_UNDECLARED_SELECTOR = YES; 197 + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 198 + GCC_WARN_UNUSED_FUNCTION = YES; 199 + GCC_WARN_UNUSED_VARIABLE = YES; 200 + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 201 + MACOSX_DEPLOYMENT_TARGET = 26.0; 202 + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 203 + MTL_FAST_MATH = YES; 204 + ONLY_ACTIVE_ARCH = YES; 205 + SDKROOT = macosx; 206 + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 207 + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 208 + }; 209 + name = Debug; 210 + }; 211 + D69CE0542F1F378200584C57 /* Release */ = { 212 + isa = XCBuildConfiguration; 213 + buildSettings = { 214 + ALWAYS_SEARCH_USER_PATHS = NO; 215 + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 216 + CLANG_ANALYZER_NONNULL = YES; 217 + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 218 + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 219 + CLANG_ENABLE_MODULES = YES; 220 + CLANG_ENABLE_OBJC_ARC = YES; 221 + CLANG_ENABLE_OBJC_WEAK = YES; 222 + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 223 + CLANG_WARN_BOOL_CONVERSION = YES; 224 + CLANG_WARN_COMMA = YES; 225 + CLANG_WARN_CONSTANT_CONVERSION = YES; 226 + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 227 + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 228 + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 229 + CLANG_WARN_EMPTY_BODY = YES; 230 + CLANG_WARN_ENUM_CONVERSION = YES; 231 + CLANG_WARN_INFINITE_RECURSION = YES; 232 + CLANG_WARN_INT_CONVERSION = YES; 233 + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 234 + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 235 + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 236 + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 237 + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 238 + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 239 + CLANG_WARN_STRICT_PROTOTYPES = YES; 240 + CLANG_WARN_SUSPICIOUS_MOVE = YES; 241 + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 242 + CLANG_WARN_UNREACHABLE_CODE = YES; 243 + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 244 + COPY_PHASE_STRIP = NO; 245 + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 246 + DEVELOPMENT_TEAM = 9ZLSJ2GN2B; 247 + ENABLE_NS_ASSERTIONS = NO; 248 + ENABLE_STRICT_OBJC_MSGSEND = YES; 249 + ENABLE_USER_SCRIPT_SANDBOXING = YES; 250 + GCC_C_LANGUAGE_STANDARD = gnu17; 251 + GCC_NO_COMMON_BLOCKS = YES; 252 + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 253 + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 254 + GCC_WARN_UNDECLARED_SELECTOR = YES; 255 + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 256 + GCC_WARN_UNUSED_FUNCTION = YES; 257 + GCC_WARN_UNUSED_VARIABLE = YES; 258 + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 259 + MACOSX_DEPLOYMENT_TARGET = 26.0; 260 + MTL_ENABLE_DEBUG_INFO = NO; 261 + MTL_FAST_MATH = YES; 262 + SDKROOT = macosx; 263 + SWIFT_COMPILATION_MODE = wholemodule; 264 + }; 265 + name = Release; 266 + }; 267 + D69CE0562F1F378200584C57 /* Debug */ = { 268 + isa = XCBuildConfiguration; 269 + buildSettings = { 270 + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 271 + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 272 + AUTOMATION_APPLE_EVENTS = NO; 273 + CODE_SIGN_STYLE = Automatic; 274 + COMBINE_HIDPI_IMAGES = YES; 275 + CURRENT_PROJECT_VERSION = 1; 276 + DEVELOPMENT_TEAM = 9ZLSJ2GN2B; 277 + ENABLE_APP_SANDBOX = NO; 278 + ENABLE_HARDENED_RUNTIME = NO; 279 + ENABLE_PREVIEWS = YES; 280 + ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO; 281 + ENABLE_RESOURCE_ACCESS_CALENDARS = NO; 282 + ENABLE_RESOURCE_ACCESS_CAMERA = NO; 283 + ENABLE_RESOURCE_ACCESS_CONTACTS = NO; 284 + ENABLE_RESOURCE_ACCESS_LOCATION = NO; 285 + ENABLE_RESOURCE_ACCESS_PHOTO_LIBRARY = NO; 286 + GENERATE_INFOPLIST_FILE = YES; 287 + INFOPLIST_KEY_NSHumanReadableCopyright = ""; 288 + LD_RUNPATH_SEARCH_PATHS = ( 289 + "$(inherited)", 290 + "@executable_path/../Frameworks", 291 + ); 292 + MARKETING_VERSION = 1.0; 293 + OTHER_LDFLAGS = ( 294 + "$(inherited)", 295 + "-lc++", 296 + ); 297 + PRODUCT_BUNDLE_IDENTIFIER = app.supabit.supacode; 298 + PRODUCT_NAME = "$(TARGET_NAME)"; 299 + REGISTER_APP_GROUPS = YES; 300 + RUNTIME_EXCEPTION_ALLOW_DYLD_ENVIRONMENT_VARIABLES = NO; 301 + RUNTIME_EXCEPTION_ALLOW_JIT = NO; 302 + RUNTIME_EXCEPTION_ALLOW_UNSIGNED_EXECUTABLE_MEMORY = NO; 303 + RUNTIME_EXCEPTION_DEBUGGING_TOOL = NO; 304 + RUNTIME_EXCEPTION_DISABLE_EXECUTABLE_PAGE_PROTECTION = NO; 305 + RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = NO; 306 + STRING_CATALOG_GENERATE_SYMBOLS = YES; 307 + SWIFT_APPROACHABLE_CONCURRENCY = YES; 308 + SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; 309 + SWIFT_EMIT_LOC_STRINGS = YES; 310 + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; 311 + SWIFT_VERSION = 5.0; 312 + }; 313 + name = Debug; 314 + }; 315 + D69CE0572F1F378200584C57 /* Release */ = { 316 + isa = XCBuildConfiguration; 317 + buildSettings = { 318 + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 319 + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 320 + AUTOMATION_APPLE_EVENTS = NO; 321 + CODE_SIGN_STYLE = Automatic; 322 + COMBINE_HIDPI_IMAGES = YES; 323 + CURRENT_PROJECT_VERSION = 1; 324 + DEVELOPMENT_TEAM = 9ZLSJ2GN2B; 325 + ENABLE_APP_SANDBOX = NO; 326 + ENABLE_HARDENED_RUNTIME = NO; 327 + ENABLE_PREVIEWS = YES; 328 + ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO; 329 + ENABLE_RESOURCE_ACCESS_CALENDARS = NO; 330 + ENABLE_RESOURCE_ACCESS_CAMERA = NO; 331 + ENABLE_RESOURCE_ACCESS_CONTACTS = NO; 332 + ENABLE_RESOURCE_ACCESS_LOCATION = NO; 333 + ENABLE_RESOURCE_ACCESS_PHOTO_LIBRARY = NO; 334 + GENERATE_INFOPLIST_FILE = YES; 335 + INFOPLIST_KEY_NSHumanReadableCopyright = ""; 336 + LD_RUNPATH_SEARCH_PATHS = ( 337 + "$(inherited)", 338 + "@executable_path/../Frameworks", 339 + ); 340 + MARKETING_VERSION = 1.0; 341 + OTHER_LDFLAGS = ( 342 + "$(inherited)", 343 + "-lc++", 344 + ); 345 + PRODUCT_BUNDLE_IDENTIFIER = app.supabit.supacode; 346 + PRODUCT_NAME = "$(TARGET_NAME)"; 347 + REGISTER_APP_GROUPS = YES; 348 + RUNTIME_EXCEPTION_ALLOW_DYLD_ENVIRONMENT_VARIABLES = NO; 349 + RUNTIME_EXCEPTION_ALLOW_JIT = NO; 350 + RUNTIME_EXCEPTION_ALLOW_UNSIGNED_EXECUTABLE_MEMORY = NO; 351 + RUNTIME_EXCEPTION_DEBUGGING_TOOL = NO; 352 + RUNTIME_EXCEPTION_DISABLE_EXECUTABLE_PAGE_PROTECTION = NO; 353 + RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = NO; 354 + STRING_CATALOG_GENERATE_SYMBOLS = YES; 355 + SWIFT_APPROACHABLE_CONCURRENCY = YES; 356 + SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; 357 + SWIFT_EMIT_LOC_STRINGS = YES; 358 + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; 359 + SWIFT_VERSION = 5.0; 360 + }; 361 + name = Release; 362 + }; 363 + /* End XCBuildConfiguration section */ 364 + 365 + /* Begin XCConfigurationList section */ 366 + D69CE0452F1F378200584C57 /* Build configuration list for PBXProject "supacode" */ = { 367 + isa = XCConfigurationList; 368 + buildConfigurations = ( 369 + D69CE0532F1F378200584C57 /* Debug */, 370 + D69CE0542F1F378200584C57 /* Release */, 371 + ); 372 + defaultConfigurationIsVisible = 0; 373 + defaultConfigurationName = Release; 374 + }; 375 + D69CE0552F1F378200584C57 /* Build configuration list for PBXNativeTarget "supacode" */ = { 376 + isa = XCConfigurationList; 377 + buildConfigurations = ( 378 + D69CE0562F1F378200584C57 /* Debug */, 379 + D69CE0572F1F378200584C57 /* Release */, 380 + ); 381 + defaultConfigurationIsVisible = 0; 382 + defaultConfigurationName = Release; 383 + }; 384 + /* End XCConfigurationList section */ 385 + }; 386 + rootObject = D69CE0422F1F378200584C57 /* Project object */; 387 + }
+7
supacode.xcodeproj/project.xcworkspace/contents.xcworkspacedata
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <Workspace 3 + version = "1.0"> 4 + <FileRef 5 + location = "self:"> 6 + </FileRef> 7 + </Workspace>
+11
supacode/Assets.xcassets/AccentColor.colorset/Contents.json
··· 1 + { 2 + "colors" : [ 3 + { 4 + "idiom" : "universal" 5 + } 6 + ], 7 + "info" : { 8 + "author" : "xcode", 9 + "version" : 1 10 + } 11 + }
+58
supacode/Assets.xcassets/AppIcon.appiconset/Contents.json
··· 1 + { 2 + "images" : [ 3 + { 4 + "idiom" : "mac", 5 + "scale" : "1x", 6 + "size" : "16x16" 7 + }, 8 + { 9 + "idiom" : "mac", 10 + "scale" : "2x", 11 + "size" : "16x16" 12 + }, 13 + { 14 + "idiom" : "mac", 15 + "scale" : "1x", 16 + "size" : "32x32" 17 + }, 18 + { 19 + "idiom" : "mac", 20 + "scale" : "2x", 21 + "size" : "32x32" 22 + }, 23 + { 24 + "idiom" : "mac", 25 + "scale" : "1x", 26 + "size" : "128x128" 27 + }, 28 + { 29 + "idiom" : "mac", 30 + "scale" : "2x", 31 + "size" : "128x128" 32 + }, 33 + { 34 + "idiom" : "mac", 35 + "scale" : "1x", 36 + "size" : "256x256" 37 + }, 38 + { 39 + "idiom" : "mac", 40 + "scale" : "2x", 41 + "size" : "256x256" 42 + }, 43 + { 44 + "idiom" : "mac", 45 + "scale" : "1x", 46 + "size" : "512x512" 47 + }, 48 + { 49 + "idiom" : "mac", 50 + "scale" : "2x", 51 + "size" : "512x512" 52 + } 53 + ], 54 + "info" : { 55 + "author" : "xcode", 56 + "version" : 1 57 + } 58 + }
+6
supacode/Assets.xcassets/Contents.json
··· 1 + { 2 + "info" : { 3 + "author" : "xcode", 4 + "version" : 1 5 + } 6 + }
+18
supacode/ContentView.swift
··· 1 + // 2 + // ContentView.swift 3 + // supacode 4 + // 5 + // Created by khoi on 20/1/26. 6 + // 7 + 8 + import SwiftUI 9 + 10 + struct ContentView: View { 11 + let runtime: GhosttyRuntime 12 + 13 + var body: some View { 14 + GhosttyTerminalView(runtime: runtime) 15 + .frame(maxWidth: .infinity, maxHeight: .infinity) 16 + .background(Color.black) 17 + } 18 + }
+162
supacode/GhosttyEmbed/GhosttyRuntime.swift
··· 1 + import AppKit 2 + import Combine 3 + import GhosttyKit 4 + 5 + final class GhosttyRuntime: ObservableObject { 6 + private var config: ghostty_config_t? 7 + private(set) var app: ghostty_app_t? 8 + private var observers: [NSObjectProtocol] = [] 9 + 10 + init() { 11 + guard let config = ghostty_config_new() else { 12 + preconditionFailure("ghostty_config_new failed") 13 + } 14 + self.config = config 15 + ghostty_config_load_default_files(config) 16 + ghostty_config_load_recursive_files(config) 17 + ghostty_config_finalize(config) 18 + 19 + var runtimeConfig = ghostty_runtime_config_s( 20 + userdata: Unmanaged.passUnretained(self).toOpaque(), 21 + supports_selection_clipboard: false, 22 + wakeup_cb: { userdata in GhosttyRuntime.wakeup(userdata) }, 23 + action_cb: { app, target, action in 24 + guard let app else { return false } 25 + return GhosttyRuntime.action(app, target: target, action: action) 26 + }, 27 + read_clipboard_cb: { userdata, loc, state in GhosttyRuntime.readClipboard(userdata, location: loc, state: state) }, 28 + confirm_read_clipboard_cb: { userdata, str, state, request in 29 + GhosttyRuntime.confirmReadClipboard(userdata, string: str, state: state, request: request) 30 + }, 31 + write_clipboard_cb: { userdata, loc, content, len, confirm in 32 + GhosttyRuntime.writeClipboard(userdata, location: loc, content: content, len: len, confirm: confirm) 33 + }, 34 + close_surface_cb: { userdata, processAlive in GhosttyRuntime.closeSurface(userdata, processAlive: processAlive) } 35 + ) 36 + 37 + guard let app = ghostty_app_new(&runtimeConfig, config) else { 38 + preconditionFailure("ghostty_app_new failed") 39 + } 40 + self.app = app 41 + 42 + let center = NotificationCenter.default 43 + observers.append(center.addObserver( 44 + forName: NSApplication.didBecomeActiveNotification, 45 + object: nil, 46 + queue: .main 47 + ) { [weak self] _ in 48 + self?.setAppFocus(true) 49 + }) 50 + observers.append(center.addObserver( 51 + forName: NSApplication.didResignActiveNotification, 52 + object: nil, 53 + queue: .main 54 + ) { [weak self] _ in 55 + self?.setAppFocus(false) 56 + }) 57 + } 58 + 59 + deinit { 60 + let center = NotificationCenter.default 61 + for observer in observers { 62 + center.removeObserver(observer) 63 + } 64 + if let app { 65 + ghostty_app_free(app) 66 + } 67 + if let config { 68 + ghostty_config_free(config) 69 + } 70 + } 71 + 72 + func setAppFocus(_ focused: Bool) { 73 + if let app { 74 + ghostty_app_set_focus(app, focused) 75 + } 76 + } 77 + 78 + func tick() { 79 + if let app { 80 + ghostty_app_tick(app) 81 + } 82 + } 83 + 84 + private static func runtime(from userdata: UnsafeMutableRawPointer?) -> GhosttyRuntime? { 85 + guard let userdata else { return nil } 86 + return Unmanaged<GhosttyRuntime>.fromOpaque(userdata).takeUnretainedValue() 87 + } 88 + 89 + private static func surfaceView(from userdata: UnsafeMutableRawPointer?) -> GhosttySurfaceView? { 90 + guard let userdata else { return nil } 91 + return Unmanaged<GhosttySurfaceView>.fromOpaque(userdata).takeUnretainedValue() 92 + } 93 + 94 + private static func wakeup(_ userdata: UnsafeMutableRawPointer?) { 95 + guard let runtime = runtime(from: userdata) else { return } 96 + DispatchQueue.main.async { 97 + runtime.tick() 98 + } 99 + } 100 + 101 + private static func action(_ app: ghostty_app_t, target: ghostty_target_s, action: ghostty_action_s) -> Bool { 102 + return false 103 + } 104 + 105 + private static func readClipboard( 106 + _ userdata: UnsafeMutableRawPointer?, 107 + location: ghostty_clipboard_e, 108 + state: UnsafeMutableRawPointer? 109 + ) { 110 + guard let surfaceView = surfaceView(from: userdata), let surface = surfaceView.surface else { return } 111 + DispatchQueue.main.async { 112 + let pasteboard = NSPasteboard.general 113 + let value = pasteboard.string(forType: .string) ?? "" 114 + value.withCString { ptr in 115 + ghostty_surface_complete_clipboard_request(surface, ptr, state, false) 116 + } 117 + } 118 + } 119 + 120 + private static func confirmReadClipboard( 121 + _ userdata: UnsafeMutableRawPointer?, 122 + string: UnsafePointer<CChar>?, 123 + state: UnsafeMutableRawPointer?, 124 + request: ghostty_clipboard_request_e 125 + ) { 126 + guard let surfaceView = surfaceView(from: userdata), let surface = surfaceView.surface else { return } 127 + guard let string else { return } 128 + DispatchQueue.main.async { 129 + ghostty_surface_complete_clipboard_request(surface, string, state, true) 130 + } 131 + } 132 + 133 + private static func writeClipboard( 134 + _ userdata: UnsafeMutableRawPointer?, 135 + location: ghostty_clipboard_e, 136 + content: UnsafePointer<ghostty_clipboard_content_s>?, 137 + len: Int, 138 + confirm: Bool 139 + ) { 140 + guard let content, len > 0 else { return } 141 + DispatchQueue.main.async { 142 + let pasteboard = NSPasteboard.general 143 + pasteboard.clearContents() 144 + var stringValue: String? 145 + for i in 0..<len { 146 + let item = content.advanced(by: i).pointee 147 + if let mime = item.mime, let data = item.data, String(cString: mime) == "text/plain" { 148 + stringValue = String(cString: data) 149 + break 150 + } 151 + } 152 + if let stringValue { 153 + pasteboard.setString(stringValue, forType: .string) 154 + } 155 + } 156 + } 157 + 158 + private static func closeSurface(_ userdata: UnsafeMutableRawPointer?, processAlive: Bool) { 159 + guard let surfaceView = surfaceView(from: userdata) else { return } 160 + surfaceView.closeSurface() 161 + } 162 + }
+254
supacode/GhosttyEmbed/GhosttySurfaceView.swift
··· 1 + import AppKit 2 + import GhosttyKit 3 + 4 + final class GhosttySurfaceView: NSView { 5 + private let runtime: GhosttyRuntime 6 + private(set) var surface: ghostty_surface_t? 7 + private var trackingArea: NSTrackingArea? 8 + private var lastBackingSize: CGSize = .zero 9 + private var lastModifierFlags: NSEvent.ModifierFlags = [] 10 + 11 + override var acceptsFirstResponder: Bool { true } 12 + 13 + init(runtime: GhosttyRuntime) { 14 + self.runtime = runtime 15 + super.init(frame: NSRect(x: 0, y: 0, width: 800, height: 600)) 16 + wantsLayer = true 17 + createSurface() 18 + } 19 + 20 + required init?(coder: NSCoder) { 21 + fatalError("init(coder:) is not supported") 22 + } 23 + 24 + deinit { 25 + closeSurface() 26 + } 27 + 28 + func closeSurface() { 29 + if let surface { 30 + ghostty_surface_free(surface) 31 + self.surface = nil 32 + } 33 + } 34 + 35 + override func viewDidMoveToWindow() { 36 + super.viewDidMoveToWindow() 37 + updateContentScale() 38 + updateSurfaceSize() 39 + } 40 + 41 + override func viewDidChangeBackingProperties() { 42 + super.viewDidChangeBackingProperties() 43 + updateContentScale() 44 + updateSurfaceSize() 45 + } 46 + 47 + override func layout() { 48 + super.layout() 49 + updateSurfaceSize() 50 + } 51 + 52 + override func updateTrackingAreas() { 53 + if let trackingArea { 54 + removeTrackingArea(trackingArea) 55 + } 56 + let area = NSTrackingArea( 57 + rect: bounds, 58 + options: [.mouseMoved, .activeInKeyWindow, .inVisibleRect], 59 + owner: self, 60 + userInfo: nil 61 + ) 62 + addTrackingArea(area) 63 + trackingArea = area 64 + } 65 + 66 + override func becomeFirstResponder() -> Bool { 67 + let result = super.becomeFirstResponder() 68 + if result { 69 + setSurfaceFocus(true) 70 + } 71 + return result 72 + } 73 + 74 + override func resignFirstResponder() -> Bool { 75 + let result = super.resignFirstResponder() 76 + if result { 77 + setSurfaceFocus(false) 78 + } 79 + return result 80 + } 81 + 82 + override func keyDown(with event: NSEvent) { 83 + let action = event.isARepeat ? GHOSTTY_ACTION_REPEAT : GHOSTTY_ACTION_PRESS 84 + sendKey(event: event, action: action) 85 + } 86 + 87 + override func keyUp(with event: NSEvent) { 88 + sendKey(event: event, action: GHOSTTY_ACTION_RELEASE) 89 + } 90 + 91 + override func flagsChanged(with event: NSEvent) { 92 + let relevant: NSEvent.ModifierFlags = [.shift, .control, .option, .command, .capsLock] 93 + let newFlags = event.modifierFlags.intersection(relevant) 94 + let oldFlags = lastModifierFlags 95 + lastModifierFlags = newFlags 96 + let pressed = newFlags.subtracting(oldFlags) 97 + let released = oldFlags.subtracting(newFlags) 98 + if !pressed.isEmpty { 99 + sendKey(event: event, action: GHOSTTY_ACTION_PRESS) 100 + } 101 + if !released.isEmpty { 102 + sendKey(event: event, action: GHOSTTY_ACTION_RELEASE) 103 + } 104 + } 105 + 106 + override func mouseMoved(with event: NSEvent) { 107 + sendMousePosition(event) 108 + } 109 + 110 + override func mouseDown(with event: NSEvent) { 111 + sendMouseButton(event, state: GHOSTTY_MOUSE_PRESS, button: GHOSTTY_MOUSE_LEFT) 112 + } 113 + 114 + override func mouseUp(with event: NSEvent) { 115 + sendMouseButton(event, state: GHOSTTY_MOUSE_RELEASE, button: GHOSTTY_MOUSE_LEFT) 116 + } 117 + 118 + override func rightMouseDown(with event: NSEvent) { 119 + sendMouseButton(event, state: GHOSTTY_MOUSE_PRESS, button: GHOSTTY_MOUSE_RIGHT) 120 + } 121 + 122 + override func rightMouseUp(with event: NSEvent) { 123 + sendMouseButton(event, state: GHOSTTY_MOUSE_RELEASE, button: GHOSTTY_MOUSE_RIGHT) 124 + } 125 + 126 + override func otherMouseDown(with event: NSEvent) { 127 + sendMouseButton(event, state: GHOSTTY_MOUSE_PRESS, button: GHOSTTY_MOUSE_MIDDLE) 128 + } 129 + 130 + override func otherMouseUp(with event: NSEvent) { 131 + sendMouseButton(event, state: GHOSTTY_MOUSE_RELEASE, button: GHOSTTY_MOUSE_MIDDLE) 132 + } 133 + 134 + override func mouseDragged(with event: NSEvent) { 135 + sendMousePosition(event) 136 + } 137 + 138 + override func rightMouseDragged(with event: NSEvent) { 139 + sendMousePosition(event) 140 + } 141 + 142 + override func otherMouseDragged(with event: NSEvent) { 143 + sendMousePosition(event) 144 + } 145 + 146 + override func scrollWheel(with event: NSEvent) { 147 + guard let surface else { return } 148 + ghostty_surface_mouse_scroll(surface, event.scrollingDeltaX, event.scrollingDeltaY, 0) 149 + } 150 + 151 + func updateSurfaceSize() { 152 + guard let surface else { return } 153 + let backingSize = convertToBacking(bounds.size) 154 + if backingSize == lastBackingSize { 155 + return 156 + } 157 + lastBackingSize = backingSize 158 + let width = UInt32(max(1, Int(backingSize.width.rounded(.down)))) 159 + let height = UInt32(max(1, Int(backingSize.height.rounded(.down)))) 160 + ghostty_surface_set_size(surface, width, height) 161 + } 162 + 163 + private func createSurface() { 164 + guard let app = runtime.app else { return } 165 + var config = ghostty_surface_config_new() 166 + config.userdata = Unmanaged.passUnretained(self).toOpaque() 167 + config.platform_tag = GHOSTTY_PLATFORM_MACOS 168 + config.platform = ghostty_platform_u(macos: ghostty_platform_macos_s( 169 + nsview: Unmanaged.passUnretained(self).toOpaque() 170 + )) 171 + config.scale_factor = backingScaleFactor() 172 + config.context = GHOSTTY_SURFACE_CONTEXT_WINDOW 173 + surface = ghostty_surface_new(app, &config) 174 + updateSurfaceSize() 175 + } 176 + 177 + private func updateContentScale() { 178 + guard let surface else { return } 179 + let scale = backingScaleFactor() 180 + ghostty_surface_set_content_scale(surface, scale, scale) 181 + } 182 + 183 + private func backingScaleFactor() -> Double { 184 + if let window { 185 + return window.backingScaleFactor 186 + } 187 + if let screen = NSScreen.main { 188 + return screen.backingScaleFactor 189 + } 190 + return 2.0 191 + } 192 + 193 + private func setSurfaceFocus(_ focused: Bool) { 194 + guard let surface else { return } 195 + ghostty_surface_set_focus(surface, focused) 196 + } 197 + 198 + private func sendKey(event: NSEvent, action: ghostty_input_action_e) { 199 + guard let surface else { return } 200 + var key = ghostty_input_key_s() 201 + key.action = action 202 + key.keycode = UInt32(event.keyCode) 203 + key.mods = ghosttyMods(event.modifierFlags) 204 + key.consumed_mods = key.mods 205 + key.unshifted_codepoint = unshiftedCodepoint(for: event) 206 + key.composing = false 207 + if let text = event.characters, !text.isEmpty { 208 + text.withCString { ptr in 209 + key.text = ptr 210 + _ = ghostty_surface_key(surface, key) 211 + } 212 + } else { 213 + key.text = nil 214 + _ = ghostty_surface_key(surface, key) 215 + } 216 + } 217 + 218 + private func unshiftedCodepoint(for event: NSEvent) -> UInt32 { 219 + if let chars = event.charactersIgnoringModifiers, 220 + let scalar = chars.unicodeScalars.first { 221 + return scalar.value 222 + } 223 + return 0 224 + } 225 + 226 + private func sendMousePosition(_ event: NSEvent) { 227 + guard let surface else { return } 228 + let point = convert(event.locationInWindow, from: nil) 229 + let backing = convertToBacking(point) 230 + let mods = ghosttyMods(event.modifierFlags) 231 + ghostty_surface_mouse_pos(surface, backing.x, backing.y, mods) 232 + } 233 + 234 + private func sendMouseButton( 235 + _ event: NSEvent, 236 + state: ghostty_input_mouse_state_e, 237 + button: ghostty_input_mouse_button_e 238 + ) { 239 + guard let surface else { return } 240 + let mods = ghosttyMods(event.modifierFlags) 241 + ghostty_surface_mouse_button(surface, state, button, mods) 242 + } 243 + 244 + private func ghosttyMods(_ flags: NSEvent.ModifierFlags) -> ghostty_input_mods_e { 245 + var mods: UInt32 = GHOSTTY_MODS_NONE.rawValue 246 + if flags.contains(.shift) { mods |= GHOSTTY_MODS_SHIFT.rawValue } 247 + if flags.contains(.control) { mods |= GHOSTTY_MODS_CTRL.rawValue } 248 + if flags.contains(.option) { mods |= GHOSTTY_MODS_ALT.rawValue } 249 + if flags.contains(.command) { mods |= GHOSTTY_MODS_SUPER.rawValue } 250 + if flags.contains(.capsLock) { mods |= GHOSTTY_MODS_CAPS.rawValue } 251 + return ghostty_input_mods_e(mods) 252 + } 253 + 254 + }
+13
supacode/GhosttyEmbed/GhosttyTerminalView.swift
··· 1 + import SwiftUI 2 + 3 + struct GhosttyTerminalView: NSViewRepresentable { 4 + @ObservedObject var runtime: GhosttyRuntime 5 + 6 + func makeNSView(context: Context) -> GhosttySurfaceView { 7 + GhosttySurfaceView(runtime: runtime) 8 + } 9 + 10 + func updateNSView(_ view: GhosttySurfaceView, context: Context) { 11 + view.updateSurfaceSize() 12 + } 13 + }
+27
supacode/supacodeApp.swift
··· 1 + // 2 + // supacodeApp.swift 3 + // supacode 4 + // 5 + // Created by khoi on 20/1/26. 6 + // 7 + 8 + import SwiftUI 9 + import GhosttyKit 10 + 11 + @main 12 + struct supacodeApp: App { 13 + @StateObject private var ghostty: GhosttyRuntime 14 + 15 + init() { 16 + if ghostty_init(UInt(CommandLine.argc), CommandLine.unsafeArgv) != GHOSTTY_SUCCESS { 17 + preconditionFailure("ghostty_init failed") 18 + } 19 + _ghostty = StateObject(wrappedValue: GhosttyRuntime()) 20 + } 21 + 22 + var body: some Scene { 23 + WindowGroup { 24 + ContentView(runtime: ghostty) 25 + } 26 + } 27 + }