Skip to content

Commit 9e72e16

Browse files
committed
fixed permission bug, revamped Local LLM Settings
1 parent 9aa0e66 commit 9e72e16

File tree

15 files changed

+2682
-845
lines changed

15 files changed

+2682
-845
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0
1+
4.1

macOS/README.md

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,9 @@ Core functionality works well, and it is still an ongoing work in progress.
66

77
---
88

9-
## Working Features
10-
- All of the tools, including the new response windows and the manual chat option.
11-
- Input Window even when no text is selected
12-
- Gemini, OpenAI and Local LLM Support.
13-
- The Gradient Theme (Dark Mode and Light Mode are supported).
14-
- Initial Setup, Settings, and About pages.
15-
16-
---
17-
18-
## Not Yet Available
19-
- All of the original port's features are now available; however, more optimizations and improvements are coming soon.
20-
21-
---
22-
239
## System Requirements
24-
Due to the accessibility features the app uses (e.g., automatically selecting the window containing the text and pasting the updated version), **the minimum macOS version required is 14.0**.
10+
Due to the accessibility features the app uses (e.g., automatically selecting the window containing the text and pasting the updated version), **the minimum macOS version required is 14.0**. You also have to allow this accessibility access in System Settings.
11+
> System Settings → Privacy & Security → Accessibility → Press the plus (+) button → Add *writing-tools* and enable access.
2512
2613
---
2714

@@ -72,14 +59,10 @@ This guide will help you properly set up the Writing Tools macOS project in Xcod
7259

7360
## Credits
7461

