Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 6cd98d4

Browse files
committed
Add icon
1 parent c1a4e4c commit 6cd98d4

14 files changed

Lines changed: 113 additions & 9 deletions

File tree

β€ŽXGPT/SourceEditorCommand.swiftβ€Ž

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@ import AsyncHTTPClient
99
import Foundation
1010
import XcodeKit
1111
import OpenAIKit
12+
import SwiftAssistantCore
1213

13-
class SourceEditorCommand: NSObject, XCSourceEditorCommand {
1414

15+
enum SAErrors: Error {
16+
case tokenMissing
17+
}
18+
19+
class SourceEditorCommand: NSObject, XCSourceEditorCommand {
20+
1521
static let httpClient = HTTPClient(eventLoopGroupProvider: .createNew)
16-
let configuration = Configuration(apiKey: "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", organization: "")
22+
23+
let tokenManager = TokenManager()
1724

1825
func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void ) -> Void {
1926

@@ -23,8 +30,18 @@ class SourceEditorCommand: NSObject, XCSourceEditorCommand {
2330
return "\(line)"
2431
}.joined(separator: "\n")
2532

33+
guard let token = tokenManager.getToken() else {
34+
completionHandler(SAErrors.tokenMissing)
35+
return
36+
}
37+
38+
let configuration = Configuration(apiKey: token, organization: "")
39+
2640
let openAIClient = OpenAIKit.Client(httpClient: SourceEditorCommand.httpClient, configuration: configuration)
2741

42+
lines.removeAllObjects()
43+
lines.addObjects(from: ["// Gerando resposta"])
44+
2845
Task {
2946
do {
3047
let prompts = ["A linguagem de programaΓ§Γ£o usada Γ© Swift. \(prompt)"]

β€ŽXcodeGPT.xcodeproj/project.pbxprojβ€Ž

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
4B12189029C9280000F3A6AF /* TokenView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B12188F29C9280000F3A6AF /* TokenView.swift */; };
11+
4B12189229C92A0000F3A6AF /* TokenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B12189129C92A0000F3A6AF /* TokenViewModel.swift */; };
1012
4B58CC7A29BE2D6900CEAE59 /* XcodeGPTApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B58CC7929BE2D6900CEAE59 /* XcodeGPTApp.swift */; };
1113
4B58CC7C29BE2D6900CEAE59 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B58CC7B29BE2D6900CEAE59 /* HomeView.swift */; };
1214
4B58CC7E29BE2D6B00CEAE59 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4B58CC7D29BE2D6B00CEAE59 /* Assets.xcassets */; };
@@ -27,9 +29,9 @@
2729
4B8040A229C167A300522386 /* SwiftAssistantCoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8040A129C167A300522386 /* SwiftAssistantCoreTests.swift */; };
2830
4B8040A329C167A300522386 /* SwiftAssistantCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B80409529C167A300522386 /* SwiftAssistantCore.h */; settings = {ATTRIBUTES = (Public, ); }; };
2931
4B8040AA29C167B200522386 /* SwiftAssistantCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B80409329C167A300522386 /* SwiftAssistantCore.framework */; };
30-
4B8040AB29C167B200522386 /* SwiftAssistantCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B80409329C167A300522386 /* SwiftAssistantCore.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
32+
4B8040AB29C167B200522386 /* SwiftAssistantCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B80409329C167A300522386 /* SwiftAssistantCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3133
4B8040AF29C167C900522386 /* SwiftAssistantCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B80409329C167A300522386 /* SwiftAssistantCore.framework */; };
32-
4B8040B029C167C900522386 /* SwiftAssistantCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B80409329C167A300522386 /* SwiftAssistantCore.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
34+
4B8040B029C167C900522386 /* SwiftAssistantCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B80409329C167A300522386 /* SwiftAssistantCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3335
4B8040B529C167FE00522386 /* TokenManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8040B429C167FE00522386 /* TokenManager.swift */; };
3436
4B8040B729C1690E00522386 /* KeychainHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8040B629C1690E00522386 /* KeychainHelper.swift */; };
3537
4B8040BA29C16AD800522386 /* HomeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8040B929C16AD800522386 /* HomeViewModel.swift */; };
@@ -118,7 +120,9 @@
118120
/* End PBXCopyFilesBuildPhase section */
119121

