Plain-English tasks run on your bot’s brain
phone.task (“open Settings and turn on dark mode”) now runs on the bot’s own model, on every kind of phone. Each step reads the screen, the bot’s brain picks one phone action (tap, type, swipe, back, home, key or open an app), Desktop runs it, and the loop repeats until the task is done, can’t be done, or reaches its step limit (15 by default, 40 at most). A task never sends texts or places calls; those stay separate tool calls that you approve. Before a task taps Pay or Delete, types into a password field or opens a bank app, it waits for you: see Approvals for sensitive phone actions. The wait is not counted in the task’s duration.
A bot passes its bot_id (or a brain as provider/model) so the task uses its model; without one, the task uses the default model. Google ARTEMIS is now only a fallback: Desktop uses it when Desktop’s local API can’t be reached, for an Android phone over adb, with GEMINI_API_KEY set.
The result says whether the task finished (done), its status (done, failed, max_steps or timeout), the result in words, each step, how many model calls it made, and its run_id.
Tasks started by text
When you text your bot’s own Allternit number and the bot starts a phone task from that text (source: "sms"), the bot texts short status lines back on the same thread, from the same number:
<task> is the task’s goal, cut to 40 characters. The link opens the Needs you inbox with that approval in view (https://ai.allternit.com/?allternit_inbox=approval:<id>).
- You can’t approve by text. Replying “yes” or “approve” does nothing to the approval. Approve or deny in the app, on any device.
- Status only. The texts never include what was on the phone’s screen, typed text or screenshots.
- Only the thread’s own number sends. If the thread’s number does not belong to that bot, or the number has no texting account, no status texts are sent. A failed text never stops the task.
- A refused task (a paused bot, or a thread you don’t own) sends no status texts.
Skills and App Maps
A skill is a fixed list of steps you saved from a run. An App Map is a set of screens your bot learns by itself as it works. Both replay with no model call, and both pass the same approvals as any other tap. Use a skill for one job you repeat. Maps help every task in an app. Stop now stops phone tasks, skill replays and Explore runs.Run history
Each phone tool call becomes one step in the history: the tool, its arguments, whether it worked, how long it took, and a screenshot when the call returned one. Steps that ran close together form one run. A run starts again after five minutes with no calls, and everyphone.task and every skill replay is its own run.
What is never stored:
- Text the bot typed, the body of a text message, and phone numbers. They are replaced with their length.
- Anything older than 30 days, and anything past the newest 500 steps per phone. Screenshots stop being kept once a phone’s history holds 100 MB of them.
Save a run as a skill
Ask the bot to save the run (“save that as a skill called dark-mode”), or callphone.save_skill with the run’s run_id and a name. To save only part of a run, give from_step and to_step. These are positions in the run, counting from 0.
Only the steps that acted on the phone are kept: taps, typing, swipes, keys, back, home, opening an app and find-and-tap. Screen reads and screenshots are not. For each tap, the skill remembers the element it landed on: its label, its resource id, its type, where it was on the screen and a tiny fingerprint of how it looked. When the screen read after the step showed something new, the skill also remembers that, as the step’s check.
Typed text is never part of a skill. Each typing step becomes an input (text1, text2, or the names you give with input_names), and every run passes the text again.
Skills never include texts or calls.
Replay a skill
Callphone.run_skill with the skill’s name, the phone, and its inputs. For each step, the replay reads the screen and looks for the step’s element:
- the same resource id and label;
- otherwise the one element with that label;
- otherwise the one element with that resource id;
- otherwise the one element in the same place that still looks the same.
diverged.
The result lists each step with how its element was found (id, name, resource, pixels, model or coordinates), and model_calls: 0 for a clean replay.
On an iPhone on a USB Agent, which has no screen read, taps replay at their recorded position.
Approvals during a replay
A replay stops at a step that pays, deletes, sends, calls or types a secret, the same as a task does, and waits for you in Needs you. Approve lets that step run once. Deny ends the replay. Saving a skill does not save an approval: each replay asks again. See Approvals for sensitive phone actions.Run a skill on a schedule
A routine can run a phone skill instead of sending its bot a message. Set the routine’s config to:serial is optional when only one phone is connected. The routine still belongs to a bot: if a step moved, the bot’s brain re-decides it. If the routine reaches a step that needs your approval and nobody answers within 5 minutes, the run stops and shows one item, “Routine stopped at a step that needs you”, with Retry. There is no standing permission that skips it. Each run is recorded like any other routine run, with the replayed steps as its output, and a replay that diverges counts as a failed run.
For developers
The API is served by the local allternit-api (cmd/allternit-api/src/phone_runs.rs, phone_replay.rs, phone_task.rs) under /api/v1, with the same sign-in as the computers routes. Replays and tasks reach the phone through Desktop’s phone gateway (~/.allternit/phone-gateway.json). Path serials are URL-encoded (link%3A…).
A step has
{id, run_id, serial, at, tool, label, args, ok, error?, duration_ms, ui?, target?, source?, thumbnail?, snapshot}. thumbnail is a small PNG data URL. source is bot, skill, task or routine. A run summary is {run_id, serial, started_at, ended_at, steps, failed, source, thumbnail}, newest first. For POST /phones/:serial/task, use the serial - to let Desktop pick the only connected phone. The task route answers 503 when Desktop’s phone gateway isn’t running.
Every recorded step also writes a phone.step row to the owner ledger, and every task or skill run that ends (from the route, a background run or a routine) writes phone.run.completed. The event forwarder (runtime_events.rs) sends them to the cloud, where they become Platform API webhooks. They carry ids, the tool, the label, ok, the error and timings, never frames, screen text or typed values. An unpaired runtime writes nothing. Developers reach these routes from their own servers through /v1/phones, which relays to this Desktop.
Desktop posts a history step after every phone tool call, without waiting for it (surfaces/allternit-desktop/src/main/phone-runs.ts). It strips typed text first, shrinks frames to 1280 px JPEG, and attaches the element a tap landed on from the bot’s last full screen read. Replays and tasks tag their gateway calls with _run_id and _source. Desktop drops those keys before running the tool.
Task and skill reports add tokens_in, tokens_out, map_steps, screenshots_sent and fallbacks, and phone.run.completed carries them. vision is auto or always; any other value is 400 invalid_args. Explore ends with phone.run.completed and source: "explore", with a report of screens and taps and a truncated reason when it stopped early. Maps are described in Phone App Maps.