feat(keyboard): ship AI mode surface with streaming search answers

Add the AI keyboard tab, Agent settings, and user-owned LLM key path for 1.7.0, including streaming answers and web-search transports without the built-in DeepSeek fallback.
This commit is contained in:
Rocky
2026-08-11 01:06:27 +08:00
parent f6212dcd2c
commit 3de665d254
81 changed files with 4467 additions and 398 deletions
@@ -10,6 +10,7 @@ public struct FlowUtteranceRequest: Equatable, Sendable {
public let editSourceText: String?
public let sourceHistoryEntryID: UUID?
public let sourceHistoryEntryRevision: Int64?
public let aiConversationID: UUID?
public static let dictation = FlowUtteranceRequest(mode: .dictation)
@@ -17,12 +18,14 @@ public struct FlowUtteranceRequest: Equatable, Sendable {
mode: FlowUtteranceMode,
editSourceText: String? = nil,
sourceHistoryEntryID: UUID? = nil,
sourceHistoryEntryRevision: Int64? = nil
sourceHistoryEntryRevision: Int64? = nil,
aiConversationID: UUID? = nil
) {
self.mode = mode
self.editSourceText = editSourceText
self.sourceHistoryEntryID = sourceHistoryEntryID
self.sourceHistoryEntryRevision = sourceHistoryEntryRevision
self.aiConversationID = aiConversationID
}
public static func editLastInput(
@@ -37,6 +40,14 @@ public struct FlowUtteranceRequest: Equatable, Sendable {
}
public var isEdit: Bool { mode == .editLastInput }
public var isAIQuestion: Bool { mode == .aiQuestion }
public static func aiQuestion(conversationID: UUID) -> FlowUtteranceRequest {
FlowUtteranceRequest(
mode: .aiQuestion,
aiConversationID: conversationID
)
}
}
public enum FlowUtteranceStartRejection: Equatable, Sendable {