assistant_actions_generator 0.0.18
assistant_actions_generator: ^0.0.18 copied to clipboard
build_runner generator for assistant_actions: turns annotated Dart actions, entities and App Schema adoptions into App Intents Swift for iOS and macOS.
0.0.18 #
- Generates
apple/AssistantWidgets.g.swift(writeAppWidgets) with extension-safeControlWidgets (@AssistantControl),WidgetConfigurationIntents (@AssistantWidgetConfig), andassistantControlsBundlewithoutFlutterFrameworklinkage, plusAssistantActionsAppGroup(appGroup:) andAssistantActionsAppIntentslookup forAssistantSiriTip. - Generates
FocusFilterAppContext(filterCriteriaParam:) and thefocusFilter.currentcold-start host handler (supporting schema entity parameters and availability guards). - Generates
AssistantPromptingIntentconformances anddecodersregistry entries for mid-callAssistantCall.requestValue/disambiguateacross primitives, enums, currency, measurements, plain entities and schema entities; generatesUndoableIntent+.undoregistry entries for plain@AssistantAction(undo: ...)functions; and generatesAssistantDonationsmethods anddonate.actioncases for adopted schema intents alongside plain actions. - Resolves adopted schema entity parameters (
T,T?,List<T>) on@AssistantActionand@AssistantFocusFilter,@Paramnumeric ranges / control styles / string input options / file UTTypes /DynamicOptionsProvider(with@IntentParameterDependencyand snapshot fallbacks),IntentCurrencyAmountandMeasurement<Unit...>value types, and conditionalWhen/SwitchparameterSummarybuilders. - Populates
CSSearchableItemAttributeSet(keywords,textContent,contentCreationDate,contentModificationDate) from Spotlight field annotations, emitsAssistantQuery.Filterpredicates fromSnapshotFilter, expands plainEntityPropertyQuerycomparators (Stringprefix/suffix/equal/notEqual,@AssistantEnum,Duration), and generates#if canImport(FoundationModels)FoundationModels.Toolstructs andAssistantFoundationTools.all(including currency, measurement and plain/schema entity parameters). - Needs assistant_actions 0.0.21.
0.0.17 #
- Generates
authenticationPolicyfromrequiresUnlock, raised to Apple's schema minimum where needed (system.open,journal.*and others need.requiresLocalDeviceAuthentication). Without it the output is unchanged. - Generates
parameterSummary, listing parameters the sentence leaves out under it, andDisplayRepresentationimages for entities and App Enum cases, with Spotlight thumbnails for local files. - Reply intents show their card through a generated
AssistantCardSnippetIntent(SnippetIntent, withAssistantCardButtonIntentfor its buttons) when the deployment target or the intent's own floor is iOS / macOS 26 (ShowsSnippetIntent). Below that, intents that opt in withcardButtonsuse it from 26 and the plain card view before; other intents' output is unchanged. - Build-time checks for summary placeholders,
summariesandcardButtonsintent names, SF Symbol names and@EntityImage()types. tool/validate_schemas.dartadopts every schema with unlock policies, summaries, images and card buttons.- Needs assistant_actions 0.0.20.
0.0.16 #
- Every generated entity is
Transferable: as text, a file entity also as its file, and with the exports Apple's query schemas ask for when the member is mapped (IntentValueRepresentation, iOS / macOS 26.4). - Importing query schemas become
IntentValueQuerys (withmaps.placeIntentValueQueryon, the processor reports "Start Navigation" as implemented), answered by the handler while Dart runs, else from the published items. - Deep links:
url:makes aURLRepresentableEntity, and itssystem.openaURLRepresentableIntentthat opens the link (App Shortcuts for it, with@IntentShortcut, keep working). IntentValueRepresentationexports and the Visual Intelligence query are inside#if compiler(>=6.4), so the generated code builds with Xcodes before 27 too.- Plain actions and snapshot answers are
PredictableIntents; generatedAssistantDonationsand the donation host calls. Focus filters are left out. AssistantActionsAppHostCalls: on-screen entity identifiers and donations.- Visual Intelligence search: one
IntentValueQueryover aSemanticContentDescriptor(a union of the types from iOS 27) and the registry'svisualSearchcallback. Queries start the headless engine with@AssistantBackground(), else wait briefly for the app's Dart, then answer from the published items. tool/export_catalog.dartexportsquerySchema;tool/validate_schemas.dartturns on every importing query, deep links and Visual Intelligence search, adds a plain entity and action, and reports queries.- Needs assistant_actions 0.0.19.
0.0.15 #
- Every live intent (
Runs.withFlutterand Live Activity actions, live schema calls and replies, record intents) calls Dart throughcallDart:ProgressReportingIntent,CancellableIntentfrom 26.4, andLongRunningIntent(27) withlongRunning/@AssistantLongRunning(). - From a deployment target of iOS 26 / macOS 26 (the plugin's
Package.swift, or theios_deployment_target/macos_deployment_targetoptions), live intents declaresupportedModes(.foreground(.dynamic),.foregroundfor those that open the app,[.background, .foreground(.dynamic)]with@AssistantBackground()) instead of the deprecatedForegroundContinuableIntent, per platform. Warning-free at 17 / 14, 26 and mixed targets. SyncableEntityfor syncable schemas and@AssistantSyncable();IndexedEntityQuery(27) on every entity query;UndoableIntentwith@AssistantUndoable(), including inbox changes that say a dialog.files.filewithFileEntityIdentifierids and all fivefiles.*intents.CancellableIntent,LongRunningIntent,SyncableEntityandIndexedEntityQueryconformances are inside#if compiler(>=6.4), so the generated code still builds with Xcodes before 27, whose SDKs lack them.tool/validate_schemas.dartadoptsfiles.file, makes every class undoable and long-running, and takes--deployment=26.0.- Needs assistant_actions 0.0.18.
0.0.14 #
- With an
@AssistantBackground()function, writes the headless engine's entrypoint (assistantActionsBackgroundMain) andAssistantActionsAppBackground. Live intents that don't need the app's screen (Runs.withFlutteractions, including those returning values, replies, confirmations and Live Activity actions, and live schema calls and replies) callAssistantBackground.prepare()instead of asking to open the app, falling back to the foreground if Dart can't start. They declaresupportedModes[.background, .foreground(.dynamic)]from iOS 26 and keepForegroundContinuableIntentbefore. Intents that open the app or record audio still come to the foreground. Queued intents, Focus filters and deferred Live Activity actions apply right away on the headless engine. @AssistantAction(opensApp: true).tool/validate_schemas.dartsets up background execution;--no-backgroundchecks the output without it.- Without
@AssistantBackground(), the output is unchanged. - Needs assistant_actions 0.0.17.
0.0.13 #
- Generates App Enums, the new action parameter types and their defaults,
and
ReturnsValueresults, including withAssistantReply<T>(withShowsSnippetViewandrequestChoice). Availability follows places, schema enums and schema entities. Confirmations, dialogs and Focus filter summaries say the new parameter types; Focus filters take them too. - App Shortcuts: phrases naming entity and enum parameters, schema intents
(
@IntentShortcut) behindif #available/#if os, the tile color, and theAssistantActionsAppShortcutsclass that refreshes entity phrases. Generated types the Runner or public actions reach are made public. - Checks at build time: phrase parameters, Apple's limit of 10 App
Shortcuts, hidden actions as shortcuts, deferred or Live Activity actions
returning values, unsupported parameter and result types, placeholders
Siri can't say, and
@IntentShortcutplacement. - Needs assistant_actions 0.0.16.
0.0.12 #
- Generates Focus filters from
@AssistantFocusFilter, checking that each parameter is nullable or has a constant default. liveActivity: trueactions conform toLiveActivityIntenton iOS, and call Dart without coming forward when it's already running. They can also return anAssistantReply. On aSnapshotAnswerthe option is a build error.
0.0.11 #
- Generates
requestConfirmation(deletes by default),ProvidesDialogfromdialogstemplates,ShowsSnippetViewresult cards, andrequestChoicefor intents that use replies. - Checks intent names, placeholders and whether an intent can reply, at build time.
tool/validate_schemas.dartexercises these options on every other intent.- Needs assistant_actions 0.0.14.
0.0.10 #
- Maps people, places, files, recurrence rules and unions to the runtime's Dart types, for parameters, results and fields. Unions encode with their case and decode by case; entity cases resolve when the app adopts the entity.
- Union results (
audio.recognizeAudio): the handler returnsAssistantUnions. - List members of any supported type map to Dart lists; sets decode as Swift
Sets. LinkMetadatais the Swift type for link previews (iOS / macOS 26.4).- Validated: 73 of 74 public entities and 167 of 172 intents adopted at once, accepted by Apple's metadata processor on macOS and the iOS simulator.
- Needs assistant_actions 0.0.12.
0.0.9 #
- Generates every shape in Apple's schema catalog, not only create, update
and delete:
- Calls: any other intent calls a handler method named after it, with
its parameters as Dart values (enums,
Duration, entity ids, lists). Intents that open the app, record audio or return an item run live (from the foreground on iOS;supportedModes = .foregroundfrom iOS 26). Others are queued in the inbox, likeRuns.deferred. Results are item ids that Swift looks up. - Domain intents (
camera.*,system.searchInApp,assistant.activate) get a<Domain>AssistantHandlerand a registry parameter. system.opengenerates an open intent per adopted entity, unless the entity's own domain has one (Apple allows one per target).- Unions become
@UnionValueenums. Person, file, place, recurrence, link and scene members get their Swift types (IntentPerson,IntentFile, …). These aren't passed to Dart yet; the docs list them. - Unique entities (
maps.navigationSession) get aUniqueAppEntityQuery. - Entity references: a member that is another adopted entity maps to its id. Swift resolves it from the snapshot, one level deep.
- Clear build errors for what isn't supported: file entities (
files.file), union results, results of entities the app doesn't adopt, and app-defined enum cases the app didn't give.
- Calls: any other intent calls a handler method named after it, with
its parameters as Dart values (enums,
- Availability: enums use their own catalog availability, a platform missing
from the catalog is unavailable (
assistant.activateis iOS 26.2 only), andvalueState(clearing a field) raises update intents to iOS 18.2 / macOS 15.2. - Create/update/delete are decided by the intent's verb and shape, so
clock.cancelTimerandphotos.addAssetsToAlbumbecome calls rather than deletes or updates. tool/export_catalog.dartexports every public domain by default and skips private or deprecated schemas, including ones that use a private schema.tool/validate_schemas.dartadopts every schema in a throwaway app and runs the builder,flutter analyzeand Apple'sappintentsmetadataprocessorfor macOS and the iOS simulator.- Needs assistant_actions 0.0.11.
0.0.8 #
- Supports Apple's
journalschemas (assistant_actions 0.0.10): create, update and delete forjournal.entry, with Spotlight indexing (title, text content, creation date) and property queries on the mapped members. - Record intents: a schema intent that adopts
AudioRecordingIntent, takes no parameters and is named after the entity (journal.createAudioEntry) is an opt-in flag on the entity annotation. It generates an intent that brings the app forward on iOS (requestToContinueInForeground) or activates it on macOS, then calls the handler's newstartAudioEntry()live over the FFI bridge. - Availability follows the Swift types a schema uses, not only Apple's
catalog:
PlaceDescriptor(journal entrylocation) needs iOS / macOS 26, so journal types are generated for 26 though the schema dates from 18. export_catalog.dartexports each intent's system protocols and_openApp.
0.0.7 #
- Generated entity queries are also
EntityPropertyQuery, modelled on Apple's Notes, so Siri can filter and sort entities:- schema entities, for mapped members: bools take equal; dates and date
components take
==,!=,<,<=,>,>=and between; strings and attributed strings take contains. They sort by the title member and dates. Queryable members get@Property(title:)from the catalog, which Apple's metadata needs. @AssistantEntitytypes: the title takes contains, and published bool, number, date and string fields become properties with the same comparators. They sort by title, numbers and dates.
- schema entities, for mapped members: bools take equal; dates and date
components take
- Needs assistant_actions 0.0.8 or later.
0.0.6 #
- Generated entity queries also conform to
EnumerableEntityQuery(allEntities(): everything published plus Siri's pending changes), andentities(matching:)uses the runtime's forgivingAssistantMatchwith the type's own words (class, schema and app names) ignored. - Needs assistant_actions 0.0.7 or later.
0.0.5 #
- Generated entities conform to
IndexedEntity(iOS 18+ / macOS 15+). Schema entities fill Spotlight attributes from the catalog's indexing keys (title, display name, text content, due, completion, creation and modification dates);@AssistantEntitytypes use their title and subtitle. - Generates
AssistantActionsAppSpotlight, which assistant_actions 0.0.6 calls to index each collection. - Needs assistant_actions 0.0.6 or later.
0.0.4 #
- Generated Swift compiles without warnings:
valueStateswitches handle@unknown default(treated as unchanged), which Swift 6 mode would otherwise reject;- update intents with no clearable field declare
clearedas a constant.
0.0.3 #
- Generates snapshot-answer actions (
@AssistantActionon aconst SnapshotAnswer<T>) and checks their fields and value types at build time. - Update intents read
$param.valueState, so Siri clearing an optional field arrives as cleared, not unchanged;…Valuesclasses getclearedand<field>Cleared. @AssistantEntityclasses publish their String, int, double, bool, DateTime and Uri fields, so snapshot answers can use them.- Needs assistant_actions 0.0.5 or later, and says so if it's older.
- README: install with
flutter pub add.
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.