feat(keyboard): improve typing, voice flow, and polish reliability

Reduce extension memory pressure and delivery races while adding richer candidates, tactile feedback, and safer two-level creative polishing.
This commit is contained in:
Rocky
2026-08-05 21:39:31 +08:00
parent 38e5ad570d
commit 31f5937a7f
177 changed files with 8343 additions and 3904 deletions
+95 -26
View File
@@ -51,8 +51,8 @@ settings:
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS: YES
STRING_CATALOG_GENERATE_SYMBOLS: YES
CLANG_CXX_LANGUAGE_STANDARD: c++17
MARKETING_VERSION: "1.5.0"
CURRENT_PROJECT_VERSION: "33"
MARKETING_VERSION: "1.6.0"
CURRENT_PROJECT_VERSION: "44"
# 签名配置来自 Signing.local.xcconfiggitignored,不会被覆盖)
# 项目级签名 xcconfig,适用于所有 target
@@ -107,6 +107,23 @@ targets:
- path: OSGKeyboard/Resources/Fonts/MaterialIcons-Regular.ttf
- path: OSGKeyboard/Resources/PrivacyPolicy.html
- path: OSGKeyboard/PrivacyInfo.xcprivacy
# Host-only heavy assets — keep out of the keyboard extension Shared framework.
# CLM uses a unique iOS-only path (`HostCLM/`): XcodeGen dedupes identical
# file paths across iOS/Mac, which previously left the iOS app without CLM.
- path: OSGKeyboard/Resources/Typing/Rime/osg_pinyin.dict.yaml
- path: OSGKeyboard/Resources/Typing/Rime/manifest.json
- path: OSGKeyboard/Resources/HostCLM/v1/OSGKeyboardCLM.bin
- path: OSGKeyboard/Resources/HostCLM/v1/compiled-manifest.json
- path: OSGKeyboard/Resources/LocalASR/local-asr-catalog.json
- path: OSGKeyboard/Resources/Typing/Licenses/NOTICE.txt
- path: OSGKeyboard/Resources/Typing/Licenses/LICENSE.txt
- path: OSGKeyboard/Resources/Typing/Licenses/LICENSE-PINYIN-SIMP-APACHE.txt
- path: OSGKeyboard/Resources/Typing/Licenses/LICENSE-JIEBA-MIT.txt
- path: OSGKeyboard/Resources/Typing/Licenses/LICENSE-PHRASE-PINYIN-DATA-MIT.txt
- path: OSGKeyboard/Resources/Typing/Licenses/LICENSE-PINYIN-DATA-MIT.txt
- path: OSGKeyboard/Resources/Typing/Licenses/THIRD_PARTY_NOTICES.md
- path: OSGKeyboard/Resources/Typing/Licenses/third-party-notices.zip
- path: OSGKeyboard/Resources/Typing/Licenses/LIBRIME-COMBINED-NOTICES.txt
info:
path: OSGKeyboard/Info.plist
properties:
@@ -212,10 +229,15 @@ targets:
dependencies:
- target: OSGKeyboardShared
embed: true
- target: OSGKeyboardHostSupport
embed: true
- target: OSGKeyboardExt
# Keyboard Extension is a plugin of the main App; embed it.
embed: true
buildPhase: embedAppExtensions
- target: OSGKeyboardLiveActivity
embed: true
buildPhase: embedAppExtensions
- sdk: Speech.framework
- sdk: ActivityKit.framework
- sdk: StoreKit.framework
@@ -327,30 +349,22 @@ targets:
- "en.lproj"
- "zh-Hans.lproj"
- "**/*.swift.example"
- "Resources/**"
- path: OSGKeyboardShared/en.lproj/Shared.strings
buildPhase: resources
- path: OSGKeyboardShared/zh-Hans.lproj/Shared.strings
buildPhase: resources
# Prefer sources+buildPhase over target-level `resources:` — the latter
# was not emitting Copy Bundle Resources entries for this framework.
- path: OSGKeyboardShared/Resources/Typing/English/english_lexicon.tsv
buildPhase: resources
- path: OSGKeyboardShared/Resources/Typing/English/english_bigrams.tsv
buildPhase: resources
- path: OSGKeyboardShared/Resources/PolishStyles
buildPhase: resources
- path: OSGRimeBridge
excludes:
- "include/**"
resources:
- path: OSGKeyboardShared/Resources/CustomLanguageModel/v1/OSGKeyboardCLM.bin
- path: OSGKeyboardShared/Resources/CustomLanguageModel/v1/compiled-manifest.json
- path: OSGKeyboardShared/Resources/LocalASR/local-asr-catalog.json
- path: OSGKeyboardShared/Resources/Typing/NOTICE.txt
- path: OSGKeyboardShared/Resources/Typing/LICENSE.txt
- path: OSGKeyboardShared/Resources/Typing/LICENSE-PINYIN-SIMP-APACHE.txt
- path: OSGKeyboardShared/Resources/Typing/LICENSE-JIEBA-MIT.txt
- path: OSGKeyboardShared/Resources/Typing/LICENSE-PHRASE-PINYIN-DATA-MIT.txt
- path: OSGKeyboardShared/Resources/Typing/LICENSE-PINYIN-DATA-MIT.txt
- path: OSGKeyboardShared/Resources/Typing/THIRD_PARTY_NOTICES.md
- path: OSGKeyboardShared/Resources/Typing/third-party-notices.zip
- path: OSGKeyboardShared/Resources/Typing/LIBRIME-COMBINED-NOTICES.txt
- path: OSGKeyboardShared/Resources/Typing/Rime/osg_pinyin.dict.yaml
- path: OSGKeyboardShared/Resources/Typing/Rime/manifest.json
- path: OSGKeyboardShared/Resources/Typing/English/english_lexicon.tsv
- path: OSGKeyboardShared/Resources/Typing/English/english_bigrams.tsv
info:
path: OSGKeyboardShared/Info.plist
settings:
@@ -375,6 +389,33 @@ targets:
dependencies:
- package: Librime
product: RimeStatic
# Host-only support framework (ASR / CLM / Cloud / Charts / StoreKit).
# Keyboard extension does NOT link this — keeps Speech/AVFoundation/Charts
# out of the extension jetsam budget.
OSGKeyboardHostSupport:
type: framework
platform: iOS
sources:
- path: OSGKeyboardHostSupport
info:
path: OSGKeyboardHostSupport/Info.plist
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.osgkeyboard.ios.hostsupport
TARGETED_DEVICE_FAMILY: "1,2"
DEFINES_MODULE: YES
SKIP_INSTALL: YES
BUILD_LIBRARY_FOR_DISTRIBUTION: NO
DYLIB_INSTALL_NAME_BASE: "@rpath"
APPLICATION_EXTENSION_API_ONLY: NO
ENABLE_MODULE_VERIFIER: YES
CODE_SIGNING_ALLOWED: NO
CODE_SIGNING_REQUIRED: NO
CODE_SIGN_IDENTITY: ""
dependencies:
- target: OSGKeyboardShared
embed: false
- sdk: Speech.framework
- sdk: AVFoundation.framework
- sdk: Charts.framework
@@ -392,6 +433,7 @@ targets:
path: OSGKeyboardTests/Info.plist
dependencies:
- target: OSGKeyboard
- target: OSGKeyboardHostSupport
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.osgkeyboard.ios.tests
@@ -405,6 +447,9 @@ targets:
platform: iOS
sources:
- path: OSGKeyboardExtTests
# Host-only dict fixture for librime deploy tests (not linked into Ext).
- path: OSGKeyboard/Resources/Typing/Rime/osg_pinyin.dict.yaml
buildPhase: resources
info:
path: OSGKeyboardExtTests/Info.plist
dependencies:
@@ -465,36 +510,60 @@ targets:
- "AppIcon.appiconset"
- path: OSGKeyboardMac
- path: OSGKeyboard/Services/OpenSourceLicenseCatalog.swift
- path: OSGKeyboardHostSupport
excludes:
# iOS SpeechAnalyzer / AVAudioSession capture — Mac has its own paths.
- "Services/ASRService.swift"
- "Services/CloudASR/CloudASRService.swift"
- "Services/FlowContinuousCapture.swift"
- "Services/LiveDictationController.swift"
- "Models/AudioBufferSnapshot+AVFoundation.swift"
- "Info.plist"
- path: OSGKeyboardShared
excludes:
- "en.lproj"
- "zh-Hans.lproj"
- "Info.plist"
- "**/*.swift.example"
- "Resources/**"
- "DesignSystem/WaveformView.swift"
- "DesignSystem/TranslationChip.swift"
- "DesignSystem/RecordButton.swift"
- "Services/ASRService.swift"
- "Services/CloudASR/CloudASRService.swift"
- "Services/FlowContinuousCapture.swift"
- "Services/LiveDictationController.swift"
- "Services/KeyboardState.swift"
- "Services/CursorNavigation.swift"
- "Models/MicVoiceAvailability+Keyboard.swift"
- "Models/TypingInputConfiguration.swift"
- "Typing/**"
- "Utilities/ProgressiveDictationTranscriptAccumulator.swift"
- path: OSGKeyboardShared/en.lproj/Shared.strings
buildPhase: resources
- path: OSGKeyboardShared/zh-Hans.lproj/Shared.strings
buildPhase: resources
- path: OSGKeyboardShared/Resources/PolishStyles
buildPhase: resources
- path: OSGKeyboard/Resources/CustomLanguageModel/v1/phrases.tsv
buildPhase: resources
- path: OSGKeyboardShared/Resources/CustomLanguageModel/v1/OSGKeyboardCLM.bin
- path: OSGKeyboard/Resources/CustomLanguageModel/v1/OSGKeyboardCLM.bin
buildPhase: resources
- path: OSGKeyboardShared/Resources/CustomLanguageModel/v1/compiled-manifest.json
- path: OSGKeyboard/Resources/CustomLanguageModel/v1/compiled-manifest.json
buildPhase: resources
- path: OSGKeyboard/Resources/PrivacyPolicy.html
buildPhase: resources
- path: OSGKeyboardShared/Resources/LocalASR/local-asr-catalog.json
- path: OSGKeyboard/Resources/LocalASR/local-asr-catalog.json
buildPhase: resources
- path: OSGKeyboard/Resources/Typing/Licenses/LIBRIME-COMBINED-NOTICES.txt
buildPhase: resources
- path: OSGKeyboard/Resources/Typing/Licenses/LICENSE-PINYIN-SIMP-APACHE.txt
buildPhase: resources
- path: OSGKeyboard/Resources/Typing/Licenses/LICENSE-JIEBA-MIT.txt
buildPhase: resources
- path: OSGKeyboard/Resources/Typing/Licenses/LICENSE-PHRASE-PINYIN-DATA-MIT.txt
buildPhase: resources
- path: OSGKeyboard/Resources/Typing/Licenses/LICENSE-PINYIN-DATA-MIT.txt
buildPhase: resources
- path: OSGKeyboard/Resources/Typing/Licenses/LICENSE.txt
buildPhase: resources
- path: OSGKeyboard/Resources/Typing/Licenses/NOTICE.txt
buildPhase: resources
entitlements:
path: OSGKeyboardMac/OSGKeyboardMac.entitlements