feat(account): add managed credits and cloud gateway

Introduce optional Apple account-backed credits with scoped gateway access while preserving local and BYOK paths. Refresh assistant behavior, tests, privacy disclosures, docs, and the website for the 2.0 experience.
This commit is contained in:
Rocky
2026-08-20 11:43:21 +08:00
parent 0f9280bd00
commit 498f407585
301 changed files with 19221 additions and 10891 deletions
@@ -5,8 +5,8 @@
// The host process never starts this monitor, so shared typing code can emit
// extension-only milestones without duplicating host telemetry.
import Foundation
import Darwin
import Foundation
public enum KeyboardExtensionMemoryBudget {
/// Start preserving evidence before the extension reaches its safe ceiling.
+1 -1
View File
@@ -5,8 +5,8 @@
// Console without needing an os.Logger subsystem filter (keyboard extension
// OSLog lines are easy to miss when the host process is selected).
import Foundation
import Darwin
import Foundation
public enum OSGDiag {
public struct MemorySnapshot: Sendable, Equatable {
@@ -5,8 +5,8 @@
// Short-form presets may emit a new time range after ~30 s; treating the
// latest partial as the full transcript drops earlier segments.
import Foundation
import CoreMedia
import Foundation
/// Combines volatile partials and finalized segments from
/// `DictationTranscriber.results` into a single growing transcript.
@@ -13,8 +13,10 @@ public enum UtteranceBatchFallbackPolicy {
public static func shouldRunBatchFallback(
stitchedFinal: String,
partialSnapshot: String,
recognitionFailed: Bool = false,
minimumCharacterAdvantage: Int = defaultCharacterAdvantage
) -> Bool {
if recognitionFailed { return true }
let final = stitchedFinal.trimmingCharacters(in: .whitespacesAndNewlines)
let partial = partialSnapshot.trimmingCharacters(in: .whitespacesAndNewlines)