API reference · Objects
Objects
The three shapes every agent deals with: a Device (what can be done), a Command (what is happening) and its Verification (how sure we are).
On this page
Device
Returned by get_device; list_devices returns the first four fields only.
| Field | Type | Meaning |
|---|---|---|
| device_id | string | Opaque, stable id |
| alias | string | null | User-chosen name |
| kind | string | air_conditioner, smart_plug, light, lock, vehicle, dishwasher, oven, speaker, climate_sensor, … |
| connection_status | enum | online · offline · unknown |
| model | string | null | Manufacturer model name when known, e.g. Tapo P115 |
| control_path | enum | manufacturer_cloud · plug_cloud · local_helper |
| capabilities[] | Capability[] | id, version, kind (read · set · execute · event), input_schema, output_schema, approval, idempotent, preconditions, completion_rule, verification, last_execution, last_verified_at |
- device_id
- Typestring
- MeaningOpaque, stable id
- alias
- Typestring | null
- MeaningUser-chosen name
- kind
- Typestring
- Meaning
air_conditioner,smart_plug,light,lock,vehicle,dishwasher,oven,speaker,climate_sensor, …
- connection_status
- Typeenum
- Meaning
online·offline·unknown
- model
- Typestring | null
- MeaningManufacturer model name when known, e.g.
Tapo P115
- control_path
- Typeenum
- Meaning
manufacturer_cloud·plug_cloud·local_helper
- capabilities[]
- TypeCapability[]
- Meaning
id,version,kind(read · set · execute · event),input_schema,output_schema,approval,idempotent,preconditions,completion_rule,verification,last_execution,last_verified_at
Command
Returned by execute_device_action, get_command_status and cancel_command, and embedded in schedule runs.
| Field | Type | Meaning |
|---|---|---|
| command_id | string | null | null only on tool errors |
| status | enum | waiting_approval queued dispatching provider_accepted verifying succeeded rejected failed cancelled expired outcome_unknown |
| reason_code | enum | null | Set on rejected, failed, cancelled, expired, outcome_unknown. See reason codes |
| device_id · action · parameters | Exactly what was stored; the approval page shows these same values | |
| verification | Verification | Below |
| approval | object | null | approval_id, url, expires_at while waiting |
| next_action | object | type (poll_command_status · open_approval_url · show_result · show_unknown) and a user-safe message |
| next_poll_after_ms | integer | null | Suggested wait before polling |
| expires_at | string | After this the command cannot be sent any more |
| approval_channel · approval_channel_reason | enum · string | How approval was (or will be) handled |
- command_id
- Typestring | null
- Meaning
nullonly on tool errors
- status
- Typeenum
- Meaning
waiting_approvalqueueddispatchingprovider_acceptedverifyingsucceededrejectedfailedcancelledexpiredoutcome_unknown
- reason_code
- Typeenum | null
- MeaningSet on
rejected,failed,cancelled,expired,outcome_unknown. See reason codes
- device_id · action · parameters
- Type
- MeaningExactly what was stored; the approval page shows these same values
- verification
- TypeVerification
- MeaningBelow
- approval
- Typeobject | null
- Meaning
approval_id,url,expires_atwhile waiting
- next_action
- Typeobject
- Meaning
type(poll_command_status·open_approval_url·show_result·show_unknown) and a user-safemessage
- next_poll_after_ms
- Typeinteger | null
- MeaningSuggested wait before polling
- expires_at
- Typestring
- MeaningAfter this the command cannot be sent any more
- approval_channel · approval_channel_reason
- Typeenum · string
- MeaningHow approval was (or will be) handled
Verification
The evidence behind a status. succeeded is only set when level satisfies required_level; levels are never compared numerically, only by rule.
| Field | Values | Meaning |
|---|---|---|
| level | none · provider_ack · provider_completed · state_observed | What has been confirmed so far |
| required_level | provider_completed · state_observed | What this action needs to count as done |
| provider_status | unknown · accepted · completed · failed | What the manufacturer said about the request |
| target_match | not_checked · matched · not_matched | Whether the observed attribute equals the requested value |
| source | manufacturer_command · device_state · manufacturer_state · plug_state · null | Where the evidence came from |
| observed_at · deadline_at | ISO time | null | When the evidence was observed, and until when the worker keeps checking before outcome_unknown |
- level
- Values
none·provider_ack·provider_completed·state_observed - MeaningWhat has been confirmed so far
- required_level
- Values
provider_completed·state_observed - MeaningWhat this action needs to count as done
- provider_status
- Values
unknown·accepted·completed·failed - MeaningWhat the manufacturer said about the request
- target_match
- Values
not_checked·matched·not_matched - MeaningWhether the observed attribute equals the requested value
- source
- Values
manufacturer_command·device_state·manufacturer_state·plug_state· null - MeaningWhere the evidence came from
- observed_at · deadline_at
- ValuesISO time | null
- MeaningWhen the evidence was observed, and until when the worker keeps checking before
outcome_unknown
Details and examples: Verification levels.