Repository navigation
Conversation
Move the Lifi lifecycle facade and the quick-add AI bridge from iosMain to appleMain so the macOS client can use the same AI runtime. The Swift API is unchanged for iOS. IosLifiCore.create picks the platform SQLite driver through an internal expect/actual. Add a createWithDatabase(config:) overload so hosts can pass provider options such as the temperature that reasoning models require.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Mac 客户端要接入 Lifi AI(对话助手、快速添加的 AI 识别、记忆),与 iOS 使用同一个智能体。目前
IosLifiCore和IosQuickAddBridge放在iosMain,macOS 用不到。开发者已同意把 Lifi AI 合入 macOS。改动
IosLifiCore、IosQuickAddBridge从iosMain移到appleMain,类名、包名和方法都不变,iOS 的 Swift 调用不受影响。IosLifiCore.create(databasePath)原来直接用IosDatabaseDriverFactory。改为内部的expect fun appleLifiDatabaseDriverFactory(path):iOS 仍返回IosDatabaseDriverFactory,macOS 返回MacosDatabaseDriverFactory。IosLifiCore.createWithDatabase(config: AIConfig, database, ownsDatabase),原来的createWithDatabase(apiKey, baseUrl, model, timezone, …)改为调用它,行为不变。AIConfig,温度使用默认的 0.1。OpenAI 的推理模型(o 系列、gpt-5 及之后)只接受默认温度 1,其他取值返回 HTTP 400。宿主需要能传入温度、回复语言等选项(Mac 的月度洞察已因此出过问题)。platform = "ios",因为 Lifi 的工具只为 ios / android / harmony 声明,Mac 与 iOS 使用同一套 Apple 工具。验证
./gradlew -PlifiMode=stub :shared:macosArm64Test:280 个测试全部通过。./gradlew -PlifiMode=private :shared:macosArm64Test:334 个测试全部通过。compileKotlinIosArm64、compileKotlinIosSimulatorArm64在 stub / private 模式下都编译通过。compileKotlinOhosArm64在本机失败(缺少鸿蒙 SDK 的OH_AI_*原生库),不应用这次改动时同样失败,与本 PR 无关。影响
IosLifiCore、IosLifiEventListener、IosQuickAddBridge。