Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

Fix auto-update system and improve macOS compatibility

altic-devd8377f8d2938
diff --git a/Fluid-oss-1.1.zip b/Fluid-oss-1.1.zip
deleted file mode 100644
index 1fa51de7..00000000
Binary files a/Fluid-oss-1.1.zip and /dev/null differ
diff --git a/Info.plist b/Info.plist
index d9b0d9a2..28d73a92 100644
--- a/Info.plist
+++ b/Info.plist
@@ -11,7 +11,7 @@
<key>CFBundleVersion</key>
<string>1</string>
<key>CFBundleShortVersionString</key>
- <string>1.1</string>
+ <string>1.2</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>LSApplicationCategoryType</key>
diff --git a/Sources/Fluid/AppDelegate.swift b/Sources/Fluid/AppDelegate.swift
index 97b6032f..5fcec476 100644
--- a/Sources/Fluid/AppDelegate.swift
+++ b/Sources/Fluid/AppDelegate.swift
@@ -30,22 +30,31 @@ class AppDelegate: NSObject, NSApplicationDelegate {
// MARK: - Manual Update Check
@objc func checkForUpdatesManually() {
- guard let updater = updater else {
- DebugLogger.shared.error("AppUpdater not initialized", source: "AppDelegate")
- showUpdateAlert(title: "Update Error", message: "Update system not available")
- return
- }
+ // Confirm invocation
+ print("🔎 Manual update check triggered")
+ NSLog("🔎 Manual update check triggered")
+
+ // We use SimpleUpdater for manual checks; AppUpdater instance is optional
- DebugLogger.shared.info("Manual update check requested", source: "AppDelegate")
+ // Get current app version for debugging
+ let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "unknown"
+ DebugLogger.shared.info("Manual update check requested. Current version: \(currentVersion)", source: "AppDelegate")
+ DebugLogger.shared.info("Checking repository: altic-dev/Fluid-oss", source: "AppDelegate")
+ print("🔍 DEBUG: Manual update check started - Current version: \(currentVersion)")
+ print("🔍 DEBUG: Repository: altic-dev/Fluid-oss")
- updater.check().catch(policy: .allErrors) { error in
- DispatchQueue.main.async {
- if error.isCancelled {
- // User is already up-to-date
+ Task {
+ do {
+ // Use our tolerant updater to handle v-prefixed tags and 2-part versions
+ try await SimpleUpdater.shared.checkAndUpdate(owner: "altic-dev", repo: "Fluid-oss")
+ // If we get here, an update was found; SimpleUpdater will relaunch on success
+ // Show a quick heads-up before app restarts
+ self.showUpdateAlert(title: "Update Found!", message: "A new version is available and will be installed now.")
+ } catch {
+ if let pmkError = error as? PMKError, pmkError.isCancelled {
DebugLogger.shared.info("App is already up-to-date", source: "AppDelegate")
self.showUpdateAlert(title: "No Updates", message: "You're already running the latest version of Fluid!")
} else {
- // Handle update error
DebugLogger.shared.error("Update check failed: \(error)", source: "AppDelegate")
self.showUpdateAlert(title: "Update Check Failed", message: "Unable to check for updates. Please try again later.\n\nError: \(error.localizedDescription)")
}
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift
index 4879fc63..b7334533 100644
--- a/Sources/Fluid/ContentView.swift
+++ b/Sources/Fluid/ContentView.swift
@@ -215,6 +215,12 @@ struct ContentView: View {
}
guard isRecordingShortcut else {
+ // Check for escape key to cancel ASR recording
+ if event.keyCode == 53 && asr.isRunning {
+ DebugLogger.shared.debug("NSEvent monitor: Escape pressed, cancelling ASR recording", source: "ContentView")
+ asr.stopWithoutTranscription()
+ return nil
+ }
DebugLogger.shared.debug("NSEvent monitor: Not recording shortcut, forwarding event", source: "ContentView")
return event
}
@@ -276,7 +282,7 @@ struct ContentView: View {
return event
}
}
- .onChange(of: accessibilityEnabled) { _, enabled in
+ .onChange(of: accessibilityEnabled) { enabled in
if enabled && hotkeyManager != nil && !hotkeyManagerInitialized {
DebugLogger.shared.debug("Accessibility enabled, reinitializing hotkey manager", source: "ContentView")
hotkeyManager?.reinitialize()
@@ -326,8 +332,8 @@ struct ContentView: View {
asr.stopWithoutTranscription()
overlay?.hide()
}
- .onChange(of: hotkeyShortcut) { oldValue, newValue in
- DebugLogger.shared.debug("Hotkey shortcut changed from \(oldValue.displayString) to \(newValue.displayString)", source: "ContentView")
+ .onChange(of: hotkeyShortcut) { newValue in
+ DebugLogger.shared.debug("Hotkey shortcut changed to \(newValue.displayString)", source: "ContentView")
hotkeyManager?.updateShortcut(newValue)
// Update initialization status after shortcut change
@@ -336,7 +342,7 @@ struct ContentView: View {
DebugLogger.shared.debug("Hotkey manager initialized: \(self.hotkeyManagerInitialized)", source: "ContentView")
}
}
- .onChange(of: asr.isRunning) { _, running in
+ .onChange(of: asr.isRunning) { running in
// Prevent rapid state changes that could cause cycles
guard overlayVisible != running else { return }
@@ -1374,6 +1380,11 @@ struct ContentView: View {
.font(.caption)
.foregroundStyle(asr.isAsrReady ? .white : .secondary)
.padding(.leading, 4)
+
+ Text("Automatically detects and transcribes 25 European languages")
+ .font(.caption)
+ .foregroundStyle(.secondary)
+ .padding(.leading, 4)
// Model status indicator (non-clickable)
HStack {
@@ -1734,7 +1745,7 @@ struct ContentView: View {
HStack(spacing: 16) {
Toggle("Enable AI Enhancement", isOn: $enableAIProcessing)
.toggleStyle(GlassToggleStyle())
- .onChange(of: enableAIProcessing) { _, newValue in
+ .onChange(of: enableAIProcessing) { newValue in
SettingsStore.shared.enableAIProcessing = newValue
}
@@ -1914,7 +1925,7 @@ struct ContentView: View {
.pickerStyle(.menu)
.frame(width: 180, alignment: .leading)
.layoutPriority(1)
- .onChange(of: selectedProviderID) { _, newValue in
+ .onChange(of: selectedProviderID) { newValue in
switch newValue {
case "openai":
openAIBaseURL = "https://api.openai.com/v1"
@@ -2130,7 +2141,7 @@ struct ContentView: View {
.textFieldStyle(.roundedBorder)
.frame(width: 350)
.layoutPriority(1)
- .onChange(of: openAIBaseURL) { _, _ in
+ .onChange(of: openAIBaseURL) { _ in
updateCurrentProvider()
}
}
@@ -2439,24 +2450,24 @@ struct ContentView: View {
selectedModel = first
}
}
- .onChange(of: asr.isRunning) { _, newValue in
+ .onChange(of: asr.isRunning) { newValue in
// Mark playground as used when user starts recording
if newValue && !playgroundUsed {
playgroundUsed = true
}
}
- .onChange(of: asr.finalText) { _, newValue in
+ .onChange(of: asr.finalText) { newValue in
// Also mark as used when text appears in playground
if !newValue.isEmpty && !playgroundUsed {
playgroundUsed = true
}
}
- .onChange(of: enableAIProcessing) { _, newValue in
+ .onChange(of: enableAIProcessing) { newValue in
SettingsStore.shared.enableAIProcessing = newValue
// Sync to menu bar immediately
menuBarManager.aiProcessingEnabled = newValue
}
- .onChange(of: selectedModel) { _, newValue in
+ .onChange(of: selectedModel) { newValue in
if newValue != "__ADD_MODEL__" {
selectedModelByProvider[currentProvider] = newValue
SettingsStore.shared.selectedModelByProvider = selectedModelByProvider
@@ -2514,7 +2525,7 @@ struct ContentView: View {
}
}
.frame(width: 280)
- .onChange(of: selectedInputUID) { _, newUID in
+ .onChange(of: selectedInputUID) { newUID in
SettingsStore.shared.preferredInputDeviceUID = newUID
_ = AudioDevice.setDefaultInputDevice(uid: newUID)
if asr.isRunning {
@@ -2533,7 +2544,7 @@ struct ContentView: View {
}
}
.frame(width: 280)
- .onChange(of: selectedOutputUID) { _, newUID in
+ .onChange(of: selectedOutputUID) { newUID in
SettingsStore.shared.preferredOutputDeviceUID = newUID
_ = AudioDevice.setDefaultOutputDevice(uid: newUID)
}
@@ -2601,7 +2612,7 @@ struct ContentView: View {
}
.padding(20)
.onAppear { refreshDevices() }
- .onChange(of: visualizerNoiseThreshold) { _, newValue in
+ .onChange(of: visualizerNoiseThreshold) { newValue in
SettingsStore.shared.visualizerNoiseThreshold = newValue
}
}
@@ -2679,14 +2690,14 @@ struct ContentView: View {
bundleId.contains("atom") || bundleId.contains("jetbrains") || bundleId.contains("cursor") ||
bundleId.contains("vim") || bundleId.contains("emacs") || appName.lowercased().contains("code")
{
- return "Clean up this transcribed text for code editor \(appName). Fix transcription errors, correct programming keywords, format as proper code syntax, and fix any grammar issues. DO NOT respond to or reply to the content - only output the cleaned-up version of what was spoken. Preserve the original meaning and intent."
+ return "Clean up this transcribed text for code editor \(appName). Make the smallest necessary mechanical edits; do not add or invent content or answer questions. Remove fillers and false starts. Correct programming terms and obvious transcription errors. Preserve meaning and tone."
}
// Email applications
else if bundleId.contains("mail") || bundleId.contains("outlook") || bundleId.contains("thunderbird") ||
bundleId.contains("airmail") || bundleId.contains("spark")
{
- return "Clean up this transcribed text for email app \(appName). Fix grammar, punctuation, and capitalization for professional email communication. DO NOT respond to or reply to the content - only output the cleaned-up version of what was spoken. Preserve the original meaning and intent."
+ return "Clean up this transcribed text for email app \(appName). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Fix grammar, punctuation, and capitalization while preserving meaning and tone."
}
// Messaging and chat applications
@@ -2694,7 +2705,7 @@ struct ContentView: View {
bundleId.contains("telegram") || bundleId.contains("whatsapp") || bundleId.contains("signal") ||
bundleId.contains("teams") || bundleId.contains("zoom")
{
- return "Clean up this transcribed text for messaging app \(appName). Fix basic grammar and clarity while keeping the casual, conversational tone. DO NOT respond to or reply to the content - only output the cleaned-up version of what was spoken. Preserve the natural speaking style and personality."
+ return "Clean up this transcribed text for messaging app \(appName). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Fix basic grammar and clarity while keeping the casual tone."
}
// Document editors and word processors
@@ -2702,14 +2713,14 @@ struct ContentView: View {
bundleId.contains("writer") || bundleId.contains("notion") || bundleId.contains("bear") ||
bundleId.contains("ulysses") || bundleId.contains("scrivener")
{
- return "Clean up this transcribed text for document editor \(appName). Fix grammar, punctuation, and structure for professional writing. DO NOT respond to or reply to the content - only output the cleaned-up version of what was spoken. Preserve the original meaning and intent."
+ return "Clean up this transcribed text for document editor \(appName). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Fix grammar, punctuation, and structure while preserving meaning."
}
// Note-taking applications
else if bundleId.contains("notes") || bundleId.contains("obsidian") || bundleId.contains("roam") ||
bundleId.contains("logseq") || bundleId.contains("evernote") || bundleId.contains("onenote")
{
- return "Clean up this transcribed text for note-taking app \(appName). Fix grammar and organize into clear, readable notes. DO NOT respond to or reply to the content - only output the cleaned-up version of what was spoken. Preserve all key points and ideas."
+ return "Clean up this transcribed text for note-taking app \(appName). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Fix grammar and organize into clear, readable notes without adding information."
}
// Browsers (various web apps). Include: Safari, Chrome, Firefox, Edge, Arc, Brave, Dia, Comet
@@ -2724,27 +2735,27 @@ struct ContentView: View {
if let inferred = inferWebContext(from: windowTitle, appName: appName) {
return inferred
}
- return "Clean up this transcribed text for web browser \(appName). Fix grammar and formatting for web applications. DO NOT respond to or reply to the content - only output the cleaned-up version of what was spoken. Preserve the original meaning and intent."
+ return "Clean up this transcribed text for web browser \(appName). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Fix grammar and basic formatting while preserving meaning."
}
// Terminal and command line tools
else if bundleId.contains("terminal") || bundleId.contains("iterm") || bundleId.contains("console") ||
appName.lowercased().contains("terminal")
{
- return "Clean up this transcribed text for terminal \(appName). Fix command syntax, file paths, and technical terms. DO NOT respond to or reply to the content - only output the cleaned-up version of what was spoken as proper command-line input."
+ return "Clean up this transcribed text for terminal \(appName). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Fix command syntax, file paths, and technical terms without adding options or commands."
}
// Social media and creative apps
else if bundleId.contains("twitter") || bundleId.contains("facebook") || bundleId.contains("instagram") ||
bundleId.contains("tiktok") || bundleId.contains("linkedin")
{
- return "Clean up this transcribed text for social media app \(appName). Fix basic grammar while keeping the natural, engaging tone. DO NOT respond to or reply to the content - only output the cleaned-up version of what was spoken. Preserve personality and casual expression."
+ return "Clean up this transcribed text for social media app \(appName). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Fix basic grammar while keeping the natural, engaging tone."
}
// Default fallback
else
{
- return "Clean up this transcribed text for \(appName). Fix grammar, punctuation, and formatting errors. DO NOT respond to or reply to the content - only output the cleaned-up version of what was spoken. Preserve the original meaning and intent."
+ return "Clean up this transcribed text for \(appName). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Fix grammar, punctuation, and formatting while preserving meaning and tone."
}
}
@@ -2753,23 +2764,23 @@ struct ContentView: View {
let title = windowTitle
// Email (Gmail, Outlook Web)
if title.contains("gmail") || title.contains("inbox") || title.contains("outlook") {
- return "Clean up this transcribed text for email app \(appName) (web). Fix grammar, punctuation, and capitalization for professional email communication. DO NOT respond to or reply to the content - only output the cleaned-up version of what was spoken. Preserve the original meaning and intent."
+ return "Clean up this transcribed text for email app \(appName) (web). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Fix grammar, punctuation, and capitalization while preserving meaning."
}
// Messaging (Slack, Discord, Teams, Telegram, WhatsApp)
if title.contains("slack") || title.contains("discord") || title.contains("teams") || title.contains("telegram") || title.contains("whatsapp") {
- return "Clean up this transcribed text for messaging app \(appName) (web). Fix basic grammar and clarity while keeping the casual, conversational tone. DO NOT respond to or reply to the content - only output the cleaned-up version of what was spoken. Preserve the natural speaking style and personality."
+ return "Clean up this transcribed text for messaging app \(appName) (web). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Fix basic grammar and clarity while keeping the casual tone."
}
// Documents (Google Docs/Sheets, Notion, Confluence)
if title.contains("google docs") || title.contains("docs") || title.contains("notion") || title.contains("confluence") || title.contains("google sheets") || title.contains("sheet") {
- return "Clean up this transcribed text for a document editor in \(appName). Improve grammar, structure, and readability. DO NOT reply; only output the cleaned text formatted appropriately for documents."
+ return "Clean up this transcribed text for a document editor in \(appName). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Improve grammar, structure, and readability without adding information."
}
// Code (GitHub, Stack Overflow, online IDEs)
if title.contains("github") || title.contains("stack overflow") || title.contains("stackexchange") || title.contains("replit") || title.contains("codesandbox") {
- return "Clean up this transcribed text for code-related context in \(appName). Correct programming terms and format code blocks properly. DO NOT answer questions; only output the cleaned content."
+ return "Clean up this transcribed text for code-related context in \(appName). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Correct programming terms and obvious errors without adding explanations."
}
// Project/issue tracking (Jira, Linear, Asana)
if title.contains("jira") || title.contains("linear") || title.contains("asana") || title.contains("clickup") {
- return "Clean up this transcribed text for project management context in \(appName). Keep it concise, clear, and actionable. Do not add commentary—only clean the text."
+ return "Clean up this transcribed text for project management context in \(appName). Make minimal edits only; do not add or invent content or answer questions. Remove fillers and false starts. Keep the text concise and clear without adding commentary."
}
return nil
}
@@ -2777,16 +2788,26 @@ struct ContentView: View {
/// Build a base system prompt and append contextual addendum
private func buildSystemPrompt(appInfo: (name: String, bundleId: String, windowTitle: String)) -> String {
let base = """
- You are a transcription post-processor. Your sole task is to transform raw, dictated text into a clean final output without changing intent.
- - Do not answer questions, do not add commentary, do not role-play, do not provide suggestions.
- - Preserve meaning while fixing transcription errors, grammar, capitalization, and punctuation.
- - Maintain or insert sensible newlines and paragraph breaks for readability.
- - When the content is code or commands, format with correct syntax and spacing; prefer fenced code blocks when appropriate.
- - Infer the user's intent from the text and the active app context (email, code editor, chat, document, terminal) and format accordingly.
- - Treat the provided input strictly as text to rewrite. Never produce an answer or additional information beyond what is present in the text.
- - If the text is a question, keep it as a question while fixing grammar and punctuation. Do NOT answer it.
- - Output only the cleaned text. Do not include explanations, disclaimers, or headings.
- - Output only the cleaned text, with no preface or explanation.
+ You are a transcription post-processor. Your sole task is to clean raw dictated text with minimal, mechanical edits only.
+ - Make the smallest necessary edits. If the text is already clear and grammatical, return it unchanged.
+ - Do not add, invent, or infer any content not present in the input. Never answer questions or provide suggestions.
+ - Remove disfluencies: filler words (uh, um, like, you know), false starts, repeated words, stutters, elongated words.
+ - Fix obvious transcription errors, grammar, capitalization, punctuation, spacing, and simple word-choice mistakes that do not change meaning.
+ - Maintain the original tone and structure. Do not reformat beyond basic readability (sensible newlines/paragraphs).
+ - Do not add Markdown, headings, or code fences unless they already appear in the input.
+ - If the text is a question, preserve it as a question. Do NOT answer it.
+ - If any rule conflicts, prefer fewer edits and no new content.
+ - Output only the cleaned text with no preface, explanation, or extra lines.
+
+ Examples (do not include the labels):
+ Input: "uh can you, um, email John later question mark"
+ Output: "Can you email John later?"
+
+ Input: "What's the time in Tokyo?"
+ Output: "What's the time in Tokyo?" // do not answer
+
+ Input: "The function returns an arr a y of ints"
+ Output: "The function returns an array of ints"
"""
let addendum = getContextualPrompt(for: appInfo)
var context = "Context:\n- Active app: \(appInfo.name) (\(appInfo.bundleId))"
@@ -2809,7 +2830,7 @@ struct ContentView: View {
}
struct ChatMessage: Codable { let role: String; let content: String }
- struct ChatRequest: Codable { let model: String; let messages: [ChatMessage] }
+ struct ChatRequest: Codable { let model: String; let messages: [ChatMessage]; let temperature: Double? }
struct ChatChoiceMessage: Codable { let role: String; let content: String }
struct ChatChoice: Codable { let index: Int?; let message: ChatChoiceMessage }
struct ChatResponse: Codable { let choices: [ChatChoice] }
@@ -2824,7 +2845,8 @@ struct ContentView: View {
messages: [
ChatMessage(role: "system", content: systemPrompt),
ChatMessage(role: "user", content: inputText)
- ]
+ ],
+ temperature: 0.2
)
guard let jsonData = try? JSONEncoder().encode(body) else {
diff --git a/Sources/Fluid/CustomAnimations.swift b/Sources/Fluid/CustomAnimations.swift
index 15eaf431..87e22cc3 100644
--- a/Sources/Fluid/CustomAnimations.swift
+++ b/Sources/Fluid/CustomAnimations.swift
@@ -52,7 +52,7 @@ struct PulseAudioVisualizationView: View {
.frame(width: 12, height: 12)
}
.frame(width: 100, height: 100)
- .onChange(of: data.audioLevel) { _, newLevel in
+ .onChange(of: data.audioLevel) { newLevel in
// Only trigger animation update for significant changes to prevent cycles
if abs(newLevel - (data.audioLevel)) > 0.1 {
animationId = UUID()
@@ -86,7 +86,7 @@ struct WaveAudioVisualizationView: View {
}
}
.frame(width: 60, height: 40)
- .onChange(of: data.audioLevel) { _, newLevel in
+ .onChange(of: data.audioLevel) { newLevel in
// Only trigger animation update for significant changes to prevent cycles
if abs(newLevel - (data.audioLevel)) > 0.1 {
animationId = UUID()
diff --git a/Sources/Fluid/Networking/AIProvider.swift b/Sources/Fluid/Networking/AIProvider.swift
index b16b046a..5e72e041 100644
--- a/Sources/Fluid/Networking/AIProvider.swift
+++ b/Sources/Fluid/Networking/AIProvider.swift
@@ -8,7 +8,7 @@ protocol AIProvider
final class OpenAICompatibleProvider: AIProvider
{
struct ChatMessage: Codable { let role: String; let content: String }
- struct ChatRequest: Codable { let model: String; let messages: [ChatMessage] }
+ struct ChatRequest: Codable { let model: String; let messages: [ChatMessage]; let temperature: Double? }
struct ChatChoiceMessage: Codable { let role: String; let content: String }
struct ChatChoice: Codable { let index: Int?; let message: ChatChoiceMessage }
struct ChatResponse: Codable { let choices: [ChatChoice] }
@@ -23,7 +23,8 @@ final class OpenAICompatibleProvider: AIProvider
messages: [
ChatMessage(role: "system", content: systemPrompt),
ChatMessage(role: "user", content: userText)
- ]
+ ],
+ temperature: 0.2
)
guard let jsonData = try? JSONEncoder().encode(body) else { return "Error: Failed to encode request" }
@@ -52,4 +53,3 @@ final class OpenAICompatibleProvider: AIProvider
}
}
-
diff --git a/Sources/Fluid/Services/ASRService.swift b/Sources/Fluid/Services/ASRService.swift
index 3168d820..1f68e4f9 100644
--- a/Sources/Fluid/Services/ASRService.swift
+++ b/Sources/Fluid/Services/ASRService.swift
@@ -27,21 +27,12 @@ import AppKit
/// ```
///
/// ## Language Support
-/// The service supports 25 European languages with Parakeet TDT v3:
-/// - Auto-detect (recommended): Automatically detects the language
-/// - Specific languages: Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian,
-/// Finnish, French, German, Greek, Hungarian, Italian, Latvian, Lithuanian, Maltese,
-/// Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Russian, Ukrainian
+/// The service automatically detects and transcribes 25 European languages with Parakeet TDT v3:
+/// Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German,
+/// Greek, Hungarian, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian,
+/// Slovak, Slovenian, Spanish, Swedish, Russian, and Ukrainian.
///
-/// ## Language Configuration
-/// ```swift
-/// // Set a specific language
-/// try await asrService.setLanguage(.fr) // French
-///
-/// // Use auto-detection (default)
-/// try await asrService.setLanguage(.auto)
-/// ```
-///Tak, jasne. Cześć, co słychać?
+/// No manual language selection is required - the model automatically detects the spoken language.
/// ## Thread Safety
/// All public methods are marked with @MainActor to ensure thread safety.
/// Audio processing happens on background threads for optimal performance.
@@ -59,8 +50,6 @@ final class ASRService: ObservableObject
@Published var isDownloadingModel: Bool = false
@Published var modelDownloadProgress: Double = 0.0
@Published var selectedModel: ModelOption = .parakeetTdt06bV3
- @Published var selectedLanguage: LanguageOption = .auto
- @Published var availableLanguages: [LanguageOption] = []
enum ModelOption: String, CaseIterable, Identifiable, Hashable
{
@@ -69,38 +58,6 @@ final class ASRService: ObservableObject
var displayName: String { rawValue }
}
- enum LanguageOption: String, CaseIterable, Identifiable, Hashable
- {
- case auto = "Auto-detect"
- case bg = "Bulgarian"
- case hr = "Croatian"
- case cs = "Czech"
- case da = "Danish"
- case nl = "Dutch"
- case en = "English"
- case et = "Estonian"
- case fi = "Finnish"
- case fr = "French"
- case de = "German"
- case el = "Greek"
- case hu = "Hungarian"
- case it = "Italian"
- case lv = "Latvian"
- case lt = "Lithuanian"
- case mt = "Maltese"
- case pl = "Polish"
- case pt = "Portuguese"
- case ro = "Romanian"
- case sk = "Slovak"
- case sl = "Slovenian"
- case es = "Spanish"
- case sv = "Swedish"
- case ru = "Russian"
- case uk = "Ukrainian"
-
- var id: String { rawValue }
- var displayName: String { rawValue }
- }
private let engine = AVAudioEngine()
private var inputFormat: AVAudioFormat?
@@ -126,14 +83,8 @@ final class ASRService: ObservableObject
self.micStatus = AVCaptureDevice.authorizationStatus(for: .audio)
self.micPermissionGranted = (self.micStatus == .authorized)
registerDefaultDeviceChangeListener()
- populateAvailableLanguages()
}
- private func populateAvailableLanguages()
- {
- // All 25 European languages supported by Parakeet TDT v3
- availableLanguages = LanguageOption.allCases
- }
func requestMicAccess()
{
@@ -620,19 +571,6 @@ final class ASRService: ObservableObject
await MainActor.run { self.isDownloadingModel = false }
}
- // MARK: - Language configuration
- func setLanguage(_ language: LanguageOption) async throws
- {
- selectedLanguage = language
- DebugLogger.shared.debug("Setting ASR language to: \(language.displayName)", source: "ASRService")
-
- // Force reinitialization with new language setting
- isAsrReady = false
- asrManager = nil
-
- // Reinitialize with new language configuration
- try await ensureAsrReady()
- }
// MARK: - Cache management
func clearModelCache() async throws
diff --git a/Sources/Fluid/Services/MenuBarManager.swift b/Sources/Fluid/Services/MenuBarManager.swift
index 5f27899a..5dc583dc 100644
--- a/Sources/Fluid/Services/MenuBarManager.swift
+++ b/Sources/Fluid/Services/MenuBarManager.swift
@@ -1,5 +1,6 @@
import AppKit
import Combine
+import PromiseKit
@MainActor
final class MenuBarManager: ObservableObject {
@@ -157,7 +158,7 @@ final class MenuBarManager: ObservableObject {
menu.addItem(openItem)
// Check for Updates
- let updateItem = NSMenuItem(title: "Check for Updates...", action: #selector(checkForUpdates), keyEquivalent: "")
+ let updateItem = NSMenuItem(title: "Check for Updates...", action: #selector(checkForUpdates(_:)), keyEquivalent: "")
updateItem.target = self
menu.addItem(updateItem)
@@ -189,10 +190,39 @@ final class MenuBarManager: ObservableObject {
updateMenu()
}
- @objc private func checkForUpdates() {
- // Call the AppDelegate's manual update check method
+ @objc private func checkForUpdates(_ sender: Any?) {
+ print("🔎 Menu action: Check for Updates…")
+ NSLog("🔎 Menu action: Check for Updates…")
+
+ // Call the AppDelegate's manual update check method if available
if let appDelegate = NSApp.delegate as? AppDelegate {
appDelegate.checkForUpdatesManually()
+ return
+ }
+
+ // Fallback: perform direct, tolerant check so the menu item always does something
+ Task { @MainActor in
+ do {
+ try await SimpleUpdater.shared.checkAndUpdate(owner: "altic-dev", repo: "Fluid-oss")
+ let ok = NSAlert()
+ ok.messageText = "Update Found!"
+ ok.informativeText = "A new version is available and will be installed now."
+ ok.alertStyle = .informational
+ ok.addButton(withTitle: "OK")
+ ok.runModal()
+ } catch {
+ let msg = NSAlert()
+ if let pmkError = error as? PMKError, pmkError.isCancelled {
+ msg.messageText = "You’re Up To Date"
+ msg.informativeText = "You’re already running the latest version of Fluid."
+ } else {
+ msg.messageText = "Update Check Failed"
+ msg.informativeText = "Unable to check for updates. Please try again later.\n\nError: \(error.localizedDescription)"
+ }
+ msg.alertStyle = .informational
+ msg.addButton(withTitle: "OK")
+ msg.runModal()
+ }
}
}
diff --git a/Sources/Fluid/Services/SimpleUpdater.swift b/Sources/Fluid/Services/SimpleUpdater.swift
new file mode 100644
index 00000000..f6a966d3
--- /dev/null
+++ b/Sources/Fluid/Services/SimpleUpdater.swift
@@ -0,0 +1,251 @@
+import Foundation
+import AppKit
+import PromiseKit
+
+enum SimpleUpdateError: Error, LocalizedError {
+ case invalidResponse
+ case jsonDecoding
+ case noSuitableRelease
+ case noAsset
+ case downloadFailed
+ case unzipFailed
+ case notAnAppBundle
+ case codesignMismatch
+
+ var errorDescription: String? {
+ switch self {
+ case .invalidResponse: return "Invalid HTTP response from GitHub."
+ case .jsonDecoding: return "The data couldn’t be read because it isn’t in the correct format."
+ case .noSuitableRelease: return "No suitable release found."
+ case .noAsset: return "No matching asset found in the latest release."
+ case .downloadFailed: return "Failed to download update."
+ case .unzipFailed: return "Failed to extract the update archive."
+ case .notAnAppBundle: return "Extracted content does not contain an app bundle."
+ case .codesignMismatch: return "Downloaded app’s code signature does not match current app."
+ }
+ }
+}
+
+struct GHRelease: Decodable {
+ struct Asset: Decodable {
+ let name: String
+ let browser_download_url: URL
+ let content_type: String
+ }
+ let tag_name: String
+ let prerelease: Bool
+ let assets: [Asset]
+}
+
+@MainActor
+final class SimpleUpdater {
+ static let shared = SimpleUpdater()
+ private init() {}
+ // Allowed Apple Developer Team IDs for code-sign validation
+ // Configured per your request; restrict to your actual Team ID only.
+ private let allowedTeamIDs: Set<String> = [
+ "V4J43B279J"
+ ]
+
+ func checkAndUpdate(owner: String, repo: String) async throws {
+ let releasesURL = URL(string: "https://api.github.com/repos/\(owner)/\(repo)/releases")!
+
+ let (data, response) = try await URLSession.shared.data(from: releasesURL)
+ guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
+ throw SimpleUpdateError.invalidResponse
+ }
+
+ let releases: [GHRelease]
+ do {
+ releases = try JSONDecoder().decode([GHRelease].self, from: data)
+ } catch {
+ throw SimpleUpdateError.jsonDecoding
+ }
+
+ // choose latest non-prerelease release
+ guard let latest = releases.first(where: { !$0.prerelease }) else {
+ throw SimpleUpdateError.noSuitableRelease
+ }
+
+ let currentVersionString = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "0.0.0"
+ let current = parseVersion(currentVersionString)
+ let latestTag = latest.tag_name
+ let latestVersion = parseVersion(latestTag)
+
+ // up to date
+ if !isVersion(latestVersion, greaterThan: current) {
+ throw PMKError.cancelled // mimic AppUpdater semantics for up-to-date
+ }
+
+ // Find asset matching: "{repo-lower}-{version-no-v}.*" and zip preferred
+ let verString = versionString(latestVersion)
+ let prefix = "\(repo.lowercased())-\(verString)"
+ let asset = latest.assets.first { asset in
+ let base = (asset.name as NSString).deletingPathExtension.lowercased()
+ return (base == prefix) && (asset.content_type == "application/zip" || asset.content_type == "application/x-zip-compressed")
+ } ?? latest.assets.first { asset in
+ let base = (asset.name as NSString).deletingPathExtension.lowercased()
+ return (base == prefix)
+ }
+
+ guard let asset = asset else { throw SimpleUpdateError.noAsset }
+
+ let tempDir = try FileManager.default.url(for: .itemReplacementDirectory, in: .userDomainMask, appropriateFor: Bundle.main.bundleURL, create: true)
+ let downloadURL = tempDir.appendingPathComponent(asset.browser_download_url.lastPathComponent)
+
+ do {
+ let (tmpFile, _) = try await URLSession.shared.download(from: asset.browser_download_url)
+ try FileManager.default.moveItem(at: tmpFile, to: downloadURL)
+ } catch {
+ throw SimpleUpdateError.downloadFailed
+ }
+
+ // unzip
+ let extractedBundleURL: URL
+ do {
+ extractedBundleURL = try await unzip(at: downloadURL)
+ } catch {
+ throw SimpleUpdateError.unzipFailed
+ }
+
+ guard extractedBundleURL.pathExtension == "app" else {
+ throw SimpleUpdateError.notAnAppBundle
+ }
+
+ // Validate code signing identity matches (skip in DEBUG for easier local testing)
+ let currentBundle = Bundle.main
+ #if DEBUG
+ // In Debug builds the local app is typically signed with a development cert, while
+ // releases are signed with Developer ID. Skip strict check to enable testing.
+ _ = currentBundle // keep reference used in Release path
+ #else
+ let curID = try await codeSigningIdentity(for: currentBundle.bundleURL)
+ let newID = try await codeSigningIdentity(for: extractedBundleURL)
+
+ func teamID(from identity: String) -> String? {
+ // Handle TeamIdentifier= format first
+ if identity.hasPrefix("TeamIdentifier=") {
+ return String(identity.dropFirst("TeamIdentifier=".count))
+ }
+
+ // Handle Authority= format (extract team ID from parentheses)
+ guard let l = identity.lastIndex(of: "("), let r = identity.lastIndex(of: ")"), l < r else { return nil }
+ let inside = identity[identity.index(after: l)..<r]
+ return String(inside)
+ }
+
+ // Allow update if:
+ // - full identity matches OR
+ // - Team IDs match OR
+ // - both current and new Team IDs are in the allowedTeamIDs set
+ // This enables dev→prod updates across your two known Team IDs.
+ let sameIdentity = curID == newID
+ let curTeam = teamID(from: curID)
+ let newTeam = teamID(from: newID)
+ let sameTeam = (curTeam != nil && curTeam == newTeam)
+ let bothAllowed = (curTeam != nil && newTeam != nil && allowedTeamIDs.contains(curTeam!) && allowedTeamIDs.contains(newTeam!))
+
+ guard sameIdentity || sameTeam || bothAllowed else {
+ print("SimpleUpdater: Code-sign mismatch. Current=\(curID) New=\(newID)")
+ print("SimpleUpdater: Current Team=\(curTeam ?? "none") New Team=\(newTeam ?? "none")")
+ throw SimpleUpdateError.codesignMismatch
+ }
+ #endif
+
+ // Replace and relaunch
+ try performSwapAndRelaunch(installedAppURL: currentBundle.bundleURL, downloadedAppURL: extractedBundleURL)
+ }
+
+ // MARK: - Helpers
+ private func parseVersion(_ s: String) -> [Int] {
+ let t = s.hasPrefix("v") ? String(s.dropFirst()) : s
+ let comps = t.split(separator: ".").map { Int($0) ?? 0 }
+ return [comps[safe:0] ?? 0, comps[safe:1] ?? 0, comps[safe:2] ?? 0]
+ }
+
+ private func versionString(_ v: [Int]) -> String {
+ // Match asset naming that omits trailing .0
+ if v[2] == 0 { return "\(v[0]).\(v[1])" }
+ return "\(v[0]).\(v[1]).\(v[2])"
+ }
+
+ private func isVersion(_ a: [Int], greaterThan b: [Int]) -> Bool {
+ if a[0] != b[0] { return a[0] > b[0] }
+ if a[1] != b[1] { return a[1] > b[1] }
+ return a[2] > b[2]
+ }
+
+ private func unzip(at url: URL) async throws -> URL {
+ let workDir = url.deletingLastPathComponent()
+ let proc = Process()
+ proc.currentDirectoryURL = workDir
+ proc.launchPath = "/usr/bin/unzip"
+ proc.arguments = [url.path]
+
+ return try await withCheckedThrowingContinuation { cont in
+ proc.terminationHandler = { _ in
+ // Find first .app in workDir
+ if let appURL = try? FileManager.default.contentsOfDirectory(at: workDir, includingPropertiesForKeys: [.isDirectoryKey], options: [.skipsSubdirectoryDescendants]).first(where: { $0.pathExtension == "app" }) {
+ cont.resume(returning: appURL)
+ } else {
+ cont.resume(throwing: SimpleUpdateError.unzipFailed)
+ }
+ }
+ do { try proc.run() } catch { cont.resume(throwing: error) }
+ }
+ }
+
+ private func codeSigningIdentity(for bundleURL: URL) async throws -> String {
+ let proc = Process()
+ proc.launchPath = "/usr/bin/codesign"
+ proc.arguments = ["-dvvv", bundleURL.path]
+ let pipe = Pipe()
+ proc.standardError = pipe
+
+ return try await withCheckedThrowingContinuation { cont in
+ proc.terminationHandler = { _ in
+ let data = pipe.fileHandleForReading.readDataToEndOfFile()
+ let s = String(data: data, encoding: .utf8) ?? ""
+
+ // First try to get TeamIdentifier (most reliable)
+ if let teamLine = s.split(separator: "\n").first(where: { $0.hasPrefix("TeamIdentifier=") }) {
+ cont.resume(returning: String(teamLine))
+ } else {
+ // Fallback to Authority line
+ let line = s.split(separator: "\n").first(where: { $0.hasPrefix("Authority=") })
+ cont.resume(returning: line.map(String.init) ?? "")
+ }
+ }
+ do { try proc.run() } catch { cont.resume(throwing: error) }
+ }
+ }
+
+ private func performSwapAndRelaunch(installedAppURL: URL, downloadedAppURL: URL) throws {
+ // Replace bundle on disk
+ try FileManager.default.removeItem(at: installedAppURL)
+ try FileManager.default.moveItem(at: downloadedAppURL, to: installedAppURL)
+
+ // Use modern NSWorkspace API for more reliable app launching
+ DispatchQueue.main.async {
+ let configuration = NSWorkspace.OpenConfiguration()
+ configuration.createsNewApplicationInstance = true
+
+ NSWorkspace.shared.openApplication(at: installedAppURL, configuration: configuration) { app, error in
+ if let error = error {
+ print("Failed to relaunch app: \(error)")
+ }
+
+ // Give the new instance time to fully start before terminating
+ DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
+ NSApp.terminate(nil)
+ }
+ }
+ }
+ }
+}
+
+private extension Array {
+ subscript(safe index: Int) -> Element? {
+ indices.contains(index) ? self[index] : nil
+ }
+}
diff --git a/Sources/Fluid/UI/MouseTracker.swift b/Sources/Fluid/UI/MouseTracker.swift
index 190b1ba5..0ba6a117 100644
--- a/Sources/Fluid/UI/MouseTracker.swift
+++ b/Sources/Fluid/UI/MouseTracker.swift
@@ -55,7 +55,7 @@ struct MouseTrackingModifier: ViewModifier {
let globalFrame = geometry.frame(in: .global)
tracker.updateWindowFrame(globalFrame)
}
- .onChange(of: geometry.frame(in: .global)) { _, newFrame in
+ .onChange(of: geometry.frame(in: .global)) { newFrame in
tracker.updateWindowFrame(newFrame)
}
}
diff --git a/release.sh b/release.sh
old mode 100644
new mode 100755
index 73b095db..fd86b893
--- a/release.sh
+++ b/release.sh
@@ -8,12 +8,29 @@ echo "🚀 Starting Fluid release process..."
VERSION=$(plutil -p Info.plist | grep CFBundleShortVersionString | cut -d '"' -f 4)
echo "📋 Release version: $VERSION"
-# Build app in Release mode
-echo "🔨 Building app in Release configuration..."
-xcodebuild -project Fluid.xcodeproj -scheme Fluid -configuration Release clean build
+# Validate version format
+if [[ ! $VERSION =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then
+ echo "❌ Error: Invalid version format '$VERSION'. Expected format: X.Y or X.Y.Z"
+ exit 1
+fi
+
+# Check if release already exists
+if gh release view "v$VERSION" --repo altic-dev/Fluid-oss >/dev/null 2>&1; then
+ echo "⚠️ Warning: Release v$VERSION already exists!"
+ echo "Do you want to delete and recreate it? (y/N)"
+ read -r response
+ if [[ "$response" =~ ^[Yy]$ ]]; then
+ echo "🗑️ Deleting existing release..."
+ gh release delete "v$VERSION" --repo altic-dev/Fluid-oss --yes
+ else
+ echo "❌ Aborting release process"
+ exit 1
+ fi
+fi
-# Find the built app
-APP_PATH="build/Release/Fluid.app"
+# Use pre-built app from Documents
+APP_PATH="/Users/barathwajanandan/Documents/Fluid.app"
+echo "📱 Using pre-built app: $APP_PATH"
if [ ! -d "$APP_PATH" ]; then
echo "❌ Error: Built app not found at $APP_PATH"
exit 1
@@ -22,9 +39,9 @@ fi
# Create zip with exact naming convention
ZIP_NAME="Fluid-oss-${VERSION}.zip"
echo "📦 Creating release zip: $ZIP_NAME"
-cd build/Release
-zip -r "../../$ZIP_NAME" Fluid.app
-cd ../..
+cd "$(dirname "$APP_PATH")"
+zip -r "$OLDPWD/$ZIP_NAME" Fluid.app
+cd "$OLDPWD"
# Verify zip was created
if [ ! -f "$ZIP_NAME" ]; then
@@ -46,44 +63,23 @@ create-dmg \
--hide-extension "Fluid.app" \
--app-drop-link 400 150 \
"$DMG_NAME" \
- "Fluid.app"
+ "$APP_PATH"
echo "✅ DMG created successfully: $DMG_NAME"
# Create GitHub release
echo "📤 Creating GitHub release..."
gh release create "v$VERSION" "$ZIP_NAME" "$DMG_NAME" \
- --title "Fluid v$VERSION - Parakeet TDT v3 with Multi-Language Support" \
- --notes "\
-## 🎉 What's New in v$VERSION
-
-- **Upgraded to Parakeet TDT v3** with unified model architecture
-- **25 European languages** with auto-detection support
-- **Enhanced UI** with language selection and documentation links
-- **Improved error handling** and logging
-- **Automatic updates** - seamless update experience!
-
-## 🚀 Installation Options
-
-### Option 1: ZIP (Recommended for Auto-Updates)
-1. Download \`$ZIP_NAME\`
-2. Extract and move \`Fluid.app\` to your Applications folder
-3. Run the app - updates will be automatic!
-
-### Option 2: DMG (Traditional Installer)
-1. Download \`$DMG_NAME\`
-2. Double-click to mount and drag \`Fluid.app\` to Applications
-3. Run the app and grant accessibility permissions
-
-## 🔧 System Requirements
-- macOS 13.0 or later
-- Apple Silicon or Intel Mac
-
-## 📦 Asset Details
-- **ZIP**: \`$ZIP_NAME\` ($(du -h "$ZIP_NAME" | cut -f1))
- - SHA256: $(shasum -a 256 "$ZIP_NAME" | cut -d' ' -f1)
-- **DMG**: \`$DMG_NAME\` ($(du -h "$DMG_NAME" | cut -f1))
- - SHA256: $(shasum -a 256 "$DMG_NAME" | cut -d' ' -f1)
+ --repo altic-dev/Fluid-oss \
+ --title "Fluid v$VERSION" \
+ --notes "## What's New in v$VERSION
+
+- Upgraded to Parakeet TDT v3 with unified model architecture
+- 25 European languages with auto-detection support
+- Enhanced UI with language selection and documentation links
+- Improved error handling and logging
+- Automatic updates support
+- Fixed UI glitches with light system preference
"
echo "✅ Release v$VERSION created successfully!"