Agent run
An agent doing a job on the device, step by step: each tool call with its time, approval before anything risky runs, and the answer at the end.
- Apple Foundation Models: supported
- Gemini Nano: not supported
- Llama (not yet supported): not supported
- A cloud model: supported
- Tool calling runs on Apple's model or a cloud model. Gemini Nano's tool calling is still an alpha preview, so Ondai does not route tools to it yet.
Install
npx ondai add agent-runUsage
import { AgentRun } from '@/components/ondai/agent-run'
import { tool } from '@ondai/core'
import { z } from 'zod'
<AgentRun
goal="Find a quiet dinner spot near Priya’s office on Friday and invite her"
tools={{ searchPlaces, checkCalendar, createEvent }}
meta={{ createEvent: { title: 'Create the event and invite Priya', policy: 'ask', risk: 'medium' } }}
/>- Tools with
policy: 'ask'stop at an approval card before they run. - Built on
useToolAgent(); Apple and Gemini Nano run the tool loop on device.
Customize
Every AI component takes the same look and customization props, so it fits your app rather than ours.
<AgentRun
variant="pop"
tint="#FF5A5F"
size="lg"
radius={12}
icons={{ run: Search, again: null }}
labels={{ run: '…', cancel: '…' }}
/>| Prop | What it does |
|---|---|
variant | The look of the whole component: clean, minimal, glass, pop, candy, metal, shine |
size | sm, md, lg; type, rows, icons and keys scale together |
tint | Any colour; the variant paints its keys, tiles and glow in it |
radius | Corner radius of the container |
icons | Replace any icon (a lucide component, an element, or null to hide it): run, again, stepDone, stepRunning, stepError, stepCancelled, answer |
labels | Every visible and spoken string; defaults are exported as agentRunLabels: run, cancel, runAgain, idle, planning, nextStep, refusal, stopped |
| Slots | Draw a part yourself: renderStep, renderConfirm, renderAnswer, renderIdle, renderActions |
styles | Style any named part |
Variants
| Prop | Options |
|---|---|
variant | clean, minimal, glass, pop, candy, metal, shine |
presentation | card, plain |
size | sm, md, lg |
Fallback
When no provider is ready the component renders the unavailable state (AvailabilityGate copy) and, where a deterministic path exists, keeps working without the model.
Eval score
No model-driven fixtures for this component.
Files
Registry dependencies: button, on-device-badge, shimmer-text, surface, tool-confirm-card
npm dependencies: @ondai/core, @ondai/tokens, lucide-react-native, react-native-reanimated
Inline suggest
A text field that offers the rest of the sentence as ghost text while the person types, from the on-device model. Tab or the Add key takes it.
Voice memo
Talk, and get the memo back as something to act on: a title, a two-line summary and the to-dos you mentioned, ticked and ready to add. All on device.