75-
The macOS port is being developed by **Aryamirsepasi**.
76-
77-
GitHub: [https://github.com/Aryamirsepasi](https://github.com/Aryamirsepasi)
78-
79-
The amazing picture processing functionality was created by **Joaov41**
80-
GitHub: [https://github.com/Joaov41](https://github.com/Joaov41)
62+
The macOS port is being developed by **Aryamirsepasi**. [GitHub](https://github.com/Aryamirsepasi)
8163

82-
Special Thanks to @sindresorhus for developing an amazing and stable keyboard shortcuts package for Swift.
64+
The amazing gemini picture processing functionality was created by **Joaov41**. [GitHub](https://github.com/Joaov41)
8365

84-
GitHub: [https://github.com/sindresorhus/KeyboardShortcuts](https://github.com/sindresorhus/KeyboardShortcuts)
66+
Special Thanks to @sindresorhus for developing a great and stable keyboard shortcuts package for Swift. [GitHub](https://github.com/sindresorhus/KeyboardShortcuts)
8567

68+
Huge shoutout to MLX Swift Team, creating local LLM compatibility on Apple silicon Macs. [GitHub](https://github.com/ml-explore/mlx-swift-examples)

macOS/writing-tools.xcodeproj/project.pbxproj

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
attributes = {
134134
BuildIndependentTargetsInParallel = 1;
135135
LastSwiftUpdateCheck = 1610;
136-
LastUpgradeCheck = 1620;
136+
LastUpgradeCheck = 1630;
137137
TargetAttributes = {
138138
2ABCBC1D2CDEB606001E4B5E = {
139139
CreatedOnToolsVersion = 16.1;
@@ -195,6 +195,7 @@
195195
buildSettings = {
196196
ALWAYS_SEARCH_USER_PATHS = NO;
197197
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
198+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
198199
CLANG_ANALYZER_NONNULL = YES;
199200
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
200201
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -226,6 +227,7 @@
226227
COPY_PHASE_STRIP = NO;
227228
DEAD_CODE_STRIPPING = YES;
228229
DEBUG_INFORMATION_FORMAT = dwarf;
230+
DEVELOPMENT_TEAM = MK2V998W66;
229231
ENABLE_STRICT_OBJC_MSGSEND = YES;
230232
ENABLE_TESTABILITY = YES;
231233
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -260,6 +262,7 @@
260262
buildSettings = {
261263
ALWAYS_SEARCH_USER_PATHS = NO;
262264
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
265+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
263266
CLANG_ANALYZER_NONNULL = YES;
264267
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
265268
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -291,6 +294,7 @@
291294
COPY_PHASE_STRIP = NO;
292295
DEAD_CODE_STRIPPING = YES;
293296
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
297+
DEVELOPMENT_TEAM = MK2V998W66;
294298
ENABLE_NS_ASSERTIONS = NO;
295299
ENABLE_STRICT_OBJC_MSGSEND = YES;
296300
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -318,14 +322,15 @@
318322
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
319323
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
320324
CODE_SIGN_ENTITLEMENTS = "writing-tools/writing_tools.entitlements";
321-
CODE_SIGN_IDENTITY = "Apple Development";
322-
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
323-
CODE_SIGN_STYLE = Automatic;
325+
CODE_SIGN_IDENTITY = "Developer ID Application";
326+
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application";
327+
CODE_SIGN_STYLE = Manual;
324328
COMBINE_HIDPI_IMAGES = YES;
325-
CURRENT_PROJECT_VERSION = 9;
329+
CURRENT_PROJECT_VERSION = 13;
326330
DEAD_CODE_STRIPPING = YES;
327331
DEVELOPMENT_ASSET_PATHS = "\"writing-tools/Preview Content\"";
328-
DEVELOPMENT_TEAM = MK2V998W66;
332+
DEVELOPMENT_TEAM = "";
333+
"DEVELOPMENT_TEAM[sdk=macosx*]" = MK2V998W66;
329334
ENABLE_HARDENED_RUNTIME = YES;
330335
ENABLE_PREVIEWS = YES;
331336
GENERATE_INFOPLIST_FILE = YES;
@@ -338,7 +343,7 @@
338343
"@executable_path/../Frameworks",
339344
);
340345
MACOSX_DEPLOYMENT_TARGET = 14.0;
341-
MARKETING_VERSION = 4.0;
346+
MARKETING_VERSION = 4.1;
342347
PRODUCT_BUNDLE_IDENTIFIER = "com.aryamirsepasi.writing-tools";
343348
PRODUCT_NAME = "$(TARGET_NAME)";
344349
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -353,14 +358,15 @@
353358
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
354359
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
355360
CODE_SIGN_ENTITLEMENTS = "writing-tools/writing_tools.entitlements";
356-
CODE_SIGN_IDENTITY = "Apple Development";
357-
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
358-
CODE_SIGN_STYLE = Automatic;
361+
CODE_SIGN_IDENTITY = "Developer ID Application";
362+
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application";
363+
CODE_SIGN_STYLE = Manual;
359364
COMBINE_HIDPI_IMAGES = YES;
360-
CURRENT_PROJECT_VERSION = 9;
365+
CURRENT_PROJECT_VERSION = 13;
361366
DEAD_CODE_STRIPPING = YES;
362367
DEVELOPMENT_ASSET_PATHS = "\"writing-tools/Preview Content\"";
363-
DEVELOPMENT_TEAM = MK2V998W66;
368+
DEVELOPMENT_TEAM = "";
369+
"DEVELOPMENT_TEAM[sdk=macosx*]" = MK2V998W66;
364370
ENABLE_HARDENED_RUNTIME = YES;
365371
ENABLE_PREVIEWS = YES;
366372
GENERATE_INFOPLIST_FILE = YES;
@@ -373,7 +379,7 @@
373379
"@executable_path/../Frameworks",
374380
);
375381
MACOSX_DEPLOYMENT_TARGET = 14.0;
376-
MARKETING_VERSION = 4.0;
382+
MARKETING_VERSION = 4.1;
377383
PRODUCT_BUNDLE_IDENTIFIER = "com.aryamirsepasi.writing-tools";
378384
PRODUCT_NAME = "$(TARGET_NAME)";
379385
PROVISIONING_PROFILE_SPECIFIER = "";

macOS/writing-tools.xcodeproj/xcshareddata/xcschemes/swift-writing-tools.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1620"
3+
LastUpgradeVersion = "1630"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

macOS/writing-tools/App/AppSettings.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class AppSettings: ObservableObject {
8686
didSet { defaults.set(mistralModel, forKey: "mistral_model") }
8787
}
8888

89-
// New Ollama settings:
89+
// Ollama settings:
9090
@Published var ollamaBaseURL: String {
9191
didSet { defaults.set(ollamaBaseURL, forKey: "ollama_base_url") }
9292
}
@@ -103,6 +103,11 @@ class AppSettings: ObservableObject {
103103
didSet { defaults.set(ollamaImageMode.rawValue, forKey: "ollama_image_mode") }
104104
}
105105

106+
// Store the ID (rawValue) of the selected local LLM model type
107+
@Published var selectedLocalLLMId: String? {
108+
didSet { defaults.set(selectedLocalLLMId, forKey: "selected_local_llm_id") }
109+
}
110+
106111
// MARK: - Init
107112
private init() {
108113
let defaults = UserDefaults.standard
@@ -143,6 +148,8 @@ class AppSettings: ObservableObject {
143148

144149
let ollamaImageModeRaw = defaults.string(forKey: "ollama_image_mode") ?? OllamaImageMode.ocr.rawValue
145150
self.ollamaImageMode = OllamaImageMode(rawValue: ollamaImageModeRaw) ?? .ocr
151+
152+
self.selectedLocalLLMId = defaults.string(forKey: "selected_local_llm_id")
146153
}
147154

148155
// MARK: - Convenience

macOS/writing-tools/App/AppState.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class AppState: ObservableObject {
88
@Published var openAIProvider: OpenAIProvider
99
@Published var mistralProvider: MistralProvider
1010
@Published var ollamaProvider: OllamaProvider
11-
@Published var localLLMProvider: LocalLLMProvider
11+
@Published var localLLMProvider: LocalModelProvider
1212

1313
@Published var customInstruction: String = ""
1414
@Published var selectedText: String = ""
@@ -71,7 +71,7 @@ class AppState: ObservableObject {
7171
)
7272
self.mistralProvider = MistralProvider(config: mistralConfig)
7373

74-
self.localLLMProvider = LocalLLMProvider()
74+
self.localLLMProvider = LocalModelProvider()
7575

7676

7777
// Initialize OllamaProvider with its settings.

macOS/writing-tools/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<true/>
2323
<key>NSServices</key>
2424
<array/>
25-
<key>NSAppleEventsUsageDescription</key>
26-
<string>WritingTools needs accessibility access to help improve your writing across applications.</string>
25+
<key>NSAccessibilityUsageDescription</key>
26+
<string>WritingTools needs access to control your computer to simulate copy and paste actions, allowing it to retrieve selected text and insert AI-generated results.</string>
2727
</dict>
2828
</plist>

0 commit comments

Comments
 (0)