feat(keyboard): expand contextual skills and managed flows

Add local clipboard intent recommendations, webpage and phone actions, and safer host handoffs. Refine managed gateway, catalog refresh, onboarding, and adaptive polish behavior.
This commit is contained in:
Rocky
2026-08-23 14:02:33 +08:00
parent 7df5bbdaa0
commit 2cc81c4628
68 changed files with 10368 additions and 7765 deletions
+22
View File
@@ -121,5 +121,27 @@ final class AIHintPoolTests: XCTestCase {
"""
let pack = try JSONDecoder().decode(AIHintPack.self, from: Data(json.utf8))
XCTAssertEqual(pack.cards.first?.displayText, "全网热点:很长")
XCTAssertEqual(pack.cards.first?.taskKind, .aiQuestion)
}
func testCurrentInformationHintDecodesExplicitSearchIntent() throws {
let json = """
{"id":"hot","text":"","prompt":"","category":"society","locale":"zh","taskKind":"current_information_question"}
"""
let card = try JSONDecoder().decode(AIHintCard.self, from: Data(json.utf8))
XCTAssertEqual(card.taskKind, .currentInformationQuestion)
}
func testLocalTimeSensitiveHintsRequireCurrentInformation() throws {
let cards = AIHintLocalCatalog.cards(locale: "zh")
let stocks = try XCTUnwrap(cards.first { $0.id == "local-zh-stocks" })
let brief = try XCTUnwrap(cards.first { $0.id == "local-zh-daily-brief" })
let concept = try XCTUnwrap(cards.first { $0.id == "local-zh-encyclopedia" })
XCTAssertEqual(stocks.taskKind, .currentInformationQuestion)
XCTAssertEqual(brief.taskKind, .currentInformationQuestion)
XCTAssertEqual(concept.taskKind, .aiQuestion)
}
}