120122
/* Begin PBXFileReference section */
121-
4B58CC7629BE2D6900CEAE59 /* XcodeGPT.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XcodeGPT.app; sourceTree = BUILT_PRODUCTS_DIR; };
123+
4B12188F29C9280000F3A6AF /* TokenView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenView.swift; sourceTree = "<group>"; };
124+
4B12189129C92A0000F3A6AF /* TokenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenViewModel.swift; sourceTree = "<group>"; };
125+
4B58CC7629BE2D6900CEAE59 /* Swift Assistant.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Swift Assistant.app"; sourceTree = BUILT_PRODUCTS_DIR; };
122126
4B58CC7929BE2D6900CEAE59 /* XcodeGPTApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcodeGPTApp.swift; sourceTree = "<group>"; };
123127
4B58CC7B29BE2D6900CEAE59 /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
124128
4B58CC7D29BE2D6B00CEAE59 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -199,6 +203,15 @@
199203
/* End PBXFrameworksBuildPhase section */
200204

201205
/* Begin PBXGroup section */
206+
4B12188E29C927EC00F3A6AF /* TokenView */ = {
207+
isa = PBXGroup;
208+
children = (
209+
4B12188F29C9280000F3A6AF /* TokenView.swift */,
210+
4B12189129C92A0000F3A6AF /* TokenViewModel.swift */,
211+
);
212+
path = TokenView;
213+
sourceTree = "<group>";
214+
};
202215
4B58CC6D29BE2D6900CEAE59 = {
203216
isa = PBXGroup;
204217
children = (
@@ -216,7 +229,7 @@
216229
4B58CC7729BE2D6900CEAE59 /* Products */ = {
217230
isa = PBXGroup;
218231
children = (
219-
4B58CC7629BE2D6900CEAE59 /* XcodeGPT.app */,
232+
4B58CC7629BE2D6900CEAE59 /* Swift Assistant.app */,
220233
4B58CC8729BE2D6C00CEAE59 /* XcodeGPTTests.xctest */,
221234
4B58CC9129BE2D6C00CEAE59 /* XcodeGPTUITests.xctest */,
222235
4B58CCA829BE2DBE00CEAE59 /* SwiftAI.appex */,
@@ -229,6 +242,7 @@
229242
4B58CC7829BE2D6900CEAE59 /* XcodeGPT */ = {
230243
isa = PBXGroup;
231244
children = (
245+
4B12188E29C927EC00F3A6AF /* TokenView */,
232246
4B8040B829C16ACA00522386 /* HomeView */,
233247
4B58CC7929BE2D6900CEAE59 /* XcodeGPTApp.swift */,
234248
4B58CC7D29BE2D6B00CEAE59 /* Assets.xcassets */,
@@ -352,7 +366,7 @@
352366
);
353367
name = XcodeGPT;
354368
productName = XcodeGPT;
355-
productReference = 4B58CC7629BE2D6900CEAE59 /* XcodeGPT.app */;
369+
productReference = 4B58CC7629BE2D6900CEAE59 /* Swift Assistant.app */;
356370
productType = "com.apple.product-type.application";
357371
};
358372
4B58CC8629BE2D6C00CEAE59 /* XcodeGPTTests */ = {
@@ -561,6 +575,8 @@
561575
files = (
562576
4B58CC7C29BE2D6900CEAE59 /* HomeView.swift in Sources */,
563577
4B80408D29C157CC00522386 /* MenuCard.swift in Sources */,
578+
4B12189229C92A0000F3A6AF /* TokenViewModel.swift in Sources */,
579+
4B12189029C9280000F3A6AF /* TokenView.swift in Sources */,
564580
4B58CC7A29BE2D6900CEAE59 /* XcodeGPTApp.swift in Sources */,
565581
4B8040BA29C16AD800522386 /* HomeViewModel.swift in Sources */,
566582
);
@@ -700,6 +716,7 @@
700716
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
701717
MTL_FAST_MATH = YES;
702718
ONLY_ACTIVE_ARCH = YES;
719+
PRODUCT_NAME = "Swift Assistant";
703720
SDKROOT = macosx;
704721
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
705722
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -753,6 +770,7 @@
753770
MACOSX_DEPLOYMENT_TARGET = 12.4;
754771
MTL_ENABLE_DEBUG_INFO = NO;
755772
MTL_FAST_MATH = YES;
773+
PRODUCT_NAME = "Swift Assistant";
756774
SDKROOT = macosx;
757775
SWIFT_COMPILATION_MODE = wholemodule;
758776
SWIFT_OPTIMIZATION_LEVEL = "-O";
@@ -784,7 +802,7 @@
784802
);
785803
MARKETING_VERSION = 1.0;
786804
PRODUCT_BUNDLE_IDENTIFIER = dev.muriloaraujo.XcodeGPT;
787-
PRODUCT_NAME = "$(TARGET_NAME)";
805+
PRODUCT_NAME = "Swift Assistant";
788806
SWIFT_EMIT_LOC_STRINGS = YES;
789807
SWIFT_VERSION = 5.0;
790808
};
@@ -815,7 +833,7 @@
815833
);
816834
MARKETING_VERSION = 1.0;
817835
PRODUCT_BUNDLE_IDENTIFIER = dev.muriloaraujo.XcodeGPT;
818-
PRODUCT_NAME = "$(TARGET_NAME)";
836+
PRODUCT_NAME = "Swift Assistant";
819837
SWIFT_EMIT_LOC_STRINGS = YES;
820838
SWIFT_VERSION = 5.0;
821839
};

β€ŽXcodeGPT/Assets.xcassets/AppIcon.appiconset/Contents.jsonβ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,61 @@
11
{
22
"images" : [
33
{
4+
"filename" : "Untitled-16.png",
45
"idiom" : "mac",
56
"scale" : "1x",
67
"size" : "16x16"
78
},
89
{
10+
"filename" : "Untitled-32.png",
911
"idiom" : "mac",
1012
"scale" : "2x",
1113
"size" : "16x16"
1214
},
1315
{
16+
"filename" : "Untitled-32.png",
1417
"idiom" : "mac",
1518
"scale" : "1x",
1619
"size" : "32x32"
1720
},
1821
{
22+
"filename" : "Untitled-64.png",
1923
"idiom" : "mac",
2024
"scale" : "2x",
2125
"size" : "32x32"
2226
},
2327
{
28+
"filename" : "Untitled-128.png",
2429
"idiom" : "mac",
2530
"scale" : "1x",
2631
"size" : "128x128"
2732
},
2833
{
34+
"filename" : "Untitled-256.png",
2935
"idiom" : "mac",
3036
"scale" : "2x",
3137
"size" : "128x128"
3238
},
3339
{
40+
"filename" : "Untitled-256.png",
3441
"idiom" : "mac",
3542
"scale" : "1x",
3643
"size" : "256x256"
3744
},
3845
{
46+
"filename" : "Untitled-512.png",
3947
"idiom" : "mac",
4048
"scale" : "2x",
4149
"size" : "256x256"
4250
},
4351
{
52+
"filename" : "Untitled-512.png",
4453
"idiom" : "mac",
4554
"scale" : "1x",
4655
"size" : "512x512"
4756
},
4857
{
58+
"filename" : "Untitled-1024.png",
4959
"idiom" : "mac",
5060
"scale" : "2x",
5161
"size" : "512x512"
214 KB
Loading
11 KB
Loading
1.68 KB
Loading
27.9 KB
Loading
2.54 KB
Loading
74.6 KB
Loading
4.85 KB
Loading

0 commit comments

Comments
Β (0)