assistant_actions 0.0.21
assistant_actions: ^0.0.21 copied to clipboard
Siri, Shortcuts, Spotlight and Apple Intelligence for Flutter on iOS and macOS. Declare actions and entities in Dart and adopt Apple's App Schemas with typed annotations.
0.0.21 #
- App Group shared container:
appGroup: 'group.…'on@AssistantActionsApp(and its new@AssistantAppalias) routes published snapshots, queued inbox changes and Spotlight state through the shared App Group container andUserDefaults(suiteName:)(AssistantAppGroup.swift), falling back cleanly to Application Support andUserDefaults.standard. - Controls & configurable widgets:
@AssistantControlgenerates extension-safeControlWidgets (ControlWidgetButtonandControlWidgetToggle) for Control Center, Lock Screen and the Action Button, and@AssistantWidgetConfiggeneratesWidgetConfigurationIntents intoapple/AssistantWidgets.g.swift(wired intoAssistantWidgetsbydart run assistant_actions:install --widgets). - Interactive Live Activities & APNs push tokens:
AssistantLiveActivityButtononAssistantActivityContent.buttonsrenders up to 2 interactiveButton(intent:)controls on the Lock Screen and Dynamic Island;enablePush: trueonstart,AssistantLiveActivity.pushToStartTokens(),pushToken()andpushTokens()expose ActivityKit APNs hex tokens. - Focus filters:
filterCriteriaParam:on@AssistantFocusFilterpopulatesFocusFilterAppContext(notificationFilterPredicate:);AssistantActions.currentFocusFilter()andsyncCurrentFocusFilter()query the active Focus filter on cold launch. - In-app discovery widgets:
AssistantSiriTip,AssistantShortcutsLink, andAssistantActions.openShortcutsApp()(AssistantPlatformViews.swift). - User-facing errors & mid-call conversational prompts: throwing
AssistantError(message)fails the intent cleanly in Swift with the exact localized message (stopping multi-step Shortcuts without a generic prefix);AssistantCall.currentadds mid-executionconfirm,choose,requestValue<T>anddisambiguate<T>prompts. - Plain action undo & schema donations:
undo: myUndoFnon@AssistantActionmakes plain actionsUndoableIntents (forwarding inputs and optionalresult), andAssistantDonationsnow includes typed donation methods for adopted schemacall,create,update,append,deleteandrecordintents. - Schema entity parameters, rich
@Paramoptions & measurements: adopted schema entity classes work as parameters (T,T?,List<T>) on@AssistantActionand@AssistantFocusFilter;@Paramaddsmin/max,controlStyle,multiline,capitalization,keyboardType,supportedContentTypes, andoptions:+snapshotField:(DynamicOptionsProvider); addedAssistantCurrencyand typedAssistantLength,AssistantMass,AssistantTemperature,AssistantVolume,AssistantSpeedandAssistantEnergywrappers. - Conditional summaries & richer result cards:
summaries:on@AssistantAction(SummaryWhenandSummarySwitch), plusAssistantCardToggle(toggles:) and remoteimageUrl:onAssistantCard. - Spotlight attributes,
SnapshotFilter& richer property queries:@EntityKeywords(),@EntityBody(),@EntityCreatedAt()and@EntityUpdatedAt()on@AssistantEntityclasses;SnapshotFilterpredicates (equals,notEquals, comparisons,contains,startsWith,isNull,isNotNull,isToday,isPast,isFuture) onSnapshotAnswer(filters: [...]); richerEntityPropertyQuerycomparators on plain entities; and Apple IntelligenceFoundationModels.Toolbridging (AssistantFoundationTools.all). Generator API 14. - Needs assistant_actions_generator 0.0.18.
0.0.20 #
requiresUnlock:(Unlock.notRequired/required/onThisDevice) on@AssistantActionsApp,@AssistantAction,@AssistantEntity, schema entity annotations and…Intentsannotations keeps Siri from running intents on a locked device. Schema intents that Apple requires to be stricter (system.open,journal.*, …) are raised toonThisDevice. Entity queries can't be protected (App Intents has no setting for them), so Siri can still look up published titles on a locked device.summary:on@AssistantActionandsummaries:on schema annotations show actions in Shortcuts as sentences ('Add {title} to {list}').systemImage:on@AssistantEntity, schema entities andCaseTitle, and the new@EntityImage()field annotation (a path,file:orhttps:URL), give items images in Siri, Spotlight and Shortcuts.- Interactive result cards:
AssistantCard(buttons: [AssistantCardButton('Add to list', action: 'toggleShoppingList', args: {...})]). On iOS / macOS 26 a button runs the Dart action without leaving Siri (headless with@AssistantBackground()), and the card in the action'sAssistantReplyreplaces the card. Buttons show when the app targets iOS 26 and macOS 26, or when the intent opts in with@AssistantAction(cardButtons: true)orcardButtons: {'intent'}on a schema annotation; otherwise, and below 26, cards show without them. A button naming an unknown action throwsArgumentError. - Swift:
AssistantCardStore,AssistantCard.buttons/jsonandAssistantCardView(_:intent:). - The bundled catalogs include each intent schema's minimum
authenticationPolicy; the schema libraries forwardrequiresUnlock,summaries,systemImageandcardButtons. Generator API 13. - Needs assistant_actions_generator 0.0.17.
0.0.19 #
AssistantActions.showing(item)/stopShowing(): tell Siri and Apple Intelligence which entity is on screen, so "remind me about this" means it (anNSUserActivitywithappEntityIdentifieron the key window, iOS 18.2+ / macOS 15.2+). File entities are identified by theirFileEntityIdentifier.AssistantActions.donate(item)donates an item the user opened (itssystem.openintent); the generatedAssistantDonationsdonates actions the user runs in the app, with the functions' parameters (entities and lists of them, enums, lists, durations, people, places, files, defaults).url:andvisualSearch:on@AssistantEntityand every schema entity annotation (SchemaEntity.url/visualSearch, forwarded by the schema libraries alongsidedialogs,confirmandreplies).AssistantSemanticContent: what Visual Intelligence saw (its labels, and the image as a PNGAssistantFile).visualIntelligence.semanticContentSearchnow passes it to Dart, andAssistantValue.semanticContentdecodes it.- The catalogs include Apple's query schemas (
queries): exporting ones (journal.entryTransferable,maps.placeTransferable, the attendee, message person and phone person ones) and importing ones, which are opt-ins on the entity annotation (@MapsPlace(placeIntentValueQuery: true)). - Swift:
AssistantContext,AssistantTransferError,AssistantValues.text/saveFile/references/encode(SemanticContentDescriptor), and label and place matching inAssistantMatch.EntityCodec.idOf. Generator API 12. - Visual Intelligence needs Xcode 27 (Swift 6.4); with older Xcodes it is left out and the package still builds.
- Needs assistant_actions_generator 0.0.16.
0.0.18 #
files.fileis supported: a file entity's@EntityId()is the file's path (or afile://URL); Swift gives Siri aFileEntityIdentifierfor it (AssistantFileIDs) and finds published items from Siri's identifiers.@AssistantSyncable([bool]):SyncableEntity(iOS / macOS 27). The catalog marks the schemas Apple's own apps make syncable (notes.note,reminders.list,calendar.event, …), which are syncable by default.@AssistantUndoable():UndoableIntent(26). Swift'sAssistantUndoqueues the inverse of creates, updates and deletes; other intents callundo…handler methods.AssistantCall.current: live calls report progress (reportProgress) and see cancellation (isCancelled,whenCancelled).@AssistantAction(longRunning:)and@AssistantLongRunning()make themLongRunningIntents (27). SwiftAssistantLiveCallandcallDart.installgives the generated plugin the Runner's deployment targets, so the generated Swift can drop what they deprecate.AssistantInbox.createtakes an optionalid.- Cancellation and long-running calls need Xcode 27 (Swift 6.4), whose SDKs
have
CancellableIntentandLongRunningIntent; with older Xcodes live calls are plain ones, and the package still builds. - Needs assistant_actions_generator 0.0.15.
0.0.17 #
@AssistantBackground(): on iOS, Siri runs the app's Dart without opening the app. Mark the top-level function that builds the registry; when an intent needs Dart and the app has no Flutter engine, the runtime starts a headlessFlutterEngineat the generated entrypoint, registers the app's plugins on it (the Runner'sGeneratedPluginRegistrant, found by name, orAssistantBackground.registerPlugins), and answers there. No Runner changes are needed. The headless engine stopsAssistantBackground.shared.keepAliveseconds (30) after its last use, and as soon as it's idle once the app's own engine starts; Dart on it claims it over a host call, so it stands down if the app's engine started first.- With it, queued intents (
Runs.deferred, schema creates, updates, deletes and queued calls) are applied right away on the headless engine before Siri answers, unless@AssistantBackground(applyQueued: false). AssistantActions.inBackgroundandAssistantActions.startInBackground(called by generated code). SwiftAssistantBackground(prepare,applyInbox,keepAlive,registerPlugins).@AssistantAction(opensApp: true): aRuns.withFlutteraction that always comes to the foreground (and activates the app on macOS).- Needs assistant_actions_generator 0.0.14.
0.0.16 #
@AssistantEnumand@CaseTitle: the app's enums as App Enums, with case titles and synonyms.- Action parameters can be enums (the app's or schema enums such as
ClockTimerState), lists,Duration,AssistantPerson,AssistantPlaceandAssistantFile. Dart defaults become App Intents defaults. Runs.withFlutteractions can return values to Shortcuts (ReturnsValue): values,@AssistantEntityor schema entity items (by id), and lists. Return the value, anActionResult<T>(with a dialog), or anAssistantReply<T>(with a dialog and a card;chooseasks which item). Live Activity actions can't return values.@AssistantAction(searchKeywords:, isDiscoverable:).- App Shortcut phrases can name entity and enum parameters (
{recipe}). The runtime refreshes them afterAssistantActions.publishthroughupdateAppShortcutParameters()(AssistantShortcutParametersfinds the generatedAssistantActionsAppShortcutsby name). @IntentShortcut('domain.intent', ...)makes App Schema intents App Shortcuts.@AssistantActionsApp(shortcutTileColor:)andShortcutTileColor.dart run assistant_actions:installraises the Runner targets to iOS 17.4 / macOS 14.4, which App Shortcuts need forif #available(never lowering one). Rerun it in apps installed earlier.AssistantValue.encodeResult,AssistantReply.encodeValue; SwiftAssistantValues.result,AssistantValues.measurementandencode(Measurement<UnitDuration>?).- The README documents localizing titles and phrases with String Catalogs.
- Needs assistant_actions_generator 0.0.13.
0.0.15 #
- Focus filters:
@AssistantFocusFilteron a top-level function makes it the app's Focus filter (SetFocusFilterIntent). It runs live when Dart is running and is queued otherwise. - Live Activities (iOS):
AssistantLiveActivity.start / update / end / running / areEnabled, withAssistantActivityContentand the runtime's JSON-backedAssistantActivityAttributes, overAssistantHostCalls. dart run assistant_actions:install --widgetsadds anAssistantWidgetswidget extension with a generic Live Activity view: the files, the Xcode target embedded in Runner, andNSSupportsLiveActivities.@AssistantAction(liveActivity: true)makes the intent aLiveActivityIntenton iOS, which runs at once when Dart is already running.- The README documents what an app adds for Controls and widget configuration, which live in the widget extension, and for the Action button.
0.0.14 #
- Siri can confirm, speak results and show result cards.
@AssistantAction(confirm: 'Remove {recipe}?')asks before anything runs or is queued.- Schema annotations take
dialogs(spoken results, such as{'createReminder': 'Added {title}.'}),confirmandreplies. Delete intents confirm by default; turn that off withconfirmDeletes: false. AssistantReply(a dialog, anAssistantCard, andchoosefor picking among several items on iOS / macOS 26) forRuns.withFlutteractions and for live schema intents listed inreplies.- New runtime Swift:
AssistantCardView(SwiftUI),AssistantDialog,assistantConfirmandassistantChoose.
- Schema libraries are regenerated with the new annotation options.
- Needs assistant_actions_generator 0.0.11.
0.0.13 #
AssistantHostCalls: Dart runs Swift features by name (AssistantActions.callSwift, internal to the package) over one new Pigeon FFI method,invoke, so new features don't change the FFI surface. Swift registers handlers withAssistantHostCalls.register; generated code adds its own throughAssistantActionsAppHostCalls, found by name.- The
AssistantHosttest interface is unchanged; hosts that also run Swift calls implementAssistantHostCalls.
0.0.12 #
- People, places, files, recurrence rules and unions cross to Dart as
AssistantPerson,AssistantPlace,AssistantFile,AssistantRecurrenceandAssistantUnion, as intent parameters, results and entity fields. A file Siri passes is copied into Application Support (assistant_actions/files/), so its path still works for calls queued while the app wasn't running. - List members map to Dart lists (
List<AssistantFile>for a journal entry'smediaItems,List<String>for reminder tags). - So every public schema entity can be adopted except
files.file, which needs file-based ids (FileEntity). messages.destinationleaves out itsconversationcase, which Apple's metadata processor rejects.- Needs assistant_actions_generator 0.0.10.
0.0.11 #
- Every App Schema domain the SDK defines publicly: 23 typed libraries in
package:assistant_actions/schemas/(calendar,clock,camera,mail,photos,browser,books,presentation,spreadsheet,wordProcessor,system, … plusreminders,notesandjournal), from Xcode 27.2 (27B52, catalog c2d369abe24c). The 12 domains with no public schemas (home,health,playbackControls,voiceMemos, …) aren't exported. Seedoc/schemas.mdfor what each domain supports. - Only public, non-deprecated schemas are exported. Each catalog lists the
others under
skipped, with why.journal.searchis gone: Apple deprecated it forsystem.searchInApp. - Schema enums are Dart enums (
ClockTimerState). Enums whose cases the app defines (camera.captureMode) get an annotation for the app's own enum:@CameraCaptureMode() enum CaptureMode { photo, video }. @<Domain>Intents(...)(@CameraIntents,@SystemIntents) turns on the intents that belong to no entity.- Names carry their domain, so several libraries import together:
RemindersReminderField,FixedRemindersList,JournalEntryField. The reminders and notes names from before (ReminderField,FixedList,NoteField,FixedFolder, …) stay as aliases. - Field members that are other entities map to
Stringids (List<String>for lists). - Runtime values:
AssistantValue.enumeration/encodeEnum,duration/encodeDurationandlistin Dart;Duration, enum and id-list encoding in Swift. - Needs assistant_actions_generator 0.0.9.
0.0.10 #
journalApp Schemas (package:assistant_actions/schemas/journal.dart):@JournalEntryadoptsjournal.entrywithEntryField.title,.messageand.entryDate, and the create, update and delete intents.createAudioEntry: trueadoptsjournal.createAudioEntry: Siri brings the app forward and callsstartAudioEntry()on the generated handler; the app records.mediaItemsandlocationhave no Dart mapping yet, andjournal.searchisn't adopted. Exported from Xcode 27.2 (27B52, catalog c2d369abe24c), likeremindersandnotes.- The bundled catalogs record each schema intent's system protocols (such as
audioStarting) and whether it opens the app. - Journal needs assistant_actions_generator 0.0.8.
0.0.9 #
- Docs: bump the app's build number whenever the generated actions or
entities change. Siri caches App Intents per build number, so an app
rebuilt with the same number can keep failing with "Flow tool not found in
database" (
ToolDiscoveryError).dart run assistant_actions:installnow says so too.
0.0.8 #
AssistantPredicateandAssistantComparison: Siri's entity property comparisons ("open reminders", "reminders due today", "notes containing milk"), evaluated in Swift over the published snapshot plus Siri's pending changes, with sorting and limits. Text compares ignoring case and accents; a date naming a whole day covers all of it, so "due today" matches any time today, "before Friday" means before Friday starts and "after Friday" after it ends.DateComponentsisComparable(by the date it names), which App Intents' ordering comparators need for schema dates such as a reminder's due date.- Needs assistant_actions_generator 0.0.7.
0.0.7 #
AssistantMatch: forgiving search for generated entity queries. Searches are split into words; filler words and words naming the entity type, schema or app ("tasks", "reminders", "Mira") are ignored, and a search with nothing else left lists everything. Remaining words match case- and accent-insensitively in the title or any text field (so items Siri just created match too); if no item has all of them, items with any are returned. Fixes "do I have any tasks in
0.0.6 #
- Spotlight indexing: published entities are indexed with Core Spotlight
(
indexAppEntities, iOS 18+ / macOS 15+) whenever Dart publishes a collection or Siri creates, updates or deletes an item, and removed ones are deleted. Siri's planner finds "my reminders in App" through Spotlight, not only through entity queries. No app code is needed: the runtime finds the generated indexer by name. Needs assistant_actions_generator 0.0.5.
0.0.5 #
SnapshotAnswer<T>: put@AssistantActionon aconst SnapshotAnswer<T>and Siri answers from the items ofTlast published (plus changes Siri queued since), in Swift, without starting Flutter. Filter withwhere, order withsortBy, and format withitem/dialogtemplates. Needs assistant_actions_generator 0.0.3.- Schema updates can now clear optional fields: the generated
…Valuesclasses haveclearedand a<field>Clearedgetter per nullable field (for exampleTaskItemValues.dueClearedwhen Siri removes a due date). AssistantHostis exported, so tests can pass a fake toAssistantActions.start(registry, host: ...).
0.0.4 #
- README: install with
flutter pub addinstead of pinned versions, which listed anassistant_actions_generatorversion that doesn't exist.
0.0.3 #
- Dart and Swift now talk over FFI (Pigeon native interop) instead of a
platform channel. No API changes. Apps pick up
ffiandobjective_cas dependencies.
0.0.2 #
- Add repository and issue tracker links.
0.0.1 #
- First preview: iOS 17+ / macOS 14+.
- Actions (
@AssistantAction), entities (@AssistantEntity) and App Schema adoption forreminders.*andnotes.*with typed annotations. - Deferred actions and schema changes work without Flutter running, through a UserDefaults inbox that Dart applies on start and resume.