Skip to main content

openadapt-types

Pydantic schemas for describing a screen and an action on it. Recorders emit them, the compiler stores and replays them, the grounding package resolves their targets, and the privacy package scrubs them. One definition, so nothing in the stack has to translate.

pip install openadapt-types

Optional, and not the product. If you want to record and replay a workflow, you want openadapt-flow instead; this is the contract underneath it, published separately for anyone building their own computer-use agent. The API is not stable across minor versions yet.

Describe a screen, then act on it

from openadapt_types import (
    Action, ActionTarget, ActionType,
    ComputerState, UINode, BoundingBox,
)

state = ComputerState(
    viewport=(1920, 1080),
    nodes=[
        UINode(node_id="n0", role="window", name="My App", children_ids=["n1"]),
        UINode(node_id="n1", role="button", name="Submit", parent_id="n0",
               bbox=BoundingBox(x=500, y=400, width=100, height=40)),
    ],
)

print(state.to_text_tree())
# [n0] window: My App
#   [n1] button: Submit

action = Action(
    type=ActionType.CLICK,
    target=ActionTarget(node_id="n1"),
    reasoning="Click Submit to proceed",
)

to_text_tree() exists so you can drop the element tree straight into a prompt.

Targeting

ActionTarget takes three kinds of answer to "which thing", and the runtime prefers them in this order:

ActionTarget(node_id="n1")                          # an element the recorder saw
ActionTarget(description="the blue submit button")  # resolved by the grounder
ActionTarget(x=550, y=420)                          # coordinates, last resort
ActionTarget(x=0.29, y=0.39, is_normalized=True)

An agent should produce a node_id or a description and let the runtime work out the pixels. Coordinates are the thing that breaks when a window moves.

The rest of the types

Type What it holds
ComputerState Screenshot, UI element graph, window context
UINode One element: role, bbox, hierarchy, platform anchors
Action A typed action plus its target
ActionResult The outcome, with an error taxonomy and a state delta
Episode / Step A whole trajectory: observation, action, result
FailureRecord A classified failure, for dataset pipelines

Plus the versioned wire contracts: ControlOverlayFrameV1/V2 and ControlOverlayTimelineV1/V2 for PHI-safe execution overlays, ExecuteRequestV1 / ExecuteStatusV1 / ExecuteEvidenceReceiptV1 for asynchronous qualified execution, EffectStrengthV1, and the BusinessDecision*V1 family for signed, finite human choices. What those contracts may and may not carry is in docs/CONTRACTS.md.

JSON Schema for everything else

import json
from openadapt_types import ComputerState

print(json.dumps(ComputerState.model_json_schema(), indent=2))

The same schemas ship as JSON under openadapt_types/schemas/ for TypeScript, Rust, and anything else that isn't Python. Seventeen files, including execute-v1-openapi.json, the public OpenAdapt Execute contract.

Converting from the older formats

from openadapt_types._compat import (
    from_benchmark_observation,   # openadapt-evals BenchmarkObservation
    from_benchmark_action,        # openadapt-evals BenchmarkAction
    from_ml_observation,          # openadapt-ml Observation
    from_ml_action,               # openadapt-ml Action
    from_omnimcp_screen_state,    # omnimcp ScreenState
    from_omnimcp_action_decision, # omnimcp ActionDecision
)

state = from_benchmark_observation(obs.__dict__)

OpenAdapt Execute

A partner sends an authorized request, gets an execution ID back, and then either reads a terminal receipt or waits for a signed webhook. The contract exposes no runner, no customer data, no evidence bytes, and no control-plane internals.

from openadapt_types import ExecuteClient

client = ExecuteClient(
    base_url="https://app.openadapt.ai/api",
    bearer_token="partner-provisioned-token",
)

The client requires HTTPS and refuses to follow a redirect before it would send the bearer token somewhere else. It also doesn't poll forever, deliberately: a workflow can sit waiting for a human decision or a reconciliation, so treat the terminal receipt or the signed webhook as the completion signal, not a timeout.

Reference Python and TypeScript clients: examples/execute.

Design

Pydantic v2, so you get runtime validation, JSON Schema export, and fast serialization. Pixels and structure are both captured, always, because either one alone loses information the other has. The node graph is the full element tree rather than the focused element. The same schema covers web, Windows, macOS, Linux, RDP, and Citrix/VDI. raw, attributes, and metadata fields exist everywhere so you can carry your own data through without forking.

The only dependency is pydantic>=2.0. No ML libraries.

License

MIT

Metadata

Release files for openadapt-types 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openadapt-types 0.11.0
File Size Uploaded
openadapt_types-0.11.0.tar.gz 154.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openadapt-types 0.11.0
File Interpreter ABI Platform
openadapt_types-0.11.0-py3-none-any.whl Python 3 none any Details

Total release size: 257.6 kB

Release files / openadapt_types-0.11.0.tar.gz

Download URL openadapt_types-0.11.0.tar.gz
Size 154.1 kB
Tags Source
SHA-256 checksum
How to use checksums
01e63ee7eb0c724b302de115203d39390c6d0e0abb7e2f2b5b66b938d2cb54d0
BLAKE2b-256 checksum
How to use checksums
b6791965200cd1ed1b6a6aad70a96b0f72f703a818fa11645ac7cb80095e65f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release files / openadapt_types-0.11.0-py3-none-any.whl

Download URL openadapt_types-0.11.0-py3-none-any.whl
Size 103.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a1c31cd8a8459cfd7f3143c0cf028944ab0ed9585dbe3659a57c9a6a2ddd040
BLAKE2b-256 checksum
How to use checksums
8e0bf7d44326f41b6133df20138eafbc6cfb189d793a1234dad5bcebf97e63da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.13.0

2 release files

0.12.0

2 release files

This release

0.11.0 This release

2 release files

0.10.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page