Repository navigation
0.2.0
Pre-release
Pre-release
SiriAIKit no longer does auth. Keep your app's own networking and token storage, and wrap your existing API call in a Siri tool.
Breaking changes
- Removed:
ToolHTTPClient,HTTPMethod,TokenAuthenticator,KeychainTokenStore,TokenStore,Tokens,KeychainAccessibility. ToolErroris nowToolFailure:signedOut,timedOut,unreachable,failed..rejectedand.invalidResponsebecame.failed, and.keychainis gone.- Outcomes: "used saved token" and "refreshed after 401" are no longer recorded automatically.
Upgrading from 0.1.0
- Wrap your existing API call:
await tool.answer { … }ortry await tool.run { … }on aSiriTool. - Keep tokens in your own store, saved with
kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly. Check it at launch withKeychainLockCheck.warnIfLockedOut(service:)in debug builds. - Add details to outcomes from your code with
ToolOutcomeLog.standard.note("refreshed after 401").
The example app's DemoAPI.swift shows refreshing inside a Siri call: one refresh at a time, and sign out only on a rejected refresh.
New
SiriTool: keeps to Siri's time budget (10 seconds by default, or when Siri cancels), turns failures into sentences Siri can say, and records each call's outcome. It stops waiting at the deadline without cancelling your code, so a token refresh still saves.ToolOutcomeLog.note(_:): details per call, as in "succeeded (refreshed after 401)".KeychainLockCheck(debug only): warns when a Keychain item can't be read while the phone is locked.siri-ai-eval summarize: flags runs where Siri gave the right answer without calling your tool, which usually means it answered from the Spotlight index.expo-siri-ai-kit: an Expo config plugin (inexpo-plugin/) that adds SiriAIKit to your app target during prebuild and turns on the preview flag. Its npm release follows separately.
Verified on a device
iPhone 16 Pro, iOS 27.3 beta, Xcode 27.3 beta (27C5020n), using the example app:
| Evaluation | Real pass rate |
|---|---|
| Cart from the demo API | 5 of 5 |
| Cart after the one-minute token expires | 4 of 4 complete runs, refreshed in all 5 |
| Negative control, refresh off | 0 of 1, as it should |
In an Expo SDK 58 app using the plugin, a SiriAIKit tool passed 3 of 3 runs.
APIs may change before 1.0 while Apple's APIs are in beta.