Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Fluid.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
86CAA2D4EF18433096185602 /* LLMClientRequestBodyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 343B29013F4441D6A797D12D /* LLMClientRequestBodyTests.swift */; };
272BFB5CB271489892CAE50C /* TemperatureSupportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 980330F3CE464336ADCE3E23 /* TemperatureSupportTests.swift */; };
A11A00000000000000000002 /* AnalyticsDatabaseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A11A00000000000000000001 /* AnalyticsDatabaseTests.swift */; };
2E9B00000000000000000007 /* ZeppelinDataLayerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9B00000000000000000006 /* ZeppelinDataLayerTests.swift */; };
2E9B00000000000000000009 /* SearchIndexTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9B00000000000000000008 /* SearchIndexTests.swift */; };
2E9B0000000000000000000B /* AppSearchServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9B0000000000000000000A /* AppSearchServiceTests.swift */; };
A62300000000000000000002 /* AudioBufferConverterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A62300000000000000000001 /* AudioBufferConverterTests.swift */; };
D1A600000000000000000202 /* SpeakerTurnMergingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A600000000000000000201 /* SpeakerTurnMergingTests.swift */; };
F1BD00000000000000000002 /* StripThinkingTagsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1BD00000000000000000001 /* StripThinkingTagsTests.swift */; };
Expand Down Expand Up @@ -69,6 +72,9 @@
343B29013F4441D6A797D12D /* LLMClientRequestBodyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LLMClientRequestBodyTests.swift; sourceTree = "<group>"; };
980330F3CE464336ADCE3E23 /* TemperatureSupportTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TemperatureSupportTests.swift; sourceTree = "<group>"; };
A11A00000000000000000001 /* AnalyticsDatabaseTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsDatabaseTests.swift; sourceTree = "<group>"; };
2E9B00000000000000000006 /* ZeppelinDataLayerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZeppelinDataLayerTests.swift; sourceTree = "<group>"; };
2E9B00000000000000000008 /* SearchIndexTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchIndexTests.swift; sourceTree = "<group>"; };
2E9B0000000000000000000A /* AppSearchServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppSearchServiceTests.swift; sourceTree = "<group>"; };
A62300000000000000000001 /* AudioBufferConverterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioBufferConverterTests.swift; sourceTree = "<group>"; };
D1A600000000000000000201 /* SpeakerTurnMergingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpeakerTurnMergingTests.swift; sourceTree = "<group>"; };
F1BD00000000000000000001 /* StripThinkingTagsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StripThinkingTagsTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -165,6 +171,9 @@
343B29013F4441D6A797D12D /* LLMClientRequestBodyTests.swift */,
980330F3CE464336ADCE3E23 /* TemperatureSupportTests.swift */,
A11A00000000000000000001 /* AnalyticsDatabaseTests.swift */,
2E9B00000000000000000006 /* ZeppelinDataLayerTests.swift */,
2E9B00000000000000000008 /* SearchIndexTests.swift */,
2E9B0000000000000000000A /* AppSearchServiceTests.swift */,
A62300000000000000000001 /* AudioBufferConverterTests.swift */,
D1A600000000000000000201 /* SpeakerTurnMergingTests.swift */,
F1BD00000000000000000001 /* StripThinkingTagsTests.swift */,
Expand Down Expand Up @@ -233,6 +242,7 @@
7CE006BC2E80EBE600DDCCD6 /* AppUpdater */,
7C9A71012F58B00000FB7CAF /* TranscribeCpp */,
7C5AF14A2F15041600DE21B0 /* MediaRemoteAdapter */,
2E9B00000000000000000004 /* ZeppelinEmbed */,
);
productName = FluidVoice;
productReference = 7C078D8F2E3B339200FB7CAC /* FluidVoice Debug.app */;
Expand All @@ -254,6 +264,7 @@
name = FluidDictationIntegrationTests;
packageProductDependencies = (
803000000000000000000004 /* MediaRemoteAdapter */,
2E9B00000000000000000005 /* ZeppelinEmbed */,
);
productName = FluidDictationIntegrationTests;
productReference = 7CDB0A202F3C4D5600FB7CAD /* FluidDictationIntegrationTests.xctest */;
Expand Down Expand Up @@ -292,6 +303,7 @@
7C3697872ED70F9C005874CE /* XCRemoteSwiftPackageReference "DynamicNotchKit" */,
7C9A71002F58B00000FB7CAF /* XCRemoteSwiftPackageReference "transcribe-cpp-swift" */,
7C5AF1492F15041600DE21B0 /* XCRemoteSwiftPackageReference "mediaremote-adapter" */,
2E9B00000000000000000003 /* XCRemoteSwiftPackageReference "zeppelin-embed" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 7C078D902E3B339200FB7CAC /* Products */;
Expand Down Expand Up @@ -343,6 +355,9 @@
86CAA2D4EF18433096185602 /* LLMClientRequestBodyTests.swift in Sources */,
272BFB5CB271489892CAE50C /* TemperatureSupportTests.swift in Sources */,
A11A00000000000000000002 /* AnalyticsDatabaseTests.swift in Sources */,
2E9B00000000000000000007 /* ZeppelinDataLayerTests.swift in Sources */,
2E9B00000000000000000009 /* SearchIndexTests.swift in Sources */,
2E9B0000000000000000000B /* AppSearchServiceTests.swift in Sources */,
A62300000000000000000002 /* AudioBufferConverterTests.swift in Sources */,
D1A600000000000000000202 /* SpeakerTurnMergingTests.swift in Sources */,
F1BD00000000000000000002 /* StripThinkingTagsTests.swift in Sources */,
Expand Down Expand Up @@ -711,6 +726,14 @@
kind = branch;
};
};
2E9B00000000000000000003 /* XCRemoteSwiftPackageReference "zeppelin-embed" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/zepdb/zeppelin-embed.git";
requirement = {
kind = exactVersion;
version = 0.4.1;
};
};
7C9A71002F58B00000FB7CAF /* XCRemoteSwiftPackageReference "transcribe-cpp-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/altic-dev/transcribe-cpp-swift.git";
Expand Down Expand Up @@ -755,6 +778,16 @@
package = 7CE006BB2E80EBE600DDCCD6 /* XCRemoteSwiftPackageReference "AppUpdater" */;
productName = AppUpdater;
};
2E9B00000000000000000004 /* ZeppelinEmbed */ = {
isa = XCSwiftPackageProductDependency;
package = 2E9B00000000000000000003 /* XCRemoteSwiftPackageReference "zeppelin-embed" */;
productName = ZeppelinEmbed;
};
2E9B00000000000000000005 /* ZeppelinEmbed */ = {
isa = XCSwiftPackageProductDependency;
package = 2E9B00000000000000000003 /* XCRemoteSwiftPackageReference "zeppelin-embed" */;
productName = ZeppelinEmbed;
};
7C9A71012F58B00000FB7CAF /* TranscribeCpp */ = {
isa = XCSwiftPackageProductDependency;
package = 7C9A71002F58B00000FB7CAF /* XCRemoteSwiftPackageReference "transcribe-cpp-swift" */;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let package = Package(
.package(url: "https://github.com/mxcl/PromiseKit", from: "6.0.0"),
.package(url: "https://github.com/altic-dev/DynamicNotchKit.git", branch: "main"),
.package(url: "https://github.com/altic-dev/transcribe-cpp-swift.git", exact: "0.1.2"),
.package(url: "https://github.com/zepdb/zeppelin-embed.git", exact: "0.4.1"),
],
targets: [
.target(
Expand All @@ -32,6 +33,7 @@ let package = Package(
"PromiseKit",
"DynamicNotchKit",
.product(name: "TranscribeCpp", package: "transcribe-cpp-swift"),
.product(name: "ZeppelinEmbed", package: "zeppelin-embed"),
],
linkerSettings: [
.linkedLibrary("sqlite3"),
Expand Down
24 changes: 24 additions & 0 deletions Sources/Fluid/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
SettingsStore.shared.bootstrapOnboardingState(isTrueFirstOpen: isTrueFirstOpen)

AnalyticsService.shared.bootstrap()
SearchIndexCoordinator.shared.start()

// Check for updates automatically if enabled (initial check on launch)
self.checkForUpdatesAutomatically()
Expand Down Expand Up @@ -85,12 +86,35 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
DebugLogger.shared.info("Application will terminate", source: "AppDelegate")
self.shutdownPrivateAIRuntimeForTermination()
self.shutdownASRRuntimeForTermination()
self.closeZeppelinForTermination()
LocalAPIServer.shared.stop()
// Clean up the update check timer
self.updateCheckTimer?.invalidate()
self.updateCheckTimer = nil
}

/// Short deadline: the index is rebuilt from its source stores, so a timeout
/// costs a log replay at startup and nothing else.
private func closeZeppelinForTermination() {
var didClose = false
Task {
await FluidZeppelinRoot.shared.closeAll()
didClose = true
}

let deadline = Date().addingTimeInterval(2)
while !didClose, Date() < deadline {
RunLoop.current.run(mode: .default, before: Date().addingTimeInterval(0.01))
}

if !didClose {
DebugLogger.shared.warning(
"Timed out closing Zeppelin namespaces during termination",
source: "AppDelegate"
)
}
}

private func shutdownASRRuntimeForTermination() {
var didFinishShutdown = false
Task { @MainActor in
Expand Down
Loading
Loading