Expose AppFunctions for TMDB search and watchlist mutations#18
Open
odaridavid wants to merge 2 commits into
Open
Expose AppFunctions for TMDB search and watchlist mutations#18odaridavid wants to merge 2 commits into
odaridavid wants to merge 2 commits into
Conversation
Wires Smoovie into the Android 16+ AppFunctions surface so system agents (Gemini, Routines) can search TMDB and mutate the on-device watchlist without opening the app. - Bump compileSdk to 37; add androidx.appfunctions alpha02 + KSP compiler - Register app_metadata.xml describing the function-discovery contract - Implement SmoovieAppFunctions in androidMain wired to existing search/watchlist use cases via Koin; addToWatchlist is idempotent - Make SmoovieApplication an AppFunctionConfiguration.Provider Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
searchMovies,searchTvShows,listWatchlist,addToWatchlist,removeFromWatchlist.addToWatchlistis idempotent (it checks the current list before delegating toToggleWatchlistUseCase, which would otherwise remove an existing entry).androidMainknows about AppFunctions).Changes
gradle/libs.versions.toml:android-compileSdk36→37; addandroidx.appfunctions 1.0.0-alpha02+ three aliases.composeApp/build.gradle.kts: deps onandroidx.appfunctions{,-service},kspAndroidcompiler,ksp { arg("appfunctions:aggregateAppFunctions", "true") }.composeApp/src/androidMain/res/xml/app_metadata.xml: capability + operational-pattern description for agents.AndroidManifest.xml:<property android:name="android.app.appfunctions.app_metadata" .../>.appfunctions/SmoovieAppFunctions.kt(new): five@AppFunctionmethods +SmoovieTitle/SmoovieSearchPage@AppFunctionSerializabletypes with inline KDoc per property.PlatformModule.android.kt: KoinsingleforSmoovieAppFunctions.SmoovieApplication: implementsAppFunctionConfiguration.Provider, resolves the class viaKoinPlatform.getKoin().Notes
alpha02:@AppFunction/AppFunctionConfigurationlive underandroidx.appfunctions.service, andisDescribedByKDoc = true(referenced in the official docs) was removed — KDoc is now always parsed.MediaTypeis exposed as a String ("movie"/"tv") to match TMDB conventions and stay within@AppFunctionSerializable-supported types.compileSdk = 37. Suppressible viaandroid.suppressUnsupportedCompileSdk=37.0ingradle.propertiesif noisy.Test plan
./gradlew :composeApp:compileDebugKotlinAndroid(green locally)./gradlew :composeApp:compileCommonMainKotlinMetadata+compileKotlinIosSimulatorArm64(KMP didn't regress; green locally)./gradlew :composeApp:ktlintCheck(green locally)adb shell cmd app_function list-app-functions | grep dev.odaridavid.smoovie— confirm all five functions registeradb shell cmd app_function execute-app-function --package dev.odaridavid.smoovie --function "<searchMovies id>" --parameters '{"query":"Dune","page":1}'— returns titlesaddToWatchlistwith a tmdbId from the search; open the Watchlist tab — entry should appearaddToWatchlistwith same tmdbId — no duplicate (idempotency)removeFromWatchlist— entry disappears from the Watchlist tab🤖 Generated with Claude Code