Version 1.4.0 (current)
Call app interfaces
CLI, HTTP, and app UI operate on the same real business state.
An app business interface lets another program call the app’s methods. Use the CLI (command-line interface) and HTTP examples below to verify that service results and the app UI share the same state.
Prerequisites
Continue from App generation with your my_score test app, or choose an existing test app that exposes the same methods. The app must provide api.mjs, and the device Node service must listen on 127.0.0.1:8765. This tutorial uses the experimental React/WebView service; native Java apps using a ContentProvider have a different interface.
The first two steps run in the same device shell. The third runs on your computer. my_score is the service app ID, while org.agentos.myscore is the Android package name; they are not interchangeable. Replace the ID consistently when using another app.
This service executes trusted business code. It does not provide cross-app sandboxing or system-wide authorization isolation. Start with discovery and a read-only method.
Call and verify
Discover and read state
/data/local/agentos/light-app-lab/free-app-kit/mini-app list
app_id=my_score
/data/local/agentos/light-app-lab/free-app-kit/mini-app describe "$app_id"
/data/local/agentos/light-app-lab/free-app-kit/mini-app call "$app_id" score.state '{}'Confirm that describe lists score.state, score.add, and score.undo, then save the initial score returned by score.state. If the app or methods are missing, resolve that mismatch before writing.
Change your test app state
Open your test app before calling these methods. score.add changes the score; check the UI and query score.state again before undoing. Use a new request key for a new change. Reuse a key only when deliberately testing replay of the same request.
The payload below assumes describe declares team A, integer delta, and an empty parameter object for undo. Generated apps can define a different contract; adjust the parameters to the discovered schema before using this example.
/data/local/agentos/light-app-lab/free-app-kit/mini-app call "$app_id" score.add '{"team":"A","delta":5}' --key docs-score-new-1
/data/local/agentos/light-app-lab/free-app-kit/mini-app call "$app_id" score.state '{}'After checking the UI against the returned state, undo and verify the score returns to its initial value:
/data/local/agentos/light-app-lab/free-app-kit/mini-app call "$app_id" score.undo '{}'
/data/local/agentos/light-app-lab/free-app-kit/mini-app call "$app_id" score.state '{}'Connect from a computer
adb -s emulator-5582 forward --no-rebind tcp:8765 tcp:8765
curl http://127.0.0.1:8765/v1/apps
curl http://127.0.0.1:8765/v1/apps/my_scoreReplace emulator-5582 with the serial from adb devices. The HTTP example targets the same my_score app. After inspection, remove the forward created by this step with adb -s emulator-5582 forward --remove tcp:8765.
The experimental HTTP service has /v1/openapi.json. It describes app business interfaces only. The system SDK's JSON Schema is not this HTTP OpenAPI. Neither establishes that the complete OS API is publicly available.
Verify the result
JSON returns the business result, revision, and replay marker. The open app updates automatically. For example, team A goes from 3 to 8 and back to 3 after undo. Idempotent replay, which repeats the same request without applying the change again, does not add points again.
Method contract
Apps define their own method names, parameter schemas (data-shape constraints), result descriptions, mutates flags, and handlers. The UI queries and changes state through the same methods. The current hook refreshes by polling, not event push. Result schemas support discovery and documentation; result validation is not yet enforced.
Limits and troubleshooting
Unknown methods, invalid parameters, and conflicts involving repeated keys need actual errors. The service retains the latest 100 completed-call receipts for idempotent replay. It does not guarantee strict exactly-once execution if business execution crashes. A --no-rebind failure means a local port is occupied; do not replace an unrelated service.
Next steps
Research preview · Current availability
Report an issue or give feedback
Delivery to the maintenance queue does not mean it has been handled. Feedback is retained for 90 days.
Built with Fumadocs